@kubex/zinc 1.1.120 → 1.1.122

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.
Files changed (41) hide show
  1. package/dist/custom-elements.json +1952 -921
  2. package/dist/vscode.html-custom-data.json +80 -58
  3. package/dist/web-types.json +208 -142
  4. package/dist/zn.d.ts +403 -298
  5. package/dist/zn.min.js +1511 -1370
  6. package/docs/pages/components/button.md +9 -0
  7. package/docs/pages/components/data-table-filter.md +60 -4
  8. package/docs/pages/components/data-table-search.md +3 -3
  9. package/docs/pages/components/data-table.md +78 -9
  10. package/docs/pages/components/datepicker.md +10 -0
  11. package/docs/pages/components/menu-item.md +16 -2
  12. package/docs/pages/components/translation-group.md +2 -2
  13. package/package.json +1 -1
  14. package/src/components/button/button.component.ts +11 -4
  15. package/src/components/button/button.scss +12 -1
  16. package/src/components/data-table/data-table.component.ts +341 -139
  17. package/src/components/data-table/data-table.scss +105 -42
  18. package/src/components/data-table/data-table.test.ts +110 -0
  19. package/src/components/data-table-filter/data-table-filter.component.ts +487 -49
  20. package/src/components/data-table-filter/data-table-filter.scss +163 -9
  21. package/src/components/data-table-filter/data-table-filter.test.ts +328 -2
  22. package/src/components/data-table-search/data-table-search.component.ts +1 -1
  23. package/src/components/datepicker/datepicker.component.ts +23 -2
  24. package/src/components/datepicker/datepicker.scss +25 -0
  25. package/src/components/datepicker/datepicker.test.ts +28 -1
  26. package/src/components/input/input.component.ts +1 -0
  27. package/src/components/input/input.scss +1 -1
  28. package/src/components/menu/menu.component.ts +2 -0
  29. package/src/components/menu/menu.scss +23 -2
  30. package/src/components/menu-item/menu-item.component.ts +7 -1
  31. package/src/components/menu-item/menu-item.scss +4 -4
  32. package/src/components/menu-item/menu-item.test.ts +39 -1
  33. package/src/components/panel/panel.component.ts +12 -5
  34. package/src/components/panel/panel.scss +3 -3
  35. package/src/components/query-builder/query-builder.component.ts +1 -1
  36. package/src/components/tooltip/tooltip.component.ts +2 -2
  37. package/src/components/tooltip/tooltip.test.ts +70 -2
  38. package/src/components/translation-group/translation-group.component.ts +5 -7
  39. package/src/components/translation-group/translation-group.test.ts +8 -8
  40. package/src/components/translations/translations.component.ts +3 -4
  41. package/src/components/translations/translations.test.ts +1 -1
