@tylertech/forge 2.13.0-next.0 → 2.13.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (128) hide show
  1. package/README.md +1 -1
  2. package/custom-elements.json +117 -108
  3. package/dist/esm/app-bar/help-button/index.js +1 -1
  4. package/dist/esm/app-bar/index.js +1 -1
  5. package/dist/esm/autocomplete/index.js +1 -1
  6. package/dist/esm/bottom-sheet/index.js +1 -1
  7. package/dist/esm/chip-field/index.js +1 -1
  8. package/dist/esm/chunks/{chunk.32SMESZX.js → chunk.4RNKUXN3.js} +2 -2
  9. package/dist/esm/chunks/{chunk.32SMESZX.js.map → chunk.4RNKUXN3.js.map} +0 -0
  10. package/dist/esm/chunks/{chunk.Z5P6EA5L.js → chunk.6QMDYUVT.js} +2 -2
  11. package/dist/esm/chunks/{chunk.Z5P6EA5L.js.map → chunk.6QMDYUVT.js.map} +0 -0
  12. package/dist/esm/chunks/{chunk.WUIIZZQD.js → chunk.6VYFW76H.js} +2 -2
  13. package/dist/esm/chunks/{chunk.WUIIZZQD.js.map → chunk.6VYFW76H.js.map} +0 -0
  14. package/dist/esm/chunks/{chunk.D3DLVPPE.js → chunk.73G2CH2D.js} +2 -2
  15. package/dist/esm/chunks/{chunk.D3DLVPPE.js.map → chunk.73G2CH2D.js.map} +0 -0
  16. package/dist/esm/chunks/chunk.75LTLEZ7.js +7 -0
  17. package/dist/esm/chunks/chunk.75LTLEZ7.js.map +7 -0
  18. package/dist/esm/chunks/{chunk.G5Q2CUUE.js → chunk.AVIF5W7A.js} +2 -2
  19. package/dist/esm/chunks/{chunk.G5Q2CUUE.js.map → chunk.AVIF5W7A.js.map} +0 -0
  20. package/dist/esm/chunks/{chunk.KGW63HJX.js → chunk.CNL6EUCO.js} +2 -2
  21. package/dist/esm/chunks/{chunk.KGW63HJX.js.map → chunk.CNL6EUCO.js.map} +0 -0
  22. package/dist/esm/chunks/{chunk.K32ME33N.js → chunk.D3LMXSX6.js} +2 -2
  23. package/dist/esm/chunks/{chunk.K32ME33N.js.map → chunk.D3LMXSX6.js.map} +0 -0
  24. package/dist/esm/chunks/{chunk.E4ZTNVXI.js → chunk.DPCNIOLL.js} +2 -2
  25. package/dist/esm/chunks/{chunk.E4ZTNVXI.js.map → chunk.DPCNIOLL.js.map} +0 -0
  26. package/dist/esm/chunks/chunk.EJ4ASQET.js +7 -0
  27. package/dist/esm/chunks/chunk.EJ4ASQET.js.map +7 -0
  28. package/dist/esm/chunks/{chunk.F3W3XMGT.js → chunk.ELS7SQAV.js} +2 -2
  29. package/dist/esm/chunks/{chunk.F3W3XMGT.js.map → chunk.ELS7SQAV.js.map} +0 -0
  30. package/dist/esm/chunks/{chunk.DML4YNQF.js → chunk.HSJQA42U.js} +2 -2
  31. package/dist/esm/chunks/{chunk.DML4YNQF.js.map → chunk.HSJQA42U.js.map} +2 -2
  32. package/dist/esm/chunks/{chunk.DGOV5RDW.js → chunk.HUWXZ4ZN.js} +2 -2
  33. package/dist/esm/chunks/{chunk.DGOV5RDW.js.map → chunk.HUWXZ4ZN.js.map} +2 -2
  34. package/dist/esm/chunks/chunk.KLK2FBDP.js +7 -0
  35. package/dist/esm/chunks/chunk.KLK2FBDP.js.map +7 -0
  36. package/dist/esm/chunks/{chunk.NTFA7FCB.js → chunk.LV7GGIUI.js} +2 -2
  37. package/dist/esm/chunks/{chunk.NTFA7FCB.js.map → chunk.LV7GGIUI.js.map} +0 -0
  38. package/dist/esm/chunks/{chunk.VH3PVW2V.js → chunk.NLZKJ53B.js} +2 -2
  39. package/dist/esm/chunks/{chunk.VH3PVW2V.js.map → chunk.NLZKJ53B.js.map} +0 -0
  40. package/dist/esm/chunks/chunk.NNGE722W.js +7 -0
  41. package/dist/esm/chunks/chunk.NNGE722W.js.map +7 -0
  42. package/dist/esm/chunks/{chunk.2ZSAAJDN.js → chunk.O4Y6QT46.js} +2 -2
  43. package/dist/esm/chunks/{chunk.2ZSAAJDN.js.map → chunk.O4Y6QT46.js.map} +0 -0
  44. package/dist/esm/chunks/chunk.QOZLQPKE.js +7 -0
  45. package/dist/esm/chunks/chunk.QOZLQPKE.js.map +7 -0
  46. package/dist/esm/chunks/{chunk.SZL74RTY.js → chunk.VWSC3NDJ.js} +2 -2
  47. package/dist/esm/chunks/{chunk.SZL74RTY.js.map → chunk.VWSC3NDJ.js.map} +0 -0
  48. package/dist/esm/chunks/chunk.WQE6OCJR.js +7 -0
  49. package/dist/esm/chunks/chunk.WQE6OCJR.js.map +7 -0
  50. package/dist/esm/chunks/{chunk.V7P3QPNM.js → chunk.Y7Q6QI5V.js} +2 -2
  51. package/dist/esm/chunks/{chunk.V7P3QPNM.js.map → chunk.Y7Q6QI5V.js.map} +2 -2
  52. package/dist/esm/chunks/chunk.YPUWII7L.js +7 -0
  53. package/dist/esm/chunks/{chunk.5PQTSZ7G.js.map → chunk.YPUWII7L.js.map} +2 -2
  54. package/dist/esm/chunks/chunk.ZMH4OL2E.js +7 -0
  55. package/dist/esm/chunks/{chunk.CYJBOJMX.js.map → chunk.ZMH4OL2E.js.map} +2 -2
  56. package/dist/esm/date-picker/index.js +1 -1
  57. package/dist/esm/date-range-picker/index.js +1 -1
  58. package/dist/esm/dialog/index.js +1 -1
  59. package/dist/esm/file-picker/index.js +1 -1
  60. package/dist/esm/index.js +1 -1
  61. package/dist/esm/list/index.js +1 -1
  62. package/dist/esm/list/list/index.js +1 -1
  63. package/dist/esm/list/list-item/index.js +1 -1
  64. package/dist/esm/list-dropdown/index.js +1 -1
  65. package/dist/esm/menu/index.js +1 -1
  66. package/dist/esm/paginator/index.js +1 -1
  67. package/dist/esm/select/core/index.js +1 -1
  68. package/dist/esm/select/index.js +1 -1
  69. package/dist/esm/select/option/index.js +1 -1
  70. package/dist/esm/select/select/index.js +1 -1
  71. package/dist/esm/select/select-dropdown/index.js +1 -1
  72. package/dist/esm/split-view/index.js +1 -1
  73. package/dist/esm/split-view/split-view/index.js +1 -1
  74. package/dist/esm/split-view/split-view-panel/index.js +1 -1
  75. package/dist/esm/switch/index.js +1 -1
  76. package/dist/esm/text-field/index.js +1 -1
  77. package/dist/esm/time-picker/index.js +1 -1
  78. package/esm/chip-field/chip-field.js +1 -1
  79. package/esm/date-range-picker/date-range-picker-foundation.d.ts +1 -0
  80. package/esm/date-range-picker/date-range-picker-foundation.js +13 -1
  81. package/esm/dialog/dialog-adapter.d.ts +5 -5
  82. package/esm/dialog/dialog-adapter.js +31 -30
  83. package/esm/dialog/dialog-foundation.d.ts +2 -4
  84. package/esm/dialog/dialog-foundation.js +38 -55
  85. package/esm/dialog/dialog.d.ts +0 -4
  86. package/esm/dialog/dialog.js +1 -7
  87. package/esm/file-picker/file-picker.js +1 -1
  88. package/esm/list/list-item/list-item-adapter.d.ts +10 -2
  89. package/esm/list/list-item/list-item-adapter.js +14 -4
  90. package/esm/list/list-item/list-item-foundation.js +17 -4
  91. package/esm/list/list-item/list-item.d.ts +1 -1
  92. package/esm/list/list-item/list-item.js +1 -1
  93. package/esm/select/core/base-select-adapter.js +11 -1
  94. package/esm/select/core/base-select-foundation.js +7 -3
  95. package/esm/select/option/option-constants.d.ts +3 -0
  96. package/esm/select/option/option-constants.js +5 -1
  97. package/esm/select/option/option-foundation.d.ts +2 -2
  98. package/esm/select/option/option-foundation.js +1 -0
  99. package/esm/select/select/select.js +1 -1
  100. package/esm/split-view/split-view/split-view-constants.d.ts +0 -1
  101. package/esm/split-view/split-view-panel/split-view-panel-adapter.d.ts +4 -1
  102. package/esm/split-view/split-view-panel/split-view-panel-adapter.js +17 -6
  103. package/esm/split-view/split-view-panel/split-view-panel-constants.d.ts +1 -0
  104. package/esm/split-view/split-view-panel/split-view-panel-constants.js +2 -1
  105. package/esm/split-view/split-view-panel/split-view-panel-foundation.js +1 -4
  106. package/esm/split-view/split-view-panel/split-view-panel-utils.d.ts +6 -0
  107. package/esm/split-view/split-view-panel/split-view-panel-utils.js +17 -0
  108. package/esm/split-view/split-view-panel/split-view-panel.js +1 -1
  109. package/esm/switch/switch.d.ts +1 -0
  110. package/esm/switch/switch.js +13 -9
  111. package/esm/text-field/text-field.js +1 -1
  112. package/package.json +1 -1
  113. package/styles/field/_base.scss +4 -2
  114. package/styles/field/_variables.scss +0 -3
  115. package/dist/esm/chunks/chunk.5D6UB4DL.js +0 -7
  116. package/dist/esm/chunks/chunk.5D6UB4DL.js.map +0 -7
  117. package/dist/esm/chunks/chunk.5PQTSZ7G.js +0 -7
  118. package/dist/esm/chunks/chunk.7JTKKFL4.js +0 -7
  119. package/dist/esm/chunks/chunk.7JTKKFL4.js.map +0 -7
  120. package/dist/esm/chunks/chunk.CYJBOJMX.js +0 -7
  121. package/dist/esm/chunks/chunk.IGMTMR3D.js +0 -7
  122. package/dist/esm/chunks/chunk.IGMTMR3D.js.map +0 -7
  123. package/dist/esm/chunks/chunk.TCCPCDJK.js +0 -7
  124. package/dist/esm/chunks/chunk.TCCPCDJK.js.map +0 -7
  125. package/dist/esm/chunks/chunk.VQKRN5IQ.js +0 -7
  126. package/dist/esm/chunks/chunk.VQKRN5IQ.js.map +0 -7
  127. package/dist/esm/chunks/chunk.YK2PXI6D.js +0 -7
  128. package/dist/esm/chunks/chunk.YK2PXI6D.js.map +0 -7
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/select/core/base-select-constants.ts", "../../src/select/core/select-utils.ts", "../../src/select/core/base-select-foundation.ts", "../../src/select/core/base-select.ts", "../../src/select/core/base-select-adapter.ts"],
4
+ "sourcesContent": ["import { IListDropdownOption, IListDropdownOptionGroup } from '../../list-dropdown/list-dropdown-constants';\n\nexport type SelectOptionBuilder = (option: ISelectOption, parentElement: HTMLElement) => HTMLElement;\nexport type SelectSelectedTextBuilder = (selectedOptions: IListDropdownOption[]) => string;\nexport type SelectOptionListenerDestructor = () => void;\nexport type SelectBeforeValueChangeCallback<T> = (value: T | T[]) => boolean | Promise<boolean>;\n\nexport interface ISelectOption extends IListDropdownOption {}\nexport interface ISelectOptionGroup extends IListDropdownOptionGroup {}\n\nconst observedAttributes = {\n VALUE: 'value',\n MULTIPLE: 'multiple',\n OBSERVE_SCROLL: 'observe-scroll',\n OBSERVE_SCROLL_THRESHOLD: 'observe-scroll-threshold',\n POPUP_CLASSES: 'popup-classes',\n OPTION_LIMIT: 'option-limit',\n SYNC_POPUP_WIDTH: 'sync-popup-width'\n};\n\nconst attributes = {\n ...observedAttributes\n};\n\nconst events = {\n CHANGE: 'change'\n};\n\nexport const BASE_SELECT_CONSTANTS = {\n attributes,\n events\n};\n", "import { isDefined, isObject } from '@tylertech/forge-core';\nimport { ISelectOption, ISelectOptionGroup } from './base-select-constants';\n\nexport enum SelectOptionType { Option, Group }\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 isSelectOptionType(options: ISelectOption[] | ISelectOptionGroup[], type: SelectOptionType): boolean {\n const isOptionGroups = options.some((o: ISelectOption | ISelectOptionGroup) => isOptionGroupObject(o));\n const isOptionTypes = options.some((o: ISelectOption | ISelectOptionGroup) => isOptionObject(o));\n return (isOptionGroups && type === SelectOptionType.Group) || (isOptionTypes && type === SelectOptionType.Option);\n}\n\nexport function isOptionGroupObject(o: ISelectOption | ISelectOptionGroup): o is ISelectOptionGroup {\n return isDefined(o) && isObject(o) && o.hasOwnProperty('options') && o.hasOwnProperty('text');\n}\n\nexport function isOptionObject(o: ISelectOption | ISelectOptionGroup): o is ISelectOption {\n return isDefined(o) && isObject(o) && o.hasOwnProperty('label') && o.hasOwnProperty('value');\n}\n", "import { isDefined, isDeepEqual, randomChars } from '@tylertech/forge-core';\nimport { OptionListenerDestructor } from '../select/select-adapter';\nimport { ISelectOption, ISelectOptionGroup, SelectSelectedTextBuilder, SelectOptionBuilder, BASE_SELECT_CONSTANTS, SelectBeforeValueChangeCallback } from './base-select-constants';\nimport { isSelectOptionType, SelectOptionType } from './select-utils';\nimport { IListDropdownConfig, ListDropdownHeaderBuilder, ListDropdownFooterBuilder } from '../../list-dropdown/list-dropdown-constants';\nimport { IBaseSelectAdapter } from './base-select-adapter';\nimport { IListDropdownAwareFoundation, ListDropdownAwareFoundation } from '../../list-dropdown/list-dropdown-aware-foundation';\n\nexport interface IBaseSelectFoundation extends IListDropdownAwareFoundation {\n value: any;\n selectedIndex: number | number[];\n options: ISelectOption[] | ISelectOptionGroup[];\n multiple: boolean;\n open: boolean;\n popupElement: HTMLElement | undefined;\n optionBuilder: SelectOptionBuilder;\n selectedTextBuilder: SelectSelectedTextBuilder;\n observeScroll: boolean;\n observeScrollThreshold: number;\n syncPopupWidth: boolean;\n beforeValueChange: SelectBeforeValueChangeCallback<any>;\n appendOptions(options: ISelectOption[] | ISelectOptionGroup[]): void;\n selectAll(): void;\n deselectAll(): void;\n initialize(): void;\n initializeTarget(): void;\n disconnect(): void;\n}\n\nexport abstract class BaseSelectFoundation<T extends IBaseSelectAdapter> extends ListDropdownAwareFoundation implements IBaseSelectFoundation {\n protected _options: ISelectOption[] | ISelectOptionGroup[] = [];\n protected _value: any = [];\n protected _multiple = false;\n protected _open = false;\n protected _optionBuilder: SelectOptionBuilder;\n protected _selectedTextBuilder: SelectSelectedTextBuilder;\n protected _selectedValues: string[] = [];\n protected _selectedLabels: string[] = [];\n protected _selectedIndexes: number[] = [];\n protected _filterTimeout: number | undefined;\n protected _filterString = '';\n protected _identifier: string;\n protected _targetWidthCallback: () => number;\n protected _beforeValueChange: SelectBeforeValueChangeCallback<unknown>;\n private _focusListener: (evt: Event) => void;\n private _blurListener: (evt: FocusEvent) => void;\n private _clickListener: (evt: MouseEvent) => void;\n private _keydownListener: (evt: KeyboardEvent) => void;\n private _optionsChangedListener: (options: ISelectOption[] | ISelectOptionGroup[]) => void;\n private _optionListenerDestructor: OptionListenerDestructor;\n private _activeChangeListener: (id: string) => void;\n private _dropdownScrollEndListener: () => void;\n private _valueChanging: Promise<boolean> | undefined;\n private _dismissListener: () => void;\n\n constructor(protected _adapter: T) {\n super();\n this._focusListener = evt => this._onFocus(evt);\n this._blurListener = evt => this._onBlur(evt);\n this._clickListener = evt => this._onClick(evt);\n this._keydownListener = evt => this._onKeydown(evt);\n this._optionsChangedListener = options => this._onOptionsChanged(options);\n this._activeChangeListener = id => this._onActiveOptionChanged(id);\n this._dropdownScrollEndListener = () => this._onDropdownScrollEnd();\n this._dismissListener = () => this._onDismiss();\n this._identifier = randomChars();\n }\n\n protected abstract _onDropdownScrollEnd(): void;\n protected _onFocus(evt: Event): void {}\n\n public initialize(): void {\n if (this._optionListenerDestructor) {\n this._optionListenerDestructor();\n }\n this._optionListenerDestructor = this._adapter.setOptionsListener(this._optionsChangedListener);\n this._initializeValue();\n }\n\n public initializeTarget(): void {\n this._adapter.initializeAccessibility();\n this._adapter.setMultiple(this._multiple);\n this._adapter.addClickListener(this._clickListener);\n this._adapter.addTargetListener('blur', this._blurListener);\n this._adapter.addTargetListener('focus', this._focusListener);\n this._adapter.addTargetListener('keydown', this._keydownListener);\n }\n\n public disconnect(): void {\n this._adapter.removeClickListener(this._clickListener);\n this._adapter.removeTargetListener('blur', this._blurListener);\n this._adapter.removeTargetListener('focus', this._focusListener);\n this._adapter.removeTargetListener('keydown', this._keydownListener);\n\n if (this._open) {\n this._closeDropdown();\n }\n\n if (this._optionListenerDestructor) {\n this._optionListenerDestructor();\n }\n }\n\n public appendOptions(options: ISelectOption[] | ISelectOptionGroup[]): void {\n this._adapter.setOptions(options, false);\n if (this._open) {\n this._adapter.appendDropdownOptions(options);\n }\n }\n\n public selectAll(): void {\n if (this._multiple) {\n this.value = this._flatOptions.map(o => o.value);\n }\n }\n\n public deselectAll(): void {\n if (this._multiple) {\n this.value = [];\n }\n }\n\n protected get _flatOptions(): ISelectOption[] {\n if (isSelectOptionType(this._options, SelectOptionType.Group)) {\n return [].concat.apply([], (this._options as ISelectOptionGroup[]).map(g => g.options)) as ISelectOption[];\n }\n return this._options as ISelectOption[];\n }\n\n private get _nonDividerOptions(): ISelectOption[] {\n return this._flatOptions.filter(o => !o.divider);\n }\n\n protected _initializeValue(): void {\n const options = (this._options.length && this._options) || this._adapter.getOptions();\n if (isDefined(this._value) && options.length) {\n this._applyValue(this._value);\n }\n }\n\n protected _onClick(evt: MouseEvent): void {\n if (evt.button !== 0) {\n return;\n }\n if (!this._open) {\n this._openDropdown();\n } else {\n this._closeDropdown();\n }\n }\n\n protected _onBlur(evt: FocusEvent): void {\n // If the blur event was triggered by an element within the popup then ignore it\n if (this._adapter.isFocusWithinPopup(evt.relatedTarget as HTMLElement)) {\n return;\n }\n\n if (this._open) {\n this._closeDropdown();\n }\n }\n\n\n protected _openDropdown(): void {\n this._options = this._adapter.getOptions();\n\n if (!this._flatOptions.length) {\n return;\n }\n\n this._open = true;\n const config: IListDropdownConfig = {\n options: this._options,\n multiple: this._multiple,\n selectedValues: [...this._selectedValues],\n id: this._identifier,\n optionBuilder: this._optionBuilder,\n syncWidth: this._syncPopupWidth,\n observeScroll: this._observeScroll,\n observeScrollThreshold: this._observeScrollThreshold,\n scrollEndListener: this._dropdownScrollEndListener,\n activeChangeCallback: this._activeChangeListener,\n targetWidthCallback: this._targetWidthCallback,\n popupClasses: this._popupClasses,\n optionLimit: this._optionLimit,\n headerBuilder: this._popupHeaderBuilder,\n footerBuilder: this._popupFooterBuilder,\n closeCallback: () => this._closeDropdown(),\n selectCallback: (value: any) => {\n const flatOptions = this._flatOptions;\n const option = flatOptions.find(o => o.value === value);\n if (option) {\n const index = flatOptions.indexOf(option);\n this._onSelect(option, index, true);\n }\n }\n };\n this._adapter.open(config);\n this._adapter.setDismissListener(this._dismissListener);\n }\n\n /**\n * Closes the dropdown.\n */\n protected _closeDropdown(): void {\n this._open = false;\n this._adapter.close();\n }\n\n /**\n * Handles selecting an item in the dropdown.\n * @param {ISelectOption} option The selected option.\n * @param {number} optionIndex The index of the selected option.\n */\n protected async _onSelect(option: ISelectOption, optionIndex: number, closeDropdown = true): Promise<boolean> {\n return new Promise(async resolve => {\n if (this._valueChanging) {\n return Promise.resolve(false);\n }\n\n const value = option ? option.value : '';\n const label = option ? option.label : '';\n\n // Store the current selections in case we need to rollback (if the event was cancelled)\n const prevValues = [...this._value];\n const prevSelectedValues = [...this._selectedValues];\n const prevSelectedLabels = [...this._selectedLabels];\n const prevSelectedIndexes = [...this._selectedIndexes];\n\n if (this._multiple) {\n if (this._selectedValues.includes(value)) {\n const index = this._selectedValues.indexOf(value);\n this._selectedValues.splice(index, 1);\n this._selectedLabels.splice(index, 1);\n this._selectedIndexes.splice(index, 1);\n } else {\n this._selectedValues.push(value);\n this._selectedLabels.push(label);\n this._selectedIndexes.push(optionIndex);\n }\n } else {\n if (isDefined(value)) {\n this._selectedValues[0] = value;\n this._selectedLabels[0] = label;\n this._selectedIndexes[0] = optionIndex;\n } else {\n this._selectedValues = [];\n this._selectedLabels = [];\n this._selectedIndexes = [];\n }\n }\n\n this._value = [...this._selectedValues];\n\n const rollbackValue = (): void => {\n this._selectedValues = [...prevSelectedValues];\n this._selectedLabels = [...prevSelectedLabels];\n this._selectedIndexes = [...prevSelectedIndexes];\n this._value = [...prevValues];\n };\n\n const applyValue = (): void => {\n // If we're in multiselect mode, we need to toggle the selected option\n if (this._multiple) {\n const isSelected = this._selectedIndexes.includes(optionIndex);\n this._adapter.toggleOptionMultiple(optionIndex, isSelected);\n }\n\n this._applySelection();\n };\n\n const data = this.multiple ? [...this._selectedValues] : this._selectedValues[0];\n\n // We close the dropdown immediately if in single selection mode\n if (this._open && closeDropdown && !this._multiple) {\n this._closeDropdown();\n }\n\n // First we check to see if there is an before change callback and execute that\n if (typeof this._beforeValueChange === 'function') {\n this._valueChanging = Promise.resolve(this._beforeValueChange.call(null, data));\n const shouldContinue = await this._valueChanging;\n this._valueChanging = undefined;\n if (!shouldContinue) {\n rollbackValue();\n this._tryUpdateDropdownPosition();\n return resolve(false);\n }\n }\n\n // Now we can emit the change event AFTER the before change callback has been executed and returned true\n const cancelled = !this._adapter.emitHostEvent(BASE_SELECT_CONSTANTS.events.CHANGE, data, true, true);\n if (!cancelled) {\n applyValue();\n } else {\n rollbackValue();\n }\n\n this._tryUpdateDropdownPosition();\n resolve(!cancelled);\n });\n }\n\n private _selectActiveOption(): void {\n const activeOptionIndex = this._adapter.getActiveOptionIndex();\n if (activeOptionIndex >= 0 && this._nonDividerOptions[activeOptionIndex]) {\n this._onSelect(this._nonDividerOptions[activeOptionIndex], activeOptionIndex);\n }\n }\n\n protected _tryUpdateDropdownPosition(): void {\n if (this._open) {\n this._adapter.queueDropdownPositionUpdate();\n }\n }\n\n protected _reset(): void {\n this._selectedValues = [];\n this._selectedLabels = [];\n this._selectedIndexes = [];\n }\n\n protected _applyValue(value: string | string[]): void {\n this._selectedValues = [];\n this._selectedLabels = [];\n\n this._options = this._adapter.getOptions();\n\n if (!Array.isArray(value)) {\n value = [value];\n }\n\n this._value = [];\n\n // Ensure that the values passed are actually existing options\n for (const val of value) {\n if (!this._value.includes(val)) {\n this._value.push(val);\n }\n const option = this._flatOptions.find(o => isDeepEqual(o.value, val));\n if (option) {\n this._selectedValues.push(option.value);\n this._selectedLabels.push(option.label);\n }\n }\n\n // Update the selected indexes based on the values that are now selected\n this._selectedIndexes = this._selectedValues.map(val => this._flatOptions.findIndex(o => o.value === val));\n\n // Update the selected options in the dropdown\n this._adapter.patchSelectedValues(this._selectedValues);\n }\n \n /**\n * Handles the user dismissing the dropdown.\n */\n protected _onDismiss(): void {\n this._closeDropdown();\n }\n\n /** Creates the selected text value from the selected label values. */\n protected _getSelectedText(): string {\n if (typeof this._selectedTextBuilder === 'function') {\n const selectedOptions = this._flatOptions.filter(o => this._selectedValues.includes(o.value));\n return this._selectedTextBuilder(selectedOptions);\n }\n\n if (this._multiple) {\n if (this._selectedLabels.length) {\n return `${this._selectedLabels.length} ${this._selectedLabels.length === 1 ? 'option' : 'options'} selected`;\n } else {\n return '';\n }\n }\n \n return this._selectedLabels\n .filter(v => v && v.length)\n .join(' ')\n .trim();\n }\n\n private _onKeydown(evt: KeyboardEvent): void {\n const isEscapeKey = evt.key === 'Escape' || evt.keyCode === 27;\n const isEnter = evt.key === 'Enter' || evt.keyCode === 13;\n const isSpace = evt.key === 'Space' || evt.keyCode === 32;\n const isArrowDown = evt.key === 'ArrowDown' || evt.keyCode === 40;\n const isArrowUp = evt.key === 'ArrowUp' || evt.keyCode === 38;\n const isFilterableCharacter = evt.keyCode >= 48 && evt.keyCode <= 90;\n const isHomeKey = evt.key === 'Home' || evt.keyCode === 36;\n const isEndKey = evt.key === 'End' || evt.keyCode === 35;\n const isTabKey = evt.key === 'Tab';\n\n // We automatically select the active option if the dropdown is open and in single selection mode\n if (isTabKey && this._open && !this._multiple) {\n this._selectActiveOption();\n return;\n }\n\n // If an active filter was started, clear it now\n if (!isFilterableCharacter && this._filterTimeout) {\n window.clearTimeout(this._filterTimeout);\n this._filterString = '';\n this._filterTimeout = undefined;\n }\n\n if (isEscapeKey) {\n evt.preventDefault();\n if (this._open) {\n this._closeDropdown();\n return;\n }\n }\n\n if (isSpace) {\n evt.preventDefault();\n\n if (!this._open) {\n this._openDropdown();\n } else {\n this._closeDropdown();\n }\n } else if (isEnter) {\n if (this._open) {\n evt.stopPropagation();\n evt.preventDefault();\n this._options = this._adapter.getOptions();\n this._selectActiveOption();\n }\n } else if (isArrowUp || isArrowDown) {\n evt.preventDefault();\n\n if (this._multiple && !this._open) {\n this._openDropdown();\n this._adapter.activateFirstOption();\n return;\n }\n\n if (this._flatOptions.length === 0) {\n return;\n }\n\n let optionIndex = 0;\n if (this._open) {\n optionIndex = this._adapter.getActiveOptionIndex();\n if (optionIndex === -1) {\n optionIndex = this._getFirstSelectedOptionIndex();\n }\n } else {\n optionIndex = this._getFirstSelectedOptionIndex();\n }\n\n if (isArrowUp) {\n optionIndex = this._getPreviousHighlightableOptionIndex(optionIndex, this._nonDividerOptions);\n } else {\n optionIndex = this._getNextHighlightableOptionIndex(optionIndex, this._nonDividerOptions);\n }\n\n // If the dropdown is open then we just move the active index, otherwise we change the selection (to mimic the native <select>)\n if (this._open) {\n this._adapter.highlightActiveOption(optionIndex);\n } else {\n this._onSelect(this._nonDividerOptions[optionIndex], optionIndex);\n }\n } else if (isHomeKey) {\n if (this._open) {\n evt.preventDefault();\n this._adapter.highlightActiveOption(this._nonDividerOptions.findIndex(o => !o.disabled));\n }\n } else if (isEndKey) {\n if (this._open) {\n evt.preventDefault();\n const options = this._nonDividerOptions;\n for (let i = options.length - 1; i >= 0; i--) {\n if (!options[i].disabled) {\n this._adapter.highlightActiveOption(i);\n break;\n }\n }\n }\n } else if (isFilterableCharacter) {\n this._filter(evt.key);\n }\n }\n\n private _getFirstSelectedOptionIndex(): number {\n return this._nonDividerOptions.findIndex(option => this._selectedValues.includes(option.value));\n }\n\n private _getPreviousHighlightableOptionIndex(startIndex: number, options: ISelectOption[]): number {\n let index = startIndex;\n if (index <= 0) {\n index = options.length - 1;\n } else {\n index--;\n }\n if (options[index].disabled) {\n return this._getPreviousHighlightableOptionIndex(index, options);\n }\n return index;\n }\n\n private _getNextHighlightableOptionIndex(startIndex: number, options: ISelectOption[]): number {\n let index = startIndex;\n if (index === options.length - 1) {\n index = 0;\n } else {\n index++;\n }\n if (options[index].disabled) {\n return this._getNextHighlightableOptionIndex(index, options);\n }\n return index;\n }\n\n private _filter(key: string): void {\n // This allows for typing numbers and/or characters while the select is focused to auto-select the closest match\n if (this._filterTimeout) {\n window.clearTimeout(this._filterTimeout);\n this._filterTimeout = undefined;\n }\n this._filterString += key;\n this._filterTimeout = window.setTimeout(() => {\n this._filterString = '';\n this._filterTimeout = undefined;\n }, 300);\n this._options = this._adapter.getOptions();\n // TODO(kieran.nichols): Enhance this to cycle through closest matches (see the native select)\n const matchedOption = this._flatOptions.find(option => !option.disabled && option.label.toLowerCase().startsWith(this._filterString));\n if (matchedOption) {\n const optionIndex = this._flatOptions.indexOf(matchedOption);\n if (this._open) {\n this._adapter.highlightActiveOption(optionIndex);\n } else if (!this._multiple) {\n this._onSelect(matchedOption, optionIndex, false);\n }\n }\n }\n\n private _onOptionsChanged(options: ISelectOption[] | ISelectOptionGroup[]): void {\n this._options = options;\n this._applyValue(this._value);\n }\n\n private _onActiveOptionChanged(id: string): void {\n this._adapter.updateActiveDescendant(id);\n }\n\n /** Gets/sets the value of the component. */\n public get value(): any {\n return this._multiple ? [...this._value] : this._value[0];\n }\n public set value(value: any) {\n let _value: string | string[];\n \n if (Array.isArray(value)) {\n _value = [ ...value ];\n } else {\n _value = value;\n }\n\n this._applyValue(_value);\n }\n\n /** Gets/sets the selected index(s). */\n public get selectedIndex(): number | number[] {\n return this._multiple ? [ ...this._selectedIndexes ] : this._selectedIndexes[0];\n }\n public set selectedIndex(indexes: number | number[]) {\n this._options = this._adapter.getOptions();\n\n let indicies: number [];\n if (Array.isArray(indexes)) {\n indicies = [ ...indexes ];\n } else {\n indicies = [indexes];\n }\n\n indicies.sort();\n\n if (this.multiple) {\n this.value = indicies\n .map(index => this._flatOptions[index])\n .filter(o => o)\n .map(o => o.value);\n } else {\n const option = this._flatOptions[indicies[indicies.length - 1]];\n if (!option) {\n return;\n }\n this.value = option.value;\n }\n }\n\n /** Gets/sets the available options. */\n public get options(): ISelectOption[] | ISelectOptionGroup[] {\n return this._adapter.getOptions();\n }\n public set options(value: ISelectOption[] | ISelectOptionGroup[]) {\n let _value: ISelectOption[] | ISelectOptionGroup[];\n if (isSelectOptionType(value, SelectOptionType.Group)) {\n _value = (value as ISelectOptionGroup[]).map(v => ({ ...v }));\n } else {\n _value = (value as ISelectOption[]).map(v => ({ ...v }));\n }\n\n this._options = _value;\n this._adapter.setOptions(_value); // Must set options before intializing value\n this._initializeValue();\n\n if (this._open) {\n this._adapter.setDropdownOptions(_value);\n }\n }\n\n /** Gets/sets the multiple select state. */\n public get multiple(): boolean {\n return this._multiple;\n }\n public set multiple(value: boolean) {\n if (this._multiple !== value) {\n this._multiple = value;\n this._reset();\n if (this._open) {\n this._closeDropdown();\n }\n this._adapter.setMultiple(this._multiple);\n }\n }\n\n /** Gets/sets the open state of the dropdown. */\n public get open(): boolean {\n return this._open;\n }\n public set open(value: boolean) {\n if (this._open !== value) {\n if (value) {\n this._openDropdown();\n } else {\n this._closeDropdown();\n }\n }\n }\n\n /** Gets/sets the builder callback to use when building options. */\n public get optionBuilder(): SelectOptionBuilder {\n return this._optionBuilder;\n }\n public set optionBuilder(value: SelectOptionBuilder) {\n this._optionBuilder = value;\n }\n\n /** Sets the selected text builder callback that will be executed when getting the selected text to display in the field. */\n public get selectedTextBuilder(): SelectSelectedTextBuilder {\n return this._selectedTextBuilder;\n }\n public set selectedTextBuilder(fn: SelectSelectedTextBuilder) {\n this._selectedTextBuilder = fn;\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 syncPopupWidth(): boolean {\n return this._syncPopupWidth;\n }\n public set syncPopupWidth(value: boolean) {\n this._syncPopupWidth = value;\n }\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 popupClasses(): string | string[] {\n return this._popupClasses;\n }\n public set popupClasses(value: string | string[]) {\n this._popupClasses = 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 /** Gets the currently active popup element when the dropdown is open. */\n public get popupElement(): HTMLElement | undefined {\n return this._adapter.popupElement;\n }\n\n /** Sets the callback to be executed when the user selects a value. */\n public get beforeValueChange(): SelectBeforeValueChangeCallback<any> {\n return this._beforeValueChange;\n }\n public set beforeValueChange(value: SelectBeforeValueChangeCallback<any>) {\n this._beforeValueChange = value;\n }\n}\n", "import { coerceBoolean, FoundationProperty } from '@tylertech/forge-core';\n\nimport {\n SelectOptionBuilder,\n SelectSelectedTextBuilder,\n ISelectOption,\n ISelectOptionGroup,\n SelectBeforeValueChangeCallback,\n BASE_SELECT_CONSTANTS\n} from './base-select-constants';\nimport { IBaseSelectFoundation } from './base-select-foundation';\nimport { IListDropdownAware, ListDropdownAware } from '../../list-dropdown/list-dropdown-aware';\nimport { IPopupComponent } from '../../popup';\n\n\nexport interface IBaseSelectComponent extends IListDropdownAware {\n value: any;\n selectedIndex: number | number[];\n options: ISelectOption[] | ISelectOptionGroup[];\n multiple: boolean;\n open: boolean;\n optionBuilder: SelectOptionBuilder;\n selectedTextBuilder: SelectSelectedTextBuilder;\n popupElement: IPopupComponent | undefined;\n beforeValueChange: SelectBeforeValueChangeCallback<any>;\n appendOptions(options: ISelectOption[] | ISelectOption[]): void;\n selectAll(): void;\n deselectAll(): void;\n}\n\nexport abstract class BaseSelectComponent<T extends IBaseSelectFoundation> extends ListDropdownAware implements IBaseSelectComponent {\n protected _foundation: T;\n\n constructor() {\n super();\n }\n\n /** Gets/sets the value. */\n @FoundationProperty()\n public value: any;\n \n /** Gets/sets the selected index. */\n @FoundationProperty()\n public selectedIndex: number | number[];\n \n /** Gets/sets the available options. */\n @FoundationProperty()\n public options: ISelectOption[] | ISelectOptionGroup[];\n\n /** Gets/sets the multiple select state. */\n @FoundationProperty()\n public multiple: boolean;\n \n /** Gets the open state of the dropdown. */\n @FoundationProperty()\n public open: boolean;\n \n /** Sets the option builder callback that will be executed when building the option list in the dropdown. */\n @FoundationProperty()\n public optionBuilder: SelectOptionBuilder;\n \n /** Sets the selected text builder callback that will be executed when getting the selected text to display in the field. */\n @FoundationProperty()\n public selectedTextBuilder: SelectSelectedTextBuilder;\n\n /** Sets the callback to be executed when the user selects a value. */\n @FoundationProperty()\n public beforeValueChange: SelectBeforeValueChangeCallback<any>;\n\n /** Gets the popup element (when the dropdown is open). */\n @FoundationProperty({ set: false })\n public popupElement: IPopupComponent | undefined;\n \n public attributeChangedCallback(name: string, oldValue: string, newValue: string): void {\n super.attributeChangedCallback(name, oldValue, newValue);\n switch (name) {\n case BASE_SELECT_CONSTANTS.attributes.MULTIPLE:\n this.multiple = coerceBoolean(newValue);\n break;\n case BASE_SELECT_CONSTANTS.attributes.VALUE:\n this.value = newValue;\n break;\n }\n }\n\n public appendOptions(options: ISelectOption[] | ISelectOptionGroup[]): void {\n this._foundation.appendOptions(options);\n }\n\n public selectAll(): void {\n this._foundation.selectAll();\n }\n \n public deselectAll(): void {\n this._foundation.deselectAll();\n }\n\n public connectedCallback(): void {\n this._foundation.initialize();\n }\n\n public disconnectedCallback(): void {\n this._foundation.disconnect();\n }\n}\n", "import { isDefined, removeElement } from '@tylertech/forge-core';\nimport { BaseAdapter, IBaseAdapter } from '../../core/base/base-adapter';\nimport { IBaseSelectComponent } from './base-select';\nimport { ListDropdown, IListDropdown } from '../../list-dropdown';\nimport { IListDropdownConfig, ListDropdownIconType } from '../../list-dropdown/list-dropdown-constants';\nimport { IOptionComponent, OPTION_CONSTANTS } from '../option';\nimport { IOptionGroupComponent, OPTION_GROUP_CONSTANTS } from '../option-group';\nimport { ISelectOption, ISelectOptionGroup, SelectOptionListenerDestructor } from './base-select-constants';\nimport { isOptionGroupObject } from './select-utils';\nimport { IPopupComponent, POPUP_CONSTANTS } from '../../popup';\nimport { assignMatchingProperties } from '../../core/utils/utils';\n\nexport interface IBaseSelectAdapter extends IBaseAdapter {\n initializeAccessibility(): void;\n addClickListener(listener: (evt: Event) => void): void;\n removeClickListener(listener: (evt: Event) => void): void;\n addTargetListener(type: string, listener: (evt: Event) => void): void;\n removeTargetListener(type: string, listener: (evt: Event) => void): void;\n getOptions(): ISelectOption[] | ISelectOptionGroup[];\n setOptions(options: ISelectOption[] | ISelectOptionGroup[], clear?: boolean): void;\n open(config: IListDropdownConfig): void;\n close(): void;\n setDismissListener(listener: () => void): void;\n scrollSelectedOptionIntoView(): void;\n activateSelectedOption(): void;\n activateFirstOption(): void;\n getActiveOptionIndex(): number;\n highlightActiveOption(index: number): void;\n toggleOptionMultiple(index: number, isSelected: boolean): void;\n patchSelectedValues(selectedValues: string[]): void;\n updateActiveDescendant(id: string): void;\n setOptionsListener(listener: (options: ISelectOption[] | ISelectOptionGroup[]) => void): SelectOptionListenerDestructor;\n setDropdownOptions(options: ISelectOption[] | ISelectOptionGroup[]): void;\n appendDropdownOptions(options: ISelectOption[] | ISelectOptionGroup[]): void;\n setMultiple(multiple: boolean): void;\n isFocusWithinPopup(target: HTMLElement): boolean;\n queueDropdownPositionUpdate(): void;\n popupElement: HTMLElement | undefined;\n}\n\nexport abstract class BaseSelectAdapter extends BaseAdapter<IBaseSelectComponent> implements IBaseSelectAdapter {\n private _listDropdown?: IListDropdown;\n protected _targetElement: HTMLElement;\n\n constructor(component: IBaseSelectComponent) {\n super(component);\n }\n\n public abstract initializeAccessibility(): void;\n public abstract updateActiveDescendant(id: string): void;\n public abstract addClickListener(listener: (evt: Event) => void): void;\n public abstract removeClickListener(listener: (evt: Event) => void): void;\n public abstract addTargetListener(type: string, listener: (evt: Event) => void): void;\n public abstract removeTargetListener(type: string, listener: (evt: Event) => void): void;\n public abstract setMultiple(multiple: boolean): void;\n\n public get popupElement(): HTMLElement | undefined {\n return this._listDropdown?.dropdownElement;\n }\n\n public getOptions(): ISelectOption[] | ISelectOptionGroup[] {\n const optionGroupElements = Array.from(this._component.querySelectorAll(OPTION_GROUP_CONSTANTS.elementName)) as IOptionGroupComponent[];\n if (optionGroupElements.length) {\n return optionGroupElements.map(optionGroupElement => {\n const optionElements = Array.from(optionGroupElement.querySelectorAll(OPTION_CONSTANTS.elementName)) as IOptionComponent[];\n const options = this._createOptionsFromElements(optionElements);\n return { text: optionGroupElement.label, options } as ISelectOptionGroup;\n });\n } else {\n const optionElements = Array.from(this._component.querySelectorAll(OPTION_CONSTANTS.elementName)) as IOptionComponent[];\n return this._createOptionsFromElements(optionElements);\n }\n }\n\n private _createOptionsFromElements(optionElements: IOptionComponent[]): ISelectOption[] {\n return optionElements.map(o => {\n let optionClass = o.hasAttribute(OPTION_CONSTANTS.attributes.OPTION_CLASS) ? o.getAttribute(OPTION_CONSTANTS.attributes.OPTION_CLASS) as string : o.optionClass;\n if (typeof optionClass === 'string') {\n optionClass = optionClass.split(' ');\n }\n\n return {\n // eslint-disable-next-line @typescript-eslint/no-extra-parens\n label: o.hasAttribute(OPTION_CONSTANTS.attributes.LABEL) ? o.getAttribute(OPTION_CONSTANTS.attributes.LABEL) as string : (isDefined(o.label) ? o.label : o.innerText),\n value: o.hasAttribute(OPTION_CONSTANTS.attributes.VALUE) ? o.getAttribute(OPTION_CONSTANTS.attributes.VALUE) : o.value,\n disabled: o.hasAttribute(OPTION_CONSTANTS.attributes.DISABLED),\n divider: o.hasAttribute(OPTION_CONSTANTS.attributes.DIVIDER),\n optionClass,\n leadingIcon: o.hasAttribute(OPTION_CONSTANTS.attributes.LEADING_ICON) ? o.getAttribute(OPTION_CONSTANTS.attributes.LEADING_ICON) as string : o.leadingIcon,\n leadingIconClass: o.hasAttribute(OPTION_CONSTANTS.attributes.LEADING_ICON_CLASS) ? o.getAttribute(OPTION_CONSTANTS.attributes.LEADING_ICON_CLASS) as string : o.leadingIconClass,\n leadingIconType: o.hasAttribute(OPTION_CONSTANTS.attributes.LEADING_ICON_TYPE) ? o.getAttribute(OPTION_CONSTANTS.attributes.LEADING_ICON_TYPE) as ListDropdownIconType : o.leadingIconType,\n trailingIcon: o.hasAttribute(OPTION_CONSTANTS.attributes.TRAILING_ICON) ? o.getAttribute(OPTION_CONSTANTS.attributes.TRAILING_ICON) as string : o.trailingIcon,\n trailingIconClass: o.hasAttribute(OPTION_CONSTANTS.attributes.TRAILING_ICON_CLASS) ? o.getAttribute(OPTION_CONSTANTS.attributes.TRAILING_ICON_CLASS) as string : o.trailingIconClass,\n trailingIconType: o.hasAttribute(OPTION_CONSTANTS.attributes.TRAILING_ICON_TYPE) ? o.getAttribute(OPTION_CONSTANTS.attributes.TRAILING_ICON_TYPE) as ListDropdownIconType : o.trailingIconType,\n leadingBuilder: o.leadingBuilder,\n trailingBuilder: o.trailingBuilder\n };\n });\n }\n\n public open(config: IListDropdownConfig): void {\n this._listDropdown = new ListDropdown(this._targetElement, config);\n this._listDropdown.open();\n }\n\n public close(): void {\n if (this._listDropdown) {\n this._listDropdown.close();\n this._listDropdown.destroy();\n this._listDropdown = undefined;\n }\n }\n\n public setDismissListener(listener: () => void): void {\n if (!this._listDropdown || !this._listDropdown.dropdownElement) {\n return;\n }\n const dropdownElement = this._listDropdown.dropdownElement as IPopupComponent;\n if (dropdownElement.targetElement) {\n dropdownElement.targetElement.addEventListener(POPUP_CONSTANTS.events.BLUR, listener);\n }\n }\n\n public toggleOptionMultiple(index: number, isSelected: boolean): void {\n this._listDropdown?.toggleOptionMultiple(index, isSelected);\n }\n\n public getActiveOptionIndex(): number {\n return this._listDropdown?.getActiveOptionIndex() ?? -1;\n }\n\n public activateSelectedOption(): void {\n this._listDropdown?.activateSelectedOption();\n }\n\n public activateFirstOption(): void {\n this._listDropdown?.activateFirstOption();\n }\n\n public highlightActiveOption(index: number): void {\n this._listDropdown?.activateOption(index);\n }\n\n public patchSelectedValues(selectedValues: string[]): void {\n this._listDropdown?.setSelectedValues(selectedValues);\n }\n\n public setOptionsListener(listener: (options: ISelectOption[] | ISelectOptionGroup[]) => void): SelectOptionListenerDestructor {\n // Watch for option value property changes\n const optionValueChangeListener: EventListener = evt => {\n evt.stopPropagation();\n listener(this.getOptions());\n };\n this._component.addEventListener(OPTION_CONSTANTS.events.VALUE_CHANGE, optionValueChangeListener);\n\n // Watch for DOM changes\n const observer = new MutationObserver(() => listener(this.getOptions()));\n observer.observe(this._component, { childList: true, subtree: true });\n\n return () => {\n this._component.removeEventListener(OPTION_CONSTANTS.events.VALUE_CHANGE, optionValueChangeListener);\n observer.disconnect();\n };\n }\n\n public setOptions(options: ISelectOption[] | ISelectOptionGroup[], clear = true): void {\n if (clear) {\n this._clearOptions();\n }\n\n for (const opt of options) {\n if (isOptionGroupObject(opt)) {\n const optionGroupElement = this._createOptionGroupElement(opt);\n for (const option of opt.options) {\n const optionElement = this._createOptionElement(option);\n optionGroupElement.appendChild(optionElement);\n }\n this._component.appendChild(optionGroupElement);\n } else {\n const optionElement = this._createOptionElement(opt);\n this._component.appendChild(optionElement);\n }\n }\n }\n\n public appendDropdownOptions(options: ISelectOption[] | ISelectOptionGroup[]): void {\n this._listDropdown?.appendOptions(options);\n }\n\n public setDropdownOptions(options: ISelectOption[] | ISelectOptionGroup[]): void {\n this._listDropdown?.setOptions(options);\n }\n\n public scrollSelectedOptionIntoView(): void {\n this._listDropdown?.scrollSelectedOptionIntoView();\n }\n\n public isFocusWithinPopup(target: HTMLElement): boolean {\n if (!this._listDropdown || !this._listDropdown.dropdownElement) {\n return false;\n }\n return this._listDropdown.dropdownElement.contains(target);\n }\n\n public queueDropdownPositionUpdate(): void {\n if (!this.popupElement) {\n return;\n }\n // We need to wait for the next animation frame to ensure that the layout has been updated\n window.requestAnimationFrame(() => {\n const dropdownEl = this.popupElement as IPopupComponent | undefined;\n dropdownEl?.position();\n });\n }\n\n private _clearOptions(): void {\n // First we remove all option group elements\n const existingOptionGroupElements = Array.from(this._component.querySelectorAll(OPTION_GROUP_CONSTANTS.elementName));\n existingOptionGroupElements.forEach((optGroup: IOptionGroupComponent) => removeElement(optGroup));\n\n // Then find all top-level option elements that aren't inside of a group, and ensure that those are removed as well\n const existingOptionElements = Array.from(this._component.querySelectorAll(OPTION_CONSTANTS.elementName));\n existingOptionElements.forEach((o: HTMLElement) => removeElement(o));\n }\n\n private _createOptionGroupElement(group: ISelectOptionGroup): HTMLElement {\n const optionGroupElement = document.createElement('forge-option-group');\n assignMatchingProperties(group, optionGroupElement);\n optionGroupElement.label = group.text ?? '';\n return optionGroupElement;\n }\n\n private _createOptionElement(option: ISelectOption): HTMLElement {\n const optionElement = document.createElement('forge-option');\n assignMatchingProperties(option,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C,EACvF,QAAQ,AAAC,GAAoC,EAAc,CAAQ,CAAC,EAIhG,AAD+B,MAAM,KAAK,KAAK,WAAW,iBAAiB,EAAiB,WAAW,CAAC,EACjF,QAAQ,AAAC,GAAmB,EAAc,CAAC,CAAC,CACrE,CAEA,AAAQ,0BAA0B,EAAwC,CAjO5E,MAkOI,GAAM,GAAqB,SAAS,cAAc,oBAAoB,EACtE,SAAyB,EAAO,CAAkB,EAClD,EAAmB,MAAQ,KAAM,OAAN,OAAc,GAClC,CACT,CAEA,AAAQ,qBAAqB,EAAoC,CAC/D,GAAM,GAAgB,SAAS,cAAc,cAAc,EAC3D,SAAyB,EAAQ,CAAa,EAC9C,EAAc,YAAc,EAAO,MAC5B,CACT,CACF",
6
+ "names": []
7
+ }
@@ -3,5 +3,5 @@
3
3
  * Copyright 2022 Tyler Technologies, Inc.
