@limetech/lime-elements 37.13.3 → 37.14.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/cjs/limel-portal_3.cjs.entry.js +6 -4
  3. package/dist/cjs/limel-portal_3.cjs.entry.js.map +1 -1
  4. package/dist/cjs/limel-select.cjs.entry.js +3 -1
  5. package/dist/cjs/limel-select.cjs.entry.js.map +1 -1
  6. package/dist/collection/components/select/option.types.js.map +1 -1
  7. package/dist/collection/components/select/select.js +1 -0
  8. package/dist/collection/components/select/select.js.map +1 -1
  9. package/dist/collection/components/select/select.template.js +3 -1
  10. package/dist/collection/components/select/select.template.js.map +1 -1
  11. package/dist/collection/components/tooltip/tooltip.js +6 -4
  12. package/dist/collection/components/tooltip/tooltip.js.map +1 -1
  13. package/dist/esm/limel-portal_3.entry.js +6 -4
  14. package/dist/esm/limel-portal_3.entry.js.map +1 -1
  15. package/dist/esm/limel-select.entry.js +3 -1
  16. package/dist/esm/limel-select.entry.js.map +1 -1
  17. package/dist/lime-elements/lime-elements.esm.js +1 -1
  18. package/dist/lime-elements/{p-4b29d287.entry.js → p-66c9403f.entry.js} +2 -2
  19. package/dist/lime-elements/p-66c9403f.entry.js.map +1 -0
  20. package/dist/lime-elements/p-6fb481ea.entry.js +68 -0
  21. package/dist/lime-elements/p-6fb481ea.entry.js.map +1 -0
  22. package/dist/types/components/select/option.types.d.ts +4 -0
  23. package/dist/types/components/select/select.d.ts +1 -0
  24. package/dist/types/components.d.ts +4 -0
  25. package/package.json +2 -2
  26. package/dist/lime-elements/p-4b29d287.entry.js.map +0 -1
  27. package/dist/lime-elements/p-6f361347.entry.js +0 -68
  28. package/dist/lime-elements/p-6f361347.entry.js.map +0 -1
