@limetech/lime-elements 37.12.1 → 37.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (119) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/cjs/{checkbox.template-e7aa89b5.js → checkbox.template-02070306.js} +15 -2
  3. package/dist/cjs/checkbox.template-02070306.js.map +1 -0
  4. package/dist/cjs/dom-ee8ee17d.js +244 -0
  5. package/dist/cjs/dom-ee8ee17d.js.map +1 -0
  6. package/dist/cjs/lime-elements.cjs.js +1 -1
  7. package/dist/cjs/limel-breadcrumbs_3.cjs.entry.js +1 -1
  8. package/dist/cjs/limel-breadcrumbs_3.cjs.entry.js.map +1 -1
  9. package/dist/cjs/limel-checkbox.cjs.entry.js +7 -3
  10. package/dist/cjs/limel-checkbox.cjs.entry.js.map +1 -1
  11. package/dist/cjs/{limel-helper-line.cjs.entry.js → limel-dynamic-label_2.cjs.entry.js} +47 -1
  12. package/dist/cjs/limel-dynamic-label_2.cjs.entry.js.map +1 -0
  13. package/dist/cjs/limel-flatpickr-adapter.cjs.entry.js +5 -1
  14. package/dist/cjs/limel-flatpickr-adapter.cjs.entry.js.map +1 -1
  15. package/dist/cjs/limel-form.cjs.entry.js +6 -3
  16. package/dist/cjs/limel-form.cjs.entry.js.map +1 -1
  17. package/dist/cjs/limel-input-field_3.cjs.entry.js +6 -212
  18. package/dist/cjs/limel-input-field_3.cjs.entry.js.map +1 -1
  19. package/dist/cjs/limel-picker.cjs.entry.js +23 -237
  20. package/dist/cjs/limel-picker.cjs.entry.js.map +1 -1
  21. package/dist/cjs/limel-switch.cjs.entry.js +24 -7
  22. package/dist/cjs/limel-switch.cjs.entry.js.map +1 -1
  23. package/dist/cjs/loader.cjs.js +1 -1
  24. package/dist/collection/collection-manifest.json +1 -0
  25. package/dist/collection/components/checkbox/checkbox.css +0 -24
  26. package/dist/collection/components/checkbox/checkbox.js +33 -1
  27. package/dist/collection/components/checkbox/checkbox.js.map +1 -1
  28. package/dist/collection/components/checkbox/checkbox.template.js +14 -1
  29. package/dist/collection/components/checkbox/checkbox.template.js.map +1 -1
  30. package/dist/collection/components/dynamic-label/dynamic-label.css +84 -0
  31. package/dist/collection/components/dynamic-label/dynamic-label.js +142 -0
  32. package/dist/collection/components/dynamic-label/dynamic-label.js.map +1 -0
  33. package/dist/collection/components/dynamic-label/label.types.js +2 -0
  34. package/dist/collection/components/dynamic-label/label.types.js.map +1 -0
  35. package/dist/collection/components/form/widgets/checkbox.js +6 -3
  36. package/dist/collection/components/form/widgets/checkbox.js.map +1 -1
  37. package/dist/collection/components/list/list.css +0 -48
  38. package/dist/collection/components/menu-list/menu-list.css +0 -52
  39. package/dist/collection/components/picker/picker.js +18 -21
  40. package/dist/collection/components/picker/picker.js.map +1 -1
  41. package/dist/collection/components/switch/switch.css +0 -14
  42. package/dist/collection/components/switch/switch.js +52 -7
  43. package/dist/collection/components/switch/switch.js.map +1 -1
  44. package/dist/collection/interface.js +2 -0
  45. package/dist/collection/interface.js.map +1 -1
  46. package/dist/esm/{checkbox.template-50268c7d.js → checkbox.template-10fda4a9.js} +15 -2
  47. package/dist/esm/checkbox.template-10fda4a9.js.map +1 -0
  48. package/dist/esm/dom-ae531ebc.js +241 -0
  49. package/dist/esm/dom-ae531ebc.js.map +1 -0
  50. package/dist/esm/lime-elements.js +1 -1
  51. package/dist/esm/limel-breadcrumbs_3.entry.js +1 -1
  52. package/dist/esm/limel-breadcrumbs_3.entry.js.map +1 -1
  53. package/dist/esm/limel-checkbox.entry.js +7 -3
  54. package/dist/esm/limel-checkbox.entry.js.map +1 -1
  55. package/dist/esm/{limel-helper-line.entry.js → limel-dynamic-label_2.entry.js} +47 -2
  56. package/dist/esm/limel-dynamic-label_2.entry.js.map +1 -0
  57. package/dist/esm/limel-flatpickr-adapter.entry.js +5 -1
  58. package/dist/esm/limel-flatpickr-adapter.entry.js.map +1 -1
  59. package/dist/esm/limel-form.entry.js +6 -3
  60. package/dist/esm/limel-form.entry.js.map +1 -1
  61. package/dist/esm/limel-input-field_3.entry.js +5 -211
  62. package/dist/esm/limel-input-field_3.entry.js.map +1 -1
  63. package/dist/esm/limel-picker.entry.js +23 -237
  64. package/dist/esm/limel-picker.entry.js.map +1 -1
  65. package/dist/esm/limel-switch.entry.js +25 -8
  66. package/dist/esm/limel-switch.entry.js.map +1 -1
  67. package/dist/esm/loader.js +1 -1
  68. package/dist/lime-elements/lime-elements.esm.js +1 -1
  69. package/dist/lime-elements/lime-elements.esm.js.map +1 -1
  70. package/dist/lime-elements/{p-e5ca6c0c.entry.js → p-20d26cdf.entry.js} +6 -6
  71. package/dist/lime-elements/p-20d26cdf.entry.js.map +1 -0
  72. package/dist/lime-elements/p-714d6937.js +2 -0
  73. package/dist/lime-elements/p-714d6937.js.map +1 -0
  74. package/dist/lime-elements/{p-fb44db4d.entry.js → p-77a07224.entry.js} +2 -2
  75. package/dist/lime-elements/{p-fb44db4d.entry.js.map → p-77a07224.entry.js.map} +1 -1
  76. package/dist/lime-elements/{p-1b4d3901.entry.js → p-932185ef.entry.js} +2 -2
  77. package/dist/lime-elements/{p-1b4d3901.entry.js.map → p-932185ef.entry.js.map} +1 -1
  78. package/dist/lime-elements/p-9468b1b8.entry.js +2 -0
  79. package/dist/lime-elements/p-9468b1b8.entry.js.map +1 -0
  80. package/dist/lime-elements/p-9fd032ca.entry.js +2 -0
  81. package/dist/lime-elements/p-9fd032ca.entry.js.map +1 -0
  82. package/dist/lime-elements/p-a98c3ea7.entry.js +2 -0
  83. package/dist/lime-elements/p-a98c3ea7.entry.js.map +1 -0
  84. package/dist/lime-elements/{p-386d1c5a.entry.js → p-aa8befcd.entry.js} +7 -7
  85. package/dist/lime-elements/p-aa8befcd.entry.js.map +1 -0
  86. package/dist/lime-elements/p-d35e5b2f.js +2 -0
  87. package/dist/lime-elements/p-d35e5b2f.js.map +1 -0
  88. package/dist/lime-elements/p-ffe1fc16.entry.js +68 -0
  89. package/dist/lime-elements/{p-885274d9.entry.js.map → p-ffe1fc16.entry.js.map} +1 -1
  90. package/dist/types/components/checkbox/checkbox.d.ts +8 -0
  91. package/dist/types/components/checkbox/checkbox.template.d.ts +2 -0
  92. package/dist/types/components/dynamic-label/dynamic-label.d.ts +43 -0
  93. package/dist/types/components/dynamic-label/label.types.d.ts +20 -0
  94. package/dist/types/components/picker/picker.d.ts +1 -1
  95. package/dist/types/components/switch/switch.d.ts +9 -1
  96. package/dist/types/components.d.ts +123 -0
  97. package/dist/types/interface.d.ts +3 -1
  98. package/package.json +9 -10
  99. package/dist/cjs/checkbox.template-e7aa89b5.js.map +0 -1
  100. package/dist/cjs/dom-81eaa633.js +0 -34
  101. package/dist/cjs/dom-81eaa633.js.map +0 -1
  102. package/dist/cjs/limel-helper-line.cjs.entry.js.map +0 -1
  103. package/dist/esm/checkbox.template-50268c7d.js.map +0 -1
  104. package/dist/esm/dom-0b0170a0.js +0 -32
  105. package/dist/esm/dom-0b0170a0.js.map +0 -1
  106. package/dist/esm/limel-helper-line.entry.js.map +0 -1
  107. package/dist/lime-elements/p-042e5620.entry.js +0 -16
  108. package/dist/lime-elements/p-042e5620.entry.js.map +0 -1
  109. package/dist/lime-elements/p-27330d1d.entry.js +0 -2
  110. package/dist/lime-elements/p-27330d1d.entry.js.map +0 -1
  111. package/dist/lime-elements/p-386d1c5a.entry.js.map +0 -1
  112. package/dist/lime-elements/p-4015e8e9.entry.js +0 -2
  113. package/dist/lime-elements/p-4015e8e9.entry.js.map +0 -1
  114. package/dist/lime-elements/p-5e7b7b03.js +0 -2
  115. package/dist/lime-elements/p-5e7b7b03.js.map +0 -1
  116. package/dist/lime-elements/p-61aa37de.js +0 -2
  117. package/dist/lime-elements/p-61aa37de.js.map +0 -1
  118. package/dist/lime-elements/p-885274d9.entry.js +0 -68
  119. package/dist/lime-elements/p-e5ca6c0c.entry.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"names":["dist","debounce","fn","wait","arguments","length","undefined","options","lastCallAt","deferred","timer","pendingArgs","debounced","currentWait","getWait","currentTime","Date","getTime","isCold","_len","args","Array","_key","leading","accumulate","Promise","resolve","call","this","then","result","apply","concat","clearTimeout","defer","push","setTimeout","flush","bind","argsIndex","promise","results","thisDeferred","reject","createImperativePromise","promiseArg","wrappedPromise","_resolve","_reject","val","error","value","reason","cancel","onlyResolvesLast","asyncFunction","cancelPrevious","wrappedFunction","_i","initialPromise","_a","__assign","Object","assign","t","s","i","n","p","prototype","hasOwnProperty","DefaultOptions","key","_args","DebounceCache","config","debounceSingleton","debounceCache","_createDebouncedFunction","debouncedFunc","DebouncePromise","func","getDebouncedFunction","AwesomeDebouncePromise","finalOptions","AwesomeDebouncePromiseWrapper","debouncedFn","pickerCss","SEARCH_DEBOUNCE","CHIP_SET_TAG_NAME","Picker","constructor","hostRef","chipSetEditMode","getValueId","item","id","createChips","multiple","listItems","map","createChip","listItem","name","getIconName","icon","color","getIconFillColor","iconColor","valueId","text","removable","handleTextInput","handleInputKeyDown","handleDropdownKeyDown","handleInputFieldFocus","handleChange","handleInteract","handleListChange","handleActionListChange","handleStopEditAndBlur","createDebouncedSearcher","handleCloseMenu","onListKeyDown","portalId","createRandomString","componentWillLoad","chips","componentDidLoad","searcher","chipSet","host","shadowRoot","querySelector","async","getEditMode","render","props","maxItems","h","type","inputType","label","helperText","leadingIcon","disabled","invalid","delimiter","renderDelimiter","readonly","required","searchLabel","onInput","onKeyDown","onChange","onInteract","onStartEdit","onStopEdit","emptyInputOnBlur","clearAllButton","renderDropdown","onChangeValue","newValue","debouncedSearch","dropDownContent","getDropdownContent","content","shouldShowDropDownContent","actionContent","getActionContent","actionPosition","renderPortal","actionCount","_b","actions","class","actionScrollBehavior","badgeIcons","items","removeUnusedPropertiesOnAction","action","isFull","loading","renderSpinner","renderEmptyMessage","renderListResult","style","width","display","padding","limeBranded","emptyResultMessage","margin","event","keyFound","TAB","ESCAPE","ENTER","includes","keyCodeFound","TAB_KEY_CODE","ESCAPE_KEY_CODE","ENTER_KEY_CODE","keyCode","setFocus","dropdownZIndex","getComputedStyle","getPropertyValue","visible","containerId","inheritParentWidth","containerStyle","open","allowClicksElement","onDismiss","element","activeElement","document","portalElement","isDescendant","clearInputField","stopPropagation","query","detail","textValue","searchFn","handleSearchResult","change","emit","chip","find","interact","isForwardTab","altKey","metaKey","shiftKey","isUp","ARROW_UP","ARROW_UP_KEY_CODE","isDown","ARROW_DOWN","ARROW_DOWN_KEY_CODE","list","preventDefault","listElement","focus","isEscape","values","filter","emptyInput"],"sources":["./node_modules/debounce-promise/dist/index.js","./node_modules/awesome-imperative-promise/dist/index.es.js","./node_modules/awesome-only-resolves-last-promise/dist/index.es.js","./node_modules/awesome-debounce-promise/dist/index.es.js","./src/components/picker/picker.scss?tag=limel-picker&encapsulation=shadow","./src/components/picker/picker.tsx"],"sourcesContent":["'use strict';\n\n/* global setTimeout, clearTimeout */\n\nmodule.exports = function debounce(fn) {\n var wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\n var lastCallAt = void 0;\n var deferred = void 0;\n var timer = void 0;\n var pendingArgs = [];\n return function debounced() {\n var currentWait = getWait(wait);\n var currentTime = new Date().getTime();\n\n var isCold = !lastCallAt || currentTime - lastCallAt > currentWait;\n\n lastCallAt = currentTime;\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n if (isCold && options.leading) {\n return options.accumulate ? Promise.resolve(fn.call(this, [args])).then(function (result) {\n return result[0];\n }) : Promise.resolve(fn.call.apply(fn, [this].concat(args)));\n }\n\n if (deferred) {\n clearTimeout(timer);\n } else {\n deferred = defer();\n }\n\n pendingArgs.push(args);\n timer = setTimeout(flush.bind(this), currentWait);\n\n if (options.accumulate) {\n var argsIndex = pendingArgs.length - 1;\n return deferred.promise.then(function (results) {\n return results[argsIndex];\n });\n }\n\n return deferred.promise;\n };\n\n function flush() {\n var thisDeferred = deferred;\n clearTimeout(timer);\n\n Promise.resolve(options.accumulate ? fn.call(this, pendingArgs) : fn.apply(this, pendingArgs[pendingArgs.length - 1])).then(thisDeferred.resolve, thisDeferred.reject);\n\n pendingArgs = [];\n deferred = null;\n }\n};\n\nfunction getWait(wait) {\n return typeof wait === 'function' ? wait() : wait;\n}\n\nfunction defer() {\n var deferred = {};\n deferred.promise = new Promise(function (resolve, reject) {\n deferred.resolve = resolve;\n deferred.reject = reject;\n });\n return deferred;\n}\n//# sourceMappingURL=index.js.map","function createImperativePromise(promiseArg) {\r\n var resolve = null;\r\n var reject = null;\r\n var wrappedPromise = new Promise(function (_resolve, _reject) {\r\n resolve = _resolve;\r\n reject = _reject;\r\n });\r\n promiseArg && promiseArg.then(function (val) {\r\n resolve && resolve(val);\r\n }, function (error) {\r\n reject && reject(error);\r\n });\r\n return {\r\n promise: wrappedPromise,\r\n resolve: function (value) {\r\n resolve && resolve(value);\r\n },\r\n reject: function (reason) {\r\n reject && reject(reason);\r\n },\r\n cancel: function () {\r\n resolve = null;\r\n reject = null;\r\n }\r\n };\r\n}\n\nexport { createImperativePromise };\n//# sourceMappingURL=index.es.js.map\n","import { createImperativePromise } from 'awesome-imperative-promise';\n\n// see https://stackoverflow.com/a/54825370/82609\r\nfunction onlyResolvesLast(asyncFunction) {\r\n var cancelPrevious = null;\r\n var wrappedFunction = function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n cancelPrevious && cancelPrevious();\r\n var initialPromise = asyncFunction.apply(void 0, args);\r\n var _a = createImperativePromise(initialPromise), promise = _a.promise, cancel = _a.cancel;\r\n cancelPrevious = cancel;\r\n return promise;\r\n };\r\n return wrappedFunction; // TODO fix TS\r\n}\n\nexport { onlyResolvesLast };\n//# sourceMappingURL=index.es.js.map\n","import DebouncePromise from 'debounce-promise';\nimport { onlyResolvesLast } from 'awesome-only-resolves-last-promise';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n\r\nvar __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n };\r\n return __assign.apply(this, arguments);\r\n};\n\nvar DefaultOptions = {\r\n // One distinct debounced function is created per key and added to an internal cache\r\n // By default, the key is null, which means that all the calls\r\n // will share the same debounced function\r\n key: function () {\r\n var _args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n _args[_i] = arguments[_i];\r\n }\r\n return null;\r\n },\r\n // By default, a debounced function will only resolve\r\n // the last promise it returned\r\n // Former calls will stay unresolved, so that you don't have\r\n // to handle concurrency issues in your code\r\n // Setting this to false means all returned promises will resolve to the last result\r\n onlyResolvesLast: true,\r\n};\r\n// We create a debouncing function cache, because when wrapping the original function,\r\n// we may actually want to route the function call to different debounced functions depending function paameters\r\nvar DebounceCache = /** @class */ (function () {\r\n function DebounceCache(config) {\r\n this.config = config;\r\n this.debounceSingleton = null;\r\n this.debounceCache = {}; // when key feature is used\r\n }\r\n DebounceCache.prototype._createDebouncedFunction = function () {\r\n var debouncedFunc = DebouncePromise(this.config.func, this.config.wait, this.config.options); // TODO TS\r\n if (this.config.options.onlyResolvesLast) {\r\n debouncedFunc = onlyResolvesLast(debouncedFunc);\r\n }\r\n return {\r\n func: debouncedFunc,\r\n };\r\n };\r\n DebounceCache.prototype.getDebouncedFunction = function (args) {\r\n var _a;\r\n var key = (_a = this.config.options).key.apply(_a, args);\r\n if (key === null || typeof key === 'undefined') {\r\n if (!this.debounceSingleton) {\r\n this.debounceSingleton = this._createDebouncedFunction();\r\n }\r\n return this.debounceSingleton;\r\n }\r\n else {\r\n if (!this.debounceCache[key]) {\r\n this.debounceCache[key] = this._createDebouncedFunction();\r\n }\r\n return this.debounceCache[key];\r\n }\r\n };\r\n return DebounceCache;\r\n}());\r\nfunction AwesomeDebouncePromise(func, wait, options) {\r\n var finalOptions = __assign({}, DefaultOptions, options);\r\n var debounceCache = new DebounceCache({\r\n func: func,\r\n wait: wait,\r\n options: finalOptions,\r\n });\r\n var AwesomeDebouncePromiseWrapper = (function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n var debouncedFn = debounceCache.getDebouncedFunction(args).func;\r\n return debouncedFn.apply(void 0, args);\r\n }); // TODO fix TS\r\n /*\r\n AwesomeDebouncePromiseWrapper.cancel = (key?: string) => {\r\n \n };\r\n */\r\n return AwesomeDebouncePromiseWrapper;\r\n}\n\nexport default AwesomeDebouncePromise;\n//# sourceMappingURL=index.es.js.map\n","// Note! The `--dropdown-z-index` property is used from `picker.tsx`.\n/**\n * @prop --dropdown-z-index: z-index of the dropdown menu.\n */\n\n:host {\n position: relative;\n display: block;\n}\n\n:host([hidden]) {\n display: none;\n}\n","import { Action } from '../collapsible-section/action';\nimport { ActionPosition, ActionScrollBehavior } from '../picker/actions.types';\nimport { Chip } from '../chip-set/chip.types';\nimport { ListItem } from '../list/list-item.types';\nimport { Searcher } from '../picker/searcher.types';\nimport {\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Prop,\n State,\n Watch,\n} from '@stencil/core';\nimport AwesomeDebouncePromise from 'awesome-debounce-promise';\nimport { isDescendant } from '../../util/dom';\nimport {\n ARROW_DOWN,\n ARROW_DOWN_KEY_CODE,\n ARROW_UP,\n ARROW_UP_KEY_CODE,\n ENTER,\n ENTER_KEY_CODE,\n ESCAPE,\n ESCAPE_KEY_CODE,\n TAB,\n TAB_KEY_CODE,\n} from '../../util/keycodes';\nimport { createRandomString } from '../../util/random-string';\nimport {\n LimelChipSetCustomEvent,\n LimelListCustomEvent,\n} from '../../components';\nimport { getIconFillColor, getIconName } from '../icon/get-icon-props';\nimport { PickerValue } from './value.types';\n\nconst SEARCH_DEBOUNCE = 500;\nconst CHIP_SET_TAG_NAME = 'limel-chip-set';\n\n/**\n * @exampleComponent limel-example-picker-single\n * @exampleComponent limel-example-picker-multiple\n * @exampleComponent limel-example-picker-icons\n * @exampleComponent limel-example-picker-value-as-object\n * @exampleComponent limel-example-picker-empty-suggestions\n * @exampleComponent limel-example-picker-leading-icon\n * @exampleComponent limel-example-picker-static-actions\n * @exampleComponent limel-example-picker-composite\n */\n@Component({\n tag: 'limel-picker',\n shadow: true,\n styleUrl: 'picker.scss',\n})\nexport class Picker {\n /**\n * True if the picker should be disabled\n */\n @Prop()\n public disabled: boolean = false;\n\n /**\n * Set to `true` to disable adding and removing items,\n * but allow interaction with existing items.\n */\n @Prop({ reflect: true })\n public readonly: boolean = false;\n\n /**\n * Text to display for the input field of the picker\n */\n @Prop()\n public label: string;\n\n /**\n * Search label to display in the input field when searching\n */\n @Prop()\n public searchLabel: string;\n\n /**\n * Optional helper text to display below the input field when it has focus\n */\n @Prop({ reflect: true })\n public helperText: string;\n\n /**\n * Leading icon to show to the far left in the text field\n */\n @Prop()\n public leadingIcon: string;\n\n /**\n * A message to display when the search returned an empty result\n */\n @Prop()\n public emptyResultMessage: string;\n\n /**\n * True if the control requires a value\n */\n @Prop()\n public required: boolean = false;\n\n /**\n * Set to `true` to indicate that the current value of the input field is\n * invalid.\n */\n @Prop({ reflect: true })\n public invalid = false;\n\n /**\n * Currently selected value or values. Where the value can be an object.\n */\n @Prop()\n public value: ListItem<PickerValue> | Array<ListItem<PickerValue>>;\n\n /**\n * A search function that takes a search-string as an argument,\n * and returns a promise that will eventually be resolved with\n * an array of `ListItem`:s.\n *\n * See the docs for the type `Searcher` for type information on\n * the searcher function itself.\n */\n @Prop()\n public searcher: Searcher;\n\n /**\n * True if multiple values are allowed\n */\n @Prop()\n public multiple: boolean = false;\n\n /**\n * Sets delimiters between chips. Works only when `multiple` is `true`.\n */\n @Prop({ reflect: true })\n public delimiter: string = null;\n\n /**\n * Static actions that can be clicked by the user.\n */\n @Prop()\n public actions: Array<ListItem<Action>> = [];\n\n /**\n * Position of the custom static actions in the picker's results dropdown.\n * Can be set to `'top'` or `'bottom'`.\n */\n @Prop()\n public actionPosition: ActionPosition = 'bottom';\n\n /**\n * Scroll behavior of the custom static actions, when user scrolls\n * in the picker's results dropdown. Can be set to `'scroll'` which means\n * the action items will scroll together with the list, or `'sticky'` which\n * retains their position at the top or bottom of the drop down while\n * scrolling.\n */\n @Prop()\n public actionScrollBehavior: ActionScrollBehavior = 'sticky';\n\n /**\n * Whether badge icons should be used in the result list or not\n */\n @Prop({ reflect: true })\n public badgeIcons: boolean = false;\n\n /**\n * Fired when a new value has been selected from the picker\n */\n @Event()\n private change: EventEmitter<\n ListItem<PickerValue> | Array<ListItem<PickerValue>>\n >;\n\n /**\n * Fired when clicking on a selected value\n */\n @Event()\n private interact: EventEmitter<ListItem<PickerValue>>;\n\n /**\n * Emitted when the user selects an action.\n */\n @Event()\n private action: EventEmitter<Action>;\n\n @State()\n private items: Array<ListItem<number | string>>;\n\n @State()\n private textValue: string = '';\n\n @State()\n private loading: boolean = false;\n\n @State()\n private chips: Chip[] = [];\n\n @Element()\n private host: HTMLLimelPickerElement;\n\n // Should NOT be decorated with State(), since this\n // should not trigger a re-render by itself.\n private chipSetEditMode = false;\n\n private debouncedSearch: Searcher;\n private chipSet: HTMLLimelChipSetElement;\n private portalId: string;\n\n constructor() {\n this.handleTextInput = this.handleTextInput.bind(this);\n this.handleInputKeyDown = this.handleInputKeyDown.bind(this);\n this.handleDropdownKeyDown = this.handleDropdownKeyDown.bind(this);\n this.handleInputFieldFocus = this.handleInputFieldFocus.bind(this);\n this.handleChange = this.handleChange.bind(this);\n this.handleInteract = this.handleInteract.bind(this);\n this.handleListChange = this.handleListChange.bind(this);\n this.handleActionListChange = this.handleActionListChange.bind(this);\n this.handleStopEditAndBlur = this.handleStopEditAndBlur.bind(this);\n this.createDebouncedSearcher = this.createDebouncedSearcher.bind(this);\n this.handleCloseMenu = this.handleCloseMenu.bind(this);\n this.onListKeyDown = this.onListKeyDown.bind(this);\n\n this.portalId = createRandomString();\n }\n\n public componentWillLoad() {\n this.chips = this.createChips(this.value);\n }\n\n public componentDidLoad() {\n this.createDebouncedSearcher(this.searcher);\n this.chipSet = this.host.shadowRoot.querySelector(CHIP_SET_TAG_NAME);\n }\n\n public async componentWillUpdate() {\n this.chipSetEditMode = false;\n if (this.chipSet) {\n this.chipSetEditMode = await this.chipSet.getEditMode();\n }\n }\n\n public render() {\n const props: {\n maxItems?: number;\n } = {};\n\n if (!this.multiple) {\n props.maxItems = 1;\n }\n\n return [\n <limel-chip-set\n type=\"input\"\n inputType=\"search\"\n label={this.label}\n helperText={this.helperText}\n leadingIcon={this.leadingIcon}\n value={this.chips}\n disabled={this.disabled}\n invalid={this.invalid}\n delimiter={this.renderDelimiter()}\n readonly={this.readonly}\n required={this.required}\n searchLabel={this.searchLabel}\n onInput={this.handleTextInput}\n onKeyDown={this.handleInputKeyDown}\n onChange={this.handleChange}\n onInteract={this.handleInteract}\n onStartEdit={this.handleInputFieldFocus}\n onStopEdit={this.handleStopEditAndBlur}\n emptyInputOnBlur={false}\n clearAllButton={this.multiple && !this.chipSetEditMode}\n {...props}\n />,\n this.renderDropdown(),\n ];\n }\n\n @Watch('value')\n protected onChangeValue() {\n this.chips = this.createChips(this.value);\n }\n\n @Watch('searcher')\n protected createDebouncedSearcher(newValue: Searcher) {\n if (typeof newValue !== 'function') {\n return;\n }\n\n this.debouncedSearch = AwesomeDebouncePromise(\n newValue,\n SEARCH_DEBOUNCE,\n );\n }\n\n private renderDelimiter() {\n if (this.multiple) {\n return this.delimiter;\n }\n\n return null;\n }\n\n private getValueId = (item: ListItem) => {\n const value = item.value;\n if (!!value && typeof value === 'object') {\n return value.id;\n }\n\n return value;\n };\n\n private createChips = (value: ListItem | ListItem[]): Chip[] => {\n if (!value) {\n return [];\n }\n\n if (this.multiple) {\n const listItems: ListItem[] = value as ListItem[];\n\n return listItems.map(this.createChip);\n }\n\n const listItem: ListItem = value as ListItem;\n\n return [this.createChip(listItem)];\n };\n\n private createChip = (listItem: ListItem): Chip => {\n const name = getIconName(listItem.icon);\n const color = getIconFillColor(listItem.icon, listItem.iconColor);\n const valueId = this.getValueId(listItem);\n\n return {\n id: `${valueId}`,\n text: listItem.text,\n removable: true,\n icon: name ? { name: name, color: color } : undefined,\n value: listItem,\n };\n };\n\n /**\n * Renders the dropdown with the items to pick from, or a spinner if the picker\n * is waiting for items to be received\n *\n * @returns picker dropdown\n */\n private renderDropdown() {\n const dropDownContent = this.getDropdownContent();\n\n const content = [];\n\n if (this.shouldShowDropDownContent()) {\n const actionContent = this.getActionContent();\n if (this.actionPosition === 'top') {\n content.push(actionContent);\n }\n\n if (dropDownContent) {\n content.push(dropDownContent);\n }\n\n if (this.actionPosition === 'bottom') {\n content.push(actionContent);\n }\n }\n\n return this.renderPortal(content);\n }\n\n private getActionContent() {\n const actionCount = this.actions?.length ?? 0;\n if (actionCount === 0) {\n return null;\n }\n\n return [\n <limel-list\n class={{\n 'static-actions-list': true,\n 'is-on-top': this.actionPosition === 'top',\n 'is-at-bottom': this.actionPosition === 'bottom',\n 'has-position-sticky':\n this.actionScrollBehavior === 'sticky',\n }}\n badgeIcons={true}\n type={'selectable'}\n onChange={this.handleActionListChange}\n items={this.actions.map(this.removeUnusedPropertiesOnAction)}\n />,\n ];\n }\n\n private removeUnusedPropertiesOnAction(\n action: ListItem<Action>,\n ): ListItem<Action> {\n return {\n ...action,\n actions: [],\n };\n }\n\n private shouldShowDropDownContent() {\n if (this.isFull()) {\n return false;\n }\n\n return !!this.chipSetEditMode;\n }\n\n private getDropdownContent() {\n if (!this.shouldShowDropDownContent()) {\n return;\n }\n\n if (this.loading) {\n return this.renderSpinner();\n }\n\n if (!this.items || !this.items.length) {\n return this.renderEmptyMessage();\n }\n\n return this.renderListResult();\n }\n\n /**\n * Returns true if the picker is \"full\"\n * The picker is considered to be full if it has a value and only one is allowed\n *\n * @returns true if the picker is full\n */\n private isFull(): boolean {\n return !this.multiple && !!this.value;\n }\n\n private renderSpinner() {\n return (\n <div\n style={{\n width: '100%',\n display: 'flex',\n 'align-items': 'center',\n 'justify-content': 'center',\n padding: '1rem 0',\n }}\n >\n <limel-spinner limeBranded={false} />\n </div>\n );\n }\n\n private renderEmptyMessage() {\n if (!this.emptyResultMessage) {\n return;\n }\n\n const style = {\n color: 'rgb(var(--contrast-1100))',\n 'text-align': 'center',\n margin: '0.5rem 1rem',\n };\n\n return <p style={style}>{this.emptyResultMessage}</p>;\n }\n\n private renderListResult() {\n return (\n <limel-list\n badgeIcons={this.badgeIcons}\n onChange={this.handleListChange}\n onKeyDown={this.onListKeyDown}\n type=\"selectable\"\n items={this.items}\n />\n );\n }\n\n private onListKeyDown(event: KeyboardEvent) {\n const keyFound = [TAB, ESCAPE, ENTER].includes(event.key);\n const keyCodeFound = [\n TAB_KEY_CODE,\n ESCAPE_KEY_CODE,\n ENTER_KEY_CODE,\n ].includes(event.keyCode);\n if (keyFound || keyCodeFound) {\n this.chipSet.setFocus();\n }\n }\n\n private renderPortal(content: any[] = []) {\n const dropdownZIndex = getComputedStyle(this.host).getPropertyValue(\n '--dropdown-z-index',\n );\n\n return (\n <limel-portal\n visible={content.length > 0}\n containerId={this.portalId}\n inheritParentWidth={true}\n containerStyle={{ 'z-index': dropdownZIndex }}\n >\n <limel-menu-surface\n open={content.length > 0}\n allowClicksElement={this.host}\n style={{\n '--mdc-menu-min-width': '100%',\n 'max-height': 'inherit',\n display: 'flex',\n }}\n onDismiss={this.handleCloseMenu}\n >\n {content}\n </limel-menu-surface>\n </limel-portal>\n );\n }\n\n /**\n * Check if a descendant still has focus. If not, reset text value and search result.\n */\n private handleStopEditAndBlur() {\n // In browsers where shadow DOM is not supported activeElement on shadowRoot will return null\n // However, document.activeElement will return the actual focused element instead of the outermost shadow host\n const element =\n this.host.shadowRoot.activeElement || document.activeElement;\n const portalElement = document.querySelector(`#${this.portalId}`);\n if (\n isDescendant(element as HTMLElement, this.host) ||\n isDescendant(element as HTMLElement, portalElement as HTMLElement)\n ) {\n return;\n }\n\n this.clearInputField();\n }\n\n /**\n * Input handler for the input field\n *\n * @param event - event\n */\n private async handleTextInput(event) {\n event.stopPropagation();\n\n const query = event.detail;\n this.textValue = query;\n this.loading = true;\n\n // If the search-query is an empty string, bypass debouncing.\n const searchFn = query === '' ? this.searcher : this.debouncedSearch;\n const result = (await searchFn(query)) as Array<ListItem<PickerValue>>;\n this.handleSearchResult(query, result);\n }\n\n /**\n * Change handler for the list\n *\n * @param event - event\n */\n private handleListChange(\n event: LimelListCustomEvent<ListItem<PickerValue>>,\n ) {\n event.stopPropagation();\n if (!this.value || this.value !== event.detail) {\n let newValue: ListItem<PickerValue> | Array<ListItem<PickerValue>> =\n event.detail;\n if (this.multiple) {\n newValue = [\n ...(this.value as Array<ListItem<PickerValue>>),\n event.detail,\n ];\n }\n\n this.change.emit(newValue);\n this.items = [];\n }\n\n if (this.multiple) {\n this.chipSet?.setFocus(true);\n }\n }\n\n /**\n * Change handler for the list\n *\n * @param event - event\n */\n private handleActionListChange(\n event: LimelListCustomEvent<ListItem<Action>>,\n ) {\n event.stopPropagation();\n if (!event.detail) {\n return;\n }\n\n this.action.emit(event.detail.value);\n this.items = [];\n }\n\n /**\n * Focus handler for the chip set\n * Prevent focus if the picker has a value and does not support multiple values\n */\n private async handleInputFieldFocus() {\n this.loading = true;\n const query = this.textValue;\n const result = (await this.searcher(query)) as Array<\n ListItem<PickerValue>\n >;\n this.handleSearchResult(query, result);\n }\n\n private handleChange(event: LimelChipSetCustomEvent<Chip | Chip[]>) {\n event.stopPropagation();\n\n let newValue = null;\n if (this.multiple) {\n const chips = event.detail as Chip[];\n newValue = chips.map((chip) => {\n return (this.value as ListItem[]).find((item) => {\n const valueId = this.getValueId(item);\n\n return `${valueId}` === chip.id;\n });\n });\n }\n\n this.change.emit(newValue);\n }\n\n private handleInteract(event: LimelChipSetCustomEvent<Chip>) {\n event.stopPropagation();\n this.interact.emit(event.detail ? event.detail.value : event.detail);\n }\n\n /**\n * Key handler for the input field\n * Will change focus to the first/last item in the dropdown list to enable selection with the keyboard\n *\n * @param event - event\n */\n private handleInputKeyDown(event: KeyboardEvent) {\n const isForwardTab =\n (event.key === TAB || event.keyCode === TAB_KEY_CODE) &&\n !event.altKey &&\n !event.metaKey &&\n !event.shiftKey;\n const isUp =\n event.key === ARROW_UP || event.keyCode === ARROW_UP_KEY_CODE;\n const isDown =\n event.key === ARROW_DOWN || event.keyCode === ARROW_DOWN_KEY_CODE;\n\n if (!isForwardTab && !isUp && !isDown) {\n return;\n }\n\n const list = document.querySelector(` #${this.portalId} limel-list`);\n if (!list) {\n return;\n }\n\n event.preventDefault();\n\n if (isForwardTab || isDown) {\n const listElement: HTMLElement = list.shadowRoot.querySelector(\n '.mdc-deprecated-list-item:first-child',\n );\n listElement.focus();\n\n return;\n }\n\n if (isUp) {\n const listElement: HTMLElement = list.shadowRoot.querySelector(\n '.mdc-deprecated-list-item:last-child',\n );\n listElement.focus();\n }\n }\n\n /**\n * Key handler for the dropdown\n *\n * @param event - event\n */\n private handleDropdownKeyDown(event: KeyboardEvent) {\n const isEscape =\n event.key === ESCAPE || event.keyCode === ESCAPE_KEY_CODE;\n\n if (isEscape) {\n event.preventDefault();\n this.textValue = '';\n this.chipSet.setFocus(true);\n }\n }\n\n private handleSearchResult(query: string, result: ListItem[]) {\n if (query === this.textValue) {\n this.items = result;\n if (this.multiple) {\n const values = this.value as ListItem[];\n this.items = result.filter((item) => {\n return !values.includes(item);\n });\n }\n\n this.loading = false;\n }\n }\n\n private handleCloseMenu() {\n if (this.items.length > 0) {\n return;\n }\n\n this.clearInputField();\n }\n\n private clearInputField() {\n this.chipSet.emptyInput();\n this.textValue = '';\n this.handleSearchResult('', []);\n }\n}\n"],"mappings":"+QAIA,IAAAA,EAAiB,SAASC,EAASC,GACjC,IAAIC,EAAOC,UAAUC,OAAS,GAAKD,UAAU,KAAOE,UAAYF,UAAU,GAAK,EAC/E,IAAIG,EAAUH,UAAUC,OAAS,GAAKD,UAAU,KAAOE,UAAYF,UAAU,GAAK,GAElF,IAAII,OAAkB,EACtB,IAAIC,OAAgB,EACpB,IAAIC,OAAa,EACjB,IAAIC,EAAc,GAClB,OAAO,SAASC,IACd,IAAIC,EAAcC,EAAQX,GAC1B,IAAIY,GAAc,IAAIC,MAAOC,UAE7B,IAAIC,GAAUV,GAAcO,EAAcP,EAAaK,EAEvDL,EAAaO,EAEb,IAAK,IAAII,EAAOf,UAAUC,OAAQe,EAAOC,MAAMF,GAAOG,EAAO,EAAGA,EAAOH,EAAMG,IAAQ,CACnFF,EAAKE,GAAQlB,UAAUkB,EAC7B,CAEI,GAAIJ,GAAUX,EAAQgB,QAAS,CAC7B,OAAOhB,EAAQiB,WAAaC,QAAQC,QAAQxB,EAAGyB,KAAKC,KAAM,CAACR,KAAQS,MAAK,SAAUC,GAChF,OAAOA,EAAO,EACtB,IAAWL,QAAQC,QAAQxB,EAAGyB,KAAKI,MAAM7B,EAAI,CAAC0B,MAAMI,OAAOZ,IAC3D,CAEI,GAAIX,EAAU,CACZwB,aAAavB,EACnB,KAAW,CACLD,EAAWyB,GACjB,CAEIvB,EAAYwB,KAAKf,GACjBV,EAAQ0B,WAAWC,EAAMC,KAAKV,MAAOf,GAErC,GAAIN,EAAQiB,WAAY,CACtB,IAAIe,EAAY5B,EAAYN,OAAS,EACrC,OAAOI,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OzB,SAASpF,cAAc,KAAKzG,KAAKgG,uBAC9C,IAAKsH,EAAM,CACP,M,CAGJjD,EAAMkD,iBAEN,GAAIX,GAAgBO,EAAQ,CACxB,MAAMK,EAA2BF,EAAK9G,WAAWC,cAC7C,yCAEJ+G,EAAYC,QAEZ,M,CAGJ,GAAIT,EAAM,CACN,MAAMQ,EAA2BF,EAAK9G,WAAWC,cAC7C,wCAEJ+G,EAAYC,O,EASZnI,sBAAsB+E,GAC1B,MAAMqD,EACFrD,EAAMzH,MAAQ4H,GAAUH,EAAMU,UAAYF,EAE9C,GAAI6C,EAAU,CACVrD,EAAMkD,iBACNvN,KAAKoM,UAAY,GACjBpM,KAAKsG,QAAQ0E,SAAS,K,EAItBsB,mBAAmBJ,EAAehM,GACtC,GAAIgM,IAAUlM,KAAKoM,UAAW,CAC1BpM,KAAKsJ,MAAQpJ,EACb,GAAIF,KAAKsE,SAAU,CACf,MAAMqJ,EAAS3N,KAAKuB,MACpBvB,KAAKsJ,MAAQpJ,EAAO0N,QAAQzJ,IAChBwJ,EAAOjD,SAASvG,I,CAIhCnE,KAAK0J,QAAU,K,EAIf5D,kBACJ,GAAI9F,KAAKsJ,MAAM7K,OAAS,EAAG,CACvB,M,CAGJuB,KAAKgM,iB,CAGDA,kBACJhM,KAAKsG,QAAQuH,aACb7N,KAAKoM,UAAY,GACjBpM,KAAKsM,mBAAmB,GAAI,G"}
