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,EAAiBnD,YAAI,IAAAkD,EAAAA,EAAIpI,KAAKwG,YAE3CxG,KAAK2G,YAAczB,EAAO,GAC1BlF,KAAKwG,YAAcxG,KAAKyG,oBAAoBvB,GAC5ClF,KAAK0G,cAAoC,QAAvB4B,EAAkB,QAAlBC,EAAGvI,KAAKC,KAAKqE,aAAK,IAAAiE,OAAA,EAAfA,EAAiBpD,WAAG,IAAAmD,EAAAA,EAAItI,KAAK0G,aACtD,EACJ8B,EAvIqBpC,GAAoE/D,EAAAA,EAAAA,GAAAmG,EAAAlG,UAAA,QACpFuC,EAAAA,UAYDxC,EAAAA,EAAAA,GAAAmG,EAAAlG,UAAA,eAGCmG,EAAAA,WAAOpG,EAAAA,EAAAA,GAAAmG,EAAAlG,UAAA,iBAMPmG,EAAAA,WAHDpG,EAAAA,EAAAA,GAAAmG,EAAAlG,UAAA,eASCmG,EAAAA,WA+BDjG,EAAAA,EAAAA,GAAAgG,EAAAlG,UAAA,gBALCwC,EAAAA,EAAAA,UAAS,yBAA0B,cAAe,kBAmBnDtC,EAAAA,EAAAA,GAAAgG,EAAAlG,UAXC,kBAAAwC,EAAAA,EAAAA,UAAS,4CAA6C,oBA4BvDtC,EAAAA,EAAAA,GAAAgG,EAAAlG,UAAA,kBAdCwC,EAAAA,EAAAA,UAAS,kBA8BVtC,EAAAA,EAAAA,GAAAgG,EAAAlG,UAbC,qBAAAwC,EAAAA,EAAAA,UAAS,cAAe,gBAAiB,cAAe,kBAsBzDtC,EAAAA,EAAAA,GAAAgG,EAAAlG,UAAA,mBANCH,EAAAA,UAeDK,EAAAA,EAAAA,GAAAgG,EAAAlG,UAAA,gBANCH,EAAAA,UAgBAK,EAAAA,EAAAA,GAAAgG,EAAAlG,UAAA,kCAPAH,EAAAA,UAQJM,EAAAA,EAAAA,sBAAAhE,EAvIoB2H,E","sources":["src/components/row-item.hbs","src/components/row-item.ts","src/components/dropdown-select.hbs","src/components/dropdown-select.ts","src/components/segmented-time-picker.hbs","src/components/segmented-time-picker.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"
\\n {{#if @onRowClick}}\\n \\n {{yield}}\\n \\n {{else}}\\n
\\n {{yield}}\\n
\\n {{/if}}\\n\\n \\n {{#if @collapse}}\\n {{#if (or this.showEllipsis items.length)}}\\n \\n \\n \\n {{/if}}\\n {{else if items.length}}\\n
\\n {{#each items as |item|}}\\n {{#if item.visible}}\\n \\n {{/if}}\\n {{/each}}\\n
\\n {{/if}}\\n
\\n
\")","import Component from '@glimmer/component';\nimport { action } from '@ember/object';\nimport { service } from '@ember/service';\nimport { DeleteActionItem, EditActionItem, ActionItem } from '../utils/action-item.js';\n\nimport type { Registry as ServiceRegistry } from '@ember/service';\n\ntype Item = Omit & {\n icon: string;\n text: string;\n};\n\nexport interface RowItemSignature {\n Element: HTMLDivElement;\n Args: {\n /** The actions to show (could be dropdown actions or toolbar buttons). */\n items?: ActionItem[] | Promise;\n /** Called when the user interacts with the row-item content (not actions). */\n onRowClick?: VoidFunction;\n /** Indicates whether the row item should have a minimum height of 64px. */\n compact?: boolean;\n /** Indicates the items should be displayed within a dropdown-actions menu. */\n collapse?: boolean;\n /** Indicates dropdown-actions button or individual toolbar buttons should all be disabled. */\n areActionsDisabled?: boolean;\n /** Indicates whether the dropdown-actions button should be visible even when items are empty. */\n showEllipsis?: boolean;\n /** CSS class applied to the row-item content node. */\n rowContentClass?: string;\n /** Indicates whether to row should have a CSS class of `highlight-row`. */\n highlightRow?: boolean;\n };\n Blocks: {\n default: [];\n };\n}\n\nexport default class RowItem extends Component {\n @service declare intl: ServiceRegistry['adc-intl'];\n\n get showEllipsis(): boolean {\n return this.args.showEllipsis ?? true;\n }\n\n get highlightRow(): boolean {\n return this.args.highlightRow ?? true;\n }\n\n private updateDefaultActionProps(\n items: ActionItem[],\n defaultTextKey: string,\n type: new () => T\n ): void {\n const item = items.find((item) => item instanceof type);\n if (item) {\n const defaultText = this.intl.t(`@adc/ui-components.${defaultTextKey}`);\n\n // Add default text and icon title if it was not defined.\n item.text = item.text || defaultText;\n item.iconTitle = item.iconTitle || defaultText;\n }\n }\n\n get items(): Item[] | Promise {\n const { items } = this.args;\n if (!items) {\n return [];\n }\n\n return (async () => {\n const resolvedItems = await items;\n\n this.updateDefaultActionProps(resolvedItems, 'edit', EditActionItem);\n this.updateDefaultActionProps(resolvedItems, 'delete', DeleteActionItem);\n\n return (\n resolvedItems.filter((item) => {\n if (!item || !item.visible) {\n return false;\n }\n\n if (!(item instanceof ActionItem)) {\n console.error(\n `[@adc/ui-components/row-item]: The item ${item} must be an instance of ActionItem.`\n );\n return false;\n }\n\n if (!item.icon || !item.text) {\n console.error(`[@adc/ui-components/row-item]: The item ${item} must have an icon and text.`);\n return false;\n }\n\n return true;\n }) as Item[]\n ).sort((a, b) => (a instanceof DeleteActionItem ? 1 : b instanceof DeleteActionItem ? -1 : 0));\n })();\n }\n\n @action clickRow(): void {\n this.args.onRowClick?.();\n }\n\n @action async clickButton(item: ActionItem): Promise {\n await item.action?.();\n }\n}\n","import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{#unless @multiselect}}\\n \\n{{else}}\\n \\n <:default as |id classes togglePopoverVisibility|>\\n {{yield id classes togglePopoverVisibility}}\\n \\n \\n{{/unless}}\")","import Component from '@glimmer/component';\nimport { isArray, A } from '@ember/array';\nimport { computed } from '@ember/object';\nimport { inject as service } from '@ember/service';\nimport { capitalize } from '@ember/string';\nimport { isEmpty, isPresent } from '@ember/utils';\nimport DropdownSelectItem from '../utils/dropdown-select-item.js';\n\nimport type ADCIntlService from '@adc/i18n/services/adc-intl';\nimport type { MultiSelectSignature } from './dropdown-select/multi-select';\nimport type { SingleSelectSignature } from './dropdown-select/single-select';\nimport type { CommonInputErrorTooltipArgs } from './error-tooltip';\n\ntype MultiSelectSignatureArgs = MultiSelectSignature['Args'];\ntype SingleSelectSignatureArgs = SingleSelectSignature['Args'];\ntype Items = TItem[] | DropdownSelectItem[];\n\ninterface DropdownSelectCommonArgs extends CommonInputErrorTooltipArgs {\n /** The Drop down items to render. */\n items: Promise> | Items;\n /** The current select value (only works for single select). */\n value?: string;\n /** The key of the item used for the item value. */\n itemValueKey?: keyof TItem;\n /** The key of the item used for the item name. */\n itemNameKey?: keyof TItem;\n /** The key of the item used for the item description. */\n itemDescriptionKey?: keyof TItem;\n /** The key of the item used for the item disabled state. */\n itemDisabledKey?: keyof TItem;\n}\n\ninterface DropdownSelectSingleArgs\n extends DropdownSelectCommonArgs,\n Pick<\n SingleSelectSignatureArgs,\n 'value-change' | 'label' | 'selectId' | 'placeholder' | 'disabled' | 'required'\n > {\n /** Indicates the dropdown should be multi-select. */\n multiselect?: false;\n /** The tab index value for the native select element. */\n tabindex?: number;\n}\n\ninterface DropdownSelectMultiArgs\n extends DropdownSelectCommonArgs,\n Pick<\n MultiSelectSignatureArgs,\n | 'popoverPlacement'\n | 'popoverClass'\n | 'preventScroll'\n | 'popoverMaxHeight'\n | 'popoverMaxWidth'\n | 'popoverMinWidth'\n | 'matchTriggerElementWidth'\n | 'itemsText'\n | 'isOpen'\n | 'alwaysShowHeaders'\n | 'maxItemCount'\n | 'hasSearch'\n | 'searchString'\n | 'label'\n | 'placeholder'\n | 'disabled'\n | 'tabindex'\n | 'value-change'\n > {\n /** Indicates the dropdown should be multi-select. */\n multiselect: true;\n /** The popover max height, in pixels. */\n maxHeight?: MultiSelectSignatureArgs['popoverMaxHeight'];\n /** The popover max width, in pixels. */\n maxWidth?: MultiSelectSignatureArgs['popoverMaxWidth'];\n /** The popover minimum width, in pixels. */\n minWidth?: MultiSelectSignatureArgs['popoverMinWidth'];\n}\n\ninterface DropdownSelectSignature {\n Element: SingleSelectSignature['Element'] | MultiSelectSignature['Element'];\n Args: DropdownSelectMultiArgs | DropdownSelectSingleArgs;\n Blocks: {\n /** When passing a custom trigger (multiselect only) this will yield the `id` and CSS classes for the customer trigger, as well as an action for toggling the drop down opened/closed. */\n default: [string, string, (event: Event) => void];\n };\n}\n\n/**\n * @classdesc\n *\n * A middle-man component for rendering either a native HTML select element, or a custom multiselect dropdown list.\n */\nexport default class DropdownSelect extends Component> {\n @service declare intl: ADCIntlService;\n\n /**\n * Whether or not the dropdown wrapper should match the trigger element width, with respect to the min-width CSS property value.\n */\n get matchTriggerElementWidth(): boolean {\n const { args } = this;\n return (args.multiselect && args.matchTriggerElementWidth) ?? true;\n }\n\n /**\n * Converts a custom object into a {@link DropdownSelectItem} using the property keys (e.g. itemNameKey).\n */\n private convertToDropdownSelectItem(customItem: TItem): DropdownSelectItem {\n const newItemObject: Partial = {};\n\n type CustomKeyArgs = Pick<\n DropdownSelectSignature['Args'],\n 'itemNameKey' | 'itemValueKey' | 'itemDescriptionKey' | 'itemDisabledKey'\n >;\n ['name', 'value', 'description', 'disabled'].forEach((dropdownSelectKey) => {\n const customKey = this.args[`item${capitalize(dropdownSelectKey)}Key` as keyof CustomKeyArgs];\n\n // Was a key defined and does the custom object have a value for that key?\n if (customKey && isPresent(customItem[customKey])) {\n newItemObject[dropdownSelectKey] = customItem[customKey];\n }\n });\n\n return DropdownSelectItem.create(newItemObject as DropdownSelectItem);\n }\n\n /**\n * Transforms the items resolved in the promise into the correct format for use in the dropdown-select.\n *\n * @note This allows a developer to define a mapping and then have the dropdown-select component handle the\n * conversion once the promise resolves.\n */\n private transformItemsCollection(items: Items): DropdownSelectItem[] {\n // NOTE: The order of checks is important here. The order of precedence is:\n // 1. Value and name mapping\n // 2. No mapping (return the same array)\n\n if (!isArray(items) || isEmpty(items)) {\n return A([]);\n }\n\n // Is there a known mapping of value and name?\n if (this.args.itemValueKey && this.args.itemNameKey) {\n // Create a DropdownSelectItem for each item returned from the promise.\n return A((items as TItem[]).map((item) => this.convertToDropdownSelectItem(item)));\n }\n\n // No mapping was specified. Return the same array.\n return items as DropdownSelectItem[];\n }\n\n /**\n * Ensures that \"items\" are valid, are run through any specified transforms, and are wrapped in a PromiseArray.\n */\n @computed('args.items.[]')\n get itemsInternal(): Promise {\n return (async () => {\n const items = await this.args.items,\n transformedItems = this.transformItemsCollection(items);\n\n // Does each item have the correct DropdownSelectItem structure?\n transformedItems.forEach((item) => {\n if (!item || item.name === undefined || item.value === undefined) {\n throw new Error(`Item must have value and name properties ${JSON.stringify(item)}`);\n }\n });\n\n return transformedItems;\n })();\n }\n\n /**\n * A string copy of the value since it must be a string for data attribute lookup in the DOM.\n */\n @computed('args.value')\n get valueString(): string | undefined {\n const { value } = this.args;\n return isEmpty(value) ? value : String(value);\n }\n}\n","import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"
\\n \\n

\\n :\\n

\\n \\n {{#if this.useMeridiem}}\\n \\n {{/if}}\\n
\")","import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { computed, action } from '@ember/object';\nimport { inject as service } from '@ember/service';\nimport DropdownSelectItem, { SELECTED, UNSELECTED } from '../utils/dropdown-select-item.js';\n\nimport type ADCIntlService from '@adc/i18n/services/adc-intl';\n\nexport interface SegmentedTimeModel {\n hour: number;\n min: number;\n}\n\n/**\n * Default configuration for time picker if no placeholder is provided\n * @private\n */\nconst DefaultConfig: SegmentedTimeModel = {\n hour: 0,\n min: 0\n};\n\n/**\n * Build a list of dropdown select items for a given number value range and interval\n * @private\n */\nfunction buildDropdownOptions(\n minValue: number,\n maxValue: number,\n interval: number,\n comparisonValue: number,\n isMinute = false\n): DropdownSelectItem[] {\n const valueList = [];\n for (let value = minValue; value <= maxValue; value += interval) {\n valueList.push(value);\n }\n\n return valueList.map((value) =>\n DropdownSelectItem.create({\n name: isMinute ? String(value).padStart(2, '0') : String(value),\n value: String(value),\n state: comparisonValue === value ? SELECTED : UNSELECTED\n })\n );\n}\n\nexport interface SegmentedTimePickerSignature {\n Element: HTMLDivElement;\n Args: {\n /** The minimum possible minute value to display. */\n minMinute?: number;\n /** The maximum possible minute value to display. */\n maxMinute?: number;\n /** The interval which to increment the minute options. */\n minuteInterval?: number;\n /** The method to fire when a value is changed, allowing the parent to handle changes. */\n valueChange: (timeModel: SegmentedTimeModel, ...args: unknown[]) => void;\n /** The value of the time picker to initialize it or update it */\n value?: SegmentedTimeModel;\n };\n}\n\n/**\n * Time picker broken up into 3 segments: hour, minute, period\n * @classdesc\n */\nexport default class SegmentedTimePicker extends Component {\n @service declare intl: ADCIntlService;\n\n constructor(owner: unknown, args: SegmentedTimePickerSignature['Args']) {\n super(owner, args);\n\n const { min, hour } = args.value ?? DefaultConfig;\n\n this.currentHour = this.getHourWithMeridiem(hour);\n this.currentMinute = min;\n this.isCurrentAm = hour < 12;\n }\n\n /**\n * The currently selected hour value\n */\n @tracked\n currentHour: number;\n\n /**\n * The currently selected minute value\n */\n @tracked\n currentMinute: number;\n\n /**\n * Whether or not the current period is set to 'AM', for use only with meridiem displays\n */\n @tracked\n isCurrentAm: boolean;\n\n /**\n * Get the hour factoring in if we are using meridiem time\n */\n private getHourWithMeridiem(hour: number): number {\n return hour === 0 && this.useMeridiem ? 12 : hour > 12 && this.useMeridiem ? hour - 12 : hour;\n }\n\n /**\n * Whether or not the format uses am/pm\n */\n get useMeridiem(): boolean {\n return !this.intl\n .formatTimeTz(new Date('2020-06-04T13:00:00.000Z'), {\n hour: 'numeric',\n minute: '2-digit',\n timeZone: 'UTC'\n })\n .includes('13');\n }\n\n /**\n * Get the dropdown list items for the possible hours\n */\n @computed('args.{maxHour,minHour}', 'currentHour', 'useMeridiem')\n get hourOptions(): DropdownSelectItem[] {\n return buildDropdownOptions(this.useMeridiem ? 1 : 0, this.useMeridiem ? 12 : 23, 1, this.currentHour);\n }\n\n /**\n * Get the dropdown list items for the possible minutes\n */\n @computed('args.{maxMinute,minMinute,minuteInterval}', 'currentMinute')\n get minuteOptions(): DropdownSelectItem[] {\n return buildDropdownOptions(\n this.args.minMinute ?? 0,\n this.args.maxMinute ?? 60,\n this.args.minuteInterval ?? 1,\n this.currentMinute,\n true\n );\n }\n\n /**\n * Get the dropdown list items for the possible periods\n */\n @computed('isCurrentAm')\n get periodOptions(): DropdownSelectItem[] {\n return [\n ['am', this.isCurrentAm],\n ['pm', !this.isCurrentAm]\n ].map(([value, state]: [string, boolean]) =>\n DropdownSelectItem.create({\n name: this.intl.t(`@adc/ui-components.${value}`),\n value,\n state: state ? SELECTED : UNSELECTED\n })\n );\n }\n\n /**\n * Get the current time configuration\n */\n @computed('currentHour', 'currentMinute', 'isCurrentAm', 'useMeridiem')\n get currentTimeModel(): SegmentedTimeModel {\n let { currentHour } = this;\n if (currentHour === 12 && this.isCurrentAm && this.useMeridiem) {\n currentHour = 0;\n }\n\n return {\n hour: this.useMeridiem && !this.isCurrentAm && currentHour != 12 ? currentHour + 12 : currentHour,\n min: this.currentMinute\n };\n }\n\n /**\n * Set the current minute or hour and pass the current time config to the passed valueChange method\n */\n @action\n changeTimeValue(key: 'currentHour' | 'currentMinute', newValue: string): void {\n this[key] = Number(newValue);\n this.args.valueChange(this.currentTimeModel);\n }\n\n /**\n * Set the current period and pass the current time config to the passed valueChange method\n */\n @action\n changePeriod(newPeriod: string): void {\n this.isCurrentAm = newPeriod === 'am';\n this.args.valueChange(this.currentTimeModel);\n }\n\n /**\n * Update the current time when the passed value is updated\n */\n @action\n updateCurrentTimeByPassedValue(): void {\n const hour = this.args.value?.hour ?? this.currentHour;\n\n this.isCurrentAm = hour < 12;\n this.currentHour = this.getHourWithMeridiem(hour);\n this.currentMinute = this.args.value?.min ?? this.currentMinute;\n }\n}\n"],"names":["TEMPLATE","createTemplateFactory","scope","coalesce_","on","preventDefault_","asyncLoader_","or_","dropdownActions_","t_","buttonIcon_","buttonAsync_","fn","_intl","WeakMap","RowItem","Component","constructor","arguments","_classPrivateFieldInitSpec","i","showEllipsis","_this$args$showEllips","this","args","highlightRow","_this$args$highlightR","updateDefaultActionProps","items","defaultTextKey","type","item","find","defaultText","intl","t","concat","text","iconTitle","resolvedItems","EditActionItem","DeleteActionItem","filter","visible","ActionItem","icon","console","error","sort","a","b","clickRow","_this$args$onRowClick","_this$args","onRowClick","call","clickButton","_item$action","action","_RowItem","g","prototype","service","n","setComponentTemplate","dropdownSelectSingleSelect_","eq_","dropdownSelectMultiSelect_","DropdownSelect","matchTriggerElementWidth","_ref","multiselect","convertToDropdownSelectItem","customItem","newItemObject","forEach","dropdownSelectKey","customKey","capitalize","isPresent","DropdownSelectItem","create","transformItemsCollection","isArray","isEmpty","A","itemValueKey","itemNameKey","map","itemsInternal","transformedItems","undefined","name","value","Error","JSON","stringify","valueString","String","_DropdownSelect","inject","computed","didUpdate_","dropdownSelect_","DefaultConfig","hour","min","buildDropdownOptions","minValue","maxValue","interval","comparisonValue","isMinute","length","valueList","push","padStart","state","SELECTED","UNSELECTED","_currentHour","_currentMinute","_isCurrentAm","SegmentedTimePicker","owner","_args$value","super","currentHour","getHourWithMeridiem","currentMinute","isCurrentAm","useMeridiem","formatTimeTz","Date","minute","timeZone","includes","hourOptions","minuteOptions","_this$args$minMinute","_this$args$maxMinute","_this$args$minuteInte","minMinute","maxMinute","minuteInterval","periodOptions","currentTimeModel","changeTimeValue","key","newValue","Number","valueChange","changePeriod","newPeriod","updateCurrentTimeByPassedValue","_this$args$value$hour","_this$args$value","_this$args$value$min","_this$args$value2","_SegmentedTimePicker","tracked"],"sourceRoot":""}