@limetech/lime-elements 39.44.4 → 39.44.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/dist/cjs/{keycodes-B75-uKOK.js → keycodes-k-EdzcMX.js} +4 -0
- package/dist/cjs/lime-elements.cjs.js +1 -1
- package/dist/cjs/limel-breadcrumbs_8.cjs.entry.js +20 -1
- package/dist/cjs/limel-chip-set.cjs.entry.js +1 -1
- package/dist/cjs/limel-chip_2.cjs.entry.js +1 -1
- package/dist/cjs/limel-file-viewer.cjs.entry.js +84 -8
- package/dist/cjs/limel-markdown.cjs.entry.js +2 -2
- package/dist/cjs/limel-picker.cjs.entry.js +1 -1
- package/dist/cjs/limel-popover_2.cjs.entry.js +1 -1
- package/dist/cjs/limel-prosemirror-adapter.cjs.entry.js +1 -1
- package/dist/cjs/limel-select.cjs.entry.js +377 -13
- package/dist/cjs/limel-text-editor-link-menu.cjs.entry.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{markdown-parser-F3YRMjcy.js → markdown-parser-ChnRAxpZ.js} +22 -6
- package/dist/collection/components/list/list.js +19 -0
- package/dist/collection/components/markdown/markdown-parser.js +5 -0
- package/dist/collection/components/markdown/markdown.js +2 -1
- package/dist/collection/components/markdown/sanitize-style.js +17 -6
- package/dist/collection/components/select/select.js +215 -12
- package/dist/collection/components/select/select.template.js +17 -3
- package/dist/collection/util/keycodes.js +3 -0
- package/dist/collection/util/typeahead.js +159 -0
- package/dist/esm/{keycodes-rI0IeKpx.js → keycodes-C4_9qUMP.js} +4 -1
- package/dist/esm/lime-elements.js +1 -1
- package/dist/esm/limel-breadcrumbs_8.entry.js +20 -1
- package/dist/esm/limel-chip-set.entry.js +1 -1
- package/dist/esm/limel-chip_2.entry.js +1 -1
- package/dist/esm/limel-file-viewer.entry.js +84 -8
- package/dist/esm/limel-markdown.entry.js +2 -2
- package/dist/esm/limel-picker.entry.js +1 -1
- package/dist/esm/limel-popover_2.entry.js +1 -1
- package/dist/esm/limel-prosemirror-adapter.entry.js +1 -1
- package/dist/esm/limel-select.entry.js +378 -14
- package/dist/esm/limel-text-editor-link-menu.entry.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{markdown-parser-Blt6ZFY0.js → markdown-parser-BSQKleVw.js} +22 -6
- package/dist/lime-elements/lime-elements.esm.js +1 -1
- package/dist/lime-elements/{p-a089b580.entry.js → p-03fd2181.entry.js} +1 -1
- package/dist/lime-elements/{p-fc43fb46.entry.js → p-12fe8fe1.entry.js} +6 -6
- package/dist/lime-elements/{p-bf3c78a8.entry.js → p-2b01c1f2.entry.js} +1 -1
- package/dist/lime-elements/{p-758939be.entry.js → p-2e5d5e79.entry.js} +1 -1
- package/dist/lime-elements/{p-224e80b5.entry.js → p-3ea159fd.entry.js} +1 -1
- package/dist/lime-elements/{p-4512a7b1.entry.js → p-845cfda7.entry.js} +1 -1
- package/dist/lime-elements/p-9152d7e1.entry.js +23 -0
- package/dist/lime-elements/{p-1e3cdfa1.entry.js → p-9a04a686.entry.js} +1 -1
- package/dist/lime-elements/{p-DnPeu2SH.js → p-B0qhUema.js} +1 -1
- package/dist/lime-elements/p-C4_9qUMP.js +1 -0
- package/dist/lime-elements/{p-6fbf20c6.entry.js → p-e8df7a2e.entry.js} +1 -1
- package/dist/lime-elements/p-f51b5651.entry.js +1 -0
- package/dist/types/components/markdown/markdown.d.ts +1 -0
- package/dist/types/components/markdown/sanitize-style.d.ts +9 -5
- package/dist/types/components/select/select.d.ts +76 -1
- package/dist/types/components/select/select.template.d.ts +21 -1
- package/dist/types/components.d.ts +40 -0
- package/dist/types/util/keycodes.d.ts +3 -0
- package/dist/types/util/typeahead.d.ts +101 -0
- package/package.json +3 -3
- package/dist/lime-elements/p-552d0733.entry.js +0 -1
- package/dist/lime-elements/p-8f4273e4.entry.js +0 -23
- package/dist/lime-elements/p-rI0IeKpx.js +0 -1
|
@@ -33790,26 +33790,31 @@ function sanitizeStyle(node) {
|
|
|
33790
33790
|
var _a;
|
|
33791
33791
|
if (node.tagName && ((_a = node.properties) === null || _a === void 0 ? void 0 : _a.style)) {
|
|
33792
33792
|
// Sanitize the 'style' attribute of the node.
|
|
33793
|
-
node.properties.style = sanitizeStyleValue(node.properties.style);
|
|
33793
|
+
node.properties.style = sanitizeStyleValue(node.properties.style, node.tagName);
|
|
33794
33794
|
}
|
|
33795
33795
|
}
|
|
33796
33796
|
/**
|
|
33797
33797
|
* Applies a whitelist to the CSS properties in the input string.
|
|
33798
33798
|
* Any CSS properties not in the whitelist will be removed.
|
|
33799
33799
|
*
|
|
33800
|
+
* A zero width is also removed from `table` elements. Some HTML sources
|
|
33801
|
+
* (e.g. Google Sheets) set `width: 0px` on the table element and define
|
|
33802
|
+
* the real column widths in `colgroup`; a zero width forces the table
|
|
33803
|
+
* down to its min-content size, crushing every column to its longest
|
|
33804
|
+
* word. A zero width on a table can only ever harm rendering, since
|
|
33805
|
+
* auto layout already floors the table at min-content.
|
|
33806
|
+
*
|
|
33800
33807
|
* @param styleValue - a string with CSS properties and values
|
|
33808
|
+
* @param tagName - tag name of the element the style belongs to
|
|
33801
33809
|
* @returns a sanitized version of the input string
|
|
33802
33810
|
*/
|
|
33803
|
-
|
|
33804
|
-
*
|
|
33805
|
-
* @param styleValue
|
|
33806
|
-
*/
|
|
33807
|
-
function sanitizeStyleValue(styleValue) {
|
|
33811
|
+
function sanitizeStyleValue(styleValue, tagName) {
|
|
33808
33812
|
try {
|
|
33809
33813
|
const css = StyleToObject(styleValue);
|
|
33810
33814
|
const normalizedCss = normalizeBackgroundColor(css);
|
|
33811
33815
|
return Object.entries(normalizedCss)
|
|
33812
33816
|
.filter(([key]) => allowedCssProperties.includes(key))
|
|
33817
|
+
.filter(([key, value]) => !isCollapsedTableWidth(tagName, key, value))
|
|
33813
33818
|
.map(([key, value]) => `${key}: ${value}`)
|
|
33814
33819
|
.join('; ');
|
|
33815
33820
|
}
|
|
@@ -33818,6 +33823,12 @@ function sanitizeStyleValue(styleValue) {
|
|
|
33818
33823
|
return '';
|
|
33819
33824
|
}
|
|
33820
33825
|
}
|
|
33826
|
+
function isCollapsedTableWidth(tagName, property, value) {
|
|
33827
|
+
return tagName === 'table' && property === 'width' && isZeroLength(value);
|
|
33828
|
+
}
|
|
33829
|
+
function isZeroLength(value) {
|
|
33830
|
+
return Number.parseFloat(value) === 0;
|
|
33831
|
+
}
|
|
33821
33832
|
/**
|
|
33822
33833
|
* Returns a copy of the input object with the `background` property removed.
|
|
33823
33834
|
* If the `background` property's value was a valid CSS color value, the
|
|
@@ -34117,6 +34128,11 @@ function getWhiteList(allowedComponents) {
|
|
|
34117
34128
|
// elements only.
|
|
34118
34129
|
clobberPrefix: '', strip: [...((_b = defaultSchema.strip) !== null && _b !== void 0 ? _b : []), 'style'], tagNames: [
|
|
34119
34130
|
...(defaultSchema.tagNames || []),
|
|
34131
|
+
// Table column definitions carry the column widths for tables
|
|
34132
|
+
// from sources like Google Sheets, where the table element
|
|
34133
|
+
// itself has no usable width.
|
|
34134
|
+
'colgroup',
|
|
34135
|
+
'col',
|
|
34120
34136
|
...allowedComponents.map((component) => component.tagName),
|
|
34121
34137
|
], attributes: Object.assign(Object.assign({}, defaultSchema.attributes), { p: [
|
|
34122
34138
|
...((_c = defaultSchema.attributes.p) !== null && _c !== void 0 ? _c : []),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,g as l,b as a}from"./p-BGxJfR2f.js";export{s as setNonce}from"./p-BGxJfR2f.js";(()=>{const l=import.meta.url,a={};return""!==l&&(a.resourcesUrl=new URL(".",l).href),e(a)})().then((async e=>(await l(),a(JSON.parse('[["p-d19ab443",[[1,"limel-icon",{"size":[513],"name":[513],"badge":[516],"svgClass":[513,"svg-class"]},null,{"name":[{"loadIcon":0}],"svgClass":[{"applySvgClass":0}]}]]],["p-a45b8634",[[17,"limel-text-editor",{"contentType":[1,"content-type"],"language":[513],"disabled":[516],"readonly":[516],"helperText":[513,"helper-text"],"placeholder":[513],"label":[513],"invalid":[516],"value":[513],"customElements":[16],"inlineImages":[16],"triggers":[16],"required":[516],"allowResize":[516,"allow-resize"],"ui":[513],"flushPendingChanges":[64],"clear":[64]}]]],["p-552d0733",[[1,"limel-file-viewer",{"url":[513],"filename":[513],"alt":[513],"allowFullscreen":[516,"allow-fullscreen"],"allowOpenInNewTab":[516,"allow-open-in-new-tab"],"allowDownload":[516,"allow-download"],"language":[1],"officeViewer":[513,"office-viewer"],"actions":[16],"isFullscreen":[32],"fileType":[32],"loading":[32],"fileUrl":[32],"email":[32]},null,{"url":[{"watchUrl":0}]}]]],["p-7df111bb",[[257,"limel-card",{"heading":[513],"subheading":[513],"image":[16],"icon":[513],"value":[1],"actions":[16],"clickable":[516],"orientation":[513],"selected":[516],"show3dEffect":[516,"show-3d-effect"],"canScrollUp":[32],"canScrollDown":[32]}]]],["p-8aeeeb53",[[1,"limel-file",{"value":[16],"label":[513],"helperText":[513,"helper-text"],"required":[516],"disabled":[516],"readonly":[516],"invalid":[516],"loading":[516],"accept":[513],"resizeImage":[16],"language":[1],"resizingFile":[32]},null,{"value":[{"handleValueChange":0}]}]]],["p-ca0b86ee",[[1,"limel-code-diff",{"oldValue":[1,"old-value"],"newValue":[1,"new-value"],"oldHeading":[513,"old-heading"],"newHeading":[513,"new-heading"],"layout":[513],"contextLines":[514,"context-lines"],"lineWrapping":[516,"line-wrapping"],"language":[513],"reformatJson":[516,"reformat-json"],"translationLanguage":[513,"translation-language"],"diffResult":[32],"liveAnnouncement":[32],"copyState":[32],"searchVisible":[32],"searchTerm":[32],"currentMatchIndex":[32]},null,{"oldValue":[{"watchInputs":0}],"newValue":[{"watchInputs":0}],"contextLines":[{"watchInputs":0}],"reformatJson":[{"watchInputs":0}],"layout":[{"watchInputs":0}]}]]],["p-2f223e46",[[0,"limel-list-item",{"language":[513],"value":[8],"text":[513],"secondaryText":[513,"secondary-text"],"disabled":[516],"icon":[1],"iconSize":[513,"icon-size"],"badgeIcon":[516,"badge-icon"],"selected":[516],"actions":[16],"primaryComponent":[16],"image":[16],"type":[513]}]]],["p-a089b580",[[17,"limel-picker",{"disabled":[4],"readonly":[516],"label":[1],"searchLabel":[1,"search-label"],"helperText":[513,"helper-text"],"leadingIcon":[1,"leading-icon"],"emptyResultMessage":[1,"empty-result-message"],"language":[1],"required":[4],"invalid":[516],"value":[16],"searcher":[16],"allItems":[16],"multiple":[4],"delimiter":[513],"actions":[16],"actionPosition":[1,"action-position"],"actionScrollBehavior":[1,"action-scroll-behavior"],"badgeIcons":[516,"badge-icons"],"items":[32],"textValue":[32],"loading":[32],"chips":[32]},null,{"disabled":[{"onDisabledChange":0}],"value":[{"onChangeValue":0}]}]]],["p-8175c53a",[[17,"limel-split-button",{"label":[513],"primary":[516],"icon":[513],"disabled":[516],"loading":[516],"loadingFailed":[516,"loading-failed"],"items":[16]}]]],["p-191efd88",[[1,"limel-color-picker",{"value":[513],"label":[513],"helperText":[513,"helper-text"],"tooltipLabel":[513,"tooltip-label"],"required":[516],"disabled":[516],"readonly":[516],"invalid":[516],"placeholder":[513],"manualInput":[516,"manual-input"],"palette":[16],"paletteColumnCount":[514,"palette-column-count"],"isOpen":[32]}]]],["p-6722e6e2",[[1,"limel-profile-picture",{"language":[513],"label":[513],"icon":[1],"helperText":[1,"helper-text"],"disabled":[516],"readonly":[516],"required":[516],"invalid":[516],"loading":[516],"value":[1],"imageFit":[513,"image-fit"],"accept":[513],"resize":[16],"objectUrl":[32],"imageError":[32],"isErrorMessagePopoverOpen":[32]},null,{"value":[{"handleValueChange":0}]}]]],["p-ea94f7fa",[[1,"limel-dock",{"dockItems":[16],"dockFooterItems":[16],"accessibleLabel":[513,"accessible-label"],"expanded":[516],"allowResize":[516,"allow-resize"],"mobileBreakPoint":[514,"mobile-break-point"],"useMobileLayout":[32]}]]],["p-e545c9e8",[[1,"limel-snackbar",{"open":[516],"message":[1],"timeout":[514],"actionText":[1,"action-text"],"dismissible":[4],"multiline":[4],"language":[1],"offset":[32],"isOpen":[32],"closing":[32],"show":[64]},[[0,"changeOffset","onChangeIndex"]],{"open":[{"watchOpen":0}]}]]],["p-ed53466d",[[1,"limel-date-picker",{"disabled":[516],"readonly":[516],"invalid":[516],"label":[513],"placeholder":[513],"helperText":[513,"helper-text"],"required":[516],"value":[16],"type":[513],"format":[513],"language":[513],"formatter":[16],"internalFormat":[32],"showPortal":[32]}]]],["p-92bbb643",[[1,"limel-button-group",{"value":[16],"disabled":[516],"selectedButtonId":[32]},null,{"value":[{"valueChanged":0}]}]]],["p-7487d65d",[[1,"limel-chart",{"language":[513],"accessibleLabel":[513,"accessible-label"],"accessibleItemsLabel":[513,"accessible-items-label"],"accessibleValuesLabel":[513,"accessible-values-label"],"displayAxisLabels":[516,"display-axis-labels"],"displayItemText":[516,"display-item-text"],"displayItemValue":[516,"display-item-value"],"items":[16],"type":[513],"orientation":[513],"maxValue":[514,"max-value"],"axisIncrement":[514,"axis-increment"],"loading":[516]},null,{"items":[{"handleChange":0}],"axisIncrement":[{"handleChange":0}],"maxValue":[{"handleChange":0}]}]]],["p-8f4273e4",[[1,"limel-select",{"disabled":[516],"readonly":[516],"invalid":[516],"required":[516],"label":[513],"helperText":[513,"helper-text"],"value":[16],"options":[16],"multiple":[4],"menuOpen":[32]},null,{"value":[{"resetHasChanged":0}],"options":[{"resetHasChanged":0},{"updateHasPrimaryComponent":0}],"menuOpen":[{"watchOpen":0}]}]]],["p-f2c8b10b",[[1,"limel-help",{"value":[1],"trigger":[1],"readMoreLink":[16],"openDirection":[513,"open-direction"],"isOpen":[32]}]]],["p-51cb779f",[[257,"limel-info-tile",{"value":[520],"icon":[1],"label":[513],"prefix":[513],"suffix":[513],"disabled":[516],"reducedPresence":[516,"reduced-presence"],"badge":[520],"loading":[516],"link":[16],"progress":[16],"hasPrimarySlot":[32]}]]],["p-31713caf",[[1,"limel-table",{"data":[16],"columns":[16],"mode":[513],"layout":[513],"pageSize":[514,"page-size"],"totalRows":[514,"total-rows"],"sorting":[16],"activeRow":[1040],"movableColumns":[516,"movable-columns"],"movableRows":[516,"movable-rows"],"sortableColumns":[516,"sortable-columns"],"loading":[516],"page":[514],"emptyMessage":[1,"empty-message"],"aggregates":[16],"selectable":[516],"selection":[16],"language":[513],"paginationLocation":[513,"pagination-location"]},null,{"totalRows":[{"totalRowsChanged":0}],"pageSize":[{"pageSizeChanged":0}],"page":[{"pageChanged":0}],"activeRow":[{"activeRowChanged":0}],"data":[{"updateData":0}],"columns":[{"updateColumns":0}],"aggregates":[{"updateAggregates":0}],"selection":[{"updateSelection":0}],"selectable":[{"updateSelectable":0}],"movableRows":[{"updateMovableRows":0}],"sortableColumns":[{"updateSortableColumns":0}],"sorting":[{"updateSorting":0}]}]]],["p-4a09fb2e",[[0,"limel-drag-handle",{"dragDirection":[513,"drag-direction"],"tooltipOpenDirection":[513,"tooltip-open-direction"],"language":[513]}]]],["p-ad4672b2",[[1,"limel-shortcut",{"icon":[513],"label":[513],"disabled":[516],"badge":[520],"link":[16]}]]],["p-b3274e2e",[[1,"limel-switch",{"label":[513],"disabled":[516],"readonly":[516],"invalid":[516],"value":[516],"helperText":[513,"helper-text"],"readonlyLabels":[16],"fieldId":[32]}]]],["p-946a33ea",[[257,"limel-tab-panel",{"tabs":[1040]},null,{"tabs":[{"tabsChanged":0}]}]]],["p-9ae7d11b",[[1,"limel-code-editor",{"value":[1],"language":[1],"readonly":[516],"disabled":[516],"invalid":[516],"required":[516],"label":[513],"helperText":[513,"helper-text"],"lineNumbers":[516,"line-numbers"],"lineWrapping":[516,"line-wrapping"],"fold":[516],"lint":[516],"colorScheme":[513,"color-scheme"],"translationLanguage":[513,"translation-language"],"showCopyButton":[516,"show-copy-button"],"random":[32],"wasCopied":[32]},null,{"value":[{"watchValue":0}],"disabled":[{"watchDisabled":0}],"readonly":[{"watchReadonly":0}],"invalid":[{"watchInvalid":0}],"required":[{"watchRequired":0}],"helperText":[{"watchHelperText":0}]}]]],["p-c0263530",[[257,"limel-dialog",{"heading":[1],"fullscreen":[516],"open":[1540],"closingActions":[16]},null,{"open":[{"watchHandler":0}],"closingActions":[{"closingActionsChanged":0}]}]]],["p-120182f5",[[1,"limel-menu-item-meta",{"commandText":[513,"command-text"],"hotkey":[513],"disabled":[516],"badge":[8],"showChevron":[4,"show-chevron"]}]]],["p-eecd1132",[[1,"limel-progress-flow",{"flowItems":[16],"disabled":[4],"readonly":[4]}]]],["p-ee58f0b4",[[1,"limel-slider",{"disabled":[516],"readonly":[516],"factor":[514],"label":[513],"helperText":[513,"helper-text"],"required":[516],"invalid":[516],"displaysPercentageColors":[516,"displays-percentage-colors"],"unit":[513],"value":[514],"valuemax":[514],"valuemin":[514],"step":[514],"percentageClass":[32],"displayValue":[32]},null,{"value":[{"watchValue":0}]}]]],["p-fe531211",[[257,"limel-banner",{"message":[513],"icon":[513],"isOpen":[32],"open":[64],"close":[64]}]]],["p-1fb4bfa9",[[1,"limel-form",{"schema":[16],"value":[16],"disabled":[4],"propsFactory":[16],"transformErrors":[16],"errors":[16],"revealErrors":[4,"reveal-errors"]}]]],["p-2737cade",[[0,"limel-radio-button-group",{"items":[16],"selectedItem":[16],"disabled":[516],"badgeIcons":[516,"badge-icons"],"maxLinesSecondaryText":[514,"max-lines-secondary-text"]}]]],["p-7f7e2180",[[1,"limel-ai-avatar",{"isThinking":[516,"is-thinking"],"mode":[513],"variant":[513],"language":[513]},null,{"isThinking":[{"onIsThinkingChange":0}]}]]],["p-6acd82ce",[[1,"limel-config",{"config":[16]}]]],["p-bb9b399c",[[257,"limel-flex-container",{"direction":[513],"justify":[513],"align":[513],"reverse":[516]}]]],["p-6665e14b",[[257,"limel-grid"]]],["p-21558be2",[[257,"limel-masonry-layout",{"ordered":[516],"containerHeight":[32]},null,{"ordered":[{"onOrderedChange":0}]}]]],["p-aa080a8f",[[257,"limel-email-viewer",{"email":[16],"fallbackUrl":[513,"fallback-url"],"language":[513],"allowRemoteImages":[4,"allow-remote-images"],"allowRemoteImagesState":[32]},null,{"email":[{"resetAllowRemoteImages":0}]}]]],["p-4512a7b1",[[17,"limel-prosemirror-adapter",{"contentType":[1,"content-type"],"value":[1],"language":[513],"disabled":[516],"customElements":[16],"inlineImages":[16],"triggerCharacters":[16],"ui":[1],"view":[32],"actionBarItems":[32],"link":[32],"isLinkMenuOpen":[32],"flushPendingChanges":[64],"clear":[64]},null,{"value":[{"watchValue":0}]}]]],["p-dd9591a3",[[0,"limel-dock-button",{"item":[16],"expanded":[516],"useMobileLayout":[516,"use-mobile-layout"],"isOpen":[32]},null,{"isOpen":[{"openWatcher":0}]}]]],["p-c8ce60a0",[[17,"limel-color-picker-palette",{"value":[513],"label":[513],"helperText":[513,"helper-text"],"placeholder":[513],"required":[516],"invalid":[516],"manualInput":[516,"manual-input"],"columnCount":[514,"column-count"],"palette":[16]}]]],["p-cf955cc2",[[1,"limel-checkbox",{"disabled":[516],"readonly":[516],"invalid":[516],"label":[513],"helperText":[513,"helper-text"],"checked":[516],"indeterminate":[516],"required":[516],"readonlyLabels":[16],"modified":[32]},null,{"checked":[{"handleCheckedChange":0}],"indeterminate":[{"handleIndeterminateChange":0}],"readonly":[{"handleReadonlyChange":0}]}]]],["p-eeb7fcb3",[[1,"limel-tab-bar",{"tabs":[1040],"canScrollLeft":[32],"canScrollRight":[32]},[[9,"resize","handleWindowResize"]],{"tabs":[{"tabsChanged":0}]}]]],["p-2284caa7",[[257,"limel-callout",{"heading":[513],"icon":[513],"type":[513],"language":[1]}]]],["p-1907a5be",[[257,"limel-header",{"icon":[1],"heading":[1],"subheading":[1],"supportingText":[1,"supporting-text"],"subheadingDivider":[1,"subheading-divider"]}]]],["p-de070191",[[1,"limel-help-content",{"value":[1],"readMoreLink":[16]}]]],["p-e3ba7e15",[[0,"limel-progress-flow-item",{"item":[16],"disabled":[4],"readonly":[4],"currentStep":[4,"current-step"]}]]],["p-70087de6",[[1,"limel-circular-progress",{"value":[2],"maxValue":[2,"max-value"],"prefix":[513],"suffix":[1],"displayPercentageColors":[4,"display-percentage-colors"],"size":[513]}]]],["p-19c81ded",[[1,"limel-flatpickr-adapter",{"value":[16],"type":[1],"format":[1],"isOpen":[4,"is-open"],"inputElement":[16],"language":[1],"formatter":[16]}]]],["p-7fe6a073",[[0,"limel-radio-button",{"checked":[516],"disabled":[516],"id":[1],"label":[1],"onChange":[16]}]]],["p-758939be",[[17,"limel-chip-set",{"value":[16],"type":[513],"label":[513],"helperText":[513,"helper-text"],"disabled":[516],"readonly":[516],"invalid":[516],"inputType":[513,"input-type"],"maxItems":[514,"max-items"],"required":[516],"searchLabel":[513,"search-label"],"emptyInputOnBlur":[516,"empty-input-on-blur"],"emptyInputOnChange":[516,"empty-input-on-change"],"clearAllButton":[4,"clear-all-button"],"leadingIcon":[513,"leading-icon"],"delimiter":[513],"autocomplete":[513],"language":[1],"editMode":[32],"textValue":[32],"blurred":[32],"inputChipIndexSelected":[32],"selectedChipIds":[32],"getEditMode":[64],"setFocus":[64],"emptyInput":[64]},null,{"value":[{"handleChangeChips":0}]}]]],["p-7bfac292",[[17,"limel-button",{"label":[513],"primary":[516],"outlined":[516],"icon":[513],"disabled":[516],"loading":[516],"loadingFailed":[516,"loading-failed"],"justLoaded":[32]},null,{"loading":[{"loadingWatcher":0}]}]]],["p-d521d599",[[1,"limel-tooltip",{"elementId":[513,"element-id"],"label":[513],"helperLabel":[513,"helper-label"],"hotkey":[513],"maxlength":[514],"openDirection":[513,"open-direction"],"open":[32]}],[1,"limel-tooltip-content",{"label":[513],"helperLabel":[513,"helper-label"],"maxlength":[514],"hotkey":[513]}],[1,"limel-hotkey",{"value":[513],"disabled":[516]}],[257,"limel-portal",{"openDirection":[513,"open-direction"],"position":[513],"containerId":[513,"container-id"],"containerStyle":[16],"inheritParentWidth":[516,"inherit-parent-width"],"visible":[516],"anchor":[16]},null,{"visible":[{"onVisible":0}]}]]],["p-6fbf20c6",[[1,"limel-text-editor-link-menu",{"link":[16],"language":[513],"isOpen":[516,"is-open"]}]]],["p-d7bb4310",[[257,"limel-collapsible-section",{"isOpen":[1540,"is-open"],"header":[513],"icon":[1],"invalid":[516],"actions":[16],"language":[513]}]]],["p-be5cc2ae",[[1,"limel-3d-hover-effect-glow"]]],["p-ea34a4bc",[[257,"limel-file-dropzone",{"accept":[513],"disabled":[4],"text":[1],"helperText":[1,"helper-text"],"hasFileToDrop":[32]}],[257,"limel-file-input",{"accept":[513],"disabled":[516],"multiple":[516]}]]],["p-a1c15727",[[1,"limel-dynamic-label",{"value":[8],"defaultLabel":[16],"labels":[16]}]]],["p-86b9f9d0",[[17,"limel-icon-button",{"icon":[1],"elevated":[516],"label":[513],"helperLabel":[513,"helper-label"],"disabled":[516]}]]],["p-224e80b5",[[1,"limel-markdown",{"value":[1],"whitelist":[16],"lazyLoadImages":[516,"lazy-load-images"],"removeEmptyParagraphs":[516,"remove-empty-paragraphs"],"adaptColorContrast":[516,"adapt-color-contrast"]},null,{"value":[{"textChanged":0}],"whitelist":[{"handleWhitelistChange":0}],"removeEmptyParagraphs":[{"handleRemoveEmptyParagraphsChange":0}],"adaptColorContrast":[{"handleAdaptColorContrastChange":0}]}]]],["p-bf3c78a8",[[257,"limel-popover",{"open":[4],"openDirection":[513,"open-direction"]},null,{"open":[{"watchOpen":0}]}],[1,"limel-popover-surface",{"contentCollection":[16]}]]],["p-f09822a6",[[1,"limel-badge",{"label":[520]}]]],["p-0ecf8399",[[1,"limel-helper-line",{"helperText":[513,"helper-text"],"length":[514],"maxLength":[514,"max-length"],"invalid":[516],"helperTextId":[513,"helper-text-id"]}]]],["p-fc43fb46",[[257,"limel-menu",{"items":[16],"disabled":[516],"openDirection":[513,"open-direction"],"surfaceWidth":[513,"surface-width"],"open":[1540],"badgeIcons":[516,"badge-icons"],"gridLayout":[516,"grid-layout"],"loading":[516],"currentSubMenu":[1040],"rootItem":[16],"searcher":[16],"searchPlaceholder":[1,"search-placeholder"],"emptyResultMessage":[1,"empty-result-message"],"keepOpenOnSelect":[516,"keep-open-on-select"],"loadingSubItems":[32],"searchValue":[32],"searchResults":[32]},null,{"items":[{"itemsWatcher":0}],"open":[{"openWatcher":0}]}],[1,"limel-breadcrumbs",{"items":[16],"divider":[1]}],[17,"limel-menu-list",{"items":[16],"badgeIcons":[4,"badge-icons"],"iconSize":[1,"icon-size"]},null,{"items":[{"itemsChanged":0}]}],[17,"limel-input-field",{"disabled":[516],"readonly":[516],"invalid":[516],"label":[513],"placeholder":[513],"helperText":[513,"helper-text"],"prefix":[513],"suffix":[513],"required":[516],"value":[513],"trailingIcon":[513,"trailing-icon"],"leadingIcon":[513,"leading-icon"],"pattern":[513],"type":[513],"formatNumber":[516,"format-number"],"step":[520],"max":[514],"min":[514],"maxlength":[514],"minlength":[514],"completions":[16],"showLink":[516,"show-link"],"locale":[513],"isFocused":[32],"wasInvalid":[32],"showCompletions":[32],"getSelectionStart":[64],"getSelectionEnd":[64],"getSelectionDirection":[64]},null,{"value":[{"valueWatcher":0}],"completions":[{"completionsWatcher":0}]}],[257,"limel-menu-surface",{"open":[4],"allowClicksElement":[16]}],[1,"limel-spinner",{"size":[513],"limeBranded":[4,"lime-branded"]}],[17,"limel-list",{"items":[16],"badgeIcons":[4,"badge-icons"],"iconSize":[1,"icon-size"],"type":[1],"maxLinesSecondaryText":[2,"max-lines-secondary-text"]},null,{"type":[{"handleType":0}],"items":[{"itemsChanged":0}]}],[260,"limel-notched-outline",{"required":[516],"readonly":[516],"invalid":[516],"disabled":[516],"label":[513],"labelId":[513,"label-id"],"hasValue":[516,"has-value"],"hasLeadingIcon":[516,"has-leading-icon"],"hasFloatingLabel":[516,"has-floating-label"]}]]],["p-1e3cdfa1",[[17,"limel-chip",{"language":[513],"text":[513],"icon":[1],"image":[16],"link":[16],"badge":[520],"disabled":[516],"readonly":[516],"selected":[516],"invalid":[516],"removable":[516],"type":[513],"loading":[516],"progress":[514],"identifier":[520],"size":[513],"menuItems":[16]}],[1,"limel-linear-progress",{"language":[513],"value":[514],"indeterminate":[516],"accessibleLabel":[513,"accessible-label"]},null,{"value":[{"watchValue":0}]}]]],["p-c8116a01",[[1,"limel-action-bar",{"actions":[16],"accessibleLabel":[513,"accessible-label"],"language":[1],"layout":[513],"collapsible":[516],"openDirection":[513,"open-direction"],"overflowCutoff":[32]}],[0,"limel-action-bar-overflow-menu",{"items":[16],"openDirection":[513,"open-direction"]}],[0,"limel-action-bar-item",{"item":[16],"isVisible":[516,"is-visible"],"selected":[516]}]]]]'),e))));
|
|
1
|
+
import{p as e,g as l,b as a}from"./p-BGxJfR2f.js";export{s as setNonce}from"./p-BGxJfR2f.js";(()=>{const l=import.meta.url,a={};return""!==l&&(a.resourcesUrl=new URL(".",l).href),e(a)})().then((async e=>(await l(),a(JSON.parse('[["p-d19ab443",[[1,"limel-icon",{"size":[513],"name":[513],"badge":[516],"svgClass":[513,"svg-class"]},null,{"name":[{"loadIcon":0}],"svgClass":[{"applySvgClass":0}]}]]],["p-a45b8634",[[17,"limel-text-editor",{"contentType":[1,"content-type"],"language":[513],"disabled":[516],"readonly":[516],"helperText":[513,"helper-text"],"placeholder":[513],"label":[513],"invalid":[516],"value":[513],"customElements":[16],"inlineImages":[16],"triggers":[16],"required":[516],"allowResize":[516,"allow-resize"],"ui":[513],"flushPendingChanges":[64],"clear":[64]}]]],["p-f51b5651",[[1,"limel-file-viewer",{"url":[513],"filename":[513],"alt":[513],"allowFullscreen":[516,"allow-fullscreen"],"allowOpenInNewTab":[516,"allow-open-in-new-tab"],"allowDownload":[516,"allow-download"],"language":[1],"officeViewer":[513,"office-viewer"],"actions":[16],"isFullscreen":[32],"fileType":[32],"loading":[32],"fileUrl":[32],"email":[32]},null,{"url":[{"watchUrl":0}]}]]],["p-7df111bb",[[257,"limel-card",{"heading":[513],"subheading":[513],"image":[16],"icon":[513],"value":[1],"actions":[16],"clickable":[516],"orientation":[513],"selected":[516],"show3dEffect":[516,"show-3d-effect"],"canScrollUp":[32],"canScrollDown":[32]}]]],["p-8aeeeb53",[[1,"limel-file",{"value":[16],"label":[513],"helperText":[513,"helper-text"],"required":[516],"disabled":[516],"readonly":[516],"invalid":[516],"loading":[516],"accept":[513],"resizeImage":[16],"language":[1],"resizingFile":[32]},null,{"value":[{"handleValueChange":0}]}]]],["p-ca0b86ee",[[1,"limel-code-diff",{"oldValue":[1,"old-value"],"newValue":[1,"new-value"],"oldHeading":[513,"old-heading"],"newHeading":[513,"new-heading"],"layout":[513],"contextLines":[514,"context-lines"],"lineWrapping":[516,"line-wrapping"],"language":[513],"reformatJson":[516,"reformat-json"],"translationLanguage":[513,"translation-language"],"diffResult":[32],"liveAnnouncement":[32],"copyState":[32],"searchVisible":[32],"searchTerm":[32],"currentMatchIndex":[32]},null,{"oldValue":[{"watchInputs":0}],"newValue":[{"watchInputs":0}],"contextLines":[{"watchInputs":0}],"reformatJson":[{"watchInputs":0}],"layout":[{"watchInputs":0}]}]]],["p-2f223e46",[[0,"limel-list-item",{"language":[513],"value":[8],"text":[513],"secondaryText":[513,"secondary-text"],"disabled":[516],"icon":[1],"iconSize":[513,"icon-size"],"badgeIcon":[516,"badge-icon"],"selected":[516],"actions":[16],"primaryComponent":[16],"image":[16],"type":[513]}]]],["p-03fd2181",[[17,"limel-picker",{"disabled":[4],"readonly":[516],"label":[1],"searchLabel":[1,"search-label"],"helperText":[513,"helper-text"],"leadingIcon":[1,"leading-icon"],"emptyResultMessage":[1,"empty-result-message"],"language":[1],"required":[4],"invalid":[516],"value":[16],"searcher":[16],"allItems":[16],"multiple":[4],"delimiter":[513],"actions":[16],"actionPosition":[1,"action-position"],"actionScrollBehavior":[1,"action-scroll-behavior"],"badgeIcons":[516,"badge-icons"],"items":[32],"textValue":[32],"loading":[32],"chips":[32]},null,{"disabled":[{"onDisabledChange":0}],"value":[{"onChangeValue":0}]}]]],["p-8175c53a",[[17,"limel-split-button",{"label":[513],"primary":[516],"icon":[513],"disabled":[516],"loading":[516],"loadingFailed":[516,"loading-failed"],"items":[16]}]]],["p-191efd88",[[1,"limel-color-picker",{"value":[513],"label":[513],"helperText":[513,"helper-text"],"tooltipLabel":[513,"tooltip-label"],"required":[516],"disabled":[516],"readonly":[516],"invalid":[516],"placeholder":[513],"manualInput":[516,"manual-input"],"palette":[16],"paletteColumnCount":[514,"palette-column-count"],"isOpen":[32]}]]],["p-6722e6e2",[[1,"limel-profile-picture",{"language":[513],"label":[513],"icon":[1],"helperText":[1,"helper-text"],"disabled":[516],"readonly":[516],"required":[516],"invalid":[516],"loading":[516],"value":[1],"imageFit":[513,"image-fit"],"accept":[513],"resize":[16],"objectUrl":[32],"imageError":[32],"isErrorMessagePopoverOpen":[32]},null,{"value":[{"handleValueChange":0}]}]]],["p-ea94f7fa",[[1,"limel-dock",{"dockItems":[16],"dockFooterItems":[16],"accessibleLabel":[513,"accessible-label"],"expanded":[516],"allowResize":[516,"allow-resize"],"mobileBreakPoint":[514,"mobile-break-point"],"useMobileLayout":[32]}]]],["p-e545c9e8",[[1,"limel-snackbar",{"open":[516],"message":[1],"timeout":[514],"actionText":[1,"action-text"],"dismissible":[4],"multiline":[4],"language":[1],"offset":[32],"isOpen":[32],"closing":[32],"show":[64]},[[0,"changeOffset","onChangeIndex"]],{"open":[{"watchOpen":0}]}]]],["p-ed53466d",[[1,"limel-date-picker",{"disabled":[516],"readonly":[516],"invalid":[516],"label":[513],"placeholder":[513],"helperText":[513,"helper-text"],"required":[516],"value":[16],"type":[513],"format":[513],"language":[513],"formatter":[16],"internalFormat":[32],"showPortal":[32]}]]],["p-92bbb643",[[1,"limel-button-group",{"value":[16],"disabled":[516],"selectedButtonId":[32]},null,{"value":[{"valueChanged":0}]}]]],["p-7487d65d",[[1,"limel-chart",{"language":[513],"accessibleLabel":[513,"accessible-label"],"accessibleItemsLabel":[513,"accessible-items-label"],"accessibleValuesLabel":[513,"accessible-values-label"],"displayAxisLabels":[516,"display-axis-labels"],"displayItemText":[516,"display-item-text"],"displayItemValue":[516,"display-item-value"],"items":[16],"type":[513],"orientation":[513],"maxValue":[514,"max-value"],"axisIncrement":[514,"axis-increment"],"loading":[516]},null,{"items":[{"handleChange":0}],"axisIncrement":[{"handleChange":0}],"maxValue":[{"handleChange":0}]}]]],["p-9152d7e1",[[1,"limel-select",{"disabled":[516],"readonly":[516],"invalid":[516],"required":[516],"label":[513],"helperText":[513,"helper-text"],"value":[16],"options":[16],"multiple":[4],"menuOpen":[32]},null,{"value":[{"resetHasChanged":0}],"options":[{"resetHasChanged":0},{"updateHasPrimaryComponent":0},{"resetTypeaheadOnItemsChange":0}],"required":[{"resetTypeaheadOnItemsChange":0}],"menuOpen":[{"watchOpen":0}]}]]],["p-f2c8b10b",[[1,"limel-help",{"value":[1],"trigger":[1],"readMoreLink":[16],"openDirection":[513,"open-direction"],"isOpen":[32]}]]],["p-51cb779f",[[257,"limel-info-tile",{"value":[520],"icon":[1],"label":[513],"prefix":[513],"suffix":[513],"disabled":[516],"reducedPresence":[516,"reduced-presence"],"badge":[520],"loading":[516],"link":[16],"progress":[16],"hasPrimarySlot":[32]}]]],["p-31713caf",[[1,"limel-table",{"data":[16],"columns":[16],"mode":[513],"layout":[513],"pageSize":[514,"page-size"],"totalRows":[514,"total-rows"],"sorting":[16],"activeRow":[1040],"movableColumns":[516,"movable-columns"],"movableRows":[516,"movable-rows"],"sortableColumns":[516,"sortable-columns"],"loading":[516],"page":[514],"emptyMessage":[1,"empty-message"],"aggregates":[16],"selectable":[516],"selection":[16],"language":[513],"paginationLocation":[513,"pagination-location"]},null,{"totalRows":[{"totalRowsChanged":0}],"pageSize":[{"pageSizeChanged":0}],"page":[{"pageChanged":0}],"activeRow":[{"activeRowChanged":0}],"data":[{"updateData":0}],"columns":[{"updateColumns":0}],"aggregates":[{"updateAggregates":0}],"selection":[{"updateSelection":0}],"selectable":[{"updateSelectable":0}],"movableRows":[{"updateMovableRows":0}],"sortableColumns":[{"updateSortableColumns":0}],"sorting":[{"updateSorting":0}]}]]],["p-4a09fb2e",[[0,"limel-drag-handle",{"dragDirection":[513,"drag-direction"],"tooltipOpenDirection":[513,"tooltip-open-direction"],"language":[513]}]]],["p-ad4672b2",[[1,"limel-shortcut",{"icon":[513],"label":[513],"disabled":[516],"badge":[520],"link":[16]}]]],["p-b3274e2e",[[1,"limel-switch",{"label":[513],"disabled":[516],"readonly":[516],"invalid":[516],"value":[516],"helperText":[513,"helper-text"],"readonlyLabels":[16],"fieldId":[32]}]]],["p-946a33ea",[[257,"limel-tab-panel",{"tabs":[1040]},null,{"tabs":[{"tabsChanged":0}]}]]],["p-9ae7d11b",[[1,"limel-code-editor",{"value":[1],"language":[1],"readonly":[516],"disabled":[516],"invalid":[516],"required":[516],"label":[513],"helperText":[513,"helper-text"],"lineNumbers":[516,"line-numbers"],"lineWrapping":[516,"line-wrapping"],"fold":[516],"lint":[516],"colorScheme":[513,"color-scheme"],"translationLanguage":[513,"translation-language"],"showCopyButton":[516,"show-copy-button"],"random":[32],"wasCopied":[32]},null,{"value":[{"watchValue":0}],"disabled":[{"watchDisabled":0}],"readonly":[{"watchReadonly":0}],"invalid":[{"watchInvalid":0}],"required":[{"watchRequired":0}],"helperText":[{"watchHelperText":0}]}]]],["p-c0263530",[[257,"limel-dialog",{"heading":[1],"fullscreen":[516],"open":[1540],"closingActions":[16]},null,{"open":[{"watchHandler":0}],"closingActions":[{"closingActionsChanged":0}]}]]],["p-120182f5",[[1,"limel-menu-item-meta",{"commandText":[513,"command-text"],"hotkey":[513],"disabled":[516],"badge":[8],"showChevron":[4,"show-chevron"]}]]],["p-eecd1132",[[1,"limel-progress-flow",{"flowItems":[16],"disabled":[4],"readonly":[4]}]]],["p-ee58f0b4",[[1,"limel-slider",{"disabled":[516],"readonly":[516],"factor":[514],"label":[513],"helperText":[513,"helper-text"],"required":[516],"invalid":[516],"displaysPercentageColors":[516,"displays-percentage-colors"],"unit":[513],"value":[514],"valuemax":[514],"valuemin":[514],"step":[514],"percentageClass":[32],"displayValue":[32]},null,{"value":[{"watchValue":0}]}]]],["p-fe531211",[[257,"limel-banner",{"message":[513],"icon":[513],"isOpen":[32],"open":[64],"close":[64]}]]],["p-1fb4bfa9",[[1,"limel-form",{"schema":[16],"value":[16],"disabled":[4],"propsFactory":[16],"transformErrors":[16],"errors":[16],"revealErrors":[4,"reveal-errors"]}]]],["p-2737cade",[[0,"limel-radio-button-group",{"items":[16],"selectedItem":[16],"disabled":[516],"badgeIcons":[516,"badge-icons"],"maxLinesSecondaryText":[514,"max-lines-secondary-text"]}]]],["p-7f7e2180",[[1,"limel-ai-avatar",{"isThinking":[516,"is-thinking"],"mode":[513],"variant":[513],"language":[513]},null,{"isThinking":[{"onIsThinkingChange":0}]}]]],["p-6acd82ce",[[1,"limel-config",{"config":[16]}]]],["p-bb9b399c",[[257,"limel-flex-container",{"direction":[513],"justify":[513],"align":[513],"reverse":[516]}]]],["p-6665e14b",[[257,"limel-grid"]]],["p-21558be2",[[257,"limel-masonry-layout",{"ordered":[516],"containerHeight":[32]},null,{"ordered":[{"onOrderedChange":0}]}]]],["p-aa080a8f",[[257,"limel-email-viewer",{"email":[16],"fallbackUrl":[513,"fallback-url"],"language":[513],"allowRemoteImages":[4,"allow-remote-images"],"allowRemoteImagesState":[32]},null,{"email":[{"resetAllowRemoteImages":0}]}]]],["p-845cfda7",[[17,"limel-prosemirror-adapter",{"contentType":[1,"content-type"],"value":[1],"language":[513],"disabled":[516],"customElements":[16],"inlineImages":[16],"triggerCharacters":[16],"ui":[1],"view":[32],"actionBarItems":[32],"link":[32],"isLinkMenuOpen":[32],"flushPendingChanges":[64],"clear":[64]},null,{"value":[{"watchValue":0}]}]]],["p-dd9591a3",[[0,"limel-dock-button",{"item":[16],"expanded":[516],"useMobileLayout":[516,"use-mobile-layout"],"isOpen":[32]},null,{"isOpen":[{"openWatcher":0}]}]]],["p-c8ce60a0",[[17,"limel-color-picker-palette",{"value":[513],"label":[513],"helperText":[513,"helper-text"],"placeholder":[513],"required":[516],"invalid":[516],"manualInput":[516,"manual-input"],"columnCount":[514,"column-count"],"palette":[16]}]]],["p-cf955cc2",[[1,"limel-checkbox",{"disabled":[516],"readonly":[516],"invalid":[516],"label":[513],"helperText":[513,"helper-text"],"checked":[516],"indeterminate":[516],"required":[516],"readonlyLabels":[16],"modified":[32]},null,{"checked":[{"handleCheckedChange":0}],"indeterminate":[{"handleIndeterminateChange":0}],"readonly":[{"handleReadonlyChange":0}]}]]],["p-eeb7fcb3",[[1,"limel-tab-bar",{"tabs":[1040],"canScrollLeft":[32],"canScrollRight":[32]},[[9,"resize","handleWindowResize"]],{"tabs":[{"tabsChanged":0}]}]]],["p-2284caa7",[[257,"limel-callout",{"heading":[513],"icon":[513],"type":[513],"language":[1]}]]],["p-1907a5be",[[257,"limel-header",{"icon":[1],"heading":[1],"subheading":[1],"supportingText":[1,"supporting-text"],"subheadingDivider":[1,"subheading-divider"]}]]],["p-de070191",[[1,"limel-help-content",{"value":[1],"readMoreLink":[16]}]]],["p-e3ba7e15",[[0,"limel-progress-flow-item",{"item":[16],"disabled":[4],"readonly":[4],"currentStep":[4,"current-step"]}]]],["p-70087de6",[[1,"limel-circular-progress",{"value":[2],"maxValue":[2,"max-value"],"prefix":[513],"suffix":[1],"displayPercentageColors":[4,"display-percentage-colors"],"size":[513]}]]],["p-19c81ded",[[1,"limel-flatpickr-adapter",{"value":[16],"type":[1],"format":[1],"isOpen":[4,"is-open"],"inputElement":[16],"language":[1],"formatter":[16]}]]],["p-7fe6a073",[[0,"limel-radio-button",{"checked":[516],"disabled":[516],"id":[1],"label":[1],"onChange":[16]}]]],["p-2e5d5e79",[[17,"limel-chip-set",{"value":[16],"type":[513],"label":[513],"helperText":[513,"helper-text"],"disabled":[516],"readonly":[516],"invalid":[516],"inputType":[513,"input-type"],"maxItems":[514,"max-items"],"required":[516],"searchLabel":[513,"search-label"],"emptyInputOnBlur":[516,"empty-input-on-blur"],"emptyInputOnChange":[516,"empty-input-on-change"],"clearAllButton":[4,"clear-all-button"],"leadingIcon":[513,"leading-icon"],"delimiter":[513],"autocomplete":[513],"language":[1],"editMode":[32],"textValue":[32],"blurred":[32],"inputChipIndexSelected":[32],"selectedChipIds":[32],"getEditMode":[64],"setFocus":[64],"emptyInput":[64]},null,{"value":[{"handleChangeChips":0}]}]]],["p-7bfac292",[[17,"limel-button",{"label":[513],"primary":[516],"outlined":[516],"icon":[513],"disabled":[516],"loading":[516],"loadingFailed":[516,"loading-failed"],"justLoaded":[32]},null,{"loading":[{"loadingWatcher":0}]}]]],["p-d521d599",[[1,"limel-tooltip",{"elementId":[513,"element-id"],"label":[513],"helperLabel":[513,"helper-label"],"hotkey":[513],"maxlength":[514],"openDirection":[513,"open-direction"],"open":[32]}],[1,"limel-tooltip-content",{"label":[513],"helperLabel":[513,"helper-label"],"maxlength":[514],"hotkey":[513]}],[1,"limel-hotkey",{"value":[513],"disabled":[516]}],[257,"limel-portal",{"openDirection":[513,"open-direction"],"position":[513],"containerId":[513,"container-id"],"containerStyle":[16],"inheritParentWidth":[516,"inherit-parent-width"],"visible":[516],"anchor":[16]},null,{"visible":[{"onVisible":0}]}]]],["p-e8df7a2e",[[1,"limel-text-editor-link-menu",{"link":[16],"language":[513],"isOpen":[516,"is-open"]}]]],["p-d7bb4310",[[257,"limel-collapsible-section",{"isOpen":[1540,"is-open"],"header":[513],"icon":[1],"invalid":[516],"actions":[16],"language":[513]}]]],["p-be5cc2ae",[[1,"limel-3d-hover-effect-glow"]]],["p-ea34a4bc",[[257,"limel-file-dropzone",{"accept":[513],"disabled":[4],"text":[1],"helperText":[1,"helper-text"],"hasFileToDrop":[32]}],[257,"limel-file-input",{"accept":[513],"disabled":[516],"multiple":[516]}]]],["p-a1c15727",[[1,"limel-dynamic-label",{"value":[8],"defaultLabel":[16],"labels":[16]}]]],["p-86b9f9d0",[[17,"limel-icon-button",{"icon":[1],"elevated":[516],"label":[513],"helperLabel":[513,"helper-label"],"disabled":[516]}]]],["p-3ea159fd",[[1,"limel-markdown",{"value":[1],"whitelist":[16],"lazyLoadImages":[516,"lazy-load-images"],"removeEmptyParagraphs":[516,"remove-empty-paragraphs"],"adaptColorContrast":[516,"adapt-color-contrast"]},null,{"value":[{"textChanged":0}],"whitelist":[{"handleWhitelistChange":0}],"removeEmptyParagraphs":[{"handleRemoveEmptyParagraphsChange":0}],"adaptColorContrast":[{"handleAdaptColorContrastChange":0}]}]]],["p-2b01c1f2",[[257,"limel-popover",{"open":[4],"openDirection":[513,"open-direction"]},null,{"open":[{"watchOpen":0}]}],[1,"limel-popover-surface",{"contentCollection":[16]}]]],["p-f09822a6",[[1,"limel-badge",{"label":[520]}]]],["p-0ecf8399",[[1,"limel-helper-line",{"helperText":[513,"helper-text"],"length":[514],"maxLength":[514,"max-length"],"invalid":[516],"helperTextId":[513,"helper-text-id"]}]]],["p-12fe8fe1",[[257,"limel-menu",{"items":[16],"disabled":[516],"openDirection":[513,"open-direction"],"surfaceWidth":[513,"surface-width"],"open":[1540],"badgeIcons":[516,"badge-icons"],"gridLayout":[516,"grid-layout"],"loading":[516],"currentSubMenu":[1040],"rootItem":[16],"searcher":[16],"searchPlaceholder":[1,"search-placeholder"],"emptyResultMessage":[1,"empty-result-message"],"keepOpenOnSelect":[516,"keep-open-on-select"],"loadingSubItems":[32],"searchValue":[32],"searchResults":[32]},null,{"items":[{"itemsWatcher":0}],"open":[{"openWatcher":0}]}],[1,"limel-breadcrumbs",{"items":[16],"divider":[1]}],[17,"limel-menu-list",{"items":[16],"badgeIcons":[4,"badge-icons"],"iconSize":[1,"icon-size"]},null,{"items":[{"itemsChanged":0}]}],[17,"limel-input-field",{"disabled":[516],"readonly":[516],"invalid":[516],"label":[513],"placeholder":[513],"helperText":[513,"helper-text"],"prefix":[513],"suffix":[513],"required":[516],"value":[513],"trailingIcon":[513,"trailing-icon"],"leadingIcon":[513,"leading-icon"],"pattern":[513],"type":[513],"formatNumber":[516,"format-number"],"step":[520],"max":[514],"min":[514],"maxlength":[514],"minlength":[514],"completions":[16],"showLink":[516,"show-link"],"locale":[513],"isFocused":[32],"wasInvalid":[32],"showCompletions":[32],"getSelectionStart":[64],"getSelectionEnd":[64],"getSelectionDirection":[64]},null,{"value":[{"valueWatcher":0}],"completions":[{"completionsWatcher":0}]}],[257,"limel-menu-surface",{"open":[4],"allowClicksElement":[16]}],[1,"limel-spinner",{"size":[513],"limeBranded":[4,"lime-branded"]}],[17,"limel-list",{"items":[16],"badgeIcons":[4,"badge-icons"],"iconSize":[1,"icon-size"],"type":[1],"maxLinesSecondaryText":[2,"max-lines-secondary-text"]},null,{"type":[{"handleType":0}],"items":[{"itemsChanged":0}]}],[260,"limel-notched-outline",{"required":[516],"readonly":[516],"invalid":[516],"disabled":[516],"label":[513],"labelId":[513,"label-id"],"hasValue":[516,"has-value"],"hasLeadingIcon":[516,"has-leading-icon"],"hasFloatingLabel":[516,"has-floating-label"]}]]],["p-9a04a686",[[17,"limel-chip",{"language":[513],"text":[513],"icon":[1],"image":[16],"link":[16],"badge":[520],"disabled":[516],"readonly":[516],"selected":[516],"invalid":[516],"removable":[516],"type":[513],"loading":[516],"progress":[514],"identifier":[520],"size":[513],"menuItems":[16]}],[1,"limel-linear-progress",{"language":[513],"value":[514],"indeterminate":[516],"accessibleLabel":[513,"accessible-label"]},null,{"value":[{"watchValue":0}]}]]],["p-c8116a01",[[1,"limel-action-bar",{"actions":[16],"accessibleLabel":[513,"accessible-label"],"language":[1],"layout":[513],"collapsible":[516],"openDirection":[513,"open-direction"],"overflowCutoff":[32]}],[0,"limel-action-bar-overflow-menu",{"items":[16],"openDirection":[513,"open-direction"]}],[0,"limel-action-bar-item",{"item":[16],"isVisible":[516,"is-visible"],"selected":[516]}]]]]'),e))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as i,h as s,a as e}from"./p-BGxJfR2f.js";import{t as h}from"./p-Cb9R_zmF.js";import{i as n}from"./p-B9Ofc5RB.js";import{E as r,T as o,a,A as l,b as c}from"./p-
|
|
1
|
+
import{r as t,c as i,h as s,a as e}from"./p-BGxJfR2f.js";import{t as h}from"./p-Cb9R_zmF.js";import{i as n}from"./p-B9Ofc5RB.js";import{E as r,T as o,a,A as l,b as c}from"./p-C4_9qUMP.js";import{c as d}from"./p-JbKhhoXs.js";import{a as u,g as p}from"./p-CgNJbSP4.js";import{d as m}from"./p-BviYUVSD.js";import"./p-BJQylLSL.js";import"./p-D6dCQvwl.js";import"./p-BOEi1C7r.js";import"./p-oiMYqRQ0.js";const g=class{constructor(s){t(this,s),this.change=i(this,"change"),this.interact=i(this,"interact"),this.action=i(this,"action"),this.disabled=!1,this.readonly=!1,this.language="en",this.required=!1,this.invalid=!1,this.allItems=[],this.multiple=!1,this.delimiter=null,this.actions=[],this.actionPosition="bottom",this.actionScrollBehavior="sticky",this.badgeIcons=!1,this.textValue="",this.loading=!1,this.chips=[],this.chipSetEditMode=!1,this.getValueId=t=>{const i=t.value;return i&&"object"==typeof i?i.id:i},this.createChips=t=>t?this.multiple?t.map(this.createChip):[this.createChip(t)]:[],this.createChip=t=>{const i=p(t.icon),s=u(t.icon,t.iconColor);return{id:`${this.getValueId(t)}`,text:t.text,removable:!1!==t.removable,icon:i?{name:i,color:s}:void 0,image:t.image,value:t,menuItems:t.actions,badge:t.badge}},this.search=async t=>{const i=setTimeout((()=>{this.loading=!0})),s=this.searcher||this.defaultSearcher,e=await s(this.textValue);clearTimeout(i),this.handleSearchResult(t,e)},this.defaultSearcher=async t=>""===t?this.allItems.slice(0,20):this.allItems.filter((i=>{let s=i.text.toLowerCase();return i.secondaryText&&(s=s+" "+i.secondaryText.toLowerCase()),s.includes(t.toLowerCase())})).slice(0,20),this.handleTextInput=this.handleTextInput.bind(this),this.handleInputKeyDown=this.handleInputKeyDown.bind(this),this.handleInputFieldFocus=this.handleInputFieldFocus.bind(this),this.handleChange=this.handleChange.bind(this),this.handleInteract=this.handleInteract.bind(this),this.handleListChange=this.handleListChange.bind(this),this.handleActionListChange=this.handleActionListChange.bind(this),this.handleStopEditAndBlur=this.handleStopEditAndBlur.bind(this),this.handleCloseMenu=this.handleCloseMenu.bind(this),this.onListKeyDown=this.onListKeyDown.bind(this),this.portalId=d(),this.debouncedSearch=m(this.search,300)}componentWillLoad(){this.chips=this.createChips(this.value)}componentDidLoad(){this.chipSet=this.host.shadowRoot.querySelector("limel-chip-set"),this.updateTabIndex()}disconnectedCallback(){this.debouncedSearch.cancel()}onDisabledChange(){this.updateTabIndex()}updateTabIndex(){this.host.setAttribute("tabindex",this.disabled||this.readonly?"-1":"0")}async componentWillUpdate(){this.chipSetEditMode=!1,this.chipSet&&(this.chipSetEditMode=await this.chipSet.getEditMode())}render(){const t={};return this.multiple||(t.maxItems=1),[s("limel-chip-set",Object.assign({key:"281a5f2451505c012b72c04610d897cf22717420",type:"input",inputType:"search",label:this.label,helperText:this.helperText,leadingIcon:this.leadingIcon,value:this.chips,disabled:this.disabled,invalid:this.invalid,delimiter:this.renderDelimiter(),readonly:this.readonly,required:this.required,searchLabel:this.searchLabel,language:this.language,onInput:this.handleTextInput,onKeyDown:this.handleInputKeyDown,onChange:this.handleChange,onInteract:this.handleInteract,onStartEdit:this.handleInputFieldFocus,onStopEdit:this.handleStopEditAndBlur,emptyInputOnBlur:!1,emptyInputOnChange:!1,clearAllButton:this.multiple&&!this.chipSetEditMode},t)),this.renderDropdown()]}onChangeValue(){this.chips=this.createChips(this.value)}renderDelimiter(){return this.multiple?this.delimiter:null}renderDropdown(){const t=this.getDropdownContent(),i=[];if(this.shouldShowDropDownContent()){const s=this.getActionContent();"top"===this.actionPosition&&i.push(s),t&&i.push(t),"bottom"===this.actionPosition&&i.push(s)}return this.renderPortal(i)}getActionContent(){var t,i;return 0===(null!==(i=null===(t=this.actions)||void 0===t?void 0:t.length)&&void 0!==i?i:0)?null:[s("limel-list",{class:{"static-actions-list":!0,"is-on-top":"top"===this.actionPosition,"is-at-bottom":"bottom"===this.actionPosition,"has-position-sticky":"sticky"===this.actionScrollBehavior},badgeIcons:!0,type:"selectable",onChange:this.handleActionListChange,items:this.actions.map(this.removeUnusedPropertiesOnAction)})]}removeUnusedPropertiesOnAction(t){return Object.assign(Object.assign({},t),{actions:[]})}shouldShowDropDownContent(){return!this.isFull()&&!!this.chipSetEditMode}getDropdownContent(){var t;if(this.shouldShowDropDownContent())return this.loading?this.renderSpinner():(null===(t=this.items)||void 0===t?void 0:t.length)?this.renderListResult():""!==this.textValue?this.renderEmptyMessage():void 0}isFull(){return!this.multiple&&!!this.value}renderSpinner(){return s("div",{style:{width:"100%",display:"flex","align-items":"center","justify-content":"center",padding:"1rem 0"}},s("limel-spinner",{limeBranded:!1}))}renderEmptyMessage(){const t=this.emptyResultMessage||h.get("picker.no-matching-results",this.language,{query:this.textValue});return s("p",{style:{color:"rgb(var(--contrast-1100))",textAlign:"center",fontSize:"var(--limel-theme-default-font-size)",margin:"0.5rem 1rem"}},t)}renderListResult(){return s("limel-list",{badgeIcons:this.badgeIcons,onChange:this.handleListChange,onKeyDown:this.onListKeyDown,type:"selectable",items:this.items})}onListKeyDown(t){if(t.key===r)return t.preventDefault(),t.stopPropagation(),this.handleEscape(),void this.chipSet.setFocus();[o,a].includes(t.key)&&this.chipSet.setFocus()}renderPortal(t=[]){const i=getComputedStyle(this.host).getPropertyValue("--dropdown-z-index");return s("limel-portal",{visible:t.length>0,containerId:this.portalId,inheritParentWidth:!0,containerStyle:{"z-index":i}},s("limel-menu-surface",{open:t.length>0,allowClicksElement:this.host,style:{"--menu-surface-width":"100%","max-height":"inherit",display:"flex"},onDismiss:this.handleCloseMenu},t))}handleStopEditAndBlur(){const t=this.host.shadowRoot.activeElement||document.activeElement,i=document.querySelector(`#${this.portalId}`);n(t,this.host)||n(t,i)||this.clearInputField()}async handleTextInput(t){t.stopPropagation();const i=t.detail;this.textValue=i,this.debouncedSearch(i),""===i&&this.debouncedSearch.flush()}handleListChange(t){var i,s,e;if(t.stopPropagation(),!this.value||this.value!==t.detail){let e=t.detail;if(this.multiple&&(e=[...null!==(i=this.value)&&void 0!==i?i:[],t.detail]),this.change.emit(e),this.multiple){const i=this.items.filter((i=>i!==t.detail));this.items=this.hasPickableItems(i)?i:[]}else this.items=[],this.textValue="",null===(s=this.chipSet)||void 0===s||s.emptyInput()}this.multiple&&(null===(e=this.chipSet)||void 0===e||e.setFocus())}handleActionListChange(t){t.stopPropagation(),t.detail&&(this.action.emit(t.detail.value),this.items=[])}handleInputFieldFocus(){this.debouncedSearch(this.textValue)}handleChange(t){t.stopPropagation(),this.textValue="";let i=null;this.multiple&&(i=t.detail.map((t=>this.value.find((i=>`${this.getValueId(i)}`===t.id))))),this.change.emit(i)}handleInteract(t){t.stopPropagation(),this.interact.emit(t.detail?t.detail.value:t.detail)}handleInputKeyDown(t){const i=t.key===o&&!t.altKey&&!t.metaKey&&!t.shiftKey,s=t.key===l,e=t.key===c;if(t.key===r)return t.preventDefault(),t.stopPropagation(),void this.handleEscape();if(!i&&!s&&!e)return;const h=document.querySelector(` #${this.portalId} limel-list`);if(h){if(i||e){const i=h.shadowRoot.querySelector(".mdc-deprecated-list-item");if(!i)return;return t.preventDefault(),void i.focus()}if(s){const i=[...h.shadowRoot.querySelectorAll(".mdc-deprecated-list-item")].at(-1);if(!i)return;t.preventDefault(),i.focus()}}}handleSearchResult(t,i){var s;if(t===this.textValue){let e=i;if(this.multiple){const t=null!==(s=this.value)&&void 0!==s?s:[];e=i.filter((i=>"separator"in i||!t.includes(i)))}this.items=this.prependSearchHeader(t,e),this.loading=!1}}hasPickableItems(t){return t.some((t=>!("separator"in t)))}prependSearchHeader(t,i){return""===t?i:this.hasPickableItems(i)?[{separator:!0,text:h.get("picker.results-matching",this.language,{query:t})},...i]:i}handleCloseMenu(){this.clearInputField()}clearTextValue(){this.chipSet.emptyInput(),this.textValue="",this.debouncedSearch.cancel()}clearInputField(){this.clearTextValue(),this.handleSearchResult("",[])}resetSearchToDefault(){this.clearTextValue(),this.search("")}handleEscape(){""===this.textValue?this.clearInputField():this.resetSearchToDefault()}static get delegatesFocus(){return!0}get host(){return e(this)}static get watchers(){return{disabled:[{onDisabledChange:0}],value:[{onChangeValue:0}]}}};g.style=":host{position:relative;display:block}:host([hidden]){display:none}";export{g as limel_picker}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as t,c as e,h as i,a as l,H as n}from"./p-BGxJfR2f.js";import{m as r,r as o}from"./p-BgTwPGeH.js";import{c as d}from"./p-JbKhhoXs.js";import{g as a,b as s}from"./p-CgNJbSP4.js";import{T as c,A as m,b as h,E as f,a as u,S as x,c as p,d as b}from"./p-rI0IeKpx.js";import{b as g,a as v,g as _}from"./p-5KsJICvh.js";import{g as y}from"./p-Dnt5w_Bp.js";import{d as w}from"./p-BviYUVSD.js";import{M as k}from"./p-DZkKQUDM.js";import{_ as I,a as T,M as E,m as A,d as C,c as O,b as z}from"./p-ChRGk668.js";import{f as S,z as R}from"./p-D0F7gOYG.js";import{h as L,t as D,n as j}from"./p-BxrRWYts.js";import{i as F}from"./p-BcJ-TDVt.js";import{M}from"./p-BN1-aIOw.js";import{i as N}from"./p-B9Ofc5RB.js";import"./p-BJQylLSL.js";import"./p-D6dCQvwl.js";import"./p-BOEi1C7r.js";import"./p-oiMYqRQ0.js";import"./p-C9yTLqR8.js";import"./p-ByzvFNMm.js";import"./p-9W8bTt2G.js";import"./p-DbBZn7JO.js";import"./p-CZ30nDJE.js";const B=class{constructor(l){t(this,l),this.select=e(this,"select"),this.divider="›",this.renderSteps=()=>{const t=this.items.slice(0,-1);return this.areItemsLinks(this.items)?t.map(this.renderAsLink):t.map(this.renderAsButton)},this.renderAsButton=t=>{const e=d();return[i("button",{role:"listitem",id:e,class:"step",onClick:this.handleClick(t)},this.renderIcon(t),this.renderLabel(t)),this.renderTooltip(t,e)]},this.renderAsLink=t=>{const e=d();return[i("a",{role:"listitem",id:e,class:"step",href:t.link.href,title:t.link.title},this.renderIcon(t),this.renderLabel(t)),this.renderTooltip(t,e)]},this.renderLastStep=()=>{const t=this.items.slice(-1);return i("li",{class:"last step",tabindex:"-1","aria-current":this.areItemsLinks(this.items)?"page":"step"},this.renderIcon(t[0]),i("span",{class:"text"},t[0].text))},this.renderIcon=t=>{const e=a(t.icon),l=s(t.icon);if(e)return i("limel-icon",{style:{color:`${l}`},name:e})},this.renderLabel=t=>{if("icon-only"!==t.type)return i("span",{class:"text"},t.text)},this.renderTooltip=(t,e)=>{if("icon-only"===t.type)return i("limel-tooltip",{elementId:e,label:t.text})},this.areItemsLinks=t=>t.some((t=>"link"in t)),this.handleClick=t=>e=>{e.stopPropagation(),this.select.emit(t)}}render(){return i("ol",{key:"66f28dfd61493e4aa5d86b0d2434c2039fee4636",role:"navigation","aria-label":"Breadcrumb",style:{"--limel-breadcrumbs-divider":`'${this.divider}'`}},this.renderSteps(),this.renderLastStep())}componentWillLoad(){r(this.host)}disconnectedCallback(){o(this.host)}get host(){return l(this)}};B.style='@charset "UTF-8";:host(limel-breadcrumbs){--limel-breadcrumbs-item-height:1.5rem;--limel-breadcrumbs-gap:0.75rem;--limel-breadcrumbs-gap:0.75rem;--limel-breadcrumbs-item-text-color:var( --breadcrumbs-item-text-color, rgb(var(--contrast-1500)) );--limel-overflow-mask-horizontal:linear-gradient( to right, transparent 0%, black calc(0% + var(--limel-left-edge-fade-width, 1rem)), black calc(100% - var(--limel-right-edge-fade-width, 1rem)), transparent 100% );-webkit-mask-image:var(--limel-overflow-mask-horizontal);mask-image:var(--limel-overflow-mask-horizontal);padding-left:var(--limel-left-edge-fade-width, 1rem);padding-right:var(--limel-right-edge-fade-width, 1rem);--limel-left-edge-fade-width:0.5rem;--limel-right-edge-fade-width:0.5rem}ol,li,.step{all:unset}*{box-sizing:border-box}ol{padding:0.5rem;gap:var(--limel-breadcrumbs-gap)}.step{position:relative;display:inline-flex;align-items:center;justify-content:center;gap:0.25rem;max-width:var(--breadcrumbs-item-max-width, 10rem);height:var(--limel-breadcrumbs-item-height);color:var(--limel-breadcrumbs-item-text-color);border-radius:100vw;font-size:var(--limel-theme-default-font-size);padding:0 0.25rem}.step:not(:has(.text)){padding:0 0.125rem}.step:not(.last):focus{outline:none}.step:not(.last):focus-visible{outline:none;box-shadow:var(--shadow-depth-8-focused)}.step:not(.last):after{content:var(--limel-breadcrumbs-divider);display:flex;align-items:center;justify-content:center;width:var(--limel-breadcrumbs-gap);position:absolute;top:0;right:calc(var(--limel-breadcrumbs-gap) * -1);bottom:0;left:auto;text-align:center}a.step{position:relative;cursor:pointer;transition:color 0.2s ease;color:var(--limel-breadcrumbs-item-text-color)}a.step:before{transition:opacity 0.2s ease, transform 0.3s ease-out;content:"";position:absolute;inset:auto 0 0 0;width:calc(100% - 0.5rem);margin:auto;height:0.125rem;border-radius:1rem;background-color:currentColor;opacity:0;transform:scale(0.6)}a.step:hover{color:rgb(var(--color-blue-default))}a.step:hover:before{opacity:0.3;transform:scale(1)}button.step:not(.last){transition:color var(--limel-clickable-transition-speed, 0.4s) ease, background-color var(--limel-clickable-transition-speed, 0.4s) ease, box-shadow var(--limel-clickable-transform-speed, 0.4s) ease, transform var(--limel-clickable-transform-speed, 0.4s) var(--limel-clickable-transform-timing-function, ease);cursor:pointer;color:var(--limel-breadcrumbs-item-text-color);background-color:transparent}button.step:not(.last):hover,button.step:not(.last):focus,button.step:not(.last):focus-visible{will-change:color, background-color, box-shadow, transform}button.step:not(.last):hover,button.step:not(.last):focus-visible{transform:translate3d(0, 0.01rem, 0);color:var(--limel-theme-on-surface-color);background-color:var(--lime-elevated-surface-background-color)}button.step:not(.last):hover{box-shadow:var(--button-shadow-hovered)}button.step:not(.last):active{--limel-clickable-transform-timing-function:cubic-bezier( 0.83, -0.15, 0.49, 1.16 );transform:translate3d(0, 0.05rem, 0);box-shadow:var(--button-shadow-pressed)}button.step:not(.last):hover,button.step:not(.last):active{--limel-clickable-transition-speed:0.2s;--limel-clickable-transform-speed:0.16s}limel-icon{flex-shrink:0;width:calc(var(--limel-breadcrumbs-item-height) - 0.25rem);height:calc(var(--limel-breadcrumbs-item-height) - 0.25rem)}.text{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;padding:0 0.25rem}.last{opacity:0.7}:host(limel-breadcrumbs){box-sizing:border-box;display:flex;width:100%;overflow-x:auto;scrollbar-width:none;-ms-overflow-style:none}:host(limel-breadcrumbs)::-webkit-scrollbar{display:none}:host(limel-breadcrumbs){direction:rtl}ol{display:flex;flex-direction:row-reverse;justify-content:flex-end;margin-right:auto}.step{direction:ltr}';const Y=class{constructor(l){t(this,l),this.change=e(this,"change"),this.action=e(this,"action"),this.disabled=!1,this.readonly=!1,this.invalid=!1,this.required=!1,this.type="text",this.formatNumber=!0,this.step="any",this.completions=[],this.showLink=!1,this.locale=y.defaultLocale,this.isFocused=!1,this.wasInvalid=!1,this.showCompletions=!1,this.completionsList=[],this.changeWaiting=!1,this.initialize=()=>{const t=this.limelInputField.shadowRoot.querySelector(".mdc-text-field");t&&(this.mdcTextField=new k(t),this.value&&(this.mdcTextField.value=this.value),this.invalid&&(this.mdcTextField.valid=!1),this.mapCompletions(),window.addEventListener("resize",this.layout,{passive:!0}),this.limelInputField.addEventListener("focus",this.setFocus))},this.mapCompletions=()=>{this.completionsList=[...this.completions].map((t=>({text:t})))},this.setFocus=()=>{this.mdcTextField.focus()},this.getContainerClassList=()=>{const t={"mdc-text-field":!0,"mdc-text-field--outlined":!0,"mdc-text-field--invalid":this.isInvalid(),"mdc-text-field--disabled":this.disabled||this.readonly,"lime-text-field--readonly":this.readonly,"mdc-text-field--required":this.required,"lime-text-field--empty":this.isEmpty(),"lime-has-prefix":this.hasPrefix(),"lime-has-suffix":this.hasSuffix()};return"textarea"===this.type?t["mdc-text-field--textarea"]=!0:(t["mdc-text-field--with-leading-icon"]=!!this.leadingIcon,t["mdc-text-field--with-trailing-icon"]=!!this.getTrailingIcon()),t},this.isEmpty=()=>{var t;return!("number"===this.type&&(null===(t=this.inputElement)||void 0===t?void 0:t.validity.badInput)||this.getCurrentValue())},this.getCurrentValue=()=>this.changeWaiting&&this.inputElement?this.inputElement.value:this.value,this.renderInput=t=>{if("textarea"!==this.type)return i("input",Object.assign({},t,{type:"urlAsText"===this.type?"text":this.type,pattern:this.pattern,onWheel:this.handleWheel,onKeyDown:this.onKeyDown,placeholder:this.placeholder}))},this.renderTextarea=t=>{if("textarea"===this.type)return i("span",{class:"mdc-text-field__resizer"},i("textarea",Object.assign({},t,{placeholder:this.placeholder})))},this.layout=()=>{var t;null===(t=this.mdcTextField)||void 0===t||t.layout(),this.restyleCompletionsDropDown()},this.restyleCompletionsDropDown=w((()=>{const t=this.showCompletions;this.showCompletions=!1,requestAnimationFrame((()=>{this.showCompletions=t}))}),100),this.getAdditionalProps=()=>{const t={};return"number"===this.type&&(t.step=this.step),"number"===this.type&&Number.isInteger(this.min)&&(t.min=this.min),"number"===this.type&&Number.isInteger(this.max)&&(t.max=this.max),this.minlength&&(t.minlength=this.minlength),this.maxlength&&(t.maxlength=this.maxlength),t},this.onFocus=()=>{this.isFocused=!0,this.showCompletions=!0},this.onBlur=()=>{this.isFocused=!1,this.validate(),this.changeEmitter.flush()},this.hasHelperText=()=>{var t;return!!(null!==(t=this.helperText)&&void 0!==t?t:this.validationMessage)},this.hasHelperLine=()=>this.maxlength>0||this.hasHelperText(),this.renderHelperLine=()=>{var t;const e=(this.getCurrentValue()||"").length;if(this.hasHelperLine())return i("limel-helper-line",{helperTextId:this.helperTextId,helperText:null!==(t=this.helperText)&&void 0!==t?t:this.validationMessage,length:e,maxLength:this.maxlength,invalid:this.isInvalid()})},this.renderSuffix=()=>{if(this.hasSuffix()&&"textarea"!==this.type)return i("span",{class:{"mdc-text-field__affix":!0,"mdc-text-field__affix--suffix":!0}},this.suffix)},this.hasSuffix=()=>null!=this.suffix,this.renderPrefix=()=>{if(this.hasPrefix()&&"textarea"!==this.type)return i("span",{class:{"mdc-text-field__affix":!0,"mdc-text-field__affix--prefix":!0}},this.prefix)},this.hasPrefix=()=>null!=this.prefix,this.isInvalid=()=>!this.readonly&&(!!this.invalid||this.wasInvalid),this.validate=()=>{this.readonly||this.invalid?this.wasInvalid=!1:this.inputElement&&(this.wasInvalid=!this.inputElement.checkValidity())},this.setInputElement=t=>{t&&(this.inputElement=t)},this.renderLeadingIcon=()=>{if("textarea"!==this.type)return this.leadingIcon?i("i",{class:"material-icons mdc-text-field__icon mdc-text-field__icon--leading"},i("limel-icon",{name:this.leadingIcon})):void 0},this.renderTrailingLinkOrButton=()=>{if("textarea"===this.type)return;const t=this.getTrailingIcon();return!this.isInvalid()&&this.hasLink()?this.renderLinkIcon(this.getLink(),t):t?this.renderTrailingIcon(t):void 0},this.hasLink=()=>this.showLink&&["email","tel","url","urlAsText"].includes(this.type),this.getLink=()=>{const t={href:""};switch(this.type){case"email":t.href=`mailto:${this.value}`;break;case"tel":t.href=`tel:${this.value}`;break;default:t.href=g(this.value),t.target=v(this.value),t.rel=_(t.target)}return t},this.renderLinkIcon=(t,e)=>i("a",Object.assign({},t,{class:"material-icons mdc-text-field__icon lime-trailing-icon-for-link",tabindex:this.disabled||this.isEmpty()?"-1":"0",role:"button"}),i("limel-icon",{name:e})),this.renderTrailingIcon=t=>this.isInvalid()?i("i",{key:"invalid",class:"material-icons mdc-text-field__icon invalid-icon"},i("limel-icon",{name:t})):i("i",{key:"action",class:"material-icons mdc-text-field__icon mdc-text-field__icon--trailing",tabIndex:0,role:"button",onKeyDown:this.handleIconKeyPress,onClick:this.handleIconClick},i("limel-icon",{name:t})),this.getTrailingIcon=()=>this.isInvalid()?"high_importance":this.trailingIcon?this.trailingIcon:this.showLink&&"email"===this.type?"filled_message":this.showLink&&"tel"===this.type?"phone":!this.showLink||"url"!==this.type&&"urlAsText"!==this.type?void 0:"external_link",this.renderFormattedNumber=()=>{if("number"!==this.type)return;let t=this.value;return this.formatNumber&&this.value&&(t=new Intl.NumberFormat(this.locale).format(Number(this.value)),"NaN"===t)?void 0:i("span",{class:"lime-formatted-input lime-looks-like-input-value"},t)},this.onKeyDown=t=>{this.showCompletions=!0;const e=t.key===c&&!t.altKey&&!t.metaKey&&!t.shiftKey,i=t.key===m,l=t.key===h;if(t.key===c&&t.shiftKey&&(this.showCompletions=!1),!e&&!i&&!l)return;const n=document.querySelector(` #${this.portalId} limel-list`);n&&(t.preventDefault(),e||l?n.shadowRoot.querySelector(".mdc-deprecated-list-item:first-child").focus():i&&n.shadowRoot.querySelector(".mdc-deprecated-list-item:last-child").focus())},this.handleCompletionChange=t=>{t.stopPropagation(),t.detail&&(this.showCompletions=!1,this.changeEmitter(t.detail.text),this.changeEmitter.flush())},this.renderAutocompleteList=()=>{if("textarea"===this.type||0===this.completions.length)return;const t=getComputedStyle(this.limelInputField).getPropertyValue("--dropdown-z-index");return i("limel-portal",{visible:this.showCompletions,containerId:this.portalId,inheritParentWidth:!0,containerStyle:{"z-index":t}},i("limel-menu-surface",{open:this.showCompletions,allowClicksElement:this.limelInputField,style:{"--menu-surface-width":"100%","max-height":"inherit",display:"flex"},onDismiss:this.handleCloseMenu},this.renderListResult()))},this.renderListResult=()=>{const t=this.filterCompletions(this.getCurrentValue());return t&&0!==t.length?i("limel-list",{onChange:this.handleCompletionChange,onKeyDown:this.handleKeyDownInDropdown,type:"selectable",items:t}):null},this.handleKeyDownInDropdown=t=>{[c,f,u].includes(t.key)&&this.setFocus()},this.handleCloseMenu=()=>{this.showCompletions=!1},this.filterCompletions=t=>t?this.completionsList.filter((e=>e.text.toLowerCase().includes(t.toLowerCase()))):this.completionsList,this.handleInput=t=>{t.stopPropagation();let e=t.target.value;if("number"===this.type){if(!e&&t.data)return void t.stopPropagation();e&&(e=Number(e))}this.changeWaiting=!0,this.changeEmitter(e)},this.changeEmitter=w((t=>{this.change.emit(t),this.changeWaiting=!1}),300),this.handleChange=t=>{t.stopPropagation(),this.changeEmitter.flush()},this.handleIconClick=()=>{this.action.emit()},this.handleIconKeyPress=t=>{(t.key===x||t.key===u)&&this.action.emit()},this.handleWheel=()=>{},this.portalId=d(),this.helperTextId=d(),this.labelId=d()}connectedCallback(){this.initialize()}componentDidLoad(){this.initialize()}disconnectedCallback(){this.mdcTextField&&this.mdcTextField.destroy(),this.restyleCompletionsDropDown.cancel(),window.removeEventListener("resize",this.layout),this.limelInputField.removeEventListener("focus",this.setFocus)}componentDidUpdate(){this.invalid?this.mdcTextField.valid=!1:this.wasInvalid||(this.mdcTextField.valid=!0),this.mdcTextField.disabled=this.disabled||this.readonly}async getSelectionStart(){var t,e;try{return null!==(e=null===(t=this.inputElement)||void 0===t?void 0:t.selectionStart)&&void 0!==e?e:null}catch(t){return null}}async getSelectionEnd(){var t,e;try{return null!==(e=null===(t=this.inputElement)||void 0===t?void 0:t.selectionEnd)&&void 0!==e?e:null}catch(t){return null}}async getSelectionDirection(){var t,e;try{return null!==(e=null===(t=this.inputElement)||void 0===t?void 0:t.selectionDirection)&&void 0!==e?e:null}catch(t){return null}}render(){const t=this.getAdditionalProps();t["aria-labelledby"]=this.labelId,t.class="mdc-text-field__input",t.ref=this.setInputElement,t.onInput=this.handleInput,t.onChange=this.handleChange,t.onFocus=this.onFocus,t.onBlur=this.onBlur,t.required=this.required,t.readonly=this.readonly,t.disabled=this.disabled||this.readonly;let e="";return this.hasHelperText()&&(e+=this.helperTextId,t["aria-describedby"]=this.helperTextId),this.renderAutocompleteList()&&(e&&(e+=" "),e+=this.portalId),e&&(t["aria-controls"]=e),i(n,{key:"e6f4d81dfdfef80077c4537a6e23220fc7c0dbce"},i("limel-notched-outline",{key:"a0feabbe707cd51308a40cea1bff974bc3459f74",labelId:this.labelId,label:this.label,required:this.required,invalid:this.invalid||this.isInvalid(),disabled:this.disabled,readonly:this.readonly,hasValue:!!this.value,hasLeadingIcon:!!this.leadingIcon},i("label",{key:"ef17b7ae25a2c4511aa7b4011f1692cd4065b5b2",slot:"content",class:this.getContainerClassList()},this.renderLeadingIcon(),this.renderPrefix(),this.renderFormattedNumber(),this.renderInput(t),this.renderSuffix(),this.renderTextarea(t),this.renderTrailingLinkOrButton())),this.renderHelperLine(),this.renderAutocompleteList())}valueWatcher(t){this.mdcTextField&&(this.changeWaiting||"number"===this.type&&this.isFocused&&Number(t)===Number(this.mdcTextField.value)||(t!==this.mdcTextField.value&&(this.mdcTextField.value=t||""),this.wasInvalid&&this.validate()))}completionsWatcher(){this.mapCompletions()}get validationMessage(){var t;return this.isInvalid()&&!this.invalid&&(null===(t=this.inputElement)||void 0===t?void 0:t.validationMessage)||""}static get delegatesFocus(){return!0}get limelInputField(){return l(this)}static get watchers(){return{value:[{valueWatcher:0}],completions:[{completionsWatcher:0}]}}};
|
|
1
|
+
import{r as t,c as e,h as i,a as l,H as n}from"./p-BGxJfR2f.js";import{m as r,r as o}from"./p-BgTwPGeH.js";import{c as d}from"./p-JbKhhoXs.js";import{g as a,b as s}from"./p-CgNJbSP4.js";import{T as c,A as m,b as h,E as f,a as u,e as x,c as p,d as b}from"./p-C4_9qUMP.js";import{b as g,a as v,g as _}from"./p-5KsJICvh.js";import{g as y}from"./p-Dnt5w_Bp.js";import{d as w}from"./p-BviYUVSD.js";import{M as k}from"./p-DZkKQUDM.js";import{_ as I,a as T,M as E,m as C,d as A,c as O,b as z}from"./p-ChRGk668.js";import{f as S,z as R}from"./p-D0F7gOYG.js";import{h as L,t as D,n as j}from"./p-BxrRWYts.js";import{i as F}from"./p-BcJ-TDVt.js";import{M}from"./p-BN1-aIOw.js";import{i as N}from"./p-B9Ofc5RB.js";import"./p-BJQylLSL.js";import"./p-D6dCQvwl.js";import"./p-BOEi1C7r.js";import"./p-oiMYqRQ0.js";import"./p-C9yTLqR8.js";import"./p-ByzvFNMm.js";import"./p-9W8bTt2G.js";import"./p-DbBZn7JO.js";import"./p-CZ30nDJE.js";const B=class{constructor(l){t(this,l),this.select=e(this,"select"),this.divider="›",this.renderSteps=()=>{const t=this.items.slice(0,-1);return this.areItemsLinks(this.items)?t.map(this.renderAsLink):t.map(this.renderAsButton)},this.renderAsButton=t=>{const e=d();return[i("button",{role:"listitem",id:e,class:"step",onClick:this.handleClick(t)},this.renderIcon(t),this.renderLabel(t)),this.renderTooltip(t,e)]},this.renderAsLink=t=>{const e=d();return[i("a",{role:"listitem",id:e,class:"step",href:t.link.href,title:t.link.title},this.renderIcon(t),this.renderLabel(t)),this.renderTooltip(t,e)]},this.renderLastStep=()=>{const t=this.items.slice(-1);return i("li",{class:"last step",tabindex:"-1","aria-current":this.areItemsLinks(this.items)?"page":"step"},this.renderIcon(t[0]),i("span",{class:"text"},t[0].text))},this.renderIcon=t=>{const e=a(t.icon),l=s(t.icon);if(e)return i("limel-icon",{style:{color:`${l}`},name:e})},this.renderLabel=t=>{if("icon-only"!==t.type)return i("span",{class:"text"},t.text)},this.renderTooltip=(t,e)=>{if("icon-only"===t.type)return i("limel-tooltip",{elementId:e,label:t.text})},this.areItemsLinks=t=>t.some((t=>"link"in t)),this.handleClick=t=>e=>{e.stopPropagation(),this.select.emit(t)}}render(){return i("ol",{key:"66f28dfd61493e4aa5d86b0d2434c2039fee4636",role:"navigation","aria-label":"Breadcrumb",style:{"--limel-breadcrumbs-divider":`'${this.divider}'`}},this.renderSteps(),this.renderLastStep())}componentWillLoad(){r(this.host)}disconnectedCallback(){o(this.host)}get host(){return l(this)}};B.style='@charset "UTF-8";:host(limel-breadcrumbs){--limel-breadcrumbs-item-height:1.5rem;--limel-breadcrumbs-gap:0.75rem;--limel-breadcrumbs-gap:0.75rem;--limel-breadcrumbs-item-text-color:var( --breadcrumbs-item-text-color, rgb(var(--contrast-1500)) );--limel-overflow-mask-horizontal:linear-gradient( to right, transparent 0%, black calc(0% + var(--limel-left-edge-fade-width, 1rem)), black calc(100% - var(--limel-right-edge-fade-width, 1rem)), transparent 100% );-webkit-mask-image:var(--limel-overflow-mask-horizontal);mask-image:var(--limel-overflow-mask-horizontal);padding-left:var(--limel-left-edge-fade-width, 1rem);padding-right:var(--limel-right-edge-fade-width, 1rem);--limel-left-edge-fade-width:0.5rem;--limel-right-edge-fade-width:0.5rem}ol,li,.step{all:unset}*{box-sizing:border-box}ol{padding:0.5rem;gap:var(--limel-breadcrumbs-gap)}.step{position:relative;display:inline-flex;align-items:center;justify-content:center;gap:0.25rem;max-width:var(--breadcrumbs-item-max-width, 10rem);height:var(--limel-breadcrumbs-item-height);color:var(--limel-breadcrumbs-item-text-color);border-radius:100vw;font-size:var(--limel-theme-default-font-size);padding:0 0.25rem}.step:not(:has(.text)){padding:0 0.125rem}.step:not(.last):focus{outline:none}.step:not(.last):focus-visible{outline:none;box-shadow:var(--shadow-depth-8-focused)}.step:not(.last):after{content:var(--limel-breadcrumbs-divider);display:flex;align-items:center;justify-content:center;width:var(--limel-breadcrumbs-gap);position:absolute;top:0;right:calc(var(--limel-breadcrumbs-gap) * -1);bottom:0;left:auto;text-align:center}a.step{position:relative;cursor:pointer;transition:color 0.2s ease;color:var(--limel-breadcrumbs-item-text-color)}a.step:before{transition:opacity 0.2s ease, transform 0.3s ease-out;content:"";position:absolute;inset:auto 0 0 0;width:calc(100% - 0.5rem);margin:auto;height:0.125rem;border-radius:1rem;background-color:currentColor;opacity:0;transform:scale(0.6)}a.step:hover{color:rgb(var(--color-blue-default))}a.step:hover:before{opacity:0.3;transform:scale(1)}button.step:not(.last){transition:color var(--limel-clickable-transition-speed, 0.4s) ease, background-color var(--limel-clickable-transition-speed, 0.4s) ease, box-shadow var(--limel-clickable-transform-speed, 0.4s) ease, transform var(--limel-clickable-transform-speed, 0.4s) var(--limel-clickable-transform-timing-function, ease);cursor:pointer;color:var(--limel-breadcrumbs-item-text-color);background-color:transparent}button.step:not(.last):hover,button.step:not(.last):focus,button.step:not(.last):focus-visible{will-change:color, background-color, box-shadow, transform}button.step:not(.last):hover,button.step:not(.last):focus-visible{transform:translate3d(0, 0.01rem, 0);color:var(--limel-theme-on-surface-color);background-color:var(--lime-elevated-surface-background-color)}button.step:not(.last):hover{box-shadow:var(--button-shadow-hovered)}button.step:not(.last):active{--limel-clickable-transform-timing-function:cubic-bezier( 0.83, -0.15, 0.49, 1.16 );transform:translate3d(0, 0.05rem, 0);box-shadow:var(--button-shadow-pressed)}button.step:not(.last):hover,button.step:not(.last):active{--limel-clickable-transition-speed:0.2s;--limel-clickable-transform-speed:0.16s}limel-icon{flex-shrink:0;width:calc(var(--limel-breadcrumbs-item-height) - 0.25rem);height:calc(var(--limel-breadcrumbs-item-height) - 0.25rem)}.text{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;padding:0 0.25rem}.last{opacity:0.7}:host(limel-breadcrumbs){box-sizing:border-box;display:flex;width:100%;overflow-x:auto;scrollbar-width:none;-ms-overflow-style:none}:host(limel-breadcrumbs)::-webkit-scrollbar{display:none}:host(limel-breadcrumbs){direction:rtl}ol{display:flex;flex-direction:row-reverse;justify-content:flex-end;margin-right:auto}.step{direction:ltr}';const Y=class{constructor(l){t(this,l),this.change=e(this,"change"),this.action=e(this,"action"),this.disabled=!1,this.readonly=!1,this.invalid=!1,this.required=!1,this.type="text",this.formatNumber=!0,this.step="any",this.completions=[],this.showLink=!1,this.locale=y.defaultLocale,this.isFocused=!1,this.wasInvalid=!1,this.showCompletions=!1,this.completionsList=[],this.changeWaiting=!1,this.initialize=()=>{const t=this.limelInputField.shadowRoot.querySelector(".mdc-text-field");t&&(this.mdcTextField=new k(t),this.value&&(this.mdcTextField.value=this.value),this.invalid&&(this.mdcTextField.valid=!1),this.mapCompletions(),window.addEventListener("resize",this.layout,{passive:!0}),this.limelInputField.addEventListener("focus",this.setFocus))},this.mapCompletions=()=>{this.completionsList=[...this.completions].map((t=>({text:t})))},this.setFocus=()=>{this.mdcTextField.focus()},this.getContainerClassList=()=>{const t={"mdc-text-field":!0,"mdc-text-field--outlined":!0,"mdc-text-field--invalid":this.isInvalid(),"mdc-text-field--disabled":this.disabled||this.readonly,"lime-text-field--readonly":this.readonly,"mdc-text-field--required":this.required,"lime-text-field--empty":this.isEmpty(),"lime-has-prefix":this.hasPrefix(),"lime-has-suffix":this.hasSuffix()};return"textarea"===this.type?t["mdc-text-field--textarea"]=!0:(t["mdc-text-field--with-leading-icon"]=!!this.leadingIcon,t["mdc-text-field--with-trailing-icon"]=!!this.getTrailingIcon()),t},this.isEmpty=()=>{var t;return!("number"===this.type&&(null===(t=this.inputElement)||void 0===t?void 0:t.validity.badInput)||this.getCurrentValue())},this.getCurrentValue=()=>this.changeWaiting&&this.inputElement?this.inputElement.value:this.value,this.renderInput=t=>{if("textarea"!==this.type)return i("input",Object.assign({},t,{type:"urlAsText"===this.type?"text":this.type,pattern:this.pattern,onWheel:this.handleWheel,onKeyDown:this.onKeyDown,placeholder:this.placeholder}))},this.renderTextarea=t=>{if("textarea"===this.type)return i("span",{class:"mdc-text-field__resizer"},i("textarea",Object.assign({},t,{placeholder:this.placeholder})))},this.layout=()=>{var t;null===(t=this.mdcTextField)||void 0===t||t.layout(),this.restyleCompletionsDropDown()},this.restyleCompletionsDropDown=w((()=>{const t=this.showCompletions;this.showCompletions=!1,requestAnimationFrame((()=>{this.showCompletions=t}))}),100),this.getAdditionalProps=()=>{const t={};return"number"===this.type&&(t.step=this.step),"number"===this.type&&Number.isInteger(this.min)&&(t.min=this.min),"number"===this.type&&Number.isInteger(this.max)&&(t.max=this.max),this.minlength&&(t.minlength=this.minlength),this.maxlength&&(t.maxlength=this.maxlength),t},this.onFocus=()=>{this.isFocused=!0,this.showCompletions=!0},this.onBlur=()=>{this.isFocused=!1,this.validate(),this.changeEmitter.flush()},this.hasHelperText=()=>{var t;return!!(null!==(t=this.helperText)&&void 0!==t?t:this.validationMessage)},this.hasHelperLine=()=>this.maxlength>0||this.hasHelperText(),this.renderHelperLine=()=>{var t;const e=(this.getCurrentValue()||"").length;if(this.hasHelperLine())return i("limel-helper-line",{helperTextId:this.helperTextId,helperText:null!==(t=this.helperText)&&void 0!==t?t:this.validationMessage,length:e,maxLength:this.maxlength,invalid:this.isInvalid()})},this.renderSuffix=()=>{if(this.hasSuffix()&&"textarea"!==this.type)return i("span",{class:{"mdc-text-field__affix":!0,"mdc-text-field__affix--suffix":!0}},this.suffix)},this.hasSuffix=()=>null!=this.suffix,this.renderPrefix=()=>{if(this.hasPrefix()&&"textarea"!==this.type)return i("span",{class:{"mdc-text-field__affix":!0,"mdc-text-field__affix--prefix":!0}},this.prefix)},this.hasPrefix=()=>null!=this.prefix,this.isInvalid=()=>!this.readonly&&(!!this.invalid||this.wasInvalid),this.validate=()=>{this.readonly||this.invalid?this.wasInvalid=!1:this.inputElement&&(this.wasInvalid=!this.inputElement.checkValidity())},this.setInputElement=t=>{t&&(this.inputElement=t)},this.renderLeadingIcon=()=>{if("textarea"!==this.type)return this.leadingIcon?i("i",{class:"material-icons mdc-text-field__icon mdc-text-field__icon--leading"},i("limel-icon",{name:this.leadingIcon})):void 0},this.renderTrailingLinkOrButton=()=>{if("textarea"===this.type)return;const t=this.getTrailingIcon();return!this.isInvalid()&&this.hasLink()?this.renderLinkIcon(this.getLink(),t):t?this.renderTrailingIcon(t):void 0},this.hasLink=()=>this.showLink&&["email","tel","url","urlAsText"].includes(this.type),this.getLink=()=>{const t={href:""};switch(this.type){case"email":t.href=`mailto:${this.value}`;break;case"tel":t.href=`tel:${this.value}`;break;default:t.href=g(this.value),t.target=v(this.value),t.rel=_(t.target)}return t},this.renderLinkIcon=(t,e)=>i("a",Object.assign({},t,{class:"material-icons mdc-text-field__icon lime-trailing-icon-for-link",tabindex:this.disabled||this.isEmpty()?"-1":"0",role:"button"}),i("limel-icon",{name:e})),this.renderTrailingIcon=t=>this.isInvalid()?i("i",{key:"invalid",class:"material-icons mdc-text-field__icon invalid-icon"},i("limel-icon",{name:t})):i("i",{key:"action",class:"material-icons mdc-text-field__icon mdc-text-field__icon--trailing",tabIndex:0,role:"button",onKeyDown:this.handleIconKeyPress,onClick:this.handleIconClick},i("limel-icon",{name:t})),this.getTrailingIcon=()=>this.isInvalid()?"high_importance":this.trailingIcon?this.trailingIcon:this.showLink&&"email"===this.type?"filled_message":this.showLink&&"tel"===this.type?"phone":!this.showLink||"url"!==this.type&&"urlAsText"!==this.type?void 0:"external_link",this.renderFormattedNumber=()=>{if("number"!==this.type)return;let t=this.value;return this.formatNumber&&this.value&&(t=new Intl.NumberFormat(this.locale).format(Number(this.value)),"NaN"===t)?void 0:i("span",{class:"lime-formatted-input lime-looks-like-input-value"},t)},this.onKeyDown=t=>{this.showCompletions=!0;const e=t.key===c&&!t.altKey&&!t.metaKey&&!t.shiftKey,i=t.key===m,l=t.key===h;if(t.key===c&&t.shiftKey&&(this.showCompletions=!1),!e&&!i&&!l)return;const n=document.querySelector(` #${this.portalId} limel-list`);n&&(t.preventDefault(),e||l?n.shadowRoot.querySelector(".mdc-deprecated-list-item:first-child").focus():i&&n.shadowRoot.querySelector(".mdc-deprecated-list-item:last-child").focus())},this.handleCompletionChange=t=>{t.stopPropagation(),t.detail&&(this.showCompletions=!1,this.changeEmitter(t.detail.text),this.changeEmitter.flush())},this.renderAutocompleteList=()=>{if("textarea"===this.type||0===this.completions.length)return;const t=getComputedStyle(this.limelInputField).getPropertyValue("--dropdown-z-index");return i("limel-portal",{visible:this.showCompletions,containerId:this.portalId,inheritParentWidth:!0,containerStyle:{"z-index":t}},i("limel-menu-surface",{open:this.showCompletions,allowClicksElement:this.limelInputField,style:{"--menu-surface-width":"100%","max-height":"inherit",display:"flex"},onDismiss:this.handleCloseMenu},this.renderListResult()))},this.renderListResult=()=>{const t=this.filterCompletions(this.getCurrentValue());return t&&0!==t.length?i("limel-list",{onChange:this.handleCompletionChange,onKeyDown:this.handleKeyDownInDropdown,type:"selectable",items:t}):null},this.handleKeyDownInDropdown=t=>{[c,f,u].includes(t.key)&&this.setFocus()},this.handleCloseMenu=()=>{this.showCompletions=!1},this.filterCompletions=t=>t?this.completionsList.filter((e=>e.text.toLowerCase().includes(t.toLowerCase()))):this.completionsList,this.handleInput=t=>{t.stopPropagation();let e=t.target.value;if("number"===this.type){if(!e&&t.data)return void t.stopPropagation();e&&(e=Number(e))}this.changeWaiting=!0,this.changeEmitter(e)},this.changeEmitter=w((t=>{this.change.emit(t),this.changeWaiting=!1}),300),this.handleChange=t=>{t.stopPropagation(),this.changeEmitter.flush()},this.handleIconClick=()=>{this.action.emit()},this.handleIconKeyPress=t=>{(t.key===x||t.key===u)&&this.action.emit()},this.handleWheel=()=>{},this.portalId=d(),this.helperTextId=d(),this.labelId=d()}connectedCallback(){this.initialize()}componentDidLoad(){this.initialize()}disconnectedCallback(){this.mdcTextField&&this.mdcTextField.destroy(),this.restyleCompletionsDropDown.cancel(),window.removeEventListener("resize",this.layout),this.limelInputField.removeEventListener("focus",this.setFocus)}componentDidUpdate(){this.invalid?this.mdcTextField.valid=!1:this.wasInvalid||(this.mdcTextField.valid=!0),this.mdcTextField.disabled=this.disabled||this.readonly}async getSelectionStart(){var t,e;try{return null!==(e=null===(t=this.inputElement)||void 0===t?void 0:t.selectionStart)&&void 0!==e?e:null}catch(t){return null}}async getSelectionEnd(){var t,e;try{return null!==(e=null===(t=this.inputElement)||void 0===t?void 0:t.selectionEnd)&&void 0!==e?e:null}catch(t){return null}}async getSelectionDirection(){var t,e;try{return null!==(e=null===(t=this.inputElement)||void 0===t?void 0:t.selectionDirection)&&void 0!==e?e:null}catch(t){return null}}render(){const t=this.getAdditionalProps();t["aria-labelledby"]=this.labelId,t.class="mdc-text-field__input",t.ref=this.setInputElement,t.onInput=this.handleInput,t.onChange=this.handleChange,t.onFocus=this.onFocus,t.onBlur=this.onBlur,t.required=this.required,t.readonly=this.readonly,t.disabled=this.disabled||this.readonly;let e="";return this.hasHelperText()&&(e+=this.helperTextId,t["aria-describedby"]=this.helperTextId),this.renderAutocompleteList()&&(e&&(e+=" "),e+=this.portalId),e&&(t["aria-controls"]=e),i(n,{key:"e6f4d81dfdfef80077c4537a6e23220fc7c0dbce"},i("limel-notched-outline",{key:"a0feabbe707cd51308a40cea1bff974bc3459f74",labelId:this.labelId,label:this.label,required:this.required,invalid:this.invalid||this.isInvalid(),disabled:this.disabled,readonly:this.readonly,hasValue:!!this.value,hasLeadingIcon:!!this.leadingIcon},i("label",{key:"ef17b7ae25a2c4511aa7b4011f1692cd4065b5b2",slot:"content",class:this.getContainerClassList()},this.renderLeadingIcon(),this.renderPrefix(),this.renderFormattedNumber(),this.renderInput(t),this.renderSuffix(),this.renderTextarea(t),this.renderTrailingLinkOrButton())),this.renderHelperLine(),this.renderAutocompleteList())}valueWatcher(t){this.mdcTextField&&(this.changeWaiting||"number"===this.type&&this.isFocused&&Number(t)===Number(this.mdcTextField.value)||(t!==this.mdcTextField.value&&(this.mdcTextField.value=t||""),this.wasInvalid&&this.validate()))}completionsWatcher(){this.mapCompletions()}get validationMessage(){var t;return this.isInvalid()&&!this.invalid&&(null===(t=this.inputElement)||void 0===t?void 0:t.validationMessage)||""}static get delegatesFocus(){return!0}get limelInputField(){return l(this)}static get watchers(){return{value:[{valueWatcher:0}],completions:[{completionsWatcher:0}]}}};
|
|
2
2
|
/**
|
|
3
3
|
* @license
|
|
4
4
|
* Copyright 2018 Google Inc.
|
|
@@ -65,7 +65,7 @@ var X,U;Y.style='@charset "UTF-8";:host([type=url]) .mdc-text-field--with-traili
|
|
|
65
65
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
66
66
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
67
67
|
* THE SOFTWARE.
|
|
68
|
-
*/var bt=function(t){function e(i){var l=t.call(this,T(T({},e.defaultAdapter),i))||this;return l.wrapFocus=!1,l.isVertical=!0,l.isSingleSelectionList=!1,l.selectedIndex=K.UNSET_INDEX,l.focusedItemIndex=K.UNSET_INDEX,l.useActivatedClass=!1,l.useSelectedAttr=!1,l.ariaCurrentAttrValue=null,l.isCheckboxList=!1,l.isRadioList=!1,l.hasTypeahead=!1,l.typeaheadState={bufferClearTimeout:0,currentFirstChar:"",sortedIndexCursor:0,typeaheadBuffer:""},l.sortedIndexByFirstChar=new Map,l}return I(e,t),Object.defineProperty(e,"strings",{get:function(){return W},enumerable:!1,configurable:!0}),Object.defineProperty(e,"cssClasses",{get:function(){return H},enumerable:!1,configurable:!0}),Object.defineProperty(e,"numbers",{get:function(){return K},enumerable:!1,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{addClassForElementIndex:function(){},focusItemAtIndex:function(){},getAttributeForElementIndex:function(){return null},getFocusedElementIndex:function(){return 0},getListItemCount:function(){return 0},hasCheckboxAtIndex:function(){return!1},hasRadioAtIndex:function(){return!1},isCheckboxCheckedAtIndex:function(){return!1},isFocusInsideList:function(){return!1},isRootFocused:function(){return!1},listItemAtIndexHasClass:function(){return!1},notifyAction:function(){},removeClassForElementIndex:function(){},setAttributeForElementIndex:function(){},setCheckedCheckboxOrRadioAtIndex:function(){},setTabIndexForListItemChildren:function(){},getPrimaryTextAtIndex:function(){return""}}},enumerable:!1,configurable:!0}),e.prototype.layout=function(){0!==this.adapter.getListItemCount()&&(this.adapter.hasCheckboxAtIndex(0)?this.isCheckboxList=!0:this.adapter.hasRadioAtIndex(0)?this.isRadioList=!0:this.maybeInitializeSingleSelection(),this.hasTypeahead&&(this.sortedIndexByFirstChar=this.typeaheadInitSortedIndex()))},e.prototype.getFocusedItemIndex=function(){return this.focusedItemIndex},e.prototype.setWrapFocus=function(t){this.wrapFocus=t},e.prototype.setVerticalOrientation=function(t){this.isVertical=t},e.prototype.setSingleSelection=function(t){this.isSingleSelectionList=t,t&&(this.maybeInitializeSingleSelection(),this.selectedIndex=this.getSelectedIndexFromDOM())},e.prototype.maybeInitializeSingleSelection=function(){var t=this.getSelectedIndexFromDOM();t!==K.UNSET_INDEX&&(this.adapter.listItemAtIndexHasClass(t,H.LIST_ITEM_ACTIVATED_CLASS)&&this.setUseActivatedClass(!0),this.isSingleSelectionList=!0,this.selectedIndex=t)},e.prototype.getSelectedIndexFromDOM=function(){for(var t=K.UNSET_INDEX,e=this.adapter.getListItemCount(),i=0;i<e;i++){var l=this.adapter.listItemAtIndexHasClass(i,H.LIST_ITEM_SELECTED_CLASS),n=this.adapter.listItemAtIndexHasClass(i,H.LIST_ITEM_ACTIVATED_CLASS);if(l||n){t=i;break}}return t},e.prototype.setHasTypeahead=function(t){this.hasTypeahead=t,t&&(this.sortedIndexByFirstChar=this.typeaheadInitSortedIndex())},e.prototype.isTypeaheadInProgress=function(){return this.hasTypeahead&&ut(this.typeaheadState)},e.prototype.setUseActivatedClass=function(t){this.useActivatedClass=t},e.prototype.setUseSelectedAttribute=function(t){this.useSelectedAttr=t},e.prototype.getSelectedIndex=function(){return this.selectedIndex},e.prototype.setSelectedIndex=function(t,e){var i=(void 0===e?{}:e).forceUpdate;this.isIndexValid(t)&&(this.isCheckboxList?this.setCheckboxAtIndex(t):this.isRadioList?this.setRadioAtIndex(t):this.setSingleSelectionAtIndex(t,{forceUpdate:i}))},e.prototype.handleFocusIn=function(t){t>=0&&(this.focusedItemIndex=t,this.adapter.setAttributeForElementIndex(t,"tabindex","0"),this.adapter.setTabIndexForListItemChildren(t,"0"))},e.prototype.handleFocusOut=function(t){var e=this;t>=0&&(this.adapter.setAttributeForElementIndex(t,"tabindex","-1"),this.adapter.setTabIndexForListItemChildren(t,"-1")),setTimeout((function(){e.adapter.isFocusInsideList()||e.setTabindexToFirstSelectedOrFocusedItem()}),0)},e.prototype.handleKeydown=function(t,e,i){var l=this,n="ArrowLeft"===ct(t),r="ArrowUp"===ct(t),o="ArrowRight"===ct(t),d="ArrowDown"===ct(t),a="Home"===ct(t),s="End"===ct(t),c="Enter"===ct(t),m="Spacebar"===ct(t),h="A"===t.key||"a"===t.key;if(this.adapter.isRootFocused())r||s?(t.preventDefault(),this.focusLastElement()):(d||a)&&(t.preventDefault(),this.focusFirstElement()),this.hasTypeahead&&pt({event:t,focusItemAtIndex:function(t){l.focusItemAtIndex(t)},focusedItemIndex:-1,isTargetListItem:e,sortedIndexByFirstChar:this.sortedIndexByFirstChar,isItemAtIndexDisabled:function(t){return l.adapter.listItemAtIndexHasClass(t,H.LIST_ITEM_DISABLED_CLASS)}},this.typeaheadState);else{var f=this.adapter.getFocusedElementIndex();if(!(-1===f&&(f=i)<0)){if(this.isVertical&&d||!this.isVertical&&o)ht(t),this.focusNextElement(f);else if(this.isVertical&&r||!this.isVertical&&n)ht(t),this.focusPrevElement(f);else if(a)ht(t),this.focusFirstElement();else if(s)ht(t),this.focusLastElement();else if(h&&t.ctrlKey&&this.isCheckboxList)t.preventDefault(),this.toggleAll(this.selectedIndex===K.UNSET_INDEX?[]:this.selectedIndex);else if((c||m)&&e){var u=t.target;if(u&&"A"===u.tagName&&c)return;if(ht(t),this.adapter.listItemAtIndexHasClass(f,H.LIST_ITEM_DISABLED_CLASS))return;this.isTypeaheadInProgress()||(this.isSelectableList()&&this.setSelectedIndexOnAction(f),this.adapter.notifyAction(f))}this.hasTypeahead&&pt({event:t,focusItemAtIndex:function(t){l.focusItemAtIndex(t)},focusedItemIndex:this.focusedItemIndex,isTargetListItem:e,sortedIndexByFirstChar:this.sortedIndexByFirstChar,isItemAtIndexDisabled:function(t){return l.adapter.listItemAtIndexHasClass(t,H.LIST_ITEM_DISABLED_CLASS)}},this.typeaheadState)}}},e.prototype.handleClick=function(t,e){t!==K.UNSET_INDEX&&(this.adapter.listItemAtIndexHasClass(t,H.LIST_ITEM_DISABLED_CLASS)||(this.isSelectableList()&&this.setSelectedIndexOnAction(t,e),this.adapter.notifyAction(t)))},e.prototype.focusNextElement=function(t){var e=t+1;if(e>=this.adapter.getListItemCount()){if(!this.wrapFocus)return t;e=0}return this.focusItemAtIndex(e),e},e.prototype.focusPrevElement=function(t){var e=t-1;if(e<0){if(!this.wrapFocus)return t;e=this.adapter.getListItemCount()-1}return this.focusItemAtIndex(e),e},e.prototype.focusFirstElement=function(){return this.focusItemAtIndex(0),0},e.prototype.focusLastElement=function(){var t=this.adapter.getListItemCount()-1;return this.focusItemAtIndex(t),t},e.prototype.focusInitialElement=function(){var t=this.getFirstSelectedOrFocusedItemIndex();return this.focusItemAtIndex(t),t},e.prototype.setEnabled=function(t,e){this.isIndexValid(t)&&(e?(this.adapter.removeClassForElementIndex(t,H.LIST_ITEM_DISABLED_CLASS),this.adapter.setAttributeForElementIndex(t,W.ARIA_DISABLED,"false")):(this.adapter.addClassForElementIndex(t,H.LIST_ITEM_DISABLED_CLASS),this.adapter.setAttributeForElementIndex(t,W.ARIA_DISABLED,"true")))},e.prototype.setSingleSelectionAtIndex=function(t,e){if(this.selectedIndex!==t||(void 0===e?{}:e).forceUpdate){var i=H.LIST_ITEM_SELECTED_CLASS;this.useActivatedClass&&(i=H.LIST_ITEM_ACTIVATED_CLASS),this.selectedIndex!==K.UNSET_INDEX&&this.adapter.removeClassForElementIndex(this.selectedIndex,i),this.setAriaForSingleSelectionAtIndex(t),this.setTabindexAtIndex(t),t!==K.UNSET_INDEX&&this.adapter.addClassForElementIndex(t,i),this.selectedIndex=t}},e.prototype.setAriaForSingleSelectionAtIndex=function(t){this.selectedIndex===K.UNSET_INDEX&&(this.ariaCurrentAttrValue=this.adapter.getAttributeForElementIndex(t,W.ARIA_CURRENT));var e=null!==this.ariaCurrentAttrValue,i=e?W.ARIA_CURRENT:W.ARIA_SELECTED;this.selectedIndex!==K.UNSET_INDEX&&this.adapter.setAttributeForElementIndex(this.selectedIndex,i,"false"),t!==K.UNSET_INDEX&&this.adapter.setAttributeForElementIndex(t,i,e?this.ariaCurrentAttrValue:"true")},e.prototype.getSelectionAttribute=function(){return this.useSelectedAttr?W.ARIA_SELECTED:W.ARIA_CHECKED},e.prototype.setRadioAtIndex=function(t){var e=this.getSelectionAttribute();this.adapter.setCheckedCheckboxOrRadioAtIndex(t,!0),this.selectedIndex!==K.UNSET_INDEX&&this.adapter.setAttributeForElementIndex(this.selectedIndex,e,"false"),this.adapter.setAttributeForElementIndex(t,e,"true"),this.selectedIndex=t},e.prototype.setCheckboxAtIndex=function(t){for(var e=this.getSelectionAttribute(),i=0;i<this.adapter.getListItemCount();i++){var l=!1;t.indexOf(i)>=0&&(l=!0),this.adapter.setCheckedCheckboxOrRadioAtIndex(i,l),this.adapter.setAttributeForElementIndex(i,e,l?"true":"false")}this.selectedIndex=t},e.prototype.setTabindexAtIndex=function(t){this.focusedItemIndex===K.UNSET_INDEX&&0!==t?this.adapter.setAttributeForElementIndex(0,"tabindex","-1"):this.focusedItemIndex>=0&&this.focusedItemIndex!==t&&this.adapter.setAttributeForElementIndex(this.focusedItemIndex,"tabindex","-1"),this.selectedIndex instanceof Array||this.selectedIndex===t||this.adapter.setAttributeForElementIndex(this.selectedIndex,"tabindex","-1"),t!==K.UNSET_INDEX&&this.adapter.setAttributeForElementIndex(t,"tabindex","0")},e.prototype.isSelectableList=function(){return this.isSingleSelectionList||this.isCheckboxList||this.isRadioList},e.prototype.setTabindexToFirstSelectedOrFocusedItem=function(){var t=this.getFirstSelectedOrFocusedItemIndex();this.setTabindexAtIndex(t)},e.prototype.getFirstSelectedOrFocusedItemIndex=function(){return this.isSelectableList()?"number"==typeof this.selectedIndex&&this.selectedIndex!==K.UNSET_INDEX?this.selectedIndex:this.selectedIndex instanceof Array&&this.selectedIndex.length>0?this.selectedIndex.reduce((function(t,e){return Math.min(t,e)})):0:Math.max(this.focusedItemIndex,0)},e.prototype.isIndexValid=function(t){var e=this;if(t instanceof Array){if(!this.isCheckboxList)throw new Error("MDCListFoundation: Array of index is only supported for checkbox based list");return 0===t.length||t.some((function(t){return e.isIndexInRange(t)}))}if("number"==typeof t){if(this.isCheckboxList)throw new Error("MDCListFoundation: Expected array of index for checkbox based list but got number: "+t);return this.isIndexInRange(t)||this.isSingleSelectionList&&t===K.UNSET_INDEX}return!1},e.prototype.isIndexInRange=function(t){var e=this.adapter.getListItemCount();return t>=0&&t<e},e.prototype.setSelectedIndexOnAction=function(t,e){void 0===e&&(e=!0),this.isCheckboxList?this.toggleCheckboxAtIndex(t,e):this.setSelectedIndex(t)},e.prototype.toggleCheckboxAtIndex=function(t,e){var i=this.getSelectionAttribute(),l=this.adapter.isCheckboxCheckedAtIndex(t);e&&this.adapter.setCheckedCheckboxOrRadioAtIndex(t,l=!l),this.adapter.setAttributeForElementIndex(t,i,l?"true":"false");var n=this.selectedIndex===K.UNSET_INDEX?[]:this.selectedIndex.slice();l?n.push(t):n=n.filter((function(e){return e!==t})),this.selectedIndex=n},e.prototype.focusItemAtIndex=function(t){this.adapter.focusItemAtIndex(t),this.focusedItemIndex=t},e.prototype.toggleAll=function(t){var e=this.adapter.getListItemCount();if(t.length===e)this.setCheckboxAtIndex([]);else{for(var i=[],l=0;l<e;l++)(!this.adapter.listItemAtIndexHasClass(l,H.LIST_ITEM_DISABLED_CLASS)||t.indexOf(l)>-1)&&i.push(l);this.setCheckboxAtIndex(i)}},e.prototype.typeaheadMatchItem=function(t,e,i){var l=this;return void 0===i&&(i=!1),ft({focusItemAtIndex:function(t){l.focusItemAtIndex(t)},focusedItemIndex:e||this.focusedItemIndex,nextChar:t,sortedIndexByFirstChar:this.sortedIndexByFirstChar,skipFocus:i,isItemAtIndexDisabled:function(t){return l.adapter.listItemAtIndexHasClass(t,H.LIST_ITEM_DISABLED_CLASS)}},this.typeaheadState)},e.prototype.typeaheadInitSortedIndex=function(){return function(t,e){for(var i=new Map,l=0;l<t;l++){var n=e(l).trim();if(n){var r=n[0].toLowerCase();i.has(r)||i.set(r,[]),i.get(r).push({text:n.toLowerCase(),index:l})}}return i.forEach((function(t){t.sort((function(t,e){return t.index-e.index}))})),i}(this.adapter.getListItemCount(),this.adapter.getPrimaryTextAtIndex)},e.prototype.clearTypeaheadBuffer=function(){xt(this.typeaheadState)},e}(E),gt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return I(e,t),Object.defineProperty(e.prototype,"vertical",{set:function(t){this.foundation.setVerticalOrientation(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"listElements",{get:function(){return Array.from(this.root.querySelectorAll("."+this.classNameMap[H.LIST_ITEM_CLASS]))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"wrapFocus",{set:function(t){this.foundation.setWrapFocus(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"typeaheadInProgress",{get:function(){return this.foundation.isTypeaheadInProgress()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasTypeahead",{set:function(t){this.foundation.setHasTypeahead(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"singleSelection",{set:function(t){this.foundation.setSingleSelection(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"selectedIndex",{get:function(){return this.foundation.getSelectedIndex()},set:function(t){this.foundation.setSelectedIndex(t)},enumerable:!1,configurable:!0}),e.attachTo=function(t){return new e(t)},e.prototype.initialSyncWithDOM=function(){this.isEvolutionEnabled="evolution"in this.root.dataset,this.classNameMap=this.isEvolutionEnabled?P:A(this.root,W.DEPRECATED_SELECTOR)?G:Object.values(H).reduce((function(t,e){return t[e]=e,t}),{}),this.handleClick=this.handleClickEvent.bind(this),this.handleKeydown=this.handleKeydownEvent.bind(this),this.focusInEventListener=this.handleFocusInEvent.bind(this),this.focusOutEventListener=this.handleFocusOutEvent.bind(this),this.listen("keydown",this.handleKeydown),this.listen("click",this.handleClick),this.listen("focusin",this.focusInEventListener),this.listen("focusout",this.focusOutEventListener),this.layout(),this.initializeListType(),this.ensureFocusable()},e.prototype.destroy=function(){this.unlisten("keydown",this.handleKeydown),this.unlisten("click",this.handleClick),this.unlisten("focusin",this.focusInEventListener),this.unlisten("focusout",this.focusOutEventListener)},e.prototype.layout=function(){var t=this.root.getAttribute(W.ARIA_ORIENTATION);this.vertical=t!==W.ARIA_ORIENTATION_HORIZONTAL;var e=W.FOCUSABLE_CHILD_ELEMENTS,i=this.root.querySelectorAll("."+this.classNameMap[H.LIST_ITEM_CLASS]+":not([tabindex])");i.length&&Array.prototype.forEach.call(i,(function(t){t.setAttribute("tabindex","-1")}));var l=this.root.querySelectorAll(e);l.length&&Array.prototype.forEach.call(l,(function(t){t.setAttribute("tabindex","-1")})),this.isEvolutionEnabled&&this.foundation.setUseSelectedAttribute(!0),this.foundation.layout()},e.prototype.getPrimaryText=function(t){var e,i=t.querySelector("."+this.classNameMap[H.LIST_ITEM_PRIMARY_TEXT_CLASS]);if(this.isEvolutionEnabled||i)return null!==(e=null==i?void 0:i.textContent)&&void 0!==e?e:"";var l=t.querySelector("."+this.classNameMap[H.LIST_ITEM_TEXT_CLASS]);return l&&l.textContent||""},e.prototype.initializeListType=function(){var t=this;if(this.isInteractive=A(this.root,W.ARIA_INTERACTIVE_ROLES_SELECTOR),this.isEvolutionEnabled&&this.isInteractive){var e=Array.from(this.root.querySelectorAll(W.SELECTED_ITEM_SELECTOR),(function(e){return t.listElements.indexOf(e)}));A(this.root,W.ARIA_MULTI_SELECTABLE_SELECTOR)?this.selectedIndex=e:e.length>0&&(this.selectedIndex=e[0])}else{var i=this.root.querySelectorAll(W.ARIA_ROLE_CHECKBOX_SELECTOR),l=this.root.querySelector(W.ARIA_CHECKED_RADIO_SELECTOR);if(i.length){var n=this.root.querySelectorAll(W.ARIA_CHECKED_CHECKBOX_SELECTOR);this.selectedIndex=Array.from(n,(function(e){return t.listElements.indexOf(e)}))}else l&&(this.selectedIndex=this.listElements.indexOf(l))}},e.prototype.setEnabled=function(t,e){this.foundation.setEnabled(t,e)},e.prototype.typeaheadMatchItem=function(t,e){return this.foundation.typeaheadMatchItem(t,e,!0)},e.prototype.getDefaultFoundation=function(){var t=this;return new bt({addClassForElementIndex:function(e,i){var l=t.listElements[e];l&&l.classList.add(t.classNameMap[i])},focusItemAtIndex:function(e){var i=t.listElements[e];i&&i.focus()},getAttributeForElementIndex:function(e,i){return t.listElements[e].getAttribute(i)},getFocusedElementIndex:function(){return t.listElements.indexOf(document.activeElement)},getListItemCount:function(){return t.listElements.length},getPrimaryTextAtIndex:function(e){return t.getPrimaryText(t.listElements[e])},hasCheckboxAtIndex:function(e){return!!t.listElements[e].querySelector(W.CHECKBOX_SELECTOR)},hasRadioAtIndex:function(e){return!!t.listElements[e].querySelector(W.RADIO_SELECTOR)},isCheckboxCheckedAtIndex:function(e){return t.listElements[e].querySelector(W.CHECKBOX_SELECTOR).checked},isFocusInsideList:function(){return t.root!==document.activeElement&&t.root.contains(document.activeElement)},isRootFocused:function(){return document.activeElement===t.root},listItemAtIndexHasClass:function(e,i){return t.listElements[e].classList.contains(t.classNameMap[i])},notifyAction:function(e){t.emit(W.ACTION_EVENT,{index:e},!0)},removeClassForElementIndex:function(e,i){var l=t.listElements[e];l&&l.classList.remove(t.classNameMap[i])},setAttributeForElementIndex:function(e,i,l){var n=t.listElements[e];n&&n.setAttribute(i,l)},setCheckedCheckboxOrRadioAtIndex:function(e,i){var l=t.listElements[e].querySelector(W.CHECKBOX_RADIO_SELECTOR);l.checked=i;var n=document.createEvent("Event");n.initEvent("change",!0,!0),l.dispatchEvent(n)},setTabIndexForListItemChildren:function(e,i){Array.prototype.forEach.call(t.listElements[e].querySelectorAll(W.CHILD_ELEMENTS_TO_TOGGLE_TABINDEX),(function(t){t.setAttribute("tabindex",i)}))}})},e.prototype.ensureFocusable=function(){if(this.isEvolutionEnabled&&this.isInteractive&&!this.root.querySelector("."+this.classNameMap[H.LIST_ITEM_CLASS]+'[tabindex="0"]')){var t=this.initialFocusIndex();-1!==t&&(this.listElements[t].tabIndex=0)}},e.prototype.initialFocusIndex=function(){if(this.selectedIndex instanceof Array&&this.selectedIndex.length>0)return this.selectedIndex[0];if("number"==typeof this.selectedIndex&&this.selectedIndex!==K.UNSET_INDEX)return this.selectedIndex;var t=this.root.querySelector("."+this.classNameMap[H.LIST_ITEM_CLASS]+":not(."+this.classNameMap[H.LIST_ITEM_DISABLED_CLASS]+")");return null===t?-1:this.getListItemIndex(t)},e.prototype.getListItemIndex=function(t){var e=C(t,"."+this.classNameMap[H.LIST_ITEM_CLASS]+", ."+this.classNameMap[H.ROOT]);return e&&A(e,"."+this.classNameMap[H.LIST_ITEM_CLASS])?this.listElements.indexOf(e):-1},e.prototype.handleFocusInEvent=function(t){var e=this.getListItemIndex(t.target);this.foundation.handleFocusIn(e)},e.prototype.handleFocusOutEvent=function(t){var e=this.getListItemIndex(t.target);this.foundation.handleFocusOut(e)},e.prototype.handleKeydownEvent=function(t){var e=this.getListItemIndex(t.target);this.foundation.handleKeydown(t,t.target.classList.contains(this.classNameMap[H.LIST_ITEM_CLASS]),e)},e.prototype.handleClickEvent=function(t){var e=this.getListItemIndex(t.target),i=!A(t.target,W.CHECKBOX_RADIO_SELECTOR);this.foundation.handleClick(e,i)},e}(O);
|
|
68
|
+
*/var bt=function(t){function e(i){var l=t.call(this,T(T({},e.defaultAdapter),i))||this;return l.wrapFocus=!1,l.isVertical=!0,l.isSingleSelectionList=!1,l.selectedIndex=K.UNSET_INDEX,l.focusedItemIndex=K.UNSET_INDEX,l.useActivatedClass=!1,l.useSelectedAttr=!1,l.ariaCurrentAttrValue=null,l.isCheckboxList=!1,l.isRadioList=!1,l.hasTypeahead=!1,l.typeaheadState={bufferClearTimeout:0,currentFirstChar:"",sortedIndexCursor:0,typeaheadBuffer:""},l.sortedIndexByFirstChar=new Map,l}return I(e,t),Object.defineProperty(e,"strings",{get:function(){return W},enumerable:!1,configurable:!0}),Object.defineProperty(e,"cssClasses",{get:function(){return H},enumerable:!1,configurable:!0}),Object.defineProperty(e,"numbers",{get:function(){return K},enumerable:!1,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{addClassForElementIndex:function(){},focusItemAtIndex:function(){},getAttributeForElementIndex:function(){return null},getFocusedElementIndex:function(){return 0},getListItemCount:function(){return 0},hasCheckboxAtIndex:function(){return!1},hasRadioAtIndex:function(){return!1},isCheckboxCheckedAtIndex:function(){return!1},isFocusInsideList:function(){return!1},isRootFocused:function(){return!1},listItemAtIndexHasClass:function(){return!1},notifyAction:function(){},removeClassForElementIndex:function(){},setAttributeForElementIndex:function(){},setCheckedCheckboxOrRadioAtIndex:function(){},setTabIndexForListItemChildren:function(){},getPrimaryTextAtIndex:function(){return""}}},enumerable:!1,configurable:!0}),e.prototype.layout=function(){0!==this.adapter.getListItemCount()&&(this.adapter.hasCheckboxAtIndex(0)?this.isCheckboxList=!0:this.adapter.hasRadioAtIndex(0)?this.isRadioList=!0:this.maybeInitializeSingleSelection(),this.hasTypeahead&&(this.sortedIndexByFirstChar=this.typeaheadInitSortedIndex()))},e.prototype.getFocusedItemIndex=function(){return this.focusedItemIndex},e.prototype.setWrapFocus=function(t){this.wrapFocus=t},e.prototype.setVerticalOrientation=function(t){this.isVertical=t},e.prototype.setSingleSelection=function(t){this.isSingleSelectionList=t,t&&(this.maybeInitializeSingleSelection(),this.selectedIndex=this.getSelectedIndexFromDOM())},e.prototype.maybeInitializeSingleSelection=function(){var t=this.getSelectedIndexFromDOM();t!==K.UNSET_INDEX&&(this.adapter.listItemAtIndexHasClass(t,H.LIST_ITEM_ACTIVATED_CLASS)&&this.setUseActivatedClass(!0),this.isSingleSelectionList=!0,this.selectedIndex=t)},e.prototype.getSelectedIndexFromDOM=function(){for(var t=K.UNSET_INDEX,e=this.adapter.getListItemCount(),i=0;i<e;i++){var l=this.adapter.listItemAtIndexHasClass(i,H.LIST_ITEM_SELECTED_CLASS),n=this.adapter.listItemAtIndexHasClass(i,H.LIST_ITEM_ACTIVATED_CLASS);if(l||n){t=i;break}}return t},e.prototype.setHasTypeahead=function(t){this.hasTypeahead=t,t&&(this.sortedIndexByFirstChar=this.typeaheadInitSortedIndex())},e.prototype.isTypeaheadInProgress=function(){return this.hasTypeahead&&ut(this.typeaheadState)},e.prototype.setUseActivatedClass=function(t){this.useActivatedClass=t},e.prototype.setUseSelectedAttribute=function(t){this.useSelectedAttr=t},e.prototype.getSelectedIndex=function(){return this.selectedIndex},e.prototype.setSelectedIndex=function(t,e){var i=(void 0===e?{}:e).forceUpdate;this.isIndexValid(t)&&(this.isCheckboxList?this.setCheckboxAtIndex(t):this.isRadioList?this.setRadioAtIndex(t):this.setSingleSelectionAtIndex(t,{forceUpdate:i}))},e.prototype.handleFocusIn=function(t){t>=0&&(this.focusedItemIndex=t,this.adapter.setAttributeForElementIndex(t,"tabindex","0"),this.adapter.setTabIndexForListItemChildren(t,"0"))},e.prototype.handleFocusOut=function(t){var e=this;t>=0&&(this.adapter.setAttributeForElementIndex(t,"tabindex","-1"),this.adapter.setTabIndexForListItemChildren(t,"-1")),setTimeout((function(){e.adapter.isFocusInsideList()||e.setTabindexToFirstSelectedOrFocusedItem()}),0)},e.prototype.handleKeydown=function(t,e,i){var l=this,n="ArrowLeft"===ct(t),r="ArrowUp"===ct(t),o="ArrowRight"===ct(t),d="ArrowDown"===ct(t),a="Home"===ct(t),s="End"===ct(t),c="Enter"===ct(t),m="Spacebar"===ct(t),h="A"===t.key||"a"===t.key;if(this.adapter.isRootFocused())r||s?(t.preventDefault(),this.focusLastElement()):(d||a)&&(t.preventDefault(),this.focusFirstElement()),this.hasTypeahead&&pt({event:t,focusItemAtIndex:function(t){l.focusItemAtIndex(t)},focusedItemIndex:-1,isTargetListItem:e,sortedIndexByFirstChar:this.sortedIndexByFirstChar,isItemAtIndexDisabled:function(t){return l.adapter.listItemAtIndexHasClass(t,H.LIST_ITEM_DISABLED_CLASS)}},this.typeaheadState);else{var f=this.adapter.getFocusedElementIndex();if(!(-1===f&&(f=i)<0)){if(this.isVertical&&d||!this.isVertical&&o)ht(t),this.focusNextElement(f);else if(this.isVertical&&r||!this.isVertical&&n)ht(t),this.focusPrevElement(f);else if(a)ht(t),this.focusFirstElement();else if(s)ht(t),this.focusLastElement();else if(h&&t.ctrlKey&&this.isCheckboxList)t.preventDefault(),this.toggleAll(this.selectedIndex===K.UNSET_INDEX?[]:this.selectedIndex);else if((c||m)&&e){var u=t.target;if(u&&"A"===u.tagName&&c)return;if(ht(t),this.adapter.listItemAtIndexHasClass(f,H.LIST_ITEM_DISABLED_CLASS))return;this.isTypeaheadInProgress()||(this.isSelectableList()&&this.setSelectedIndexOnAction(f),this.adapter.notifyAction(f))}this.hasTypeahead&&pt({event:t,focusItemAtIndex:function(t){l.focusItemAtIndex(t)},focusedItemIndex:this.focusedItemIndex,isTargetListItem:e,sortedIndexByFirstChar:this.sortedIndexByFirstChar,isItemAtIndexDisabled:function(t){return l.adapter.listItemAtIndexHasClass(t,H.LIST_ITEM_DISABLED_CLASS)}},this.typeaheadState)}}},e.prototype.handleClick=function(t,e){t!==K.UNSET_INDEX&&(this.adapter.listItemAtIndexHasClass(t,H.LIST_ITEM_DISABLED_CLASS)||(this.isSelectableList()&&this.setSelectedIndexOnAction(t,e),this.adapter.notifyAction(t)))},e.prototype.focusNextElement=function(t){var e=t+1;if(e>=this.adapter.getListItemCount()){if(!this.wrapFocus)return t;e=0}return this.focusItemAtIndex(e),e},e.prototype.focusPrevElement=function(t){var e=t-1;if(e<0){if(!this.wrapFocus)return t;e=this.adapter.getListItemCount()-1}return this.focusItemAtIndex(e),e},e.prototype.focusFirstElement=function(){return this.focusItemAtIndex(0),0},e.prototype.focusLastElement=function(){var t=this.adapter.getListItemCount()-1;return this.focusItemAtIndex(t),t},e.prototype.focusInitialElement=function(){var t=this.getFirstSelectedOrFocusedItemIndex();return this.focusItemAtIndex(t),t},e.prototype.setEnabled=function(t,e){this.isIndexValid(t)&&(e?(this.adapter.removeClassForElementIndex(t,H.LIST_ITEM_DISABLED_CLASS),this.adapter.setAttributeForElementIndex(t,W.ARIA_DISABLED,"false")):(this.adapter.addClassForElementIndex(t,H.LIST_ITEM_DISABLED_CLASS),this.adapter.setAttributeForElementIndex(t,W.ARIA_DISABLED,"true")))},e.prototype.setSingleSelectionAtIndex=function(t,e){if(this.selectedIndex!==t||(void 0===e?{}:e).forceUpdate){var i=H.LIST_ITEM_SELECTED_CLASS;this.useActivatedClass&&(i=H.LIST_ITEM_ACTIVATED_CLASS),this.selectedIndex!==K.UNSET_INDEX&&this.adapter.removeClassForElementIndex(this.selectedIndex,i),this.setAriaForSingleSelectionAtIndex(t),this.setTabindexAtIndex(t),t!==K.UNSET_INDEX&&this.adapter.addClassForElementIndex(t,i),this.selectedIndex=t}},e.prototype.setAriaForSingleSelectionAtIndex=function(t){this.selectedIndex===K.UNSET_INDEX&&(this.ariaCurrentAttrValue=this.adapter.getAttributeForElementIndex(t,W.ARIA_CURRENT));var e=null!==this.ariaCurrentAttrValue,i=e?W.ARIA_CURRENT:W.ARIA_SELECTED;this.selectedIndex!==K.UNSET_INDEX&&this.adapter.setAttributeForElementIndex(this.selectedIndex,i,"false"),t!==K.UNSET_INDEX&&this.adapter.setAttributeForElementIndex(t,i,e?this.ariaCurrentAttrValue:"true")},e.prototype.getSelectionAttribute=function(){return this.useSelectedAttr?W.ARIA_SELECTED:W.ARIA_CHECKED},e.prototype.setRadioAtIndex=function(t){var e=this.getSelectionAttribute();this.adapter.setCheckedCheckboxOrRadioAtIndex(t,!0),this.selectedIndex!==K.UNSET_INDEX&&this.adapter.setAttributeForElementIndex(this.selectedIndex,e,"false"),this.adapter.setAttributeForElementIndex(t,e,"true"),this.selectedIndex=t},e.prototype.setCheckboxAtIndex=function(t){for(var e=this.getSelectionAttribute(),i=0;i<this.adapter.getListItemCount();i++){var l=!1;t.indexOf(i)>=0&&(l=!0),this.adapter.setCheckedCheckboxOrRadioAtIndex(i,l),this.adapter.setAttributeForElementIndex(i,e,l?"true":"false")}this.selectedIndex=t},e.prototype.setTabindexAtIndex=function(t){this.focusedItemIndex===K.UNSET_INDEX&&0!==t?this.adapter.setAttributeForElementIndex(0,"tabindex","-1"):this.focusedItemIndex>=0&&this.focusedItemIndex!==t&&this.adapter.setAttributeForElementIndex(this.focusedItemIndex,"tabindex","-1"),this.selectedIndex instanceof Array||this.selectedIndex===t||this.adapter.setAttributeForElementIndex(this.selectedIndex,"tabindex","-1"),t!==K.UNSET_INDEX&&this.adapter.setAttributeForElementIndex(t,"tabindex","0")},e.prototype.isSelectableList=function(){return this.isSingleSelectionList||this.isCheckboxList||this.isRadioList},e.prototype.setTabindexToFirstSelectedOrFocusedItem=function(){var t=this.getFirstSelectedOrFocusedItemIndex();this.setTabindexAtIndex(t)},e.prototype.getFirstSelectedOrFocusedItemIndex=function(){return this.isSelectableList()?"number"==typeof this.selectedIndex&&this.selectedIndex!==K.UNSET_INDEX?this.selectedIndex:this.selectedIndex instanceof Array&&this.selectedIndex.length>0?this.selectedIndex.reduce((function(t,e){return Math.min(t,e)})):0:Math.max(this.focusedItemIndex,0)},e.prototype.isIndexValid=function(t){var e=this;if(t instanceof Array){if(!this.isCheckboxList)throw new Error("MDCListFoundation: Array of index is only supported for checkbox based list");return 0===t.length||t.some((function(t){return e.isIndexInRange(t)}))}if("number"==typeof t){if(this.isCheckboxList)throw new Error("MDCListFoundation: Expected array of index for checkbox based list but got number: "+t);return this.isIndexInRange(t)||this.isSingleSelectionList&&t===K.UNSET_INDEX}return!1},e.prototype.isIndexInRange=function(t){var e=this.adapter.getListItemCount();return t>=0&&t<e},e.prototype.setSelectedIndexOnAction=function(t,e){void 0===e&&(e=!0),this.isCheckboxList?this.toggleCheckboxAtIndex(t,e):this.setSelectedIndex(t)},e.prototype.toggleCheckboxAtIndex=function(t,e){var i=this.getSelectionAttribute(),l=this.adapter.isCheckboxCheckedAtIndex(t);e&&this.adapter.setCheckedCheckboxOrRadioAtIndex(t,l=!l),this.adapter.setAttributeForElementIndex(t,i,l?"true":"false");var n=this.selectedIndex===K.UNSET_INDEX?[]:this.selectedIndex.slice();l?n.push(t):n=n.filter((function(e){return e!==t})),this.selectedIndex=n},e.prototype.focusItemAtIndex=function(t){this.adapter.focusItemAtIndex(t),this.focusedItemIndex=t},e.prototype.toggleAll=function(t){var e=this.adapter.getListItemCount();if(t.length===e)this.setCheckboxAtIndex([]);else{for(var i=[],l=0;l<e;l++)(!this.adapter.listItemAtIndexHasClass(l,H.LIST_ITEM_DISABLED_CLASS)||t.indexOf(l)>-1)&&i.push(l);this.setCheckboxAtIndex(i)}},e.prototype.typeaheadMatchItem=function(t,e,i){var l=this;return void 0===i&&(i=!1),ft({focusItemAtIndex:function(t){l.focusItemAtIndex(t)},focusedItemIndex:e||this.focusedItemIndex,nextChar:t,sortedIndexByFirstChar:this.sortedIndexByFirstChar,skipFocus:i,isItemAtIndexDisabled:function(t){return l.adapter.listItemAtIndexHasClass(t,H.LIST_ITEM_DISABLED_CLASS)}},this.typeaheadState)},e.prototype.typeaheadInitSortedIndex=function(){return function(t,e){for(var i=new Map,l=0;l<t;l++){var n=e(l).trim();if(n){var r=n[0].toLowerCase();i.has(r)||i.set(r,[]),i.get(r).push({text:n.toLowerCase(),index:l})}}return i.forEach((function(t){t.sort((function(t,e){return t.index-e.index}))})),i}(this.adapter.getListItemCount(),this.adapter.getPrimaryTextAtIndex)},e.prototype.clearTypeaheadBuffer=function(){xt(this.typeaheadState)},e}(E),gt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return I(e,t),Object.defineProperty(e.prototype,"vertical",{set:function(t){this.foundation.setVerticalOrientation(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"listElements",{get:function(){return Array.from(this.root.querySelectorAll("."+this.classNameMap[H.LIST_ITEM_CLASS]))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"wrapFocus",{set:function(t){this.foundation.setWrapFocus(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"typeaheadInProgress",{get:function(){return this.foundation.isTypeaheadInProgress()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasTypeahead",{set:function(t){this.foundation.setHasTypeahead(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"singleSelection",{set:function(t){this.foundation.setSingleSelection(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"selectedIndex",{get:function(){return this.foundation.getSelectedIndex()},set:function(t){this.foundation.setSelectedIndex(t)},enumerable:!1,configurable:!0}),e.attachTo=function(t){return new e(t)},e.prototype.initialSyncWithDOM=function(){this.isEvolutionEnabled="evolution"in this.root.dataset,this.classNameMap=this.isEvolutionEnabled?P:C(this.root,W.DEPRECATED_SELECTOR)?G:Object.values(H).reduce((function(t,e){return t[e]=e,t}),{}),this.handleClick=this.handleClickEvent.bind(this),this.handleKeydown=this.handleKeydownEvent.bind(this),this.focusInEventListener=this.handleFocusInEvent.bind(this),this.focusOutEventListener=this.handleFocusOutEvent.bind(this),this.listen("keydown",this.handleKeydown),this.listen("click",this.handleClick),this.listen("focusin",this.focusInEventListener),this.listen("focusout",this.focusOutEventListener),this.layout(),this.initializeListType(),this.ensureFocusable()},e.prototype.destroy=function(){this.unlisten("keydown",this.handleKeydown),this.unlisten("click",this.handleClick),this.unlisten("focusin",this.focusInEventListener),this.unlisten("focusout",this.focusOutEventListener)},e.prototype.layout=function(){var t=this.root.getAttribute(W.ARIA_ORIENTATION);this.vertical=t!==W.ARIA_ORIENTATION_HORIZONTAL;var e=W.FOCUSABLE_CHILD_ELEMENTS,i=this.root.querySelectorAll("."+this.classNameMap[H.LIST_ITEM_CLASS]+":not([tabindex])");i.length&&Array.prototype.forEach.call(i,(function(t){t.setAttribute("tabindex","-1")}));var l=this.root.querySelectorAll(e);l.length&&Array.prototype.forEach.call(l,(function(t){t.setAttribute("tabindex","-1")})),this.isEvolutionEnabled&&this.foundation.setUseSelectedAttribute(!0),this.foundation.layout()},e.prototype.getPrimaryText=function(t){var e,i=t.querySelector("."+this.classNameMap[H.LIST_ITEM_PRIMARY_TEXT_CLASS]);if(this.isEvolutionEnabled||i)return null!==(e=null==i?void 0:i.textContent)&&void 0!==e?e:"";var l=t.querySelector("."+this.classNameMap[H.LIST_ITEM_TEXT_CLASS]);return l&&l.textContent||""},e.prototype.initializeListType=function(){var t=this;if(this.isInteractive=C(this.root,W.ARIA_INTERACTIVE_ROLES_SELECTOR),this.isEvolutionEnabled&&this.isInteractive){var e=Array.from(this.root.querySelectorAll(W.SELECTED_ITEM_SELECTOR),(function(e){return t.listElements.indexOf(e)}));C(this.root,W.ARIA_MULTI_SELECTABLE_SELECTOR)?this.selectedIndex=e:e.length>0&&(this.selectedIndex=e[0])}else{var i=this.root.querySelectorAll(W.ARIA_ROLE_CHECKBOX_SELECTOR),l=this.root.querySelector(W.ARIA_CHECKED_RADIO_SELECTOR);if(i.length){var n=this.root.querySelectorAll(W.ARIA_CHECKED_CHECKBOX_SELECTOR);this.selectedIndex=Array.from(n,(function(e){return t.listElements.indexOf(e)}))}else l&&(this.selectedIndex=this.listElements.indexOf(l))}},e.prototype.setEnabled=function(t,e){this.foundation.setEnabled(t,e)},e.prototype.typeaheadMatchItem=function(t,e){return this.foundation.typeaheadMatchItem(t,e,!0)},e.prototype.getDefaultFoundation=function(){var t=this;return new bt({addClassForElementIndex:function(e,i){var l=t.listElements[e];l&&l.classList.add(t.classNameMap[i])},focusItemAtIndex:function(e){var i=t.listElements[e];i&&i.focus()},getAttributeForElementIndex:function(e,i){return t.listElements[e].getAttribute(i)},getFocusedElementIndex:function(){return t.listElements.indexOf(document.activeElement)},getListItemCount:function(){return t.listElements.length},getPrimaryTextAtIndex:function(e){return t.getPrimaryText(t.listElements[e])},hasCheckboxAtIndex:function(e){return!!t.listElements[e].querySelector(W.CHECKBOX_SELECTOR)},hasRadioAtIndex:function(e){return!!t.listElements[e].querySelector(W.RADIO_SELECTOR)},isCheckboxCheckedAtIndex:function(e){return t.listElements[e].querySelector(W.CHECKBOX_SELECTOR).checked},isFocusInsideList:function(){return t.root!==document.activeElement&&t.root.contains(document.activeElement)},isRootFocused:function(){return document.activeElement===t.root},listItemAtIndexHasClass:function(e,i){return t.listElements[e].classList.contains(t.classNameMap[i])},notifyAction:function(e){t.emit(W.ACTION_EVENT,{index:e},!0)},removeClassForElementIndex:function(e,i){var l=t.listElements[e];l&&l.classList.remove(t.classNameMap[i])},setAttributeForElementIndex:function(e,i,l){var n=t.listElements[e];n&&n.setAttribute(i,l)},setCheckedCheckboxOrRadioAtIndex:function(e,i){var l=t.listElements[e].querySelector(W.CHECKBOX_RADIO_SELECTOR);l.checked=i;var n=document.createEvent("Event");n.initEvent("change",!0,!0),l.dispatchEvent(n)},setTabIndexForListItemChildren:function(e,i){Array.prototype.forEach.call(t.listElements[e].querySelectorAll(W.CHILD_ELEMENTS_TO_TOGGLE_TABINDEX),(function(t){t.setAttribute("tabindex",i)}))}})},e.prototype.ensureFocusable=function(){if(this.isEvolutionEnabled&&this.isInteractive&&!this.root.querySelector("."+this.classNameMap[H.LIST_ITEM_CLASS]+'[tabindex="0"]')){var t=this.initialFocusIndex();-1!==t&&(this.listElements[t].tabIndex=0)}},e.prototype.initialFocusIndex=function(){if(this.selectedIndex instanceof Array&&this.selectedIndex.length>0)return this.selectedIndex[0];if("number"==typeof this.selectedIndex&&this.selectedIndex!==K.UNSET_INDEX)return this.selectedIndex;var t=this.root.querySelector("."+this.classNameMap[H.LIST_ITEM_CLASS]+":not(."+this.classNameMap[H.LIST_ITEM_DISABLED_CLASS]+")");return null===t?-1:this.getListItemIndex(t)},e.prototype.getListItemIndex=function(t){var e=A(t,"."+this.classNameMap[H.LIST_ITEM_CLASS]+", ."+this.classNameMap[H.ROOT]);return e&&C(e,"."+this.classNameMap[H.LIST_ITEM_CLASS])?this.listElements.indexOf(e):-1},e.prototype.handleFocusInEvent=function(t){var e=this.getListItemIndex(t.target);this.foundation.handleFocusIn(e)},e.prototype.handleFocusOutEvent=function(t){var e=this.getListItemIndex(t.target);this.foundation.handleFocusOut(e)},e.prototype.handleKeydownEvent=function(t){var e=this.getListItemIndex(t.target);this.foundation.handleKeydown(t,t.target.classList.contains(this.classNameMap[H.LIST_ITEM_CLASS]),e)},e.prototype.handleClickEvent=function(t){var e=this.getListItemIndex(t.target),i=!C(t.target,W.CHECKBOX_RADIO_SELECTOR);this.foundation.handleClick(e,i)},e}(O);
|
|
69
69
|
/**
|
|
70
70
|
* @license
|
|
71
71
|
* Copyright 2018 Google Inc.
|
|
@@ -110,7 +110,7 @@ var X,U;Y.style='@charset "UTF-8";:host([type=url]) .mdc-text-field--with-traili
|
|
|
110
110
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
111
111
|
* THE SOFTWARE.
|
|
112
112
|
*/
|
|
113
|
-
var It,Tt,Et={ANCHOR:"mdc-menu-surface--anchor",ANIMATING_CLOSED:"mdc-menu-surface--animating-closed",ANIMATING_OPEN:"mdc-menu-surface--animating-open",FIXED:"mdc-menu-surface--fixed",IS_OPEN_BELOW:"mdc-menu-surface--is-open-below",OPEN:"mdc-menu-surface--open",ROOT:"mdc-menu-surface"},
|
|
113
|
+
var It,Tt,Et={ANCHOR:"mdc-menu-surface--anchor",ANIMATING_CLOSED:"mdc-menu-surface--animating-closed",ANIMATING_OPEN:"mdc-menu-surface--animating-open",FIXED:"mdc-menu-surface--fixed",IS_OPEN_BELOW:"mdc-menu-surface--is-open-below",OPEN:"mdc-menu-surface--open",ROOT:"mdc-menu-surface"},Ct={CLOSED_EVENT:"MDCMenuSurface:closed",CLOSING_EVENT:"MDCMenuSurface:closing",OPENED_EVENT:"MDCMenuSurface:opened",FOCUSABLE_ELEMENTS:["button:not(:disabled)",'[href]:not([aria-disabled="true"])',"input:not(:disabled)","select:not(:disabled)","textarea:not(:disabled)",'[tabindex]:not([tabindex="-1"]):not([aria-disabled="true"])'].join(", ")},At={TRANSITION_OPEN_DURATION:120,TRANSITION_CLOSE_DURATION:75,MARGIN_TO_EDGE:32,ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO:.67,TOUCH_EVENT_WAIT_MS:30};!function(t){t[t.BOTTOM=1]="BOTTOM",t[t.CENTER=2]="CENTER",t[t.RIGHT=4]="RIGHT",t[t.FLIP_RTL=8]="FLIP_RTL"}(It||(It={})),function(t){t[t.TOP_LEFT=0]="TOP_LEFT",t[t.TOP_RIGHT=4]="TOP_RIGHT",t[t.BOTTOM_LEFT=1]="BOTTOM_LEFT",t[t.BOTTOM_RIGHT=5]="BOTTOM_RIGHT",t[t.TOP_START=8]="TOP_START",t[t.TOP_END=12]="TOP_END",t[t.BOTTOM_START=9]="BOTTOM_START",t[t.BOTTOM_END=13]="BOTTOM_END"}(Tt||(Tt={}));
|
|
114
114
|
/**
|
|
115
115
|
* @license
|
|
116
116
|
* Copyright 2018 Google Inc.
|
|
@@ -133,7 +133,7 @@ var It,Tt,Et={ANCHOR:"mdc-menu-surface--anchor",ANIMATING_CLOSED:"mdc-menu-surfa
|
|
|
133
133
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
134
134
|
* THE SOFTWARE.
|
|
135
135
|
*/
|
|
136
|
-
var Ot=function(t){function e(i){var l=t.call(this,T(T({},e.defaultAdapter),i))||this;return l.isSurfaceOpen=!1,l.isQuickOpen=!1,l.isHoistedElement=!1,l.isFixedPosition=!1,l.isHorizontallyCenteredOnViewport=!1,l.maxHeight=0,l.openAnimationEndTimerId=0,l.closeAnimationEndTimerId=0,l.animationRequestId=0,l.anchorCorner=Tt.TOP_START,l.originCorner=Tt.TOP_START,l.anchorMargin={top:0,right:0,bottom:0,left:0},l.position={x:0,y:0},l}return I(e,t),Object.defineProperty(e,"cssClasses",{get:function(){return Et},enumerable:!1,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return
|
|
136
|
+
var Ot=function(t){function e(i){var l=t.call(this,T(T({},e.defaultAdapter),i))||this;return l.isSurfaceOpen=!1,l.isQuickOpen=!1,l.isHoistedElement=!1,l.isFixedPosition=!1,l.isHorizontallyCenteredOnViewport=!1,l.maxHeight=0,l.openAnimationEndTimerId=0,l.closeAnimationEndTimerId=0,l.animationRequestId=0,l.anchorCorner=Tt.TOP_START,l.originCorner=Tt.TOP_START,l.anchorMargin={top:0,right:0,bottom:0,left:0},l.position={x:0,y:0},l}return I(e,t),Object.defineProperty(e,"cssClasses",{get:function(){return Et},enumerable:!1,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return Ct},enumerable:!1,configurable:!0}),Object.defineProperty(e,"numbers",{get:function(){return At},enumerable:!1,configurable:!0}),Object.defineProperty(e,"Corner",{get:function(){return Tt},enumerable:!1,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){return!1},hasAnchor:function(){return!1},isElementInContainer:function(){return!1},isFocused:function(){return!1},isRtl:function(){return!1},getInnerDimensions:function(){return{height:0,width:0}},getAnchorDimensions:function(){return null},getWindowDimensions:function(){return{height:0,width:0}},getBodyDimensions:function(){return{height:0,width:0}},getWindowScroll:function(){return{x:0,y:0}},setPosition:function(){},setMaxHeight:function(){},setTransformOrigin:function(){},saveFocus:function(){},restoreFocus:function(){},notifyClose:function(){},notifyOpen:function(){},notifyClosing:function(){}}},enumerable:!1,configurable:!0}),e.prototype.init=function(){var t=e.cssClasses,i=t.ROOT,l=t.OPEN;if(!this.adapter.hasClass(i))throw new Error(i+" class required in root element.");this.adapter.hasClass(l)&&(this.isSurfaceOpen=!0)},e.prototype.destroy=function(){clearTimeout(this.openAnimationEndTimerId),clearTimeout(this.closeAnimationEndTimerId),cancelAnimationFrame(this.animationRequestId)},e.prototype.setAnchorCorner=function(t){this.anchorCorner=t},e.prototype.flipCornerHorizontally=function(){this.originCorner=this.originCorner^It.RIGHT},e.prototype.setAnchorMargin=function(t){this.anchorMargin.top=t.top||0,this.anchorMargin.right=t.right||0,this.anchorMargin.bottom=t.bottom||0,this.anchorMargin.left=t.left||0},e.prototype.setIsHoisted=function(t){this.isHoistedElement=t},e.prototype.setFixedPosition=function(t){this.isFixedPosition=t},e.prototype.isFixed=function(){return this.isFixedPosition},e.prototype.setAbsolutePosition=function(t,e){this.position.x=this.isFinite(t)?t:0,this.position.y=this.isFinite(e)?e:0},e.prototype.setIsHorizontallyCenteredOnViewport=function(t){this.isHorizontallyCenteredOnViewport=t},e.prototype.setQuickOpen=function(t){this.isQuickOpen=t},e.prototype.setMaxHeight=function(t){this.maxHeight=t},e.prototype.isOpen=function(){return this.isSurfaceOpen},e.prototype.open=function(){var t=this;this.isSurfaceOpen||(this.adapter.saveFocus(),this.isQuickOpen?(this.isSurfaceOpen=!0,this.adapter.addClass(e.cssClasses.OPEN),this.dimensions=this.adapter.getInnerDimensions(),this.autoposition(),this.adapter.notifyOpen()):(this.adapter.addClass(e.cssClasses.ANIMATING_OPEN),this.animationRequestId=requestAnimationFrame((function(){t.dimensions=t.adapter.getInnerDimensions(),t.autoposition(),t.adapter.addClass(e.cssClasses.OPEN),t.openAnimationEndTimerId=setTimeout((function(){t.openAnimationEndTimerId=0,t.adapter.removeClass(e.cssClasses.ANIMATING_OPEN),t.adapter.notifyOpen()}),At.TRANSITION_OPEN_DURATION)})),this.isSurfaceOpen=!0))},e.prototype.close=function(t){var i=this;if(void 0===t&&(t=!1),this.isSurfaceOpen){if(this.adapter.notifyClosing(),this.isQuickOpen)return this.isSurfaceOpen=!1,t||this.maybeRestoreFocus(),this.adapter.removeClass(e.cssClasses.OPEN),this.adapter.removeClass(e.cssClasses.IS_OPEN_BELOW),void this.adapter.notifyClose();this.adapter.addClass(e.cssClasses.ANIMATING_CLOSED),requestAnimationFrame((function(){i.adapter.removeClass(e.cssClasses.OPEN),i.adapter.removeClass(e.cssClasses.IS_OPEN_BELOW),i.closeAnimationEndTimerId=setTimeout((function(){i.closeAnimationEndTimerId=0,i.adapter.removeClass(e.cssClasses.ANIMATING_CLOSED),i.adapter.notifyClose()}),At.TRANSITION_CLOSE_DURATION)})),this.isSurfaceOpen=!1,t||this.maybeRestoreFocus()}},e.prototype.handleBodyClick=function(t){this.adapter.isElementInContainer(t.target)||this.close()},e.prototype.handleKeydown=function(t){("Escape"===t.key||27===t.keyCode)&&this.close()},e.prototype.autoposition=function(){var t;this.measurements=this.getAutoLayoutmeasurements();var i=this.getoriginCorner(),l=this.getMenuSurfaceMaxHeight(i),n=this.hasBit(i,It.BOTTOM)?"bottom":"top",r=this.hasBit(i,It.RIGHT)?"right":"left",o=this.getHorizontalOriginOffset(i),d=this.getVerticalOriginOffset(i),a=this.measurements,s=a.anchorSize,c=a.surfaceSize,m=((t={})[r]=o,t[n]=d,t);s.width/c.width>At.ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO&&(r="center"),(this.isHoistedElement||this.isFixedPosition)&&this.adjustPositionForHoistedElement(m),this.adapter.setTransformOrigin(r+" "+n),this.adapter.setPosition(m),this.adapter.setMaxHeight(l?l+"px":""),this.hasBit(i,It.BOTTOM)||this.adapter.addClass(e.cssClasses.IS_OPEN_BELOW)},e.prototype.getAutoLayoutmeasurements=function(){var t=this.adapter.getAnchorDimensions(),e=this.adapter.getBodyDimensions(),i=this.adapter.getWindowDimensions(),l=this.adapter.getWindowScroll();return t||(t={top:this.position.y,right:this.position.x,bottom:this.position.y,left:this.position.x,width:0,height:0}),{anchorSize:t,bodySize:e,surfaceSize:this.dimensions,viewportDistance:{top:t.top,right:i.width-t.right,bottom:i.height-t.bottom,left:t.left},viewportSize:i,windowScroll:l}},e.prototype.getoriginCorner=function(){var t,i,l=this.originCorner,n=this.measurements,r=n.viewportDistance,o=n.anchorSize,d=n.surfaceSize,a=e.numbers.MARGIN_TO_EDGE;this.hasBit(this.anchorCorner,It.BOTTOM)?(t=r.top-a+this.anchorMargin.bottom,i=r.bottom-a-this.anchorMargin.bottom):(t=r.top-a+this.anchorMargin.top,i=r.bottom-a+o.height-this.anchorMargin.top),!(i-d.height>0)&&t>i&&(l=this.setBit(l,It.BOTTOM));var s,c,m,h=this.adapter.isRtl(),f=this.hasBit(this.anchorCorner,It.FLIP_RTL),u=this.hasBit(this.anchorCorner,It.RIGHT)||this.hasBit(l,It.RIGHT);(m=h&&f?!u:u)?(s=r.left+o.width+this.anchorMargin.right,c=r.right-this.anchorMargin.right):(s=r.left+this.anchorMargin.left,c=r.right+o.width-this.anchorMargin.left);var x=s-d.width>0,p=c-d.width>0,b=this.hasBit(l,It.FLIP_RTL)&&this.hasBit(l,It.RIGHT);return p&&b&&h||!x&&b?l=this.unsetBit(l,It.RIGHT):(x&&m&&h||x&&!m&&u||!p&&s>=c)&&(l=this.setBit(l,It.RIGHT)),l},e.prototype.getMenuSurfaceMaxHeight=function(t){if(this.maxHeight>0)return this.maxHeight;var i=this.measurements.viewportDistance,l=0,n=this.hasBit(t,It.BOTTOM),r=this.hasBit(this.anchorCorner,It.BOTTOM),o=e.numbers.MARGIN_TO_EDGE;return n?(l=i.top+this.anchorMargin.top-o,r||(l+=this.measurements.anchorSize.height)):(l=i.bottom-this.anchorMargin.bottom+this.measurements.anchorSize.height-o,r&&(l-=this.measurements.anchorSize.height)),l},e.prototype.getHorizontalOriginOffset=function(t){var e=this.measurements.anchorSize,i=this.hasBit(t,It.RIGHT),l=this.hasBit(this.anchorCorner,It.RIGHT);if(i){var n=l?e.width-this.anchorMargin.left:this.anchorMargin.right;return this.isHoistedElement||this.isFixedPosition?n-(this.measurements.viewportSize.width-this.measurements.bodySize.width):n}return l?e.width-this.anchorMargin.right:this.anchorMargin.left},e.prototype.getVerticalOriginOffset=function(t){var e=this.measurements.anchorSize,i=this.hasBit(t,It.BOTTOM),l=this.hasBit(this.anchorCorner,It.BOTTOM);return i?l?e.height-this.anchorMargin.top:-this.anchorMargin.bottom:l?e.height+this.anchorMargin.bottom:this.anchorMargin.top},e.prototype.adjustPositionForHoistedElement=function(t){var e,i,l=this.measurements,n=l.windowScroll,r=l.viewportDistance,o=l.surfaceSize,d=l.viewportSize,a=Object.keys(t);try{for(var s=z(a),c=s.next();!c.done;c=s.next()){var m=c.value,h=t[m]||0;!this.isHorizontallyCenteredOnViewport||"left"!==m&&"right"!==m?(h+=r[m],this.isFixedPosition||("top"===m?h+=n.y:"bottom"===m?h-=n.y:"left"===m?h+=n.x:h-=n.x),t[m]=h):t[m]=(d.width-o.width)/2}}catch(t){e={error:t}}finally{try{c&&!c.done&&(i=s.return)&&i.call(s)}finally{if(e)throw e.error}}},e.prototype.maybeRestoreFocus=function(){var t=this,e=this.adapter.isFocused(),i=document.activeElement&&this.adapter.isElementInContainer(document.activeElement);(e||i)&&setTimeout((function(){t.adapter.restoreFocus()}),At.TOUCH_EVENT_WAIT_MS)},e.prototype.hasBit=function(t,e){return Boolean(t&e)},e.prototype.setBit=function(t,e){return t|e},e.prototype.unsetBit=function(t,e){return t^e},e.prototype.isFinite=function(t){return"number"==typeof t&&isFinite(t)},e}(E),zt={animation:{prefixed:"-webkit-animation",standard:"animation"},transform:{prefixed:"-webkit-transform",standard:"transform"},transition:{prefixed:"-webkit-transition",standard:"transition"}};
|
|
137
137
|
/**
|
|
138
138
|
* @license
|
|
139
139
|
* Copyright 2016 Google Inc.
|
|
@@ -178,7 +178,7 @@ var Ot=function(t){function e(i){var l=t.call(this,T(T({},e.defaultAdapter),i))|
|
|
|
178
178
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
179
179
|
* THE SOFTWARE.
|
|
180
180
|
*/
|
|
181
|
-
var St,Rt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return I(e,t),e.attachTo=function(t){return new e(t)},e.prototype.initialSyncWithDOM=function(){var t=this,e=this.root.parentElement;this.anchorElement=e&&e.classList.contains(Et.ANCHOR)?e:null,this.root.classList.contains(Et.FIXED)&&this.setFixedPosition(!0),this.handleKeydown=function(e){t.foundation.handleKeydown(e)},this.handleBodyClick=function(e){t.foundation.handleBodyClick(e)},this.registerBodyClickListener=function(){document.body.addEventListener("click",t.handleBodyClick,{capture:!0})},this.deregisterBodyClickListener=function(){document.body.removeEventListener("click",t.handleBodyClick,{capture:!0})},this.listen("keydown",this.handleKeydown),this.listen(
|
|
181
|
+
var St,Rt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return I(e,t),e.attachTo=function(t){return new e(t)},e.prototype.initialSyncWithDOM=function(){var t=this,e=this.root.parentElement;this.anchorElement=e&&e.classList.contains(Et.ANCHOR)?e:null,this.root.classList.contains(Et.FIXED)&&this.setFixedPosition(!0),this.handleKeydown=function(e){t.foundation.handleKeydown(e)},this.handleBodyClick=function(e){t.foundation.handleBodyClick(e)},this.registerBodyClickListener=function(){document.body.addEventListener("click",t.handleBodyClick,{capture:!0})},this.deregisterBodyClickListener=function(){document.body.removeEventListener("click",t.handleBodyClick,{capture:!0})},this.listen("keydown",this.handleKeydown),this.listen(Ct.OPENED_EVENT,this.registerBodyClickListener),this.listen(Ct.CLOSED_EVENT,this.deregisterBodyClickListener)},e.prototype.destroy=function(){this.unlisten("keydown",this.handleKeydown),this.unlisten(Ct.OPENED_EVENT,this.registerBodyClickListener),this.unlisten(Ct.CLOSED_EVENT,this.deregisterBodyClickListener),t.prototype.destroy.call(this)},e.prototype.isOpen=function(){return this.foundation.isOpen()},e.prototype.open=function(){this.foundation.open()},e.prototype.close=function(t){void 0===t&&(t=!1),this.foundation.close(t)},Object.defineProperty(e.prototype,"quickOpen",{set:function(t){this.foundation.setQuickOpen(t)},enumerable:!1,configurable:!0}),e.prototype.setIsHoisted=function(t){this.foundation.setIsHoisted(t)},e.prototype.setMenuSurfaceAnchorElement=function(t){this.anchorElement=t},e.prototype.setFixedPosition=function(t){t?this.root.classList.add(Et.FIXED):this.root.classList.remove(Et.FIXED),this.foundation.setFixedPosition(t)},e.prototype.setAbsolutePosition=function(t,e){this.foundation.setAbsolutePosition(t,e),this.setIsHoisted(!0)},e.prototype.setAnchorCorner=function(t){this.foundation.setAnchorCorner(t)},e.prototype.setAnchorMargin=function(t){this.foundation.setAnchorMargin(t)},e.prototype.getDefaultFoundation=function(){var t=this;return new Ot({addClass:function(e){return t.root.classList.add(e)},removeClass:function(e){return t.root.classList.remove(e)},hasClass:function(e){return t.root.classList.contains(e)},hasAnchor:function(){return!!t.anchorElement},notifyClose:function(){return t.emit(Ot.strings.CLOSED_EVENT,{})},notifyClosing:function(){t.emit(Ot.strings.CLOSING_EVENT,{})},notifyOpen:function(){return t.emit(Ot.strings.OPENED_EVENT,{})},isElementInContainer:function(e){return t.root.contains(e)},isRtl:function(){return"rtl"===getComputedStyle(t.root).getPropertyValue("direction")},setTransformOrigin:function(e){var i=function(t,e){if(function(t){return Boolean(t.document)&&"function"==typeof t.document.createElement}(t)&&e in zt){var i=t.document.createElement("div"),l=zt[e],n=l.standard;return n in i.style?n:l.prefixed}return e}(window,"transform")+"-origin";t.root.style.setProperty(i,e)},isFocused:function(){return document.activeElement===t.root},saveFocus:function(){t.previousFocus=document.activeElement},restoreFocus:function(){t.root.contains(document.activeElement)&&t.previousFocus&&t.previousFocus.focus&&t.previousFocus.focus()},getInnerDimensions:function(){return{width:t.root.offsetWidth,height:t.root.offsetHeight}},getAnchorDimensions:function(){return t.anchorElement?t.anchorElement.getBoundingClientRect():null},getWindowDimensions:function(){return{width:window.innerWidth,height:window.innerHeight}},getBodyDimensions:function(){return{width:document.body.clientWidth,height:document.body.clientHeight}},getWindowScroll:function(){return{x:window.pageXOffset,y:window.pageYOffset}},setPosition:function(e){var i=t.root;i.style.left="left"in e?e.left+"px":"",i.style.right="right"in e?e.right+"px":"",i.style.top="top"in e?e.top+"px":"",i.style.bottom="bottom"in e?e.bottom+"px":""},setMaxHeight:function(e){t.root.style.maxHeight=e}})},e}(O),Lt={MENU_SELECTED_LIST_ITEM:"mdc-menu-item--selected",MENU_SELECTION_GROUP:"mdc-menu__selection-group",ROOT:"mdc-menu"},Dt={ARIA_CHECKED_ATTR:"aria-checked",ARIA_DISABLED_ATTR:"aria-disabled",CHECKBOX_SELECTOR:'input[type="checkbox"]',LIST_SELECTOR:".mdc-list,.mdc-deprecated-list",SELECTED_EVENT:"MDCMenu:selected",SKIP_RESTORE_FOCUS:"data-menu-item-skip-restore-focus"},jt={FOCUS_ROOT_INDEX:-1};
|
|
182
182
|
/**
|
|
183
183
|
* @license
|
|
184
184
|
* Copyright 2018 Google Inc.
|
|
@@ -223,7 +223,7 @@ var St,Rt=function(t){function e(){return null!==t&&t.apply(this,arguments)||thi
|
|
|
223
223
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
224
224
|
* THE SOFTWARE.
|
|
225
225
|
*/
|
|
226
|
-
var Ft=function(t){function e(i){var l=t.call(this,T(T({},e.defaultAdapter),i))||this;return l.closeAnimationEndTimerId=0,l.defaultFocusState=St.LIST_ROOT,l.selectedIndex=-1,l}return I(e,t),Object.defineProperty(e,"cssClasses",{get:function(){return Lt},enumerable:!1,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return Dt},enumerable:!1,configurable:!0}),Object.defineProperty(e,"numbers",{get:function(){return jt},enumerable:!1,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{addClassToElementAtIndex:function(){},removeClassFromElementAtIndex:function(){},addAttributeToElementAtIndex:function(){},removeAttributeFromElementAtIndex:function(){},getAttributeFromElementAtIndex:function(){return null},elementContainsClass:function(){return!1},closeSurface:function(){},getElementIndex:function(){return-1},notifySelected:function(){},getMenuItemCount:function(){return 0},focusItemAtIndex:function(){},focusListRoot:function(){},getSelectedSiblingOfItemAtIndex:function(){return-1},isSelectableItemAtIndex:function(){return!1}}},enumerable:!1,configurable:!0}),e.prototype.destroy=function(){this.closeAnimationEndTimerId&&clearTimeout(this.closeAnimationEndTimerId),this.adapter.closeSurface()},e.prototype.handleKeydown=function(t){("Tab"===t.key||9===t.keyCode)&&this.adapter.closeSurface(!0)},e.prototype.handleItemAction=function(t){var e=this,i=this.adapter.getElementIndex(t);if(!(i<0)){this.adapter.notifySelected({index:i});var l="true"===this.adapter.getAttributeFromElementAtIndex(i,Dt.SKIP_RESTORE_FOCUS);this.adapter.closeSurface(l),this.closeAnimationEndTimerId=setTimeout((function(){var i=e.adapter.getElementIndex(t);i>=0&&e.adapter.isSelectableItemAtIndex(i)&&e.setSelectedIndex(i)}),Ot.numbers.TRANSITION_CLOSE_DURATION)}},e.prototype.handleMenuSurfaceOpened=function(){switch(this.defaultFocusState){case St.FIRST_ITEM:this.adapter.focusItemAtIndex(0);break;case St.LAST_ITEM:this.adapter.focusItemAtIndex(this.adapter.getMenuItemCount()-1);break;case St.NONE:break;default:this.adapter.focusListRoot()}},e.prototype.setDefaultFocusState=function(t){this.defaultFocusState=t},e.prototype.getSelectedIndex=function(){return this.selectedIndex},e.prototype.setSelectedIndex=function(t){if(this.validatedIndex(t),!this.adapter.isSelectableItemAtIndex(t))throw new Error("MDCMenuFoundation: No selection group at specified index.");var e=this.adapter.getSelectedSiblingOfItemAtIndex(t);e>=0&&(this.adapter.removeAttributeFromElementAtIndex(e,Dt.ARIA_CHECKED_ATTR),this.adapter.removeClassFromElementAtIndex(e,Lt.MENU_SELECTED_LIST_ITEM)),this.adapter.addClassToElementAtIndex(t,Lt.MENU_SELECTED_LIST_ITEM),this.adapter.addAttributeToElementAtIndex(t,Dt.ARIA_CHECKED_ATTR,"true"),this.selectedIndex=t},e.prototype.setEnabled=function(t,e){this.validatedIndex(t),e?(this.adapter.removeClassFromElementAtIndex(t,H.LIST_ITEM_DISABLED_CLASS),this.adapter.addAttributeToElementAtIndex(t,Dt.ARIA_DISABLED_ATTR,"false")):(this.adapter.addClassToElementAtIndex(t,H.LIST_ITEM_DISABLED_CLASS),this.adapter.addAttributeToElementAtIndex(t,Dt.ARIA_DISABLED_ATTR,"true"))},e.prototype.validatedIndex=function(t){var e=this.adapter.getMenuItemCount();if(!(t>=0&&t<e))throw new Error("MDCMenuFoundation: No list item at specified index.")},e}(E),Mt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return I(e,t),e.attachTo=function(t){return new e(t)},e.prototype.initialize=function(t,e){void 0===t&&(t=function(t){return new Rt(t)}),void 0===e&&(e=function(t){return new gt(t)}),this.menuSurfaceFactory=t,this.listFactory=e},e.prototype.initialSyncWithDOM=function(){var t=this;this.menuSurface=this.menuSurfaceFactory(this.root);var e=this.root.querySelector(Dt.LIST_SELECTOR);e?(this.list=this.listFactory(e),this.list.wrapFocus=!0):this.list=null,this.handleKeydown=function(e){t.foundation.handleKeydown(e)},this.handleItemAction=function(e){t.foundation.handleItemAction(t.items[e.detail.index])},this.handleMenuSurfaceOpened=function(){t.foundation.handleMenuSurfaceOpened()},this.menuSurface.listen(Ot.strings.OPENED_EVENT,this.handleMenuSurfaceOpened),this.listen("keydown",this.handleKeydown),this.listen(bt.strings.ACTION_EVENT,this.handleItemAction)},e.prototype.destroy=function(){this.list&&this.list.destroy(),this.menuSurface.destroy(),this.menuSurface.unlisten(Ot.strings.OPENED_EVENT,this.handleMenuSurfaceOpened),this.unlisten("keydown",this.handleKeydown),this.unlisten(bt.strings.ACTION_EVENT,this.handleItemAction),t.prototype.destroy.call(this)},Object.defineProperty(e.prototype,"open",{get:function(){return this.menuSurface.isOpen()},set:function(t){t?this.menuSurface.open():this.menuSurface.close()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"wrapFocus",{get:function(){return!!this.list&&this.list.wrapFocus},set:function(t){this.list&&(this.list.wrapFocus=t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasTypeahead",{set:function(t){this.list&&(this.list.hasTypeahead=t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"typeaheadInProgress",{get:function(){return!!this.list&&this.list.typeaheadInProgress},enumerable:!1,configurable:!0}),e.prototype.typeaheadMatchItem=function(t,e){return this.list?this.list.typeaheadMatchItem(t,e):-1},e.prototype.layout=function(){this.list&&this.list.layout()},Object.defineProperty(e.prototype,"items",{get:function(){return this.list?this.list.listElements:[]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"singleSelection",{set:function(t){this.list&&(this.list.singleSelection=t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"selectedIndex",{get:function(){return this.list?this.list.selectedIndex:K.UNSET_INDEX},set:function(t){this.list&&(this.list.selectedIndex=t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"quickOpen",{set:function(t){this.menuSurface.quickOpen=t},enumerable:!1,configurable:!0}),e.prototype.setDefaultFocusState=function(t){this.foundation.setDefaultFocusState(t)},e.prototype.setAnchorCorner=function(t){this.menuSurface.setAnchorCorner(t)},e.prototype.setAnchorMargin=function(t){this.menuSurface.setAnchorMargin(t)},e.prototype.setSelectedIndex=function(t){this.foundation.setSelectedIndex(t)},e.prototype.setEnabled=function(t,e){this.foundation.setEnabled(t,e)},e.prototype.getOptionByIndex=function(t){return t<this.items.length?this.items[t]:null},e.prototype.getPrimaryTextAtIndex=function(t){var e=this.getOptionByIndex(t);return e&&this.list&&this.list.getPrimaryText(e)||""},e.prototype.setFixedPosition=function(t){this.menuSurface.setFixedPosition(t)},e.prototype.setIsHoisted=function(t){this.menuSurface.setIsHoisted(t)},e.prototype.setAbsolutePosition=function(t,e){this.menuSurface.setAbsolutePosition(t,e)},e.prototype.setAnchorElement=function(t){this.menuSurface.anchorElement=t},e.prototype.getDefaultFoundation=function(){var t=this;return new Ft({addClassToElementAtIndex:function(e,i){t.items[e].classList.add(i)},removeClassFromElementAtIndex:function(e,i){t.items[e].classList.remove(i)},addAttributeToElementAtIndex:function(e,i,l){t.items[e].setAttribute(i,l)},removeAttributeFromElementAtIndex:function(e,i){t.items[e].removeAttribute(i)},getAttributeFromElementAtIndex:function(e,i){return t.items[e].getAttribute(i)},elementContainsClass:function(t,e){return t.classList.contains(e)},closeSurface:function(e){t.menuSurface.close(e)},getElementIndex:function(e){return t.items.indexOf(e)},notifySelected:function(e){t.emit(Dt.SELECTED_EVENT,{index:e.index,item:t.items[e.index]})},getMenuItemCount:function(){return t.items.length},focusItemAtIndex:function(e){t.items[e].focus()},focusListRoot:function(){t.root.querySelector(Dt.LIST_SELECTOR).focus()},isSelectableItemAtIndex:function(e){return!!
|
|
226
|
+
var Ft=function(t){function e(i){var l=t.call(this,T(T({},e.defaultAdapter),i))||this;return l.closeAnimationEndTimerId=0,l.defaultFocusState=St.LIST_ROOT,l.selectedIndex=-1,l}return I(e,t),Object.defineProperty(e,"cssClasses",{get:function(){return Lt},enumerable:!1,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return Dt},enumerable:!1,configurable:!0}),Object.defineProperty(e,"numbers",{get:function(){return jt},enumerable:!1,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{addClassToElementAtIndex:function(){},removeClassFromElementAtIndex:function(){},addAttributeToElementAtIndex:function(){},removeAttributeFromElementAtIndex:function(){},getAttributeFromElementAtIndex:function(){return null},elementContainsClass:function(){return!1},closeSurface:function(){},getElementIndex:function(){return-1},notifySelected:function(){},getMenuItemCount:function(){return 0},focusItemAtIndex:function(){},focusListRoot:function(){},getSelectedSiblingOfItemAtIndex:function(){return-1},isSelectableItemAtIndex:function(){return!1}}},enumerable:!1,configurable:!0}),e.prototype.destroy=function(){this.closeAnimationEndTimerId&&clearTimeout(this.closeAnimationEndTimerId),this.adapter.closeSurface()},e.prototype.handleKeydown=function(t){("Tab"===t.key||9===t.keyCode)&&this.adapter.closeSurface(!0)},e.prototype.handleItemAction=function(t){var e=this,i=this.adapter.getElementIndex(t);if(!(i<0)){this.adapter.notifySelected({index:i});var l="true"===this.adapter.getAttributeFromElementAtIndex(i,Dt.SKIP_RESTORE_FOCUS);this.adapter.closeSurface(l),this.closeAnimationEndTimerId=setTimeout((function(){var i=e.adapter.getElementIndex(t);i>=0&&e.adapter.isSelectableItemAtIndex(i)&&e.setSelectedIndex(i)}),Ot.numbers.TRANSITION_CLOSE_DURATION)}},e.prototype.handleMenuSurfaceOpened=function(){switch(this.defaultFocusState){case St.FIRST_ITEM:this.adapter.focusItemAtIndex(0);break;case St.LAST_ITEM:this.adapter.focusItemAtIndex(this.adapter.getMenuItemCount()-1);break;case St.NONE:break;default:this.adapter.focusListRoot()}},e.prototype.setDefaultFocusState=function(t){this.defaultFocusState=t},e.prototype.getSelectedIndex=function(){return this.selectedIndex},e.prototype.setSelectedIndex=function(t){if(this.validatedIndex(t),!this.adapter.isSelectableItemAtIndex(t))throw new Error("MDCMenuFoundation: No selection group at specified index.");var e=this.adapter.getSelectedSiblingOfItemAtIndex(t);e>=0&&(this.adapter.removeAttributeFromElementAtIndex(e,Dt.ARIA_CHECKED_ATTR),this.adapter.removeClassFromElementAtIndex(e,Lt.MENU_SELECTED_LIST_ITEM)),this.adapter.addClassToElementAtIndex(t,Lt.MENU_SELECTED_LIST_ITEM),this.adapter.addAttributeToElementAtIndex(t,Dt.ARIA_CHECKED_ATTR,"true"),this.selectedIndex=t},e.prototype.setEnabled=function(t,e){this.validatedIndex(t),e?(this.adapter.removeClassFromElementAtIndex(t,H.LIST_ITEM_DISABLED_CLASS),this.adapter.addAttributeToElementAtIndex(t,Dt.ARIA_DISABLED_ATTR,"false")):(this.adapter.addClassToElementAtIndex(t,H.LIST_ITEM_DISABLED_CLASS),this.adapter.addAttributeToElementAtIndex(t,Dt.ARIA_DISABLED_ATTR,"true"))},e.prototype.validatedIndex=function(t){var e=this.adapter.getMenuItemCount();if(!(t>=0&&t<e))throw new Error("MDCMenuFoundation: No list item at specified index.")},e}(E),Mt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return I(e,t),e.attachTo=function(t){return new e(t)},e.prototype.initialize=function(t,e){void 0===t&&(t=function(t){return new Rt(t)}),void 0===e&&(e=function(t){return new gt(t)}),this.menuSurfaceFactory=t,this.listFactory=e},e.prototype.initialSyncWithDOM=function(){var t=this;this.menuSurface=this.menuSurfaceFactory(this.root);var e=this.root.querySelector(Dt.LIST_SELECTOR);e?(this.list=this.listFactory(e),this.list.wrapFocus=!0):this.list=null,this.handleKeydown=function(e){t.foundation.handleKeydown(e)},this.handleItemAction=function(e){t.foundation.handleItemAction(t.items[e.detail.index])},this.handleMenuSurfaceOpened=function(){t.foundation.handleMenuSurfaceOpened()},this.menuSurface.listen(Ot.strings.OPENED_EVENT,this.handleMenuSurfaceOpened),this.listen("keydown",this.handleKeydown),this.listen(bt.strings.ACTION_EVENT,this.handleItemAction)},e.prototype.destroy=function(){this.list&&this.list.destroy(),this.menuSurface.destroy(),this.menuSurface.unlisten(Ot.strings.OPENED_EVENT,this.handleMenuSurfaceOpened),this.unlisten("keydown",this.handleKeydown),this.unlisten(bt.strings.ACTION_EVENT,this.handleItemAction),t.prototype.destroy.call(this)},Object.defineProperty(e.prototype,"open",{get:function(){return this.menuSurface.isOpen()},set:function(t){t?this.menuSurface.open():this.menuSurface.close()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"wrapFocus",{get:function(){return!!this.list&&this.list.wrapFocus},set:function(t){this.list&&(this.list.wrapFocus=t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasTypeahead",{set:function(t){this.list&&(this.list.hasTypeahead=t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"typeaheadInProgress",{get:function(){return!!this.list&&this.list.typeaheadInProgress},enumerable:!1,configurable:!0}),e.prototype.typeaheadMatchItem=function(t,e){return this.list?this.list.typeaheadMatchItem(t,e):-1},e.prototype.layout=function(){this.list&&this.list.layout()},Object.defineProperty(e.prototype,"items",{get:function(){return this.list?this.list.listElements:[]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"singleSelection",{set:function(t){this.list&&(this.list.singleSelection=t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"selectedIndex",{get:function(){return this.list?this.list.selectedIndex:K.UNSET_INDEX},set:function(t){this.list&&(this.list.selectedIndex=t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"quickOpen",{set:function(t){this.menuSurface.quickOpen=t},enumerable:!1,configurable:!0}),e.prototype.setDefaultFocusState=function(t){this.foundation.setDefaultFocusState(t)},e.prototype.setAnchorCorner=function(t){this.menuSurface.setAnchorCorner(t)},e.prototype.setAnchorMargin=function(t){this.menuSurface.setAnchorMargin(t)},e.prototype.setSelectedIndex=function(t){this.foundation.setSelectedIndex(t)},e.prototype.setEnabled=function(t,e){this.foundation.setEnabled(t,e)},e.prototype.getOptionByIndex=function(t){return t<this.items.length?this.items[t]:null},e.prototype.getPrimaryTextAtIndex=function(t){var e=this.getOptionByIndex(t);return e&&this.list&&this.list.getPrimaryText(e)||""},e.prototype.setFixedPosition=function(t){this.menuSurface.setFixedPosition(t)},e.prototype.setIsHoisted=function(t){this.menuSurface.setIsHoisted(t)},e.prototype.setAbsolutePosition=function(t,e){this.menuSurface.setAbsolutePosition(t,e)},e.prototype.setAnchorElement=function(t){this.menuSurface.anchorElement=t},e.prototype.getDefaultFoundation=function(){var t=this;return new Ft({addClassToElementAtIndex:function(e,i){t.items[e].classList.add(i)},removeClassFromElementAtIndex:function(e,i){t.items[e].classList.remove(i)},addAttributeToElementAtIndex:function(e,i,l){t.items[e].setAttribute(i,l)},removeAttributeFromElementAtIndex:function(e,i){t.items[e].removeAttribute(i)},getAttributeFromElementAtIndex:function(e,i){return t.items[e].getAttribute(i)},elementContainsClass:function(t,e){return t.classList.contains(e)},closeSurface:function(e){t.menuSurface.close(e)},getElementIndex:function(e){return t.items.indexOf(e)},notifySelected:function(e){t.emit(Dt.SELECTED_EVENT,{index:e.index,item:t.items[e.index]})},getMenuItemCount:function(){return t.items.length},focusItemAtIndex:function(e){t.items[e].focus()},focusListRoot:function(){t.root.querySelector(Dt.LIST_SELECTOR).focus()},isSelectableItemAtIndex:function(e){return!!A(t.items[e],"."+Lt.MENU_SELECTION_GROUP)},getSelectedSiblingOfItemAtIndex:function(e){var i=A(t.items[e],"."+Lt.MENU_SELECTION_GROUP).querySelector("."+Lt.MENU_SELECTED_LIST_ITEM);return i?t.items.indexOf(i):-1}})},e}(O);
|
|
227
227
|
/**
|
|
228
228
|
* @license
|
|
229
229
|
* Copyright 2018 Google Inc.
|