@kubex/zinc 1.0.24 → 1.0.98
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/project.md +556 -0
- package/.github/workflows/js_build_and_deploy.yaml +9 -10
- package/dist/custom-elements.json +13431 -8728
- package/dist/vscode.html-custom-data.json +571 -37
- package/dist/web-types.json +1439 -181
- package/dist/zn.d.ts +1642 -661
- package/dist/zn.min.css +1 -1
- package/dist/zn.min.js +1407 -887
- package/docs/_utilities/code-previews.cjs +10 -1
- package/docs/assets/scripts/docs.js +42 -18
- package/docs/data/data-table.json +229 -66
- package/docs/data/empty.json +6 -0
- package/docs/data/products-table.json +41 -193
- package/docs/pages/components/action-bar.md +121 -6
- package/docs/pages/components/alert.md +118 -15
- package/docs/pages/components/animated-button.md +299 -0
- package/docs/pages/components/audio-select.md +534 -0
- package/docs/pages/components/bulk-actions.md +79 -5
- package/docs/pages/components/button-group.md +235 -27
- package/docs/pages/components/button.md +139 -1
- package/docs/pages/components/chart.md +365 -9
- package/docs/pages/components/checkbox.md +387 -58
- package/docs/pages/components/chip.md +253 -33
- package/docs/pages/components/collapsible.md +393 -46
- package/docs/pages/components/cols.md +152 -30
- package/docs/pages/components/confirm.md +182 -16
- package/docs/pages/components/copy-button.md +169 -6
- package/docs/pages/components/data-select.md +194 -15
- package/docs/pages/components/data-table-filter.md +96 -5
- package/docs/pages/components/data-table-search.md +451 -0
- package/docs/pages/components/data-table-sort.md +66 -5
- package/docs/pages/components/data-table.md +727 -66
- package/docs/pages/components/datepicker.md +402 -7
- package/docs/pages/components/defined-label.md +120 -5
- package/docs/pages/components/dialog.md +339 -59
- package/docs/pages/components/dropdown.md +366 -11
- package/docs/pages/components/editor.md +604 -7
- package/docs/pages/components/empty-state.md +315 -16
- package/docs/pages/components/expanding-action.md +212 -28
- package/docs/pages/components/file.md +421 -12
- package/docs/pages/components/filter-container.md +158 -5
- package/docs/pages/components/filter-wrapper.md +167 -6
- package/docs/pages/components/form-group.md +383 -6
- package/docs/pages/components/hover-container.md +237 -6
- package/docs/pages/components/icon-picker.md +121 -0
- package/docs/pages/components/icon.md +454 -48
- package/docs/pages/components/inline-edit.md +787 -19
- package/docs/pages/components/input-group.md +207 -13
- package/docs/pages/components/input.md +194 -0
- package/docs/pages/components/key-container.md +115 -0
- package/docs/pages/components/key.md +101 -0
- package/docs/pages/components/menu.md +512 -6
- package/docs/pages/components/note.md +239 -36
- package/docs/pages/components/opt-group.md +107 -0
- package/docs/pages/components/pagination.md +332 -6
- package/docs/pages/components/pane.md +222 -6
- package/docs/pages/components/panel.md +213 -26
- package/docs/pages/components/popup.md +1354 -6
- package/docs/pages/components/priority-list.md +233 -0
- package/docs/pages/components/progress-bar.md +387 -6
- package/docs/pages/components/radio-group.md +242 -5
- package/docs/pages/components/radio.md +474 -6
- package/docs/pages/components/rating.md +331 -7
- package/docs/pages/components/reveal.md +524 -6
- package/docs/pages/components/scroll-container.md +552 -6
- package/docs/pages/components/select.md +762 -160
- package/docs/pages/components/skeleton.md +473 -30
- package/docs/pages/components/slideout.md +261 -5
- package/docs/pages/components/sp.md +99 -41
- package/docs/pages/components/split-button.md +347 -9
- package/docs/pages/components/split-pane.md +445 -6
- package/docs/pages/components/stat.md +549 -9
- package/docs/pages/components/status-indicator.md +230 -1
- package/docs/pages/components/stepper.md +563 -6
- package/docs/pages/components/tabs.md +439 -13
- package/docs/pages/components/textarea.md +415 -17
- package/docs/pages/components/tile.md +385 -26
- package/docs/pages/components/toggle.md +424 -6
- package/docs/pages/components/tooltip.md +367 -0
- package/docs/pages/components/translation-group.md +210 -0
- package/docs/pages/components/translations.md +319 -18
- package/docs/pages/components/vertical-stepper.md +401 -8
- package/docs/pages/components/well.md +300 -3
- package/docs/pages/getting-started/form-controls.md +162 -0
- package/docs/pages/index.md +116 -15
- package/package.json +5 -6
- package/scss/_global-spacing.scss +4 -0
- package/scss/_root.scss +2 -2
- package/scss/boot.scss +19 -0
- package/scss/shared/layout.scss +5 -0
- package/scss/themes/_light.scss +3 -3
- package/src/components/alert/alert.scss +1 -0
- package/src/components/animated-button/README.md +306 -0
- package/src/components/animated-button/animated-button.component.ts +229 -0
- package/src/components/animated-button/animated-button.scss +228 -0
- package/src/components/animated-button/animated-button.test.ts +143 -0
- package/src/components/animated-button/index.ts +12 -0
- package/src/components/button/button.component.ts +5 -0
- package/src/components/button-group/button-group.component.ts +25 -13
- package/src/components/button-group/button-group.scss +6 -0
- package/src/components/checkbox/checkbox.component.ts +4 -0
- package/src/components/checkbox/checkbox.scss +7 -4
- package/src/components/checkbox-group/checkbox-group.scss +7 -0
- package/src/components/chip/chip.component.ts +7 -2
- package/src/components/chip/chip.scss +16 -2
- package/src/components/collapsible/collapsible.component.ts +27 -20
- package/src/components/cols/cols.component.ts +14 -2
- package/src/components/cols/cols.scss +6 -12
- package/src/components/confirm/confirm.component.ts +7 -0
- package/src/components/copy-button/copy-button.component.ts +12 -11
- package/src/components/data-select/data-select.component.ts +215 -44
- package/src/components/data-select/data-select.scss +66 -6
- package/src/components/data-select/providers/currency-data-provider.ts +20 -6
- package/src/components/data-select/providers/provider.ts +1 -0
- package/src/components/data-select/providers/us-state-data-provider.ts +68 -0
- package/src/components/data-table/data-table.component.ts +82 -23
- package/src/components/data-table-search/data-table-search.component.ts +184 -0
- package/src/components/data-table-search/data-table-search.scss +17 -0
- package/src/components/data-table-search/data-table-search.test.ts +11 -0
- package/src/components/data-table-search/index.ts +12 -0
- package/src/components/datepicker/datepicker.component.ts +347 -13
- package/src/components/dialog/dialog.component.ts +1 -1
- package/src/components/empty-state/empty-state.scss +6 -1
- package/src/components/header/header.scss +3 -3
- package/src/components/icon/icon.component.ts +23 -1
- package/src/components/icon/icon.scss +23 -0
- package/src/components/icon-picker/brand-icons.ts +24 -0
- package/src/components/icon-picker/icon-picker.component.ts +407 -0
- package/src/components/icon-picker/icon-picker.scss +205 -0
- package/src/components/icon-picker/index.ts +12 -0
- package/src/components/icon-picker/line-icons.ts +612 -0
- package/src/components/icon-picker/material-icons.ts +14543 -0
- package/src/components/inline-edit/inline-edit.component.ts +190 -46
- package/src/components/inline-edit/inline-edit.scss +29 -0
- package/src/components/inline-edit/inline-edit.test.ts +314 -1
- package/src/components/input/input.component.ts +328 -5
- package/src/components/input/input.scss +100 -4
- package/src/components/input-group/input-group.component.ts +28 -7
- package/src/components/input-group/input-group.scss +48 -10
- package/src/components/item/item.component.ts +11 -2
- package/src/components/item/item.scss +7 -0
- package/src/components/key/index.ts +12 -0
- package/src/components/key/key.component.ts +47 -0
- package/src/components/key/key.scss +38 -0
- package/src/components/key-container/index.ts +12 -0
- package/src/components/key-container/key-container.component.ts +142 -0
- package/src/components/key-container/key-container.scss +33 -0
- package/src/components/menu-item/menu-item.component.ts +20 -0
- package/src/components/menu-item/menu-item.scss +69 -2
- package/src/components/navbar/navbar.component.ts +103 -8
- package/src/components/navbar/navbar.scss +6 -1
- package/src/components/opt-group/index.ts +12 -0
- package/src/components/opt-group/opt-group.component.ts +74 -0
- package/src/components/opt-group/opt-group.scss +37 -0
- package/src/components/opt-group/opt-group.test.ts +27 -0
- package/src/components/option/option.component.ts +1 -16
- package/src/components/option/option.scss +4 -0
- package/src/components/panel/panel.component.ts +10 -8
- package/src/components/panel/panel.scss +20 -0
- package/src/components/priority-list/index.ts +12 -0
- package/src/components/priority-list/priority-list.component.ts +611 -0
- package/src/components/priority-list/priority-list.scss +185 -0
- package/src/components/priority-list/priority-list.test.ts +139 -0
- package/src/components/progress-bar/progress-bar.component.ts +22 -16
- package/src/components/radio/radio.scss +10 -3
- package/src/components/select/select.component.ts +812 -72
- package/src/components/select/select.scss +108 -2
- package/src/components/select/select.test.ts +147 -2
- package/src/components/settings-container/settings-container.component.ts +44 -19
- package/src/components/settings-container/settings-container.scss +1 -1
- package/src/components/skeleton/skeleton.component.ts +6 -1
- package/src/components/slideout/slideout.scss +8 -3
- package/src/components/sp/sp.component.ts +3 -1
- package/src/components/sp/sp.scss +19 -0
- package/src/components/stepper/stepper.component.ts +16 -10
- package/src/components/textarea/textarea.scss +0 -4
- package/src/components/tile/tile.component.ts +12 -3
- package/src/components/tile/tile.scss +1 -1
- package/src/components/timer/timer.component.ts +15 -2
- package/src/components/toggle/toggle.component.ts +29 -26
- package/src/components/toggle/toggle.scss +13 -1
- package/src/components/translation-group/index.ts +12 -0
- package/src/components/translation-group/translation-group.component.ts +207 -0
- package/src/components/translation-group/translation-group.scss +8 -0
- package/src/components/translations/translations.component.ts +90 -42
- package/src/components/translations/translations.scss +5 -1
- package/src/components/vertical-stepper/vertical-stepper.component.ts +14 -9
- package/src/events/events.ts +12 -7
- package/src/events/zn-language-change.ts +7 -0
- package/src/events/zn-purchase.ts +11 -0
- package/src/events/zn-redirect.ts +7 -0
- package/src/events/zn-reorder.ts +7 -0
- package/src/events/zn-search-change.ts +11 -0
- package/src/events/zn-submit.ts +1 -1
- package/src/form-control.scss +4 -0
- package/src/internal/form-navigation.ts +510 -0
- package/src/internal/form.ts +6 -0
- package/src/zinc.ts +91 -83
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
meta:
|
|
3
3
|
title: Data Select
|
|
4
|
-
description:
|
|
4
|
+
description: A select component with built-in data providers for common options like countries, currencies, colors, and phone prefixes. Supports icons, filtering, multiple selection, and all standard select features.
|
|
5
5
|
layout: component
|
|
6
6
|
---
|
|
7
7
|
|
|
@@ -16,49 +16,228 @@ layout: component
|
|
|
16
16
|
|
|
17
17
|
## Examples
|
|
18
18
|
|
|
19
|
-
###
|
|
19
|
+
### Data Providers
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
The component includes built-in providers for common data types.
|
|
22
22
|
|
|
23
23
|
```html:preview
|
|
24
|
+
<div class="form-spacing">
|
|
25
|
+
<zn-data-select label="Country" provider="country" name="country"></zn-data-select>
|
|
26
|
+
<zn-data-select label="Currency" provider="currency" name="currency"></zn-data-select>
|
|
27
|
+
<zn-data-select label="Color" provider="color" name="color"></zn-data-select>
|
|
28
|
+
<zn-data-select label="Phone Prefix" provider="phone" name="phone"></zn-data-select>
|
|
29
|
+
</div>
|
|
30
|
+
```
|
|
24
31
|
|
|
32
|
+
### With Default Values
|
|
33
|
+
|
|
34
|
+
Set a default selected value using the `value` attribute.
|
|
35
|
+
|
|
36
|
+
```html:preview
|
|
25
37
|
<div class="form-spacing">
|
|
26
|
-
<zn-data-select provider="country" name="country" value="GB"
|
|
27
|
-
<zn-data-select provider="
|
|
38
|
+
<zn-data-select label="Country" provider="country" name="country" value="GB"></zn-data-select>
|
|
39
|
+
<zn-data-select label="Currency" provider="currency" name="currency" value="USD"></zn-data-select>
|
|
40
|
+
<zn-data-select label="Color" provider="color" name="color" value="blue"></zn-data-select>
|
|
41
|
+
</div>
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Icon Position
|
|
45
|
+
|
|
46
|
+
Control where the icon appears using the `icon-position` attribute. Options are `start`, `end`, or `none` (default).
|
|
47
|
+
|
|
48
|
+
```html:preview
|
|
49
|
+
<div class="form-spacing">
|
|
50
|
+
<zn-data-select label="Icon at Start" provider="country" name="country" value="GB" icon-position="start"></zn-data-select>
|
|
51
|
+
<zn-data-select label="Icon at End" provider="country" name="country" value="US" icon-position="end"></zn-data-select>
|
|
52
|
+
<zn-data-select label="No Icon" provider="country" name="country" value="FR" icon-position="none"></zn-data-select>
|
|
28
53
|
</div>
|
|
29
54
|
```
|
|
30
55
|
|
|
31
56
|
### Icon Only
|
|
32
57
|
|
|
33
|
-
|
|
58
|
+
Display only the icon without text using the `icon-only` attribute.
|
|
34
59
|
|
|
35
60
|
```html:preview
|
|
36
61
|
<div class="form-spacing">
|
|
37
62
|
<zn-data-select provider="color" name="color" value="red" icon-only></zn-data-select>
|
|
63
|
+
<zn-data-select provider="country" name="country" value="GB" icon-only></zn-data-select>
|
|
64
|
+
<zn-data-select provider="currency" name="currency" value="USD" icon-only></zn-data-select>
|
|
65
|
+
</div>
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### Multiple Selection
|
|
69
|
+
|
|
70
|
+
Allow selecting multiple options using the `multiple` attribute.
|
|
71
|
+
|
|
72
|
+
```html:preview
|
|
73
|
+
<div class="form-spacing">
|
|
74
|
+
<zn-data-select label="Countries" provider="country" name="countries" multiple></zn-data-select>
|
|
75
|
+
<zn-data-select label="Currencies" provider="currency" name="currencies" multiple></zn-data-select>
|
|
76
|
+
<zn-data-select label="Colors" provider="color" name="colors" multiple></zn-data-select>
|
|
38
77
|
</div>
|
|
39
78
|
```
|
|
40
79
|
|
|
41
80
|
### Clearable
|
|
42
81
|
|
|
82
|
+
Add a clear button to reset the selection using the `clearable` attribute.
|
|
83
|
+
|
|
43
84
|
```html:preview
|
|
85
|
+
<div class="form-spacing">
|
|
86
|
+
<zn-data-select label="Country" provider="country" name="country" value="GB" clearable></zn-data-select>
|
|
87
|
+
<zn-data-select label="Currency" provider="currency" name="currency" value="USD" clearable></zn-data-select>
|
|
88
|
+
<zn-data-select label="Color" provider="color" name="color" value="blue" clearable></zn-data-select>
|
|
89
|
+
</div>
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Filtered Options
|
|
44
93
|
|
|
94
|
+
Use the `filter` attribute to show only specific options from the provider.
|
|
95
|
+
|
|
96
|
+
```html:preview
|
|
45
97
|
<div class="form-spacing">
|
|
46
|
-
<zn-data-select provider="country" name="country"
|
|
47
|
-
<zn-data-select provider="currency" name="currency"
|
|
48
|
-
<zn-data-select provider="color" name="color"
|
|
98
|
+
<zn-data-select label="Major Countries" provider="country" name="country" filter="gb,us,fr,de,jp,cn"></zn-data-select>
|
|
99
|
+
<zn-data-select label="Common Currencies" provider="currency" name="currency" filter="gbp,usd,eur,jpy"></zn-data-select>
|
|
100
|
+
<zn-data-select label="Primary Colors" provider="color" name="color" filter="red,green,blue"></zn-data-select>
|
|
49
101
|
</div>
|
|
50
102
|
```
|
|
51
103
|
|
|
52
|
-
###
|
|
104
|
+
### Sizes
|
|
53
105
|
|
|
54
|
-
|
|
55
|
-
results.
|
|
106
|
+
Control the size of the select using the `size` attribute.
|
|
56
107
|
|
|
57
108
|
```html:preview
|
|
109
|
+
<div class="form-spacing">
|
|
110
|
+
<zn-data-select label="Small" provider="country" name="country" size="small" value="GB"></zn-data-select>
|
|
111
|
+
<zn-data-select label="Medium" provider="country" name="country" size="medium" value="US"></zn-data-select>
|
|
112
|
+
<zn-data-select label="Large" provider="country" name="country" size="large" value="FR"></zn-data-select>
|
|
113
|
+
</div>
|
|
114
|
+
```
|
|
58
115
|
|
|
116
|
+
### With Help Text
|
|
117
|
+
|
|
118
|
+
Provide additional context using the `help-text` attribute.
|
|
119
|
+
|
|
120
|
+
```html:preview
|
|
59
121
|
<div class="form-spacing">
|
|
60
|
-
<zn-data-select
|
|
61
|
-
|
|
62
|
-
|
|
122
|
+
<zn-data-select label="Country"
|
|
123
|
+
provider="country"
|
|
124
|
+
name="country"
|
|
125
|
+
help-text="Select your country of residence"></zn-data-select>
|
|
63
126
|
</div>
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### Required Field
|
|
130
|
+
|
|
131
|
+
Mark fields as required using the `required` attribute.
|
|
132
|
+
|
|
133
|
+
```html:preview
|
|
134
|
+
<form>
|
|
135
|
+
<div class="form-spacing">
|
|
136
|
+
<zn-data-select label="Country" provider="country" name="country" required></zn-data-select>
|
|
137
|
+
<zn-data-select label="Currency" provider="currency" name="currency" required></zn-data-select>
|
|
138
|
+
<zn-button type="submit" color="success">Submit</zn-button>
|
|
139
|
+
</div>
|
|
140
|
+
</form>
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### Disabled State
|
|
144
|
+
|
|
145
|
+
Disable the select using the `disabled` attribute.
|
|
146
|
+
|
|
147
|
+
```html:preview
|
|
148
|
+
<div class="form-spacing">
|
|
149
|
+
<zn-data-select label="Country" provider="country" name="country" value="GB" disabled></zn-data-select>
|
|
150
|
+
<zn-data-select label="Currency" provider="currency" name="currency" value="USD" disabled></zn-data-select>
|
|
151
|
+
</div>
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### With Label Tooltip
|
|
155
|
+
|
|
156
|
+
Add a tooltip to the label using the `label-tooltip` attribute.
|
|
157
|
+
|
|
158
|
+
```html:preview
|
|
159
|
+
<div class="form-spacing">
|
|
160
|
+
<zn-data-select label="Country"
|
|
161
|
+
provider="country"
|
|
162
|
+
name="country"
|
|
163
|
+
label-tooltip="This is used for shipping and tax calculations"></zn-data-select>
|
|
164
|
+
</div>
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
### With Context Note
|
|
168
|
+
|
|
169
|
+
Add contextual information using the `context-note` attribute.
|
|
170
|
+
|
|
171
|
+
```html:preview
|
|
172
|
+
<div class="form-spacing">
|
|
173
|
+
<zn-data-select label="Currency"
|
|
174
|
+
provider="currency"
|
|
175
|
+
name="currency"
|
|
176
|
+
context-note="Optional"></zn-data-select>
|
|
177
|
+
</div>
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
### Placement Options
|
|
181
|
+
|
|
182
|
+
Control where the dropdown menu appears using the `placement` attribute.
|
|
183
|
+
|
|
184
|
+
```html:preview
|
|
185
|
+
<div class="form-spacing">
|
|
186
|
+
<zn-data-select label="Opens Below" provider="country" name="country" placement="bottom"></zn-data-select>
|
|
187
|
+
<zn-data-select label="Opens Above" provider="country" name="country" placement="top"></zn-data-select>
|
|
188
|
+
</div>
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
### Allow All Option
|
|
192
|
+
|
|
193
|
+
Include an "All" option at the top of the list using the `allow-all` attribute.
|
|
194
|
+
|
|
195
|
+
```html:preview
|
|
196
|
+
<div class="form-spacing">
|
|
197
|
+
<zn-data-select label="Country" provider="country" name="country" allow-all></zn-data-select>
|
|
198
|
+
<zn-data-select label="Currency" provider="currency" name="currency" allow-all></zn-data-select>
|
|
199
|
+
</div>
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
### Common Currencies
|
|
203
|
+
|
|
204
|
+
For the currency provider, use `allow-common` to include a "Common Currencies" option.
|
|
205
|
+
|
|
206
|
+
```html:preview
|
|
207
|
+
<div class="form-spacing">
|
|
208
|
+
<zn-data-select label="Currency" provider="currency" name="currency" allow-common></zn-data-select>
|
|
209
|
+
</div>
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
### Complete Form Example
|
|
213
|
+
|
|
214
|
+
A complete form using data-select components.
|
|
215
|
+
|
|
216
|
+
```html:preview
|
|
217
|
+
<form>
|
|
218
|
+
<div class="form-spacing">
|
|
219
|
+
<zn-data-select label="Country"
|
|
220
|
+
provider="country"
|
|
221
|
+
name="country"
|
|
222
|
+
required
|
|
223
|
+
clearable
|
|
224
|
+
icon-position="start"
|
|
225
|
+
help-text="Select your country"></zn-data-select>
|
|
226
|
+
|
|
227
|
+
<zn-data-select label="Currency"
|
|
228
|
+
provider="currency"
|
|
229
|
+
name="currency"
|
|
230
|
+
required
|
|
231
|
+
clearable
|
|
232
|
+
help-text="Preferred currency for transactions"></zn-data-select>
|
|
233
|
+
|
|
234
|
+
<zn-data-select label="Accent Color"
|
|
235
|
+
provider="color"
|
|
236
|
+
name="color"
|
|
237
|
+
icon-position="start"
|
|
238
|
+
help-text="Choose your preferred theme color"></zn-data-select>
|
|
239
|
+
|
|
240
|
+
<zn-button type="submit" color="success">Save Preferences</zn-button>
|
|
241
|
+
</div>
|
|
242
|
+
</form>
|
|
64
243
|
```
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
meta:
|
|
3
3
|
title: Data Table Filter
|
|
4
|
-
description:
|
|
4
|
+
description: A comprehensive filtering component that opens a slideout panel with a query builder interface. Supports text, number, date fields, dropdown options, and multiple filter operators.
|
|
5
5
|
layout: component
|
|
6
6
|
---
|
|
7
7
|
|
|
@@ -14,10 +14,101 @@ layout: component
|
|
|
14
14
|
|
|
15
15
|
## Examples
|
|
16
16
|
|
|
17
|
-
###
|
|
17
|
+
### Basic Text Filters
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
Create simple text-based filters with equality and fuzzy search operators.
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
```html:preview
|
|
22
|
+
<zn-data-table-filter
|
|
23
|
+
filters="[{"id":"name","name":"Name","operators":["eq","fuzzy"]},{"id":"email","name":"Email","operators":["eq","fuzzy"]},{"id":"company","name":"Company","operators":["eq"]}]"
|
|
24
|
+
name="text-filters">
|
|
25
|
+
</zn-data-table-filter>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Number Filters with Operators
|
|
29
|
+
|
|
30
|
+
Use number type filters with comparison operators like equal, greater than, less than.
|
|
31
|
+
|
|
32
|
+
```html:preview
|
|
33
|
+
<zn-data-table-filter
|
|
34
|
+
filters="[{"id":"age","name":"Age","type":"number","operators":["eq","gt","gte","lt","lte"]},{"id":"price","name":"Price","type":"number","operators":["eq","gt","lt"]},{"id":"quantity","name":"Quantity","type":"number","operators":["eq","gte","lte"]}]"
|
|
35
|
+
name="number-filters">
|
|
36
|
+
</zn-data-table-filter>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Date Filters
|
|
40
|
+
|
|
41
|
+
Filter by dates with before, after, and equal operators.
|
|
42
|
+
|
|
43
|
+
```html:preview
|
|
44
|
+
<zn-data-table-filter
|
|
45
|
+
filters="[{"id":"created","name":"Created Date","type":"date","operators":["eq","before","after"]},{"id":"modified","name":"Modified Date","type":"date","operators":["before","after"]},{"id":"due_date","name":"Due Date","type":"date","operators":["eq","before","after"]}]"
|
|
46
|
+
name="date-filters">
|
|
47
|
+
</zn-data-table-filter>
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Dropdown Options
|
|
22
51
|
|
|
23
|
-
|
|
52
|
+
Use predefined options for select-based filtering.
|
|
53
|
+
|
|
54
|
+
```html:preview
|
|
55
|
+
<zn-data-table-filter
|
|
56
|
+
filters="[{"id":"status","name":"Status","options":{"open":"Open","in_progress":"In Progress","closed":"Closed"},"operators":["eq","in"]},{"id":"priority","name":"Priority","options":{"low":"Low","medium":"Medium","high":"High","critical":"Critical"},"operators":["eq","in"]}]"
|
|
57
|
+
name="option-filters">
|
|
58
|
+
</zn-data-table-filter>
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Limited Options Display
|
|
62
|
+
|
|
63
|
+
Control how many options are initially visible using `maxOptionsVisible`.
|
|
64
|
+
|
|
65
|
+
```html:preview
|
|
66
|
+
<zn-data-table-filter
|
|
67
|
+
filters="[{"id":"category","name":"Category","options":{"cat1":"Category 1","cat2":"Category 2","cat3":"Category 3","cat4":"Category 4","cat5":"Category 5","cat6":"Category 6"},"maxOptionsVisible":3,"operators":["eq","in"]}]"
|
|
68
|
+
name="limited-options">
|
|
69
|
+
</zn-data-table-filter>
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Mixed Filter Types
|
|
73
|
+
|
|
74
|
+
Combine different field types in a single filter component.
|
|
75
|
+
|
|
76
|
+
```html:preview
|
|
77
|
+
<zn-data-table-filter
|
|
78
|
+
filters="[{"id":"product","name":"Product Name","operators":["eq","fuzzy"]},{"id":"category","name":"Category","options":{"electronics":"Electronics","clothing":"Clothing","books":"Books"},"operators":["eq","in"]},{"id":"price","name":"Price","type":"number","operators":["eq","gt","lt"]},{"id":"in_stock","name":"In Stock","type":"boolean","operators":["eq"]}]"
|
|
79
|
+
name="mixed-filters">
|
|
80
|
+
</zn-data-table-filter>
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Employee Filter Example
|
|
84
|
+
|
|
85
|
+
A practical example for filtering employee data.
|
|
86
|
+
|
|
87
|
+
```html:preview
|
|
88
|
+
<zn-data-table-filter
|
|
89
|
+
filters="[{"id":"employee_name","name":"Employee Name","operators":["eq","fuzzy"]},{"id":"department","name":"Department","options":{"engineering":"Engineering","sales":"Sales","marketing":"Marketing","hr":"Human Resources","finance":"Finance"},"operators":["eq","in"]},{"id":"hire_date","name":"Hire Date","type":"date","operators":["before","after"]},{"id":"salary","name":"Salary","type":"number","operators":["gt","lt"]}]"
|
|
90
|
+
name="employee-filters">
|
|
91
|
+
</zn-data-table-filter>
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### E-commerce Filter Example
|
|
95
|
+
|
|
96
|
+
Filter products with various criteria.
|
|
97
|
+
|
|
98
|
+
```html:preview
|
|
99
|
+
<zn-data-table-filter
|
|
100
|
+
filters="[{"id":"title","name":"Product Title","operators":["eq","fuzzy"]},{"id":"brand","name":"Brand","operators":["eq"]},{"id":"category","name":"Category","options":{"electronics":"Electronics","clothing":"Clothing","home":"Home & Garden","sports":"Sports","toys":"Toys"},"maxOptionsVisible":3,"operators":["eq","in"]},{"id":"price","name":"Price","type":"number","operators":["eq","gt","gte","lt","lte"]},{"id":"rating","name":"Rating","type":"number","operators":["gte"]},{"id":"release_date","name":"Release Date","type":"date","operators":["before","after"]}]"
|
|
101
|
+
name="product-filters">
|
|
102
|
+
</zn-data-table-filter>
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### Content Library Filter
|
|
106
|
+
|
|
107
|
+
Filter media content like books, movies, or articles.
|
|
108
|
+
|
|
109
|
+
```html:preview
|
|
110
|
+
<zn-data-table-filter
|
|
111
|
+
filters="[{"id":"title","name":"Title","operators":["eq","fuzzy"]},{"id":"author","name":"Author","operators":["eq","fuzzy"]},{"id":"genre","name":"Genre","options":{"action":"Action","comedy":"Comedy","drama":"Drama","fantasy":"Fantasy","horror":"Horror","mystery":"Mystery","romance":"Romance","thriller":"Thriller","sci-fi":"Science Fiction"},"maxOptionsVisible":3,"operators":["eq","in"]},{"id":"rating","name":"Rating","type":"number","operators":["eq","gt","gte","lt","lte"]},{"id":"published","name":"Published Date","type":"date","operators":["eq","before","after"]}]"
|
|
112
|
+
name="content-filters">
|
|
113
|
+
</zn-data-table-filter>
|
|
114
|
+
```
|