@genesislcap/foundation-ui 14.138.1 → 14.139.1

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 (38) hide show
  1. package/dist/custom-elements.json +2997 -1541
  2. package/dist/dts/base-components.d.ts +12 -0
  3. package/dist/dts/base-components.d.ts.map +1 -1
  4. package/dist/dts/combobox/combobox.d.ts +1 -0
  5. package/dist/dts/combobox/combobox.d.ts.map +1 -1
  6. package/dist/dts/index.d.ts +1 -0
  7. package/dist/dts/index.d.ts.map +1 -1
  8. package/dist/dts/options-datasource/options-datasource.d.ts +1 -0
  9. package/dist/dts/options-datasource/options-datasource.d.ts.map +1 -1
  10. package/dist/dts/search-bar/index.d.ts +8 -0
  11. package/dist/dts/search-bar/index.d.ts.map +1 -0
  12. package/dist/dts/search-bar/search-bar-combobox.d.ts +27 -0
  13. package/dist/dts/search-bar/search-bar-combobox.d.ts.map +1 -0
  14. package/dist/dts/search-bar/search-bar-combobox.styles.d.ts +4 -0
  15. package/dist/dts/search-bar/search-bar-combobox.styles.d.ts.map +1 -0
  16. package/dist/dts/search-bar/search-bar-combobox.template.d.ts +6 -0
  17. package/dist/dts/search-bar/search-bar-combobox.template.d.ts.map +1 -0
  18. package/dist/dts/search-bar/search-bar.d.ts +52 -0
  19. package/dist/dts/search-bar/search-bar.d.ts.map +1 -0
  20. package/dist/dts/search-bar/search-bar.styles.d.ts +2 -0
  21. package/dist/dts/search-bar/search-bar.styles.d.ts.map +1 -0
  22. package/dist/dts/search-bar/search-bar.template.d.ts +6 -0
  23. package/dist/dts/search-bar/search-bar.template.d.ts.map +1 -0
  24. package/dist/dts/search-bar/search-bar.types.d.ts +19 -0
  25. package/dist/dts/search-bar/search-bar.types.d.ts.map +1 -0
  26. package/dist/esm/base-components.js +4 -0
  27. package/dist/esm/combobox/combobox.js +5 -0
  28. package/dist/esm/index.js +1 -0
  29. package/dist/esm/options-datasource/options-datasource.js +40 -23
  30. package/dist/esm/search-bar/index.js +7 -0
  31. package/dist/esm/search-bar/search-bar-combobox.js +140 -0
  32. package/dist/esm/search-bar/search-bar-combobox.styles.js +26 -0
  33. package/dist/esm/search-bar/search-bar-combobox.template.js +60 -0
  34. package/dist/esm/search-bar/search-bar.js +144 -0
  35. package/dist/esm/search-bar/search-bar.styles.js +96 -0
  36. package/dist/esm/search-bar/search-bar.template.js +100 -0
  37. package/dist/esm/search-bar/search-bar.types.js +13 -0
  38. package/package.json +10 -10
