@limetech/lime-elements 37.52.7 → 37.52.9

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 (34) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/cjs/limel-breadcrumbs_5.cjs.entry.js +12 -2
  3. package/dist/cjs/limel-breadcrumbs_5.cjs.entry.js.map +1 -1
  4. package/dist/cjs/limel-date-picker.cjs.entry.js +1 -6
  5. package/dist/cjs/limel-date-picker.cjs.entry.js.map +1 -1
  6. package/dist/cjs/limel-dynamic-label_4.cjs.entry.js +0 -9
  7. package/dist/cjs/limel-dynamic-label_4.cjs.entry.js.map +1 -1
  8. package/dist/collection/components/date-picker/date-picker.js +1 -6
  9. package/dist/collection/components/date-picker/date-picker.js.map +1 -1
  10. package/dist/collection/components/input-field/input-field.js +12 -2
  11. package/dist/collection/components/input-field/input-field.js.map +1 -1
  12. package/dist/collection/components/menu-surface/menu-surface.js +0 -9
  13. package/dist/collection/components/menu-surface/menu-surface.js.map +1 -1
  14. package/dist/esm/limel-breadcrumbs_5.entry.js +12 -2
  15. package/dist/esm/limel-breadcrumbs_5.entry.js.map +1 -1
  16. package/dist/esm/limel-date-picker.entry.js +1 -6
  17. package/dist/esm/limel-date-picker.entry.js.map +1 -1
  18. package/dist/esm/limel-dynamic-label_4.entry.js +0 -9
  19. package/dist/esm/limel-dynamic-label_4.entry.js.map +1 -1
  20. package/dist/lime-elements/lime-elements.esm.js +1 -1
  21. package/dist/lime-elements/p-242763b6.entry.js +68 -0
  22. package/dist/lime-elements/p-242763b6.entry.js.map +1 -0
  23. package/dist/lime-elements/{p-9a895330.entry.js → p-25ee1656.entry.js} +2 -2
  24. package/dist/lime-elements/p-25ee1656.entry.js.map +1 -0
  25. package/dist/lime-elements/p-b76d8f4f.entry.js +2 -0
  26. package/dist/lime-elements/p-b76d8f4f.entry.js.map +1 -0
  27. package/dist/types/components/input-field/input-field.d.ts +1 -0
  28. package/dist/types/components/menu-surface/menu-surface.d.ts +0 -1
  29. package/package.json +1 -1
  30. package/dist/lime-elements/p-5d2eaff4.entry.js +0 -2
  31. package/dist/lime-elements/p-5d2eaff4.entry.js.map +0 -1
  32. package/dist/lime-elements/p-773e3d4f.entry.js +0 -68
  33. package/dist/lime-elements/p-773e3d4f.entry.js.map +0 -1
  34. package/dist/lime-elements/p-9a895330.entry.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"names":["breadcrumbsCss","Breadcrumbs","this","renderSteps","allStepsWithoutLast","items","slice","areItemsLinks","map","renderAsLink","renderAsButton","item","tooltipId","createRandomString","h","role","id","class","onClick","handleClick","renderIcon","renderLabel","renderTooltip","href","link","title","renderLastStep","lastItem","tabindex","text","name","getIconName","icon","color","getIconColor","style","type","elementId","label","some","event","stopPropagation","select","emit","render","divider","componentWillLoad","makeEnterClickable","host","disconnectedCallback","removeEnterClickable","inputFieldCss","DEBOUNCE_TIMEOUT","InputField","constructor","hostRef","completionsList","changeWaiting","initialize","element","limelInputField","shadowRoot","querySelector","mdcTextField","MDCTextField","value","invalid","valid","mapCompletions","window","addEventListener","layout","passive","setFocus","completions","focus","getContainerClassList","classList","isInvalid","disabled","readonly","required","isEmpty","hasPrefix","hasSuffix","helperText","maxlength","leadingIcon","getTrailingIcon","_a","inputElement","validity","badInput","getCurrentValue","renderInput","properties","Object","assign","pattern","onWheel","handleWheel","onKeyDown","placeholder","renderTextarea","getAdditionalProps","props","step","Number","isInteger","min","max","minlength","onFocus","isFocused","showCompletions","onBlur","validate","changeEmitter","flush","hasHelperText","undefined","hasHelperLine","renderHelperLine","length","helperTextId","maxLength","renderEmptyValueForReadonly","renderSuffix","suffix","renderPrefix","prefix","wasInvalid","checkValidity","setInputElement","labelClassList","labelId","renderLeadingIcon","renderTrailingLinkOrButton","trailingIcon","hasLink","renderLinkIcon","getLink","renderTrailingIcon","showLink","includes","getHref","target","getTarget","linkProps","key","tabIndex","handleIconKeyPress","handleIconClick","renderFormattedNumber","renderValue","formatNumber","Intl","NumberFormat","locale","format","isForwardTab","TAB","keyCode","TAB_KEY_CODE","altKey","metaKey","shiftKey","isUp","ARROW_UP","ARROW_UP_KEY_CODE","isDown","ARROW_DOWN","ARROW_DOWN_KEY_CODE","list","document","portalId","preventDefault","listElement","handleCompletionChange","detail","renderAutocompleteList","dropdownZIndex","getComputedStyle","getPropertyValue","visible","containerId","inheritParentWidth","containerStyle","open","allowClicksElement","display","onDismiss","handleCloseMenu","renderListResult","filteredCompletions","filterCompletions","onChange","handleKeyDownInDropdown","keyFound","ESCAPE","ENTER","keyCodeFound","ESCAPE_KEY_CODE","ENTER_KEY_CODE","filter","completion","toLowerCase","indexOf","handleInput","data","debounce","change","handleChange","action","isEnter","isSpace","SPACE","SPACE_KEY_CODE","globalConfig","defaultLocale","connectedCallback","componentDidLoad","destroy","removeEventListener","componentDidUpdate","ref","onInput","ariaControls","valueWatcher","newValue","completionsWatcher","menuCss","DEFAULT_ROOT_BREADCRUMBS_ITEM","Menu","renderLoader","loadingSubItems","loading","cssProperties","getCssProperties","width","padding","size","limeBranded","renderBreadcrumb","breadcrumbsItems","getBreadcrumbsItems","onSelect","handleBreadcrumbsSelect","menuItem","currentSubMenu","clearSearch","navigateMenu","handleSelect","renderSearchField","searcher","setSearchElement","searchValue","handleTextInput","handleInputKeyDown","renderEmptyMessage","emptyResultMessage","Array","isArray","searchResults","renderMenuList","visibleItems","gridLayout","badgeIcons","setListElement","handleMenuKeyDown","async","query","result","listItems","querySelectorAll","isBackwardTab","isLeft","ARROW_LEFT","ARROW_LEFT_KEY_CODE","isRight","ARROW_RIGHT","ARROW_RIGHT_KEY_CODE","searchInput","currentItem","getCurrentItem","goForward","goBack","activeItem","_b","attrIndex","_c","attributes","getNamedItem","dataIndex","parseInt","parent","parentItem","setTriggerAttributes","entries","removeAttribute","setAttribute","String","onClose","cancel","onTriggerClick","selectOnEmptyChildren","selectedMenuItem","isFunction","menuLoader","subItems","setTimeout","observer","IntersectionObserver","unobserve","activeElement","observe","focusMenuItem","blur","menuItems","isMenuItem","selectedIndex","Math","findIndex","selected","menuElements","from","renderNotificationBadge","hasNotificationBadge","badge","setTriggerRef","elm","triggerElement","componentDidRender","slotElement","assignedElements","forEach","menuSurfaceWidth","getMenuSurfaceWidth","openDirection","position","itemsWatcher","openWatcher","breadCrumbItems","push","rootItem","reverse","propertyNames","values","property","zipObject","customWidth","surfaceWidth","assignedTriggers","clientWidth","_d","cssClasses","MENU_SELECTED_LIST_ITEM","MENU_SELECTION_GROUP","ROOT","strings","ARIA_CHECKED_ATTR","ARIA_DISABLED_ATTR","CHECKBOX_SELECTOR","LIST_SELECTOR","SELECTED_EVENT","SKIP_RESTORE_FOCUS","numbers","FOCUS_ROOT_INDEX","DefaultFocusState","MDCMenuFoundation","_super","__extends","adapter","_this","call","__assign","defaultAdapter","closeAnimationEndTimerId","defaultFocusState","LIST_ROOT","defineProperty","get","enumerable","configurable","addClassToElementAtIndex","removeClassFromElementAtIndex","addAttributeToElementAtIndex","removeAttributeFromElementAtIndex","getAttributeFromElementAtIndex","elementContainsClass","closeSurface","getElementIndex","notifySelected","getMenuItemCount","focusItemAtIndex","focusListRoot","getSelectedSiblingOfItemAtIndex","isSelectableItemAtIndex","prototype","clearTimeout","handleKeydown","evt","isTab","handleItemAction","listItem","index","skipRestoreFocus","recomputedIndex","setSelectedIndex","MDCMenuSurfaceFoundation","TRANSITION_CLOSE_DURATION","handleMenuSurfaceOpened","FIRST_ITEM","LAST_ITEM","NONE","setDefaultFocusState","focusState","getSelectedIndex","validatedIndex","Error","prevSelectedIndex","setEnabled","isEnabled","listCssClasses","LIST_ITEM_DISABLED_CLASS","menuSize","isIndexInRange","MDCFoundation","MDCMenu","apply","arguments","attachTo","root","menuSurfaceFactory","listFactory","el","MDCMenuSurface","MDCList","initialSyncWithDOM","menuSurface","wrapFocus","foundation","listen","OPENED_EVENT","MDCListFoundation","ACTION_EVENT","unlisten","isOpen","set","close","hasTypeahead","typeaheadInProgress","typeaheadMatchItem","nextChar","startingIndex","listElements","singleSelection","listConstants","UNSET_INDEX","quickOpen","setAnchorCorner","corner","setAnchorMargin","margin","getOptionByIndex","getPrimaryTextAtIndex","getPrimaryText","setFixedPosition","isFixed","setIsHoisted","isHoisted","setAbsolutePosition","x","y","setAnchorElement","anchorElement","getDefaultFoundation","className","add","remove","attr","getAttribute","contains","evtData","closest","selectionGroupEl","selectedItemEl","MDCComponent","MenuListRenderer","defaultConfig","getIndexForWhichToApplyTabIndex","i","renderMenuItem","rendertext","classNames","applyTabIndexToItemAtIndex","config","renderText","renderSubMenuIcon","renderNotification","twoLines","avatarList","renderDivider","isSimpleItem","renderCommandText","secondaryText","hasSubItems","commandText","iconColor","iconSize","classes","commandKey","hasIcons","selectable","menuListCss","menuStrings","MenuList","setup","setupMenu","setupListeners","mdcMenu","teardown","MDCRipple","handleMenuSelect","handleSingleSelect","MenuItems","selectedItem","find","triggerIconColorWarning","html","handleType","itemsChanged","console","warn","spinnerCss","Spinner","viewBox","xmlns","renderSpinner","cx","cy","r","d"],"sources":["./src/components/breadcrumbs/breadcrumbs.scss?tag=limel-breadcrumbs&encapsulation=shadow","./src/components/breadcrumbs/breadcrumbs.tsx","./src/components/input-field/input-field.scss?tag=limel-input-field&encapsulation=shadow","./src/components/input-field/input-field.tsx","./src/components/menu/menu.scss?tag=limel-menu&encapsulation=shadow","./src/components/menu/menu.tsx","./node_modules/@material/menu/constants.js","./node_modules/@material/menu/foundation.js","./node_modules/@material/menu/component.js","./src/components/menu-list/menu-list-renderer.tsx","./src/components/menu-list/menu-list.scss?tag=limel-menu-list&encapsulation=shadow","./src/components/menu-list/menu-list.tsx","./src/components/spinner/spinner.scss?tag=limel-spinner&encapsulation=shadow","./src/components/spinner/spinner.tsx"],"sourcesContent":["@use '../../style/mixins';\n\n/**\n* @prop --breadcrumbs-item-text-color: Text color of breadcrumbs items, defaults to `--contrast-1100`.\n* @prop --breadcrumbs-item-max-width: Maximum width of a button in the breadcrumbs. Defaults to `10rem`. Keep in mind that the buttons should not appear too big.\n*/\n\n$padding: 0.5rem;\n\n:host(limel-breadcrumbs) {\n --limel-breadcrumbs-item-height: 1.5rem;\n --limel-breadcrumbs-gap: 0.75rem;\n --limel-breadcrumbs-gap: 0.75rem;\n --limel-breadcrumbs-item-text-color: var(\n --breadcrumbs-item-text-color,\n rgb(var(--contrast-1500))\n );\n @include mixins.fade-out-overflowed-content-on-edges(horizontally);\n --limel-left-edge-fade-width: #{$padding};\n --limel-right-edge-fade-width: #{$padding};\n}\n\nol,\nli,\n.step {\n all: unset;\n}\n\n* {\n box-sizing: border-box;\n}\n\nol {\n padding: $padding; // needed for the focus and hover effects, since we are using overflow\n gap: var(--limel-breadcrumbs-gap);\n}\n\n.step {\n position: relative;\n\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 0.25rem;\n\n max-width: var(--breadcrumbs-item-max-width, 10rem);\n height: var(--limel-breadcrumbs-item-height);\n\n color: var(--limel-breadcrumbs-item-text-color);\n border-radius: 100vw;\n font-size: 0.875rem;\n padding: 0 0.25rem;\n\n &:not(:has(.text)) {\n padding: 0 0.125rem;\n }\n\n &:not(.last) {\n @include mixins.visualize-keyboard-focus;\n\n &:after {\n content: var(--limel-breadcrumbs-divider);\n display: flex;\n align-items: center;\n justify-content: center;\n\n width: var(--limel-breadcrumbs-gap);\n\n position: absolute;\n top: 0;\n right: calc(var(--limel-breadcrumbs-gap) * -1);\n bottom: 0;\n left: auto;\n\n text-align: center;\n }\n }\n}\n\na.step {\n @include mixins.hyperlink($color: var(--limel-breadcrumbs-item-text-color));\n}\n\nbutton.step {\n &:not(.last) {\n @include mixins.is-flat-clickable(\n $color: var(--limel-breadcrumbs-item-text-color)\n );\n }\n}\n\nlimel-icon {\n flex-shrink: 0;\n width: calc(var(--limel-breadcrumbs-item-height) - 0.25rem);\n height: calc(var(--limel-breadcrumbs-item-height) - 0.25rem);\n}\n\n.text {\n @include mixins.truncate-text;\n padding: 0 0.25rem;\n}\n\n.last {\n opacity: 0.7;\n}\n\n// LAYOUT:\n// The code below makes sure that the last item is always visible,\n// and previous items overflow out of the container\n// while keeping the container scrollable.\n// All without any additional scripts in the component code.\n\n:host(limel-breadcrumbs) {\n box-sizing: border-box;\n\n display: flex;\n width: 100%;\n overflow-x: auto;\n scrollbar-width: none; // This hides the scrollbars appearing under in Firefox\n -ms-overflow-style: none; // Same as above for IE 11\n &::-webkit-scrollbar {\n display: none; // This hides the scrollbars appearing under in Chrome\n }\n\n direction: rtl;\n}\n\nol {\n display: flex;\n flex-direction: row-reverse;\n justify-content: flex-end;\n margin-right: auto;\n}\n\n.step {\n direction: ltr;\n}\n","import {\n Component,\n Element,\n h,\n Event,\n EventEmitter,\n Prop,\n} from '@stencil/core';\nimport { BreadcrumbsItem } from './breadcrumbs.types';\nimport {\n makeEnterClickable,\n removeEnterClickable,\n} from '../../util/make-enter-clickable';\nimport { createRandomString } from '../../util/random-string';\nimport { getIconColor, getIconName } from '../icon/get-icon-props';\n\n/**\n * A Breadcrumb consists of a list of distinct \"places\" that a user has gone through,\n * before ending up where they are right now, in a website or an application.\n *\n * These \"places\" can be for example _pages_ of a website, which are hierarchically\n * laid out before the current page that the user is looking at.\n * They could also be _steps_ which the user has gone through, which perhaps have no\n * hierarchical relation with each other, but has eventually led the user \"here\".\n *\n * :::note\n * - Where the user currently is, is always the last step of the breadcrumb.\n * - A breadcrumbs never shows where users can go after this place.\n * It only illustrates where user has been before ending up here.\n * If the path that a user can take is not changing and if next steps are clear,\n * you can use the [Progress flow component](#/component/limel-progress-flow) instead.\n * :::\n *\n * Breadcrumbs are often placed horizontally before the main content of the current screen.\n *\n * @exampleComponent limel-example-breadcrumbs-links\n * @exampleComponent limel-example-breadcrumbs-buttons\n * @exampleComponent limel-example-breadcrumbs-icons\n * @exampleComponent limel-example-breadcrumbs-divider\n * @exampleComponent limel-example-breadcrumbs-icon-color\n * @exampleComponent limel-example-breadcrumbs-styling\n */\n\n@Component({\n tag: 'limel-breadcrumbs',\n shadow: true,\n styleUrl: 'breadcrumbs.scss',\n})\nexport class Breadcrumbs {\n /**\n * List of items in the breadcrumbs,\n * each representing a step or a page.\n */\n @Prop()\n public items: BreadcrumbsItem[];\n\n /**\n * The visual divider that separates items.\n * It must be a single character such as `-` or `,`.\n */\n @Prop()\n public divider: string = '›';\n\n /**\n * Fired when clicking on buttons (not links!)\n * inside the breadcrumbs.\n */\n @Event()\n public select: EventEmitter<BreadcrumbsItem>;\n\n @Element()\n private host: HTMLLimelBreadcrumbsElement;\n\n public render() {\n return (\n <ol\n role=\"navigation\"\n aria-label=\"Breadcrumb\"\n style={{ '--limel-breadcrumbs-divider': `'${this.divider}'` }}\n >\n {this.renderSteps()}\n {this.renderLastStep()}\n </ol>\n );\n }\n\n public componentWillLoad() {\n makeEnterClickable(this.host);\n }\n\n public disconnectedCallback() {\n removeEnterClickable(this.host);\n }\n\n private renderSteps = () => {\n const allStepsWithoutLast = this.items.slice(0, -1);\n\n if (this.areItemsLinks(this.items)) {\n return allStepsWithoutLast.map(this.renderAsLink);\n }\n\n return allStepsWithoutLast.map(this.renderAsButton);\n };\n\n private renderAsButton = (item: BreadcrumbsItem) => {\n const tooltipId = createRandomString();\n\n return [\n <button\n role=\"listitem\"\n id={tooltipId}\n class=\"step\"\n onClick={this.handleClick(item)}\n >\n {this.renderIcon(item)}\n {this.renderLabel(item)}\n </button>,\n this.renderTooltip(item, tooltipId),\n ];\n };\n\n private renderAsLink = (item: BreadcrumbsItem) => {\n const tooltipId = createRandomString();\n\n return [\n <a\n role=\"listitem\"\n id={tooltipId}\n class=\"step\"\n href={item.link.href}\n title={item.link.title}\n >\n {this.renderIcon(item)}\n {this.renderLabel(item)}\n </a>,\n this.renderTooltip(item, tooltipId),\n ];\n };\n\n private renderLastStep = () => {\n const lastItem = this.items.slice(-1);\n\n return (\n <li\n class=\"last step\"\n tabindex=\"-1\"\n aria-current={this.areItemsLinks(this.items) ? 'page' : 'step'}\n >\n {this.renderIcon(lastItem[0])}\n <span class=\"text\">{lastItem[0].text}</span>\n </li>\n );\n };\n\n private renderIcon = (item: BreadcrumbsItem) => {\n const name = getIconName(item.icon);\n const color = getIconColor(item.icon);\n\n if (!name) {\n return;\n }\n\n return (\n <limel-icon\n style={{\n color: `${color}`,\n }}\n name={name}\n />\n );\n };\n\n private renderLabel = (item: BreadcrumbsItem) => {\n if (item.type === 'icon-only') {\n return;\n }\n\n return <span class=\"text\">{item.text}</span>;\n };\n\n private renderTooltip = (item: BreadcrumbsItem, tooltipId: string) => {\n if (item.type === 'icon-only') {\n return <limel-tooltip elementId={tooltipId} label={item.text} />;\n }\n };\n\n private areItemsLinks = (items: BreadcrumbsItem[]) => {\n return items.some((item) => 'link' in item);\n };\n\n private handleClick = (item: BreadcrumbsItem) => (event: MouseEvent) => {\n event.stopPropagation();\n this.select.emit(item);\n };\n}\n","@use '../../style/internal/z-index';\n@use '../../style/functions';\n@use '../../style/internal/shared_input-select-picker';\n@use '../../style/mixins';\n\n@use '../../style/internal/lime-theme';\n\n@use '@material/textfield';\n@use '@material/textfield/icon';\n@use '@material/notched-outline/mdc-notched-outline';\n@use '@material/floating-label';\n@use '@material/floating-label/mdc-floating-label';\n@use '@material/ripple';\n@use '@material/list';\n@use '@material/elevation';\n@use '@material/menu-surface';\n\n/**\n * @prop --textarea-height: Height of the field when type is set to `textarea`\n */\n\n:host {\n position: relative;\n display: block;\n}\n\n:host([hidden]) {\n display: none;\n}\n\n:host([type='textarea']) {\n height: var(--textarea-height, 100%);\n\n .mdc-text-field.mdc-text-field--textarea {\n height: var(--textarea-height, 100%);\n\n .mdc-text-field__input {\n @include shared_input-select-picker.input-field-placeholder;\n margin-top: functions.pxToRem(8);\n margin-bottom: 0;\n }\n }\n}\n\n@include mixins.hide-helper-line-when-not-needed(limel-input-field);\n\n@include textfield.core-styles;\n@include icon.icon-core-styles;\n\n@include shared_input-select-picker.outlined-style-overrides;\n@include shared_input-select-picker.readonly-overrides;\n@include shared_input-select-picker.cropped-label-hack;\n@include shared_input-select-picker.disabled-overrides;\n@include shared_input-select-picker.leading-icon;\n@include shared_input-select-picker.trailing-icon;\n@include shared_input-select-picker.floating-label-overrides;\n@include shared_input-select-picker.lime-empty-value-for-readonly;\n@include shared_input-select-picker.lime-looks-like-input-value;\n\n.lime-text-field--empty {\n .mdc-text-field__icon--trailing {\n @include shared_input-select-picker.looks-disabled;\n pointer-events: none;\n box-shadow: none !important;\n }\n}\n\n.mdc-text-field {\n width: 100%;\n\n &:not(.mdc-text-field--disabled) {\n .mdc-text-field__affix,\n .mdc-text-field__icon {\n color: rgb(var(--contrast-900));\n }\n }\n &.mdc-text-field--disabled {\n .mdc-text-field__affix,\n .mdc-text-field__icon {\n color: rgb(var(--contrast-700));\n }\n }\n}\n\n.lime-formatted-input {\n display: none;\n width: calc(100% - #{functions.pxToRem(20)});\n z-index: z-index.$input-field--formatted-value;\n\n pointer-events: none;\n\n .mdc-text-field:not(.mdc-text-field--focused):not(.mdc-text-field--invalid)\n & {\n display: block;\n }\n\n + .mdc-text-field__input {\n z-index: z-index.$input-field--input-with-formatted-value;\n }\n}\n\n.mdc-text-field:not(.mdc-text-field--focused):not(.mdc-text-field--invalid) {\n .mdc-text-field__input[type='number'] {\n color: transparent;\n -webkit-text-fill-color: transparent;\n }\n\n &.lime-text-field--readonly {\n .mdc-text-field__input[type='number'] {\n visibility: hidden;\n // Not having `visibility: hidden;` makes the unformatted\n // value selectable; which is not so nice when users\n // click drag to select content on the screen.\n // The reason to have it only on `readonly` mode is\n // 1. This is the use case where it makes most sense\n // 2. We don't want to repeat the same thing in the\n // accessibility tree, and make it readable for assistive\n // technologies.\n // 3. When not readonly, clicking on the `<input />`\n // element sets the focus and activates the edit mode.\n // So we cannot always have it `hidden` on.\n // which is why we have instead\n // `color: transparent` a few lines before this.\n }\n }\n}\n\n.autocomplete-list-container {\n position: relative;\n}\n\n.autocomplete-list {\n background-color: var(--lime-elevated-surface-background-color);\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n max-height: functions.pxToRem(200);\n overflow-y: auto;\n}\n\n.mdc-deprecated-list-item {\n cursor: pointer;\n}\n\ninput.mdc-text-field__input {\n @include shared_input-select-picker.input-field-placeholder;\n\n &::-webkit-search-cancel-button {\n @include mixins.clear-all-button;\n\n -webkit-appearance: none;\n\n position: absolute;\n right: 0;\n top: 0;\n bottom: 0;\n margin: auto;\n\n &:active {\n transform: none; //Makes the \"clear-all button\" work\n }\n .mdc-text-field--label-floating & {\n opacity: 1;\n }\n }\n}\n\n@import './partial-styles/trailing-icon.scss';\n@import './partial-styles/readonly';\n\n// To make the input field render smaller than the default MDC UI\n.mdc-text-field {\n &.mdc-text-field--outlined {\n height: shared_input-select-picker.$height-of-mdc-text-field;\n }\n}\n.mdc-text-field--with-trailing-icon {\n .mdc-text-field__icon:last-child {\n padding: 0.25rem;\n margin-right: 0.25rem;\n }\n}\n.mdc-text-field--outlined.mdc-text-field--with-leading-icon {\n .mdc-text-field__icon--leading {\n margin-left: 0.25rem;\n }\n .mdc-floating-label {\n left: 1.5rem;\n }\n}\n","import { MDCTextField } from '@material/textfield';\nimport {\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Prop,\n State,\n Watch,\n} from '@stencil/core';\nimport { debounce } from 'lodash-es';\nimport {\n ARROW_DOWN,\n ARROW_DOWN_KEY_CODE,\n ARROW_UP,\n ARROW_UP_KEY_CODE,\n ENTER,\n ENTER_KEY_CODE,\n ESCAPE,\n ESCAPE_KEY_CODE,\n SPACE,\n SPACE_KEY_CODE,\n TAB,\n TAB_KEY_CODE,\n} from '../../util/keycodes';\nimport { InputType } from '../input-field/input-field.types';\nimport { ListItem } from '../list/list-item.types';\nimport { getHref, getTarget } from '../../util/link-helper';\nimport { JSXBase } from '@stencil/core/internal';\nimport { createRandomString } from '../../util/random-string';\nimport { LimelListCustomEvent } from '../../components';\nimport { globalConfig } from '../../global/config';\n\ninterface LinkProperties {\n href: string;\n target?: string;\n}\n\nconst DEBOUNCE_TIMEOUT = 300;\n\n/**\n * @exampleComponent limel-example-input-field-text\n * @exampleComponent limel-example-input-field-placeholder\n * @exampleComponent limel-example-input-field-text-multiple\n * @exampleComponent limel-example-input-field-number\n * @exampleComponent limel-example-input-field-autocomplete\n * @exampleComponent limel-example-input-field-icon-leading\n * @exampleComponent limel-example-input-field-icon-trailing\n * @exampleComponent limel-example-input-field-icon-both\n * @exampleComponent limel-example-input-field-showlink\n * @exampleComponent limel-example-input-field-error-icon\n * @exampleComponent limel-example-input-field-textarea\n * @exampleComponent limel-example-input-field-suffix\n * @exampleComponent limel-example-input-field-prefix\n * @exampleComponent limel-example-input-field-search\n * @exampleComponent limel-example-input-field-pattern\n * @exampleComponent limel-example-input-field-focus\n */\n@Component({\n tag: 'limel-input-field',\n shadow: true,\n styleUrl: 'input-field.scss',\n})\nexport class InputField {\n /**\n * Set to `true` to disable the field.\n * Use `disabled` to indicate that the field can normally be interacted\n * with, but is currently disabled. This tells the user that if certain\n * requirements are met, the field may become enabled again.\n */\n @Prop({ reflect: true })\n public disabled = false;\n\n /**\n * Set to `true` to make the field read-only.\n * Use `readonly` when the field is only there to present the data it holds,\n * and will not become possible for the current user to edit.\n */\n @Prop({ reflect: true })\n public readonly = false;\n\n /**\n * Set to `true` to indicate that the current value of the input field is\n * invalid.\n */\n @Prop({ reflect: true })\n public invalid = false;\n\n /**\n * The input label.\n */\n @Prop({ reflect: true })\n public label: string;\n\n /**\n * The placeholder text shown inside the input field, when the field is focused and empty.\n */\n @Prop({ reflect: true })\n public placeholder: 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 * A short piece of text to display before the value inside the input field.\n * Displayed for all types except `textarea`.\n */\n @Prop({ reflect: true })\n public prefix: string;\n\n /**\n * A short piece of text to display after the value inside the input field.\n * Displayed for all types except `textarea`.\n */\n @Prop({ reflect: true })\n public suffix: string;\n\n /**\n * Set to `true` to indicate that the field is required.\n */\n @Prop({ reflect: true })\n public required = false;\n\n /**\n * The value of the field.\n */\n @Prop({ reflect: true })\n public value: string;\n\n /**\n * Trailing icon to show to the far right in the field.\n */\n @Prop({ reflect: true })\n public trailingIcon: string;\n\n /**\n * Leading icon to show to the far left in the field.\n */\n @Prop({ reflect: true })\n public leadingIcon: string;\n\n /**\n * Regular expression that the current value of the input field must match.\n * No forward slashes should be specified around the pattern.\n * Only used if type is `text`, `tel`, `email`, `url`, `urlAsText`,\n * `password`, or `search`.\n */\n @Prop({ reflect: true })\n public pattern: string;\n\n /**\n * Type of input.\n *\n * Note** regarding type `url`: `limel-input` uses the native validation\n * built into the browser for many types of input fields. The native\n * validation for `url` is very strict, and does not allow relative urls,\n * nor any other formats that are not a \"fully qualified\" url. To allow\n * such urls, use the type `urlAsText` instead. `urlAsText` works exactly\n * like `text` in all regards, except that it enables use of the `showLink`\n * property.\n */\n @Prop({ reflect: true })\n public type: InputType = 'text';\n\n /**\n * Set to `true` to format the current value of the input field only\n * if the field is of type number.\n * The number format is determined by the current language of the browser.\n */\n @Prop({ reflect: true })\n public formatNumber = true;\n\n /**\n * Incremental values that are valid if the field type is `number`.\n */\n @Prop({ reflect: true })\n public step: number | 'any' = 'any';\n\n /**\n * Maximum allowed value if input type is `number`.\n */\n @Prop({ reflect: true })\n public max: number;\n\n /**\n * Minimum allowed value if input type is `number`.\n */\n @Prop({ reflect: true })\n public min: number;\n\n /**\n * Maximum length of the value if type is `password`, `search`, `tel`,\n * `text`, `url`, or `urlAsText`.\n */\n @Prop({ reflect: true })\n public maxlength: number;\n\n /**\n * Minimum length of the value if type is `password`, `search`, `tel`,\n * `text`, `url`, or `urlAsText`.\n */\n @Prop({ reflect: true })\n public minlength: number;\n\n /**\n * list of suggestions `value` can autocomplete to.\n */\n @Prop()\n public completions: string[] = [];\n\n /**\n * For inputs of type `email`, `tel`, `url`, and `urlAsText`, set this to\n * `true` to show a trailing icon with a `mailto:`,`tel:`, or normal link,\n * respectively. The default icon can be overridden using the `trailingIcon`\n * property.\n */\n @Prop({ reflect: true })\n public showLink = false;\n\n /**\n * The locale to use for formatting numbers.\n */\n @Prop({ reflect: true })\n public locale: string = globalConfig.defaultLocale;\n\n /**\n * Emitted when the input value is changed.\n */\n @Event()\n private change: EventEmitter<string>;\n\n /**\n * Emitted when `trailingIcon` or `leadingIcon` is set\n * and the icon is interacted with.\n */\n @Event()\n private action: EventEmitter<void>;\n\n @Element()\n private limelInputField: HTMLLimelInputFieldElement;\n\n @State()\n private isFocused: boolean = false;\n\n @State()\n private wasInvalid: boolean = false;\n\n @State()\n public showCompletions: boolean = false;\n\n private inputElement?: HTMLInputElement | HTMLTextAreaElement;\n private mdcTextField: MDCTextField;\n private completionsList: ListItem[] = [];\n private portalId: string;\n private helperTextId: string;\n private labelId: string;\n\n private changeWaiting = false;\n\n constructor() {\n this.portalId = createRandomString();\n this.helperTextId = createRandomString();\n this.labelId = createRandomString();\n }\n\n public connectedCallback() {\n this.initialize();\n }\n\n public componentDidLoad() {\n this.initialize();\n }\n\n public disconnectedCallback() {\n if (this.mdcTextField) {\n this.mdcTextField.destroy();\n }\n\n window.removeEventListener('resize', this.layout);\n this.limelInputField.removeEventListener('focus', this.setFocus);\n }\n\n public componentDidUpdate() {\n if (this.invalid) {\n this.mdcTextField.valid = false;\n }\n\n this.mdcTextField.disabled = this.disabled || this.readonly;\n }\n\n public render() {\n const properties = this.getAdditionalProps();\n properties['aria-labelledby'] = this.labelId;\n properties.class = 'mdc-text-field__input';\n properties.ref = this.setInputElement;\n properties.onInput = this.handleInput;\n properties.onChange = this.handleChange;\n properties.onFocus = this.onFocus;\n properties.onBlur = this.onBlur;\n properties.required = this.required;\n properties.readonly = this.readonly;\n properties.disabled = this.disabled || this.readonly;\n\n let ariaControls = '';\n\n if (this.hasHelperText()) {\n ariaControls += this.helperTextId;\n properties['aria-describedby'] = this.helperTextId;\n }\n\n if (this.renderAutocompleteList()) {\n if (ariaControls) {\n ariaControls += ' ';\n }\n\n ariaControls += this.portalId;\n }\n\n if (ariaControls) {\n properties['aria-controls'] = ariaControls;\n }\n\n return [\n <label class={this.getContainerClassList()}>\n <span class=\"mdc-notched-outline\" tabindex=\"-1\">\n <span class=\"mdc-notched-outline__leading\"></span>\n {this.renderLabel()}\n <span class=\"mdc-notched-outline__trailing\"></span>\n </span>\n {this.renderLeadingIcon()}\n {this.renderEmptyValueForReadonly()}\n {this.renderPrefix()}\n {this.renderFormattedNumber()}\n {this.renderInput(properties)}\n {this.renderSuffix()}\n {this.renderTextarea(properties)}\n {this.renderTrailingLinkOrButton()}\n </label>,\n this.renderHelperLine(),\n this.renderAutocompleteList(),\n ];\n }\n\n @Watch('value')\n protected valueWatcher(newValue: string) {\n if (!this.mdcTextField) {\n return;\n }\n\n if (this.changeWaiting) {\n return;\n }\n\n if (\n this.type === 'number' &&\n this.isFocused &&\n Number(newValue) === Number(this.mdcTextField.value)\n ) {\n return;\n }\n\n if (newValue !== this.mdcTextField.value) {\n this.mdcTextField.value = newValue || '';\n }\n\n if (this.wasInvalid) {\n this.validate();\n }\n }\n\n @Watch('completions')\n protected completionsWatcher() {\n this.mapCompletions();\n }\n\n private initialize = () => {\n const element =\n this.limelInputField.shadowRoot.querySelector('.mdc-text-field');\n if (!element) {\n return;\n }\n\n this.mdcTextField = new MDCTextField(element);\n if (this.value) {\n this.mdcTextField.value = this.value;\n }\n\n if (this.invalid) {\n this.mdcTextField.valid = false;\n }\n\n this.mapCompletions();\n\n window.addEventListener('resize', this.layout, { passive: true });\n this.limelInputField.addEventListener('focus', this.setFocus);\n };\n\n private mapCompletions = () => {\n this.completionsList = [...this.completions].map((item) => {\n return { text: item };\n });\n };\n\n private setFocus = () => {\n this.mdcTextField.focus();\n };\n\n private getContainerClassList = () => {\n const classList = {\n 'mdc-text-field': true,\n 'mdc-text-field--no-label': !this.label,\n 'mdc-text-field--outlined': true,\n 'mdc-text-field--invalid': this.isInvalid(),\n 'mdc-text-field--disabled': this.disabled || this.readonly,\n 'lime-text-field--readonly': this.readonly,\n 'mdc-text-field--required': this.required,\n 'lime-text-field--empty': this.isEmpty(),\n 'lime-has-prefix': this.hasPrefix(),\n 'lime-has-suffix': this.hasSuffix(),\n };\n\n if (this.type === 'textarea') {\n classList['mdc-text-field--textarea'] = true;\n classList['has-helper-line'] =\n !!this.helperText || !!this.maxlength;\n } else {\n classList['mdc-text-field--with-leading-icon'] = !!this.leadingIcon;\n classList['mdc-text-field--with-trailing-icon'] =\n !!this.getTrailingIcon();\n }\n\n return classList;\n };\n\n private isEmpty = () => {\n if (this.type === 'number' && this.inputElement?.validity.badInput) {\n return false;\n }\n\n return !this.getCurrentValue();\n };\n\n private getCurrentValue = () => {\n if (this.changeWaiting && this.inputElement) {\n return this.inputElement.value;\n }\n\n return this.value;\n };\n\n private renderInput = (\n properties: JSXBase.InputHTMLAttributes<HTMLInputElement>,\n ) => {\n if (this.type === 'textarea') {\n return;\n }\n\n const type = this.type === 'urlAsText' ? 'text' : this.type;\n\n return (\n <input\n {...properties}\n type={type}\n pattern={this.pattern}\n onWheel={this.handleWheel}\n onKeyDown={this.onKeyDown}\n placeholder={this.placeholder}\n />\n );\n };\n\n private renderTextarea = (\n properties: JSXBase.TextareaHTMLAttributes<HTMLTextAreaElement>,\n ) => {\n if (this.type !== 'textarea') {\n return;\n }\n\n return (\n <span class=\"mdc-text-field__resizer\">\n <textarea\n {...properties}\n placeholder={this.placeholder}\n ></textarea>\n </span>\n );\n };\n\n private layout = () => {\n this.mdcTextField?.layout();\n };\n\n private getAdditionalProps = () => {\n const props: any = {};\n\n if (this.type === 'number') {\n props.step = this.step;\n }\n\n if (this.type === 'number' && Number.isInteger(this.min)) {\n props.min = this.min;\n }\n\n if (this.type === 'number' && Number.isInteger(this.max)) {\n props.max = this.max;\n }\n\n if (this.minlength) {\n props.minlength = this.minlength;\n }\n\n if (this.maxlength) {\n props.maxlength = this.maxlength;\n }\n\n return props;\n };\n\n private onFocus = () => {\n this.isFocused = true;\n this.showCompletions = true;\n };\n\n private onBlur = () => {\n this.isFocused = false;\n this.validate();\n this.changeEmitter.flush();\n };\n\n private hasHelperText = () => {\n return this.helperText !== null && this.helperText !== undefined;\n };\n\n private hasHelperLine = () => {\n return this.maxlength || this.hasHelperText();\n };\n\n private renderHelperLine = () => {\n const text: string = this.getCurrentValue() || '';\n const length = text.length;\n\n if (!this.hasHelperLine()) {\n return;\n }\n\n return (\n <limel-helper-line\n helperTextId={this.helperTextId}\n helperText={this.helperText}\n length={length}\n maxLength={this.maxlength}\n invalid={this.isInvalid()}\n />\n );\n };\n\n private renderEmptyValueForReadonly = () => {\n if (this.readonly && this.isEmpty()) {\n return (\n <span class=\"lime-empty-value-for-readonly lime-looks-like-input-value\">\n –\n </span>\n );\n }\n };\n\n private renderSuffix = () => {\n if (!this.hasSuffix() || this.type === 'textarea') {\n return;\n }\n\n const classList = {\n 'mdc-text-field__affix': true,\n 'mdc-text-field__affix--suffix': true,\n };\n\n return <span class={classList}>{this.suffix}</span>;\n };\n\n private hasSuffix = () => {\n return this.suffix !== null && this.suffix !== undefined;\n };\n\n private renderPrefix = () => {\n if (!this.hasPrefix() || this.type === 'textarea') {\n return;\n }\n\n const classList = {\n 'mdc-text-field__affix': true,\n 'mdc-text-field__affix--prefix': true,\n };\n\n return <span class={classList}>{this.prefix}</span>;\n };\n\n private hasPrefix = () => {\n return this.prefix !== null && this.prefix !== undefined;\n };\n\n private isInvalid = () => {\n if (this.readonly) {\n // A readonly field can never be invalid.\n return false;\n }\n\n if (this.invalid) {\n // `this.invalid` is set by the consumer. If the consumer explicitly\n // told us to consider the field invalid, we consider it invalid\n // regardless of what our internal validation thinks, and regardless\n // of whether the field has been modified.\n return true;\n }\n\n return this.wasInvalid;\n };\n\n private validate = () => {\n if (this.readonly || this.invalid) {\n this.wasInvalid = false;\n\n return;\n }\n\n if (this.inputElement) {\n this.wasInvalid = !this.inputElement.checkValidity();\n }\n };\n\n private setInputElement = (\n element?: HTMLInputElement | HTMLTextAreaElement,\n ) => {\n if (element) {\n this.inputElement = element;\n }\n };\n\n private renderLabel = () => {\n const labelClassList = {\n 'mdc-floating-label': true,\n 'mdc-floating-label--float-above':\n !this.isEmpty() || this.isFocused || this.readonly,\n };\n\n if (!this.label) {\n return;\n }\n\n return (\n <span class=\"mdc-notched-outline__notch\">\n <span class={labelClassList} id={this.labelId}>\n {this.label}\n </span>\n </span>\n );\n };\n\n private renderLeadingIcon = () => {\n if (this.type === 'textarea') {\n return;\n }\n\n if (this.leadingIcon) {\n return (\n <i class=\"material-icons mdc-text-field__icon mdc-text-field__icon--leading\">\n <limel-icon name={this.leadingIcon} />\n </i>\n );\n }\n };\n\n private renderTrailingLinkOrButton = () => {\n if (this.type === 'textarea') {\n return;\n }\n\n const trailingIcon = this.getTrailingIcon();\n\n if (!this.isInvalid() && this.hasLink()) {\n return this.renderLinkIcon(this.getLink(), trailingIcon);\n } else if (trailingIcon) {\n return this.renderTrailingIcon(trailingIcon);\n }\n };\n\n private hasLink = () => {\n return (\n this.showLink &&\n ['email', 'tel', 'url', 'urlAsText'].includes(this.type)\n );\n };\n\n private getLink = () => {\n const props: LinkProperties = { href: '' };\n switch (this.type) {\n case 'email':\n props.href = `mailto:${this.value}`;\n break;\n case 'tel':\n props.href = `tel:${this.value}`;\n break;\n default:\n props.href = getHref(this.value);\n props.target = getTarget(this.value);\n }\n\n return props;\n };\n\n private renderLinkIcon = (linkProps: LinkProperties, icon: string) => {\n // If the trailing icon uses the class `mdc-text-field__icon--trailing`,\n // MDC attaches a click handler to it, which apparently runs\n // `preventDefault()` on the event. For links, we don't want that,\n // so instead of `mdc-text-field__icon--trailing`, we use our own class\n // `lime-trailing-icon-for-link`, which uses all the same styling. /Ads\n return (\n <a\n {...linkProps}\n class=\"material-icons mdc-text-field__icon lime-trailing-icon-for-link\"\n tabindex={this.disabled || this.isEmpty() ? '-1' : '0'}\n role=\"button\"\n >\n <limel-icon name={icon} />\n </a>\n );\n };\n\n private renderTrailingIcon = (icon: string) => {\n if (this.isInvalid()) {\n return (\n <i\n key=\"invalid\"\n class=\"material-icons mdc-text-field__icon invalid-icon\"\n >\n <limel-icon name={icon} />\n </i>\n );\n }\n\n return (\n <i\n key=\"action\"\n class=\"material-icons mdc-text-field__icon mdc-text-field__icon--trailing\"\n tabIndex={0}\n role=\"button\"\n onKeyDown={this.handleIconKeyPress}\n onClick={this.handleIconClick}\n >\n <limel-icon name={icon} />\n </i>\n );\n };\n\n private getTrailingIcon = () => {\n if (this.isInvalid()) {\n return 'high_importance';\n }\n\n if (this.trailingIcon) {\n return this.trailingIcon;\n }\n\n if (this.showLink && this.type === 'email') {\n return 'filled_message';\n }\n\n if (this.showLink && this.type === 'tel') {\n return 'phone';\n }\n\n if (\n this.showLink &&\n (this.type === 'url' || this.type === 'urlAsText')\n ) {\n return 'external_link';\n }\n };\n\n private renderFormattedNumber = () => {\n if (this.type !== 'number') {\n return;\n }\n\n let renderValue = this.value;\n if (this.formatNumber && this.value) {\n renderValue = new Intl.NumberFormat(this.locale).format(\n Number(this.value),\n );\n if (renderValue === 'NaN') {\n return;\n }\n }\n\n return (\n <span class=\"lime-formatted-input lime-looks-like-input-value\">\n {renderValue}\n </span>\n );\n };\n\n /**\n * Key handler for the input field\n * Will change focus to the first/last item in the dropdown list to enable selection with the keyboard\n *\n * @param event - event\n */\n\n private onKeyDown = (event: KeyboardEvent): void => {\n this.showCompletions = true;\n const isForwardTab =\n (event.key === TAB || event.keyCode === TAB_KEY_CODE) &&\n !event.altKey &&\n !event.metaKey &&\n !event.shiftKey;\n const isUp =\n event.key === ARROW_UP || event.keyCode === ARROW_UP_KEY_CODE;\n const isDown =\n event.key === ARROW_DOWN || event.keyCode === ARROW_DOWN_KEY_CODE;\n\n if (event.keyCode === TAB_KEY_CODE && event.shiftKey) {\n this.showCompletions = false;\n }\n\n if (!isForwardTab && !isUp && !isDown) {\n return;\n }\n\n const list = document.querySelector(` #${this.portalId} limel-list`);\n\n if (!list) {\n return;\n }\n\n event.preventDefault();\n if (isForwardTab || isDown) {\n const listElement: HTMLElement = list.shadowRoot.querySelector(\n '.mdc-deprecated-list-item:first-child',\n );\n listElement.focus();\n\n return;\n }\n\n if (isUp) {\n const listElement: HTMLElement = list.shadowRoot.querySelector(\n '.mdc-deprecated-list-item:last-child',\n );\n listElement.focus();\n }\n };\n\n private handleCompletionChange = (\n event: LimelListCustomEvent<ListItem>,\n ) => {\n event.stopPropagation();\n if (!event.detail) {\n return;\n }\n\n this.showCompletions = false;\n\n /*\n This change event doesn't need to be debounced in itself, but we want\n to make absolutely sure that an earlier change event that *has* been\n debounced doesn't emit after this one. Therefore, we run this through\n the same debounced emitter function. /Ads\n */\n this.changeEmitter(event.detail.text);\n this.changeEmitter.flush();\n };\n\n private renderAutocompleteList = () => {\n if (this.type === 'textarea' || !this.completions.length) {\n return;\n }\n\n const dropdownZIndex = getComputedStyle(\n this.limelInputField,\n ).getPropertyValue('--dropdown-z-index');\n\n return (\n <limel-portal\n visible={this.showCompletions}\n containerId={this.portalId}\n inheritParentWidth={true}\n containerStyle={{ 'z-index': dropdownZIndex }}\n >\n <limel-menu-surface\n open={this.showCompletions}\n allowClicksElement={this.limelInputField}\n style={{\n '--mdc-menu-min-width': '100%',\n 'max-height': 'inherit',\n display: 'flex',\n }}\n onDismiss={this.handleCloseMenu}\n >\n {this.renderListResult()}\n </limel-menu-surface>\n </limel-portal>\n );\n };\n\n private renderListResult = () => {\n const filteredCompletions: ListItem[] = this.filterCompletions(\n this.getCurrentValue(),\n );\n if (!filteredCompletions || filteredCompletions.length === 0) {\n return null;\n }\n\n return (\n <limel-list\n onChange={this.handleCompletionChange}\n onKeyDown={this.handleKeyDownInDropdown}\n type=\"selectable\"\n items={filteredCompletions}\n />\n );\n };\n\n private handleKeyDownInDropdown = (event: KeyboardEvent) => {\n const keyFound = [TAB, ESCAPE, ENTER].includes(event.key);\n const keyCodeFound = [\n TAB_KEY_CODE,\n ESCAPE_KEY_CODE,\n ENTER_KEY_CODE,\n ].includes(event.keyCode);\n if (keyFound || keyCodeFound) {\n this.setFocus();\n }\n };\n\n private handleCloseMenu = () => {\n this.showCompletions = false;\n };\n\n private filterCompletions = (filter: string) => {\n if (!filter) {\n return this.completionsList;\n }\n\n return this.completionsList.filter(\n (completion) =>\n completion.text.toLowerCase().indexOf(filter.toLowerCase()) >\n -1,\n );\n };\n\n private handleInput = (event) => {\n event.stopPropagation();\n let value = event.target.value;\n\n if (this.type === 'number') {\n if (!value && event.data) {\n event.stopPropagation();\n\n return;\n }\n\n if (value) {\n value = Number(value);\n }\n }\n\n this.changeWaiting = true;\n this.changeEmitter(value);\n };\n\n private changeEmitter = debounce((value: string) => {\n this.change.emit(value);\n this.changeWaiting = false;\n }, DEBOUNCE_TIMEOUT);\n\n private handleChange = (event: Event) => {\n event.stopPropagation();\n this.changeEmitter.flush();\n };\n\n private handleIconClick = () => {\n this.action.emit();\n };\n\n private handleIconKeyPress = (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 (isSpace || isEnter) {\n this.action.emit();\n }\n };\n\n private handleWheel = () => {\n // This empty event handler is here to circumvent a bug.\n // In some browsers (Chrome for example), hovering the input with\n // the input focused, and scrolling, will both change the value\n // AND scroll the page. We would prefer to never change the value\n // on scroll, instead always scrolling the page, but since we\n // haven't found a way to do that, this is the next best thing, as\n // it prevents the page from being scrolled, but only in the\n // circumstances when the value is changed by the scrolling.\n // Please test THOROUGHLY if you remove this event handler 😄\n };\n}\n","@use '../../style/functions';\n\n// Note! The `--dropdown-z-index` property is used from `menu.tsx`.\n\n/**\n * @prop --dropdown-z-index: `z-index` of the dropdown menu.\n * @prop --menu-surface-width: Width of the menu surface. Overrides the width defined by `surfaceWidth`.\n * @prop --list-grid-item-max-width: Maximum width of items in the menu list when `gridLayout={true}`. Defaults to `10rem`.\n * @prop --list-grid-item-min-width: Minimum width of items in the menu list when `gridLayout={true}`. Defaults to `7.5rem`.\n * @prop --list-grid-gap: Distance between the items in the menu list when `gridLayout={true}`. Defaults to `0.75rem`.\n * @prop --notification-badge-text-color: Defines the text color of notification badges. Defaults to `--color-white`.\n * @prop --notification-badge-background-color: Defines the background color of notification badges. Defaults to `--color-red-default`.\n */\n\n:host(limel-menu) {\n isolation: isolate;\n position: relative;\n display: inline-block;\n --badge-background-color: var(\n --notification-badge-background-color,\n rgb(var(--color-red-default))\n );\n --badge-text-color: var(\n --notification-badge-text-color,\n rgb(var(--color-white))\n );\n}\n\n:host([hidden]) {\n display: none;\n}\n\n.menu__trigger {\n border-color: transparent;\n border-width: 1px;\n border-style: solid;\n background: none;\n color: rgb(var(--contrast-800));\n height: functions.pxToRem(36);\n\n &-enabled {\n &:hover {\n border-color: rgb(var(--contrast-800));\n color: rgb(var(--contrast-1100));\n }\n }\n}\n\n.mdc-menu-surface--anchor {\n position: relative;\n}\n\nlimel-badge {\n position: absolute;\n top: -0.25rem;\n right: -0.25rem;\n}\n","/* eslint-disable sonarjs/no-duplicate-string */\nimport {\n Component,\n Event,\n EventEmitter,\n h,\n Prop,\n Element,\n Watch,\n State,\n} from '@stencil/core';\nimport { createRandomString } from '../../util/random-string';\nimport { zipObject, isFunction } from 'lodash-es';\nimport {\n LimelBreadcrumbsCustomEvent,\n LimelInputFieldCustomEvent,\n} from '../../components';\n\nimport { BreadcrumbsItem } from '../breadcrumbs/breadcrumbs.types';\nimport { ListSeparator } from '../list/list-item.types';\nimport {\n OpenDirection,\n MenuItem,\n MenuLoader,\n SurfaceWidth,\n MenuSearcher,\n} from './menu.types';\n\nimport {\n ARROW_DOWN,\n ARROW_DOWN_KEY_CODE,\n ARROW_LEFT,\n ARROW_LEFT_KEY_CODE,\n ARROW_RIGHT,\n ARROW_RIGHT_KEY_CODE,\n ARROW_UP,\n ARROW_UP_KEY_CODE,\n TAB,\n TAB_KEY_CODE,\n} from '../../util/keycodes';\n\ninterface MenuCrumbItem extends BreadcrumbsItem {\n menuItem?: MenuItem;\n}\n\nconst DEFAULT_ROOT_BREADCRUMBS_ITEM: BreadcrumbsItem = {\n text: '',\n icon: {\n name: 'home',\n },\n type: 'icon-only',\n};\n\n/**\n * @slot trigger - Element to use as a trigger for the menu.\n * @exampleComponent limel-example-menu-basic\n * @exampleComponent limel-example-menu-disabled\n * @exampleComponent limel-example-menu-open-direction\n * @exampleComponent limel-example-menu-surface-width\n * @exampleComponent limel-example-menu-separators\n * @exampleComponent limel-example-menu-icons\n * @exampleComponent limel-example-menu-badge-icons\n * @exampleComponent limel-example-menu-grid\n * @exampleComponent limel-example-menu-hotkeys\n * @exampleComponent limel-example-menu-secondary-text\n * @exampleComponent limel-example-menu-notification\n * @exampleComponent limel-example-menu-sub-menus\n * @exampleComponent limel-example-menu-sub-menu-lazy-loading\n * @exampleComponent limel-example-menu-sub-menu-lazy-loading-infinite\n * @exampleComponent limel-example-menu-searchable\n * @exampleComponent limel-example-menu-composite\n */\n@Component({\n tag: 'limel-menu',\n shadow: true,\n styleUrl: 'menu.scss',\n})\nexport class Menu {\n /**\n * A list of items and separators to show in the menu.\n */\n @Prop()\n public items: Array<MenuItem | ListSeparator> = [];\n\n /**\n * Sets the disabled state of the menu.\n */\n @Prop({ reflect: true })\n public disabled = false;\n\n /**\n * Decides the menu's location in relation to its trigger\n */\n @Prop({ reflect: true })\n public openDirection: OpenDirection = 'bottom-start';\n\n /**\n * Decides the width of menu's dropdown\n */\n @Prop({ reflect: true })\n public surfaceWidth: SurfaceWidth = 'inherit-from-items';\n\n /**\n * Sets the open state of the menu.\n */\n @Prop({ mutable: true, reflect: true })\n public open = false;\n\n /**\n * Defines whether the menu should show badges.\n */\n @Prop({ reflect: true })\n public badgeIcons = false;\n\n /**\n * Renders list items in a grid layout, rather than a vertical list\n */\n @Prop({ reflect: true })\n public gridLayout = false;\n\n /**\n * :::warning Internal Use Only\n * This property is for internal use only. We need it for now, but want to\n * find a better implementation of the functionality it currently enables.\n * If and when we do so, this property will be removed without prior\n * notice. If you use it, your code _will_ break in the future.\n * :::\n *\n * @internal\n */\n @Prop({ reflect: true })\n public loading = false;\n\n /**\n * :::warning Internal Use Only\n * This property is for internal use only. We need it for now, but want to\n * find a better implementation of the functionality it currently enables.\n * If and when we do so, this property will be removed without prior\n * notice. If you use it, your code _will_ break in the future.\n * :::\n *\n * @internal\n */\n @Prop({ mutable: true })\n public currentSubMenu: MenuItem;\n\n /**\n * A root breadcrumb item to show above the menu items.\n * Clicking it navigates back from a sub-menu to the root menu.\n */\n @Prop()\n public rootItem: BreadcrumbsItem = DEFAULT_ROOT_BREADCRUMBS_ITEM;\n\n /**\n * Is emitted when the menu is cancelled.\n */\n @Event()\n public cancel: EventEmitter<void>;\n\n /**\n * Is emitted when a menu item is selected.\n */\n @Event()\n public select: EventEmitter<MenuItem>;\n\n /**\n * A search function that takes a search-string as an argument,\n * and returns a promise that will eventually be resolved with\n * an array of `MenuItem`:s.\n *\n * See the docs for the type `MenuSearcher` for type information on\n * the searcher function itself.\n */\n @Prop()\n public searcher: MenuSearcher;\n\n /**\n * Message to display when search returns 0 results.\n */\n @Prop()\n public emptyResultMessage?: string;\n\n /**\n * Is emitted when a menu item with a sub-menu is selected.\n */\n @Event()\n public navigateMenu: EventEmitter<MenuItem | null>;\n\n @Element()\n private host: HTMLLimelMenuElement;\n\n @State()\n private loadingSubItems: boolean;\n\n @State()\n private searchValue: string;\n\n @State()\n private searchResults: Array<MenuItem | ListSeparator> | null;\n\n private list: HTMLLimelMenuListElement;\n private searchInput: HTMLLimelInputFieldElement;\n private portalId: string;\n private triggerElement: HTMLSlotElement;\n private selectedMenuItem?: MenuItem;\n\n constructor() {\n this.portalId = createRandomString();\n }\n\n public componentDidRender() {\n const slotElement = this.host.shadowRoot.querySelector('slot');\n slotElement.assignedElements().forEach(this.setTriggerAttributes);\n }\n\n public render() {\n const cssProperties = this.getCssProperties();\n\n const dropdownZIndex = getComputedStyle(this.host).getPropertyValue(\n '--dropdown-z-index',\n );\n\n const menuSurfaceWidth = this.getMenuSurfaceWidth(\n cssProperties['--menu-surface-width'],\n );\n\n return (\n <div class=\"mdc-menu-surface--anchor\" onClick={this.onTriggerClick}>\n <slot ref={this.setTriggerRef} name=\"trigger\" />\n {this.renderNotificationBadge()}\n <limel-portal\n visible={this.open}\n containerId={this.portalId}\n openDirection={this.openDirection}\n position=\"absolute\"\n containerStyle={{ 'z-index': dropdownZIndex }}\n >\n <limel-menu-surface\n open={this.open}\n onDismiss={this.onClose}\n style={{\n ...cssProperties,\n '--mdc-menu-min-width': menuSurfaceWidth,\n '--limel-menu-surface-display': 'flex',\n '--limel-menu-surface-flex-direction': 'column',\n }}\n class={{\n 'has-grid-layout': this.gridLayout,\n }}\n >\n {this.renderSearchField()}\n {this.renderBreadcrumb()}\n {this.renderLoader()}\n {this.renderEmptyMessage()}\n {this.renderMenuList()}\n </limel-menu-surface>\n </limel-portal>\n </div>\n );\n }\n\n @Watch('items')\n protected itemsWatcher() {\n this.clearSearch();\n this.setFocus();\n }\n\n @Watch('open')\n protected openWatcher(newValue: boolean) {\n if (newValue) {\n this.setFocus();\n } else {\n this.clearSearch();\n }\n }\n\n private getBreadcrumbsItems() {\n const breadCrumbItems: MenuCrumbItem[] = [];\n let currentItem = this.currentSubMenu;\n while (currentItem) {\n breadCrumbItems.push({\n text: currentItem.text,\n icon: currentItem.icon,\n menuItem: currentItem,\n });\n currentItem = currentItem.parentItem;\n }\n\n if (\n breadCrumbItems.length ||\n this.rootItem !== DEFAULT_ROOT_BREADCRUMBS_ITEM\n ) {\n breadCrumbItems.push(this.rootItem);\n }\n\n return breadCrumbItems.reverse();\n }\n\n private renderLoader = () => {\n if (!this.loadingSubItems && !this.loading) {\n return;\n }\n\n const cssProperties = this.getCssProperties();\n\n return (\n <div\n style={{\n width: cssProperties['--menu-surface-width'],\n display: 'flex',\n 'align-items': 'center',\n 'justify-content': 'center',\n padding: '0.5rem 0',\n }}\n >\n <limel-spinner size=\"mini\" limeBranded={false} />\n </div>\n );\n };\n\n private renderBreadcrumb = () => {\n const breadcrumbsItems = this.getBreadcrumbsItems();\n if (!breadcrumbsItems.length) {\n return;\n }\n\n return (\n <limel-breadcrumbs\n style={{\n 'border-bottom': 'solid 1px rgb(var(--contrast-500))',\n 'flex-shrink': '0',\n }}\n onSelect={this.handleBreadcrumbsSelect}\n items={breadcrumbsItems}\n />\n );\n };\n\n private handleBreadcrumbsSelect = (\n event: LimelBreadcrumbsCustomEvent<MenuCrumbItem>,\n ) => {\n if (!event.detail.menuItem) {\n this.currentSubMenu = null;\n this.clearSearch();\n this.navigateMenu.emit(null);\n\n this.setFocus();\n\n return;\n }\n\n this.handleSelect(event.detail.menuItem);\n };\n\n private renderSearchField = () => {\n if (!this.searcher) {\n return;\n }\n\n return (\n <limel-input-field\n tabindex=\"0\"\n ref={this.setSearchElement}\n type=\"search\"\n leadingIcon=\"search\"\n style={{\n padding: '0.25rem',\n 'box-sizing': 'border-box',\n }}\n value={this.searchValue}\n onChange={this.handleTextInput}\n onKeyDown={this.handleInputKeyDown}\n />\n );\n };\n\n private renderEmptyMessage = () => {\n if (\n this.loading ||\n this.loadingSubItems ||\n !this.emptyResultMessage ||\n !Array.isArray(this.searchResults) ||\n this.searchResults?.length\n ) {\n return null;\n }\n\n return (\n <p\n style={{\n padding: '0 1rem',\n 'text-align': 'center',\n }}\n >\n {this.emptyResultMessage}\n </p>\n );\n };\n\n private renderMenuList = () => {\n let items = this.visibleItems;\n\n if (this.loadingSubItems || this.loading) {\n items = [];\n }\n\n return (\n <limel-menu-list\n style={{\n 'overflow-y': 'auto',\n 'flex-grow': '1',\n }}\n class={{\n 'has-grid-layout has-interactive-items': this.gridLayout,\n }}\n items={items}\n type=\"menu\"\n badgeIcons={this.badgeIcons}\n onSelect={this.onSelect}\n ref={this.setListElement}\n onKeyDown={this.handleMenuKeyDown}\n />\n );\n };\n\n private handleTextInput = async (\n event: LimelInputFieldCustomEvent<string>,\n ) => {\n event.stopPropagation();\n\n const query = event.detail;\n this.searchValue = query;\n if (query === '') {\n this.searchResults = null;\n this.loadingSubItems = false;\n\n return;\n }\n\n this.loadingSubItems = true;\n\n const result = await this.searcher(query);\n\n if (this.searchValue !== query) {\n return;\n }\n\n this.searchResults = result;\n this.loadingSubItems = false;\n };\n\n // Key handler for the input search field\n // Will change focus to the first/last item in the dropdown\n // list to enable selection with the keyboard\n private handleInputKeyDown = (event: KeyboardEvent) => {\n const isForwardTab =\n (event.key === TAB || event.keyCode === TAB_KEY_CODE) &&\n !event.altKey &&\n !event.metaKey &&\n !event.shiftKey;\n const isUp =\n event.key === ARROW_UP || event.keyCode === ARROW_UP_KEY_CODE;\n const isDown =\n event.key === ARROW_DOWN || event.keyCode === ARROW_DOWN_KEY_CODE;\n\n if (!isForwardTab && !isUp && !isDown) {\n return;\n }\n\n if (!this.list) {\n return;\n }\n\n event.stopPropagation();\n event.preventDefault();\n\n if (isForwardTab || isDown) {\n const listItems =\n this.list.shadowRoot.querySelectorAll<HTMLElement>(\n '.mdc-deprecated-list-item',\n );\n const listElement = listItems[0];\n listElement?.focus();\n\n return;\n }\n\n if (isUp) {\n const listItems =\n this.list.shadowRoot.querySelectorAll<HTMLElement>(\n '.mdc-deprecated-list-item',\n );\n const listElement = listItems[listItems.length - 1];\n listElement?.focus();\n }\n };\n\n // Key handler for the menu list\n // Will change focus to the search field if using shift+tab\n // And can go forward/back with righ/left arrow keys\n private handleMenuKeyDown = (event: KeyboardEvent) => {\n const isBackwardTab =\n (event.key === TAB || event.keyCode === TAB_KEY_CODE) &&\n !event.altKey &&\n !event.metaKey &&\n event.shiftKey;\n\n const isLeft =\n event.key === ARROW_LEFT || event.keyCode === ARROW_LEFT_KEY_CODE;\n\n const isRight =\n event.key === ARROW_RIGHT || event.keyCode === ARROW_RIGHT_KEY_CODE;\n\n if (!isBackwardTab && !isLeft && !isRight) {\n return;\n }\n\n if (isBackwardTab) {\n event.stopPropagation();\n event.preventDefault();\n this.searchInput?.focus();\n } else if (!this.gridLayout) {\n const currentItem = this.getCurrentItem();\n\n event.stopPropagation();\n event.preventDefault();\n if (isRight) {\n this.goForward(currentItem);\n } else if (isLeft) {\n this.goBack();\n }\n }\n };\n\n private clearSearch = () => {\n this.searchValue = '';\n this.searchResults = null;\n this.loadingSubItems = false;\n };\n\n private getCurrentItem = (): MenuItem => {\n const activeItem = this.list?.shadowRoot?.querySelector(\n '[role=\"menuitem\"][tabindex=\"0\"]',\n );\n const attrIndex = activeItem?.attributes?.getNamedItem('data-index');\n const dataIndex = parseInt(attrIndex?.value || '0', 10);\n\n return this.visibleItems[dataIndex] as MenuItem;\n };\n\n private goForward = (currentItem: MenuItem) => {\n this.handleSelect(currentItem, false);\n };\n\n private goBack = () => {\n if (!this.currentSubMenu) {\n // Already in the root of the menu\n return;\n }\n\n const parent = this.currentSubMenu.parentItem;\n if (!parent) {\n // If only one step down, go to the root of the menu.\n // No need to load a sub-menu.\n this.currentSubMenu = null;\n this.clearSearch();\n this.navigateMenu.emit(null);\n\n this.setFocus();\n\n return;\n }\n\n this.handleSelect(parent);\n };\n\n private setTriggerAttributes = (element: HTMLElement) => {\n const attributes = {\n 'aria-haspopup': true,\n 'aria-expanded': this.open,\n 'aria-controls': this.portalId,\n disabled: this.disabled,\n role: 'button',\n };\n\n for (const [key, value] of Object.entries(attributes)) {\n if (!value) {\n element.removeAttribute(key);\n } else {\n element.setAttribute(key, String(value));\n }\n }\n };\n\n private onClose = () => {\n this.cancel.emit();\n this.open = false;\n this.currentSubMenu = null;\n };\n\n private onTriggerClick = (event: MouseEvent) => {\n event.stopPropagation();\n if (this.disabled) {\n return;\n }\n\n this.open = !this.open;\n };\n\n private handleSelect = async (\n menuItem: MenuItem,\n selectOnEmptyChildren: boolean = true,\n ) => {\n if (Array.isArray(menuItem?.items) && menuItem.items.length > 0) {\n this.selectedMenuItem = menuItem;\n this.clearSearch();\n this.currentSubMenu = menuItem;\n this.navigateMenu.emit(menuItem);\n\n this.setFocus();\n\n return;\n } else if (isFunction(menuItem?.items)) {\n const menuLoader = menuItem.items as MenuLoader;\n this.selectedMenuItem = menuItem;\n this.loadingSubItems = true;\n const subItems = await menuLoader(menuItem);\n\n if (this.selectedMenuItem !== menuItem) {\n return;\n }\n\n menuItem.items = subItems;\n this.loadingSubItems = false;\n\n if (subItems?.length) {\n this.currentSubMenu = menuItem;\n this.clearSearch();\n this.navigateMenu.emit(menuItem);\n\n this.setFocus();\n\n return;\n }\n }\n\n if (!selectOnEmptyChildren) {\n return;\n }\n\n this.selectedMenuItem = menuItem;\n this.loadingSubItems = false;\n\n this.select.emit(menuItem);\n this.open = false;\n this.currentSubMenu = null;\n this.setFocus();\n };\n\n private onSelect = (event: CustomEvent<MenuItem>) => {\n event.stopPropagation();\n this.handleSelect(event.detail);\n };\n\n private getCssProperties() {\n const propertyNames = [\n '--menu-surface-width',\n '--list-grid-item-max-width',\n '--list-grid-item-min-width',\n '--list-grid-gap',\n '--notification-badge-background-color',\n '--notification-badge-text-color',\n ] as const;\n const style = getComputedStyle(this.host);\n const values = propertyNames.map((property) => {\n return style.getPropertyValue(property);\n });\n\n type PropName = (typeof propertyNames)[number];\n\n return zipObject(propertyNames, values) as Record<PropName, string>;\n }\n\n private setListElement = (element: HTMLLimelMenuListElement) => {\n this.list = element;\n };\n\n private setFocus = () => {\n setTimeout(() => {\n if (this.searchInput && this.searcher) {\n const observer = new IntersectionObserver(() => {\n observer.unobserve(this.searchInput);\n if (this.searchInput === window.document.activeElement) {\n return;\n }\n\n this.searchInput.focus();\n });\n observer.observe(this.searchInput);\n } else if (this.list) {\n const observer = new IntersectionObserver(() => {\n observer.unobserve(this.list);\n this.focusMenuItem();\n });\n observer.observe(this.list);\n }\n }, 0);\n };\n\n private setSearchElement = (element: HTMLLimelInputFieldElement) => {\n this.searchInput = element;\n };\n\n private focusMenuItem = () => {\n if (!this.list) {\n return;\n }\n\n const activeElement = this.list.shadowRoot.activeElement as HTMLElement;\n activeElement?.blur();\n\n const menuItems = this.visibleItems.filter(this.isMenuItem);\n const selectedIndex = Math.max(\n menuItems.findIndex((item) => item.selected),\n 0,\n );\n const menuElements: HTMLElement[] = Array.from(\n this.list.shadowRoot.querySelectorAll('[role=\"menuitem\"]'),\n );\n menuElements[selectedIndex]?.focus();\n };\n\n private isMenuItem(item: MenuItem | ListSeparator): item is MenuItem {\n return !('separator' in item);\n }\n\n private renderNotificationBadge = () => {\n if (this.items.some(this.hasNotificationBadge)) {\n return <limel-badge />;\n }\n };\n\n private hasNotificationBadge = (item: MenuItem | ListSeparator) =>\n this.isMenuItem(item) && item.badge !== undefined;\n\n private setTriggerRef = (elm?: HTMLSlotElement) => {\n this.triggerElement = elm;\n };\n\n private getMenuSurfaceWidth(customWidth: string): string {\n if (customWidth) {\n return customWidth;\n }\n\n if (this.surfaceWidth === 'inherit-from-trigger') {\n const assignedTriggers = this.triggerElement?.assignedElements();\n\n if (\n !assignedTriggers?.length ||\n !assignedTriggers[0]?.clientWidth\n ) {\n return '';\n }\n\n return `${assignedTriggers[0].clientWidth}px`;\n } else if (this.surfaceWidth === 'inherit-from-menu') {\n if (!this.host?.clientWidth) {\n return '';\n }\n\n return `${this.host?.clientWidth}px`;\n }\n\n return '';\n }\n\n private get visibleItems(): Array<MenuItem | ListSeparator> {\n if (Array.isArray(this.searchResults) && this.searchValue) {\n return this.searchResults;\n } else if (Array.isArray(this.currentSubMenu?.items)) {\n return this.currentSubMenu.items.map((item) => ({\n ...item,\n parentItem: this.currentSubMenu,\n }));\n }\n\n return this.items;\n }\n}\n","/**\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 cssClasses = {\n MENU_SELECTED_LIST_ITEM: 'mdc-menu-item--selected',\n MENU_SELECTION_GROUP: 'mdc-menu__selection-group',\n ROOT: 'mdc-menu',\n};\nvar strings = {\n ARIA_CHECKED_ATTR: 'aria-checked',\n ARIA_DISABLED_ATTR: 'aria-disabled',\n CHECKBOX_SELECTOR: 'input[type=\"checkbox\"]',\n LIST_SELECTOR: '.mdc-list,.mdc-deprecated-list',\n SELECTED_EVENT: 'MDCMenu:selected',\n SKIP_RESTORE_FOCUS: 'data-menu-item-skip-restore-focus',\n};\nvar numbers = {\n FOCUS_ROOT_INDEX: -1,\n};\nvar DefaultFocusState;\n(function (DefaultFocusState) {\n DefaultFocusState[DefaultFocusState[\"NONE\"] = 0] = \"NONE\";\n DefaultFocusState[DefaultFocusState[\"LIST_ROOT\"] = 1] = \"LIST_ROOT\";\n DefaultFocusState[DefaultFocusState[\"FIRST_ITEM\"] = 2] = \"FIRST_ITEM\";\n DefaultFocusState[DefaultFocusState[\"LAST_ITEM\"] = 3] = \"LAST_ITEM\";\n})(DefaultFocusState || (DefaultFocusState = {}));\nexport { cssClasses, strings, numbers, DefaultFocusState };\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 as listCssClasses } from '@material/list/constants';\nimport { MDCMenuSurfaceFoundation } from '@material/menu-surface/foundation';\nimport { cssClasses, DefaultFocusState, numbers, strings } from './constants';\nvar MDCMenuFoundation = /** @class */ (function (_super) {\n __extends(MDCMenuFoundation, _super);\n function MDCMenuFoundation(adapter) {\n var _this = _super.call(this, __assign(__assign({}, MDCMenuFoundation.defaultAdapter), adapter)) || this;\n _this.closeAnimationEndTimerId = 0;\n _this.defaultFocusState = DefaultFocusState.LIST_ROOT;\n _this.selectedIndex = -1;\n return _this;\n }\n Object.defineProperty(MDCMenuFoundation, \"cssClasses\", {\n get: function () {\n return cssClasses;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MDCMenuFoundation, \"strings\", {\n get: function () {\n return strings;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MDCMenuFoundation, \"numbers\", {\n get: function () {\n return numbers;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MDCMenuFoundation, \"defaultAdapter\", {\n /**\n * @see {@link MDCMenuAdapter} 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 addClassToElementAtIndex: function () { return undefined; },\n removeClassFromElementAtIndex: function () { return undefined; },\n addAttributeToElementAtIndex: function () { return undefined; },\n removeAttributeFromElementAtIndex: function () { return undefined; },\n getAttributeFromElementAtIndex: function () { return null; },\n elementContainsClass: function () { return false; },\n closeSurface: function () { return undefined; },\n getElementIndex: function () { return -1; },\n notifySelected: function () { return undefined; },\n getMenuItemCount: function () { return 0; },\n focusItemAtIndex: function () { return undefined; },\n focusListRoot: function () { return undefined; },\n getSelectedSiblingOfItemAtIndex: function () { return -1; },\n isSelectableItemAtIndex: function () { return false; },\n };\n // tslint:enable:object-literal-sort-keys\n },\n enumerable: false,\n configurable: true\n });\n MDCMenuFoundation.prototype.destroy = function () {\n if (this.closeAnimationEndTimerId) {\n clearTimeout(this.closeAnimationEndTimerId);\n }\n this.adapter.closeSurface();\n };\n MDCMenuFoundation.prototype.handleKeydown = function (evt) {\n var key = evt.key, keyCode = evt.keyCode;\n var isTab = key === 'Tab' || keyCode === 9;\n if (isTab) {\n this.adapter.closeSurface(/** skipRestoreFocus */ true);\n }\n };\n MDCMenuFoundation.prototype.handleItemAction = function (listItem) {\n var _this = this;\n var index = this.adapter.getElementIndex(listItem);\n if (index < 0) {\n return;\n }\n this.adapter.notifySelected({ index: index });\n var skipRestoreFocus = this.adapter.getAttributeFromElementAtIndex(index, strings.SKIP_RESTORE_FOCUS) === 'true';\n this.adapter.closeSurface(skipRestoreFocus);\n // Wait for the menu to close before adding/removing classes that affect styles.\n this.closeAnimationEndTimerId = setTimeout(function () {\n // Recompute the index in case the menu contents have changed.\n var recomputedIndex = _this.adapter.getElementIndex(listItem);\n if (recomputedIndex >= 0 &&\n _this.adapter.isSelectableItemAtIndex(recomputedIndex)) {\n _this.setSelectedIndex(recomputedIndex);\n }\n }, MDCMenuSurfaceFoundation.numbers.TRANSITION_CLOSE_DURATION);\n };\n MDCMenuFoundation.prototype.handleMenuSurfaceOpened = function () {\n switch (this.defaultFocusState) {\n case DefaultFocusState.FIRST_ITEM:\n this.adapter.focusItemAtIndex(0);\n break;\n case DefaultFocusState.LAST_ITEM:\n this.adapter.focusItemAtIndex(this.adapter.getMenuItemCount() - 1);\n break;\n case DefaultFocusState.NONE:\n // Do nothing.\n break;\n default:\n this.adapter.focusListRoot();\n break;\n }\n };\n /**\n * Sets default focus state where the menu should focus every time when menu\n * is opened. Focuses the list root (`DefaultFocusState.LIST_ROOT`) element by\n * default.\n */\n MDCMenuFoundation.prototype.setDefaultFocusState = function (focusState) {\n this.defaultFocusState = focusState;\n };\n /** @return Index of the currently selected list item within the menu. */\n MDCMenuFoundation.prototype.getSelectedIndex = function () {\n return this.selectedIndex;\n };\n /**\n * Selects the list item at `index` within the menu.\n * @param index Index of list item within the menu.\n */\n MDCMenuFoundation.prototype.setSelectedIndex = function (index) {\n this.validatedIndex(index);\n if (!this.adapter.isSelectableItemAtIndex(index)) {\n throw new Error('MDCMenuFoundation: No selection group at specified index.');\n }\n var prevSelectedIndex = this.adapter.getSelectedSiblingOfItemAtIndex(index);\n if (prevSelectedIndex >= 0) {\n this.adapter.removeAttributeFromElementAtIndex(prevSelectedIndex, strings.ARIA_CHECKED_ATTR);\n this.adapter.removeClassFromElementAtIndex(prevSelectedIndex, cssClasses.MENU_SELECTED_LIST_ITEM);\n }\n this.adapter.addClassToElementAtIndex(index, cssClasses.MENU_SELECTED_LIST_ITEM);\n this.adapter.addAttributeToElementAtIndex(index, strings.ARIA_CHECKED_ATTR, 'true');\n this.selectedIndex = index;\n };\n /**\n * Sets the enabled state to isEnabled for the menu item at the given index.\n * @param index Index of the menu item\n * @param isEnabled The desired enabled state of the menu item.\n */\n MDCMenuFoundation.prototype.setEnabled = function (index, isEnabled) {\n this.validatedIndex(index);\n if (isEnabled) {\n this.adapter.removeClassFromElementAtIndex(index, listCssClasses.LIST_ITEM_DISABLED_CLASS);\n this.adapter.addAttributeToElementAtIndex(index, strings.ARIA_DISABLED_ATTR, 'false');\n }\n else {\n this.adapter.addClassToElementAtIndex(index, listCssClasses.LIST_ITEM_DISABLED_CLASS);\n this.adapter.addAttributeToElementAtIndex(index, strings.ARIA_DISABLED_ATTR, 'true');\n }\n };\n MDCMenuFoundation.prototype.validatedIndex = function (index) {\n var menuSize = this.adapter.getMenuItemCount();\n var isIndexInRange = index >= 0 && index < menuSize;\n if (!isIndexInRange) {\n throw new Error('MDCMenuFoundation: No list item at specified index.');\n }\n };\n return MDCMenuFoundation;\n}(MDCFoundation));\nexport { MDCMenuFoundation };\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCMenuFoundation;\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 { closest } from '@material/dom/ponyfill';\nimport { MDCList } from '@material/list/component';\nimport { numbers as listConstants } from '@material/list/constants';\nimport { MDCListFoundation } from '@material/list/foundation';\nimport { MDCMenuSurface } from '@material/menu-surface/component';\nimport { MDCMenuSurfaceFoundation } from '@material/menu-surface/foundation';\nimport { cssClasses, strings } from './constants';\nimport { MDCMenuFoundation } from './foundation';\nvar MDCMenu = /** @class */ (function (_super) {\n __extends(MDCMenu, _super);\n function MDCMenu() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n MDCMenu.attachTo = function (root) {\n return new MDCMenu(root);\n };\n MDCMenu.prototype.initialize = function (menuSurfaceFactory, listFactory) {\n if (menuSurfaceFactory === void 0) { menuSurfaceFactory = function (el) { return new MDCMenuSurface(el); }; }\n if (listFactory === void 0) { listFactory = function (el) { return new MDCList(el); }; }\n this.menuSurfaceFactory = menuSurfaceFactory;\n this.listFactory = listFactory;\n };\n MDCMenu.prototype.initialSyncWithDOM = function () {\n var _this = this;\n this.menuSurface = this.menuSurfaceFactory(this.root);\n var list = this.root.querySelector(strings.LIST_SELECTOR);\n if (list) {\n this.list = this.listFactory(list);\n this.list.wrapFocus = true;\n }\n else {\n this.list = null;\n }\n this.handleKeydown = function (evt) {\n _this.foundation.handleKeydown(evt);\n };\n this.handleItemAction = function (evt) {\n _this.foundation.handleItemAction(_this.items[evt.detail.index]);\n };\n this.handleMenuSurfaceOpened = function () {\n _this.foundation.handleMenuSurfaceOpened();\n };\n this.menuSurface.listen(MDCMenuSurfaceFoundation.strings.OPENED_EVENT, this.handleMenuSurfaceOpened);\n this.listen('keydown', this.handleKeydown);\n this.listen(MDCListFoundation.strings.ACTION_EVENT, this.handleItemAction);\n };\n MDCMenu.prototype.destroy = function () {\n if (this.list) {\n this.list.destroy();\n }\n this.menuSurface.destroy();\n this.menuSurface.unlisten(MDCMenuSurfaceFoundation.strings.OPENED_EVENT, this.handleMenuSurfaceOpened);\n this.unlisten('keydown', this.handleKeydown);\n this.unlisten(MDCListFoundation.strings.ACTION_EVENT, this.handleItemAction);\n _super.prototype.destroy.call(this);\n };\n Object.defineProperty(MDCMenu.prototype, \"open\", {\n get: function () {\n return this.menuSurface.isOpen();\n },\n set: function (value) {\n if (value) {\n this.menuSurface.open();\n }\n else {\n this.menuSurface.close();\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MDCMenu.prototype, \"wrapFocus\", {\n get: function () {\n return this.list ? this.list.wrapFocus : false;\n },\n set: function (value) {\n if (this.list) {\n this.list.wrapFocus = value;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MDCMenu.prototype, \"hasTypeahead\", {\n /**\n * Sets whether the menu has typeahead functionality.\n * @param value Whether typeahead is enabled.\n */\n set: function (value) {\n if (this.list) {\n this.list.hasTypeahead = value;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MDCMenu.prototype, \"typeaheadInProgress\", {\n /**\n * @return Whether typeahead logic is currently matching some user prefix.\n */\n get: function () {\n return this.list ? this.list.typeaheadInProgress : false;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Given the next desired character from the user, adds it to the typeahead\n * buffer. Then, attempts to find the next option matching the buffer. Wraps\n * around if at the end of options.\n *\n * @param nextChar The next character to add to the prefix buffer.\n * @param startingIndex The index from which to start matching. Only relevant\n * when starting a new match sequence. To start a new match sequence,\n * clear the buffer using `clearTypeaheadBuffer`, or wait for the buffer\n * to clear after a set interval defined in list foundation. Defaults to\n * the currently focused index.\n * @return The index of the matched item, or -1 if no match.\n */\n MDCMenu.prototype.typeaheadMatchItem = function (nextChar, startingIndex) {\n if (this.list) {\n return this.list.typeaheadMatchItem(nextChar, startingIndex);\n }\n return -1;\n };\n /**\n * Layout the underlying list element in the case of any dynamic updates\n * to its structure.\n */\n MDCMenu.prototype.layout = function () {\n if (this.list) {\n this.list.layout();\n }\n };\n Object.defineProperty(MDCMenu.prototype, \"items\", {\n /**\n * Return the items within the menu. Note that this only contains the set of elements within\n * the items container that are proper list items, and not supplemental / presentational DOM\n * elements.\n */\n get: function () {\n return this.list ? this.list.listElements : [];\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MDCMenu.prototype, \"singleSelection\", {\n /**\n * Turns on/off the underlying list's single selection mode. Used mainly\n * by select menu.\n *\n * @param singleSelection Whether to enable single selection mode.\n */\n set: function (singleSelection) {\n if (this.list) {\n this.list.singleSelection = singleSelection;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MDCMenu.prototype, \"selectedIndex\", {\n /**\n * Retrieves the selected index. Only applicable to select menus.\n * @return The selected index, which is a number for single selection and\n * radio lists, and an array of numbers for checkbox lists.\n */\n get: function () {\n return this.list ? this.list.selectedIndex : listConstants.UNSET_INDEX;\n },\n /**\n * Sets the selected index of the list. Only applicable to select menus.\n * @param index The selected index, which is a number for single selection and\n * radio lists, and an array of numbers for checkbox lists.\n */\n set: function (index) {\n if (this.list) {\n this.list.selectedIndex = index;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MDCMenu.prototype, \"quickOpen\", {\n set: function (quickOpen) {\n this.menuSurface.quickOpen = quickOpen;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Sets default focus state where the menu should focus every time when menu\n * is opened. Focuses the list root (`DefaultFocusState.LIST_ROOT`) element by\n * default.\n * @param focusState Default focus state.\n */\n MDCMenu.prototype.setDefaultFocusState = function (focusState) {\n this.foundation.setDefaultFocusState(focusState);\n };\n /**\n * @param corner Default anchor corner alignment of top-left menu corner.\n */\n MDCMenu.prototype.setAnchorCorner = function (corner) {\n this.menuSurface.setAnchorCorner(corner);\n };\n MDCMenu.prototype.setAnchorMargin = function (margin) {\n this.menuSurface.setAnchorMargin(margin);\n };\n /**\n * Sets the list item as the selected row at the specified index.\n * @param index Index of list item within menu.\n */\n MDCMenu.prototype.setSelectedIndex = function (index) {\n this.foundation.setSelectedIndex(index);\n };\n /**\n * Sets the enabled state to isEnabled for the menu item at the given index.\n * @param index Index of the menu item\n * @param isEnabled The desired enabled state of the menu item.\n */\n MDCMenu.prototype.setEnabled = function (index, isEnabled) {\n this.foundation.setEnabled(index, isEnabled);\n };\n /**\n * @return The item within the menu at the index specified.\n */\n MDCMenu.prototype.getOptionByIndex = function (index) {\n var items = this.items;\n if (index < items.length) {\n return this.items[index];\n }\n else {\n return null;\n }\n };\n /**\n * @param index A menu item's index.\n * @return The primary text within the menu at the index specified.\n */\n MDCMenu.prototype.getPrimaryTextAtIndex = function (index) {\n var item = this.getOptionByIndex(index);\n if (item && this.list) {\n return this.list.getPrimaryText(item) || '';\n }\n return '';\n };\n MDCMenu.prototype.setFixedPosition = function (isFixed) {\n this.menuSurface.setFixedPosition(isFixed);\n };\n MDCMenu.prototype.setIsHoisted = function (isHoisted) {\n this.menuSurface.setIsHoisted(isHoisted);\n };\n MDCMenu.prototype.setAbsolutePosition = function (x, y) {\n this.menuSurface.setAbsolutePosition(x, y);\n };\n /**\n * Sets the element that the menu-surface is anchored to.\n */\n MDCMenu.prototype.setAnchorElement = function (element) {\n this.menuSurface.anchorElement = element;\n };\n MDCMenu.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 addClassToElementAtIndex: function (index, className) {\n var list = _this.items;\n list[index].classList.add(className);\n },\n removeClassFromElementAtIndex: function (index, className) {\n var list = _this.items;\n list[index].classList.remove(className);\n },\n addAttributeToElementAtIndex: function (index, attr, value) {\n var list = _this.items;\n list[index].setAttribute(attr, value);\n },\n removeAttributeFromElementAtIndex: function (index, attr) {\n var list = _this.items;\n list[index].removeAttribute(attr);\n },\n getAttributeFromElementAtIndex: function (index, attr) {\n var list = _this.items;\n return list[index].getAttribute(attr);\n },\n elementContainsClass: function (element, className) {\n return element.classList.contains(className);\n },\n closeSurface: function (skipRestoreFocus) {\n _this.menuSurface.close(skipRestoreFocus);\n },\n getElementIndex: function (element) { return _this.items.indexOf(element); },\n notifySelected: function (evtData) {\n _this.emit(strings.SELECTED_EVENT, {\n index: evtData.index,\n item: _this.items[evtData.index],\n });\n },\n getMenuItemCount: function () { return _this.items.length; },\n focusItemAtIndex: function (index) {\n _this.items[index].focus();\n },\n focusListRoot: function () {\n _this.root.querySelector(strings.LIST_SELECTOR).focus();\n },\n isSelectableItemAtIndex: function (index) {\n return !!closest(_this.items[index], \".\" + cssClasses.MENU_SELECTION_GROUP);\n },\n getSelectedSiblingOfItemAtIndex: function (index) {\n var selectionGroupEl = closest(_this.items[index], \".\" + cssClasses.MENU_SELECTION_GROUP);\n var selectedItemEl = selectionGroupEl.querySelector(\".\" + cssClasses.MENU_SELECTED_LIST_ITEM);\n return selectedItemEl ? _this.items.indexOf(selectedItemEl) : -1;\n },\n };\n // tslint:enable:object-literal-sort-keys\n return new MDCMenuFoundation(adapter);\n };\n return MDCMenu;\n}(MDCComponent));\nexport { MDCMenu };\n//# sourceMappingURL=component.js.map","import { ListSeparator } from '../list/list-item.types';\nimport { MenuItem } from '../menu/menu.types';\nimport { h } from '@stencil/core';\nimport { MenuListRendererConfig } from './menu-list-renderer-config';\nimport { getIconColor, getIconName } from '../icon/get-icon-props';\nimport { isFunction } from 'lodash-es';\n\nexport class MenuListRenderer {\n private defaultConfig: MenuListRendererConfig = {\n isOpen: true,\n badgeIcons: false,\n };\n\n private config: MenuListRendererConfig;\n\n private hasIcons: boolean;\n private twoLines: boolean;\n private avatarList: boolean;\n private commandKey: boolean;\n\n private applyTabIndexToItemAtIndex: number;\n\n public render(\n items: Array<MenuItem | ListSeparator>,\n config: MenuListRendererConfig = {},\n ) {\n items = items || [];\n this.config = { ...this.defaultConfig, ...config };\n\n this.twoLines = items.some((item) => {\n return 'secondaryText' in item && !!item.secondaryText;\n });\n\n this.commandKey = items.some((item) => {\n return 'commandText' in item && !!item.commandText;\n });\n\n this.hasIcons = items.some((item) => {\n return 'icon' in item && !!item.icon;\n });\n\n this.avatarList = this.config.badgeIcons && this.hasIcons;\n\n this.applyTabIndexToItemAtIndex =\n this.getIndexForWhichToApplyTabIndex(items);\n\n const classNames = {\n 'mdc-deprecated-list': true,\n 'mdc-deprecated-list--two-line': this.twoLines,\n selectable: true,\n 'mdc-deprecated-list--avatar-list': this.avatarList,\n 'list--compact':\n this.twoLines &&\n this.commandKey &&\n ['small', 'x-small'].includes(this.config.iconSize),\n };\n\n return (\n <ul\n class={classNames}\n role=\"menu\"\n aria-orientation=\"vertical\"\n style={{ '--maxLinesSecondaryText': '2' }}\n >\n {items.map(this.renderMenuItem)}\n </ul>\n );\n }\n\n /**\n * Determine which MenuItem should have the `tab-index` attribute set,\n * and return the index at which that MenuItem is located in `items`.\n * Returns `undefined` if no item should have the attribute set.\n * See https://github.com/material-components/material-components-web/tree/e66a43a75fef4f9179e24856649518e15e279a04/packages/mdc-list#accessibility\n *\n * @param items - the items of the list, including any `ListSeparator`:s\n * @returns the index as per the description\n */\n private getIndexForWhichToApplyTabIndex = (\n items: Array<MenuItem | ListSeparator>,\n ) => {\n let result;\n for (let i = 0, max = items.length; i < max; i += 1) {\n if ('separator' in items[i]) {\n // Ignore ListSeparator\n } else {\n const item = items[i] as MenuItem<any>;\n if (item.selected) {\n result = i;\n break;\n }\n\n if (result === undefined && !item.disabled) {\n result = i;\n // Do NOT break, as any later item with\n // `selected=true` should get the tab-index instead!\n }\n }\n }\n\n return result;\n };\n\n /**\n * Render a single list item\n *\n * @param item - the item to render\n * @param index - the index the item had in the `items` array\n * @returns the list item\n */\n private renderMenuItem = (\n item: MenuItem | ListSeparator,\n index: number,\n ) => {\n if ('separator' in item) {\n return (\n <li class=\"mdc-deprecated-list-divider\" role=\"separator\">\n {this.rendertext(item)}\n <div class=\"limel-list-divider-line\" />\n </li>\n );\n }\n\n const classNames = {\n 'mdc-deprecated-list-item': true,\n 'mdc-deprecated-list-item--disabled': item.disabled,\n 'mdc-deprecated-list-item--selected': item.selected,\n };\n\n const attributes: { tabindex?: string } = {};\n if (index === this.applyTabIndexToItemAtIndex) {\n attributes.tabindex = '0';\n }\n\n return (\n <li\n class={classNames}\n role=\"menuitem\"\n aria-disabled={item.disabled ? 'true' : 'false'}\n aria-selected={item.selected ? 'true' : 'false'}\n data-index={index}\n {...attributes}\n >\n {this.renderIcon(this.config, item)}\n {this.renderText(item)}\n {this.renderSubMenuIcon(item)}\n {this.renderNotification(item)}\n {this.twoLines && this.avatarList ? this.renderDivider() : null}\n </li>\n );\n };\n\n /**\n * Render the text of the list item\n *\n * @param item - the list item\n * @returns the text for the list item\n */\n private renderText = (item: MenuItem) => {\n if (this.isSimpleItem(item)) {\n return (\n <span class=\"mdc-deprecated-list-item__text\">{item.text}</span>\n );\n }\n\n return (\n <div class=\"mdc-deprecated-list-item__text\">\n <div class=\"mdc-deprecated-list-item__primary-command-text\">\n <div class=\"mdc-deprecated-list-item__primary-text\">\n {item.text}\n </div>\n {this.renderCommandText(item)}\n </div>\n <div class=\"mdc-deprecated-list-item__secondary-text\">\n {item.secondaryText}\n </div>\n </div>\n );\n };\n\n private renderSubMenuIcon = (item: MenuItem) => {\n if (!this.hasSubItems(item)) {\n return;\n }\n\n return <limel-icon class=\"sub-menu-icon\" name=\"-lime-caret-right\" />;\n };\n\n private rendertext = (item: ListSeparator) => {\n if ('text' in item) {\n return <h2 class=\"limel-list-divider-title\">{item.text}</h2>;\n }\n };\n\n private renderCommandText = (item: MenuItem) => {\n if (!('commandText' in item)) {\n return;\n }\n\n return (\n <div class=\"mdc-deprecated-list-item__command-text\">\n {item.commandText}\n </div>\n );\n };\n\n private isSimpleItem = (item: MenuItem): boolean => {\n if ('commandText' in item) {\n return false;\n }\n\n return !('secondaryText' in item);\n };\n\n /**\n * Render an icon for a list item\n *\n * @param config - the config object, passed on from the `renderMenuItem` function\n * @param item - the list item\n * @returns the icon element\n */\n private renderIcon = (config: MenuListRendererConfig, item: MenuItem) => {\n const style: any = {};\n const name = getIconName(item.icon);\n if (!name) {\n return;\n }\n\n const color = getIconColor(item.icon, item.iconColor);\n\n if (color) {\n if (config.badgeIcons) {\n style['--icon-background-color'] = color;\n } else {\n style.color = color;\n }\n }\n\n return (\n <limel-icon\n badge={config.badgeIcons}\n class=\"mdc-deprecated-list-item__graphic\"\n name={name}\n style={style}\n size={config.iconSize}\n />\n );\n };\n\n private renderNotification = (item: MenuItem) => {\n if (item.badge !== undefined) {\n return <limel-badge label={item.badge} />;\n }\n };\n\n private renderDivider = () => {\n const classes = {\n 'mdc-deprecated-list-divider': true,\n 'mdc-deprecated-list-divider--inset': true,\n };\n if (this.config.iconSize) {\n classes[this.config.iconSize] = true;\n }\n\n return <hr class={classes} />;\n };\n\n private hasSubItems = (item: MenuItem): boolean => {\n return (\n (Array.isArray(item.items) && item.items.length > 0) ||\n isFunction(item.items)\n );\n };\n}\n","@use '../../style/functions';\n\n@import '../list/list';\n\n:host(limel-menu-list) {\n display: block;\n --badge-background-color: var(\n --notification-badge-background-color,\n rgb(var(--color-red-default))\n );\n --badge-text-color: var(\n --notification-badge-text-color,\n rgb(var(--color-white))\n );\n}\n\n.mdc-menu {\n max-height: 70vh; // force tall menus render inside the viewport when menu is at the bottom of the screen\n}\n\n.mdc-deprecated-list {\n margin: functions.pxToRem(4);\n // added space to visualize keyboard-focused items\n .mdc-deprecated-list-item[role='menuitem'] {\n font-size: functions.pxToRem(13);\n\n .mdc-deprecated-list-item__graphic {\n margin-right: 0;\n margin-left: -0.75rem;\n }\n }\n\n hr.mdc-deprecated-list-divider {\n &.mdc-deprecated-list-divider--inset {\n display: none;\n }\n }\n}\n\nlimel-badge {\n transform: translateX(0.75rem);\n}\n\n.sub-menu-icon {\n width: 1rem;\n transform: translateX(0.75rem);\n flex-shrink: 0;\n}\n","import { IconSize } from '../icon/icon.types';\nimport { ListSeparator } from '../list/list-item.types';\nimport { MenuItem } from '../menu/menu.types';\nimport { MenuListType } from '../menu-list/menu-list.types';\nimport { MDCMenu, MDCMenuItemEvent } from '@material/menu';\nimport { MDCRipple } from '@material/ripple';\nimport { strings as menuStrings } from '@material/menu/constants';\nimport {\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Prop,\n Watch,\n} from '@stencil/core';\nimport { MenuListRenderer } from './menu-list-renderer';\nimport { MenuListRendererConfig } from './menu-list-renderer-config';\n\nconst { SELECTED_EVENT } = menuStrings;\n\n/**\n * @private\n */\n@Component({\n tag: 'limel-menu-list',\n shadow: { delegatesFocus: true },\n styleUrl: 'menu-list.scss',\n})\nexport class MenuList {\n /**\n * List of items to display\n */\n @Prop()\n public items: Array<MenuItem | ListSeparator>;\n\n /**\n * Set to `true` if the list should display larger icons with a background\n */\n @Prop()\n public badgeIcons: boolean;\n\n /**\n * Size of the icons in the list\n */\n @Prop()\n public iconSize: IconSize = 'small';\n\n /**\n * The type of the menu, omit to get a regular vertical menu.\n * Available types are:\n * `menu`: regular vertical menu.\n */\n @Prop()\n public type: MenuListType;\n\n /**\n * By default, lists will display 3 lines of text, and then truncate the rest.\n * Consumers can increase or decrease this number by specifying\n * `maxLinesSecondaryText`. If consumer enters zero or negative\n * numbers we default to 1; and if they type decimals we round up.\n */\n // eslint-disable-next-line no-magic-numbers\n @Prop() maxLinesSecondaryText: number = 3;\n\n @Element()\n private element: HTMLLimelMenuListElement;\n\n private config: MenuListRendererConfig;\n private MenuListRenderer = new MenuListRenderer();\n private mdcMenu: MDCMenu;\n\n /**\n * Fired when a new value has been selected from the list.\n */\n @Event()\n private select: EventEmitter<MenuItem>;\n\n public connectedCallback() {\n this.setup();\n }\n\n public disconnectedCallback() {\n this.teardown();\n }\n\n public componentDidLoad() {\n this.setup();\n this.triggerIconColorWarning();\n }\n\n public render() {\n this.config = {\n badgeIcons: this.badgeIcons,\n type: this.type,\n iconSize: this.iconSize,\n };\n\n const html = this.MenuListRenderer.render(this.items, this.config);\n\n return <div class=\"mdc-menu mdc-menu-surface\">{html}</div>;\n }\n\n @Watch('type')\n protected handleType() {\n this.setupListeners();\n }\n\n @Watch('items')\n protected itemsChanged() {\n setTimeout(() => {\n this.setup();\n }, 0);\n }\n\n private setup = () => {\n this.setupMenu();\n this.setupListeners();\n };\n\n private setupMenu = () => {\n if (this.mdcMenu) {\n this.teardown();\n this.mdcMenu = null;\n }\n\n const element = this.element.shadowRoot.querySelector('.mdc-menu');\n if (!element) {\n return;\n }\n\n this.mdcMenu = new MDCMenu(element);\n this.mdcMenu.hasTypeahead = true;\n this.mdcMenu.wrapFocus = true;\n this.mdcMenu.items.forEach((item) => new MDCRipple(item));\n };\n\n private setupListeners = () => {\n if (!this.mdcMenu) {\n return;\n }\n\n this.mdcMenu.unlisten(SELECTED_EVENT, this.handleMenuSelect);\n this.mdcMenu.listen(SELECTED_EVENT, this.handleMenuSelect);\n };\n\n private teardown = () => {\n this.mdcMenu?.unlisten(SELECTED_EVENT, this.handleMenuSelect);\n this.mdcMenu?.destroy();\n };\n\n private handleMenuSelect = (event: MDCMenuItemEvent) => {\n this.handleSingleSelect(event.detail.index);\n };\n\n private handleSingleSelect = (index: number) => {\n const MenuItems = this.items.filter(this.isMenuItem) as MenuItem[];\n if (MenuItems[index].disabled) {\n return;\n }\n\n const selectedItem: MenuItem = MenuItems.find((item: MenuItem) => {\n return !!item.selected;\n });\n\n if (selectedItem) {\n this.select.emit({ ...selectedItem, selected: false });\n }\n\n if (MenuItems[index] !== selectedItem) {\n this.select.emit({ ...MenuItems[index], selected: false });\n }\n };\n\n private isMenuItem = (item: MenuItem): boolean => {\n return !('separator' in item);\n };\n\n private triggerIconColorWarning() {\n if (this.items?.some((item) => 'iconColor' in item)) {\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 'sass:math';\n@use '../../style/functions';\n@use '../../style/internal/lime-theme';\n\n/**\n * @prop --spinner-color-1: 1st animated stroke color, defaults to `--lime-brand-color-deep-red`.\n * @prop --spinner-color-2: 2nd animated stroke color, defaults to `--lime-brand-color-sellable-orange`.\n * @prop --spinner-color-3: 3rd animated stroke color, defaults to `--lime-brand-color-simple-blue`.\n * @prop --spinner-color-4: 4th animated stroke color, defaults to `--lime-brand-color-orange`.\n * @prop --spinner-color-5: 5th animated stroke color, defaults to `--lime-brand-color-lime-green`.\n * @prop --spinner-color-6: 6th animated stroke color, defaults to `--lime-brand-color-yellow`.\n * @prop --spinner-color-7: 7th animated stroke color, defaults to `--lime-brand-color-flexible-turquoise`.\n * @prop --spinner-color-8: 8th animated stroke color, defaults to `--lime-brand-color-loving-magenta`.\n * @prop --spinner-color-9: 9th animated stroke color, defaults to `--lime-brand-color-dark-blue`.\n * @prop --spinner-color-10: 10th animated stroke color, defaults to `--lime-brand-color-light-grey`.\n */\n\n$stroke-width-normal: 4;\n$stroke-width-thick: 10;\n$colors: var(--spinner-color-1, rgb(var(--lime-brand-color-deep-red))),\n var(--spinner-color-2, rgb(var(--lime-brand-color-sellable-orange))),\n var(--spinner-color-3, rgb(var(--lime-brand-color-simple-blue))),\n var(--spinner-color-4, rgb(var(--lime-brand-color-orange))),\n var(--spinner-color-5, rgb(var(--lime-brand-color-lime-green))),\n var(--spinner-color-6, rgb(var(--lime-brand-color-yellow))),\n var(--spinner-color-7, rgb(var(--lime-brand-color-flexible-turquoise))),\n var(--spinner-color-8, rgb(var(--lime-brand-color-loving-magenta))),\n var(--spinner-color-9, rgb(var(--lime-brand-color-dark-blue))),\n var(--spinner-color-9, rgb(var(--lime-brand-color-light-grey)));\n$dash: 63;\n$duration: length($colors) * 1s;\n$duration-alt: math.div($duration, length($colors));\n$keyframe: math.div(1, length($colors) * 2) * 100;\n\n:host(limel-spinner) {\n display: block;\n}\n\n@keyframes spin {\n 50% {\n transform: rotate(180deg);\n }\n 100% {\n transform: rotate(720deg);\n }\n}\n\n@keyframes fade-in-the-spinner {\n 0% {\n transform: scale(0.7);\n opacity: 0;\n }\n 100% {\n transform: scale(1);\n opacity: 1;\n }\n}\n\n@keyframes animate-colored-circles {\n #{$keyframe * 1%} {\n stroke-dashoffset: 0;\n }\n #{$keyframe * 2%},\n 100% {\n stroke-dashoffset: $dash;\n }\n}\n\n:host([hidden]) {\n display: none;\n}\n\n:host {\n box-sizing: border-box;\n display: flex;\n align-items: center;\n justify-content: center;\n\n // size=mini is the default\n height: functions.pxToRem(24);\n width: functions.pxToRem(24);\n transform: translate3d(0, 0, 0);\n animation: fade-in-the-spinner 0.5s ease forwards;\n}\n\n:host([size='x-small']) {\n height: functions.pxToRem(32);\n width: functions.pxToRem(32);\n}\n\n:host([size='small']) {\n height: functions.pxToRem(34);\n width: functions.pxToRem(34);\n}\n\n:host([size='medium']) {\n height: functions.pxToRem(44);\n width: functions.pxToRem(44);\n}\n\n:host([size='large']) {\n height: functions.pxToRem(64);\n width: functions.pxToRem(64);\n}\n\n.spinner {\n animation: spin $duration-alt linear infinite;\n transform-origin: center;\n}\n\n.color {\n animation: animate-colored-circles $duration linear infinite;\n fill: none;\n stroke-dasharray: $dash;\n stroke-dashoffset: $dash;\n stroke-linecap: round;\n stroke-width: $stroke-width-normal;\n\n &.thick {\n stroke-width: $stroke-width-thick;\n }\n\n @for $i from 1 through length($colors) {\n &:nth-child(#{$i}) {\n stroke: nth($colors, $i);\n\n @if $i > 1 {\n animation-delay: ($i - 1) * $duration-alt;\n }\n }\n }\n}\n\n.outline {\n stroke: rgba(var(--lime-brand-color-light-grey), 0.3);\n fill: none;\n stroke-linecap: round;\n stroke-width: $stroke-width-normal;\n\n &.thick {\n stroke-width: $stroke-width-thick;\n }\n}\n","import { SpinnerSize } from './spinner.types';\nimport { Component, Prop, h } from '@stencil/core';\n\n/**\n * @exampleComponent limel-example-spinner\n * @exampleComponent limel-example-spinner-color\n * @exampleComponent limel-example-spinner-size\n */\n@Component({\n tag: 'limel-spinner',\n shadow: true,\n styleUrl: 'spinner.scss',\n})\nexport class Spinner {\n /**\n * Determines the size of the spinner.\n */\n @Prop({ reflect: true })\n public size: SpinnerSize = 'mini';\n\n /**\n * Gives the spinner the shape of Lime Technologies' logo\n */\n @Prop()\n public limeBranded: boolean = true;\n\n public render() {\n return [\n <svg viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n {this.renderSpinner()}\n </svg>,\n ];\n }\n\n private renderSpinner() {\n if (!this.limeBranded) {\n return (\n <g>\n <circle class=\"outline\" cx=\"12\" cy=\"12\" r=\"10\" />\n <g class=\"spinner\">\n <circle class=\"color\" cx=\"12\" cy=\"12\" r=\"10\" />\n <circle class=\"color\" cx=\"12\" cy=\"12\" r=\"10\" />\n <circle class=\"color\" cx=\"12\" cy=\"12\" r=\"10\" />\n <circle class=\"color\" cx=\"12\" cy=\"12\" r=\"10\" />\n <circle class=\"color\" cx=\"12\" cy=\"12\" r=\"10\" />\n <circle class=\"color\" cx=\"12\" cy=\"12\" r=\"10\" />\n <circle class=\"color\" cx=\"12\" cy=\"12\" r=\"10\" />\n <circle class=\"color\" cx=\"12\" cy=\"12\" r=\"10\" />\n <circle class=\"color\" cx=\"12\" cy=\"12\" r=\"10\" />\n <circle class=\"color\" cx=\"12\" cy=\"12\" r=\"10\" />\n <circle class=\"color\" cx=\"12\" cy=\"12\" r=\"10\" />\n </g>\n </g>\n );\n }\n\n return (\n <g>\n <g clip-path=\"url(#mask)\">\n <circle class=\"outline thick\" cx=\"12\" cy=\"12\" r=\"12\" />\n <g class=\"spinner\">\n <circle class=\"color thick\" cx=\"12\" cy=\"12\" r=\"12\" />\n <circle class=\"color thick\" cx=\"12\" cy=\"12\" r=\"12\" />\n <circle class=\"color thick\" cx=\"12\" cy=\"12\" r=\"12\" />\n <circle class=\"color thick\" cx=\"12\" cy=\"12\" r=\"12\" />\n <circle class=\"color thick\" cx=\"12\" cy=\"12\" r=\"12\" />\n <circle class=\"color thick\" cx=\"12\" cy=\"12\" r=\"12\" />\n <circle class=\"color thick\" cx=\"12\" cy=\"12\" r=\"12\" />\n <circle class=\"color thick\" cx=\"12\" cy=\"12\" r=\"12\" />\n <circle class=\"color thick\" cx=\"12\" cy=\"12\" r=\"12\" />\n <circle class=\"color thick\" cx=\"12\" cy=\"12\" r=\"12\" />\n <circle class=\"color thick\" cx=\"12\" cy=\"12\" r=\"12\" />\n </g>\n </g>\n <clipPath id=\"mask\">\n <path d=\"M2.166 11.248C2.166 5.04 7.058 0 13.083 0 19.108 0 24 5.04 24 11.248c0 3.229-1.307 6.548-4.533 9.306-3.908 3.343-9.15 3.8-17.254 3.249-2.405-.164-2.753-.588-1.51-1.533C4.61 19.3 2.165 17.025 2.165 11.248zm3.124 9.834c5.563.227 9.416-.246 12.397-2.76 2.432-2.05 3.482-4.56 3.51-7.074.05-4.613-3.636-8.36-8.114-8.36-4.478 0-8.114 3.746-8.114 8.36 0 2.793.607 4.737.726 6.345.092 1.252.03 2.388-.405 3.49z\" />\n </clipPath>\n </g>\n );\n }\n}\n"],"mappings":"g7BAAA,MAAMA,EAAiB,ujG,MCgDVC,EAAW,M,wDA8CZC,KAAAC,YAAc,KAClB,MAAMC,EAAsBF,KAAKG,MAAMC,MAAM,GAAI,GAEjD,GAAIJ,KAAKK,cAAcL,KAAKG,OAAQ,CAChC,OAAOD,EAAoBI,IAAIN,KAAKO,a,CAGxC,OAAOL,EAAoBI,IAAIN,KAAKQ,eAAe,EAG/CR,KAAAQ,eAAkBC,IACtB,MAAMC,EAAYC,IAElB,MAAO,CACHC,EAAA,UACIC,KAAK,WACLC,GAAIJ,EACJK,MAAM,OACNC,QAAShB,KAAKiB,YAAYR,IAEzBT,KAAKkB,WAAWT,GAChBT,KAAKmB,YAAYV,IAEtBT,KAAKoB,cAAcX,EAAMC,GAC5B,EAGGV,KAAAO,aAAgBE,IACpB,MAAMC,EAAYC,IAElB,MAAO,CACHC,EAAA,KACIC,KAAK,WACLC,GAAIJ,EACJK,MAAM,OACNM,KAAMZ,EAAKa,KAAKD,KAChBE,MAAOd,EAAKa,KAAKC,OAEhBvB,KAAKkB,WAAWT,GAChBT,KAAKmB,YAAYV,IAEtBT,KAAKoB,cAAcX,EAAMC,GAC5B,EAGGV,KAAAwB,eAAiB,KACrB,MAAMC,EAAWzB,KAAKG,MAAMC,OAAO,GAEnC,OACIQ,EAA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LH,EAAA,UAAQG,MAAM,cAAc0gB,GAAG,KAAKC,GAAG,KAAKC,EAAE,OAC9C/gB,EAAA,UAAQG,MAAM,cAAc0gB,GAAG,KAAKC,GAAG,KAAKC,EAAE,OAC9C/gB,EAAA,UAAQG,MAAM,cAAc0gB,GAAG,KAAKC,GAAG,KAAKC,EAAE,OAC9C/gB,EAAA,UAAQG,MAAM,cAAc0gB,GAAG,KAAKC,GAAG,KAAKC,EAAE,OAC9C/gB,EAAA,UAAQG,MAAM,cAAc0gB,GAAG,KAAKC,GAAG,KAAKC,EAAE,OAC9C/gB,EAAA,UAAQG,MAAM,cAAc0gB,GAAG,KAAKC,GAAG,KAAKC,EAAE,OAC9C/gB,EAAA,UAAQG,MAAM,cAAc0gB,GAAG,KAAKC,GAAG,KAAKC,EAAE,OAC9C/gB,EAAA,UAAQG,MAAM,cAAc0gB,GAAG,KAAKC,GAAG,KAAKC,EAAE,OAC9C/gB,EAAA,UAAQG,MAAM,cAAc0gB,GAAG,KAAKC,GAAG,KAAKC,EAAE,OAC9C/gB,EAAA,UAAQG,MAAM,cAAc0gB,GAAG,KAAKC,GAAG,KAAKC,EAAE,OAC9C/gB,EAAA,UAAQG,MAAM,cAAc0gB,GAAG,KAAKC,GAAG,KAAKC,EAAE,SAGtD/gB,EAAA,YAAUE,GAAG,QACTF,EAAA,QAAMghB,EAAE,wZ"}
