@genesislcap/foundation-ui 14.154.2 → 14.154.3-alpha-005efd0.0

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.
@@ -23,6 +23,17 @@ export declare const baseComponents: {
23
23
  foundationButton: (overrideDefinition?: import("@microsoft/fast-foundation").OverrideFoundationElementDefinition<import("@microsoft/fast-foundation").FoundationElementDefinition>) => import("@microsoft/fast-foundation").FoundationElementRegistry<import("@microsoft/fast-foundation").FoundationElementDefinition, typeof import("./button").Button>;
24
24
  foundationCalendar: (overrideDefinition?: import("@microsoft/fast-foundation").OverrideFoundationElementDefinition<import("@microsoft/fast-foundation").CalendarOptions>) => import("@microsoft/fast-foundation").FoundationElementRegistry<import("@microsoft/fast-foundation").CalendarOptions, import("@microsoft/fast-element").Constructable<import("@microsoft/fast-foundation").FoundationElement>>;
25
25
  foundationCard: (overrideDefinition?: import("@microsoft/fast-foundation").OverrideFoundationElementDefinition<import("@microsoft/fast-foundation").FoundationElementDefinition>) => import("@microsoft/fast-foundation").FoundationElementRegistry<import("@microsoft/fast-foundation").FoundationElementDefinition, typeof import("./card").Card>;
26
+ foundationCategorizedMultiselect: (overrideDefinition?: import("@microsoft/fast-foundation").OverrideFoundationElementDefinition<{
27
+ baseName: string;
28
+ template: import("@microsoft/fast-element").ViewTemplate<import("./categorized-multiselect").CategorizedMultiselect, any>;
29
+ styles: import("@microsoft/fast-element").ElementStyles;
30
+ shadowOptions: ShadowRootInit;
31
+ }>) => import("@microsoft/fast-foundation").FoundationElementRegistry<{
32
+ baseName: string;
33
+ template: import("@microsoft/fast-element").ViewTemplate<import("./categorized-multiselect").CategorizedMultiselect, any>;
34
+ styles: import("@microsoft/fast-element").ElementStyles;
35
+ shadowOptions: ShadowRootInit;
36
+ }, typeof import("./categorized-multiselect").CategorizedMultiselect>;
26
37
  foundationCheckbox: (overrideDefinition?: import("@microsoft/fast-foundation").OverrideFoundationElementDefinition<import("@microsoft/fast-foundation").CheckboxOptions>) => import("@microsoft/fast-foundation").FoundationElementRegistry<import("@microsoft/fast-foundation").CheckboxOptions, import("@microsoft/fast-element").Constructable<import("@microsoft/fast-foundation").FoundationElement>>;
27
38
  foundationCombobox: (overrideDefinition?: import("@microsoft/fast-foundation").OverrideFoundationElementDefinition<import("@microsoft/fast-foundation").ComboboxOptions>) => import("@microsoft/fast-foundation").FoundationElementRegistry<import("@microsoft/fast-foundation").ComboboxOptions, import("@microsoft/fast-element").Constructable<import("@microsoft/fast-foundation").FoundationElement>>;
28
39
  foundationConnectionIndicator: (overrideDefinition?: import("@microsoft/fast-foundation").OverrideFoundationElementDefinition<import("@microsoft/fast-foundation").FoundationElementDefinition>) => import("@microsoft/fast-foundation").FoundationElementRegistry<import("@microsoft/fast-foundation").FoundationElementDefinition, typeof import("./connection-indicator").ConnectionIndicator>;
@@ -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;AA4E5D,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBA2EJ,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;AA6E5D,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBA4EJ,SAAS,WAAW,GAAG,EAAE;CAe/C,CAAC"}
@@ -0,0 +1,74 @@
1
+ import { FoundationElement } from '@microsoft/fast-foundation';
2
+ import { Position } from '../multiselect';
3
+ export declare const foundationCategorizedMultiselectShadowOptions: ShadowRootInit;
4
+ export declare const defaultCategorizedMultiselectConfig: {};
5
+ export type CategorizedMultiselectOption = {
6
+ type: string;
7
+ value: string;
8
+ label: string;
9
+ disabled?: boolean;
10
+ };
11
+ export type CategorizedMultiselectFilteredOption = {
12
+ type: string;
13
+ options: Omit<CategorizedMultiselectOption, 'type'>;
14
+ };
15
+ /**
16
+ * @tagname %%prefix%%-categorized-multiselect
17
+ */
18
+ export declare class CategorizedMultiselect extends FoundationElement {
19
+ name: string;
20
+ autoPosition: boolean;
21
+ search: boolean;
22
+ disabled: boolean;
23
+ defaultSlottedNodes: Node[];
24
+ valueFormatter: any;
25
+ filterSearchValue: string;
26
+ private clickOutside;
27
+ open: boolean;
28
+ openChanged(previous: boolean, open: boolean): void;
29
+ options: CategorizedMultiselectOption[];
30
+ selectedOptions: string[];
31
+ filteredAvailableOptions: CategorizedMultiselectFilteredOption[];
32
+ /**
33
+ * Controls the positioning of the multiselect dropdown. Accepts the following values:
34
+ * - Position.ABOVE: Forces the dropdown to always open above the input field.
35
+ * - Position.BELOW: Forces the dropdown to always open below the input field.
36
+ */
37
+ position: Position;
38
+ optionsElement: HTMLElement;
39
+ connectedCallback(): void;
40
+ disconnectedCallback(): void;
41
+ toggle(): void;
42
+ sortFilteredOptions(options?: CategorizedMultiselectOption[]): CategorizedMultiselectFilteredOption[];
43
+ optionsChanged(): void;
44
+ /**
45
+ * Sets the dropdown position based on the current configuration.
46
+ * @remarks
47
+ * If `autoPosition` is `true`, this method calculates the available space above and below the input field in the viewport and positions the dropdown accordingly.
48
+ * This ensures the dropdown is always visible to the user. If `autoPosition` is `false`, the dropdown position is locked to either 'above' or 'below', as specified by the `position` attribute.
49
+ * This method is intended for internal use by the component and is marked as private.
50
+ * @private
51
+ */
52
+ private setDropdownPosition;
53
+ optionGetter(option: CategorizedMultiselectOption): string;
54
+ getItemLabel(option: CategorizedMultiselectOption): any;
55
+ isOptionDisabled(option: CategorizedMultiselectOption): boolean;
56
+ get getPlaceholder(): string;
57
+ isOptionSelected(normalizedOption: CategorizedMultiselectOption): boolean;
58
+ selectCheckboxOne(normalizedOption: CategorizedMultiselectOption): void;
59
+ setFilter(): void;
60
+ changeHandler(event: Event): void;
61
+ private handleClickOutside;
62
+ }
63
+ export declare const foundationCategorizedMultiselect: (overrideDefinition?: import("@microsoft/fast-foundation").OverrideFoundationElementDefinition<{
64
+ baseName: string;
65
+ template: import("@microsoft/fast-element").ViewTemplate<CategorizedMultiselect, any>;
66
+ styles: import("@microsoft/fast-element").ElementStyles;
67
+ shadowOptions: ShadowRootInit;
68
+ }>) => import("@microsoft/fast-foundation").FoundationElementRegistry<{
69
+ baseName: string;
70
+ template: import("@microsoft/fast-element").ViewTemplate<CategorizedMultiselect, any>;
71
+ styles: import("@microsoft/fast-element").ElementStyles;
72
+ shadowOptions: ShadowRootInit;
73
+ }, typeof CategorizedMultiselect>;
74
+ //# sourceMappingURL=categorized-multiselect.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"categorized-multiselect.d.ts","sourceRoot":"","sources":["../../../src/categorized-multiselect/categorized-multiselect.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/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,MAAM,EAAE,4BAA4B;IAQrD,IACI,cAAc,WAEjB;IAED,gBAAgB,CAAC,gBAAgB,EAAE,4BAA4B,GAAG,OAAO;IAIzE,iBAAiB,CAAC,gBAAgB,EAAE,4BAA4B;IAahE,SAAS;IAeT,aAAa,CAAC,KAAK,EAAE,KAAK;IAK1B,OAAO,CAAC,kBAAkB;CAK3B;AAED,eAAO,MAAM,gCAAgC;;;;;;;;;;iCAM3C,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare const optionsMaxheight = 450;
2
+ export declare const categorizedMultiselectStyles: import("@microsoft/fast-element").ElementStyles;
3
+ //# sourceMappingURL=categorized-multiselect.styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"categorized-multiselect.styles.d.ts","sourceRoot":"","sources":["../../../src/categorized-multiselect/categorized-multiselect.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,gBAAgB,MAAM,CAAC;AAEpC,eAAO,MAAM,4BAA4B,iDA6IxC,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { CategorizedMultiselect } from './categorized-multiselect';
2
+ export declare const getPrefixedCategorizedMultiselect: (prefix?: string) => import("@microsoft/fast-element").ViewTemplate<CategorizedMultiselect, any>;
3
+ export declare const categorizedMultiselectTemplate: import("@microsoft/fast-element").ViewTemplate<CategorizedMultiselect, any>;
4
+ //# sourceMappingURL=categorized-multiselect.template.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"categorized-multiselect.template.d.ts","sourceRoot":"","sources":["../../../src/categorized-multiselect/categorized-multiselect.template.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAEnE,eAAO,MAAM,iCAAiC,YACpC,MAAM,gFAyDf,CAAC;AAEF,eAAO,MAAM,8BAA8B,6EAE1C,CAAC"}
@@ -0,0 +1,4 @@
1
+ export * from './categorized-multiselect';
2
+ export * from './categorized-multiselect.styles';
3
+ export * from './categorized-multiselect.template';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/categorized-multiselect/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kCAAkC,CAAC;AACjD,cAAc,oCAAoC,CAAC"}
@@ -17,6 +17,7 @@ export * from './breadcrumb';
17
17
  export * from './button';
18
18
  export * from './calendar';
19
19
  export * from './card';
20
+ export * from './categorized-multiselect';
20
21
  export * from './checkbox';
21
22
  export * from './combobox';
22
23
  export * from './connection-indicator';
@@ -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,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAEvF,OAAO,EAAE,cAAc,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,CAAC;AAExE,eAAO,MAAM,8BAA8B,yDAAuD,CAAC;AAEnG,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,mBAAmB,CAAC;AAClC,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,wBAAwB,CAAC;AACvC,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cA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AC;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"}
@@ -1,3 +1,4 @@
1
+ export * from './multiselect-consts';
1
2
  export * from './multiselect';
2
3
  export * from './multiselect.styles';
3
4
  export * from './multiselect.template';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/multiselect/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/multiselect/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC"}
@@ -12,6 +12,7 @@ import { foundationBreadcrumbItem } from './breadcrumb-item';
12
12
  import { foundationButton } from './button';
13
13
  import { foundationCalendar } from './calendar';
14
14
  import { foundationCard } from './card';
15
+ import { foundationCategorizedMultiselect } from './categorized-multiselect';
15
16
  import { foundationCheckbox } from './checkbox';
16
17
  import { foundationCombobox } from './combobox';
17
18
  import { foundationConnectionIndicator } from './connection-indicator';
@@ -87,6 +88,7 @@ export const baseComponents = {
87
88
  foundationButton,
88
89
  foundationCalendar,
89
90
  foundationCard,
91
+ foundationCategorizedMultiselect,
90
92
  foundationCheckbox,
91
93
  foundationCombobox,
92
94
  foundationConnectionIndicator,
@@ -0,0 +1,221 @@
1
+ import { __decorate } from "tslib";
2
+ import { attr, observable, volatile } from '@microsoft/fast-element';
3
+ import { FoundationElement } from '@microsoft/fast-foundation';
4
+ import { Position } from '../multiselect';
5
+ import { wasClickOutsideElement } from '../utils';
6
+ import { categorizedMultiselectStyles as styles } from './categorized-multiselect.styles';
7
+ import { categorizedMultiselectTemplate as template } from './categorized-multiselect.template';
8
+ export const foundationCategorizedMultiselectShadowOptions = undefined;
9
+ export const defaultCategorizedMultiselectConfig = {};
10
+ /**
11
+ * @tagname %%prefix%%-categorized-multiselect
12
+ */
13
+ export class CategorizedMultiselect extends FoundationElement {
14
+ constructor() {
15
+ super(...arguments);
16
+ this.name = '';
17
+ this.autoPosition = true;
18
+ this.search = true;
19
+ this.disabled = false;
20
+ this.clickOutside = (e) => this.handleClickOutside(e);
21
+ this.open = false;
22
+ this.options = [];
23
+ this.selectedOptions = [];
24
+ /**
25
+ * Controls the positioning of the multiselect dropdown. Accepts the following values:
26
+ * - Position.ABOVE: Forces the dropdown to always open above the input field.
27
+ * - Position.BELOW: Forces the dropdown to always open below the input field.
28
+ */
29
+ this.position = Position.BELOW;
30
+ }
31
+ openChanged(previous, open) {
32
+ var _a, _b;
33
+ if (open) {
34
+ document.addEventListener('mousedown', this.clickOutside);
35
+ (_a = this.optionsElement) === null || _a === void 0 ? void 0 : _a.classList.add('visible');
36
+ }
37
+ else {
38
+ document.removeEventListener('mousedown', this.clickOutside);
39
+ (_b = this.optionsElement) === null || _b === void 0 ? void 0 : _b.classList.remove('visible');
40
+ }
41
+ }
42
+ connectedCallback() {
43
+ var _a;
44
+ super.connectedCallback();
45
+ if (this.position === Position.ABOVE) {
46
+ (_a = this.optionsElement) === null || _a === void 0 ? void 0 : _a.classList.add('position-above');
47
+ }
48
+ }
49
+ disconnectedCallback() {
50
+ super.disconnectedCallback();
51
+ document.removeEventListener('mousedown', this.clickOutside);
52
+ }
53
+ toggle() {
54
+ if (!this.open) {
55
+ this.setDropdownPosition();
56
+ }
57
+ this.open = !this.open;
58
+ }
59
+ sortFilteredOptions(options) {
60
+ const sortedData = (options !== null && options !== void 0 ? options : this.options).reduce((acc, curr) => {
61
+ const type = curr.type || 'Other';
62
+ if (!acc[type]) {
63
+ acc[type] = {
64
+ type: type,
65
+ options: [curr],
66
+ };
67
+ }
68
+ else {
69
+ acc[type].options.push(curr);
70
+ }
71
+ return acc;
72
+ }, {});
73
+ const result = Object.values(sortedData);
74
+ return result;
75
+ }
76
+ optionsChanged() {
77
+ this.filteredAvailableOptions = this.sortFilteredOptions();
78
+ }
79
+ /**
80
+ * Sets the dropdown position based on the current configuration.
81
+ * @remarks
82
+ * If `autoPosition` is `true`, this method calculates the available space above and below the input field in the viewport and positions the dropdown accordingly.
83
+ * This ensures the dropdown is always visible to the user. If `autoPosition` is `false`, the dropdown position is locked to either 'above' or 'below', as specified by the `position` attribute.
84
+ * This method is intended for internal use by the component and is marked as private.
85
+ * @private
86
+ */
87
+ setDropdownPosition() {
88
+ let calculatedPosition = this.position;
89
+ if (this.autoPosition) {
90
+ let container = this.assignedSlot ? this.assignedSlot.parentElement : this.parentElement;
91
+ while (container && !container.classList.contains('content-wrapper')) {
92
+ container = container.parentElement;
93
+ }
94
+ if (!container) {
95
+ const multiselectRect = this.getBoundingClientRect();
96
+ const viewportHeight = window.innerHeight;
97
+ const spaceAbove = multiselectRect.top;
98
+ const spaceBelow = viewportHeight - multiselectRect.bottom;
99
+ calculatedPosition =
100
+ spaceBelow < multiselectRect.height && spaceAbove > spaceBelow
101
+ ? Position.ABOVE
102
+ : Position.BELOW;
103
+ }
104
+ else {
105
+ const containerRect = container.getBoundingClientRect();
106
+ const thisRect = this.getBoundingClientRect();
107
+ const midPoint = containerRect.top + containerRect.height / 2;
108
+ calculatedPosition = thisRect.top < midPoint ? Position.BELOW : Position.ABOVE;
109
+ }
110
+ }
111
+ if (calculatedPosition === Position.ABOVE) {
112
+ this.optionsElement.classList.add('position-above');
113
+ this.optionsElement.classList.remove('position-below');
114
+ }
115
+ else if (calculatedPosition === Position.BELOW) {
116
+ this.optionsElement.classList.add('position-below');
117
+ this.optionsElement.classList.remove('position-above');
118
+ }
119
+ }
120
+ optionGetter(option) {
121
+ return option.value;
122
+ }
123
+ getItemLabel(option) {
124
+ let value;
125
+ if (!option) {
126
+ return '';
127
+ }
128
+ else {
129
+ value = option.label || option.value || '';
130
+ }
131
+ return this.valueFormatter ? this.valueFormatter(value) : value;
132
+ }
133
+ isOptionDisabled(option) {
134
+ if (!option || typeof option === 'string') {
135
+ return false;
136
+ }
137
+ return option.disabled || false;
138
+ }
139
+ get getPlaceholder() {
140
+ return `Search ${this.name}`.trim().concat('...');
141
+ }
142
+ isOptionSelected(normalizedOption) {
143
+ return this.selectedOptions.includes(this.optionGetter(normalizedOption));
144
+ }
145
+ selectCheckboxOne(normalizedOption) {
146
+ const option = this.optionGetter(normalizedOption);
147
+ const isIncluded = this.selectedOptions.includes(option);
148
+ if (!isIncluded) {
149
+ this.selectedOptions = [...this.selectedOptions, option];
150
+ }
151
+ else {
152
+ this.selectedOptions = [...this.selectedOptions];
153
+ this.selectedOptions.splice(this.selectedOptions.indexOf(option), 1);
154
+ }
155
+ this.$emit('selectionChange', this.selectedOptions);
156
+ }
157
+ setFilter() {
158
+ const filteredOptions = this.options.filter((option) => {
159
+ var _a;
160
+ const optionType = option.type;
161
+ const optionValue = (_a = option.label) !== null && _a !== void 0 ? _a : option.value;
162
+ if (optionType === null || optionType === void 0 ? void 0 : optionType.toLowerCase().includes(this.filterSearchValue.toLowerCase())) {
163
+ return option;
164
+ }
165
+ if (optionValue.toLowerCase().includes(this.filterSearchValue.toLowerCase())) {
166
+ return option;
167
+ }
168
+ });
169
+ this.filteredAvailableOptions = this.sortFilteredOptions(filteredOptions);
170
+ }
171
+ changeHandler(event) {
172
+ event.preventDefault();
173
+ event.stopImmediatePropagation();
174
+ }
175
+ handleClickOutside(event) {
176
+ if (wasClickOutsideElement(event, this)) {
177
+ this.open = false;
178
+ }
179
+ }
180
+ }
181
+ __decorate([
182
+ attr
183
+ ], CategorizedMultiselect.prototype, "name", void 0);
184
+ __decorate([
185
+ attr({ mode: 'boolean', attribute: 'auto-position' })
186
+ ], CategorizedMultiselect.prototype, "autoPosition", void 0);
187
+ __decorate([
188
+ attr({ mode: 'boolean' })
189
+ ], CategorizedMultiselect.prototype, "search", void 0);
190
+ __decorate([
191
+ attr({ mode: 'boolean' })
192
+ ], CategorizedMultiselect.prototype, "disabled", void 0);
193
+ __decorate([
194
+ observable
195
+ ], CategorizedMultiselect.prototype, "defaultSlottedNodes", void 0);
196
+ __decorate([
197
+ observable
198
+ ], CategorizedMultiselect.prototype, "valueFormatter", void 0);
199
+ __decorate([
200
+ observable
201
+ ], CategorizedMultiselect.prototype, "filterSearchValue", void 0);
202
+ __decorate([
203
+ observable
204
+ ], CategorizedMultiselect.prototype, "open", void 0);
205
+ __decorate([
206
+ observable
207
+ ], CategorizedMultiselect.prototype, "options", void 0);
208
+ __decorate([
209
+ observable
210
+ ], CategorizedMultiselect.prototype, "selectedOptions", void 0);
211
+ __decorate([
212
+ observable
213
+ ], CategorizedMultiselect.prototype, "filteredAvailableOptions", void 0);
214
+ __decorate([
215
+ observable
216
+ ], CategorizedMultiselect.prototype, "position", void 0);
217
+ __decorate([
218
+ volatile
219
+ ], CategorizedMultiselect.prototype, "getPlaceholder", null);
220
+ export const foundationCategorizedMultiselect = CategorizedMultiselect.compose(Object.assign({ baseName: 'categorized-multiselect', template,
221
+ styles, shadowOptions: foundationCategorizedMultiselectShadowOptions }, defaultCategorizedMultiselectConfig));
@@ -0,0 +1,144 @@
1
+ import { css } from '@microsoft/fast-element';
2
+ export const optionsMaxheight = 450;
3
+ export const categorizedMultiselectStyles = css `
4
+ .root {
5
+ position: relative;
6
+ width: 100%;
7
+ min-width: 250px;
8
+ max-width: 1000px;
9
+ }
10
+
11
+ .control-button {
12
+ display: flex;
13
+ justify-content: center;
14
+ min-width: 31px;
15
+ width: 31px;
16
+ height: 31px;
17
+ margin-left: calc(var(--design-unit) * 2px);
18
+ color: var(--neutral-foreground-hint);
19
+ }
20
+
21
+ .control {
22
+ cursor: pointer;
23
+ position: relative;
24
+ display: flex;
25
+ justify-content: end;
26
+ align-items: center;
27
+ width: 100%;
28
+ border-radius: calc(var(--control-corner-radius) * 1px);
29
+ }
30
+
31
+ .label {
32
+ display: block;
33
+ cursor: pointer;
34
+ font-size: var(--type-ramp-base-font-size);
35
+ line-height: var(--type-ramp-base-line-height);
36
+ font-style: normal;
37
+ font-weight: 700;
38
+ margin: calc(var(--design-unit) * 2px) 0;
39
+ }
40
+
41
+ .label-hidden {
42
+ display: none;
43
+ }
44
+
45
+ .control:hover .control-button,
46
+ .control:hover .label {
47
+ color: var(--neutral-foreground-rest);
48
+ }
49
+
50
+ button {
51
+ pointer-events: none;
52
+ }
53
+
54
+ .options {
55
+ display: flex;
56
+ flex-direction: column;
57
+ position: absolute;
58
+ height: max-content;
59
+ overflow-y: hidden;
60
+ margin-top: 5px;
61
+ padding: calc((var(--design-unit) + 3) * 2px) calc((var(--design-unit) + 3) * 1px);
62
+ border: 1px solid rgba(46 51 57 / 100%);
63
+ border-radius: 4px;
64
+ background: var(--neutral-fill-input-rest);
65
+ width: 100%;
66
+ max-height: 0;
67
+ visibility: hidden;
68
+ transition:
69
+ max-height 0.4s ease 0s,
70
+ visibility 0.4s ease 0s;
71
+ z-index: 999;
72
+ }
73
+
74
+ .position-above {
75
+ bottom: 100%;
76
+ }
77
+
78
+ .checkbox-container {
79
+ display: flex;
80
+ flex-direction: column;
81
+ overflow-y: scroll;
82
+ scrollbar-width: thin;
83
+ scrollbar-color: rgb(46 48 53) rgb(31 33 38);
84
+ }
85
+
86
+ span {
87
+ border-bottom: calc(var(--stroke-width) * 1px) solid;
88
+ border-color: color-mix(in srgb, var(--neutral-fill-rest), transparent 50%);
89
+ padding: calc((var(--design-unit) + 2) * 2px) calc((var(--design-unit) + 3) * 1px);
90
+ font-size: 13px;
91
+ color: var(--neutral-foreground-hint);
92
+ }
93
+
94
+ .multiselect-checkbox {
95
+ min-width: fit-content;
96
+ flex-direction: row-reverse;
97
+ justify-content: space-between;
98
+ border-bottom: 1px solid;
99
+ border-color: color-mix(in srgb, var(--neutral-fill-rest), transparent 50%);
100
+ padding: calc((var(--design-unit) + 3) * 1px) calc((var(--design-unit) + 3) * 1px)
101
+ calc((var(--design-unit) + 3) * 1px) 0;
102
+ margin: 0;
103
+ }
104
+
105
+ .multiselect-checkbox:hover {
106
+ background-color: rgb(45 47 51);
107
+ cursor: pointer;
108
+ }
109
+
110
+ .multiselect-checkbox::part(label) {
111
+ overflow-x: hidden;
112
+ text-overflow: ellipsis;
113
+ white-space: nowrap;
114
+ }
115
+
116
+ .checkbox-container .multiselect-checkbox[disabled] {
117
+ cursor: not-allowed;
118
+ }
119
+
120
+ #filter-search {
121
+ padding: 5px;
122
+ }
123
+
124
+ ::-webkit-scrollbar {
125
+ width: 12px;
126
+ }
127
+
128
+ ::-webkit-scrollbar-track {
129
+ background: rgb(31 33 38);
130
+ }
131
+
132
+ ::-webkit-scrollbar-thumb {
133
+ width: 8px;
134
+ border-radius: 10px;
135
+ box-shadow: inset 0 0 6px rgba(0 0 0 / 30%);
136
+ background-color: rgb(46 48 53);
137
+ border: 3px solid rgb(31 33 38);
138
+ }
139
+
140
+ .visible {
141
+ visibility: visible;
142
+ max-height: ${optionsMaxheight.toString()}px;
143
+ }
144
+ `;
@@ -0,0 +1,55 @@
1
+ import { sync } from '@genesislcap/foundation-utils';
2
+ import { html, repeat, ref, when, slotted } from '@microsoft/fast-element';
3
+ import { whitespaceFilter } from '@microsoft/fast-foundation';
4
+ import { classNames } from '@microsoft/fast-web-utilities';
5
+ export const getPrefixedCategorizedMultiselect = (prefix = 'foundation') => html `
6
+ <div class="root" part="root">
7
+ <div class="control" part="control" @click=${(x) => !x.disabled && x.toggle()}>
8
+ <label
9
+ part="label"
10
+ for="control"
11
+ class=${(x) => { var _a; return classNames('label', ['label-hidden', !((_a = x.defaultSlottedNodes) === null || _a === void 0 ? void 0 : _a.length)]); }}
12
+ >
13
+ <slot
14
+ ${slotted({
15
+ property: 'defaultSlottedNodes',
16
+ filter: whitespaceFilter,
17
+ })}
18
+ ></slot>
19
+ </label>
20
+ <${prefix}-button class="control-button" part="control-button"><${prefix}-icon name="plus" variant="solid" size="lg"></${prefix}-icon></${prefix}-button>
21
+ </div>
22
+ <div ${ref('optionsElement')} class="options" part="options">
23
+ ${when((x) => x.search, html `
24
+ <${prefix}-text-field
25
+ id="filter-search"
26
+ part="filter-search"
27
+ value=${sync((x) => x.filterSearchValue, 'string', 'input')}
28
+ placeholder="${(x) => x.getPlaceholder}"
29
+ @input=${(x, c) => x.setFilter()}
30
+ @change=${(x, c) => x.changeHandler(c.event)}
31
+ ></${prefix}-text-field>
32
+ `)}
33
+ <div class="checkbox-container" part="checkbox-container">
34
+ ${repeat((x) => x.filteredAvailableOptions, html `
35
+ <span>${(x) => x.type}</span>
36
+ ${repeat((x) => x.options, html `
37
+ <${prefix}-checkbox
38
+ class="multiselect-checkbox"
39
+ part="multiselect-checkbox"
40
+ @click=${(x, c) => c.parentContext.parent.selectCheckboxOne(x)}
41
+ @change=${(x, c) => c.parentContext.parent.changeHandler(c.event)}
42
+ ?current-checked="${(x, c) => c.parentContext.parent.isOptionSelected(x)}"
43
+ ?disabled="${(x, c) => c.parentContext.parent.isOptionDisabled(x)}"
44
+ >
45
+ ${(x, ctx) => ctx.parentContext.parent.getItemLabel(x)}
46
+ </${prefix}-checkbox>
47
+ `)}
48
+ `)}
49
+ </div>
50
+ </div>
51
+ </div>
52
+ `;
53
+ export const categorizedMultiselectTemplate = html `
54
+ ${getPrefixedCategorizedMultiselect()}
55
+ `;
@@ -0,0 +1,3 @@
1
+ export * from './categorized-multiselect';
2
+ export * from './categorized-multiselect.styles';
3
+ export * from './categorized-multiselect.template';
package/dist/esm/index.js CHANGED
@@ -17,6 +17,7 @@ export * from './breadcrumb';
17
17
  export * from './button';
18
18
  export * from './calendar';
19
19
  export * from './card';
20
+ export * from './categorized-multiselect';
20
21
  export * from './checkbox';
21
22
  export * from './combobox';
22
23
  export * from './connection-indicator';
@@ -1,3 +1,4 @@
1
+ export * from './multiselect-consts';
1
2
  export * from './multiselect';
2
3
  export * from './multiselect.styles';
3
4
  export * from './multiselect.template';