@tylertech/forge 2.16.0 → 2.16.2-dev.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/custom-elements.json +451 -467
- package/dist/esm/app-bar/help-button/index.js +1 -1
- package/dist/esm/app-bar/index.js +1 -1
- package/dist/esm/autocomplete/index.js +1 -1
- package/dist/esm/chunks/{chunk.4RPIQ65C.js → chunk.27TSALYN.js} +2 -2
- package/dist/esm/chunks/{chunk.4RPIQ65C.js.map → chunk.27TSALYN.js.map} +2 -2
- package/dist/esm/chunks/{chunk.26XTVQKW.js → chunk.2NSEMS3F.js} +2 -2
- package/dist/esm/chunks/chunk.7AEMNSV3.js +7 -0
- package/dist/esm/chunks/chunk.7AEMNSV3.js.map +7 -0
- package/dist/esm/chunks/{chunk.YUCLBBES.js → chunk.ASJHDPFL.js} +2 -2
- package/dist/esm/chunks/{chunk.K4DGAJOM.js → chunk.CDUN4ONU.js} +2 -2
- package/dist/esm/chunks/{chunk.P4EW5GAS.js → chunk.D6MLVA5G.js} +2 -2
- package/dist/esm/chunks/{chunk.7B3AZYBR.js → chunk.EE25TGNW.js} +2 -2
- package/dist/esm/chunks/{chunk.7LI25R6R.js → chunk.ELV22KTH.js} +2 -2
- package/dist/esm/chunks/{chunk.REH25ELY.js → chunk.LJU5WSSF.js} +2 -2
- package/dist/esm/chunks/{chunk.4Y7EPWU2.js → chunk.LYM6SPBV.js} +2 -2
- package/dist/esm/chunks/{chunk.J2VLKZWP.js → chunk.MBDF4C2J.js} +2 -2
- package/dist/esm/chunks/{chunk.J2VLKZWP.js.map → chunk.MBDF4C2J.js.map} +1 -1
- package/dist/esm/chunks/{chunk.MUEXD4SD.js → chunk.NSOALSSD.js} +2 -2
- package/dist/esm/chunks/chunk.TBY35XZK.js +7 -0
- package/dist/esm/chunks/chunk.TBY35XZK.js.map +7 -0
- package/dist/esm/chunks/{chunk.UDAWTDPV.js → chunk.V6PXSHJ4.js} +2 -2
- package/dist/esm/chunks/{chunk.22OZJNVS.js → chunk.XBW46N2J.js} +2 -2
- package/dist/esm/chunks/{chunk.PWKRTM6B.js → chunk.XZOIRI4V.js} +2 -2
- package/dist/esm/chunks/chunk.ZWTTBW3O.js +7 -0
- package/dist/esm/chunks/chunk.ZWTTBW3O.js.map +7 -0
- package/dist/esm/date-picker/index.js +1 -1
- package/dist/esm/date-range-picker/index.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/list-dropdown/index.js +1 -1
- package/dist/esm/menu/index.js +1 -1
- package/dist/esm/paginator/index.js +1 -1
- package/dist/esm/select/core/index.js +1 -1
- package/dist/esm/select/index.js +1 -1
- package/dist/esm/select/select/index.js +1 -1
- package/dist/esm/select/select-dropdown/index.js +1 -1
- package/dist/esm/split-view/index.js +1 -1
- package/dist/esm/split-view/split-view/index.js +1 -1
- package/dist/esm/split-view/split-view-panel/index.js +1 -1
- package/dist/esm/time-picker/index.js +1 -1
- package/esm/autocomplete/autocomplete-adapter.d.ts +0 -2
- package/esm/autocomplete/autocomplete-adapter.js +0 -4
- package/esm/autocomplete/autocomplete-foundation.js +0 -11
- package/esm/date-picker/base/base-date-picker-foundation.js +1 -1
- package/esm/list-dropdown/list-dropdown-adapter.js +1 -1
- package/esm/list-dropdown/list-dropdown-utils.d.ts +1 -1
- package/esm/list-dropdown/list-dropdown-utils.js +7 -4
- package/esm/split-view/split-view/split-view-adapter.js +3 -1
- package/esm/split-view/split-view-panel/split-view-panel.js +1 -1
- package/package.json +2 -2
- package/dist/esm/chunks/chunk.IP3OQKGW.js +0 -7
- package/dist/esm/chunks/chunk.IP3OQKGW.js.map +0 -7
- package/dist/esm/chunks/chunk.KKMKGN2I.js +0 -7
- package/dist/esm/chunks/chunk.KKMKGN2I.js.map +0 -7
- package/dist/esm/chunks/chunk.VPH7GX4C.js +0 -7
- package/dist/esm/chunks/chunk.VPH7GX4C.js.map +0 -7
- /package/dist/esm/chunks/{chunk.26XTVQKW.js.map → chunk.2NSEMS3F.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.YUCLBBES.js.map → chunk.ASJHDPFL.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.K4DGAJOM.js.map → chunk.CDUN4ONU.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.P4EW5GAS.js.map → chunk.D6MLVA5G.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.7B3AZYBR.js.map → chunk.EE25TGNW.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.7LI25R6R.js.map → chunk.ELV22KTH.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.REH25ELY.js.map → chunk.LJU5WSSF.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.4Y7EPWU2.js.map → chunk.LYM6SPBV.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.MUEXD4SD.js.map → chunk.NSOALSSD.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.UDAWTDPV.js.map → chunk.V6PXSHJ4.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.22OZJNVS.js.map → chunk.XBW46N2J.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.PWKRTM6B.js.map → chunk.XZOIRI4V.js.map} +0 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/list-dropdown/list-dropdown-constants.ts", "../../../../../../node_modules/@tylertech/forge-core/esm/events/event-aware.js", "../../../../../../node_modules/@tylertech/forge-core/esm/scroll/scroll-types.js", "../../../../../../node_modules/@tylertech/forge-core/esm/scroll/scroll-axis-observer.js", "../../src/list-dropdown/list-dropdown-utils.ts", "../../src/list-dropdown/list-dropdown-foundation.ts", "../../src/list-dropdown/list-dropdown-adapter.ts", "../../src/list-dropdown/list-dropdown.ts", "../../src/list-dropdown/list-dropdown-aware-foundation.ts", "../../src/list-dropdown/cascading-list-dropdown-aware-foundation.ts"],
|
|
4
|
+
"sourcesContent": ["import { IPopupPosition, PopupPlacement } from '../popup';\n\nconst attributes = {\n POPUP_CLASSES: 'popup-classes',\n OPTION_LIMIT: 'option-limit',\n OBSERVE_SCROLL: 'observe-scroll',\n OBSERVE_SCROLL_THRESHOLD: 'observe-scroll-threshold',\n SYNC_POPUP_WIDTH: 'sync-popup-width',\n CONSTRAIN_POPUP_WIDTH: 'constrain-popup-width',\n WRAP_OPTION_TEXT: 'wrap-option-text',\n\n // Internal\n CHECKBOX_ELEMENT: 'data-list-dropdown-checkbox',\n DATA_ALLOW_FOCUS: 'data-list-dropdown-allow-focus'\n};\n\nconst classes = {\n GROUP_WRAPPER: 'forge-list-dropdown__group-wrapper'\n};\n\nexport const LIST_DROPDOWN_CONSTANTS = {\n attributes,\n classes\n};\n\nexport type ListDropdownOptionBuilder<T = HTMLElement> = (option: IListDropdownOption, parentElement: T) => HTMLElement | string | void;\nexport type ListDropdownHeaderBuilder = () => HTMLElement;\nexport type ListDropdownFooterBuilder = () => HTMLElement;\nexport type ListDropdownOptionGroupBuilder<T = any> = (option: IListDropdownOptionGroup<T>) => HTMLElement | string;\nexport type ListDropdownTransformCallback = (label: string) => string | HTMLElement;\nexport type ListDropdownIconType = 'font' | 'component';\n\nexport interface IBaseListDropdownOption<T = any> {\n value: T;\n label: string;\n disabled?: boolean;\n divider?: boolean;\n optionClass?: string | string[];\n leadingIcon?: string;\n leadingIconClass?: string;\n leadingIconType?: ListDropdownIconType;\n trailingIcon?: string;\n trailingIconClass?: string;\n trailingIconType?: ListDropdownIconType;\n leadingBuilder?: () => HTMLElement;\n trailingBuilder?: () => HTMLElement;\n}\n\nexport interface IListDropdownOption<T = any> extends IBaseListDropdownOption<T> {\n options?: Array<IListDropdownOption | IListDropdownOptionGroup>;\n elementAttributes?: Map<string, string>;\n}\n\nexport interface IListDropdownOptionGroup<T = any, K = any> {\n text?: string;\n value?: K;\n builder?: ListDropdownOptionGroupBuilder;\n options: IListDropdownOption<T>[];\n}\n\nexport interface IListDropdownSelectEventData {\n value: IListDropdownOption | IListDropdownOption[];\n}\n\nexport interface IListDropdownConfig<T = any> {\n id: string;\n options: Array<IListDropdownOption | IListDropdownOptionGroup>;\n selectCallback: (value: T) => void;\n \n // Optional values\n activeChangeCallback?: (id: string) => void;\n closeCallback?: () => void;\n syncWidth?: boolean;\n constrainViewportWidth?: boolean;\n wrapOptionText?: boolean;\n selectedValues?: T[];\n multiple?: boolean;\n activeStartIndex?: number;\n visibleStartIndex?: number;\n transform?: ListDropdownTransformCallback;\n allowBusy?: boolean;\n asyncStyle?: ListDropdownAsyncStyle;\n iconClass?: string;\n dense?: boolean;\n type?: ListDropdownType;\n popupClasses?: string | string[];\n popupOffset?: IPopupPosition;\n popupStatic?: boolean;\n popupPlacement?: PopupPlacement;\n popupFallbackPlacements?: PopupPlacement[];\n optionLimit?: number;\n optionBuilder?: ListDropdownOptionBuilder;\n observeScroll?: boolean;\n observeScrollThreshold?: number;\n targetWidthCallback?: () => number;\n scrollEndListener?: () => void;\n headerBuilder?: ListDropdownHeaderBuilder;\n footerBuilder?: ListDropdownFooterBuilder;\n cascade?: boolean;\n cascadingElementFactory?: (config: IListDropdownCascadingElementFactoryConfig) => HTMLElement;\n}\n\nexport interface IListDropdownCascadingElementFactoryConfig {\n index: number;\n options: Array<IListDropdownOption | IListDropdownOptionGroup>;\n parentValue: any;\n}\n\nexport const DEFAULT_LIST_DROPDOWN_CONFIG: Partial<IListDropdownConfig> = {\n options: [],\n syncWidth: false,\n selectedValues: [],\n multiple: false\n};\n\nexport interface IListDropdownOpenConfig extends IListDropdownConfig {}\n\nexport enum ListDropdownType {\n None = 'none',\n Standard = 'standard',\n Menu = 'menu'\n}\n\nexport enum ListDropdownAsyncStyle {\n Spinner = 'spinner',\n Skeleton = 'skeleton'\n}\n", "export class EventAware {\n constructor() {\n this._listenerMap = new Map();\n }\n _emit(type, data) {\n const listeners = this._listenerMap.get(type);\n if (listeners && listeners.length) {\n listeners.forEach(cb => cb({ type, data }));\n }\n }\n hasListeners(type) {\n return type ? this._listenerMap.has(type) : this._listenerMap.size > 0;\n }\n addListener(type, listener) {\n if (!this._listenerMap.has(type)) {\n this._listenerMap.set(type, [listener]);\n }\n else {\n const listeners = this._listenerMap.get(type);\n if (listeners) {\n listeners.push(listener);\n }\n }\n }\n removeListener(type, listener) {\n const listeners = this._listenerMap.get(type);\n if (listeners && listeners.length && listeners.includes(listener)) {\n listeners.splice(listeners.indexOf(listener), 1);\n if (!listeners.length) {\n this._listenerMap.delete(type);\n }\n }\n }\n}\n", "export var ScrollDirection;\n(function (ScrollDirection) {\n ScrollDirection[\"Up\"] = \"up\";\n ScrollDirection[\"Down\"] = \"down\";\n ScrollDirection[\"Left\"] = \"left\";\n ScrollDirection[\"Right\"] = \"right\";\n})(ScrollDirection || (ScrollDirection = {}));\nexport var ScrollEvents;\n(function (ScrollEvents) {\n ScrollEvents[\"Scroll\"] = \"scroll\";\n ScrollEvents[\"Scrolled\"] = \"scrolled\";\n ScrollEvents[\"ScrolledStart\"] = \"scrolled-start\";\n ScrollEvents[\"ScrolledEnd\"] = \"scrolled-end\";\n})(ScrollEvents || (ScrollEvents = {}));\n", "import { EventAware } from '../events/event-aware';\nimport { ScrollEvents, ScrollDirection } from './scroll-types';\nimport { isDefined, throttle, isNumber } from '../utils';\nconst DEFAULT_SCROLL_THROTTLE = 100;\n/**\n * Provides facilties for observing and reacting to scroll events and information on a given element.\n */\nexport class ScrollAxisObserver extends EventAware {\n constructor(_element, _config = {}) {\n super();\n this._element = _element;\n this._config = _config;\n this._axis = 'vertical';\n this._scrollThreshold = 0;\n this._lastScrollPosition = 0;\n this._lastScrollTop = 0;\n this._lastScrollLeft = 0;\n this._isListening = false;\n this._initialize();\n }\n destroy() {\n this.stop();\n }\n start() {\n if (!this._isListening) {\n this._element.addEventListener('scroll', this._scrollListener);\n this._isListening = true;\n }\n }\n stop() {\n this._element.removeEventListener('scroll', this._scrollListener);\n this._isListening = false;\n }\n _initialize() {\n if (this._config.throttle) {\n const wait = this._config.throttleTime || DEFAULT_SCROLL_THROTTLE;\n this._scrollListener = throttle(() => this._onScroll(), wait);\n }\n else {\n this._scrollListener = () => this._onScroll();\n }\n if (!isDefined(this._config.paused) || !this._config.paused) {\n this.start();\n }\n if (isDefined(this._config.axis)) {\n this._axis = this._config.axis;\n }\n if (isDefined(this._config.scrollThreshold) && isNumber(this._config.scrollThreshold)) {\n this._scrollThreshold = this._config.scrollThreshold;\n }\n }\n _isScrollAxis() {\n const isVertical = this._lastScrollTop !== this._element.scrollTop;\n const isHorizontal = this._lastScrollLeft !== this._element.scrollLeft;\n return (this._axis === 'vertical' && isVertical) || (this._axis === 'horizontal' && isHorizontal);\n }\n _onScroll() {\n if (!this._isScrollAxis()) {\n return;\n }\n const position = this.scrollPosition;\n const direction = this._lastScrollPosition - position < 0 ? this._axis === 'vertical' ? ScrollDirection.Down : ScrollDirection.Right : this._axis === 'vertical' ? ScrollDirection.Up : ScrollDirection.Left;\n this._emit(ScrollEvents.Scroll, { direction, position });\n if (this._lastScrollPosition <= this._scrollThreshold && position > this._scrollThreshold) {\n this._emit(ScrollEvents.Scrolled, true);\n }\n else if (this._lastScrollPosition >= this._scrollThreshold && (this._scrollThreshold > 0 ? position < this._scrollThreshold : position === 0)) {\n this._emit(ScrollEvents.Scrolled, false);\n }\n const scrollStart = Math.round(position - this._scrollThreshold);\n const scrollEnd = Math.round(this.scrollSize - position);\n if (this._lastScrollPosition >= this._scrollThreshold && scrollStart <= 0) {\n this._emit(ScrollEvents.ScrolledStart);\n }\n else if (this._lastScrollPosition <= (this.scrollSize - this._scrollThreshold) && scrollEnd <= this._scrollThreshold) {\n this._emit(ScrollEvents.ScrolledEnd);\n }\n this._lastScrollPosition = position || 0;\n this._lastScrollTop = this._element.scrollTop || 0;\n this._lastScrollLeft = this._element.scrollLeft || 0;\n }\n get scrollPosition() {\n return this._axis === 'vertical' ? this._element.scrollTop : this._element.scrollLeft;\n }\n get isScrolled() {\n return this.scrollPosition > this._scrollThreshold;\n }\n get isScrolledStart() {\n return this.scrollPosition === 0;\n }\n get isScrolledEnd() {\n return this.scrollPosition === this._element.scrollWidth;\n }\n get isScrollable() {\n if (this._axis === 'vertical') {\n return this._element.scrollHeight > this._element.clientHeight;\n }\n return this._element.scrollWidth > this._element.clientWidth;\n }\n get scrollSize() {\n return (this._axis === 'vertical' ? this._element.scrollHeight : this._element.scrollWidth) - this.elementSize;\n }\n get elementSize() {\n return this._axis === 'vertical' ? this._element.clientHeight : this._element.clientWidth;\n }\n setScrollPosition(position) {\n if (this._axis === 'vertical') {\n this._element.scrollTop = position;\n }\n else {\n this._element.scrollLeft = position;\n }\n }\n}\n", "import { addClass, getEventPath, isDeepEqual, isDefined, isObject } from '@tylertech/forge-core';\nimport { tylIconCheckBox, tylIconCheckBoxOutlineBlank } from '@tylertech/tyler-icons/standard';\nimport { ICON_CLASS_NAME } from '../constants';\nimport { ILinearProgressComponent, LINEAR_PROGRESS_CONSTANTS } from '../linear-progress';\nimport { IListComponent, LIST_CONSTANTS } from '../list/list';\nimport { IPopupComponent, PopupAnimationType, POPUP_CONSTANTS } from '../popup';\nimport { ISkeletonComponent, SKELETON_CONSTANTS } from '../skeleton';\nimport { IListDropdownCascadingElementFactoryConfig, IListDropdownOpenConfig, IListDropdownOption, IListDropdownOptionGroup, ListDropdownAsyncStyle, ListDropdownIconType, ListDropdownType, LIST_DROPDOWN_CONSTANTS } from './list-dropdown-constants';\n\nexport enum ListDropdownOptionType { Option, Group }\n\n/**\n * Creates the floating dropdown element container.\n * @param config \n * @param targetElement \n */\nexport function createDropdown(config: IListDropdownOpenConfig, targetElement: HTMLElement): IPopupComponent {\n const dropdownElement = createPopupDropdown(config, targetElement);\n const dropdownId = `list-dropdown-popup-${config.id}`;\n\n // Prevent mousedown events from changing focus. We keep focus in the target element at all times while open.\n dropdownElement.addEventListener('mousedown', evt => {\n const composedPath = getEventPath(evt);\n\n // We allow for custom header and footer templates and these elements could be focusable so we need to allow access into them\n const isFromCustomTemplate = composedPath.find(el => el.nodeType === 1 && el.hasAttribute(LIST_DROPDOWN_CONSTANTS.attributes.DATA_ALLOW_FOCUS));\n if (isFromCustomTemplate) {\n return;\n }\n\n const isWithinDropdownElement = composedPath.find(el => el.id === dropdownId || el.id === config.id);\n if (isWithinDropdownElement) {\n evt.preventDefault();\n }\n });\n\n // Set roles and other attributes based on our type\n switch (config.type) {\n case ListDropdownType.Menu:\n dropdownElement.setAttribute('role', 'menu');\n dropdownElement.setAttribute('aria-orientation', 'vertical');\n break;\n default:\n dropdownElement.setAttribute('role', 'listbox');\n }\n\n if (config.id) {\n dropdownElement.id = dropdownId;\n }\n if (config.popupClasses) {\n addClass(config.popupClasses, dropdownElement);\n }\n\n return dropdownElement;\n}\n\nexport function createPopupDropdown(config: IListDropdownOpenConfig, targetElement: HTMLElement): IPopupComponent {\n const popupElement = document.createElement('forge-popup');\n popupElement.targetElement = targetElement;\n popupElement.placement = config.popupPlacement || 'bottom-start';\n popupElement.manageFocus = false;\n popupElement.static = !!config.popupStatic;\n\n if (config.popupFallbackPlacements?.length) {\n popupElement.fallbackPlacements = config.popupFallbackPlacements;\n }\n\n if (config.constrainViewportWidth) {\n popupElement.setAttribute(POPUP_CONSTANTS.attributes.CONSTRAIN_VIEWPORT_WIDTH, '');\n }\n\n if (config.popupOffset) {\n popupElement.offset = config.popupOffset;\n }\n\n // Set the animations based on our type\n switch (config.type) {\n case ListDropdownType.Menu:\n popupElement.animationType = PopupAnimationType.Menu;\n break;\n case ListDropdownType.None:\n popupElement.animationType = PopupAnimationType.None;\n break;\n default:\n popupElement.animationType = PopupAnimationType.Dropdown;\n }\n return popupElement;\n}\n\nexport function createList(config: IListDropdownOpenConfig): IListComponent {\n const listElement = document.createElement(LIST_CONSTANTS.elementName) as IListComponent;\n listElement.id = `list-dropdown-list-${config.id}`;\n listElement.propagateClick = false;\n return listElement;\n}\n\n/**\n * Creates the list to place inside of the dropdown.\n * @param config \n */\nexport function createListItems(config: IListDropdownOpenConfig, listElement: IListComponent, options?: Array<IListDropdownOption | IListDropdownOptionGroup>, startIndex = 0, renderSelected = true): void {\n // Ensure the options are provided in the form a group (if no groups provided, then we have one anonymous group of options)\n const groups = getOptionsByGroup(options || config.options);\n const flatOptions = getFlattenedOptions(groups);\n\n const limitOptions = config.optionLimit ? true : false;\n let optionLimit = config.optionLimit || 0;\n let optionIdIndex = startIndex;\n\n // Iterate over our groups and render the optional headers and options for that group\n for (const group of groups) {\n let optionParent: IListComponent | HTMLElement = listElement;\n\n // Check for a group header builder callback\n if (group.builder && typeof group.builder === 'function') {\n const headerElement = group.builder(group);\n if (headerElement) {\n const groupWrapper = document.createElement('div');\n groupWrapper.classList.add(LIST_DROPDOWN_CONSTANTS.classes.GROUP_WRAPPER);\n optionParent = groupWrapper;\n\n if (typeof headerElement === 'string') {\n groupWrapper.innerHTML = headerElement;\n } else if (headerElement instanceof HTMLElement) {\n groupWrapper.appendChild(headerElement);\n }\n\n listElement.appendChild(groupWrapper);\n }\n } else if (group.text) {\n // We are rendering just text as a group header so create the group header element with predefined styles\n const groupWrapper = document.createElement('div');\n groupWrapper.classList.add(LIST_DROPDOWN_CONSTANTS.classes.GROUP_WRAPPER);\n\n const listHeaderElement = document.createElement('div');\n listHeaderElement.textContent = group.text;\n listHeaderElement.classList.add('forge-typography--overline');\n listHeaderElement.style.fontFamily = 'Roboto,sans-serif';\n listHeaderElement.style.fontSize = '0.75rem';\n listHeaderElement.style.lineHeight = '2rem';\n listHeaderElement.style.letterSpacing = '0.16667em';\n listHeaderElement.style.fontWeight = '500';\n listHeaderElement.style.margin = '4px 8px';\n\n optionParent = groupWrapper;\n groupWrapper.appendChild(listHeaderElement);\n listElement.appendChild(groupWrapper);\n }\n\n // Loop over the options for this group\n for (const option of group.options) {\n // First we check if this option is just a divider\n if (option.divider) {\n const dividerElement = createDivider();\n listElement.appendChild(dividerElement);\n continue;\n }\n\n // Check if an option limit has been provided to reduce amount of options that need to be rendered\n if (limitOptions && --optionLimit < 0) {\n break;\n }\n \n // Create and configure the list element\n const isSelected = config.selectedValues ? config.selectedValues.some(v => isDeepEqual(v, option.value)) : false;\n\n // We don't render selected options that are appended dynamically since those are always displayed at the top of the list\n if (!renderSelected && isSelected) {\n continue;\n }\n\n let listItemElement = document.createElement('forge-list-item');\n listItemElement.value = option.value;\n listItemElement.id = `list-dropdown-option-${config.id}-${optionIdIndex++}`;\n listItemElement.style.cursor = 'pointer';\n\n if (config.wrapOptionText) {\n listItemElement.wrap = true;\n }\n \n // Add any CSS classes to the option list-item\n if (option.optionClass && (typeof option.optionClass === 'string' || Array.isArray(option.optionClass) && option.optionClass.length)) {\n addClass(option.optionClass, listItemElement);\n }\n\n // Set role based on type\n switch (config.type) {\n case ListDropdownType.Menu:\n listItemElement.setAttribute('role', 'menuitem');\n break;\n case ListDropdownType.None:\n break;\n default:\n listItemElement.setAttribute('role', 'option');\n }\n\n if (config.dense) {\n listItemElement.dense = true;\n }\n\n // Check for a custom option template builder\n if (config.optionBuilder && typeof config.optionBuilder === 'function') {\n const element = config.optionBuilder(option, listItemElement);\n if (element) {\n if (typeof element === 'string') {\n listItemElement.innerHTML = element;\n } else {\n listItemElement.appendChild(element);\n }\n }\n } else {\n if (typeof config.transform !== 'function') {\n listItemElement.textContent = option.label || '';\n } else {\n const result = config.transform(option.label);\n if (typeof result === 'string') {\n listItemElement.textContent = result;\n } else if (typeof result === 'object' && (result as HTMLElement).nodeType !== undefined) {\n listItemElement.appendChild(result);\n }\n }\n }\n\n // If multiple selections are enabled then we need to create and append a leading checkbox element\n if (config.multiple) {\n const checkboxElement = createCheckboxElement(isSelected);\n listItemElement.appendChild(checkboxElement);\n listItemElement.setAttribute('aria-selected', `${isSelected}`);\n listItemElement.setAttribute('aria-checked', `${isSelected}`);\n }\n\n if (option.elementAttributes) {\n option.elementAttributes.forEach((value: string, key: string) => {\n listItemElement.setAttribute(key, value);\n });\n }\n\n // Leading element/icon\n if (option.leadingBuilder) {\n const element = option.leadingBuilder();\n if (isObject(element)) {\n element.slot = 'leading';\n listItemElement.appendChild(element);\n }\n } else if (option.leadingIcon) {\n const leadingIconElement = createIconElement(option.leadingIconType, option.leadingIcon, option.leadingIconClass || config.iconClass);\n leadingIconElement.slot = 'leading';\n listItemElement.appendChild(leadingIconElement);\n }\n\n // Trailing element/icon\n if (option.trailingBuilder) {\n const element = option.trailingBuilder();\n if (isObject(element)) {\n element.slot = 'trailing';\n listItemElement.appendChild(element);\n }\n } else if (option.trailingIcon) {\n const trailingIconElement = createIconElement(option.trailingIconType, option.trailingIcon, option.trailingIconClass || config.iconClass);\n trailingIconElement.slot = 'trailing';\n listItemElement.appendChild(trailingIconElement);\n }\n\n // Update the disabled state\n if (option.disabled) {\n listItemElement.disabled = option.disabled;\n listItemElement.setAttribute('aria-disabled', 'true');\n } else {\n listItemElement.style.cursor = 'pointer';\n listItemElement.setAttribute('aria-disabled', 'false');\n }\n\n // Update the selected state\n if (isSelected) {\n listItemElement.selected = true;\n }\n listItemElement.setAttribute('aria-selected', isSelected ? 'true' : 'false');\n\n // If we have any child options, we need to render a child menu for this list item\n if (!option.disabled && typeof config.cascadingElementFactory === 'function' && Array.isArray(option.options) && option.options.length) {\n // Create the trailing indicator icon to show that a child menu exists for this option. \n const optionIconElement = document.createElement('forge-icon');\n optionIconElement.name = 'arrow_right';\n optionIconElement.slot = 'trailing';\n listItemElement.appendChild(optionIconElement);\n\n const nonDividerOptions = flatOptions.filter(o => !o.divider);\n\n // Create the nested cascading element wrapper\n const factoryConfig: IListDropdownCascadingElementFactoryConfig = {\n index: nonDividerOptions.indexOf(option),\n options: option.options,\n parentValue: option.value\n };\n const cascadingElement = config.cascadingElementFactory.call(null, factoryConfig);\n cascadingElement.appendChild(listItemElement);\n listItemElement = cascadingElement;\n }\n\n optionParent.appendChild(listItemElement);\n }\n }\n}\n\nexport function createCheckboxElement(selected: boolean): HTMLElement {\n const checkboxElement = document.createElement('forge-icon');\n checkboxElement.setAttribute(LIST_DROPDOWN_CONSTANTS.attributes.CHECKBOX_ELEMENT, '');\n checkboxElement.name = selected ? tylIconCheckBox.name : tylIconCheckBoxOutlineBlank.name;\n checkboxElement.slot = 'leading';\n checkboxElement.style.marginRight = '16px';\n checkboxElement.style.verticalAlign = 'middle';\n return checkboxElement;\n}\n\nfunction createDivider(): HTMLElement {\n const divider = document.createElement('forge-divider');\n divider.setAttribute('aria-hidden', 'true');\n return divider;\n}\n\nfunction createIconElement(type: ListDropdownIconType = 'font', iconName: string, iconClass?: string): HTMLElement {\n if (type === 'component') {\n const icon = document.createElement('forge-icon');\n if (iconClass) {\n icon.classList.add(iconClass);\n }\n icon.setAttribute('aria-hidden', 'true');\n icon.name = iconName;\n return icon;\n }\n\n const iconElement = document.createElement('i');\n iconElement.classList.add(iconClass || ICON_CLASS_NAME);\n iconElement.setAttribute('aria-hidden', 'true');\n iconElement.textContent = iconName;\n return iconElement;\n}\n\nexport function createAsyncElement(asyncStyle?: ListDropdownAsyncStyle): HTMLElement {\n switch (asyncStyle) {\n case ListDropdownAsyncStyle.Skeleton:\n return createSkeletonElement();\n default:\n return createSpinnerElement();\n }\n}\n\nfunction createSpinnerElement(): HTMLElement {\n const div = document.createElement('div');\n div.style.display = 'flex';\n div.style.justifyContent = 'center';\n div.style.alignItems = 'center';\n div.style.padding = '8px';\n div.style.boxSizing = 'border-box';\n\n const spinner = document.createElement('forge-circular-progress');\n spinner.style.setProperty('--forge-circular-progress-size', '24px');\n div.appendChild(spinner);\n\n return div;\n}\n\nfunction createSkeletonElement(): HTMLElement {\n const list = document.createElement('forge-list');\n const div = document.createElement('div');\n div.style.minWidth = '192px';\n for (let i = 0; i < 3; i++) {\n const listItemSkeleton = document.createElement(SKELETON_CONSTANTS.elementName) as ISkeletonComponent;\n listItemSkeleton.setAttribute('list-item', '');\n div.appendChild(listItemSkeleton);\n }\n list.appendChild(div);\n return list;\n}\n\nexport function createBusyElement(): ILinearProgressComponent {\n const linearProgress = document.createElement(LINEAR_PROGRESS_CONSTANTS.elementName) as ILinearProgressComponent;\n linearProgress.determinate = false;\n linearProgress.style.position = 'absolute';\n linearProgress.style.top = '0';\n linearProgress.style.left = '0';\n linearProgress.style.right = '0';\n linearProgress.style.width = '100%';\n return linearProgress;\n}\n\nfunction getOptionsByGroup(options: Array<IListDropdownOption | IListDropdownOptionGroup>): IListDropdownOptionGroup[] {\n return isListDropdownOptionType(options, ListDropdownOptionType.Group) ? (options as IListDropdownOptionGroup[]) : [{ text: '', options }] as IListDropdownOptionGroup[];\n}\n\n/**\n * Determines if the provided options are of the specified type.\n * @param options The options either grouped or individual.\n * @param type The type of option to detect.\n */\nexport function isListDropdownOptionType(options: Array<IListDropdownOption | IListDropdownOptionGroup>, type: ListDropdownOptionType): type is ListDropdownOptionType {\n const isOptionGroups = options.some((o: IListDropdownOption | IListDropdownOptionGroup) => isDefined(o) && isObject(o) && o.hasOwnProperty('options') && (o.hasOwnProperty('text') || o.hasOwnProperty('builder')));\n const isOptionTypes = options.some((o: IListDropdownOption | IListDropdownOptionGroup) => isDefined(o) && isObject(o) && o.hasOwnProperty('label') && o.hasOwnProperty('value'));\n return (isOptionGroups && type === ListDropdownOptionType.Group) || (isOptionTypes && type === ListDropdownOptionType.Option);\n}\n\nexport function getFlattenedOptions(options: Array<IListDropdownOptionGroup | IListDropdownOption>): IListDropdownOption[] {\n if (isListDropdownOptionType(options, ListDropdownOptionType.Group)) {\n const groups = options as IListDropdownOptionGroup[];\n return groups.reduce((flatOpts, group) => flatOpts.concat(group.options), [] as IListDropdownOption[]);\n }\n return [...options as IListDropdownOption[]];\n}\n", "import { IListDropdownAdapter } from './list-dropdown-adapter';\nimport { DEFAULT_LIST_DROPDOWN_CONFIG, IListDropdownConfig, IListDropdownOption, IListDropdownOptionGroup } from './list-dropdown-constants';\nimport { getFlattenedOptions } from './list-dropdown-utils';\n\nexport interface IListDropdownFoundation {\n dropdownElement: HTMLElement | undefined;\n open(): void;\n close(): void;\n getActiveOptionIndex(): number;\n getActiveOption(): IListDropdownOption | undefined;\n toggleOptionMultiple(index: number, isSelected: boolean): void;\n activateSelectedOption(): void;\n activateFirstOption(): number;\n activateOption(index: number): void;\n setSelectedValues(values: any): void;\n clearActiveOption(): void;\n setOptions(options: Array<IListDropdownOption | IListDropdownOptionGroup>): void;\n appendOptions(options: Array<IListDropdownOption | IListDropdownOptionGroup>): void;\n scrollSelectedOptionIntoView(animate?: boolean): void;\n setScrollBottomListener(listener: () => void, threshold?: number): void;\n removeScrollBottomListener(): void;\n setBusyVisibility(isVisible: boolean): void;\n handleKey(key: string): void;\n}\n\nexport class ListDropdownFoundation implements IListDropdownFoundation {\n private _config: IListDropdownConfig;\n private _open = false;\n private _selectListener: (value: any, id: string) => void;\n private _closeListener: () => void;\n private _scrollEndListener: () => void;\n\n constructor(private _adapter: IListDropdownAdapter, config: IListDropdownConfig) {\n this._config = Object.assign({ ...DEFAULT_LIST_DROPDOWN_CONFIG }, { ...config });\n this._selectListener = (value, id) => this._onSelect(value, id);\n this._closeListener = () => {\n if (typeof this._config.closeCallback === 'function') {\n this._config.closeCallback();\n }\n };\n this._scrollEndListener = () => {\n if (this._config.observeScroll && typeof this._config.scrollEndListener === 'function') {\n this._config.scrollEndListener();\n }\n };\n }\n\n public destroy(): void {\n if (this._open) {\n this.close();\n }\n }\n\n public open(): void {\n if (!this._open) {\n this._open = true;\n this._adapter.open(this._config, this._selectListener, this._closeListener);\n window.requestAnimationFrame(() => {\n if (this._open) {\n this.activateInitialOption();\n }\n });\n\n if (this._config.observeScroll && this._config.scrollEndListener) {\n this._adapter.setScrollBottomListener(this._scrollEndListener, this._config.observeScrollThreshold || 0);\n }\n }\n }\n\n public close(): void {\n if (this._open) {\n this._open = false;\n this._adapter.close();\n if (this._config.observeScroll && this._config.scrollEndListener) {\n this._adapter.removeScrollBottomListener(this._scrollEndListener);\n }\n }\n }\n\n private _onSelect(value: any, id: string): void {\n if (typeof this._config.activeChangeCallback === 'function') {\n this._config.activeChangeCallback(id);\n }\n\n if (typeof this._config.selectCallback === 'function') {\n this._config.selectCallback(value);\n }\n\n if (this._open) {\n const sync = this._config.syncWidth === undefined ? true : false;\n // Keep the popup width at least the same as the target if the target size has now changed\n this._adapter.syncWidth(sync);\n }\n }\n\n public getActiveOptionIndex(): number {\n return this._adapter.getActiveOptionIndex();\n }\n\n public getActiveOption(): IListDropdownOption | undefined {\n const index = this.getActiveOptionIndex();\n return index >= 0 ? this._nonDividerOptions[index] : undefined;\n }\n \n public toggleOptionMultiple(index: number, isSelected: boolean): void {\n return this._adapter.toggleOptionMultiple(index, isSelected);\n }\n\n public activateSelectedOption(): void {\n this._adapter.activateSelectedOption(this._config);\n }\n\n public activateFirstOption(): number {\n const index = this._nonDividerOptions.findIndex(o => !o.disabled);\n if (index !== -1) {\n this.activateOption(index);\n }\n return index;\n }\n\n public activateLastOption(): number {\n const options = this._nonDividerOptions;\n const index = (options.length - 1) - options.findIndex(o => !o.disabled);\n if (index !== -1) {\n this.activateOption(index);\n }\n return index;\n }\n\n public activateOption(index: number, animate?: boolean): void {\n return this._adapter.activateOption(index, this._config.activeChangeCallback, animate);\n }\n\n public activateInitialOption(): void {\n if (typeof this._config.activeStartIndex === 'number' && this._nonDividerOptions[this._config.activeStartIndex]) {\n this.activateOption(this._config.activeStartIndex, false);\n this._adapter.scrollSelectedOptionIntoView(false);\n } else if (this._config.selectedValues && this._config.selectedValues.length) {\n this._adapter.scrollSelectedOptionIntoView(false);\n } else if (typeof this._config.visibleStartIndex === 'number' && this._nonDividerOptions[this._config.visibleStartIndex]) {\n this._adapter.scrollOptionIntoView(this._config.visibleStartIndex);\n }\n }\n\n public setSelectedValues(values: any[]): void {\n if (!Array.isArray(values)) {\n values = [values];\n }\n if (!this._config.multiple && values.length > 1) {\n values = [values[0]];\n }\n this._config.selectedValues = values;\n this._adapter.setSelectedValues(values, this._config.multiple);\n }\n\n public clearActiveOption(): void {\n this._adapter.clearActiveOption();\n }\n\n public setOptions(options: Array<IListDropdownOption | IListDropdownOptionGroup>): void {\n this._config.options = options;\n if (!this._open) {\n return;\n }\n this._adapter.setOptions(this._config);\n this.activateInitialOption();\n }\n\n public appendOptions(options: Array<IListDropdownOption | IListDropdownOptionGroup>): void {\n this._config.options = [...this._config.options, ...options] as Array<IListDropdownOption | IListDropdownOptionGroup>;\n if (!this._open) {\n return;\n }\n this._adapter.appendOptions(options, this._config);\n }\n\n public get dropdownElement(): HTMLElement | undefined {\n return this._adapter.dropdownElement;\n }\n\n public scrollSelectedOptionIntoView(animate = true): void {\n this._adapter.scrollSelectedOptionIntoView(animate);\n }\n\n public setScrollBottomListener(listener: () => void, threshold?: number): void {\n this._config.scrollEndListener = listener;\n this._config.observeScroll = true;\n this._config.observeScrollThreshold = threshold;\n this._adapter.setScrollBottomListener(this._scrollEndListener, this._config.observeScrollThreshold || 0);\n }\n\n public removeScrollBottomListener(): void {\n this._config.scrollEndListener = undefined;\n this._adapter.removeScrollBottomListener(this._scrollEndListener);\n }\n\n public setBusyVisibility(isVisible: boolean): void {\n if (!this._config.allowBusy) {\n return;\n }\n this._adapter.setBusyVisibility(isVisible);\n }\n\n public handleKey(key: string): void {\n switch (key) {\n case 'Enter':\n case 'NumpadEnter':\n const activeOptionIndex = this.getActiveOptionIndex();\n const activeOption = this._nonDividerOptions[activeOptionIndex];\n if (this._canSelectOption(activeOption)) {\n const id = this._adapter.getActiveOptionIdByIndex(activeOptionIndex);\n if (id) {\n this._onSelect(activeOption.value, id);\n }\n }\n break;\n case 'Up':\n case 'ArrowUp':\n case 'Down':\n case 'ArrowDown':\n const options = this._nonDividerOptions;\n if (options.length && options.every(o => !this._canSelectOption(o))) {\n return;\n }\n const index = this._getNextActiveOptionIndex(key);\n this.activateOption(index);\n break;\n case 'Home':\n this.activateFirstOption();\n break;\n case 'End':\n this.activateLastOption();\n break;\n }\n }\n\n private _canSelectOption(option: IListDropdownOption): boolean {\n return option && !option.disabled && !option.divider;\n }\n\n private _getNextActiveOptionIndex(key: string): number {\n let index = this._adapter.getActiveOptionIndex();\n if (index === -1) {\n index = this._adapter.getSelectedOptionIndex();\n }\n if (key === 'ArrowUp' || key === 'Up') {\n return this._getPreviousHighlightableOptionIndex(index, this._nonDividerOptions);\n }\n return this._getNextHighlightableOptionIndex(index, this._nonDividerOptions);\n }\n\n private _getPreviousHighlightableOptionIndex(startIndex: number, options: IListDropdownOption[]): number {\n const index = startIndex <= 0 ? options.length - 1 : startIndex - 1;\n if (options[index].disabled) {\n return this._getPreviousHighlightableOptionIndex(index, options);\n }\n return index;\n }\n\n private _getNextHighlightableOptionIndex(startIndex: number, options: IListDropdownOption[]): number {\n const index = startIndex === options.length - 1 ? 0 : startIndex + 1;\n if (options[index].disabled) {\n return this._getNextHighlightableOptionIndex(index, options);\n }\n return index;\n }\n\n private get _flatOptions(): IListDropdownOption[] {\n return getFlattenedOptions(this._config.options);\n }\n\n private get _nonDividerOptions(): IListDropdownOption[] {\n return this._flatOptions.filter(o => !o.divider);\n }\n}\n", "import { IListDropdownOption, IListDropdownOpenConfig, IListDropdownOptionGroup, LIST_DROPDOWN_CONSTANTS } from './list-dropdown-constants';\nimport { createDropdown, createList, createListItems, createAsyncElement, createBusyElement, createCheckboxElement } from './list-dropdown-utils';\nimport { IPopupComponent, POPUP_CONSTANTS } from '../popup';\nimport { IListComponent } from '../list/list';\nimport { LIST_ITEM_CONSTANTS, IListItemComponent, IListItemSelectEventData } from '../list/list-item';\nimport { ScrollEvents, getShadowElement, IScrollObserverConfiguration, ScrollAxisObserver, removeAllChildren, isFunction, removeElement, replaceElement, createVisuallyHiddenElement, isDeepEqual, tryScrollIntoView } from '@tylertech/forge-core';\nimport { ILinearProgressComponent } from '../linear-progress';\nimport { ICON_CONSTANTS, IIconComponent } from '../icon';\n\nexport interface IListDropdownAdapter {\n dropdownElement: HTMLElement | undefined;\n open(config: IListDropdownOpenConfig, selectCallback: (value: any, id: string) => void, closeCb: () => void): void;\n close(): void;\n setScrollBottomListener(listener: () => void, scrollThreshold: number): void;\n removeScrollBottomListener(listener: () => void): void;\n getActiveOptionIndex(): number;\n getSelectedOptionIndex(): number;\n getActiveOptionIdByIndex(index: number): string | null;\n toggleOptionMultiple(index: number, isSelected: boolean): void;\n scrollOptionIntoView(index: number): void;\n scrollSelectedOptionIntoView(animate?: boolean): void;\n activateSelectedOption(config: IListDropdownOpenConfig): void;\n activateOption(index: number, activeChangeCallback: ((id: string) => void) | undefined, animate?: boolean): void;\n setSelectedValues(values: any[], multiple?: boolean): void;\n clearActiveOption(): void;\n syncWidth(sync: boolean, targetWidthCallback?: () => number): void;\n setOptions(config: IListDropdownOpenConfig): void;\n appendOptions(options: Array<IListDropdownOption | IListDropdownOptionGroup>, config: IListDropdownOpenConfig): void;\n setBusyVisibility(isVisible: boolean): void;\n getScreenWidth(): number;\n}\n\nexport class ListDropdownAdapter implements IListDropdownAdapter {\n private _dropdownElement: IPopupComponent | undefined;\n private _listElement: IListComponent | undefined;\n private _announcerElement: HTMLElement | undefined;\n private _scrollObserver: ScrollAxisObserver | undefined;\n private _asyncElement: HTMLElement | undefined;\n private _busyElement: ILinearProgressComponent;\n private _headerElement: HTMLElement;\n private _footerElement: HTMLElement;\n\n constructor(private _targetElement: HTMLElement) {}\n\n public get dropdownElement(): HTMLElement | undefined {\n return this._dropdownElement;\n }\n\n public open(config: IListDropdownOpenConfig, selectCallback: (value: any, id: string) => void, closeCb: () => void): void {\n // Now lets create the popup and append the children\n this._dropdownElement = createDropdown(config, this._targetElement);\n this.syncWidth(!!config.syncWidth, config.targetWidthCallback);\n\n // If we are configured to show a busy indicator (linear progress bar across the top), then create and append it first\n if (config.allowBusy) {\n this._busyElement = createBusyElement();\n this._busyElement.style.display = 'none';\n this._dropdownElement.appendChild(this._busyElement);\n }\n\n // Create the header element if a builder exists\n if (config.headerBuilder) {\n this._headerElement = config.headerBuilder();\n if (this._headerElement) {\n this._headerElement.setAttribute(LIST_DROPDOWN_CONSTANTS.attributes.DATA_ALLOW_FOCUS, '');\n }\n }\n \n // Create the footer element if a builder exists\n if (config.footerBuilder) {\n this._footerElement = config.footerBuilder();\n if (this._footerElement) {\n this._footerElement.setAttribute(LIST_DROPDOWN_CONSTANTS.attributes.DATA_ALLOW_FOCUS, '');\n }\n }\n\n // Create the list from our config\n this._listElement = createList(config);\n\n // Add the listener for when list items are selected from the dropdown\n this._listElement.addEventListener(LIST_ITEM_CONSTANTS.events.SELECT, (evt: CustomEvent<IListItemSelectEventData>) => {\n evt.detail.listItem.setAttribute('aria-selected', 'true');\n selectCallback(evt.detail.value, evt.detail.listItem.id);\n });\n\n // Determine if we need to show the list or the async element first\n if (config.options.length) {\n // Now we can create an append the list items\n createListItems(config, this._listElement);\n this._dropdownElement.appendChild(this._listElement);\n\n // Always append the optional header element **first**\n if (this._headerElement) {\n this._dropdownElement.insertAdjacentElement('afterbegin', this._headerElement);\n }\n\n // Always append the optional footer element **last**\n if (this._footerElement) {\n this._dropdownElement.appendChild(this._footerElement);\n }\n } else if (config.allowBusy) {\n this._asyncElement = createAsyncElement(config.asyncStyle);\n this._dropdownElement.appendChild(this._asyncElement);\n }\n\n // Create the announcer element for a11y\n this._announcerElement = createVisuallyHiddenElement();\n this._announcerElement.id = `${config.id}-activedescendant`;\n this._dropdownElement.appendChild(this._announcerElement);\n\n // Open the popup\n this._dropdownElement.open = true;\n }\n\n public close(): void {\n if (!this._dropdownElement) {\n return;\n }\n this._dropdownElement.open = false;\n this._dropdownElement = undefined;\n this._listElement = undefined;\n this._announcerElement = undefined;\n }\n\n public setScrollBottomListener(listener: () => void, scrollThreshold: number): void {\n if (this._dropdownElement) {\n if (!this._scrollObserver) {\n const scrollTarget = getShadowElement(this._dropdownElement, POPUP_CONSTANTS.selectors.CONTAINER);\n const scrollConfig: IScrollObserverConfiguration = { scrollThreshold };\n this._scrollObserver = new ScrollAxisObserver(scrollTarget, scrollConfig);\n this._scrollObserver.addListener(ScrollEvents.ScrolledEnd, listener);\n }\n }\n }\n\n public removeScrollBottomListener(listener: () => void): void {\n if (this._scrollObserver) {\n this._scrollObserver.removeListener(ScrollEvents.ScrolledEnd, listener);\n }\n }\n\n public getActiveOptionIndex(): number {\n if (!this._dropdownElement) {\n return -1;\n }\n const listItems = this._getListItemElements();\n const activeListItem = [...listItems].reverse().find(li => li.active);\n return activeListItem ? listItems.indexOf(activeListItem) : -1;\n }\n\n public getSelectedOptionIndex(): number {\n const listItems = this._getListItemElements();\n return listItems.findIndex(li => li.selected);\n }\n\n public getActiveOptionIdByIndex(index: number): string | null {\n if (!this._dropdownElement) {\n return null;\n }\n const listItems = this._getListItemElements();\n const item = listItems[index];\n return item ? item.id : null;\n }\n\n public toggleOptionMultiple(index: number, isSelected: boolean): void {\n if (!this._dropdownElement) {\n return;\n }\n\n const listItems = this._getListItemElements();\n if (listItems.length && listItems[index]) {\n this._toggleSelectedOption(listItems[index], isSelected);\n }\n }\n\n public scrollOptionIntoView(index: number, animate = true): void {\n const listItem = this._getListItemElements()[index];\n if (listItem) {\n this._scrollListItemIntoView(listItem, animate ? 'smooth' : 'auto', 'center');\n }\n }\n\n public scrollSelectedOptionIntoView(animate = true): void {\n const listItem = this._getSelectedListItem();\n this._scrollListItemIntoView(listItem, animate ? 'smooth' : 'auto', 'center');\n }\n\n public activateSelectedOption(config: IListDropdownOpenConfig): void {\n const listItems = this._getListItemElements();\n if (listItems.length) {\n const activeListItems = listItems.filter(li => li.active);\n activeListItems.forEach(li => li.active = false);\n }\n \n const listItem = this._getSelectedListItem();\n if (listItem) {\n this._activateListOption(listItem, config.activeChangeCallback);\n }\n }\n\n public activateOption(index: number, activeChangeCallback: ((id: string) => void) | undefined, animate = true): void {\n if (!this._dropdownElement) {\n return;\n }\n const listItems = this._getListItemElements();\n if (listItems.length) {\n const activeListItems = listItems.filter(li => li.active);\n activeListItems.forEach(li => li.active = false);\n this._activateListOption(listItems[index], activeChangeCallback);\n this._scrollListItemIntoView(listItems[index], animate ? 'smooth' : 'auto');\n }\n }\n\n public setSelectedValues(values: any[], multiple = false): void {\n if (!this._dropdownElement) {\n return;\n }\n const listItems = this._getListItemElements();\n for (const listItem of listItems) {\n const isSelected = values.some(v => isDeepEqual(v, listItem.value));\n listItem.selected = isSelected;\n\n if (multiple) {\n const checkboxElement = listItem.querySelector(`[${LIST_DROPDOWN_CONSTANTS.attributes.CHECKBOX_ELEMENT}]`) as IIconComponent;\n if (checkboxElement) {\n const newCheckboxElement = createCheckboxElement(isSelected);\n replaceElement(newCheckboxElement, checkboxElement);\n }\n }\n }\n }\n\n public clearActiveOption(): void {\n const listItems = this._getListItemElements();\n listItems.forEach(li => li.active = false);\n }\n\n public syncWidth(sync: boolean, targetWidthCallback?: () => number): void {\n if (this._dropdownElement) {\n this._dropdownElement.style[sync ? 'width' : 'minWidth'] = `${this._getTargetElementWidth(targetWidthCallback)}px`;\n }\n }\n\n public setOptions(config: IListDropdownOpenConfig): void {\n if (!this._dropdownElement || !this._listElement) {\n return;\n }\n if (this._asyncElement && this._asyncElement.isConnected) {\n removeElement(this._asyncElement);\n }\n if (this._busyElement) {\n this._busyElement.close();\n }\n if (!this._listElement.isConnected) {\n this._dropdownElement.appendChild(this._listElement);\n }\n \n removeAllChildren(this._listElement);\n createListItems(config, this._listElement);\n\n if (this._headerElement && !this._headerElement.isConnected) {\n this._dropdownElement.insertAdjacentElement('afterbegin', this._headerElement);\n }\n if (this._footerElement && !this._footerElement.isConnected) {\n this._dropdownElement.insertAdjacentElement('beforeend', this._footerElement);\n }\n if ('position' in this._dropdownElement && typeof this._dropdownElement.position === 'function') {\n this._dropdownElement.position();\n }\n }\n\n public appendOptions(options: Array<IListDropdownOption | IListDropdownOptionGroup>, config: IListDropdownOpenConfig): void {\n if (!this._dropdownElement || !this._listElement) {\n return;\n }\n createListItems(config, this._listElement, options, this._listElement.childElementCount, false);\n }\n\n public setBusyVisibility(isVisible: boolean): void {\n if (!this._dropdownElement) {\n return;\n }\n if (isVisible) {\n this._busyElement.style.removeProperty('display');\n this._busyElement.open();\n } else {\n this._busyElement.close();\n }\n }\n\n public getScreenWidth(): number {\n return window.innerWidth;\n }\n\n private _getListItemElements(): IListItemComponent[] {\n return this._dropdownElement ? Array.from(this._dropdownElement.querySelectorAll(LIST_ITEM_CONSTANTS.elementName)) as IListItemComponent[] : [];\n }\n\n private _toggleSelectedOption(listItem: IListItemComponent, isSelected: boolean): void {\n if (!this._dropdownElement) {\n return;\n }\n\n // First we need to remove the active state from any other list items\n const listItems = this._getListItemElements();\n if (listItems.length) {\n const activeItems = listItems.filter(li => li !== listItem && li.active);\n if (activeItems.length) {\n activeItems.forEach(ai => ai.active = false);\n }\n }\n\n // Now we can toggle the selected state and sync the active state\n listItem.selected = isSelected;\n listItem.setAttribute('aria-selected', `${isSelected}`);\n listItem.setAttribute('aria-checked', `${isSelected}`);\n\n if (isSelected) {\n listItem.active = true;\n }\n\n // Toggle the checkbox icon based on the selected state\n const checkboxElement = listItem.querySelector(`${ICON_CONSTANTS.elementName}[slot=leading]`) as IIconComponent;\n if (checkboxElement) {\n const newCheckboxElement = createCheckboxElement(isSelected);\n replaceElement(newCheckboxElement, checkboxElement);\n }\n }\n\n private _getTargetElementWidth(cb?: () => number): number {\n if (cb && isFunction(cb)) {\n return cb();\n }\n return this._targetElement.getBoundingClientRect().width;\n }\n\n private _activateListOption(listItem: IListItemComponent | undefined, activeChangeCallback?: (id: string) => void): void {\n if (listItem && !listItem.disabled) {\n listItem.active = true;\n if (activeChangeCallback && isFunction(activeChangeCallback)) {\n activeChangeCallback(listItem.id);\n }\n }\n }\n\n private _scrollListItemIntoView(listItem: HTMLElement | undefined, behavior: 'auto' | 'smooth' = 'auto', block: 'nearest' | 'center' = 'nearest'): void {\n if (listItem && this._dropdownElement && this._dropdownElement.isConnected) {\n const scrollContainer = getShadowElement(this._dropdownElement, POPUP_CONSTANTS.selectors.CONTAINER);\n if (scrollContainer) {\n tryScrollIntoView(scrollContainer, listItem, behavior, block);\n }\n }\n }\n\n private _getSelectedListItem(): IListItemComponent | undefined {\n const listItems = this._getListItemElements();\n return listItems.find(li => li.selected);\n }\n}\n", "import { tylIconCheckBox, tylIconCheckBoxOutlineBlank } from '@tylertech/tyler-icons/standard';\n\nimport { IListDropdownConfig, IListDropdownOption, IListDropdownOptionGroup } from './list-dropdown-constants';\nimport { ListDropdownFoundation } from './list-dropdown-foundation';\nimport { ListDropdownAdapter } from './list-dropdown-adapter';\nimport { IconRegistry } from '../icon';\n\nexport interface IListDropdown {\n dropdownElement: HTMLElement | undefined;\n open(): void;\n close(): void;\n destroy(): void;\n getActiveOptionIndex(): number;\n getActiveOption(): IListDropdownOption | undefined;\n toggleOptionMultiple(index: number, isSelected: boolean): void;\n activateSelectedOption(): void;\n activateFirstOption(): number;\n activateOption(index: number): void;\n activateInitialOption(): void;\n clearActiveOption(): void;\n setSelectedValues(values: any[]): void;\n setOptions(options: Array<IListDropdownOption | IListDropdownOptionGroup>): void;\n appendOptions(options: Array<IListDropdownOption | IListDropdownOptionGroup>): void;\n scrollSelectedOptionIntoView(animate?: boolean): void;\n setScrollBottomListener(listener: () => void, threshold?: number): void;\n removeScrollBottomListener(): void;\n setBusyVisibility(isVisible: boolean): void;\n handleKey(key: string): void;\n}\n\nexport class ListDropdown implements IListDropdown {\n private _foundation: ListDropdownFoundation;\n\n constructor(private _targetElement: HTMLElement, config: IListDropdownConfig) {\n IconRegistry.define([tylIconCheckBox, tylIconCheckBoxOutlineBlank]);\n this._foundation = new ListDropdownFoundation(new ListDropdownAdapter(this._targetElement), config);\n }\n\n public destroy(): void {\n this._foundation.destroy();\n }\n\n /** Opens the dropdown. */\n public open(): void {\n this._foundation.open();\n }\n\n /** Closes the dropdown. */\n public close(): void {\n this._foundation.close();\n }\n\n /** Gets the currently highlighted option index in the dropdown. */\n public getActiveOptionIndex(): number {\n return this._foundation.getActiveOptionIndex();\n }\n\n public getActiveOption(): IListDropdownOption | undefined {\n return this._foundation.getActiveOption();\n }\n \n /** Toggles the selected option by index. Only applies when in multiselect mode. */\n public toggleOptionMultiple(index: number, isSelected: boolean): void {\n return this._foundation.toggleOptionMultiple(index, isSelected);\n }\n \n /** Activates the first selected option. */\n public activateSelectedOption(): void {\n this._foundation.activateSelectedOption();\n }\n\n /** Activates the first non-disabled option. */\n public activateFirstOption(): number {\n return this._foundation.activateFirstOption();\n }\n\n /** Activates (highlights) an option by index. */\n public activateOption(index: number): void {\n return this._foundation.activateOption(index);\n }\n\n /** Activates the first activatable option. */\n public activateInitialOption(): void {\n return this._foundation.activateInitialOption();\n }\n\n /** Clears the active option from the dropdown */\n public clearActiveOption(): void {\n this._foundation.clearActiveOption();\n }\n\n /** Sets the selected values. Only applies when in multiselect mode. */\n public setSelectedValues(values: any[]): void {\n return this._foundation.setSelectedValues(values);\n }\n\n public get dropdownElement(): HTMLElement | undefined {\n return this._foundation.dropdownElement;\n }\n\n public setOptions(options: Array<IListDropdownOption | IListDropdownOptionGroup>): void {\n this._foundation.setOptions(options);\n }\n\n public appendOptions(options: Array<IListDropdownOption | IListDropdownOptionGroup>): void {\n this._foundation.appendOptions(options);\n }\n\n public scrollSelectedOptionIntoView(animate?: boolean): void {\n this._foundation.scrollSelectedOptionIntoView();\n }\n\n public setScrollBottomListener(listener: () => void, threshold?: number): void {\n this._foundation.setScrollBottomListener(listener, threshold);\n }\n\n public removeScrollBottomListener(): void {\n this._foundation.removeScrollBottomListener();\n }\n\n public setBusyVisibility(isVisible: boolean): void {\n this._foundation.setBusyVisibility(isVisible);\n }\n\n public handleKey(key: string): void {\n this._foundation.handleKey(key);\n }\n}\n", "import { ICustomElementFoundation } from '@tylertech/forge-core';\n\nimport { ListDropdownHeaderBuilder, ListDropdownFooterBuilder } from './list-dropdown-constants';\n\nexport interface IListDropdownAwareFoundation extends ICustomElementFoundation {\n popupClasses: string | string[];\n popupHeaderBuilder: ListDropdownHeaderBuilder;\n popupFooterBuilder: ListDropdownHeaderBuilder;\n syncPopupWidth: boolean;\n optionLimit: number;\n observeScroll: boolean;\n observeScrollThreshold: number;\n constrainPopupWidth: boolean;\n wrapOptionText: boolean;\n}\n\nexport abstract class ListDropdownAwareFoundation implements IListDropdownAwareFoundation {\n protected _popupClasses: string | string[] = [];\n protected _popupHeaderBuilder: ListDropdownHeaderBuilder;\n protected _popupFooterBuilder: ListDropdownFooterBuilder;\n protected _syncPopupWidth = false;\n protected _optionLimit = 0;\n protected _observeScroll = false;\n protected _observeScrollThreshold = 0;\n protected _constrainPopupWidth = true;\n protected _wrapOptionText = false;\n\n public get syncPopupWidth(): boolean {\n return this._syncPopupWidth;\n }\n public set syncPopupWidth(value: boolean) {\n this._syncPopupWidth = value;\n }\n\n public get popupClasses(): string | string[] {\n return this._popupClasses;\n }\n public set popupClasses(value: string | string[]) {\n if (typeof value === 'string') {\n value = [value];\n }\n if (Array.isArray(value)) {\n this._popupClasses = value;\n }\n }\n\n public get observeScroll(): boolean {\n return this._observeScroll;\n }\n public set observeScroll(value: boolean) {\n this._observeScroll = value;\n }\n\n public get observeScrollThreshold(): number {\n return this._observeScrollThreshold;\n }\n public set observeScrollThreshold(value: number) {\n this._observeScrollThreshold = value;\n }\n\n public get optionLimit(): number {\n return this._optionLimit;\n }\n public set optionLimit(value: number) {\n this._optionLimit = value;\n }\n\n public get popupHeaderBuilder(): ListDropdownHeaderBuilder {\n return this._popupHeaderBuilder;\n }\n public set popupHeaderBuilder(value: ListDropdownHeaderBuilder) {\n this._popupHeaderBuilder = value;\n }\n\n public get popupFooterBuilder(): ListDropdownFooterBuilder {\n return this._popupFooterBuilder;\n }\n public set popupFooterBuilder(value: ListDropdownFooterBuilder) {\n this._popupFooterBuilder = value;\n }\n\n public get constrainPopupWidth(): boolean {\n return this._constrainPopupWidth;\n }\n public set constrainPopupWidth(value: boolean) {\n this._constrainPopupWidth = value;\n }\n\n public get wrapOptionText(): boolean {\n return this._wrapOptionText;\n }\n public set wrapOptionText(value: boolean) {\n this._wrapOptionText = value;\n }\n\n protected _applySelection(): void {}\n}\n", "import { IListDropdownAwareFoundation, ListDropdownAwareFoundation } from './list-dropdown-aware-foundation';\n\nexport interface ICascadingListDropdownAwareFoundation extends IListDropdownAwareFoundation {}\n\nexport interface ICascadingListDropdownAwareFoundationConfiguration {\n popupTimeout: number;\n targetTimeout: number;\n}\n\nexport abstract class CascadingListDropdownAwareFoundation<T> extends ListDropdownAwareFoundation implements ICascadingListDropdownAwareFoundation {\n protected _open = false;\n protected _options: T[] = [];\n protected _childOpen = false;\n protected _popupHasMouse = false; // Used to determine if the popup element is under the users mouse\n protected _mouseCoords: { x: number; y: number };\n protected _activeMouseLeaveTimeout: number;\n protected _targetMouseEnterListener: (evt: MouseEvent) => void;\n protected _targetMouseLeaveListener: (evt: MouseEvent) => void;\n protected _childPopupMouseEnterListener: (evt: MouseEvent) => void;\n protected _childPopupMouseLeaveListener: (evt: MouseEvent) => void;\n protected _documentMouseMoveListener: (evt: MouseEvent) => void;\n \n protected abstract _attachCascadingListeners(): void;\n protected abstract _detachCascadingListeners(): void;\n protected abstract _onCascadingOptionSelected(data: any): void;\n protected abstract _onCascadingChildOpen(index: number): void;\n protected abstract _onCascadingChildClose(index: number): void;\n protected abstract _closeDropdown(): void;\n protected abstract _openDropdown({ fromKeyboard }: { fromKeyboard?: boolean }): void;\n protected abstract _setCascadeTargetInactive(): void;\n protected abstract _isOwnElement(element: Element): boolean;\n\n constructor(private _config: ICascadingListDropdownAwareFoundationConfiguration) {\n super();\n this._targetMouseEnterListener = evt => this._onTargetMouseEnter(evt);\n this._targetMouseLeaveListener = evt => this._onTargetMouseLeave(evt);\n this._childPopupMouseEnterListener = () => this._onChildPopupMouseEnter();\n this._childPopupMouseLeaveListener = () => this._onChildPopupMouseLeave();\n this._documentMouseMoveListener = evt => this._mouseCoords = { x: evt.pageX, y: evt.pageY };\n }\n\n private _onChildPopupMouseEnter(): void {\n this._popupHasMouse = true;\n }\n\n private _onChildPopupMouseLeave(): void {\n this._popupHasMouse = false;\n setTimeout(() => {\n const mouseElement = document.elementFromPoint(this._mouseCoords.x, this._mouseCoords.y);\n if (!this._popupHasMouse && !this._childOpen && (!mouseElement || !this._isOwnElement(mouseElement))) {\n this._setCascadeTargetInactive();\n this._closeDropdown();\n }\n }, this._config.popupTimeout);\n }\n\n private _onTargetMouseEnter(evt: MouseEvent): void {\n if (!this._options.length) {\n return;\n }\n this._openDropdown({ fromKeyboard: false });\n }\n\n private _onTargetMouseLeave(evt: MouseEvent): void {\n // We wrap this in a timeout to allow for the user to take an indirect path toward an open child menu. This\n // allows for the popup to stay open while the user is moving their mouse to it (makes the transition easier and more smooth)\n this._activeMouseLeaveTimeout = window.setTimeout(() => {\n // Ignore this if our open state has changed, or if we have a child popup open now\n if (!this._open || this._childOpen) {\n return;\n }\n if (this._mouseCoords) {\n // We ignore this event if the mouse moved to an element within our own popup\n const mouseElement = document.elementFromPoint(this._mouseCoords.x, this._mouseCoords.y);\n if (mouseElement && this._isOwnElement(mouseElement)) {\n return;\n }\n }\n this._setCascadeTargetInactive();\n this._closeDropdown();\n }, this._config.targetTimeout);\n }\n\n protected _clearMouseLeaveTimeout(): void {\n if (this._activeMouseLeaveTimeout !== undefined) {\n window.clearTimeout(this._activeMouseLeaveTimeout);\n }\n }\n}\n"],
|
|
5
|
+
"mappings": "4lBAEA,IAAMA,GAAa,CACjB,cAAe,gBACf,aAAc,eACd,eAAgB,iBAChB,yBAA0B,2BAC1B,iBAAkB,mBAClB,sBAAuB,wBACvB,iBAAkB,mBAGlB,iBAAkB,8BAClB,iBAAkB,gCACpB,EAEMC,GAAU,CACd,cAAe,oCACjB,EAEaC,EAA0B,CACrC,WAAAF,GACA,QAAAC,EACF,EAqFaE,EAA6D,CACxE,QAAS,CAAC,EACV,UAAW,GACX,eAAgB,CAAC,EACjB,SAAU,EACZ,EAIYC,QACVA,EAAA,KAAO,OACPA,EAAA,SAAW,WACXA,EAAA,KAAO,OAHGA,QAAA,IAMAC,QACVA,EAAA,QAAU,UACVA,EAAA,SAAW,WAFDA,QAAA,IC3HL,IAAMC,EAAN,KAAiB,CACpB,aAAc,CACV,KAAK,aAAe,IAAI,GAC5B,CACA,MAAMC,EAAMC,EAAM,CACd,IAAMC,EAAY,KAAK,aAAa,IAAIF,CAAI,EACxCE,GAAaA,EAAU,QACvBA,EAA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AgC,CACtC,KAAK,eAAiB,EACxB,CAEQ,yBAAgC,CACtC,KAAK,eAAiB,GACtB,WAAW,IAAM,CACf,IAAMC,EAAe,SAAS,iBAAiB,KAAK,aAAa,EAAG,KAAK,aAAa,CAAC,EACnF,CAAC,KAAK,gBAAkB,CAAC,KAAK,aAAe,CAACA,GAAgB,CAAC,KAAK,cAAcA,CAAY,KAChG,KAAK,0BAA0B,EAC/B,KAAK,eAAe,EAExB,EAAG,KAAK,QAAQ,YAAY,CAC9B,CAEQ,oBAAoBD,EAAuB,CAC7C,CAAC,KAAK,SAAS,QAGnB,KAAK,cAAc,CAAE,aAAc,EAAM,CAAC,CAC5C,CAEQ,oBAAoBA,EAAuB,CAGjD,KAAK,yBAA2B,OAAO,WAAW,IAAM,CAEtD,GAAI,GAAC,KAAK,OAAS,KAAK,YAGxB,IAAI,KAAK,aAAc,CAErB,IAAMC,EAAe,SAAS,iBAAiB,KAAK,aAAa,EAAG,KAAK,aAAa,CAAC,EACvF,GAAIA,GAAgB,KAAK,cAAcA,CAAY,EACjD,MAEJ,CACA,KAAK,0BAA0B,EAC/B,KAAK,eAAe,EACtB,EAAG,KAAK,QAAQ,aAAa,CAC/B,CAEU,yBAAgC,CACpC,KAAK,2BAA6B,QACpC,OAAO,aAAa,KAAK,wBAAwB,CAErD,CACF",
|
|
6
|
+
"names": ["attributes", "classes", "LIST_DROPDOWN_CONSTANTS", "DEFAULT_LIST_DROPDOWN_CONFIG", "ListDropdownType", "ListDropdownAsyncStyle", "EventAware", "type", "data", "listeners", "cb", "listener", "ScrollDirection", "ScrollEvents", "DEFAULT_SCROLL_THROTTLE", "ScrollAxisObserver", "EventAware", "_element", "_config", "wait", "throttle", "isDefined", "isNumber", "isVertical", "isHorizontal", "position", "direction", "ScrollDirection", "ScrollEvents", "scrollStart", "scrollEnd", "createDropdown", "config", "targetElement", "dropdownElement", "createPopupDropdown", "dropdownId", "evt", "composedPath", "getEventPath", "el", "LIST_DROPDOWN_CONSTANTS", "addClass", "_a", "popupElement", "POPUP_CONSTANTS", "createList", "listElement", "LIST_CONSTANTS", "createListItems", "options", "startIndex", "renderSelected", "groups", "getOptionsByGroup", "flatOptions", "getFlattenedOptions", "limitOptions", "optionLimit", "optionIdIndex", "group", "optionParent", "headerElement", "groupWrapper", "listHeaderElement", "option", "dividerElement", "createDivider", "isSelected", "v", "isDeepEqual", "listItemElement", "element", "result", "checkboxElement", "createCheckboxElement", "value", "key", "isObject", "leadingIconElement", "createIconElement", "trailingIconElement", "optionIconElement", "factoryConfig", "o", "cascadingElement", "selected", "tylIconCheckBox", "tylIconCheckBoxOutlineBlank", "divider", "type", "iconName", "iconClass", "icon", "iconElement", "ICON_CLASS_NAME", "createAsyncElement", "asyncStyle", "createSkeletonElement", "createSpinnerElement", "div", "spinner", "list", "i", "listItemSkeleton", "SKELETON_CONSTANTS", "createBusyElement", "linearProgress", "LINEAR_PROGRESS_CONSTANTS", "isListDropdownOptionType", "isOptionGroups", "isDefined", "isOptionTypes", "flatOpts", "ListDropdownFoundation", "_adapter", "config", "__spreadValues", "DEFAULT_LIST_DROPDOWN_CONFIG", "value", "id", "sync", "index", "isSelected", "o", "options", "animate", "values", "listener", "threshold", "isVisible", "key", "activeOptionIndex", "activeOption", "option", "startIndex", "getFlattenedOptions", "ListDropdownAdapter", "_targetElement", "config", "selectCallback", "closeCb", "createDropdown", "createBusyElement", "LIST_DROPDOWN_CONSTANTS", "createList", "LIST_ITEM_CONSTANTS", "evt", "createListItems", "createAsyncElement", "createVisuallyHiddenElement", "listener", "scrollThreshold", "scrollTarget", "getShadowElement", "POPUP_CONSTANTS", "scrollConfig", "ScrollAxisObserver", "ScrollEvents", "listItems", "activeListItem", "li", "index", "item", "isSelected", "animate", "listItem", "activeChangeCallback", "values", "multiple", "v", "isDeepEqual", "checkboxElement", "newCheckboxElement", "createCheckboxElement", "replaceElement", "sync", "targetWidthCallback", "removeElement", "removeAllChildren", "options", "isVisible", "activeItems", "ai", "ICON_CONSTANTS", "cb", "isFunction", "behavior", "block", "scrollContainer", "tryScrollIntoView", "ListDropdown", "_targetElement", "config", "IconRegistry", "tylIconCheckBox", "tylIconCheckBoxOutlineBlank", "ListDropdownFoundation", "ListDropdownAdapter", "index", "isSelected", "values", "options", "animate", "listener", "threshold", "isVisible", "key", "ListDropdownAwareFoundation", "value", "CascadingListDropdownAwareFoundation", "ListDropdownAwareFoundation", "_config", "evt", "mouseElement"]
|
|
7
|
+
}
|
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
* Copyright 2023 Tyler Technologies, Inc.
|
|
4
4
|
* License: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import{d as F}from"./chunk.K4DGAJOM.js";import{b as G}from"./chunk.7A6MX6CS.js";import{n as y,r as B,s as N,u as z}from"./chunk.MZLPUI6R.js";import{d as w}from"./chunk.4WPFFNLH.js";import{d as O,l as k}from"./chunk.JHBCYICS.js";import{a as x}from"./chunk.G5MGGEFP.js";import{a as p}from"./chunk.KTGSZEAG.js";import{a as S,b as I}from"./chunk.BE7PZANN.js";import{a as A,e as L,g as r,j as d,l as T}from"./chunk.Y4GKBJGI.js";import{d as v,f as _,g as P,t as E}from"./chunk.PN26D52V.js";import{b,i as m,k as l,l as c}from"./chunk.J2M2MXP2.js";import{f as n}from"./chunk.MCIQXNKY.js";var R=`${I}paginator`,g={LABEL:"forge-paginator__label",PAGE_SIZE_OPTIONS:"forge-paginator__page-size-options",RANGE_LABEL:"forge-paginator__range-label",RANGE_LABEL_ALTERNATIVE:"forge-paginator__range-label--alternative",FIRST_PAGE_BUTTON:"forge-paginator__first-page",PREVIOUS_PAGE_BUTTON:"forge-paginator__previous-page",NEXT_PAGE_BUTTON:"forge-paginator__next-page",LAST_PAGE_BUTTON:"forge-paginator__last-page",ROOT:"forge-paginator",ALTERNATIVE:"forge-paginator--alternative",ALIGNMENT_START:"forge-paginator--alignment-start",ALIGNMENT_SPACE_BETWEEN:"forge-paginator--alignment-center",ALIGNMENT_END:"forge-paginator--alignment-end"},U={LABEL:`.${g.LABEL}`,PAGE_SIZE_SELECT:`.${g.PAGE_SIZE_OPTIONS}`,RANGE_LABEL:`.${g.RANGE_LABEL}`,FIRST_PAGE_BUTTON:`.${g.FIRST_PAGE_BUTTON} > button`,FIRST_PAGE_ICON_BUTTON:`.${g.FIRST_PAGE_BUTTON}`,PREVIOUS_PAGE_BUTTON:`.${g.PREVIOUS_PAGE_BUTTON} > button`,NEXT_PAGE_BUTTON:`.${g.NEXT_PAGE_BUTTON} > button`,LAST_PAGE_BUTTON:`.${g.LAST_PAGE_BUTTON} > button`,LAST_PAGE_ICON_BUTTON:`.${g.LAST_PAGE_BUTTON}`,ROOT:`.${g.ROOT}`,RANGE_LABEL_ALTERNATIVE:`.${g.RANGE_LABEL_ALTERNATIVE}`},M={PAGE_INDEX:"page-index",PAGE_SIZE:"page-size",OFFSET:"offset",PAGE_SIZE_OPTIONS:"page-size-options",TOTAL:"total",LABEL:"label",FIRST_LAST:"first-last",FIRST:"first",DISABLED:"disabled",ALTERNATIVE:"alternative",ALIGNMENT:"alignment"},D={CHANGE:`${R}-change`},H={DEFAULT_PAGE_INDEX:0,DEFAULT_TOTAL:0,DEFAULT_PAGE_SIZE:25,DEFAULT_PAGE_SIZE_OPTIONS:[5,15,25,50,100]},$={DEFAULT_LABEL:"Rows per page:",RANGE_SEPARATOR_LABEL:"of",FIRST_PAGE:"first-page",PREVIOUS_PAGE:"previous-page",NEXT_PAGE:"next-page",LAST_PAGE:"last-page",PAGE_SIZE:"page-size"},e={elementName:R,classes:g,selectors:U,attributes:M,events:D,numbers:H,strings:$};var h=class{constructor(i){this._adapter=i;this._pageIndex=e.numbers.DEFAULT_PAGE_INDEX;this._pageSize=e.numbers.DEFAULT_PAGE_SIZE;this._total=e.numbers.DEFAULT_TOTAL;this._pageSizeOptions=[];this._label=e.strings.DEFAULT_LABEL;this._firstLast=!1;this._first=!1;this._disabled=!1;this._alignment="space-between";this._pageSizeListener=t=>this._onPageSizeChanged(t),this._firstPageListener=t=>this._onFirstPage(t),this._previousPageListener=t=>this._onPreviousPage(t),this._nextPageListener=t=>this._onNextPage(t),this._lastPageListener=t=>this._onLastPage(t),this._pageSizeOptions=e.numbers.DEFAULT_PAGE_SIZE_OPTIONS.map(t=>({label:t.toString(),value:t.toString()}))}set pageIndex(i){this._pageIndex!==i&&(b(i)?(this._pageIndex=i,this._update(),this._adapter.setHostAttribute(e.attributes.PAGE_INDEX,this._pageIndex.toString())):this._adapter.removeHostAttribute(e.attributes.PAGE_INDEX))}get pageIndex(){return this._pageIndex}set pageSize(i){this._pageSize!==i&&(this._pageSize=i,this._adapter.setPageSize(this._pageSize),this._update(),this._adapter.setHostAttribute(e.attributes.PAGE_SIZE,this._pageSize.toString()))}get pageSize(){return this._pageSize}set offset(i){i>=this._total&&(this._total>=this._pageSize?i=this._total-this._pageSize:i=0);let t=Math.min(Math.max(i,0),this._total);this.pageIndex=Math.floor(t/this._pageSize)}get offset(){return this._pageIndex*this._pageSize}set total(i){this._total!==i&&(this._total=i,this._update(),this._adapter.setHostAttribute(e.attributes.TOTAL,this._total.toString()))}get total(){return this._total}set pageSizeOptions(i){m(i)?(this._pageSizeOptions=i.map(t=>({label:t.toString(),value:t.toString()})).sort((t,s)=>c(t.value)-c(s.value)),this._adapter.setPageSizeOptions(this._pageSizeOptions),this._adapter.attachPageSizeChangeListener(this._pageSizeListener),this._adapter.setPageSizeVisibility(!0),b(this._pageSize)&&this._pageSizeOptions.length&&!this._pageSizeOptions.find(t=>c(t.value)===this._pageSize)&&(this.pageSize=c(this._pageSizeOptions[0].value))):i.toString().toLowerCase()==="false"&&(this._adapter.detachPageSizeChangeListener(this._pageSizeListener),this._adapter.setPageSizeVisibility(!1))}get pageSizeOptions(){return this._pageSizeOptions.map(i=>Number(i.value))}set label(i){this._label!==i&&(this._label=i,this._adapter.setLabel(this._label),this._adapter.setHostAttribute(e.attributes.LABEL,b(this._label)?this._label.toString():""))}get label(){return this._label}set firstLast(i){this._firstLast!==i&&(this._firstLast=i,this._toggleFirstLastButtons(),this._firstLast?this._adapter.setHostAttribute(e.attributes.FIRST_LAST):this._adapter.removeHostAttribute(e.attributes.FIRST_LAST))}get firstLast(){return this._firstLast}set first(i){this._first!==i&&(this._first=i,this._toggleFirstButton(),this._first?this._adapter.setHostAttribute(e.attributes.FIRST):this._adapter.removeHostAttribute(e.attributes.FIRST))}get first(){return this._first}set disabled(i){this._disabled!==i&&(this._disabled=i,this._update(),this._disabled?this._adapter.setHostAttribute(e.attributes.DISABLED):this._adapter.removeHostAttribute(e.attributes.DISABLED))}get disabled(){return this._disabled}get alternative(){return this._alternative}set alternative(i){i!==this._alternative&&(this._alternative=i,this._applyAlternative())}get alignment(){return this._alignment}set alignment(i){i!==this._alignment&&(this._alignment=i,this._applyAlternativeAlignment())}_applyAlternativeAlignment(){this._adapter.setHostAttribute(e.attributes.ALIGNMENT,this._alignment),this._adapter.setAlignment(this._alignment)}_applyAlternative(){this._adapter.toggleHostAttribute(e.attributes.ALTERNATIVE,this._alternative),this._adapter.setAlternative(this._alternative),this._applyAlternativeAlignment()}initialize(){this._update(),this._adapter.setLabel(this._label),this._adapter.setPageSizeOptions(this._pageSizeOptions),this._adapter.setPageSize(this._pageSize),this._attachListeners(),this._toggleFirstLastButtons()}disconnect(){this._detachListeners()}_attachListeners(){this._adapter.attachPageSizeChangeListener(this._pageSizeListener),this._adapter.attachFirstPageListener(this._firstPageListener),this._adapter.attachPreviousPageListener(this._previousPageListener),this._adapter.attachNextPageListener(this._nextPageListener),this._adapter.attachLastPageListener(this._lastPageListener)}_detachListeners(){this._adapter.detachPageSizeChangeListener(this._pageSizeListener),this._adapter.detachFirstPageListener(this._firstPageListener),this._adapter.detachPreviousPageListener(this._previousPageListener),this._adapter.detachNextPageListener(this._nextPageListener),this._adapter.detachLastPageListener(this._lastPageListener)}_onFirstPage(i){if(i.stopPropagation(),!this._hasFirstPage())return;let t=0;this._emitChangeEvent(e.strings.FIRST_PAGE,{pageIndex:t})&&(this.pageIndex=t)}_onPreviousPage(i){if(i.stopPropagation(),!this._hasPreviousPage())return;let t=this._pageIndex-1;this._emitChangeEvent(e.strings.PREVIOUS_PAGE,{pageIndex:t})&&(this.pageIndex=t)}_onNextPage(i){if(i.stopPropagation(),!this._hasNextPage())return;let t=this._pageIndex+1;this._emitChangeEvent(e.strings.NEXT_PAGE,{pageIndex:t})&&(this.pageIndex=t)}_onLastPage(i){if(i.stopPropagation(),!this._hasLastPage())return;let t=this._getMaxPages();this._emitChangeEvent(e.strings.LAST_PAGE,{pageIndex:t})&&(this.pageIndex=t)}_onPageSizeChanged(i){i.stopPropagation();let t=Number(i.detail);this._emitChangeEvent(e.strings.PAGE_SIZE,{pageIndex:0,pageSize:t})&&(this.pageIndex=0,this.pageSize=t,i.preventDefault())}_emitChangeEvent(i,{pageSize:t=this._pageSize,pageIndex:s=this._pageIndex}={}){let o=s*t,C={type:i,pageSize:t,pageIndex:s,offset:o};return this._adapter.emitHostEvent(e.events.CHANGE,C,!0,!0)}_getMaxPages(){return Math.ceil(this._total/this._pageSize)-1}_update(){if(this.pageSize>1){let i=this._pageIndex*this._pageSize,s=(Math.floor(i/this._pageSize)||0)*this._pageSize+1,o=i<this._total?Math.min(i+this._pageSize,this._total):i+this._pageSize;this._rangeLabel=`${s}-${o} ${e.strings.RANGE_SEPARATOR_LABEL} ${this._total}`}else this._rangeLabel=`${this._pageIndex+1} ${e.strings.RANGE_SEPARATOR_LABEL} ${this._total}`;this._adapter.setRangeLabel(this._rangeLabel),this.disabled?(this._adapter.disablePageSizeSelect(),this._adapter.disableFirstPageButton(),this._adapter.disablePreviousPageButton(),this._adapter.disableNextPageButton(),this._adapter.disableLastPageButton()):(this._adapter.enablePageSizeSelect(),this._hasFirstPage()?this._adapter.enableFirstPageButton():this._adapter.disableFirstPageButton(),this._hasPreviousPage()?this._adapter.enablePreviousPageButton():this._adapter.disablePreviousPageButton(),this._hasNextPage()?this._adapter.enableNextPageButton():this._adapter.disableNextPageButton(),this._hasLastPage()?this._adapter.enableLastPageButton():this._adapter.disableLastPageButton())}_toggleFirstLastButtons(){this._toggleFirstButton(),this._firstLast?this._adapter.hasLastPageButton()||this._adapter.showLastPageButton():this._adapter.hasLastPageButton()&&this._adapter.hideLastPageButton()}_toggleFirstButton(){this._first||this._firstLast?this._adapter.hasFirstPageButton()||this._adapter.showFirstPageButton():this._adapter.hasFirstPageButton()&&this._adapter.hideFirstPageButton()}_hasFirstPage(){return this._hasPreviousPage()}_hasPreviousPage(){return this._pageIndex>=1&&this._pageSize!==0}_hasNextPage(){let i=this._getMaxPages();return this._pageIndex<i&&this._pageSize!==0}_hasLastPage(){return this._hasNextPage()}};var u=class extends x{constructor(t){super(t);this._labelElement=r(t,e.selectors.LABEL),this._root=r(t,e.selectors.ROOT),this._pageSizeSelect=r(t,e.selectors.PAGE_SIZE_SELECT),this._rangeLabel=r(t,e.selectors.RANGE_LABEL),this._rangeLabelAlternative=r(t,e.selectors.RANGE_LABEL_ALTERNATIVE),this._firstPageButton=r(t,e.selectors.FIRST_PAGE_BUTTON),this._firstPageIconButton=r(t,e.selectors.FIRST_PAGE_ICON_BUTTON),this._previousPageButton=r(t,e.selectors.PREVIOUS_PAGE_BUTTON),this._nextPageButton=r(t,e.selectors.NEXT_PAGE_BUTTON),this._lastPageButton=r(t,e.selectors.LAST_PAGE_BUTTON),this._lastPageIconButton=r(t,e.selectors.LAST_PAGE_ICON_BUTTON)}setLabel(t){this._labelElement.textContent=t}setPageSizeOptions(t){v(this._pageSizeSelect),this._pageSizeSelect.options=t}setPageSize(t){this._pageSizeSelect.value=t.toString()}setRangeLabel(t){this._rangeLabel.innerText=t,this._rangeLabelAlternative.innerText=t}hasFirstPageButton(){return!!r(this._component,e.selectors.FIRST_PAGE_ICON_BUTTON)}showFirstPageButton(){this._firstPagePlaceholder=d(this._component,!0,e.elementName,e.selectors.FIRST_PAGE_ICON_BUTTON,this._firstPageIconButton,this._firstPagePlaceholder)}hideFirstPageButton(){this._firstPagePlaceholder=d(this._component,!1,e.elementName,e.selectors.FIRST_PAGE_ICON_BUTTON,this._firstPageIconButton,this._firstPagePlaceholder)}hasLastPageButton(){return!!r(this._component,e.selectors.LAST_PAGE_ICON_BUTTON)}showLastPageButton(){this._lastPagePlaceholder=d(this._component,!0,e.elementName,e.selectors.LAST_PAGE_ICON_BUTTON,this._lastPageIconButton,this._lastPagePlaceholder)}hideLastPageButton(){this._lastPagePlaceholder=d(this._component,!1,e.elementName,e.selectors.LAST_PAGE_ICON_BUTTON,this._lastPageIconButton,this._lastPagePlaceholder)}attachPageSizeChangeListener(t){this._pageSizeSelect.addEventListener("change",t)}attachFirstPageListener(t){this._firstPageButton.addEventListener("click",t)}attachPreviousPageListener(t){this._previousPageButton.addEventListener("click",t)}attachNextPageListener(t){this._nextPageButton.addEventListener("click",t)}attachLastPageListener(t){this._lastPageButton.addEventListener("click",t)}detachPageSizeChangeListener(t){this._pageSizeSelect.removeEventListener("change",t)}detachFirstPageListener(t){this._firstPageButton.removeEventListener("click",t)}detachPreviousPageListener(t){this._previousPageButton.removeEventListener("click",t)}detachNextPageListener(t){this._nextPageButton.removeEventListener("click",t)}detachLastPageListener(t){this._lastPageButton.removeEventListener("click",t)}disableFirstPageButton(){this._firstPageButton.setAttribute("disabled","disabled")}enableFirstPageButton(){this._firstPageButton.removeAttribute("disabled")}disablePreviousPageButton(){this._previousPageButton.setAttribute("disabled","disabled")}enablePreviousPageButton(){this._previousPageButton.removeAttribute("disabled")}disableNextPageButton(){this._nextPageButton.setAttribute("disabled","disabled")}enableNextPageButton(){this._nextPageButton.removeAttribute("disabled")}disablePageSizeSelect(){this._pageSizeSelect.setAttribute("disabled","disabled")}enablePageSizeSelect(){this._pageSizeSelect.removeAttribute("disabled")}setPageSizeVisibility(t){t?this._pageSizeSelect.style.removeProperty("display"):this._pageSizeSelect.style.display="none"}disableLastPageButton(){this._lastPageButton.setAttribute("disabled","disabled")}enableLastPageButton(){this._lastPageButton.removeAttribute("disabled")}setAlternative(t){E(this._root,t,e.classes.ALTERNATIVE)}setAlignment(t){switch(P([e.classes.ALIGNMENT_SPACE_BETWEEN,e.classes.ALIGNMENT_START,e.classes.ALIGNMENT_END],this._root),t){case"start":_(e.classes.ALIGNMENT_START,this._root);break;case"end":_(e.classes.ALIGNMENT_END,this._root);break;case"space-between":default:_(e.classes.ALIGNMENT_SPACE_BETWEEN,this._root);break}}};var Z='<template><div class="forge-paginator" part="root"><div class="forge-paginator__container" part="container"><div class="forge-paginator__label" part="label"></div><forge-select class="forge-paginator__page-size-options" aria-label="Choose page size" density="dense" part="page-size-options"></forge-select><div class="forge-paginator__range-label" part="range-label"></div><forge-icon-button class="forge-paginator__first-page" part="first-page-button"><button aria-label="First Page" part="first-page-button-element"><forge-icon name="first_page" part="first-page-icon"></forge-icon></button><forge-tooltip position="top">Go to the first page</forge-tooltip></forge-icon-button><forge-icon-button class="forge-paginator__previous-page" part="previous-page-button"><button aria-label="Previous Page" part="previous-page-button-element"><forge-icon name="keyboard_arrow_left" part="previous-page-button-icon"></forge-icon></button><forge-tooltip position="top">Go to the previous page</forge-tooltip></forge-icon-button><div class="forge-paginator__range-label--alternative" part="range-label-alternative"></div><forge-icon-button class="forge-paginator__next-page" part="next-page-button"><button aria-label="Next Page" part="next-page-button-element"><forge-icon name="keyboard_arrow_right" part="next-page-icon"></forge-icon></button><forge-tooltip position="top">Go to the next page</forge-tooltip></forge-icon-button><forge-icon-button class="forge-paginator__last-page" part="last-page-button"><button aria-label="Last Page" part="last-page-button-element"><forge-icon name="last_page" part="last-page-icon"></forge-icon></button><forge-tooltip position="top">Go to the last page</forge-tooltip></forge-icon-button></div></div></template>',X='.forge-icon-button{display:-webkit-inline-box;display:inline-flex;-webkit-box-pack:center;justify-content:center;-webkit-box-align:center;align-items:center;position:relative;-webkit-box-sizing:border-box;box-sizing:border-box;border:none;outline:0;background-color:transparent;fill:currentColor;color:inherit;font-size:24px;text-decoration:none;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:48px;height:48px;padding:12px}.forge-icon-button forge-icon,.forge-icon-button img,.forge-icon-button svg{width:24px;height:24px}.forge-icon-button:disabled{color:rgba(0,0,0,.38);color:var(--mdc-theme-text-disabled-on-light,rgba(0,0,0,.38))}.forge-icon-button:disabled{cursor:default;pointer-events:none}.forge-icon-button__icon{display:inline-block}.forge-icon-button__icon.forge-icon-button__icon--on{display:none}.forge-icon-button--on .forge-icon-button__icon{display:none}.forge-icon-button--on .forge-icon-button__icon.forge-icon-button__icon--on{display:inline-block}@-webkit-keyframes mdc-ripple-fg-radius-in{from{-webkit-animation-timing-function:cubic-bezier(0.4,0,0.2,1);animation-timing-function:cubic-bezier(0.4,0,0.2,1);-webkit-transform:translate(var(--mdc-ripple-fg-translate-start,0)) scale(1);transform:translate(var(--mdc-ripple-fg-translate-start,0)) scale(1)}to{-webkit-transform:translate(var(--mdc-ripple-fg-translate-end,0)) scale(var(--mdc-ripple-fg-scale,1));transform:translate(var(--mdc-ripple-fg-translate-end,0)) scale(var(--mdc-ripple-fg-scale,1))}}@keyframes mdc-ripple-fg-radius-in{from{-webkit-animation-timing-function:cubic-bezier(0.4,0,0.2,1);animation-timing-function:cubic-bezier(0.4,0,0.2,1);-webkit-transform:translate(var(--mdc-ripple-fg-translate-start,0)) scale(1);transform:translate(var(--mdc-ripple-fg-translate-start,0)) scale(1)}to{-webkit-transform:translate(var(--mdc-ripple-fg-translate-end,0)) scale(var(--mdc-ripple-fg-scale,1));transform:translate(var(--mdc-ripple-fg-translate-end,0)) scale(var(--mdc-ripple-fg-scale,1))}}@-webkit-keyframes mdc-ripple-fg-opacity-in{from{-webkit-animation-timing-function:linear;animation-timing-function:linear;opacity:0}to{opacity:var(--mdc-ripple-fg-opacity, 0)}}@keyframes mdc-ripple-fg-opacity-in{from{-webkit-animation-timing-function:linear;animation-timing-function:linear;opacity:0}to{opacity:var(--mdc-ripple-fg-opacity, 0)}}@-webkit-keyframes mdc-ripple-fg-opacity-out{from{-webkit-animation-timing-function:linear;animation-timing-function:linear;opacity:var(--mdc-ripple-fg-opacity, 0)}to{opacity:0}}@keyframes mdc-ripple-fg-opacity-out{from{-webkit-animation-timing-function:linear;animation-timing-function:linear;opacity:var(--mdc-ripple-fg-opacity, 0)}to{opacity:0}}.forge-icon-button{--mdc-ripple-fg-size:0;--mdc-ripple-left:0;--mdc-ripple-top:0;--mdc-ripple-fg-scale:1;--mdc-ripple-fg-translate-end:0;--mdc-ripple-fg-translate-start:0;-webkit-tap-highlight-color:transparent;will-change:transform,opacity}.forge-icon-button::after,.forge-icon-button::before{position:absolute;border-radius:50%;opacity:0;pointer-events:none;content:""}.forge-icon-button::before{-webkit-transition:opacity 15ms linear,background-color 15ms linear;transition:opacity 15ms linear,background-color 15ms linear;z-index:1;z-index:var(--mdc-ripple-z-index,1)}.forge-icon-button::after{z-index:0;z-index:var(--mdc-ripple-z-index,0)}.forge-icon-button.mdc-ripple-upgraded::before{-webkit-transform:scale(var(--mdc-ripple-fg-scale,1));transform:scale(var(--mdc-ripple-fg-scale,1))}.forge-icon-button.mdc-ripple-upgraded::after{top:0;left:0;-webkit-transform:scale(0);transform:scale(0);-webkit-transform-origin:center center;transform-origin:center center}.forge-icon-button.mdc-ripple-upgraded--unbounded::after{top:var(--mdc-ripple-top,0);left:var(--mdc-ripple-left,0)}.forge-icon-button.mdc-ripple-upgraded--foreground-activation::after{-webkit-animation:mdc-ripple-fg-radius-in 225ms forwards,mdc-ripple-fg-opacity-in 75ms forwards;animation:mdc-ripple-fg-radius-in 225ms forwards,mdc-ripple-fg-opacity-in 75ms forwards}.forge-icon-button.mdc-ripple-upgraded--foreground-deactivation::after{-webkit-animation:mdc-ripple-fg-opacity-out 150ms;animation:mdc-ripple-fg-opacity-out 150ms;-webkit-transform:translate(var(--mdc-ripple-fg-translate-end,0)) scale(var(--mdc-ripple-fg-scale,1));transform:translate(var(--mdc-ripple-fg-translate-end,0)) scale(var(--mdc-ripple-fg-scale,1))}.forge-icon-button::after,.forge-icon-button::before{top:calc(50% - 50%);left:calc(50% - 50%);width:100%;height:100%}.forge-icon-button.mdc-ripple-upgraded::after,.forge-icon-button.mdc-ripple-upgraded::before{top:var(--mdc-ripple-top,calc(50% - 50%));left:var(--mdc-ripple-left,calc(50% - 50%));width:var(--mdc-ripple-fg-size,100%);height:var(--mdc-ripple-fg-size,100%)}.forge-icon-button.mdc-ripple-upgraded::after{width:var(--mdc-ripple-fg-size,100%);height:var(--mdc-ripple-fg-size,100%)}.forge-icon-button::after,.forge-icon-button::before{background-color:#000;background-color:var(--mdc-ripple-color,var(--mdc-theme-on-surface,#000))}.forge-icon-button.mdc-ripple-surface--hover::before,.forge-icon-button:hover::before{opacity:.04;opacity:var(--mdc-ripple-hover-opacity, .04)}.forge-icon-button.mdc-ripple-upgraded--background-focused::before,.forge-icon-button:not(.mdc-ripple-upgraded):focus::before{-webkit-transition-duration:75ms;transition-duration:75ms;opacity:.12;opacity:var(--mdc-ripple-focus-opacity, .12)}.forge-icon-button:not(.mdc-ripple-upgraded)::after{-webkit-transition:opacity 150ms linear;transition:opacity 150ms linear}.forge-icon-button:not(.mdc-ripple-upgraded):active::after{-webkit-transition-duration:75ms;transition-duration:75ms;opacity:.12;opacity:var(--mdc-ripple-press-opacity, .12)}.forge-icon-button.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.12)}forge-icon-button{position:relative;display:inline-block;overflow:visible}.forge-icon-button--on{color:#3f51b5;color:var(--mdc-theme-primary,#3f51b5)}.forge-icon-button--on::after,.forge-icon-button--on::before{background-color:#3f51b5;background-color:var(--mdc-ripple-color,var(--mdc-theme-primary,#3f51b5))}.forge-icon-button--on.mdc-ripple-surface--hover::before,.forge-icon-button--on:hover::before{opacity:.04;opacity:var(--mdc-ripple-hover-opacity, .04)}.forge-icon-button--on.mdc-ripple-upgraded--background-focused::before,.forge-icon-button--on:not(.mdc-ripple-upgraded):focus::before{-webkit-transition-duration:75ms;transition-duration:75ms;opacity:.12;opacity:var(--mdc-ripple-focus-opacity, .12)}.forge-icon-button--on:not(.mdc-ripple-upgraded)::after{-webkit-transition:opacity 150ms linear;transition:opacity 150ms linear}.forge-icon-button--on:not(.mdc-ripple-upgraded):active::after{-webkit-transition-duration:75ms;transition-duration:75ms;opacity:.12;opacity:var(--mdc-ripple-press-opacity, .12)}.forge-icon-button--on.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.12)}.forge-icon-button--on::before{background-color:#3f51b5;background-color:var(--mdc-theme-primary,#3f51b5);opacity:.08}.forge-icon-button--dense{width:28px;height:28px;padding:2px;padding:0}.forge-icon-button--dense-1{width:44px;height:44px;padding:10px}.forge-icon-button--dense-2{width:40px;height:40px;padding:8px}.forge-icon-button--dense-3{width:36px;height:36px;padding:6px}.forge-icon-button--dense-4{width:32px;height:32px;padding:4px}.forge-icon-button--dense-5{width:28px;height:28px;padding:2px}.forge-icon-button--dense-6{width:24px;height:24px;padding:0}.forge-icon-button--with-badge forge-badge{z-index:1;z-index:var(--forge-z-index-surface,1);pointer-events:none;--forge-badge-max-width:32px;--forge-badge-border:1px solid transparent}.forge-icon-button--with-badge forge-badge[app-bar-context]{--forge-badge-border:2px solid var(--forge-app-bar-theme-background)}.forge-paginator{display:inline-block}.forge-paginator--alternative{display:-webkit-box;display:flex}.forge-paginator--alternative .forge-paginator__label,.forge-paginator--alternative .forge-paginator__page-size-options,.forge-paginator--alternative .forge-paginator__range-label{display:none}.forge-paginator--alternative .forge-paginator__range-label--alternative{display:inline-block;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-body2-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:.875rem;font-size:var(--mdc-typography-body2-font-size, .875rem);line-height:1.25rem;line-height:var(--mdc-typography-body2-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-body2-font-weight,400);letter-spacing:.0178571429em;letter-spacing:var(--mdc-typography-body2-letter-spacing, .0178571429em);text-decoration:inherit;-webkit-text-decoration:var(--mdc-typography-body2-text-decoration,inherit);text-decoration:var(--mdc-typography-body2-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-body2-text-transform,inherit);margin:0 12px}.forge-paginator__range-label--alternative{display:none}.forge-paginator__container{display:-webkit-box;display:flex;-webkit-box-align:center;align-items:center}.forge-paginator__label{-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;-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);margin-right:16px}.forge-paginator__page-size-options{margin-right:16px}.forge-paginator__range-label{-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;-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);margin-right:8px}.forge-paginator__first-page,.forge-paginator__last-page,.forge-paginator__next-page,.forge-paginator__previous-page{color:rgba(0,0,0,.87);color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87))}:host{display:inline-block}:host([hidden]){display:none}:host([alternative]) .forge-paginator--alignment-center .forge-paginator__container{-webkit-box-pack:center;justify-content:center}:host([alternative]) .forge-paginator--alignment-center .forge-paginator__range-label--alternative{margin:0 auto}:host([alternative]) .forge-paginator--alignment-start .forge-paginator__container{-webkit-box-pack:start;justify-content:flex-start}:host([alternative]) .forge-paginator--alignment-end .forge-paginator__container{-webkit-box-pack:end;justify-content:flex-end}:host([alternative]) .forge-paginator .forge-paginator__container{-webkit-box-flex:1;flex:1}',a=class extends T{constructor(){super();O.define([y,B,N,z]),L(this,Z,X),this._foundation=new h(new u(this))}static get observedAttributes(){return[e.attributes.PAGE_INDEX,e.attributes.PAGE_SIZE,e.attributes.OFFSET,e.attributes.TOTAL,e.attributes.PAGE_SIZE_OPTIONS,e.attributes.LABEL,e.attributes.FIRST_LAST,e.attributes.FIRST,e.attributes.DISABLED,e.attributes.ALTERNATIVE,e.attributes.ALIGNMENT]}connectedCallback(){this._foundation.initialize()}disconnectedCallback(){this._foundation.disconnect()}attributeChangedCallback(t,s,o){switch(t){case e.attributes.PAGE_INDEX:this.pageIndex=Number(o)||e.numbers.DEFAULT_PAGE_INDEX;break;case e.attributes.PAGE_SIZE:this.pageSize=Number(o)||e.numbers.DEFAULT_PAGE_SIZE;break;case e.attributes.OFFSET:this.offset=Number(o);break;case e.attributes.TOTAL:this.total=Number(o)||e.numbers.DEFAULT_TOTAL;break;case e.attributes.PAGE_SIZE_OPTIONS:this.pageSizeOptions=o;break;case e.attributes.LABEL:this.label=o;break;case e.attributes.FIRST_LAST:this.firstLast=l(o);break;case e.attributes.FIRST:this.first=l(o);break;case e.attributes.DISABLED:this.disabled=l(o);break;case e.attributes.ALTERNATIVE:this.alternative=l(o);break;case e.attributes.ALIGNMENT:this.alignment=o;break}}};n([p()],a.prototype,"pageIndex",2),n([p()],a.prototype,"pageSize",2),n([p()],a.prototype,"offset",2),n([p()],a.prototype,"total",2),n([p()],a.prototype,"pageSizeOptions",2),n([p()],a.prototype,"label",2),n([p()],a.prototype,"firstLast",2),n([p()],a.prototype,"first",2),n([p()],a.prototype,"disabled",2),n([p()],a.prototype,"alternative",2),n([p()],a.prototype,"alignment",2),a=n([S({name:e.elementName,dependencies:[G,F,k,w]})],a);function At(){A(a)}export{e as a,h as b,u as c,a as d,At as e};
|
|
7
|
-
//# sourceMappingURL=chunk.
|
|
6
|
+
import{d as F}from"./chunk.CDUN4ONU.js";import{b as G}from"./chunk.7A6MX6CS.js";import{n as y,r as B,s as N,u as z}from"./chunk.MZLPUI6R.js";import{d as w}from"./chunk.4WPFFNLH.js";import{d as O,l as k}from"./chunk.JHBCYICS.js";import{a as x}from"./chunk.G5MGGEFP.js";import{a as p}from"./chunk.KTGSZEAG.js";import{a as S,b as I}from"./chunk.BE7PZANN.js";import{a as A,e as L,g as r,j as d,l as T}from"./chunk.Y4GKBJGI.js";import{d as v,f as _,g as P,t as E}from"./chunk.PN26D52V.js";import{b,i as m,k as l,l as c}from"./chunk.J2M2MXP2.js";import{f as n}from"./chunk.MCIQXNKY.js";var R=`${I}paginator`,g={LABEL:"forge-paginator__label",PAGE_SIZE_OPTIONS:"forge-paginator__page-size-options",RANGE_LABEL:"forge-paginator__range-label",RANGE_LABEL_ALTERNATIVE:"forge-paginator__range-label--alternative",FIRST_PAGE_BUTTON:"forge-paginator__first-page",PREVIOUS_PAGE_BUTTON:"forge-paginator__previous-page",NEXT_PAGE_BUTTON:"forge-paginator__next-page",LAST_PAGE_BUTTON:"forge-paginator__last-page",ROOT:"forge-paginator",ALTERNATIVE:"forge-paginator--alternative",ALIGNMENT_START:"forge-paginator--alignment-start",ALIGNMENT_SPACE_BETWEEN:"forge-paginator--alignment-center",ALIGNMENT_END:"forge-paginator--alignment-end"},U={LABEL:`.${g.LABEL}`,PAGE_SIZE_SELECT:`.${g.PAGE_SIZE_OPTIONS}`,RANGE_LABEL:`.${g.RANGE_LABEL}`,FIRST_PAGE_BUTTON:`.${g.FIRST_PAGE_BUTTON} > button`,FIRST_PAGE_ICON_BUTTON:`.${g.FIRST_PAGE_BUTTON}`,PREVIOUS_PAGE_BUTTON:`.${g.PREVIOUS_PAGE_BUTTON} > button`,NEXT_PAGE_BUTTON:`.${g.NEXT_PAGE_BUTTON} > button`,LAST_PAGE_BUTTON:`.${g.LAST_PAGE_BUTTON} > button`,LAST_PAGE_ICON_BUTTON:`.${g.LAST_PAGE_BUTTON}`,ROOT:`.${g.ROOT}`,RANGE_LABEL_ALTERNATIVE:`.${g.RANGE_LABEL_ALTERNATIVE}`},M={PAGE_INDEX:"page-index",PAGE_SIZE:"page-size",OFFSET:"offset",PAGE_SIZE_OPTIONS:"page-size-options",TOTAL:"total",LABEL:"label",FIRST_LAST:"first-last",FIRST:"first",DISABLED:"disabled",ALTERNATIVE:"alternative",ALIGNMENT:"alignment"},D={CHANGE:`${R}-change`},H={DEFAULT_PAGE_INDEX:0,DEFAULT_TOTAL:0,DEFAULT_PAGE_SIZE:25,DEFAULT_PAGE_SIZE_OPTIONS:[5,15,25,50,100]},$={DEFAULT_LABEL:"Rows per page:",RANGE_SEPARATOR_LABEL:"of",FIRST_PAGE:"first-page",PREVIOUS_PAGE:"previous-page",NEXT_PAGE:"next-page",LAST_PAGE:"last-page",PAGE_SIZE:"page-size"},e={elementName:R,classes:g,selectors:U,attributes:M,events:D,numbers:H,strings:$};var h=class{constructor(i){this._adapter=i;this._pageIndex=e.numbers.DEFAULT_PAGE_INDEX;this._pageSize=e.numbers.DEFAULT_PAGE_SIZE;this._total=e.numbers.DEFAULT_TOTAL;this._pageSizeOptions=[];this._label=e.strings.DEFAULT_LABEL;this._firstLast=!1;this._first=!1;this._disabled=!1;this._alignment="space-between";this._pageSizeListener=t=>this._onPageSizeChanged(t),this._firstPageListener=t=>this._onFirstPage(t),this._previousPageListener=t=>this._onPreviousPage(t),this._nextPageListener=t=>this._onNextPage(t),this._lastPageListener=t=>this._onLastPage(t),this._pageSizeOptions=e.numbers.DEFAULT_PAGE_SIZE_OPTIONS.map(t=>({label:t.toString(),value:t.toString()}))}set pageIndex(i){this._pageIndex!==i&&(b(i)?(this._pageIndex=i,this._update(),this._adapter.setHostAttribute(e.attributes.PAGE_INDEX,this._pageIndex.toString())):this._adapter.removeHostAttribute(e.attributes.PAGE_INDEX))}get pageIndex(){return this._pageIndex}set pageSize(i){this._pageSize!==i&&(this._pageSize=i,this._adapter.setPageSize(this._pageSize),this._update(),this._adapter.setHostAttribute(e.attributes.PAGE_SIZE,this._pageSize.toString()))}get pageSize(){return this._pageSize}set offset(i){i>=this._total&&(this._total>=this._pageSize?i=this._total-this._pageSize:i=0);let t=Math.min(Math.max(i,0),this._total);this.pageIndex=Math.floor(t/this._pageSize)}get offset(){return this._pageIndex*this._pageSize}set total(i){this._total!==i&&(this._total=i,this._update(),this._adapter.setHostAttribute(e.attributes.TOTAL,this._total.toString()))}get total(){return this._total}set pageSizeOptions(i){m(i)?(this._pageSizeOptions=i.map(t=>({label:t.toString(),value:t.toString()})).sort((t,s)=>c(t.value)-c(s.value)),this._adapter.setPageSizeOptions(this._pageSizeOptions),this._adapter.attachPageSizeChangeListener(this._pageSizeListener),this._adapter.setPageSizeVisibility(!0),b(this._pageSize)&&this._pageSizeOptions.length&&!this._pageSizeOptions.find(t=>c(t.value)===this._pageSize)&&(this.pageSize=c(this._pageSizeOptions[0].value))):i.toString().toLowerCase()==="false"&&(this._adapter.detachPageSizeChangeListener(this._pageSizeListener),this._adapter.setPageSizeVisibility(!1))}get pageSizeOptions(){return this._pageSizeOptions.map(i=>Number(i.value))}set label(i){this._label!==i&&(this._label=i,this._adapter.setLabel(this._label),this._adapter.setHostAttribute(e.attributes.LABEL,b(this._label)?this._label.toString():""))}get label(){return this._label}set firstLast(i){this._firstLast!==i&&(this._firstLast=i,this._toggleFirstLastButtons(),this._firstLast?this._adapter.setHostAttribute(e.attributes.FIRST_LAST):this._adapter.removeHostAttribute(e.attributes.FIRST_LAST))}get firstLast(){return this._firstLast}set first(i){this._first!==i&&(this._first=i,this._toggleFirstButton(),this._first?this._adapter.setHostAttribute(e.attributes.FIRST):this._adapter.removeHostAttribute(e.attributes.FIRST))}get first(){return this._first}set disabled(i){this._disabled!==i&&(this._disabled=i,this._update(),this._disabled?this._adapter.setHostAttribute(e.attributes.DISABLED):this._adapter.removeHostAttribute(e.attributes.DISABLED))}get disabled(){return this._disabled}get alternative(){return this._alternative}set alternative(i){i!==this._alternative&&(this._alternative=i,this._applyAlternative())}get alignment(){return this._alignment}set alignment(i){i!==this._alignment&&(this._alignment=i,this._applyAlternativeAlignment())}_applyAlternativeAlignment(){this._adapter.setHostAttribute(e.attributes.ALIGNMENT,this._alignment),this._adapter.setAlignment(this._alignment)}_applyAlternative(){this._adapter.toggleHostAttribute(e.attributes.ALTERNATIVE,this._alternative),this._adapter.setAlternative(this._alternative),this._applyAlternativeAlignment()}initialize(){this._update(),this._adapter.setLabel(this._label),this._adapter.setPageSizeOptions(this._pageSizeOptions),this._adapter.setPageSize(this._pageSize),this._attachListeners(),this._toggleFirstLastButtons()}disconnect(){this._detachListeners()}_attachListeners(){this._adapter.attachPageSizeChangeListener(this._pageSizeListener),this._adapter.attachFirstPageListener(this._firstPageListener),this._adapter.attachPreviousPageListener(this._previousPageListener),this._adapter.attachNextPageListener(this._nextPageListener),this._adapter.attachLastPageListener(this._lastPageListener)}_detachListeners(){this._adapter.detachPageSizeChangeListener(this._pageSizeListener),this._adapter.detachFirstPageListener(this._firstPageListener),this._adapter.detachPreviousPageListener(this._previousPageListener),this._adapter.detachNextPageListener(this._nextPageListener),this._adapter.detachLastPageListener(this._lastPageListener)}_onFirstPage(i){if(i.stopPropagation(),!this._hasFirstPage())return;let t=0;this._emitChangeEvent(e.strings.FIRST_PAGE,{pageIndex:t})&&(this.pageIndex=t)}_onPreviousPage(i){if(i.stopPropagation(),!this._hasPreviousPage())return;let t=this._pageIndex-1;this._emitChangeEvent(e.strings.PREVIOUS_PAGE,{pageIndex:t})&&(this.pageIndex=t)}_onNextPage(i){if(i.stopPropagation(),!this._hasNextPage())return;let t=this._pageIndex+1;this._emitChangeEvent(e.strings.NEXT_PAGE,{pageIndex:t})&&(this.pageIndex=t)}_onLastPage(i){if(i.stopPropagation(),!this._hasLastPage())return;let t=this._getMaxPages();this._emitChangeEvent(e.strings.LAST_PAGE,{pageIndex:t})&&(this.pageIndex=t)}_onPageSizeChanged(i){i.stopPropagation();let t=Number(i.detail);this._emitChangeEvent(e.strings.PAGE_SIZE,{pageIndex:0,pageSize:t})&&(this.pageIndex=0,this.pageSize=t,i.preventDefault())}_emitChangeEvent(i,{pageSize:t=this._pageSize,pageIndex:s=this._pageIndex}={}){let o=s*t,C={type:i,pageSize:t,pageIndex:s,offset:o};return this._adapter.emitHostEvent(e.events.CHANGE,C,!0,!0)}_getMaxPages(){return Math.ceil(this._total/this._pageSize)-1}_update(){if(this.pageSize>1){let i=this._pageIndex*this._pageSize,s=(Math.floor(i/this._pageSize)||0)*this._pageSize+1,o=i<this._total?Math.min(i+this._pageSize,this._total):i+this._pageSize;this._rangeLabel=`${s}-${o} ${e.strings.RANGE_SEPARATOR_LABEL} ${this._total}`}else this._rangeLabel=`${this._pageIndex+1} ${e.strings.RANGE_SEPARATOR_LABEL} ${this._total}`;this._adapter.setRangeLabel(this._rangeLabel),this.disabled?(this._adapter.disablePageSizeSelect(),this._adapter.disableFirstPageButton(),this._adapter.disablePreviousPageButton(),this._adapter.disableNextPageButton(),this._adapter.disableLastPageButton()):(this._adapter.enablePageSizeSelect(),this._hasFirstPage()?this._adapter.enableFirstPageButton():this._adapter.disableFirstPageButton(),this._hasPreviousPage()?this._adapter.enablePreviousPageButton():this._adapter.disablePreviousPageButton(),this._hasNextPage()?this._adapter.enableNextPageButton():this._adapter.disableNextPageButton(),this._hasLastPage()?this._adapter.enableLastPageButton():this._adapter.disableLastPageButton())}_toggleFirstLastButtons(){this._toggleFirstButton(),this._firstLast?this._adapter.hasLastPageButton()||this._adapter.showLastPageButton():this._adapter.hasLastPageButton()&&this._adapter.hideLastPageButton()}_toggleFirstButton(){this._first||this._firstLast?this._adapter.hasFirstPageButton()||this._adapter.showFirstPageButton():this._adapter.hasFirstPageButton()&&this._adapter.hideFirstPageButton()}_hasFirstPage(){return this._hasPreviousPage()}_hasPreviousPage(){return this._pageIndex>=1&&this._pageSize!==0}_hasNextPage(){let i=this._getMaxPages();return this._pageIndex<i&&this._pageSize!==0}_hasLastPage(){return this._hasNextPage()}};var u=class extends x{constructor(t){super(t);this._labelElement=r(t,e.selectors.LABEL),this._root=r(t,e.selectors.ROOT),this._pageSizeSelect=r(t,e.selectors.PAGE_SIZE_SELECT),this._rangeLabel=r(t,e.selectors.RANGE_LABEL),this._rangeLabelAlternative=r(t,e.selectors.RANGE_LABEL_ALTERNATIVE),this._firstPageButton=r(t,e.selectors.FIRST_PAGE_BUTTON),this._firstPageIconButton=r(t,e.selectors.FIRST_PAGE_ICON_BUTTON),this._previousPageButton=r(t,e.selectors.PREVIOUS_PAGE_BUTTON),this._nextPageButton=r(t,e.selectors.NEXT_PAGE_BUTTON),this._lastPageButton=r(t,e.selectors.LAST_PAGE_BUTTON),this._lastPageIconButton=r(t,e.selectors.LAST_PAGE_ICON_BUTTON)}setLabel(t){this._labelElement.textContent=t}setPageSizeOptions(t){v(this._pageSizeSelect),this._pageSizeSelect.options=t}setPageSize(t){this._pageSizeSelect.value=t.toString()}setRangeLabel(t){this._rangeLabel.innerText=t,this._rangeLabelAlternative.innerText=t}hasFirstPageButton(){return!!r(this._component,e.selectors.FIRST_PAGE_ICON_BUTTON)}showFirstPageButton(){this._firstPagePlaceholder=d(this._component,!0,e.elementName,e.selectors.FIRST_PAGE_ICON_BUTTON,this._firstPageIconButton,this._firstPagePlaceholder)}hideFirstPageButton(){this._firstPagePlaceholder=d(this._component,!1,e.elementName,e.selectors.FIRST_PAGE_ICON_BUTTON,this._firstPageIconButton,this._firstPagePlaceholder)}hasLastPageButton(){return!!r(this._component,e.selectors.LAST_PAGE_ICON_BUTTON)}showLastPageButton(){this._lastPagePlaceholder=d(this._component,!0,e.elementName,e.selectors.LAST_PAGE_ICON_BUTTON,this._lastPageIconButton,this._lastPagePlaceholder)}hideLastPageButton(){this._lastPagePlaceholder=d(this._component,!1,e.elementName,e.selectors.LAST_PAGE_ICON_BUTTON,this._lastPageIconButton,this._lastPagePlaceholder)}attachPageSizeChangeListener(t){this._pageSizeSelect.addEventListener("change",t)}attachFirstPageListener(t){this._firstPageButton.addEventListener("click",t)}attachPreviousPageListener(t){this._previousPageButton.addEventListener("click",t)}attachNextPageListener(t){this._nextPageButton.addEventListener("click",t)}attachLastPageListener(t){this._lastPageButton.addEventListener("click",t)}detachPageSizeChangeListener(t){this._pageSizeSelect.removeEventListener("change",t)}detachFirstPageListener(t){this._firstPageButton.removeEventListener("click",t)}detachPreviousPageListener(t){this._previousPageButton.removeEventListener("click",t)}detachNextPageListener(t){this._nextPageButton.removeEventListener("click",t)}detachLastPageListener(t){this._lastPageButton.removeEventListener("click",t)}disableFirstPageButton(){this._firstPageButton.setAttribute("disabled","disabled")}enableFirstPageButton(){this._firstPageButton.removeAttribute("disabled")}disablePreviousPageButton(){this._previousPageButton.setAttribute("disabled","disabled")}enablePreviousPageButton(){this._previousPageButton.removeAttribute("disabled")}disableNextPageButton(){this._nextPageButton.setAttribute("disabled","disabled")}enableNextPageButton(){this._nextPageButton.removeAttribute("disabled")}disablePageSizeSelect(){this._pageSizeSelect.setAttribute("disabled","disabled")}enablePageSizeSelect(){this._pageSizeSelect.removeAttribute("disabled")}setPageSizeVisibility(t){t?this._pageSizeSelect.style.removeProperty("display"):this._pageSizeSelect.style.display="none"}disableLastPageButton(){this._lastPageButton.setAttribute("disabled","disabled")}enableLastPageButton(){this._lastPageButton.removeAttribute("disabled")}setAlternative(t){E(this._root,t,e.classes.ALTERNATIVE)}setAlignment(t){switch(P([e.classes.ALIGNMENT_SPACE_BETWEEN,e.classes.ALIGNMENT_START,e.classes.ALIGNMENT_END],this._root),t){case"start":_(e.classes.ALIGNMENT_START,this._root);break;case"end":_(e.classes.ALIGNMENT_END,this._root);break;case"space-between":default:_(e.classes.ALIGNMENT_SPACE_BETWEEN,this._root);break}}};var Z='<template><div class="forge-paginator" part="root"><div class="forge-paginator__container" part="container"><div class="forge-paginator__label" part="label"></div><forge-select class="forge-paginator__page-size-options" aria-label="Choose page size" density="dense" part="page-size-options"></forge-select><div class="forge-paginator__range-label" part="range-label"></div><forge-icon-button class="forge-paginator__first-page" part="first-page-button"><button aria-label="First Page" part="first-page-button-element"><forge-icon name="first_page" part="first-page-icon"></forge-icon></button><forge-tooltip position="top">Go to the first page</forge-tooltip></forge-icon-button><forge-icon-button class="forge-paginator__previous-page" part="previous-page-button"><button aria-label="Previous Page" part="previous-page-button-element"><forge-icon name="keyboard_arrow_left" part="previous-page-button-icon"></forge-icon></button><forge-tooltip position="top">Go to the previous page</forge-tooltip></forge-icon-button><div class="forge-paginator__range-label--alternative" part="range-label-alternative"></div><forge-icon-button class="forge-paginator__next-page" part="next-page-button"><button aria-label="Next Page" part="next-page-button-element"><forge-icon name="keyboard_arrow_right" part="next-page-icon"></forge-icon></button><forge-tooltip position="top">Go to the next page</forge-tooltip></forge-icon-button><forge-icon-button class="forge-paginator__last-page" part="last-page-button"><button aria-label="Last Page" part="last-page-button-element"><forge-icon name="last_page" part="last-page-icon"></forge-icon></button><forge-tooltip position="top">Go to the last page</forge-tooltip></forge-icon-button></div></div></template>',X='.forge-icon-button{display:-webkit-inline-box;display:inline-flex;-webkit-box-pack:center;justify-content:center;-webkit-box-align:center;align-items:center;position:relative;-webkit-box-sizing:border-box;box-sizing:border-box;border:none;outline:0;background-color:transparent;fill:currentColor;color:inherit;font-size:24px;text-decoration:none;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:48px;height:48px;padding:12px}.forge-icon-button forge-icon,.forge-icon-button img,.forge-icon-button svg{width:24px;height:24px}.forge-icon-button:disabled{color:rgba(0,0,0,.38);color:var(--mdc-theme-text-disabled-on-light,rgba(0,0,0,.38))}.forge-icon-button:disabled{cursor:default;pointer-events:none}.forge-icon-button__icon{display:inline-block}.forge-icon-button__icon.forge-icon-button__icon--on{display:none}.forge-icon-button--on .forge-icon-button__icon{display:none}.forge-icon-button--on .forge-icon-button__icon.forge-icon-button__icon--on{display:inline-block}@-webkit-keyframes mdc-ripple-fg-radius-in{from{-webkit-animation-timing-function:cubic-bezier(0.4,0,0.2,1);animation-timing-function:cubic-bezier(0.4,0,0.2,1);-webkit-transform:translate(var(--mdc-ripple-fg-translate-start,0)) scale(1);transform:translate(var(--mdc-ripple-fg-translate-start,0)) scale(1)}to{-webkit-transform:translate(var(--mdc-ripple-fg-translate-end,0)) scale(var(--mdc-ripple-fg-scale,1));transform:translate(var(--mdc-ripple-fg-translate-end,0)) scale(var(--mdc-ripple-fg-scale,1))}}@keyframes mdc-ripple-fg-radius-in{from{-webkit-animation-timing-function:cubic-bezier(0.4,0,0.2,1);animation-timing-function:cubic-bezier(0.4,0,0.2,1);-webkit-transform:translate(var(--mdc-ripple-fg-translate-start,0)) scale(1);transform:translate(var(--mdc-ripple-fg-translate-start,0)) scale(1)}to{-webkit-transform:translate(var(--mdc-ripple-fg-translate-end,0)) scale(var(--mdc-ripple-fg-scale,1));transform:translate(var(--mdc-ripple-fg-translate-end,0)) scale(var(--mdc-ripple-fg-scale,1))}}@-webkit-keyframes mdc-ripple-fg-opacity-in{from{-webkit-animation-timing-function:linear;animation-timing-function:linear;opacity:0}to{opacity:var(--mdc-ripple-fg-opacity, 0)}}@keyframes mdc-ripple-fg-opacity-in{from{-webkit-animation-timing-function:linear;animation-timing-function:linear;opacity:0}to{opacity:var(--mdc-ripple-fg-opacity, 0)}}@-webkit-keyframes mdc-ripple-fg-opacity-out{from{-webkit-animation-timing-function:linear;animation-timing-function:linear;opacity:var(--mdc-ripple-fg-opacity, 0)}to{opacity:0}}@keyframes mdc-ripple-fg-opacity-out{from{-webkit-animation-timing-function:linear;animation-timing-function:linear;opacity:var(--mdc-ripple-fg-opacity, 0)}to{opacity:0}}.forge-icon-button{--mdc-ripple-fg-size:0;--mdc-ripple-left:0;--mdc-ripple-top:0;--mdc-ripple-fg-scale:1;--mdc-ripple-fg-translate-end:0;--mdc-ripple-fg-translate-start:0;-webkit-tap-highlight-color:transparent;will-change:transform,opacity}.forge-icon-button::after,.forge-icon-button::before{position:absolute;border-radius:50%;opacity:0;pointer-events:none;content:""}.forge-icon-button::before{-webkit-transition:opacity 15ms linear,background-color 15ms linear;transition:opacity 15ms linear,background-color 15ms linear;z-index:1;z-index:var(--mdc-ripple-z-index,1)}.forge-icon-button::after{z-index:0;z-index:var(--mdc-ripple-z-index,0)}.forge-icon-button.mdc-ripple-upgraded::before{-webkit-transform:scale(var(--mdc-ripple-fg-scale,1));transform:scale(var(--mdc-ripple-fg-scale,1))}.forge-icon-button.mdc-ripple-upgraded::after{top:0;left:0;-webkit-transform:scale(0);transform:scale(0);-webkit-transform-origin:center center;transform-origin:center center}.forge-icon-button.mdc-ripple-upgraded--unbounded::after{top:var(--mdc-ripple-top,0);left:var(--mdc-ripple-left,0)}.forge-icon-button.mdc-ripple-upgraded--foreground-activation::after{-webkit-animation:mdc-ripple-fg-radius-in 225ms forwards,mdc-ripple-fg-opacity-in 75ms forwards;animation:mdc-ripple-fg-radius-in 225ms forwards,mdc-ripple-fg-opacity-in 75ms forwards}.forge-icon-button.mdc-ripple-upgraded--foreground-deactivation::after{-webkit-animation:mdc-ripple-fg-opacity-out 150ms;animation:mdc-ripple-fg-opacity-out 150ms;-webkit-transform:translate(var(--mdc-ripple-fg-translate-end,0)) scale(var(--mdc-ripple-fg-scale,1));transform:translate(var(--mdc-ripple-fg-translate-end,0)) scale(var(--mdc-ripple-fg-scale,1))}.forge-icon-button::after,.forge-icon-button::before{top:calc(50% - 50%);left:calc(50% - 50%);width:100%;height:100%}.forge-icon-button.mdc-ripple-upgraded::after,.forge-icon-button.mdc-ripple-upgraded::before{top:var(--mdc-ripple-top,calc(50% - 50%));left:var(--mdc-ripple-left,calc(50% - 50%));width:var(--mdc-ripple-fg-size,100%);height:var(--mdc-ripple-fg-size,100%)}.forge-icon-button.mdc-ripple-upgraded::after{width:var(--mdc-ripple-fg-size,100%);height:var(--mdc-ripple-fg-size,100%)}.forge-icon-button::after,.forge-icon-button::before{background-color:#000;background-color:var(--mdc-ripple-color,var(--mdc-theme-on-surface,#000))}.forge-icon-button.mdc-ripple-surface--hover::before,.forge-icon-button:hover::before{opacity:.04;opacity:var(--mdc-ripple-hover-opacity, .04)}.forge-icon-button.mdc-ripple-upgraded--background-focused::before,.forge-icon-button:not(.mdc-ripple-upgraded):focus::before{-webkit-transition-duration:75ms;transition-duration:75ms;opacity:.12;opacity:var(--mdc-ripple-focus-opacity, .12)}.forge-icon-button:not(.mdc-ripple-upgraded)::after{-webkit-transition:opacity 150ms linear;transition:opacity 150ms linear}.forge-icon-button:not(.mdc-ripple-upgraded):active::after{-webkit-transition-duration:75ms;transition-duration:75ms;opacity:.12;opacity:var(--mdc-ripple-press-opacity, .12)}.forge-icon-button.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.12)}forge-icon-button{position:relative;display:inline-block;overflow:visible}.forge-icon-button--on{color:#3f51b5;color:var(--mdc-theme-primary,#3f51b5)}.forge-icon-button--on::after,.forge-icon-button--on::before{background-color:#3f51b5;background-color:var(--mdc-ripple-color,var(--mdc-theme-primary,#3f51b5))}.forge-icon-button--on.mdc-ripple-surface--hover::before,.forge-icon-button--on:hover::before{opacity:.04;opacity:var(--mdc-ripple-hover-opacity, .04)}.forge-icon-button--on.mdc-ripple-upgraded--background-focused::before,.forge-icon-button--on:not(.mdc-ripple-upgraded):focus::before{-webkit-transition-duration:75ms;transition-duration:75ms;opacity:.12;opacity:var(--mdc-ripple-focus-opacity, .12)}.forge-icon-button--on:not(.mdc-ripple-upgraded)::after{-webkit-transition:opacity 150ms linear;transition:opacity 150ms linear}.forge-icon-button--on:not(.mdc-ripple-upgraded):active::after{-webkit-transition-duration:75ms;transition-duration:75ms;opacity:.12;opacity:var(--mdc-ripple-press-opacity, .12)}.forge-icon-button--on.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.12)}.forge-icon-button--on::before{background-color:#3f51b5;background-color:var(--mdc-theme-primary,#3f51b5);opacity:.08}.forge-icon-button--dense{width:28px;height:28px;padding:2px;padding:0}.forge-icon-button--dense-1{width:44px;height:44px;padding:10px}.forge-icon-button--dense-2{width:40px;height:40px;padding:8px}.forge-icon-button--dense-3{width:36px;height:36px;padding:6px}.forge-icon-button--dense-4{width:32px;height:32px;padding:4px}.forge-icon-button--dense-5{width:28px;height:28px;padding:2px}.forge-icon-button--dense-6{width:24px;height:24px;padding:0}.forge-icon-button--with-badge forge-badge{z-index:1;z-index:var(--forge-z-index-surface,1);pointer-events:none;--forge-badge-max-width:32px;--forge-badge-border:1px solid transparent}.forge-icon-button--with-badge forge-badge[app-bar-context]{--forge-badge-border:2px solid var(--forge-app-bar-theme-background)}.forge-paginator{display:inline-block}.forge-paginator--alternative{display:-webkit-box;display:flex}.forge-paginator--alternative .forge-paginator__label,.forge-paginator--alternative .forge-paginator__page-size-options,.forge-paginator--alternative .forge-paginator__range-label{display:none}.forge-paginator--alternative .forge-paginator__range-label--alternative{display:inline-block;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-body2-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:.875rem;font-size:var(--mdc-typography-body2-font-size, .875rem);line-height:1.25rem;line-height:var(--mdc-typography-body2-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-body2-font-weight,400);letter-spacing:.0178571429em;letter-spacing:var(--mdc-typography-body2-letter-spacing, .0178571429em);text-decoration:inherit;-webkit-text-decoration:var(--mdc-typography-body2-text-decoration,inherit);text-decoration:var(--mdc-typography-body2-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-body2-text-transform,inherit);margin:0 12px}.forge-paginator__range-label--alternative{display:none}.forge-paginator__container{display:-webkit-box;display:flex;-webkit-box-align:center;align-items:center}.forge-paginator__label{-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;-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);margin-right:16px}.forge-paginator__page-size-options{margin-right:16px}.forge-paginator__range-label{-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;-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);margin-right:8px}.forge-paginator__first-page,.forge-paginator__last-page,.forge-paginator__next-page,.forge-paginator__previous-page{color:rgba(0,0,0,.87);color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87))}:host{display:inline-block}:host([hidden]){display:none}:host([alternative]) .forge-paginator--alignment-center .forge-paginator__container{-webkit-box-pack:center;justify-content:center}:host([alternative]) .forge-paginator--alignment-center .forge-paginator__range-label--alternative{margin:0 auto}:host([alternative]) .forge-paginator--alignment-start .forge-paginator__container{-webkit-box-pack:start;justify-content:flex-start}:host([alternative]) .forge-paginator--alignment-end .forge-paginator__container{-webkit-box-pack:end;justify-content:flex-end}:host([alternative]) .forge-paginator .forge-paginator__container{-webkit-box-flex:1;flex:1}',a=class extends T{constructor(){super();O.define([y,B,N,z]),L(this,Z,X),this._foundation=new h(new u(this))}static get observedAttributes(){return[e.attributes.PAGE_INDEX,e.attributes.PAGE_SIZE,e.attributes.OFFSET,e.attributes.TOTAL,e.attributes.PAGE_SIZE_OPTIONS,e.attributes.LABEL,e.attributes.FIRST_LAST,e.attributes.FIRST,e.attributes.DISABLED,e.attributes.ALTERNATIVE,e.attributes.ALIGNMENT]}connectedCallback(){this._foundation.initialize()}disconnectedCallback(){this._foundation.disconnect()}attributeChangedCallback(t,s,o){switch(t){case e.attributes.PAGE_INDEX:this.pageIndex=Number(o)||e.numbers.DEFAULT_PAGE_INDEX;break;case e.attributes.PAGE_SIZE:this.pageSize=Number(o)||e.numbers.DEFAULT_PAGE_SIZE;break;case e.attributes.OFFSET:this.offset=Number(o);break;case e.attributes.TOTAL:this.total=Number(o)||e.numbers.DEFAULT_TOTAL;break;case e.attributes.PAGE_SIZE_OPTIONS:this.pageSizeOptions=o;break;case e.attributes.LABEL:this.label=o;break;case e.attributes.FIRST_LAST:this.firstLast=l(o);break;case e.attributes.FIRST:this.first=l(o);break;case e.attributes.DISABLED:this.disabled=l(o);break;case e.attributes.ALTERNATIVE:this.alternative=l(o);break;case e.attributes.ALIGNMENT:this.alignment=o;break}}};n([p()],a.prototype,"pageIndex",2),n([p()],a.prototype,"pageSize",2),n([p()],a.prototype,"offset",2),n([p()],a.prototype,"total",2),n([p()],a.prototype,"pageSizeOptions",2),n([p()],a.prototype,"label",2),n([p()],a.prototype,"firstLast",2),n([p()],a.prototype,"first",2),n([p()],a.prototype,"disabled",2),n([p()],a.prototype,"alternative",2),n([p()],a.prototype,"alignment",2),a=n([S({name:e.elementName,dependencies:[G,F,k,w]})],a);function At(){A(a)}export{e as a,h as b,u as c,a as d,At as e};
|
|
7
|
+
//# sourceMappingURL=chunk.V6PXSHJ4.js.map
|
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
* Copyright 2023 Tyler Technologies, Inc.
|
|
4
4
|
* License: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import{a as k}from"./chunk.MUEXD4SD.js";import{e as V,h as B,j as H}from"./chunk.KKMKGN2I.js";import{c as x}from"./chunk.KE6GOYAB.js";import{a as m,b as N}from"./chunk.RG6CDWEX.js";import{d as K}from"./chunk.TWZXQQQO.js";import{b as A}from"./chunk.VAKNDCLP.js";import{e as F}from"./chunk.V7WKXEZC.js";import{d as P}from"./chunk.MZLPUI6R.js";import{d as w}from"./chunk.JHBCYICS.js";import{a as S}from"./chunk.G5MGGEFP.js";import{a as p}from"./chunk.KTGSZEAG.js";import{a as T,b as D,d as y}from"./chunk.BE7PZANN.js";import{a as L,e as C}from"./chunk.Y4GKBJGI.js";import{m as M}from"./chunk.PN26D52V.js";import{a as g,b as O,i as I,k as _}from"./chunk.J2M2MXP2.js";import{a as c,b,f as a}from"./chunk.MCIQXNKY.js";var l=`${D}menu`,U={POPUP:"forge-menu__popup",MENU:"mdc-menu"},G={TOGGLE:`.${l}__toggle,[${l}-toggle],button,[type=button],[role=button],a,[tabindex]:not([tabindex^="-"])`,MENU_LIST:"forge-list"},R={OPEN:"open",PLACEMENT:"placement",SELECTED_INDEX:"selected-index",SELECTED_VALUE:"selected-value",DENSE:"dense",ICON_CLASS:"icon-class",PERSIST_SELECTION:"persist-selection",MODE:"mode",SYNC_POPUP_WIDTH:"sync-popup-width",POPUP_CLASSES:"popup-classes",OPTION_LIMIT:"option-limit",OBSERVE_SCROLL:"observe-scroll",OBSERVE_SCROLL_THRESHOLD:"observe-scroll-threshold"},$={SELECT:`${l}-select`,OPEN:`${l}-open`,CLOSE:`${l}-close`,ACTIVE_CHANGE:`${l}-active-change`},z={CHILD_MOUSE_LEAVE_TIMEOUT:300,POPUP_MOUSE_LEAVE_TIMEOUT:500},i={elementName:l,classes:U,selectors:G,attributes:R,events:$,numbers:z};var u=class extends S{constructor(e){super(e);this._childMenus=new Map}getDropdownElement(){var e,t;return(t=(e=this._listDropdown)==null?void 0:e.dropdownElement)!=null?t:null}hasTargetElement(){return!!this._targetElement}initializeTarget(){this._targetElement=this._component.querySelector(i.selectors.TOGGLE),this._targetElement||(this._targetElement=this._component.firstElementChild)}initializeAccessibility(e){!this._targetElement||(this._targetElement.setAttribute("aria-atomic","true"),this._targetElement.setAttribute("aria-live","assertive"),this._targetElement.setAttribute("aria-haspopup","true"),this._targetElement.setAttribute("aria-expanded","false"),this._targetElement.hasAttribute("aria-label")||this._targetElement.setAttribute("aria-label",this._targetElement.textContent||""))}addTargetListener(e,t,n=!1){this._targetElement&&this._targetElement.addEventListener(e,t,n)}removeTargetListener(e,t){this._targetElement&&this._targetElement.removeEventListener(e,t)}attachMenu(e){this._listDropdown||!this._targetElement||(this._listDropdown=new B(this._targetElement,e),this._listDropdown.open(),this._targetElement.setAttribute("aria-expanded","true"),this._targetElement.setAttribute("aria-controls",`list-dropdown-popup-${e.id}`))}setOptions(e){this._listDropdown&&this._listDropdown.setOptions(e)}detachMenu(){this._targetElement&&(this._targetElement.removeAttribute("aria-activedescendant"),this._targetElement.removeAttribute("aria-expanded"),this._targetElement.removeAttribute("aria-controls")),this._listDropdown&&(this._listDropdown.close(),this._listDropdown.destroy(),this._listDropdown=void 0)}setActiveOption(e){var t;(t=this._listDropdown)==null||t.activateOption(e)}activateFirstOption(){var e;(e=this._listDropdown)==null||e.activateFirstOption()}setCascadeTargetInactive(){let e=this._targetElement;e!=null&&e.active&&(e.active=!1)}getActiveOptionIndex(){var e,t;return(t=(e=this._listDropdown)==null?void 0:e.getActiveOptionIndex())!=null?t:-1}focusTarget(){this._targetElement&&this._targetElement.focus()}isTargetFocused(){return document.activeElement===this._targetElement}updateActiveDescendant(e){!this._targetElement||(e?this._targetElement.setAttribute("aria-activedescendant",e):this._targetElement.removeAttribute("aria-activedescendant"))}addDropdownListener(e,t){!this._listDropdown||!this._listDropdown.dropdownElement||this._listDropdown.dropdownElement.addEventListener(e,t)}isOwnElement(e){return!this._targetElement||!this._listDropdown||!this._listDropdown.dropdownElement?!1:this._targetElement.contains(e)||!!this._listDropdown.dropdownElement.contains(e)}propagateKey(e){var t;(t=this._listDropdown)==null||t.handleKey(e)}proxyKeyboardEventToChild(e,t){if(!this.getDropdownElement())return;let n=this._getOpenChildMenu(t);n&&n.propagateKeyEvent(e)}toggleChildMenu(e,t){let r=this._getListItems()[e].parentElement;r&&r.tagName.toLowerCase()===i.elementName&&(t===void 0?r.open=!r.open:r.open=t,r.activateFirstOption())}createChildMenu(e,t,n,o,r){let d=document.createElement("forge-menu");return d.style.display="block",d.addEventListener(i.events.OPEN,()=>{this._childMenus.set(e,d),n(e)}),d.addEventListener(i.events.CLOSE,()=>{this._childMenus.delete(e),o(e)}),d.addEventListener(i.events.SELECT,f=>{f.stopPropagation(),r(b(c({},f.detail),{parentValue:t}))}),d}closeOtherChildMenus(e){let t=[];this._childMenus.forEach((n,o)=>{o!==e&&(n.open=!1,t.push(o))}),t.forEach(n=>this._childMenus.delete(n))}setSelectedValues(e){var t;(t=this._listDropdown)==null||t.setSelectedValues(e)}_getOpenChildMenu(e){if(!this.getDropdownElement())return null;let t=this._getOwnList(e);return t?t.querySelector(`${i.elementName}[${i.attributes.OPEN}]`):null}_getOwnList(e){let t=this.getDropdownElement();return t?t.querySelector(`${m.elementName}[id="list-dropdown-list-${e}"]`):null}_getListItems(){let e=this.getDropdownElement();if(!e)return[];let t=e.querySelector(m.elementName);return t?Array.from(t.querySelectorAll(N.elementName)):[]}};var h=class extends H{constructor(e){super({popupTimeout:i.numbers.POPUP_MOUSE_LEAVE_TIMEOUT,targetTimeout:i.numbers.CHILD_MOUSE_LEAVE_TIMEOUT});this._adapter=e;this._placement="bottom-start";this._fallbackPlacements=[];this._dense=!1;this._iconClass=y;this._persistSelection=!1;this._mode="click";this._identifier=g(),this._clickListener=t=>this._onTargetClick(t),this._blurListener=t=>this._onTargetBlur(t),this._selectListener=t=>this._handleSelectEvent(t),this._keydownListener=t=>this.onKeydown(t),this._activeChangeListener=t=>this._onActiveOptionChanged(t)}initialize(){this._adapter.initializeTarget(),this._adapter.initializeAccessibility(this._identifier),this._initializeInteractionListeners()}disconnect(){this._open&&this._closeDropdown(),this._destroyInteractionListeners()}activateFirstOption(){this._adapter.activateFirstOption()}_applyMode(){!this._adapter.hasTargetElement()||(this._mode!=="cascade"?this._adapter.addTargetListener("click",this._clickListener):this._attachCascadingListeners())}_initializeInteractionListeners(){!this._adapter.hasTargetElement()||(this._applyMode(),this._adapter.addTargetListener("keydown",this._keydownListener,!0),this._adapter.addTargetListener("focusout",this._blurListener))}_destroyInteractionListeners(){!this._adapter.hasTargetElement()||(this._adapter.removeTargetListener("keydown",this._clickListener),this._adapter.removeTargetListener("focusout",this._blurListener),this._adapter.removeTargetListener("click",this._clickListener),this._detachCascadingListeners())}_attachCascadingListeners(){this._adapter.addTargetListener("mouseenter",this._targetMouseEnterListener),this._adapter.addTargetListener("mouseleave",this._targetMouseLeaveListener),this._adapter.addDocumentListener("mousemove",this._documentMouseMoveListener)}_detachCascadingListeners(){this._adapter.removeTargetListener("mouseenter",this._targetMouseEnterListener),this._adapter.removeTargetListener("mouseleave",this._targetMouseLeaveListener),this._adapter.removeDocumentListener("mousemove",this._documentMouseMoveListener)}get _nonDividerOptions(){return this._flatOptions.filter(e=>!e.divider)}get _flatOptions(){return V(this._options,1)?this._options.reduce((e,t)=>e.concat(t.options),[]):this._options}_onTargetClick(e){if(this._open){this._closeDropdown();return}this.open=!this._open,this._open&&this._adapter.focusTarget()}_onTargetBlur(e){this._open&&this._closeDropdown()}_onActiveOptionChanged(e){let t={id:e},n=this._adapter.emitHostEvent(i.events.ACTIVE_CHANGE,t,!0,!0);this._mode!=="cascade"&&n&&this._adapter.updateActiveDescendant(e)}onKeydown(e){if(this._childOpen){this._adapter.proxyKeyboardEventToChild(e,this._identifier);return}switch(e.code){case"Tab":this._open&&this._selectActiveOption();break;case"Escape":this._open&&(e.preventDefault(),e.stopPropagation(),this._closeDropdown());break;case"Space":e.preventDefault(),this._open?this._closeDropdown():this._openDropdown({fromKeyboard:!0});break;case"Home":case"End":this._open&&(e.preventDefault(),this._adapter.propagateKey(e.code));break;case"Enter":if(e.preventDefault(),!this._open){e.preventDefault(),this._openDropdown({fromKeyboard:!0});return}e.stopImmediatePropagation(),this._adapter.propagateKey(e.code);let t=this._adapter.getActiveOptionIndex(),n=this._nonDividerOptions[t];n&&n.options&&n.options.length&&this._adapter.toggleChildMenu(t);break;case"ArrowUp":case"ArrowDown":if(this._open&&e.stopImmediatePropagation(),e.preventDefault(),!this._open&&e.code==="ArrowDown"){this._openDropdown({fromKeyboard:!0}),this._adapter.activateFirstOption();return}this._adapter.propagateKey(e.code);break;case"ArrowLeft":this._open&&e.stopImmediatePropagation(),this._mode==="cascade"&&this._open&&this._closeDropdown();break;case"ArrowRight":if(this._open&&e.stopImmediatePropagation(),!this._open)return;let o=this._adapter.getActiveOptionIndex(),r=this._nonDividerOptions[o];if(r&&r.options){this._adapter.toggleChildMenu(o,e.code==="ArrowRight");return}break}}async _openMenu({fromKeyboard:e}={}){this._open=!0;let t=[];if(typeof this._optionsFactory=="function")this._loadOptionsAsync(),this._options=[];else{if(!this._options||!this._options.length)return;t=this._options}this._persistSelection||t.forEach(r=>r.selected=!1),this._mapIconToLeadingIcon();let n=this._persistSelection?this._getSelectedValues():[],o={id:this._identifier,type:"menu",options:this._options,selectedValues:n,iconClass:this._iconClass,dense:this._dense,multiple:!1,popupStatic:!0,allowBusy:!0,asyncStyle:"spinner",optionBuilder:this._optionBuilder,optionLimit:this._optionLimit,headerBuilder:this._popupHeaderBuilder,footerBuilder:this._popupFooterBuilder,observeScroll:this._observeScroll,observeScrollThreshold:this._observeScrollThreshold,popupPlacement:this._placement,popupFallbackPlacements:this._fallbackPlacements,activeStartIndex:e?0:void 0,popupClasses:[i.classes.POPUP,i.classes.MENU,...this._popupClasses],syncWidth:this._syncPopupWidth,activeChangeCallback:this._activeChangeListener,selectCallback:this._selectListener,popupOffset:this._popupOffset,cascadingElementFactory:r=>this._createCascadingElement(r)};this._adapter.setHostAttribute(i.attributes.OPEN,""),this._adapter.attachMenu(o),this._mode==="cascade"&&(this._adapter.addDropdownListener("mouseenter",this._childPopupMouseEnterListener),this._adapter.addDropdownListener("mouseleave",this._childPopupMouseLeaveListener)),this._adapter.addDropdownListener(i.events.ACTIVE_CHANGE,r=>{this._onActiveOptionChanged(r.detail.id)}),this._adapter.emitHostEvent(i.events.OPEN)}_closeMenu(){this._open=!1,this._childOpen=!1,this._adapter.detachMenu(),this._activeMouseLeaveTimeout!==void 0&&window.clearTimeout(this._activeMouseLeaveTimeout),this._adapter.removeHostAttribute(i.attributes.OPEN),this._adapter.emitHostEvent(i.events.CLOSE)}_loadOptionsAsync(){return this._optionsFactory?Promise.resolve(this._optionsFactory()).then(e=>{if(this._persistSelection||e.forEach(t=>t.selected=!1),this._open)if(e&&I(e)&&e.length){this._options=e,this._adapter.setOptions(e);let t=this._getSelectedValues();t.length&&this._adapter.setSelectedValues(t)}else this._open&&this._closeDropdown()}).catch(e=>{console.error("An unexpected error ocurred while opening the menu:",e),this._open&&this._closeDropdown()}):(this._open&&this._closeMenu(),Promise.resolve())}_handleSelectEvent(e){let t=this._nonDividerOptions.findIndex(n=>n.value===e);t<0||this._selectOptionByIndex(t)}_selectActiveOption(){let e=this._adapter.getActiveOptionIndex();e>=0&&this._nonDividerOptions[e]&&this._selectOptionByIndex(e)}_selectOptionByIndex(e){let{options:t,value:n}=this._nonDividerOptions[e];if(t){this._adapter.setActiveOption(e);return}this._closeDropdown();let o={index:e,value:n};!this._adapter.emitHostEvent(i.events.SELECT,o,!0,!0)||(this._selectedValue=this._persistSelection?n:void 0)}_getSelectedValues(){let e=this._flatOptions.filter(t=>t.selected).map(t=>t.value);return this._selectedValue!==void 0&&e.push(this._selectedValue),e}_onCascadingOptionSelected(e){this._persistSelection&&(this._selectedValue=e.value),this._adapter.emitHostEvent(i.events.SELECT,e),this._closeDropdown()}_onCascadingChildOpen(e){super._clearMouseLeaveTimeout(),this._adapter.closeOtherChildMenus(e),this._childOpen=!0,this._adapter.setActiveOption(e)}_onCascadingChildClose(e){this._childOpen=!1}_closeDropdown(){this._closeMenu()}_openDropdown({fromKeyboard:e}={}){this._openMenu({fromKeyboard:e})}_setCascadeTargetInactive(){this._adapter.setCascadeTargetInactive()}_isOwnElement(e){return this._adapter.isOwnElement(e)}_createCascadingElement({index:e,options:t,parentValue:n}){let o=this._adapter.createChildMenu(e,n,this._onCascadingChildOpen.bind(this),this._onCascadingChildClose.bind(this),this._onCascadingOptionSelected.bind(this));return o.mode="cascade",o.popupOffset={x:0,y:-8},o.dense=this._dense,o.placement="right-start",o.fallbackPlacements=["left-start","right-start"],o.persistSelection=this._persistSelection,this._persistSelection&&(o.selectedValue=this._selectedValue),o.options=t,o.optionBuilder=this._optionBuilder,o.iconClass=this._iconClass,o}_mapIconToLeadingIcon(){this._flatOptions.filter(e=>e.icon).forEach(e=>e.leadingIcon=e.icon)}get open(){return this._open}set open(e){e=Boolean(e),this._open!==e&&(this._open=e,e?this._openDropdown():this._closeDropdown())}set options(e){if(typeof e=="function")this.optionsFactory=e;else if(this.optionsFactory=void 0,this._options=e.map(t=>c({},t)),this._open&&(this._mapIconToLeadingIcon(),this._adapter.setOptions(this._options),this._persistSelection)){let t=this._getSelectedValues();t.length&&this._adapter.setSelectedValues(t)}}get options(){return this._options?this._flatOptions.map(e=>c({},e)):[]}set optionsFactory(e){this._optionsFactory=e}set selectedIndex(e){let t=this._nonDividerOptions[e];t&&t.value!==this._selectedValue&&(this.selectedValue=t.value)}get selectedIndex(){return this._selectedValue!==void 0?this._nonDividerOptions.findIndex(e=>e.value===this._selectedValue):-1}set selectedValue(e){this._selectedValue!==e&&(this._selectedValue=e,this._adapter.setSelectedValues(this._selectedValue))}get selectedValue(){return this._selectedValue}get placement(){return this._placement}set placement(e){this._placement!==e&&(this._placement=e||"bottom-start",this._adapter.setHostAttribute(i.attributes.PLACEMENT,this._placement))}get fallbackPlacements(){return this._fallbackPlacements}set fallbackPlacements(e){this._fallbackPlacements=Array.isArray(e)?e:[]}get dense(){return this._dense}set dense(e){this._dense=e}get iconClass(){return this._iconClass}set iconClass(e){this._iconClass=e}get persistSelection(){return this._persistSelection}set persistSelection(e){this._persistSelection!==e&&(this._persistSelection=e,this._adapter.toggleHostAttribute(i.attributes.PERSIST_SELECTION,this._persistSelection),this._persistSelection||(this._flatOptions.forEach(t=>t.selected=!1),this._selectedValue=void 0))}get mode(){return this._mode}set mode(e){this._mode!==e&&(this._mode=e,this._destroyInteractionListeners(),this._applyMode(),this._adapter.setHostAttribute(i.attributes.MODE,this._mode))}get popupOffset(){return this._popupOffset}set popupOffset(e){this._popupOffset=e}get optionBuilder(){return this._optionBuilder}set optionBuilder(e){this._optionBuilder=e}get popupElement(){return this._adapter.getDropdownElement()}};var q="<template><slot></slot></template>",W=":host{display:inline-block}:host([hidden]){display:none}",s=class extends k{constructor(){super();w.define(P),this._foundation=new h(new u(this)),C(this,q,W)}static get observedAttributes(){return[i.attributes.OPEN,i.attributes.PLACEMENT,i.attributes.SELECTED_INDEX,i.attributes.SELECTED_VALUE,i.attributes.DENSE,i.attributes.ICON_CLASS,i.attributes.PERSIST_SELECTION,i.attributes.MODE,i.attributes.SYNC_POPUP_WIDTH,i.attributes.POPUP_CLASSES,i.attributes.OPTION_LIMIT,i.attributes.OBSERVE_SCROLL,i.attributes.OBSERVE_SCROLL_THRESHOLD]}connectedCallback(){this.querySelector(i.selectors.TOGGLE)?this._foundation.initialize():M(this,i.selectors.TOGGLE).then(()=>this._foundation.initialize())}attributeChangedCallback(e,t,n){switch(super.attributeChangedCallback(e,t,n),e){case i.attributes.OPEN:this._foundation.open=O(n);break;case i.attributes.PLACEMENT:this._foundation.placement=n;break;case i.attributes.SELECTED_INDEX:this._foundation.selectedIndex=Number(n);break;case i.attributes.SELECTED_VALUE:this._foundation.selectedValue=n;break;case i.attributes.DENSE:this._foundation.dense=_(n);break;case i.attributes.ICON_CLASS:this._foundation.iconClass=n;break;case i.attributes.PERSIST_SELECTION:this.persistSelection=_(n);break;case i.attributes.MODE:this.mode=n;break}}disconnectedCallback(){this._foundation.disconnect()}propagateKeyEvent(e){this._foundation.onKeydown(e)}activateFirstOption(){this._foundation.activateFirstOption()}};a([p()],s.prototype,"open",2),a([p()],s.prototype,"options",2),a([p()],s.prototype,"selectedIndex",2),a([p()],s.prototype,"selectedValue",2),a([p()],s.prototype,"placement",2),a([p()],s.prototype,"fallbackPlacements",2),a([p()],s.prototype,"dense",2),a([p()],s.prototype,"iconClass",2),a([p()],s.prototype,"persistSelection",2),a([p()],s.prototype,"mode",2),a([p()],s.prototype,"popupOffset",2),a([p()],s.prototype,"optionBuilder",2),a([p({set:!1})],s.prototype,"popupElement",2),s=a([T({name:i.elementName,dependencies:[F,x,K,A]})],s);function Ye(){L(s)}export{i as a,u as b,h as c,s as d,Ye as e};
|
|
7
|
-
//# sourceMappingURL=chunk.
|
|
6
|
+
import{a as k}from"./chunk.NSOALSSD.js";import{e as V,h as B,j as H}from"./chunk.TBY35XZK.js";import{c as x}from"./chunk.KE6GOYAB.js";import{a as m,b as N}from"./chunk.RG6CDWEX.js";import{d as K}from"./chunk.TWZXQQQO.js";import{b as A}from"./chunk.VAKNDCLP.js";import{e as F}from"./chunk.V7WKXEZC.js";import{d as P}from"./chunk.MZLPUI6R.js";import{d as w}from"./chunk.JHBCYICS.js";import{a as S}from"./chunk.G5MGGEFP.js";import{a as p}from"./chunk.KTGSZEAG.js";import{a as T,b as D,d as y}from"./chunk.BE7PZANN.js";import{a as L,e as C}from"./chunk.Y4GKBJGI.js";import{m as M}from"./chunk.PN26D52V.js";import{a as g,b as O,i as I,k as _}from"./chunk.J2M2MXP2.js";import{a as c,b,f as a}from"./chunk.MCIQXNKY.js";var l=`${D}menu`,U={POPUP:"forge-menu__popup",MENU:"mdc-menu"},G={TOGGLE:`.${l}__toggle,[${l}-toggle],button,[type=button],[role=button],a,[tabindex]:not([tabindex^="-"])`,MENU_LIST:"forge-list"},R={OPEN:"open",PLACEMENT:"placement",SELECTED_INDEX:"selected-index",SELECTED_VALUE:"selected-value",DENSE:"dense",ICON_CLASS:"icon-class",PERSIST_SELECTION:"persist-selection",MODE:"mode",SYNC_POPUP_WIDTH:"sync-popup-width",POPUP_CLASSES:"popup-classes",OPTION_LIMIT:"option-limit",OBSERVE_SCROLL:"observe-scroll",OBSERVE_SCROLL_THRESHOLD:"observe-scroll-threshold"},$={SELECT:`${l}-select`,OPEN:`${l}-open`,CLOSE:`${l}-close`,ACTIVE_CHANGE:`${l}-active-change`},z={CHILD_MOUSE_LEAVE_TIMEOUT:300,POPUP_MOUSE_LEAVE_TIMEOUT:500},i={elementName:l,classes:U,selectors:G,attributes:R,events:$,numbers:z};var u=class extends S{constructor(e){super(e);this._childMenus=new Map}getDropdownElement(){var e,t;return(t=(e=this._listDropdown)==null?void 0:e.dropdownElement)!=null?t:null}hasTargetElement(){return!!this._targetElement}initializeTarget(){this._targetElement=this._component.querySelector(i.selectors.TOGGLE),this._targetElement||(this._targetElement=this._component.firstElementChild)}initializeAccessibility(e){!this._targetElement||(this._targetElement.setAttribute("aria-atomic","true"),this._targetElement.setAttribute("aria-live","assertive"),this._targetElement.setAttribute("aria-haspopup","true"),this._targetElement.setAttribute("aria-expanded","false"),this._targetElement.hasAttribute("aria-label")||this._targetElement.setAttribute("aria-label",this._targetElement.textContent||""))}addTargetListener(e,t,n=!1){this._targetElement&&this._targetElement.addEventListener(e,t,n)}removeTargetListener(e,t){this._targetElement&&this._targetElement.removeEventListener(e,t)}attachMenu(e){this._listDropdown||!this._targetElement||(this._listDropdown=new B(this._targetElement,e),this._listDropdown.open(),this._targetElement.setAttribute("aria-expanded","true"),this._targetElement.setAttribute("aria-controls",`list-dropdown-popup-${e.id}`))}setOptions(e){this._listDropdown&&this._listDropdown.setOptions(e)}detachMenu(){this._targetElement&&(this._targetElement.removeAttribute("aria-activedescendant"),this._targetElement.removeAttribute("aria-expanded"),this._targetElement.removeAttribute("aria-controls")),this._listDropdown&&(this._listDropdown.close(),this._listDropdown.destroy(),this._listDropdown=void 0)}setActiveOption(e){var t;(t=this._listDropdown)==null||t.activateOption(e)}activateFirstOption(){var e;(e=this._listDropdown)==null||e.activateFirstOption()}setCascadeTargetInactive(){let e=this._targetElement;e!=null&&e.active&&(e.active=!1)}getActiveOptionIndex(){var e,t;return(t=(e=this._listDropdown)==null?void 0:e.getActiveOptionIndex())!=null?t:-1}focusTarget(){this._targetElement&&this._targetElement.focus()}isTargetFocused(){return document.activeElement===this._targetElement}updateActiveDescendant(e){!this._targetElement||(e?this._targetElement.setAttribute("aria-activedescendant",e):this._targetElement.removeAttribute("aria-activedescendant"))}addDropdownListener(e,t){!this._listDropdown||!this._listDropdown.dropdownElement||this._listDropdown.dropdownElement.addEventListener(e,t)}isOwnElement(e){return!this._targetElement||!this._listDropdown||!this._listDropdown.dropdownElement?!1:this._targetElement.contains(e)||!!this._listDropdown.dropdownElement.contains(e)}propagateKey(e){var t;(t=this._listDropdown)==null||t.handleKey(e)}proxyKeyboardEventToChild(e,t){if(!this.getDropdownElement())return;let n=this._getOpenChildMenu(t);n&&n.propagateKeyEvent(e)}toggleChildMenu(e,t){let r=this._getListItems()[e].parentElement;r&&r.tagName.toLowerCase()===i.elementName&&(t===void 0?r.open=!r.open:r.open=t,r.activateFirstOption())}createChildMenu(e,t,n,o,r){let d=document.createElement("forge-menu");return d.style.display="block",d.addEventListener(i.events.OPEN,()=>{this._childMenus.set(e,d),n(e)}),d.addEventListener(i.events.CLOSE,()=>{this._childMenus.delete(e),o(e)}),d.addEventListener(i.events.SELECT,f=>{f.stopPropagation(),r(b(c({},f.detail),{parentValue:t}))}),d}closeOtherChildMenus(e){let t=[];this._childMenus.forEach((n,o)=>{o!==e&&(n.open=!1,t.push(o))}),t.forEach(n=>this._childMenus.delete(n))}setSelectedValues(e){var t;(t=this._listDropdown)==null||t.setSelectedValues(e)}_getOpenChildMenu(e){if(!this.getDropdownElement())return null;let t=this._getOwnList(e);return t?t.querySelector(`${i.elementName}[${i.attributes.OPEN}]`):null}_getOwnList(e){let t=this.getDropdownElement();return t?t.querySelector(`${m.elementName}[id="list-dropdown-list-${e}"]`):null}_getListItems(){let e=this.getDropdownElement();if(!e)return[];let t=e.querySelector(m.elementName);return t?Array.from(t.querySelectorAll(N.elementName)):[]}};var h=class extends H{constructor(e){super({popupTimeout:i.numbers.POPUP_MOUSE_LEAVE_TIMEOUT,targetTimeout:i.numbers.CHILD_MOUSE_LEAVE_TIMEOUT});this._adapter=e;this._placement="bottom-start";this._fallbackPlacements=[];this._dense=!1;this._iconClass=y;this._persistSelection=!1;this._mode="click";this._identifier=g(),this._clickListener=t=>this._onTargetClick(t),this._blurListener=t=>this._onTargetBlur(t),this._selectListener=t=>this._handleSelectEvent(t),this._keydownListener=t=>this.onKeydown(t),this._activeChangeListener=t=>this._onActiveOptionChanged(t)}initialize(){this._adapter.initializeTarget(),this._adapter.initializeAccessibility(this._identifier),this._initializeInteractionListeners()}disconnect(){this._open&&this._closeDropdown(),this._destroyInteractionListeners()}activateFirstOption(){this._adapter.activateFirstOption()}_applyMode(){!this._adapter.hasTargetElement()||(this._mode!=="cascade"?this._adapter.addTargetListener("click",this._clickListener):this._attachCascadingListeners())}_initializeInteractionListeners(){!this._adapter.hasTargetElement()||(this._applyMode(),this._adapter.addTargetListener("keydown",this._keydownListener,!0),this._adapter.addTargetListener("focusout",this._blurListener))}_destroyInteractionListeners(){!this._adapter.hasTargetElement()||(this._adapter.removeTargetListener("keydown",this._clickListener),this._adapter.removeTargetListener("focusout",this._blurListener),this._adapter.removeTargetListener("click",this._clickListener),this._detachCascadingListeners())}_attachCascadingListeners(){this._adapter.addTargetListener("mouseenter",this._targetMouseEnterListener),this._adapter.addTargetListener("mouseleave",this._targetMouseLeaveListener),this._adapter.addDocumentListener("mousemove",this._documentMouseMoveListener)}_detachCascadingListeners(){this._adapter.removeTargetListener("mouseenter",this._targetMouseEnterListener),this._adapter.removeTargetListener("mouseleave",this._targetMouseLeaveListener),this._adapter.removeDocumentListener("mousemove",this._documentMouseMoveListener)}get _nonDividerOptions(){return this._flatOptions.filter(e=>!e.divider)}get _flatOptions(){return V(this._options,1)?this._options.reduce((e,t)=>e.concat(t.options),[]):this._options}_onTargetClick(e){if(this._open){this._closeDropdown();return}this.open=!this._open,this._open&&this._adapter.focusTarget()}_onTargetBlur(e){this._open&&this._closeDropdown()}_onActiveOptionChanged(e){let t={id:e},n=this._adapter.emitHostEvent(i.events.ACTIVE_CHANGE,t,!0,!0);this._mode!=="cascade"&&n&&this._adapter.updateActiveDescendant(e)}onKeydown(e){if(this._childOpen){this._adapter.proxyKeyboardEventToChild(e,this._identifier);return}switch(e.code){case"Tab":this._open&&this._selectActiveOption();break;case"Escape":this._open&&(e.preventDefault(),e.stopPropagation(),this._closeDropdown());break;case"Space":e.preventDefault(),this._open?this._closeDropdown():this._openDropdown({fromKeyboard:!0});break;case"Home":case"End":this._open&&(e.preventDefault(),this._adapter.propagateKey(e.code));break;case"Enter":if(e.preventDefault(),!this._open){e.preventDefault(),this._openDropdown({fromKeyboard:!0});return}e.stopImmediatePropagation(),this._adapter.propagateKey(e.code);let t=this._adapter.getActiveOptionIndex(),n=this._nonDividerOptions[t];n&&n.options&&n.options.length&&this._adapter.toggleChildMenu(t);break;case"ArrowUp":case"ArrowDown":if(this._open&&e.stopImmediatePropagation(),e.preventDefault(),!this._open&&e.code==="ArrowDown"){this._openDropdown({fromKeyboard:!0}),this._adapter.activateFirstOption();return}this._adapter.propagateKey(e.code);break;case"ArrowLeft":this._open&&e.stopImmediatePropagation(),this._mode==="cascade"&&this._open&&this._closeDropdown();break;case"ArrowRight":if(this._open&&e.stopImmediatePropagation(),!this._open)return;let o=this._adapter.getActiveOptionIndex(),r=this._nonDividerOptions[o];if(r&&r.options){this._adapter.toggleChildMenu(o,e.code==="ArrowRight");return}break}}async _openMenu({fromKeyboard:e}={}){this._open=!0;let t=[];if(typeof this._optionsFactory=="function")this._loadOptionsAsync(),this._options=[];else{if(!this._options||!this._options.length)return;t=this._options}this._persistSelection||t.forEach(r=>r.selected=!1),this._mapIconToLeadingIcon();let n=this._persistSelection?this._getSelectedValues():[],o={id:this._identifier,type:"menu",options:this._options,selectedValues:n,iconClass:this._iconClass,dense:this._dense,multiple:!1,popupStatic:!0,allowBusy:!0,asyncStyle:"spinner",optionBuilder:this._optionBuilder,optionLimit:this._optionLimit,headerBuilder:this._popupHeaderBuilder,footerBuilder:this._popupFooterBuilder,observeScroll:this._observeScroll,observeScrollThreshold:this._observeScrollThreshold,popupPlacement:this._placement,popupFallbackPlacements:this._fallbackPlacements,activeStartIndex:e?0:void 0,popupClasses:[i.classes.POPUP,i.classes.MENU,...this._popupClasses],syncWidth:this._syncPopupWidth,activeChangeCallback:this._activeChangeListener,selectCallback:this._selectListener,popupOffset:this._popupOffset,cascadingElementFactory:r=>this._createCascadingElement(r)};this._adapter.setHostAttribute(i.attributes.OPEN,""),this._adapter.attachMenu(o),this._mode==="cascade"&&(this._adapter.addDropdownListener("mouseenter",this._childPopupMouseEnterListener),this._adapter.addDropdownListener("mouseleave",this._childPopupMouseLeaveListener)),this._adapter.addDropdownListener(i.events.ACTIVE_CHANGE,r=>{this._onActiveOptionChanged(r.detail.id)}),this._adapter.emitHostEvent(i.events.OPEN)}_closeMenu(){this._open=!1,this._childOpen=!1,this._adapter.detachMenu(),this._activeMouseLeaveTimeout!==void 0&&window.clearTimeout(this._activeMouseLeaveTimeout),this._adapter.removeHostAttribute(i.attributes.OPEN),this._adapter.emitHostEvent(i.events.CLOSE)}_loadOptionsAsync(){return this._optionsFactory?Promise.resolve(this._optionsFactory()).then(e=>{if(this._persistSelection||e.forEach(t=>t.selected=!1),this._open)if(e&&I(e)&&e.length){this._options=e,this._adapter.setOptions(e);let t=this._getSelectedValues();t.length&&this._adapter.setSelectedValues(t)}else this._open&&this._closeDropdown()}).catch(e=>{console.error("An unexpected error ocurred while opening the menu:",e),this._open&&this._closeDropdown()}):(this._open&&this._closeMenu(),Promise.resolve())}_handleSelectEvent(e){let t=this._nonDividerOptions.findIndex(n=>n.value===e);t<0||this._selectOptionByIndex(t)}_selectActiveOption(){let e=this._adapter.getActiveOptionIndex();e>=0&&this._nonDividerOptions[e]&&this._selectOptionByIndex(e)}_selectOptionByIndex(e){let{options:t,value:n}=this._nonDividerOptions[e];if(t){this._adapter.setActiveOption(e);return}this._closeDropdown();let o={index:e,value:n};!this._adapter.emitHostEvent(i.events.SELECT,o,!0,!0)||(this._selectedValue=this._persistSelection?n:void 0)}_getSelectedValues(){let e=this._flatOptions.filter(t=>t.selected).map(t=>t.value);return this._selectedValue!==void 0&&e.push(this._selectedValue),e}_onCascadingOptionSelected(e){this._persistSelection&&(this._selectedValue=e.value),this._adapter.emitHostEvent(i.events.SELECT,e),this._closeDropdown()}_onCascadingChildOpen(e){super._clearMouseLeaveTimeout(),this._adapter.closeOtherChildMenus(e),this._childOpen=!0,this._adapter.setActiveOption(e)}_onCascadingChildClose(e){this._childOpen=!1}_closeDropdown(){this._closeMenu()}_openDropdown({fromKeyboard:e}={}){this._openMenu({fromKeyboard:e})}_setCascadeTargetInactive(){this._adapter.setCascadeTargetInactive()}_isOwnElement(e){return this._adapter.isOwnElement(e)}_createCascadingElement({index:e,options:t,parentValue:n}){let o=this._adapter.createChildMenu(e,n,this._onCascadingChildOpen.bind(this),this._onCascadingChildClose.bind(this),this._onCascadingOptionSelected.bind(this));return o.mode="cascade",o.popupOffset={x:0,y:-8},o.dense=this._dense,o.placement="right-start",o.fallbackPlacements=["left-start","right-start"],o.persistSelection=this._persistSelection,this._persistSelection&&(o.selectedValue=this._selectedValue),o.options=t,o.optionBuilder=this._optionBuilder,o.iconClass=this._iconClass,o}_mapIconToLeadingIcon(){this._flatOptions.filter(e=>e.icon).forEach(e=>e.leadingIcon=e.icon)}get open(){return this._open}set open(e){e=Boolean(e),this._open!==e&&(this._open=e,e?this._openDropdown():this._closeDropdown())}set options(e){if(typeof e=="function")this.optionsFactory=e;else if(this.optionsFactory=void 0,this._options=e.map(t=>c({},t)),this._open&&(this._mapIconToLeadingIcon(),this._adapter.setOptions(this._options),this._persistSelection)){let t=this._getSelectedValues();t.length&&this._adapter.setSelectedValues(t)}}get options(){return this._options?this._flatOptions.map(e=>c({},e)):[]}set optionsFactory(e){this._optionsFactory=e}set selectedIndex(e){let t=this._nonDividerOptions[e];t&&t.value!==this._selectedValue&&(this.selectedValue=t.value)}get selectedIndex(){return this._selectedValue!==void 0?this._nonDividerOptions.findIndex(e=>e.value===this._selectedValue):-1}set selectedValue(e){this._selectedValue!==e&&(this._selectedValue=e,this._adapter.setSelectedValues(this._selectedValue))}get selectedValue(){return this._selectedValue}get placement(){return this._placement}set placement(e){this._placement!==e&&(this._placement=e||"bottom-start",this._adapter.setHostAttribute(i.attributes.PLACEMENT,this._placement))}get fallbackPlacements(){return this._fallbackPlacements}set fallbackPlacements(e){this._fallbackPlacements=Array.isArray(e)?e:[]}get dense(){return this._dense}set dense(e){this._dense=e}get iconClass(){return this._iconClass}set iconClass(e){this._iconClass=e}get persistSelection(){return this._persistSelection}set persistSelection(e){this._persistSelection!==e&&(this._persistSelection=e,this._adapter.toggleHostAttribute(i.attributes.PERSIST_SELECTION,this._persistSelection),this._persistSelection||(this._flatOptions.forEach(t=>t.selected=!1),this._selectedValue=void 0))}get mode(){return this._mode}set mode(e){this._mode!==e&&(this._mode=e,this._destroyInteractionListeners(),this._applyMode(),this._adapter.setHostAttribute(i.attributes.MODE,this._mode))}get popupOffset(){return this._popupOffset}set popupOffset(e){this._popupOffset=e}get optionBuilder(){return this._optionBuilder}set optionBuilder(e){this._optionBuilder=e}get popupElement(){return this._adapter.getDropdownElement()}};var q="<template><slot></slot></template>",W=":host{display:inline-block}:host([hidden]){display:none}",s=class extends k{constructor(){super();w.define(P),this._foundation=new h(new u(this)),C(this,q,W)}static get observedAttributes(){return[i.attributes.OPEN,i.attributes.PLACEMENT,i.attributes.SELECTED_INDEX,i.attributes.SELECTED_VALUE,i.attributes.DENSE,i.attributes.ICON_CLASS,i.attributes.PERSIST_SELECTION,i.attributes.MODE,i.attributes.SYNC_POPUP_WIDTH,i.attributes.POPUP_CLASSES,i.attributes.OPTION_LIMIT,i.attributes.OBSERVE_SCROLL,i.attributes.OBSERVE_SCROLL_THRESHOLD]}connectedCallback(){this.querySelector(i.selectors.TOGGLE)?this._foundation.initialize():M(this,i.selectors.TOGGLE).then(()=>this._foundation.initialize())}attributeChangedCallback(e,t,n){switch(super.attributeChangedCallback(e,t,n),e){case i.attributes.OPEN:this._foundation.open=O(n);break;case i.attributes.PLACEMENT:this._foundation.placement=n;break;case i.attributes.SELECTED_INDEX:this._foundation.selectedIndex=Number(n);break;case i.attributes.SELECTED_VALUE:this._foundation.selectedValue=n;break;case i.attributes.DENSE:this._foundation.dense=_(n);break;case i.attributes.ICON_CLASS:this._foundation.iconClass=n;break;case i.attributes.PERSIST_SELECTION:this.persistSelection=_(n);break;case i.attributes.MODE:this.mode=n;break}}disconnectedCallback(){this._foundation.disconnect()}propagateKeyEvent(e){this._foundation.onKeydown(e)}activateFirstOption(){this._foundation.activateFirstOption()}};a([p()],s.prototype,"open",2),a([p()],s.prototype,"options",2),a([p()],s.prototype,"selectedIndex",2),a([p()],s.prototype,"selectedValue",2),a([p()],s.prototype,"placement",2),a([p()],s.prototype,"fallbackPlacements",2),a([p()],s.prototype,"dense",2),a([p()],s.prototype,"iconClass",2),a([p()],s.prototype,"persistSelection",2),a([p()],s.prototype,"mode",2),a([p()],s.prototype,"popupOffset",2),a([p()],s.prototype,"optionBuilder",2),a([p({set:!1})],s.prototype,"popupElement",2),s=a([T({name:i.elementName,dependencies:[F,x,K,A]})],s);function Ye(){L(s)}export{i as a,u as b,h as c,s as d,Ye as e};
|
|
7
|
+
//# sourceMappingURL=chunk.XBW46N2J.js.map
|
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
* Copyright 2023 Tyler Technologies, Inc.
|
|
4
4
|
* License: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import{a as w,b as L,d as O,e as B}from"./chunk.
|
|
7
|
-
//# sourceMappingURL=chunk.
|
|
6
|
+
import{a as w,b as L,d as O,e as B}from"./chunk.27TSALYN.js";import{E as N}from"./chunk.6OKJPSUE.js";import{F as S}from"./chunk.DT7MZR5Y.js";import{b as y}from"./chunk.MLV25D2G.js";import{e as g}from"./chunk.DONAMICM.js";import{e as V}from"./chunk.V7WKXEZC.js";import{b as M}from"./chunk.7A6MX6CS.js";import{p as P}from"./chunk.MZLPUI6R.js";import{a as D}from"./chunk.YI4JTY4T.js";import{d as T,l as F}from"./chunk.JHBCYICS.js";import{a as x}from"./chunk.ARJ3EVVO.js";import{b as A}from"./chunk.FVRSGKJD.js";import{e as m}from"./chunk.U6WGJELL.js";import{a as b,b as k}from"./chunk.BE7PZANN.js";import{a as E,e as C,i as I}from"./chunk.Y4GKBJGI.js";import{s as f}from"./chunk.PN26D52V.js";import{f as v}from"./chunk.J2M2MXP2.js";import{a as d,f as _}from"./chunk.MCIQXNKY.js";var r=`${k}date-picker`,z={VALUE:"value"},U={INPUT:"input,input[forge-date-picker-input]"},R={CHANGE:`${r}-change`,OPEN:`${r}-open`,CLOSE:`${r}-close`,INPUT:`${r}-input`},n={elementName:r,selectors:U,events:R,observedAttributes:z};var l=class extends O{constructor(e){super(e);this._dropdownIdentifier=`forge-date-picker-${this._identifier}`}_initializeInput(){this._inputElement=this._component.querySelector(n.selectors.INPUT)}_initializeCalendarDropdown(){let e=this._getDefaultTargetElement();this._calendarDropdown=new S(e,this._dropdownIdentifier)}initializeMask(e){var t;(t=this._inputMask)==null||t.destroy(),this._inputMask=new A(this._inputElement,e)}destroyMask(){var e;(e=this._inputMask)==null||e.destroy(),this._inputMask=void 0}initializeAccessibility(){this._inputElement.setAttribute("autocomplete","off"),this._inputElement.setAttribute("autocorrect","off"),this._inputElement.setAttribute("autocapitalize","off"),this._inputElement.setAttribute("spellcheck","false"),this._inputElement.setAttribute("role","combobox"),this._inputElement.setAttribute("aria-live","assertive"),this._inputElement.setAttribute("aria-atomic","true"),this._inputElement.setAttribute("aria-haspopup","true"),this._inputElement.setAttribute("aria-expanded","false"),this._inputElement.setAttribute("aria-owns",this._dropdownIdentifier)}addInputListener(e,t,i){var a;(a=this._inputElement)==null||a.addEventListener(e,t,{capture:i})}removeInputListener(e,t,i){var a;(a=this._inputElement)==null||a.removeEventListener(e,t,{capture:i})}setInputValueChangedListener(e,t){this.destroyValueChangeListener();let i=g(e,this._inputElement,"value",t);this._valueChangeListeners.push(i)}hasInputElement(){return!!this._inputElement}attachCalendar(e,t){super.attachCalendar(e,t),this._inputElement.setAttribute("aria-expanded","true")}detachCalendar(){super.detachCalendar(),this._inputElement&&(this._inputElement.setAttribute("aria-expanded","false"),this._inputElement.removeAttribute("aria-activedescendant"))}setActiveDescendant(e){this._inputElement.setAttribute("aria-activedescendant",e)}setInputValue(e,t){this._inputElement.value!==e&&(this._inputElement.value=e,this._inputMask&&this._inputMask.updateMask(),t&&(this._inputElement.dispatchEvent(new Event("change")),this._inputElement.dispatchEvent(new Event("input"))))}isInputDisabled(){return this._inputElement.disabled}isInputFocused(){return f()===this._inputElement}getInputValue(){return this._inputMask?this._inputMask.maskedValue:this._inputElement.value}setDisabled(e){this._inputElement.disabled=e,this._inputElement.setAttribute("aria-disabled",e.toString()),this._toggleElement&&(this._toggleElement.setAttribute("aria-disabled",e.toString()),this._toggleElement.hasOwnProperty("disabled")&&(this._toggleElement.disabled=e))}tryFocusInput(){this._inputElement.focus()}tryBlurInput(){this._inputElement.blur()}selectInputText(){this._inputElement.select()}emitInputEvent(e,t){I(this._inputElement,e,t)}};var p=class extends B{constructor(e){super(e);this._mode="single"}_initializeState(){this._value||(this._value=this._coerceDateValue(this._adapter.getInputValue()))}_emitChangeEvent(e,t){let i=this._getTypedValue(e);return this._adapter.emitHostEvent(n.events.CHANGE,i,!0,!t)?(this._setValue(e),!0):!1}_emitOpenEvent(){this._adapter.emitHostEvent(n.events.OPEN,void 0,!1)}_emitCloseEvent(){this._adapter.emitHostEvent(n.events.CLOSE,void 0,!1)}_onToday(){let e=new Date;e.setHours(0,0,0,0),this._onDateSelected({date:e,selected:!0,type:"date"})}_onClear(){this._onDateSelected({date:null,selected:!1,type:"date"})}_getCurrentValue(){return this._value}_setFormattedInputValue(e){let t=this._formatDate(this._value);t?this._adapter.setInputValue(t,e?!1:this._notifyInputValueChanges):this._allowInvalidDate||this._adapter.setInputValue("",e?!1:this._notifyInputValueChanges)}_setValue(e){(!e||this._isDateValueAcceptable(e))&&(this._value=e)}_onDateSelected(e){let t=e.date;if(e.type==="date"&&this._closeCalendar(!0),!this._emitChangeEvent(t))return;let i=this._formatDate(t);this._adapter.setInputValue(i,this._notifyInputValueChanges),this._formatInputValue(),D.isMobile||this._adapter.selectInputText()}_openCalendar(e){super._openCalendar(e);let t=this._getCurrentValue();t&&this._adapter.goToCalendarDate(new Date(t))}_applyMin(){this._value&&!this._isDateValueAcceptable(this._value)&&(this._emitChangeEvent(null,!0),this._setFormattedInputValue()),super._applyMin()}_applyMax(){this._value&&!this._isDateValueAcceptable(this._value)&&(this._emitChangeEvent(null,!0),this._setFormattedInputValue()),super._applyMax()}_applyDisabledDates(){this._value&&!this._isDateValueAcceptable(this._value)&&(this._emitChangeEvent(null,!0),this._setFormattedInputValue())}_applyDisabledDaysOfWeek(){this._value&&!this._isDateValueAcceptable(this._value)&&(this._emitChangeEvent(null,!0),this._setFormattedInputValue())}_handleInput(e){let t=this._getSanitizedDateString(e),i=this._coerceDateValue(t);this._masked&&this._adapter.emitInputEvent(n.events.INPUT,t),!m(i,this._value)&&this._isDateValueAcceptable(i)&&this._emitChangeEvent(i)}_onInputValueChanged(e){let t=this._getSanitizedDateString(e);if(this._masked&&t)return;let i=this._coerceDateValue(t);!m(i,this._value)&&this._isDateValueAcceptable(i)&&(this.value=i,this._emitChangeEvent(this._value))}_applyValue(){this._setFormattedInputValue(),this._open&&this._adapter.setCalendarValue(this._value)}get value(){let e=this._getTypedValue(this._value);return e?v(e)?new Date(e.getTime()):e:null}set value(e){this._value!==e&&(this._setValue(this._coerceDateValue(e)),this._isInitialized&&this._applyValue())}};var K="<template><slot></slot></template>",$=":host{display:block}:host([hidden]){display:none}",o=class extends L{static get observedAttributes(){return[...Object.values(w.observedAttributes),n.observedAttributes.VALUE]}constructor(){super(),T.define(P),C(this,K,$),this._foundation=new p(new l(this))}attributeChangedCallback(s,e,t){switch(s){case n.observedAttributes.VALUE:this.value=t;return}super.attributeChangedCallback(s,e,t)}};o=_([b({name:n.elementName,dependencies:[V,N,M,F]})],o);var H=class extends x{constructor(e){super(e)}_build(){let e=document.createElement(n.elementName);return this._attachTextField(e),e}getInputElement(){return this._textFieldDelegate.inputElement}getTextFieldElement(){return this._textFieldDelegate.element}get value(){return this._element.value}set value(e){this._element.value=e}get disabled(){return this._element.disabled}set disabled(e){this._element.disabled=e}get invalid(){return this._textFieldDelegate.invalid||!1}set invalid(e){this._textFieldDelegate.invalid=e}onChange(e){this._element.masked?this._element.addEventListener(n.events.INPUT,t=>e(t.target.value)):this.getInputElement().addEventListener("input",t=>e(t.target.value))}onInput(e){this._element.masked?this._element.addEventListener(n.events.INPUT,t=>e(t.detail)):this._textFieldDelegate.inputElement.addEventListener("input",t=>e(t.target.value))}onFocus(e){this._textFieldDelegate.inputElement.addEventListener("focus",t=>e(t))}onBlur(e){this._textFieldDelegate.inputElement.addEventListener("blur",t=>e(t))}_attachTextField(e){var i,a,c,h;let t={props:d({},(a=(i=this._config.options)==null?void 0:i.textFieldDelegateConfig)==null?void 0:a.props),options:d({},(h=(c=this._config.options)==null?void 0:c.textFieldDelegateConfig)==null?void 0:h.options)};this._textFieldDelegate=new y(t),e.appendChild(this._textFieldDelegate.element)}};function Fe(){E(o)}export{n as a,l as b,p as c,o as d,H as e,Fe as f};
|
|
7
|
+
//# sourceMappingURL=chunk.XZOIRI4V.js.map
|