@@ -1 +0,0 @@
1
- {"version":3,"names":["dynamicLabelCss","DynamicLabel","render","label","this","labels","find","l","value","renderIcon","_a","icon","defaultLabel","renderLabel","_b","text","iconName","getIconName","iconColor","iconBackgroundColor","color","backgroundColor","iconProps","role","name","style","h","Object","assign","helperLineCss","HelperLine","hasContent","maxLength","helperText","length","renderHelperText","class","id","helperTextId","renderCharacterCounter","counter","Host","tabIndex","invalid","display","RadioButtonTemplate","props","disabled","type","checked","onChange","htmlFor","ListRenderer","constructor","defaultConfig","isOpen","badgeIcons","getIndexForWhichToApplyTabIndex","items","result","i","max","item","selected","undefined","renderListItem","index","rendertext","includes","config","renderVariantListItem","classNames","hasPrimaryComponent","attributes","applyTabIndexToItemAtIndex","tabindex","getPrimaryComponent","renderText","twoLines","avatarList","renderDivider","renderActionMenu","actions","primaryComponent","isSimpleItem","secondaryText","getIconColor","badge","size","iconSize","classes","openDirection","slot","itemTemplate","CheckboxTemplate","renderVariantListItemContent","hasIcons","some","selectableListTypes","selectable","commandKey","map","PrimaryComponent","listCss","ACTION_EVENT","listStrings","List","listRenderer","setup","setupList","setupListeners","mdcList","teardown","element","shadowRoot","querySelector","MDCList","hasTypeahead","unlisten","handleAction","multiple","listen","singleSelection","destroy","event","handleSingleSelect","detail","handleMultiSelect","listItems","filter","isListItem","selectedItem","selectedIndex","change","emit","selectedItems","listIndex","connectedCallback","disconnectedCallback","componentDidLoad","triggerIconColorWarning","maxLinesSecondaryText","toFixed","html","handleType","itemsChanged","setTimeout","indexOf","findIndex","initializeListType","console","warn","menuSurfaceCss","MenuSurface","menuElement","host","menuSurface","MDCMenuSurface","setAnchorCorner","Corner","TOP_START","document","addEventListener","handleDocumentClick","capture","handleKeyDown","window","handleResize","passive","removeEventListener","elementPath","composedPath","open","isDescendant","target","allowClicksElement","clickedInAllowedElement","dismiss","preventClickEventPropagation","stopEvent","once","stopPropagation","preventDefault","isEscape","key","ESCAPE","keyCode","ESCAPE_KEY_CODE","isTab","TAB","TAB_KEY_CODE","classList"],"sources":["./src/components/dynamic-label/dynamic-label.scss?tag=limel-dynamic-label&encapsulation=shadow","./src/components/dynamic-label/dynamic-label.tsx","./src/components/helper-line/helper-line.scss?tag=limel-helper-line&encapsulation=shadow","./src/components/helper-line/helper-line.tsx","./src/components/list/radio-button/radio-button.template.tsx","./src/components/list/list-renderer.tsx","./src/components/list/list.scss?tag=limel-list&encapsulation=shadow","./src/components/list/list.tsx","./src/components/menu-surface/menu-surface.scss?tag=limel-menu-surface&encapsulation=shadow","./src/components/menu-surface/menu-surface.tsx"],"sourcesContent":["@use '../../style/mixins.scss';\n\n* {\n box-sizing: border-box;\n min-width: 0;\n}\n\n:host(limel-dynamic-label) {\n --limel-dynamic-label-min-height: 1.75rem;\n display: flex;\n gap: 0.5rem;\n align-items: center;\n border-radius: 0.5rem;\n min-width: 0;\n}\n\nlimel-icon {\n --limel-icon-svg-margin: 0.125rem;\n border-radius: 0.25rem;\n flex-shrink: 0;\n width: var(--limel-dynamic-label-min-height);\n color: rgb(\n var(--contrast-900)\n ); // The default `false` color. Will be overwritten by `Icon`\n}\n\nspan {\n @include mixins.truncate-text;\n flex-grow: 1;\n font-size: 0.8125rem; // `13px`, Like Checkbox & Switch\n color: var(--mdc-theme-on-surface);\n}\n","import { getIconName } from '../icon/get-icon-props';\nimport { Component, Prop, h } from '@stencil/core';\nimport { Label, LabelValue } from './label.types';\nimport { Icon } from '../../interface';\n\n/**\n * This components displays a different label depending on the current given\n * value. A label can consist of a text and an optional icon. If no matching\n * label is found among the given `labels`, the `defaultLabel` will be displayed.\n *\n * One use case of the component is to enhance the visualization of a `boolean`\n * field like a checkbox or switch in a `readonly` state.\n *\n * The reason we offer this component is that the default styling\n * of the Checkbox or Toggle switch in the `readonly` state may not always\n * provide the best way of _visualizing information_, potentially leading to\n * confusion and negatively affecting the end-users' experience.\n *\n * @exampleComponent limel-example-dynamic-label\n * @exampleComponent limel-example-dynamic-label-readonly-boolean\n * @beta\n */\n@Component({\n tag: 'limel-dynamic-label',\n shadow: true,\n styleUrl: 'dynamic-label.scss',\n})\nexport class DynamicLabel {\n /**\n * The current value of the component which is used to match with the given\n * `labels` to determine what label to display.\n *\n * If not matching label is found, the `defaultLabel` is displayed.\n */\n @Prop()\n public value: LabelValue;\n\n /**\n * The label to display when no matching value is found in the `labels`\n * array. This is a fallback label that ensures there's always a label\n * displayed for the component.\n */\n @Prop({ reflect: true })\n public defaultLabel: Omit<Label, 'value'> = {};\n\n /**\n * A list of available labels. Each label has a corresponding value that\n * will be matched with the current `value` of the component to determine\n * what label to display.\n */\n @Prop()\n public labels: Label[] = [];\n\n public render() {\n const label = this.labels.find((l) => l.value === this.value);\n\n return [\n this.renderIcon(label?.icon ?? this.defaultLabel.icon),\n this.renderLabel(label?.text ?? this.defaultLabel.text),\n ];\n }\n\n private renderIcon(icon?: string | Icon) {\n const iconName = getIconName(icon);\n if (!iconName) {\n return;\n }\n\n let iconColor: string | undefined;\n let iconBackgroundColor: string | undefined;\n\n if (typeof icon === 'object') {\n iconColor = icon.color;\n iconBackgroundColor = icon.backgroundColor;\n }\n\n const iconProps = {\n role: 'presentation',\n name: iconName,\n style: {\n color: iconColor,\n 'background-color': iconBackgroundColor,\n },\n };\n\n return <limel-icon {...iconProps} />;\n }\n\n private renderLabel(label: string = '') {\n return <span>{label}</span>;\n }\n}\n",":host(limel-helper-line) {\n transition: opacity 0.2s ease;\n\n box-sizing: border-box;\n display: grid;\n\n min-width: 0; // prevents overflowing, if component is placed in flex containers\n\n -moz-osx-font-smoothing: grayscale;\n -webkit-font-smoothing: antialiased;\n font-size: 0.6875rem;\n line-height: normal;\n\n color: rgb(var(--contrast-1200));\n}\n\ndiv {\n display: flex;\n justify-content: space-between;\n gap: 0.75rem;\n overflow: hidden;\n padding: 0 1rem;\n}\n\n:host(limel-helper-line.invalid) {\n .helper-text {\n color: var(--mdc-theme-error);\n }\n}\n\n.counter {\n flex-shrink: 0;\n margin-left: auto;\n}\n\n.helper-text,\n.counter {\n padding-top: 0.125rem;\n}\n\n// This animates height of the helper line, from `0` to `auto`.\n// To get this animation effect, the consumer component should\n// add `hide` classed accordingly.\n:host(limel-helper-line) {\n transition: grid-template-rows\n var(--limel-h-l-grid-template-rows-transition-speed, 0.46s)\n cubic-bezier(1, 0.09, 0, 0.89);\n grid-template-rows: var(--limel-h-l-grid-template-rows, 1fr);\n}\n\n:host(limel-helper-line.hide) {\n --limel-h-l-grid-template-rows-transition-speed: 0.3s;\n --limel-h-l-grid-template-rows: 0fr;\n}\n// End: animating height\n","import { Component, Host, Prop, h } from '@stencil/core';\n\n/**\n * This is an internal and private component that many input fields\n * use to display a helper text, along with a character counter below the\n * input field.\n *\n * We created this to keep the visual styles the same everywhere\n * and to avoid importing styles separately.\n *\n * Also this enables us to open the helper line in limel-portal,\n * more easily without having to send the styles to the portal.\n *\n * @exampleComponent limel-example-helper-line\n * @exampleComponent limel-example-helper-line-invalid\n * @exampleComponent limel-example-helper-line-long-text\n * @exampleComponent limel-example-helper-line-long-text-no-counter\n * @exampleComponent limel-example-helper-line-character-counter\n * @exampleComponent limel-example-helper-line-empty\n * @exampleComponent limel-example-helper-line-animation\n * @private\n */\n@Component({\n tag: 'limel-helper-line',\n shadow: true,\n styleUrl: 'helper-line.scss',\n})\nexport class HelperLine {\n /**\n * The helper text that is displayed on the left side.\n */\n @Prop({ reflect: true })\n public helperText?: string;\n\n /**\n * Length of the current input value, coming from the parent component.\n * Used in the character counter section on the right side.\n */\n @Prop({ reflect: true })\n public length?: number;\n\n /**\n * Maximum length of the characters, defined on the parent component.\n * Used in the character counter section on the right side.\n */\n @Prop({ reflect: true })\n public maxLength?: number;\n\n /**\n * Turns `true`, when the parent component is invalid.\n * For example, when the parent component is `required` but is left empty.\n * Or when the input format is invalid.\n */\n @Prop({ reflect: true })\n public invalid?: boolean = false;\n\n /**\n * Used by `aria-controls` and `aria-describedby` in the parent component.\n */\n @Prop({ reflect: true })\n public helperTextId?: string;\n\n public render() {\n return (\n <Host\n tabIndex={-1}\n class={{\n invalid: this.invalid,\n }}\n style={!this.hasContent() ? { display: 'none' } : {}}\n aria-hidden={!this.hasContent()}\n >\n <div>\n {this.renderHelperText()}\n {this.renderCharacterCounter()}\n </div>\n </Host>\n );\n }\n\n private hasContent = () => {\n return !!(\n this.maxLength > 0 ||\n (this.helperText && this.helperText.length > 0)\n );\n };\n\n private renderHelperText = () => {\n if (!this.helperText) {\n return;\n }\n\n return (\n <span class=\"helper-text\" id={this.helperTextId}>\n {this.helperText}\n </span>\n );\n };\n\n private renderCharacterCounter = () => {\n const counter = `${this.length} / ${this.maxLength}`;\n\n if (!this.maxLength) {\n return;\n }\n\n return <span class=\"counter\">{counter}</span>;\n };\n}\n","import { FunctionalComponent, h } from '@stencil/core';\n\ninterface RadioButtonTemplateProps {\n disabled?: boolean;\n id: string;\n checked?: boolean;\n onChange?: (event: Event) => void;\n label?: string;\n}\n\nexport const RadioButtonTemplate: FunctionalComponent<\n RadioButtonTemplateProps\n> = (props) => {\n return (\n <div class=\"mdc-form-field\">\n <div\n class={`\n mdc-radio\n ${props.disabled ? 'mdc-radio--disabled' : ''}\n `}\n >\n <input\n class=\"mdc-radio__native-control\"\n type=\"radio\"\n id={props.id}\n checked={props.checked}\n disabled={props.disabled}\n onChange={props.onChange}\n />\n <div class=\"mdc-radio__background\">\n <div class=\"mdc-radio__outer-circle\" />\n <div class=\"mdc-radio__inner-circle\" />\n </div>\n </div>\n <label\n class={`${props.disabled ? 'disabled' : ''}`}\n htmlFor={props.id}\n >\n {props.label}\n </label>\n </div>\n );\n};\n","import { ListItem } from './list-item.types';\nimport { ListSeparator } from '../../global/shared-types/separator.types';\nimport { MenuItem } from '../menu/menu.types';\nimport { h } from '@stencil/core';\nimport { CheckboxTemplate } from '../checkbox/checkbox.template';\nimport { ListRendererConfig } from './list-renderer-config';\nimport { RadioButtonTemplate } from './radio-button/radio-button.template';\nimport { getIconColor, getIconName } from '../icon/get-icon-props';\n\nexport class ListRenderer {\n private defaultConfig: ListRendererConfig = {\n isOpen: true,\n badgeIcons: false,\n };\n\n private config: ListRendererConfig;\n\n private hasIcons: boolean;\n private twoLines: boolean;\n private avatarList: boolean;\n private commandKey: boolean;\n\n private applyTabIndexToItemAtIndex: number;\n\n public render(\n items: Array<ListItem | ListSeparator>,\n config: ListRendererConfig = {},\n ) {\n items = items || [];\n this.config = { ...this.defaultConfig, ...config };\n\n this.twoLines = items.some((item) => {\n return 'secondaryText' in item && !!item.secondaryText;\n });\n\n this.hasIcons = items.some((item) => {\n return 'icon' in item && !!item.icon;\n });\n\n this.avatarList = this.config.badgeIcons && this.hasIcons;\n const selectableListTypes = ['selectable', 'radio', 'checkbox'];\n\n let role;\n switch (this.config.type) {\n case 'checkbox':\n role = 'group';\n break;\n case 'radio':\n role = 'radiogroup';\n break;\n default:\n role = 'listbox';\n }\n\n this.applyTabIndexToItemAtIndex =\n this.getIndexForWhichToApplyTabIndex(items);\n\n const classNames = {\n 'mdc-deprecated-list': true,\n 'mdc-deprecated-list--two-line': this.twoLines,\n selectable: selectableListTypes.includes(this.config.type),\n 'mdc-deprecated-list--avatar-list': this.avatarList,\n 'list--compact':\n this.twoLines &&\n this.commandKey &&\n ['small', 'x-small'].includes(this.config.iconSize),\n };\n\n return (\n <ul class={classNames} role={role} aria-orientation=\"vertical\">\n {items.map(this.renderListItem)}\n </ul>\n );\n }\n\n /**\n * Determine which ListItem should have the `tab-index` attribute set,\n * and return the index at which that ListItem is located in `items`.\n * Returns `undefined` if no item should have the attribute set.\n * See https://github.com/material-components/material-components-web/tree/e66a43a75fef4f9179e24856649518e15e279a04/packages/mdc-list#accessibility\n *\n * @param items - the items of the list, including any `ListSeparator`:s\n * @returns the index as per the description\n */\n private getIndexForWhichToApplyTabIndex = (\n items: Array<ListItem | ListSeparator>,\n ) => {\n let result;\n for (let i = 0, max = items.length; i < max; i += 1) {\n if ('separator' in items[i]) {\n // Ignore ListSeparator\n } else {\n const item = items[i] as ListItem<any>;\n if (item.selected) {\n result = i;\n break;\n }\n\n if (result === undefined && !item.disabled) {\n result = i;\n // Do NOT break, as any later item with\n // `selected=true` should get the tab-index instead!\n }\n }\n }\n\n return result;\n };\n\n /**\n * Render a single list item\n *\n * @param item - the item to render\n * @param index - the index the item had in the `items` array\n * @returns the list item\n */\n private renderListItem = (\n item: ListItem | ListSeparator,\n index: number,\n ) => {\n if ('separator' in item) {\n return (\n <li class=\"mdc-deprecated-list-divider\" role=\"separator\">\n {this.rendertext(item)}\n <div class=\"limel-list-divider-line\" />\n </li>\n );\n }\n\n if (['radio', 'checkbox'].includes(this.config.type)) {\n return this.renderVariantListItem(this.config, item, index);\n }\n\n const classNames = {\n 'mdc-deprecated-list-item': true,\n 'mdc-deprecated-list-item--disabled': item.disabled,\n 'mdc-deprecated-list-item--selected': item.selected,\n 'has-primary-component': this.hasPrimaryComponent(item),\n };\n\n const attributes: { tabindex?: string } = {};\n if (index === this.applyTabIndexToItemAtIndex) {\n attributes.tabindex = '0';\n }\n\n return (\n <li\n class={classNames}\n aria-disabled={item.disabled ? 'true' : 'false'}\n aria-selected={item.selected ? 'true' : 'false'}\n data-index={index}\n {...attributes}\n >\n {this.renderIcon(this.config, item)}\n {this.getPrimaryComponent(item)}\n {this.renderText(item)}\n {this.twoLines && this.avatarList ? this.renderDivider() : null}\n {this.renderActionMenu(item.actions)}\n </li>\n );\n };\n\n private rendertext = (item: ListSeparator) => {\n if ('text' in item) {\n return <h2 class=\"limel-list-divider-title\">{item.text}</h2>;\n }\n };\n\n private getPrimaryComponent(item: ListItem): Element {\n if (!this.hasPrimaryComponent(item)) {\n return;\n }\n\n const PrimaryComponent = item.primaryComponent.name;\n const props = item.primaryComponent.props;\n\n return <PrimaryComponent {...props} />;\n }\n\n private hasPrimaryComponent = (item: ListItem) => {\n return !!item?.primaryComponent?.name;\n };\n\n /**\n * Render the text of the list item\n *\n * @param item - the list item\n * @returns the text for the list item\n */\n private renderText = (item: ListItem) => {\n if (this.isSimpleItem(item)) {\n return (\n <span class=\"mdc-deprecated-list-item__text\">{item.text}</span>\n );\n }\n\n return (\n <div class=\"mdc-deprecated-list-item__text\">\n <div class=\"mdc-deprecated-list-item__primary-command-text\">\n <div class=\"mdc-deprecated-list-item__primary-text\">\n {item.text}\n </div>\n </div>\n <div class=\"mdc-deprecated-list-item__secondary-text\">\n {item.secondaryText}\n </div>\n </div>\n );\n };\n\n private isSimpleItem = (item: ListItem): boolean => {\n return !('secondaryText' in item);\n };\n\n /**\n * Render an icon for a list item\n *\n * @param config - the config object, passed on from the `renderListItem` function\n * @param item - the list item\n * @returns the icon element\n */\n private renderIcon = (config: ListRendererConfig, item: ListItem) => {\n const style: any = {};\n const name = getIconName(item.icon);\n if (!name) {\n return;\n }\n\n const color = getIconColor(item.icon, item.iconColor);\n\n if (color) {\n if (config.badgeIcons) {\n style['--icon-background-color'] = color;\n } else {\n style.color = color;\n }\n }\n\n return (\n <limel-icon\n badge={config.badgeIcons}\n class=\"mdc-deprecated-list-item__graphic\"\n name={name}\n style={style}\n size={config.iconSize}\n />\n );\n };\n\n private renderDivider = () => {\n const classes = {\n 'mdc-deprecated-list-divider': true,\n 'mdc-deprecated-list-divider--inset': true,\n };\n if (this.config.iconSize) {\n classes[this.config.iconSize] = true;\n }\n\n return <hr class={classes} />;\n };\n\n private renderActionMenu = (actions: Array<MenuItem | ListSeparator>) => {\n if (!actions || actions.length === 0) {\n return;\n }\n\n return (\n <limel-menu\n class=\"mdc-deprecated-list-item__meta\"\n items={actions}\n openDirection=\"left-start\"\n >\n <limel-icon-button\n class=\"action-menu-trigger\"\n slot=\"trigger\"\n icon=\"menu_2\"\n />\n </limel-menu>\n );\n };\n\n private renderVariantListItem = (\n config: ListRendererConfig,\n item: ListItem,\n index: number,\n ) => {\n let itemTemplate;\n if (config.type === 'radio') {\n itemTemplate = (\n <RadioButtonTemplate\n id={`c_${index}`}\n checked={item.selected}\n disabled={item.disabled}\n />\n );\n } else if (config.type === 'checkbox') {\n itemTemplate = (\n <CheckboxTemplate\n id={`c_${index}`}\n checked={item.selected}\n disabled={item.disabled}\n />\n );\n }\n\n const classNames = {\n 'mdc-deprecated-list-item': true,\n 'mdc-deprecated-list-item--disabled': item.disabled,\n 'mdc-deprecated-list-item__text': !item.secondaryText,\n 'has-primary-component': this.hasPrimaryComponent(item),\n };\n\n const attributes: { tabindex?: string } = {};\n if (index === this.applyTabIndexToItemAtIndex) {\n attributes.tabindex = '0';\n }\n\n return (\n <li\n class={classNames}\n role={config.type}\n aria-checked={item.selected ? 'true' : 'false'}\n aria-disabled={item.disabled ? 'true' : 'false'}\n data-index={index}\n {...attributes}\n >\n {this.renderVariantListItemContent(config, item, itemTemplate)}\n </li>\n );\n };\n\n private renderVariantListItemContent = (\n config: ListRendererConfig,\n item: ListItem,\n itemTemplate: any,\n ) => {\n if (this.hasIcons) {\n return [\n item.icon ? this.renderIcon(config, item) : null,\n this.getPrimaryComponent(item),\n this.renderText(item),\n <div class=\"mdc-deprecated-list-item__meta\">\n {itemTemplate}\n </div>,\n ];\n }\n\n return [\n <div class=\"mdc-deprecated-list-item__graphic\">{itemTemplate}</div>,\n this.getPrimaryComponent(item),\n this.renderText(item),\n ];\n };\n}\n","@use '../../style/functions';\n@use '../../style/mixins';\n\n@use '../../style/internal/lime-theme';\n@use '../checkbox/checkbox.scss';\n\n@use '@material/list';\n\n$list-border-radius: 0.375rem; // 6px\n$list--has-interactive-items--mdc-list-item--hover: 1;\n$list-static-actions-list: 1;\n$list-mdc-list-item: 0;\n\n/**\n * @prop --icon-background-color: Color to use for icon background when `badgeIcons=true`.\n * @prop --icon-color: Color to use for icon. Defaults to grey when `badgeIcons=false`. Defaults to white when `badgeIcons=true`.\n * @prop --list-grid-max-width: Maximum width of a list that has `has-grid-layout` class. Defaults to `100%`.\n * @prop --list-grid-item-max-width: Maximum width of items in a list that has `has-grid-layout` class. Defaults to `10rem`.\n * @prop --list-grid-item-min-width: Minimum width of items in a list that has `has-grid-layout` class. Defaults to `7.5rem`.\n * @prop --list-grid-gap: Distance between items in a list that has `has-grid-layout` class. Defaults to `0.75rem`.\n * @prop --list-background-color-of-odd-interactive-items: Background color of odd list items, when `has-striped-rows` class is applied to the component. Defaults to `--contrast-200`.\n * @prop --list-background-color-of-even-interactive-items: Background color of even list items, when `has-striped-rows` class is applied to the component. Defaults to `transparent`.\n * @prop --list-margin: Space around the list. Defaults to `0.25rem`, which visualizes keyboard-focused items in a better way, as it adds some space for the outline effect;\n */\n\n:host(limel-list) {\n display: block;\n isolation: isolate;\n @include checkbox.custom-checkbox-styles;\n}\n\n:host([hidden]) {\n display: none;\n}\n\n@include list.deprecated-core-styles;\n\n.mdc-deprecated-list,\n.mdc-deprecated-list-item__secondary-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-deprecated-list {\n --mdc-theme-text-icon-on-background: var(\n --icon-color,\n rgb(var(--contrast-900))\n );\n margin: var(\n --list-margin,\n 0.25rem\n ); // added space to visualize keyboard-focused items\n padding: 0;\n border-radius: $list-border-radius;\n\n .mdc-deprecated-list-divider {\n border-bottom-color: transparent;\n display: flex;\n align-items: center;\n gap: 0.75rem;\n height: auto;\n padding: 0 0.5rem;\n }\n\n .limel-list-divider-line {\n background-color: rgb(var(--contrast-400));\n height: 0.125rem;\n border-radius: 1rem;\n min-width: 1rem;\n flex-grow: 1;\n }\n\n .limel-list-divider-title {\n all: unset;\n @include mixins.truncate-text;\n color: rgb(var(--contrast-900));\n font-size: 0.8125rem; // 13px\n }\n\n .mdc-deprecated-list-item {\n gap: 0.5rem;\n transition: background-color 0.2s ease;\n box-sizing: border-box;\n z-index: $list-mdc-list-item; // in Chrome on Windows, menus flicker when they have a scroll bar and user hovers on them. We may be able to remove this in future versions of Chrome. Kia 2021-May-12\n min-height: 2.5rem;\n\n &:not(.mdc-deprecated-list-item--disabled) {\n &:hover {\n background-color: rgb(var(--contrast-300));\n z-index: 1;\n }\n }\n\n &.mdc-deprecated-list-item--disabled {\n cursor: not-allowed;\n\n limel-icon {\n opacity: 0.38; // similar to `mdc-deprecated-list-item__text` when disabled\n }\n }\n\n &:first-child {\n border-top-left-radius: $list-border-radius;\n border-top-right-radius: $list-border-radius;\n }\n &:last-child {\n border-bottom-right-radius: $list-border-radius;\n border-bottom-left-radius: $list-border-radius;\n }\n }\n\n &.selectable\n .mdc-deprecated-list-item:not(.mdc-deprecated-list-item--disabled) {\n cursor: pointer;\n }\n\n .mdc-deprecated-list-item__meta {\n // the action menu on the right side a list item\n line-height: 100%;\n margin-right: -0.5rem;\n order: var(--limel-list-meta-order, 3);\n }\n\n .mdc-deprecated-list-item__graphic {\n margin-right: 0;\n }\n\n &.mdc-deprecated-list--avatar-list {\n position: relative;\n\n limel-icon.mdc-deprecated-list-item__graphic {\n background-color: var(\n --icon-background-color,\n rgb(var(--contrast-900))\n );\n color: var(--icon-color, rgba(var(--color-white), 0.88));\n margin-left: functions.pxToRem(-4);\n }\n\n hr.mdc-deprecated-list-divider {\n position: absolute;\n bottom: 0;\n\n &.mdc-deprecated-list-divider--inset {\n --icon-width: #{functions.pxToRem(40)};\n --icon-right-padding: #{functions.pxToRem(12)};\n --list-right-padding: #{functions.pxToRem(12)};\n right: 0;\n width: calc(\n 100% - var(--icon-width) - var(--icon-right-padding) - var(\n --list-right-padding\n )\n );\n\n &.x-small {\n --icon-width: #{functions.pxToRem(24)};\n }\n\n &.small {\n --icon-width: #{functions.pxToRem(32)};\n }\n\n &.medium {\n --icon-width: #{functions.pxToRem(40)};\n }\n\n &.large {\n --icon-width: #{functions.pxToRem(48)};\n }\n }\n }\n\n .mdc-deprecated-list-item:last-child hr.mdc-deprecated-list-divider {\n display: none;\n }\n }\n\n &.mdc-deprecated-list--two-line {\n .mdc-deprecated-list-item__text {\n padding-top: functions.pxToRem(8);\n padding-bottom: functions.pxToRem(8);\n }\n }\n\n .mdc-deprecated-list-item__secondary-text,\n .mdc-deprecated-list-item__primary-text,\n .mdc-deprecated-list-item__command-text {\n margin: 0;\n &:before,\n &:after {\n display: none;\n }\n }\n\n .mdc-deprecated-list-item__command-text {\n color: rgb(var(--contrast-800));\n margin-left: 0.7rem;\n }\n\n .mdc-deprecated-list-item__text {\n align-self: center;\n width: 100%;\n }\n\n .mdc-deprecated-list-item__primary-command-text {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: baseline;\n }\n\n // Tweaks to display the icon correctly in Edge\n limel-icon.mdc-deprecated-list-item__graphic {\n display: block;\n }\n}\n\n.mdc-deprecated-list:not(.mdc-deprecated-list--avatar-list) {\n limel-icon.mdc-deprecated-list-item__graphic {\n // Tweaks to make icon lists align nicely with badge-icon lists.\n &[size='x-small'] {\n margin-right: 0;\n }\n &[size='small'] {\n margin-right: 0;\n }\n &[size='medium'] {\n margin-right: 0.25rem;\n }\n &[size='large'] {\n margin-right: 0.5rem;\n }\n }\n}\n\n.mdc-deprecated-list-item.mdc-deprecated-list-item--selected {\n &:before {\n background-color: var(--mdc-theme-primary);\n opacity: 0.15;\n }\n}\n\n:not(.mdc-deprecated-list--non-interactive) {\n > {\n :not(.mdc-deprecated-list-item--disabled).mdc-deprecated-list-item {\n @include mixins.visualize-keyboard-focus;\n\n &:focus-visible {\n border-radius: $list-border-radius;\n z-index: $list--has-interactive-items--mdc-list-item--hover;\n }\n }\n }\n}\n\n@import '../checkbox/checkbox.scss';\n\n@import './radio-button/radio-button.scss';\n\n@import './partial-styles/custom-styles.scss';\n@import './partial-styles/enable-multiline-text.scss';\n@import './partial-styles/_has-grid-layout.scss';\n@import './partial-styles/_static-actions.scss';\n","import { IconSize } from '../icon/icon.types';\nimport { ListItem, ListSeparator } from './list-item.types';\nimport { ListType } from './list.types';\nimport { MDCList, MDCListActionEvent } from '@material/list';\nimport { strings as listStrings } from '@material/list/constants';\nimport {\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Prop,\n Watch,\n} from '@stencil/core';\nimport { ListRenderer } from './list-renderer';\nimport { ListRendererConfig } from './list-renderer-config';\n\nconst { ACTION_EVENT } = listStrings;\n\n/**\n * @exampleComponent limel-example-list\n * @exampleComponent limel-example-list-secondary\n * @exampleComponent limel-example-list-separator\n * @exampleComponent limel-example-list-selectable\n * @exampleComponent limel-example-list-icons\n * @exampleComponent limel-example-list-badge-icons\n * @exampleComponent limel-example-list-checkbox\n * @exampleComponent limel-example-list-checkbox-icons\n * @exampleComponent limel-example-list-radio-button\n * @exampleComponent limel-example-list-radio-button-icons\n * @exampleComponent limel-example-list-action\n * @exampleComponent limel-example-list-striped\n * @exampleComponent limel-example-list-badge-icons-with-multiple-lines\n * @exampleComponent limel-example-list-grid\n * @exampleComponent limel-example-list-primary-component\n */\n@Component({\n tag: 'limel-list',\n shadow: { delegatesFocus: true },\n styleUrl: 'list.scss',\n})\nexport class List {\n /**\n * List of items to display\n */\n @Prop()\n public items: Array<ListItem | ListSeparator>;\n\n /**\n * Set to `true` if the list should display larger icons with a background\n */\n @Prop()\n public badgeIcons: boolean;\n\n /**\n * Size of the icons in the list\n */\n @Prop()\n public iconSize: IconSize = 'small';\n\n /**\n * The type of the list, omit to get a regular list. Available types are:\n * `selectable`: regular list with single selection.\n * `radio`: radio button list with single selection.\n * `checkbox`: checkbox list with multiple selection.\n */\n @Prop()\n public type: ListType;\n\n /**\n * By default, lists will display 3 lines of text, and then truncate the rest.\n * Consumers can increase or decrease this number by specifying\n * `maxLinesSecondaryText`. If consumer enters zero or negative\n * numbers we default to 1; and if they type decimals we round up.\n */\n // eslint-disable-next-line no-magic-numbers\n @Prop() maxLinesSecondaryText: number = 3;\n\n @Element()\n private element: HTMLLimelListElement;\n\n private config: ListRendererConfig;\n private listRenderer = new ListRenderer();\n private mdcList: MDCList;\n private multiple: boolean;\n private selectable: boolean;\n\n /**\n * Fired when a new value has been selected from the list.\n * Only fired if `type` is set to `selectable`, `radio` or `checkbox`.\n */\n @Event()\n private change: EventEmitter<ListItem | ListItem[]>;\n\n /**\n * Fired when an action has been selected from the action menu of a list item\n */\n @Event()\n protected select: EventEmitter<ListItem | ListItem[]>;\n\n public connectedCallback() {\n this.setup();\n }\n\n public disconnectedCallback() {\n this.teardown();\n }\n\n public componentDidLoad() {\n this.setup();\n this.triggerIconColorWarning();\n }\n\n public render() {\n this.config = {\n badgeIcons: this.badgeIcons,\n type: this.type,\n iconSize: this.iconSize,\n };\n let maxLinesSecondaryText = +this.maxLinesSecondaryText?.toFixed();\n if (this.maxLinesSecondaryText < 1) {\n maxLinesSecondaryText = 1;\n }\n\n const html = this.listRenderer.render(this.items, this.config);\n\n return (\n <Host\n style={{\n '--maxLinesSecondaryText': `${maxLinesSecondaryText}`,\n }}\n >\n {html}\n </Host>\n );\n }\n\n @Watch('type')\n protected handleType() {\n this.setupListeners();\n }\n\n @Watch('items')\n protected itemsChanged() {\n if (!this.mdcList) {\n return;\n }\n\n setTimeout(() => {\n this.setup();\n\n const listItems = this.items.filter(this.isListItem);\n\n if (this.multiple) {\n this.mdcList.selectedIndex = listItems\n .filter((item: ListItem) => item.selected)\n .map((item: ListItem) => listItems.indexOf(item));\n } else {\n const selectedIndex = listItems.findIndex(\n (item: ListItem) => item.selected,\n );\n\n if (selectedIndex === -1) {\n this.mdcList.initializeListType();\n } else {\n this.mdcList.selectedIndex = selectedIndex;\n }\n }\n }, 0);\n }\n\n private setup = () => {\n this.setupList();\n\n this.setupListeners();\n };\n\n private setupList = () => {\n if (this.mdcList) {\n this.teardown();\n this.mdcList = null;\n }\n\n const element = this.element.shadowRoot.querySelector(\n '.mdc-deprecated-list',\n );\n if (!element) {\n return;\n }\n\n this.mdcList = new MDCList(element);\n this.mdcList.hasTypeahead = true;\n };\n\n private setupListeners = () => {\n if (!this.mdcList) {\n return;\n }\n\n this.mdcList.unlisten(ACTION_EVENT, this.handleAction);\n\n this.selectable = ['selectable', 'radio', 'checkbox'].includes(\n this.type,\n );\n this.multiple = this.type === 'checkbox';\n\n if (!this.selectable) {\n return;\n }\n\n this.mdcList.listen(ACTION_EVENT, this.handleAction);\n this.mdcList.singleSelection = !this.multiple;\n };\n\n private teardown = () => {\n this.mdcList?.unlisten(ACTION_EVENT, this.handleAction);\n this.mdcList?.destroy();\n };\n\n private handleAction = (event: MDCListActionEvent) => {\n if (!this.multiple) {\n this.handleSingleSelect(event.detail.index);\n\n return;\n }\n\n this.handleMultiSelect(event.detail.index);\n };\n\n private handleSingleSelect = (index: number) => {\n const listItems = this.items.filter(this.isListItem) as ListItem[];\n if (listItems[index].disabled) {\n return;\n }\n\n const selectedItem: ListItem = listItems.find((item: ListItem) => {\n return !!item.selected;\n });\n\n if (selectedItem) {\n if (this.type !== 'radio') {\n this.mdcList.selectedIndex = -1;\n }\n\n this.change.emit({ ...selectedItem, selected: false });\n }\n\n if (listItems[index] !== selectedItem) {\n this.change.emit({ ...listItems[index], selected: true });\n }\n };\n\n private handleMultiSelect = (index: number) => {\n const listItems = this.items.filter(this.isListItem) as ListItem[];\n if (listItems[index].disabled) {\n return;\n }\n\n const selectedItems: ListItem[] = listItems\n .filter((item: ListItem, listIndex: number) => {\n if (listIndex === index) {\n // This is the item that was selected or deselected,\n // so we negate its previous selection status.\n return !item.selected;\n }\n\n // This is an item that didn't change, so we keep its selection status.\n return item.selected;\n })\n .map((item: ListItem) => {\n return { ...item, selected: true };\n });\n\n this.change.emit(selectedItems);\n };\n\n private isListItem = (item: ListItem): boolean => {\n return !('separator' in item);\n };\n\n private triggerIconColorWarning() {\n if (this.items?.some((item) => 'iconColor' in item)) {\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 '@material/menu-surface';\n@use '@material/elevation';\n@use '@material/menu';\n\n/**\n* @prop --limel-menu-surface-display: defines whether the surface is treated as a block, flex or grid. It affects layout used to display its children. Defaults to `block`.\n* @prop --limel-menu-surface-flex-direction: defines the direction of menu-surface layout.\n*/\n\n:host(limel-menu-surface) {\n display: block;\n max-height: inherit;\n}\n\n@include menu-surface.core-styles;\n@include menu.core-styles;\n\n.mdc-menu-surface {\n display: var(--limel-menu-surface-display, block);\n flex-direction: var(--limel-menu-surface-flex-direction, row);\n max-height: inherit;\n position: relative;\n --mdc-menu-max-width: var(\n --menu-surface-width,\n min(calc(100vw - 2rem), 20rem)\n );\n background-color: var(--lime-elevated-surface-background-color);\n}\n\n:host(limel-menu-surface.has-grid-layout) {\n .mdc-menu-surface {\n width: var(--menu-surface-width, min(calc(100vw - 2rem), 40rem));\n max-width: unset;\n }\n}\n","import { Corner, MDCMenuSurface } from '@material/menu-surface';\nimport {\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Prop,\n} from '@stencil/core';\nimport { isDescendant } from '../../util/dom';\nimport {\n ESCAPE,\n ESCAPE_KEY_CODE,\n TAB,\n TAB_KEY_CODE,\n} from '../../util/keycodes';\n\n/**\n * @slot - Content to put inside the surface\n * @private\n */\n@Component({\n tag: 'limel-menu-surface',\n shadow: true,\n styleUrl: 'menu-surface.scss',\n})\nexport class MenuSurface {\n /**\n * True if the menu surface is open, false otherwise\n */\n @Prop()\n public open = false;\n\n /**\n * Clicks in this element should not be prevented when the menu surface is open\n */\n @Prop()\n public allowClicksElement: HTMLElement;\n\n /**\n * Emitted when the menu surface is dismissed and should be closed\n */\n @Event()\n public dismiss: EventEmitter<void>;\n\n @Element()\n private host: HTMLLimelMenuSurfaceElement;\n\n private menuSurface: MDCMenuSurface;\n\n public connectedCallback() {\n this.setup();\n }\n\n public disconnectedCallback() {\n this.teardown();\n }\n\n public componentDidLoad() {\n this.setup();\n }\n\n public render() {\n const classList = {\n 'mdc-menu': true,\n 'mdc-menu-surface': true,\n 'mdc-menu-surface--open': this.open,\n 'mdc-elevation-transition': true,\n 'mdc-elevation--z4': true,\n };\n\n return (\n <div class={classList} tabindex=\"-1\">\n <slot />\n </div>\n );\n }\n\n private setup = () => {\n const menuElement: HTMLElement =\n this.host.shadowRoot.querySelector('.mdc-menu-surface');\n if (!menuElement) {\n return;\n }\n\n this.menuSurface = new MDCMenuSurface(menuElement);\n this.menuSurface.setAnchorCorner(Corner.TOP_START);\n\n document.addEventListener('mousedown', this.handleDocumentClick, {\n capture: true,\n });\n this.host.addEventListener('keydown', this.handleKeyDown);\n window.addEventListener('resize', this.handleResize, {\n passive: true,\n });\n };\n\n private teardown = () => {\n this.menuSurface?.destroy();\n document.removeEventListener('mousedown', this.handleDocumentClick, {\n capture: true,\n });\n this.host.removeEventListener('keydown', this.handleKeyDown);\n window.removeEventListener('resize', this.handleResize);\n };\n\n private handleDocumentClick = (event) => {\n const elementPath = event.composedPath ? event.composedPath() : [];\n\n if (!this.open) {\n return;\n }\n\n if (isDescendant(event.target, this.host)) {\n return;\n }\n\n if (this.allowClicksElement) {\n const clickedInAllowedElement = elementPath.includes(\n this.allowClicksElement,\n );\n\n if (clickedInAllowedElement) {\n return;\n }\n }\n\n this.dismiss.emit();\n this.preventClickEventPropagation();\n };\n\n private handleResize = () => {\n if (this.open) {\n this.dismiss.emit();\n }\n };\n\n private preventClickEventPropagation = () => {\n // When the menu surface is open, we want to stop the `click` event from propagating\n // when clicking outside the surface itself. This is to prevent any dialog that might\n // be open from closing, etc. However, when dragging a scrollbar no `click` event is emitted,\n // only mousedown and mouseup. So we listen for `mousedown` and attach a one-time listener\n // for `click`, so we can capture and \"kill\" it.\n document.addEventListener('click', this.stopEvent, {\n capture: true,\n once: true,\n });\n // We also capture and \"kill\" the next `mouseup` event.\n document.addEventListener('mouseup', this.stopEvent, {\n capture: true,\n once: true,\n });\n // If the user dragged the scrollbar, no `click` event happens. So when we get the\n // `mouseup` event, remove the handler for `click` if it's still there.\n // Otherwise, we would catch the next click even though the menu is no longer open.\n document.addEventListener(\n 'mouseup',\n () => {\n document.removeEventListener('click', this.stopEvent, {\n capture: true,\n });\n },\n {\n once: true,\n },\n );\n };\n\n private stopEvent = (event) => {\n event.stopPropagation();\n event.preventDefault();\n };\n\n private handleKeyDown = (event: KeyboardEvent) => {\n const isEscape =\n event.key === ESCAPE || event.keyCode === ESCAPE_KEY_CODE;\n const isTab = event.key === TAB || event.keyCode === TAB_KEY_CODE;\n\n if (this.open && (isEscape || isTab)) {\n event.stopPropagation();\n this.dismiss.emit();\n }\n };\n}\n"],"mappings":"wWAAA,MAAMA,EAAkB,oe,MC2BXC,EAAY,M,gEAgBuB,G,YAQnB,E,CAElBC,S,QACH,MAAMC,EAAQC,KAAKC,OAAOC,MAAMC,GAAMA,EAAEC,QAAUJ,KAAKI,QAEvD,MAAO,CAC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