Skip to content

Feature/examples search filter #74

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
Nov 20, 2018
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4,436 changes: 2,218 additions & 2,218 deletions package-lock.json

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions packages/context/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion packages/forms/examples/forms/forms.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
DatepickerModule,
MaskModule,
RangeSliderModule,
SearchFilterModule,
TimepickerModule,
WysiwygModule,
} from '@acpaas-ui/ngx-components/forms';
Expand All @@ -33,7 +34,8 @@ import { Pages } from './pages/index';
FormsModule,
AutoCompleteModule,
CodeSnippetModule,
MaskModule,
MaskModule,
SearchFilterModule,
TimepickerModule,
WysiwygModule,
],
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,30 @@
<h2 class="h4 u-margin-bottom">Search filter</h2>

<div class="u-margin-bottom-lg">
<aui-code-snippet [codeSnippet]="searchfilterImportExample"></aui-code-snippet>
</div>

<h3 class="h5 u-margin-bottom">Basic</h3>

<div class="u-margin-bottom">
<aui-code-snippet [codeSnippet]="searchfilterExampleJS1"></aui-code-snippet>
</div>

<div class="u-margin-bottom-lg">
<aui-code-snippet [codeSnippet]="searchfilterExampleHTML1"></aui-code-snippet>
</div>

<div class="u-margin-bottom-xx">
<aui-search-filter
id="test"
name="test"
label="Find stuff"
labelDeselect="Clear stuff"
labelResults="Found stuff"
labelNoResults="Couldn't find stuff!"
placeholder="Look for stuff"
inputDelay="0"
[choices]="stuff"
[showAllByDefault]="true">
</aui-search-filter>
</div>
Original file line number Diff line number Diff line change
@@ -1,7 +1,60 @@
import { Component } from '@angular/core';
import { SearchFilterChoice } from '@acpaas-ui/ngx-components/forms';

@Component({
templateUrl: './search-filter.page.html',
})
export class FormsSearchFilterDemoPageComponent {

public stuff: SearchFilterChoice[] = [{
label: "First item",
value: "one",
}, {
label: "Second item",
value: "two",
}, {
label: "Third item",
value: "three",
}, {
label: "Fourth item",
value: "four",
}];

public searchfilterImportExample = `import { SearchFilterModule } from '@acpaas-ui/ngx-components/forms';

@NgModule({
imports: [
SearchFilterModule,
]
});

export class AppModule {};`;

public searchfilterExampleJS1 = `public stuff: SearchFilterChoice[] = [{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can add import { SearchFilterChoice } from '@acpaas-ui/ngx-components/forms'; here.

label: "First item",
value: "one",
}, {
label: "Second item",
value: "two",
}, {
label: "Third item",
value: "three",
}, {
label: "Fourth item",
value: "four",
}];`;

public searchfilterExampleHTML1 = `<aui-search-filter
id="test"
name="test"
label="Find stuff"
labelDeselect="Clear stuff"
labelResults="Found stuff"
labelNoResults="Couldn't find stuff!"
placeholder="Look for stuff"
inputDelay="0"
[choices]="stuff"
[showAllByDefault]="true">
</aui-search-filter>`;

}
83 changes: 83 additions & 0 deletions packages/forms/src/lib/search-filter/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# @acpaas-ui/ngx-components/forms

The search-filter is a JIRA-like filter component with remote search capabilities.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

search filter (without hyphen).


## Usage

```typescript
import { SearchFilterModule } from '@acpaas-ui/ngx-components/search-filter'`;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.../forms 😉

```

## Documentation

Visit our [documentation site](https://acpaas-ui.digipolis.be/) for full how-to docs and guidelines

### API

| Name | Default value | Description |
| ----------- | ------ | -------------------------- |
| `@Input() id: string;` | - | Field id. |
| `@Input() name: string;` | - | Field name. |
| `@Input() flyoutSize: enum;` | `FlyoutSize.Small` | Passed along to `auiFlyout`. |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps describe it a bit more. It's straight forward, but you can copy some content from the flyout.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: maybe it's better to provide link to the appropriate documentation?

| `@Input() flyoutAlign: string;` | `'left'` | Passed along to `auiFlyout`. |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here ;-)

| `@Input() label: string;` | `'Filter'` | Field label. |
| `@Input() labelDeselect: string;` | `'Alles deselecteren'` | Clear button text. |
| `@Input() labelResults: string;` | `'Resultaten'` | Result list header text. |
| `@Input() labelNoResults: string;` | `'Geen resultaten gevonden.'` | Text shown when no results are found. |
| `@Input() choices: SearchFilterChoice[];` | - | Available choices. |
| `@Input() remote: boolean;` | `false` | Enable remote searching. |
| `@Input() placeholder: string;` | `'Zoeken'` | Search field placeholder text. |
| `@Input() inputDelay: string;` | `'150'` | Delay the search callback on the input field. |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this really a string? Then we should list it in our technical debt document.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no number when verifying in the new components. Older readme had a wrong type defined.

| `@Input() showAllByDefault: boolean;` | `false` | Show all items on init, will trigger a search when `remote` is `true`. |
| `@Output() search: Event<string>;` | - | Callback triggered when `remote` is true. |

### Example

```typescript
import { SearchFilterModule } from '@acpaas-ui/ngx-components/forms';

@NgModule({
imports: [
SearchFilterModule,
]
});

export class AppModule {};
```

#### Basic

```typescript
public stuff: SearchFilterChoice[] = [{
label: "First item",
value: "one",
}, {
label: "Second item",
value: "two",
}, {
label: "Third item",
value: "three",
}, {
label: "Fourth item",
value: "four",
}];
```

```html
<aui-search-filter
id="test"
name="test"
label="Find stuff"
labelDeselect="Clear stuff"
labelResults="Found stuff"
labelNoResults="Couldn't find stuff!"
placeholder="Look for stuff"
inputDelay="0"
[choices]="stuff"
[showAllByDefault]="true">
</aui-search-filter>
```

## Contributing

Visit our [Contribution Guidelines](../../../../../CONTRIBUTING.md) for more information on how to contribute.
Loading