@@ -1,2 +0,0 @@
1
- import{r as e,h as i,H as t}from"./p-3075aa67.js";const s=":host(limel-helper-line){transition:opacity 0.2s ease;box-sizing:border-box;display:grid;min-width:0;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-size:0.6875rem;line-height:normal;color:rgb(var(--contrast-1200))}div{display:flex;justify-content:space-between;gap:0.75rem;overflow:hidden;padding:0 1rem}:host(limel-helper-line.invalid) .helper-text{color:var(--mdc-theme-error)}.counter{flex-shrink:0;margin-left:auto}.helper-text,.counter{padding-top:0.125rem}:host(limel-helper-line){transition:grid-template-rows var(--limel-h-l-grid-template-rows-transition-speed, 0.46s) cubic-bezier(1, 0.09, 0, 0.89);grid-template-rows:var(--limel-h-l-grid-template-rows, 1fr)}:host(limel-helper-line.hide){--limel-h-l-grid-template-rows-transition-speed:0.3s;--limel-h-l-grid-template-rows:0fr}";const r=class{constructor(t){e(this,t);this.hasContent=()=>!!(this.maxLength>0||this.helperText&&this.helperText.length>0);this.renderHelperText=()=>{if(!this.helperText){return}return i("span",{class:"helper-text",id:this.helperTextId},this.helperText)};this.renderCharacterCounter=()=>{const e=`${this.length} / ${this.maxLength}`;if(!this.maxLength){return}return i("span",{class:"counter"},e)};this.helperText=undefined;this.length=undefined;this.maxLength=undefined;this.invalid=false;this.helperTextId=undefined}render(){return i(t,{tabIndex:-1,class:{invalid:this.invalid},style:!this.hasContent()?{display:"none"}:{},"aria-hidden":!this.hasContent()},i("div",null,this.renderHelperText(),this.renderCharacterCounter()))}};r.style=s;export{r as limel_helper_line};
2
- //# sourceMappingURL=p-27330d1d.entry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["helperLineCss","HelperLine","this","hasContent","maxLength","helperText","length","renderHelperText","h","class","id","helperTextId","renderCharacterCounter","counter","render","Host","tabIndex","invalid","style","display"],"sources":["./src/components/helper-line/helper-line.scss?tag=limel-helper-line&encapsulation=shadow","./src/components/helper-line/helper-line.tsx"],"sourcesContent":[":host(limel-helper-line) {\n transition: opacity 0.2s ease;\n\n box-sizing: border-box;\n display: grid;\n\n min-width: 0; // prevents overflowing, if component is placed in flex containers\n\n -moz-osx-font-smoothing: grayscale;\n -webkit-font-smoothing: antialiased;\n font-size: 0.6875rem;\n line-height: normal;\n\n color: rgb(var(--contrast-1200));\n}\n\ndiv {\n display: flex;\n justify-content: space-between;\n gap: 0.75rem;\n overflow: hidden;\n padding: 0 1rem;\n}\n\n:host(limel-helper-line.invalid) {\n .helper-text {\n color: var(--mdc-theme-error);\n }\n}\n\n.counter {\n flex-shrink: 0;\n margin-left: auto;\n}\n\n.helper-text,\n.counter {\n padding-top: 0.125rem;\n}\n\n// This animates height of the helper line, from `0` to `auto`.\n// To get this animation effect, the consumer component should\n// add `hide` classed accordingly.\n:host(limel-helper-line) {\n transition: grid-template-rows\n var(--limel-h-l-grid-template-rows-transition-speed, 0.46s)\n cubic-bezier(1, 0.09, 0, 0.89);\n grid-template-rows: var(--limel-h-l-grid-template-rows, 1fr);\n}\n\n:host(limel-helper-line.hide) {\n --limel-h-l-grid-template-rows-transition-speed: 0.3s;\n --limel-h-l-grid-template-rows: 0fr;\n}\n// End: animating height\n","import { Component, Host, Prop, h } from '@stencil/core';\n\n/**\n * This is an internal and private component that many input fields\n * use to display a helper text, along with a character counter below the\n * input field.\n *\n * We created this to keep the visual styles the same everywhere\n * and to avoid importing styles separately.\n *\n * Also this enables us to open the helper line in limel-portal,\n * more easily without having to send the styles to the portal.\n *\n * @exampleComponent limel-example-helper-line\n * @exampleComponent limel-example-helper-line-invalid\n * @exampleComponent limel-example-helper-line-long-text\n * @exampleComponent limel-example-helper-line-long-text-no-counter\n * @exampleComponent limel-example-helper-line-character-counter\n * @exampleComponent limel-example-helper-line-empty\n * @exampleComponent limel-example-helper-line-animation\n * @private\n */\n@Component({\n tag: 'limel-helper-line',\n shadow: true,\n styleUrl: 'helper-line.scss',\n})\nexport class HelperLine {\n /**\n * The helper text that is displayed on the left side.\n */\n @Prop({ reflect: true })\n public helperText?: string;\n\n /**\n * Length of the current input value, coming from the parent component.\n * Used in the character counter section on the right side.\n */\n @Prop({ reflect: true })\n public length?: number;\n\n /**\n * Maximum length of the characters, defined on the parent component.\n * Used in the character counter section on the right side.\n */\n @Prop({ reflect: true })\n public maxLength?: number;\n\n /**\n * Turns `true`, when the parent component is invalid.\n * For example, when the parent component is `required` but is left empty.\n * Or when the input format is invalid.\n */\n @Prop({ reflect: true })\n public invalid?: boolean = false;\n\n /**\n * Used by `aria-controls` and `aria-describedby` in the parent component.\n */\n @Prop({ reflect: true })\n public helperTextId?: string;\n\n public render() {\n return (\n <Host\n tabIndex={-1}\n class={{\n invalid: this.invalid,\n }}\n style={!this.hasContent() ? { display: 'none' } : {}}\n aria-hidden={!this.hasContent()}\n >\n <div>\n {this.renderHelperText()}\n {this.renderCharacterCounter()}\n </div>\n </Host>\n );\n }\n\n private hasContent = () => {\n return !!(\n this.maxLength > 0 ||\n (this.helperText && this.helperText.length > 0)\n );\n };\n\n private renderHelperText = () => {\n if (!this.helperText) {\n return;\n }\n\n return (\n <span class=\"helper-text\" id={this.helperTextId}>\n {this.helperText}\n </span>\n );\n };\n\n private renderCharacterCounter = () => {\n const counter = `${this.length} / ${this.maxLength}`;\n\n if (!this.maxLength) {\n return;\n }\n\n return <span class=\"counter\">{counter}</span>;\n };\n}\n"],"mappings":"kDAAA,MAAMA,EAAgB,gzB,MC2BTC,EAAU,M,yBAqDXC,KAAAC,WAAa,OAEbD,KAAKE,UAAY,GAChBF,KAAKG,YAAcH,KAAKG,WAAWC,OAAS,GAI7CJ,KAAAK,iBAAmB,KACvB,IAAKL,KAAKG,WAAY,CAClB,M,CAGJ,OACIG,EAAA,QAAMC,MAAM,cAAcC,GAAIR,KAAKS,cAC9BT,KAAKG,WACH,EAIPH,KAAAU,uBAAyB,KAC7B,MAAMC,EAAU,GAAGX,KAAKI,YAAYJ,KAAKE,YAEzC,IAAKF,KAAKE,UAAW,CACjB,M,CAGJ,OAAOI,EAAA,QAAMC,MAAM,WAAWI,EAAe,E,sFApDtB,M,4BAQpBC,SACH,OACIN,EAACO,EAAI,CACDC,UAAW,EACXP,MAAO,CACHQ,QAASf,KAAKe,SAElBC,OAAQhB,KAAKC,aAAe,CAAEgB,QAAS,QAAW,GAAE,eACtCjB,KAAKC,cAEnBK,EAAA,WACKN,KAAKK,mBACLL,KAAKU,0B"}
@@ -1 +0,0 @@
1
- {"version":3,"names":["CssClasses","Selectors","observeProperty","target","property","observer","targetObservers","installObserver","observers","getObservers","push","splice","indexOf","allTargetObservers","WeakMap","observersMap","Map","has","set","isEnabled","key","get","installedProperties","Set","descriptor","getDescriptor","configurable","enumerable","value","writable","observedDescriptor","__assign","descGet","descSet","value_1","newValue","call","this","e_4","_a","previous","_b","__values","_c","next","done","e_4_1","error","return","add","Object","defineProperty","descriptorTarget","getOwnPropertyDescriptor","getPrototypeOf","setObserversEnabled","enabled","MDCObserverFoundation","_super","__extends","adapter","_this","unobserves","prototype","destroy","unobserve","observe","e_1","cleanup","keys","bind","e_1_1","e_2","cleanup_1","cleanup_1_1","cleanupFn","e_2_1","delete","e_3","__spreadArray","__read","e_3_1","MDCFoundation","MDCSwitchFoundation","handleClick","init","state","disabled","stopProcessingIfDisabled","processing","selected","MDCSwitchRenderFoundation","apply","arguments","onDisabledChange","onProcessingChange","onSelectedChange","initFromDOM","hasClass","SELECTED","isDisabled","PROCESSING","setDisabled","toggleClass","setAriaChecked","String","UNSELECTED","addClass","className","removeClass","MDCSwitch","root","foundation","attachTo","initialize","ripple","MDCRipple","createRippleFoundation","initialSyncWithDOM","rippleElement","querySelector","RIPPLE","Error","addEventListener","removeEventListener","getDefaultFoundation","createAdapter","classList","contains","remove","ariaChecked","setAttribute","MDCRippleFoundation","createRippleAdapter","computeBoundingRect","getBoundingClientRect","isUnbounded","MDCComponent","switchCss","Switch","helperTextId","createRandomString","renderHelperLine","hasHelperText","h","helperText","invalid","undefined","event","stopPropagation","change","emit","connectedCallback","componentWillLoad","makeEnterClickable","host","componentDidLoad","element","shadowRoot","mdcSwitch","disconnectedCallback","removeEnterClickable","render","Host","id","fieldId","class","readonly","type","role","onClick","viewBox","d","htmlFor","label","valueWatcher"],"sources":["./node_modules/@material/switch/constants.js","./node_modules/@material/base/observer.js","./node_modules/@material/base/observer-foundation.js","./node_modules/@material/switch/foundation.js","./node_modules/@material/switch/component.js","./src/components/switch/switch.scss?tag=limel-switch&encapsulation=shadow","./src/components/switch/switch.tsx"],"sourcesContent":["/**\n * @license\n * Copyright 2021 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n/**\n * CSS classes used for switch.\n */\nexport var CssClasses;\n(function (CssClasses) {\n CssClasses[\"PROCESSING\"] = \"mdc-switch--processing\";\n CssClasses[\"SELECTED\"] = \"mdc-switch--selected\";\n CssClasses[\"UNSELECTED\"] = \"mdc-switch--unselected\";\n})(CssClasses || (CssClasses = {}));\n/**\n * Query selectors used for switch.\n */\nexport var Selectors;\n(function (Selectors) {\n Selectors[\"RIPPLE\"] = \".mdc-switch__ripple\";\n})(Selectors || (Selectors = {}));\n//# sourceMappingURL=constants.js.map","/**\n * @license\n * Copyright 2021 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\nimport { __assign, __extends, __read, __spreadArray, __values } from \"tslib\";\n/**\n * Mixin to add `MDCObserver` functionality to an optional base class.\n *\n * @deprecated Prefer MDCObserverFoundation for stricter closure compliance.\n * @template C Optional base class constructor type.\n * @param baseClass - Optional base class.\n * @return A class that extends the optional base class with `MDCObserver`\n * functionality.\n */\nexport function mdcObserver(baseClass) {\n if (baseClass === void 0) { baseClass = /** @class */ (function () {\n function class_1() {\n }\n return class_1;\n }()); }\n // Mixin classes cannot use private members and Symbol() cannot be used in 3P\n // for IE11.\n var unobserveMap = new WeakMap();\n return /** @class */ (function (_super) {\n __extends(MDCObserver, _super);\n function MDCObserver() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n MDCObserver.prototype.observe = function (target, observers) {\n var e_1, _a;\n var _this = this;\n var cleanup = [];\n try {\n for (var _b = __values(Object.keys(observers)), _c = _b.next(); !_c.done; _c = _b.next()) {\n var property = _c.value;\n var observer = observers[property].bind(this);\n cleanup.push(observeProperty(target, property, observer));\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_1) throw e_1.error; }\n }\n var unobserve = function () {\n var e_2, _a;\n try {\n for (var cleanup_1 = __values(cleanup), cleanup_1_1 = cleanup_1.next(); !cleanup_1_1.done; cleanup_1_1 = cleanup_1.next()) {\n var cleanupFn = cleanup_1_1.value;\n cleanupFn();\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (cleanup_1_1 && !cleanup_1_1.done && (_a = cleanup_1.return)) _a.call(cleanup_1);\n }\n finally { if (e_2) throw e_2.error; }\n }\n var unobserves = unobserveMap.get(_this) || [];\n var index = unobserves.indexOf(unobserve);\n if (index > -1) {\n unobserves.splice(index, 1);\n }\n };\n var unobserves = unobserveMap.get(this);\n if (!unobserves) {\n unobserves = [];\n unobserveMap.set(this, unobserves);\n }\n unobserves.push(unobserve);\n return unobserve;\n };\n MDCObserver.prototype.setObserversEnabled = function (target, enabled) {\n setObserversEnabled(target, enabled);\n };\n MDCObserver.prototype.unobserve = function () {\n var e_3, _a;\n // Iterate over a copy since unobserve() will remove themselves from the\n // array\n var unobserves = unobserveMap.get(this) || [];\n try {\n for (var _b = __values(__spreadArray([], __read(unobserves))), _c = _b.next(); !_c.done; _c = _b.next()) {\n var unobserve = _c.value;\n unobserve();\n }\n }\n catch (e_3_1) { e_3 = { error: e_3_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_3) throw e_3.error; }\n }\n };\n return MDCObserver;\n }(baseClass));\n}\n/**\n * Observe a target's property for changes. When a property changes, the\n * provided `Observer` function will be invoked with the properties current and\n * previous values.\n *\n * The returned cleanup function will stop listening to changes for the\n * provided `Observer`.\n *\n * @template T The observed target type.\n * @template K The observed property.\n * @param target - The target to observe.\n * @param property - The property of the target to observe.\n * @param observer - An observer function to invoke each time the property\n * changes.\n * @return A cleanup function that will stop observing changes for the provided\n * `Observer`.\n */\nexport function observeProperty(target, property, observer) {\n var targetObservers = installObserver(target, property);\n var observers = targetObservers.getObservers(property);\n observers.push(observer);\n return function () {\n observers.splice(observers.indexOf(observer), 1);\n };\n}\n/**\n * A Map of all `TargetObservers` that have been installed.\n */\nvar allTargetObservers = new WeakMap();\n/**\n * Installs a `TargetObservers` for the provided target (if not already\n * installed), and replaces the given property with a getter and setter that\n * will respond to changes and call `TargetObservers`.\n *\n * Subsequent calls to `installObserver()` with the same target and property\n * will not override the property's previously installed getter/setter.\n *\n * @template T The observed target type.\n * @template K The observed property to create a getter/setter for.\n * @param target - The target to observe.\n * @param property - The property to create a getter/setter for, if needed.\n * @return The installed `TargetObservers` for the provided target.\n */\nfunction installObserver(target, property) {\n var observersMap = new Map();\n if (!allTargetObservers.has(target)) {\n allTargetObservers.set(target, {\n isEnabled: true,\n getObservers: function (key) {\n var observers = observersMap.get(key) || [];\n if (!observersMap.has(key)) {\n observersMap.set(key, observers);\n }\n return observers;\n },\n installedProperties: new Set()\n });\n }\n var targetObservers = allTargetObservers.get(target);\n if (targetObservers.installedProperties.has(property)) {\n // The getter/setter has already been replaced for this property\n return targetObservers;\n }\n // Retrieve (or create if it's a plain property) the original descriptor from\n // the target...\n var descriptor = getDescriptor(target, property) || {\n configurable: true,\n enumerable: true,\n value: target[property],\n writable: true\n };\n // ...and create a copy that will be used for the observer.\n var observedDescriptor = __assign({}, descriptor);\n var descGet = descriptor.get, descSet = descriptor.set;\n if ('value' in descriptor) {\n // The descriptor is a simple value (not a getter/setter).\n // For our observer descriptor that we copied, delete the value/writable\n // properties, since they are incompatible with the get/set properties\n // for descriptors.\n delete observedDescriptor.value;\n delete observedDescriptor.writable;\n // Set up a simple getter...\n var value_1 = descriptor.value;\n descGet = function () { return value_1; };\n // ...and setter (if the original property was writable).\n if (descriptor.writable) {\n descSet = function (newValue) {\n value_1 = newValue;\n };\n }\n }\n if (descGet) {\n observedDescriptor.get = function () {\n // `this as T` needed for closure conformance\n return descGet.call(this);\n };\n }\n if (descSet) {\n observedDescriptor.set = function (newValue) {\n var e_4, _a;\n // `thus as T` needed for closure conformance\n var previous = descGet ? descGet.call(this) : newValue;\n descSet.call(this, newValue);\n if (targetObservers.isEnabled && (!descGet || newValue !== previous)) {\n try {\n for (var _b = __values(targetObservers.getObservers(property)), _c = _b.next(); !_c.done; _c = _b.next()) {\n var observer = _c.value;\n observer(newValue, previous);\n }\n }\n catch (e_4_1) { e_4 = { error: e_4_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_4) throw e_4.error; }\n }\n }\n };\n }\n targetObservers.installedProperties.add(property);\n Object.defineProperty(target, property, observedDescriptor);\n return targetObservers;\n}\n/**\n * Retrieves the descriptor for a property from the provided target. This\n * function will walk up the target's prototype chain to search for the\n * descriptor.\n *\n * @template T The target type.\n * @template K The property type.\n * @param target - The target to retrieve a descriptor from.\n * @param property - The name of the property to retrieve a descriptor for.\n * @return the descriptor, or undefined if it does not exist. Keep in mind that\n * plain properties may not have a descriptor defined.\n */\nexport function getDescriptor(target, property) {\n var descriptorTarget = target;\n var descriptor;\n while (descriptorTarget) {\n descriptor = Object.getOwnPropertyDescriptor(descriptorTarget, property);\n if (descriptor) {\n break;\n }\n // Walk up the instance's prototype chain in case the property is declared\n // on a superclass.\n descriptorTarget = Object.getPrototypeOf(descriptorTarget);\n }\n return descriptor;\n}\n/**\n * Enables or disables all observers for a provided target. Changes to observed\n * properties will not call any observers when disabled.\n *\n * @template T The observed target type.\n * @param target - The target to enable or disable observers for.\n * @param enabled - True to enable or false to disable observers.\n */\nexport function setObserversEnabled(target, enabled) {\n var targetObservers = allTargetObservers.get(target);\n if (targetObservers) {\n targetObservers.isEnabled = enabled;\n }\n}\n//# sourceMappingURL=observer.js.map","/**\n * @license\n * Copyright 2021 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\nimport { __extends, __read, __spreadArray, __values } from \"tslib\";\nimport { MDCFoundation } from './foundation';\nimport { observeProperty, setObserversEnabled } from './observer';\nvar MDCObserverFoundation = /** @class */ (function (_super) {\n __extends(MDCObserverFoundation, _super);\n function MDCObserverFoundation(adapter) {\n var _this = _super.call(this, adapter) || this;\n /** A set of cleanup functions to unobserve changes. */\n _this.unobserves = new Set();\n return _this;\n }\n MDCObserverFoundation.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n this.unobserve();\n };\n /**\n * Observe a target's properties for changes using the provided map of\n * property names and observer functions.\n *\n * @template T The target type.\n * @param target - The target to observe.\n * @param observers - An object whose keys are target properties and values\n * are observer functions that are called when the associated property\n * changes.\n * @return A cleanup function that can be called to unobserve the\n * target.\n */\n MDCObserverFoundation.prototype.observe = function (target, observers) {\n var e_1, _a;\n var _this = this;\n var cleanup = [];\n try {\n for (var _b = __values(Object.keys(observers)), _c = _b.next(); !_c.done; _c = _b.next()) {\n var property = _c.value;\n var observer = observers[property].bind(this);\n cleanup.push(this.observeProperty(target, property, observer));\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_1) throw e_1.error; }\n }\n var unobserve = function () {\n var e_2, _a;\n try {\n for (var cleanup_1 = __values(cleanup), cleanup_1_1 = cleanup_1.next(); !cleanup_1_1.done; cleanup_1_1 = cleanup_1.next()) {\n var cleanupFn = cleanup_1_1.value;\n cleanupFn();\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (cleanup_1_1 && !cleanup_1_1.done && (_a = cleanup_1.return)) _a.call(cleanup_1);\n }\n finally { if (e_2) throw e_2.error; }\n }\n _this.unobserves.delete(unobserve);\n };\n this.unobserves.add(unobserve);\n return unobserve;\n };\n /**\n * Observe a target's property for changes. When a property changes, the\n * provided `Observer` function will be invoked with the properties current\n * and previous values.\n *\n * The returned cleanup function will stop listening to changes for the\n * provided `Observer`.\n *\n * @template T The observed target type.\n * @template K The observed property.\n * @param target - The target to observe.\n * @param property - The property of the target to observe.\n * @param observer - An observer function to invoke each time the property\n * changes.\n * @return A cleanup function that will stop observing changes for the\n * provided `Observer`.\n */\n MDCObserverFoundation.prototype.observeProperty = function (target, property, observer) {\n return observeProperty(target, property, observer);\n };\n /**\n * Enables or disables all observers for the provided target. Disabling\n * observers will prevent them from being called until they are re-enabled.\n *\n * @param target - The target to enable or disable observers for.\n * @param enabled - Whether or not observers should be called.\n */\n MDCObserverFoundation.prototype.setObserversEnabled = function (target, enabled) {\n setObserversEnabled(target, enabled);\n };\n /**\n * Clean up all observers and stop listening for property changes.\n */\n MDCObserverFoundation.prototype.unobserve = function () {\n var e_3, _a;\n try {\n // Iterate over a copy since unobserve() will remove themselves from the set\n for (var _b = __values(__spreadArray([], __read(this.unobserves))), _c = _b.next(); !_c.done; _c = _b.next()) {\n var unobserve = _c.value;\n unobserve();\n }\n }\n catch (e_3_1) { e_3 = { error: e_3_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_3) throw e_3.error; }\n }\n };\n return MDCObserverFoundation;\n}(MDCFoundation));\nexport { MDCObserverFoundation };\n//# sourceMappingURL=observer-foundation.js.map","/**\n * @license\n * Copyright 2021 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\nimport { __extends } from \"tslib\";\nimport { MDCObserverFoundation } from '@material/base/observer-foundation';\nimport { CssClasses } from './constants';\n/**\n * `MDCSwitchFoundation` provides a state-only foundation for a switch\n * component.\n *\n * State observers and event handler entrypoints update a component's adapter's\n * state with the logic needed for switch to function.\n */\nvar MDCSwitchFoundation = /** @class */ (function (_super) {\n __extends(MDCSwitchFoundation, _super);\n function MDCSwitchFoundation(adapter) {\n var _this = _super.call(this, adapter) || this;\n _this.handleClick = _this.handleClick.bind(_this);\n return _this;\n }\n /**\n * Initializes the foundation and starts observing state changes.\n */\n MDCSwitchFoundation.prototype.init = function () {\n this.observe(this.adapter.state, {\n disabled: this.stopProcessingIfDisabled,\n processing: this.stopProcessingIfDisabled,\n });\n };\n /**\n * Event handler for switch click events. Clicking on a switch will toggle its\n * selected state.\n */\n MDCSwitchFoundation.prototype.handleClick = function () {\n if (this.adapter.state.disabled) {\n return;\n }\n this.adapter.state.selected = !this.adapter.state.selected;\n };\n MDCSwitchFoundation.prototype.stopProcessingIfDisabled = function () {\n if (this.adapter.state.disabled) {\n this.adapter.state.processing = false;\n }\n };\n return MDCSwitchFoundation;\n}(MDCObserverFoundation));\nexport { MDCSwitchFoundation };\n/**\n * `MDCSwitchRenderFoundation` provides a state and rendering foundation for a\n * switch component.\n *\n * State observers and event handler entrypoints update a component's\n * adapter's state with the logic needed for switch to function.\n *\n * In response to state changes, the rendering foundation uses the component's\n * render adapter to keep the component's DOM updated with the state.\n */\nvar MDCSwitchRenderFoundation = /** @class */ (function (_super) {\n __extends(MDCSwitchRenderFoundation, _super);\n function MDCSwitchRenderFoundation() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Initializes the foundation and starts observing state changes.\n */\n MDCSwitchRenderFoundation.prototype.init = function () {\n _super.prototype.init.call(this);\n this.observe(this.adapter.state, {\n disabled: this.onDisabledChange,\n processing: this.onProcessingChange,\n selected: this.onSelectedChange,\n });\n };\n /**\n * Initializes the foundation from a server side rendered (SSR) component.\n * This will sync the adapter's state with the current state of the DOM.\n *\n * This method should be called after `init()`.\n */\n MDCSwitchRenderFoundation.prototype.initFromDOM = function () {\n // Turn off observers while setting state\n this.setObserversEnabled(this.adapter.state, false);\n this.adapter.state.selected = this.adapter.hasClass(CssClasses.SELECTED);\n // Ensure aria-checked is set if attribute is not present\n this.onSelectedChange();\n this.adapter.state.disabled = this.adapter.isDisabled();\n this.adapter.state.processing =\n this.adapter.hasClass(CssClasses.PROCESSING);\n // Re-observe state\n this.setObserversEnabled(this.adapter.state, true);\n this.stopProcessingIfDisabled();\n };\n MDCSwitchRenderFoundation.prototype.onDisabledChange = function () {\n this.adapter.setDisabled(this.adapter.state.disabled);\n };\n MDCSwitchRenderFoundation.prototype.onProcessingChange = function () {\n this.toggleClass(this.adapter.state.processing, CssClasses.PROCESSING);\n };\n MDCSwitchRenderFoundation.prototype.onSelectedChange = function () {\n this.adapter.setAriaChecked(String(this.adapter.state.selected));\n this.toggleClass(this.adapter.state.selected, CssClasses.SELECTED);\n this.toggleClass(!this.adapter.state.selected, CssClasses.UNSELECTED);\n };\n MDCSwitchRenderFoundation.prototype.toggleClass = function (addClass, className) {\n if (addClass) {\n this.adapter.addClass(className);\n }\n else {\n this.adapter.removeClass(className);\n }\n };\n return MDCSwitchRenderFoundation;\n}(MDCSwitchFoundation));\nexport { MDCSwitchRenderFoundation };\n//# sourceMappingURL=foundation.js.map","/**\n * @license\n * Copyright 2021 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\nimport { __assign, __extends } from \"tslib\";\nimport { MDCComponent } from '@material/base/component';\nimport { MDCRipple } from '@material/ripple/component';\nimport { MDCRippleFoundation } from '@material/ripple/foundation';\nimport { Selectors } from './constants';\nimport { MDCSwitchRenderFoundation } from './foundation';\n/**\n * `MDCSwitch` provides a component implementation of a Material Design switch.\n */\nvar MDCSwitch = /** @class */ (function (_super) {\n __extends(MDCSwitch, _super);\n function MDCSwitch(root, foundation) {\n var _this = _super.call(this, root, foundation) || this;\n _this.root = root;\n return _this;\n }\n /**\n * Creates a new `MDCSwitch` and attaches it to the given root element.\n * @param root The root to attach to.\n * @return the new component instance.\n */\n MDCSwitch.attachTo = function (root) {\n return new MDCSwitch(root);\n };\n MDCSwitch.prototype.initialize = function () {\n this.ripple = new MDCRipple(this.root, this.createRippleFoundation());\n };\n MDCSwitch.prototype.initialSyncWithDOM = function () {\n var rippleElement = this.root.querySelector(Selectors.RIPPLE);\n if (!rippleElement) {\n throw new Error(\"Switch \" + Selectors.RIPPLE + \" element is required.\");\n }\n this.rippleElement = rippleElement;\n this.root.addEventListener('click', this.foundation.handleClick);\n this.foundation.initFromDOM();\n };\n MDCSwitch.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n this.ripple.destroy();\n this.root.removeEventListener('click', this.foundation.handleClick);\n };\n MDCSwitch.prototype.getDefaultFoundation = function () {\n return new MDCSwitchRenderFoundation(this.createAdapter());\n };\n MDCSwitch.prototype.createAdapter = function () {\n var _this = this;\n return {\n addClass: function (className) {\n _this.root.classList.add(className);\n },\n hasClass: function (className) { return _this.root.classList.contains(className); },\n isDisabled: function () { return _this.root.disabled; },\n removeClass: function (className) {\n _this.root.classList.remove(className);\n },\n setAriaChecked: function (ariaChecked) {\n return _this.root.setAttribute('aria-checked', ariaChecked);\n },\n setDisabled: function (disabled) {\n _this.root.disabled = disabled;\n },\n state: this,\n };\n };\n MDCSwitch.prototype.createRippleFoundation = function () {\n return new MDCRippleFoundation(this.createRippleAdapter());\n };\n MDCSwitch.prototype.createRippleAdapter = function () {\n var _this = this;\n return __assign(__assign({}, MDCRipple.createAdapter(this)), { computeBoundingRect: function () { return _this.rippleElement.getBoundingClientRect(); }, isUnbounded: function () { return true; } });\n };\n return MDCSwitch;\n}(MDCComponent));\nexport { MDCSwitch };\n//# sourceMappingURL=component.js.map","@use '../../style/functions';\n@use '../../style/internal/shared_input-select-picker';\n@use '../../style/internal/lime-theme';\n@use '../../style/internal/lime-typography';\n\n@use '@material/switch/styles';\n\n$scale-factor: 0.8;\n\n:host(limel-switch) {\n isolation: isolate;\n\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n\n --mdc-switch-selected-icon-color: transparent;\n --mdc-switch-unselected-icon-color: transparent;\n\n --mdc-switch-disabled-selected-icon-opacity: 1;\n --mdc-switch-disabled-unselected-icon-opacity: 1;\n\n --mdc-switch-selected-icon-size: 0.75rem;\n --mdc-switch-unselected-icon-size: 0.75rem;\n\n --mdc-switch-track-height: 1.25rem;\n --mdc-switch-track-shape: var(--mdc-switch-track-height);\n\n --mdc-switch-unselected-focus-handle-color: var(\n --lime-elevated-surface-background-color\n );\n --mdc-switch-selected-focus-handle-color: var(\n --lime-elevated-surface-background-color\n );\n --mdc-switch-unselected-pressed-handle-color: var(\n --lime-elevated-surface-background-color\n );\n --mdc-switch-selected-pressed-handle-color: var(\n --lime-elevated-surface-background-color\n );\n --mdc-switch-unselected-handle-color: var(\n --lime-elevated-surface-background-color\n );\n --mdc-switch-unselected-hover-handle-color: var(\n --lime-elevated-surface-background-color\n );\n --mdc-switch-selected-handle-color: var(\n --lime-elevated-surface-background-color\n );\n --mdc-switch-selected-hover-handle-color: var(\n --lime-elevated-surface-background-color\n );\n\n --mdc-switch-unselected-track-color: rgb(var(--contrast-700));\n --mdc-switch-unselected-focus-track-color: rgb(var(--contrast-800));\n --mdc-switch-unselected-pressed-track-color: rgb(var(--contrast-800));\n --mdc-switch-unselected-hover-track-color: rgb(var(--contrast-800));\n --mdc-switch-selected-focus-track-color: var(--mdc-theme-primary);\n --mdc-switch-selected-pressed-track-color: var(--mdc-theme-primary);\n --mdc-switch-selected-track-color: var(--mdc-theme-primary);\n --mdc-switch-selected-hover-track-color: var(--mdc-theme-primary);\n\n --mdc-switch-handle-elevation: var(--button-shadow-normal);\n --mdc-switch-disabled-track-opacity: 0.4;\n\n --mdc-switch-disabled-selected-handle-color: rgb(var(--contrast-1000));\n --mdc-switch-disabled-unselected-handle-color: rgb(var(--contrast-1000));\n}\n\n.mdc-switch {\n margin-right: functions.pxToRem(8);\n &:hover {\n --mdc-switch-handle-elevation: var(--button-shadow-hovered);\n }\n}\n\nlabel {\n @include lime-typography.typography(body2);\n color: var(--mdc-theme-on-surface);\n\n &:not(.disabled) {\n cursor: pointer;\n }\n}\n\nlabel {\n // As long as this component is depended on MDC,\n // we need to force it to be font-agnostic.\n // When MDC-dependency is removed, this block can also be removed.\n // However, on removal of MDC-dependency, we should also make sure to check\n // other font-related styles that might be set by MDC,\n // such as `letter-spacing` or `font-size`.\n font-family: inherit;\n}\n\n.mdc-switch {\n &.mdc-switch--selected,\n &.mdc-switch.mdc-switch--unselected {\n .mdc-switch__handle {\n &:after,\n &:before {\n transform: scale($scale-factor);\n }\n }\n }\n .mdc-switch__shadow {\n transform: scale($scale-factor);\n }\n}\n\n@import './partial-styles/_readonly.scss';\n@import './partial-styles/_helper-text.scss';\n","import { MDCSwitch } from '@material/switch';\nimport {\n Component,\n Element,\n Event,\n EventEmitter,\n Host,\n h,\n Prop,\n State,\n Watch,\n} from '@stencil/core';\nimport { createRandomString } from '../../util/random-string';\nimport {\n makeEnterClickable,\n removeEnterClickable,\n} from '../../util/make-enter-clickable';\n\n/**\n * The Switch component is a fundamental element in UI design that serves as a toggle switch\n * to control the state of a specific setting or option in an application or website.\n * The two distinct positions of the Switch are visually indicative of the two states:\n * ON and OFF; making it easy for users to understand the current state of the controlled feature.\n *\n * The Switch component is widely used in user interfaces to enable users to\n * quickly and intuitively change binary settings.\n *\n * :::important\n * Checkboxes are sometimes used interchangeably with switches in user interfaces.\n * But there is an important difference between the two! Please read our guidelines about\n * [Switch vs. Checkbox](/#/DesignGuidelines/switch-vs-checkbox.md/).\n *\n * @exampleComponent limel-example-switch\n * @exampleComponent limel-example-switch-helper-text\n */\n@Component({\n tag: 'limel-switch',\n shadow: true,\n styleUrl: 'switch.scss',\n})\nexport class Switch {\n /**\n * Label to display next to the switch\n */\n @Prop({ reflect: true })\n public label: string;\n\n /**\n * Disables the switch when `true`,\n * and visually shows that the switch is editable but disabled.\n * This tells the users that if certain requirements are met,\n * the switch may become interactable.\n */\n @Prop({ reflect: true })\n public disabled = false;\n\n /**\n * Disables the switch when `true`. This visualizes the switch slightly differently.\n * But shows no visual sign indicating that the switch is disabled\n * or can ever become interactable.\n */\n @Prop({ reflect: true })\n public readonly = false;\n\n /**\n * Set to `true` to indicate that the current value is invalid.\n */\n @Prop({ reflect: true })\n public invalid: boolean;\n\n /**\n * The value of the switch\n */\n @Prop({ reflect: true })\n public value = false;\n\n /**\n * Optional helper text to display below the switch\n */\n @Prop({ reflect: true })\n public helperText: string;\n\n /**\n * Emitted when the value has changed\n */\n @Event()\n private change: EventEmitter<boolean>;\n\n @Element()\n private host: HTMLLimelSwitchElement;\n private helperTextId: string = createRandomString();\n\n @State()\n private fieldId = createRandomString();\n\n private mdcSwitch: MDCSwitch;\n\n public connectedCallback() {\n this.initialize();\n }\n\n public componentWillLoad() {\n makeEnterClickable(this.host);\n }\n\n public componentDidLoad() {\n this.initialize();\n }\n\n private initialize() {\n const element = this.host.shadowRoot.querySelector(\n '.mdc-switch',\n ) as HTMLButtonElement;\n if (!element) {\n return;\n }\n\n this.mdcSwitch = new MDCSwitch(element);\n }\n\n public disconnectedCallback() {\n removeEnterClickable(this.host);\n this.mdcSwitch?.destroy();\n }\n\n public render() {\n return (\n <Host>\n <button\n id={this.fieldId}\n class={{\n 'mdc-switch': true,\n 'lime-switch--readonly': this.readonly,\n 'mdc-switch--unselected': !this.value,\n 'mdc-switch--selected': this.value,\n }}\n type=\"button\"\n role=\"switch\"\n aria-checked={this.value}\n disabled={this.disabled || this.readonly}\n onClick={this.handleClick}\n aria-controls={this.helperTextId}\n >\n <div class=\"mdc-switch__track\" />\n <div class=\"mdc-switch__handle-track\">\n <div class=\"mdc-switch__handle\">\n <div class=\"mdc-switch__shadow\">\n <div class=\"mdc-elevation-overlay\"></div>\n </div>\n <div class=\"mdc-switch__ripple\"></div>\n <div class=\"mdc-switch__icons\">\n <svg\n class=\"mdc-switch__icon mdc-switch__icon--on\"\n viewBox=\"0 0 24 24\"\n >\n <path d=\"M19.69,5.23L8.96,15.96l-4.23-4.23L2.96,13.5l6,6L21.46,7L19.69,5.23z\" />\n </svg>\n <svg\n class=\"mdc-switch__icon mdc-switch__icon--off\"\n viewBox=\"0 0 24 24\"\n >\n <path d=\"M20 13H4v-2h16v2z\" />\n </svg>\n </div>\n </div>\n </div>\n </button>\n <label\n class={`${\n this.disabled || this.readonly ? 'disabled' : ''\n }`}\n htmlFor={this.fieldId}\n >\n {this.label}\n </label>\n {this.renderHelperLine()}\n </Host>\n );\n }\n\n @Watch('value')\n protected valueWatcher(newValue: boolean) {\n if (!this.mdcSwitch) {\n return;\n }\n\n this.mdcSwitch.selected = newValue;\n }\n\n private renderHelperLine = () => {\n if (!this.hasHelperText()) {\n return;\n }\n\n return (\n <limel-helper-line\n helperTextId={this.helperTextId}\n helperText={this.helperText}\n invalid={this.invalid}\n />\n );\n };\n\n private hasHelperText = () => {\n return this.helperText !== null && this.helperText !== undefined;\n };\n\n private handleClick = (event: MouseEvent) => {\n event.stopPropagation();\n this.change.emit(!this.value);\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;GAyBO,IAAIA,GACX,SAAWA,GACPA,EAAW,cAAgB,yBAC3BA,EAAW,YAAc,uBACzBA,EAAW,cAAgB,wBAC9B,EAJD,CAIGA,IAAeA,EAAa,KAIxB,IAAIC,GACX,SAAWA,GACPA,EAAU,UAAY,qBACzB,EAFD,CAEGA,IAAcA,EAAY;;;;;;;;;;;;;;;;;;;;;;GCkGtB,SAASC,EAAgBC,EAAQC,EAAUC,GAC9C,IAAIC,EAAkBC,EAAgBJ,EAAQC,GAC9C,IAAII,EAAYF,EAAgBG,aAAaL,GAC7CI,EAAUE,KAAKL,GACf,OAAO,WACHG,EAAUG,OAAOH,EAAUI,QAAQP,GAAW,EACtD,CACA,CAIA,IAAIQ,EAAqB,IAAIC,QAe7B,SAASP,EAAgBJ,EAAQC,GAC7B,IAAIW,EAAe,IAAIC,IACvB,IAAKH,EAAmBI,IAAId,GAAS,CACjCU,EAAmBK,IAAIf,EAAQ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