-
Notifications
You must be signed in to change notification settings - Fork 18
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
Changes from 4 commits
96c8027
f6a7461
b3f9bbf
08d8b7e
fe953e1
df204aa
0924b0f
cc5ef00
cb4b3a6
df09947
a7511c4
b32eb85
f18beb8
6cc3e63
744dc11
50fe6c1
f7e5e0b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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[] = [{ | ||
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>`; | ||
|
||
} |
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. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
## Usage | ||
|
||
```typescript | ||
import { SearchFilterModule } from '@acpaas-ui/ngx-components/search-filter'`; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
``` | ||
|
||
## 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`. | | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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`. | | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. | | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
There was a problem hiding this comment.
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.