@mgdis/mg-components 6.10.0 → 6.11.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/dist/cjs/{index-CfIlskRh.js → index-B_WwxtkQ.js} +4 -4
- package/dist/cjs/{index-CfIlskRh.js.map → index-B_WwxtkQ.js.map} +1 -1
- package/dist/cjs/{index.es-BCLy9yYb.js → index.es-C-3Gv8Eu.js} +85 -81
- package/dist/cjs/index.es-C-3Gv8Eu.js.map +1 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/mg-action-more_37.cjs.entry.js +1915 -1909
- package/dist/cjs/mg-action-more_37.cjs.entry.js.map +1 -1
- package/dist/cjs/mg-alert.cjs.entry.js +6 -6
- package/dist/cjs/mg-components.cjs.js +1 -1
- package/dist/cjs/mg-input-combobox.cjs.entry.js +75 -72
- package/dist/cjs/mg-input-combobox.cjs.entry.js.map +1 -1
- package/dist/cjs/mg-input-combobox.entry.cjs.js.map +1 -1
- package/dist/cjs/mg-input-rich-text-editor.cjs.entry.js +12 -12
- package/dist/cjs/mg-loader.cjs.entry.js +4 -4
- package/dist/cjs/mg-progress.cjs.entry.js +10 -10
- package/dist/collection/components/atoms/mg-button/mg-button.js +1 -1
- package/dist/collection/components/atoms/mg-button/mg-button.js.map +1 -1
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.conf.js +0 -1
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.conf.js.map +1 -1
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js +43 -63
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-combobox/mg-input-combobox.conf.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-combobox/mg-input-combobox.js +67 -45
- package/dist/collection/components/molecules/inputs/mg-input-combobox/mg-input-combobox.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +25 -30
- package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js.map +1 -1
- package/dist/collection/components/molecules/mg-details/mg-details.js +5 -1
- package/dist/collection/components/molecules/mg-details/mg-details.js.map +1 -1
- package/dist/collection/components/molecules/mg-popover/mg-popover.js +47 -97
- package/dist/collection/components/molecules/mg-popover/mg-popover.js.map +1 -1
- package/dist/components/index.es.js +71 -68
- package/dist/components/index.es.js.map +1 -1
- package/dist/components/index2.js +2 -2
- package/dist/components/mg-action-more.js +6 -6
- package/dist/components/mg-alert.js +5 -5
- package/dist/components/mg-badge2.js +6 -6
- package/dist/components/mg-button2.js +7 -7
- package/dist/components/mg-button2.js.map +1 -1
- package/dist/components/mg-character-left2.js +4 -4
- package/dist/components/mg-details.js +8 -4
- package/dist/components/mg-details.js.map +1 -1
- package/dist/components/mg-form.js +7 -7
- package/dist/components/mg-icon2.js +6 -6
- package/dist/components/mg-illustrated-message.js +5 -5
- package/dist/components/mg-input-checkbox.js +9 -9
- package/dist/components/mg-input-combobox.js +74 -71
- package/dist/components/mg-input-combobox.js.map +1 -1
- package/dist/components/mg-input-date.js +17 -17
- package/dist/components/mg-input-numeric.js +13 -13
- package/dist/components/mg-input-password.js +3 -3
- package/dist/components/mg-input-radio.js +7 -7
- package/dist/components/mg-input-rich-text-editor.js +11 -11
- package/dist/components/mg-input-select2.js +32 -37
- package/dist/components/mg-input-select2.js.map +1 -1
- package/dist/components/mg-input-text2.js +9 -9
- package/dist/components/mg-input-textarea.js +7 -7
- package/dist/components/mg-input-title2.js +4 -4
- package/dist/components/mg-input-toggle.js +6 -6
- package/dist/components/mg-input2.js +8 -8
- package/dist/components/mg-item-more2.js +7 -7
- package/dist/components/mg-loader2.js +3 -3
- package/dist/components/mg-menu-item2.js +11 -11
- package/dist/components/mg-message2.js +4 -4
- package/dist/components/mg-modal.js +8 -8
- package/dist/components/mg-pagination2.js +6 -6
- package/dist/components/mg-panel.js +9 -9
- package/dist/components/mg-popover-content2.js +4 -4
- package/dist/components/mg-popover-content2.js.map +1 -1
- package/dist/components/mg-popover2.js +48 -96
- package/dist/components/mg-popover2.js.map +1 -1
- package/dist/components/mg-progress.js +10 -10
- package/dist/components/mg-skip-links.js +2 -2
- package/dist/components/mg-table.js +6 -6
- package/dist/components/mg-tabs.js +12 -12
- package/dist/components/mg-tag.js +4 -4
- package/dist/components/mg-tooltip-content2.js +1 -1
- package/dist/components/mg-tooltip-content2.js.map +1 -1
- package/dist/components/mg-tooltip2.js +47 -66
- package/dist/components/mg-tooltip2.js.map +1 -1
- package/dist/components/popper.js +1793 -0
- package/dist/components/popper.js.map +1 -0
- package/dist/esm/{index-DmsGewMC.js → index-DHpyFawS.js} +4 -4
- package/dist/esm/{index-DmsGewMC.js.map → index-DHpyFawS.js.map} +1 -1
- package/dist/esm/{index.es-rLV3KFPd.js → index.es-lyrZ9KRh.js} +73 -70
- package/dist/esm/index.es-lyrZ9KRh.js.map +1 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/mg-action-more_37.entry.js +1915 -1909
- package/dist/esm/mg-action-more_37.entry.js.map +1 -1
- package/dist/esm/mg-alert.entry.js +6 -6
- package/dist/esm/mg-components.js +1 -1
- package/dist/esm/mg-input-combobox.entry.js +75 -72
- package/dist/esm/mg-input-combobox.entry.js.map +1 -1
- package/dist/esm/mg-input-rich-text-editor.entry.js +12 -12
- package/dist/esm/mg-loader.entry.js +4 -4
- package/dist/esm/mg-progress.entry.js +10 -10
- package/dist/mg-components/mg-components.esm.js +1 -1
- package/dist/mg-components/mg-input-combobox.entry.esm.js.map +1 -1
- package/dist/mg-components/{p-ad66e7b3.entry.js → p-596c0e08.entry.js} +2 -2
- package/dist/mg-components/p-8a3bd8ad.entry.js +2 -0
- package/dist/mg-components/p-8a3bd8ad.entry.js.map +1 -0
- package/dist/mg-components/p-98a74b62.entry.js +2 -0
- package/dist/mg-components/{p-cdbe689e.entry.js.map → p-98a74b62.entry.js.map} +1 -1
- package/dist/mg-components/{p-DK9teKTo.js → p-C-vIqOyI.js} +2 -2
- package/dist/mg-components/{p-DK9teKTo.js.map → p-C-vIqOyI.js.map} +1 -1
- package/dist/mg-components/{p-73099ed7.entry.js → p-d4ed3aad.entry.js} +2 -2
- package/dist/mg-components/p-e822bd96.entry.js +2 -0
- package/dist/mg-components/{p-88f77de2.entry.js.map → p-e822bd96.entry.js.map} +1 -1
- package/dist/mg-components/p-fc7b96e6.entry.js +2 -0
- package/dist/mg-components/p-fc7b96e6.entry.js.map +1 -0
- package/dist/mg-components/p-lyrZ9KRh.js +2 -0
- package/dist/mg-components/p-lyrZ9KRh.js.map +1 -0
- package/dist/types/components/atoms/mg-tooltip/mg-tooltip.conf.d.ts +0 -6
- package/dist/types/components/atoms/mg-tooltip/mg-tooltip.d.ts +6 -8
- package/dist/types/components/molecules/inputs/mg-input-combobox/mg-input-combobox.conf.d.ts +1 -1
- package/dist/types/components/molecules/inputs/mg-input-combobox/mg-input-combobox.d.ts +5 -0
- package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.d.ts +0 -9
- package/dist/types/components/molecules/mg-details/mg-details.d.ts +1 -0
- package/dist/types/components/molecules/mg-popover/mg-popover.d.ts +8 -22
- package/dist/types/components.d.ts +11 -8
- package/ide/intellij/web-types.json +6 -2
- package/ide/vscode/html-custom-data.json +1 -1
- package/package.json +12 -12
- package/dist/cjs/index.es-BCLy9yYb.js.map +0 -1
- package/dist/collection/components/molecules/mg-popover/mg-popover.conf.js +0 -2
- package/dist/collection/components/molecules/mg-popover/mg-popover.conf.js.map +0 -1
- package/dist/collection/utils/floating-ui.utils.js +0 -74
- package/dist/collection/utils/floating-ui.utils.js.map +0 -1
- package/dist/components/floating-ui.utils.js +0 -1721
- package/dist/components/floating-ui.utils.js.map +0 -1
- package/dist/esm/index.es-rLV3KFPd.js.map +0 -1
- package/dist/mg-components/p-0f761c6c.entry.js +0 -2
- package/dist/mg-components/p-0f761c6c.entry.js.map +0 -1
- package/dist/mg-components/p-88f77de2.entry.js +0 -2
- package/dist/mg-components/p-cdbe689e.entry.js +0 -2
- package/dist/mg-components/p-d3a868f0.entry.js +0 -2
- package/dist/mg-components/p-d3a868f0.entry.js.map +0 -1
- package/dist/mg-components/p-rLV3KFPd.js +0 -2
- package/dist/mg-components/p-rLV3KFPd.js.map +0 -1
- package/dist/types/components/molecules/mg-popover/mg-popover.conf.d.ts +0 -6
- package/dist/types/utils/floating-ui.utils.d.ts +0 -28
- /package/dist/mg-components/{p-ad66e7b3.entry.js.map → p-596c0e08.entry.js.map} +0 -0
- /package/dist/mg-components/{p-73099ed7.entry.js.map → p-d4ed3aad.entry.js.map} +0 -0
package/dist/collection/components/molecules/inputs/mg-input-combobox/mg-input-combobox.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mg-input-combobox.js","sourceRoot":"","sources":["../../../../../src/components/molecules/inputs/mg-input-combobox/mg-input-combobox.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAgB,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACvG,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,qBAAqB,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAmB,QAAQ,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAEnL,OAAO,EAAoD,MAAM,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAEnI,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,gCAAgC,CAAC;AAEtD;;;;GAIG;AACH,MAAM,MAAM,GAAG,CAAC,IAAa,EAAkB,EAAE,CAAC,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,OAAQ,IAAe,CAAC,KAAK,KAAK,QAAQ,IAAK,IAAe,CAAC,KAAK,KAAK,SAAS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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Event, h, Prop, EventEmitter, State, Element, Method, Watch } from '@stencil/core';\nimport { allItemsAreString, ClassList, getObjectValueFromKey, isValidString, nextTick, Page, Paginate, Cursor, type CursorType, toString, isObject } from '@mgdis/stencil-helpers';\nimport { type ActionType, type RequestMappingType, type ResponseMappingType } from './mg-input-combobox.conf';\nimport { type TooltipPosition, type Width, type EventType, widths, classReadonly, classDisabled } from '../mg-input/mg-input.conf';\nimport type { Option } from '../../../../types';\nimport { initLocales } from '../../../../locales';\nimport { Keys } from '../../../../utils/events.utils';\n\n/**\n * Check if object is an item\n * @param item - object to check\n * @returns True if object is an item\n */\nconst isItem = (item: unknown): item is Option => item && typeof item === 'object' && typeof (item as Option).title === 'string' && (item as Option).value !== undefined;\n\n/**\n * Check if objects are items\n * @param items - items to check\n * @returns True if objects are items\n */\nconst isItems = (items: unknown[]): items is Option[] => Array.isArray(items) && items.every(isItem);\n\n/**\n * Check if object is valid combobox fetchmappings\n * @param value - to validate\n * @returns truthy if mapping is valid\n */\nconst isFetchmappings = (value: unknown): value is MgInputCombobox['fetchmappings'] => {\n const isValidRoot = isObject<Record<string, unknown>>(value) && Object.hasOwn(value, 'request') && Object.hasOwn(value, 'response');\n if (isValidRoot) {\n const { request, response } = value as MgInputCombobox['fetchmappings'];\n if ([request, response].some(property => !isObject(property))) return false;\n const isValidRequest = typeof request.filter === 'string';\n const isValidResponse =\n typeof response === 'object' &&\n typeof response.total === 'string' &&\n typeof response.items === 'string' &&\n typeof response.next === 'string' &&\n typeof response.itemTitle === 'string' &&\n typeof response.itemValue === 'string';\n return isValidRequest && isValidResponse;\n } else {\n return isValidRoot;\n }\n};\n\n/**\n * Map new URL from old url\n * @param newValue - new URL value\n * @param oldValue - previous URL value\n * @returns updated url\n */\nconst mapUrl = (newValue: string, oldValue: string): string => {\n if (!Boolean(newValue)) return;\n else if (URL.canParse(newValue)) {\n return newValue;\n }\n\n // build new URL\n const params = newValue.includes('?') && newValue.split('?').pop();\n if (Boolean(params)) {\n const { origin, pathname } = new URL(oldValue);\n return `${origin}${pathname}?${params}`;\n } else {\n return newValue;\n }\n};\n\n@Component({\n tag: 'mg-input-combobox',\n styleUrl: '../../../../../node_modules/@mgdis/styles/dist/components/mg-input-combobox.css',\n shadow: true,\n})\nexport class MgInputCombobox {\n /************\n * Internal *\n ************/\n\n // Classes\n private readonly classFocus = 'mg-u-is-focused';\n\n // HTML selector\n private input: HTMLInputElement;\n private loadMoreElement: HTMLMgButtonElement;\n private popoverId: string;\n\n // Locales\n private messages;\n\n // hasDisplayedError (triggered by blur event)\n private hasDisplayedError = false;\n\n private handlerInProgress: EventType;\n private loadingAction: ActionType['name'];\n\n private page: Page<Option>;\n\n /**************\n * Decorators *\n **************/\n\n /**\n * Get component DOM element\n */\n @Element() element: HTMLMgInputComboboxElement;\n\n /**\n * Define component value\n */\n @Prop({ mutable: true, reflect: true }) value: string | Option;\n @Watch('value')\n watchValue(newValue: MgInputCombobox['value']): void {\n this.filter = this.getValueTitle();\n this.valueChange.emit(newValue);\n }\n\n /**\n * Define components items\n */\n @Prop() items: (string | Option)[];\n @Watch('items')\n watchItems(newValue: MgInputCombobox['items']) {\n if (Boolean(this.fetchurl) && !Boolean(newValue)) {\n // skip newValue check\n return;\n } else if (Boolean(this.fetchurl) && Boolean(newValue)) {\n throw new Error(`<mg-input-combobox> prop \"items\" values cannot be use with \"fetchurl\" prop defined. Passed value: ${toString(newValue)}.`);\n }\n // Empty options\n else if (Array.isArray(newValue) && newValue.length === 0) {\n this.options = new Paginate([]);\n }\n // String array\n else if (allItemsAreString(newValue)) {\n this.options = new Paginate(\n newValue.map(item => ({ title: item, value: item })),\n { total: newValue.length },\n );\n }\n // Object array\n else if (isItems(newValue)) {\n this.options = new Paginate(newValue, { total: newValue.length });\n } else {\n throw new Error(`<mg-input-combobox> prop \"items\" values must be the same type, string or Option. Passed value: ${toString(newValue)}.`);\n }\n }\n\n /**\n * Define items label\n * Include short description. Required for accessibility.\n * @example\n * ```\n * Countries\n * ```\n */\n @Prop() itemsLabel!: string;\n\n /**\n * Identifier is used for the element ID (id is a reserved prop in Stencil.js)\n */\n @Prop() identifier!: string;\n @Watch('identifier')\n watchIdentifier(newValue: MgInputCombobox['identifier']): void {\n if (Boolean(newValue)) {\n this.popoverId = `${newValue}-popover`;\n this.element.dataset.mgPopoverGuard = this.popoverId;\n }\n }\n\n /**\n * Input name\n * If not set the value equals the identifier\n */\n @Prop() name: string = this.identifier;\n\n /**\n * Input label\n */\n @Prop() label!: string;\n\n /**\n * Define if label is displayed on top\n */\n @Prop() labelOnTop = false;\n\n /**\n * Define if label is visible\n */\n @Prop() labelHide = false;\n\n /**\n * Define input placeholder.\n * It should be a word or short phrase that demonstrates the expected type of data, not a replacement for labels or help combobox.\n */\n @Prop() placeholder?: string;\n\n /**\n * Define if input is required\n */\n @Prop() required = false;\n\n /**\n * Define if input is readonly\n */\n @Prop() readonly = false;\n @Watch('readonly')\n watchReadonly(newValue: MgInputCombobox['readonly']): void {\n if (newValue) this.classCollection.add(classReadonly);\n else this.classCollection.delete(classReadonly);\n }\n\n /**\n * Define if input is disabled\n */\n @Prop() disabled = false;\n @Watch('required')\n @Watch('readonly')\n @Watch('disabled')\n watchValidityChange(newValue: boolean, _oldValue: boolean, prop: string): void {\n if (this.input === undefined) return;\n this.input[prop] = newValue;\n this.checkValidity();\n if (this.hasDisplayedError) {\n this.setErrorMessage();\n this.hasDisplayedError = false;\n }\n }\n\n @Watch('disabled')\n watchDisabled(newValue: MgInputCombobox['disabled']): void {\n if (newValue) {\n this.classCollection.add(classDisabled);\n } else {\n this.classCollection.delete(classDisabled);\n }\n }\n\n /**\n * Define input width\n */\n @Prop() mgWidth: Width = 'full';\n @Watch('mgWidth')\n watchMgWidth(newValue: MgInputCombobox['mgWidth']): void {\n // reset width class\n widths.forEach(width => {\n this.classCollection.delete(`mg-c-input--width-${width}`);\n });\n\n // apply new width\n if (newValue !== undefined) this.classCollection.add(`mg-c-input--width-${this.mgWidth}`);\n this.classCollection = new ClassList(this.classCollection.classes);\n }\n\n /**\n * Add a tooltip message next to the input\n */\n @Prop() tooltip?: string;\n\n /**\n * Define tooltip position\n */\n @Prop() tooltipPosition: TooltipPosition = 'input';\n\n /**\n * Add a help text under the input, usually expected data format and example\n */\n @Prop() helpText?: string;\n\n /**\n * Define API url to fetch\n * @example\n * ```\n * {\n * url: \"http://myapi.com?$select='href,name'&my-custom-param='my-custom-value'\", // url to fetch\n * }\n * ```\n */\n @Prop() fetchurl?: string | URL;\n @Watch('fetchurl')\n watchFetchUrl(newValue: MgInputCombobox['fetchurl']): void {\n if (newValue && !URL.canParse(newValue)) {\n throw new Error(`<mg-input-combobox> prop \"fetchurl\" value must be URL or string. Passed value: ${toString(newValue)}.`);\n }\n }\n\n /**\n * Define fetch options object\n * Require `fetchurl` prop to be defined otherwith it will be ignored if defined\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/RequestInit}\n * @example JSON headers:\n * ```json\n * {\n * \"headers\": {\n * \"authorization\": \"my-token\"\n * }\n * }\n * ```\n */\n @Prop() fetchoptions?: RequestInit;\n @Watch('fetchoptions')\n watchFetchOptions(newValue: MgInputCombobox['fetchoptions']): void {\n if (this.fetchurl && newValue && !isObject(newValue)) {\n throw new Error(`<mg-input-combobox> prop \"fetchoptions\" value must be a valid RequestInit. Passed value: ${toString(newValue)}.`);\n } else {\n new Request(this.fetchurl, newValue);\n }\n }\n\n /**\n * Define fetch request mappings.\n * Required with `fetchurl`\n * @example\n * ```\n * {\n * request: {\n * filter: 'name', // `filter` key\n * },\n * response: {\n * total: 'body.data.total', // response object mapping to get `total` value\n * items: 'body.data.results' // response object mapping to get `items` value\n * next: 'body.next' // response object mapping to get `next` items\n * itemTitle: 'name', // item property to map on item['title']\n * itemValue: 'href', // item property to map on item['value']\n * }\n * }\n * ```\n */\n @Prop() fetchmappings?: { request: RequestMappingType; response: ResponseMappingType };\n @Watch('fetchmappings')\n watchFetchMappings(newValue: MgInputCombobox['fetchmappings']): void {\n if (Boolean(this.fetchurl) && !Boolean(newValue)) {\n throw new Error(`<mg-input-combobox> prop \"fetchmappings\" is required with \"fetchurl\" prop.`);\n } else if (Boolean(newValue) && !isFetchmappings(newValue)) {\n throw new Error(\n `<mg-input-combobox> prop \"fetchmappings\" value must be { request: RequestMappingType, response: ResponseMappingType }. Passed value: ${toString(newValue)}.`,\n );\n }\n }\n\n /**\n * Define input valid state\n */\n @Prop({ mutable: true }) valid: boolean;\n\n /**\n * Define input invalid state\n */\n @Prop({ mutable: true }) invalid: boolean;\n\n /**\n * Define if items are loading\n */\n @State() isLoading: boolean;\n\n /**\n * Formated items for display\n */\n @State() options: Paginate<Option> = new Paginate([]);\n @Watch('options')\n watchOptions(newValue: Paginate<Option>): void {\n this.page = newValue.getPage(0, Boolean(this.filter) ? this.optionsFilter : undefined);\n }\n\n /**\n * Active option\n */\n @State() option: Option;\n\n /**\n * Option filter\n */\n @State() filter: string = '';\n @Watch('filter')\n watchFilter(newValue: MgInputCombobox['filter']): void {\n this.loadingWrapper({ name: 'load-data' });\n this.filterChange.emit(newValue);\n }\n\n /**\n * Component classes\n */\n @State() classCollection: ClassList = new ClassList(['mg-c-input--combobox', 'mg-c-input--has-icon', 'mg-c-input--input-append']);\n\n /**\n * Error message to display\n */\n @State() errorMessage: string;\n\n /**\n * Popover display state\n */\n @State() popoverDisplay = false;\n @Watch('popoverDisplay')\n watchPopoverDisplay(newValue: MgInputCombobox['popoverDisplay']): void {\n if (newValue) {\n this.classCollection.add(this.classFocus);\n this.input.focus();\n this.scrollToIndex(0);\n } else {\n // remove visual focus\n this.option = null;\n // reset filter with value\n this.filter = this.getValueTitle();\n this.classCollection.delete(this.classFocus);\n this.handlerInProgress = 'blur';\n this.displayError().finally(() => {\n // reset guard\n this.handlerInProgress = undefined;\n });\n }\n }\n\n /**\n * Emited event when value change\n */\n @Event({ eventName: 'value-change' }) valueChange: EventEmitter<HTMLMgInputComboboxElement['value']>;\n\n /**\n * Emited event when filter change\n */\n @Event({ eventName: 'filter-change' }) filterChange: EventEmitter<string>;\n\n /**\n * Emited event when `load-more` is called\n */\n @Event({ eventName: 'load-more' }) loadMore: EventEmitter<void>;\n\n /**\n * Emited event when checking validity\n */\n @Event({ eventName: 'input-valid' }) inputValid: EventEmitter<HTMLMgInputComboboxElement['valid']>;\n\n /**\n * Public method to play input focus\n */\n @Method()\n async setFocus(): Promise<void> {\n this.input.focus();\n }\n\n /**\n * Display input error if it exists.\n */\n @Method()\n displayError(): Promise<void> {\n // Use `Promise` as requested for stencil method\n // Use `requestAnimationFrame` to ensure:\n // - DOM is fully updated before validation\n // - Async operations are completed\n // - No timing issues with Stencil's render cycle\n // - Keep everything in sync both inside and outside the component\n return new Promise(resolve => {\n requestAnimationFrame(() => {\n this.checkValidity();\n this.setErrorMessage();\n this.hasDisplayedError = this.invalid;\n resolve();\n });\n });\n }\n\n /**\n * Set an error and display a custom error message.\n * This method can be used to set the component's error state from its concombobox by passing a boolean value to the `valid` parameter.\n * It must be paired with an error message to display for the given concombobox.\n * When used to set validity to `false`, you should use this method again to reset the validity to `true`.\n * @param valid - value indicating the validity\n * @param errorMessage - the error message to display\n */\n @Method()\n async setError(valid: MgInputCombobox['valid'], errorMessage: string): Promise<void> {\n if (typeof valid !== 'boolean') {\n throw new Error('<mg-input-combobox> method \"setError()\" param \"valid\" must be a boolean.');\n } else if (!isValidString(errorMessage)) {\n throw new Error('<mg-input-combobox> method \"setError()\" param \"errorMessage\" must be a string.');\n } else {\n this.setValidity(valid);\n this.setErrorMessage(valid ? undefined : errorMessage);\n this.hasDisplayedError = this.invalid;\n }\n }\n\n /**\n * Reset value, validity and error state\n */\n @Method()\n async reset(): Promise<void> {\n if (this.readonly) return;\n this.setValue(null);\n this.option = null;\n this.filter = '';\n this.checkValidity();\n this.errorMessage = undefined;\n this.hasDisplayedError = false;\n }\n\n /**\n * Handle `click` event on option\n * @param event - option element click event\n */\n private handleOptionClick = (event: MouseEvent & { target: HTMLLIElement }) => {\n this.setValue(this.options.items.find(option => option.value === event.target.id));\n this.popoverDisplay = false;\n };\n\n /**\n * Handle `click` event on reset button\n * @param event - click event\n */\n private handleResetButton = (event: MouseEvent): void => {\n event.stopPropagation();\n this.reset().then(() => {\n this.input.focus();\n });\n };\n\n /**\n * Handle `display-change` event on mg-popover\n */\n private handlePopoverDisplay = (event: CustomEvent): void => {\n this.popoverDisplay = event.detail;\n };\n\n /**\n * Handle input event\n */\n private handleFilterInput = (): void => {\n this.checkValidity();\n if (this.hasDisplayedError) this.setErrorMessage();\n if (!this.popoverDisplay) this.popoverDisplay = true;\n this.filter = this.input.value;\n };\n\n /**\n * Handle `blur` event\n */\n private handleFilterBlur = (): void => {\n // skip process if popover is displayed\n if (this.popoverDisplay) return;\n\n // Display Error\n this.handlerInProgress = 'blur';\n this.displayError().finally(() => {\n // reset guard\n this.handlerInProgress = undefined;\n });\n };\n\n /**\n * Handle `focus` event\n */\n private handleFilterFocus = (): void => {\n // ensure visual focus is always clear on focus when component isn't in loading state\n if (!this.isLoading) {\n this.option = null;\n }\n };\n\n /**\n * Handle load-more <mg-button> `click`\n */\n private handleLoadMoreButton = (): void => {\n this.loadingWrapper({ name: 'load-more', cursor: Cursor.NEXT }).then(() => {\n this.input.focus();\n });\n };\n\n /**\n * Handle `keypress` event\n * @param event - keyboard event\n */\n private handleFilterKeydown = (event: KeyboardEvent): void => {\n if (this.disabled || event.ctrlKey || event.shiftKey) return;\n\n let guard = false;\n\n // override keys actions\n switch (event.key) {\n case Keys.TAB:\n case Keys.ENTER:\n guard = event.key === Keys.ENTER;\n const option = this.option || this.options.items.find(this.isCurrentOption);\n // Sets the value to the content of the focused option in the listbox.\n if (this.popoverDisplay) this.setValue(this.page.total > 0 ? option : null);\n // Closes the popover.\n this.popoverDisplay = false;\n break;\n\n case Keys.DOWN:\n case Keys.ARROWDOWN:\n case Keys.UP:\n case Keys.ARROWUP:\n guard = true;\n if (this.isLoading || !(this.page.total > 0)) {\n this.popoverDisplay = true;\n break;\n }\n\n if (Boolean(event.altKey) && [Keys.DOWN, Keys.ARROWDOWN].includes(event.key)) {\n // Opens the popover without moving focus or changing selection.\n this.popoverDisplay = true;\n break;\n }\n\n // define cursor\n let cursor: CursorType;\n const isNavigationStart = this.popoverDisplay && isItem(this.option);\n if ([Keys.DOWN, Keys.ARROWDOWN].includes(event.key)) {\n // If the filter is not empty and the popover is displayed, moves visual focus to the first suggested value.\n // If the filter is empty and the popover is not displayed, opens the popover and moves visual focus to the first option.\n // Moves visual focus to the next option.\n // If visual focus is on the last option, moves visual focus to the first option.\n cursor = isNavigationStart ? Cursor.NEXT : Cursor.FIRST;\n } else if ([Keys.UP, Keys.ARROWUP].includes(event.key)) {\n // If the filter is not empty and the popover is displayed, moves visual focus to the last suggested value.\n // If the filter is empty, first opens the popover if it is not already displayed and then moves visual focus to the last option.\n // Moves visual focus to the previous option.\n // If visual focus is on the first option, moves visual focus to the last option.\n cursor = isNavigationStart ? Cursor.PREVIOUS : Cursor.LAST;\n }\n\n // update scroll and visual focused option in wrapper\n this.loadingWrapper({ name: 'scroll', cursor });\n\n // open popover\n this.popoverDisplay = true;\n break;\n\n case Keys.LEFT:\n case Keys.ARROWLEFT:\n case Keys.HOME:\n case Keys.RIGHT:\n case Keys.ARROWRIGHT:\n case Keys.END:\n // skip process if visual focus is not in popover\n if (!isItem(this.option)) break;\n guard = true;\n\n // Remove visual focus from popover options\n this.option = null;\n\n let index;\n if (Keys.HOME === event.key) {\n // Moves visual focus to the textbox and places the editing cursor at the beginning of the field.\n index = 0;\n } else if (Keys.END === event.key) {\n // Moves visual focus to the textbox and places the editing cursor at the end of the field.\n index = this.filter.length;\n }\n if (typeof index === 'number') {\n this.input.setSelectionRange(index, index);\n }\n break;\n\n case Keys.ESC:\n case Keys.ESCAPE:\n guard = true;\n\n if (this.popoverDisplay) {\n // If the popover is displayed, closes it.\n this.popoverDisplay = false;\n } else {\n // If the popover is not displayed, clears the filter.\n this.setValue(null);\n this.filter = '';\n // Sets visual focus on the textbox.\n this.option = null;\n }\n break;\n\n default:\n // Remove visual focus from popover options\n this.option = null;\n break;\n }\n\n if (guard) {\n event.stopPropagation();\n event.preventDefault();\n }\n };\n\n /**\n * Scroll to next option from cursor\n * @param index - targeted option index to scroll into\n */\n private scrollToIndex = (index: number): void => {\n this.element.shadowRoot.querySelector(`li:nth-of-type(${(index || 0) + this.page.baseIndex})`)?.scrollIntoView();\n };\n\n /**\n * Is option the current value\n * @param option - option to match with\n * @returns true if option is the current value\n */\n private isCurrentOption = (option: Option) => (isItem(this.value) ? this.value.value : this.value) === option.value;\n\n /**\n * Set value prop\n * @param newValue - slected option item\n */\n private setValue(newValue: MgInputCombobox['option'] | null): void {\n if (!isItem(newValue)) {\n this.value = '';\n } else {\n this.value = allItemsAreString(this.items || this.options.items) ? newValue.title : { ...newValue };\n }\n }\n\n /**\n * get value prop title\n * @returns value title\n */\n private getValueTitle = (): Option['title'] => {\n if (this.value && isItem(this.value)) return this.value.title;\n else if (typeof this.value === 'string') return this.value;\n else return '';\n };\n\n /**\n * Method to set validity values\n * @param newValue - valid new value\n */\n private setValidity(newValue: MgInputCombobox['valid']) {\n const oldValidValue = this.valid;\n this.valid = newValue;\n this.invalid = !this.valid;\n // We need to send valid event even if it is the same value\n if (this.handlerInProgress === undefined || (this.handlerInProgress === 'blur' && this.valid !== oldValidValue)) this.inputValid.emit(this.valid);\n }\n\n /**\n * Check if input is valid\n */\n private checkValidity = (): void => {\n this.setValidity(this.readonly || this.disabled || this.input.checkValidity());\n };\n\n /**\n * Set input error message\n * @param errorMessage - errorMessage override\n */\n private setErrorMessage = (errorMessage?: string): void => {\n // Set error message\n this.errorMessage = undefined;\n // Does have a custom error message\n if (!this.valid && errorMessage !== undefined) {\n this.errorMessage = errorMessage;\n }\n // required\n else if (!this.valid && this.input.validity.valueMissing) {\n this.errorMessage = this.messages.errors.required;\n }\n };\n\n /**\n * Get filtered options from `filter` input value\n * @returns filtered options\n */\n private optionsFilter = (option): boolean => (this.filter === '' ? true : option.title.toLocaleLowerCase().includes(this.filter.toLocaleLowerCase()));\n\n /**\n * Loading wrapper with a given action\n * @param action - wrapped loading action\n * @returns promisified action\n */\n private loadingWrapper = (action: ActionType): Promise<void> => {\n let promise;\n let index: number;\n\n // cache initial loading action if not defined\n if (!Boolean(this.loadingAction)) {\n this.loadingAction = action.name;\n }\n\n // update index\n if (Boolean(this.option) && this.loadingAction !== 'load-more') {\n index = this.page.items.findIndex(option => option.value.toString() === this.option.value.toString());\n } else if (this.loadingAction === 'load-more') {\n index = this.page.items.length - this.page.baseIndex;\n }\n // when action require a loadMore we fetch the API else we report action to next tick\n // Set \"load more\" if action match OR if next item not available in the current page\n if (action.name === 'load-more') {\n // wait for new element render and update scroll position\n // set component loading\n this.isLoading = true;\n promise = this.goToNextPage;\n } else if (\n action.cursor === Cursor.NEXT &&\n this.page.items.length <= this.page.total &&\n index + this.page.baseIndex === this.page.items.length &&\n index + this.page.baseIndex < this.page.total\n ) {\n // trigger load-more from button to benefit from `disabled-on-click`\n this.loadMoreElement.click();\n return;\n } else if (action.name === 'scroll') {\n promise = nextTick;\n } else {\n promise = this.updatePage;\n }\n\n return promise()\n .then(() => {\n // parse full items list from options\n const options = this.options.items.filter(this.optionsFilter);\n\n // update visual focus\n if (action.name !== 'load-data') {\n index = this.page.getIndexFromCursor(action.cursor, this.loadingAction === 'load-more' && index >= 0 ? options[index] : this.option);\n }\n this.option = options[index];\n\n // update scroll position\n this.scrollToIndex(index);\n })\n .finally(() => {\n // reset loading after next render\n requestAnimationFrame(() => {\n this.isLoading = false;\n this.loadingAction = undefined;\n });\n });\n };\n\n /**\n * Go to next page\n * @returns promise\n */\n private goToNextPage = (): Promise<void> => {\n this.loadMore.emit();\n if (Boolean(this.fetchurl)) {\n return this.getOptions(typeof this.page.next === 'string' ? this.page.next : undefined).then(nextPage => {\n if (!Boolean(nextPage)) return;\n // merge items from current page and next page\n const items = [...this.page.items, ...nextPage.items];\n // create new options pagination withe merged items\n this.options = new Paginate(items, { total: nextPage.total, next: nextPage.next, top: items.length });\n });\n } else {\n return nextTick(() => {\n if (typeof this.page.next === 'function') {\n const nextPage = this.page.next();\n this.page = new Page({\n ...nextPage,\n items: [...this.page.items, ...nextPage.items],\n });\n }\n });\n }\n };\n\n /**\n * Go to next page\n * @returns promise\n */\n private updatePage = async (): Promise<void> => {\n if (Boolean(this.fetchurl)) {\n return this.getOptions().then(page => {\n if (!Boolean(page)) return;\n // reset current options pagination from API response\n this.options = new Paginate(page.items, { total: page.total, next: page.next, top: page.top });\n });\n } else {\n this.page = this.options.getPage(0, this.optionsFilter);\n }\n };\n\n /**\n * Fetch request\n * @param url - to fetch\n * @returns new page from url\n */\n private getOptions = async (url = this.fetchurl): Promise<Pick<Page<Option>, 'items' | 'top'> & Partial<Page<Option>>> => {\n // add text filter\n const updateUrl = (typeof url === 'string' ? url : url.toString()).replaceAll(this.fetchmappings.request.filter, encodeURIComponent(this.filter));\n\n try {\n const response = await fetch(updateUrl, this.fetchoptions).then(response => response.json());\n if (!response) return null;\n const items = getObjectValueFromKey<Response, Option[]>(response, this.fetchmappings.response.items).map(\n (item): Option => ({\n title: getObjectValueFromKey<unknown, Option['title']>(item, this.fetchmappings.response.itemTitle),\n value: getObjectValueFromKey<unknown, Option['value']>(item, this.fetchmappings.response.itemValue),\n }),\n );\n const total = Number(getObjectValueFromKey<Response, number>(response, this.fetchmappings.response.total, 0));\n const next = mapUrl(getObjectValueFromKey<Response, string>(response, this.fetchmappings.response.next), this.fetchurl.toString());\n return { items, total, next, top: items.length };\n } catch {}\n };\n\n /*************\n * Lifecycle *\n *************/\n\n /**\n * Check if component props are well configured on init\n * @returns timeout\n */\n componentWillLoad(): ReturnType<typeof setTimeout> {\n // Get locales\n this.messages = initLocales(this.element).messages;\n // Validate\n this.watchIdentifier(this.identifier);\n this.watchItems(this.items);\n if (Boolean(this.fetchurl)) {\n this.watchFetchUrl(this.fetchurl);\n this.watchFetchOptions(this.fetchoptions);\n this.watchFetchMappings(this.fetchmappings);\n this.loadingWrapper({ name: 'load-data' });\n }\n this.watchValue(this.value);\n this.watchOptions(this.options);\n this.watchMgWidth(this.mgWidth);\n this.watchReadonly(this.readonly);\n this.watchDisabled(this.disabled);\n // Check validity when component is ready\n // return a promise to process action only in the FIRST render().\n // https://stenciljs.com/docs/component-lifecycle#componentwillload\n return setTimeout(() => {\n this.checkValidity();\n }, 0);\n }\n\n /**\n * Render\n * @returns HTML Element\n */\n render(): HTMLElement {\n const listId = `${this.identifier}-list`;\n const readonlyValue = this.getValueTitle();\n const withResetButton = this.value && !this.disabled;\n\n let popoverContent: 'list' | 'notfound' | 'notavailable';\n if (this.page?.items.length > 0) popoverContent = 'list';\n else if (this.page?.items.length === 0 && Boolean(this.filter)) popoverContent = 'notfound';\n else if (this.page?.items.length === 0) popoverContent = 'notavailable';\n\n return (\n <mg-input\n label={this.label}\n identifier={this.identifier}\n class={this.classCollection.classes.join(' ')}\n ariaDescribedbyIDs={popoverContent && popoverContent !== 'list' ? [popoverContent] : []}\n labelOnTop={this.labelOnTop}\n labelHide={this.labelHide}\n required={this.required}\n tooltip={this.tooltip}\n tooltipPosition={this.readonly && this.value === undefined ? 'label' : this.tooltipPosition}\n helpText={this.helpText}\n errorMessage={this.errorMessage}\n >\n {this.readonly ? (\n readonlyValue && <b class=\"mg-c-input__readonly-value\">{readonlyValue}</b>\n ) : (\n <mg-popover\n identifier={this.popoverId}\n placement=\"bottom-start\"\n display={this.popoverDisplay}\n arrow-hide\n style={{\n '--mg-c-input-list-width': Boolean(this.input?.offsetWidth) ? `${this.input.offsetWidth}px` : undefined,\n '--mg-c-input-append-x': withResetButton ? '2' : '1',\n }}\n data-fallback-placement=\"bottom-end\"\n onDisplay-change={this.handlePopoverDisplay}\n >\n <div class=\"mg-c-input__input-group-container\">\n <mg-icon icon=\"magnifying-glass\"></mg-icon>\n <input\n type=\"text\"\n role=\"combobox\"\n class=\"mg-c-input__box mg-c-input__box--width\"\n value={this.filter}\n id={this.identifier}\n name={this.name}\n placeholder={this.placeholder}\n title={this.placeholder}\n disabled={this.disabled}\n required={this.required}\n autocomplete=\"off\"\n aria-autocomplete=\"list\"\n aria-expanded={this.popoverDisplay.toString()}\n aria-controls={listId}\n aria-invalid={(this.invalid === true).toString()}\n aria-activedescendant={Boolean(this.option?.value) ? this.option.value : typeof this.value === 'string' ? this.value : this.value?.value}\n onInput={this.handleFilterInput}\n onBlur={this.handleFilterBlur}\n onFocus={this.handleFilterFocus}\n onKeyDown={this.handleFilterKeydown}\n ref={(el: HTMLInputElement) => {\n if (el !== null) this.input = el;\n }}\n />\n {withResetButton && (\n <mg-button\n class=\"mg-c-input__box-append mg-c-input__reset\"\n variant=\"flat\"\n is-icon\n label={this.messages.general.reset}\n aria-controls={this.identifier}\n tabindex=\"-1\"\n onClick={this.handleResetButton}\n >\n <mg-icon icon=\"cross\"></mg-icon>\n </mg-button>\n )}\n <mg-button class=\"mg-c-input__box-append\" variant=\"flat\" is-icon label={this.itemsLabel} tabindex=\"-1\" disabled={this.disabled}>\n <mg-icon icon={`chevron-${this.popoverDisplay ? 'up' : 'down'}`}></mg-icon>\n </mg-button>\n </div>\n <div slot=\"content\" class=\"mg-c-input__popover-container\">\n {popoverContent === 'list' && [\n // eslint-disable-next-line jsx-a11y/role-supports-aria-props\n <ul key=\"list\" class=\"mg-c-input__input-list\" role=\"listbox\" id={listId} aria-label={this.itemsLabel} aria-setsize={this.page.total}>\n {this.page.items.map(option => {\n return (\n // eslint-disable-next-line jsx-a11y/click-events-have-key-events\n <li\n role=\"option\"\n class={{\n 'mg-c-input__input-list-item': true,\n 'mg-c-input__input-list-item--focus-visible': this.option === option,\n 'mg-c-input__input-list-item--selected': this.isCurrentOption(option),\n }}\n key={option.title}\n id={option.value.toString()}\n aria-selected={this.isCurrentOption(option).toString()}\n onClick={this.handleOptionClick}\n >\n {option.title}\n {this.isCurrentOption(option) && <mg-icon icon=\"check\"></mg-icon>}\n </li>\n );\n })}\n </ul>,\n this.isLoading && <mg-loader key=\"loader\" message={this.messages.input.combobox.search} class={{ 'mg-u-visually-hidden': Boolean(this.page.next) }}></mg-loader>,\n this.page.next && (\n <mg-button\n key=\"load-more\"\n variant=\"flat\"\n class=\"mg-c-input__load-more\"\n tabIndex={-1}\n disabled={this.isLoading}\n full-width\n disable-on-click\n onClick={this.handleLoadMoreButton}\n aria-controls={listId}\n ref={(el: HTMLMgButtonElement) => {\n if (el !== null) this.loadMoreElement = el;\n }}\n >\n <mg-icon icon=\"chevron-down\"></mg-icon>\n {this.messages.input.combobox.loadMore}\n </mg-button>\n ),\n ]}\n {popoverContent === 'notfound' && (\n <p id={popoverContent} class=\"mg-c-input__popover-info\">\n {this.messages.input.combobox.notFound}\n </p>\n )}\n {popoverContent === 'notavailable' && (\n <p id={popoverContent} class=\"mg-c-input__popover-info\">\n {this.messages.input.combobox.notAvailable}\n </p>\n )}\n </div>\n </mg-popover>\n )}\n </mg-input>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"mg-input-combobox.js","sourceRoot":"","sources":["../../../../../src/components/molecules/inputs/mg-input-combobox/mg-input-combobox.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAgB,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACvG,OAAO,EACL,iBAAiB,EACjB,SAAS,EACT,qBAAqB,EACrB,aAAa,EACb,QAAQ,EACR,IAAI,EACJ,QAAQ,EACR,MAAM,EAEN,QAAQ,EACR,QAAQ,EACR,QAAQ,GACT,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAoD,MAAM,EAAE,aAAa,EAAE,aAAa,EAAE,MAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Event, h, Prop, EventEmitter, State, Element, Method, Watch } from '@stencil/core';\nimport {\n allItemsAreString,\n ClassList,\n getObjectValueFromKey,\n isValidString,\n nextTick,\n Page,\n Paginate,\n Cursor,\n type CursorType,\n toString,\n isObject,\n formatID,\n} from '@mgdis/stencil-helpers';\nimport { type ActionType, type RequestMappingType, type ResponseMappingType } from './mg-input-combobox.conf';\nimport { type TooltipPosition, type Width, type EventType, widths, classReadonly, classDisabled } from '../mg-input/mg-input.conf';\nimport type { Option } from '../../../../types';\nimport { initLocales } from '../../../../locales';\nimport { Keys } from '../../../../utils/events.utils';\n\n/**\n * Check if object is an item\n * @param item - object to check\n * @returns True if object is an item\n */\nconst isItem = (item: unknown): item is Option => item && typeof item === 'object' && typeof (item as Option).title === 'string' && (item as Option).value !== undefined;\n\n/**\n * Check if objects are items\n * @param items - items to check\n * @returns True if objects are items\n */\nconst isItems = (items: unknown[]): items is Option[] => Array.isArray(items) && items.every(isItem);\n\n/**\n * Check if object is valid combobox fetchmappings\n * @param value - to validate\n * @returns truthy if mapping is valid\n */\nconst isFetchmappings = (value: unknown): value is MgInputCombobox['fetchmappings'] => {\n const isValidRoot = isObject<Record<string, unknown>>(value) && Object.hasOwn(value, 'request') && Object.hasOwn(value, 'response');\n if (isValidRoot) {\n const { request, response } = value as MgInputCombobox['fetchmappings'];\n if ([request, response].some(property => !isObject(property))) return false;\n const isValidRequest = typeof request.filter === 'string';\n const isValidResponse =\n typeof response === 'object' &&\n typeof response.total === 'string' &&\n typeof response.items === 'string' &&\n typeof response.next === 'string' &&\n typeof response.itemTitle === 'string' &&\n (typeof response.itemValue === 'string' || response.itemValue === undefined);\n return isValidRequest && isValidResponse;\n } else {\n return isValidRoot;\n }\n};\n\n@Component({\n tag: 'mg-input-combobox',\n styleUrl: '../../../../../node_modules/@mgdis/styles/dist/components/mg-input-combobox.css',\n shadow: true,\n})\nexport class MgInputCombobox {\n /************\n * Internal *\n ************/\n\n // Classes\n private readonly classFocus = 'mg-u-is-focused';\n\n // HTML selector\n private input: HTMLInputElement;\n private loadMoreElement: HTMLMgButtonElement;\n private popoverId: string;\n\n // Locales\n private messages;\n\n // hasDisplayedError (triggered by blur event)\n private hasDisplayedError = false;\n\n private handlerInProgress: EventType;\n private loadingAction: ActionType['name'];\n private debounce: boolean;\n\n private page: Page<Option>;\n\n /**************\n * Decorators *\n **************/\n\n /**\n * Get component DOM element\n */\n @Element() element: HTMLMgInputComboboxElement;\n\n /**\n * Define component value\n */\n @Prop({ mutable: true, reflect: true }) value: string | Option;\n @Watch('value')\n watchValue(newValue: MgInputCombobox['value']): void {\n this.filter = this.getValueTitle();\n this.valueChange.emit(newValue);\n }\n\n /**\n * Define components items\n */\n @Prop() items: (string | Option)[];\n @Watch('items')\n watchItems(newValue: MgInputCombobox['items']) {\n if (Boolean(this.fetchurl) && !Boolean(newValue)) {\n // skip newValue check\n return;\n } else if (Boolean(this.fetchurl) && Boolean(newValue)) {\n throw new Error(`<mg-input-combobox> prop \"items\" values cannot be use with \"fetchurl\" prop defined. Passed value: ${toString(newValue)}.`);\n }\n // Empty options\n else if (Array.isArray(newValue) && newValue.length === 0) {\n this.options = new Paginate([]);\n }\n // String array\n else if (allItemsAreString(newValue)) {\n this.options = new Paginate(\n newValue.map(item => ({ title: item, value: item })),\n { total: newValue.length },\n );\n }\n // Object array\n else if (isItems(newValue)) {\n this.options = new Paginate(newValue, { total: newValue.length });\n } else {\n throw new Error(`<mg-input-combobox> prop \"items\" values must be the same type, string or Option. Passed value: ${toString(newValue)}.`);\n }\n }\n\n /**\n * Define items label\n * Include short description. Required for accessibility.\n * @example\n * ```\n * Countries\n * ```\n */\n @Prop() itemsLabel!: string;\n\n /**\n * Identifier is used for the element ID (id is a reserved prop in Stencil.js)\n */\n @Prop() identifier!: string;\n @Watch('identifier')\n watchIdentifier(newValue: MgInputCombobox['identifier']): void {\n if (Boolean(newValue)) {\n this.popoverId = `${newValue}-popover`;\n this.element.dataset.mgPopoverGuard = this.popoverId;\n }\n }\n\n /**\n * Input name\n * If not set the value equals the identifier\n */\n @Prop() name: string = this.identifier;\n\n /**\n * Input label\n */\n @Prop() label!: string;\n\n /**\n * Define if label is displayed on top\n */\n @Prop() labelOnTop = false;\n\n /**\n * Define if label is visible\n */\n @Prop() labelHide = false;\n\n /**\n * Define input placeholder.\n * It should be a word or short phrase that demonstrates the expected type of data, not a replacement for labels or help combobox.\n */\n @Prop() placeholder?: string;\n\n /**\n * Define if input is required\n */\n @Prop() required = false;\n\n /**\n * Define if input is readonly\n */\n @Prop() readonly = false;\n @Watch('readonly')\n watchReadonly(newValue: MgInputCombobox['readonly']): void {\n if (newValue) this.classCollection.add(classReadonly);\n else this.classCollection.delete(classReadonly);\n }\n\n /**\n * Define if input is disabled\n */\n @Prop() disabled = false;\n @Watch('required')\n @Watch('readonly')\n @Watch('disabled')\n watchValidityChange(newValue: boolean, _oldValue: boolean, prop: string): void {\n if (this.input === undefined) return;\n this.input[prop] = newValue;\n this.checkValidity();\n if (this.hasDisplayedError) {\n this.setErrorMessage();\n this.hasDisplayedError = false;\n }\n }\n\n @Watch('disabled')\n watchDisabled(newValue: MgInputCombobox['disabled']): void {\n if (newValue) {\n this.classCollection.add(classDisabled);\n } else {\n this.classCollection.delete(classDisabled);\n }\n }\n\n /**\n * Define input width\n */\n @Prop() mgWidth: Width = 'full';\n @Watch('mgWidth')\n watchMgWidth(newValue: MgInputCombobox['mgWidth']): void {\n // reset width class\n widths.forEach(width => {\n this.classCollection.delete(`mg-c-input--width-${width}`);\n });\n\n // apply new width\n if (newValue !== undefined) this.classCollection.add(`mg-c-input--width-${this.mgWidth}`);\n this.classCollection = new ClassList(this.classCollection.classes);\n }\n\n /**\n * Add a tooltip message next to the input\n */\n @Prop() tooltip?: string;\n\n /**\n * Define tooltip position\n */\n @Prop() tooltipPosition: TooltipPosition = 'input';\n\n /**\n * Add a help text under the input, usually expected data format and example\n */\n @Prop() helpText?: string;\n\n /**\n * Define API url to fetch\n * @example\n * ```\n * {\n * url: \"http://myapi.com?$select='href,name'&my-custom-param='my-custom-value'\", // url to fetch\n * }\n * ```\n */\n @Prop() fetchurl?: string | URL;\n @Watch('fetchurl')\n watchFetchUrl(newValue: MgInputCombobox['fetchurl']): void {\n if (Boolean(newValue)) {\n this.loadingWrapper({ name: 'load-data' });\n }\n }\n\n /**\n * Define fetch options object\n * Require `fetchurl` prop to be defined otherwith it will be ignored if defined\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/RequestInit}\n * @example JSON headers:\n * ```json\n * {\n * \"headers\": {\n * \"authorization\": \"my-token\"\n * }\n * }\n * ```\n */\n @Prop() fetchoptions?: RequestInit;\n @Watch('fetchoptions')\n watchFetchOptions(newValue: MgInputCombobox['fetchoptions']): void {\n if (this.fetchurl && newValue && !isObject(newValue)) {\n throw new Error(`<mg-input-combobox> prop \"fetchoptions\" value must be a valid RequestInit. Passed value: ${toString(newValue)}.`);\n } else {\n new Request(this.fetchurl, newValue);\n }\n }\n\n /**\n * Define fetch request mappings.\n * Required with `fetchurl`\n * @example\n * ```\n * {\n * request: {\n * filter: 'name', // `filter` key\n * },\n * response: {\n * total: 'body.data.total', // response object mapping to get `total` value\n * items: 'body.data.results' // response object mapping to get `items` value\n * next: 'body.next' // response object mapping to get `next` items\n * itemTitle: 'name', // item property to map on item['title']\n * itemValue: 'href', // item property to map on item['value']\n * }\n * }\n * ```\n */\n @Prop() fetchmappings?: { request: RequestMappingType; response: ResponseMappingType };\n @Watch('fetchmappings')\n watchFetchMappings(newValue: MgInputCombobox['fetchmappings']): void {\n if (Boolean(this.fetchurl) && !Boolean(newValue)) {\n throw new Error(`<mg-input-combobox> prop \"fetchmappings\" is required with \"fetchurl\" prop.`);\n } else if (Boolean(newValue) && !isFetchmappings(newValue)) {\n throw new Error(\n `<mg-input-combobox> prop \"fetchmappings\" value must be { request: RequestMappingType, response: ResponseMappingType }. Passed value: ${toString(newValue)}.`,\n );\n }\n }\n\n /**\n * Define input valid state\n */\n @Prop({ mutable: true }) valid: boolean;\n\n /**\n * Define input invalid state\n */\n @Prop({ mutable: true }) invalid: boolean;\n\n /**\n * Define if items are loading\n */\n @State() isLoading: boolean;\n\n /**\n * Formated items for display\n */\n @State() options: Paginate<Option> = new Paginate([]);\n @Watch('options')\n watchOptions(newValue: Paginate<Option>): void {\n this.page = newValue.getPage(0, Boolean(this.filter) ? this.optionsFilter : undefined);\n }\n\n /**\n * Active option\n */\n @State() option: Option;\n\n /**\n * Option filter\n */\n @State() filter: string = '';\n @Watch('filter')\n watchFilter(newValue: MgInputCombobox['filter']): void {\n this.loadingWrapper({ name: 'load-data' });\n this.filterChange.emit(newValue);\n }\n\n /**\n * Component classes\n */\n @State() classCollection: ClassList = new ClassList(['mg-c-input--combobox', 'mg-c-input--has-icon', 'mg-c-input--input-append']);\n\n /**\n * Error message to display\n */\n @State() errorMessage: string;\n\n /**\n * Popover display state\n */\n @State() popoverDisplay = false;\n @Watch('popoverDisplay')\n watchPopoverDisplay(newValue: MgInputCombobox['popoverDisplay']): void {\n if (newValue) {\n this.classCollection.add(this.classFocus);\n this.input.focus();\n this.scrollToIndex(0);\n } else {\n // remove visual focus\n this.option = null;\n // reset filter with value\n this.filter = this.getValueTitle();\n this.classCollection.delete(this.classFocus);\n this.handlerInProgress = 'blur';\n this.displayError().finally(() => {\n // reset guard\n this.handlerInProgress = undefined;\n });\n }\n }\n\n /**\n * Emited event when value change\n */\n @Event({ eventName: 'value-change' }) valueChange: EventEmitter<HTMLMgInputComboboxElement['value']>;\n\n /**\n * Emited event when filter change\n */\n @Event({ eventName: 'filter-change' }) filterChange: EventEmitter<string>;\n\n /**\n * Emited event when `load-more` is called\n */\n @Event({ eventName: 'load-more' }) loadMore: EventEmitter<void>;\n\n /**\n * Emited event when checking validity\n */\n @Event({ eventName: 'input-valid' }) inputValid: EventEmitter<HTMLMgInputComboboxElement['valid']>;\n\n /**\n * Emited event when fetch API throw an error\n */\n @Event({ eventName: 'fetch-error' }) fetchError: EventEmitter<Error>;\n\n /**\n * Public method to play input focus\n */\n @Method()\n async setFocus(): Promise<void> {\n this.input.focus();\n }\n\n /**\n * Display input error if it exists.\n */\n @Method()\n displayError(): Promise<void> {\n // Use `Promise` as requested for stencil method\n // Use `requestAnimationFrame` to ensure:\n // - DOM is fully updated before validation\n // - Async operations are completed\n // - No timing issues with Stencil's render cycle\n // - Keep everything in sync both inside and outside the component\n return new Promise(resolve => {\n requestAnimationFrame(() => {\n this.checkValidity();\n this.setErrorMessage();\n this.hasDisplayedError = this.invalid;\n resolve();\n });\n });\n }\n\n /**\n * Set an error and display a custom error message.\n * This method can be used to set the component's error state from its concombobox by passing a boolean value to the `valid` parameter.\n * It must be paired with an error message to display for the given concombobox.\n * When used to set validity to `false`, you should use this method again to reset the validity to `true`.\n * @param valid - value indicating the validity\n * @param errorMessage - the error message to display\n */\n @Method()\n async setError(valid: MgInputCombobox['valid'], errorMessage: string): Promise<void> {\n if (typeof valid !== 'boolean') {\n throw new Error('<mg-input-combobox> method \"setError()\" param \"valid\" must be a boolean.');\n } else if (!isValidString(errorMessage)) {\n throw new Error('<mg-input-combobox> method \"setError()\" param \"errorMessage\" must be a string.');\n } else {\n this.setValidity(valid);\n this.setErrorMessage(valid ? undefined : errorMessage);\n this.hasDisplayedError = this.invalid;\n }\n }\n\n /**\n * Reset value, validity and error state\n */\n @Method()\n async reset(): Promise<void> {\n if (this.readonly) return;\n this.setValue(null);\n this.option = null;\n this.filter = '';\n this.checkValidity();\n this.errorMessage = undefined;\n this.hasDisplayedError = false;\n }\n\n /**\n * Handle `click` event on option\n * @param event - option element click event\n */\n private handleOptionClick = (event: MouseEvent & { target: HTMLLIElement }) => {\n this.setValue(this.options.items.find(option => formatID(option.value) === event.target.id));\n this.popoverDisplay = false;\n };\n\n /**\n * Handle `click` event on reset button\n * @param event - click event\n */\n private handleResetButton = (event: MouseEvent): void => {\n event.stopPropagation();\n this.reset().then(() => {\n this.input.focus();\n });\n };\n\n /**\n * Handle `display-change` event on mg-popover\n */\n private handlePopoverDisplay = (event: CustomEvent): void => {\n this.popoverDisplay = event.detail;\n };\n\n /**\n * Handle input event\n */\n private handleFilterInput = (): void => {\n this.checkValidity();\n if (this.hasDisplayedError) this.setErrorMessage();\n if (!this.popoverDisplay) this.popoverDisplay = true;\n\n // update filter with debounce to prevent filter update overload\n if (!this.debounce) {\n this.debounce = true;\n setTimeout(() => {\n this.filter = this.input.value;\n this.debounce = false;\n }, 250);\n }\n };\n\n /**\n * Handle `blur` event\n */\n private handleFilterBlur = (): void => {\n // skip process if popover is displayed\n if (this.popoverDisplay) return;\n\n // Display Error\n this.handlerInProgress = 'blur';\n this.displayError().finally(() => {\n // reset guard\n this.handlerInProgress = undefined;\n });\n };\n\n /**\n * Handle `focus` event\n */\n private handleFilterFocus = (): void => {\n // ensure visual focus is always clear on focus when component isn't in loading state\n if (!this.isLoading) {\n this.option = null;\n }\n };\n\n /**\n * Handle load-more <mg-button> `click`\n */\n private handleLoadMoreButton = (): void => {\n this.loadingWrapper({ name: 'load-more', cursor: Cursor.NEXT }).then(() => {\n this.input.focus();\n });\n };\n\n /**\n * Handle `keypress` event\n * @param event - keyboard event\n */\n private handleFilterKeydown = (event: KeyboardEvent): void => {\n if (this.disabled || event.ctrlKey || event.shiftKey) return;\n\n let guard = false;\n\n // override keys actions\n switch (event.key) {\n case Keys.TAB:\n case Keys.ENTER:\n guard = event.key === Keys.ENTER;\n const option = this.option || this.options.items.find(this.isCurrentOption);\n // Sets the value to the content of the focused option in the listbox.\n if (this.popoverDisplay) this.setValue(this.page.total > 0 ? option : null);\n // Closes the popover.\n this.popoverDisplay = false;\n break;\n\n case Keys.DOWN:\n case Keys.ARROWDOWN:\n case Keys.UP:\n case Keys.ARROWUP:\n guard = true;\n if (this.isLoading || !(this.page.total > 0)) {\n this.popoverDisplay = true;\n break;\n }\n\n if (Boolean(event.altKey) && [Keys.DOWN, Keys.ARROWDOWN].includes(event.key)) {\n // Opens the popover without moving focus or changing selection.\n this.popoverDisplay = true;\n break;\n }\n\n // define cursor\n let cursor: CursorType;\n const isNavigationStart = this.popoverDisplay && isItem(this.option);\n if ([Keys.DOWN, Keys.ARROWDOWN].includes(event.key)) {\n // If the filter is not empty and the popover is displayed, moves visual focus to the first suggested value.\n // If the filter is empty and the popover is not displayed, opens the popover and moves visual focus to the first option.\n // Moves visual focus to the next option.\n // If visual focus is on the last option, moves visual focus to the first option.\n cursor = isNavigationStart ? Cursor.NEXT : Cursor.FIRST;\n } else if ([Keys.UP, Keys.ARROWUP].includes(event.key)) {\n // If the filter is not empty and the popover is displayed, moves visual focus to the last suggested value.\n // If the filter is empty, first opens the popover if it is not already displayed and then moves visual focus to the last option.\n // Moves visual focus to the previous option.\n // If visual focus is on the first option, moves visual focus to the last option.\n cursor = isNavigationStart ? Cursor.PREVIOUS : Cursor.LAST;\n }\n\n // update scroll and visual focused option in wrapper\n this.loadingWrapper({ name: 'scroll', cursor });\n\n // open popover\n this.popoverDisplay = true;\n break;\n\n case Keys.LEFT:\n case Keys.ARROWLEFT:\n case Keys.HOME:\n case Keys.RIGHT:\n case Keys.ARROWRIGHT:\n case Keys.END:\n // skip process if visual focus is not in popover\n if (!isItem(this.option)) break;\n guard = true;\n\n // Remove visual focus from popover options\n this.option = null;\n\n let index;\n if (Keys.HOME === event.key) {\n // Moves visual focus to the textbox and places the editing cursor at the beginning of the field.\n index = 0;\n } else if (Keys.END === event.key) {\n // Moves visual focus to the textbox and places the editing cursor at the end of the field.\n index = this.filter.length;\n }\n if (typeof index === 'number') {\n this.input.setSelectionRange(index, index);\n }\n break;\n\n case Keys.ESC:\n case Keys.ESCAPE:\n guard = true;\n\n if (this.popoverDisplay) {\n // If the popover is displayed, closes it.\n this.popoverDisplay = false;\n } else {\n // If the popover is not displayed, clears the filter.\n this.setValue(null);\n this.filter = '';\n // Sets visual focus on the textbox.\n this.option = null;\n }\n break;\n\n default:\n // Remove visual focus from popover options\n this.option = null;\n break;\n }\n\n if (guard) {\n event.stopPropagation();\n event.preventDefault();\n }\n };\n\n /**\n * Scroll to next option from cursor\n * @param index - targeted option index to scroll into\n */\n private scrollToIndex = (index: number): void => {\n this.element.shadowRoot.querySelector(`li:nth-of-type(${(index || 0) + this.page.baseIndex})`)?.scrollIntoView();\n };\n\n /**\n * Is option the current value\n * @param option - option to match with\n * @returns true if option is the current value\n */\n private isCurrentOption = (option: Option) => (isItem(this.value) ? this.value.value : this.value) === option.value;\n\n /**\n * Set value prop\n * @param newValue - slected option item\n */\n private setValue(newValue: MgInputCombobox['option'] | null): void {\n if (!isItem(newValue)) {\n this.value = '';\n } else if (allItemsAreString(this.items || this.options.items)) {\n this.value = newValue.title;\n } else {\n this.value = { ...newValue };\n }\n }\n\n /**\n * get value prop title\n * @returns value title\n */\n private getValueTitle = (): Option['title'] => {\n if (this.value && isItem(this.value)) return this.value.title;\n else if (typeof this.value === 'string') return this.value;\n else return '';\n };\n\n /**\n * Method to set validity values\n * @param newValue - valid new value\n */\n private setValidity(newValue: MgInputCombobox['valid']) {\n const oldValidValue = this.valid;\n this.valid = newValue;\n this.invalid = !this.valid;\n // We need to send valid event even if it is the same value\n if (this.handlerInProgress === undefined || (this.handlerInProgress === 'blur' && this.valid !== oldValidValue)) this.inputValid.emit(this.valid);\n }\n\n /**\n * Check if input is valid\n */\n private checkValidity = (): void => {\n this.setValidity(this.readonly || this.disabled || this.input.checkValidity());\n };\n\n /**\n * Set input error message\n * @param errorMessage - errorMessage override\n */\n private setErrorMessage = (errorMessage?: string): void => {\n // Set error message\n this.errorMessage = undefined;\n // Does have a custom error message\n if (!this.valid && errorMessage !== undefined) {\n this.errorMessage = errorMessage;\n }\n // required\n else if (!this.valid && this.input.validity.valueMissing) {\n this.errorMessage = this.messages.errors.required;\n }\n };\n\n /**\n * Get filtered options from `filter` input value\n * @returns filtered options\n */\n private optionsFilter = (option): boolean => (this.filter === '' ? true : option.title.toLocaleLowerCase().includes(this.filter.toLocaleLowerCase()));\n\n /**\n * Loading wrapper with a given action\n * @param action - wrapped loading action\n * @returns promisified action\n */\n private loadingWrapper = (action: ActionType): Promise<void> => {\n let promise;\n let index: number;\n\n // cache initial loading action if not defined\n if (!Boolean(this.loadingAction)) {\n this.loadingAction = action.name;\n }\n\n // update index\n if (Boolean(this.option) && this.loadingAction !== 'load-more') {\n index = this.page.items.findIndex(option => option.value.toString() === this.option.value.toString());\n } else if (this.loadingAction === 'load-more') {\n index = this.page.items.length - this.page.baseIndex;\n }\n // when action require a loadMore we fetch the API else we report action to next tick\n // Set \"load more\" if action match OR if next item not available in the current page\n if (action.name === 'load-more') {\n // wait for new element render and update scroll position\n // set component loading\n this.isLoading = true;\n promise = this.goToNextPage;\n } else if (\n action.cursor === Cursor.NEXT &&\n this.page.items.length <= this.page.total &&\n index + this.page.baseIndex === this.page.items.length &&\n index + this.page.baseIndex < this.page.total\n ) {\n // trigger load-more from button to benefit from `disabled-on-click`\n this.loadMoreElement.click();\n return;\n } else if (action.name === 'scroll') {\n promise = nextTick;\n } else {\n promise = this.updatePage;\n }\n\n return promise()\n .then(() => {\n // parse full items list from options\n const options = this.options.items.filter(this.optionsFilter);\n\n // update visual focus\n if (action.name !== 'load-data') {\n index = this.page.getIndexFromCursor(action.cursor, this.loadingAction === 'load-more' && index >= 0 ? options[index] : this.option);\n }\n this.option = options[index];\n\n // update scroll position\n this.scrollToIndex(index);\n })\n .finally(() => {\n // reset loading after next render\n requestAnimationFrame(() => {\n this.isLoading = false;\n this.loadingAction = undefined;\n });\n });\n };\n\n /**\n * Go to next page\n * @returns promise\n */\n private goToNextPage = (): Promise<void> => {\n this.loadMore.emit();\n if (Boolean(this.fetchurl)) {\n return this.getOptions(typeof this.page.next === 'string' ? this.page.next : undefined).then(nextPage => {\n if (!Boolean(nextPage)) return;\n // merge items from current page and next page\n const items = [...this.page.items, ...nextPage.items];\n // create new options pagination withe merged items\n this.options = new Paginate(items, { total: nextPage.total, next: nextPage.next, top: items.length });\n });\n } else {\n return nextTick(() => {\n if (typeof this.page.next === 'function') {\n const nextPage = this.page.next();\n this.page = new Page({\n ...nextPage,\n items: [...this.page.items, ...nextPage.items],\n });\n }\n });\n }\n };\n\n /**\n * Go to next page\n * @returns promise\n */\n private updatePage = async (): Promise<void> => {\n if (Boolean(this.fetchurl)) {\n return this.getOptions().then(page => {\n if (!Boolean(page)) return;\n // reset current options pagination from API response\n this.options = new Paginate(page.items, { total: page.total, next: page.next, top: page.top });\n });\n } else {\n this.page = this.options.getPage(0, this.optionsFilter);\n }\n };\n\n /**\n * Fetch request\n * @param url - to fetch\n * @returns new page from url\n */\n private getOptions = async (url = this.fetchurl): Promise<Pick<Page<Option>, 'items' | 'top'> & Partial<Page<Option>>> => {\n // add text filter\n const updateUrl = (typeof url === 'string' ? url : url.toString()).replaceAll(this.fetchmappings.request.filter, encodeURIComponent(this.filter));\n\n try {\n const response = await fetch(updateUrl, this.fetchoptions);\n if (!response.ok) {\n this.fetchError.emit(new Error(`${response.status} - ${response.statusText}`));\n return;\n }\n const json = await response.json();\n const items = getObjectValueFromKey<Response, Option[]>(json, this.fetchmappings.response.items).map(\n (item): Option => ({\n title: getObjectValueFromKey<unknown, Option['title']>(item, this.fetchmappings.response.itemTitle),\n value: this.fetchmappings.response.itemValue ? getObjectValueFromKey<unknown, Option['value']>(item, this.fetchmappings.response.itemValue) : item,\n }),\n );\n const total = Number(getObjectValueFromKey<Response, number>(json, this.fetchmappings.response.total, 0));\n const next = getObjectValueFromKey<Response, string>(json, this.fetchmappings.response.next);\n return { items, total, next, top: items.length };\n } catch (error) {\n this.fetchError.emit(error);\n }\n };\n\n /*************\n * Lifecycle *\n *************/\n\n /**\n * Check if component props are well configured on init\n * @returns timeout\n */\n componentWillLoad(): ReturnType<typeof setTimeout> {\n // Get locales\n this.messages = initLocales(this.element).messages;\n // Validate\n this.watchIdentifier(this.identifier);\n this.watchItems(this.items);\n if (Boolean(this.fetchurl)) {\n this.watchFetchOptions(this.fetchoptions);\n this.watchFetchMappings(this.fetchmappings);\n this.loadingWrapper({ name: 'load-data' });\n }\n this.watchValue(this.value);\n this.watchOptions(this.options);\n this.watchMgWidth(this.mgWidth);\n this.watchReadonly(this.readonly);\n this.watchDisabled(this.disabled);\n // Check validity when component is ready\n // return a promise to process action only in the FIRST render().\n // https://stenciljs.com/docs/component-lifecycle#componentwillload\n return setTimeout(() => {\n this.checkValidity();\n }, 0);\n }\n\n /**\n * Render\n * @returns HTML Element\n */\n render(): HTMLElement {\n const listId = `${this.identifier}-list`;\n const readonlyValue = this.getValueTitle();\n const withResetButton = this.value && !this.disabled;\n\n let popoverContent: 'list' | 'notfound' | 'notavailable';\n if (this.page?.items.length > 0) popoverContent = 'list';\n else if (this.page?.items.length === 0 && Boolean(this.filter)) popoverContent = 'notfound';\n else if (this.page?.items.length === 0) popoverContent = 'notavailable';\n\n let activeDescendant;\n if (Boolean(this.option?.value)) {\n activeDescendant = this.option.value;\n } else if (typeof this.value === 'string') {\n activeDescendant = this.value;\n } else {\n activeDescendant = this.value?.value;\n }\n\n return (\n <mg-input\n label={this.label}\n identifier={this.identifier}\n class={this.classCollection.classes.join(' ')}\n ariaDescribedbyIDs={popoverContent && popoverContent !== 'list' ? [popoverContent] : []}\n labelOnTop={this.labelOnTop}\n labelHide={this.labelHide}\n required={this.required}\n tooltip={this.tooltip}\n tooltipPosition={this.readonly && this.value === undefined ? 'label' : this.tooltipPosition}\n helpText={this.helpText}\n errorMessage={this.errorMessage}\n >\n {this.readonly ? (\n readonlyValue && <b class=\"mg-c-input__readonly-value\">{readonlyValue}</b>\n ) : (\n <mg-popover\n identifier={this.popoverId}\n placement=\"bottom-start\"\n display={this.popoverDisplay}\n arrow-hide\n style={{\n '--mg-c-input-list-width': Boolean(this.input?.offsetWidth) ? `${this.input.offsetWidth}px` : undefined,\n }}\n data-fallback-placement=\"bottom-end\"\n onDisplay-change={this.handlePopoverDisplay}\n >\n <div class=\"mg-c-input__input-group-container\">\n <mg-icon icon=\"magnifying-glass\"></mg-icon>\n <input\n type=\"text\"\n role=\"combobox\"\n class=\"mg-c-input__box mg-c-input__box--width\"\n value={this.filter}\n id={this.identifier}\n name={this.name}\n placeholder={this.placeholder}\n title={this.placeholder}\n disabled={this.disabled}\n required={this.required}\n autocomplete=\"off\"\n aria-autocomplete=\"list\"\n aria-expanded={this.popoverDisplay.toString()}\n aria-controls={listId}\n aria-invalid={(this.invalid === true).toString()}\n aria-activedescendant={formatID(activeDescendant)}\n onInput={this.handleFilterInput}\n onBlur={this.handleFilterBlur}\n onFocus={this.handleFilterFocus}\n onKeyDown={this.handleFilterKeydown}\n ref={(el: HTMLInputElement) => {\n if (el !== null) this.input = el;\n }}\n />\n {withResetButton ? (\n <mg-button\n class=\"mg-c-input__box-append mg-c-input__reset\"\n variant=\"flat\"\n is-icon\n label={this.messages.general.reset}\n aria-controls={this.identifier}\n tabindex=\"-1\"\n onClick={this.handleResetButton}\n >\n <mg-icon icon=\"cross\"></mg-icon>\n </mg-button>\n ) : (\n <mg-button class=\"mg-c-input__box-append\" variant=\"flat\" is-icon label={this.itemsLabel} tabindex=\"-1\" disabled={this.disabled}>\n <mg-icon icon={`chevron-${this.popoverDisplay ? 'up' : 'down'}`}></mg-icon>\n </mg-button>\n )}\n </div>\n <div slot=\"content\" class=\"mg-c-input__popover-container\">\n {popoverContent === 'list' && [\n // eslint-disable-next-line jsx-a11y/role-supports-aria-props\n <ul key=\"list\" class=\"mg-c-input__input-list\" role=\"listbox\" id={listId} aria-label={this.itemsLabel} aria-setsize={this.page.total}>\n {this.page.items.map(option => {\n return (\n // eslint-disable-next-line jsx-a11y/click-events-have-key-events\n <li\n role=\"option\"\n class={{\n 'mg-c-input__input-list-item': true,\n 'mg-c-input__input-list-item--focus-visible': JSON.stringify(this.option?.value) === JSON.stringify(option.value),\n 'mg-c-input__input-list-item--selected': this.isCurrentOption(option),\n }}\n key={option.title}\n id={formatID(option.value)}\n aria-selected={this.isCurrentOption(option).toString()}\n onClick={this.handleOptionClick}\n >\n {option.title}\n {this.isCurrentOption(option) && <mg-icon icon=\"check\"></mg-icon>}\n </li>\n );\n })}\n </ul>,\n this.isLoading && <mg-loader key=\"loader\" message={this.messages.input.combobox.search} class={{ 'mg-u-visually-hidden': Boolean(this.page.next) }}></mg-loader>,\n this.page.next && (\n <mg-button\n key=\"load-more\"\n variant=\"flat\"\n class=\"mg-c-input__load-more\"\n tabIndex={-1}\n disabled={this.isLoading}\n full-width\n disable-on-click\n onClick={this.handleLoadMoreButton}\n aria-controls={listId}\n ref={(el: HTMLMgButtonElement) => {\n if (el !== null) this.loadMoreElement = el;\n }}\n >\n <mg-icon icon=\"chevron-down\"></mg-icon>\n {this.messages.input.combobox.loadMore}\n </mg-button>\n ),\n ]}\n {popoverContent === 'notfound' && (\n <p id={popoverContent} class=\"mg-c-input__popover-info\">\n {this.messages.input.combobox.notFound}\n </p>\n )}\n {popoverContent === 'notavailable' && (\n <p id={popoverContent} class=\"mg-c-input__popover-info\">\n {this.messages.input.combobox.notAvailable}\n </p>\n )}\n </div>\n </mg-popover>\n )}\n </mg-input>\n );\n }\n}\n"]}
|
|
@@ -93,43 +93,30 @@ export class MgInputSelect {
|
|
|
93
93
|
* Handle input event
|
|
94
94
|
*/
|
|
95
95
|
this.handleInput = () => {
|
|
96
|
-
this.updateValue();
|
|
97
|
-
if (this.hasDisplayedError)
|
|
98
|
-
this.setErrorMessage();
|
|
99
|
-
};
|
|
100
|
-
/**
|
|
101
|
-
* Method to compare item.title with input.value
|
|
102
|
-
* @param item - item to compare with
|
|
103
|
-
* @returns truthy if input.value is an item
|
|
104
|
-
*/
|
|
105
|
-
this.isInputValue = (item) => { var _a; return item.title === ((_a = this.input) === null || _a === void 0 ? void 0 : _a.value); };
|
|
106
|
-
/**
|
|
107
|
-
* value props setter
|
|
108
|
-
* @param newValue - value to update with
|
|
109
|
-
*/
|
|
110
|
-
this.setValue = (newValue) => {
|
|
111
|
-
this.checkValidity();
|
|
112
|
-
this.value = newValue;
|
|
113
|
-
};
|
|
114
|
-
/**
|
|
115
|
-
* Update value from input.value
|
|
116
|
-
*/
|
|
117
|
-
this.updateValue = () => {
|
|
118
96
|
if (this.input.value === '') {
|
|
119
|
-
this.
|
|
97
|
+
this.value = null;
|
|
120
98
|
}
|
|
121
99
|
else if (allItemsAreString(this.items) && this.items.includes(this.input.value)) {
|
|
122
|
-
this.
|
|
100
|
+
this.value = this.input.value;
|
|
123
101
|
}
|
|
124
102
|
else if (allItemsAreOptions(this.items) && typeof this.input.value === 'string' && this.items.some(this.isInputValue)) {
|
|
125
|
-
this.
|
|
103
|
+
this.value = this.items.find(this.isInputValue).value;
|
|
126
104
|
}
|
|
127
105
|
else {
|
|
128
|
-
//
|
|
106
|
+
// Add the unknown input.value to the options array as a disabled option before setting it as the new value
|
|
129
107
|
this.options.push({ title: this.input.value, value: this.input.value, disabled: true });
|
|
130
|
-
this.
|
|
108
|
+
this.value = this.input.value;
|
|
109
|
+
}
|
|
110
|
+
if (this.hasDisplayedError) {
|
|
111
|
+
this.setErrorMessage();
|
|
131
112
|
}
|
|
132
113
|
};
|
|
114
|
+
/**
|
|
115
|
+
* Method to compare item.title with input.value
|
|
116
|
+
* @param item - item to compare with
|
|
117
|
+
* @returns truthy if input.value is an item
|
|
118
|
+
*/
|
|
119
|
+
this.isInputValue = (item) => { var _a; return item.title === ((_a = this.input) === null || _a === void 0 ? void 0 : _a.value); };
|
|
133
120
|
/**
|
|
134
121
|
* Handle blur event
|
|
135
122
|
*/
|
|
@@ -185,6 +172,12 @@ export class MgInputSelect {
|
|
|
185
172
|
else {
|
|
186
173
|
this.readonlyValue = null;
|
|
187
174
|
}
|
|
175
|
+
setTimeout(() => {
|
|
176
|
+
this.checkValidity();
|
|
177
|
+
if (this.hasDisplayedError) {
|
|
178
|
+
this.setErrorMessage();
|
|
179
|
+
}
|
|
180
|
+
}, 0);
|
|
188
181
|
this.valueChange.emit(newValue);
|
|
189
182
|
}
|
|
190
183
|
validateItems(newValue) {
|
|
@@ -194,8 +187,9 @@ export class MgInputSelect {
|
|
|
194
187
|
}
|
|
195
188
|
// String array
|
|
196
189
|
else if (allItemsAreString(newValue)) {
|
|
197
|
-
if (typeof this.value === 'string')
|
|
190
|
+
if (typeof this.value === 'string') {
|
|
198
191
|
this.valueExist = newValue.includes(this.value);
|
|
192
|
+
}
|
|
199
193
|
this.options = newValue.map(item => ({ title: item, value: item }));
|
|
200
194
|
}
|
|
201
195
|
// Object array
|
|
@@ -305,8 +299,9 @@ export class MgInputSelect {
|
|
|
305
299
|
this.valid = newValue;
|
|
306
300
|
this.invalid = !this.valid;
|
|
307
301
|
// We need to send valid event even if it is the same value
|
|
308
|
-
if (this.handlerInProgress === undefined || (this.handlerInProgress === 'blur' && this.valid !== oldValidValue))
|
|
302
|
+
if (this.handlerInProgress === undefined || (this.handlerInProgress === 'blur' && this.valid !== oldValidValue)) {
|
|
309
303
|
this.inputValid.emit(this.valid);
|
|
304
|
+
}
|
|
310
305
|
}
|
|
311
306
|
/*************
|
|
312
307
|
* Lifecycle *
|
|
@@ -340,7 +335,7 @@ export class MgInputSelect {
|
|
|
340
335
|
* @returns HTML Element
|
|
341
336
|
*/
|
|
342
337
|
render() {
|
|
343
|
-
return (h("mg-input", { key: '
|
|
338
|
+
return (h("mg-input", { key: 'e5f8f97d2ebe984532bc25b7be94053c2e6ddf43', label: this.label, identifier: this.identifier, class: this.classCollection.join(), ariaDescribedbyIDs: [], labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, tooltip: this.tooltip, tooltipPosition: this.readonly && this.readonlyValue === null ? 'label' : this.tooltipPosition, helpText: this.helpText, errorMessage: this.errorMessage }, this.readonly ? (this.readonlyValue && h("b", { class: "mg-c-input__readonly-value" }, this.readonlyValue)) : (h("select", { class: "mg-c-input__box", id: this.identifier, name: this.name, title: this.placeholder, disabled: this.disabled, required: this.required, "aria-invalid": (this.invalid === true).toString(), onInput: this.handleInput, onBlur: this.handleBlur, ref: (el) => {
|
|
344
339
|
if (el !== null)
|
|
345
340
|
this.input = el;
|
|
346
341
|
} }, (!this.placeholderHide || !this.valueExist) && ( // In case passed value does not match any option we display the placeholder
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mg-input-select.js","sourceRoot":"","sources":["../../../../../src/components/molecules/inputs/mg-input-select/mg-input-select.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAgB,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvG,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAE/F,OAAO,EAAoD,aAAa,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACnI,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAElD;;;;GAIG;AACH,MAAM,QAAQ,GAAG,CAAC,MAAe,EAA0B,EAAE,CAAC,OAAO,MAAM,KAAK,QAAQ,IAAI,OAAQ,MAAuB,CAAC,KAAK,KAAK,QAAQ,CAAC;AAE/I;;;;GAIG;AACH,MAAM,kBAAkB,GA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, h, Prop, State, EventEmitter, Watch, Method } from '@stencil/core';\nimport { ClassList, allItemsAreString, isValidString, toString } from '@mgdis/stencil-helpers';\nimport { SelectOption, OptGroup } from './mg-input-select.conf';\nimport { type TooltipPosition, type Width, type EventType, classReadonly, classDisabled, widths } from '../mg-input/mg-input.conf';\nimport { initLocales } from '../../../../locales';\n\n/**\n * Check if item is a well configured option\n * @param option - select option\n * @returns select option type is valid\n */\nconst isOption = (option: unknown): option is SelectOption => typeof option === 'object' && typeof (option as SelectOption).title === 'string';\n\n/**\n * Check if items[] is SelectOption\n * @param items - select option\n * @returns select option array type is valid\n */\nconst allItemsAreOptions = (items: unknown[]): items is SelectOption[] => Array.isArray(items) && items.every(item => isOption(item));\n\n/**\n * Check if item is a well configured optgroup\n * @param optgroup - select option\n * @returns select optgroup type is valid\n */\nconst isOptGroup = (optgroup: unknown): optgroup is OptGroup =>\n typeof optgroup === 'object' && typeof (optgroup as OptGroup).group === 'string' && allItemsAreOptions((optgroup as OptGroup).options);\n\n/**\n * Group options\n * @param acc - reduce accumulator\n * @param item - item to add\n * @returns grouped options\n */\nconst groupOptions = (acc: (SelectOption | OptGroup)[], { group, title, value, disabled }: SelectOption): (SelectOption | OptGroup)[] => {\n if (group !== undefined) {\n // Check if group is already created\n const optGroup: OptGroup = (acc as OptGroup[]).find(grp => grp.group === group);\n // Add to group\n if (optGroup !== undefined) {\n optGroup.options.push({ title, value, disabled });\n }\n // Create group\n else {\n acc.push({ group, options: [{ title, value, disabled }] });\n }\n } else {\n acc.push({ title, value, disabled });\n }\n return acc;\n};\n\n@Component({\n tag: 'mg-input-select',\n styleUrl: '../../../../../node_modules/@mgdis/styles/dist/components/mg-input-select.css',\n shadow: true,\n})\nexport class MgInputSelect {\n /************\n * Internal *\n ************/\n\n // HTML selector\n private input: HTMLSelectElement;\n\n // Locales\n private messages;\n\n // hasDisplayedError (triggered by blur event)\n private hasDisplayedError = false;\n private handlerInProgress: EventType;\n\n /**************\n * Decorators *\n **************/\n\n /**\n * Get component DOM element\n */\n @Element() element: HTMLMgInputSelectElement;\n\n /**\n * Component value\n */\n @Prop({ mutable: true }) value: any; // eslint-disable-line @typescript-eslint/no-explicit-any\n @Watch('value')\n validateValue(newValue: MgInputSelect['value']): void {\n if (allItemsAreString(this.items) && typeof newValue === 'string') {\n this.readonlyValue = this.input?.value !== undefined ? this.input.value : newValue;\n } else if (allItemsAreOptions(this.items)) {\n this.readonlyValue = this.items.find(item => item.value === newValue)?.title;\n } else {\n this.readonlyValue = null;\n }\n this.valueChange.emit(newValue);\n }\n\n /**\n * Items are the possible options to select\n */\n @Prop() items!: (string | SelectOption)[];\n @Watch('items')\n validateItems(newValue: MgInputSelect['items']): void {\n // Empty options\n if (newValue.length === 0) {\n this.options = [];\n }\n // String array\n else if (allItemsAreString(newValue)) {\n if (typeof this.value === 'string') this.valueExist = newValue.includes(this.value);\n this.options = newValue.map(item => ({ title: item, value: item }));\n }\n // Object array\n else if (allItemsAreOptions(newValue)) {\n this.valueExist = newValue.map(item => item.value).includes(this.value);\n // Grouped object options\n if (newValue.some(item => Boolean(item.group))) {\n this.options = newValue.reduce(groupOptions, []);\n }\n // Standart object options\n else {\n this.options = newValue;\n }\n } else {\n throw new Error(\n `<mg-input-select> prop \"items\" is required, can be an empty Array or all items must be the same type: string or Option. Passed value: ${toString(newValue)}.`,\n );\n }\n }\n\n /**\n * Identifier is used for the element ID (id is a reserved prop in Stencil.js)\n */\n @Prop() identifier!: string;\n\n /**\n * Input name\n * If not set the value equals the identifier\n */\n @Prop() name = this.identifier;\n\n /**\n * Input label\n */\n @Prop() label!: string;\n\n /**\n * Define if label is displayed on top\n */\n @Prop() labelOnTop = false;\n\n /**\n * Define if label is visible\n */\n @Prop() labelHide = false;\n\n /**\n * Input placeholder.\n * It should be a word or short phrase that demonstrates the expected type of data, not a replacement for labels or help text.\n */\n @Prop({ mutable: true }) placeholder: string;\n\n /**\n * Option to remove placeholder\n */\n @Prop() placeholderHide = false;\n\n /**\n * Option to disable placeholder\n */\n @Prop() placeholderDisabled = false;\n\n /**\n * Define if input is required\n */\n @Prop() required = false;\n\n /**\n * Define if input is readonly\n */\n @Prop() readonly = false;\n @Watch('readonly')\n watchReadonly(newValue: MgInputSelect['readonly']): void {\n if (newValue) this.classCollection.add(classReadonly);\n else this.classCollection.delete(classReadonly);\n }\n\n /**\n * Define if input is disabled\n */\n @Prop() disabled = false;\n @Watch('required')\n @Watch('readonly')\n @Watch('disabled')\n handleValidityChange(newValue: boolean, _oldValue: boolean, prop: string): void {\n if (this.input !== undefined) {\n this.input[prop] = newValue;\n this.checkValidity();\n if (this.hasDisplayedError) {\n this.setErrorMessage();\n this.hasDisplayedError = false;\n }\n }\n }\n\n @Watch('disabled')\n watchDisabled(newValue: MgInputSelect['disabled']): void {\n if (newValue) this.classCollection.add(classDisabled);\n else this.classCollection.delete(classDisabled);\n }\n\n /**\n * Define input width\n */\n @Prop({ reflect: true }) mgWidth: Width;\n @Watch('mgWidth')\n watchMgWidth(newValue: MgInputSelect['mgWidth']): void {\n // reset width class\n widths.forEach(width => {\n this.classCollection.delete(`mg-c-input--width-${width}`);\n });\n // apply new width\n if (newValue !== undefined) this.classCollection.add(`mg-c-input--width-${this.mgWidth}`);\n }\n\n /**\n * Add a tooltip message next to the input\n */\n @Prop() tooltip?: string;\n\n /**\n * Define tooltip position\n */\n @Prop() tooltipPosition: TooltipPosition = 'input';\n\n /**\n * Add a help text under the input, usually expected data format and example\n */\n @Prop() helpText?: string;\n\n /**\n * Define input valid state\n */\n @Prop({ mutable: true }) valid: boolean;\n\n /**\n * Define input invalid state\n */\n @Prop({ mutable: true }) invalid: boolean;\n\n /**\n * Component classes\n */\n @State() classCollection: ClassList = new ClassList(['mg-c-input--select']);\n\n /**\n * Error message to display\n */\n @State() errorMessage: string;\n\n /**\n * Formated items for display\n */\n @State() options: (SelectOption | OptGroup)[];\n\n /**\n * Does value match any item option\n */\n @State() valueExist: boolean;\n\n /**\n * Value to display in readonly mode\n */\n @State() readonlyValue: string;\n\n /**\n * Emited event when value change\n */\n @Event({ eventName: 'value-change' }) valueChange: EventEmitter<HTMLMgInputCheckboxElement['value']>;\n\n /**\n * Emited event when checking validity\n */\n @Event({ eventName: 'input-valid' }) inputValid: EventEmitter<HTMLMgInputCheckboxElement['valid']>;\n\n /**\n * Display input error if it exists.\n */\n @Method()\n displayError(): Promise<void> {\n // Use `Promise` as requested for stencil method\n // Use `requestAnimationFrame` to ensure:\n // - DOM is fully updated before validation\n // - Async operations are completed\n // - No timing issues with Stencil's render cycle\n // - Keep everything in sync both inside and outside the component\n return new Promise(resolve => {\n requestAnimationFrame(() => {\n this.checkValidity();\n this.setErrorMessage();\n this.hasDisplayedError = this.invalid;\n resolve();\n });\n });\n }\n\n /**\n * Set an error and display a custom error message.\n * This method can be used to set the component's error state from its context by passing a boolean value to the `valid` parameter.\n * It must be paired with an error message to display for the given context.\n * When used to set validity to `false`, you should use this method again to reset the validity to `true`.\n * @param valid - value indicating the validity\n * @param errorMessage - the error message to display\n */\n @Method()\n async setError(valid: MgInputSelect['valid'], errorMessage: string): Promise<void> {\n if (typeof valid !== 'boolean') {\n throw new Error('<mg-input-select> method \"setError()\" param \"valid\" must be a boolean.');\n } else if (!isValidString(errorMessage)) {\n throw new Error('<mg-input-select> method \"setError()\" param \"errorMessage\" must be a string.');\n } else {\n this.setValidity(valid);\n this.setErrorMessage(valid ? undefined : errorMessage);\n this.hasDisplayedError = this.invalid;\n }\n }\n\n /**\n * Reset value, validity and error state\n */\n @Method()\n async reset(): Promise<void> {\n if (!this.readonly) {\n this.value = null;\n this.checkValidity();\n this.errorMessage = undefined;\n this.hasDisplayedError = false;\n }\n }\n\n /**\n * Method to set validity values\n * @param newValue - valid new value\n */\n private setValidity(newValue: MgInputSelect['valid']) {\n const oldValidValue = this.valid;\n this.valid = newValue;\n this.invalid = !this.valid;\n // We need to send valid event even if it is the same value\n if (this.handlerInProgress === undefined || (this.handlerInProgress === 'blur' && this.valid !== oldValidValue)) this.inputValid.emit(this.valid);\n }\n /**\n * Handle input event\n */\n private handleInput = (): void => {\n this.updateValue();\n if (this.hasDisplayedError) this.setErrorMessage();\n };\n\n /**\n * Method to compare item.title with input.value\n * @param item - item to compare with\n * @returns truthy if input.value is an item\n */\n private isInputValue = (item: SelectOption): boolean => item.title === this.input?.value;\n\n /**\n * value props setter\n * @param newValue - value to update with\n */\n private setValue = (newValue: MgInputSelect['value']): void => {\n this.checkValidity();\n this.value = newValue;\n };\n\n /**\n * Update value from input.value\n */\n private updateValue = (): void => {\n if (this.input.value === '') {\n this.setValue(null);\n } else if (allItemsAreString(this.items) && this.items.includes(this.input.value)) {\n this.setValue(this.input.value);\n } else if (allItemsAreOptions(this.items) && typeof this.input.value === 'string' && this.items.some(this.isInputValue)) {\n this.setValue(this.items.find(this.isInputValue).value);\n } else {\n // before set newValue with push to options[] the unknown input.value with a disable satus\n this.options.push({ title: this.input.value, value: this.input.value, disabled: true });\n this.setValue(this.input.value);\n }\n };\n\n /**\n * Handle blur event\n */\n private handleBlur = (): void => {\n this.handlerInProgress = 'blur';\n this.displayError().finally(() => {\n // reset guard\n this.handlerInProgress = undefined;\n });\n };\n\n /**\n * Input value is disabled\n * @returns truthy if input value is disabled\n */\n private isDisabledValue = (): boolean => allItemsAreOptions(this.options) && this.options.find(this.isInputValue)?.disabled === true;\n\n /**\n * Check if input is valid\n */\n private checkValidity = (): void => {\n this.setValidity(!this.isDisabledValue() && (this.readonly || this.disabled || this.input.checkValidity()));\n };\n\n /**\n * Set input error message\n * @param errorMessage - errorMessage override\n */\n private setErrorMessage = (errorMessage?: string): void => {\n // Set error message\n this.errorMessage = undefined;\n if (!this.valid) {\n if (errorMessage !== undefined) {\n this.errorMessage = errorMessage;\n } else if (this.input.validity.valueMissing) {\n this.errorMessage = this.messages.errors.required;\n }\n }\n };\n\n /*************\n * Lifecycle *\n *************/\n\n /**\n * Check if component props are well configured on init\n * @returns timeout\n */\n componentWillLoad(): ReturnType<typeof setTimeout> {\n // Get locales\n this.messages = initLocales(this.element).messages;\n // Validate\n this.validateItems(this.items);\n this.validateValue(this.value);\n this.watchMgWidth(this.mgWidth);\n this.watchReadonly(this.readonly);\n this.watchDisabled(this.disabled);\n // Set default placeholder\n if (this.placeholder === undefined || this.placeholder === '') {\n this.placeholder = this.messages.input.select.placeholder;\n }\n // Check validity when component is ready\n // return a promise to process action only in the FIRST render().\n // https://stenciljs.com/docs/component-lifecycle#componentwillload\n return setTimeout(() => {\n this.checkValidity();\n }, 0);\n }\n\n /**\n * Render option\n * @param option - to render\n * @returns render option\n */\n private renderOption = (option: SelectOption): HTMLElement => (\n <option key={option.title} value={option.title} selected={JSON.stringify(this.value) === JSON.stringify(option.value)} disabled={option.disabled}>\n {option.title}\n </option>\n );\n\n /**\n * Render\n * @returns HTML Element\n */\n render(): HTMLElement {\n return (\n <mg-input\n label={this.label}\n identifier={this.identifier}\n class={this.classCollection.join()}\n ariaDescribedbyIDs={[]}\n labelOnTop={this.labelOnTop}\n labelHide={this.labelHide}\n required={this.required}\n tooltip={this.tooltip}\n tooltipPosition={this.readonly && this.readonlyValue === null ? 'label' : this.tooltipPosition}\n helpText={this.helpText}\n errorMessage={this.errorMessage}\n >\n {this.readonly ? (\n this.readonlyValue && <b class=\"mg-c-input__readonly-value\">{this.readonlyValue}</b>\n ) : (\n <select\n class=\"mg-c-input__box\"\n id={this.identifier}\n name={this.name}\n title={this.placeholder}\n disabled={this.disabled}\n required={this.required}\n aria-invalid={(this.invalid === true).toString()}\n onInput={this.handleInput}\n onBlur={this.handleBlur}\n ref={(el: HTMLSelectElement) => {\n if (el !== null) this.input = el;\n }}\n >\n {(!this.placeholderHide || !this.valueExist) && ( // In case passed value does not match any option we display the placeholder\n <option value=\"\" disabled={this.placeholderDisabled && this.valueExist}>\n {this.placeholder}\n </option>\n )}\n {this.options.map(option =>\n isOptGroup(option) ? (\n <optgroup label={option.group} key={option.group}>\n {option.options.map(this.renderOption)}\n </optgroup>\n ) : (\n isOption(option) && this.renderOption(option)\n ),\n )}\n </select>\n )}\n </mg-input>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"mg-input-select.js","sourceRoot":"","sources":["../../../../../src/components/molecules/inputs/mg-input-select/mg-input-select.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAgB,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvG,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAE/F,OAAO,EAAoD,aAAa,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACnI,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAElD;;;;GAIG;AACH,MAAM,QAAQ,GAAG,CAAC,MAAe,EAA0B,EAAE,CAAC,OAAO,MAAM,KAAK,QAAQ,IAAI,OAAQ,MAAuB,CAAC,KAAK,KAAK,QAAQ,CAAC;AAE/I;;;;GAIG;AACH,MAAM,kBAAkB,GAAG,CAAC,KAAgB,EAA2B,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;AAEtI;;;;GAIG;AACH,MAAM,UAAU,GAAG,CAAC,QA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, h, Prop, State, EventEmitter, Watch, Method } from '@stencil/core';\nimport { ClassList, allItemsAreString, isValidString, toString } from '@mgdis/stencil-helpers';\nimport { SelectOption, OptGroup } from './mg-input-select.conf';\nimport { type TooltipPosition, type Width, type EventType, classReadonly, classDisabled, widths } from '../mg-input/mg-input.conf';\nimport { initLocales } from '../../../../locales';\n\n/**\n * Check if item is a well configured option\n * @param option - select option\n * @returns select option type is valid\n */\nconst isOption = (option: unknown): option is SelectOption => typeof option === 'object' && typeof (option as SelectOption).title === 'string';\n\n/**\n * Check if items[] is SelectOption\n * @param items - select option\n * @returns select option array type is valid\n */\nconst allItemsAreOptions = (items: unknown[]): items is SelectOption[] => Array.isArray(items) && items.every(item => isOption(item));\n\n/**\n * Check if item is a well configured optgroup\n * @param optgroup - select option\n * @returns select optgroup type is valid\n */\nconst isOptGroup = (optgroup: unknown): optgroup is OptGroup =>\n typeof optgroup === 'object' && typeof (optgroup as OptGroup).group === 'string' && allItemsAreOptions((optgroup as OptGroup).options);\n\n/**\n * Group options\n * @param acc - reduce accumulator\n * @param item - item to add\n * @returns grouped options\n */\nconst groupOptions = (acc: (SelectOption | OptGroup)[], { group, title, value, disabled }: SelectOption): (SelectOption | OptGroup)[] => {\n if (group !== undefined) {\n // Check if group is already created\n const optGroup: OptGroup = (acc as OptGroup[]).find(grp => grp.group === group);\n // Add to group\n if (optGroup !== undefined) {\n optGroup.options.push({ title, value, disabled });\n }\n // Create group\n else {\n acc.push({ group, options: [{ title, value, disabled }] });\n }\n } else {\n acc.push({ title, value, disabled });\n }\n return acc;\n};\n\n@Component({\n tag: 'mg-input-select',\n styleUrl: '../../../../../node_modules/@mgdis/styles/dist/components/mg-input-select.css',\n shadow: true,\n})\nexport class MgInputSelect {\n /************\n * Internal *\n ************/\n\n // HTML selector\n private input: HTMLSelectElement;\n\n // Locales\n private messages;\n\n // hasDisplayedError (triggered by blur event)\n private hasDisplayedError = false;\n private handlerInProgress: EventType;\n\n /**************\n * Decorators *\n **************/\n\n /**\n * Get component DOM element\n */\n @Element() element: HTMLMgInputSelectElement;\n\n /**\n * Component value\n */\n @Prop({ mutable: true }) value: any; // eslint-disable-line @typescript-eslint/no-explicit-any\n @Watch('value')\n validateValue(newValue: MgInputSelect['value']): void {\n if (allItemsAreString(this.items) && typeof newValue === 'string') {\n this.readonlyValue = this.input?.value !== undefined ? this.input.value : newValue;\n } else if (allItemsAreOptions(this.items)) {\n this.readonlyValue = this.items.find(item => item.value === newValue)?.title;\n } else {\n this.readonlyValue = null;\n }\n setTimeout(() => {\n this.checkValidity();\n if (this.hasDisplayedError) {\n this.setErrorMessage();\n }\n }, 0);\n this.valueChange.emit(newValue);\n }\n\n /**\n * Items are the possible options to select\n */\n @Prop() items!: (string | SelectOption)[];\n @Watch('items')\n validateItems(newValue: MgInputSelect['items']): void {\n // Empty options\n if (newValue.length === 0) {\n this.options = [];\n }\n // String array\n else if (allItemsAreString(newValue)) {\n if (typeof this.value === 'string') {\n this.valueExist = newValue.includes(this.value);\n }\n this.options = newValue.map(item => ({ title: item, value: item }));\n }\n // Object array\n else if (allItemsAreOptions(newValue)) {\n this.valueExist = newValue.map(item => item.value).includes(this.value);\n // Grouped object options\n if (newValue.some(item => Boolean(item.group))) {\n this.options = newValue.reduce(groupOptions, []);\n }\n // Standart object options\n else {\n this.options = newValue;\n }\n } else {\n throw new Error(\n `<mg-input-select> prop \"items\" is required, can be an empty Array or all items must be the same type: string or Option. Passed value: ${toString(newValue)}.`,\n );\n }\n }\n\n /**\n * Identifier is used for the element ID (id is a reserved prop in Stencil.js)\n */\n @Prop() identifier!: string;\n\n /**\n * Input name\n * If not set the value equals the identifier\n */\n @Prop() name = this.identifier;\n\n /**\n * Input label\n */\n @Prop() label!: string;\n\n /**\n * Define if label is displayed on top\n */\n @Prop() labelOnTop = false;\n\n /**\n * Define if label is visible\n */\n @Prop() labelHide = false;\n\n /**\n * Input placeholder.\n * It should be a word or short phrase that demonstrates the expected type of data, not a replacement for labels or help text.\n */\n @Prop({ mutable: true }) placeholder: string;\n\n /**\n * Option to remove placeholder\n */\n @Prop() placeholderHide = false;\n\n /**\n * Option to disable placeholder\n */\n @Prop() placeholderDisabled = false;\n\n /**\n * Define if input is required\n */\n @Prop() required = false;\n\n /**\n * Define if input is readonly\n */\n @Prop() readonly = false;\n @Watch('readonly')\n watchReadonly(newValue: MgInputSelect['readonly']): void {\n if (newValue) this.classCollection.add(classReadonly);\n else this.classCollection.delete(classReadonly);\n }\n\n /**\n * Define if input is disabled\n */\n @Prop() disabled = false;\n @Watch('required')\n @Watch('readonly')\n @Watch('disabled')\n handleValidityChange(newValue: boolean, _oldValue: boolean, prop: string): void {\n if (this.input !== undefined) {\n this.input[prop] = newValue;\n this.checkValidity();\n if (this.hasDisplayedError) {\n this.setErrorMessage();\n this.hasDisplayedError = false;\n }\n }\n }\n\n @Watch('disabled')\n watchDisabled(newValue: MgInputSelect['disabled']): void {\n if (newValue) this.classCollection.add(classDisabled);\n else this.classCollection.delete(classDisabled);\n }\n\n /**\n * Define input width\n */\n @Prop({ reflect: true }) mgWidth: Width;\n @Watch('mgWidth')\n watchMgWidth(newValue: MgInputSelect['mgWidth']): void {\n // reset width class\n widths.forEach(width => {\n this.classCollection.delete(`mg-c-input--width-${width}`);\n });\n // apply new width\n if (newValue !== undefined) this.classCollection.add(`mg-c-input--width-${this.mgWidth}`);\n }\n\n /**\n * Add a tooltip message next to the input\n */\n @Prop() tooltip?: string;\n\n /**\n * Define tooltip position\n */\n @Prop() tooltipPosition: TooltipPosition = 'input';\n\n /**\n * Add a help text under the input, usually expected data format and example\n */\n @Prop() helpText?: string;\n\n /**\n * Define input valid state\n */\n @Prop({ mutable: true }) valid: boolean;\n\n /**\n * Define input invalid state\n */\n @Prop({ mutable: true }) invalid: boolean;\n\n /**\n * Component classes\n */\n @State() classCollection: ClassList = new ClassList(['mg-c-input--select']);\n\n /**\n * Error message to display\n */\n @State() errorMessage: string;\n\n /**\n * Formated items for display\n */\n @State() options: (SelectOption | OptGroup)[];\n\n /**\n * Does value match any item option\n */\n @State() valueExist: boolean;\n\n /**\n * Value to display in readonly mode\n */\n @State() readonlyValue: string;\n\n /**\n * Emited event when value change\n */\n @Event({ eventName: 'value-change' }) valueChange: EventEmitter<HTMLMgInputCheckboxElement['value']>;\n\n /**\n * Emited event when checking validity\n */\n @Event({ eventName: 'input-valid' }) inputValid: EventEmitter<HTMLMgInputCheckboxElement['valid']>;\n\n /**\n * Display input error if it exists.\n */\n @Method()\n displayError(): Promise<void> {\n // Use `Promise` as requested for stencil method\n // Use `requestAnimationFrame` to ensure:\n // - DOM is fully updated before validation\n // - Async operations are completed\n // - No timing issues with Stencil's render cycle\n // - Keep everything in sync both inside and outside the component\n return new Promise(resolve => {\n requestAnimationFrame(() => {\n this.checkValidity();\n this.setErrorMessage();\n this.hasDisplayedError = this.invalid;\n resolve();\n });\n });\n }\n\n /**\n * Set an error and display a custom error message.\n * This method can be used to set the component's error state from its context by passing a boolean value to the `valid` parameter.\n * It must be paired with an error message to display for the given context.\n * When used to set validity to `false`, you should use this method again to reset the validity to `true`.\n * @param valid - value indicating the validity\n * @param errorMessage - the error message to display\n */\n @Method()\n async setError(valid: MgInputSelect['valid'], errorMessage: string): Promise<void> {\n if (typeof valid !== 'boolean') {\n throw new Error('<mg-input-select> method \"setError()\" param \"valid\" must be a boolean.');\n } else if (!isValidString(errorMessage)) {\n throw new Error('<mg-input-select> method \"setError()\" param \"errorMessage\" must be a string.');\n } else {\n this.setValidity(valid);\n this.setErrorMessage(valid ? undefined : errorMessage);\n this.hasDisplayedError = this.invalid;\n }\n }\n\n /**\n * Reset value, validity and error state\n */\n @Method()\n async reset(): Promise<void> {\n if (!this.readonly) {\n this.value = null;\n this.checkValidity();\n this.errorMessage = undefined;\n this.hasDisplayedError = false;\n }\n }\n\n /**\n * Method to set validity values\n * @param newValue - valid new value\n */\n private setValidity(newValue: MgInputSelect['valid']) {\n const oldValidValue = this.valid;\n this.valid = newValue;\n this.invalid = !this.valid;\n // We need to send valid event even if it is the same value\n if (this.handlerInProgress === undefined || (this.handlerInProgress === 'blur' && this.valid !== oldValidValue)) {\n this.inputValid.emit(this.valid);\n }\n }\n\n /**\n * Handle input event\n */\n private handleInput = (): void => {\n if (this.input.value === '') {\n this.value = null;\n } else if (allItemsAreString(this.items) && this.items.includes(this.input.value)) {\n this.value = this.input.value;\n } else if (allItemsAreOptions(this.items) && typeof this.input.value === 'string' && this.items.some(this.isInputValue)) {\n this.value = this.items.find(this.isInputValue).value;\n } else {\n // Add the unknown input.value to the options array as a disabled option before setting it as the new value\n this.options.push({ title: this.input.value, value: this.input.value, disabled: true });\n this.value = this.input.value;\n }\n if (this.hasDisplayedError) {\n this.setErrorMessage();\n }\n };\n\n /**\n * Method to compare item.title with input.value\n * @param item - item to compare with\n * @returns truthy if input.value is an item\n */\n private isInputValue = (item: SelectOption): boolean => item.title === this.input?.value;\n\n /**\n * Handle blur event\n */\n private handleBlur = (): void => {\n this.handlerInProgress = 'blur';\n this.displayError().finally(() => {\n // reset guard\n this.handlerInProgress = undefined;\n });\n };\n\n /**\n * Input value is disabled\n * @returns truthy if input value is disabled\n */\n private isDisabledValue = (): boolean => allItemsAreOptions(this.options) && this.options.find(this.isInputValue)?.disabled === true;\n\n /**\n * Check if input is valid\n */\n private checkValidity = (): void => {\n this.setValidity(!this.isDisabledValue() && (this.readonly || this.disabled || this.input.checkValidity()));\n };\n\n /**\n * Set input error message\n * @param errorMessage - errorMessage override\n */\n private setErrorMessage = (errorMessage?: string): void => {\n // Set error message\n this.errorMessage = undefined;\n if (!this.valid) {\n if (errorMessage !== undefined) {\n this.errorMessage = errorMessage;\n } else if (this.input.validity.valueMissing) {\n this.errorMessage = this.messages.errors.required;\n }\n }\n };\n\n /*************\n * Lifecycle *\n *************/\n\n /**\n * Check if component props are well configured on init\n * @returns timeout\n */\n componentWillLoad(): ReturnType<typeof setTimeout> {\n // Get locales\n this.messages = initLocales(this.element).messages;\n // Validate\n this.validateItems(this.items);\n this.validateValue(this.value);\n this.watchMgWidth(this.mgWidth);\n this.watchReadonly(this.readonly);\n this.watchDisabled(this.disabled);\n // Set default placeholder\n if (this.placeholder === undefined || this.placeholder === '') {\n this.placeholder = this.messages.input.select.placeholder;\n }\n // Check validity when component is ready\n // return a promise to process action only in the FIRST render().\n // https://stenciljs.com/docs/component-lifecycle#componentwillload\n return setTimeout(() => {\n this.checkValidity();\n }, 0);\n }\n\n /**\n * Render option\n * @param option - to render\n * @returns render option\n */\n private renderOption = (option: SelectOption): HTMLElement => (\n <option key={option.title} value={option.title} selected={JSON.stringify(this.value) === JSON.stringify(option.value)} disabled={option.disabled}>\n {option.title}\n </option>\n );\n\n /**\n * Render\n * @returns HTML Element\n */\n render(): HTMLElement {\n return (\n <mg-input\n label={this.label}\n identifier={this.identifier}\n class={this.classCollection.join()}\n ariaDescribedbyIDs={[]}\n labelOnTop={this.labelOnTop}\n labelHide={this.labelHide}\n required={this.required}\n tooltip={this.tooltip}\n tooltipPosition={this.readonly && this.readonlyValue === null ? 'label' : this.tooltipPosition}\n helpText={this.helpText}\n errorMessage={this.errorMessage}\n >\n {this.readonly ? (\n this.readonlyValue && <b class=\"mg-c-input__readonly-value\">{this.readonlyValue}</b>\n ) : (\n <select\n class=\"mg-c-input__box\"\n id={this.identifier}\n name={this.name}\n title={this.placeholder}\n disabled={this.disabled}\n required={this.required}\n aria-invalid={(this.invalid === true).toString()}\n onInput={this.handleInput}\n onBlur={this.handleBlur}\n ref={(el: HTMLSelectElement) => {\n if (el !== null) this.input = el;\n }}\n >\n {(!this.placeholderHide || !this.valueExist) && ( // In case passed value does not match any option we display the placeholder\n <option value=\"\" disabled={this.placeholderDisabled && this.valueExist}>\n {this.placeholder}\n </option>\n )}\n {this.options.map(option =>\n isOptGroup(option) ? (\n <optgroup label={option.group} key={option.group}>\n {option.options.map(this.renderOption)}\n </optgroup>\n ) : (\n isOption(option) && this.renderOption(option)\n ),\n )}\n </select>\n )}\n </mg-input>\n );\n }\n}\n"]}
|
|
@@ -38,6 +38,10 @@ export class MgDetails {
|
|
|
38
38
|
componentWillLoad() {
|
|
39
39
|
this.validateTitles(this.toggleClosed);
|
|
40
40
|
this.validateTitles(this.toggleOpened);
|
|
41
|
+
// Check if summary slot is empty
|
|
42
|
+
const summarySlot = this.element.querySelector('[slot="summary"]');
|
|
43
|
+
this.isEmptySummary = summarySlot === null || !isValidString(summarySlot.textContent);
|
|
44
|
+
// Add event listener to prevent default action on summary click
|
|
41
45
|
this.element.addEventListener('click', (event) => {
|
|
42
46
|
if (event.target.closest('[slot="summary"] mg-button, mg-button[slot="summary"]') !== null) {
|
|
43
47
|
event.preventDefault();
|
|
@@ -49,7 +53,7 @@ export class MgDetails {
|
|
|
49
53
|
* @returns HTML Element
|
|
50
54
|
*/
|
|
51
55
|
render() {
|
|
52
|
-
return (h("details", { key: '
|
|
56
|
+
return (h("details", { key: '7ec633056f7e127154b9d8f30f77bd9d03a78591', class: { 'mg-c-details': true, 'mg-c-details--empty-summary': this.isEmptySummary }, onToggle: this.handleToggle, open: this.expanded, ref: (el) => (this.details = el) }, h("summary", { key: '4947a7a5d1971feb4f7b27c5bc161b0599b640c1' }, h("slot", { key: '6505ae282f5cc53ac3b5f924caee6347e958b03f', name: "summary" }), h("span", { key: 'fcf391abf5a99f3ff9f5a006698e9ef646ca159e', class: "mg-c-details__toggle" }, h("mg-icon", { key: '5d02b782ce1f762612ae5881cd85d65680addaa9', icon: "chevron-up", class: { 'mg-c-details__toggle-icon': true, 'mg-c-details__toggle-icon--reverse': !this.expanded } }), h("span", { key: '0dbd12e051714756a633146a99303088cbab4fa7', class: { 'mg-u-visually-hidden': this.hideSummary } }, this.expanded ? this.toggleOpened : this.toggleClosed))), h("div", { key: '607ae907cce5efd3fa56d9ed62cf9f4091abf262', class: "mg-c-details__details" }, h("slot", { key: '0e1eda9ec27c618aee1929727676d9450e457b42', name: "details" }))));
|
|
53
57
|
}
|
|
54
58
|
static get is() { return "mg-details"; }
|
|
55
59
|
static get encapsulation() { return "shadow"; }
|