@@ -198,6 +198,18 @@ export declare const baseComponents: {
198
198
  foundationProgressRing: (overrideDefinition?: import("@microsoft/fast-foundation").OverrideFoundationElementDefinition<import("@microsoft/fast-foundation").ProgressRingOptions>) => import("@microsoft/fast-foundation").FoundationElementRegistry<import("@microsoft/fast-foundation").ProgressRingOptions, import("@microsoft/fast-element").Constructable<import("@microsoft/fast-foundation").FoundationElement>>;
199
199
  foundationRadio: (overrideDefinition?: import("@microsoft/fast-foundation").OverrideFoundationElementDefinition<import("@microsoft/fast-foundation").RadioOptions>) => import("@microsoft/fast-foundation").FoundationElementRegistry<import("@microsoft/fast-foundation").RadioOptions, import("@microsoft/fast-element").Constructable<import("@microsoft/fast-foundation").FoundationElement>>;
200
200
  foundationRadioGroup: (overrideDefinition?: import("@microsoft/fast-foundation").OverrideFoundationElementDefinition<import("@microsoft/fast-foundation").FoundationElementDefinition>) => import("@microsoft/fast-foundation").FoundationElementRegistry<import("@microsoft/fast-foundation").FoundationElementDefinition, typeof import("./radio-group").RadioGroup>;
201
+ foundationSearchBar: (overrideDefinition?: import("@microsoft/fast-foundation").OverrideFoundationElementDefinition<{
202
+ baseName: string;
203
+ template: import("@microsoft/fast-element").ViewTemplate<import("./search-bar").SearchBar, any>;
204
+ styles: import("@microsoft/fast-element").ElementStyles;
205
+ shadowOptions: ShadowRootInit;
206
+ }>) => import("@microsoft/fast-foundation").FoundationElementRegistry<{
207
+ baseName: string;
208
+ template: import("@microsoft/fast-element").ViewTemplate<import("./search-bar").SearchBar, any>;
209
+ styles: import("@microsoft/fast-element").ElementStyles;
210
+ shadowOptions: ShadowRootInit;
211
+ }, typeof import("./search-bar").SearchBar>;
212
+ foundationSearchBarCombobox: (overrideDefinition?: import("@microsoft/fast-foundation").OverrideFoundationElementDefinition<import("@microsoft/fast-foundation").FoundationElementDefinition>) => import("@microsoft/fast-foundation").FoundationElementRegistry<import("@microsoft/fast-foundation").FoundationElementDefinition, typeof import("./search-bar").SearchBarCombobox>;
201
213
  foundationSegmentedControl: (overrideDefinition?: import("@microsoft/fast-foundation").OverrideFoundationElementDefinition<import("@microsoft/fast-foundation").FoundationElementDefinition>) => import("@microsoft/fast-foundation").FoundationElementRegistry<import("@microsoft/fast-foundation").FoundationElementDefinition, typeof import("./segmented-control").SegmentedControl>;
202
214
  foundationSegmentedItem: (overrideDefinition?: import("@microsoft/fast-foundation").OverrideFoundationElementDefinition<import("@microsoft/fast-foundation").RadioOptions>) => import("@microsoft/fast-foundation").FoundationElementRegistry<import("@microsoft/fast-foundation").RadioOptions, import("@microsoft/fast-element").Constructable<import("@microsoft/fast-foundation").FoundationElement>>;
203
215
  foundationSelect: (overrideDefinition?: import("@microsoft/fast-foundation").OverrideFoundationElementDefinition<import("@microsoft/fast-foundation").SelectOptions>) => import("@microsoft/fast-foundation").FoundationElementRegistry<import("@microsoft/fast-foundation").SelectOptions, import("@microsoft/fast-element").Constructable<import("@microsoft/fast-foundation").FoundationElement>>;
@@ -1 +1 @@
1
- {"version":3,"file":"base-components.d.ts","sourceRoot":"","sources":["../../src/base-components.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AA0E5D,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAyEJ,SAAS,WAAW,GAAG,EAAE;CAe/C,CAAC"}
1
+ {"version":3,"file":"base-components.d.ts","sourceRoot":"","sources":["../../src/base-components.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AA4E5D,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBA2EJ,SAAS,WAAW,GAAG,EAAE;CAe/C,CAAC"}
@@ -17,6 +17,7 @@ export declare class Combobox extends FASTComboBox {
17
17
  ignoreInputClick: boolean;
18
18
  get value(): string;
19
19
  set value(next: string);
20
+ slottedOptionsChanged(prev: Element[] | undefined, next: Element[]): void;
20
21
  filterOptions(): void;
21
22
  clickHandler(e: MouseEvent): boolean | void;
22
23
  keydownHandler(e: KeyboardEvent): boolean | void;
@@ -1 +1 @@
1
- {"version":3,"file":"combobox.d.ts","sourceRoot":"","sources":["../../../src/combobox/combobox.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,IAAI,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAGtE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAWlE;;GAEG;AACH,qBAAa,QAAS,SAAQ,YAAY;;IACxC,OAAO,CAAC,SAAS,CAAS;IAGd,iBAAiB,EAA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,MAAM,CAAiB;IACvC,eAAe,CAAC,QAAQ,KAAA,EAAE,QAAQ,EAAE,MAAM;IAG1C,qBAAqB,MAAC;IACtB,iFAAiF;IAE1E,aAAa,EAAE,OAAO,CAAS;IAEtC,wFAAwF;IAEjF,gBAAgB,EAAE,OAAO,CAAS;IAEzC,IAAW,KAAK,IAKO,MAAM,CAF5B;IAED,IAAW,KAAK,CAAC,IAAI,EAAE,MAAM,EAsB5B;IAEe,qBAAqB,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;IAMzE,aAAa,IAAI,IAAI;IAoBrB,YAAY,CAAC,CAAC,EAAE,UAAU,GAAG,OAAO,GAAG,IAAI;IAuB3C,cAAc,CAAC,CAAC,EAAE,aAAa,GAAG,OAAO,GAAG,IAAI;IAiChD,YAAY,CAAC,CAAC,EAAE,aAAa,GAAG,OAAO,GAAG,IAAI;IAuB9D;;;;OAIG;IACH,SAAS,KAAK,SAAS,IAAI,OAAO,CAGjC;IAED;;;;;OAKG;IACH,SAAS,CAAC,iBAAiB,CAAC,KAAK,EAAE,MAAM;IAKhC,YAAY,CAAC,CAAC,EAAE,UAAU,GAAG,OAAO,GAAG,IAAI;IAQpD,cAAc;CAmBf;AAGD,eAAO,MAAM,+BAA+B,EAAE,cAG7C,CAAC;AAEF,eAAO,MAAM,qBAAqB;;CAajC,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,8SAM7B,CAAC"}
@@ -59,6 +59,7 @@ export * from './progress-ring';
59
59
  export * from './radio';
60
60
  export * from './radio-group';
61
61
  export * from './router';
62
+ export * from './search-bar';
62
63
  export * from './segmented-control';
63
64
  export * from './segmented-item';
64
65
  export * from './select';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,E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9B,cAAc,yBAAyB,CAAC;AACxC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,UAAU,CAAC;AACzB,cAAc,OAAO,CAAC;AACtB,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,yBAAyB,CAAC"}
@@ -5,6 +5,7 @@ export declare class OptionsDatasource extends BaseDatasource {
5
5
  labelField: string;
6
6
  optionElement: string;
7
7
  valueField: string;
8
+ emptyDataLabel: string;
8
9
  labelFormatter: any;
9
10
  initialSelectedValue: string | number;
10
11
  initialSelectedValueChanged(oldValue: any, newValue: any): void;
@@ -1 +1 @@
1
- {"version":3,"file":"options-datasource.d.ts","sourceRoot":"","sources":["../../../src/options-datasource/options-datasource.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,M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AAC;IAEf,oBAAoB,EAAE,MAAM,GAAG,MAAM,CAAC;IAClD,2BAA2B,CAAC,QAAQ,KAAA,EAAE,QAAQ,KAAA;IAI9C,8BAA8B,EAAE,OAAO,CAAS;IAEhD,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,QAAQ,CAAC;IAC7B,UAAU,EAAE,OAAO,CAAQ;IAElC,SAAS,CAAC,OAAO,EAAE;QAAE,KAAK,EAAE,GAAG,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAE7C,iBAAiB;IAgCjB,sBAAsB;IAY5B,SAAS,IAAI,IAAI;IAUjB,iBAAiB,CAAC,YAAY,CAAC,EAAE,GAAG,EAAE;IAwCtC,mBAAmB,CAAC,YAAY,EAAE,GAAG,EAAE,GAAG,IAAI;IAI9C,mBAAmB,CAAC,WAAW,EAAE,GAAG,EAAE,GAAG,IAAI;IAI7C,mBAAmB,CAAC,WAAW,EAAE,GAAG,EAAE,GAAG,IAAI;CAG9C"}
@@ -0,0 +1,8 @@
1
+ export * from './search-bar';
2
+ export * from './search-bar.styles';
3
+ export * from './search-bar.template';
4
+ export * from './search-bar.types';
5
+ export * from './search-bar-combobox';
6
+ export * from './search-bar-combobox.styles';
7
+ export * from './search-bar-combobox.template';
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/search-bar/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gCAAgC,CAAC"}
@@ -0,0 +1,27 @@
1
+ import { Combobox } from '@microsoft/fast-components';
2
+ /**
3
+ * @tagname %%prefix%%-search-bar-combobox
4
+ */
5
+ export declare class SearchBarCombobox extends Combobox {
6
+ minlength: number;
7
+ private previousLength;
8
+ private changeListener;
9
+ connectedCallback(): void;
10
+ disconnectedCallback(): void;
11
+ clickHandler(e: any): boolean | void;
12
+ keyupHandler(e: KeyboardEvent): void;
13
+ keydownHandler(e: Event & KeyboardEvent): boolean | void;
14
+ inputHandler(e: InputEvent): boolean | void;
15
+ openChanged(): void;
16
+ }
17
+ export declare const foundationSearchBarComboboxShadowOptions: ShadowRootInit;
18
+ export declare const defaultSearchBarComboboxConfig: {};
19
+ /**
20
+ * The Foundation Search Bar Combobox
21
+ *
22
+ * @public
23
+ * @remarks
24
+ * HTML Element: \<foundation-search-bar-combobox\>
25
+ */
26
+ export declare const foundationSearchBarCombobox: (overrideDefinition?: import("@microsoft/fast-foundation").OverrideFoundationElementDefinition<import("@microsoft/fast-foundation").FoundationElementDefinition>) => import("@microsoft/fast-foundation").FoundationElementRegistry<import("@microsoft/fast-foundation").FoundationElementDefinition, typeof SearchBarCombobox>;
27
+ //# sourceMappingURL=search-bar-combobox.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search-bar-combobox.d.ts","sourceRoot":"","sources":["../../../src/search-bar/search-bar-combobox.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAOtD;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,QAAQ;IACvC,SAAS,EAAE,MAAM,CAA0B;IAEjD,OAAO,CAAC,cAAc,CAAc;IAEpC,OAAO,CAAC,cAAc,CAEpB;IAEF,iBAAiB;IAKjB,oBAAoB,IAAI,IAAI;IAK5B,YAAY,CAAC,CAAC,EAAE,GAAG,GAAG,OAAO,GAAG,IAAI;IAiB7B,YAAY,CAAC,CAAC,EAAE,aAAa;IA0B7B,cAAc,CAAC,CAAC,EAAE,KAAK,GAAG,aAAa,GAAG,OAAO,GAAG,IAAI;IAoC/D,YAAY,CAAC,CAAC,EAAE,UAAU,GAAG,OAAO,GAAG,IAAI;IAW3C,WAAW;CAWZ;AAED,eAAO,MAAM,wCAAwC,EAAE,cAGtD,CAAC;AAEF,eAAO,MAAM,8BAA8B,IAAK,CAAC;AAEjD;;;;;;GAMG;AACH,eAAO,MAAM,2BAA2B,iUAMtC,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { ElementStyles } from '@microsoft/fast-element';
2
+ import type { ElementDefinitionContext, FoundationElementDefinition } from '@microsoft/fast-foundation';
3
+ export declare const foundationSearchBarComboboxStyles: (context: ElementDefinitionContext, definition: FoundationElementDefinition) => ElementStyles;
4
+ //# sourceMappingURL=search-bar-combobox.styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search-bar-combobox.styles.d.ts","sourceRoot":"","sources":["../../../src/search-bar/search-bar-combobox.styles.ts"],"names":[],"mappings":"AACA,OAAO,EAAO,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,KAAK,EACV,wBAAwB,EACxB,2BAA2B,EAC5B,MAAM,4BAA4B,CAAC;AAGpC,eAAO,MAAM,iCAAiC,YACnC,wBAAwB,cACrB,2BAA2B,KACtC,aAsBF,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { ViewTemplate } from '@microsoft/fast-element';
2
+ import { ElementDefinitionContext } from '@microsoft/fast-foundation';
3
+ import type { ComboboxOptions } from '@microsoft/fast-foundation';
4
+ import type { SearchBarCombobox } from './search-bar-combobox';
5
+ export declare const foundationSearchBarComboboxTemplate: (context: ElementDefinitionContext, definition: ComboboxOptions) => ViewTemplate<SearchBarCombobox>;
6
+ //# sourceMappingURL=search-bar-combobox.template.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search-bar-combobox.template.d.ts","sourceRoot":"","sources":["../../../src/search-bar/search-bar-combobox.template.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO,EAAmB,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAEvF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE/D,eAAO,MAAM,mCAAmC,YACrC,wBAAwB,cACrB,eAAe,KAC1B,aAAa,iBAAiB,CAyDhC,CAAC"}
@@ -0,0 +1,52 @@
1
+ import { FoundationElement } from '@microsoft/fast-foundation';
2
+ import { SearchBarCombobox } from './search-bar-combobox';
3
+ import { AvailableOption, SelectedOption } from './search-bar.types';
4
+ /**
5
+ * @tagname %%prefix%%-search-bar
6
+ */
7
+ export declare class SearchBar extends FoundationElement {
8
+ combobox: SearchBarCombobox;
9
+ defaultSlottedNodes: any;
10
+ options: AvailableOption[];
11
+ searchTerm: string;
12
+ appearance: string;
13
+ minlength: number;
14
+ placeholder: string;
15
+ disabled: boolean;
16
+ loading: boolean;
17
+ selectedOptions: SelectedOption[];
18
+ filteredOptions: AvailableOption[];
19
+ selectedOptionsDiv: HTMLDivElement;
20
+ clear(): void;
21
+ clearSearch(): void;
22
+ inputdeleted(): void;
23
+ changeHandler(): void;
24
+ pasteHandler(event: ClipboardEvent): void;
25
+ hasSelectedOption(term: string, field: string): boolean;
26
+ unselectOption(option: any): void;
27
+ inputHandler(): Promise<void>;
28
+ private filterSelectedOptions;
29
+ private normalizeDelimiter;
30
+ private addOrReplaceSelectedText;
31
+ }
32
+ export declare const foundationSearchBarShadowOptions: ShadowRootInit;
33
+ export declare const defaultSearchBarConfig: {};
34
+ /**
35
+ * The Foundation Search Bar
36
+ *
37
+ * @public
38
+ * @remarks
39
+ * HTML Element: \<foundation-search-bar\>
40
+ */
41
+ export declare const foundationSearchBar: (overrideDefinition?: import("@microsoft/fast-foundation").OverrideFoundationElementDefinition<{
42
+ baseName: string;
43
+ template: import("@microsoft/fast-element").ViewTemplate<SearchBar, any>;
44
+ styles: import("@microsoft/fast-element").ElementStyles;
45
+ shadowOptions: ShadowRootInit;
46
+ }>) => import("@microsoft/fast-foundation").FoundationElementRegistry<{
47
+ baseName: string;
48
+ template: import("@microsoft/fast-element").ViewTemplate<SearchBar, any>;
49
+ styles: import("@microsoft/fast-element").ElementStyles;
50
+ shadowOptions: ShadowRootInit;
51
+ }, typeof SearchBar>;
52
+ //# sourceMappingURL=search-bar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search-bar.d.ts","sourceRoot":"","sources":["../../../src/search-bar/search-bar.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAG1D,OAAO,EACL,eAAe,EACf,cAAc,EAGf,MAAM,oBAAoB,CAAC;AAE5B;;GAEG;AACH,qBAAa,SAAU,SAAQ,iBAAiB;IACvC,QAAQ,EAAE,iBAAiB,CAAC;IACvB,mBAAmB,MAAC;IAEpB,OAAO,EAAE,eAAe,EAAE,CAAC;IAE3B,UAAU,EAAE,MAAM,CAAM;IAE9B,UAAU,EAAE,MAAM,CAAa;IAC/B,SAAS,EAAE,MAAM,CAAoB;IAErC,WAAW,EAAE,MAAM,CAA4B;IAC/C,QAAQ,EAAE,OAAO,CAAC;IAEZ,OAAO,EAAE,OAAO,CAAC;IACjB,eAAe,EAAE,cAAc,EAAE,CAAM;IACvC,eAAe,EAAE,eAAe,EAAE,CAAC;IAExC,kBAAkB,EAAE,cAAc,CAAC;IAEnC,KAAK;IAML,WAAW,IAAI,IAAI;IAInB,YAAY;IAMZ,aAAa;IAuCb,YAAY,CAAC,KAAK,EAAE,cAAc;IAclC,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;IAM7C,cAAc,CAAC,MAAM,EAAE,GAAG;IAKpB,YAAY;IASzB,OAAO,CAAC,qBAAqB;IAU7B,OAAO,CAAC,kBAAkB,CAExB;IAEF,OAAO,CAAC,wBAAwB,CAQ9B;CACH;AAGD,eAAO,MAAM,gCAAgC,EAAE,cAA0B,CAAC;AAE1E,eAAO,MAAM,sBAAsB,IAAK,CAAC;AAEzC;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;oBAM9B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const foundationSearchBarStyles: import("@microsoft/fast-element").ElementStyles;
2
+ //# sourceMappingURL=search-bar.styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search-bar.styles.d.ts","sourceRoot":"","sources":["../../../src/search-bar/search-bar.styles.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,yBAAyB,iDA6FrC,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { SearchBar } from './search-bar';
2
+ export declare const crossIcon: (slot?: string) => string;
3
+ export declare const plusIcon: () => string;
4
+ export declare const getPrefixedSearchBar: (prefix: string) => import("@microsoft/fast-element").ViewTemplate<SearchBar, any>;
5
+ export declare const foundationSearchBarTemplate: import("@microsoft/fast-element").ViewTemplate<SearchBar, any>;
6
+ //# sourceMappingURL=search-bar.template.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search-bar.template.d.ts","sourceRoot":"","sources":["../../../src/search-bar/search-bar.template.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGzC,eAAO,MAAM,SAAS,2BAMrB,CAAC;AAEF,eAAO,MAAM,QAAQ,cAGd,CAAC;AAER,eAAO,MAAM,oBAAoB,WAAY,MAAM,mEAyFlD,CAAC;AAEF,eAAO,MAAM,2BAA2B,gEAEvC,CAAC"}
@@ -0,0 +1,19 @@
1
+ type CriteriaCreator = <T extends string = string>(type: T, term: string) => string;
2
+ export declare const SCROLL_TIMEOUT = 10;
3
+ export declare const INPUT_MIN_LENGTH = 3;
4
+ export declare const COMBO_INPUT_MIN_LENGTH = 1;
5
+ export type SelectedOption<T extends string = string> = {
6
+ field: T;
7
+ term: string;
8
+ label: string;
9
+ createCriteria: CriteriaCreator;
10
+ };
11
+ export type AvailableOption<T extends string = string> = {
12
+ field: T;
13
+ label: (searchTerm: string) => string;
14
+ createCriteria: CriteriaCreator;
15
+ isEnabled: (searchTerm: string, selectedOptions: SelectedOption[]) => boolean;
16
+ };
17
+ export declare const getCriteriaBuilder: CriteriaCreator;
18
+ export {};
19
+ //# sourceMappingURL=search-bar.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search-bar.types.d.ts","sourceRoot":"","sources":["../../../src/search-bar/search-bar.types.ts"],"names":[],"mappings":"AAEA,KAAK,eAAe,GAAG,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;AAEpF,eAAO,MAAM,cAAc,KAAK,CAAC;AACjC,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAClC,eAAO,MAAM,sBAAsB,IAAI,CAAC;AAExC,MAAM,MAAM,cAAc,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,IAAI;IACtD,KAAK,EAAE,CAAC,CAAC;IACT,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,eAAe,CAAC;CACjC,CAAC;AAEF,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,IAAI;IACvD,KAAK,EAAE,CAAC,CAAC;IACT,KAAK,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,MAAM,CAAC;IACtC,cAAc,EAAE,eAAe,CAAC;IAChC,SAAS,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,eAAe,EAAE,cAAc,EAAE,KAAK,OAAO,CAAC;CAC/E,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,eAUhC,CAAC"}
@@ -49,6 +49,8 @@ import { foundationProgress } from './progress';
49
49
  import { foundationProgressRing } from './progress-ring';
50
50
  import { foundationRadio } from './radio';
51
51
  import { foundationRadioGroup } from './radio-group';
52
+ import { foundationSearchBar } from './search-bar';
53
+ import { foundationSearchBarCombobox } from './search-bar';
52
54
  import { foundationSegmentedControl } from './segmented-control';
53
55
  import { foundationSegmentedItem } from './segmented-item';
54
56
  import { foundationSelect } from './select/index';
@@ -122,6 +124,8 @@ export const baseComponents = {
122
124
  foundationProgressRing,
123
125
  foundationRadio,
124
126
  foundationRadioGroup,
127
+ foundationSearchBar,
128
+ foundationSearchBarCombobox,
125
129
  foundationSegmentedControl,
126
130
  foundationSegmentedItem,
127
131
  foundationSelect,
@@ -53,6 +53,11 @@ export class Combobox extends FASTComboBox {
53
53
  Observable.notify(this, 'value');
54
54
  }
55
55
  }
56
+ slottedOptionsChanged(prev, next) {
57
+ const shouldEmit = this.async ? true : false;
58
+ super.slottedOptionsChanged(prev, next);
59
+ this['updateValue'](shouldEmit);
60
+ }
56
61
  filterOptions() {
57
62
  if (!this.autocomplete || this.autocomplete === ComboboxAutocomplete.none) {
58
63
  this['filter'] = '';
package/dist/esm/index.js CHANGED
@@ -59,6 +59,7 @@ export * from './progress-ring';
59
59
  export * from './radio';
60
60
  export * from './radio-group';
61
61
  export * from './router';
62
+ export * from './search-bar';
62
63
  export * from './segmented-control';
63
64
  export * from './segmented-item';
64
65
  export * from './select';
@@ -3,11 +3,12 @@ import { __awaiter, __decorate } from "tslib";
3
3
  import { ResourceType } from '@genesislcap/foundation-comms';
4
4
  import { attr, customElement, DOM, observable } from '@microsoft/fast-element';
5
5
  import { Combobox } from '../combobox';
6
- import { BaseDatasource, logger } from '../utils';
6
+ import { BaseDatasource, getPrefix, logger } from '../utils';
7
7
  import { dataserverCriteriaBuilder, requestServerCriteriaBuilder } from '../utils';
8
8
  let OptionsDatasource = OptionsDatasource_1 = class OptionsDatasource extends BaseDatasource {
9
9
  constructor() {
10
10
  super(...arguments);
11
+ this.emptyDataLabel = 'No matching records';
11
12
  this.initalSelectedValueInitialized = false;
12
13
  this.isSnapshot = true;
13
14
  }
@@ -19,13 +20,15 @@ let OptionsDatasource = OptionsDatasource_1 = class OptionsDatasource extends Ba
19
20
  const _super = Object.create(null, {
20
21
  connectedCallback: { get: () => super.connectedCallback }
21
22
  });
22
- var _a;
23
+ var _a, _b;
23
24
  return __awaiter(this, void 0, void 0, function* () {
24
25
  _super.connectedCallback.call(this);
25
26
  this.fields = this.labelField ? (_a = this.valueField) === null || _a === void 0 ? void 0 : _a.concat(' ', this.labelField) : this.valueField;
26
27
  this.select = this.parentElement;
28
+ this.optionElement = (_b = this.optionElement) !== null && _b !== void 0 ? _b : `${getPrefix(this.select)}-option`;
27
29
  this.select.addEventListener('change', (e) => {
28
- const selectedOption = this.options.find((option) => option.label === e.target.value);
30
+ var _a;
31
+ const selectedOption = (_a = this.options) === null || _a === void 0 ? void 0 : _a.find((option) => option.label === e.target.value);
29
32
  this.select.$emit('value-change', selectedOption);
30
33
  });
31
34
  if (this.select &&
@@ -67,27 +70,38 @@ let OptionsDatasource = OptionsDatasource_1 = class OptionsDatasource extends Ba
67
70
  syncComponentData(snapshotData) {
68
71
  var _a;
69
72
  const rowData = snapshotData !== null && snapshotData !== void 0 ? snapshotData : Array.from(this.rowsSyncedWithStream.values());
70
- this.options = rowData.map((row) => ({
71
- value: row[this.valueField],
72
- label: this.labelFormatter ? this.labelFormatter(row[this.labelField]) : row[this.labelField],
73
- }));
74
- const listboxOptions = this.options.map(({ value, label }) => {
75
- const option = document.createElement(this.optionElement);
76
- option.textContent = label ? label : value;
77
- option.value = value;
78
- return option;
79
- });
80
- listboxOptions.forEach((x) => {
81
- this.select.appendChild(x);
82
- });
83
- if (!this.initalSelectedValueInitialized) {
84
- const initialLabel = this.initialSelectedValue || this.initialSelectedValue === 0
85
- ? (_a = this.options.find((x) => x.value === this.initialSelectedValue)) === null || _a === void 0 ? void 0 : _a.label
86
- : '';
87
- DOM.queueUpdate(() => {
88
- this.select.value = initialLabel;
73
+ if (rowData.length > 0) {
74
+ this.options = rowData.map((row) => ({
75
+ value: row[this.valueField],
76
+ label: this.labelFormatter
77
+ ? this.labelFormatter(row[this.labelField])
78
+ : row[this.labelField],
79
+ }));
80
+ const listboxOptions = this.options.map(({ value, label }) => {
81
+ const option = document.createElement(this.optionElement);
82
+ option.textContent = label ? label : value;
83
+ option.value = value;
84
+ return option;
85
+ });
86
+ listboxOptions.forEach((x) => {
87
+ this.select.appendChild(x);
89
88
  });
90
- this.initalSelectedValueInitialized = true;
89
+ if (!this.initalSelectedValueInitialized) {
90
+ const initialLabel = this.initialSelectedValue || this.initialSelectedValue === 0
91
+ ? (_a = this.options.find((x) => x.value === this.initialSelectedValue)) === null || _a === void 0 ? void 0 : _a.label
92
+ : '';
93
+ DOM.queueUpdate(() => {
94
+ this.select.value = initialLabel;
95
+ });
96
+ this.initalSelectedValueInitialized = true;
97
+ }
98
+ }
99
+ else {
100
+ const option = document.createElement(this.optionElement);
101
+ option.textContent = this.emptyDataLabel;
102
+ option.value = '';
103
+ option.disabled = true;
104
+ this.select.appendChild(option);
91
105
  }
92
106
  }
93
107
  handleStreamInserts(insertedRows) {
@@ -109,6 +123,9 @@ __decorate([
109
123
  __decorate([
110
124
  attr({ attribute: 'value-field' })
111
125
  ], OptionsDatasource.prototype, "valueField", void 0);
126
+ __decorate([
127
+ attr({ attribute: 'empty-data-label' })
128
+ ], OptionsDatasource.prototype, "emptyDataLabel", void 0);
112
129
  __decorate([
113
130
  observable
114
131
  ], OptionsDatasource.prototype, "labelFormatter", void 0);
@@ -0,0 +1,7 @@
1
+ export * from './search-bar';
2
+ export * from './search-bar.styles';
3
+ export * from './search-bar.template';
4
+ export * from './search-bar.types';
5
+ export * from './search-bar-combobox';
6
+ export * from './search-bar-combobox.styles';
7
+ export * from './search-bar-combobox.template';
@@ -0,0 +1,140 @@
1
+ import { __decorate } from "tslib";
2
+ import { Combobox } from '@microsoft/fast-components';
3
+ import { attr } from '@microsoft/fast-element';
4
+ import { foundationSearchBarComboboxStyles } from './search-bar-combobox.styles';
5
+ import { foundationSearchBarComboboxTemplate } from './search-bar-combobox.template';
6
+ import { COMBO_INPUT_MIN_LENGTH } from './search-bar.types';
7
+ /**
8
+ * @tagname %%prefix%%-search-bar-combobox
9
+ */
10
+ export class SearchBarCombobox extends Combobox {
11
+ constructor() {
12
+ super(...arguments);
13
+ this.minlength = COMBO_INPUT_MIN_LENGTH;
14
+ this.previousLength = -1;
15
+ this.changeListener = (e) => {
16
+ this.previousLength = 0;
17
+ };
18
+ }
19
+ connectedCallback() {
20
+ super.connectedCallback();
21
+ this.addEventListener('change', this.changeListener);
22
+ }
23
+ disconnectedCallback() {
24
+ super.disconnectedCallback();
25
+ this.removeEventListener('change', this.changeListener);
26
+ }
27
+ clickHandler(e) {
28
+ if (this.disabled) {
29
+ return;
30
+ }
31
+ if (this.open) {
32
+ const captured = e.target.closest(`option,[role=option]`);
33
+ if (!captured || captured.disabled) {
34
+ return;
35
+ }
36
+ this.selectedOptions = [captured];
37
+ this.control.value = captured.text;
38
+ this.value = this.control.value;
39
+ this.$emit('change');
40
+ }
41
+ this.control.focus();
42
+ }
43
+ keyupHandler(e) {
44
+ const key = e.key;
45
+ switch (key) {
46
+ case 'Backspace':
47
+ case 'Delete': {
48
+ if (this.previousLength < 0) {
49
+ this.$emit('inputdeleted');
50
+ }
51
+ else {
52
+ this.previousLength = this.previousLength - 1;
53
+ }
54
+ break;
55
+ }
56
+ case 'Enter': {
57
+ if (this.open && this.selectedIndex !== -1) {
58
+ const firstOption = this.slottedOptions[0];
59
+ this.selectedOptions = [firstOption];
60
+ this.control.value = firstOption.text;
61
+ this.value = this.control.value;
62
+ this.$emit('change');
63
+ }
64
+ }
65
+ }
66
+ super.keyupHandler(e);
67
+ }
68
+ keydownHandler(e) {
69
+ const key = e.key;
70
+ switch (key) {
71
+ case 'ArrowUp':
72
+ case 'ArrowDown': {
73
+ if (this.control.value.length < this.minlength) {
74
+ return;
75
+ }
76
+ else {
77
+ return super.keydownHandler(e);
78
+ }
79
+ }
80
+ case 'Enter': {
81
+ if (this.selectedIndex === -1) {
82
+ return false;
83
+ }
84
+ return super.keydownHandler(e);
85
+ }
86
+ case 'Tab': {
87
+ if (!this.open) {
88
+ return true;
89
+ }
90
+ if (e.shiftKey) {
91
+ this.selectPreviousOption();
92
+ }
93
+ else {
94
+ this.selectNextOption();
95
+ }
96
+ break;
97
+ }
98
+ default:
99
+ return super.keydownHandler(e);
100
+ }
101
+ }
102
+ inputHandler(e) {
103
+ if (this.control.value.length >= this.minlength) {
104
+ this.open = true;
105
+ }
106
+ else {
107
+ e.stopImmediatePropagation();
108
+ this.open = false;
109
+ }
110
+ this.value = this.control.value;
111
+ this.previousLength = this.control.value.length;
112
+ }
113
+ openChanged() {
114
+ if (this.open) {
115
+ this.ariaControls = this.listboxId;
116
+ this.ariaExpanded = 'true';
117
+ this.setPositioning();
118
+ this.focusAndScrollOptionIntoView();
119
+ return;
120
+ }
121
+ this.ariaControls = '';
122
+ this.ariaExpanded = 'false';
123
+ }
124
+ }
125
+ __decorate([
126
+ attr
127
+ ], SearchBarCombobox.prototype, "minlength", void 0);
128
+ export const foundationSearchBarComboboxShadowOptions = {
129
+ delegatesFocus: true,
130
+ mode: 'open',
131
+ };
132
+ export const defaultSearchBarComboboxConfig = {};
133
+ /**
134
+ * The Foundation Search Bar Combobox
135
+ *
136
+ * @public
137
+ * @remarks
138
+ * HTML Element: \<foundation-search-bar-combobox\>
139
+ */
140
+ export const foundationSearchBarCombobox = SearchBarCombobox.compose(Object.assign({ baseName: 'search-bar-combobox', template: foundationSearchBarComboboxTemplate, styles: foundationSearchBarComboboxStyles, shadowOptions: foundationSearchBarComboboxShadowOptions }, defaultSearchBarComboboxConfig));
@@ -0,0 +1,26 @@
1
+ import { designUnit } from '@microsoft/fast-components';
2
+ import { css } from '@microsoft/fast-element';
3
+ import { foundationComboboxStyles } from '../combobox';
4
+ export const foundationSearchBarComboboxStyles = (context, definition) => css `
5
+ ${foundationComboboxStyles(context, definition)}
6
+ .control {
7
+ width: auto;
8
+ padding-left: calc(${designUnit} * 1px);
9
+ padding-right: 0;
10
+ }
11
+
12
+ .end {
13
+ height: 100%;
14
+ min-width: 36px;
15
+ max-width: 36px;
16
+ padding-right: 2px;
17
+ display: flex;
18
+ justify-content: flex-end;
19
+ align-items: center;
20
+ }
21
+
22
+ .selected-value {
23
+ min-width: 150px;
24
+ max-width: 169px;
25
+ }
26
+ `;
@@ -0,0 +1,60 @@
1
+ import { html, ref, slotted } from '@microsoft/fast-element';
2
+ import { endSlotTemplate } from '@microsoft/fast-foundation';
3
+ import { Listbox } from '@microsoft/fast-foundation';
4
+ export const foundationSearchBarComboboxTemplate = (context, definition) => html `
5
+ <template
6
+ aria-disabled="${(x) => x.ariaDisabled}"
7
+ autocomplete="${(x) => x.autocomplete}"
8
+ class="${(x) => (x.open ? 'open' : '')} ${(x) => (x.disabled ? 'disabled' : '')} ${(x) => x.position} body"
9
+ ?open="${(x) => x.open}"
10
+ tabindex="${(x) => (!x.disabled ? '0' : null)}"
11
+ @click="${(x, c) => x.clickHandler(c.event)}"
12
+ @focusout="${(x, c) => x.focusoutHandler(c.event)}"
13
+ @keydown="${(x, c) => x.keydownHandler(c.event)}"
14
+ data-test-id="combobox"
15
+ >
16
+ <slot name="selectedOptions" data-test-id="options"></slot>
17
+ <div class="control" part="control">
18
+ <slot name="control">
19
+ <input
20
+ aria-activedescendant="${(x) => (x.open ? x.ariaActiveDescendant : null)}"
21
+ aria-autocomplete="${(x) => x.ariaAutoComplete}"
22
+ aria-controls="${(x) => x.ariaControls}"
23
+ aria-disabled="${(x) => x.ariaDisabled}"
24
+ aria-expanded="${(x) => x.ariaExpanded}"
25
+ aria-haspopup="listbox"
26
+ class="selected-value"
27
+ part="selected-value"
28
+ placeholder="${(x) => x.placeholder}"
29
+ role="combobox"
30
+ type="text"
31
+ ?disabled="${(x) => x.disabled}"
32
+ :value="${(x) => x.value}"
33
+ @input="${(x, c) => x.inputHandler(c.event)}"
34
+ @keyup="${(x, c) => x.keyupHandler(c.event)}"
35
+ ${ref('control')}
36
+ data-test-id="selected-value"
37
+ />
38
+ </slot>
39
+ </div>
40
+ ${endSlotTemplate(context, definition)}
41
+ <div
42
+ class="listbox"
43
+ id="${(x) => x.listboxId}"
44
+ part="listbox"
45
+ role="listbox"
46
+ ?disabled="${(x) => x.disabled}"
47
+ ?hidden="${(x) => !x.open}"
48
+ ${ref('listbox')}
49
+ data-test-id="listbox"
50
+ >
51
+ <slot
52
+ ${slotted({
53
+ filter: Listbox.slottedOptionFilter,
54
+ flatten: true,
55
+ property: 'slottedOptions',
56
+ })}
57
+ ></slot>
58
+ </div>
59
+ </template>
60
+ `;