4
4
  * License: Apache-2.0
5
5
  */
6
- import{b as x,c as C}from"./chunk.OAKTW64X.js";import{a as y}from"./chunk.MIYZJUXH.js";import{a as E}from"./chunk.A23NSEWA.js";import{a as l}from"./chunk.B3IJU6XJ.js";import{a as b,b as L}from"./chunk.BSZ2LBJX.js";import{a as _}from"./chunk.3E5QKMHL.js";import{a as v,e as f,g as c}from"./chunk.HN4PXH3D.js";import{k as p,l as u}from"./chunk.G76HB2FK.js";import{f as s}from"./chunk.MCIQXNKY.js";var D=`${L}file-picker`,I={ACCEPT:"accept",MAX_SIZE:"max-size",CAPTURE:"capture",MULTIPLE:"multiple",DISABLED:"disabled",COMPACT:"compact",BORDERLESS:"borderless"},T={HIGHLIGHT:"highlight",DISABLED:"disabled",COMPACT:"compact",BORDERLESS:"borderless"},S={CONTAINER:"container",BUTTON:"button",INPUT:"input"},A={CONTAINER:"#container",BUTTON:"#button",INPUT:"#input",BUTTON_SLOT:"#button-slot"},P={FILES_CHANGED:`${D}-change`},i={elementName:D,attributes:I,classes:T,ids:S,selectors:A,events:P};var d=class extends E{constructor(e){super(e);this._container=c(e,i.selectors.CONTAINER),this._buttonSlot=c(e,i.selectors.BUTTON_SLOT),this._input=c(e,i.selectors.INPUT),this._inputEventListener=()=>{this._input.value="",this._input.click()},this._container.addEventListener("click",this._inputEventListener)}registerButtonSlotListener(e){this._buttonSlot.addEventListener("slotchange",e)}registerInputChangeListener(e){this._input.addEventListener("change",e)}registerDragEnterListener(e){this._container.addEventListener("dragenter",e)}registerDragLeaveListener(e){this._container.addEventListener("dragleave",e)}registerDragOverListener(e){this._container.addEventListener("dragover",e)}registerDropListener(e){this._container.addEventListener("drop",e)}removeDragEnterListener(e){this._container.removeEventListener("dragenter",e)}removeDragLeaveListener(e){this._container.removeEventListener("dragleave",e)}removeDragOverListener(e){this._container.removeEventListener("dragover",e)}removeDropListener(e){this._container.removeEventListener("drop",e)}initializeButton(){let e=this._component.querySelector("button");this._button=e||void 0}setHighlightState(e){this._container.classList.contains(i.classes.HIGHLIGHT)!==e&&this._container.classList.toggle(i.classes.HIGHLIGHT)}setAccept(e){e?this._input.setAttribute("accept",e):this._input.removeAttribute("accept")}setCapture(e){e?this._input.setAttribute("capture",e):this._input.removeAttribute("capture")}setMultiple(e){e?this._input.setAttribute("multiple",""):this._input.removeAttribute("multiple")}setDisabled(e){e?(this._container.removeEventListener("click",this._inputEventListener),this._button.setAttribute("disabled",""),this._container.setAttribute("disabled","")):(this._container.addEventListener("click",this._inputEventListener),this._button.removeAttribute("disabled"),this._container.removeAttribute("disabled"))}setCompact(e){this._container.classList.contains(i.classes.COMPACT)!==e&&this._container.classList.toggle(i.classes.COMPACT)}setBorderless(e){this._container.classList.contains(i.classes.BORDERLESS)!==e&&this._container.classList.toggle(i.classes.BORDERLESS)}};var h=class{constructor(t){this._adapter=t;this._accept=null;this._maxSize=null;this._capture=null;this._multiple=!1;this._disabled=!1;this._compact=!1;this._borderless=!1;this._buttonSlotListener=e=>this._onButtonSlotChanged(e),this._inputChangeListener=e=>this._onInputChange(e),this._dragEnterListener=e=>this._onDragEnter(e),this._dragLeaveListener=e=>this._onDragLeave(e),this._dragOverListener=e=>this._onDragOver(e),this._dropListener=e=>this._onDrop(e),this._adapter.registerButtonSlotListener(this._buttonSlotListener),this._adapter.registerInputChangeListener(this._inputChangeListener),this._compact||this._registerDragListeners()}initialize(){this._adapter.initializeButton()}_onButtonSlotChanged(t){this._adapter.initializeButton()}_onInputChange(t){let e=t.target.files;e&&this._handleFiles(e)}_onDragEnter(t){this._handleDragEvent(t,!0)}_onDragLeave(t){this._handleDragEvent(t,!1)}_onDragOver(t){this._handleDragEvent(t,!0)}_onDrop(t){if(this._handleDragEvent(t,!1),!this._disabled){let e=t.dataTransfer;if(e){let a=e.files;this._handleFiles(a)}}}_registerDragListeners(){this._adapter.registerDragEnterListener(this._dragEnterListener),this._adapter.registerDragLeaveListener(this._dragLeaveListener),this._adapter.registerDragOverListener(this._dragOverListener),this._adapter.registerDropListener(this._dropListener)}_removeDragListeners(){this._adapter.removeDragEnterListener(this._dragEnterListener),this._adapter.removeDragLeaveListener(this._dragLeaveListener),this._adapter.removeDragOverListener(this._dragOverListener),this._adapter.removeDropListener(this._dropListener)}_handleFiles(t){let e={};if(t){let a=this._sortFiles(t),o=a.legalFiles||null;!this._multiple&&o&&o.length>1&&(o=o.splice(1)),e=a}this._adapter.emitHostEvent(i.events.FILES_CHANGED,e)}_sortFiles(t){let e=[],a=[];if(!this._accept&&!this.maxSize)return e=Array.from(t),{legalFiles:e,illegalFiles:a};let o=this._accept?this._accept.split(",").map(r=>r.trim().toLowerCase()):[""];for(let r=0;r<t.length;r++)!o.some(m=>t[r].type.toLowerCase().match(m)||t[r].name.toLowerCase().match("\\"+m))||this._maxSize&&t[r].size>this._maxSize?a.push(t[r]):e.push(t[r]);return{legalFiles:e,illegalFiles:a}}_handleDragEvent(t,e){this._disabled||(t.preventDefault(),t.stopPropagation(),this._adapter.setHighlightState(e))}get accept(){return this._accept}set accept(t){this._accept!==t&&(this._accept=t,this._adapter.setAccept(t),t?this._adapter.setHostAttribute(i.attributes.ACCEPT,t):this._adapter.removeHostAttribute(i.attributes.ACCEPT))}get maxSize(){return this._maxSize}set maxSize(t){this._maxSize!==t&&(this._maxSize=t,t?this._adapter.setHostAttribute(i.attributes.MAX_SIZE,t.toString()):this._adapter.removeHostAttribute(i.attributes.MAX_SIZE))}get capture(){return this._capture}set capture(t){this._capture!==t&&(this._capture=t,this._adapter.setCapture(t),t?this._adapter.setHostAttribute(i.attributes.CAPTURE,t):this._adapter.removeHostAttribute(i.attributes.CAPTURE))}get multiple(){return this._multiple}set multiple(t){this._multiple!==t&&(this._multiple=t,this._adapter.setMultiple(t),t?this._adapter.setHostAttribute(i.attributes.MULTIPLE):this._adapter.removeHostAttribute(i.attributes.MULTIPLE))}get disabled(){return this._disabled}set disabled(t){this._disabled!==t&&(this._disabled=t,this._adapter.setDisabled(t),t?this._adapter.setHostAttribute(i.attributes.DISABLED):this._adapter.removeHostAttribute(i.attributes.DISABLED))}get compact(){return this._compact}set compact(t){this._compact!==t&&(this._compact=t,this._adapter.setCompact(t),t?(this._adapter.setHostAttribute(i.attributes.COMPACT),this._removeDragListeners()):(this._adapter.removeHostAttribute(i.attributes.COMPACT),this._registerDragListeners()))}get borderless(){return this._borderless}set borderless(t){this._borderless!==t&&(this._borderless=t,this._adapter.setBorderless(t),t?this._adapter.setHostAttribute(i.attributes.BORDERLESS):this._adapter.removeHostAttribute(i.attributes.BORDERLESS))}};var F='<template><form class="forge-file-picker" id="container" part="form"><div class="forge-file-picker__primary" id="primary" part="primary"><slot name="primary"></slot></div><slot id="button-slot"></slot><div class="forge-file-picker__secondary" id="secondary" part="secondary"><slot name="secondary"></slot></div><input type="file" class="forge-file-picker__input" id="input" part="input"></form><div class="forge-file-picker__helper-text" part="helper-text-container"><slot name="helper-text"></slot></div></template>',O='.forge-file-picker{-webkit-box-sizing:border-box;box-sizing:border-box;width:100%;height:100%;background-color:rgba(189,189,189,.12);border:1px dashed #e0e0e0;display:grid;-webkit-box-pack:center;justify-content:center;align-content:center;gap:16px;padding:16px;text-align:center;cursor:pointer}.forge-file-picker__primary{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-subtitle1-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:1rem;font-size:var(--mdc-typography-subtitle1-font-size, 1rem);line-height:1.75rem;line-height:var(--mdc-typography-subtitle1-line-height, 1.75rem);font-weight:400;font-weight:var(--mdc-typography-subtitle1-font-weight,400);letter-spacing:.009375em;letter-spacing:var(--mdc-typography-subtitle1-letter-spacing, .009375em);text-decoration:inherit;-webkit-text-decoration:var(--mdc-typography-subtitle1-text-decoration,inherit);text-decoration:var(--mdc-typography-subtitle1-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-subtitle1-text-transform,inherit);color:rgba(0,0,0,.87);color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87));max-width:auto;max-width:var(--forge-file-picker-max-content-width,auto)}.forge-file-picker__secondary{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-size:.875rem;font-size:var(--forge-typography-subtitle2-secondary-font-size, .875rem);line-height:1.375rem;line-height:var(--forge-typography-subtitle2-secondary-line-height, 1.375rem);font-weight:400;font-weight:var(--forge-typography-subtitle2-secondary-font-weight,400);letter-spacing:.0087500001em;letter-spacing:var(--forge-typography-subtitle2-secondary-letter-spacing, .0087500001em);text-decoration:inherit;-webkit-text-decoration:var(--forge-typography-subtitle2-secondary-text-decoration,inherit);text-decoration:var(--forge-typography-subtitle2-secondary-text-decoration,inherit);text-transform:inherit;text-transform:var(--forge-typography-subtitle2-secondary-text-transform,inherit);color:var(--mdc-theme-text-secondary-on-background);color:var(--forge-typography-subtitle2-secondary-color,var(--mdc-theme-text-secondary-on-background));color:rgba(0,0,0,.87);color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87));max-width:auto;max-width:var(--forge-file-picker-max-content-width,auto)}.forge-file-picker__input{display:none}.forge-file-picker__helper-text ::slotted([slot=helper-text]){-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-caption-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));line-height:1.25rem;line-height:var(--mdc-typography-caption-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-caption-font-weight,400);letter-spacing:.0333333333em;letter-spacing:var(--mdc-typography-caption-letter-spacing, .0333333333em);text-decoration:inherit;-webkit-text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-caption-text-transform,inherit);display:block;height:auto;color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54));margin-left:12px;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-caption-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:.75rem;font-size:var(--mdc-typography-caption-font-size, .75rem);line-height:1.25rem;line-height:var(--mdc-typography-caption-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-caption-font-weight,400);letter-spacing:.0333333333em;letter-spacing:var(--mdc-typography-caption-letter-spacing, .0333333333em);text-decoration:inherit;text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-caption-text-transform,inherit);text-align:start}.forge-file-picker__helper-text ::slotted([slot=helper-text])::before{display:inline-block;width:0;height:16px;content:"";vertical-align:0}.forge-file-picker[disabled]{background-color:#fafafa;background-color:var(--mdc-theme-background,#fafafa);border-color:#e0e0e0;border-color:var(--forge-theme-border-color,#e0e0e0);opacity:.38;cursor:unset}.forge-file-picker.compact{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;background-color:transparent;border:none;padding:0}.forge-file-picker.compact .forge-file-picker__primary,.forge-file-picker.compact .forge-file-picker__secondary{display:none}.forge-file-picker.compact .forge-file-picker__button>button{width:auto;width:var(--forge-file-picker-width,auto);background-color:transparent}.forge-file-picker:not(.compact).highlight{border-color:#3f51b5;border-color:var(--mdc-theme-primary,#3f51b5);background-color:rgba(63,81,181,.12);border-width:1px;border-style:solid}.forge-file-picker.borderless{--forge-file-picker-width:100%;border:none}.forge-file-picker.borderless:not(.compact).highlight{border:none}.forge-file-picker.borderless+.forge-file-picker__helper-text{display:none}:host{width:auto;width:var(--forge-file-picker-width,auto);height:auto;height:var(--forge-file-picker-height,auto);display:inline-block}:host([hidden]){display:none}',n=class extends _{constructor(){super();f(this,F,O),this._foundation=new h(new d(this))}static get observedAttributes(){return[i.attributes.ACCEPT,i.attributes.MAX_SIZE,i.attributes.CAPTURE,i.attributes.MULTIPLE,i.attributes.DISABLED,i.attributes.COMPACT,i.attributes.BORDERLESS]}connectedCallback(){this._foundation.initialize()}attributeChangedCallback(e,a,o){switch(e){case i.attributes.ACCEPT:this.accept=o;break;case i.attributes.MAX_SIZE:this.maxSize=u(o);break;case i.attributes.CAPTURE:this.capture=o;break;case i.attributes.MULTIPLE:this.multiple=p(o);break;case i.attributes.DISABLED:this.disabled=p(o);break;case i.attributes.COMPACT:this.compact=p(o);break;case i.attributes.BORDERLESS:this.borderless=p(o);break}}};s([l()],n.prototype,"accept",2),s([l()],n.prototype,"maxSize",2),s([l()],n.prototype,"capture",2),s([l()],n.prototype,"multiple",2),s([l()],n.prototype,"disabled",2),s([l()],n.prototype,"compact",2),s([l()],n.prototype,"borderless",2),n=s([b({name:i.elementName,dependencies:[x]})],n);var k=class extends y{constructor(t){super(t)}_build(){return document.createElement(i.elementName)}_configure(){var t,e,a,o;if((t=this._config.options)!=null&&t.primaryText){let r=document.createElement("span");r.slot="primary",r.textContent=this._config.options.primaryText,this._element.appendChild(r)}if((e=this._config.options)!=null&&e.secondaryText){let r=document.createElement("span");r.slot="secondary",r.textContent=this._config.options.secondaryText,this._element.appendChild(r)}if((a=this._config.options)!=null&&a.buttonText&&new C({options:{parent:this._element,text:this._config.options.buttonText},props:{type:"outlined"}}),(o=this._config.options)!=null&&o.helperText){let r=document.createElement("span");r.slot="helper-text",r.textContent=this._config.options.helperText,this._element.appendChild(r)}}onChange(t){this._element.addEventListener(i.events.FILES_CHANGED,e=>t(e.detail))}};function pe(){v(n)}export{i as a,d as b,h as c,n as d,k as e,pe as f};
7
- //# sourceMappingURL=chunk.V7P3QPNM.js.map
6
+ import{b as x,c as C}from"./chunk.OAKTW64X.js";import{a as y}from"./chunk.MIYZJUXH.js";import{a as E}from"./chunk.A23NSEWA.js";import{a as l}from"./chunk.B3IJU6XJ.js";import{a as f,b as L}from"./chunk.BSZ2LBJX.js";import{a as _}from"./chunk.3E5QKMHL.js";import{a as v,e as b,g as c}from"./chunk.HN4PXH3D.js";import{k as p,l as u}from"./chunk.G76HB2FK.js";import{f as s}from"./chunk.MCIQXNKY.js";var D=`${L}file-picker`,I={ACCEPT:"accept",MAX_SIZE:"max-size",CAPTURE:"capture",MULTIPLE:"multiple",DISABLED:"disabled",COMPACT:"compact",BORDERLESS:"borderless"},T={HIGHLIGHT:"highlight",DISABLED:"disabled",COMPACT:"compact",BORDERLESS:"borderless"},S={CONTAINER:"container",BUTTON:"button",INPUT:"input"},A={CONTAINER:"#container",BUTTON:"#button",INPUT:"#input",BUTTON_SLOT:"#button-slot"},P={FILES_CHANGED:`${D}-change`},i={elementName:D,attributes:I,classes:T,ids:S,selectors:A,events:P};var d=class extends E{constructor(e){super(e);this._container=c(e,i.selectors.CONTAINER),this._buttonSlot=c(e,i.selectors.BUTTON_SLOT),this._input=c(e,i.selectors.INPUT),this._inputEventListener=()=>{this._input.value="",this._input.click()},this._container.addEventListener("click",this._inputEventListener)}registerButtonSlotListener(e){this._buttonSlot.addEventListener("slotchange",e)}registerInputChangeListener(e){this._input.addEventListener("change",e)}registerDragEnterListener(e){this._container.addEventListener("dragenter",e)}registerDragLeaveListener(e){this._container.addEventListener("dragleave",e)}registerDragOverListener(e){this._container.addEventListener("dragover",e)}registerDropListener(e){this._container.addEventListener("drop",e)}removeDragEnterListener(e){this._container.removeEventListener("dragenter",e)}removeDragLeaveListener(e){this._container.removeEventListener("dragleave",e)}removeDragOverListener(e){this._container.removeEventListener("dragover",e)}removeDropListener(e){this._container.removeEventListener("drop",e)}initializeButton(){let e=this._component.querySelector("button");this._button=e||void 0}setHighlightState(e){this._container.classList.contains(i.classes.HIGHLIGHT)!==e&&this._container.classList.toggle(i.classes.HIGHLIGHT)}setAccept(e){e?this._input.setAttribute("accept",e):this._input.removeAttribute("accept")}setCapture(e){e?this._input.setAttribute("capture",e):this._input.removeAttribute("capture")}setMultiple(e){e?this._input.setAttribute("multiple",""):this._input.removeAttribute("multiple")}setDisabled(e){e?(this._container.removeEventListener("click",this._inputEventListener),this._button.setAttribute("disabled",""),this._container.setAttribute("disabled","")):(this._container.addEventListener("click",this._inputEventListener),this._button.removeAttribute("disabled"),this._container.removeAttribute("disabled"))}setCompact(e){this._container.classList.contains(i.classes.COMPACT)!==e&&this._container.classList.toggle(i.classes.COMPACT)}setBorderless(e){this._container.classList.contains(i.classes.BORDERLESS)!==e&&this._container.classList.toggle(i.classes.BORDERLESS)}};var h=class{constructor(t){this._adapter=t;this._accept=null;this._maxSize=null;this._capture=null;this._multiple=!1;this._disabled=!1;this._compact=!1;this._borderless=!1;this._buttonSlotListener=e=>this._onButtonSlotChanged(e),this._inputChangeListener=e=>this._onInputChange(e),this._dragEnterListener=e=>this._onDragEnter(e),this._dragLeaveListener=e=>this._onDragLeave(e),this._dragOverListener=e=>this._onDragOver(e),this._dropListener=e=>this._onDrop(e),this._adapter.registerButtonSlotListener(this._buttonSlotListener),this._adapter.registerInputChangeListener(this._inputChangeListener),this._compact||this._registerDragListeners()}initialize(){this._adapter.initializeButton()}_onButtonSlotChanged(t){this._adapter.initializeButton()}_onInputChange(t){let e=t.target.files;e&&this._handleFiles(e)}_onDragEnter(t){this._handleDragEvent(t,!0)}_onDragLeave(t){this._handleDragEvent(t,!1)}_onDragOver(t){this._handleDragEvent(t,!0)}_onDrop(t){if(this._handleDragEvent(t,!1),!this._disabled){let e=t.dataTransfer;if(e){let a=e.files;this._handleFiles(a)}}}_registerDragListeners(){this._adapter.registerDragEnterListener(this._dragEnterListener),this._adapter.registerDragLeaveListener(this._dragLeaveListener),this._adapter.registerDragOverListener(this._dragOverListener),this._adapter.registerDropListener(this._dropListener)}_removeDragListeners(){this._adapter.removeDragEnterListener(this._dragEnterListener),this._adapter.removeDragLeaveListener(this._dragLeaveListener),this._adapter.removeDragOverListener(this._dragOverListener),this._adapter.removeDropListener(this._dropListener)}_handleFiles(t){let e={};if(t){let a=this._sortFiles(t),o=a.legalFiles||null;!this._multiple&&o&&o.length>1&&(o=o.splice(1)),e=a}this._adapter.emitHostEvent(i.events.FILES_CHANGED,e)}_sortFiles(t){let e=[],a=[];if(!this._accept&&!this.maxSize)return e=Array.from(t),{legalFiles:e,illegalFiles:a};let o=this._accept?this._accept.split(",").map(r=>r.trim().toLowerCase()):[""];for(let r=0;r<t.length;r++)!o.some(m=>t[r].type.toLowerCase().match(m)||t[r].name.toLowerCase().match("\\"+m))||this._maxSize&&t[r].size>this._maxSize?a.push(t[r]):e.push(t[r]);return{legalFiles:e,illegalFiles:a}}_handleDragEvent(t,e){this._disabled||(t.preventDefault(),t.stopPropagation(),this._adapter.setHighlightState(e))}get accept(){return this._accept}set accept(t){this._accept!==t&&(this._accept=t,this._adapter.setAccept(t),t?this._adapter.setHostAttribute(i.attributes.ACCEPT,t):this._adapter.removeHostAttribute(i.attributes.ACCEPT))}get maxSize(){return this._maxSize}set maxSize(t){this._maxSize!==t&&(this._maxSize=t,t?this._adapter.setHostAttribute(i.attributes.MAX_SIZE,t.toString()):this._adapter.removeHostAttribute(i.attributes.MAX_SIZE))}get capture(){return this._capture}set capture(t){this._capture!==t&&(this._capture=t,this._adapter.setCapture(t),t?this._adapter.setHostAttribute(i.attributes.CAPTURE,t):this._adapter.removeHostAttribute(i.attributes.CAPTURE))}get multiple(){return this._multiple}set multiple(t){this._multiple!==t&&(this._multiple=t,this._adapter.setMultiple(t),t?this._adapter.setHostAttribute(i.attributes.MULTIPLE):this._adapter.removeHostAttribute(i.attributes.MULTIPLE))}get disabled(){return this._disabled}set disabled(t){this._disabled!==t&&(this._disabled=t,this._adapter.setDisabled(t),t?this._adapter.setHostAttribute(i.attributes.DISABLED):this._adapter.removeHostAttribute(i.attributes.DISABLED))}get compact(){return this._compact}set compact(t){this._compact!==t&&(this._compact=t,this._adapter.setCompact(t),t?(this._adapter.setHostAttribute(i.attributes.COMPACT),this._removeDragListeners()):(this._adapter.removeHostAttribute(i.attributes.COMPACT),this._registerDragListeners()))}get borderless(){return this._borderless}set borderless(t){this._borderless!==t&&(this._borderless=t,this._adapter.setBorderless(t),t?this._adapter.setHostAttribute(i.attributes.BORDERLESS):this._adapter.removeHostAttribute(i.attributes.BORDERLESS))}};var F='<template><form class="forge-file-picker" id="container" part="form"><div class="forge-file-picker__primary" id="primary" part="primary"><slot name="primary"></slot></div><slot id="button-slot"></slot><div class="forge-file-picker__secondary" id="secondary" part="secondary"><slot name="secondary"></slot></div><input type="file" class="forge-file-picker__input" id="input" part="input"></form><div class="forge-file-picker__helper-text" part="helper-text-container"><slot name="helper-text"></slot></div></template>',O=".forge-file-picker{-webkit-box-sizing:border-box;box-sizing:border-box;width:100%;height:100%;background-color:rgba(189,189,189,.12);border:1px dashed #e0e0e0;display:grid;-webkit-box-pack:center;justify-content:center;align-content:center;gap:16px;padding:16px;text-align:center;cursor:pointer}.forge-file-picker__primary{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-subtitle1-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:1rem;font-size:var(--mdc-typography-subtitle1-font-size, 1rem);line-height:1.75rem;line-height:var(--mdc-typography-subtitle1-line-height, 1.75rem);font-weight:400;font-weight:var(--mdc-typography-subtitle1-font-weight,400);letter-spacing:.009375em;letter-spacing:var(--mdc-typography-subtitle1-letter-spacing, .009375em);text-decoration:inherit;-webkit-text-decoration:var(--mdc-typography-subtitle1-text-decoration,inherit);text-decoration:var(--mdc-typography-subtitle1-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-subtitle1-text-transform,inherit);color:rgba(0,0,0,.87);color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87));max-width:auto;max-width:var(--forge-file-picker-max-content-width,auto)}.forge-file-picker__secondary{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-size:.875rem;font-size:var(--forge-typography-subtitle2-secondary-font-size, .875rem);line-height:1.375rem;line-height:var(--forge-typography-subtitle2-secondary-line-height, 1.375rem);font-weight:400;font-weight:var(--forge-typography-subtitle2-secondary-font-weight,400);letter-spacing:.0087500001em;letter-spacing:var(--forge-typography-subtitle2-secondary-letter-spacing, .0087500001em);text-decoration:inherit;-webkit-text-decoration:var(--forge-typography-subtitle2-secondary-text-decoration,inherit);text-decoration:var(--forge-typography-subtitle2-secondary-text-decoration,inherit);text-transform:inherit;text-transform:var(--forge-typography-subtitle2-secondary-text-transform,inherit);color:var(--mdc-theme-text-secondary-on-background);color:var(--forge-typography-subtitle2-secondary-color,var(--mdc-theme-text-secondary-on-background));color:rgba(0,0,0,.87);color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87));max-width:auto;max-width:var(--forge-file-picker-max-content-width,auto)}.forge-file-picker__input{display:none}.forge-file-picker__helper-text ::slotted([slot=helper-text]){-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-caption-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));line-height:1.25rem;line-height:var(--mdc-typography-caption-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-caption-font-weight,400);letter-spacing:.0333333333em;letter-spacing:var(--mdc-typography-caption-letter-spacing, .0333333333em);text-decoration:inherit;-webkit-text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-caption-text-transform,inherit);display:block;min-height:1.5rem;line-height:normal;padding-top:4px;-webkit-box-sizing:border-box;box-sizing:border-box;color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54));margin-left:12px;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-caption-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:.75rem;font-size:var(--mdc-typography-caption-font-size, .75rem);line-height:1.25rem;line-height:var(--mdc-typography-caption-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-caption-font-weight,400);letter-spacing:.0333333333em;letter-spacing:var(--mdc-typography-caption-letter-spacing, .0333333333em);text-decoration:inherit;text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-caption-text-transform,inherit);text-align:start}.forge-file-picker[disabled]{background-color:#fafafa;background-color:var(--mdc-theme-background,#fafafa);border-color:#e0e0e0;border-color:var(--forge-theme-border-color,#e0e0e0);opacity:.38;cursor:unset}.forge-file-picker.compact{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;background-color:transparent;border:none;padding:0}.forge-file-picker.compact .forge-file-picker__primary,.forge-file-picker.compact .forge-file-picker__secondary{display:none}.forge-file-picker.compact .forge-file-picker__button>button{width:auto;width:var(--forge-file-picker-width,auto);background-color:transparent}.forge-file-picker:not(.compact).highlight{border-color:#3f51b5;border-color:var(--mdc-theme-primary,#3f51b5);background-color:rgba(63,81,181,.12);border-width:1px;border-style:solid}.forge-file-picker.borderless{--forge-file-picker-width:100%;border:none}.forge-file-picker.borderless:not(.compact).highlight{border:none}.forge-file-picker.borderless+.forge-file-picker__helper-text{display:none}:host{width:auto;width:var(--forge-file-picker-width,auto);height:auto;height:var(--forge-file-picker-height,auto);display:inline-block}:host([hidden]){display:none}",n=class extends _{constructor(){super();b(this,F,O),this._foundation=new h(new d(this))}static get observedAttributes(){return[i.attributes.ACCEPT,i.attributes.MAX_SIZE,i.attributes.CAPTURE,i.attributes.MULTIPLE,i.attributes.DISABLED,i.attributes.COMPACT,i.attributes.BORDERLESS]}connectedCallback(){this._foundation.initialize()}attributeChangedCallback(e,a,o){switch(e){case i.attributes.ACCEPT:this.accept=o;break;case i.attributes.MAX_SIZE:this.maxSize=u(o);break;case i.attributes.CAPTURE:this.capture=o;break;case i.attributes.MULTIPLE:this.multiple=p(o);break;case i.attributes.DISABLED:this.disabled=p(o);break;case i.attributes.COMPACT:this.compact=p(o);break;case i.attributes.BORDERLESS:this.borderless=p(o);break}}};s([l()],n.prototype,"accept",2),s([l()],n.prototype,"maxSize",2),s([l()],n.prototype,"capture",2),s([l()],n.prototype,"multiple",2),s([l()],n.prototype,"disabled",2),s([l()],n.prototype,"compact",2),s([l()],n.prototype,"borderless",2),n=s([f({name:i.elementName,dependencies:[x]})],n);var k=class extends y{constructor(t){super(t)}_build(){return document.createElement(i.elementName)}_configure(){var t,e,a,o;if((t=this._config.options)!=null&&t.primaryText){let r=document.createElement("span");r.slot="primary",r.textContent=this._config.options.primaryText,this._element.appendChild(r)}if((e=this._config.options)!=null&&e.secondaryText){let r=document.createElement("span");r.slot="secondary",r.textContent=this._config.options.secondaryText,this._element.appendChild(r)}if((a=this._config.options)!=null&&a.buttonText&&new C({options:{parent:this._element,text:this._config.options.buttonText},props:{type:"outlined"}}),(o=this._config.options)!=null&&o.helperText){let r=document.createElement("span");r.slot="helper-text",r.textContent=this._config.options.helperText,this._element.appendChild(r)}}onChange(t){this._element.addEventListener(i.events.FILES_CHANGED,e=>t(e.detail))}};function pe(){v(n)}export{i as a,d as b,h as c,n as d,k as e,pe as f};
7
+ //# sourceMappingURL=chunk.Y7Q6QI5V.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/file-picker/file-picker-constants.ts", "../../src/file-picker/file-picker-adapter.ts", "../../src/file-picker/file-picker-foundation.ts", "../../src/file-picker/file-picker.ts", "../../src/file-picker/file-picker-component-delegate.ts", "../../src/file-picker/index.ts"],
4
- "sourcesContent": ["import { COMPONENT_NAME_PREFIX } from '../constants';\n\nconst elementName: keyof HTMLElementTagNameMap = `${COMPONENT_NAME_PREFIX}file-picker`;\n\nconst attributes = {\n ACCEPT: 'accept',\n MAX_SIZE: 'max-size',\n CAPTURE: 'capture',\n MULTIPLE: 'multiple',\n DISABLED: 'disabled',\n COMPACT: 'compact',\n BORDERLESS: 'borderless'\n};\n\nconst classes = {\n HIGHLIGHT: 'highlight',\n DISABLED: 'disabled',\n COMPACT: 'compact',\n BORDERLESS: 'borderless'\n};\n\nconst ids = {\n CONTAINER: 'container',\n BUTTON: 'button',\n INPUT: 'input'\n};\n\nconst selectors = {\n CONTAINER: '#container',\n BUTTON: '#button',\n INPUT: '#input',\n BUTTON_SLOT: '#button-slot'\n};\n\nconst events = {\n FILES_CHANGED: `${elementName}-change`\n};\n\nexport const FILE_PICKER_CONSTANTS = {\n elementName,\n attributes,\n classes,\n ids,\n selectors,\n events\n};\n\nexport interface IFilePickerChangeEventData {\n legalFiles?: File[];\n illegalFiles?: File[];\n}\n", "import { getShadowElement, emitEvent } from '@tylertech/forge-core';\n\nimport { IFilePickerComponent } from './file-picker';\nimport { FILE_PICKER_CONSTANTS } from './file-picker-constants';\nimport { BaseAdapter, IBaseAdapter } from '../core';\n\nexport interface IFilePickerAdapter extends IBaseAdapter {\n registerButtonSlotListener(listener: (evt: Event) => void): void;\n registerInputChangeListener(listener: (evt: Event) => void): void;\n registerDragEnterListener(listener: (evt: DragEvent) => void): void;\n registerDragLeaveListener(listener: (evt: DragEvent) => void): void;\n registerDragOverListener(listener: (evt: DragEvent) => void): void;\n registerDropListener(listener: (evt: DragEvent) => void): void;\n removeDragEnterListener(listener: (evt: DragEvent) => void): void;\n removeDragLeaveListener(listener: (evt: DragEvent) => void): void;\n removeDragOverListener(listener: (evt: DragEvent) => void): void;\n removeDropListener(listener: (evt: DragEvent) => void): void;\n initializeButton(): void;\n setHighlightState(value: boolean): void;\n setAccept(value: string | null | undefined): void;\n setCapture(value: string | null | undefined): void;\n setMultiple(value: boolean): void;\n setDisabled(value: boolean): void;\n setCompact(value: boolean): void;\n setBorderless(value: boolean): void;\n}\n\nexport class FilePickerAdapter extends BaseAdapter<IFilePickerComponent> implements IFilePickerAdapter {\n private _container: HTMLElement;\n private _buttonSlot: HTMLSlotElement;\n private _button: HTMLButtonElement;\n private _input: HTMLInputElement;\n private _inputEventListener: () => void;\n\n constructor(component: IFilePickerComponent) {\n super(component);\n\n this._container = getShadowElement(component, FILE_PICKER_CONSTANTS.selectors.CONTAINER);\n this._buttonSlot = getShadowElement(component, FILE_PICKER_CONSTANTS.selectors.BUTTON_SLOT) as HTMLSlotElement;\n this._input = getShadowElement(component, FILE_PICKER_CONSTANTS.selectors.INPUT) as HTMLInputElement;\n\n this._inputEventListener = () => {\n this._input.value = '';\n this._input.click();\n };\n\n this._container.addEventListener('click', this._inputEventListener);\n }\n\n public registerButtonSlotListener(listener: (evt: Event) => void): void {\n this._buttonSlot.addEventListener('slotchange', listener);\n }\n\n public registerInputChangeListener(listener: (evt: Event) => void): void {\n this._input.addEventListener('change', listener);\n }\n\n public registerDragEnterListener(listener: (evt: DragEvent) => void): void {\n this._container.addEventListener('dragenter', listener);\n }\n\n public registerDragLeaveListener(listener: (evt: DragEvent) => void): void {\n this._container.addEventListener('dragleave', listener);\n }\n\n public registerDragOverListener(listener: (evt: DragEvent) => void): void {\n this._container.addEventListener('dragover', listener);\n }\n\n public registerDropListener(listener: (evt: DragEvent) => void): void {\n this._container.addEventListener('drop', listener);\n }\n\n public removeDragEnterListener(listener: (evt: DragEvent) => void): void {\n this._container.removeEventListener('dragenter', listener);\n }\n\n public removeDragLeaveListener(listener: (evt: DragEvent) => void): void {\n this._container.removeEventListener('dragleave', listener);\n }\n\n public removeDragOverListener(listener: (evt: DragEvent) => void): void {\n this._container.removeEventListener('dragover', listener);\n }\n\n public removeDropListener(listener: (evt: DragEvent) => void): void {\n this._container.removeEventListener('drop', listener);\n }\n\n public initializeButton(): void {\n const button = this._component.querySelector('button') as HTMLButtonElement;\n this._button = button || undefined;\n }\n\n /**\n * Sets the highlight state of the file picker.\n * @param value True if the highlight should be applied and false if not.\n */\n public setHighlightState(value: boolean): void {\n if (this._container.classList.contains(FILE_PICKER_CONSTANTS.classes.HIGHLIGHT) !== value) {\n this._container.classList.toggle(FILE_PICKER_CONSTANTS.classes.HIGHLIGHT);\n }\n }\n\n /**\n * Sets the accept attribute of the input.\n * @param value The accept string.\n */\n public setAccept(value: string | null | undefined): void {\n if (value) {\n this._input.setAttribute('accept', value);\n } else {\n this._input.removeAttribute('accept');\n }\n }\n\n /**\n * Sets the capture attribute of the input.\n * @param value The capture string.\n */\n public setCapture(value: string | null | undefined): void {\n if (value) {\n this._input.setAttribute('capture', value);\n } else {\n this._input.removeAttribute('capture');\n }\n }\n\n /**\n * Sets the multiple attribute of the input.\n * @param value The multiple state.\n */\n public setMultiple(value: boolean): void {\n if (value) {\n this._input.setAttribute('multiple', '');\n } else {\n this._input.removeAttribute('multiple');\n }\n }\n\n /**\n * Sets the disabled state of the file picker.\n * @param value The disabled state.\n */\n public setDisabled(value: boolean): void {\n if (value) {\n this._container.removeEventListener('click', this._inputEventListener);\n this._button.setAttribute('disabled', '');\n this._container.setAttribute('disabled', '');\n } else {\n this._container.addEventListener('click', this._inputEventListener);\n this._button.removeAttribute('disabled');\n this._container.removeAttribute('disabled');\n }\n }\n\n /**\n * Sets the compact state of the file picker.\n * @param value The compact state.\n */\n public setCompact(value: boolean): void {\n if (this._container.classList.contains(FILE_PICKER_CONSTANTS.classes.COMPACT) !== value) {\n this._container.classList.toggle(FILE_PICKER_CONSTANTS.classes.COMPACT);\n }\n }\n\n /**\n * Sets the borderless state of the file picker.\n * @param value The borderless state.\n */\n public setBorderless(value: boolean): void {\n if (this._container.classList.contains(FILE_PICKER_CONSTANTS.classes.BORDERLESS) !== value) {\n this._container.classList.toggle(FILE_PICKER_CONSTANTS.classes.BORDERLESS);\n }\n }\n}\n", "import { ICustomElementFoundation } from '@tylertech/forge-core';\n\nimport { IFilePickerAdapter } from './file-picker-adapter';\nimport { FILE_PICKER_CONSTANTS, IFilePickerChangeEventData } from './file-picker-constants';\n\nexport interface IFilePickerFoundation extends ICustomElementFoundation {\n accept: string | null | undefined;\n maxSize: number | null | undefined;\n capture: string | null | undefined;\n multiple: boolean;\n disabled: boolean;\n compact: boolean;\n borderless: boolean;\n}\n\nexport class FilePickerFoundation implements IFilePickerFoundation {\n private _accept: string | null | undefined = null;\n private _maxSize: number | null | undefined = null;\n private _capture: string | null | undefined = null;\n private _multiple = false;\n private _disabled = false;\n private _compact = false;\n private _borderless = false;\n private _buttonSlotListener: (evt: Event) => void;\n private _inputChangeListener: (evt: Event) => void;\n private _dragEnterListener: (evt: DragEvent) => void;\n private _dragLeaveListener: (evt: DragEvent) => void;\n private _dragOverListener: (evt: DragEvent) => void;\n private _dropListener: (evt: DragEvent) => void;\n\n constructor(private _adapter: IFilePickerAdapter) {\n this._buttonSlotListener = evt => this._onButtonSlotChanged(evt);\n this._inputChangeListener = evt => this._onInputChange(evt);\n this._dragEnterListener = evt => this._onDragEnter(evt);\n this._dragLeaveListener = evt => this._onDragLeave(evt);\n this._dragOverListener = evt => this._onDragOver(evt);\n this._dropListener = evt => this._onDrop(evt);\n\n this._adapter.registerButtonSlotListener(this._buttonSlotListener);\n this._adapter.registerInputChangeListener(this._inputChangeListener);\n if (!this._compact) {\n this._registerDragListeners();\n }\n }\n\n public initialize(): void {\n this._adapter.initializeButton();\n }\n\n private _onButtonSlotChanged(evt: Event): void {\n this._adapter.initializeButton();\n }\n\n private _onInputChange(evt: Event): void {\n const files = (evt.target as HTMLInputElement).files;\n if (files) {\n this._handleFiles(files);\n }\n }\n\n private _onDragEnter(evt: DragEvent): void {\n this._handleDragEvent(evt, true);\n }\n\n private _onDragLeave(evt: DragEvent): void {\n this._handleDragEvent(evt, false);\n }\n\n private _onDragOver(evt: DragEvent): void {\n this._handleDragEvent(evt, true);\n }\n\n private _onDrop(evt: DragEvent): void {\n this._handleDragEvent(evt, false);\n\n if (!this._disabled) {\n const dataTransfer = evt.dataTransfer;\n if (dataTransfer) {\n const files = dataTransfer.files;\n this._handleFiles(files);\n }\n }\n }\n\n private _registerDragListeners(): void {\n this._adapter.registerDragEnterListener(this._dragEnterListener);\n this._adapter.registerDragLeaveListener(this._dragLeaveListener);\n this._adapter.registerDragOverListener(this._dragOverListener);\n this._adapter.registerDropListener(this._dropListener);\n }\n\n private _removeDragListeners(): void {\n this._adapter.removeDragEnterListener(this._dragEnterListener);\n this._adapter.removeDragLeaveListener(this._dragLeaveListener);\n this._adapter.removeDragOverListener(this._dragOverListener);\n this._adapter.removeDropListener(this._dropListener);\n }\n\n private _handleFiles(fileList: FileList): void {\n let data: IFilePickerChangeEventData = {};\n if (fileList) {\n const sortedFiles = this._sortFiles(fileList);\n let files = sortedFiles.legalFiles || null;\n\n // Ensure that we can only drop 1 file if not in multiple mode\n if (!this._multiple && files && files.length > 1) {\n files = files.splice(1);\n }\n\n data = sortedFiles;\n }\n this._adapter.emitHostEvent(FILE_PICKER_CONSTANTS.events.FILES_CHANGED, data);\n }\n\n private _sortFiles(files: FileList): IFilePickerChangeEventData {\n let legalFiles: File[] = [];\n const illegalFiles: File[] = [];\n\n if (!this._accept && !this.maxSize) {\n legalFiles = Array.from(files);\n return { legalFiles, illegalFiles };\n }\n\n const formats = this._accept ? this._accept.split(',').map(f => f.trim().toLowerCase()) : [''];\n\n // eslint-disable-next-line @typescript-eslint/prefer-for-of\n for (let i = 0; i < files.length; i++) {\n if (!formats.some(f => {\n return files[i].type.toLowerCase().match(f) || files[i].name.toLowerCase().match('\\\\' + f);\n }) || (this._maxSize && files[i].size > this._maxSize)) {\n illegalFiles.push(files[i]);\n } else {\n legalFiles.push(files[i]);\n }\n }\n\n return { legalFiles, illegalFiles };\n }\n\n private _handleDragEvent(evt: DragEvent, isOverTarget: boolean): void {\n if (!this._disabled) {\n evt.preventDefault();\n evt.stopPropagation();\n this._adapter.setHighlightState(isOverTarget);\n }\n }\n\n /** Get and set the allowed file types */\n public get accept(): string | null | undefined {\n return this._accept;\n }\n public set accept(value: string | null | undefined) {\n if (this._accept !== value) {\n this._accept = value;\n this._adapter.setAccept(value);\n if (value) {\n this._adapter.setHostAttribute(FILE_PICKER_CONSTANTS.attributes.ACCEPT, value);\n } else {\n this._adapter.removeHostAttribute(FILE_PICKER_CONSTANTS.attributes.ACCEPT);\n }\n }\n }\n\n /** Get and set the maximum allowed file size */\n public get maxSize(): number | null | undefined {\n return this._maxSize;\n }\n public set maxSize(value: number | null | undefined) {\n if (this._maxSize !== value) {\n this._maxSize = value;\n if (value) {\n this._adapter.setHostAttribute(FILE_PICKER_CONSTANTS.attributes.MAX_SIZE, value.toString());\n } else {\n this._adapter.removeHostAttribute(FILE_PICKER_CONSTANTS.attributes.MAX_SIZE);\n }\n }\n }\n\n /** Get and set the camera to use when capturing video or images */\n public get capture(): string | null | undefined {\n return this._capture;\n }\n public set capture(value: string | null | undefined) {\n if (this._capture !== value) {\n this._capture = value;\n this._adapter.setCapture(value);\n if (value) {\n this._adapter.setHostAttribute(FILE_PICKER_CONSTANTS.attributes.CAPTURE, value);\n } else {\n this._adapter.removeHostAttribute(FILE_PICKER_CONSTANTS.attributes.CAPTURE);\n }\n }\n }\n\n /** Get and set whether multiple files are allowed */\n public get multiple(): boolean {\n return this._multiple;\n }\n public set multiple(value: boolean) {\n if (this._multiple !== value) {\n this._multiple = value;\n this._adapter.setMultiple(value);\n if (value) {\n this._adapter.setHostAttribute(FILE_PICKER_CONSTANTS.attributes.MULTIPLE);\n } else {\n this._adapter.removeHostAttribute(FILE_PICKER_CONSTANTS.attributes.MULTIPLE);\n }\n }\n }\n\n /** Get and set whether the file picker is disabled */\n public get disabled(): boolean {\n return this._disabled;\n }\n public set disabled(value: boolean) {\n if (this._disabled !== value) {\n this._disabled = value;\n this._adapter.setDisabled(value);\n if (value) {\n this._adapter.setHostAttribute(FILE_PICKER_CONSTANTS.attributes.DISABLED);\n } else {\n this._adapter.removeHostAttribute(FILE_PICKER_CONSTANTS.attributes.DISABLED);\n }\n }\n }\n\n /** Get and set whether the file picker is compact */\n public get compact(): boolean {\n return this._compact;\n }\n public set compact(value: boolean) {\n if (this._compact !== value) {\n this._compact = value;\n this._adapter.setCompact(value);\n if (value) {\n this._adapter.setHostAttribute(FILE_PICKER_CONSTANTS.attributes.COMPACT);\n this._removeDragListeners();\n } else {\n this._adapter.removeHostAttribute(FILE_PICKER_CONSTANTS.attributes.COMPACT);\n this._registerDragListeners();\n }\n }\n }\n\n /** Get and set whether the file picker is borderless */\n public get borderless(): boolean {\n return this._borderless;\n }\n public set borderless(value: boolean) {\n if (this._borderless !== value) {\n this._borderless = value;\n this._adapter.setBorderless(value);\n if (value) {\n this._adapter.setHostAttribute(FILE_PICKER_CONSTANTS.attributes.BORDERLESS);\n } else {\n this._adapter.removeHostAttribute(FILE_PICKER_CONSTANTS.attributes.BORDERLESS);\n }\n }\n }\n}\n", "import { attachShadowTemplate, coerceBoolean, coerceNumber, CustomElement, FoundationProperty } from '@tylertech/forge-core';\nimport { ButtonComponent } from '../button';\nimport { BaseComponent, IBaseComponent } from '../core/base/base-component';\nimport { FilePickerAdapter } from './file-picker-adapter';\nimport { FILE_PICKER_CONSTANTS, IFilePickerChangeEventData } from './file-picker-constants';\nimport { FilePickerFoundation } from './file-picker-foundation';\n\nconst template = '<template><form class=\\\"forge-file-picker\\\" id=\\\"container\\\" part=\\\"form\\\"><div class=\\\"forge-file-picker__primary\\\" id=\\\"primary\\\" part=\\\"primary\\\"><slot name=\\\"primary\\\"></slot></div><slot id=\\\"button-slot\\\"></slot><div class=\\\"forge-file-picker__secondary\\\" id=\\\"secondary\\\" part=\\\"secondary\\\"><slot name=\\\"secondary\\\"></slot></div><input type=\\\"file\\\" class=\\\"forge-file-picker__input\\\" id=\\\"input\\\" part=\\\"input\\\"></form><div class=\\\"forge-file-picker__helper-text\\\" part=\\\"helper-text-container\\\"><slot name=\\\"helper-text\\\"></slot></div></template>';\nconst styles = '.forge-file-picker{-webkit-box-sizing:border-box;box-sizing:border-box;width:100%;height:100%;background-color:rgba(189,189,189,.12);border:1px dashed #e0e0e0;display:grid;-webkit-box-pack:center;justify-content:center;align-content:center;gap:16px;padding:16px;text-align:center;cursor:pointer}.forge-file-picker__primary{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-subtitle1-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:1rem;font-size:var(--mdc-typography-subtitle1-font-size, 1rem);line-height:1.75rem;line-height:var(--mdc-typography-subtitle1-line-height, 1.75rem);font-weight:400;font-weight:var(--mdc-typography-subtitle1-font-weight,400);letter-spacing:.009375em;letter-spacing:var(--mdc-typography-subtitle1-letter-spacing, .009375em);text-decoration:inherit;-webkit-text-decoration:var(--mdc-typography-subtitle1-text-decoration,inherit);text-decoration:var(--mdc-typography-subtitle1-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-subtitle1-text-transform,inherit);color:rgba(0,0,0,.87);color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87));max-width:auto;max-width:var(--forge-file-picker-max-content-width,auto)}.forge-file-picker__secondary{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-size:.875rem;font-size:var(--forge-typography-subtitle2-secondary-font-size, .875rem);line-height:1.375rem;line-height:var(--forge-typography-subtitle2-secondary-line-height, 1.375rem);font-weight:400;font-weight:var(--forge-typography-subtitle2-secondary-font-weight,400);letter-spacing:.0087500001em;letter-spacing:var(--forge-typography-subtitle2-secondary-letter-spacing, .0087500001em);text-decoration:inherit;-webkit-text-decoration:var(--forge-typography-subtitle2-secondary-text-decoration,inherit);text-decoration:var(--forge-typography-subtitle2-secondary-text-decoration,inherit);text-transform:inherit;text-transform:var(--forge-typography-subtitle2-secondary-text-transform,inherit);color:var(--mdc-theme-text-secondary-on-background);color:var(--forge-typography-subtitle2-secondary-color,var(--mdc-theme-text-secondary-on-background));color:rgba(0,0,0,.87);color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87));max-width:auto;max-width:var(--forge-file-picker-max-content-width,auto)}.forge-file-picker__input{display:none}.forge-file-picker__helper-text ::slotted([slot=helper-text]){-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-caption-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));line-height:1.25rem;line-height:var(--mdc-typography-caption-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-caption-font-weight,400);letter-spacing:.0333333333em;letter-spacing:var(--mdc-typography-caption-letter-spacing, .0333333333em);text-decoration:inherit;-webkit-text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-caption-text-transform,inherit);display:block;height:auto;color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54));margin-left:12px;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-caption-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:.75rem;font-size:var(--mdc-typography-caption-font-size, .75rem);line-height:1.25rem;line-height:var(--mdc-typography-caption-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-caption-font-weight,400);letter-spacing:.0333333333em;letter-spacing:var(--mdc-typography-caption-letter-spacing, .0333333333em);text-decoration:inherit;text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-caption-text-transform,inherit);text-align:start}.forge-file-picker__helper-text ::slotted([slot=helper-text])::before{display:inline-block;width:0;height:16px;content:\\\"\\\";vertical-align:0}.forge-file-picker[disabled]{background-color:#fafafa;background-color:var(--mdc-theme-background,#fafafa);border-color:#e0e0e0;border-color:var(--forge-theme-border-color,#e0e0e0);opacity:.38;cursor:unset}.forge-file-picker.compact{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;background-color:transparent;border:none;padding:0}.forge-file-picker.compact .forge-file-picker__primary,.forge-file-picker.compact .forge-file-picker__secondary{display:none}.forge-file-picker.compact .forge-file-picker__button>button{width:auto;width:var(--forge-file-picker-width,auto);background-color:transparent}.forge-file-picker:not(.compact).highlight{border-color:#3f51b5;border-color:var(--mdc-theme-primary,#3f51b5);background-color:rgba(63,81,181,.12);border-width:1px;border-style:solid}.forge-file-picker.borderless{--forge-file-picker-width:100%;border:none}.forge-file-picker.borderless:not(.compact).highlight{border:none}.forge-file-picker.borderless+.forge-file-picker__helper-text{display:none}:host{width:auto;width:var(--forge-file-picker-width,auto);height:auto;height:var(--forge-file-picker-height,auto);display:inline-block}:host([hidden]){display:none}';\n\nexport interface IFilePickerComponent extends IBaseComponent {\n accept: string | null | undefined;\n maxSize: number | null | undefined;\n capture: string | null | undefined;\n multiple: boolean;\n disabled: boolean;\n compact: boolean;\n borderless: boolean;\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'forge-file-picker': IFilePickerComponent;\n }\n\n interface HTMLElementEventMap {\n 'forge-file-picker-change': CustomEvent<IFilePickerChangeEventData>;\n }\n}\n\n/**\n * The web component class behind the `<forge-file-picker>` custom element.\n * \n * @tag forge-file-picker\n */\n@CustomElement({\n name: FILE_PICKER_CONSTANTS.elementName,\n dependencies: [ButtonComponent]\n})\nexport class FilePickerComponent extends BaseComponent implements IFilePickerComponent {\n public static get observedAttributes(): string[] {\n return [\n FILE_PICKER_CONSTANTS.attributes.ACCEPT,\n FILE_PICKER_CONSTANTS.attributes.MAX_SIZE,\n FILE_PICKER_CONSTANTS.attributes.CAPTURE,\n FILE_PICKER_CONSTANTS.attributes.MULTIPLE,\n FILE_PICKER_CONSTANTS.attributes.DISABLED,\n FILE_PICKER_CONSTANTS.attributes.COMPACT,\n FILE_PICKER_CONSTANTS.attributes.BORDERLESS\n ];\n }\n\n private _foundation: FilePickerFoundation;\n\n constructor() {\n super();\n attachShadowTemplate(this, template, styles);\n this._foundation = new FilePickerFoundation(new FilePickerAdapter(this));\n }\n\n public connectedCallback(): void {\n this._foundation.initialize();\n }\n\n public attributeChangedCallback(name: string, oldValue: string, newValue: string): void {\n switch (name) {\n case FILE_PICKER_CONSTANTS.attributes.ACCEPT:\n this.accept = newValue;\n break;\n case FILE_PICKER_CONSTANTS.attributes.MAX_SIZE:\n this.maxSize = coerceNumber(newValue);\n break;\n case FILE_PICKER_CONSTANTS.attributes.CAPTURE:\n this.capture = newValue;\n break;\n case FILE_PICKER_CONSTANTS.attributes.MULTIPLE:\n this.multiple = coerceBoolean(newValue);\n break;\n case FILE_PICKER_CONSTANTS.attributes.DISABLED:\n this.disabled = coerceBoolean(newValue);\n break;\n case FILE_PICKER_CONSTANTS.attributes.COMPACT:\n this.compact = coerceBoolean(newValue);\n break;\n case FILE_PICKER_CONSTANTS.attributes.BORDERLESS:\n this.borderless = coerceBoolean(newValue);\n break;\n }\n }\n\n /** Gets and sets the allowed file types */\n @FoundationProperty()\n public accept: string | null | undefined;\n\n /** Gets and sets the maximum allowed file size */\n @FoundationProperty()\n public maxSize: number | null | undefined;\n\n /** Gets and sets the camera to use when capturing video or images */\n @FoundationProperty()\n public capture: string | null | undefined;\n\n /** Gets and sets whether multiple files are allowed */\n @FoundationProperty()\n public multiple: boolean;\n\n /** Gets and sets whether the file picker is disabled */\n @FoundationProperty()\n public disabled: boolean;\n\n /** Gets and sets whether the file picker is compact */\n @FoundationProperty()\n public compact: boolean;\n\n /** Gets and sets whether the file picker is borderless */\n @FoundationProperty()\n public borderless: boolean;\n}\n", "import { ButtonComponentDelegate } from '../button/button-component-delegate';\nimport { BaseComponentDelegate, IBaseComponentDelegateConfig, IBaseComponentDelegateOptions } from '../core/delegates/base-component-delegate';\nimport { IFilePickerComponent } from './file-picker';\nimport { FILE_PICKER_CONSTANTS, IFilePickerChangeEventData } from './file-picker-constants';\n\nexport type FilePickerComponentDelegateProps = Partial<IFilePickerComponent>;\nexport interface IFilePickerComponentDelegateOptions extends IBaseComponentDelegateOptions {\n primaryText?: string;\n secondaryText?: string;\n helperText?: string;\n buttonText?: string;\n}\nexport interface IFilePickerComponentDelegateConfig extends IBaseComponentDelegateConfig<IFilePickerComponent, IFilePickerComponentDelegateOptions> {}\n\nexport class FilePickerComponentDelegate extends BaseComponentDelegate<IFilePickerComponent, IFilePickerComponentDelegateOptions> {\n constructor(config?: IFilePickerComponentDelegateConfig) {\n super(config);\n }\n\n protected _build(): IFilePickerComponent {\n return document.createElement(FILE_PICKER_CONSTANTS.elementName);\n }\n\n protected _configure(): void {\n if (this._config.options?.primaryText) {\n const primarySpan = document.createElement('span');\n primarySpan.slot = 'primary';\n primarySpan.textContent = this._config.options.primaryText;\n this._element.appendChild(primarySpan);\n }\n\n if (this._config.options?.secondaryText) {\n const secondarySpan = document.createElement('span');\n secondarySpan.slot = 'secondary';\n secondarySpan.textContent = this._config.options.secondaryText;\n this._element.appendChild(secondarySpan);\n }\n\n if (this._config.options?.buttonText) {\n new ButtonComponentDelegate({\n options: {\n parent: this._element,\n text: this._config.options.buttonText\n },\n props: { type: 'outlined' }\n });\n }\n\n if (this._config.options?.helperText) {\n const helperTextSpan = document.createElement('span');\n helperTextSpan.slot = 'helper-text';\n helperTextSpan.textContent = this._config.options.helperText;\n this._element.appendChild(helperTextSpan);\n }\n }\n\n public onChange(cb: (evt: IFilePickerChangeEventData) => void): void {\n this._element.addEventListener(FILE_PICKER_CONSTANTS.events.FILES_CHANGED, (evt: CustomEvent<IFilePickerChangeEventData>) => cb(evt.detail));\n }\n}\n", "import { defineCustomElement } from '@tylertech/forge-core';\n\nimport { FilePickerComponent } from './file-picker';\n\nexport * from './file-picker-adapter';\nexport * from './file-picker-constants';\nexport * from './file-picker-foundation';\nexport * from './file-picker';\nexport * from './file-picker-component-delegate';\n\nexport function defineFilePickerComponent(): void {\n defineCustomElement(FilePickerComponent);\n}\n"],
5
- "mappings": "2YAEA,GAAM,GAA2C,GAAG,eAE9C,EAAa,CACjB,OAAQ,SACR,SAAU,WACV,QAAS,UACT,SAAU,WACV,SAAU,WACV,QAAS,UACT,WAAY,YACd,EAEM,EAAU,CACd,UAAW,YACX,SAAU,WACV,QAAS,UACT,WAAY,YACd,EAEM,EAAM,CACV,UAAW,YACX,OAAQ,SACR,MAAO,OACT,EAEM,EAAY,CAChB,UAAW,aACX,OAAQ,UACR,MAAO,SACP,YAAa,cACf,EAEM,EAAS,CACb,cAAe,GAAG,UACpB,EAEa,EAAwB,CACnC,cACA,aACA,UACA,MACA,YACA,QACF,EClBO,GAAM,GAAN,aAAgC,EAAgE,CAOrG,YAAY,EAAiC,CAC3C,MAAM,CAAS,EAEf,KAAK,WAAa,EAAiB,EAAW,EAAsB,UAAU,SAAS,EACvF,KAAK,YAAc,EAAiB,EAAW,EAAsB,UAAU,WAAW,EAC1F,KAAK,OAAS,EAAiB,EAAW,EAAsB,UAAU,KAAK,EAE/E,KAAK,oBAAsB,IAAM,CAC/B,KAAK,OAAO,MAAQ,GACpB,KAAK,OAAO,MAAM,CACpB,EAEA,KAAK,WAAW,iBAAiB,QAAS,KAAK,mBAAmB,CACpE,CAEA,AAAO,2BAA2B,EAAsC,CACtE,KAAK,YAAY,iBAAiB,aAAc,CAAQ,CAC1D,CAEA,AAAO,4BAA4B,EAAsC,CACvE,KAAK,OAAO,iBAAiB,SAAU,CAAQ,CACjD,CAEA,AAAO,0BAA0B,EAA0C,CACzE,KAAK,WAAW,iBAAiB,YAAa,CAAQ,CACxD,CAEA,AAAO,0BAA0B,EAA0C,CACzE,KAAK,WAAW,iBAAiB,YAAa,CAAQ,CACxD,CAEA,AAAO,yBAAyB,EAA0C,CACx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,CACjE,CAEA,AAAU,YAAmB,CAvB/B,YAwBI,GAAI,QAAK,QAAQ,UAAb,QAAsB,YAAa,CACrC,GAAM,GAAc,SAAS,cAAc,MAAM,EACjD,EAAY,KAAO,UACnB,EAAY,YAAc,KAAK,QAAQ,QAAQ,YAC/C,KAAK,SAAS,YAAY,CAAW,CACvC,CAEA,GAAI,QAAK,QAAQ,UAAb,QAAsB,cAAe,CACvC,GAAM,GAAgB,SAAS,cAAc,MAAM,EACnD,EAAc,KAAO,YACrB,EAAc,YAAc,KAAK,QAAQ,QAAQ,cACjD,KAAK,SAAS,YAAY,CAAa,CACzC,CAYA,GAVI,QAAK,QAAQ,UAAb,QAAsB,YACxB,GAAI,GAAwB,CAC1B,QAAS,CACP,OAAQ,KAAK,SACb,KAAM,KAAK,QAAQ,QAAQ,UAC7B,EACA,MAAO,CAAE,KAAM,UAAW,CAC5B,CAAC,EAGC,QAAK,QAAQ,UAAb,QAAsB,WAAY,CACpC,GAAM,GAAiB,SAAS,cAAc,MAAM,EACpD,EAAe,KAAO,cACtB,EAAe,YAAc,KAAK,QAAQ,QAAQ,WAClD,KAAK,SAAS,YAAY,CAAc,CAC1C,CACF,CAEA,AAAO,SAAS,EAAqD,CACnE,KAAK,SAAS,iBAAiB,EAAsB,OAAO,cAAe,AAAC,GAAiD,EAAG,EAAI,MAAM,CAAC,CAC7I,CACF,ECjDO,aAA2C,CAChD,EAAoB,CAAmB,CACzC",
4
+ "sourcesContent": ["import { COMPONENT_NAME_PREFIX } from '../constants';\n\nconst elementName: keyof HTMLElementTagNameMap = `${COMPONENT_NAME_PREFIX}file-picker`;\n\nconst attributes = {\n ACCEPT: 'accept',\n MAX_SIZE: 'max-size',\n CAPTURE: 'capture',\n MULTIPLE: 'multiple',\n DISABLED: 'disabled',\n COMPACT: 'compact',\n BORDERLESS: 'borderless'\n};\n\nconst classes = {\n HIGHLIGHT: 'highlight',\n DISABLED: 'disabled',\n COMPACT: 'compact',\n BORDERLESS: 'borderless'\n};\n\nconst ids = {\n CONTAINER: 'container',\n BUTTON: 'button',\n INPUT: 'input'\n};\n\nconst selectors = {\n CONTAINER: '#container',\n BUTTON: '#button',\n INPUT: '#input',\n BUTTON_SLOT: '#button-slot'\n};\n\nconst events = {\n FILES_CHANGED: `${elementName}-change`\n};\n\nexport const FILE_PICKER_CONSTANTS = {\n elementName,\n attributes,\n classes,\n ids,\n selectors,\n events\n};\n\nexport interface IFilePickerChangeEventData {\n legalFiles?: File[];\n illegalFiles?: File[];\n}\n", "import { getShadowElement, emitEvent } from '@tylertech/forge-core';\n\nimport { IFilePickerComponent } from './file-picker';\nimport { FILE_PICKER_CONSTANTS } from './file-picker-constants';\nimport { BaseAdapter, IBaseAdapter } from '../core';\n\nexport interface IFilePickerAdapter extends IBaseAdapter {\n registerButtonSlotListener(listener: (evt: Event) => void): void;\n registerInputChangeListener(listener: (evt: Event) => void): void;\n registerDragEnterListener(listener: (evt: DragEvent) => void): void;\n registerDragLeaveListener(listener: (evt: DragEvent) => void): void;\n registerDragOverListener(listener: (evt: DragEvent) => void): void;\n registerDropListener(listener: (evt: DragEvent) => void): void;\n removeDragEnterListener(listener: (evt: DragEvent) => void): void;\n removeDragLeaveListener(listener: (evt: DragEvent) => void): void;\n removeDragOverListener(listener: (evt: DragEvent) => void): void;\n removeDropListener(listener: (evt: DragEvent) => void): void;\n initializeButton(): void;\n setHighlightState(value: boolean): void;\n setAccept(value: string | null | undefined): void;\n setCapture(value: string | null | undefined): void;\n setMultiple(value: boolean): void;\n setDisabled(value: boolean): void;\n setCompact(value: boolean): void;\n setBorderless(value: boolean): void;\n}\n\nexport class FilePickerAdapter extends BaseAdapter<IFilePickerComponent> implements IFilePickerAdapter {\n private _container: HTMLElement;\n private _buttonSlot: HTMLSlotElement;\n private _button: HTMLButtonElement;\n private _input: HTMLInputElement;\n private _inputEventListener: () => void;\n\n constructor(component: IFilePickerComponent) {\n super(component);\n\n this._container = getShadowElement(component, FILE_PICKER_CONSTANTS.selectors.CONTAINER);\n this._buttonSlot = getShadowElement(component, FILE_PICKER_CONSTANTS.selectors.BUTTON_SLOT) as HTMLSlotElement;\n this._input = getShadowElement(component, FILE_PICKER_CONSTANTS.selectors.INPUT) as HTMLInputElement;\n\n this._inputEventListener = () => {\n this._input.value = '';\n this._input.click();\n };\n\n this._container.addEventListener('click', this._inputEventListener);\n }\n\n public registerButtonSlotListener(listener: (evt: Event) => void): void {\n this._buttonSlot.addEventListener('slotchange', listener);\n }\n\n public registerInputChangeListener(listener: (evt: Event) => void): void {\n this._input.addEventListener('change', listener);\n }\n\n public registerDragEnterListener(listener: (evt: DragEvent) => void): void {\n this._container.addEventListener('dragenter', listener);\n }\n\n public registerDragLeaveListener(listener: (evt: DragEvent) => void): void {\n this._container.addEventListener('dragleave', listener);\n }\n\n public registerDragOverListener(listener: (evt: DragEvent) => void): void {\n this._container.addEventListener('dragover', listener);\n }\n\n public registerDropListener(listener: (evt: DragEvent) => void): void {\n this._container.addEventListener('drop', listener);\n }\n\n public removeDragEnterListener(listener: (evt: DragEvent) => void): void {\n this._container.removeEventListener('dragenter', listener);\n }\n\n public removeDragLeaveListener(listener: (evt: DragEvent) => void): void {\n this._container.removeEventListener('dragleave', listener);\n }\n\n public removeDragOverListener(listener: (evt: DragEvent) => void): void {\n this._container.removeEventListener('dragover', listener);\n }\n\n public removeDropListener(listener: (evt: DragEvent) => void): void {\n this._container.removeEventListener('drop', listener);\n }\n\n public initializeButton(): void {\n const button = this._component.querySelector('button') as HTMLButtonElement;\n this._button = button || undefined;\n }\n\n /**\n * Sets the highlight state of the file picker.\n * @param value True if the highlight should be applied and false if not.\n */\n public setHighlightState(value: boolean): void {\n if (this._container.classList.contains(FILE_PICKER_CONSTANTS.classes.HIGHLIGHT) !== value) {\n this._container.classList.toggle(FILE_PICKER_CONSTANTS.classes.HIGHLIGHT);\n }\n }\n\n /**\n * Sets the accept attribute of the input.\n * @param value The accept string.\n */\n public setAccept(value: string | null | undefined): void {\n if (value) {\n this._input.setAttribute('accept', value);\n } else {\n this._input.removeAttribute('accept');\n }\n }\n\n /**\n * Sets the capture attribute of the input.\n * @param value The capture string.\n */\n public setCapture(value: string | null | undefined): void {\n if (value) {\n this._input.setAttribute('capture', value);\n } else {\n this._input.removeAttribute('capture');\n }\n }\n\n /**\n * Sets the multiple attribute of the input.\n * @param value The multiple state.\n */\n public setMultiple(value: boolean): void {\n if (value) {\n this._input.setAttribute('multiple', '');\n } else {\n this._input.removeAttribute('multiple');\n }\n }\n\n /**\n * Sets the disabled state of the file picker.\n * @param value The disabled state.\n */\n public setDisabled(value: boolean): void {\n if (value) {\n this._container.removeEventListener('click', this._inputEventListener);\n this._button.setAttribute('disabled', '');\n this._container.setAttribute('disabled', '');\n } else {\n this._container.addEventListener('click', this._inputEventListener);\n this._button.removeAttribute('disabled');\n this._container.removeAttribute('disabled');\n }\n }\n\n /**\n * Sets the compact state of the file picker.\n * @param value The compact state.\n */\n public setCompact(value: boolean): void {\n if (this._container.classList.contains(FILE_PICKER_CONSTANTS.classes.COMPACT) !== value) {\n this._container.classList.toggle(FILE_PICKER_CONSTANTS.classes.COMPACT);\n }\n }\n\n /**\n * Sets the borderless state of the file picker.\n * @param value The borderless state.\n */\n public setBorderless(value: boolean): void {\n if (this._container.classList.contains(FILE_PICKER_CONSTANTS.classes.BORDERLESS) !== value) {\n this._container.classList.toggle(FILE_PICKER_CONSTANTS.classes.BORDERLESS);\n }\n }\n}\n", "import { ICustomElementFoundation } from '@tylertech/forge-core';\n\nimport { IFilePickerAdapter } from './file-picker-adapter';\nimport { FILE_PICKER_CONSTANTS, IFilePickerChangeEventData } from './file-picker-constants';\n\nexport interface IFilePickerFoundation extends ICustomElementFoundation {\n accept: string | null | undefined;\n maxSize: number | null | undefined;\n capture: string | null | undefined;\n multiple: boolean;\n disabled: boolean;\n compact: boolean;\n borderless: boolean;\n}\n\nexport class FilePickerFoundation implements IFilePickerFoundation {\n private _accept: string | null | undefined = null;\n private _maxSize: number | null | undefined = null;\n private _capture: string | null | undefined = null;\n private _multiple = false;\n private _disabled = false;\n private _compact = false;\n private _borderless = false;\n private _buttonSlotListener: (evt: Event) => void;\n private _inputChangeListener: (evt: Event) => void;\n private _dragEnterListener: (evt: DragEvent) => void;\n private _dragLeaveListener: (evt: DragEvent) => void;\n private _dragOverListener: (evt: DragEvent) => void;\n private _dropListener: (evt: DragEvent) => void;\n\n constructor(private _adapter: IFilePickerAdapter) {\n this._buttonSlotListener = evt => this._onButtonSlotChanged(evt);\n this._inputChangeListener = evt => this._onInputChange(evt);\n this._dragEnterListener = evt => this._onDragEnter(evt);\n this._dragLeaveListener = evt => this._onDragLeave(evt);\n this._dragOverListener = evt => this._onDragOver(evt);\n this._dropListener = evt => this._onDrop(evt);\n\n this._adapter.registerButtonSlotListener(this._buttonSlotListener);\n this._adapter.registerInputChangeListener(this._inputChangeListener);\n if (!this._compact) {\n this._registerDragListeners();\n }\n }\n\n public initialize(): void {\n this._adapter.initializeButton();\n }\n\n private _onButtonSlotChanged(evt: Event): void {\n this._adapter.initializeButton();\n }\n\n private _onInputChange(evt: Event): void {\n const files = (evt.target as HTMLInputElement).files;\n if (files) {\n this._handleFiles(files);\n }\n }\n\n private _onDragEnter(evt: DragEvent): void {\n this._handleDragEvent(evt, true);\n }\n\n private _onDragLeave(evt: DragEvent): void {\n this._handleDragEvent(evt, false);\n }\n\n private _onDragOver(evt: DragEvent): void {\n this._handleDragEvent(evt, true);\n }\n\n private _onDrop(evt: DragEvent): void {\n this._handleDragEvent(evt, false);\n\n if (!this._disabled) {\n const dataTransfer = evt.dataTransfer;\n if (dataTransfer) {\n const files = dataTransfer.files;\n this._handleFiles(files);\n }\n }\n }\n\n private _registerDragListeners(): void {\n this._adapter.registerDragEnterListener(this._dragEnterListener);\n this._adapter.registerDragLeaveListener(this._dragLeaveListener);\n this._adapter.registerDragOverListener(this._dragOverListener);\n this._adapter.registerDropListener(this._dropListener);\n }\n\n private _removeDragListeners(): void {\n this._adapter.removeDragEnterListener(this._dragEnterListener);\n this._adapter.removeDragLeaveListener(this._dragLeaveListener);\n this._adapter.removeDragOverListener(this._dragOverListener);\n this._adapter.removeDropListener(this._dropListener);\n }\n\n private _handleFiles(fileList: FileList): void {\n let data: IFilePickerChangeEventData = {};\n if (fileList) {\n const sortedFiles = this._sortFiles(fileList);\n let files = sortedFiles.legalFiles || null;\n\n // Ensure that we can only drop 1 file if not in multiple mode\n if (!this._multiple && files && files.length > 1) {\n files = files.splice(1);\n }\n\n data = sortedFiles;\n }\n this._adapter.emitHostEvent(FILE_PICKER_CONSTANTS.events.FILES_CHANGED, data);\n }\n\n private _sortFiles(files: FileList): IFilePickerChangeEventData {\n let legalFiles: File[] = [];\n const illegalFiles: File[] = [];\n\n if (!this._accept && !this.maxSize) {\n legalFiles = Array.from(files);\n return { legalFiles, illegalFiles };\n }\n\n const formats = this._accept ? this._accept.split(',').map(f => f.trim().toLowerCase()) : [''];\n\n // eslint-disable-next-line @typescript-eslint/prefer-for-of\n for (let i = 0; i < files.length; i++) {\n if (!formats.some(f => {\n return files[i].type.toLowerCase().match(f) || files[i].name.toLowerCase().match('\\\\' + f);\n }) || (this._maxSize && files[i].size > this._maxSize)) {\n illegalFiles.push(files[i]);\n } else {\n legalFiles.push(files[i]);\n }\n }\n\n return { legalFiles, illegalFiles };\n }\n\n private _handleDragEvent(evt: DragEvent, isOverTarget: boolean): void {\n if (!this._disabled) {\n evt.preventDefault();\n evt.stopPropagation();\n this._adapter.setHighlightState(isOverTarget);\n }\n }\n\n /** Get and set the allowed file types */\n public get accept(): string | null | undefined {\n return this._accept;\n }\n public set accept(value: string | null | undefined) {\n if (this._accept !== value) {\n this._accept = value;\n this._adapter.setAccept(value);\n if (value) {\n this._adapter.setHostAttribute(FILE_PICKER_CONSTANTS.attributes.ACCEPT, value);\n } else {\n this._adapter.removeHostAttribute(FILE_PICKER_CONSTANTS.attributes.ACCEPT);\n }\n }\n }\n\n /** Get and set the maximum allowed file size */\n public get maxSize(): number | null | undefined {\n return this._maxSize;\n }\n public set maxSize(value: number | null | undefined) {\n if (this._maxSize !== value) {\n this._maxSize = value;\n if (value) {\n this._adapter.setHostAttribute(FILE_PICKER_CONSTANTS.attributes.MAX_SIZE, value.toString());\n } else {\n this._adapter.removeHostAttribute(FILE_PICKER_CONSTANTS.attributes.MAX_SIZE);\n }\n }\n }\n\n /** Get and set the camera to use when capturing video or images */\n public get capture(): string | null | undefined {\n return this._capture;\n }\n public set capture(value: string | null | undefined) {\n if (this._capture !== value) {\n this._capture = value;\n this._adapter.setCapture(value);\n if (value) {\n this._adapter.setHostAttribute(FILE_PICKER_CONSTANTS.attributes.CAPTURE, value);\n } else {\n this._adapter.removeHostAttribute(FILE_PICKER_CONSTANTS.attributes.CAPTURE);\n }\n }\n }\n\n /** Get and set whether multiple files are allowed */\n public get multiple(): boolean {\n return this._multiple;\n }\n public set multiple(value: boolean) {\n if (this._multiple !== value) {\n this._multiple = value;\n this._adapter.setMultiple(value);\n if (value) {\n this._adapter.setHostAttribute(FILE_PICKER_CONSTANTS.attributes.MULTIPLE);\n } else {\n this._adapter.removeHostAttribute(FILE_PICKER_CONSTANTS.attributes.MULTIPLE);\n }\n }\n }\n\n /** Get and set whether the file picker is disabled */\n public get disabled(): boolean {\n return this._disabled;\n }\n public set disabled(value: boolean) {\n if (this._disabled !== value) {\n this._disabled = value;\n this._adapter.setDisabled(value);\n if (value) {\n this._adapter.setHostAttribute(FILE_PICKER_CONSTANTS.attributes.DISABLED);\n } else {\n this._adapter.removeHostAttribute(FILE_PICKER_CONSTANTS.attributes.DISABLED);\n }\n }\n }\n\n /** Get and set whether the file picker is compact */\n public get compact(): boolean {\n return this._compact;\n }\n public set compact(value: boolean) {\n if (this._compact !== value) {\n this._compact = value;\n this._adapter.setCompact(value);\n if (value) {\n this._adapter.setHostAttribute(FILE_PICKER_CONSTANTS.attributes.COMPACT);\n this._removeDragListeners();\n } else {\n this._adapter.removeHostAttribute(FILE_PICKER_CONSTANTS.attributes.COMPACT);\n this._registerDragListeners();\n }\n }\n }\n\n /** Get and set whether the file picker is borderless */\n public get borderless(): boolean {\n return this._borderless;\n }\n public set borderless(value: boolean) {\n if (this._borderless !== value) {\n this._borderless = value;\n this._adapter.setBorderless(value);\n if (value) {\n this._adapter.setHostAttribute(FILE_PICKER_CONSTANTS.attributes.BORDERLESS);\n } else {\n this._adapter.removeHostAttribute(FILE_PICKER_CONSTANTS.attributes.BORDERLESS);\n }\n }\n }\n}\n", "import { attachShadowTemplate, coerceBoolean, coerceNumber, CustomElement, FoundationProperty } from '@tylertech/forge-core';\nimport { ButtonComponent } from '../button';\nimport { BaseComponent, IBaseComponent } from '../core/base/base-component';\nimport { FilePickerAdapter } from './file-picker-adapter';\nimport { FILE_PICKER_CONSTANTS, IFilePickerChangeEventData } from './file-picker-constants';\nimport { FilePickerFoundation } from './file-picker-foundation';\n\nconst template = '<template><form class=\\\"forge-file-picker\\\" id=\\\"container\\\" part=\\\"form\\\"><div class=\\\"forge-file-picker__primary\\\" id=\\\"primary\\\" part=\\\"primary\\\"><slot name=\\\"primary\\\"></slot></div><slot id=\\\"button-slot\\\"></slot><div class=\\\"forge-file-picker__secondary\\\" id=\\\"secondary\\\" part=\\\"secondary\\\"><slot name=\\\"secondary\\\"></slot></div><input type=\\\"file\\\" class=\\\"forge-file-picker__input\\\" id=\\\"input\\\" part=\\\"input\\\"></form><div class=\\\"forge-file-picker__helper-text\\\" part=\\\"helper-text-container\\\"><slot name=\\\"helper-text\\\"></slot></div></template>';\nconst styles = '.forge-file-picker{-webkit-box-sizing:border-box;box-sizing:border-box;width:100%;height:100%;background-color:rgba(189,189,189,.12);border:1px dashed #e0e0e0;display:grid;-webkit-box-pack:center;justify-content:center;align-content:center;gap:16px;padding:16px;text-align:center;cursor:pointer}.forge-file-picker__primary{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-subtitle1-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:1rem;font-size:var(--mdc-typography-subtitle1-font-size, 1rem);line-height:1.75rem;line-height:var(--mdc-typography-subtitle1-line-height, 1.75rem);font-weight:400;font-weight:var(--mdc-typography-subtitle1-font-weight,400);letter-spacing:.009375em;letter-spacing:var(--mdc-typography-subtitle1-letter-spacing, .009375em);text-decoration:inherit;-webkit-text-decoration:var(--mdc-typography-subtitle1-text-decoration,inherit);text-decoration:var(--mdc-typography-subtitle1-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-subtitle1-text-transform,inherit);color:rgba(0,0,0,.87);color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87));max-width:auto;max-width:var(--forge-file-picker-max-content-width,auto)}.forge-file-picker__secondary{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-size:.875rem;font-size:var(--forge-typography-subtitle2-secondary-font-size, .875rem);line-height:1.375rem;line-height:var(--forge-typography-subtitle2-secondary-line-height, 1.375rem);font-weight:400;font-weight:var(--forge-typography-subtitle2-secondary-font-weight,400);letter-spacing:.0087500001em;letter-spacing:var(--forge-typography-subtitle2-secondary-letter-spacing, .0087500001em);text-decoration:inherit;-webkit-text-decoration:var(--forge-typography-subtitle2-secondary-text-decoration,inherit);text-decoration:var(--forge-typography-subtitle2-secondary-text-decoration,inherit);text-transform:inherit;text-transform:var(--forge-typography-subtitle2-secondary-text-transform,inherit);color:var(--mdc-theme-text-secondary-on-background);color:var(--forge-typography-subtitle2-secondary-color,var(--mdc-theme-text-secondary-on-background));color:rgba(0,0,0,.87);color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87));max-width:auto;max-width:var(--forge-file-picker-max-content-width,auto)}.forge-file-picker__input{display:none}.forge-file-picker__helper-text ::slotted([slot=helper-text]){-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-caption-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));line-height:1.25rem;line-height:var(--mdc-typography-caption-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-caption-font-weight,400);letter-spacing:.0333333333em;letter-spacing:var(--mdc-typography-caption-letter-spacing, .0333333333em);text-decoration:inherit;-webkit-text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-caption-text-transform,inherit);display:block;min-height:1.5rem;line-height:normal;padding-top:4px;-webkit-box-sizing:border-box;box-sizing:border-box;color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54));margin-left:12px;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-caption-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:.75rem;font-size:var(--mdc-typography-caption-font-size, .75rem);line-height:1.25rem;line-height:var(--mdc-typography-caption-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-caption-font-weight,400);letter-spacing:.0333333333em;letter-spacing:var(--mdc-typography-caption-letter-spacing, .0333333333em);text-decoration:inherit;text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-caption-text-transform,inherit);text-align:start}.forge-file-picker[disabled]{background-color:#fafafa;background-color:var(--mdc-theme-background,#fafafa);border-color:#e0e0e0;border-color:var(--forge-theme-border-color,#e0e0e0);opacity:.38;cursor:unset}.forge-file-picker.compact{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;background-color:transparent;border:none;padding:0}.forge-file-picker.compact .forge-file-picker__primary,.forge-file-picker.compact .forge-file-picker__secondary{display:none}.forge-file-picker.compact .forge-file-picker__button>button{width:auto;width:var(--forge-file-picker-width,auto);background-color:transparent}.forge-file-picker:not(.compact).highlight{border-color:#3f51b5;border-color:var(--mdc-theme-primary,#3f51b5);background-color:rgba(63,81,181,.12);border-width:1px;border-style:solid}.forge-file-picker.borderless{--forge-file-picker-width:100%;border:none}.forge-file-picker.borderless:not(.compact).highlight{border:none}.forge-file-picker.borderless+.forge-file-picker__helper-text{display:none}:host{width:auto;width:var(--forge-file-picker-width,auto);height:auto;height:var(--forge-file-picker-height,auto);display:inline-block}:host([hidden]){display:none}';\n\nexport interface IFilePickerComponent extends IBaseComponent {\n accept: string | null | undefined;\n maxSize: number | null | undefined;\n capture: string | null | undefined;\n multiple: boolean;\n disabled: boolean;\n compact: boolean;\n borderless: boolean;\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'forge-file-picker': IFilePickerComponent;\n }\n\n interface HTMLElementEventMap {\n 'forge-file-picker-change': CustomEvent<IFilePickerChangeEventData>;\n }\n}\n\n/**\n * The web component class behind the `<forge-file-picker>` custom element.\n * \n * @tag forge-file-picker\n */\n@CustomElement({\n name: FILE_PICKER_CONSTANTS.elementName,\n dependencies: [ButtonComponent]\n})\nexport class FilePickerComponent extends BaseComponent implements IFilePickerComponent {\n public static get observedAttributes(): string[] {\n return [\n FILE_PICKER_CONSTANTS.attributes.ACCEPT,\n FILE_PICKER_CONSTANTS.attributes.MAX_SIZE,\n FILE_PICKER_CONSTANTS.attributes.CAPTURE,\n FILE_PICKER_CONSTANTS.attributes.MULTIPLE,\n FILE_PICKER_CONSTANTS.attributes.DISABLED,\n FILE_PICKER_CONSTANTS.attributes.COMPACT,\n FILE_PICKER_CONSTANTS.attributes.BORDERLESS\n ];\n }\n\n private _foundation: FilePickerFoundation;\n\n constructor() {\n super();\n attachShadowTemplate(this, template, styles);\n this._foundation = new FilePickerFoundation(new FilePickerAdapter(this));\n }\n\n public connectedCallback(): void {\n this._foundation.initialize();\n }\n\n public attributeChangedCallback(name: string, oldValue: string, newValue: string): void {\n switch (name) {\n case FILE_PICKER_CONSTANTS.attributes.ACCEPT:\n this.accept = newValue;\n break;\n case FILE_PICKER_CONSTANTS.attributes.MAX_SIZE:\n this.maxSize = coerceNumber(newValue);\n break;\n case FILE_PICKER_CONSTANTS.attributes.CAPTURE:\n this.capture = newValue;\n break;\n case FILE_PICKER_CONSTANTS.attributes.MULTIPLE:\n this.multiple = coerceBoolean(newValue);\n break;\n case FILE_PICKER_CONSTANTS.attributes.DISABLED:\n this.disabled = coerceBoolean(newValue);\n break;\n case FILE_PICKER_CONSTANTS.attributes.COMPACT:\n this.compact = coerceBoolean(newValue);\n break;\n case FILE_PICKER_CONSTANTS.attributes.BORDERLESS:\n this.borderless = coerceBoolean(newValue);\n break;\n }\n }\n\n /** Gets and sets the allowed file types */\n @FoundationProperty()\n public accept: string | null | undefined;\n\n /** Gets and sets the maximum allowed file size */\n @FoundationProperty()\n public maxSize: number | null | undefined;\n\n /** Gets and sets the camera to use when capturing video or images */\n @FoundationProperty()\n public capture: string | null | undefined;\n\n /** Gets and sets whether multiple files are allowed */\n @FoundationProperty()\n public multiple: boolean;\n\n /** Gets and sets whether the file picker is disabled */\n @FoundationProperty()\n public disabled: boolean;\n\n /** Gets and sets whether the file picker is compact */\n @FoundationProperty()\n public compact: boolean;\n\n /** Gets and sets whether the file picker is borderless */\n @FoundationProperty()\n public borderless: boolean;\n}\n", "import { ButtonComponentDelegate } from '../button/button-component-delegate';\nimport { BaseComponentDelegate, IBaseComponentDelegateConfig, IBaseComponentDelegateOptions } from '../core/delegates/base-component-delegate';\nimport { IFilePickerComponent } from './file-picker';\nimport { FILE_PICKER_CONSTANTS, IFilePickerChangeEventData } from './file-picker-constants';\n\nexport type FilePickerComponentDelegateProps = Partial<IFilePickerComponent>;\nexport interface IFilePickerComponentDelegateOptions extends IBaseComponentDelegateOptions {\n primaryText?: string;\n secondaryText?: string;\n helperText?: string;\n buttonText?: string;\n}\nexport interface IFilePickerComponentDelegateConfig extends IBaseComponentDelegateConfig<IFilePickerComponent, IFilePickerComponentDelegateOptions> {}\n\nexport class FilePickerComponentDelegate extends BaseComponentDelegate<IFilePickerComponent, IFilePickerComponentDelegateOptions> {\n constructor(config?: IFilePickerComponentDelegateConfig) {\n super(config);\n }\n\n protected _build(): IFilePickerComponent {\n return document.createElement(FILE_PICKER_CONSTANTS.elementName);\n }\n\n protected _configure(): void {\n if (this._config.options?.primaryText) {\n const primarySpan = document.createElement('span');\n primarySpan.slot = 'primary';\n primarySpan.textContent = this._config.options.primaryText;\n this._element.appendChild(primarySpan);\n }\n\n if (this._config.options?.secondaryText) {\n const secondarySpan = document.createElement('span');\n secondarySpan.slot = 'secondary';\n secondarySpan.textContent = this._config.options.secondaryText;\n this._element.appendChild(secondarySpan);\n }\n\n if (this._config.options?.buttonText) {\n new ButtonComponentDelegate({\n options: {\n parent: this._element,\n text: this._config.options.buttonText\n },\n props: { type: 'outlined' }\n });\n }\n\n if (this._config.options?.helperText) {\n const helperTextSpan = document.createElement('span');\n helperTextSpan.slot = 'helper-text';\n helperTextSpan.textContent = this._config.options.helperText;\n this._element.appendChild(helperTextSpan);\n }\n }\n\n public onChange(cb: (evt: IFilePickerChangeEventData) => void): void {\n this._element.addEventListener(FILE_PICKER_CONSTANTS.events.FILES_CHANGED, (evt: CustomEvent<IFilePickerChangeEventData>) => cb(evt.detail));\n }\n}\n", "import { defineCustomElement } from '@tylertech/forge-core';\n\nimport { FilePickerComponent } from './file-picker';\n\nexport * from './file-picker-adapter';\nexport * from './file-picker-constants';\nexport * from './file-picker-foundation';\nexport * from './file-picker';\nexport * from './file-picker-component-delegate';\n\nexport function defineFilePickerComponent(): void {\n defineCustomElement(FilePickerComponent);\n}\n"],
5
+ "mappings": "2YAEA,GAAM,GAA2C,GAAG,eAE9C,EAAa,CACjB,OAAQ,SACR,SAAU,WACV,QAAS,UACT,SAAU,WACV,SAAU,WACV,QAAS,UACT,WAAY,YACd,EAEM,EAAU,CACd,UAAW,YACX,SAAU,WACV,QAAS,UACT,WAAY,YACd,EAEM,EAAM,CACV,UAAW,YACX,OAAQ,SACR,MAAO,OACT,EAEM,EAAY,CAChB,UAAW,aACX,OAAQ,UACR,MAAO,SACP,YAAa,cACf,EAEM,EAAS,CACb,cAAe,GAAG,UACpB,EAEa,EAA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UAC7B,EACA,MAAO,CAAE,KAAM,UAAW,CAC5B,CAAC,EAGC,QAAK,QAAQ,UAAb,QAAsB,WAAY,CACpC,GAAM,GAAiB,SAAS,cAAc,MAAM,EACpD,EAAe,KAAO,cACtB,EAAe,YAAc,KAAK,QAAQ,QAAQ,WAClD,KAAK,SAAS,YAAY,CAAc,CAC1C,CACF,CAEA,AAAO,SAAS,EAAqD,CACnE,KAAK,SAAS,iBAAiB,EAAsB,OAAO,cAAe,AAAC,GAAiD,EAAG,EAAI,MAAM,CAAC,CAC7I,CACF,ECjDO,aAA2C,CAChD,EAAoB,CAAmB,CACzC",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2022 Tyler Technologies, Inc.
4
+ * License: Apache-2.0
5
+ */
6
+ import{a as w,b as k,c as C}from"./chunk.RPPBBBYG.js";import{e as L}from"./chunk.Y6MPWPZU.js";import{a as E}from"./chunk.24D46RLZ.js";import{a as _,b as y}from"./chunk.BSZ2LBJX.js";import{a as v,e as x,g as s}from"./chunk.HN4PXH3D.js";import{s as u}from"./chunk.R4NDFXVA.js";import{f as h}from"./chunk.MCIQXNKY.js";var g=`${y}chip-field`,M={ROOT:"forge-chip-field"},n={LABEL:"label",HELPER_TEXT:"helper-text",MEMBER:"member"},I={ROOT:`.${M.ROOT}`,INPUT_CONTAINER:".forge-field__input-container",INPUT:"input",LABEL:`[slot=${n.LABEL}]`,HELPER_TEXT:`[slot=${n.HELPER_TEXT}]`,MEMBER:`[slot=${n.MEMBER}]`,LABEL_SLOT:`slot[name=${n.LABEL}]`,MEMBER_SLOT:`slot[name=${n.MEMBER}]`},z={MEMBER_ADDED:`${g}-member-added`,MEMBER_REMOVED:`${g}-member-removed`},i={elementName:g,classes:M,slots:n,selectors:I,events:z};var d=class extends w{constructor(e){super(e)}initialize(){super.initialize(i.selectors.ROOT),this._memberSlot=s(this._component,i.selectors.MEMBER_SLOT),this._inputContainerElement=s(this._component,i.selectors.INPUT_CONTAINER)}addRootListener(e,o){this._rootElement.addEventListener(e,o)}removeRootListener(e,o){this._rootElement.removeEventListener(e,o)}addMemberSlotListener(e){this._memberSlot.addEventListener("slotchange",e)}removeMemberSlotListener(e){this._memberSlot&&this._memberSlot.removeEventListener("slotchange",e)}addInputContainerListener(e,o){this._inputContainerElement.addEventListener(e,o)}removeInputContainerListener(e,o){this._inputContainerElement.removeEventListener(e,o)}fieldHasValue(){return!!this._component.querySelector(i.selectors.MEMBER)||super.inputHasValue()}focusInput(){!this._inputElement||this._inputElement.focus()}getSlottedMemberElements(){return this._component.querySelectorAll(i.selectors.MEMBER)}};var a=class extends k{constructor(e){super(e);this._adapter=e;this._memberSlotListener=()=>this._onMemberSlotChanged(),this._inputContainerMouseDownListener=o=>this._onInputContainerMouseDown(o),this._handleRootKeyDown=o=>this._onRootKeyDown(o),this._handleKeyDown=o=>this._onKeyDown(o)}initialize(){super.initialize(),this._adapter.addMemberSlotListener(this._memberSlotListener),this._adapter.addInputContainerListener("mousedown",this._inputContainerMouseDownListener),this._adapter.addRootListener("keydown",this._handleRootKeyDown),this._adapter.addInputListener("keydown",this._handleKeyDown)}disconnect(){super.disconnect(),this._adapter.removeMemberSlotListener(this._memberSlotListener),this._adapter.removeInputContainerListener("mousedown",this._inputContainerMouseDownListener),this._adapter.removeRootListener("keydown",this._handleRootKeyDown),this._adapter.removeInputListener("keydown",this._handleKeyDown)}_onInputContainerMouseDown(e){e.preventDefault(),this._adapter.focusInput()}_onBlur(e){let o=e.target;o.value="",super._onBlur(e)}_onRootKeyDown(e){if(!this._adapter.inputHasValue())switch(e.key){case"Right":case"ArrowRight":this._focusNextMember();break;case"Left":case"ArrowLeft":this._focusPreviousMember();break;case"Backspace":case"Delete":case"Del":this._removeMember();break;default:break}}_onKeyDown(e){let o=e.target;switch(e.key){case"Enter":this._addMember(o);break;case"Esc":case"Escape":case"Tab":o.value="";break;default:break}}_focusNextMember(){let e=this._adapter.getSlottedMemberElements();if(!(e.length<1||this._adapter.inputHasFocus()))for(let o=0;o<e.length;o++){let t=e.item(o),r=e.item(o+1);if(this._memberIsActive(t))if(r){r.focus();break}else this._adapter.focusInput()}}_focusPreviousMember(){let e=this._adapter.getSlottedMemberElements();if(!(e.length<1)){if(this._adapter.inputHasFocus()){e[e.length-1].focus();return}for(let o=0;o<e.length;o++){let t=e.item(o-1),r=e.item(o);if(this._memberIsActive(r)&&t){t.focus();break}}}}_memberIsActive(e){return u()===e||e.hasAttribute("focused")}_getActiveMember(){let e=this._adapter.getSlottedMemberElements();for(let o=0;o<e.length;o++){let t=e.item(o);if(this._memberIsActive(t))return t}return null}_addMember(e){let o=e.value.trim();o&&o.length>0&&this._adapter.emitHostEvent(i.events.MEMBER_ADDED,o),e.value=""}_removeMember(){let e=this._getActiveMember();if(!e){let o=this._adapter.getSlottedMemberElements();e=o.item(o.length-1)}!e||(this._focusNextMember(),this._adapter.emitHostEvent(i.events.MEMBER_REMOVED,e))}_onMemberSlotChanged(){this.floatLabel(this._adapter.fieldHasValue()||this._adapter.inputHasFocus()),this._adapter.getSlottedMemberElements().forEach(e=>e.tabIndex=-1)}};var F='<template><div class="forge-chip-field__wrapper" part="root"><div class="forge-chip-field forge-field" part="container"><slot name="leading"></slot><div class="forge-field__label-input-container" part="label-input-container"><slot name="label"></slot><div class="forge-field__input-container" part="input-container"><slot name="member"></slot><slot></slot></div></div><slot name="trailing"></slot><div class="forge-field__addon-end-container" part="addon-end-container"><slot name="addon-end"></slot></div></div><slot name="helper-text"></slot></div></template>',D='.forge-field::before{content:"";display:-webkit-box;display:flex;position:absolute;top:0;right:0;left:0;z-index:-1;-webkit-box-sizing:border-box;box-sizing:border-box;width:100%;max-width:100%;height:100%;pointer-events:none;border-style:solid;border-width:1px;-webkit-transition:border-color .2s 0s cubic-bezier(0, 0, .2, 1);transition:border-color .2s 0s cubic-bezier(0, 0, .2, 1);background-color:transparent;background-color:var(--forge-chip-field-theme-background,transparent);text-align:left}.forge-field[dir=rtl]::before,[dir=rtl] .forge-field::before{text-align:right}.forge-field:not(.forge-field--disabled):not(.forge-field--invalid):not(.forge-field--focused)::before{border-color:rgba(0,0,0,.38);border-color:var(--mdc-theme-text-icon-on-background,rgba(0,0,0,.38))}.forge-field:not(.forge-field--disabled):not(.forge-field--invalid):not(.forge-field--focused):hover::before{border-color:rgba(0,0,0,.87);border-color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87))}.forge-field--focused:not(.forge-field--invalid):not(.forge-field--disabled)::before{border-color:#3f51b5;border-color:var(--mdc-theme-primary,#3f51b5)}.forge-field--invalid:not(.forge-field--disabled)::before{border-color:#b00020;border-color:var(--mdc-theme-error,#b00020)}.forge-field--invalid:not(.forge-field--disabled):not(.forge-field--focused):hover::before{border-color:#db8a98;border-color:var(--forge-theme-error-hover,#db8a98)}.forge-field--disabled::before{border-color:rgba(0,0,0,.12);border-color:var(--mdc-theme-text-disabled-on-background,rgba(0,0,0,.12))}.forge-field:not(.forge-field--shape-rounded){border-radius:4px}.forge-field:not(.forge-field--shape-rounded)::before{border-radius:4px}.forge-field--shape-rounded{border-radius:28px}.forge-field--shape-rounded::before{border-radius:28px}.forge-field--disabled::before{background-color:#f5f5f5;background-color:var(--forge-theme-form-field-disabled-on-background,#f5f5f5)}.forge-field--focused::before{border-color:#3f51b5;border-color:var(--mdc-theme-primary,#3f51b5);border-width:2px}.forge-field__label-input-container{position:relative;-webkit-box-flex:1;flex:1 1 0.0001px;height:100%;display:-webkit-box;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row;-webkit-box-align:center;align-items:center;min-width:0}.forge-field ::slotted(label){color:rgba(0,0,0,.65);color:var(--forge-theme-form-field-label-on-background,rgba(0,0,0,.65));pointer-events:none;right:0;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-subtitle1-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-weight:400;font-weight:var(--mdc-typography-subtitle1-font-weight,400);letter-spacing:.009375em;letter-spacing:var(--mdc-typography-subtitle1-letter-spacing, .009375em);text-decoration:inherit;-webkit-text-decoration:var(--mdc-typography-subtitle1-text-decoration,inherit);text-decoration:var(--mdc-typography-subtitle1-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-subtitle1-text-transform,inherit);font-size:var(--mdc-typography-subtitle1-font-size, 1rem);position:absolute;left:0;-webkit-transform-origin:left top;transform-origin:left top;line-height:1.1rem;text-align:left;text-overflow:ellipsis;white-space:nowrap;cursor:text;overflow:hidden;will-change:transform;-webkit-transition:color 150ms cubic-bezier(.4, 0, .2, 1),-webkit-transform 150ms cubic-bezier(.4, 0, .2, 1);transition:color 150ms cubic-bezier(.4, 0, .2, 1),-webkit-transform 150ms cubic-bezier(.4, 0, .2, 1);transition:transform 150ms cubic-bezier(.4, 0, .2, 1),color 150ms cubic-bezier(.4, 0, .2, 1);transition:transform 150ms cubic-bezier(.4, 0, .2, 1),color 150ms cubic-bezier(.4, 0, .2, 1),-webkit-transform 150ms cubic-bezier(.4, 0, .2, 1)}.forge-field ::slotted(label[dir=rtl]),[dir=rtl] .forge-field ::slotted(label){right:0;left:auto;-webkit-transform-origin:right top;transform-origin:right top;text-align:right}.forge-field--dense:not(.forge-field--roomy) ::slotted(label){display:none}.forge-field--required ::slotted(label)::after{content:none}.forge-field--required ::slotted(label)::before{color:#b00020;color:var(--mdc-theme-error,#b00020);content:"*";margin-right:4px}.forge-field:not(.forge-field--dense):not(.forge-field--roomy) ::slotted(label){font-size:1rem}.forge-field--roomy:not(.forge-field--dense) ::slotted(label){font-size:1rem}.forge-field--disabled ::slotted(label){color:rgba(0,0,0,.38);color:var(--forge-theme-label-disabled-on-background,rgba(0,0,0,.38))}.forge-field--invalid:not(.forge-field--disabled) ::slotted(label){color:#b00020;color:var(--mdc-theme-error,#b00020)}.forge-field--focused:not(.forge-field--invalid):not(.forge-field--disabled) ::slotted(label){color:#3f51b5;color:var(--mdc-theme-primary,#3f51b5)}.forge-field:not(.forge-field--dense):not(.forge-field--roomy) ::slotted(label){top:1rem}.forge-field--roomy:not(.forge-field--dense) ::slotted(label){top:1.285rem}.forge-field:not(.forge-field--shape-rounded):not(.forge-field--leading) ::slotted(label){left:12px!important}.forge-field--shape-rounded:not(.forge-field--leading) ::slotted(label){left:32px!important}.forge-field:not(.forge-field--trailing):not(.forge-field--addon-end):not(.forge-field--shape-rounded) ::slotted(label){padding-right:12px}.forge-field:not(.forge-field--trailing):not(.forge-field--addon-end).forge-field--shape-rounded ::slotted(label){padding-right:32px}.forge-field ::slotted(label.forge-floating-label--float-above){color:rgba(0,0,0,.65);color:var(--forge-theme-form-field-label-on-background,rgba(0,0,0,.65))}.forge-field--disabled ::slotted(label.forge-floating-label--float-above){color:rgba(0,0,0,.6);color:var(--forge-theme-form-field-text-disabled-on-background,rgba(0,0,0,.6))}.forge-field--invalid:not(.forge-field--disabled) ::slotted(label.forge-floating-label--float-above){color:#b00020;color:var(--mdc-theme-error,#b00020)}.forge-field--focused:not(.forge-field--invalid):not(.forge-field--disabled) ::slotted(label.forge-floating-label--float-above){color:#3f51b5;color:var(--mdc-theme-primary,#3f51b5)}.forge-field:not(.forge-field--dense):not(.forge-field--roomy) ::slotted(label.forge-floating-label--float-above){-webkit-transform:translateY(-.54rem) scale(.8125);transform:translateY(-.54rem) scale(.8125);cursor:auto}.forge-field--roomy:not(.forge-field--dense) ::slotted(label.forge-floating-label--float-above){-webkit-transform:translateY(-.72rem) scale(.8125);transform:translateY(-.72rem) scale(.8125);cursor:auto}.forge-field:not(.forge-field--dense):not(.forge-field--roomy) ::slotted(label.forge-floating-label--float-above.forge-floating-label--float-above-end-keyframe){-webkit-transition:none;transition:none;font-size:.8125rem;-webkit-transform:translateY(-.62rem) scale(1);transform:translateY(-.62rem) scale(1);cursor:auto}.forge-field--roomy:not(.forge-field--dense) ::slotted(label.forge-floating-label--float-above.forge-floating-label--float-above-end-keyframe){-webkit-transition:none;transition:none;font-size:.8125rem;-webkit-transform:translateY(-.8rem) scale(1);transform:translateY(-.8rem) scale(1);cursor:auto}.forge-field:not(.forge-field--dense):not(.forge-field--roomy) ::slotted(label.forge-floating-label--unfloat-above-start-keyframe){-webkit-transition:none;transition:none;font-size:1rem;-webkit-transform:translateY(-.62rem) scale(.8125);transform:translateY(-.62rem) scale(.8125);cursor:auto}.forge-field--roomy:not(.forge-field--dense) ::slotted(label.forge-floating-label--unfloat-above-start-keyframe){-webkit-transition:none;transition:none;font-size:1rem;-webkit-transform:translateY(-.8rem) scale(.8125);transform:translateY(-.8rem) scale(.8125);cursor:auto}.forge-field~::slotted([slot=helper-text]){-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-caption-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));line-height:1.25rem;line-height:var(--mdc-typography-caption-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-caption-font-weight,400);letter-spacing:.0333333333em;letter-spacing:var(--mdc-typography-caption-letter-spacing, .0333333333em);text-decoration:inherit;-webkit-text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-caption-text-transform,inherit);display:block;min-height:1.5rem;line-height:normal;padding-top:4px;-webkit-box-sizing:border-box;box-sizing:border-box}.forge-field:not(.forge-field--dense):not(.forge-field--roomy)~::slotted([slot=helper-text]){font-size:.75rem}.forge-field--roomy:not(.forge-field--dense)~::slotted([slot=helper-text]){font-size:.875rem}.forge-field--dense:not(.forge-field--roomy)~::slotted([slot=helper-text]){font-size:.75rem}.forge-field~::slotted([slot=helper-text]){color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54))}.forge-field--invalid:not(.forge-field--disabled)~::slotted([slot=helper-text]){color:#b00020;color:var(--mdc-theme-error,#b00020)}.forge-field:not(.forge-field--shape-rounded)~::slotted([slot=helper-text]){margin-left:12px}.forge-field--shape-rounded~::slotted([slot=helper-text]){margin-left:32px}.forge-field ::slotted([slot=leading]){display:-webkit-box;display:flex;align-self:center}.forge-field:not(.forge-field--disabled):not(.forge-field--invalid) ::slotted([slot=leading]){color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54))}.forge-field--invalid:not(.forge-field--disabled) ::slotted([slot=leading]){color:#b00020;color:var(--mdc-theme-error,#b00020)}.forge-field--disabled ::slotted([slot=leading]){color:rgba(0,0,0,.38);color:var(--mdc-theme-text-disabled-on-light,rgba(0,0,0,.38));cursor:not-allowed;pointer-events:none}.forge-field ::slotted([slot=leading]){margin:0 4px}.forge-field ::slotted([slot=leading]:not(forge-icon-button)){padding:6px}.forge-field ::slotted([slot=trailing]){align-self:center}.forge-field:not(.forge-field--disabled):not(.forge-field--invalid) ::slotted([slot=trailing]){color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54))}.forge-field--invalid:not(.forge-field--disabled) ::slotted([slot=trailing]){color:#b00020;color:var(--mdc-theme-error,#b00020)}.forge-field--disabled ::slotted([slot=trailing]){color:rgba(0,0,0,.38);color:var(--mdc-theme-text-disabled-on-light,rgba(0,0,0,.38));cursor:not-allowed;pointer-events:none}.forge-field ::slotted([slot=trailing]){margin:0 4px}.forge-field ::slotted([slot=trailing]:not(forge-icon-button)){padding:6px}.forge-field__addon-end-container{display:none}.forge-field--addon-end .forge-field__addon-end-container{height:100%;width:auto;display:-webkit-box;display:flex;-webkit-box-pack:center;justify-content:center;-webkit-box-align:center;align-items:center;padding:0 4px;border-left-width:1px;border-left-style:solid;-webkit-transition:border-left-color .2s 0s cubic-bezier(0, 0, .2, 1);transition:border-left-color .2s 0s cubic-bezier(0, 0, .2, 1)}.forge-field:not(.forge-field--disabled):not(.forge-field--focused):not(.forge-field--invalid) .forge-field__addon-end-container{border-left-color:rgba(0,0,0,.54);border-left-color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54))}.forge-field:not(.forge-field--disabled):not(.forge-field--focused):not(.forge-field--invalid) .forge-field__addon-end-container:hover{border-left-color:rgba(0,0,0,.87);border-left-color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87))}.forge-field.forge-field--focused:not(.forge-field--invalid):not(.forge-field--disabled) .forge-field__addon-end-container{border-left-color:#3f51b5;border-left-color:var(--mdc-theme-primary,#3f51b5)}.forge-field.forge-field--invalid:not(.forge-field--disabled) .forge-field__addon-end-container{border-left-color:#b00020;border-left-color:var(--mdc-theme-error,#b00020)}.forge-field.forge-field--invalid:not(.forge-field--focused):not(.forge-field--disabled) .forge-field__addon-end-container:hover{border-left-color:#db8a98;border-left-color:var(--forge-theme-error-hover,#db8a98)}.forge-field.forge-field--disabled .forge-field__addon-end-container{border-left-color:rgba(0,0,0,.12);border-left-color:var(--mdc-theme-text-disabled-on-background,rgba(0,0,0,.12))}.forge-field:not(.forge-field--disabled):not(.forge-field--invalid) ::slotted([slot=addon-end]){color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54))}.forge-field--invalid:not(.forge-field--disabled) ::slotted([slot=addon-end]){color:#b00020;color:var(--mdc-theme-error,#b00020)}.forge-field--disabled ::slotted([slot=addon-end]){color:rgba(0,0,0,.38);color:var(--mdc-theme-text-disabled-on-light,rgba(0,0,0,.38));cursor:not-allowed;pointer-events:none}.forge-chip-field{-webkit-box-sizing:border-box;box-sizing:border-box;display:-webkit-box;display:flex;-webkit-box-align:center;align-items:center;position:relative;z-index:1;z-index:var(--forge-z-index-surface,1);margin-top:0;margin-top:var(--forge-chip-field-margin-top,0)}.forge-chip-field.forge-field--disabled{background-color:#f5f5f5;background-color:var(--forge-theme-form-field-disabled-on-background,#f5f5f5);cursor:not-allowed}.forge-chip-field .forge-chip-field{display:grid;grid-template-columns:[leading] -webkit-min-content [input] 1fr [trailing] -webkit-min-content [addon-end] -webkit-min-content [end];grid-template-columns:[leading] min-content [input] 1fr [trailing] min-content [addon-end] min-content [end]}.forge-chip-field .forge-chip-field:not(.forge-field--dense):not(.forge-field--roomy){height:auto;min-height:46px;min-height:var(--forge-chip-field-height,46px)}.forge-chip-field .forge-chip-field.forge-field--roomy:not(.forge-field--dense){height:auto;min-height:3.5rem;min-height:var(--forge-chip-field-height,3.5rem)}.forge-chip-field .forge-chip-field.forge-field--dense:not(.forge-field--roomy){height:auto;min-height:1.5rem;min-height:var(--forge-chip-field-height,1.5rem)}.forge-field__label-input-container{grid-column-start:input;grid-column-end:trailing}.forge-field__input-container{-webkit-box-flex:1;flex:1 1 0.0001px;display:-webkit-box;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row;flex-wrap:wrap;-webkit-box-align:start;align-items:flex-start;-webkit-box-sizing:border-box;box-sizing:border-box}.forge-field__input-container{padding:2px 12px}.forge-field--label .forge-field__input-container{padding-top:22px}.forge-field--roomy.forge-field--label .forge-field__input-container{padding-top:22px}.forge-field--shape-rounded:not(.forge-field--leading) .forge-field__input-container{padding-left:32px}.forge-field--leading:not(.forge-field--shape-rounded) .forge-field__input-container{padding-left:0}.forge-field--shape-rounded.forge-field--leading .forge-field__input-container{padding-left:0}.forge-field--label .forge-field__input-container{padding-bottom:2px}.forge-field--roomy.forge-field--label .forge-field__input-container{padding-bottom:2px}.forge-field--shape-rounded:not(.forge-field--trailing):not(.forge-field--addon-end) .forge-field__input-container{padding-right:32px}.forge-field--addon-end:not(.forge-field--shape-rounded) .forge-field__input-container,.forge-field--trailing:not(.forge-field--shape-rounded) .forge-field__input-container{padding-right:0}.forge-field--shape-rounded.forge-field--addon-end .forge-field__input-container,.forge-field--shape-rounded.forge-field--trailing .forge-field__input-container{padding-right:0}.forge-field ::slotted([slot=member]){display:block}.forge-field--disabled ::slotted([slot=member]){--mdc-theme-primary:rgba(0, 0, 0, 0.38);--mdc-theme-primary:var(--mdc-theme-text-disabled-on-light, rgba(0, 0, 0, 0.38));cursor:not-allowed;pointer-events:none}.forge-field:not(.forge-field--dense):not(.forge-field--roomy) ::slotted([slot=member]){margin:2px 8px 2px 0}.forge-field--roomy:not(.forge-field--dense) ::slotted([slot=member]){margin:6px 12px 6px 0}.forge-field--dense:not(.forge-field--roomy) ::slotted([slot=member]){margin:2px 6px 2px 0}.forge-field:not(.forge-field--dense):not(.forge-field--roomy) ::slotted([slot=member]){--forge-chip-min-height:20px}.forge-field--dense:not(.forge-field--roomy) ::slotted([slot=member]){--forge-chip-min-height:16px}.forge-field ::slotted(input){-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-body1-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-weight:400;font-weight:var(--mdc-typography-body1-font-weight,400);letter-spacing:.03125em;letter-spacing:var(--mdc-typography-body1-letter-spacing, .03125em);text-decoration:inherit;-webkit-text-decoration:var(--mdc-typography-body1-text-decoration,inherit);text-decoration:var(--mdc-typography-body1-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-body1-text-transform,inherit);align-self:flex-end;-webkit-box-sizing:border-box;box-sizing:border-box;width:100%;height:100%;-webkit-transition:opacity 150ms 0s cubic-bezier(.4, 0, .2, 1);transition:opacity 150ms 0s cubic-bezier(.4, 0, .2, 1);border:none;background:0 0;-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:0;line-height:normal;min-width:0}.forge-field ::slotted(input)::-webkit-input-placeholder{color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54));font-size:.875rem}.forge-field ::slotted(input)::-moz-placeholder{color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54));font-size:.875rem}.forge-field ::slotted(input):-ms-input-placeholder{color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54));font-size:.875rem}.forge-field ::slotted(input)::-ms-input-placeholder{color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54));font-size:.875rem}.forge-field ::slotted(input)::placeholder{color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54));font-size:.875rem}.forge-field ::slotted(input):invalid{-webkit-box-shadow:none;box-shadow:none}.forge-field ::slotted(input):-webkit-autofill{z-index:auto!important}.forge-field:not(.forge-field--disabled) ::slotted(input){color:rgba(0,0,0,.87);color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87))}.forge-field--disabled ::slotted(input){color:rgba(0,0,0,.6);color:var(--forge-theme-form-field-text-disabled-on-background,rgba(0,0,0,.6));cursor:not-allowed}.forge-field:not(.forge-field--dense):not(.forge-field--roomy) ::slotted(input){font-size:1rem;font-size:var(--forge-chip-field-font-size, 1rem)}.forge-field--roomy:not(.forge-field--dense) ::slotted(input){font-size:1rem;font-size:var(--forge-chip-field-font-size, 1rem)}.forge-field--dense:not(.forge-field--roomy) ::slotted(input){font-size:.875rem;font-size:var(--forge-chip-field-font-size, .875rem)}.forge-field ::slotted(input){-webkit-box-flex:1;flex:1 1 0.0001px;min-width:40px;display:block;align-self:flex-start;padding:0}.forge-field:not(.forge-field--dense):not(.forge-field--roomy) ::slotted(input){margin:4px 0}.forge-field--roomy:not(.forge-field--dense) ::slotted(input){margin:6px 0}.forge-field--dense:not(.forge-field--roomy) ::slotted(input){margin:2px 0}.forge-field:not(.forge-field--dense):not(.forge-field--roomy) ::slotted(input){height:1rem;line-height:1rem}.forge-field--roomy:not(.forge-field--dense) ::slotted(input){height:1.25rem;line-height:1.25rem}.forge-field--dense:not(.forge-field--roomy) ::slotted(input){height:1rem;line-height:1rem}.forge-field ::slotted([slot=leading]){grid-column-start:leading;grid-column-end:input;align-self:flex-start}.forge-field:not(.forge-field--dense):not(.forge-field--roomy) ::slotted([slot=leading]){margin-top:5px;margin-bottom:5px}.forge-field--roomy:not(.forge-field--dense) ::slotted([slot=leading]){margin-top:10px;margin-bottom:10px}.forge-field--dense:not(.forge-field--roomy) ::slotted([slot=leading]){margin-top:0;margin-bottom:0}.forge-field--dense:not(.forge-field--roomy) ::slotted([slot=leading]){padding-top:0;padding-bottom:0}.forge-field ::slotted([slot=trailing]){grid-column-start:trailing;grid-column-end:addon-end;display:-webkit-box;display:flex;-webkit-box-align:start;align-items:flex-start;align-self:flex-start}.forge-field:not(.forge-field--dense):not(.forge-field--roomy) ::slotted([slot=trailing]){margin-top:5px;margin-bottom:5px}.forge-field--roomy:not(.forge-field--dense) ::slotted([slot=trailing]){margin-top:10px;margin-bottom:10px}.forge-field--dense:not(.forge-field--roomy) ::slotted([slot=trailing]){margin-top:0;margin-bottom:0}.forge-field--dense:not(.forge-field--roomy) ::slotted([slot=trailing]){padding-top:0;padding-bottom:0}.forge-field--addon-end .forge-field__addon-end-container{grid-column-start:addon-end;grid-column-end:end;display:-webkit-box;display:flex;-webkit-box-align:start;align-items:flex-start;align-self:flex-start}.forge-field:not(.forge-field--dense):not(.forge-field--roomy) ::slotted([slot=addon-end]){margin-top:5px;margin-bottom:5px}.forge-field--roomy:not(.forge-field--dense) ::slotted([slot=addon-end]){margin-top:10px;margin-bottom:10px}.forge-field--dense:not(.forge-field--roomy) ::slotted([slot=addon-end]){margin-top:0;margin-bottom:0}.forge-field ::slotted(forge-icon-button){display:-webkit-inline-box!important;display:inline-flex!important}:host{display:block;contain:layout}:host([hidden]){display:none}',l=class extends C{constructor(){super(),x(this,F,D),this._foundation=new a(new d(this))}};l=h([_({name:i.elementName,dependencies:[L]})],l);var T=class extends E{constructor(e){super(e)}_build(){var o,t;let e=document.createElement(i.elementName);return this._inputElement=this._buildInputElement(e),(o=this._config.options)!=null&&o.leadingElement&&(this._config.options.leadingElement.slot="leading",e.appendChild(this._config.options.leadingElement)),(t=this._config.options)!=null&&t.trailingElement&&(this._config.options.trailingElement.slot="trailing",e.appendChild(this._config.options.trailingElement)),e.appendChild(this._inputElement),e}_configure(){var e,o;(e=this._config.options)!=null&&e.helperText&&this.setHelperText(this._config.options.helperText),typeof((o=this._config.options)==null?void 0:o.label)=="string"&&this._createLabel(this._config.options.label)}get value(){return this._inputElement.value}set value(e){this._inputElement.value=e}get disabled(){return this._inputElement.disabled}set disabled(e){this._inputElement.disabled=e}get invalid(){return this._element.invalid||!1}set invalid(e){this._element.invalid=e}get inputElement(){return this._inputElement}get labelElement(){return this._labelElement}onChange(e){this._inputElement.addEventListener("input",o=>e(o.target.value))}onFocus(e){this._inputElement.addEventListener("focus",o=>e(o))}onBlur(e){this._inputElement.addEventListener("blur",o=>e(o))}setLabel(e){e?this._labelElement?this._labelElement.textContent=e:this._createLabel(e):this._labelElement&&(this._element.removeChild(this._labelElement),this._labelElement=void 0)}setHelperText(e){e?(this._helperTextElement||(this._helperTextElement=document.createElement("span"),this._helperTextElement.slot="helper-text",this._element.appendChild(this._helperTextElement)),this._helperTextElement.textContent=e):this._helperTextElement&&(this._element.removeChild(this._helperTextElement),this._helperTextElement=void 0)}floatLabel(e){this._element.floatLabel(e)}_createLabel(e){var o;this._labelElement=document.createElement("label"),this._labelElement.textContent=e,(o=this._config.options)!=null&&o.id&&this._labelElement.setAttribute("for",this._config.options.id),this._element.appendChild(this._labelElement)}_buildInputElement(e){var t,r,p,b,c;let o=document.createElement("input");return o.type=((t=this._config.options)==null?void 0:t.type)||"text",((r=this._config.options)==null?void 0:r.value)!==void 0&&(o.value=this._config.options.value),(p=this._config.options)!=null&&p.id&&(o.id=this._config.options.id),typeof((b=this._config.options)==null?void 0:b.placeholder)=="string"&&(o.placeholder=(c=this._config.options)==null?void 0:c.placeholder),e.appendChild(o),o}};function fe(){v(l)}export{i as a,d as b,a as c,l as d,T as e,fe as f};
7
+ //# sourceMappingURL=chunk.YPUWII7L.js.map