@tylertech/forge 2.16.1 → 2.16.2

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 (56) hide show
  1. package/custom-elements.json +8 -24
  2. package/dist/esm/app-bar/help-button/index.js +1 -1
  3. package/dist/esm/app-bar/index.js +1 -1
  4. package/dist/esm/autocomplete/index.js +1 -1
  5. package/dist/esm/chunks/{chunk.26XTVQKW.js → chunk.2NSEMS3F.js} +2 -2
  6. package/dist/esm/chunks/{chunk.6LMDKS5P.js → chunk.44GK7GFN.js} +2 -2
  7. package/dist/esm/chunks/{chunk.6LMDKS5P.js.map → chunk.44GK7GFN.js.map} +1 -1
  8. package/dist/esm/chunks/{chunk.K4M53T3A.js → chunk.4DNQVKCH.js} +2 -2
  9. package/dist/esm/chunks/{chunk.TQCGXWZF.js → chunk.5YLZK4RB.js} +2 -2
  10. package/dist/esm/chunks/{chunk.YUCLBBES.js → chunk.ASJHDPFL.js} +2 -2
  11. package/dist/esm/chunks/{chunk.K4DGAJOM.js → chunk.CDUN4ONU.js} +2 -2
  12. package/dist/esm/chunks/{chunk.P4EW5GAS.js → chunk.D6MLVA5G.js} +2 -2
  13. package/dist/esm/chunks/{chunk.7LI25R6R.js → chunk.ELV22KTH.js} +2 -2
  14. package/dist/esm/chunks/{chunk.REH25ELY.js → chunk.LJU5WSSF.js} +2 -2
  15. package/dist/esm/chunks/{chunk.MUEXD4SD.js → chunk.NSOALSSD.js} +2 -2
  16. package/dist/esm/chunks/chunk.TBY35XZK.js +7 -0
  17. package/dist/esm/chunks/chunk.TBY35XZK.js.map +7 -0
  18. package/dist/esm/chunks/{chunk.UDAWTDPV.js → chunk.V6PXSHJ4.js} +2 -2
  19. package/dist/esm/chunks/{chunk.22OZJNVS.js → chunk.XBW46N2J.js} +2 -2
  20. package/dist/esm/chunks/chunk.ZWTTBW3O.js +7 -0
  21. package/dist/esm/chunks/chunk.ZWTTBW3O.js.map +7 -0
  22. package/dist/esm/index.js +1 -1
  23. package/dist/esm/list-dropdown/index.js +1 -1
  24. package/dist/esm/menu/index.js +1 -1
  25. package/dist/esm/paginator/index.js +1 -1
  26. package/dist/esm/select/core/index.js +1 -1
  27. package/dist/esm/select/index.js +1 -1
  28. package/dist/esm/select/select/index.js +1 -1
  29. package/dist/esm/select/select-dropdown/index.js +1 -1
  30. package/dist/esm/split-view/index.js +1 -1
  31. package/dist/esm/split-view/split-view/index.js +1 -1
  32. package/dist/esm/split-view/split-view-panel/index.js +1 -1
  33. package/dist/esm/time-picker/index.js +1 -1
  34. package/esm/autocomplete/autocomplete-adapter.d.ts +0 -2
  35. package/esm/autocomplete/autocomplete-adapter.js +0 -4
  36. package/esm/autocomplete/autocomplete-foundation.js +0 -11
  37. package/esm/list-dropdown/list-dropdown-adapter.js +1 -1
  38. package/esm/list-dropdown/list-dropdown-utils.d.ts +1 -1
  39. package/esm/list-dropdown/list-dropdown-utils.js +7 -4
  40. package/esm/split-view/split-view-panel/split-view-panel.js +1 -1
  41. package/package.json +1 -1
  42. package/dist/esm/chunks/chunk.KKMKGN2I.js +0 -7
  43. package/dist/esm/chunks/chunk.KKMKGN2I.js.map +0 -7
  44. package/dist/esm/chunks/chunk.VPH7GX4C.js +0 -7
  45. package/dist/esm/chunks/chunk.VPH7GX4C.js.map +0 -7
  46. /package/dist/esm/chunks/{chunk.26XTVQKW.js.map → chunk.2NSEMS3F.js.map} +0 -0
  47. /package/dist/esm/chunks/{chunk.K4M53T3A.js.map → chunk.4DNQVKCH.js.map} +0 -0
  48. /package/dist/esm/chunks/{chunk.TQCGXWZF.js.map → chunk.5YLZK4RB.js.map} +0 -0
  49. /package/dist/esm/chunks/{chunk.YUCLBBES.js.map → chunk.ASJHDPFL.js.map} +0 -0
  50. /package/dist/esm/chunks/{chunk.K4DGAJOM.js.map → chunk.CDUN4ONU.js.map} +0 -0
  51. /package/dist/esm/chunks/{chunk.P4EW5GAS.js.map → chunk.D6MLVA5G.js.map} +0 -0
  52. /package/dist/esm/chunks/{chunk.7LI25R6R.js.map → chunk.ELV22KTH.js.map} +0 -0
  53. /package/dist/esm/chunks/{chunk.REH25ELY.js.map → chunk.LJU5WSSF.js.map} +0 -0
  54. /package/dist/esm/chunks/{chunk.MUEXD4SD.js.map → chunk.NSOALSSD.js.map} +0 -0
  55. /package/dist/esm/chunks/{chunk.UDAWTDPV.js.map → chunk.V6PXSHJ4.js.map} +0 -0
  56. /package/dist/esm/chunks/{chunk.22OZJNVS.js.map → chunk.XBW46N2J.js.map} +0 -0
@@ -75,10 +75,6 @@ export class AutocompleteAdapter extends BaseAdapter {
75
75
  var _a;
76
76
  (_a = this._listDropdown) === null || _a === void 0 ? void 0 : _a.setBusyVisibility(isVisible);
77
77
  }