@@ -361,12 +361,13 @@ function createMenuItems(options, value, selectIsRequired = false) {
361
361
  const menuOptionFilter = getMenuOptionFilter(selectIsRequired);
362
362
  return options.filter(menuOptionFilter).map((option) => {
363
363
  const selected = isSelected(option, value);
364
- const { text, disabled } = option;
364
+ const { text, secondaryText, disabled } = option;
365
365
  const name = getIconProps.getIconName(option.icon);
366
366
  const color = getIconProps.getIconColor(option.icon, option.iconColor);
367
367
  if (!name) {
368
368
  return {
369
369
  text: text,
370
+ secondaryText: secondaryText,
370
371
  selected: selected,
371
372
  disabled: disabled,
372
373
  value: option,
@@ -374,6 +375,7 @@ function createMenuItems(options, value, selectIsRequired = false) {
374
375
  }
375
376
  return {
376
377
  text: text,
378
+ secondaryText: secondaryText,
377
379
  selected: selected,
378
380
  disabled: disabled,
379
381
  value: option,
@@ -1 +1 @@
1
- {"file":"limel-select.entry.cjs.js","mappings":";;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,OAAO,GAAG;AACd,IAAI,WAAW,EAAE,aAAa;AAC9B,IAAI,IAAI,EAAE,MAAM;AAChB,CAAC,CAAC;AACF,IAAI,UAAU,GAAG;AACjB,IAAI,0BAA0B,EAAE,wCAAwC;AACxE,IAAI,qCAAqC,EAAE,mDAAmD;AAC9F,CAAC;;AC7BD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA,IAAI,6BAA6B,kBAAkB,UAAU,MAAM,EAAE;AACrE,IAAIA,mBAAS,CAAC,6BAA6B,EAAE,MAAM,CAAC,CAAC;AACrD,IAAI,SAAS,6BAA6B,CAAC,OAAO,EAAE;AACpD,QAAQ,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,EAAEC,kBAAQ,CAACA,kBAAQ,CAAC,EAAE,EAAE,6BAA6B,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC,CAAC,IAAI,IAAI,CAAC;AACxH,KAAK;AACL,IAAI,MAAM,CAAC,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,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7B,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;GACzB;;;;;;;;;;","names":["__extends","__assign","MDCFoundation","MDCComponent","isMultiple","h","getIconName","getIconColor","createRandomString","isMobileDevice","MDCFloatingLabel","ENTER","ENTER_KEY_CODE","SPACE","SPACE_KEY_CODE"],"sources":["./node_modules/@material/select/helper-text/constants.js","./node_modules/@material/select/helper-text/foundation.js","./node_modules/@material/select/helper-text/component.js","./src/components/select/select.template.tsx","./src/components/select/select.scss?tag=limel-select&encapsulation=shadow","./src/components/select/select.tsx"],"sourcesContent":["/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\nvar strings = {\n ARIA_HIDDEN: 'aria-hidden',\n ROLE: 'role',\n};\nvar cssClasses = {\n HELPER_TEXT_VALIDATION_MSG: 'mdc-select-helper-text--validation-msg',\n HELPER_TEXT_VALIDATION_MSG_PERSISTENT: 'mdc-select-helper-text--validation-msg-persistent',\n};\nexport { strings, cssClasses };\n//# sourceMappingURL=constants.js.map","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\nimport { __assign, __extends } from \"tslib\";\nimport { MDCFoundation } from '@material/base/foundation';\nimport { cssClasses, strings } from './constants';\nvar MDCSelectHelperTextFoundation = /** @class */ (function (_super) {\n __extends(MDCSelectHelperTextFoundation, _super);\n function MDCSelectHelperTextFoundation(adapter) {\n return _super.call(this, __assign(__assign({}, MDCSelectHelperTextFoundation.defaultAdapter), adapter)) || this;\n }\n Object.defineProperty(MDCSelectHelperTextFoundation, \"cssClasses\", {\n get: function () {\n return cssClasses;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MDCSelectHelperTextFoundation, \"strings\", {\n get: function () {\n return strings;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MDCSelectHelperTextFoundation, \"defaultAdapter\", {\n /**\n * See {@link MDCSelectHelperTextAdapter} for typing information on parameters and return types.\n */\n get: function () {\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n return {\n addClass: function () { return undefined; },\n removeClass: function () { return undefined; },\n hasClass: function () { return false; },\n setAttr: function () { return undefined; },\n getAttr: function () { return null; },\n removeAttr: function () { return undefined; },\n setContent: function () { return undefined; },\n };\n // tslint:enable:object-literal-sort-keys\n },\n enumerable: false,\n configurable: true\n });\n /**\n * @return The ID of the helper text, or null if none is set.\n */\n MDCSelectHelperTextFoundation.prototype.getId = function () {\n return this.adapter.getAttr('id');\n };\n /**\n * @return Whether the helper text is currently visible.\n */\n MDCSelectHelperTextFoundation.prototype.isVisible = function () {\n return this.adapter.getAttr(strings.ARIA_HIDDEN) !== 'true';\n };\n /**\n * Sets the content of the helper text field.\n */\n MDCSelectHelperTextFoundation.prototype.setContent = function (content) {\n this.adapter.setContent(content);\n };\n /**\n * Sets the helper text to act as a validation message.\n * By default, validation messages are hidden when the select is valid and\n * visible when the select is invalid.\n *\n * @param isValidation True to make the helper text act as an error validation\n * message.\n */\n MDCSelectHelperTextFoundation.prototype.setValidation = function (isValidation) {\n if (isValidation) {\n this.adapter.addClass(cssClasses.HELPER_TEXT_VALIDATION_MSG);\n }\n else {\n this.adapter.removeClass(cssClasses.HELPER_TEXT_VALIDATION_MSG);\n }\n };\n /**\n * Sets the persistency of the validation helper text.\n * This keeps the validation message visible even if the select is valid,\n * though it will be displayed in the normal (grey) color.\n */\n MDCSelectHelperTextFoundation.prototype.setValidationMsgPersistent = function (isPersistent) {\n if (isPersistent) {\n this.adapter.addClass(cssClasses.HELPER_TEXT_VALIDATION_MSG_PERSISTENT);\n }\n else {\n this.adapter.removeClass(cssClasses.HELPER_TEXT_VALIDATION_MSG_PERSISTENT);\n }\n };\n /**\n * When acting as a validation message, shows/hides the helper text and\n * triggers alerts as necessary based on the select's validity.\n */\n MDCSelectHelperTextFoundation.prototype.setValidity = function (selectIsValid) {\n var isValidationMsg = this.adapter.hasClass(cssClasses.HELPER_TEXT_VALIDATION_MSG);\n if (!isValidationMsg) {\n // Non-validating helper-text is always displayed and does not participate\n // in validation logic.\n return;\n }\n var isPersistentValidationMsg = this.adapter.hasClass(cssClasses.HELPER_TEXT_VALIDATION_MSG_PERSISTENT);\n // Validating helper text is displayed if select is invalid, unless it is\n // set as persistent, in which case it always displays.\n var msgShouldDisplay = !selectIsValid || isPersistentValidationMsg;\n if (msgShouldDisplay) {\n this.showToScreenReader();\n // In addition to displaying, also trigger an alert if the select\n // has become invalid.\n if (!selectIsValid) {\n this.adapter.setAttr(strings.ROLE, 'alert');\n }\n else {\n this.adapter.removeAttr(strings.ROLE);\n }\n return;\n }\n // Hide everything.\n this.adapter.removeAttr(strings.ROLE);\n this.hide();\n };\n /**\n * Makes the helper text visible to screen readers.\n */\n MDCSelectHelperTextFoundation.prototype.showToScreenReader = function () {\n this.adapter.removeAttr(strings.ARIA_HIDDEN);\n };\n /**\n * Hides the help text from screen readers.\n */\n MDCSelectHelperTextFoundation.prototype.hide = function () {\n this.adapter.setAttr(strings.ARIA_HIDDEN, 'true');\n };\n return MDCSelectHelperTextFoundation;\n}(MDCFoundation));\nexport { MDCSelectHelperTextFoundation };\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCSelectHelperTextFoundation;\n//# sourceMappingURL=foundation.js.map","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\nimport { __extends } from \"tslib\";\nimport { MDCComponent } from '@material/base/component';\nimport { MDCSelectHelperTextFoundation } from './foundation';\nvar MDCSelectHelperText = /** @class */ (function (_super) {\n __extends(MDCSelectHelperText, _super);\n function MDCSelectHelperText() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n MDCSelectHelperText.attachTo = function (root) {\n return new MDCSelectHelperText(root);\n };\n Object.defineProperty(MDCSelectHelperText.prototype, \"foundationForSelect\", {\n // Provided for access by MDCSelect component\n get: function () {\n return this.foundation;\n },\n enumerable: false,\n configurable: true\n });\n MDCSelectHelperText.prototype.getDefaultFoundation = function () {\n var _this = this;\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n var adapter = {\n addClass: function (className) { return _this.root.classList.add(className); },\n removeClass: function (className) { return _this.root.classList.remove(className); },\n hasClass: function (className) { return _this.root.classList.contains(className); },\n getAttr: function (attr) { return _this.root.getAttribute(attr); },\n setAttr: function (attr, value) { return _this.root.setAttribute(attr, value); },\n removeAttr: function (attr) { return _this.root.removeAttribute(attr); },\n setContent: function (content) {\n _this.root.textContent = content;\n },\n };\n // tslint:enable:object-literal-sort-keys\n return new MDCSelectHelperTextFoundation(adapter);\n };\n return MDCSelectHelperText;\n}(MDCComponent));\nexport { MDCSelectHelperText };\n//# sourceMappingURL=component.js.map","import { ListItem } from '../list/list-item.types';\nimport { Option } from '../select/option.types';\nimport { FunctionalComponent, h } from '@stencil/core';\nimport { isMultiple } from '../../util/multiple';\nimport { getIconColor, getIconName } from '../icon/get-icon-props';\n\ninterface SelectTemplateProps {\n disabled?: boolean;\n readonly?: boolean;\n required?: boolean;\n invalid?: boolean;\n options: Option[];\n value: Option | Option[];\n label?: string;\n helperText?: string;\n multiple?: boolean;\n native: boolean;\n\n onNativeChange: (event: Event) => void;\n\n id: string;\n onMenuChange: (event: CustomEvent<ListItem | ListItem[]>) => void;\n onTriggerPress: (event: KeyboardEvent) => void;\n isOpen: boolean;\n open: () => void;\n close: () => void;\n checkValid: boolean;\n\n dropdownZIndex: string;\n}\n\nexport const SelectTemplate: FunctionalComponent<SelectTemplateProps> = (\n props,\n) => {\n const value = props.value;\n let hasValue = !!props.value;\n let hasEmptyText = true;\n if (isMultiple(value)) {\n hasValue = value.length > 0;\n } else if (hasValue) {\n hasValue = !!value.value;\n hasEmptyText = value.text === '';\n }\n\n let isValid = !props.invalid;\n if (props.checkValid && props.required && !hasValue) {\n isValid = false;\n }\n\n const classList = {\n 'limel-select': true,\n 'mdc-select': true,\n 'mdc-select--outlined': true,\n 'mdc-select--disabled': props.disabled,\n 'limel-select--readonly': props.readonly,\n 'limel-select--required': props.required,\n 'limel-select--invalid': !isValid,\n 'limel-select--empty': !hasValue,\n 'limel-select--with-helper-text': typeof props.helperText === 'string',\n };\n\n return (\n <div class={classList}>\n <SelectValue\n {...props}\n hasValue={hasValue}\n isValid={isValid}\n hasEmptyText={hasEmptyText}\n />\n <HelperText text={props.helperText} isValid={!props.invalid} />\n <SelectDropdown {...props} />\n </div>\n );\n};\n\nconst SelectValue: FunctionalComponent<\n SelectTemplateProps & {\n hasValue: boolean;\n isValid: boolean;\n hasEmptyText: boolean;\n }\n> = (props) => {\n const anchorClassList = {\n 'mdc-select__anchor': true,\n 'limel-select-trigger': true,\n 'limel-select--focused': props.isOpen,\n };\n const labelClassList = {\n 'mdc-floating-label': true,\n 'mdc-floating-label--float-above':\n !props.hasEmptyText ||\n props.isOpen ||\n props.readonly ||\n props.hasValue,\n 'mdc-floating-label--active': props.isOpen,\n };\n\n return (\n <button\n class={anchorClassList}\n onClick={props.open}\n onKeyPress={props.onTriggerPress}\n aria-haspopup=\"listbox\"\n aria-expanded={props.isOpen}\n aria-controls={props.id}\n aria-labelledby=\"s-label s-selected-text\"\n aria-required={props.required}\n disabled={props.disabled || props.readonly}\n >\n <span id=\"s-label\" class={labelClassList}>\n {props.label}\n </span>\n <span class=\"mdc-select__selected-text-container limel-select__selected-option\">\n {getSelectedIcon(props.value)}\n <span\n id=\"s-selected-text\"\n class=\"mdc-select__selected-text limel-select__selected-option__text\"\n >\n {getSelectedText(props.value, props.readonly)}\n </span>\n </span>\n <ShowIcon {...props} isValid={props.isValid} />\n <span class=\"mdc-select__dropdown-icon\">\n <svg\n class=\"mdc-select__dropdown-icon-graphic\"\n viewBox=\"7 10 10 5\"\n focusable=\"false\"\n >\n <polygon\n stroke=\"none\"\n fill-rule=\"evenodd\"\n points=\"7 10 12 15 17 10\"\n ></polygon>\n </svg>\n </span>\n </button>\n );\n};\n\nconst ShowIcon: FunctionalComponent<\n SelectTemplateProps & {\n isValid: boolean;\n }\n> = (props) => {\n if (props.isValid) {\n return;\n }\n\n return (\n <limel-icon name=\"high_importance\" size=\"medium\" class=\"invalid-icon\" />\n );\n};\n\nconst HelperText: FunctionalComponent<{ text: string; isValid: boolean }> = (\n props,\n) => {\n if (typeof props.text !== 'string') {\n return;\n }\n\n return (\n <limel-helper-line\n helperText={props.text.trim()}\n invalid={!props.isValid}\n />\n );\n};\n\nconst SelectDropdown: FunctionalComponent<SelectTemplateProps> = (props) => {\n if (props.native) {\n return <NativeDropdown {...props} />;\n }\n\n return <MenuDropdown {...props} />;\n};\n\nconst MenuDropdown: FunctionalComponent<SelectTemplateProps> = (props) => {\n const items = createMenuItems(props.options, props.value, props.required);\n\n return (\n <limel-portal\n containerId={props.id}\n visible={props.isOpen}\n inheritParentWidth={true}\n containerStyle={{ 'z-index': props.dropdownZIndex }}\n >\n <limel-menu-surface\n open={props.isOpen}\n onDismiss={props.close}\n style={{\n '--mdc-menu-min-width': '100%',\n 'max-height': 'inherit',\n display: 'flex',\n 'min-width': '100%',\n width: 'fit-content',\n }}\n >\n <limel-list\n items={items}\n type={props.multiple ? 'checkbox' : 'selectable'}\n onChange={props.onMenuChange}\n />\n </limel-menu-surface>\n </limel-portal>\n );\n};\n\nconst NativeDropdown: FunctionalComponent<SelectTemplateProps> = (props) => {\n return (\n <select\n required={props.required}\n aria-disabled={props.disabled}\n aria-required={props.required}\n onChange={props.onNativeChange}\n onFocus={props.open}\n onBlur={props.close}\n class=\"limel-select__native-control\"\n disabled={props.disabled}\n multiple={props.multiple}\n >\n {props.options.map((option) => {\n return (\n <option\n key={option.value}\n value={option.value}\n selected={isSelected(option, props.value)}\n disabled={option.disabled}\n >\n {option.text}\n </option>\n );\n })}\n </select>\n );\n};\n\nfunction isSelected(option: Option, value: Option | Option[]): boolean {\n if (!value) {\n return false;\n }\n\n if (isMultiple(value)) {\n return value.some((o) => option.value === o.value);\n }\n\n return option.value === value.value;\n}\n\nfunction createMenuItems(\n options: Option[],\n value: Option | Option[],\n selectIsRequired = false,\n): Array<ListItem<Option>> {\n const menuOptionFilter = getMenuOptionFilter(selectIsRequired);\n\n return options.filter(menuOptionFilter).map((option) => {\n const selected = isSelected(option, value);\n const { text, disabled } = option;\n const name = getIconName(option.icon);\n const color = getIconColor(option.icon, option.iconColor);\n\n if (!name) {\n return {\n text: text,\n selected: selected,\n disabled: disabled,\n value: option,\n };\n }\n\n return {\n text: text,\n selected: selected,\n disabled: disabled,\n value: option,\n icon: {\n name: name,\n color: color,\n },\n };\n });\n}\n\nfunction getMenuOptionFilter(selectIsRequired: boolean) {\n return (option: Option) => {\n if (!selectIsRequired) {\n // If the select component is NOT required, we keep all options.\n return true;\n }\n\n if (option.text) {\n // If the select component IS required, we keep only options\n // that are not \"empty\". We only check the text property, because\n // some systems use an \"empty option\" that will have a value for\n // the `value` property, to signify \"no option selected\". Such\n // an option should be treated as \"empty\".\n return true;\n }\n };\n}\n\nfunction getSelectedText(value: Option | Option[], readonly: boolean): string {\n if ((!value || (isMultiple(value) && !value.length)) && readonly) {\n return '–';\n }\n\n if (!value) {\n return '';\n }\n\n if (isMultiple(value)) {\n return value.map((option) => option.text).join(', ');\n }\n\n return value.text;\n}\n\nfunction getSelectedIcon(value: any) {\n if (!value || !value.icon) {\n return '';\n }\n\n const name = getIconName(value.icon);\n const color = getIconColor(value.icon, value.iconColor);\n const style: any = {};\n if (color) {\n style.color = color;\n }\n\n return (\n <limel-icon\n class=\"limel-select__selected-option__icon\"\n name={name}\n size=\"medium\"\n style={style}\n />\n );\n}\n\nexport function triggerIconColorWarning(options: Option[]) {\n options.forEach((option) => {\n if (option.iconColor) {\n /* eslint-disable-next-line no-console */\n console.warn(\n \"The `iconColor` prop is deprecated now! Use the new `Icon` interface and instead of `iconColor: 'color-name'` write `icon {name: 'icon-name', color: 'color-name'}`.\",\n );\n }\n });\n}\n","@use '../../style/functions';\n@use '../../style/internal/shared_input-select-picker';\n@use '../../style/mixins';\n\n@use '@material/select/styles';\n@use '@material/floating-label';\n@use '@material/floating-label/mdc-floating-label';\n\n// Note! The `--dropdown-z-index` property is used from `select.tsx`.\n/**\n * @prop --dropdown-z-index: z-index of the dropdown menu.\n */\n\n:host {\n display: block;\n position: relative;\n}\n\n:host([hidden]) {\n display: none;\n}\n\n.mdc-select--outlined .mdc-floating-label {\n left: functions.pxToRem(16);\n}\n\n.mdc-select__anchor,\n.mdc-floating-label,\n.mdc-select__selected-text {\n // As long as this component is depended on MDC,\n // we need to force it to be font-agnostic.\n // When MDC-dependency is removed, this block can also be removed.\n // However, on removal of MDC-dependency, we should also make sure to check\n // other font-related styles that might be set by MDC,\n // such as `letter-spacing` or `font-size`.\n font-family: inherit;\n}\n\n.mdc-select__dropdown-icon-graphic {\n transition: transform 0.2s ease;\n}\n\n.limel-select__selected-option {\n display: flex;\n align-items: center;\n\n box-sizing: border-box;\n outline: none;\n\n align-self: center;\n min-width: 0; // makes it truncate and prevents the select to grow wider than its container\n padding: 0 0.25rem 0 1rem;\n}\n\n.limel-select__selected-option__icon {\n margin-right: functions.pxToRem(8);\n margin-left: functions.pxToRem(-8);\n flex-shrink: 0;\n}\n\n.limel-select__selected-option__text {\n .mdc-select:not(.mdc-select--disabled) & {\n @include shared_input-select-picker.looks-like-input-label;\n }\n @include mixins.truncate-text;\n}\n\n.limel-select {\n flex-wrap: wrap;\n width: 100%;\n\n &:not(.limel-select--readonly) {\n .limel-select-trigger {\n background-color: shared_input-select-picker.$background-color-focused;\n }\n }\n\n .mdc-select__anchor {\n height: functions.pxToRem(36);\n padding-left: functions.pxToRem(0);\n }\n .limel-select-trigger {\n border: none;\n height: shared_input-select-picker.$height-of-mdc-text-field;\n display: inline-flex;\n align-items: center;\n\n border-radius: functions.pxToRem(5);\n\n .mdc-floating-label {\n color: shared_input-select-picker.$label-color;\n width: calc(\n 100% - #{functions.pxToRem(16)}\n ); //This forces the label to truncate when container is too little.\n &.mdc-floating-label--float-above {\n font-size: shared_input-select-picker.$cropped-label-hack--font-size;\n transform: translateY(functions.pxToRem(-27)) scale(0.75);\n }\n }\n }\n\n .limel-select-trigger,\n .limel-select__selected-option {\n width: 100%;\n }\n\n .mdc-select__dropdown-icon {\n margin-right: 0.25rem;\n margin-left: 0.25rem;\n }\n\n &.mdc-select--disabled {\n .limel-select-trigger {\n @include shared_input-select-picker.looks-disabled;\n box-shadow: var(--button-shadow-normal);\n }\n .mdc-select__dropdown-icon {\n svg {\n fill: rgb(var(--contrast-800));\n }\n }\n }\n\n &:not(.mdc-select--disabled) {\n .mdc-select__dropdown-icon {\n svg {\n fill: rgb(var(--contrast-1000));\n }\n }\n\n .limel-select-trigger {\n @include mixins.is-elevated-clickable;\n @include mixins.visualize-keyboard-focus;\n\n &.limel-select--focused {\n background-color: shared_input-select-picker.$background-color-focused;\n\n .mdc-floating-label {\n color: var(--mdc-theme-primary);\n }\n\n .mdc-select__dropdown-icon {\n svg {\n fill: var(--mdc-theme-primary);\n }\n }\n\n .mdc-select__dropdown-icon-graphic {\n transform: rotate(-180deg);\n }\n }\n\n &[aria-expanded]:not([aria-expanded='false']),\n &[aria-expanded='true'] {\n box-shadow: var(--button-shadow-inset-pressed);\n }\n }\n }\n\n &.limel-select--required {\n .mdc-floating-label::after {\n content: '*';\n }\n }\n\n &.limel-select--invalid {\n .limel-select__selected-option__text,\n .invalid-icon {\n color: var(--lime-error-text-color);\n }\n .mdc-floating-label:not(.mdc-floating-label--float-above) {\n max-width: calc(\n 100% - #{functions.pxToRem(64)}\n ); // leaves space for the invalid-icon\n }\n }\n}\n\n.invalid-icon {\n flex-shrink: 0;\n}\n\nselect.limel-select__native-control {\n position: absolute;\n top: 0;\n left: 0;\n\n width: 100%;\n height: 100%;\n opacity: 0;\n border: 0;\n}\n\n@import './partial-styles/_readonly';\n@import './partial-styles/_helper-text';\n","import { ListItem } from '../list/list-item.types';\nimport { Option } from '../select/option.types';\nimport { MDCFloatingLabel } from '@material/floating-label';\nimport { MDCSelectHelperText } from '@material/select/helper-text';\nimport {\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Prop,\n State,\n Watch,\n} from '@stencil/core';\nimport { isMobileDevice } from '../../util/device';\nimport {\n ENTER,\n ENTER_KEY_CODE,\n SPACE,\n SPACE_KEY_CODE,\n} from '../../util/keycodes';\nimport { isMultiple } from '../../util/multiple';\nimport { createRandomString } from '../../util/random-string';\nimport { SelectTemplate, triggerIconColorWarning } from './select.template';\n\n/**\n * @exampleComponent limel-example-select\n * @exampleComponent limel-example-select-with-icons\n * @exampleComponent limel-example-select-multiple\n * @exampleComponent limel-example-select-with-empty-option\n * @exampleComponent limel-example-select-preselected\n * @exampleComponent limel-example-select-change-options\n * @exampleComponent limel-example-select-dialog\n */\n@Component({\n tag: 'limel-select',\n shadow: true,\n styleUrl: 'select.scss',\n})\nexport class Select {\n /**\n * Set to `true` to make the field disabled.\n * and visually shows that the `select` component is editable but disabled.\n * This tells the users that if certain requirements are met,\n * the component may become interactable.\n */\n @Prop({ reflect: true })\n public disabled = false;\n\n /**\n * Set to `true` to make the field read-only.\n * This visualizes the component slightly differently.\n * But shows no visual sign indicating that the component is disabled\n * or can ever become interactable.\n */\n @Prop({ reflect: true })\n public readonly = false;\n\n /**\n * Set to `true` to indicate that the current value of the select is\n * invalid.\n */\n @Prop({ reflect: true })\n public invalid: boolean;\n\n /**\n * True if the control requires a value.\n */\n @Prop({ reflect: true })\n public required = false;\n\n /**\n * Text to display next to the select.\n */\n @Prop({ reflect: true })\n public label: string;\n\n /**\n * Optional helper text to display below the input field when it has focus.\n */\n @Prop({ reflect: true })\n public helperText: string;\n\n /**\n * Currently selected value or values.\n * If `multiple` is `true`, this must be an array. Otherwise it must be a\n * single value.\n */\n @Prop()\n public value: Option | Option[];\n\n /**\n * List of options.\n */\n @Prop()\n public options: Option[] = [];\n\n /**\n * Set to `true` to allow multiple values to be selected.\n */\n @Prop()\n public multiple: boolean = false;\n\n /**\n * Emitted when the value is changed.\n */\n @Event()\n private change: EventEmitter<Option | Option[]>;\n\n @Element()\n private host: HTMLLimelSelectElement;\n\n @State()\n private menuOpen: boolean = false;\n\n private hasChanged: boolean = false;\n private checkValid: boolean = false;\n private mdcSelectHelperText: MDCSelectHelperText;\n private mdcFloatingLabel: MDCFloatingLabel;\n private isMobileDevice: boolean;\n private portalId: string;\n\n constructor() {\n this.handleMenuChange = this.handleMenuChange.bind(this);\n this.handleNativeChange = this.handleNativeChange.bind(this);\n this.handleMenuTriggerKeyPress =\n this.handleMenuTriggerKeyPress.bind(this);\n this.openMenu = this.openMenu.bind(this);\n this.closeMenu = this.closeMenu.bind(this);\n\n this.portalId = createRandomString();\n }\n\n public connectedCallback() {\n this.initialize();\n }\n\n public componentWillLoad() {\n this.isMobileDevice = isMobileDevice();\n\n // It should not be possible to render the native select for consumers, but we still want to make it testable.\n // We can set this attribute in tests to force rendering of the native select\n if (this.host.hasAttribute('data-native')) {\n this.isMobileDevice = true;\n }\n }\n\n public componentDidLoad() {\n this.initialize();\n triggerIconColorWarning(this.options);\n }\n\n private initialize() {\n let element: HTMLElement;\n element = this.host.shadowRoot.querySelector('.mdc-floating-label');\n if (!element) {\n return;\n }\n\n this.mdcFloatingLabel = new MDCFloatingLabel(element);\n\n element = this.host.shadowRoot.querySelector('.mdc-select-helper-text');\n if (element) {\n this.mdcSelectHelperText = new MDCSelectHelperText(element);\n }\n }\n\n public disconnectedCallback() {\n if (this.mdcFloatingLabel) {\n this.mdcFloatingLabel.destroy();\n }\n\n if (this.mdcSelectHelperText) {\n this.mdcSelectHelperText.destroy();\n }\n }\n\n public componentDidUpdate() {\n if (this.menuOpen) {\n this.setMenuFocus();\n }\n }\n\n public render() {\n const dropdownZIndex = getComputedStyle(this.host).getPropertyValue(\n '--dropdown-z-index',\n );\n\n return (\n <SelectTemplate\n id={this.portalId}\n disabled={this.disabled || this.readonly}\n readonly={this.readonly}\n required={this.required}\n invalid={this.invalid}\n label={this.label}\n helperText={this.helperText}\n value={this.value}\n options={this.options}\n onMenuChange={this.handleMenuChange}\n onNativeChange={this.handleNativeChange}\n onTriggerPress={this.handleMenuTriggerKeyPress}\n multiple={this.multiple}\n isOpen={this.menuOpen}\n open={this.openMenu}\n close={this.closeMenu}\n checkValid={this.checkValid}\n native={this.isMobileDevice}\n dropdownZIndex={dropdownZIndex}\n />\n );\n }\n\n @Watch('menuOpen')\n protected watchOpen(newValue: boolean, oldValue: boolean) {\n if (this.checkValid) {\n return;\n }\n\n // Menu was closed for the first time\n if (!newValue && oldValue) {\n this.checkValid = true;\n }\n }\n\n private setMenuFocus() {\n if (this.isMobileDevice) {\n return;\n }\n\n setTimeout(() => {\n const list: HTMLElement = document.querySelector(\n `#${this.portalId} limel-menu-surface limel-list`,\n );\n const firstItem: HTMLElement =\n list?.shadowRoot?.querySelector('[tabindex]');\n\n if (firstItem) {\n firstItem.focus();\n }\n });\n }\n\n private setTriggerFocus() {\n const trigger: HTMLElement = this.host.shadowRoot.querySelector(\n '.limel-select-trigger',\n );\n trigger.focus();\n }\n\n private handleMenuChange(\n event: CustomEvent<Array<ListItem<Option>> | ListItem<Option>>,\n ) {\n event.stopPropagation();\n\n if (isMultiple(event.detail)) {\n const listItems: ListItem[] = event.detail;\n const options: Option[] = listItems.map((item) => item.value);\n this.change.emit(options);\n\n return;\n }\n\n if (!event.detail.selected) {\n return;\n }\n\n const listItem: ListItem = event.detail;\n const option: Option = listItem.value;\n if (option.disabled) {\n return;\n }\n\n this.change.emit(option);\n this.menuOpen = false;\n this.setTriggerFocus();\n }\n\n private openMenu() {\n if (this.emitFirstChangeEvent()) {\n this.hasChanged = true;\n this.change.emit(this.options[0]);\n }\n\n this.menuOpen = true;\n }\n\n private emitFirstChangeEvent() {\n return !this.hasChanged && this.isMobileDevice && !this.value;\n }\n\n private closeMenu() {\n this.menuOpen = false;\n this.setTriggerFocus();\n }\n\n private handleMenuTriggerKeyPress(event: KeyboardEvent) {\n const isEnter = event.key === ENTER || event.keyCode === ENTER_KEY_CODE;\n const isSpace = event.key === SPACE || event.keyCode === SPACE_KEY_CODE;\n\n if (!this.menuOpen && (isSpace || isEnter)) {\n event.stopPropagation();\n event.preventDefault();\n this.menuOpen = true;\n }\n }\n\n private handleNativeChange(event: Event) {\n event.stopPropagation();\n\n const element: HTMLSelectElement = this.host.shadowRoot.querySelector(\n 'select.limel-select__native-control',\n );\n const options = Array.apply(null, element.options) // eslint-disable-line prefer-spread\n .filter((optionElement: HTMLOptionElement) => {\n return !!optionElement.selected;\n })\n .map((optionElement: HTMLOptionElement) => {\n return this.options.find(\n (o) => o.value === optionElement.value,\n );\n });\n\n if (this.multiple) {\n this.change.emit(options);\n\n return;\n }\n\n this.change.emit(options[0]);\n this.menuOpen = false;\n }\n}\n"],"version":3}
1
+ {"file":"limel-select.entry.cjs.js","mappings":";;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAC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AAQ,KAAK,OAAO,IAAI,OAAO,CAAC,EAAE;MACxC,KAAK,CAAC,eAAe,EAAE,CAAC;MACxB,KAAK,CAAC,cAAc,EAAE,CAAC;MACvB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;KACxB;GACJ;EAEO,kBAAkB,CAAC,KAAY;IACnC,KAAK,CAAC,eAAe,EAAE,CAAC;IAExB,MAAM,OAAO,GAAsB,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,CACjE,qCAAqC,CACxC,CAAC;IACF,MAAM,OAAO,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC;OAC7C,MAAM,CAAC,CAAC,aAAgC;MACrC,OAAO,CAAC,CAAC,aAAa,CAAC,QAAQ,CAAC;KACnC,CAAC;OACD,GAAG,CAAC,CAAC,aAAgC;MAClC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CACpB,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,KAAK,aAAa,CAAC,KAAK,CACzC,CAAC;KACL,CAAC,CAAC;IAEP,IAAI,IAAI,CAAC,QAAQ,EAAE;MACf,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;MAE1B,OAAO;KACV;IAED,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7B,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;GACzB;;;;;;;;;;","names":["__extends","__assign","MDCFoundation","MDCComponent","isMultiple","h","getIconName","getIconColor","createRandomString","isMobileDevice","MDCFloatingLabel","ENTER","ENTER_KEY_CODE","SPACE","SPACE_KEY_CODE"],"sources":["./node_modules/@material/select/helper-text/constants.js","./node_modules/@material/select/helper-text/foundation.js","./node_modules/@material/select/helper-text/component.js","./src/components/select/select.template.tsx","./src/components/select/select.scss?tag=limel-select&encapsulation=shadow","./src/components/select/select.tsx"],"sourcesContent":["/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\nvar strings = {\n ARIA_HIDDEN: 'aria-hidden',\n ROLE: 'role',\n};\nvar cssClasses = {\n HELPER_TEXT_VALIDATION_MSG: 'mdc-select-helper-text--validation-msg',\n HELPER_TEXT_VALIDATION_MSG_PERSISTENT: 'mdc-select-helper-text--validation-msg-persistent',\n};\nexport { strings, cssClasses };\n//# sourceMappingURL=constants.js.map","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\nimport { __assign, __extends } from \"tslib\";\nimport { MDCFoundation } from '@material/base/foundation';\nimport { cssClasses, strings } from './constants';\nvar MDCSelectHelperTextFoundation = /** @class */ (function (_super) {\n __extends(MDCSelectHelperTextFoundation, _super);\n function MDCSelectHelperTextFoundation(adapter) {\n return _super.call(this, __assign(__assign({}, MDCSelectHelperTextFoundation.defaultAdapter), adapter)) || this;\n }\n Object.defineProperty(MDCSelectHelperTextFoundation, \"cssClasses\", {\n get: function () {\n return cssClasses;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MDCSelectHelperTextFoundation, \"strings\", {\n get: function () {\n return strings;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MDCSelectHelperTextFoundation, \"defaultAdapter\", {\n /**\n * See {@link MDCSelectHelperTextAdapter} for typing information on parameters and return types.\n */\n get: function () {\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n return {\n addClass: function () { return undefined; },\n removeClass: function () { return undefined; },\n hasClass: function () { return false; },\n setAttr: function () { return undefined; },\n getAttr: function () { return null; },\n removeAttr: function () { return undefined; },\n setContent: function () { return undefined; },\n };\n // tslint:enable:object-literal-sort-keys\n },\n enumerable: false,\n configurable: true\n });\n /**\n * @return The ID of the helper text, or null if none is set.\n */\n MDCSelectHelperTextFoundation.prototype.getId = function () {\n return this.adapter.getAttr('id');\n };\n /**\n * @return Whether the helper text is currently visible.\n */\n MDCSelectHelperTextFoundation.prototype.isVisible = function () {\n return this.adapter.getAttr(strings.ARIA_HIDDEN) !== 'true';\n };\n /**\n * Sets the content of the helper text field.\n */\n MDCSelectHelperTextFoundation.prototype.setContent = function (content) {\n this.adapter.setContent(content);\n };\n /**\n * Sets the helper text to act as a validation message.\n * By default, validation messages are hidden when the select is valid and\n * visible when the select is invalid.\n *\n * @param isValidation True to make the helper text act as an error validation\n * message.\n */\n MDCSelectHelperTextFoundation.prototype.setValidation = function (isValidation) {\n if (isValidation) {\n this.adapter.addClass(cssClasses.HELPER_TEXT_VALIDATION_MSG);\n }\n else {\n this.adapter.removeClass(cssClasses.HELPER_TEXT_VALIDATION_MSG);\n }\n };\n /**\n * Sets the persistency of the validation helper text.\n * This keeps the validation message visible even if the select is valid,\n * though it will be displayed in the normal (grey) color.\n */\n MDCSelectHelperTextFoundation.prototype.setValidationMsgPersistent = function (isPersistent) {\n if (isPersistent) {\n this.adapter.addClass(cssClasses.HELPER_TEXT_VALIDATION_MSG_PERSISTENT);\n }\n else {\n this.adapter.removeClass(cssClasses.HELPER_TEXT_VALIDATION_MSG_PERSISTENT);\n }\n };\n /**\n * When acting as a validation message, shows/hides the helper text and\n * triggers alerts as necessary based on the select's validity.\n */\n MDCSelectHelperTextFoundation.prototype.setValidity = function (selectIsValid) {\n var isValidationMsg = this.adapter.hasClass(cssClasses.HELPER_TEXT_VALIDATION_MSG);\n if (!isValidationMsg) {\n // Non-validating helper-text is always displayed and does not participate\n // in validation logic.\n return;\n }\n var isPersistentValidationMsg = this.adapter.hasClass(cssClasses.HELPER_TEXT_VALIDATION_MSG_PERSISTENT);\n // Validating helper text is displayed if select is invalid, unless it is\n // set as persistent, in which case it always displays.\n var msgShouldDisplay = !selectIsValid || isPersistentValidationMsg;\n if (msgShouldDisplay) {\n this.showToScreenReader();\n // In addition to displaying, also trigger an alert if the select\n // has become invalid.\n if (!selectIsValid) {\n this.adapter.setAttr(strings.ROLE, 'alert');\n }\n else {\n this.adapter.removeAttr(strings.ROLE);\n }\n return;\n }\n // Hide everything.\n this.adapter.removeAttr(strings.ROLE);\n this.hide();\n };\n /**\n * Makes the helper text visible to screen readers.\n */\n MDCSelectHelperTextFoundation.prototype.showToScreenReader = function () {\n this.adapter.removeAttr(strings.ARIA_HIDDEN);\n };\n /**\n * Hides the help text from screen readers.\n */\n MDCSelectHelperTextFoundation.prototype.hide = function () {\n this.adapter.setAttr(strings.ARIA_HIDDEN, 'true');\n };\n return MDCSelectHelperTextFoundation;\n}(MDCFoundation));\nexport { MDCSelectHelperTextFoundation };\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCSelectHelperTextFoundation;\n//# sourceMappingURL=foundation.js.map","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\nimport { __extends } from \"tslib\";\nimport { MDCComponent } from '@material/base/component';\nimport { MDCSelectHelperTextFoundation } from './foundation';\nvar MDCSelectHelperText = /** @class */ (function (_super) {\n __extends(MDCSelectHelperText, _super);\n function MDCSelectHelperText() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n MDCSelectHelperText.attachTo = function (root) {\n return new MDCSelectHelperText(root);\n };\n Object.defineProperty(MDCSelectHelperText.prototype, \"foundationForSelect\", {\n // Provided for access by MDCSelect component\n get: function () {\n return this.foundation;\n },\n enumerable: false,\n configurable: true\n });\n MDCSelectHelperText.prototype.getDefaultFoundation = function () {\n var _this = this;\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n var adapter = {\n addClass: function (className) { return _this.root.classList.add(className); },\n removeClass: function (className) { return _this.root.classList.remove(className); },\n hasClass: function (className) { return _this.root.classList.contains(className); },\n getAttr: function (attr) { return _this.root.getAttribute(attr); },\n setAttr: function (attr, value) { return _this.root.setAttribute(attr, value); },\n removeAttr: function (attr) { return _this.root.removeAttribute(attr); },\n setContent: function (content) {\n _this.root.textContent = content;\n },\n };\n // tslint:enable:object-literal-sort-keys\n return new MDCSelectHelperTextFoundation(adapter);\n };\n return MDCSelectHelperText;\n}(MDCComponent));\nexport { MDCSelectHelperText };\n//# sourceMappingURL=component.js.map","import { ListItem } from '../list/list-item.types';\nimport { Option } from '../select/option.types';\nimport { FunctionalComponent, h } from '@stencil/core';\nimport { isMultiple } from '../../util/multiple';\nimport { getIconColor, getIconName } from '../icon/get-icon-props';\n\ninterface SelectTemplateProps {\n disabled?: boolean;\n readonly?: boolean;\n required?: boolean;\n invalid?: boolean;\n options: Option[];\n value: Option | Option[];\n label?: string;\n helperText?: string;\n multiple?: boolean;\n native: boolean;\n\n onNativeChange: (event: Event) => void;\n\n id: string;\n onMenuChange: (event: CustomEvent<ListItem | ListItem[]>) => void;\n onTriggerPress: (event: KeyboardEvent) => void;\n isOpen: boolean;\n open: () => void;\n close: () => void;\n checkValid: boolean;\n\n dropdownZIndex: string;\n}\n\nexport const SelectTemplate: FunctionalComponent<SelectTemplateProps> = (\n props,\n) => {\n const value = props.value;\n let hasValue = !!props.value;\n let hasEmptyText = true;\n if (isMultiple(value)) {\n hasValue = value.length > 0;\n } else if (hasValue) {\n hasValue = !!value.value;\n hasEmptyText = value.text === '';\n }\n\n let isValid = !props.invalid;\n if (props.checkValid && props.required && !hasValue) {\n isValid = false;\n }\n\n const classList = {\n 'limel-select': true,\n 'mdc-select': true,\n 'mdc-select--outlined': true,\n 'mdc-select--disabled': props.disabled,\n 'limel-select--readonly': props.readonly,\n 'limel-select--required': props.required,\n 'limel-select--invalid': !isValid,\n 'limel-select--empty': !hasValue,\n 'limel-select--with-helper-text': typeof props.helperText === 'string',\n };\n\n return (\n <div class={classList}>\n <SelectValue\n {...props}\n hasValue={hasValue}\n isValid={isValid}\n hasEmptyText={hasEmptyText}\n />\n <HelperText text={props.helperText} isValid={!props.invalid} />\n <SelectDropdown {...props} />\n </div>\n );\n};\n\nconst SelectValue: FunctionalComponent<\n SelectTemplateProps & {\n hasValue: boolean;\n isValid: boolean;\n hasEmptyText: boolean;\n }\n> = (props) => {\n const anchorClassList = {\n 'mdc-select__anchor': true,\n 'limel-select-trigger': true,\n 'limel-select--focused': props.isOpen,\n };\n const labelClassList = {\n 'mdc-floating-label': true,\n 'mdc-floating-label--float-above':\n !props.hasEmptyText ||\n props.isOpen ||\n props.readonly ||\n props.hasValue,\n 'mdc-floating-label--active': props.isOpen,\n };\n\n return (\n <button\n class={anchorClassList}\n onClick={props.open}\n onKeyPress={props.onTriggerPress}\n aria-haspopup=\"listbox\"\n aria-expanded={props.isOpen}\n aria-controls={props.id}\n aria-labelledby=\"s-label s-selected-text\"\n aria-required={props.required}\n disabled={props.disabled || props.readonly}\n >\n <span id=\"s-label\" class={labelClassList}>\n {props.label}\n </span>\n <span class=\"mdc-select__selected-text-container limel-select__selected-option\">\n {getSelectedIcon(props.value)}\n <span\n id=\"s-selected-text\"\n class=\"mdc-select__selected-text limel-select__selected-option__text\"\n >\n {getSelectedText(props.value, props.readonly)}\n </span>\n </span>\n <ShowIcon {...props} isValid={props.isValid} />\n <span class=\"mdc-select__dropdown-icon\">\n <svg\n class=\"mdc-select__dropdown-icon-graphic\"\n viewBox=\"7 10 10 5\"\n focusable=\"false\"\n >\n <polygon\n stroke=\"none\"\n fill-rule=\"evenodd\"\n points=\"7 10 12 15 17 10\"\n ></polygon>\n </svg>\n </span>\n </button>\n );\n};\n\nconst ShowIcon: FunctionalComponent<\n SelectTemplateProps & {\n isValid: boolean;\n }\n> = (props) => {\n if (props.isValid) {\n return;\n }\n\n return (\n <limel-icon name=\"high_importance\" size=\"medium\" class=\"invalid-icon\" />\n );\n};\n\nconst HelperText: FunctionalComponent<{ text: string; isValid: boolean }> = (\n props,\n) => {\n if (typeof props.text !== 'string') {\n return;\n }\n\n return (\n <limel-helper-line\n helperText={props.text.trim()}\n invalid={!props.isValid}\n />\n );\n};\n\nconst SelectDropdown: FunctionalComponent<SelectTemplateProps> = (props) => {\n if (props.native) {\n return <NativeDropdown {...props} />;\n }\n\n return <MenuDropdown {...props} />;\n};\n\nconst MenuDropdown: FunctionalComponent<SelectTemplateProps> = (props) => {\n const items = createMenuItems(props.options, props.value, props.required);\n\n return (\n <limel-portal\n containerId={props.id}\n visible={props.isOpen}\n inheritParentWidth={true}\n containerStyle={{ 'z-index': props.dropdownZIndex }}\n >\n <limel-menu-surface\n open={props.isOpen}\n onDismiss={props.close}\n style={{\n '--mdc-menu-min-width': '100%',\n 'max-height': 'inherit',\n display: 'flex',\n 'min-width': '100%',\n width: 'fit-content',\n }}\n >\n <limel-list\n items={items}\n type={props.multiple ? 'checkbox' : 'selectable'}\n onChange={props.onMenuChange}\n />\n </limel-menu-surface>\n </limel-portal>\n );\n};\n\nconst NativeDropdown: FunctionalComponent<SelectTemplateProps> = (props) => {\n return (\n <select\n required={props.required}\n aria-disabled={props.disabled}\n aria-required={props.required}\n onChange={props.onNativeChange}\n onFocus={props.open}\n onBlur={props.close}\n class=\"limel-select__native-control\"\n disabled={props.disabled}\n multiple={props.multiple}\n >\n {props.options.map((option) => {\n return (\n <option\n key={option.value}\n value={option.value}\n selected={isSelected(option, props.value)}\n disabled={option.disabled}\n >\n {option.text}\n </option>\n );\n })}\n </select>\n );\n};\n\nfunction isSelected(option: Option, value: Option | Option[]): boolean {\n if (!value) {\n return false;\n }\n\n if (isMultiple(value)) {\n return value.some((o) => option.value === o.value);\n }\n\n return option.value === value.value;\n}\n\nfunction createMenuItems(\n options: Option[],\n value: Option | Option[],\n selectIsRequired = false,\n): Array<ListItem<Option>> {\n const menuOptionFilter = getMenuOptionFilter(selectIsRequired);\n\n return options.filter(menuOptionFilter).map((option) => {\n const selected = isSelected(option, value);\n const { text, secondaryText, disabled } = option;\n const name = getIconName(option.icon);\n const color = getIconColor(option.icon, option.iconColor);\n\n if (!name) {\n return {\n text: text,\n secondaryText: secondaryText,\n selected: selected,\n disabled: disabled,\n value: option,\n };\n }\n\n return {\n text: text,\n secondaryText: secondaryText,\n selected: selected,\n disabled: disabled,\n value: option,\n icon: {\n name: name,\n color: color,\n },\n };\n });\n}\n\nfunction getMenuOptionFilter(selectIsRequired: boolean) {\n return (option: Option) => {\n if (!selectIsRequired) {\n // If the select component is NOT required, we keep all options.\n return true;\n }\n\n if (option.text) {\n // If the select component IS required, we keep only options\n // that are not \"empty\". We only check the text property, because\n // some systems use an \"empty option\" that will have a value for\n // the `value` property, to signify \"no option selected\". Such\n // an option should be treated as \"empty\".\n return true;\n }\n };\n}\n\nfunction getSelectedText(value: Option | Option[], readonly: boolean): string {\n if ((!value || (isMultiple(value) && !value.length)) && readonly) {\n return '–';\n }\n\n if (!value) {\n return '';\n }\n\n if (isMultiple(value)) {\n return value.map((option) => option.text).join(', ');\n }\n\n return value.text;\n}\n\nfunction getSelectedIcon(value: any) {\n if (!value || !value.icon) {\n return '';\n }\n\n const name = getIconName(value.icon);\n const color = getIconColor(value.icon, value.iconColor);\n const style: any = {};\n if (color) {\n style.color = color;\n }\n\n return (\n <limel-icon\n class=\"limel-select__selected-option__icon\"\n name={name}\n size=\"medium\"\n style={style}\n />\n );\n}\n\nexport function triggerIconColorWarning(options: Option[]) {\n options.forEach((option) => {\n if (option.iconColor) {\n /* eslint-disable-next-line no-console */\n console.warn(\n \"The `iconColor` prop is deprecated now! Use the new `Icon` interface and instead of `iconColor: 'color-name'` write `icon {name: 'icon-name', color: 'color-name'}`.\",\n );\n }\n });\n}\n","@use '../../style/functions';\n@use '../../style/internal/shared_input-select-picker';\n@use '../../style/mixins';\n\n@use '@material/select/styles';\n@use '@material/floating-label';\n@use '@material/floating-label/mdc-floating-label';\n\n// Note! The `--dropdown-z-index` property is used from `select.tsx`.\n/**\n * @prop --dropdown-z-index: z-index of the dropdown menu.\n */\n\n:host {\n display: block;\n position: relative;\n}\n\n:host([hidden]) {\n display: none;\n}\n\n.mdc-select--outlined .mdc-floating-label {\n left: functions.pxToRem(16);\n}\n\n.mdc-select__anchor,\n.mdc-floating-label,\n.mdc-select__selected-text {\n // As long as this component is depended on MDC,\n // we need to force it to be font-agnostic.\n // When MDC-dependency is removed, this block can also be removed.\n // However, on removal of MDC-dependency, we should also make sure to check\n // other font-related styles that might be set by MDC,\n // such as `letter-spacing` or `font-size`.\n font-family: inherit;\n}\n\n.mdc-select__dropdown-icon-graphic {\n transition: transform 0.2s ease;\n}\n\n.limel-select__selected-option {\n display: flex;\n align-items: center;\n\n box-sizing: border-box;\n outline: none;\n\n align-self: center;\n min-width: 0; // makes it truncate and prevents the select to grow wider than its container\n padding: 0 0.25rem 0 1rem;\n}\n\n.limel-select__selected-option__icon {\n margin-right: functions.pxToRem(8);\n margin-left: functions.pxToRem(-8);\n flex-shrink: 0;\n}\n\n.limel-select__selected-option__text {\n .mdc-select:not(.mdc-select--disabled) & {\n @include shared_input-select-picker.looks-like-input-label;\n }\n @include mixins.truncate-text;\n}\n\n.limel-select {\n flex-wrap: wrap;\n width: 100%;\n\n &:not(.limel-select--readonly) {\n .limel-select-trigger {\n background-color: shared_input-select-picker.$background-color-focused;\n }\n }\n\n .mdc-select__anchor {\n height: functions.pxToRem(36);\n padding-left: functions.pxToRem(0);\n }\n .limel-select-trigger {\n border: none;\n height: shared_input-select-picker.$height-of-mdc-text-field;\n display: inline-flex;\n align-items: center;\n\n border-radius: functions.pxToRem(5);\n\n .mdc-floating-label {\n color: shared_input-select-picker.$label-color;\n width: calc(\n 100% - #{functions.pxToRem(16)}\n ); //This forces the label to truncate when container is too little.\n &.mdc-floating-label--float-above {\n font-size: shared_input-select-picker.$cropped-label-hack--font-size;\n transform: translateY(functions.pxToRem(-27)) scale(0.75);\n }\n }\n }\n\n .limel-select-trigger,\n .limel-select__selected-option {\n width: 100%;\n }\n\n .mdc-select__dropdown-icon {\n margin-right: 0.25rem;\n margin-left: 0.25rem;\n }\n\n &.mdc-select--disabled {\n .limel-select-trigger {\n @include shared_input-select-picker.looks-disabled;\n box-shadow: var(--button-shadow-normal);\n }\n .mdc-select__dropdown-icon {\n svg {\n fill: rgb(var(--contrast-800));\n }\n }\n }\n\n &:not(.mdc-select--disabled) {\n .mdc-select__dropdown-icon {\n svg {\n fill: rgb(var(--contrast-1000));\n }\n }\n\n .limel-select-trigger {\n @include mixins.is-elevated-clickable;\n @include mixins.visualize-keyboard-focus;\n\n &.limel-select--focused {\n background-color: shared_input-select-picker.$background-color-focused;\n\n .mdc-floating-label {\n color: var(--mdc-theme-primary);\n }\n\n .mdc-select__dropdown-icon {\n svg {\n fill: var(--mdc-theme-primary);\n }\n }\n\n .mdc-select__dropdown-icon-graphic {\n transform: rotate(-180deg);\n }\n }\n\n &[aria-expanded]:not([aria-expanded='false']),\n &[aria-expanded='true'] {\n box-shadow: var(--button-shadow-inset-pressed);\n }\n }\n }\n\n &.limel-select--required {\n .mdc-floating-label::after {\n content: '*';\n }\n }\n\n &.limel-select--invalid {\n .limel-select__selected-option__text,\n .invalid-icon {\n color: var(--lime-error-text-color);\n }\n .mdc-floating-label:not(.mdc-floating-label--float-above) {\n max-width: calc(\n 100% - #{functions.pxToRem(64)}\n ); // leaves space for the invalid-icon\n }\n }\n}\n\n.invalid-icon {\n flex-shrink: 0;\n}\n\nselect.limel-select__native-control {\n position: absolute;\n top: 0;\n left: 0;\n\n width: 100%;\n height: 100%;\n opacity: 0;\n border: 0;\n}\n\n@import './partial-styles/_readonly';\n@import './partial-styles/_helper-text';\n","import { ListItem } from '../list/list-item.types';\nimport { Option } from '../select/option.types';\nimport { MDCFloatingLabel } from '@material/floating-label';\nimport { MDCSelectHelperText } from '@material/select/helper-text';\nimport {\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Prop,\n State,\n Watch,\n} from '@stencil/core';\nimport { isMobileDevice } from '../../util/device';\nimport {\n ENTER,\n ENTER_KEY_CODE,\n SPACE,\n SPACE_KEY_CODE,\n} from '../../util/keycodes';\nimport { isMultiple } from '../../util/multiple';\nimport { createRandomString } from '../../util/random-string';\nimport { SelectTemplate, triggerIconColorWarning } from './select.template';\n\n/**\n * @exampleComponent limel-example-select\n * @exampleComponent limel-example-select-with-icons\n * @exampleComponent limel-example-select-with-secondary-text\n * @exampleComponent limel-example-select-multiple\n * @exampleComponent limel-example-select-with-empty-option\n * @exampleComponent limel-example-select-preselected\n * @exampleComponent limel-example-select-change-options\n * @exampleComponent limel-example-select-dialog\n */\n@Component({\n tag: 'limel-select',\n shadow: true,\n styleUrl: 'select.scss',\n})\nexport class Select {\n /**\n * Set to `true` to make the field disabled.\n * and visually shows that the `select` component is editable but disabled.\n * This tells the users that if certain requirements are met,\n * the component may become interactable.\n */\n @Prop({ reflect: true })\n public disabled = false;\n\n /**\n * Set to `true` to make the field read-only.\n * This visualizes the component slightly differently.\n * But shows no visual sign indicating that the component is disabled\n * or can ever become interactable.\n */\n @Prop({ reflect: true })\n public readonly = false;\n\n /**\n * Set to `true` to indicate that the current value of the select is\n * invalid.\n */\n @Prop({ reflect: true })\n public invalid: boolean;\n\n /**\n * True if the control requires a value.\n */\n @Prop({ reflect: true })\n public required = false;\n\n /**\n * Text to display next to the select.\n */\n @Prop({ reflect: true })\n public label: string;\n\n /**\n * Optional helper text to display below the input field when it has focus.\n */\n @Prop({ reflect: true })\n public helperText: string;\n\n /**\n * Currently selected value or values.\n * If `multiple` is `true`, this must be an array. Otherwise it must be a\n * single value.\n */\n @Prop()\n public value: Option | Option[];\n\n /**\n * List of options.\n */\n @Prop()\n public options: Option[] = [];\n\n /**\n * Set to `true` to allow multiple values to be selected.\n */\n @Prop()\n public multiple: boolean = false;\n\n /**\n * Emitted when the value is changed.\n */\n @Event()\n private change: EventEmitter<Option | Option[]>;\n\n @Element()\n private host: HTMLLimelSelectElement;\n\n @State()\n private menuOpen: boolean = false;\n\n private hasChanged: boolean = false;\n private checkValid: boolean = false;\n private mdcSelectHelperText: MDCSelectHelperText;\n private mdcFloatingLabel: MDCFloatingLabel;\n private isMobileDevice: boolean;\n private portalId: string;\n\n constructor() {\n this.handleMenuChange = this.handleMenuChange.bind(this);\n this.handleNativeChange = this.handleNativeChange.bind(this);\n this.handleMenuTriggerKeyPress =\n this.handleMenuTriggerKeyPress.bind(this);\n this.openMenu = this.openMenu.bind(this);\n this.closeMenu = this.closeMenu.bind(this);\n\n this.portalId = createRandomString();\n }\n\n public connectedCallback() {\n this.initialize();\n }\n\n public componentWillLoad() {\n this.isMobileDevice = isMobileDevice();\n\n // It should not be possible to render the native select for consumers, but we still want to make it testable.\n // We can set this attribute in tests to force rendering of the native select\n if (this.host.hasAttribute('data-native')) {\n this.isMobileDevice = true;\n }\n }\n\n public componentDidLoad() {\n this.initialize();\n triggerIconColorWarning(this.options);\n }\n\n private initialize() {\n let element: HTMLElement;\n element = this.host.shadowRoot.querySelector('.mdc-floating-label');\n if (!element) {\n return;\n }\n\n this.mdcFloatingLabel = new MDCFloatingLabel(element);\n\n element = this.host.shadowRoot.querySelector('.mdc-select-helper-text');\n if (element) {\n this.mdcSelectHelperText = new MDCSelectHelperText(element);\n }\n }\n\n public disconnectedCallback() {\n if (this.mdcFloatingLabel) {\n this.mdcFloatingLabel.destroy();\n }\n\n if (this.mdcSelectHelperText) {\n this.mdcSelectHelperText.destroy();\n }\n }\n\n public componentDidUpdate() {\n if (this.menuOpen) {\n this.setMenuFocus();\n }\n }\n\n public render() {\n const dropdownZIndex = getComputedStyle(this.host).getPropertyValue(\n '--dropdown-z-index',\n );\n\n return (\n <SelectTemplate\n id={this.portalId}\n disabled={this.disabled || this.readonly}\n readonly={this.readonly}\n required={this.required}\n invalid={this.invalid}\n label={this.label}\n helperText={this.helperText}\n value={this.value}\n options={this.options}\n onMenuChange={this.handleMenuChange}\n onNativeChange={this.handleNativeChange}\n onTriggerPress={this.handleMenuTriggerKeyPress}\n multiple={this.multiple}\n isOpen={this.menuOpen}\n open={this.openMenu}\n close={this.closeMenu}\n checkValid={this.checkValid}\n native={this.isMobileDevice}\n dropdownZIndex={dropdownZIndex}\n />\n );\n }\n\n @Watch('menuOpen')\n protected watchOpen(newValue: boolean, oldValue: boolean) {\n if (this.checkValid) {\n return;\n }\n\n // Menu was closed for the first time\n if (!newValue && oldValue) {\n this.checkValid = true;\n }\n }\n\n private setMenuFocus() {\n if (this.isMobileDevice) {\n return;\n }\n\n setTimeout(() => {\n const list: HTMLElement = document.querySelector(\n `#${this.portalId} limel-menu-surface limel-list`,\n );\n const firstItem: HTMLElement =\n list?.shadowRoot?.querySelector('[tabindex]');\n\n if (firstItem) {\n firstItem.focus();\n }\n });\n }\n\n private setTriggerFocus() {\n const trigger: HTMLElement = this.host.shadowRoot.querySelector(\n '.limel-select-trigger',\n );\n trigger.focus();\n }\n\n private handleMenuChange(\n event: CustomEvent<Array<ListItem<Option>> | ListItem<Option>>,\n ) {\n event.stopPropagation();\n\n if (isMultiple(event.detail)) {\n const listItems: ListItem[] = event.detail;\n const options: Option[] = listItems.map((item) => item.value);\n this.change.emit(options);\n\n return;\n }\n\n if (!event.detail.selected) {\n return;\n }\n\n const listItem: ListItem = event.detail;\n const option: Option = listItem.value;\n if (option.disabled) {\n return;\n }\n\n this.change.emit(option);\n this.menuOpen = false;\n this.setTriggerFocus();\n }\n\n private openMenu() {\n if (this.emitFirstChangeEvent()) {\n this.hasChanged = true;\n this.change.emit(this.options[0]);\n }\n\n this.menuOpen = true;\n }\n\n private emitFirstChangeEvent() {\n return !this.hasChanged && this.isMobileDevice && !this.value;\n }\n\n private closeMenu() {\n this.menuOpen = false;\n this.setTriggerFocus();\n }\n\n private handleMenuTriggerKeyPress(event: KeyboardEvent) {\n const isEnter = event.key === ENTER || event.keyCode === ENTER_KEY_CODE;\n const isSpace = event.key === SPACE || event.keyCode === SPACE_KEY_CODE;\n\n if (!this.menuOpen && (isSpace || isEnter)) {\n event.stopPropagation();\n event.preventDefault();\n this.menuOpen = true;\n }\n }\n\n private handleNativeChange(event: Event) {\n event.stopPropagation();\n\n const element: HTMLSelectElement = this.host.shadowRoot.querySelector(\n 'select.limel-select__native-control',\n );\n const options = Array.apply(null, element.options) // eslint-disable-line prefer-spread\n .filter((optionElement: HTMLOptionElement) => {\n return !!optionElement.selected;\n })\n .map((optionElement: HTMLOptionElement) => {\n return this.options.find(\n (o) => o.value === optionElement.value,\n );\n });\n\n if (this.multiple) {\n this.change.emit(options);\n\n return;\n }\n\n this.change.emit(options[0]);\n this.menuOpen = false;\n }\n}\n"],"version":3}
@@ -1 +1 @@
1
- {"version":3,"file":"option.types.js","sourceRoot":"","sources":["../../../src/components/select/option.types.ts"],"names":[],"mappings":"","sourcesContent":["import { Icon } from '../../global/shared-types/icon.types';\n/**\n * Describes an option for limel-select.\n * @public\n */\nexport interface Option<T extends string = string> {\n /**\n * The name of the option as shown to the user.\n */\n text: string;\n\n /**\n * The unique value of the option. Should always be the same for any given\n * option, regardless of localization. The type `T` defaults to `string`,\n * but can be set to any type that extends `string` (using `Option<type>`),\n * for example an enum of specific strings.\n *\n * Note the value of this property *must* be a string!\n * If the value you wish to use is, for example, numeric, convert it to a\n * string before sending it to limel-select. Using numeric values does work\n * in many desktop browsers, but breaks the select completely on some\n * iOS devices.\n */\n value: T;\n\n /**\n * Set to `true` to make this option disabled and not possible to select.\n */\n disabled?: boolean;\n\n /**\n * Displays an icon beside the name of the option.\n */\n icon?: string | Icon;\n\n /**\n * Adds a color to the icon.\n *\n * @deprecated This property is deprecated and will be removed soon!\n *\n * Use the new `Icon` interface instead and write:\n * ```\n * icon {\n * name: string,\n * color: string,\n * },\n * ```\n */\n iconColor?: string;\n}\n"]}
1
+ {"version":3,"file":"option.types.js","sourceRoot":"","sources":["../../../src/components/select/option.types.ts"],"names":[],"mappings":"","sourcesContent":["import { Icon } from '../../global/shared-types/icon.types';\n/**\n * Describes an option for limel-select.\n * @public\n */\nexport interface Option<T extends string = string> {\n /**\n * The name of the option as shown to the user.\n */\n text: string;\n\n /**\n * Additional supporting text to display in under the option text.\n */\n secondaryText?: string;\n\n /**\n * The unique value of the option. Should always be the same for any given\n * option, regardless of localization. The type `T` defaults to `string`,\n * but can be set to any type that extends `string` (using `Option<type>`),\n * for example an enum of specific strings.\n *\n * Note the value of this property *must* be a string!\n * If the value you wish to use is, for example, numeric, convert it to a\n * string before sending it to limel-select. Using numeric values does work\n * in many desktop browsers, but breaks the select completely on some\n * iOS devices.\n */\n value: T;\n\n /**\n * Set to `true` to make this option disabled and not possible to select.\n */\n disabled?: boolean;\n\n /**\n * Displays an icon beside the name of the option.\n */\n icon?: string | Icon;\n\n /**\n * Adds a color to the icon.\n *\n * @deprecated This property is deprecated and will be removed soon!\n *\n * Use the new `Icon` interface instead and write:\n * ```\n * icon {\n * name: string,\n * color: string,\n * },\n * ```\n */\n iconColor?: string;\n}\n"]}
@@ -9,6 +9,7 @@ import { SelectTemplate, triggerIconColorWarning } from './select.template';
9
9
  /**
10
10
  * @exampleComponent limel-example-select
11
11
  * @exampleComponent limel-example-select-with-icons
12
+ * @exampleComponent limel-example-select-with-secondary-text
12
13
  * @exampleComponent limel-example-select-multiple
13
14
  * @exampleComponent limel-example-select-with-empty-option
14
15
  * @exampleComponent limel-example-select-preselected
@@ -1 +1 @@
1
- {"version":3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,IAAI,CAAC,OAAO,CAAC,IAAI,CACpB,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,aAAa,CAAC,KAAK,CACzC,CAAC;IACN,CAAC,CAAC,CAAC;IAEP,IAAI,IAAI,CAAC,QAAQ,EAAE;MACf,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;MAE1B,OAAO;KACV;IAED,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7B,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;EAC1B,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import { ListItem } from '../list/list-item.types';\nimport { Option } from '../select/option.types';\nimport { MDCFloatingLabel } from '@material/floating-label';\nimport { MDCSelectHelperText } from '@material/select/helper-text';\nimport {\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Prop,\n State,\n Watch,\n} from '@stencil/core';\nimport { isMobileDevice } from '../../util/device';\nimport {\n ENTER,\n ENTER_KEY_CODE,\n SPACE,\n SPACE_KEY_CODE,\n} from '../../util/keycodes';\nimport { isMultiple } from '../../util/multiple';\nimport { createRandomString } from '../../util/random-string';\nimport { SelectTemplate, triggerIconColorWarning } from './select.template';\n\n/**\n * @exampleComponent limel-example-select\n * @exampleComponent limel-example-select-with-icons\n * @exampleComponent limel-example-select-multiple\n * @exampleComponent limel-example-select-with-empty-option\n * @exampleComponent limel-example-select-preselected\n * @exampleComponent limel-example-select-change-options\n * @exampleComponent limel-example-select-dialog\n */\n@Component({\n tag: 'limel-select',\n shadow: true,\n styleUrl: 'select.scss',\n})\nexport class Select {\n /**\n * Set to `true` to make the field disabled.\n * and visually shows that the `select` component is editable but disabled.\n * This tells the users that if certain requirements are met,\n * the component may become interactable.\n */\n @Prop({ reflect: true })\n public disabled = false;\n\n /**\n * Set to `true` to make the field read-only.\n * This visualizes the component slightly differently.\n * But shows no visual sign indicating that the component is disabled\n * or can ever become interactable.\n */\n @Prop({ reflect: true })\n public readonly = false;\n\n /**\n * Set to `true` to indicate that the current value of the select is\n * invalid.\n */\n @Prop({ reflect: true })\n public invalid: boolean;\n\n /**\n * True if the control requires a value.\n */\n @Prop({ reflect: true })\n public required = false;\n\n /**\n * Text to display next to the select.\n */\n @Prop({ reflect: true })\n public label: string;\n\n /**\n * Optional helper text to display below the input field when it has focus.\n */\n @Prop({ reflect: true })\n public helperText: string;\n\n /**\n * Currently selected value or values.\n * If `multiple` is `true`, this must be an array. Otherwise it must be a\n * single value.\n */\n @Prop()\n public value: Option | Option[];\n\n /**\n * List of options.\n */\n @Prop()\n public options: Option[] = [];\n\n /**\n * Set to `true` to allow multiple values to be selected.\n */\n @Prop()\n public multiple: boolean = false;\n\n /**\n * Emitted when the value is changed.\n */\n @Event()\n private change: EventEmitter<Option | Option[]>;\n\n @Element()\n private host: HTMLLimelSelectElement;\n\n @State()\n private menuOpen: boolean = false;\n\n private hasChanged: boolean = false;\n private checkValid: boolean = false;\n private mdcSelectHelperText: MDCSelectHelperText;\n private mdcFloatingLabel: MDCFloatingLabel;\n private isMobileDevice: boolean;\n private portalId: string;\n\n constructor() {\n this.handleMenuChange = this.handleMenuChange.bind(this);\n this.handleNativeChange = this.handleNativeChange.bind(this);\n this.handleMenuTriggerKeyPress =\n this.handleMenuTriggerKeyPress.bind(this);\n this.openMenu = this.openMenu.bind(this);\n this.closeMenu = this.closeMenu.bind(this);\n\n this.portalId = createRandomString();\n }\n\n public connectedCallback() {\n this.initialize();\n }\n\n public componentWillLoad() {\n this.isMobileDevice = isMobileDevice();\n\n // It should not be possible to render the native select for consumers, but we still want to make it testable.\n // We can set this attribute in tests to force rendering of the native select\n if (this.host.hasAttribute('data-native')) {\n this.isMobileDevice = true;\n }\n }\n\n public componentDidLoad() {\n this.initialize();\n triggerIconColorWarning(this.options);\n }\n\n private initialize() {\n let element: HTMLElement;\n element = this.host.shadowRoot.querySelector('.mdc-floating-label');\n if (!element) {\n return;\n }\n\n this.mdcFloatingLabel = new MDCFloatingLabel(element);\n\n element = this.host.shadowRoot.querySelector('.mdc-select-helper-text');\n if (element) {\n this.mdcSelectHelperText = new MDCSelectHelperText(element);\n }\n }\n\n public disconnectedCallback() {\n if (this.mdcFloatingLabel) {\n this.mdcFloatingLabel.destroy();\n }\n\n if (this.mdcSelectHelperText) {\n this.mdcSelectHelperText.destroy();\n }\n }\n\n public componentDidUpdate() {\n if (this.menuOpen) {\n this.setMenuFocus();\n }\n }\n\n public render() {\n const dropdownZIndex = getComputedStyle(this.host).getPropertyValue(\n '--dropdown-z-index',\n );\n\n return (\n <SelectTemplate\n id={this.portalId}\n disabled={this.disabled || this.readonly}\n readonly={this.readonly}\n required={this.required}\n invalid={this.invalid}\n label={this.label}\n helperText={this.helperText}\n value={this.value}\n options={this.options}\n onMenuChange={this.handleMenuChange}\n onNativeChange={this.handleNativeChange}\n onTriggerPress={this.handleMenuTriggerKeyPress}\n multiple={this.multiple}\n isOpen={this.menuOpen}\n open={this.openMenu}\n close={this.closeMenu}\n checkValid={this.checkValid}\n native={this.isMobileDevice}\n dropdownZIndex={dropdownZIndex}\n />\n );\n }\n\n @Watch('menuOpen')\n protected watchOpen(newValue: boolean, oldValue: boolean) {\n if (this.checkValid) {\n return;\n }\n\n // Menu was closed for the first time\n if (!newValue && oldValue) {\n this.checkValid = true;\n }\n }\n\n private setMenuFocus() {\n if (this.isMobileDevice) {\n return;\n }\n\n setTimeout(() => {\n const list: HTMLElement = document.querySelector(\n `#${this.portalId} limel-menu-surface limel-list`,\n );\n const firstItem: HTMLElement =\n list?.shadowRoot?.querySelector('[tabindex]');\n\n if (firstItem) {\n firstItem.focus();\n }\n });\n }\n\n private setTriggerFocus() {\n const trigger: HTMLElement = this.host.shadowRoot.querySelector(\n '.limel-select-trigger',\n );\n trigger.focus();\n }\n\n private handleMenuChange(\n event: CustomEvent<Array<ListItem<Option>> | ListItem<Option>>,\n ) {\n event.stopPropagation();\n\n if (isMultiple(event.detail)) {\n const listItems: ListItem[] = event.detail;\n const options: Option[] = listItems.map((item) => item.value);\n this.change.emit(options);\n\n return;\n }\n\n if (!event.detail.selected) {\n return;\n }\n\n const listItem: ListItem = event.detail;\n const option: Option = listItem.value;\n if (option.disabled) {\n return;\n }\n\n this.change.emit(option);\n this.menuOpen = false;\n this.setTriggerFocus();\n }\n\n private openMenu() {\n if (this.emitFirstChangeEvent()) {\n this.hasChanged = true;\n this.change.emit(this.options[0]);\n }\n\n this.menuOpen = true;\n }\n\n private emitFirstChangeEvent() {\n return !this.hasChanged && this.isMobileDevice && !this.value;\n }\n\n private closeMenu() {\n this.menuOpen = false;\n this.setTriggerFocus();\n }\n\n private handleMenuTriggerKeyPress(event: KeyboardEvent) {\n const isEnter = event.key === ENTER || event.keyCode === ENTER_KEY_CODE;\n const isSpace = event.key === SPACE || event.keyCode === SPACE_KEY_CODE;\n\n if (!this.menuOpen && (isSpace || isEnter)) {\n event.stopPropagation();\n event.preventDefault();\n this.menuOpen = true;\n }\n }\n\n private handleNativeChange(event: Event) {\n event.stopPropagation();\n\n const element: HTMLSelectElement = this.host.shadowRoot.querySelector(\n 'select.limel-select__native-control',\n );\n const options = Array.apply(null, element.options) // eslint-disable-line prefer-spread\n .filter((optionElement: HTMLOptionElement) => {\n return !!optionElement.selected;\n })\n .map((optionElement: HTMLOptionElement) => {\n return this.options.find(\n (o) => o.value === optionElement.value,\n );\n });\n\n if (this.multiple) {\n this.change.emit(options);\n\n return;\n }\n\n this.change.emit(options[0]);\n this.menuOpen = false;\n }\n}\n"]}
1
+ {"version":3,"file":"select.js","sourceRoot":"","sources":["../../../src/components/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B,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,aAAa,CAAC,KAAK,CACzC,CAAC;IACN,CAAC,CAAC,CAAC;IAEP,IAAI,IAAI,CAAC,QAAQ,EAAE;MACf,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;MAE1B,OAAO;KACV;IAED,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7B,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;EAC1B,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import { ListItem } from '../list/list-item.types';\nimport { Option } from '../select/option.types';\nimport { MDCFloatingLabel } from '@material/floating-label';\nimport { MDCSelectHelperText } from '@material/select/helper-text';\nimport {\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Prop,\n State,\n Watch,\n} from '@stencil/core';\nimport { isMobileDevice } from '../../util/device';\nimport {\n ENTER,\n ENTER_KEY_CODE,\n SPACE,\n SPACE_KEY_CODE,\n} from '../../util/keycodes';\nimport { isMultiple } from '../../util/multiple';\nimport { createRandomString } from '../../util/random-string';\nimport { SelectTemplate, triggerIconColorWarning } from './select.template';\n\n/**\n * @exampleComponent limel-example-select\n * @exampleComponent limel-example-select-with-icons\n * @exampleComponent limel-example-select-with-secondary-text\n * @exampleComponent limel-example-select-multiple\n * @exampleComponent limel-example-select-with-empty-option\n * @exampleComponent limel-example-select-preselected\n * @exampleComponent limel-example-select-change-options\n * @exampleComponent limel-example-select-dialog\n */\n@Component({\n tag: 'limel-select',\n shadow: true,\n styleUrl: 'select.scss',\n})\nexport class Select {\n /**\n * Set to `true` to make the field disabled.\n * and visually shows that the `select` component is editable but disabled.\n * This tells the users that if certain requirements are met,\n * the component may become interactable.\n */\n @Prop({ reflect: true })\n public disabled = false;\n\n /**\n * Set to `true` to make the field read-only.\n * This visualizes the component slightly differently.\n * But shows no visual sign indicating that the component is disabled\n * or can ever become interactable.\n */\n @Prop({ reflect: true })\n public readonly = false;\n\n /**\n * Set to `true` to indicate that the current value of the select is\n * invalid.\n */\n @Prop({ reflect: true })\n public invalid: boolean;\n\n /**\n * True if the control requires a value.\n */\n @Prop({ reflect: true })\n public required = false;\n\n /**\n * Text to display next to the select.\n */\n @Prop({ reflect: true })\n public label: string;\n\n /**\n * Optional helper text to display below the input field when it has focus.\n */\n @Prop({ reflect: true })\n public helperText: string;\n\n /**\n * Currently selected value or values.\n * If `multiple` is `true`, this must be an array. Otherwise it must be a\n * single value.\n */\n @Prop()\n public value: Option | Option[];\n\n /**\n * List of options.\n */\n @Prop()\n public options: Option[] = [];\n\n /**\n * Set to `true` to allow multiple values to be selected.\n */\n @Prop()\n public multiple: boolean = false;\n\n /**\n * Emitted when the value is changed.\n */\n @Event()\n private change: EventEmitter<Option | Option[]>;\n\n @Element()\n private host: HTMLLimelSelectElement;\n\n @State()\n private menuOpen: boolean = false;\n\n private hasChanged: boolean = false;\n private checkValid: boolean = false;\n private mdcSelectHelperText: MDCSelectHelperText;\n private mdcFloatingLabel: MDCFloatingLabel;\n private isMobileDevice: boolean;\n private portalId: string;\n\n constructor() {\n this.handleMenuChange = this.handleMenuChange.bind(this);\n this.handleNativeChange = this.handleNativeChange.bind(this);\n this.handleMenuTriggerKeyPress =\n this.handleMenuTriggerKeyPress.bind(this);\n this.openMenu = this.openMenu.bind(this);\n this.closeMenu = this.closeMenu.bind(this);\n\n this.portalId = createRandomString();\n }\n\n public connectedCallback() {\n this.initialize();\n }\n\n public componentWillLoad() {\n this.isMobileDevice = isMobileDevice();\n\n // It should not be possible to render the native select for consumers, but we still want to make it testable.\n // We can set this attribute in tests to force rendering of the native select\n if (this.host.hasAttribute('data-native')) {\n this.isMobileDevice = true;\n }\n }\n\n public componentDidLoad() {\n this.initialize();\n triggerIconColorWarning(this.options);\n }\n\n private initialize() {\n let element: HTMLElement;\n element = this.host.shadowRoot.querySelector('.mdc-floating-label');\n if (!element) {\n return;\n }\n\n this.mdcFloatingLabel = new MDCFloatingLabel(element);\n\n element = this.host.shadowRoot.querySelector('.mdc-select-helper-text');\n if (element) {\n this.mdcSelectHelperText = new MDCSelectHelperText(element);\n }\n }\n\n public disconnectedCallback() {\n if (this.mdcFloatingLabel) {\n this.mdcFloatingLabel.destroy();\n }\n\n if (this.mdcSelectHelperText) {\n this.mdcSelectHelperText.destroy();\n }\n }\n\n public componentDidUpdate() {\n if (this.menuOpen) {\n this.setMenuFocus();\n }\n }\n\n public render() {\n const dropdownZIndex = getComputedStyle(this.host).getPropertyValue(\n '--dropdown-z-index',\n );\n\n return (\n <SelectTemplate\n id={this.portalId}\n disabled={this.disabled || this.readonly}\n readonly={this.readonly}\n required={this.required}\n invalid={this.invalid}\n label={this.label}\n helperText={this.helperText}\n value={this.value}\n options={this.options}\n onMenuChange={this.handleMenuChange}\n onNativeChange={this.handleNativeChange}\n onTriggerPress={this.handleMenuTriggerKeyPress}\n multiple={this.multiple}\n isOpen={this.menuOpen}\n open={this.openMenu}\n close={this.closeMenu}\n checkValid={this.checkValid}\n native={this.isMobileDevice}\n dropdownZIndex={dropdownZIndex}\n />\n );\n }\n\n @Watch('menuOpen')\n protected watchOpen(newValue: boolean, oldValue: boolean) {\n if (this.checkValid) {\n return;\n }\n\n // Menu was closed for the first time\n if (!newValue && oldValue) {\n this.checkValid = true;\n }\n }\n\n private setMenuFocus() {\n if (this.isMobileDevice) {\n return;\n }\n\n setTimeout(() => {\n const list: HTMLElement = document.querySelector(\n `#${this.portalId} limel-menu-surface limel-list`,\n );\n const firstItem: HTMLElement =\n list?.shadowRoot?.querySelector('[tabindex]');\n\n if (firstItem) {\n firstItem.focus();\n }\n });\n }\n\n private setTriggerFocus() {\n const trigger: HTMLElement = this.host.shadowRoot.querySelector(\n '.limel-select-trigger',\n );\n trigger.focus();\n }\n\n private handleMenuChange(\n event: CustomEvent<Array<ListItem<Option>> | ListItem<Option>>,\n ) {\n event.stopPropagation();\n\n if (isMultiple(event.detail)) {\n const listItems: ListItem[] = event.detail;\n const options: Option[] = listItems.map((item) => item.value);\n this.change.emit(options);\n\n return;\n }\n\n if (!event.detail.selected) {\n return;\n }\n\n const listItem: ListItem = event.detail;\n const option: Option = listItem.value;\n if (option.disabled) {\n return;\n }\n\n this.change.emit(option);\n this.menuOpen = false;\n this.setTriggerFocus();\n }\n\n private openMenu() {\n if (this.emitFirstChangeEvent()) {\n this.hasChanged = true;\n this.change.emit(this.options[0]);\n }\n\n this.menuOpen = true;\n }\n\n private emitFirstChangeEvent() {\n return !this.hasChanged && this.isMobileDevice && !this.value;\n }\n\n private closeMenu() {\n this.menuOpen = false;\n this.setTriggerFocus();\n }\n\n private handleMenuTriggerKeyPress(event: KeyboardEvent) {\n const isEnter = event.key === ENTER || event.keyCode === ENTER_KEY_CODE;\n const isSpace = event.key === SPACE || event.keyCode === SPACE_KEY_CODE;\n\n if (!this.menuOpen && (isSpace || isEnter)) {\n event.stopPropagation();\n event.preventDefault();\n this.menuOpen = true;\n }\n }\n\n private handleNativeChange(event: Event) {\n event.stopPropagation();\n\n const element: HTMLSelectElement = this.host.shadowRoot.querySelector(\n 'select.limel-select__native-control',\n );\n const options = Array.apply(null, element.options) // eslint-disable-line prefer-spread\n .filter((optionElement: HTMLOptionElement) => {\n return !!optionElement.selected;\n })\n .map((optionElement: HTMLOptionElement) => {\n return this.options.find(\n (o) => o.value === optionElement.value,\n );\n });\n\n if (this.multiple) {\n this.change.emit(options);\n\n return;\n }\n\n this.change.emit(options[0]);\n this.menuOpen = false;\n }\n}\n"]}
@@ -91,12 +91,13 @@ function createMenuItems(options, value, selectIsRequired = false) {
91
91
  const menuOptionFilter = getMenuOptionFilter(selectIsRequired);
92
92
  return options.filter(menuOptionFilter).map((option) => {
93
93
  const selected = isSelected(option, value);
94
- const { text, disabled } = option;
94
+ const { text, secondaryText, disabled } = option;
95
95
  const name = getIconName(option.icon);
96
96
  const color = getIconColor(option.icon, option.iconColor);
97
97
  if (!name) {
98
98
  return {
99
99
  text: text,
100
+ secondaryText: secondaryText,
100
101
  selected: selected,
101
102
  disabled: disabled,
102
103
  value: option,
@@ -104,6 +105,7 @@ function createMenuItems(options, value, selectIsRequired = false) {
104
105
  }
105
106
  return {
106
107
  text: text,
108
+ secondaryText: secondaryText,
107
109
  selected: selected,
108
110
  disabled: disabled,
109
111
  value: option,
@@ -1 +1 @@
1
- {"version":3,"file":"select.template.js","sourceRoot":"","sources":["../../../src/components/select/select.template.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAuB,CAAC,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AA2BnE,MAAM,CAAC,MAAM,cAAc,GAA6C,CACpE,KAAK,EACP,EAAE;EACA,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;EAC1B,IAAI,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC;EAC7B,IAAI,YAAY,GAAG,IAAI,CAAC;EACxB,IAAI,UAAU,CAAC,KAAK,CAAC,EAAE;IACnB,QAAQ,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;GAC/B;OAAM,IAAI,QAAQ,EAAE;IACjB,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC;IACzB,YAAY,GAAG,KAAK,CAAC,IAAI,KAAK,EAAE,CAAC;GACpC;EAED,IAAI,OAAO,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC;EAC7B,IAAI,KAAK,CAAC,UAAU,IAAI,K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,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;GACxD;EAED,OAAO,KAAK,CAAC,IAAI,CAAC;AACtB,CAAC;AAED,SAAS,eAAe,CAAC,KAAU;EAC/B,IAAI,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE;IACvB,OAAO,EAAE,CAAC;GACb;EAED,MAAM,IAAI,GAAG,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;EACrC,MAAM,KAAK,GAAG,YAAY,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;EACxD,MAAM,KAAK,GAAQ,EAAE,CAAC;EACtB,IAAI,KAAK,EAAE;IACP,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC;GACvB;EAED,OAAO,CACH,kBACI,KAAK,EAAC,qCAAqC,EAC3C,IAAI,EAAE,IAAI,EACV,IAAI,EAAC,QAAQ,EACb,KAAK,EAAE,KAAK,GACd,CACL,CAAC;AACN,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,OAAiB;EACrD,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE;IACvB,IAAI,MAAM,CAAC,SAAS,EAAE;MAClB,yCAAyC;MACzC,OAAO,CAAC,IAAI,CACR,sKAAsK,CACzK,CAAC;KACL;EACL,CAAC,CAAC,CAAC;AACP,CAAC","sourcesContent":["import { ListItem } from '../list/list-item.types';\nimport { Option } from '../select/option.types';\nimport { FunctionalComponent, h } from '@stencil/core';\nimport { isMultiple } from '../../util/multiple';\nimport { getIconColor, getIconName } from '../icon/get-icon-props';\n\ninterface SelectTemplateProps {\n disabled?: boolean;\n readonly?: boolean;\n required?: boolean;\n invalid?: boolean;\n options: Option[];\n value: Option | Option[];\n label?: string;\n helperText?: string;\n multiple?: boolean;\n native: boolean;\n\n onNativeChange: (event: Event) => void;\n\n id: string;\n onMenuChange: (event: CustomEvent<ListItem | ListItem[]>) => void;\n onTriggerPress: (event: KeyboardEvent) => void;\n isOpen: boolean;\n open: () => void;\n close: () => void;\n checkValid: boolean;\n\n dropdownZIndex: string;\n}\n\nexport const SelectTemplate: FunctionalComponent<SelectTemplateProps> = (\n props,\n) => {\n const value = props.value;\n let hasValue = !!props.value;\n let hasEmptyText = true;\n if (isMultiple(value)) {\n hasValue = value.length > 0;\n } else if (hasValue) {\n hasValue = !!value.value;\n hasEmptyText = value.text === '';\n }\n\n let isValid = !props.invalid;\n if (props.checkValid && props.required && !hasValue) {\n isValid = false;\n }\n\n const classList = {\n 'limel-select': true,\n 'mdc-select': true,\n 'mdc-select--outlined': true,\n 'mdc-select--disabled': props.disabled,\n 'limel-select--readonly': props.readonly,\n 'limel-select--required': props.required,\n 'limel-select--invalid': !isValid,\n 'limel-select--empty': !hasValue,\n 'limel-select--with-helper-text': typeof props.helperText === 'string',\n };\n\n return (\n <div class={classList}>\n <SelectValue\n {...props}\n hasValue={hasValue}\n isValid={isValid}\n hasEmptyText={hasEmptyText}\n />\n <HelperText text={props.helperText} isValid={!props.invalid} />\n <SelectDropdown {...props} />\n </div>\n );\n};\n\nconst SelectValue: FunctionalComponent<\n SelectTemplateProps & {\n hasValue: boolean;\n isValid: boolean;\n hasEmptyText: boolean;\n }\n> = (props) => {\n const anchorClassList = {\n 'mdc-select__anchor': true,\n 'limel-select-trigger': true,\n 'limel-select--focused': props.isOpen,\n };\n const labelClassList = {\n 'mdc-floating-label': true,\n 'mdc-floating-label--float-above':\n !props.hasEmptyText ||\n props.isOpen ||\n props.readonly ||\n props.hasValue,\n 'mdc-floating-label--active': props.isOpen,\n };\n\n return (\n <button\n class={anchorClassList}\n onClick={props.open}\n onKeyPress={props.onTriggerPress}\n aria-haspopup=\"listbox\"\n aria-expanded={props.isOpen}\n aria-controls={props.id}\n aria-labelledby=\"s-label s-selected-text\"\n aria-required={props.required}\n disabled={props.disabled || props.readonly}\n >\n <span id=\"s-label\" class={labelClassList}>\n {props.label}\n </span>\n <span class=\"mdc-select__selected-text-container limel-select__selected-option\">\n {getSelectedIcon(props.value)}\n <span\n id=\"s-selected-text\"\n class=\"mdc-select__selected-text limel-select__selected-option__text\"\n >\n {getSelectedText(props.value, props.readonly)}\n </span>\n </span>\n <ShowIcon {...props} isValid={props.isValid} />\n <span class=\"mdc-select__dropdown-icon\">\n <svg\n class=\"mdc-select__dropdown-icon-graphic\"\n viewBox=\"7 10 10 5\"\n focusable=\"false\"\n >\n <polygon\n stroke=\"none\"\n fill-rule=\"evenodd\"\n points=\"7 10 12 15 17 10\"\n ></polygon>\n </svg>\n </span>\n </button>\n );\n};\n\nconst ShowIcon: FunctionalComponent<\n SelectTemplateProps & {\n isValid: boolean;\n }\n> = (props) => {\n if (props.isValid) {\n return;\n }\n\n return (\n <limel-icon name=\"high_importance\" size=\"medium\" class=\"invalid-icon\" />\n );\n};\n\nconst HelperText: FunctionalComponent<{ text: string; isValid: boolean }> = (\n props,\n) => {\n if (typeof props.text !== 'string') {\n return;\n }\n\n return (\n <limel-helper-line\n helperText={props.text.trim()}\n invalid={!props.isValid}\n />\n );\n};\n\nconst SelectDropdown: FunctionalComponent<SelectTemplateProps> = (props) => {\n if (props.native) {\n return <NativeDropdown {...props} />;\n }\n\n return <MenuDropdown {...props} />;\n};\n\nconst MenuDropdown: FunctionalComponent<SelectTemplateProps> = (props) => {\n const items = createMenuItems(props.options, props.value, props.required);\n\n return (\n <limel-portal\n containerId={props.id}\n visible={props.isOpen}\n inheritParentWidth={true}\n containerStyle={{ 'z-index': props.dropdownZIndex }}\n >\n <limel-menu-surface\n open={props.isOpen}\n onDismiss={props.close}\n style={{\n '--mdc-menu-min-width': '100%',\n 'max-height': 'inherit',\n display: 'flex',\n 'min-width': '100%',\n width: 'fit-content',\n }}\n >\n <limel-list\n items={items}\n type={props.multiple ? 'checkbox' : 'selectable'}\n onChange={props.onMenuChange}\n />\n </limel-menu-surface>\n </limel-portal>\n );\n};\n\nconst NativeDropdown: FunctionalComponent<SelectTemplateProps> = (props) => {\n return (\n <select\n required={props.required}\n aria-disabled={props.disabled}\n aria-required={props.required}\n onChange={props.onNativeChange}\n onFocus={props.open}\n onBlur={props.close}\n class=\"limel-select__native-control\"\n disabled={props.disabled}\n multiple={props.multiple}\n >\n {props.options.map((option) => {\n return (\n <option\n key={option.value}\n value={option.value}\n selected={isSelected(option, props.value)}\n disabled={option.disabled}\n >\n {option.text}\n </option>\n );\n })}\n </select>\n );\n};\n\nfunction isSelected(option: Option, value: Option | Option[]): boolean {\n if (!value) {\n return false;\n }\n\n if (isMultiple(value)) {\n return value.some((o) => option.value === o.value);\n }\n\n return option.value === value.value;\n}\n\nfunction createMenuItems(\n options: Option[],\n value: Option | Option[],\n selectIsRequired = false,\n): Array<ListItem<Option>> {\n const menuOptionFilter = getMenuOptionFilter(selectIsRequired);\n\n return options.filter(menuOptionFilter).map((option) => {\n const selected = isSelected(option, value);\n const { text, disabled } = option;\n const name = getIconName(option.icon);\n const color = getIconColor(option.icon, option.iconColor);\n\n if (!name) {\n return {\n text: text,\n selected: selected,\n disabled: disabled,\n value: option,\n };\n }\n\n return {\n text: text,\n selected: selected,\n disabled: disabled,\n value: option,\n icon: {\n name: name,\n color: color,\n },\n };\n });\n}\n\nfunction getMenuOptionFilter(selectIsRequired: boolean) {\n return (option: Option) => {\n if (!selectIsRequired) {\n // If the select component is NOT required, we keep all options.\n return true;\n }\n\n if (option.text) {\n // If the select component IS required, we keep only options\n // that are not \"empty\". We only check the text property, because\n // some systems use an \"empty option\" that will have a value for\n // the `value` property, to signify \"no option selected\". Such\n // an option should be treated as \"empty\".\n return true;\n }\n };\n}\n\nfunction getSelectedText(value: Option | Option[], readonly: boolean): string {\n if ((!value || (isMultiple(value) && !value.length)) && readonly) {\n return '–';\n }\n\n if (!value) {\n return '';\n }\n\n if (isMultiple(value)) {\n return value.map((option) => option.text).join(', ');\n }\n\n return value.text;\n}\n\nfunction getSelectedIcon(value: any) {\n if (!value || !value.icon) {\n return '';\n }\n\n const name = getIconName(value.icon);\n const color = getIconColor(value.icon, value.iconColor);\n const style: any = {};\n if (color) {\n style.color = color;\n }\n\n return (\n <limel-icon\n class=\"limel-select__selected-option__icon\"\n name={name}\n size=\"medium\"\n style={style}\n />\n );\n}\n\nexport function triggerIconColorWarning(options: Option[]) {\n options.forEach((option) => {\n if (option.iconColor) {\n /* eslint-disable-next-line no-console */\n console.warn(\n \"The `iconColor` prop is deprecated now! Use the new `Icon` interface and instead of `iconColor: 'color-name'` write `icon {name: 'icon-name', color: 'color-name'}`.\",\n );\n }\n });\n}\n"]}
1
+ {"version":3,"file":"select.template.js","sourceRoot":"","sources":["../../../src/components/select/select.template.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAuB,CAAC,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AA2BnE,MAAM,CAAC,MAAM,cAAc,GAA6C,CACpE,KAAK,EACP,EAAE;EACA,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;EAC1B,IAAI,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC;EAC7B,IAAI,YAAY,GAAG,IAAI,CAAC;EACxB,IAAI,UAAU,CAAC,KAAK,CAAC,EAAE;IACnB,QAAQ,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;GAC/B;OAAM,IAAI,QAAQ,EAAE;IACjB,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC;IACzB,YAAY,GAAG,KAAK,CAAC,IAAI,KAAK,EAAE,CAAC;GACpC;EAED,IAAI,OAAO,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC;EAC7B,IAAI,KAAK,CAAC,UAAU,IAAI,KAAK,CAAC,QAAQ,IAAI,CAAC,QAAQ,EAAE;IACjD,OAAO,GAAG,KAAK,CAAC;GACnB;EAED,MAAM,SAAS,GAAG;IACd,cAAc,EAAE,IAAI;IACpB,YAAY,E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C;AACtB,CAAC;AAED,SAAS,eAAe,CAAC,KAAU;EAC/B,IAAI,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE;IACvB,OAAO,EAAE,CAAC;GACb;EAED,MAAM,IAAI,GAAG,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;EACrC,MAAM,KAAK,GAAG,YAAY,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;EACxD,MAAM,KAAK,GAAQ,EAAE,CAAC;EACtB,IAAI,KAAK,EAAE;IACP,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC;GACvB;EAED,OAAO,CACH,kBACI,KAAK,EAAC,qCAAqC,EAC3C,IAAI,EAAE,IAAI,EACV,IAAI,EAAC,QAAQ,EACb,KAAK,EAAE,KAAK,GACd,CACL,CAAC;AACN,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,OAAiB;EACrD,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE;IACvB,IAAI,MAAM,CAAC,SAAS,EAAE;MAClB,yCAAyC;MACzC,OAAO,CAAC,IAAI,CACR,sKAAsK,CACzK,CAAC;KACL;EACL,CAAC,CAAC,CAAC;AACP,CAAC","sourcesContent":["import { ListItem } from '../list/list-item.types';\nimport { Option } from '../select/option.types';\nimport { FunctionalComponent, h } from '@stencil/core';\nimport { isMultiple } from '../../util/multiple';\nimport { getIconColor, getIconName } from '../icon/get-icon-props';\n\ninterface SelectTemplateProps {\n disabled?: boolean;\n readonly?: boolean;\n required?: boolean;\n invalid?: boolean;\n options: Option[];\n value: Option | Option[];\n label?: string;\n helperText?: string;\n multiple?: boolean;\n native: boolean;\n\n onNativeChange: (event: Event) => void;\n\n id: string;\n onMenuChange: (event: CustomEvent<ListItem | ListItem[]>) => void;\n onTriggerPress: (event: KeyboardEvent) => void;\n isOpen: boolean;\n open: () => void;\n close: () => void;\n checkValid: boolean;\n\n dropdownZIndex: string;\n}\n\nexport const SelectTemplate: FunctionalComponent<SelectTemplateProps> = (\n props,\n) => {\n const value = props.value;\n let hasValue = !!props.value;\n let hasEmptyText = true;\n if (isMultiple(value)) {\n hasValue = value.length > 0;\n } else if (hasValue) {\n hasValue = !!value.value;\n hasEmptyText = value.text === '';\n }\n\n let isValid = !props.invalid;\n if (props.checkValid && props.required && !hasValue) {\n isValid = false;\n }\n\n const classList = {\n 'limel-select': true,\n 'mdc-select': true,\n 'mdc-select--outlined': true,\n 'mdc-select--disabled': props.disabled,\n 'limel-select--readonly': props.readonly,\n 'limel-select--required': props.required,\n 'limel-select--invalid': !isValid,\n 'limel-select--empty': !hasValue,\n 'limel-select--with-helper-text': typeof props.helperText === 'string',\n };\n\n return (\n <div class={classList}>\n <SelectValue\n {...props}\n hasValue={hasValue}\n isValid={isValid}\n hasEmptyText={hasEmptyText}\n />\n <HelperText text={props.helperText} isValid={!props.invalid} />\n <SelectDropdown {...props} />\n </div>\n );\n};\n\nconst SelectValue: FunctionalComponent<\n SelectTemplateProps & {\n hasValue: boolean;\n isValid: boolean;\n hasEmptyText: boolean;\n }\n> = (props) => {\n const anchorClassList = {\n 'mdc-select__anchor': true,\n 'limel-select-trigger': true,\n 'limel-select--focused': props.isOpen,\n };\n const labelClassList = {\n 'mdc-floating-label': true,\n 'mdc-floating-label--float-above':\n !props.hasEmptyText ||\n props.isOpen ||\n props.readonly ||\n props.hasValue,\n 'mdc-floating-label--active': props.isOpen,\n };\n\n return (\n <button\n class={anchorClassList}\n onClick={props.open}\n onKeyPress={props.onTriggerPress}\n aria-haspopup=\"listbox\"\n aria-expanded={props.isOpen}\n aria-controls={props.id}\n aria-labelledby=\"s-label s-selected-text\"\n aria-required={props.required}\n disabled={props.disabled || props.readonly}\n >\n <span id=\"s-label\" class={labelClassList}>\n {props.label}\n </span>\n <span class=\"mdc-select__selected-text-container limel-select__selected-option\">\n {getSelectedIcon(props.value)}\n <span\n id=\"s-selected-text\"\n class=\"mdc-select__selected-text limel-select__selected-option__text\"\n >\n {getSelectedText(props.value, props.readonly)}\n </span>\n </span>\n <ShowIcon {...props} isValid={props.isValid} />\n <span class=\"mdc-select__dropdown-icon\">\n <svg\n class=\"mdc-select__dropdown-icon-graphic\"\n viewBox=\"7 10 10 5\"\n focusable=\"false\"\n >\n <polygon\n stroke=\"none\"\n fill-rule=\"evenodd\"\n points=\"7 10 12 15 17 10\"\n ></polygon>\n </svg>\n </span>\n </button>\n );\n};\n\nconst ShowIcon: FunctionalComponent<\n SelectTemplateProps & {\n isValid: boolean;\n }\n> = (props) => {\n if (props.isValid) {\n return;\n }\n\n return (\n <limel-icon name=\"high_importance\" size=\"medium\" class=\"invalid-icon\" />\n );\n};\n\nconst HelperText: FunctionalComponent<{ text: string; isValid: boolean }> = (\n props,\n) => {\n if (typeof props.text !== 'string') {\n return;\n }\n\n return (\n <limel-helper-line\n helperText={props.text.trim()}\n invalid={!props.isValid}\n />\n );\n};\n\nconst SelectDropdown: FunctionalComponent<SelectTemplateProps> = (props) => {\n if (props.native) {\n return <NativeDropdown {...props} />;\n }\n\n return <MenuDropdown {...props} />;\n};\n\nconst MenuDropdown: FunctionalComponent<SelectTemplateProps> = (props) => {\n const items = createMenuItems(props.options, props.value, props.required);\n\n return (\n <limel-portal\n containerId={props.id}\n visible={props.isOpen}\n inheritParentWidth={true}\n containerStyle={{ 'z-index': props.dropdownZIndex }}\n >\n <limel-menu-surface\n open={props.isOpen}\n onDismiss={props.close}\n style={{\n '--mdc-menu-min-width': '100%',\n 'max-height': 'inherit',\n display: 'flex',\n 'min-width': '100%',\n width: 'fit-content',\n }}\n >\n <limel-list\n items={items}\n type={props.multiple ? 'checkbox' : 'selectable'}\n onChange={props.onMenuChange}\n />\n </limel-menu-surface>\n </limel-portal>\n );\n};\n\nconst NativeDropdown: FunctionalComponent<SelectTemplateProps> = (props) => {\n return (\n <select\n required={props.required}\n aria-disabled={props.disabled}\n aria-required={props.required}\n onChange={props.onNativeChange}\n onFocus={props.open}\n onBlur={props.close}\n class=\"limel-select__native-control\"\n disabled={props.disabled}\n multiple={props.multiple}\n >\n {props.options.map((option) => {\n return (\n <option\n key={option.value}\n value={option.value}\n selected={isSelected(option, props.value)}\n disabled={option.disabled}\n >\n {option.text}\n </option>\n );\n })}\n </select>\n );\n};\n\nfunction isSelected(option: Option, value: Option | Option[]): boolean {\n if (!value) {\n return false;\n }\n\n if (isMultiple(value)) {\n return value.some((o) => option.value === o.value);\n }\n\n return option.value === value.value;\n}\n\nfunction createMenuItems(\n options: Option[],\n value: Option | Option[],\n selectIsRequired = false,\n): Array<ListItem<Option>> {\n const menuOptionFilter = getMenuOptionFilter(selectIsRequired);\n\n return options.filter(menuOptionFilter).map((option) => {\n const selected = isSelected(option, value);\n const { text, secondaryText, disabled } = option;\n const name = getIconName(option.icon);\n const color = getIconColor(option.icon, option.iconColor);\n\n if (!name) {\n return {\n text: text,\n secondaryText: secondaryText,\n selected: selected,\n disabled: disabled,\n value: option,\n };\n }\n\n return {\n text: text,\n secondaryText: secondaryText,\n selected: selected,\n disabled: disabled,\n value: option,\n icon: {\n name: name,\n color: color,\n },\n };\n });\n}\n\nfunction getMenuOptionFilter(selectIsRequired: boolean) {\n return (option: Option) => {\n if (!selectIsRequired) {\n // If the select component is NOT required, we keep all options.\n return true;\n }\n\n if (option.text) {\n // If the select component IS required, we keep only options\n // that are not \"empty\". We only check the text property, because\n // some systems use an \"empty option\" that will have a value for\n // the `value` property, to signify \"no option selected\". Such\n // an option should be treated as \"empty\".\n return true;\n }\n };\n}\n\nfunction getSelectedText(value: Option | Option[], readonly: boolean): string {\n if ((!value || (isMultiple(value) && !value.length)) && readonly) {\n return '–';\n }\n\n if (!value) {\n return '';\n }\n\n if (isMultiple(value)) {\n return value.map((option) => option.text).join(', ');\n }\n\n return value.text;\n}\n\nfunction getSelectedIcon(value: any) {\n if (!value || !value.icon) {\n return '';\n }\n\n const name = getIconName(value.icon);\n const color = getIconColor(value.icon, value.iconColor);\n const style: any = {};\n if (color) {\n style.color = color;\n }\n\n return (\n <limel-icon\n class=\"limel-select__selected-option__icon\"\n name={name}\n size=\"medium\"\n style={style}\n />\n );\n}\n\nexport function triggerIconColorWarning(options: Option[]) {\n options.forEach((option) => {\n if (option.iconColor) {\n /* eslint-disable-next-line no-console */\n console.warn(\n \"The `iconColor` prop is deprecated now! Use the new `Icon` interface and instead of `iconColor: 'color-name'` write `icon {name: 'icon-name', color: 'color-name'}`.\",\n );\n }\n });\n}\n"]}
@@ -86,16 +86,18 @@ export class Tooltip {
86
86
  (_a = this.ownerElement) === null || _a === void 0 ? void 0 : _a.setAttribute('aria-describedby', this.tooltipId);
87
87
  }
88
88
  addListeners() {
89
- var _a, _b, _c;
89
+ var _a, _b, _c, _d;
90
90
  (_a = this.ownerElement) === null || _a === void 0 ? void 0 : _a.addEventListener('mouseover', this.showTooltip);
91
91
  (_b = this.ownerElement) === null || _b === void 0 ? void 0 : _b.addEventListener('mouseout', this.hideTooltip);
92
- (_c = this.ownerElement) === null || _c === void 0 ? void 0 : _c.addEventListener('click', this.hideTooltip);
92
+ (_c = this.ownerElement) === null || _c === void 0 ? void 0 : _c.addEventListener('focus', this.showTooltip);
93
+ (_d = this.ownerElement) === null || _d === void 0 ? void 0 : _d.addEventListener('blur', this.hideTooltip);
93
94
  }
94
95
  removeListeners() {
95
- var _a, _b, _c;
96
+ var _a, _b, _c, _d;
96
97
  (_a = this.ownerElement) === null || _a === void 0 ? void 0 : _a.removeEventListener('mouseover', this.showTooltip);
97
98
  (_b = this.ownerElement) === null || _b === void 0 ? void 0 : _b.removeEventListener('mouseout', this.hideTooltip);
98
- (_c = this.ownerElement) === null || _c === void 0 ? void 0 : _c.removeEventListener('click', this.hideTooltip);
99
+ (_c = this.ownerElement) === null || _c === void 0 ? void 0 : _c.removeEventListener('focus', this.showTooltip);
100
+ (_d = this.ownerElement) === null || _d === void 0 ? void 0 : _d.removeEventListener('blur', this.hideTooltip);
99
101
  }
100
102
  getOwnerElement() {
101
103
  let element = this.host;
@@ -1 +1 @@
1
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AC;EACtE,CAAC;EAcO,eAAe;IACnB,IAAI,OAAO,GAAS,IAAI,CAAC,IAAI,CAAC;IAE9B,GAAG;MACC,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC;KAChC,QACG,OAAO;MACP,OAAO,CAAC,QAAQ,KAAK,IAAI,CAAC,sBAAsB;MAChD,OAAO,CAAC,QAAQ,KAAK,IAAI,CAAC,aAAa,EACzC;IAEF,OAAQ,OAAsB,aAAtB,OAAO,uBAAP,OAAO,CAAiB,cAAc,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;EACnE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import { Component, h, Prop, Element, State } from '@stencil/core';\nimport { JSX } from 'react';\nimport { createRandomString } from '../../util/random-string';\nimport { OpenDirection } from '../menu/menu.types';\n\nconst DEFAULT_MAX_LENGTH = 50;\n\n/**\n * A tooltip can be used to display a descriptive text for any element.\n * The displayed content must be a brief and supplemental string of text,\n * identifying the element or describing its function for the user,\n * helping them better understand unfamiliar objects that aren't described\n * directly in the UI.\n *\n * ## Interaction\n * The tooltip appears after a slight delay, when the element is hovered;\n * and disappears as soon as the cursor leaves the element.\n * Therefore, users cannot interact with the tip, but if the trigger element\n * itself is interactive, it will remain interactible even with a tooltip bound\n * to it.\n *\n * :::note\n * In order to display the tooltip, the tooltip element and its trigger element\n * must be within the same document or document fragment (the same shadowRoot).\n * Often, it's easiest to just place them next to each other like in the example\n * below, but if you need to, you can place them differently.\n *\n * ```html\n * <limel-button icon=\"search\" id=\"tooltip-example\" />\n * <limel-tooltip label=\"Search\" elementId=\"tooltip-example\" />\n * ```\n * :::\n *\n * ## Usage\n * - Keep in mind that tooltips can be distracting, and can be perceived as an interruption.\n * Use them only when they add significant value.\n * - A good tip is concise, helpful, and informative.\n * Don't explain the obvious or simply repeat what is already on the screen.\n * When used correctly, supplemental info of a tooltip helps to [declutter the UI](/#/DesignGuidelines/decluttering.md/).\n * - If the tip is essential to the primary tasks that the user is performing,\n * such as warnings or important notes, include the information directly in the\n * interface instead.\n * - When a component offers a helper text (e.g. [Input field](/#/component/limel-input-field/)),\n * use that, not a tooltip.\n * - Make sure to use the tooltip on an element that users naturally and\n * effortlessly recognize can be hovered.\n *\n * @exampleComponent limel-example-tooltip-basic\n * @exampleComponent limel-example-tooltip-max-character\n * @exampleComponent limel-example-tooltip-composite\n */\n@Component({\n tag: 'limel-tooltip',\n shadow: true,\n styleUrl: 'tooltip.scss',\n})\nexport class Tooltip {\n /**\n * ID of the owner element that the tooltip should describe.\n * Must be a child within the same document fragment as the tooltip element\n * itself.\n */\n @Prop({ reflect: true })\n public elementId!: string;\n\n /**\n * Short descriptive text of the owner element.\n */\n @Prop({ reflect: true })\n public label!: string;\n\n /**\n * Additional helper text for the element.\n * Example usage can be a keyboard shortcut to activate the function of the\n * owner element.\n */\n @Prop({ reflect: true })\n public helperLabel?: string;\n\n /**\n * The maximum amount of characters before rendering 'label' and\n * 'helperLabel' in two rows.\n */\n @Prop({ reflect: true })\n public maxlength?: number = DEFAULT_MAX_LENGTH;\n\n /**\n * Decides the tooltip's location in relation to its trigger.\n */\n @Prop({ reflect: true })\n public openDirection: OpenDirection = 'top';\n\n @Element()\n private host: HTMLLimelTooltipElement;\n\n @State()\n private open: boolean;\n\n private portalId: string;\n private tooltipId: string;\n private showTooltipTimeoutHandle: number;\n private ownerElement: HTMLElement;\n\n public constructor() {\n this.portalId = createRandomString();\n this.tooltipId = createRandomString();\n }\n\n public connectedCallback() {\n this.ownerElement = this.getOwnerElement();\n this.setOwnerAriaLabel();\n this.addListeners();\n }\n\n public disconnectedCallback() {\n this.removeListeners();\n }\n\n public render(): JSX.Element {\n const tooltipZIndex = getComputedStyle(this.host).getPropertyValue(\n '--tooltip-z-index',\n );\n\n return (\n <div class=\"trigger-anchor\">\n <limel-portal\n openDirection={this.openDirection}\n visible={this.open}\n containerId={this.portalId}\n containerStyle={{\n 'z-index': tooltipZIndex,\n 'pointer-events': 'none',\n }}\n anchor={this.ownerElement}\n >\n <limel-tooltip-content\n label={this.label}\n helperLabel={this.helperLabel}\n maxlength={this.maxlength}\n role=\"tooltip\"\n aria-hidden={!this.open}\n id={this.tooltipId}\n />\n </limel-portal>\n </div>\n );\n }\n\n private setOwnerAriaLabel() {\n this.ownerElement?.setAttribute('aria-describedby', this.tooltipId);\n }\n\n private addListeners() {\n this.ownerElement?.addEventListener('mouseover', this.showTooltip);\n this.ownerElement?.addEventListener('mouseout', this.hideTooltip);\n this.ownerElement?.addEventListener('click', this.hideTooltip);\n }\n\n private removeListeners() {\n this.ownerElement?.removeEventListener('mouseover', this.showTooltip);\n this.ownerElement?.removeEventListener('mouseout', this.hideTooltip);\n this.ownerElement?.removeEventListener('click', this.hideTooltip);\n }\n\n private showTooltip = () => {\n const tooltipDelay = 500;\n this.showTooltipTimeoutHandle = window.setTimeout(() => {\n this.open = true;\n }, tooltipDelay);\n };\n\n private hideTooltip = () => {\n clearTimeout(this.showTooltipTimeoutHandle);\n this.open = false;\n };\n\n private getOwnerElement(): HTMLElement | undefined {\n let element: Node = this.host;\n\n do {\n element = element.parentNode;\n } while (\n element &&\n element.nodeType !== Node.DOCUMENT_FRAGMENT_NODE &&\n element.nodeType !== Node.DOCUMENT_NODE\n );\n\n return (element as ShadowRoot)?.getElementById(this.elementId);\n }\n}\n"]}
1
+ {"version":3,"file":"tooltip.js","sourceRoot":"","sources":["../../../src/components/tooltip/tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAG9D,MAAM,kBAAkB,GAAG,EAAE,CAAC;AAE9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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CAAC;KAChC,QACG,OAAO;MACP,OAAO,CAAC,QAAQ,KAAK,IAAI,CAAC,sBAAsB;MAChD,OAAO,CAAC,QAAQ,KAAK,IAAI,CAAC,aAAa,EACzC;IAEF,OAAQ,OAAsB,aAAtB,OAAO,uBAAP,OAAO,CAAiB,cAAc,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;EACnE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import { Component, h, Prop, Element, State } from '@stencil/core';\nimport { JSX } from 'react';\nimport { createRandomString } from '../../util/random-string';\nimport { OpenDirection } from '../menu/menu.types';\n\nconst DEFAULT_MAX_LENGTH = 50;\n\n/**\n * A tooltip can be used to display a descriptive text for any element.\n * The displayed content must be a brief and supplemental string of text,\n * identifying the element or describing its function for the user,\n * helping them better understand unfamiliar objects that aren't described\n * directly in the UI.\n *\n * ## Interaction\n * The tooltip appears after a slight delay, when the element is hovered;\n * and disappears as soon as the cursor leaves the element.\n * Therefore, users cannot interact with the tip, but if the trigger element\n * itself is interactive, it will remain interactible even with a tooltip bound\n * to it.\n *\n * :::note\n * In order to display the tooltip, the tooltip element and its trigger element\n * must be within the same document or document fragment (the same shadowRoot).\n * Often, it's easiest to just place them next to each other like in the example\n * below, but if you need to, you can place them differently.\n *\n * ```html\n * <limel-button icon=\"search\" id=\"tooltip-example\" />\n * <limel-tooltip label=\"Search\" elementId=\"tooltip-example\" />\n * ```\n * :::\n *\n * ## Usage\n * - Keep in mind that tooltips can be distracting, and can be perceived as an interruption.\n * Use them only when they add significant value.\n * - A good tip is concise, helpful, and informative.\n * Don't explain the obvious or simply repeat what is already on the screen.\n * When used correctly, supplemental info of a tooltip helps to [declutter the UI](/#/DesignGuidelines/decluttering.md/).\n * - If the tip is essential to the primary tasks that the user is performing,\n * such as warnings or important notes, include the information directly in the\n * interface instead.\n * - When a component offers a helper text (e.g. [Input field](/#/component/limel-input-field/)),\n * use that, not a tooltip.\n * - Make sure to use the tooltip on an element that users naturally and\n * effortlessly recognize can be hovered.\n *\n * @exampleComponent limel-example-tooltip-basic\n * @exampleComponent limel-example-tooltip-max-character\n * @exampleComponent limel-example-tooltip-composite\n */\n@Component({\n tag: 'limel-tooltip',\n shadow: true,\n styleUrl: 'tooltip.scss',\n})\nexport class Tooltip {\n /**\n * ID of the owner element that the tooltip should describe.\n * Must be a child within the same document fragment as the tooltip element\n * itself.\n */\n @Prop({ reflect: true })\n public elementId!: string;\n\n /**\n * Short descriptive text of the owner element.\n */\n @Prop({ reflect: true })\n public label!: string;\n\n /**\n * Additional helper text for the element.\n * Example usage can be a keyboard shortcut to activate the function of the\n * owner element.\n */\n @Prop({ reflect: true })\n public helperLabel?: string;\n\n /**\n * The maximum amount of characters before rendering 'label' and\n * 'helperLabel' in two rows.\n */\n @Prop({ reflect: true })\n public maxlength?: number = DEFAULT_MAX_LENGTH;\n\n /**\n * Decides the tooltip's location in relation to its trigger.\n */\n @Prop({ reflect: true })\n public openDirection: OpenDirection = 'top';\n\n @Element()\n private host: HTMLLimelTooltipElement;\n\n @State()\n private open: boolean;\n\n private portalId: string;\n private tooltipId: string;\n private showTooltipTimeoutHandle: number;\n private ownerElement: HTMLElement;\n\n public constructor() {\n this.portalId = createRandomString();\n this.tooltipId = createRandomString();\n }\n\n public connectedCallback() {\n this.ownerElement = this.getOwnerElement();\n this.setOwnerAriaLabel();\n this.addListeners();\n }\n\n public disconnectedCallback() {\n this.removeListeners();\n }\n\n public render(): JSX.Element {\n const tooltipZIndex = getComputedStyle(this.host).getPropertyValue(\n '--tooltip-z-index',\n );\n\n return (\n <div class=\"trigger-anchor\">\n <limel-portal\n openDirection={this.openDirection}\n visible={this.open}\n containerId={this.portalId}\n containerStyle={{\n 'z-index': tooltipZIndex,\n 'pointer-events': 'none',\n }}\n anchor={this.ownerElement}\n >\n <limel-tooltip-content\n label={this.label}\n helperLabel={this.helperLabel}\n maxlength={this.maxlength}\n role=\"tooltip\"\n aria-hidden={!this.open}\n id={this.tooltipId}\n />\n </limel-portal>\n </div>\n );\n }\n\n private setOwnerAriaLabel() {\n this.ownerElement?.setAttribute('aria-describedby', this.tooltipId);\n }\n\n private addListeners() {\n this.ownerElement?.addEventListener('mouseover', this.showTooltip);\n this.ownerElement?.addEventListener('mouseout', this.hideTooltip);\n this.ownerElement?.addEventListener('focus', this.showTooltip);\n this.ownerElement?.addEventListener('blur', this.hideTooltip);\n }\n\n private removeListeners() {\n this.ownerElement?.removeEventListener('mouseover', this.showTooltip);\n this.ownerElement?.removeEventListener('mouseout', this.hideTooltip);\n this.ownerElement?.removeEventListener('focus', this.showTooltip);\n this.ownerElement?.removeEventListener('blur', this.hideTooltip);\n }\n\n private showTooltip = () => {\n const tooltipDelay = 500;\n this.showTooltipTimeoutHandle = window.setTimeout(() => {\n this.open = true;\n }, tooltipDelay);\n };\n\n private hideTooltip = () => {\n clearTimeout(this.showTooltipTimeoutHandle);\n this.open = false;\n };\n\n private getOwnerElement(): HTMLElement | undefined {\n let element: Node = this.host;\n\n do {\n element = element.parentNode;\n } while (\n element &&\n element.nodeType !== Node.DOCUMENT_FRAGMENT_NODE &&\n element.nodeType !== Node.DOCUMENT_NODE\n );\n\n return (element as ShadowRoot)?.getElementById(this.elementId);\n }\n}\n"]}