package/dist/zn.d.ts CHANGED
@@ -650,6 +650,8 @@ declare module "components/menu-item/menu-item.component" {
650
650
  rel: string;
651
651
  gaid: string;
652
652
  confirm: boolean;
653
+ /** Leaves a containing dropdown open when this item is selected, whatever the dropdown's own setting. */
654
+ keepOpen: boolean;
653
655
  /** Removes all padding from the menu item. */
654
656
  flush: boolean;
655
657
  /** Removes horizontal (left/right) padding only. Ignored if flush is set. */
@@ -1000,6 +1002,8 @@ declare module "components/menu/menu.component" {
1000
1002
  * @cssproperty --example - An example CSS custom property.
1001
1003
  * @cssproperty --zn-menu-max-height - Caps the menu's height and makes it scroll internally.
1002
1004
  * Unset (`none`) by default, so the menu grows to fit its items unless a consumer sets this.
1005
+ * @cssproperty --zn-menu-min-width - Overrides the menu's resting width. Defaults to
1006
+ * `--zn-size-spanel`, or 245px for `variant="shell"`.
1003
1007
  */
1004
1008
  export default class ZnMenu extends ZincElement {
1005
1009
  static styles: CSSResultGroup;
@@ -1204,6 +1208,9 @@ declare module "components/button/button.component" {
1204
1208
  plain: boolean;
1205
1209
  /** Disables the hover background, for contexts where the tint doesn't fit. */
1206
1210
  noHover: boolean;
1211
+ /** Renders the button as a pill: fully rounded, sentence case and regular
1212
+ * weight. For label-like triggers such as filter chips. */
1213
+ pill: boolean;
1207
1214
  panelBackground: boolean;
1208
1215
  dropdownCloser: boolean;
1209
1216
  notification: number;
@@ -1839,55 +1846,9 @@ declare module "events/zn-search-change" {
1839
1846
  }
1840
1847
  }
1841
1848
  }
1842
- declare module "components/data-table-filter/data-table-filter.component" {
1843
- import { type CSSResultGroup, type PropertyValues } from 'lit';
1844
- import ZincElement, { type ZincFormControl } from "internal/zinc-element";
1845
- /**
1846
- * @summary Short summary of the component's intended use.
1847
- * @documentation https://zinc.style/components/data-table-filter
1848
- * @status experimental
1849
- * @since 1.0
1850
- *
1851
- * @dependency zn-example
1852
- *
1853
- * @event zn-event-name - Emitted as an example.
1854
- *
1855
- * @slot - The default slot.
1856
- * @slot example - An example slot.
1857
- *
1858
- * @csspart base - The component's base wrapper.
1859
- *
1860
- * @cssproperty --example - An example CSS custom property.
1861
- */
1862
- export default class ZnDataTableFilter extends ZincElement implements ZincFormControl {
1863
- static styles: CSSResultGroup;
1864
- private _formController;
1865
- filters: string;
1866
- name: string;
1867
- value: string;
1868
- get validationMessage(): string;
1869
- get validity(): ValidityState;
1870
- checkValidity(): boolean;
1871
- getForm(): HTMLFormElement | null;
1872
- reportValidity(): boolean;
1873
- setCustomValidity(): void;
1874
- protected firstUpdated(_changedProperties: PropertyValues): void;
1875
- handleQBClear: () => void;
1876
- handleQBReset: () => void;
1877
- handleQBUpdate: () => void;
1878
- closeSlideout(): void;
1879
- render(): import("lit-html").TemplateResult<1>;
1880
- }
1881
- }
1882
- declare module "components/data-table-filter/index" {
1883
- import ZnDataTableFilter from "components/data-table-filter/data-table-filter.component";
1884
- export * from "components/data-table-filter/data-table-filter.component";
1885
- export default ZnDataTableFilter;
1886
- global {
1887
- interface HTMLElementTagNameMap {
1888
- 'zn-data-table-filter': ZnDataTableFilter;
1889
- }
1890
- }
1849
+ declare module "utilities/lit-to-html" {
1850
+ import { type TemplateResult } from "lit";
1851
+ export function litToHTML<T extends HTMLElement>(templateResult: TemplateResult): T | null;
1891
1852
  }
1892
1853
  declare module "components/slash-menu/slash-menu-items" {
1893
1854
  export interface SlashMenuItem {
@@ -2271,6 +2232,7 @@ declare module "components/input/input.component" {
2271
2232
  * @csspart password-toggle-button - The password toggle button.
2272
2233
  * @csspart suffix - The container that wraps the suffix.
2273
2234
  *
2235
+ * @cssproperty --zn-input-box-shadow - Shadow cast by the field; set to `none` inside a panel that draws its own edge.
2274
2236
  * @cssproperty --zn-range-track-height - The height of a range input's track.
2275
2237
  * @cssproperty --zn-range-track-color - The color of a range input's track.
2276
2238
  * @cssproperty --zn-range-thumb-size - The diameter of a range input's thumb.
@@ -2509,53 +2471,6 @@ declare module "components/input/index" {
2509
2471
  }
2510
2472
  }
2511
2473
  }
2512
- declare module "components/data-select/providers/country-data-provider" {
2513
- import type { DataProviderOption, LocalDataProvider } from "components/data-select/providers/provider";
2514
- export const countryDataProvider: LocalDataProvider<DataProviderOption>;
2515
- }
2516
- declare module "components/data-select/providers/currency-data-provider" {
2517
- import type { DataProviderOption, LocalDataProvider } from "components/data-select/providers/provider";
2518
- export const currencyDataProvider: (allowCommon?: boolean) => LocalDataProvider<DataProviderOption>;
2519
- }
2520
- declare module "components/data-select/providers/color-data-provider" {
2521
- import type { DataProviderOption, LocalDataProvider } from "components/data-select/providers/provider";
2522
- export const colors: string[];
2523
- export const colorDataProvider: LocalDataProvider<DataProviderOption>;
2524
- }
2525
- declare module "components/data-select/providers/country-code-data-provider" {
2526
- import type { DataProviderOption, LocalDataProvider } from "components/data-select/providers/provider";
2527
- export const countryDialPrefixDataProvider: LocalDataProvider<DataProviderOption>;
2528
- }
2529
- declare module "components/data-select/providers/us-state-data-provider" {
2530
- import type { DataProviderOption, LocalDataProvider } from "components/data-select/providers/provider";
2531
- export const usStateDataProvider: LocalDataProvider<DataProviderOption>;
2532
- }
2533
- declare module "components/data-select/providers/provider" {
2534
- import type { HTMLTemplateResult } from "lit";
2535
- /**
2536
- * Providers are what the data select component uses to get data. They are
2537
- * responsible for defining the data.
2538
- */
2539
- export interface LocalDataProvider<T> {
2540
- getName: string;
2541
- getData: T[];
2542
- }
2543
- export interface RemoteDataProvider<T> {
2544
- getName: string;
2545
- getData: () => Promise<T[]>;
2546
- }
2547
- export interface DataProviderOption {
2548
- key: string;
2549
- value: string;
2550
- prefix?: string | HTMLTemplateResult;
2551
- }
2552
- export const emptyDataProvider: LocalDataProvider<DataProviderOption>;
2553
- export * from "components/data-select/providers/country-data-provider";
2554
- export * from "components/data-select/providers/currency-data-provider";
2555
- export * from "components/data-select/providers/color-data-provider";
2556
- export * from "components/data-select/providers/country-code-data-provider";
2557
- export * from "components/data-select/providers/us-state-data-provider";
2558
- }
2559
2474
  declare module "components/option/option.component" {
2560
2475
  import { type CSSResultGroup } from 'lit';
2561
2476
  import ZincElement from "internal/zinc-element";
@@ -3105,129 +3020,6 @@ declare module "components/select/index" {
3105
3020
  }
3106
3021
  }
3107
3022
  }
3108
- declare module "components/data-select/data-select.component" {
3109
- import { type DataProviderOption, type LocalDataProvider } from "components/data-select/providers/provider";
3110
- import { type CSSResultGroup, type PropertyValues } from 'lit';
3111
- import { FormControlController } from "internal/form";
3112
- import ZincElement from "internal/zinc-element";
3113
- import ZnOption from "components/option/index";
3114
- import ZnSelect from "components/select/index";
3115
- import type { ZincFormControl } from "internal/zinc-element";
3116
- /**
3117
- * @summary A select component with built-in data providers for common options like colors, currencies, and countries.
3118
- * @documentation https://zinc.style/components/data-select
3119
- * @status experimental
3120
- * @since 1.0
3121
- *
3122
- * @dependency zn-select
3123
- * @dependency zn-option
3124
- *
3125
- * @event zn-input - Emitted when the select's value changes.
3126
- * @event zn-clear - Emitted when the clear button is activated.
3127
- * @event blur - Emitted when the select loses focus.
3128
- *
3129
- * @slot label - The select's label. Alternatively, you can use the `label` attribute.
3130
- * @slot label-tooltip - Used to add text that is displayed in a tooltip next to the label. Alternatively, you can use the `label-tooltip` attribute.
3131
- * @slot context-note - Used to add contextual text that is displayed above the select, on the right. Alternatively, you can use the `context-note` attribute.
3132
- * @slot help-text - Text that describes how to use the select. Alternatively, you can use the `help-text` attribute.
3133
- *
3134
- * @csspart combobox - The container that wraps the prefix, combobox, clear icon, and expand button (forwarded from zn-select).
3135
- * @csspart expand-icon - The container that wraps the expand icon (forwarded from zn-select).
3136
- * @csspart form-control-help-text - The help text's wrapper (forwarded from zn-select).
3137
- * @csspart form-control-input - The select's wrapper (forwarded from zn-select).
3138
- * @csspart display-input - The element that displays the selected option's label (forwarded from zn-select).
3139
- */
3140
- export default class ZnDataSelect extends ZincElement implements ZincFormControl {
3141
- static styles: CSSResultGroup;
3142
- static dependencies: {
3143
- 'zn-select': typeof ZnSelect;
3144
- 'zn-option': typeof ZnOption;
3145
- };
3146
- select: ZnSelect;
3147
- /** The name of the select. Used for form submission. */
3148
- name: string;
3149
- /** The value of the select. Used for form submission. When `multiple` is enabled, this is an array of strings. */
3150
- value: string | string[];
3151
- /** The default value of the form control. Primarily used for resetting the form control. */
3152
- defaultValue: string | string[];
3153
- /** The provider of the select. */
3154
- provider: 'color' | 'currency' | 'country' | 'phone' | 'us-state';
3155
- /** The position of the icon. */
3156
- iconPosition: 'start' | 'end' | 'none';
3157
- /** An array of keys to use for filtering the options in the selected provider. */
3158
- filter: string[];
3159
- /** The selects size. */
3160
- size: 'small' | 'medium' | 'large';
3161
- /** Should we show the clear button */
3162
- clearable: boolean;
3163
- /** Include an "All" option at the top. */
3164
- allowAll: boolean;
3165
- /** Include a "Common" option that selects multiple common currencies. */
3166
- allowCommon: boolean;
3167
- /** The selects label. If you need to display HTML, use the `label` slot instead. */
3168
- label: string;
3169
- /** Text that appears in a tooltip next to the label. If you need to display HTML in the tooltip, use the `label-tooltip` slot instead. */
3170
- labelTooltip: string;
3171
- /** Text that appears above the input, on the right, to add additional context. If you need to display HTML in this text, use the `context-note` slot instead. */
3172
- contextNote: string;
3173
- /**
3174
- * The preferred placement of the selects menu. Note that the actual placement may vary as needed to keep the listbox
3175
- * inside the viewport.
3176
- */
3177
- placement: 'top' | 'bottom';
3178
- /** The selects help text. If you need to display HTML, use the `help-text` slot instead. */
3179
- helpText: string;
3180
- /** The selects required attribute. */
3181
- required: boolean;
3182
- /** Disables the select. */
3183
- disabled: boolean;
3184
- iconOnly: boolean;
3185
- multiple: boolean;
3186
- selectFirst: boolean;
3187
- distinct: string;
3188
- conditional: string;
3189
- protected readonly formControlController: FormControlController;
3190
- private readonly selectObserver;
3191
- get validationMessage(): string;
3192
- get validity(): ValidityState;
3193
- constructor();
3194
- connectedCallback(): void;
3195
- disconnectedCallback(): void;
3196
- protected firstUpdated(_changedProperties: PropertyValues): Promise<void>;
3197
- protected updated(_changedProperties: PropertyValues): Promise<void>;
3198
- checkValidity(): boolean;
3199
- getForm(): HTMLFormElement | null;
3200
- reportValidity(): boolean;
3201
- setCustomValidity(message: string): void;
3202
- closeOnTab: (e: KeyboardEvent) => void;
3203
- handleValueChange(): Promise<void>;
3204
- handleInput: (e: Event) => void;
3205
- handleClear: () => void;
3206
- getLocalProvider(name: string): LocalDataProvider<DataProviderOption>;
3207
- blur: () => void;
3208
- protected render(): import("lit-html").TemplateResult<1>;
3209
- private _updatePrefix;
3210
- private _updateIconEmptyState;
3211
- private getPlaceholder;
3212
- private _observeSelectDisabled;
3213
- private _syncDisabledState;
3214
- private _normalizeValue;
3215
- }
3216
- }
3217
- declare module "components/data-select/index" {
3218
- import ZnDataSelect from "components/data-select/data-select.component";
3219
- export * from "components/data-select/data-select.component";
3220
- export default ZnDataSelect;
3221
- global {
3222
- interface HTMLElementTagNameMap {
3223
- 'zn-data-select': ZnDataSelect;
3224
- }
3225
- }
3226
- }
3227
- declare module "utilities/lit-to-html" {
3228
- import { type TemplateResult } from "lit";
3229
- export function litToHTML<T extends HTMLElement>(templateResult: TemplateResult): T | null;
3230
- }
3231
3023
  declare module "events/zn-change" {
3232
3024
  export type ZnChangeEvent = CustomEvent<Record<PropertyKey, never>>;
3233
3025
  global {
@@ -3278,6 +3070,7 @@ declare module "components/datepicker/datepicker.component" {
3278
3070
  * - yyyy/MM/dd (2024/12/31)
3279
3071
  *
3280
3072
  * @cssproperty --zn-input-* - Inherited input component CSS custom properties.
3073
+ * @cssproperty --zn-datepicker-inline-border-color - Border colour of the calendar in `inline` mode.
3281
3074
  */
3282
3075
  export default class ZnDatepicker extends ZincElement implements ZincFormControl {
3283
3076
  static styles: CSSResultGroup;
@@ -3324,6 +3117,8 @@ declare module "components/datepicker/datepicker.component" {
3324
3117
  */
3325
3118
  form: string;
3326
3119
  flush: boolean;
3120
+ /** Renders the calendar in place instead of a popup, hiding the text input. */
3121
+ inline: boolean;
3327
3122
  /** Makes the input a required field. */
3328
3123
  required: boolean;
3329
3124
  /** Adds a clear button to the calendar for removing a selected date. **/
@@ -3408,6 +3203,7 @@ declare module "components/datepicker/datepicker.component" {
3408
3203
  * a document-level calendar would render behind it and be inert, so we mount inside that element.
3409
3204
  */
3410
3205
  private getCalendarContainer;
3206
+ private adoptCalendarStyles;
3411
3207
  /** Finds the closest `<dialog>` or popover ancestor, crossing shadow DOM boundaries. */
3412
3208
  private findTopLayerAncestor;
3413
3209
  private handleInput;
@@ -3505,6 +3301,9 @@ declare module "components/query-builder/query-builder.component" {
3505
3301
  Lt = "lt",
3506
3302
  Lte = "lte"
3507
3303
  }
3304
+ export const operatorText: {
3305
+ [key in QueryBuilderOperators]: string;
3306
+ };
3508
3307
  export interface CreatedRule {
3509
3308
  id: string;
3510
3309
  name: string;
@@ -3587,42 +3386,311 @@ declare module "components/query-builder/index" {
3587
3386
  }
3588
3387
  }
3589
3388
  }
3590
- declare module "components/data-table-search/data-table-search.component" {
3591
- import { type CSSResultGroup, type PropertyValues } from 'lit';
3389
+ declare module "components/data-table-filter/data-table-filter.component" {
3390
+ import { type CSSResultGroup, nothing, type PropertyValues } from 'lit';
3391
+ import { type QueryBuilderData } from "components/query-builder/index";
3592
3392
  import ZincElement, { type ZincFormControl } from "internal/zinc-element";
3393
+ import ZnButton from "components/button/index";
3394
+ import ZnDatepicker from "components/datepicker/index";
3395
+ import ZnDropdown from "components/dropdown/index";
3593
3396
  import ZnInput from "components/input/index";
3397
+ import ZnMenu from "components/menu/index";
3398
+ import ZnMenuItem from "components/menu-item/index";
3594
3399
  /**
3595
- * @summary A search component for data tables.
3596
- * @documentation https://zinc.style/components/data-table-search
3400
+ * @summary An inline filter bar for data tables. Each active filter is a pill whose dropdown sets its value.
3401
+ * @documentation https://zinc.style/components/data-table-filter
3597
3402
  * @status experimental
3598
3403
  * @since 1.0
3599
3404
  *
3405
+ * @dependency zn-button
3406
+ * @dependency zn-datepicker
3407
+ * @dependency zn-dropdown
3600
3408
  * @dependency zn-input
3409
+ * @dependency zn-menu
3410
+ * @dependency zn-menu-item
3601
3411
  *
3602
- * @event zn-search-change - Emitted when the search value changes (debounced).
3603
- *
3604
- * @slot - The default slot for additional form inputs.
3605
- *
3606
- * @csspart base - The component's base wrapper.
3607
- *
3608
- * @property {string} name - The name of the search input field (default: "search").
3609
- * @property {string} value - The current search value.
3610
- * @property {string} placeholder - The placeholder text for the search input (default: "Search...").
3611
- * @property {string} helpText - Help text displayed below the search input.
3612
- * @property {string} searchUri - Optional URI to use for search operations.
3613
- * @property {number} debounceDelay - The delay in milliseconds before triggering a search (default: 500).
3412
+ * @event zn-filter-change - Emitted when the active filters change. Read the encoded query off `value`.
3614
3413
  */
3615
- export default class ZnDataTableSearch extends ZincElement implements ZincFormControl {
3414
+ export default class ZnDataTableFilter extends ZincElement implements ZincFormControl {
3616
3415
  static styles: CSSResultGroup;
3617
3416
  static dependencies: {
3417
+ 'zn-button': typeof ZnButton;
3418
+ 'zn-datepicker': typeof ZnDatepicker;
3419
+ 'zn-dropdown': typeof ZnDropdown;
3618
3420
  'zn-input': typeof ZnInput;
3421
+ 'zn-menu': typeof ZnMenu;
3422
+ 'zn-menu-item': typeof ZnMenuItem;
3619
3423
  };
3620
3424
  private _formController;
3621
- private _searchTimeout?;
3425
+ private _textTimeout?;
3426
+ private _pendingOpen?;
3427
+ filters: QueryBuilderData;
3622
3428
  name: string;
3623
3429
  value: string;
3624
- placeholder: string;
3625
- helpText: string;
3430
+ /** Filter keys to show a pill for before the user adds any. */
3431
+ defaultFilters: string;
3432
+ /** Typeahead values per filter key. `zn-data-table` fills this from the rows it has loaded. */
3433
+ suggestions: Record<string, string[]>;
3434
+ private _active;
3435
+ private _typing;
3436
+ private _optionQuery;
3437
+ get validationMessage(): string;
3438
+ get validity(): ValidityState;
3439
+ checkValidity(): boolean;
3440
+ getForm(): HTMLFormElement | null;
3441
+ reportValidity(): boolean;
3442
+ setCustomValidity(): void;
3443
+ protected firstUpdated(_changedProperties: PropertyValues): void;
3444
+ protected updated(changed: PropertyValues): void;
3445
+ protected willUpdate(changed: PropertyValues): void;
3446
+ disconnectedCallback(): void;
3447
+ /** Number of filters with a value set. */
3448
+ get activeCount(): number;
3449
+ /** Removes every active filter. */
3450
+ clear(): void;
3451
+ private definition;
3452
+ private operatorsFor;
3453
+ private comparatorFor;
3454
+ private operatorLabel;
3455
+ private isMultiple;
3456
+ private optionsFor;
3457
+ private addFilter;
3458
+ private removeFilter;
3459
+ private setValue;
3460
+ private setComparator;
3461
+ private toggleOption;
3462
+ private selectedValues;
3463
+ private emitChange;
3464
+ private handleDateInput;
3465
+ private serializeDate;
3466
+ private handleTextInput;
3467
+ private suggestionsFor;
3468
+ private applySuggestion;
3469
+ private humanize;
3470
+ private pillLabel;
3471
+ private renderOperators;
3472
+ private renderPill;
3473
+ private isDateFilter;
3474
+ private renderValueInput;
3475
+ private handleOptionSearch;
3476
+ private renderOptionSearch;
3477
+ private renderOptionItems;
3478
+ private renderAddFilter;
3479
+ render(): import("lit-html").TemplateResult<1> | typeof nothing;
3480
+ }
3481
+ }
3482
+ declare module "components/data-table-filter/index" {
3483
+ import ZnDataTableFilter from "components/data-table-filter/data-table-filter.component";
3484
+ export * from "components/data-table-filter/data-table-filter.component";
3485
+ export default ZnDataTableFilter;
3486
+ global {
3487
+ interface HTMLElementTagNameMap {
3488
+ 'zn-data-table-filter': ZnDataTableFilter;
3489
+ }
3490
+ }
3491
+ }
3492
+ declare module "components/data-select/providers/country-data-provider" {
3493
+ import type { DataProviderOption, LocalDataProvider } from "components/data-select/providers/provider";
3494
+ export const countryDataProvider: LocalDataProvider<DataProviderOption>;
3495
+ }
3496
+ declare module "components/data-select/providers/currency-data-provider" {
3497
+ import type { DataProviderOption, LocalDataProvider } from "components/data-select/providers/provider";
3498
+ export const currencyDataProvider: (allowCommon?: boolean) => LocalDataProvider<DataProviderOption>;
3499
+ }
3500
+ declare module "components/data-select/providers/color-data-provider" {
3501
+ import type { DataProviderOption, LocalDataProvider } from "components/data-select/providers/provider";
3502
+ export const colors: string[];
3503
+ export const colorDataProvider: LocalDataProvider<DataProviderOption>;
3504
+ }
3505
+ declare module "components/data-select/providers/country-code-data-provider" {
3506
+ import type { DataProviderOption, LocalDataProvider } from "components/data-select/providers/provider";
3507
+ export const countryDialPrefixDataProvider: LocalDataProvider<DataProviderOption>;
3508
+ }
3509
+ declare module "components/data-select/providers/us-state-data-provider" {
3510
+ import type { DataProviderOption, LocalDataProvider } from "components/data-select/providers/provider";
3511
+ export const usStateDataProvider: LocalDataProvider<DataProviderOption>;
3512
+ }
3513
+ declare module "components/data-select/providers/provider" {
3514
+ import type { HTMLTemplateResult } from "lit";
3515
+ /**
3516
+ * Providers are what the data select component uses to get data. They are
3517
+ * responsible for defining the data.
3518
+ */
3519
+ export interface LocalDataProvider<T> {
3520
+ getName: string;
3521
+ getData: T[];
3522
+ }
3523
+ export interface RemoteDataProvider<T> {
3524
+ getName: string;
3525
+ getData: () => Promise<T[]>;
3526
+ }
3527
+ export interface DataProviderOption {
3528
+ key: string;
3529
+ value: string;
3530
+ prefix?: string | HTMLTemplateResult;
3531
+ }
3532
+ export const emptyDataProvider: LocalDataProvider<DataProviderOption>;
3533
+ export * from "components/data-select/providers/country-data-provider";
3534
+ export * from "components/data-select/providers/currency-data-provider";
3535
+ export * from "components/data-select/providers/color-data-provider";
3536
+ export * from "components/data-select/providers/country-code-data-provider";
3537
+ export * from "components/data-select/providers/us-state-data-provider";
3538
+ }
3539
+ declare module "components/data-select/data-select.component" {
3540
+ import { type DataProviderOption, type LocalDataProvider } from "components/data-select/providers/provider";
3541
+ import { type CSSResultGroup, type PropertyValues } from 'lit';
3542
+ import { FormControlController } from "internal/form";
3543
+ import ZincElement from "internal/zinc-element";
3544
+ import ZnOption from "components/option/index";
3545
+ import ZnSelect from "components/select/index";
3546
+ import type { ZincFormControl } from "internal/zinc-element";
3547
+ /**
3548
+ * @summary A select component with built-in data providers for common options like colors, currencies, and countries.
3549
+ * @documentation https://zinc.style/components/data-select
3550
+ * @status experimental
3551
+ * @since 1.0
3552
+ *
3553
+ * @dependency zn-select
3554
+ * @dependency zn-option
3555
+ *
3556
+ * @event zn-input - Emitted when the select's value changes.
3557
+ * @event zn-clear - Emitted when the clear button is activated.
3558
+ * @event blur - Emitted when the select loses focus.
3559
+ *
3560
+ * @slot label - The select's label. Alternatively, you can use the `label` attribute.
3561
+ * @slot label-tooltip - Used to add text that is displayed in a tooltip next to the label. Alternatively, you can use the `label-tooltip` attribute.
3562
+ * @slot context-note - Used to add contextual text that is displayed above the select, on the right. Alternatively, you can use the `context-note` attribute.
3563
+ * @slot help-text - Text that describes how to use the select. Alternatively, you can use the `help-text` attribute.
3564
+ *
3565
+ * @csspart combobox - The container that wraps the prefix, combobox, clear icon, and expand button (forwarded from zn-select).
3566
+ * @csspart expand-icon - The container that wraps the expand icon (forwarded from zn-select).
3567
+ * @csspart form-control-help-text - The help text's wrapper (forwarded from zn-select).
3568
+ * @csspart form-control-input - The select's wrapper (forwarded from zn-select).
3569
+ * @csspart display-input - The element that displays the selected option's label (forwarded from zn-select).
3570
+ */
3571
+ export default class ZnDataSelect extends ZincElement implements ZincFormControl {
3572
+ static styles: CSSResultGroup;
3573
+ static dependencies: {
3574
+ 'zn-select': typeof ZnSelect;
3575
+ 'zn-option': typeof ZnOption;
3576
+ };
3577
+ select: ZnSelect;
3578
+ /** The name of the select. Used for form submission. */
3579
+ name: string;
3580
+ /** The value of the select. Used for form submission. When `multiple` is enabled, this is an array of strings. */
3581
+ value: string | string[];
3582
+ /** The default value of the form control. Primarily used for resetting the form control. */
3583
+ defaultValue: string | string[];
3584
+ /** The provider of the select. */
3585
+ provider: 'color' | 'currency' | 'country' | 'phone' | 'us-state';
3586
+ /** The position of the icon. */
3587
+ iconPosition: 'start' | 'end' | 'none';
3588
+ /** An array of keys to use for filtering the options in the selected provider. */
3589
+ filter: string[];
3590
+ /** The selects size. */
3591
+ size: 'small' | 'medium' | 'large';
3592
+ /** Should we show the clear button */
3593
+ clearable: boolean;
3594
+ /** Include an "All" option at the top. */
3595
+ allowAll: boolean;
3596
+ /** Include a "Common" option that selects multiple common currencies. */
3597
+ allowCommon: boolean;
3598
+ /** The selects label. If you need to display HTML, use the `label` slot instead. */
3599
+ label: string;
3600
+ /** Text that appears in a tooltip next to the label. If you need to display HTML in the tooltip, use the `label-tooltip` slot instead. */
3601
+ labelTooltip: string;
3602
+ /** Text that appears above the input, on the right, to add additional context. If you need to display HTML in this text, use the `context-note` slot instead. */
3603
+ contextNote: string;
3604
+ /**
3605
+ * The preferred placement of the selects menu. Note that the actual placement may vary as needed to keep the listbox
3606
+ * inside the viewport.
3607
+ */
3608
+ placement: 'top' | 'bottom';
3609
+ /** The selects help text. If you need to display HTML, use the `help-text` slot instead. */
3610
+ helpText: string;
3611
+ /** The selects required attribute. */
3612
+ required: boolean;
3613
+ /** Disables the select. */
3614
+ disabled: boolean;
3615
+ iconOnly: boolean;
3616
+ multiple: boolean;
3617
+ selectFirst: boolean;
3618
+ distinct: string;
3619
+ conditional: string;
3620
+ protected readonly formControlController: FormControlController;
3621
+ private readonly selectObserver;
3622
+ get validationMessage(): string;
3623
+ get validity(): ValidityState;
3624
+ constructor();
3625
+ connectedCallback(): void;
3626
+ disconnectedCallback(): void;
3627
+ protected firstUpdated(_changedProperties: PropertyValues): Promise<void>;
3628
+ protected updated(_changedProperties: PropertyValues): Promise<void>;
3629
+ checkValidity(): boolean;
3630
+ getForm(): HTMLFormElement | null;
3631
+ reportValidity(): boolean;
3632
+ setCustomValidity(message: string): void;
3633
+ closeOnTab: (e: KeyboardEvent) => void;
3634
+ handleValueChange(): Promise<void>;
3635
+ handleInput: (e: Event) => void;
3636
+ handleClear: () => void;
3637
+ getLocalProvider(name: string): LocalDataProvider<DataProviderOption>;
3638
+ blur: () => void;
3639
+ protected render(): import("lit-html").TemplateResult<1>;
3640
+ private _updatePrefix;
3641
+ private _updateIconEmptyState;
3642
+ private getPlaceholder;
3643
+ private _observeSelectDisabled;
3644
+ private _syncDisabledState;
3645
+ private _normalizeValue;
3646
+ }
3647
+ }
3648
+ declare module "components/data-select/index" {
3649
+ import ZnDataSelect from "components/data-select/data-select.component";
3650
+ export * from "components/data-select/data-select.component";
3651
+ export default ZnDataSelect;
3652
+ global {
3653
+ interface HTMLElementTagNameMap {
3654
+ 'zn-data-select': ZnDataSelect;
3655
+ }
3656
+ }
3657
+ }
3658
+ declare module "components/data-table-search/data-table-search.component" {
3659
+ import { type CSSResultGroup, type PropertyValues } from 'lit';
3660
+ import ZincElement, { type ZincFormControl } from "internal/zinc-element";
3661
+ import ZnInput from "components/input/index";
3662
+ /**
3663
+ * @summary A search component for data tables.
3664
+ * @documentation https://zinc.style/components/data-table-search
3665
+ * @status experimental
3666
+ * @since 1.0
3667
+ *
3668
+ * @dependency zn-input
3669
+ *
3670
+ * @event zn-search-change - Emitted when the search value changes (debounced).
3671
+ *
3672
+ * @slot - The default slot for additional form inputs.
3673
+ *
3674
+ * @csspart base - The component's base wrapper.
3675
+ *
3676
+ * @property {string} name - The name of the search input field (default: "search").
3677
+ * @property {string} value - The current search value.
3678
+ * @property {string} placeholder - The placeholder text for the search input (default: "Search...").
3679
+ * @property {string} helpText - Help text displayed below the search input.
3680
+ * @property {string} searchUri - Optional URI to use for search operations.
3681
+ * @property {number} debounceDelay - The delay in milliseconds before triggering a search (default: 500).
3682
+ */
3683
+ export default class ZnDataTableSearch extends ZincElement implements ZincFormControl {
3684
+ static styles: CSSResultGroup;
3685
+ static dependencies: {
3686
+ 'zn-input': typeof ZnInput;
3687
+ };
3688
+ private _formController;
3689
+ private _searchTimeout?;
3690
+ name: string;
3691
+ value: string;
3692
+ placeholder: string;
3693
+ helpText: string;
3626
3694
  searchUri: string | undefined;
3627
3695
  debounceDelay: number;
3628
3696
  get validationMessage(): string;
@@ -3760,6 +3828,58 @@ declare module "components/hover-container/index" {
3760
3828
  }
3761
3829
  }
3762
3830
  }
3831
+ declare module "components/panel/panel.component" {
3832
+ import { type CSSResultGroup, type PropertyValues } from 'lit';
3833
+ import ZincElement from "internal/zinc-element";
3834
+ /**
3835
+ * @summary Panels are versatile containers that provide structure for organizing content with optional headers and footers.
3836
+ * @documentation https://zinc.style/components/panel
3837
+ * @status experimental
3838
+ * @since 1.0
3839
+ *
3840
+ * @slot - The panel's main content.
3841
+ * @slot actions - Actions displayed in the panel header (buttons, chips, etc).
3842
+ * @slot footer - Content displayed in the panel footer.
3843
+ *
3844
+ * @csspart base - The component's base wrapper.
3845
+ * @csspart header - The header region, when a caption or actions are given.
3846
+ * @csspart header-content - The padded row inside the header, forwarded from zn-header.
3847
+ * @csspart footer - The footer region, when the footer slot is filled.
3848
+ *
3849
+ * @cssproperty --zn-panel-basis - The flex-basis of the panel. Can be set using the basis-px attribute.
3850
+ * @cssproperty --zn-panel-header-padding - Padding around the header row. Defaults to `--zn-base-gap`.
3851
+ * @cssproperty --zn-panel-footer-padding - Padding around the footer row.
3852
+ */
3853
+ export default class ZnPanel extends ZincElement {
3854
+ static styles: CSSResultGroup;
3855
+ private readonly hasSlotController;
3856
+ basis: number;
3857
+ caption: string;
3858
+ icon: string;
3859
+ tabbed: boolean;
3860
+ headerBorderless: boolean;
3861
+ cosmic: boolean;
3862
+ flush: boolean;
3863
+ flushX: boolean;
3864
+ flushY: boolean;
3865
+ flushFooter: boolean;
3866
+ transparent: boolean;
3867
+ shadow: boolean;
3868
+ protected firstUpdated(_changedProperties: PropertyValues): void;
3869
+ connectedCallback(): void;
3870
+ protected render(): unknown;
3871
+ }
3872
+ }
3873
+ declare module "components/panel/index" {
3874
+ import ZnPanel from "components/panel/panel.component";
3875
+ export * from "components/panel/panel.component";
3876
+ export default ZnPanel;
3877
+ global {
3878
+ interface HTMLElementTagNameMap {
3879
+ 'zn-panel': ZnPanel;
3880
+ }
3881
+ }
3882
+ }
3763
3883
  declare module "components/skeleton/skeleton.component" {
3764
3884
  import ZincElement from "internal/zinc-element";
3765
3885
  import type { CSSResultGroup } from "lit";
@@ -3833,7 +3953,7 @@ declare module "components/style/index" {
3833
3953
  }
3834
3954
  }
3835
3955
  declare module "components/data-table/data-table.component" {
3836
- import { type CSSResultGroup, type TemplateResult } from 'lit';
3956
+ import { type CSSResultGroup, type PropertyValues, type TemplateResult } from 'lit';
3837
3957
  import { type ZnFilterChangeEvent } from "events/zn-filter-change";
3838
3958
  import { type ZnSearchChangeEvent } from "events/zn-search-change";
3839
3959
  import ZincElement from "internal/zinc-element";
@@ -3848,6 +3968,7 @@ declare module "components/data-table/data-table.component" {
3848
3968
  import ZnHoverContainer from "components/hover-container/index";
3849
3969
  import ZnMenu from "components/menu/index";
3850
3970
  import ZnMenuItem from "components/menu-item/index";
3971
+ import ZnPanel from "components/panel/index";
3851
3972
  import ZnSkeleton from "components/skeleton/index";
3852
3973
  import ZnStyle from "components/style/index";
3853
3974
  interface Cell {
@@ -3870,6 +3991,10 @@ declare module "components/data-table/data-table.component" {
3870
3991
  copyable?: boolean;
3871
3992
  title?: string;
3872
3993
  }
3994
+ interface RowGroup {
3995
+ label: string;
3996
+ rows: Row[];
3997
+ }
3873
3998
  interface Row {
3874
3999
  id: string;
3875
4000
  uri?: string;
@@ -3941,19 +4066,20 @@ declare module "components/data-table/data-table.component" {
3941
4066
  * @dependency zn-dropdown
3942
4067
  * @dependency zn-menu
3943
4068
  * @dependency zn-menu-item
4069
+ * @dependency zn-panel
3944
4070
  * @dependency zn-button-group
3945
4071
  * @dependency zn-confirm
3946
4072
  * @dependency zn-skeleton
3947
4073
  * @dependency zn-data-table-search
3948
4074
  *
3949
4075
  * @slot - The default slot.
3950
- * @slot search - Slot for search component.
3951
- * @slot sort - Slot for sort component.
3952
- * @slot filter - Slot for filter component.
3953
- * @slot filter-top - Slot for top-level filter component.
3954
- * @slot delete-action - Slot for delete action button.
3955
- * @slot modify-action - Slot for modify action button.
3956
- * @slot create-action - Slot for create action button.
4076
+ * @slot search - Slot for search component, in the header's right-hand group.
4077
+ * @slot sort - Slot for sort component, in the header's right-hand group.
4078
+ * @slot filter - Slot for filter component, in the header's right-hand group.
4079
+ * @slot filter-top - Slot for a top-level filter component, rendered above the table's panel.
4080
+ * @slot delete-action - Slot for delete action button, shown beside the caption once rows are selected.
4081
+ * @slot modify-action - Slot for modify action button, shown beside the caption once rows are selected.
4082
+ * @slot create-action - Slot for create action button, at the end of the header's right-hand group.
3957
4083
  * @slot inputs - Slot for additional input controls.
3958
4084
  * @slot empty-state - Slot for custom empty state.
3959
4085
  * @slot no-results - Slot for a custom no-results state, shown when a search on a no-initial-load table returns no rows.
@@ -3973,6 +4099,7 @@ declare module "components/data-table/data-table.component" {
3973
4099
  'zn-dropdown': typeof ZnDropdown;
3974
4100
  'zn-menu': typeof ZnMenu;
3975
4101
  'zn-menu-item': typeof ZnMenuItem;
4102
+ 'zn-panel': typeof ZnPanel;
3976
4103
  'zn-button-group': typeof ZnButtonGroup;
3977
4104
  'zn-confirm': typeof ZnConfirm;
3978
4105
  'zn-skeleton': typeof ZnSkeleton;
@@ -3995,6 +4122,8 @@ declare module "components/data-table/data-table.component" {
3995
4122
  unsortableHeaders: string;
3996
4123
  unsortable: boolean;
3997
4124
  hidePagination: boolean;
4125
+ hideColumnSelect: boolean;
4126
+ hideRefresh: boolean;
3998
4127
  standalone: boolean;
3999
4128
  caption: string;
4000
4129
  emptyStateCaption: string;
@@ -4014,7 +4143,9 @@ declare module "components/data-table/data-table.component" {
4014
4143
  private readonly resizeObserver;
4015
4144
  private page;
4016
4145
  private totalPages;
4146
+ private _totalRows;
4017
4147
  private _rows;
4148
+ private _suggestionsKey;
4018
4149
  private numberOfRowsSelected;
4019
4150
  private selectedRows;
4020
4151
  private tableContainer;
@@ -4024,22 +4155,43 @@ declare module "components/data-table/data-table.component" {
4024
4155
  private _expandedRows;
4025
4156
  private _hiddenCells;
4026
4157
  private _secondaryHeaders;
4158
+ private _deselectedColumns;
4159
+ private _filtersOpen;
4160
+ private _columnDefaultsApplied;
4027
4161
  private _formatTemplates;
4028
4162
  requestParams: Record<string, any>;
4029
4163
  refresh(): void;
4164
+ private visibleHeaders;
4165
+ private selectableHeaders;
4166
+ private isColumnVisible;
4167
+ private applyColumnDefaults;
4168
+ private toggleColumn;
4030
4169
  render(): TemplateResult<1>;
4031
4170
  connectedCallback(): void;
4171
+ protected updated(changed: PropertyValues): void;
4172
+ private publishFilterSuggestions;
4032
4173
  private getTemplate;
4033
4174
  disconnectedCallback(): void;
4175
+ filterClearListener: (e: Event) => void;
4034
4176
  filterChangeListener: (e: ZnFilterChangeEvent) => void;
4035
4177
  searchChangeListener: (e: ZnSearchChangeEvent) => void;
4036
4178
  emptyState(): TemplateResult<1>;
4037
4179
  renderTable(data: Response): TemplateResult<1>;
4038
4180
  private renderErrorAlert;
4039
4181
  humanize(str: string): string;
4040
- renderTableData(data: any, error?: ResponseError): TemplateResult<1>;
4182
+ renderTableData(groups: RowGroup[], error?: ResponseError): TemplateResult<1>;
4041
4183
  getTableHeader(): TemplateResult<1>;
4042
- getTableFooter(): TemplateResult<1>;
4184
+ private getHeaderControls;
4185
+ private hasRows;
4186
+ private getFilterToggle;
4187
+ private toggleFilters;
4188
+ private appliedFilterCount;
4189
+ private hasColumnSelect;
4190
+ private hasRefresh;
4191
+ private getColumnSelect;
4192
+ private getRefreshButton;
4193
+ private handleColumnSelect;
4194
+ getTableFooter(slot?: string): TemplateResult<1> | null;
4043
4195
  getRowsSelected(): TemplateResult<1> | null;
4044
4196
  getRowsPerPage(): TemplateResult<1> | null;
4045
4197
  private getPageRange;
@@ -5557,53 +5709,6 @@ declare module "components/timer/index" {
5557
5709
  }
5558
5710
  }
5559
5711
  }
5560
- declare module "components/panel/panel.component" {
5561
- import { type CSSResultGroup, type PropertyValues } from 'lit';
5562
- import ZincElement from "internal/zinc-element";
5563
- /**
5564
- * @summary Panels are versatile containers that provide structure for organizing content with optional headers and footers.
5565
- * @documentation https://zinc.style/components/panel
5566
- * @status experimental
5567
- * @since 1.0
5568
- *
5569
- * @slot - The panel's main content.
5570
- * @slot actions - Actions displayed in the panel header (buttons, chips, etc).
5571
- * @slot footer - Content displayed in the panel footer.
5572
- *
5573
- * @csspart base - The component's base wrapper.
5574
- *
5575
- * @cssproperty --zn-panel-basis - The flex-basis of the panel. Can be set using the basis-px attribute.
5576
- */
5577
- export default class ZnPanel extends ZincElement {
5578
- static styles: CSSResultGroup;
5579
- private readonly hasSlotController;
5580
- basis: number;
5581
- caption: string;
5582
- icon: string;
5583
- tabbed: boolean;
5584
- headerBorderless: boolean;
5585
- cosmic: boolean;
5586
- flush: boolean;
5587
- flushX: boolean;
5588
- flushY: boolean;
5589
- flushFooter: boolean;
5590
- transparent: boolean;
5591
- shadow: boolean;
5592
- protected firstUpdated(_changedProperties: PropertyValues): void;
5593
- connectedCallback(): void;
5594
- protected render(): unknown;
5595
- }
5596
- }
5597
- declare module "components/panel/index" {
5598
- import ZnPanel from "components/panel/panel.component";
5599
- export * from "components/panel/panel.component";
5600
- export default ZnPanel;
5601
- global {
5602
- interface HTMLElementTagNameMap {
5603
- 'zn-panel': ZnPanel;
5604
- }
5605
- }
5606
- }
5607
5712
  declare module "components/table/table.component" {
5608
5713
  import { type CSSResultGroup } from 'lit';
5609
5714
  import ZincElement from "internal/zinc-element";
@@ -9345,8 +9450,8 @@ declare module "components/translation-group/translation-group.component" {
9345
9450
  * - `Partial` — only some children do
9346
9451
  * - `English` — none do, so all of them fall back to the English text
9347
9452
  *
9348
- * `Empty` replaces the last of those for English itself, which has nothing to fall back to. English is the source
9349
- * rather than a translation, so it is also left out of the `n of m translated` count beside the label.
9453
+ * `Empty` replaces the last of those for English itself, which has nothing to fall back to. English counts towards
9454
+ * the `n of m` beside the label like any other language.
9350
9455
  *
9351
9456
  * The children own their values; this component only chooses which language is shown and reports on what they hold.
9352
9457
  * It reads them back on every child `zn-change`, so the chips and the count follow an edit as it is typed.