78
- toggleOptionMultiple(index, selected) {
79
- var _a;
80
- (_a = this._listDropdown) === null || _a === void 0 ? void 0 : _a.toggleOptionMultiple(index, selected);
81
- }
82
78
  setDismissListener(listener) {
83
79
  if (!this._listDropdown || !this._listDropdown.dropdownElement) {
84
80
  return;
@@ -451,11 +451,6 @@ export class AutocompleteFoundation extends ListDropdownAwareFoundation {
451
451
  const value = option ? option.value : '';
452
452
  const label = option ? option.label : '';
453
453
  if (this._multiple) {
454
- const optionIndex = flatOptions.findIndex(o => optionEqualPredicate(o, selectedValue, this._matchKey));
455
- if (optionIndex >= 0) {
456
- const selected = this._selectedOptions.some(o => optionEqualPredicate(o, selectedValue, this._matchKey));
457
- this._adapter.toggleOptionMultiple(optionIndex, selected);
458
- }
459
454
  const selectedOption = getSelectedOption(this._selectedOptions, value);
460
455
  if (selectedOption) {
461
456
  const index = this._selectedOptions.indexOf(selectedOption);
@@ -487,12 +482,6 @@ export class AutocompleteFoundation extends ListDropdownAwareFoundation {
487
482
  if (!Platform.isMobile && keepFocus) {
488
483
  this._adapter.selectInputValue();
489
484
  }
490
- if (this._multiple) {
491
- // If we're in multiselect mode, we need to toggle the selected option
492
- const index = flatOptions.findIndex(o => optionEqualPredicate(o, selectedValue, this._matchKey));
493
- const isSelected = this._values.includes(selectedValue);
494
- this._adapter.toggleOptionMultiple(index, isSelected);
495
- }
496
485
  this._emitChangeEvent();
497
486
  this._tryUpdateDropdownPosition();
498
487
  };
@@ -213,7 +213,7 @@ export class ListDropdownAdapter {
213
213
  if (!this._dropdownElement || !this._listElement) {
214
214
  return;
215
215
  }
216
- createListItems(config, this._listElement, options);
216
+ createListItems(config, this._listElement, options, this._listElement.childElementCount, false);
217
217
  }
218
218
  setBusyVisibility(isVisible) {
219
219
  if (!this._dropdownElement) {
@@ -23,7 +23,7 @@ export declare function createList(config: IListDropdownOpenConfig): IListCompon
23
23
  * Creates the list to place inside of the dropdown.
24
24
  * @param config
25
25
  */
26
- export declare function createListItems(config: IListDropdownOpenConfig, listElement: IListComponent, options?: Array<IListDropdownOption | IListDropdownOptionGroup>): void;
26
+ export declare function createListItems(config: IListDropdownOpenConfig, listElement: IListComponent, options?: Array<IListDropdownOption | IListDropdownOptionGroup>, startIndex?: number, renderSelected?: boolean): void;
27
27
  export declare function createCheckboxElement(selected: boolean): HTMLElement;
28
28
  export declare function createAsyncElement(asyncStyle?: ListDropdownAsyncStyle): HTMLElement;
29
29
  export declare function createBusyElement(): ILinearProgressComponent;
@@ -93,13 +93,13 @@ export function createList(config) {
93
93
  * Creates the list to place inside of the dropdown.
94
94
  * @param config
95
95
  */
96
- export function createListItems(config, listElement, options) {
96
+ export function createListItems(config, listElement, options, startIndex = 0, renderSelected = true) {
97
97
  // Ensure the options are provided in the form a group (if no groups provided, then we have one anonymous group of options)
98
98
  const groups = getOptionsByGroup(options || config.options);
99
99
  const flatOptions = getFlattenedOptions(groups);
100
100
  const limitOptions = config.optionLimit ? true : false;
101
101
  let optionLimit = config.optionLimit || 0;
102
- let optionIndex = 0;
102
+ let optionIdIndex = startIndex;
103
103
  // Iterate over our groups and render the optional headers and options for that group
104
104
  for (const group of groups) {
105
105
  let optionParent = listElement;
@@ -148,12 +148,15 @@ export function createListItems(config, listElement, options) {
148
148
  if (limitOptions && --optionLimit < 0) {
149
149
  break;
150
150
  }
151
- optionIndex++;
152
151
  // Create and configure the list element
153
152
  const isSelected = config.selectedValues ? config.selectedValues.some(v => isDeepEqual(v, option.value)) : false;
153
+ // We don't render selected options that are appended dynamically since those are always displayed at the top of the list
154
+ if (!renderSelected && isSelected) {
155
+ continue;
156
+ }
154
157
  let listItemElement = document.createElement('forge-list-item');
155
158
  listItemElement.value = option.value;
156
- listItemElement.id = `list-dropdown-option-${config.id}-${optionIndex}`;
159
+ listItemElement.id = `list-dropdown-option-${config.id}-${optionIdIndex++}`;
157
160
  listItemElement.style.cursor = 'pointer';
158
161
  if (config.wrapOptionText) {
159
162
  listItemElement.wrap = true;
@@ -14,7 +14,7 @@ import { SplitViewPanelAdapter } from './split-view-panel-adapter';
14
14
  import { IconComponent, IconRegistry } from '../../icon';
15
15
  import { RippleComponent } from '../../ripple';
16
16
  const template = '<template><div class=\"forge-split-view-panel\" id=\"root\" part=\"root\"><div class=\"forge-split-view-panel__handle\" id=\"handle\" part=\"handle\" role=\"separator\" aria-controls=\"content\" aria-grabbed=\"false\" tabindex=\"0\"><forge-icon class=\"forge-split-view-panel__icon\" id=\"icon\" part=\"icon\"></forge-icon><forge-ripple id=\"ripple\" part=\"ripple\"></forge-ripple></div><div class=\"forge-split-view-panel__content\" id=\"content\" part=\"content\" role=\"group\"><slot></slot></div></div></template>';
17
- const styles = '@-webkit-keyframes mdc-ripple-fg-radius-in{from{-webkit-animation-timing-function:cubic-bezier(0.4,0,0.2,1);animation-timing-function:cubic-bezier(0.4,0,0.2,1);-webkit-transform:translate(var(--mdc-ripple-fg-translate-start,0)) scale(1);transform:translate(var(--mdc-ripple-fg-translate-start,0)) scale(1)}to{-webkit-transform:translate(var(--mdc-ripple-fg-translate-end,0)) scale(var(--mdc-ripple-fg-scale,1));transform:translate(var(--mdc-ripple-fg-translate-end,0)) scale(var(--mdc-ripple-fg-scale,1))}}@keyframes mdc-ripple-fg-radius-in{from{-webkit-animation-timing-function:cubic-bezier(0.4,0,0.2,1);animation-timing-function:cubic-bezier(0.4,0,0.2,1);-webkit-transform:translate(var(--mdc-ripple-fg-translate-start,0)) scale(1);transform:translate(var(--mdc-ripple-fg-translate-start,0)) scale(1)}to{-webkit-transform:translate(var(--mdc-ripple-fg-translate-end,0)) scale(var(--mdc-ripple-fg-scale,1));transform:translate(var(--mdc-ripple-fg-translate-end,0)) scale(var(--mdc-ripple-fg-scale,1))}}@-webkit-keyframes mdc-ripple-fg-opacity-in{from{-webkit-animation-timing-function:linear;animation-timing-function:linear;opacity:0}to{opacity:var(--mdc-ripple-fg-opacity, 0)}}@keyframes mdc-ripple-fg-opacity-in{from{-webkit-animation-timing-function:linear;animation-timing-function:linear;opacity:0}to{opacity:var(--mdc-ripple-fg-opacity, 0)}}@-webkit-keyframes mdc-ripple-fg-opacity-out{from{-webkit-animation-timing-function:linear;animation-timing-function:linear;opacity:var(--mdc-ripple-fg-opacity, 0)}to{opacity:0}}@keyframes mdc-ripple-fg-opacity-out{from{-webkit-animation-timing-function:linear;animation-timing-function:linear;opacity:var(--mdc-ripple-fg-opacity, 0)}to{opacity:0}}.mdc-ripple-surface{--mdc-ripple-fg-size:0;--mdc-ripple-left:0;--mdc-ripple-top:0;--mdc-ripple-fg-scale:1;--mdc-ripple-fg-translate-end:0;--mdc-ripple-fg-translate-start:0;-webkit-tap-highlight-color:transparent;will-change:transform,opacity;position:relative;outline:0;overflow:hidden}.mdc-ripple-surface::after,.mdc-ripple-surface::before{position:absolute;border-radius:50%;opacity:0;pointer-events:none;content:\"\"}.mdc-ripple-surface::before{-webkit-transition:opacity 15ms linear,background-color 15ms linear;transition:opacity 15ms linear,background-color 15ms linear;z-index:1;z-index:var(--mdc-ripple-z-index,1)}.mdc-ripple-surface::after{z-index:0;z-index:var(--mdc-ripple-z-index,0)}.mdc-ripple-surface.mdc-ripple-upgraded::before{-webkit-transform:scale(var(--mdc-ripple-fg-scale,1));transform:scale(var(--mdc-ripple-fg-scale,1))}.mdc-ripple-surface.mdc-ripple-upgraded::after{top:0;left:0;-webkit-transform:scale(0);transform:scale(0);-webkit-transform-origin:center center;transform-origin:center center}.mdc-ripple-surface.mdc-ripple-upgraded--unbounded::after{top:var(--mdc-ripple-top,0);left:var(--mdc-ripple-left,0)}.mdc-ripple-surface.mdc-ripple-upgraded--foreground-activation::after{-webkit-animation:mdc-ripple-fg-radius-in 225ms forwards,mdc-ripple-fg-opacity-in 75ms forwards;animation:mdc-ripple-fg-radius-in 225ms forwards,mdc-ripple-fg-opacity-in 75ms forwards}.mdc-ripple-surface.mdc-ripple-upgraded--foreground-deactivation::after{-webkit-animation:mdc-ripple-fg-opacity-out 150ms;animation:mdc-ripple-fg-opacity-out 150ms;-webkit-transform:translate(var(--mdc-ripple-fg-translate-end,0)) scale(var(--mdc-ripple-fg-scale,1));transform:translate(var(--mdc-ripple-fg-translate-end,0)) scale(var(--mdc-ripple-fg-scale,1))}.mdc-ripple-surface::after,.mdc-ripple-surface::before{top:calc(50% - 100%);left:calc(50% - 100%);width:200%;height:200%}.mdc-ripple-surface.mdc-ripple-upgraded::after{width:var(--mdc-ripple-fg-size,100%);height:var(--mdc-ripple-fg-size,100%)}.mdc-ripple-surface[data-mdc-ripple-is-unbounded],.mdc-ripple-upgraded--unbounded{overflow:visible}.mdc-ripple-surface[data-mdc-ripple-is-unbounded]::after,.mdc-ripple-surface[data-mdc-ripple-is-unbounded]::before,.mdc-ripple-upgraded--unbounded::after,.mdc-ripple-upgraded--unbounded::before{top:calc(50% - 50%);left:calc(50% - 50%);width:100%;height:100%}.mdc-ripple-surface[data-mdc-ripple-is-unbounded].mdc-ripple-upgraded::after,.mdc-ripple-surface[data-mdc-ripple-is-unbounded].mdc-ripple-upgraded::before,.mdc-ripple-upgraded--unbounded.mdc-ripple-upgraded::after,.mdc-ripple-upgraded--unbounded.mdc-ripple-upgraded::before{top:var(--mdc-ripple-top,calc(50% - 50%));left:var(--mdc-ripple-left,calc(50% - 50%));width:var(--mdc-ripple-fg-size,100%);height:var(--mdc-ripple-fg-size,100%)}.mdc-ripple-surface[data-mdc-ripple-is-unbounded].mdc-ripple-upgraded::after,.mdc-ripple-upgraded--unbounded.mdc-ripple-upgraded::after{width:var(--mdc-ripple-fg-size,100%);height:var(--mdc-ripple-fg-size,100%)}.mdc-ripple-surface::after,.mdc-ripple-surface::before{background-color:#000;background-color:var(--mdc-ripple-color,#000)}.mdc-ripple-surface.mdc-ripple-surface--hover::before,.mdc-ripple-surface:hover::before{opacity:.04;opacity:var(--mdc-ripple-hover-opacity, .04)}.mdc-ripple-surface.mdc-ripple-upgraded--background-focused::before,.mdc-ripple-surface:not(.mdc-ripple-upgraded):focus::before{-webkit-transition-duration:75ms;transition-duration:75ms;opacity:.12;opacity:var(--mdc-ripple-focus-opacity, .12)}.mdc-ripple-surface:not(.mdc-ripple-upgraded)::after{-webkit-transition:opacity 150ms linear;transition:opacity 150ms linear}.mdc-ripple-surface:not(.mdc-ripple-upgraded):active::after{-webkit-transition-duration:75ms;transition-duration:75ms;opacity:.12;opacity:var(--mdc-ripple-press-opacity, .12)}.mdc-ripple-surface.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-ripple-surface::after,.mdc-ripple-surface::before{--mdc-ripple-color:var(--mdc-theme-on-surface)}.forge-split-view-panel{display:-webkit-box;display:flex;width:100%;height:100%;overflow:hidden;contain:paint size}.forge-split-view-panel__handle{color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-light,rgba(0,0,0,.54));background-color:#e0e0e0;background-color:var(--forge-theme-border-color,#e0e0e0);display:-webkit-box;display:flex;flex-shrink:0;-webkit-box-pack:center;justify-content:center;-webkit-box-align:center;align-items:center;outline:0}.forge-split-view-panel__content{-webkit-box-flex:1;flex:1;overflow:hidden}.forge-split-view-panel--closed{display:none}.forge-split-view-panel--disabled #handle{pointer-events:none}.forge-split-view-panel--disabled .forge-split-view-panel__icon{display:none}.forge-split-view-panel[orientation=horizontal]{min-width:8px;min-width:var(--forge-split-view-handle-width,8px);width:calc(var(--forge-split-view-panel-size,unset) + var(--forge-split-view-handle-width,8px));-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row}.forge-split-view-panel[orientation=horizontal] .forge-split-view-panel__handle{width:8px;width:var(--forge-split-view-handle-width,8px);cursor:var(--forge-split-view-panel-cursor)}.forge-split-view-panel[orientation=horizontal].forge-split-view-panel--closing[resizable=end]{position:absolute;top:0;left:0;-webkit-animation-name:un5krnz;animation-name:un5krnz;-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-timing-function:cubic-bezier(0.4,0,0.2,1);animation-timing-function:cubic-bezier(0.4,0,0.2,1)}@-webkit-keyframes un5krnz{from{-webkit-transform:none;transform:none}to{-webkit-transform:translateX(-100%);transform:translateX(-100%)}}@keyframes un5krnz{from{-webkit-transform:none;transform:none}to{-webkit-transform:translateX(-100%);transform:translateX(-100%)}}.forge-split-view-panel[orientation=horizontal].forge-split-view-panel--closing[resizable=start]{position:absolute;top:0;right:0;-webkit-animation-name:un5kror;animation-name:un5kror;-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-timing-function:cubic-bezier(0.4,0,0.2,1);animation-timing-function:cubic-bezier(0.4,0,0.2,1)}@-webkit-keyframes un5kror{from{-webkit-transform:none;transform:none}to{-webkit-transform:translateX(100%);transform:translateX(100%)}}@keyframes un5kror{from{-webkit-transform:none;transform:none}to{-webkit-transform:translateX(100%);transform:translateX(100%)}}.forge-split-view-panel[orientation=horizontal].forge-split-view-panel--opening[resizable=end]{position:absolute;top:0;left:0;-webkit-animation-name:un5kroy;animation-name:un5kroy;-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-timing-function:cubic-bezier(0.4,0,0.2,1);animation-timing-function:cubic-bezier(0.4,0,0.2,1);animation-direction:reverse}@-webkit-keyframes un5kroy{from{-webkit-transform:none;transform:none}to{-webkit-transform:translateX(-100%);transform:translateX(-100%)}}@keyframes un5kroy{from{-webkit-transform:none;transform:none}to{-webkit-transform:translateX(-100%);transform:translateX(-100%)}}.forge-split-view-panel[orientation=horizontal].forge-split-view-panel--opening[resizable=start]{position:absolute;top:0;right:0;-webkit-animation-name:un5krpx;animation-name:un5krpx;-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-timing-function:cubic-bezier(0.4,0,0.2,1);animation-timing-function:cubic-bezier(0.4,0,0.2,1);animation-direction:reverse}@-webkit-keyframes un5krpx{from{-webkit-transform:none;transform:none}to{-webkit-transform:translateX(100%);transform:translateX(100%)}}@keyframes un5krpx{from{-webkit-transform:none;transform:none}to{-webkit-transform:translateX(100%);transform:translateX(100%)}}.forge-split-view-panel[orientation=vertical]{min-height:8px;min-height:var(--forge-split-view-handle-width,8px);height:calc(var(--forge-split-view-panel-size,unset) + var(--forge-split-view-handle-width,8px));-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column}.forge-split-view-panel[orientation=vertical] .forge-split-view-panel__handle{height:8px;height:var(--forge-split-view-handle-width,8px);cursor:var(--forge-split-view-panel-cursor)}.forge-split-view-panel[orientation=vertical].forge-split-view-panel--closing[resizable=end]{position:absolute;top:0;left:0;-webkit-animation-name:un5krqv;animation-name:un5krqv;-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-timing-function:cubic-bezier(0.4,0,0.2,1);animation-timing-function:cubic-bezier(0.4,0,0.2,1)}@-webkit-keyframes un5krqv{from{-webkit-transform:none;transform:none}to{-webkit-transform:translateY(-100%);transform:translateY(-100%)}}@keyframes un5krqv{from{-webkit-transform:none;transform:none}to{-webkit-transform:translateY(-100%);transform:translateY(-100%)}}.forge-split-view-panel[orientation=vertical].forge-split-view-panel--closing[resizable=start]{position:absolute;bottom:0;left:0;-webkit-animation-name:un5krqx;animation-name:un5krqx;-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-timing-function:cubic-bezier(0.4,0,0.2,1);animation-timing-function:cubic-bezier(0.4,0,0.2,1)}@-webkit-keyframes un5krqx{from{-webkit-transform:none;transform:none}to{-webkit-transform:translateY(100%);transform:translateY(100%)}}@keyframes un5krqx{from{-webkit-transform:none;transform:none}to{-webkit-transform:translateY(100%);transform:translateY(100%)}}.forge-split-view-panel[orientation=vertical].forge-split-view-panel--opening[resizable=end]{position:absolute;top:0;left:0;-webkit-animation-name:un5krru;animation-name:un5krru;-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-timing-function:cubic-bezier(0.4,0,0.2,1);animation-timing-function:cubic-bezier(0.4,0,0.2,1);animation-direction:reverse}@-webkit-keyframes un5krru{from{-webkit-transform:none;transform:none}to{-webkit-transform:translateY(-100%);transform:translateY(-100%)}}@keyframes un5krru{from{-webkit-transform:none;transform:none}to{-webkit-transform:translateY(-100%);transform:translateY(-100%)}}.forge-split-view-panel[orientation=vertical].forge-split-view-panel--opening[resizable=start]{position:absolute;bottom:0;left:0;-webkit-animation-name:un5krs8;animation-name:un5krs8;-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-timing-function:cubic-bezier(0.4,0,0.2,1);animation-timing-function:cubic-bezier(0.4,0,0.2,1);animation-direction:reverse}@-webkit-keyframes un5krs8{from{-webkit-transform:none;transform:none}to{-webkit-transform:translateY(100%);transform:translateY(100%)}}@keyframes un5krs8{from{-webkit-transform:none;transform:none}to{-webkit-transform:translateY(100%);transform:translateY(100%)}}:host{z-index:var(--forge-split-view-animating-layer)!important;display:block;position:relative;height:100%;width:100%;-webkit-box-flex:0;flex:0}:host([hidden]){display:none}:host(:not([resizable=start],[resizable=end])){-webkit-box-flex:1;flex:1}:host(:not([resizable=start],[resizable=end])) .forge-split-view-panel{width:100%;height:100%;min-width:0;min-height:0}:host(:not([resizable=start],[resizable=end])) .forge-split-view-panel__handle{display:none}';
17
+ const styles = '@-webkit-keyframes mdc-ripple-fg-radius-in{from{-webkit-animation-timing-function:cubic-bezier(0.4,0,0.2,1);animation-timing-function:cubic-bezier(0.4,0,0.2,1);-webkit-transform:translate(var(--mdc-ripple-fg-translate-start,0)) scale(1);transform:translate(var(--mdc-ripple-fg-translate-start,0)) scale(1)}to{-webkit-transform:translate(var(--mdc-ripple-fg-translate-end,0)) scale(var(--mdc-ripple-fg-scale,1));transform:translate(var(--mdc-ripple-fg-translate-end,0)) scale(var(--mdc-ripple-fg-scale,1))}}@keyframes mdc-ripple-fg-radius-in{from{-webkit-animation-timing-function:cubic-bezier(0.4,0,0.2,1);animation-timing-function:cubic-bezier(0.4,0,0.2,1);-webkit-transform:translate(var(--mdc-ripple-fg-translate-start,0)) scale(1);transform:translate(var(--mdc-ripple-fg-translate-start,0)) scale(1)}to{-webkit-transform:translate(var(--mdc-ripple-fg-translate-end,0)) scale(var(--mdc-ripple-fg-scale,1));transform:translate(var(--mdc-ripple-fg-translate-end,0)) scale(var(--mdc-ripple-fg-scale,1))}}@-webkit-keyframes mdc-ripple-fg-opacity-in{from{-webkit-animation-timing-function:linear;animation-timing-function:linear;opacity:0}to{opacity:var(--mdc-ripple-fg-opacity, 0)}}@keyframes mdc-ripple-fg-opacity-in{from{-webkit-animation-timing-function:linear;animation-timing-function:linear;opacity:0}to{opacity:var(--mdc-ripple-fg-opacity, 0)}}@-webkit-keyframes mdc-ripple-fg-opacity-out{from{-webkit-animation-timing-function:linear;animation-timing-function:linear;opacity:var(--mdc-ripple-fg-opacity, 0)}to{opacity:0}}@keyframes mdc-ripple-fg-opacity-out{from{-webkit-animation-timing-function:linear;animation-timing-function:linear;opacity:var(--mdc-ripple-fg-opacity, 0)}to{opacity:0}}.mdc-ripple-surface{--mdc-ripple-fg-size:0;--mdc-ripple-left:0;--mdc-ripple-top:0;--mdc-ripple-fg-scale:1;--mdc-ripple-fg-translate-end:0;--mdc-ripple-fg-translate-start:0;-webkit-tap-highlight-color:transparent;will-change:transform,opacity;position:relative;outline:0;overflow:hidden}.mdc-ripple-surface::after,.mdc-ripple-surface::before{position:absolute;border-radius:50%;opacity:0;pointer-events:none;content:\"\"}.mdc-ripple-surface::before{-webkit-transition:opacity 15ms linear,background-color 15ms linear;transition:opacity 15ms linear,background-color 15ms linear;z-index:1;z-index:var(--mdc-ripple-z-index,1)}.mdc-ripple-surface::after{z-index:0;z-index:var(--mdc-ripple-z-index,0)}.mdc-ripple-surface.mdc-ripple-upgraded::before{-webkit-transform:scale(var(--mdc-ripple-fg-scale,1));transform:scale(var(--mdc-ripple-fg-scale,1))}.mdc-ripple-surface.mdc-ripple-upgraded::after{top:0;left:0;-webkit-transform:scale(0);transform:scale(0);-webkit-transform-origin:center center;transform-origin:center center}.mdc-ripple-surface.mdc-ripple-upgraded--unbounded::after{top:var(--mdc-ripple-top,0);left:var(--mdc-ripple-left,0)}.mdc-ripple-surface.mdc-ripple-upgraded--foreground-activation::after{-webkit-animation:mdc-ripple-fg-radius-in 225ms forwards,mdc-ripple-fg-opacity-in 75ms forwards;animation:mdc-ripple-fg-radius-in 225ms forwards,mdc-ripple-fg-opacity-in 75ms forwards}.mdc-ripple-surface.mdc-ripple-upgraded--foreground-deactivation::after{-webkit-animation:mdc-ripple-fg-opacity-out 150ms;animation:mdc-ripple-fg-opacity-out 150ms;-webkit-transform:translate(var(--mdc-ripple-fg-translate-end,0)) scale(var(--mdc-ripple-fg-scale,1));transform:translate(var(--mdc-ripple-fg-translate-end,0)) scale(var(--mdc-ripple-fg-scale,1))}.mdc-ripple-surface::after,.mdc-ripple-surface::before{top:calc(50% - 100%);left:calc(50% - 100%);width:200%;height:200%}.mdc-ripple-surface.mdc-ripple-upgraded::after{width:var(--mdc-ripple-fg-size,100%);height:var(--mdc-ripple-fg-size,100%)}.mdc-ripple-surface[data-mdc-ripple-is-unbounded],.mdc-ripple-upgraded--unbounded{overflow:visible}.mdc-ripple-surface[data-mdc-ripple-is-unbounded]::after,.mdc-ripple-surface[data-mdc-ripple-is-unbounded]::before,.mdc-ripple-upgraded--unbounded::after,.mdc-ripple-upgraded--unbounded::before{top:calc(50% - 50%);left:calc(50% - 50%);width:100%;height:100%}.mdc-ripple-surface[data-mdc-ripple-is-unbounded].mdc-ripple-upgraded::after,.mdc-ripple-surface[data-mdc-ripple-is-unbounded].mdc-ripple-upgraded::before,.mdc-ripple-upgraded--unbounded.mdc-ripple-upgraded::after,.mdc-ripple-upgraded--unbounded.mdc-ripple-upgraded::before{top:var(--mdc-ripple-top,calc(50% - 50%));left:var(--mdc-ripple-left,calc(50% - 50%));width:var(--mdc-ripple-fg-size,100%);height:var(--mdc-ripple-fg-size,100%)}.mdc-ripple-surface[data-mdc-ripple-is-unbounded].mdc-ripple-upgraded::after,.mdc-ripple-upgraded--unbounded.mdc-ripple-upgraded::after{width:var(--mdc-ripple-fg-size,100%);height:var(--mdc-ripple-fg-size,100%)}.mdc-ripple-surface::after,.mdc-ripple-surface::before{background-color:#000;background-color:var(--mdc-ripple-color,#000)}.mdc-ripple-surface.mdc-ripple-surface--hover::before,.mdc-ripple-surface:hover::before{opacity:.04;opacity:var(--mdc-ripple-hover-opacity, .04)}.mdc-ripple-surface.mdc-ripple-upgraded--background-focused::before,.mdc-ripple-surface:not(.mdc-ripple-upgraded):focus::before{-webkit-transition-duration:75ms;transition-duration:75ms;opacity:.12;opacity:var(--mdc-ripple-focus-opacity, .12)}.mdc-ripple-surface:not(.mdc-ripple-upgraded)::after{-webkit-transition:opacity 150ms linear;transition:opacity 150ms linear}.mdc-ripple-surface:not(.mdc-ripple-upgraded):active::after{-webkit-transition-duration:75ms;transition-duration:75ms;opacity:.12;opacity:var(--mdc-ripple-press-opacity, .12)}.mdc-ripple-surface.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-ripple-surface::after,.mdc-ripple-surface::before{--mdc-ripple-color:var(--mdc-theme-on-surface)}.forge-split-view-panel{display:-webkit-box;display:flex;width:100%;height:100%;overflow:hidden;contain:paint size}.forge-split-view-panel__handle{color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-light,rgba(0,0,0,.54));background-color:#e0e0e0;background-color:var(--forge-theme-border-color,#e0e0e0);display:-webkit-box;display:flex;flex-shrink:0;-webkit-box-pack:center;justify-content:center;-webkit-box-align:center;align-items:center;outline:0}.forge-split-view-panel__content{-webkit-box-flex:1;flex:1;overflow:hidden}.forge-split-view-panel--closed{display:none}.forge-split-view-panel--disabled #handle{pointer-events:none}.forge-split-view-panel--disabled .forge-split-view-panel__icon{display:none}.forge-split-view-panel[orientation=horizontal]{min-width:8px;min-width:var(--forge-split-view-handle-width,8px);width:calc(var(--forge-split-view-panel-size,unset) + var(--forge-split-view-handle-width,8px));-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row}.forge-split-view-panel[orientation=horizontal] .forge-split-view-panel__handle{width:8px;width:var(--forge-split-view-handle-width,8px);cursor:var(--forge-split-view-panel-cursor)}.forge-split-view-panel[orientation=horizontal].forge-split-view-panel--closing[resizable=end]{position:absolute;top:0;left:0;-webkit-animation-name:uak0x0l;animation-name:uak0x0l;-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-timing-function:cubic-bezier(0.4,0,0.2,1);animation-timing-function:cubic-bezier(0.4,0,0.2,1)}@-webkit-keyframes uak0x0l{from{-webkit-transform:none;transform:none}to{-webkit-transform:translateX(-100%);transform:translateX(-100%)}}@keyframes uak0x0l{from{-webkit-transform:none;transform:none}to{-webkit-transform:translateX(-100%);transform:translateX(-100%)}}.forge-split-view-panel[orientation=horizontal].forge-split-view-panel--closing[resizable=start]{position:absolute;top:0;right:0;-webkit-animation-name:uak0x1i;animation-name:uak0x1i;-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-timing-function:cubic-bezier(0.4,0,0.2,1);animation-timing-function:cubic-bezier(0.4,0,0.2,1)}@-webkit-keyframes uak0x1i{from{-webkit-transform:none;transform:none}to{-webkit-transform:translateX(100%);transform:translateX(100%)}}@keyframes uak0x1i{from{-webkit-transform:none;transform:none}to{-webkit-transform:translateX(100%);transform:translateX(100%)}}.forge-split-view-panel[orientation=horizontal].forge-split-view-panel--opening[resizable=end]{position:absolute;top:0;left:0;-webkit-animation-name:uak0x1x;animation-name:uak0x1x;-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-timing-function:cubic-bezier(0.4,0,0.2,1);animation-timing-function:cubic-bezier(0.4,0,0.2,1);animation-direction:reverse}@-webkit-keyframes uak0x1x{from{-webkit-transform:none;transform:none}to{-webkit-transform:translateX(-100%);transform:translateX(-100%)}}@keyframes uak0x1x{from{-webkit-transform:none;transform:none}to{-webkit-transform:translateX(-100%);transform:translateX(-100%)}}.forge-split-view-panel[orientation=horizontal].forge-split-view-panel--opening[resizable=start]{position:absolute;top:0;right:0;-webkit-animation-name:uak0x2o;animation-name:uak0x2o;-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-timing-function:cubic-bezier(0.4,0,0.2,1);animation-timing-function:cubic-bezier(0.4,0,0.2,1);animation-direction:reverse}@-webkit-keyframes uak0x2o{from{-webkit-transform:none;transform:none}to{-webkit-transform:translateX(100%);transform:translateX(100%)}}@keyframes uak0x2o{from{-webkit-transform:none;transform:none}to{-webkit-transform:translateX(100%);transform:translateX(100%)}}.forge-split-view-panel[orientation=vertical]{min-height:8px;min-height:var(--forge-split-view-handle-width,8px);height:calc(var(--forge-split-view-panel-size,unset) + var(--forge-split-view-handle-width,8px));-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column}.forge-split-view-panel[orientation=vertical] .forge-split-view-panel__handle{height:8px;height:var(--forge-split-view-handle-width,8px);cursor:var(--forge-split-view-panel-cursor)}.forge-split-view-panel[orientation=vertical].forge-split-view-panel--closing[resizable=end]{position:absolute;top:0;left:0;-webkit-animation-name:uak0x32;animation-name:uak0x32;-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-timing-function:cubic-bezier(0.4,0,0.2,1);animation-timing-function:cubic-bezier(0.4,0,0.2,1)}@-webkit-keyframes uak0x32{from{-webkit-transform:none;transform:none}to{-webkit-transform:translateY(-100%);transform:translateY(-100%)}}@keyframes uak0x32{from{-webkit-transform:none;transform:none}to{-webkit-transform:translateY(-100%);transform:translateY(-100%)}}.forge-split-view-panel[orientation=vertical].forge-split-view-panel--closing[resizable=start]{position:absolute;bottom:0;left:0;-webkit-animation-name:uak0x3r;animation-name:uak0x3r;-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-timing-function:cubic-bezier(0.4,0,0.2,1);animation-timing-function:cubic-bezier(0.4,0,0.2,1)}@-webkit-keyframes uak0x3r{from{-webkit-transform:none;transform:none}to{-webkit-transform:translateY(100%);transform:translateY(100%)}}@keyframes uak0x3r{from{-webkit-transform:none;transform:none}to{-webkit-transform:translateY(100%);transform:translateY(100%)}}.forge-split-view-panel[orientation=vertical].forge-split-view-panel--opening[resizable=end]{position:absolute;top:0;left:0;-webkit-animation-name:uak0x3w;animation-name:uak0x3w;-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-timing-function:cubic-bezier(0.4,0,0.2,1);animation-timing-function:cubic-bezier(0.4,0,0.2,1);animation-direction:reverse}@-webkit-keyframes uak0x3w{from{-webkit-transform:none;transform:none}to{-webkit-transform:translateY(-100%);transform:translateY(-100%)}}@keyframes uak0x3w{from{-webkit-transform:none;transform:none}to{-webkit-transform:translateY(-100%);transform:translateY(-100%)}}.forge-split-view-panel[orientation=vertical].forge-split-view-panel--opening[resizable=start]{position:absolute;bottom:0;left:0;-webkit-animation-name:uak0x4e;animation-name:uak0x4e;-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-timing-function:cubic-bezier(0.4,0,0.2,1);animation-timing-function:cubic-bezier(0.4,0,0.2,1);animation-direction:reverse}@-webkit-keyframes uak0x4e{from{-webkit-transform:none;transform:none}to{-webkit-transform:translateY(100%);transform:translateY(100%)}}@keyframes uak0x4e{from{-webkit-transform:none;transform:none}to{-webkit-transform:translateY(100%);transform:translateY(100%)}}:host{z-index:var(--forge-split-view-animating-layer)!important;display:block;position:relative;height:100%;width:100%;-webkit-box-flex:0;flex:0}:host([hidden]){display:none}:host(:not([resizable=start],[resizable=end])){-webkit-box-flex:1;flex:1}:host(:not([resizable=start],[resizable=end])) .forge-split-view-panel{width:100%;height:100%;min-width:0;min-height:0}:host(:not([resizable=start],[resizable=end])) .forge-split-view-panel__handle{display:none}';
18
18
  /**
19
19
  * The custom element class behind the `<forge-split-view-panel>` element.
20
20
  *
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tylertech/forge",
3
3
  "description": "Tyler Forge™ Web Components library",
4
- "version": "2.16.1",
4
+ "version": "2.16.2",
5
5
  "author": "Tyler Technologies, Inc.",
6
6
  "license": "Apache-2.0",
7
7
  "repository": {
@@ -1,7 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2023 Tyler Technologies, Inc.
4
- * License: Apache-2.0
5
- */
6
- import{a as J}from"./chunk.KU5CXXGS.js";import{a as Y,b as H}from"./chunk.RG6CDWEX.js";import{a as k}from"./chunk.6YPD6CQM.js";import{a as X}from"./chunk.VAKNDCLP.js";import{a as z}from"./chunk.4DAIIJ37.js";import{a as b}from"./chunk.V7WKXEZC.js";import{g,h as O}from"./chunk.MZLPUI6R.js";import{a as j,d as q}from"./chunk.JHBCYICS.js";import{d as $}from"./chunk.BE7PZANN.js";import{g as B}from"./chunk.Y4GKBJGI.js";import{d as R,e as P,f as M,i as U,x as K}from"./chunk.PN26D52V.js";import{b as h,d as V,h as A,j as v,n as L,p as G}from"./chunk.J2M2MXP2.js";import{a as x}from"./chunk.MCIQXNKY.js";var ce={POPUP_CLASSES:"popup-classes",OPTION_LIMIT:"option-limit",OBSERVE_SCROLL:"observe-scroll",OBSERVE_SCROLL_THRESHOLD:"observe-scroll-threshold",SYNC_POPUP_WIDTH:"sync-popup-width",CONSTRAIN_POPUP_WIDTH:"constrain-popup-width",WRAP_OPTION_TEXT:"wrap-option-text",CHECKBOX_ELEMENT:"data-list-dropdown-checkbox",DATA_ALLOW_FOCUS:"data-list-dropdown-allow-focus"},ue={GROUP_WRAPPER:"forge-list-dropdown__group-wrapper"},m={attributes:ce,classes:ue},Q={options:[],syncWidth:!1,selectedValues:[],multiple:!1},Z=(o=>(o.None="none",o.Standard="standard",o.Menu="menu",o))(Z||{}),ee=(t=>(t.Spinner="spinner",t.Skeleton="skeleton",t))(ee||{});var I=class{constructor(){this._listenerMap=new Map}_emit(e,t){let o=this._listenerMap.get(e);o&&o.length&&o.forEach(n=>n({type:e,data:t}))}hasListeners(e){return e?this._listenerMap.has(e):this._listenerMap.size>0}addListener(e,t){if(!this._listenerMap.has(e))this._listenerMap.set(e,[t]);else{let o=this._listenerMap.get(e);o&&o.push(t)}}removeListener(e,t){let o=this._listenerMap.get(e);o&&o.length&&o.includes(t)&&(o.splice(o.indexOf(t),1),o.length||this._listenerMap.delete(e))}};var _;(function(i){i.Up="up",i.Down="down",i.Left="left",i.Right="right"})(_||(_={}));var u;(function(i){i.Scroll="scroll",i.Scrolled="scrolled",i.ScrolledStart="scrolled-start",i.ScrolledEnd="scrolled-end"})(u||(u={}));var me=100,E=class extends I{constructor(e,t={}){super(),this._element=e,this._config=t,this._axis="vertical",this._scrollThreshold=0,this._lastScrollPosition=0,this._lastScrollTop=0,this._lastScrollLeft=0,this._isListening=!1,this._initialize()}destroy(){this.stop()}start(){this._isListening||(this._element.addEventListener("scroll",this._scrollListener),this._isListening=!0)}stop(){this._element.removeEventListener("scroll",this._scrollListener),this._isListening=!1}_initialize(){if(this._config.throttle){let e=this._config.throttleTime||me;this._scrollListener=G(()=>this._onScroll(),e)}else this._scrollListener=()=>this._onScroll();(!h(this._config.paused)||!this._config.paused)&&this.start(),h(this._config.axis)&&(this._axis=this._config.axis),h(this._config.scrollThreshold)&&V(this._config.scrollThreshold)&&(this._scrollThreshold=this._config.scrollThreshold)}_isScrollAxis(){let e=this._lastScrollTop!==this._element.scrollTop,t=this._lastScrollLeft!==this._element.scrollLeft;return this._axis==="vertical"&&e||this._axis==="horizontal"&&t}_onScroll(){if(!this._isScrollAxis())return;let e=this.scrollPosition,t=this._lastScrollPosition-e<0?this._axis==="vertical"?_.Down:_.Right:this._axis==="vertical"?_.Up:_.Left;this._emit(u.Scroll,{direction:t,position:e}),this._lastScrollPosition<=this._scrollThreshold&&e>this._scrollThreshold?this._emit(u.Scrolled,!0):this._lastScrollPosition>=this._scrollThreshold&&(this._scrollThreshold>0?e<this._scrollThreshold:e===0)&&this._emit(u.Scrolled,!1);let o=Math.round(e-this._scrollThreshold),n=Math.round(this.scrollSize-e);this._lastScrollPosition>=this._scrollThreshold&&o<=0?this._emit(u.ScrolledStart):this._lastScrollPosition<=this.scrollSize-this._scrollThreshold&&n<=this._scrollThreshold&&this._emit(u.ScrolledEnd),this._lastScrollPosition=e||0,this._lastScrollTop=this._element.scrollTop||0,this._lastScrollLeft=this._element.scrollLeft||0}get scrollPosition(){return this._axis==="vertical"?this._element.scrollTop:this._element.scrollLeft}get isScrolled(){return this.scrollPosition>this._scrollThreshold}get isScrolledStart(){return this.scrollPosition===0}get isScrolledEnd(){return this.scrollPosition===this._element.scrollWidth}get isScrollable(){return this._axis==="vertical"?this._element.scrollHeight>this._element.clientHeight:this._element.scrollWidth>this._element.clientWidth}get scrollSize(){return(this._axis==="vertical"?this._element.scrollHeight:this._element.scrollWidth)-this.elementSize}get elementSize(){return this._axis==="vertical"?this._element.clientHeight:this._element.clientWidth}setScrollPosition(e){this._axis==="vertical"?this._element.scrollTop=e:this._element.scrollLeft=e}};function ie(i,e){let t=he(i,e),o=`list-dropdown-popup-${i.id}`;switch(t.addEventListener("mousedown",n=>{let a=z(n);if(a.find(c=>c.nodeType===1&&c.hasAttribute(m.attributes.DATA_ALLOW_FOCUS)))return;a.find(c=>c.id===o||c.id===i.id)&&n.preventDefault()}),i.type){case"menu":t.setAttribute("role","menu"),t.setAttribute("aria-orientation","vertical");break;default:t.setAttribute("role","listbox")}return i.id&&(t.id=o),i.popupClasses&&M(i.popupClasses,t),t}function he(i,e){var o;let t=document.createElement("forge-popup");switch(t.targetElement=e,t.placement=i.popupPlacement||"bottom-start",t.manageFocus=!1,t.static=!!i.popupStatic,(o=i.popupFallbackPlacements)!=null&&o.length&&(t.fallbackPlacements=i.popupFallbackPlacements),i.constrainViewportWidth&&t.setAttribute(b.attributes.CONSTRAIN_VIEWPORT_WIDTH,""),i.popupOffset&&(t.offset=i.popupOffset),i.type){case"menu":t.animationType="menu";break;case"none":t.animationType="none";break;default:t.animationType="dropdown"}return t}function oe(i){let e=document.createElement(Y.elementName);return e.id=`list-dropdown-list-${i.id}`,e.propagateClick=!1,e}function w(i,e,t){let o=be(t||i.options),n=N(o),a=!!i.optionLimit,p=i.optionLimit||0,f=0;for(let c of o){let T=e;if(c.builder&&typeof c.builder=="function"){let s=c.builder(c);if(s){let d=document.createElement("div");d.classList.add(m.classes.GROUP_WRAPPER),T=d,typeof s=="string"?d.innerHTML=s:s instanceof HTMLElement&&d.appendChild(s),e.appendChild(d)}}else if(c.text){let s=document.createElement("div");s.classList.add(m.classes.GROUP_WRAPPER);let d=document.createElement("div");d.textContent=c.text,d.classList.add("forge-typography--overline"),d.style.fontFamily="Roboto,sans-serif",d.style.fontSize="0.75rem",d.style.lineHeight="2rem",d.style.letterSpacing="0.16667em",d.style.fontWeight="500",d.style.margin="4px 8px",T=s,s.appendChild(d),e.appendChild(s)}for(let s of c.options){if(s.divider){let r=_e();e.appendChild(r);continue}if(a&&--p<0)break;f++;let d=i.selectedValues?i.selectedValues.some(r=>L(r,s.value)):!1,l=document.createElement("forge-list-item");switch(l.value=s.value,l.id=`list-dropdown-option-${i.id}-${f}`,l.style.cursor="pointer",i.wrapOptionText&&(l.wrap=!0),s.optionClass&&(typeof s.optionClass=="string"||Array.isArray(s.optionClass)&&s.optionClass.length)&&M(s.optionClass,l),i.type){case"menu":l.setAttribute("role","menuitem");break;case"none":break;default:l.setAttribute("role","option")}if(i.dense&&(l.dense=!0),i.optionBuilder&&typeof i.optionBuilder=="function"){let r=i.optionBuilder(s,l);r&&(typeof r=="string"?l.innerHTML=r:l.appendChild(r))}else if(typeof i.transform!="function")l.textContent=s.label||"";else{let r=i.transform(s.label);typeof r=="string"?l.textContent=r:typeof r=="object"&&r.nodeType!==void 0&&l.appendChild(r)}if(i.multiple){let r=y(d);l.appendChild(r),l.setAttribute("aria-selected",`${d}`),l.setAttribute("aria-checked",`${d}`)}if(s.elementAttributes&&s.elementAttributes.forEach((r,F)=>{l.setAttribute(F,r)}),s.leadingBuilder){let r=s.leadingBuilder();v(r)&&(r.slot="leading",l.appendChild(r))}else if(s.leadingIcon){let r=te(s.leadingIconType,s.leadingIcon,s.leadingIconClass||i.iconClass);r.slot="leading",l.appendChild(r)}if(s.trailingBuilder){let r=s.trailingBuilder();v(r)&&(r.slot="trailing",l.appendChild(r))}else if(s.trailingIcon){let r=te(s.trailingIconType,s.trailingIcon,s.trailingIconClass||i.iconClass);r.slot="trailing",l.appendChild(r)}if(s.disabled?(l.disabled=s.disabled,l.setAttribute("aria-disabled","true")):(l.style.cursor="pointer",l.setAttribute("aria-disabled","false")),d&&(l.selected=!0),l.setAttribute("aria-selected",d?"true":"false"),!s.disabled&&typeof i.cascadingElementFactory=="function"&&Array.isArray(s.options)&&s.options.length){let r=document.createElement("forge-icon");r.name="arrow_right",r.slot="trailing",l.appendChild(r);let de={index:n.filter(ae=>!ae.divider).indexOf(s),options:s.options,parentValue:s.value},W=i.cascadingElementFactory.call(null,de);W.appendChild(l),l=W}T.appendChild(l)}}}function y(i){let e=document.createElement("forge-icon");return e.setAttribute(m.attributes.CHECKBOX_ELEMENT,""),e.name=i?O.name:g.name,e.slot="leading",e.style.marginRight="16px",e.style.verticalAlign="middle",e}function _e(){let i=document.createElement("forge-divider");return i.setAttribute("aria-hidden","true"),i}function te(i="font",e,t){if(i==="component"){let n=document.createElement("forge-icon");return t&&n.classList.add(t),n.setAttribute("aria-hidden","true"),n.name=e,n}let o=document.createElement("i");return o.classList.add(t||$),o.setAttribute("aria-hidden","true"),o.textContent=e,o}function ne(i){switch(i){case"skeleton":return ve();default:return fe()}}function fe(){let i=document.createElement("div");i.style.display="flex",i.style.justifyContent="center",i.style.alignItems="center",i.style.padding="8px",i.style.boxSizing="border-box";let e=document.createElement("forge-circular-progress");return e.style.setProperty("--forge-circular-progress-size","24px"),i.appendChild(e),i}function ve(){let i=document.createElement("forge-list"),e=document.createElement("div");e.style.minWidth="192px";for(let t=0;t<3;t++){let o=document.createElement(J.elementName);o.setAttribute("list-item",""),e.appendChild(o)}return i.appendChild(e),i}function se(){let i=document.createElement(X.elementName);return i.determinate=!1,i.style.position="absolute",i.style.top="0",i.style.left="0",i.style.right="0",i.style.width="100%",i}function be(i){return re(i,1)?i:[{text:"",options:i}]}function re(i,e){let t=i.some(n=>h(n)&&v(n)&&n.hasOwnProperty("options")&&(n.hasOwnProperty("text")||n.hasOwnProperty("builder"))),o=i.some(n=>h(n)&&v(n)&&n.hasOwnProperty("label")&&n.hasOwnProperty("value"));return t&&e===1||o&&e===0}function N(i){return re(i,1)?i.reduce((t,o)=>t.concat(o.options),[]):[...i]}var C=class{constructor(e,t){this._adapter=e;this._open=!1;this._config=Object.assign(x({},Q),x({},t)),this._selectListener=(o,n)=>this._onSelect(o,n),this._closeListener=()=>{typeof this._config.closeCallback=="function"&&this._config.closeCallback()},this._scrollEndListener=()=>{this._config.observeScroll&&typeof this._config.scrollEndListener=="function"&&this._config.scrollEndListener()}}destroy(){this._open&&this.close()}open(){this._open||(this._open=!0,this._adapter.open(this._config,this._selectListener,this._closeListener),window.requestAnimationFrame(()=>{this._open&&this.activateInitialOption()}),this._config.observeScroll&&this._config.scrollEndListener&&this._adapter.setScrollBottomListener(this._scrollEndListener,this._config.observeScrollThreshold||0))}close(){this._open&&(this._open=!1,this._adapter.close(),this._config.observeScroll&&this._config.scrollEndListener&&this._adapter.removeScrollBottomListener(this._scrollEndListener))}_onSelect(e,t){if(typeof this._config.activeChangeCallback=="function"&&this._config.activeChangeCallback(t),typeof this._config.selectCallback=="function"&&this._config.selectCallback(e),this._open){let o=this._config.syncWidth===void 0;this._adapter.syncWidth(o)}}getActiveOptionIndex(){return this._adapter.getActiveOptionIndex()}getActiveOption(){let e=this.getActiveOptionIndex();return e>=0?this._nonDividerOptions[e]:void 0}toggleOptionMultiple(e,t){return this._adapter.toggleOptionMultiple(e,t)}activateSelectedOption(){this._adapter.activateSelectedOption(this._config)}activateFirstOption(){let e=this._nonDividerOptions.findIndex(t=>!t.disabled);return e!==-1&&this.activateOption(e),e}activateLastOption(){let e=this._nonDividerOptions,t=e.length-1-e.findIndex(o=>!o.disabled);return t!==-1&&this.activateOption(t),t}activateOption(e,t){return this._adapter.activateOption(e,this._config.activeChangeCallback,t)}activateInitialOption(){typeof this._config.activeStartIndex=="number"&&this._nonDividerOptions[this._config.activeStartIndex]?(this.activateOption(this._config.activeStartIndex,!1),this._adapter.scrollSelectedOptionIntoView(!1)):this._config.selectedValues&&this._config.selectedValues.length?this._adapter.scrollSelectedOptionIntoView(!1):typeof this._config.visibleStartIndex=="number"&&this._nonDividerOptions[this._config.visibleStartIndex]&&this._adapter.scrollOptionIntoView(this._config.visibleStartIndex)}setSelectedValues(e){Array.isArray(e)||(e=[e]),!this._config.multiple&&e.length>1&&(e=[e[0]]),this._config.selectedValues=e,this._adapter.setSelectedValues(e,this._config.multiple)}clearActiveOption(){this._adapter.clearActiveOption()}setOptions(e){this._config.options=e,this._open&&(this._adapter.setOptions(this._config),this.activateInitialOption())}appendOptions(e){this._config.options=[...this._config.options,...e],this._open&&this._adapter.appendOptions(e,this._config)}get dropdownElement(){return this._adapter.dropdownElement}scrollSelectedOptionIntoView(e=!0){this._adapter.scrollSelectedOptionIntoView(e)}setScrollBottomListener(e,t){this._config.scrollEndListener=e,this._config.observeScroll=!0,this._config.observeScrollThreshold=t,this._adapter.setScrollBottomListener(this._scrollEndListener,this._config.observeScrollThreshold||0)}removeScrollBottomListener(){this._config.scrollEndListener=void 0,this._adapter.removeScrollBottomListener(this._scrollEndListener)}setBusyVisibility(e){!this._config.allowBusy||this._adapter.setBusyVisibility(e)}handleKey(e){switch(e){case"Enter":case"NumpadEnter":let t=this.getActiveOptionIndex(),o=this._nonDividerOptions[t];if(this._canSelectOption(o)){let p=this._adapter.getActiveOptionIdByIndex(t);p&&this._onSelect(o.value,p)}break;case"Up":case"ArrowUp":case"Down":case"ArrowDown":let n=this._nonDividerOptions;if(n.length&&n.every(p=>!this._canSelectOption(p)))return;let a=this._getNextActiveOptionIndex(e);this.activateOption(a);break;case"Home":this.activateFirstOption();break;case"End":this.activateLastOption();break}}_canSelectOption(e){return e&&!e.disabled&&!e.divider}_getNextActiveOptionIndex(e){let t=this._adapter.getActiveOptionIndex();return t===-1&&(t=this._adapter.getSelectedOptionIndex()),e==="ArrowUp"||e==="Up"?this._getPreviousHighlightableOptionIndex(t,this._nonDividerOptions):this._getNextHighlightableOptionIndex(t,this._nonDividerOptions)}_getPreviousHighlightableOptionIndex(e,t){let o=e<=0?t.length-1:e-1;return t[o].disabled?this._getPreviousHighlightableOptionIndex(o,t):o}_getNextHighlightableOptionIndex(e,t){let o=e===t.length-1?0:e+1;return t[o].disabled?this._getNextHighlightableOptionIndex(o,t):o}get _flatOptions(){return N(this._config.options)}get _nonDividerOptions(){return this._flatOptions.filter(e=>!e.divider)}};var S=class{constructor(e){this._targetElement=e}get dropdownElement(){return this._dropdownElement}open(e,t,o){this._dropdownElement=ie(e,this._targetElement),this.syncWidth(!!e.syncWidth,e.targetWidthCallback),e.allowBusy&&(this._busyElement=se(),this._busyElement.style.display="none",this._dropdownElement.appendChild(this._busyElement)),e.headerBuilder&&(this._headerElement=e.headerBuilder(),this._headerElement&&this._headerElement.setAttribute(m.attributes.DATA_ALLOW_FOCUS,"")),e.footerBuilder&&(this._footerElement=e.footerBuilder(),this._footerElement&&this._footerElement.setAttribute(m.attributes.DATA_ALLOW_FOCUS,"")),this._listElement=oe(e),this._listElement.addEventListener(H.events.SELECT,n=>{n.detail.listItem.setAttribute("aria-selected","true"),t(n.detail.value,n.detail.listItem.id)}),e.options.length?(w(e,this._listElement),this._dropdownElement.appendChild(this._listElement),this._headerElement&&this._dropdownElement.insertAdjacentElement("afterbegin",this._headerElement),this._footerElement&&this._dropdownElement.appendChild(this._footerElement)):e.allowBusy&&(this._asyncElement=ne(e.asyncStyle),this._dropdownElement.appendChild(this._asyncElement)),this._announcerElement=k(),this._announcerElement.id=`${e.id}-activedescendant`,this._dropdownElement.appendChild(this._announcerElement),this._dropdownElement.open=!0}close(){!this._dropdownElement||(this._dropdownElement.open=!1,this._dropdownElement=void 0,this._listElement=void 0,this._announcerElement=void 0)}setScrollBottomListener(e,t){if(this._dropdownElement&&!this._scrollObserver){let o=B(this._dropdownElement,b.selectors.CONTAINER),n={scrollThreshold:t};this._scrollObserver=new E(o,n),this._scrollObserver.addListener(u.ScrolledEnd,e)}}removeScrollBottomListener(e){this._scrollObserver&&this._scrollObserver.removeListener(u.ScrolledEnd,e)}getActiveOptionIndex(){if(!this._dropdownElement)return-1;let e=this._getListItemElements(),t=[...e].reverse().find(o=>o.active);return t?e.indexOf(t):-1}getSelectedOptionIndex(){return this._getListItemElements().findIndex(t=>t.selected)}getActiveOptionIdByIndex(e){if(!this._dropdownElement)return null;let o=this._getListItemElements()[e];return o?o.id:null}toggleOptionMultiple(e,t){if(!this._dropdownElement)return;let o=this._getListItemElements();o.length&&o[e]&&this._toggleSelectedOption(o[e],t)}scrollOptionIntoView(e,t=!0){let o=this._getListItemElements()[e];o&&this._scrollListItemIntoView(o,t?"smooth":"auto","center")}scrollSelectedOptionIntoView(e=!0){let t=this._getSelectedListItem();this._scrollListItemIntoView(t,e?"smooth":"auto","center")}activateSelectedOption(e){let t=this._getListItemElements();t.length&&t.filter(a=>a.active).forEach(a=>a.active=!1);let o=this._getSelectedListItem();o&&this._activateListOption(o,e.activeChangeCallback)}activateOption(e,t,o=!0){if(!this._dropdownElement)return;let n=this._getListItemElements();n.length&&(n.filter(p=>p.active).forEach(p=>p.active=!1),this._activateListOption(n[e],t),this._scrollListItemIntoView(n[e],o?"smooth":"auto"))}setSelectedValues(e,t=!1){if(!this._dropdownElement)return;let o=this._getListItemElements();for(let n of o){let a=e.some(p=>L(p,n.value));if(n.selected=a,t){let p=n.querySelector(`[${m.attributes.CHECKBOX_ELEMENT}]`);if(p){let f=y(a);P(f,p)}}}}clearActiveOption(){this._getListItemElements().forEach(t=>t.active=!1)}syncWidth(e,t){this._dropdownElement&&(this._dropdownElement.style[e?"width":"minWidth"]=`${this._getTargetElementWidth(t)}px`)}setOptions(e){!this._dropdownElement||!this._listElement||(this._asyncElement&&this._asyncElement.isConnected&&U(this._asyncElement),this._busyElement&&this._busyElement.close(),this._listElement.isConnected||this._dropdownElement.appendChild(this._listElement),R(this._listElement),w(e,this._listElement),this._headerElement&&!this._headerElement.isConnected&&this._dropdownElement.insertAdjacentElement("afterbegin",this._headerElement),this._footerElement&&!this._footerElement.isConnected&&this._dropdownElement.insertAdjacentElement("beforeend",this._footerElement),"position"in this._dropdownElement&&typeof this._dropdownElement.position=="function"&&this._dropdownElement.position())}appendOptions(e,t){!this._dropdownElement||!this._listElement||w(t,this._listElement,e)}setBusyVisibility(e){!this._dropdownElement||(e?(this._busyElement.style.removeProperty("display"),this._busyElement.open()):this._busyElement.close())}getScreenWidth(){return window.innerWidth}_getListItemElements(){return this._dropdownElement?Array.from(this._dropdownElement.querySelectorAll(H.elementName)):[]}_toggleSelectedOption(e,t){if(!this._dropdownElement)return;let o=this._getListItemElements();if(o.length){let a=o.filter(p=>p!==e&&p.active);a.length&&a.forEach(p=>p.active=!1)}e.selected=t,e.setAttribute("aria-selected",`${t}`),e.setAttribute("aria-checked",`${t}`),t&&(e.active=!0);let n=e.querySelector(`${j.elementName}[slot=leading]`);if(n){let a=y(t);P(a,n)}}_getTargetElementWidth(e){return e&&A(e)?e():this._targetElement.getBoundingClientRect().width}_activateListOption(e,t){e&&!e.disabled&&(e.active=!0,t&&A(t)&&t(e.id))}_scrollListItemIntoView(e,t="auto",o="nearest"){if(e&&this._dropdownElement&&this._dropdownElement.isConnected){let n=B(this._dropdownElement,b.selectors.CONTAINER);n&&K(n,e,t,o)}}_getSelectedListItem(){return this._getListItemElements().find(t=>t.selected)}};var le=class{constructor(e,t){this._targetElement=e;q.define([O,g]),this._foundation=new C(new S(this._targetElement),t)}destroy(){this._foundation.destroy()}open(){this._foundation.open()}close(){this._foundation.close()}getActiveOptionIndex(){return this._foundation.getActiveOptionIndex()}getActiveOption(){return this._foundation.getActiveOption()}toggleOptionMultiple(e,t){return this._foundation.toggleOptionMultiple(e,t)}activateSelectedOption(){this._foundation.activateSelectedOption()}activateFirstOption(){return this._foundation.activateFirstOption()}activateOption(e){return this._foundation.activateOption(e)}activateInitialOption(){return this._foundation.activateInitialOption()}clearActiveOption(){this._foundation.clearActiveOption()}setSelectedValues(e){return this._foundation.setSelectedValues(e)}get dropdownElement(){return this._foundation.dropdownElement}setOptions(e){this._foundation.setOptions(e)}appendOptions(e){this._foundation.appendOptions(e)}scrollSelectedOptionIntoView(e){this._foundation.scrollSelectedOptionIntoView()}setScrollBottomListener(e,t){this._foundation.setScrollBottomListener(e,t)}removeScrollBottomListener(){this._foundation.removeScrollBottomListener()}setBusyVisibility(e){this._foundation.setBusyVisibility(e)}handleKey(e){this._foundation.handleKey(e)}};var D=class{constructor(){this._popupClasses=[];this._syncPopupWidth=!1;this._optionLimit=0;this._observeScroll=!1;this._observeScrollThreshold=0;this._constrainPopupWidth=!0;this._wrapOptionText=!1}get syncPopupWidth(){return this._syncPopupWidth}set syncPopupWidth(e){this._syncPopupWidth=e}get popupClasses(){return this._popupClasses}set popupClasses(e){typeof e=="string"&&(e=[e]),Array.isArray(e)&&(this._popupClasses=e)}get observeScroll(){return this._observeScroll}set observeScroll(e){this._observeScroll=e}get observeScrollThreshold(){return this._observeScrollThreshold}set observeScrollThreshold(e){this._observeScrollThreshold=e}get optionLimit(){return this._optionLimit}set optionLimit(e){this._optionLimit=e}get popupHeaderBuilder(){return this._popupHeaderBuilder}set popupHeaderBuilder(e){this._popupHeaderBuilder=e}get popupFooterBuilder(){return this._popupFooterBuilder}set popupFooterBuilder(e){this._popupFooterBuilder=e}get constrainPopupWidth(){return this._constrainPopupWidth}set constrainPopupWidth(e){this._constrainPopupWidth=e}get wrapOptionText(){return this._wrapOptionText}set wrapOptionText(e){this._wrapOptionText=e}_applySelection(){}};var pe=class extends D{constructor(t){super();this._config=t;this._open=!1;this._options=[];this._childOpen=!1;this._popupHasMouse=!1;this._targetMouseEnterListener=o=>this._onTargetMouseEnter(o),this._targetMouseLeaveListener=o=>this._onTargetMouseLeave(o),this._childPopupMouseEnterListener=()=>this._onChildPopupMouseEnter(),this._childPopupMouseLeaveListener=()=>this._onChildPopupMouseLeave(),this._documentMouseMoveListener=o=>this._mouseCoords={x:o.pageX,y:o.pageY}}_onChildPopupMouseEnter(){this._popupHasMouse=!0}_onChildPopupMouseLeave(){this._popupHasMouse=!1,setTimeout(()=>{let t=document.elementFromPoint(this._mouseCoords.x,this._mouseCoords.y);!this._popupHasMouse&&!this._childOpen&&(!t||!this._isOwnElement(t))&&(this._setCascadeTargetInactive(),this._closeDropdown())},this._config.popupTimeout)}_onTargetMouseEnter(t){!this._options.length||this._openDropdown({fromKeyboard:!1})}_onTargetMouseLeave(t){this._activeMouseLeaveTimeout=window.setTimeout(()=>{if(!(!this._open||this._childOpen)){if(this._mouseCoords){let o=document.elementFromPoint(this._mouseCoords.x,this._mouseCoords.y);if(o&&this._isOwnElement(o))return}this._setCascadeTargetInactive(),this._closeDropdown()}},this._config.targetTimeout)}_clearMouseLeaveTimeout(){this._activeMouseLeaveTimeout!==void 0&&window.clearTimeout(this._activeMouseLeaveTimeout)}};export{m as a,Q as b,Z as c,ee as d,re as e,C as f,S as g,le as h,D as i,pe as j};
7
- //# sourceMappingURL=chunk.KKMKGN2I.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/list-dropdown/list-dropdown-constants.ts", "../../../../../../node_modules/@tylertech/forge-core/esm/events/event-aware.js", "../../../../../../node_modules/@tylertech/forge-core/esm/scroll/scroll-types.js", "../../../../../../node_modules/@tylertech/forge-core/esm/scroll/scroll-axis-observer.js", "../../src/list-dropdown/list-dropdown-utils.ts", "../../src/list-dropdown/list-dropdown-foundation.ts", "../../src/list-dropdown/list-dropdown-adapter.ts", "../../src/list-dropdown/list-dropdown.ts", "../../src/list-dropdown/list-dropdown-aware-foundation.ts", "../../src/list-dropdown/cascading-list-dropdown-aware-foundation.ts"],
4
- "sourcesContent": ["import { IPopupPosition, PopupPlacement } from '../popup';\n\nconst attributes = {\n POPUP_CLASSES: 'popup-classes',\n OPTION_LIMIT: 'option-limit',\n OBSERVE_SCROLL: 'observe-scroll',\n OBSERVE_SCROLL_THRESHOLD: 'observe-scroll-threshold',\n SYNC_POPUP_WIDTH: 'sync-popup-width',\n CONSTRAIN_POPUP_WIDTH: 'constrain-popup-width',\n WRAP_OPTION_TEXT: 'wrap-option-text',\n\n // Internal\n CHECKBOX_ELEMENT: 'data-list-dropdown-checkbox',\n DATA_ALLOW_FOCUS: 'data-list-dropdown-allow-focus'\n};\n\nconst classes = {\n GROUP_WRAPPER: 'forge-list-dropdown__group-wrapper'\n};\n\nexport const LIST_DROPDOWN_CONSTANTS = {\n attributes,\n classes\n};\n\nexport type ListDropdownOptionBuilder<T = HTMLElement> = (option: IListDropdownOption, parentElement: T) => HTMLElement | string | void;\nexport type ListDropdownHeaderBuilder = () => HTMLElement;\nexport type ListDropdownFooterBuilder = () => HTMLElement;\nexport type ListDropdownOptionGroupBuilder<T = any> = (option: IListDropdownOptionGroup<T>) => HTMLElement | string;\nexport type ListDropdownTransformCallback = (label: string) => string | HTMLElement;\nexport type ListDropdownIconType = 'font' | 'component';\n\nexport interface IBaseListDropdownOption<T = any> {\n value: T;\n label: string;\n disabled?: boolean;\n divider?: boolean;\n optionClass?: string | string[];\n leadingIcon?: string;\n leadingIconClass?: string;\n leadingIconType?: ListDropdownIconType;\n trailingIcon?: string;\n trailingIconClass?: string;\n trailingIconType?: ListDropdownIconType;\n leadingBuilder?: () => HTMLElement;\n trailingBuilder?: () => HTMLElement;\n}\n\nexport interface IListDropdownOption<T = any> extends IBaseListDropdownOption<T> {\n options?: Array<IListDropdownOption | IListDropdownOptionGroup>;\n elementAttributes?: Map<string, string>;\n}\n\nexport interface IListDropdownOptionGroup<T = any, K = any> {\n text?: string;\n value?: K;\n builder?: ListDropdownOptionGroupBuilder;\n options: IListDropdownOption<T>[];\n}\n\nexport interface IListDropdownSelectEventData {\n value: IListDropdownOption | IListDropdownOption[];\n}\n\nexport interface IListDropdownConfig<T = any> {\n id: string;\n options: Array<IListDropdownOption | IListDropdownOptionGroup>;\n selectCallback: (value: T) => void;\n \n // Optional values\n activeChangeCallback?: (id: string) => void;\n closeCallback?: () => void;\n syncWidth?: boolean;\n constrainViewportWidth?: boolean;\n wrapOptionText?: boolean;\n selectedValues?: T[];\n multiple?: boolean;\n activeStartIndex?: number;\n visibleStartIndex?: number;\n transform?: ListDropdownTransformCallback;\n allowBusy?: boolean;\n asyncStyle?: ListDropdownAsyncStyle;\n iconClass?: string;\n dense?: boolean;\n type?: ListDropdownType;\n popupClasses?: string | string[];\n popupOffset?: IPopupPosition;\n popupStatic?: boolean;\n popupPlacement?: PopupPlacement;\n popupFallbackPlacements?: PopupPlacement[];\n optionLimit?: number;\n optionBuilder?: ListDropdownOptionBuilder;\n observeScroll?: boolean;\n observeScrollThreshold?: number;\n targetWidthCallback?: () => number;\n scrollEndListener?: () => void;\n headerBuilder?: ListDropdownHeaderBuilder;\n footerBuilder?: ListDropdownFooterBuilder;\n cascade?: boolean;\n cascadingElementFactory?: (config: IListDropdownCascadingElementFactoryConfig) => HTMLElement;\n}\n\nexport interface IListDropdownCascadingElementFactoryConfig {\n index: number;\n options: Array<IListDropdownOption | IListDropdownOptionGroup>;\n parentValue: any;\n}\n\nexport const DEFAULT_LIST_DROPDOWN_CONFIG: Partial<IListDropdownConfig> = {\n options: [],\n syncWidth: false,\n selectedValues: [],\n multiple: false\n};\n\nexport interface IListDropdownOpenConfig extends IListDropdownConfig {}\n\nexport enum ListDropdownType {\n None = 'none',\n Standard = 'standard',\n Menu = 'menu'\n}\n\nexport enum ListDropdownAsyncStyle {\n Spinner = 'spinner',\n Skeleton = 'skeleton'\n}\n", "export class EventAware {\n constructor() {\n this._listenerMap = new Map();\n }\n _emit(type, data) {\n const listeners = this._listenerMap.get(type);\n if (listeners && listeners.length) {\n listeners.forEach(cb => cb({ type, data }));\n }\n }\n hasListeners(type) {\n return type ? this._listenerMap.has(type) : this._listenerMap.size > 0;\n }\n addListener(type, listener) {\n if (!this._listenerMap.has(type)) {\n this._listenerMap.set(type, [listener]);\n }\n else {\n const listeners = this._listenerMap.get(type);\n if (listeners) {\n listeners.push(listener);\n }\n }\n }\n removeListener(type, listener) {\n const listeners = this._listenerMap.get(type);\n if (listeners && listeners.length && listeners.includes(listener)) {\n listeners.splice(listeners.indexOf(listener), 1);\n if (!listeners.length) {\n this._listenerMap.delete(type);\n }\n }\n }\n}\n", "export var ScrollDirection;\n(function (ScrollDirection) {\n ScrollDirection[\"Up\"] = \"up\";\n ScrollDirection[\"Down\"] = \"down\";\n ScrollDirection[\"Left\"] = \"left\";\n ScrollDirection[\"Right\"] = \"right\";\n})(ScrollDirection || (ScrollDirection = {}));\nexport var ScrollEvents;\n(function (ScrollEvents) {\n ScrollEvents[\"Scroll\"] = \"scroll\";\n ScrollEvents[\"Scrolled\"] = \"scrolled\";\n ScrollEvents[\"ScrolledStart\"] = \"scrolled-start\";\n ScrollEvents[\"ScrolledEnd\"] = \"scrolled-end\";\n})(ScrollEvents || (ScrollEvents = {}));\n", "import { EventAware } from '../events/event-aware';\nimport { ScrollEvents, ScrollDirection } from './scroll-types';\nimport { isDefined, throttle, isNumber } from '../utils';\nconst DEFAULT_SCROLL_THROTTLE = 100;\n/**\n * Provides facilties for observing and reacting to scroll events and information on a given element.\n */\nexport class ScrollAxisObserver extends EventAware {\n constructor(_element, _config = {}) {\n super();\n this._element = _element;\n this._config = _config;\n this._axis = 'vertical';\n this._scrollThreshold = 0;\n this._lastScrollPosition = 0;\n this._lastScrollTop = 0;\n this._lastScrollLeft = 0;\n this._isListening = false;\n this._initialize();\n }\n destroy() {\n this.stop();\n }\n start() {\n if (!this._isListening) {\n this._element.addEventListener('scroll', this._scrollListener);\n this._isListening = true;\n }\n }\n stop() {\n this._element.removeEventListener('scroll', this._scrollListener);\n this._isListening = false;\n }\n _initialize() {\n if (this._config.throttle) {\n const wait = this._config.throttleTime || DEFAULT_SCROLL_THROTTLE;\n this._scrollListener = throttle(() => this._onScroll(), wait);\n }\n else {\n this._scrollListener = () => this._onScroll();\n }\n if (!isDefined(this._config.paused) || !this._config.paused) {\n this.start();\n }\n if (isDefined(this._config.axis)) {\n this._axis = this._config.axis;\n }\n if (isDefined(this._config.scrollThreshold) && isNumber(this._config.scrollThreshold)) {\n this._scrollThreshold = this._config.scrollThreshold;\n }\n }\n _isScrollAxis() {\n const isVertical = this._lastScrollTop !== this._element.scrollTop;\n const isHorizontal = this._lastScrollLeft !== this._element.scrollLeft;\n return (this._axis === 'vertical' && isVertical) || (this._axis === 'horizontal' && isHorizontal);\n }\n _onScroll() {\n if (!this._isScrollAxis()) {\n return;\n }\n const position = this.scrollPosition;\n const direction = this._lastScrollPosition - position < 0 ? this._axis === 'vertical' ? ScrollDirection.Down : ScrollDirection.Right : this._axis === 'vertical' ? ScrollDirection.Up : ScrollDirection.Left;\n this._emit(ScrollEvents.Scroll, { direction, position });\n if (this._lastScrollPosition <= this._scrollThreshold && position > this._scrollThreshold) {\n this._emit(ScrollEvents.Scrolled, true);\n }\n else if (this._lastScrollPosition >= this._scrollThreshold && (this._scrollThreshold > 0 ? position < this._scrollThreshold : position === 0)) {\n this._emit(ScrollEvents.Scrolled, false);\n }\n const scrollStart = Math.round(position - this._scrollThreshold);\n const scrollEnd = Math.round(this.scrollSize - position);\n if (this._lastScrollPosition >= this._scrollThreshold && scrollStart <= 0) {\n this._emit(ScrollEvents.ScrolledStart);\n }\n else if (this._lastScrollPosition <= (this.scrollSize - this._scrollThreshold) && scrollEnd <= this._scrollThreshold) {\n this._emit(ScrollEvents.ScrolledEnd);\n }\n this._lastScrollPosition = position || 0;\n this._lastScrollTop = this._element.scrollTop || 0;\n this._lastScrollLeft = this._element.scrollLeft || 0;\n }\n get scrollPosition() {\n return this._axis === 'vertical' ? this._element.scrollTop : this._element.scrollLeft;\n }\n get isScrolled() {\n return this.scrollPosition > this._scrollThreshold;\n }\n get isScrolledStart() {\n return this.scrollPosition === 0;\n }\n get isScrolledEnd() {\n return this.scrollPosition === this._element.scrollWidth;\n }\n get isScrollable() {\n if (this._axis === 'vertical') {\n return this._element.scrollHeight > this._element.clientHeight;\n }\n return this._element.scrollWidth > this._element.clientWidth;\n }\n get scrollSize() {\n return (this._axis === 'vertical' ? this._element.scrollHeight : this._element.scrollWidth) - this.elementSize;\n }\n get elementSize() {\n return this._axis === 'vertical' ? this._element.clientHeight : this._element.clientWidth;\n }\n setScrollPosition(position) {\n if (this._axis === 'vertical') {\n this._element.scrollTop = position;\n }\n else {\n this._element.scrollLeft = position;\n }\n }\n}\n", "import { addClass, getEventPath, isDeepEqual, isDefined, isObject } from '@tylertech/forge-core';\nimport { tylIconCheckBox, tylIconCheckBoxOutlineBlank } from '@tylertech/tyler-icons/standard';\nimport { ICON_CLASS_NAME } from '../constants';\nimport { ILinearProgressComponent, LINEAR_PROGRESS_CONSTANTS } from '../linear-progress';\nimport { IListComponent, LIST_CONSTANTS } from '../list/list';\nimport { IPopupComponent, PopupAnimationType, POPUP_CONSTANTS } from '../popup';\nimport { ISkeletonComponent, SKELETON_CONSTANTS } from '../skeleton';\nimport { IListDropdownCascadingElementFactoryConfig, IListDropdownOpenConfig, IListDropdownOption, IListDropdownOptionGroup, ListDropdownAsyncStyle, ListDropdownIconType, ListDropdownType, LIST_DROPDOWN_CONSTANTS } from './list-dropdown-constants';\n\nexport enum ListDropdownOptionType { Option, Group }\n\n/**\n * Creates the floating dropdown element container.\n * @param config \n * @param targetElement \n */\nexport function createDropdown(config: IListDropdownOpenConfig, targetElement: HTMLElement): IPopupComponent {\n const dropdownElement = createPopupDropdown(config, targetElement);\n const dropdownId = `list-dropdown-popup-${config.id}`;\n\n // Prevent mousedown events from changing focus. We keep focus in the target element at all times while open.\n dropdownElement.addEventListener('mousedown', evt => {\n const composedPath = getEventPath(evt);\n\n // We allow for custom header and footer templates and these elements could be focusable so we need to allow access into them\n const isFromCustomTemplate = composedPath.find(el => el.nodeType === 1 && el.hasAttribute(LIST_DROPDOWN_CONSTANTS.attributes.DATA_ALLOW_FOCUS));\n if (isFromCustomTemplate) {\n return;\n }\n\n const isWithinDropdownElement = composedPath.find(el => el.id === dropdownId || el.id === config.id);\n if (isWithinDropdownElement) {\n evt.preventDefault();\n }\n });\n\n // Set roles and other attributes based on our type\n switch (config.type) {\n case ListDropdownType.Menu:\n dropdownElement.setAttribute('role', 'menu');\n dropdownElement.setAttribute('aria-orientation', 'vertical');\n break;\n default:\n dropdownElement.setAttribute('role', 'listbox');\n }\n\n if (config.id) {\n dropdownElement.id = dropdownId;\n }\n if (config.popupClasses) {\n addClass(config.popupClasses, dropdownElement);\n }\n\n return dropdownElement;\n}\n\nexport function createPopupDropdown(config: IListDropdownOpenConfig, targetElement: HTMLElement): IPopupComponent {\n const popupElement = document.createElement('forge-popup');\n popupElement.targetElement = targetElement;\n popupElement.placement = config.popupPlacement || 'bottom-start';\n popupElement.manageFocus = false;\n popupElement.static = !!config.popupStatic;\n\n if (config.popupFallbackPlacements?.length) {\n popupElement.fallbackPlacements = config.popupFallbackPlacements;\n }\n\n if (config.constrainViewportWidth) {\n popupElement.setAttribute(POPUP_CONSTANTS.attributes.CONSTRAIN_VIEWPORT_WIDTH, '');\n }\n\n if (config.popupOffset) {\n popupElement.offset = config.popupOffset;\n }\n\n // Set the animations based on our type\n switch (config.type) {\n case ListDropdownType.Menu:\n popupElement.animationType = PopupAnimationType.Menu;\n break;\n case ListDropdownType.None:\n popupElement.animationType = PopupAnimationType.None;\n break;\n default:\n popupElement.animationType = PopupAnimationType.Dropdown;\n }\n return popupElement;\n}\n\nexport function createList(config: IListDropdownOpenConfig): IListComponent {\n const listElement = document.createElement(LIST_CONSTANTS.elementName) as IListComponent;\n listElement.id = `list-dropdown-list-${config.id}`;\n listElement.propagateClick = false;\n return listElement;\n}\n\n/**\n * Creates the list to place inside of the dropdown.\n * @param config \n */\nexport function createListItems(config: IListDropdownOpenConfig, listElement: IListComponent, options?: Array<IListDropdownOption | IListDropdownOptionGroup>): void {\n // Ensure the options are provided in the form a group (if no groups provided, then we have one anonymous group of options)\n const groups = getOptionsByGroup(options || config.options);\n const flatOptions = getFlattenedOptions(groups);\n\n const limitOptions = config.optionLimit ? true : false;\n let optionLimit = config.optionLimit || 0;\n let optionIndex = 0;\n\n // Iterate over our groups and render the optional headers and options for that group\n for (const group of groups) {\n let optionParent: IListComponent | HTMLElement = listElement;\n\n // Check for a group header builder callback\n if (group.builder && typeof group.builder === 'function') {\n const headerElement = group.builder(group);\n if (headerElement) {\n const groupWrapper = document.createElement('div');\n groupWrapper.classList.add(LIST_DROPDOWN_CONSTANTS.classes.GROUP_WRAPPER);\n optionParent = groupWrapper;\n\n if (typeof headerElement === 'string') {\n groupWrapper.innerHTML = headerElement;\n } else if (headerElement instanceof HTMLElement) {\n groupWrapper.appendChild(headerElement);\n }\n\n listElement.appendChild(groupWrapper);\n }\n } else if (group.text) {\n // We are rendering just text as a group header so create the group header element with predefined styles\n const groupWrapper = document.createElement('div');\n groupWrapper.classList.add(LIST_DROPDOWN_CONSTANTS.classes.GROUP_WRAPPER);\n\n const listHeaderElement = document.createElement('div');\n listHeaderElement.textContent = group.text;\n listHeaderElement.classList.add('forge-typography--overline');\n listHeaderElement.style.fontFamily = 'Roboto,sans-serif';\n listHeaderElement.style.fontSize = '0.75rem';\n listHeaderElement.style.lineHeight = '2rem';\n listHeaderElement.style.letterSpacing = '0.16667em';\n listHeaderElement.style.fontWeight = '500';\n listHeaderElement.style.margin = '4px 8px';\n\n optionParent = groupWrapper;\n groupWrapper.appendChild(listHeaderElement);\n listElement.appendChild(groupWrapper);\n }\n\n // Loop over the options for this group\n for (const option of group.options) {\n // First we check if this option is just a divider\n if (option.divider) {\n const dividerElement = createDivider();\n listElement.appendChild(dividerElement);\n continue;\n }\n\n // Check if an option limit has been provided to reduce amount of options that need to be rendered\n if (limitOptions && --optionLimit < 0) {\n break;\n }\n\n optionIndex++;\n \n // Create and configure the list element\n const isSelected = config.selectedValues ? config.selectedValues.some(v => isDeepEqual(v, option.value)) : false;\n let listItemElement = document.createElement('forge-list-item');\n listItemElement.value = option.value;\n listItemElement.id = `list-dropdown-option-${config.id}-${optionIndex}`;\n listItemElement.style.cursor = 'pointer';\n\n if (config.wrapOptionText) {\n listItemElement.wrap = true;\n }\n \n // Add any CSS classes to the option list-item\n if (option.optionClass && (typeof option.optionClass === 'string' || Array.isArray(option.optionClass) && option.optionClass.length)) {\n addClass(option.optionClass, listItemElement);\n }\n\n // Set role based on type\n switch (config.type) {\n case ListDropdownType.Menu:\n listItemElement.setAttribute('role', 'menuitem');\n break;\n case ListDropdownType.None:\n break;\n default:\n listItemElement.setAttribute('role', 'option');\n }\n\n if (config.dense) {\n listItemElement.dense = true;\n }\n\n // Check for a custom option template builder\n if (config.optionBuilder && typeof config.optionBuilder === 'function') {\n const element = config.optionBuilder(option, listItemElement);\n if (element) {\n if (typeof element === 'string') {\n listItemElement.innerHTML = element;\n } else {\n listItemElement.appendChild(element);\n }\n }\n } else {\n if (typeof config.transform !== 'function') {\n listItemElement.textContent = option.label || '';\n } else {\n const result = config.transform(option.label);\n if (typeof result === 'string') {\n listItemElement.textContent = result;\n } else if (typeof result === 'object' && (result as HTMLElement).nodeType !== undefined) {\n listItemElement.appendChild(result);\n }\n }\n }\n\n // If multiple selections are enabled then we need to create and append a leading checkbox element\n if (config.multiple) {\n const checkboxElement = createCheckboxElement(isSelected);\n listItemElement.appendChild(checkboxElement);\n listItemElement.setAttribute('aria-selected', `${isSelected}`);\n listItemElement.setAttribute('aria-checked', `${isSelected}`);\n }\n\n if (option.elementAttributes) {\n option.elementAttributes.forEach((value: string, key: string) => {\n listItemElement.setAttribute(key, value);\n });\n }\n\n // Leading element/icon\n if (option.leadingBuilder) {\n const element = option.leadingBuilder();\n if (isObject(element)) {\n element.slot = 'leading';\n listItemElement.appendChild(element);\n }\n } else if (option.leadingIcon) {\n const leadingIconElement = createIconElement(option.leadingIconType, option.leadingIcon, option.leadingIconClass || config.iconClass);\n leadingIconElement.slot = 'leading';\n listItemElement.appendChild(leadingIconElement);\n }\n\n // Trailing element/icon\n if (option.trailingBuilder) {\n const element = option.trailingBuilder();\n if (isObject(element)) {\n element.slot = 'trailing';\n listItemElement.appendChild(element);\n }\n } else if (option.trailingIcon) {\n const trailingIconElement = createIconElement(option.trailingIconType, option.trailingIcon, option.trailingIconClass || config.iconClass);\n trailingIconElement.slot = 'trailing';\n listItemElement.appendChild(trailingIconElement);\n }\n\n // Update the disabled state\n if (option.disabled) {\n listItemElement.disabled = option.disabled;\n listItemElement.setAttribute('aria-disabled', 'true');\n } else {\n listItemElement.style.cursor = 'pointer';\n listItemElement.setAttribute('aria-disabled', 'false');\n }\n\n // Update the selected state\n if (isSelected) {\n listItemElement.selected = true;\n }\n listItemElement.setAttribute('aria-selected', isSelected ? 'true' : 'false');\n\n // If we have any child options, we need to render a child menu for this list item\n if (!option.disabled && typeof config.cascadingElementFactory === 'function' && Array.isArray(option.options) && option.options.length) {\n // Create the trailing indicator icon to show that a child menu exists for this option. \n const optionIconElement = document.createElement('forge-icon');\n optionIconElement.name = 'arrow_right';\n optionIconElement.slot = 'trailing';\n listItemElement.appendChild(optionIconElement);\n\n const nonDividerOptions = flatOptions.filter(o => !o.divider);\n\n // Create the nested cascading element wrapper\n const factoryConfig: IListDropdownCascadingElementFactoryConfig = {\n index: nonDividerOptions.indexOf(option),\n options: option.options,\n parentValue: option.value\n };\n const cascadingElement = config.cascadingElementFactory.call(null, factoryConfig);\n cascadingElement.appendChild(listItemElement);\n listItemElement = cascadingElement;\n }\n\n optionParent.appendChild(listItemElement);\n }\n }\n}\n\nexport function createCheckboxElement(selected: boolean): HTMLElement {\n const checkboxElement = document.createElement('forge-icon');\n checkboxElement.setAttribute(LIST_DROPDOWN_CONSTANTS.attributes.CHECKBOX_ELEMENT, '');\n checkboxElement.name = selected ? tylIconCheckBox.name : tylIconCheckBoxOutlineBlank.name;\n checkboxElement.slot = 'leading';\n checkboxElement.style.marginRight = '16px';\n checkboxElement.style.verticalAlign = 'middle';\n return checkboxElement;\n}\n\nfunction createDivider(): HTMLElement {\n const divider = document.createElement('forge-divider');\n divider.setAttribute('aria-hidden', 'true');\n return divider;\n}\n\nfunction createIconElement(type: ListDropdownIconType = 'font', iconName: string, iconClass?: string): HTMLElement {\n if (type === 'component') {\n const icon = document.createElement('forge-icon');\n if (iconClass) {\n icon.classList.add(iconClass);\n }\n icon.setAttribute('aria-hidden', 'true');\n icon.name = iconName;\n return icon;\n }\n\n const iconElement = document.createElement('i');\n iconElement.classList.add(iconClass || ICON_CLASS_NAME);\n iconElement.setAttribute('aria-hidden', 'true');\n iconElement.textContent = iconName;\n return iconElement;\n}\n\nexport function createAsyncElement(asyncStyle?: ListDropdownAsyncStyle): HTMLElement {\n switch (asyncStyle) {\n case ListDropdownAsyncStyle.Skeleton:\n return createSkeletonElement();\n default:\n return createSpinnerElement();\n }\n}\n\nfunction createSpinnerElement(): HTMLElement {\n const div = document.createElement('div');\n div.style.display = 'flex';\n div.style.justifyContent = 'center';\n div.style.alignItems = 'center';\n div.style.padding = '8px';\n div.style.boxSizing = 'border-box';\n\n const spinner = document.createElement('forge-circular-progress');\n spinner.style.setProperty('--forge-circular-progress-size', '24px');\n div.appendChild(spinner);\n\n return div;\n}\n\nfunction createSkeletonElement(): HTMLElement {\n const list = document.createElement('forge-list');\n const div = document.createElement('div');\n div.style.minWidth = '192px';\n for (let i = 0; i < 3; i++) {\n const listItemSkeleton = document.createElement(SKELETON_CONSTANTS.elementName) as ISkeletonComponent;\n listItemSkeleton.setAttribute('list-item', '');\n div.appendChild(listItemSkeleton);\n }\n list.appendChild(div);\n return list;\n}\n\nexport function createBusyElement(): ILinearProgressComponent {\n const linearProgress = document.createElement(LINEAR_PROGRESS_CONSTANTS.elementName) as ILinearProgressComponent;\n linearProgress.determinate = false;\n linearProgress.style.position = 'absolute';\n linearProgress.style.top = '0';\n linearProgress.style.left = '0';\n linearProgress.style.right = '0';\n linearProgress.style.width = '100%';\n return linearProgress;\n}\n\nfunction getOptionsByGroup(options: Array<IListDropdownOption | IListDropdownOptionGroup>): IListDropdownOptionGroup[] {\n return isListDropdownOptionType(options, ListDropdownOptionType.Group) ? (options as IListDropdownOptionGroup[]) : [{ text: '', options }] as IListDropdownOptionGroup[];\n}\n\n/**\n * Determines if the provided options are of the specified type.\n * @param options The options either grouped or individual.\n * @param type The type of option to detect.\n */\nexport function isListDropdownOptionType(options: Array<IListDropdownOption | IListDropdownOptionGroup>, type: ListDropdownOptionType): type is ListDropdownOptionType {\n const isOptionGroups = options.some((o: IListDropdownOption | IListDropdownOptionGroup) => isDefined(o) && isObject(o) && o.hasOwnProperty('options') && (o.hasOwnProperty('text') || o.hasOwnProperty('builder')));\n const isOptionTypes = options.some((o: IListDropdownOption | IListDropdownOptionGroup) => isDefined(o) && isObject(o) && o.hasOwnProperty('label') && o.hasOwnProperty('value'));\n return (isOptionGroups && type === ListDropdownOptionType.Group) || (isOptionTypes && type === ListDropdownOptionType.Option);\n}\n\nexport function getFlattenedOptions(options: Array<IListDropdownOptionGroup | IListDropdownOption>): IListDropdownOption[] {\n if (isListDropdownOptionType(options, ListDropdownOptionType.Group)) {\n const groups = options as IListDropdownOptionGroup[];\n return groups.reduce((flatOpts, group) => flatOpts.concat(group.options), [] as IListDropdownOption[]);\n }\n return [...options as IListDropdownOption[]];\n}\n", "import { IListDropdownAdapter } from './list-dropdown-adapter';\nimport { DEFAULT_LIST_DROPDOWN_CONFIG, IListDropdownConfig, IListDropdownOption, IListDropdownOptionGroup } from './list-dropdown-constants';\nimport { getFlattenedOptions } from './list-dropdown-utils';\n\nexport interface IListDropdownFoundation {\n dropdownElement: HTMLElement | undefined;\n open(): void;\n close(): void;\n getActiveOptionIndex(): number;\n getActiveOption(): IListDropdownOption | undefined;\n toggleOptionMultiple(index: number, isSelected: boolean): void;\n activateSelectedOption(): void;\n activateFirstOption(): number;\n activateOption(index: number): void;\n setSelectedValues(values: any): void;\n clearActiveOption(): void;\n setOptions(options: Array<IListDropdownOption | IListDropdownOptionGroup>): void;\n appendOptions(options: Array<IListDropdownOption | IListDropdownOptionGroup>): void;\n scrollSelectedOptionIntoView(animate?: boolean): void;\n setScrollBottomListener(listener: () => void, threshold?: number): void;\n removeScrollBottomListener(): void;\n setBusyVisibility(isVisible: boolean): void;\n handleKey(key: string): void;\n}\n\nexport class ListDropdownFoundation implements IListDropdownFoundation {\n private _config: IListDropdownConfig;\n private _open = false;\n private _selectListener: (value: any, id: string) => void;\n private _closeListener: () => void;\n private _scrollEndListener: () => void;\n\n constructor(private _adapter: IListDropdownAdapter, config: IListDropdownConfig) {\n this._config = Object.assign({ ...DEFAULT_LIST_DROPDOWN_CONFIG }, { ...config });\n this._selectListener = (value, id) => this._onSelect(value, id);\n this._closeListener = () => {\n if (typeof this._config.closeCallback === 'function') {\n this._config.closeCallback();\n }\n };\n this._scrollEndListener = () => {\n if (this._config.observeScroll && typeof this._config.scrollEndListener === 'function') {\n this._config.scrollEndListener();\n }\n };\n }\n\n public destroy(): void {\n if (this._open) {\n this.close();\n }\n }\n\n public open(): void {\n if (!this._open) {\n this._open = true;\n this._adapter.open(this._config, this._selectListener, this._closeListener);\n window.requestAnimationFrame(() => {\n if (this._open) {\n this.activateInitialOption();\n }\n });\n\n if (this._config.observeScroll && this._config.scrollEndListener) {\n this._adapter.setScrollBottomListener(this._scrollEndListener, this._config.observeScrollThreshold || 0);\n }\n }\n }\n\n public close(): void {\n if (this._open) {\n this._open = false;\n this._adapter.close();\n if (this._config.observeScroll && this._config.scrollEndListener) {\n this._adapter.removeScrollBottomListener(this._scrollEndListener);\n }\n }\n }\n\n private _onSelect(value: any, id: string): void {\n if (typeof this._config.activeChangeCallback === 'function') {\n this._config.activeChangeCallback(id);\n }\n\n if (typeof this._config.selectCallback === 'function') {\n this._config.selectCallback(value);\n }\n\n if (this._open) {\n const sync = this._config.syncWidth === undefined ? true : false;\n // Keep the popup width at least the same as the target if the target size has now changed\n this._adapter.syncWidth(sync);\n }\n }\n\n public getActiveOptionIndex(): number {\n return this._adapter.getActiveOptionIndex();\n }\n\n public getActiveOption(): IListDropdownOption | undefined {\n const index = this.getActiveOptionIndex();\n return index >= 0 ? this._nonDividerOptions[index] : undefined;\n }\n \n public toggleOptionMultiple(index: number, isSelected: boolean): void {\n return this._adapter.toggleOptionMultiple(index, isSelected);\n }\n\n public activateSelectedOption(): void {\n this._adapter.activateSelectedOption(this._config);\n }\n\n public activateFirstOption(): number {\n const index = this._nonDividerOptions.findIndex(o => !o.disabled);\n if (index !== -1) {\n this.activateOption(index);\n }\n return index;\n }\n\n public activateLastOption(): number {\n const options = this._nonDividerOptions;\n const index = (options.length - 1) - options.findIndex(o => !o.disabled);\n if (index !== -1) {\n this.activateOption(index);\n }\n return index;\n }\n\n public activateOption(index: number, animate?: boolean): void {\n return this._adapter.activateOption(index, this._config.activeChangeCallback, animate);\n }\n\n public activateInitialOption(): void {\n if (typeof this._config.activeStartIndex === 'number' && this._nonDividerOptions[this._config.activeStartIndex]) {\n this.activateOption(this._config.activeStartIndex, false);\n this._adapter.scrollSelectedOptionIntoView(false);\n } else if (this._config.selectedValues && this._config.selectedValues.length) {\n this._adapter.scrollSelectedOptionIntoView(false);\n } else if (typeof this._config.visibleStartIndex === 'number' && this._nonDividerOptions[this._config.visibleStartIndex]) {\n this._adapter.scrollOptionIntoView(this._config.visibleStartIndex);\n }\n }\n\n public setSelectedValues(values: any[]): void {\n if (!Array.isArray(values)) {\n values = [values];\n }\n if (!this._config.multiple && values.length > 1) {\n values = [values[0]];\n }\n this._config.selectedValues = values;\n this._adapter.setSelectedValues(values, this._config.multiple);\n }\n\n public clearActiveOption(): void {\n this._adapter.clearActiveOption();\n }\n\n public setOptions(options: Array<IListDropdownOption | IListDropdownOptionGroup>): void {\n this._config.options = options;\n if (!this._open) {\n return;\n }\n this._adapter.setOptions(this._config);\n this.activateInitialOption();\n }\n\n public appendOptions(options: Array<IListDropdownOption | IListDropdownOptionGroup>): void {\n this._config.options = [...this._config.options, ...options] as Array<IListDropdownOption | IListDropdownOptionGroup>;\n if (!this._open) {\n return;\n }\n this._adapter.appendOptions(options, this._config);\n }\n\n public get dropdownElement(): HTMLElement | undefined {\n return this._adapter.dropdownElement;\n }\n\n public scrollSelectedOptionIntoView(animate = true): void {\n this._adapter.scrollSelectedOptionIntoView(animate);\n }\n\n public setScrollBottomListener(listener: () => void, threshold?: number): void {\n this._config.scrollEndListener = listener;\n this._config.observeScroll = true;\n this._config.observeScrollThreshold = threshold;\n this._adapter.setScrollBottomListener(this._scrollEndListener, this._config.observeScrollThreshold || 0);\n }\n\n public removeScrollBottomListener(): void {\n this._config.scrollEndListener = undefined;\n this._adapter.removeScrollBottomListener(this._scrollEndListener);\n }\n\n public setBusyVisibility(isVisible: boolean): void {\n if (!this._config.allowBusy) {\n return;\n }\n this._adapter.setBusyVisibility(isVisible);\n }\n\n public handleKey(key: string): void {\n switch (key) {\n case 'Enter':\n case 'NumpadEnter':\n const activeOptionIndex = this.getActiveOptionIndex();\n const activeOption = this._nonDividerOptions[activeOptionIndex];\n if (this._canSelectOption(activeOption)) {\n const id = this._adapter.getActiveOptionIdByIndex(activeOptionIndex);\n if (id) {\n this._onSelect(activeOption.value, id);\n }\n }\n break;\n case 'Up':\n case 'ArrowUp':\n case 'Down':\n case 'ArrowDown':\n const options = this._nonDividerOptions;\n if (options.length && options.every(o => !this._canSelectOption(o))) {\n return;\n }\n const index = this._getNextActiveOptionIndex(key);\n this.activateOption(index);\n break;\n case 'Home':\n this.activateFirstOption();\n break;\n case 'End':\n this.activateLastOption();\n break;\n }\n }\n\n private _canSelectOption(option: IListDropdownOption): boolean {\n return option && !option.disabled && !option.divider;\n }\n\n private _getNextActiveOptionIndex(key: string): number {\n let index = this._adapter.getActiveOptionIndex();\n if (index === -1) {\n index = this._adapter.getSelectedOptionIndex();\n }\n if (key === 'ArrowUp' || key === 'Up') {\n return this._getPreviousHighlightableOptionIndex(index, this._nonDividerOptions);\n }\n return this._getNextHighlightableOptionIndex(index, this._nonDividerOptions);\n }\n\n private _getPreviousHighlightableOptionIndex(startIndex: number, options: IListDropdownOption[]): number {\n const index = startIndex <= 0 ? options.length - 1 : startIndex - 1;\n if (options[index].disabled) {\n return this._getPreviousHighlightableOptionIndex(index, options);\n }\n return index;\n }\n\n private _getNextHighlightableOptionIndex(startIndex: number, options: IListDropdownOption[]): number {\n const index = startIndex === options.length - 1 ? 0 : startIndex + 1;\n if (options[index].disabled) {\n return this._getNextHighlightableOptionIndex(index, options);\n }\n return index;\n }\n\n private get _flatOptions(): IListDropdownOption[] {\n return getFlattenedOptions(this._config.options);\n }\n\n private get _nonDividerOptions(): IListDropdownOption[] {\n return this._flatOptions.filter(o => !o.divider);\n }\n}\n", "import { IListDropdownOption, IListDropdownOpenConfig, IListDropdownOptionGroup, LIST_DROPDOWN_CONSTANTS } from './list-dropdown-constants';\nimport { createDropdown, createList, createListItems, createAsyncElement, createBusyElement, createCheckboxElement } from './list-dropdown-utils';\nimport { IPopupComponent, POPUP_CONSTANTS } from '../popup';\nimport { IListComponent } from '../list/list';\nimport { LIST_ITEM_CONSTANTS, IListItemComponent, IListItemSelectEventData } from '../list/list-item';\nimport { ScrollEvents, getShadowElement, IScrollObserverConfiguration, ScrollAxisObserver, removeAllChildren, isFunction, removeElement, replaceElement, createVisuallyHiddenElement, isDeepEqual, tryScrollIntoView } from '@tylertech/forge-core';\nimport { ILinearProgressComponent } from '../linear-progress';\nimport { ICON_CONSTANTS, IIconComponent } from '../icon';\n\nexport interface IListDropdownAdapter {\n dropdownElement: HTMLElement | undefined;\n open(config: IListDropdownOpenConfig, selectCallback: (value: any, id: string) => void, closeCb: () => void): void;\n close(): void;\n setScrollBottomListener(listener: () => void, scrollThreshold: number): void;\n removeScrollBottomListener(listener: () => void): void;\n getActiveOptionIndex(): number;\n getSelectedOptionIndex(): number;\n getActiveOptionIdByIndex(index: number): string | null;\n toggleOptionMultiple(index: number, isSelected: boolean): void;\n scrollOptionIntoView(index: number): void;\n scrollSelectedOptionIntoView(animate?: boolean): void;\n activateSelectedOption(config: IListDropdownOpenConfig): void;\n activateOption(index: number, activeChangeCallback: ((id: string) => void) | undefined, animate?: boolean): void;\n setSelectedValues(values: any[], multiple?: boolean): void;\n clearActiveOption(): void;\n syncWidth(sync: boolean, targetWidthCallback?: () => number): void;\n setOptions(config: IListDropdownOpenConfig): void;\n appendOptions(options: Array<IListDropdownOption | IListDropdownOptionGroup>, config: IListDropdownOpenConfig): void;\n setBusyVisibility(isVisible: boolean): void;\n getScreenWidth(): number;\n}\n\nexport class ListDropdownAdapter implements IListDropdownAdapter {\n private _dropdownElement: IPopupComponent | undefined;\n private _listElement: IListComponent | undefined;\n private _announcerElement: HTMLElement | undefined;\n private _scrollObserver: ScrollAxisObserver | undefined;\n private _asyncElement: HTMLElement | undefined;\n private _busyElement: ILinearProgressComponent;\n private _headerElement: HTMLElement;\n private _footerElement: HTMLElement;\n\n constructor(private _targetElement: HTMLElement) {}\n\n public get dropdownElement(): HTMLElement | undefined {\n return this._dropdownElement;\n }\n\n public open(config: IListDropdownOpenConfig, selectCallback: (value: any, id: string) => void, closeCb: () => void): void {\n // Now lets create the popup and append the children\n this._dropdownElement = createDropdown(config, this._targetElement);\n this.syncWidth(!!config.syncWidth, config.targetWidthCallback);\n\n // If we are configured to show a busy indicator (linear progress bar across the top), then create and append it first\n if (config.allowBusy) {\n this._busyElement = createBusyElement();\n this._busyElement.style.display = 'none';\n this._dropdownElement.appendChild(this._busyElement);\n }\n\n // Create the header element if a builder exists\n if (config.headerBuilder) {\n this._headerElement = config.headerBuilder();\n if (this._headerElement) {\n this._headerElement.setAttribute(LIST_DROPDOWN_CONSTANTS.attributes.DATA_ALLOW_FOCUS, '');\n }\n }\n \n // Create the footer element if a builder exists\n if (config.footerBuilder) {\n this._footerElement = config.footerBuilder();\n if (this._footerElement) {\n this._footerElement.setAttribute(LIST_DROPDOWN_CONSTANTS.attributes.DATA_ALLOW_FOCUS, '');\n }\n }\n\n // Create the list from our config\n this._listElement = createList(config);\n\n // Add the listener for when list items are selected from the dropdown\n this._listElement.addEventListener(LIST_ITEM_CONSTANTS.events.SELECT, (evt: CustomEvent<IListItemSelectEventData>) => {\n evt.detail.listItem.setAttribute('aria-selected', 'true');\n selectCallback(evt.detail.value, evt.detail.listItem.id);\n });\n\n // Determine if we need to show the list or the async element first\n if (config.options.length) {\n // Now we can create an append the list items\n createListItems(config, this._listElement);\n this._dropdownElement.appendChild(this._listElement);\n\n // Always append the optional header element **first**\n if (this._headerElement) {\n this._dropdownElement.insertAdjacentElement('afterbegin', this._headerElement);\n }\n\n // Always append the optional footer element **last**\n if (this._footerElement) {\n this._dropdownElement.appendChild(this._footerElement);\n }\n } else if (config.allowBusy) {\n this._asyncElement = createAsyncElement(config.asyncStyle);\n this._dropdownElement.appendChild(this._asyncElement);\n }\n\n // Create the announcer element for a11y\n this._announcerElement = createVisuallyHiddenElement();\n this._announcerElement.id = `${config.id}-activedescendant`;\n this._dropdownElement.appendChild(this._announcerElement);\n\n // Open the popup\n this._dropdownElement.open = true;\n }\n\n public close(): void {\n if (!this._dropdownElement) {\n return;\n }\n this._dropdownElement.open = false;\n this._dropdownElement = undefined;\n this._listElement = undefined;\n this._announcerElement = undefined;\n }\n\n public setScrollBottomListener(listener: () => void, scrollThreshold: number): void {\n if (this._dropdownElement) {\n if (!this._scrollObserver) {\n const scrollTarget = getShadowElement(this._dropdownElement, POPUP_CONSTANTS.selectors.CONTAINER);\n const scrollConfig: IScrollObserverConfiguration = { scrollThreshold };\n this._scrollObserver = new ScrollAxisObserver(scrollTarget, scrollConfig);\n this._scrollObserver.addListener(ScrollEvents.ScrolledEnd, listener);\n }\n }\n }\n\n public removeScrollBottomListener(listener: () => void): void {\n if (this._scrollObserver) {\n this._scrollObserver.removeListener(ScrollEvents.ScrolledEnd, listener);\n }\n }\n\n public getActiveOptionIndex(): number {\n if (!this._dropdownElement) {\n return -1;\n }\n const listItems = this._getListItemElements();\n const activeListItem = [...listItems].reverse().find(li => li.active);\n return activeListItem ? listItems.indexOf(activeListItem) : -1;\n }\n\n public getSelectedOptionIndex(): number {\n const listItems = this._getListItemElements();\n return listItems.findIndex(li => li.selected);\n }\n\n public getActiveOptionIdByIndex(index: number): string | null {\n if (!this._dropdownElement) {\n return null;\n }\n const listItems = this._getListItemElements();\n const item = listItems[index];\n return item ? item.id : null;\n }\n\n public toggleOptionMultiple(index: number, isSelected: boolean): void {\n if (!this._dropdownElement) {\n return;\n }\n\n const listItems = this._getListItemElements();\n if (listItems.length && listItems[index]) {\n this._toggleSelectedOption(listItems[index], isSelected);\n }\n }\n\n public scrollOptionIntoView(index: number, animate = true): void {\n const listItem = this._getListItemElements()[index];\n if (listItem) {\n this._scrollListItemIntoView(listItem, animate ? 'smooth' : 'auto', 'center');\n }\n }\n\n public scrollSelectedOptionIntoView(animate = true): void {\n const listItem = this._getSelectedListItem();\n this._scrollListItemIntoView(listItem, animate ? 'smooth' : 'auto', 'center');\n }\n\n public activateSelectedOption(config: IListDropdownOpenConfig): void {\n const listItems = this._getListItemElements();\n if (listItems.length) {\n const activeListItems = listItems.filter(li => li.active);\n activeListItems.forEach(li => li.active = false);\n }\n \n const listItem = this._getSelectedListItem();\n if (listItem) {\n this._activateListOption(listItem, config.activeChangeCallback);\n }\n }\n\n public activateOption(index: number, activeChangeCallback: ((id: string) => void) | undefined, animate = true): void {\n if (!this._dropdownElement) {\n return;\n }\n const listItems = this._getListItemElements();\n if (listItems.length) {\n const activeListItems = listItems.filter(li => li.active);\n activeListItems.forEach(li => li.active = false);\n this._activateListOption(listItems[index], activeChangeCallback);\n this._scrollListItemIntoView(listItems[index], animate ? 'smooth' : 'auto');\n }\n }\n\n public setSelectedValues(values: any[], multiple = false): void {\n if (!this._dropdownElement) {\n return;\n }\n const listItems = this._getListItemElements();\n for (const listItem of listItems) {\n const isSelected = values.some(v => isDeepEqual(v, listItem.value));\n listItem.selected = isSelected;\n\n if (multiple) {\n const checkboxElement = listItem.querySelector(`[${LIST_DROPDOWN_CONSTANTS.attributes.CHECKBOX_ELEMENT}]`) as IIconComponent;\n if (checkboxElement) {\n const newCheckboxElement = createCheckboxElement(isSelected);\n replaceElement(newCheckboxElement, checkboxElement);\n }\n }\n }\n }\n\n public clearActiveOption(): void {\n const listItems = this._getListItemElements();\n listItems.forEach(li => li.active = false);\n }\n\n public syncWidth(sync: boolean, targetWidthCallback?: () => number): void {\n if (this._dropdownElement) {\n this._dropdownElement.style[sync ? 'width' : 'minWidth'] = `${this._getTargetElementWidth(targetWidthCallback)}px`;\n }\n }\n\n public setOptions(config: IListDropdownOpenConfig): void {\n if (!this._dropdownElement || !this._listElement) {\n return;\n }\n if (this._asyncElement && this._asyncElement.isConnected) {\n removeElement(this._asyncElement);\n }\n if (this._busyElement) {\n this._busyElement.close();\n }\n if (!this._listElement.isConnected) {\n this._dropdownElement.appendChild(this._listElement);\n }\n \n removeAllChildren(this._listElement);\n createListItems(config, this._listElement);\n\n if (this._headerElement && !this._headerElement.isConnected) {\n this._dropdownElement.insertAdjacentElement('afterbegin', this._headerElement);\n }\n if (this._footerElement && !this._footerElement.isConnected) {\n this._dropdownElement.insertAdjacentElement('beforeend', this._footerElement);\n }\n if ('position' in this._dropdownElement && typeof this._dropdownElement.position === 'function') {\n this._dropdownElement.position();\n }\n }\n\n public appendOptions(options: Array<IListDropdownOption | IListDropdownOptionGroup>, config: IListDropdownOpenConfig): void {\n if (!this._dropdownElement || !this._listElement) {\n return;\n }\n createListItems(config, this._listElement, options);\n }\n\n public setBusyVisibility(isVisible: boolean): void {\n if (!this._dropdownElement) {\n return;\n }\n if (isVisible) {\n this._busyElement.style.removeProperty('display');\n this._busyElement.open();\n } else {\n this._busyElement.close();\n }\n }\n\n public getScreenWidth(): number {\n return window.innerWidth;\n }\n\n private _getListItemElements(): IListItemComponent[] {\n return this._dropdownElement ? Array.from(this._dropdownElement.querySelectorAll(LIST_ITEM_CONSTANTS.elementName)) as IListItemComponent[] : [];\n }\n\n private _toggleSelectedOption(listItem: IListItemComponent, isSelected: boolean): void {\n if (!this._dropdownElement) {\n return;\n }\n\n // First we need to remove the active state from any other list items\n const listItems = this._getListItemElements();\n if (listItems.length) {\n const activeItems = listItems.filter(li => li !== listItem && li.active);\n if (activeItems.length) {\n activeItems.forEach(ai => ai.active = false);\n }\n }\n\n // Now we can toggle the selected state and sync the active state\n listItem.selected = isSelected;\n listItem.setAttribute('aria-selected', `${isSelected}`);\n listItem.setAttribute('aria-checked', `${isSelected}`);\n\n if (isSelected) {\n listItem.active = true;\n }\n\n // Toggle the checkbox icon based on the selected state\n const checkboxElement = listItem.querySelector(`${ICON_CONSTANTS.elementName}[slot=leading]`) as IIconComponent;\n if (checkboxElement) {\n const newCheckboxElement = createCheckboxElement(isSelected);\n replaceElement(newCheckboxElement, checkboxElement);\n }\n }\n\n private _getTargetElementWidth(cb?: () => number): number {\n if (cb && isFunction(cb)) {\n return cb();\n }\n return this._targetElement.getBoundingClientRect().width;\n }\n\n private _activateListOption(listItem: IListItemComponent | undefined, activeChangeCallback?: (id: string) => void): void {\n if (listItem && !listItem.disabled) {\n listItem.active = true;\n if (activeChangeCallback && isFunction(activeChangeCallback)) {\n activeChangeCallback(listItem.id);\n }\n }\n }\n\n private _scrollListItemIntoView(listItem: HTMLElement | undefined, behavior: 'auto' | 'smooth' = 'auto', block: 'nearest' | 'center' = 'nearest'): void {\n if (listItem && this._dropdownElement && this._dropdownElement.isConnected) {\n const scrollContainer = getShadowElement(this._dropdownElement, POPUP_CONSTANTS.selectors.CONTAINER);\n if (scrollContainer) {\n tryScrollIntoView(scrollContainer, listItem, behavior, block);\n }\n }\n }\n\n private _getSelectedListItem(): IListItemComponent | undefined {\n const listItems = this._getListItemElements();\n return listItems.find(li => li.selected);\n }\n}\n", "import { tylIconCheckBox, tylIconCheckBoxOutlineBlank } from '@tylertech/tyler-icons/standard';\n\nimport { IListDropdownConfig, IListDropdownOption, IListDropdownOptionGroup } from './list-dropdown-constants';\nimport { ListDropdownFoundation } from './list-dropdown-foundation';\nimport { ListDropdownAdapter } from './list-dropdown-adapter';\nimport { IconRegistry } from '../icon';\n\nexport interface IListDropdown {\n dropdownElement: HTMLElement | undefined;\n open(): void;\n close(): void;\n destroy(): void;\n getActiveOptionIndex(): number;\n getActiveOption(): IListDropdownOption | undefined;\n toggleOptionMultiple(index: number, isSelected: boolean): void;\n activateSelectedOption(): void;\n activateFirstOption(): number;\n activateOption(index: number): void;\n activateInitialOption(): void;\n clearActiveOption(): void;\n setSelectedValues(values: any[]): void;\n setOptions(options: Array<IListDropdownOption | IListDropdownOptionGroup>): void;\n appendOptions(options: Array<IListDropdownOption | IListDropdownOptionGroup>): void;\n scrollSelectedOptionIntoView(animate?: boolean): void;\n setScrollBottomListener(listener: () => void, threshold?: number): void;\n removeScrollBottomListener(): void;\n setBusyVisibility(isVisible: boolean): void;\n handleKey(key: string): void;\n}\n\nexport class ListDropdown implements IListDropdown {\n private _foundation: ListDropdownFoundation;\n\n constructor(private _targetElement: HTMLElement, config: IListDropdownConfig) {\n IconRegistry.define([tylIconCheckBox, tylIconCheckBoxOutlineBlank]);\n this._foundation = new ListDropdownFoundation(new ListDropdownAdapter(this._targetElement), config);\n }\n\n public destroy(): void {\n this._foundation.destroy();\n }\n\n /** Opens the dropdown. */\n public open(): void {\n this._foundation.open();\n }\n\n /** Closes the dropdown. */\n public close(): void {\n this._foundation.close();\n }\n\n /** Gets the currently highlighted option index in the dropdown. */\n public getActiveOptionIndex(): number {\n return this._foundation.getActiveOptionIndex();\n }\n\n public getActiveOption(): IListDropdownOption | undefined {\n return this._foundation.getActiveOption();\n }\n \n /** Toggles the selected option by index. Only applies when in multiselect mode. */\n public toggleOptionMultiple(index: number, isSelected: boolean): void {\n return this._foundation.toggleOptionMultiple(index, isSelected);\n }\n \n /** Activates the first selected option. */\n public activateSelectedOption(): void {\n this._foundation.activateSelectedOption();\n }\n\n /** Activates the first non-disabled option. */\n public activateFirstOption(): number {\n return this._foundation.activateFirstOption();\n }\n\n /** Activates (highlights) an option by index. */\n public activateOption(index: number): void {\n return this._foundation.activateOption(index);\n }\n\n /** Activates the first activatable option. */\n public activateInitialOption(): void {\n return this._foundation.activateInitialOption();\n }\n\n /** Clears the active option from the dropdown */\n public clearActiveOption(): void {\n this._foundation.clearActiveOption();\n }\n\n /** Sets the selected values. Only applies when in multiselect mode. */\n public setSelectedValues(values: any[]): void {\n return this._foundation.setSelectedValues(values);\n }\n\n public get dropdownElement(): HTMLElement | undefined {\n return this._foundation.dropdownElement;\n }\n\n public setOptions(options: Array<IListDropdownOption | IListDropdownOptionGroup>): void {\n this._foundation.setOptions(options);\n }\n\n public appendOptions(options: Array<IListDropdownOption | IListDropdownOptionGroup>): void {\n this._foundation.appendOptions(options);\n }\n\n public scrollSelectedOptionIntoView(animate?: boolean): void {\n this._foundation.scrollSelectedOptionIntoView();\n }\n\n public setScrollBottomListener(listener: () => void, threshold?: number): void {\n this._foundation.setScrollBottomListener(listener, threshold);\n }\n\n public removeScrollBottomListener(): void {\n this._foundation.removeScrollBottomListener();\n }\n\n public setBusyVisibility(isVisible: boolean): void {\n this._foundation.setBusyVisibility(isVisible);\n }\n\n public handleKey(key: string): void {\n this._foundation.handleKey(key);\n }\n}\n", "import { ICustomElementFoundation } from '@tylertech/forge-core';\n\nimport { ListDropdownHeaderBuilder, ListDropdownFooterBuilder } from './list-dropdown-constants';\n\nexport interface IListDropdownAwareFoundation extends ICustomElementFoundation {\n popupClasses: string | string[];\n popupHeaderBuilder: ListDropdownHeaderBuilder;\n popupFooterBuilder: ListDropdownHeaderBuilder;\n syncPopupWidth: boolean;\n optionLimit: number;\n observeScroll: boolean;\n observeScrollThreshold: number;\n constrainPopupWidth: boolean;\n wrapOptionText: boolean;\n}\n\nexport abstract class ListDropdownAwareFoundation implements IListDropdownAwareFoundation {\n protected _popupClasses: string | string[] = [];\n protected _popupHeaderBuilder: ListDropdownHeaderBuilder;\n protected _popupFooterBuilder: ListDropdownFooterBuilder;\n protected _syncPopupWidth = false;\n protected _optionLimit = 0;\n protected _observeScroll = false;\n protected _observeScrollThreshold = 0;\n protected _constrainPopupWidth = true;\n protected _wrapOptionText = false;\n\n public get syncPopupWidth(): boolean {\n return this._syncPopupWidth;\n }\n public set syncPopupWidth(value: boolean) {\n this._syncPopupWidth = value;\n }\n\n public get popupClasses(): string | string[] {\n return this._popupClasses;\n }\n public set popupClasses(value: string | string[]) {\n if (typeof value === 'string') {\n value = [value];\n }\n if (Array.isArray(value)) {\n this._popupClasses = value;\n }\n }\n\n public get observeScroll(): boolean {\n return this._observeScroll;\n }\n public set observeScroll(value: boolean) {\n this._observeScroll = value;\n }\n\n public get observeScrollThreshold(): number {\n return this._observeScrollThreshold;\n }\n public set observeScrollThreshold(value: number) {\n this._observeScrollThreshold = value;\n }\n\n public get optionLimit(): number {\n return this._optionLimit;\n }\n public set optionLimit(value: number) {\n this._optionLimit = value;\n }\n\n public get popupHeaderBuilder(): ListDropdownHeaderBuilder {\n return this._popupHeaderBuilder;\n }\n public set popupHeaderBuilder(value: ListDropdownHeaderBuilder) {\n this._popupHeaderBuilder = value;\n }\n\n public get popupFooterBuilder(): ListDropdownFooterBuilder {\n return this._popupFooterBuilder;\n }\n public set popupFooterBuilder(value: ListDropdownFooterBuilder) {\n this._popupFooterBuilder = value;\n }\n\n public get constrainPopupWidth(): boolean {\n return this._constrainPopupWidth;\n }\n public set constrainPopupWidth(value: boolean) {\n this._constrainPopupWidth = value;\n }\n\n public get wrapOptionText(): boolean {\n return this._wrapOptionText;\n }\n public set wrapOptionText(value: boolean) {\n this._wrapOptionText = value;\n }\n\n protected _applySelection(): void {}\n}\n", "import { IListDropdownAwareFoundation, ListDropdownAwareFoundation } from './list-dropdown-aware-foundation';\n\nexport interface ICascadingListDropdownAwareFoundation extends IListDropdownAwareFoundation {}\n\nexport interface ICascadingListDropdownAwareFoundationConfiguration {\n popupTimeout: number;\n targetTimeout: number;\n}\n\nexport abstract class CascadingListDropdownAwareFoundation<T> extends ListDropdownAwareFoundation implements ICascadingListDropdownAwareFoundation {\n protected _open = false;\n protected _options: T[] = [];\n protected _childOpen = false;\n protected _popupHasMouse = false; // Used to determine if the popup element is under the users mouse\n protected _mouseCoords: { x: number; y: number };\n protected _activeMouseLeaveTimeout: number;\n protected _targetMouseEnterListener: (evt: MouseEvent) => void;\n protected _targetMouseLeaveListener: (evt: MouseEvent) => void;\n protected _childPopupMouseEnterListener: (evt: MouseEvent) => void;\n protected _childPopupMouseLeaveListener: (evt: MouseEvent) => void;\n protected _documentMouseMoveListener: (evt: MouseEvent) => void;\n \n protected abstract _attachCascadingListeners(): void;\n protected abstract _detachCascadingListeners(): void;\n protected abstract _onCascadingOptionSelected(data: any): void;\n protected abstract _onCascadingChildOpen(index: number): void;\n protected abstract _onCascadingChildClose(index: number): void;\n protected abstract _closeDropdown(): void;\n protected abstract _openDropdown({ fromKeyboard }: { fromKeyboard?: boolean }): void;\n protected abstract _setCascadeTargetInactive(): void;\n protected abstract _isOwnElement(element: Element): boolean;\n\n constructor(private _config: ICascadingListDropdownAwareFoundationConfiguration) {\n super();\n this._targetMouseEnterListener = evt => this._onTargetMouseEnter(evt);\n this._targetMouseLeaveListener = evt => this._onTargetMouseLeave(evt);\n this._childPopupMouseEnterListener = () => this._onChildPopupMouseEnter();\n this._childPopupMouseLeaveListener = () => this._onChildPopupMouseLeave();\n this._documentMouseMoveListener = evt => this._mouseCoords = { x: evt.pageX, y: evt.pageY };\n }\n\n private _onChildPopupMouseEnter(): void {\n this._popupHasMouse = true;\n }\n\n private _onChildPopupMouseLeave(): void {\n this._popupHasMouse = false;\n setTimeout(() => {\n const mouseElement = document.elementFromPoint(this._mouseCoords.x, this._mouseCoords.y);\n if (!this._popupHasMouse && !this._childOpen && (!mouseElement || !this._isOwnElement(mouseElement))) {\n this._setCascadeTargetInactive();\n this._closeDropdown();\n }\n }, this._config.popupTimeout);\n }\n\n private _onTargetMouseEnter(evt: MouseEvent): void {\n if (!this._options.length) {\n return;\n }\n this._openDropdown({ fromKeyboard: false });\n }\n\n private _onTargetMouseLeave(evt: MouseEvent): void {\n // We wrap this in a timeout to allow for the user to take an indirect path toward an open child menu. This\n // allows for the popup to stay open while the user is moving their mouse to it (makes the transition easier and more smooth)\n this._activeMouseLeaveTimeout = window.setTimeout(() => {\n // Ignore this if our open state has changed, or if we have a child popup open now\n if (!this._open || this._childOpen) {\n return;\n }\n if (this._mouseCoords) {\n // We ignore this event if the mouse moved to an element within our own popup\n const mouseElement = document.elementFromPoint(this._mouseCoords.x, this._mouseCoords.y);\n if (mouseElement && this._isOwnElement(mouseElement)) {\n return;\n }\n }\n this._setCascadeTargetInactive();\n this._closeDropdown();\n }, this._config.targetTimeout);\n }\n\n protected _clearMouseLeaveTimeout(): void {\n if (this._activeMouseLeaveTimeout !== undefined) {\n window.clearTimeout(this._activeMouseLeaveTimeout);\n }\n }\n}\n"],
5
- "mappings": "ulBAEA,IAAMA,GAAa,CACjB,cAAe,gBACf,aAAc,eACd,eAAgB,iBAChB,yBAA0B,2BAC1B,iBAAkB,mBAClB,sBAAuB,wBACvB,iBAAkB,mBAGlB,iBAAkB,8BAClB,iBAAkB,gCACpB,EAEMC,GAAU,CACd,cAAe,oCACjB,EAEaC,EAA0B,CACrC,WAAAF,GACA,QAAAC,EACF,EAqFaE,EAA6D,CACxE,QAAS,CAAC,EACV,UAAW,GACX,eAAgB,CAAC,EACjB,SAAU,EACZ,EAIYC,OACVA,EAAA,KAAO,OACPA,EAAA,SAAW,WACXA,EAAA,KAAO,OAHGA,OAAA,IAMAC,QACVA,EAAA,QAAU,UACVA,EAAA,SAAW,WAFDA,QAAA,IC3HL,IAAMC,EAAN,KAA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AAGA,EAAI,MAAO,EAAGA,EAAI,KAAM,CAC5F,CAEQ,yBAAgC,CACtC,KAAK,eAAiB,EACxB,CAEQ,yBAAgC,CACtC,KAAK,eAAiB,GACtB,WAAW,IAAM,CACf,IAAMC,EAAe,SAAS,iBAAiB,KAAK,aAAa,EAAG,KAAK,aAAa,CAAC,EACnF,CAAC,KAAK,gBAAkB,CAAC,KAAK,aAAe,CAACA,GAAgB,CAAC,KAAK,cAAcA,CAAY,KAChG,KAAK,0BAA0B,EAC/B,KAAK,eAAe,EAExB,EAAG,KAAK,QAAQ,YAAY,CAC9B,CAEQ,oBAAoBD,EAAuB,CAC7C,CAAC,KAAK,SAAS,QAGnB,KAAK,cAAc,CAAE,aAAc,EAAM,CAAC,CAC5C,CAEQ,oBAAoBA,EAAuB,CAGjD,KAAK,yBAA2B,OAAO,WAAW,IAAM,CAEtD,GAAI,GAAC,KAAK,OAAS,KAAK,YAGxB,IAAI,KAAK,aAAc,CAErB,IAAMC,EAAe,SAAS,iBAAiB,KAAK,aAAa,EAAG,KAAK,aAAa,CAAC,EACvF,GAAIA,GAAgB,KAAK,cAAcA,CAAY,EACjD,MAEJ,CACA,KAAK,0BAA0B,EAC/B,KAAK,eAAe,EACtB,EAAG,KAAK,QAAQ,aAAa,CAC/B,CAEU,yBAAgC,CACpC,KAAK,2BAA6B,QACpC,OAAO,aAAa,KAAK,wBAAwB,CAErD,CACF",
6
- "names": ["attributes", "classes", "LIST_DROPDOWN_CONSTANTS", "DEFAULT_LIST_DROPDOWN_CONFIG", "ListDropdownType", "ListDropdownAsyncStyle", "EventAware", "type", "data", "listeners", "cb", "listener", "ScrollDirection", "ScrollEvents", "DEFAULT_SCROLL_THROTTLE", "ScrollAxisObserver", "EventAware", "_element", "_config", "wait", "throttle", "isDefined", "isNumber", "isVertical", "isHorizontal", "position", "direction", "ScrollDirection", "ScrollEvents", "scrollStart", "scrollEnd", "createDropdown", "config", "targetElement", "dropdownElement", "createPopupDropdown", "dropdownId", "evt", "composedPath", "getEventPath", "el", "LIST_DROPDOWN_CONSTANTS", "addClass", "_a", "popupElement", "POPUP_CONSTANTS", "createList", "listElement", "LIST_CONSTANTS", "createListItems", "options", "groups", "getOptionsByGroup", "flatOptions", "getFlattenedOptions", "limitOptions", "optionLimit", "optionIndex", "group", "optionParent", "headerElement", "groupWrapper", "listHeaderElement", "option", "dividerElement", "createDivider", "isSelected", "v", "isDeepEqual", "listItemElement", "element", "result", "checkboxElement", "createCheckboxElement", "value", "key", "isObject", "leadingIconElement", "createIconElement", "trailingIconElement", "optionIconElement", "factoryConfig", "o", "cascadingElement", "selected", "tylIconCheckBox", "tylIconCheckBoxOutlineBlank", "divider", "type", "iconName", "iconClass", "icon", "iconElement", "ICON_CLASS_NAME", "createAsyncElement", "asyncStyle", "createSkeletonElement", "createSpinnerElement", "div", "spinner", "list", "i", "listItemSkeleton", "SKELETON_CONSTANTS", "createBusyElement", "linearProgress", "LINEAR_PROGRESS_CONSTANTS", "isListDropdownOptionType", "isOptionGroups", "isDefined", "isOptionTypes", "flatOpts", "ListDropdownFoundation", "_adapter", "config", "__spreadValues", "DEFAULT_LIST_DROPDOWN_CONFIG", "value", "id", "sync", "index", "isSelected", "o", "options", "animate", "values", "listener", "threshold", "isVisible", "key", "activeOptionIndex", "activeOption", "option", "startIndex", "getFlattenedOptions", "ListDropdownAdapter", "_targetElement", "config", "selectCallback", "closeCb", "createDropdown", "createBusyElement", "LIST_DROPDOWN_CONSTANTS", "createList", "LIST_ITEM_CONSTANTS", "evt", "createListItems", "createAsyncElement", "createVisuallyHiddenElement", "listener", "scrollThreshold", "scrollTarget", "getShadowElement", "POPUP_CONSTANTS", "scrollConfig", "ScrollAxisObserver", "ScrollEvents", "listItems", "activeListItem", "li", "index", "item", "isSelected", "animate", "listItem", "activeChangeCallback", "values", "multiple", "v", "isDeepEqual", "checkboxElement", "newCheckboxElement", "createCheckboxElement", "replaceElement", "sync", "targetWidthCallback", "removeElement", "removeAllChildren", "options", "isVisible", "activeItems", "ai", "ICON_CONSTANTS", "cb", "isFunction", "behavior", "block", "scrollContainer", "tryScrollIntoView", "ListDropdown", "_targetElement", "config", "IconRegistry", "tylIconCheckBox", "tylIconCheckBoxOutlineBlank", "ListDropdownFoundation", "ListDropdownAdapter", "index", "isSelected", "values", "options", "animate", "listener", "threshold", "isVisible", "key", "ListDropdownAwareFoundation", "value", "CascadingListDropdownAwareFoundation", "ListDropdownAwareFoundation", "_config", "evt", "mouseElement"]
7
- }
@@ -1,7 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2023 Tyler Technologies, Inc.
4
- * License: Apache-2.0
5
- */
6
- import{c as le}from"./chunk.YWVKDJXZ.js";import{a as re,b as pe}from"./chunk.MLV25D2G.js";import{b as Q}from"./chunk.UT7QUGAO.js";import{a as y}from"./chunk.HMCOY5WC.js";import{a as se}from"./chunk.GO5A4GKZ.js";import{a as ie}from"./chunk.MUEXD4SD.js";import{h as ae,i as ue}from"./chunk.KKMKGN2I.js";import{b as ne}from"./chunk.KU5CXXGS.js";import{c as te}from"./chunk.KE6GOYAB.js";import{e as ee}from"./chunk.RG6CDWEX.js";import{b as Z}from"./chunk.VAKNDCLP.js";import{a as F,e as oe}from"./chunk.V7WKXEZC.js";import{c as V,g as q,h as z}from"./chunk.MZLPUI6R.js";import{a as L}from"./chunk.YI4JTY4T.js";import{d as X,l as J,m as j}from"./chunk.JHBCYICS.js";import{a as $}from"./chunk.ARJ3EVVO.js";import{a as Y}from"./chunk.Y66GSZJB.js";import{a as G}from"./chunk.G5MGGEFP.js";import{a}from"./chunk.KTGSZEAG.js";import{a as R,b as K,c as W}from"./chunk.BE7PZANN.js";import{a as U,e as H,g as C}from"./chunk.Y4GKBJGI.js";import{m as M,r as N,s as k,u as A}from"./chunk.PN26D52V.js";import{a as x,b as h,c as S,j as w,k as g,l as P,n as D,o as B}from"./chunk.J2M2MXP2.js";import{a as T,f as p}from"./chunk.MCIQXNKY.js";var O=`${K}autocomplete`,fe={MODE:"mode",MULTIPLE:"multiple",DEBOUNCE:"debounce",FILTER_ON_FOCUS:"filter-on-focus",FILTER_FOCUS_FIRST:"filter-focus-first",ALLOW_UNMATCHED:"allow-unmatched",POPUP_TARGET:"popup-target",POPUP_CLASSES:"popup-classes",OPTION_LIMIT:"option-limit",OBSERVE_SCROLL:"observe-scroll",OBSERVE_SCROLL_THRESHOLD:"observe-scroll-threshold",SYNC_POPUP_WIDTH:"sync-popup-width",OPEN:"open",MATCH_KEY:"match-key",FILTER_TEXT:"filter-text",DROPDOWN_ICON_OPEN:"data-forge-dropdown-icon-open"},ve={INPUT:se.selectors.INPUT,DROPDOWN_ICON:"[data-forge-dropdown-icon],[data-forge-dropdown-icon],[forge-dropdown-icon],.forge-dropdown-icon",CLEAR_BUTTON:"[data-forge-autocomplete-clear],[forge-autocomplete-clear]"},ge={DEFAULT_DEBOUNCE_TIME:500,NUM_SKELETON_ITEMS:3},be={CHANGE:`${O}-change`,SELECT:`${O}-select`,SCROLLED_BOTTOM:`${O}-scrolled-bottom`},o={elementName:O,attributes:fe,selectors:ve,numbers:ge,events:be},de=(e=>(e.Default="default",e.Stateless="stateless",e))(de||{});var I=class extends G{constructor(e){super(e);this.setInputElement()}setInputElement(){let e=N(this._component,o.selectors.INPUT,!1);return e.length&&(this._inputElement=e[0]),this._inputElement}setInputAttribute(e,t){this._inputElement.setAttribute(e,t)}addInputListener(e,t){this._inputElement.addEventListener(e,t)}removeInputListener(e,t){this._inputElement.removeEventListener(e,t)}initializeInputAccessibility(e){this._inputElement.setAttribute("autocomplete","off"),this._inputElement.setAttribute("role","combobox"),this._inputElement.setAttribute("aria-live","polite"),this._inputElement.setAttribute("aria-atomic","true"),this._inputElement.setAttribute("aria-haspopup","true"),this._inputElement.setAttribute("aria-expanded","false"),this._inputElement.setAttribute("aria-autocomplete","list")}isWrappingChipField(){return!!this._component.querySelector(y.elementName)}show(e,t){this._targetElement=this._getTargetElement(t),this._targetElement&&(this._listDropdown=new ae(this._targetElement,e),this._listDropdown.open(),this._inputElement.setAttribute("aria-expanded","true"),this._inputElement.setAttribute("aria-controls",`list-dropdown-popup-${e.id}`),this._tryToggleDropdownIconRotation(!0))}hide(e){if(!this._listDropdown)return;let{targetElement:t}=this._listDropdown.dropdownElement;t.removeEventListener(F.events.BLUR,e),this.setBusyVisibility(!1),this._tryToggleDropdownIconRotation(!1),this._inputElement.removeAttribute("aria-activedescendant"),this._inputElement.removeAttribute("aria-controls"),this._inputElement.setAttribute("aria-expanded","false"),this._listDropdown.close(),this._listDropdown=void 0}setBusyVisibility(e){var t;(t=this._listDropdown)==null||t.setBusyVisibility(e)}toggleOptionMultiple(e,t){var i;(i=this._listDropdown)==null||i.toggleOptionMultiple(e,t)}setDismissListener(e){if(!this._listDropdown||!this._listDropdown.dropdownElement)return;let t=this._listDropdown.dropdownElement;t.targetElement&&t.targetElement.addEventListener(F.events.BLUR,e)}focus(){window.requestAnimationFrame(()=>this._inputElement.focus())}setOptions(e){var t;(t=this._listDropdown)==null||t.setOptions(e)}appendOptions(e){var t;(t=this._listDropdown)==null||t.appendOptions(e)}setSelectedText(e){this._inputElement.value=e}getInputValue(){return this._inputElement.value}setInputValue(e){this._inputElement.value=e}selectInputValue(){window.requestAnimationFrame(()=>this._inputElement.select())}isFocusWithinPopup(e){return!this._listDropdown||!this._listDropdown.dropdownElement?!1:this._listDropdown.dropdownElement.contains(e)}hasFocus(){let e=k();return e===this._inputElement||this.isFocusWithinPopup(e)}hasInputElement(){return!!this._inputElement}setDropdownIconListener(e,t){window.requestAnimationFrame(()=>{let i=this._component.querySelector(o.selectors.DROPDOWN_ICON);i&&i.addEventListener(e,t)})}removeDropdownIconListener(e,t){let i=this._component.querySelector(o.selectors.DROPDOWN_ICON);i&&i.removeEventListener(e,t)}setClearButtonListener(e,t){window.requestAnimationFrame(()=>{let i=this._component.querySelector(o.selectors.CLEAR_BUTTON);i&&i.addEventListener(e,t)})}removeClearButtonListener(e,t){let i=this._component.querySelector(o.selectors.CLEAR_BUTTON);i&&i.removeEventListener(e,t)}propagateKey(e){var t;(t=this._listDropdown)==null||t.handleKey(e)}updateActiveDescendant(e){!this._targetElement||A(this._inputElement,!!e,"aria-activedescendant",e)}getTargetElementWidth(e){return this._targetElement||(this._targetElement=this._getTargetElement(e)),this._targetElement.getBoundingClientRect().width}getPopupElement(){var e,t;return(t=(e=this._listDropdown)==null?void 0:e.dropdownElement)!=null?t:null}activateFirstOption(){var e;(e=this._listDropdown)==null||e.activateFirstOption()}activateSelectedOption(){var e;(e=this._listDropdown)==null||e.activateSelectedOption()}activateOptionByIndex(e){var t;(t=this._listDropdown)==null||t.activateOption(e)}getActiveOptionIndex(){var e,t;return(t=(e=this._listDropdown)==null?void 0:e.getActiveOptionIndex())!=null?t:null}clearActiveOption(){var e;(e=this._listDropdown)==null||e.clearActiveOption()}setSelectedOptions(e){if(this._listDropdown){let t=e.map(i=>i.value);this._listDropdown.setSelectedValues(t)}}queueDropdownPositionUpdate(){!this.getPopupElement()||window.requestAnimationFrame(()=>{let e=this.getPopupElement();e==null||e.position()})}_getTargetElement(e){return e?this._component.querySelector(e)||this._getDefaultTargetElement():this._getDefaultTargetElement()}_getDefaultTargetElement(){let e=this._component.querySelector("forge-text-field");if(e&&e.shadowRoot){let i=C(e,re.selectors.ROOT);if(i)return i}let t=this._component.querySelector("forge-chip-field");if(t&&t.shadowRoot){let i=C(t,y.selectors.ROOT);if(i)return i}return this._component.querySelector("input")||this._component}_tryToggleDropdownIconRotation(e){let t=this._component.querySelector(o.selectors.DROPDOWN_ICON);t&&A(t,e,o.attributes.DROPDOWN_ICON_OPEN)}};var ce=(e=>(e[e.Option=0]="Option",e[e.Group=1]="Group",e))(ce||{});function b(u,d){let e=u.some(i=>h(i)&&w(i)&&i.hasOwnProperty("options")&&(i.hasOwnProperty("text")||i.hasOwnProperty("builder"))),t=u.some(i=>h(i)&&w(i)&&i.hasOwnProperty("label")&&i.hasOwnProperty("value"));return e&&d===1||t&&d===0}function he(u,d){return u.find(e=>e.value===d)}function v(u,d,e=null){return e?!(e in u.value)||!(e in d)?!1:D(u.value[e],d[e]):D(u.value,d)}var E=class extends ue{constructor(e){super();this._adapter=e;this._isInitialized=!1;this._isDropdownOpen=!1;this._mode="default";this._multiple=!1;this._debounce=o.numbers.DEFAULT_DEBOUNCE_TIME;this._allowUnmatched=!1;this._filterOnFocus=!0;this._filterFocusFirst=!0;this._options=[];this._filterText="";this._selectedOptions=[];this._values=[];this._pendingFilterPromises=[];this._matchKey=null;this._clickListener=t=>this._onClick(t),this._focusListener=()=>this._onFocus(),this._blurListener=t=>this._onBlur(t),this._keydownListener=t=>this._onKeydown(t),this._dropdownIconClickListener=t=>this._onDropdownIconClick(t),this._dropdownScrollEndListener=()=>this._onDropdownScrollEnd(),this._dropdownIconMouseDownListener=t=>this._onDropdownIconMouseDown(t),this._clearButtonListener=t=>this._onClear(t),this._dismissListener=()=>this._onDismiss(),this._activeChangeListener=t=>this._adapter.updateActiveDescendant(t),this._targetWidthCallback=()=>this._adapter.getTargetElementWidth(this._popupTarget),this._identifier=x()}async initialize(){if(!this._adapter.hasInputElement()&&!this._adapter.setInputElement())throw new Error("An input element is required as a child of the autocomplete component.");if(this._setInputListener(),this._setFilterCallback(),this._attachListeners(),this._initializeAccessibility(),this._values.length){if(!this._selectedOptions.length){try{await this._executeFilter()}catch(e){console.error(e)}this._updateSelectedOptions(this._values)}this._adapter.setSelectedText(this._getSelectedText())}this._isInitialized=!0}disconnect(){this._isInitialized&&(this._detachListeners(),this._isInitialized=!1),this._isDropdownOpen&&this._closeDropdown()}_attachListeners(){this._adapter.addInputListener("click",this._clickListener),this._adapter.addInputListener("focus",this._focusListener),this._adapter.addInputListener("blur",this._blurListener),this._adapter.addInputListener("input",this._inputListener),this._adapter.addInputListener("keydown",this._keydownListener),this._adapter.setDropdownIconListener("click",this._dropdownIconClickListener),this._adapter.setDropdownIconListener("mousedown",this._dropdownIconMouseDownListener),this._adapter.setClearButtonListener("click",this._clearButtonListener)}_detachListeners(){this._adapter.removeInputListener("click",this._clickListener),this._adapter.removeInputListener("focus",this._focusListener),this._adapter.removeInputListener("blur",this._blurListener),this._adapter.removeInputListener("input",this._inputListener),this._adapter.removeInputListener("keydown",this._keydownListener),this._adapter.removeDropdownIconListener("click",this._dropdownIconClickListener),this._adapter.removeDropdownIconListener("mousedown",this._dropdownIconMouseDownListener),this._adapter.removeClearButtonListener("click",this._clearButtonListener)}_setInputListener(){this._inputListener=e=>this._onInput(e)}_setFilterCallback(){this._filterFn=h(this._debounce)&&this._debounce>0?B(this._debounceFilter,this._debounce,!1):this._debounceFilter}_initializeAccessibility(){this._adapter.initializeInputAccessibility(this._identifier)}get _flatOptions(){return b(this._options,1)?this._options.reduce((e,t)=>e.concat(t.options),[]):this._options}_onClick(e){!this._isDropdownOpen&&this._filterOnFocus&&this._showDropdown()}_onDropdownIconMouseDown(e){e.preventDefault()}_onDropdownIconClick(e){this._isDropdownOpen?this._closeDropdown():(this._adapter.focus(),window.requestAnimationFrame(()=>this._showDropdown()))}_onClear(e){this._clearValue(),this._adapter.setSelectedText(this._getSelectedText())}_onDropdownScrollEnd(){this._adapter.emitHostEvent(o.events.SCROLLED_BOTTOM)}_onFocus(){!this._isDropdownOpen&&this._adapter.getInputValue()&&!L.isMobile&&this._adapter.selectInputValue()}_onBlur(e){this._adapter.isFocusWithinPopup(e.relatedTarget)||this._applyBlur()}_applyBlur(){this._isDropdownOpen&&this._closeDropdown(),this._mode!=="stateless"&&(this._selectedOptions.length?this._adapter.setSelectedText(this._getSelectedText()):this._allowUnmatched||(this._filterText="",this._adapter.setSelectedText("")))}_onInput(e){this._selectedOptions.length&&!this._multiple&&(!this._adapter.getInputValue()||this._allowUnmatched)&&!this._adapter.isWrappingChipField()&&(this._selectedOptions=[],this._values=[],this._emitChangeEvent()),this._filterText=this._adapter.getInputValue(),this._filterFn()}async _debounceFilter({checkFocus:e=!0}={}){if(!e&&!this._adapter.hasFocus()){this._pendingFilterPromises=[],this._isDropdownOpen&&this._closeDropdown();return}let t=this._filterText,i=this._executeFilter();this._pendingFilterPromises.push(i),this._isDropdownOpen?this._adapter.setBusyVisibility(!0):this._showDropdown({filter:!1});try{await i}catch(n){this._pendingFilterPromises=[],this._isDropdownOpen&&this._closeDropdown();return}if(t===this._filterText)this._pendingFilterPromises=[],this._onFilterComplete();else{let n=this._pendingFilterPromises.indexOf(i);n!==-1&&this._pendingFilterPromises.splice(n,1)}}_onKeydown(e){switch(e.key){case"Tab":this._isDropdownOpen&&!this._multiple&&this._selectActiveOption(!1);break;case"Esc":case"Escape":this._isDropdownOpen&&(e.preventDefault(),e.stopPropagation(),this._closeDropdown());break;case"Down":case"ArrowDown":e.preventDefault(),this._isDropdownOpen?this._adapter.propagateKey(e.key):this._showDropdown({activateFirst:!0,activateSelected:!0});break;case"Up":case"ArrowUp":e.preventDefault(),this._isDropdownOpen&&this._adapter.propagateKey(e.key);break;case"Enter":case"Home":case"End":this._isDropdownOpen&&(e.key==="Enter"&&e.stopPropagation(),e.preventDefault(),this._adapter.propagateKey(e.key));break;case"Backspace":case"Delete":let t=e.target,i=this._adapter.getInputValue(),n=t.value.substring(t.selectionStart,t.selectionEnd)===t.value,l=i.length===1&&t.selectionEnd===1,c=i.length===1&&t.selectionEnd===0,_=!i||n||l||c;!this._adapter.isWrappingChipField()&&_&&!this._multiple&&this._values.length&&this._clearValue();break}}_executeFilter(e=!0,t=!1){if(!this._filter||typeof this._filter!="function")throw new Error('A filter callback must be provided. Did you set the "filter" property?');let i=this._filter,n=e?this._filterText:"",l=t?this._getValue():null;return new Promise((c,_)=>Promise.resolve(i(n,l)).then(s=>{this._options=s,c(this._options)}).catch(s=>_(`An unexpected error occurred while filtering: ${s}`)))}_onFilterComplete(){if(!this._adapter.hasFocus()){this._isDropdownOpen&&this._closeDropdown();return}if(this._options.length){let e=this._allowUnmatched&&!this._selectedOptions.length;this._dropdownReady({userTriggered:e}),this._filterFocusFirst&&this._filterText&&this._adapter.activateFirstOption()}else this._closeDropdown()}_clearValue(){this._selectedOptions=[],this._values=[],this._isDropdownOpen&&(this._adapter.setSelectedOptions([]),this._adapter.clearActiveOption()),this._emitChangeEvent()}async _showDropdown({filter:e=!0,userTriggered:t=!0,activateFirst:i=!1,activateSelected:n=!1}={}){let l=this._allowUnmatched&&!this._selectedOptions.length;this._isDropdownOpen=!0;let c;if(this._optionBuilder){let s=this._optionBuilder;c=(m,f)=>s(m,this._filterText,f)}let _={options:this._options,multiple:this._multiple,selectedValues:[...this._values],id:`forge-autocomplete-${this._identifier}`,asyncStyle:"skeleton",optionLimit:this._optionLimit,popupClasses:this._popupClasses,headerBuilder:this._popupHeaderBuilder,footerBuilder:this._popupFooterBuilder,transform:s=>{if(this._filterText){let m=Y(s,this._filterText);if(m)return m}return s},allowBusy:!0,optionBuilder:c,syncWidth:this._syncPopupWidth,observeScroll:this._observeScroll,observeScrollThreshold:this._observeScrollThreshold,scrollEndListener:this._dropdownScrollEndListener,activeChangeCallback:this._activeChangeListener,targetWidthCallback:this._targetWidthCallback,selectCallback:s=>this._onSelect(s),closeCallback:()=>this._closeDropdown()};if(this._adapter.show(_,this._popupTarget),this._adapter.toggleHostAttribute(o.attributes.OPEN,this._isDropdownOpen),e){this._options.length&&this._adapter.setBusyVisibility(!0);try{await this._executeFilter(l)}catch(s){console.error(s)}this._updateSelectedOptions(this._values)}this._pendingFilterPromises.length||this._dropdownReady({userTriggered:t,activateFirst:i,activateSelected:n})}_dropdownReady({userTriggered:e=!0,activateFirst:t=!1,activateSelected:i=!1}={}){if(!this._isDropdownOpen||!this._options.length||e&&!this._adapter.hasFocus()){this._closeDropdown();return}this._sortSelectedOptions(),this._adapter.setBusyVisibility(!1),this._adapter.setOptions(this._options),this._adapter.setSelectedOptions(this._selectedOptions),this._adapter.setDismissListener(this._dismissListener),i&&this._selectedOptions.length?this._adapter.activateSelectedOption():t&&this._adapter.activateFirstOption()}_closeDropdown(){this._multiple&&(this._filterText=""),this._isDropdownOpen=!1,this._adapter.hide(this._dismissListener),this._sortSelectedOptions(),this._adapter.toggleHostAttribute(o.attributes.OPEN,this._isDropdownOpen)}_sortSelectedOptions(){if(this._multiple&&this._selectedOptions.length&&b(this._options,0)){let e=[],t=[];this._options.forEach(i=>{this._selectedOptions.find(n=>v(n,i.value,this._matchKey))?e.push(i):t.push(i)}),this._options=[...e,...t]}}async _onSelect(e,t=!0){if(this._valueChanging)return;if(this._mode==="stateless"){let n={value:e};this._adapter.emitHostEvent(o.events.SELECT,n,!0,!0)&&(this._filterText="",this._multiple||this._closeDropdown());return}let i=()=>{let n=this._flatOptions,l=n.find(s=>v(s,e,this._matchKey)),c=l?l.value:"",_=l?l.label:"";if(this._multiple){let s=n.findIndex(f=>v(f,e,this._matchKey));if(s>=0){let f=this._selectedOptions.some(me=>v(me,e,this._matchKey));this._adapter.toggleOptionMultiple(s,f)}let m=he(this._selectedOptions,c);if(m){let f=this._selectedOptions.indexOf(m);this._selectedOptions.splice(f,1)}else this._selectedOptions.push(l)}else h(c)?(this._selectedOptions[0]=l,this._filterText=_):(this._selectedOptions=[],this._filterText="");if(this._isDropdownOpen&&this._adapter.setSelectedOptions(this._selectedOptions),this._values=this._selectedOptions.map(s=>s.value),this._adapter.setSelectedText(this._getSelectedText()),!L.isMobile&&t&&this._adapter.selectInputValue(),this._multiple){let s=n.findIndex(f=>v(f,e,this._matchKey)),m=this._values.includes(e);this._adapter.toggleOptionMultiple(s,m)}this._emitChangeEvent(),this._tryUpdateDropdownPosition()};this._isDropdownOpen&&!this._multiple&&this._closeDropdown(),typeof this._beforeValueChange=="function"?(this._valueChanging=Promise.resolve(this._beforeValueChange.call(null,e,this._matchKey)),await this._valueChanging?i():this._tryUpdateDropdownPosition(),this._valueChanging=void 0):i()}_selectActiveOption(e=!0){let t=this._adapter.getActiveOptionIndex();if(typeof t=="number"&&t>=0){let i=this._flatOptions[t];i&&this._onSelect(i.value,e)}}_emitChangeEvent(){this._adapter.emitHostEvent(o.events.CHANGE,this._getValue(),!0)}_tryUpdateDropdownPosition(){this._isDropdownOpen&&this._adapter.queueDropdownPositionUpdate()}_getValue(){return this._values?this._values.length?this._multiple?[...this._values]:this._values[0]:this._multiple?[]:null:null}_getSelectedText(){var e,t;return this._adapter.isWrappingChipField()?"":this._selectedTextBuilder?this._selectedTextBuilder(this._selectedOptions):this._multiple?this._values.length?this._values.length===1?(t=(e=this._selectedOptions[0])==null?void 0:e.label)!=null?t:"":`${this._values.length} options selected`:"":this._selectedOptions.filter(i=>i&&i.label).map(i=>i.label).join(" ").trim()}_onDismiss(){this._closeDropdown()}async _applyValue(e){let t=[];this._selectedOptions=[],Array.isArray(e)?t=e:t=h(e)?[e]:[],!this._multiple&&t.length>1&&(t=[t[0]]),b(t,0)?(this._values=t.map(n=>n.value),this._selectedOptions=t):this._values=t;let i=this._flatOptions;if(t.length&&i.length&&this._updateSelectedOptions(t),this._values.length&&!this._selectedOptions.length&&!!this._filter&&this._isInitialized){try{await this._executeFilter(!1,!0)}catch(n){console.error(n)}this._updateSelectedOptions(this._values)}this._multiple?this._filterText="":this._filterText=this._selectedOptions.length?this._selectedOptions[0].label:"",this._isInitialized&&this._adapter.setSelectedText(this._getSelectedText()),this._isDropdownOpen&&this._adapter.setSelectedOptions(this._selectedOptions)}_updateSelectedOptions(e){let t=[...this._flatOptions,...this._selectedOptions];if(this._selectedOptions.length&&(this._selectedOptions=[]),b(e,0))for(let i of e){let n=t.find(l=>v(l,i.value,this._matchKey));n?this._selectedOptions.push(n):this._selectedOptions.push(i)}else for(let i of e){let n=t.find(l=>v(l,i,this._matchKey));n?this._selectedOptions.push(n):this._allowUnmatched&&this._selectedOptions.push({label:i,value:i})}}get mode(){return this._mode}set mode(e){this._mode!==e&&(this._mode=e,this._mode==="stateless"&&(this._selectedOptions=[],this._isDropdownOpen&&this._closeDropdown()),this._adapter.setHostAttribute(o.attributes.MODE,this._mode))}get multiple(){return this._multiple}set multiple(e){this._multiple!==e&&(this._multiple=e,this._adapter.setHostAttribute(o.attributes.MULTIPLE,h(this._multiple)?this._multiple.toString():""))}get value(){return this._getValue()}set value(e){let t=[];e==null?t=[]:Array.isArray(e)?t=JSON.parse(JSON.stringify(e)):S(e)?t=[e]:t=[JSON.parse(JSON.stringify(e))],(t.length!==this._values.length||t.some(n=>!this._values.includes(n)))&&this._applyValue(e)}get filterOnFocus(){return this._filterOnFocus}set filterOnFocus(e){this._filterOnFocus!==e&&(this._filterOnFocus=e,this._adapter.setHostAttribute(o.attributes.FILTER_ON_FOCUS,h(this._filterOnFocus)?this._filterOnFocus.toString():""))}get filterFocusFirst(){return this._filterFocusFirst}set filterFocusFirst(e){this._filterFocusFirst!==e&&(this._filterFocusFirst=e,this._adapter.toggleHostAttribute(o.attributes.FILTER_FOCUS_FIRST,this._filterFocusFirst))}get allowUnmatched(){return this._allowUnmatched}set allowUnmatched(e){this._allowUnmatched!==e&&(this._allowUnmatched=e,h(this._allowUnmatched)&&this._adapter.setHostAttribute(o.attributes.ALLOW_UNMATCHED,this._allowUnmatched.toString()))}get matchKey(){return this._matchKey}set matchKey(e){this._matchKey!==e&&(this._matchKey=e)}get popupTarget(){return this._popupTarget}set popupTarget(e){this._popupTarget!==e&&(this._popupTarget=e)}get filterText(){return this._filterText}set filterText(e){this._filterText!==e&&(this._filterText=this._allowUnmatched?e:"",this._isInitialized&&this._allowUnmatched&&(this._adapter.setInputValue(this._filterText),this._isDropdownOpen&&this._debounceFilter({checkFocus:!1})))}get popupClasses(){return Array.isArray(this._popupClasses)?[...this._popupClasses]:[this._popupClasses]}set popupClasses(e){this._popupClasses!==e&&(this._popupClasses=Array.isArray(e)?[...e]:[e])}set popupHeaderBuilder(e){this._popupHeaderBuilder=e}set popupFooterBuilder(e){this._popupFooterBuilder=e}get syncPopupWidth(){return this._syncPopupWidth}set syncPopupWidth(e){this._syncPopupWidth!==e&&(this._syncPopupWidth=e)}get optionLimit(){return this._optionLimit}set optionLimit(e){this._optionLimit!==e&&(this._optionLimit=e)}get debounce(){return this._debounce}set debounce(e){this._debounce!==e&&(this._debounce=e,this._isInitialized&&this._setFilterCallback(),this._adapter.setHostAttribute(o.attributes.DEBOUNCE,h(this._debounce)?this._debounce.toString():""))}get optionBuilder(){return this._optionBuilder}set optionBuilder(e){this._optionBuilder=e}get filter(){return this._filter}set filter(e){this._filter!==e&&(this._filter=e,this._isInitialized&&this._values.length&&!this._flatOptions.length&&!!this._filter&&this._executeFilter().then(()=>{this._updateSelectedOptions(this._values),this._adapter.setSelectedText(this._getSelectedText())}))}get selectedTextBuilder(){return this._selectedTextBuilder}set selectedTextBuilder(e){this._selectedTextBuilder=e,this._selectedOptions.length&&this._adapter.setSelectedText(this._getSelectedText())}get observeScroll(){return this._observeScroll}set observeScroll(e){this._observeScroll=e}get observeScrollThreshold(){return this._observeScrollThreshold}set observeScrollThreshold(e){this._observeScrollThreshold=e}appendOptions(e){!this._isDropdownOpen||(this._options=[...this._options,...e],this._adapter.appendOptions(e))}get isInitialized(){return this._isInitialized}get open(){return this._isDropdownOpen}set open(e){this._isDropdownOpen!==e&&(e?this._showDropdown({userTriggered:!1}):this._closeDropdown())}get beforeValueChange(){return this._beforeValueChange}set beforeValueChange(e){e!==this._beforeValueChange&&(this._beforeValueChange=e)}get popupElement(){return this._adapter.getPopupElement()}};var Oe="<template><slot></slot></template>",Ie=":host{display:block}:host([hidden]){display:none}",r=class extends ie{constructor(){super();X.define([V,z,q]),H(this,Oe,Ie),this._foundation=new E(new I(this))}static get observedAttributes(){return[o.attributes.MODE,o.attributes.MULTIPLE,o.attributes.DEBOUNCE,o.attributes.FILTER_ON_FOCUS,o.attributes.FILTER_FOCUS_FIRST,o.attributes.ALLOW_UNMATCHED,o.attributes.POPUP_TARGET,o.attributes.POPUP_CLASSES,o.attributes.OBSERVE_SCROLL,o.attributes.OBSERVE_SCROLL_THRESHOLD,o.attributes.OPTION_LIMIT,o.attributes.SYNC_POPUP_WIDTH,o.attributes.OPEN,o.attributes.MATCH_KEY,o.attributes.FILTER_TEXT]}connectedCallback(){this.querySelector(o.selectors.INPUT)?this._foundation.initialize():M(this,o.selectors.INPUT).then(()=>this._foundation.initialize())}disconnectedCallback(){this._foundation.disconnect()}attributeChangedCallback(e,t,i){switch(super.attributeChangedCallback(e,t,i),e){case o.attributes.MODE:this.mode=i;break;case o.attributes.MULTIPLE:this.multiple=g(i);break;case o.attributes.DEBOUNCE:this.debounce=P(i);break;case o.attributes.FILTER_ON_FOCUS:this.filterOnFocus=g(i);break;case o.attributes.FILTER_FOCUS_FIRST:this.filterFocusFirst=g(i);break;case o.attributes.ALLOW_UNMATCHED:this.allowUnmatched=g(i);break;case o.attributes.POPUP_TARGET:this.popupTarget=i;break;case o.attributes.OPEN:this.open=g(i);break;case o.attributes.MATCH_KEY:this.matchKey=i;break;case o.attributes.FILTER_TEXT:this.filterText=i;break}}appendOptions(e){this._foundation.appendOptions(e)}openDropdown(){this.open=!0}closeDropdown(){this.open=!1}};p([a()],r.prototype,"mode",2),p([a()],r.prototype,"multiple",2),p([a()],r.prototype,"value",2),p([a()],r.prototype,"debounce",2),p([a()],r.prototype,"filterOnFocus",2),p([a()],r.prototype,"filterFocusFirst",2),p([a()],r.prototype,"allowUnmatched",2),p([a()],r.prototype,"popupTarget",2),p([a()],r.prototype,"filterText",2),p([a()],r.prototype,"optionBuilder",2),p([a()],r.prototype,"filter",2),p([a()],r.prototype,"selectedTextBuilder",2),p([a()],r.prototype,"open",2),p([a()],r.prototype,"matchKey",2),p([a({set:!1})],r.prototype,"isInitialized",2),p([a({set:!1})],r.prototype,"popupElement",2),p([a()],r.prototype,"beforeValueChange",2),r=p([R({name:o.elementName,dependencies:[le,oe,te,ee,Q,ne,Z,J]})],r);var _e=class extends ${constructor(e){super(e)}_build(){let e=document.createElement(o.elementName);return this._attachTextField(e),e}get textFieldDelegate(){return this._textFieldDelegate}get value(){return this._element.value}set value(e){this._element.value=e}get disabled(){return this._textFieldDelegate.inputElement.disabled}set disabled(e){this._textFieldDelegate.inputElement.disabled=e}get invalid(){return this._textFieldDelegate.invalid||!1}set invalid(e){this._textFieldDelegate.invalid=e}onChange(e){this._element.addEventListener(o.events.CHANGE,t=>e(t.detail))}onFocus(e){this._textFieldDelegate.inputElement.addEventListener("focus",t=>e(t))}onBlur(e){this._textFieldDelegate.inputElement.addEventListener("blur",t=>e(t))}_attachTextField(e){var i,n,l,c,_,s;let t={props:T({},(n=(i=this._config.options)==null?void 0:i.textFieldDelegateConfig)==null?void 0:n.props),options:T({},(c=(l=this._config.options)==null?void 0:l.textFieldDelegateConfig)==null?void 0:c.options)};t.options||(t.options={}),((_=this._config.options)==null?void 0:_.useDropdownIcon)!==!1&&!((s=t.options)!=null&&s.trailingElement)&&(t.options.trailingElement=this._createDropdownIconElement()),this._textFieldDelegate=new pe(t),e.appendChild(this._textFieldDelegate.element)}_createDropdownIconElement(){let e={props:{slot:"trailing",name:"arrow_drop_down"},options:{attributes:{"forge-dropdown-icon":""}}};return new j(e).element}};function Rt(){U(r)}export{o as a,de as b,I as c,ce as d,b as e,he as f,v as g,E as h,r as i,_e as j,Rt as k};
7
- //# sourceMappingURL=chunk.VPH7GX4C.js.map