@oiz/stzh-components 3.6.0-beta4 → 3.6.0-beta5

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 (40) hide show
  1. package/dist/cjs/{app-globals-f1bf0bed.js → app-globals-7da024c8.js} +2 -2
  2. package/dist/cjs/{app-globals-f1bf0bed.js.map → app-globals-7da024c8.js.map} +1 -1
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/cjs/stzh-components.cjs.js +1 -1
  5. package/dist/cjs/stzh-dropdown.cjs.entry.js +8 -16
  6. package/dist/cjs/stzh-dropdown.cjs.entry.js.map +1 -1
  7. package/dist/collection/components/stzh-dropdown/stzh-dropdown.js +8 -16
  8. package/dist/collection/components/stzh-dropdown/stzh-dropdown.js.map +1 -1
  9. package/dist/components/index.js +1 -1
  10. package/dist/components/{p-aa3fc1b5.js → p-5a04123b.js} +2 -2
  11. package/dist/components/{p-aa3fc1b5.js.map → p-5a04123b.js.map} +1 -1
  12. package/dist/components/{p-4508550a.js → p-7cc4b88f.js} +3 -3
  13. package/dist/components/{p-4508550a.js.map → p-7cc4b88f.js.map} +1 -1
  14. package/dist/components/{p-3f254548.js → p-a16a72e5.js} +9 -17
  15. package/dist/components/p-a16a72e5.js.map +1 -0
  16. package/dist/components/stzh-amount.js +1 -1
  17. package/dist/components/stzh-appointments.js +3 -3
  18. package/dist/components/stzh-calendar.js +1 -1
  19. package/dist/components/stzh-datatable.js +1 -1
  20. package/dist/components/stzh-datepicker.js +1 -1
  21. package/dist/components/stzh-dropdown.js +1 -1
  22. package/dist/components/stzh-monthyearpicker.js +1 -1
  23. package/dist/components/stzh-panorama.js +1 -1
  24. package/dist/components/stzh-poilist.js +1 -1
  25. package/dist/components/stzh-search.js +1 -1
  26. package/dist/components/stzh-timepicker.js +1 -1
  27. package/dist/esm/{app-globals-1b7d8e4f.js → app-globals-9b85181b.js} +2 -2
  28. package/dist/esm/{app-globals-1b7d8e4f.js.map → app-globals-9b85181b.js.map} +1 -1
  29. package/dist/esm/loader.js +1 -1
  30. package/dist/esm/stzh-components.js +1 -1
  31. package/dist/esm/stzh-dropdown.entry.js +8 -16
  32. package/dist/esm/stzh-dropdown.entry.js.map +1 -1
  33. package/dist/stzh-components/{p-b6d653c5.entry.js → p-26c37e1c.entry.js} +2 -2
  34. package/dist/stzh-components/p-26c37e1c.entry.js.map +1 -0
  35. package/dist/stzh-components/{p-9b909077.js → p-2da834a9.js} +2 -2
  36. package/dist/stzh-components/stzh-components.esm.js +1 -1
  37. package/package.json +3 -3
  38. package/dist/components/p-3f254548.js.map +0 -1
  39. package/dist/stzh-components/p-b6d653c5.entry.js.map +0 -1
  40. /package/dist/stzh-components/{p-9b909077.js.map → p-2da834a9.js.map} +0 -0
@@ -480,17 +480,9 @@ export class StzhDropdown {
480
480
  this.tomSelect = new TomSelect(this.select, tomSelectOptions);
481
481
  if (!this.openOnFocus) {
482
482
  // we still want to enable opening the dropdown by click
483
- this.tomSelect.control.addEventListener("click", (event) => {
484
- try {
485
- event.preventDefault(); // Ensure this works without error
486
- }
487
- catch (_a) {
488
- console.log('preventDefault failed');
489
- }
483
+ this.tomSelect.control.addEventListener("click", () => {
490
484
  this.tomSelect.open();
491
- },
492
- // passive false, otherwise angular wrapper will cause error
493
- { passive: false });
485
+ });
494
486
  }
495
487
  if (this.open) {
496
488
  this.show();
@@ -528,18 +520,18 @@ export class StzhDropdown {
528
520
  [`stzh-dropdown--size-${this.size}`]: !!this.size,
529
521
  [`stzh-dropdown--${this.variant}`]: !!this.variant,
530
522
  };
531
- return (h(Host, { key: '58aa56d1ca27f5e0d9d12a47c630ac8137a12c2e', "is-invalid": this.invalid || errorUsed, tabindex: this.disabled ? null : "-1", onFocus: this.onRootFocus }, h("div", { key: 'c1be5709c6c9254ecb16b4ba9966f6388fa48b0f', class: classes, ref: (el) => (this.rootElement = el) }, h("div", { key: 'e53a8da47a55ea7c5650fe9c8ead7f6c99c06c70', class: "stzh-dropdown__wrapper" }, h("label", { key: 'a239ce7cc60f3d6583145eb58b51eac4b57f44ea', id: `${this.dropdownId}-label`, class: {
523
+ return (h(Host, { key: 'a237d5e0c99e4f41d746f135341f24b1fdd0968c', "is-invalid": this.invalid || errorUsed, tabindex: this.disabled ? null : "-1", onFocus: this.onRootFocus }, h("div", { key: 'd0ee727761072eb1d42369a9e886f6270d3a6f1e', class: classes, ref: (el) => (this.rootElement = el) }, h("div", { key: 'a82ca4c8210e6b55b126d035428580305752b680', class: "stzh-dropdown__wrapper" }, h("label", { key: '19cdc52622a8aad6b0a9d2059528fe76b65054b9', id: `${this.dropdownId}-label`, class: {
532
524
  "stzh-dropdown__label": true,
533
525
  "no-label-truncate": this.noLabelTruncate,
534
- }, htmlFor: this.dropdownId }, this.label ? this.label : h("slot", { name: "label" }), !this.hideOptional && (h("span", { key: 'ead8f56e430c5e32cea5703fef7910652235577e', class: "stzh-dropdown__marker" }, h("span", { key: 'd992c5c32a8cfcc50c69c1d39b1fda7711253b8a', class: "stzh-dropdown__marker-symbol", "aria-hidden": "true" }, this.required
526
+ }, htmlFor: this.dropdownId }, this.label ? this.label : h("slot", { name: "label" }), !this.hideOptional && (h("span", { key: '084d603e2449e1e54dcc65c34e6c0bf5d4e1cb9b', class: "stzh-dropdown__marker" }, h("span", { key: '404fd6c775eee2899fbfef267ca815f29c4888d0', class: "stzh-dropdown__marker-symbol", "aria-hidden": "true" }, this.required
535
527
  ? this.localization.$globals.requiredFieldMarker
536
- : this.localization.$globals.optionalFieldMarker), h("span", { key: '268d111ebc8a7ed7d113bfd344a271743b361b02', class: "stzh-dropdown__marker-text" }, this.required
528
+ : this.localization.$globals.optionalFieldMarker), h("span", { key: '6fb3959ef5f006951c62373a3ce6b56b11ab78e1', class: "stzh-dropdown__marker-text" }, this.required
537
529
  ? this.localization.$globals.requiredFieldText
538
- : this.localization.$globals.optionalFieldText)))), h("div", { key: '597f08cbdecf4babe97696973c03fe05e6d446f4', class: "stzh-dropdown__field-wrapper" }, h("select", { key: 'c3005bdf6e9af41b2c7870fd759641bb827bd887', id: this.dropdownId, class: "stzh-dropdown__select", ref: (el) => (this.select = el), multiple: this.multiple, name: this.name, disabled: this.disabled, "aria-labelledby": `${this.dropdownId}-label ${this.dropdownId}-not-loading ${this.dropdownId}-no-results ${this.hideOptional &&
530
+ : this.localization.$globals.optionalFieldText)))), h("div", { key: 'ab2feaf5d25d3bfa856264fe4498a004537bdb64', class: "stzh-dropdown__field-wrapper" }, h("select", { key: 'a37d0cae943a972ba3e1e1607de155b5d692f24a', id: this.dropdownId, class: "stzh-dropdown__select", ref: (el) => (this.select = el), multiple: this.multiple, name: this.name, disabled: this.disabled, "aria-labelledby": `${this.dropdownId}-label ${this.dropdownId}-not-loading ${this.dropdownId}-no-results ${this.hideOptional &&
539
531
  this.required &&
540
- `${this.dropdownId}-required`} ${this.invalid && `${this.dropdownId}-invalid`} ${this.dropdownId}-description ${this.a11yDescribedby}` }, h("slot", { key: '0ec2afcf4ca56223b64813ea367665197031e020' })), this.inline && this.label && (h("div", { key: 'ecf2e2c05a521d8f34272b3f767338c262321249', class: "stzh-dropdown__sizer" }, this.label)), h("div", { key: '56ac67d5cfdc773827ecc2790fc7b5b77594d9c0', class: "stzh-dropdown__icon-angle-wrapper" }, this.iconAngle ? (h("stzh-icon", { name: this.iconAngle, class: "stzh-dropdown__icon-angle" })) : (h("slot", { name: "icon-angle" }))), h("div", { key: 'b9b57cf8a1af00ebe78656b912fdc4da6ea71869', class: "stzh-dropdown__icon-wrapper" }, this.icon ? (h("stzh-icon", { class: "stzh-dropdown__icon", name: this.icon })) : (h("slot", { name: "icon" }))), this.hideOptional && this.required && (h("div", { key: 'dc1628f3429df00408acd962e0c6cf1817bdd645', id: `${this.dropdownId}-required`, class: "stzh-dropdown__vhidden" }, this.localization.$globals.requiredFieldText)), this.invalid && (h("div", { key: '011a973ecc417d2a92806801a8db483de75a37f0', id: `${this.dropdownId}-invalid`, class: "stzh-dropdown__vhidden" }, this.localization.$globals.invalidFieldText)))), h("div", { key: '43b89f15d72ecc01df191baf05f1292d2ffe1e11', class: "stzh-dropdown__dropdown-wrapper", ref: (el) => (this.dropdownWrapperElement = el) }), (((_b = this._error) === null || _b === void 0 ? void 0 : _b.length) > 0 ||
532
+ `${this.dropdownId}-required`} ${this.invalid && `${this.dropdownId}-invalid`} ${this.dropdownId}-description ${this.a11yDescribedby}` }, h("slot", { key: 'd3f5740bd9e2ca6a102769f94b20f08f66cae76c' })), this.inline && this.label && (h("div", { key: '72777c20dd19fe770a7ab0c975dbc76ba6b95014', class: "stzh-dropdown__sizer" }, this.label)), h("div", { key: 'f8101baf3c1d75c3445ced080393d5e7074e9891', class: "stzh-dropdown__icon-angle-wrapper" }, this.iconAngle ? (h("stzh-icon", { name: this.iconAngle, class: "stzh-dropdown__icon-angle" })) : (h("slot", { name: "icon-angle" }))), h("div", { key: 'b45a81d2433276ec2083900f6159490056669bc9', class: "stzh-dropdown__icon-wrapper" }, this.icon ? (h("stzh-icon", { class: "stzh-dropdown__icon", name: this.icon })) : (h("slot", { name: "icon" }))), this.hideOptional && this.required && (h("div", { key: '04aa1871fc8c8ca9c7d72725b1718df9b60ba63d', id: `${this.dropdownId}-required`, class: "stzh-dropdown__vhidden" }, this.localization.$globals.requiredFieldText)), this.invalid && (h("div", { key: '9a762878b72636f0415e6fcb88690d1ac74eb7b2', id: `${this.dropdownId}-invalid`, class: "stzh-dropdown__vhidden" }, this.localization.$globals.invalidFieldText)))), h("div", { key: '5029c84378274f3697acddab45b8c37173038b49', class: "stzh-dropdown__dropdown-wrapper", ref: (el) => (this.dropdownWrapperElement = el) }), (((_b = this._error) === null || _b === void 0 ? void 0 : _b.length) > 0 ||
541
533
  this.description ||
542
- this.descriptionLong) && (h(StzhInputDescription, { key: '385cb1aed8f46106f0bcef6cec03ba8c5d603bf2', classPrefix: "stzh-dropdown", id: `${this.dropdownId}-description`, error: this._error, description: this.description, descriptionLong: this.descriptionLong, descriptionLongTitle: this.descriptionLongTitle, descriptionLongUsed: descriptionLongUsed, moreInfoButtonLabel: this.localization.$globals.moreInfoButtonLabel })))));
534
+ this.descriptionLong) && (h(StzhInputDescription, { key: '48306ec50f826801871ebefa7ca06405448b4d3f', classPrefix: "stzh-dropdown", id: `${this.dropdownId}-description`, error: this._error, description: this.description, descriptionLong: this.descriptionLong, descriptionLongTitle: this.descriptionLongTitle, descriptionLongUsed: descriptionLongUsed, moreInfoButtonLabel: this.localization.$globals.moreInfoButtonLabel })))));
543
535
  }
544
536
  static get is() { return "stzh-dropdown"; }
545
537
  static get originalStyleUrls() {
@@ -1 +1 @@
1
- {"version":3,"file":"stzh-dropdown.js","sourceRoot":"","sources":["../../../../src/components/stzh-dropdown/stzh-dropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,IAAI,EACJ,IAAI,EACJ,CAAC,EACD,OAAO,EACP,KAAK,EACL,MAAM,EACN,KAAK,EAEL,MAAM,GACP,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAmB5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAE5E,OAAO,SAAS,MAAM,8CAA8C,CAAC;AACrE,OAAO,qBAAqB,MAAM,gEAAgE,CAAC;AACnG,OAAO,wBAAwB,MAAM,mEAAmE,CAAC;AACzG,OAAO,sBAAsB,MAAM,iEAAiE,CAAC;AACrG,OAAO,0BAA0B,MAAM,sEAAsE,CAAC;AAE9G,MAAM,sBAAsB,GAAG,UAAU,eAAe;IACtD,MAAM,IAAI,GAAG,IAAI,CAAC;IAElB,IAAI,CAAC,EAAE,CAAC,YAAY,EAAE,GAAG,EAAE;QACzB,MAAM,KAAK,GAAG,IAAI,CAAC,aAAiC,CAAC;QACrD,IAAI,KAAK;YAAE,KAAK,CAAC,QAAQ,GAAG,IAAI,CAAC;IACnC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,MAAM,YAAY,GAAG,0BAA0B,CAAC;AAChD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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n Component,\n Host,\n Prop,\n h,\n Element,\n Watch,\n Method,\n Event,\n EventEmitter,\n Listen,\n} from \"@stencil/core\";\n\nimport { hasSlot } from \"../../utils/utils\";\n\nimport {\n StzhDropdownSize,\n StzhDropdownOption,\n StzhDropdownChangeEvent,\n StzhDropdownItemAddEvent,\n StzhDropdownItemRemoveEvent,\n StzhDropdownOptionAddEvent,\n StzhDropdownOptionRemoveEvent,\n StzhDropdownOpenEvent,\n StzhDropdowCloseEvent,\n StzhDropdownFocusEvent,\n StzhDropdownBlurEvent,\n StzhDropdowInitEvent,\n} from \"../../index\";\n\nimport { StzhDropdownLocalizedText } from \"./stzh-dropdown.localization\";\n\nimport { StzhInputDescription } from \"../stzh-input/stzh-input-description\";\n\nimport TomSelect from \"../../libraries/tom-select/esm/tom-select.js\";\nimport TomSelectRemoveButton from \"../../libraries/tom-select/esm/plugins/remove_button/plugin.js\";\nimport TomSelectCheckboxOptions from \"../../libraries/tom-select/esm/plugins/checkbox_options/plugin.js\";\nimport TomSelectInputAutogrow from \"../../libraries/tom-select/esm/plugins/input_autogrow/plugin.js\";\nimport TomSelectNoBackspaceDelete from \"../../libraries/tom-select/esm/plugins/no_backspace_delete/plugin.js\";\n\nconst TomSelectInputReadonly = function (_plugin_options) {\n const self = this;\n\n self.on(\"initialize\", () => {\n const input = self.control_input as HTMLInputElement;\n if (input) input.readOnly = true;\n });\n};\n\nconst CLASS_FILLED = \"stzh-dropdown--is-filled\";\nconst CLASS_FOCUS = \"stzh-dropdown--has-focus\";\n\nTomSelect.define(\"remove_button\", TomSelectRemoveButton);\nTomSelect.define(\"checkbox_options\", TomSelectCheckboxOptions);\nTomSelect.define(\"input_autogrow\", TomSelectInputAutogrow);\nTomSelect.define(\"no_backspace_delete\", TomSelectNoBackspaceDelete);\nTomSelect.define(\"input_readonly\", TomSelectInputReadonly);\n\nlet dropdownCounter = 0;\n\n/**\n * @slot label - Slot for label content\n * @slot description - Slot for description\n * @slot description-long - Slot for long description (in popover)\n * @slot description-long-title - Slot for long description title (in popover) / instead of descriptionLongTitle or description property\n * @slot icon - Slot for left icon\n * @slot icon-angle - Slot for angle icon\n * @slot error - Slot for error\n */\n@Component({\n tag: \"stzh-dropdown\",\n styleUrl: \"stzh-dropdown.scss\",\n})\nexport class StzhDropdown {\n /** Available options */\n @Prop() options: StzhDropdownOption[] | string;\n private _options: StzhDropdownOption[];\n\n /**\n * Option groups that options will be bucketed into.\n * Make sure each object in the array has a property named whatever `optgroupValueField` is set to.\n */\n @Prop() optgroups: any[] | string;\n private _optgroups: any[];\n\n /**\n * Set selected options. Can be array set with JS or as JSON string.\n * To get the current (user) selected options, use `getItems` method.\n */\n @Prop({ mutable: true }) items: string[] | string;\n private _items: string[];\n\n /**\n * Default items (used by reset)\n */\n @Prop({ mutable: true }) defaultItems: string[];\n\n /**\n * An array of property names to analyze when filtering options.\n * Weights can be given to each field to improve search result:\n * `[{\"field\":\"text\",\"weight\":2},{\"field\":\"text2\",\"weight\":0.5}]`\n */\n @Prop() searchField: string[] | string = [\"text\"];\n private _searchField: string[];\n\n /** Whether multiple items option can be selected */\n @Prop({ reflect: true }) multiple: boolean = false;\n\n /** Show inline (auto width) */\n @Prop({ reflect: true }) inline: boolean = false;\n\n /** Don't wrap words when using inline (auto width) */\n @Prop({ reflect: true }) noWrap: boolean = false;\n\n /** The max number of options to display in the dropdown. Set to `null` for an unlimited number of options. */\n @Prop() maxOptions: number | null = null;\n\n /** When searching for multiple terms (separated by space), this is the operator used. Can be 'and' or 'or' */\n @Prop() searchConjunction: \"and\" | \"or\" = \"and\";\n\n /** Transform applied to input value before e.g. search is executed */\n @Prop() transformLoadQuery: \"trim\" | \"trim-to-single-ws\" | \"join\" | Function =\n \"trim\";\n\n /** If true, any options with a \"\" value will be treated like a normal option. This defaults to false to accommodate the common <select> practice of having the first empty option to act as a placeholder. */\n @Prop() allowEmptyOption: boolean = false;\n\n /** Show the dropdown immediately when the control receives focus. */\n @Prop() openOnFocus: boolean = true;\n\n /** After a selection is made, the dropdown will remain open if in a multi-selection control or will close in a single-selection control. Setting closeAfterSelect to true will force the dropdown to close after selections are made. Setting closeAfterSelect to false will keep the dropdown open after selections are made. */\n @Prop() closeAfterSelect: boolean | null = null;\n\n /** Invoked when new options should be loaded from the server. Called with the current query string and a callback function to call with the results when they are loaded (or nothing when an error arises). */\n @Prop() load: (query: string, callback: Function) => any[] | null = null;\n\n /** Minimum of characters required to execute the `load` function */\n @Prop() minCharacters: number = 3;\n\n /** The number of milliseconds to wait before requesting options from the server or null. If null, throttling is disabled. Useful when loading options dynamically while the user types a search / filter expression. */\n @Prop() loadThrottle: number = 300;\n\n /** If true, the load function will be called upon control initialization (with an empty search). Alternatively it can be set to 'focus' to call the load function when control receives focus. */\n @Prop() preload: boolean | \"focus\" = false;\n\n /** The name of the property to render as an option / item label (not needed when custom rendering functions are defined). */\n @Prop() labelField: string = \"text\";\n\n /** The name of the property to use as the value when an item is selected. */\n @Prop() valueField: string = \"value\";\n\n /** Only used for Angular control value accessors. Use `items` property to define preselected options. */\n @Prop({ mutable: true }) value: string | string[] = \"\";\n\n /** The name of the property to group items by. */\n @Prop() optgroupField: string = \"optgroup\";\n\n /** The name of the property to render as an option group label (not needed when custom rendering functions are defined). */\n @Prop() optgroupLabelField: string = \"label\";\n\n /** The name of the option group property that serves as its unique identifier. */\n @Prop() optgroupValueField: string = \"value\";\n\n /** If truthy, all optgroups will be displayed in the same order as they were added (by the `$order` property). Otherwise, it will order based on the score of the results in each. */\n @Prop() lockOptgroupOrder: true;\n\n /** Name of hidden select element */\n @Prop({ reflect: true }) name: string = \"\";\n\n /** Initial open state */\n @Prop() open: boolean = false;\n\n /** Current open state (readonly) */\n @Prop({ reflect: true }) isOpen: boolean = false;\n\n /** Variant */\n @Prop({ reflect: true }) variant: \"default\" | \"plain\" | \"filter\" = \"default\";\n\n /** Size variant */\n @Prop({ reflect: true }) size: StzhDropdownSize = \"default\";\n\n /** Size variant (above small breakpoint) */\n @Prop({ reflect: true }) sizeSmall: StzhDropdownSize;\n\n /** Size variant (above medium breakpoint) */\n @Prop({ reflect: true }) sizeMedium: StzhDropdownSize;\n\n /** Size variant (above large breakpoint) */\n @Prop({ reflect: true }) sizeLarge: StzhDropdownSize;\n\n /** Size variant (above ultra breakpoint) */\n @Prop({ reflect: true }) sizeUltra: StzhDropdownSize;\n\n /** Whether the dropdown is disabled */\n @Prop({ reflect: true }) disabled: boolean = false;\n\n /** Popover placement */\n @Prop({ reflect: true }) popoverPlacement:\n | \"bottom\"\n | \"bottom-end\"\n | \"bottom-center\"\n | \"top\"\n | \"top-end\"\n | \"top-center\" = \"bottom\";\n\n /** Whether to stretch popover to fullwith of parent */\n @Prop({ reflect: true }) popoverFullwidth: \"horizontal\" | \"\" = \"\";\n\n /** Label */\n @Prop() label: string = \"\";\n\n /** Whether label should be truncate or not */\n @Prop() noLabelTruncate: boolean = false;\n\n /** Whether label should be visually hidden. */\n @Prop() labelHidden: boolean = false;\n\n /** Icon (use instead of icon slot) */\n @Prop() icon: string = \"\";\n\n /** Angle icon */\n @Prop() iconAngle: string = \"angle-down\";\n\n /** Prevent option search */\n @Prop() noSearch: boolean = false;\n\n /** Prevent backspace delete */\n @Prop() noBackspaceDelete: boolean = false;\n\n /** Invalid status */\n @Prop({ reflect: true }) invalid: boolean = false;\n\n /** Required status */\n @Prop({ reflect: true }) required: boolean = false;\n\n /** Hide `(optional)` label (or use `required` inside form to hide it) */\n @Prop({ reflect: true }) hideOptional: boolean = false;\n\n /** Description message (use description slot as alternative) */\n @Prop() description: string;\n\n /** Long description message appearing in a popover (use description-long slot as alternative) */\n @Prop() descriptionLong: string;\n\n /** Long description title appearing in a popover (use description-long-title slot as or description property alternative) */\n @Prop() descriptionLongTitle: string;\n\n /** One or multiple error message (use error slot as alternative) */\n @Prop() error: string | string[];\n private _error: string[];\n\n /** Translation strings */\n @Prop() localization: StzhDropdownLocalizedText;\n\n /** Id for element which describes the input (this will be overwritten if description prop or slot is used, used by stzh-radiogroup) */\n @Prop({ attribute: \"a11y-describedby\" }) a11yDescribedby: string = \"\";\n\n @Listen(\"reset\", { target: \"document\" })\n resetListener(event: Event) {\n if ((event.target as HTMLElement).contains(this.element)) {\n requestAnimationFrame(() => {\n this.handleReset();\n });\n }\n }\n\n @Watch(\"options\")\n optionsWatcher(newValue: any[] | string) {\n if (typeof newValue === \"string\") {\n this._options = JSON.parse(newValue);\n } else {\n this._options = newValue;\n }\n }\n\n @Watch(\"items\")\n itemsWatcher(newValue: string[] | string) {\n if (typeof newValue === \"string\") {\n this._items = JSON.parse(newValue);\n } else {\n this._items = newValue;\n }\n this.value = this._items;\n }\n\n @Watch(\"searchField\")\n searchFieldWatcher(newValue: string[] | string) {\n if (typeof newValue === \"string\") {\n this._searchField = JSON.parse(newValue);\n } else {\n this._searchField = newValue;\n }\n }\n\n @Watch(\"optgroups\")\n optgroupsWatcher(newValue: any[] | string) {\n if (typeof newValue === \"string\") {\n this._optgroups = JSON.parse(newValue);\n } else {\n this._optgroups = newValue;\n }\n }\n\n @Watch(\"error\")\n errorWatcher(newValue: string | string[]) {\n if (typeof newValue === \"string\") {\n try {\n this._error = JSON.parse(newValue);\n } catch (e) {\n if (newValue) {\n this._error = [newValue];\n } else {\n this._error = [];\n }\n }\n } else if (newValue) {\n this._error = newValue;\n } else {\n this._error = [];\n }\n }\n\n @Element() element: HTMLStzhDropdownElement;\n\n /**\n * Returns the value of the control.\n * If multiple items can be selected,\n * this returns an array, otherwise a string.\n */\n @Method()\n async getValue(): Promise<string | string[]> {\n return this.tomSelect.getValue();\n }\n\n /** Set new value */\n @Method()\n async setValue(newValue: string | string[], silent: boolean = false) {\n this.tomSelect.setValue(newValue, silent);\n }\n\n /** Reset loaded/cached search queries (calls from load property function) */\n @Method()\n async resetLoadedSearches() {\n this.tomSelect.loadedSearches = {};\n }\n\n /** Return loaded/cached search queries (calls from load property function) */\n @Method()\n async getLoadedSearches() {\n return this.tomSelect.loadedSearches;\n }\n\n /** Return current selected items */\n @Method()\n async getItems() {\n return this.tomSelect.items;\n }\n\n /** Load items by calling load property/function */\n @Method()\n async loadItems(query: string) {\n return this.tomSelect.load(query);\n }\n\n /** Show dropdown popover */\n @Method()\n async show() {\n return this.tomSelect.open();\n }\n\n /** Hide dropdown popover */\n @Method()\n async hide() {\n return this.tomSelect.close();\n }\n\n /** Dropdown change event */\n @Event() stzhChange: EventEmitter<StzhDropdownChangeEvent>;\n\n /** Dropdown item added event */\n @Event() stzhItemAdd: EventEmitter<StzhDropdownItemAddEvent>;\n\n /** Dropdown item removed event */\n @Event() stzhItemRemove: EventEmitter<StzhDropdownItemRemoveEvent>;\n\n /** Dropdown option added event */\n @Event() stzhOptionAdd: EventEmitter<StzhDropdownOptionAddEvent>;\n\n /** Dropdown option removed event */\n @Event() stzhOptionRemove: EventEmitter<StzhDropdownOptionRemoveEvent>;\n\n /** Dropdown open event */\n @Event() stzhOpen: EventEmitter<StzhDropdownOpenEvent>;\n\n /** Dropdown close event */\n @Event() stzhClose: EventEmitter<StzhDropdowCloseEvent>;\n\n /** Dropdown focus event */\n @Event() stzhFocus: EventEmitter<StzhDropdownFocusEvent>;\n\n /** Dropdown blur event */\n @Event() stzhBlur: EventEmitter<StzhDropdownBlurEvent>;\n\n /** Dropdown focus event */\n @Event() stzhInit: EventEmitter<StzhDropdowInitEvent>;\n\n private tomSelect: TomSelect;\n private select: HTMLSelectElement;\n private rootElement: HTMLElement;\n private dropdownWrapperElement: HTMLElement;\n private dropdownId: string;\n private focusedByInput: boolean = false;\n\n private updateFilled() {\n if (this._items?.length > 0) {\n this.rootElement.classList.add(CLASS_FILLED);\n this.element.setAttribute(\"is-filled\", \"true\");\n } else {\n this.rootElement.classList.remove(CLASS_FILLED);\n this.element.removeAttribute(\"is-filled\");\n }\n }\n\n private handleReset = () => {\n this.items = [...this.defaultItems];\n };\n\n private onRootFocus = () => {\n if (!this.focusedByInput) {\n this.tomSelect.focus();\n }\n\n this.focusedByInput = false;\n };\n\n async componentWillLoad() {\n this.dropdownId = `stzh-dropdown-${dropdownCounter++}`;\n\n this.optionsWatcher(this.options);\n this.optgroupsWatcher(this.optgroups);\n this.itemsWatcher(this.items);\n this.searchFieldWatcher(this.searchField);\n this.errorWatcher(this.error);\n\n this.defaultItems = this.defaultItems || this._items;\n\n if (!this.localization) {\n this.localization = await window.stzhComponents.utils.fetchTranslations(\n this.element,\n \"dropdown\"\n );\n }\n }\n\n componentShouldUpdate(_newValue, _oldValue, prop: string) {\n return [\"isOpen\", \"value\"].includes(prop) === false;\n }\n\n async componentWillUpdate() {\n if (this.tomSelect) {\n this.tomSelect.destroy();\n this.tomSelect = null;\n }\n }\n\n async componentDidRender() {\n if (this.tomSelect) {\n return;\n }\n\n const plugins = {};\n\n if (this.noSearch) {\n plugins[\"input_readonly\"] = {};\n } else {\n plugins[\"input_autogrow\"] = {};\n }\n\n if (this.noBackspaceDelete) {\n plugins[\"no_backspace_delete\"] = {};\n }\n\n if (this.multiple) {\n plugins[\"checkbox_options\"] = {};\n }\n\n if (this.multiple || this.variant === \"filter\") {\n plugins[\"remove_button\"] = {\n title: this.localization.removeButtonTitle,\n label:\n '<stzh-icon name=\"close-big\" class=\"stzh-dropdown__remove-icon\"></stzh-icon>',\n };\n }\n\n const tomSelectOptions: any = {\n dropdownParent: this.dropdownWrapperElement,\n openDisplay: \"flex\",\n plugins,\n maxItems: this.multiple ? null : 1,\n maxOptions: this.maxOptions,\n items: this._items,\n optgroups: this._optgroups,\n searchField: this._searchField,\n searchConjunction: this.searchConjunction,\n allowEmptyOption: this.allowEmptyOption,\n closeAfterSelect:\n this.closeAfterSelect !== null ? this.closeAfterSelect : !this.multiple,\n labelField: this.labelField,\n valueField: this.valueField,\n optgroupField: this.optgroupField,\n optgroupLabelField: this.optgroupLabelField,\n optgroupValueField: this.optgroupValueField,\n lockOptgroupOrder: this.lockOptgroupOrder,\n load: this.load,\n transformLoadQuery: (inputValue: string) => {\n if (typeof this.transformLoadQuery === \"function\") {\n return this.transformLoadQuery(inputValue);\n } else if (this.transformLoadQuery === \"join\") {\n const lastQueries = Array.from(this.tomSelect.controlChildren()).map(\n (element: HTMLElement) => element.innerText\n );\n\n return (\n (lastQueries.length > 0\n ? lastQueries.join(\" \") + (inputValue ? \" \" : \"\")\n : \"\") + inputValue.replace(/\\s\\s+/g, \" \")\n );\n } else if (this.transformLoadQuery === \"trim-to-single-ws\") {\n return inputValue.replace(/\\s\\s+/g, \" \");\n } else {\n return inputValue.trim();\n }\n },\n shouldLoad: (query: string) => {\n return query.length >= this.minCharacters;\n },\n loadThrottle: this.loadThrottle,\n preload: this.preload,\n openOnFocus: this.openOnFocus,\n loadingClass: \"is-loading\",\n hideSelected: false,\n duplicates: false,\n delimiter: \",\",\n copyClassesToDropdown: false,\n hidePlaceholder: null,\n // if you want the user to be able to add own items enable this option\n // (but checkbox_options plugin throws an error and would need a fix first)\n // create: function(input, callback) {\n // callback({ value: input, text: input });\n // },\n // createOnBlur: false,\n // createFilter: null,\n // persist: false,\n render: {\n option: (data, escape) => {\n return `\n <div class=\"stzh-dropdown__option\">\n <span class=\"stzh-dropdown__option-title\">\n ${escape(data[this.labelField])}\n </span>\n <stzh-icon name=\"checkmark\" class=\"stzh-dropdown__option-check\"></stzh-icon>\n </div>\n `;\n },\n item: (data, escape) => {\n return `\n <div class=\"stzh-dropdown__item\">\n ${escape(data[this.labelField])}\n </div>\n `;\n },\n option_create: (data, escape) => {\n return `\n <div class=\"stzh-dropdown__create\">\n ${this.localization.create.replace(\n /\\{x\\}/gi,\n escape(data.input)\n )}&hellip;\n </div>\n `;\n },\n no_results: (data, escape) => {\n return `\n <div class=\"stzh-dropdown__no-results\" id=\"${\n this.dropdownId\n }-no-results\">\n ${this.localization.noResults.replace(\n /\\{x\\}/gi,\n escape(data.input)\n )}\n </div>`;\n },\n not_loading:\n this.load === null\n ? null\n : (_data, escape) => {\n return `\n <div class=\"stzh-dropdown__not-loading\" id=\"${\n this.dropdownId\n }-not-loading\">\n ${this.localization.notLoading.replace(\n /\\{x\\}/gi,\n escape(this.minCharacters.toString())\n )}\n </div>\n `;\n },\n optgroup: (data) => {\n let optgroup = document.createElement(\"div\");\n optgroup.className = \"stzh-dropdown__optgroup\";\n optgroup.appendChild(data.options);\n return optgroup;\n },\n optgroup_header: (data, escape) => {\n return `\n <div class=\"stzh-dropdown__optgroup-header\">\n ${escape(data.label)}\n </div>\n `;\n },\n loading: () => {\n return `\n <div class=\"stzh-dropdown__loader\">\n <stzh-loader></stzh-loader>\n </div>\n `;\n },\n dropdown: () => {\n return `<div class=\"stzh-dropdown__dropdown\"></div>`;\n },\n },\n onChange: (value) => {\n this._items = this.tomSelect.items;\n this.updateFilled();\n this.value = this.multiple ? this._items : this._items[0];\n this.stzhChange.emit({\n component: \"stzh-dropdown\",\n value,\n });\n },\n onItemAdd: (value) => {\n this._items = this.tomSelect.items;\n this.stzhItemAdd.emit({\n component: \"stzh-dropdown\",\n value,\n });\n },\n onItemRemove: (value) => {\n this._items = this.tomSelect.items;\n this.stzhItemRemove.emit({\n component: \"stzh-dropdown\",\n value,\n });\n },\n onOptionAdd: (value) => {\n this._options = this.tomSelect.options;\n this.updateFilled();\n\n this.stzhOptionAdd.emit({\n component: \"stzh-dropdown\",\n value,\n });\n },\n onOptionRemove: (value) => {\n this._options = this.tomSelect.options;\n this.updateFilled();\n\n this.stzhOptionRemove.emit({\n component: \"stzh-dropdown\",\n value,\n });\n },\n onDropdownOpen: () => {\n this.isOpen = true;\n this.stzhOpen.emit({\n component: \"stzh-dropdown\",\n });\n },\n onDropdownClose: () => {\n this.isOpen = false;\n this.stzhClose.emit({\n component: \"stzh-dropdown\",\n });\n },\n onFocus: () => {\n this.focusedByInput = true;\n\n if (this.tomSelect.load && this.preload === \"focus\") {\n // to be able to execute load function again, we reset loaded searches\n this.resetLoadedSearches();\n\n // if results have been preloaded before, load them now directly with load function\n if (this.tomSelect.wrapper.classList.contains(\"preloaded\")) {\n // since tomSelect.preload() doesn't call tomSelect.shouldCall() method internally (to check for minCharacters),\n // we will also not call it (this.tomSelect.settings.shouldLoad.call(this.tomSelect, ''))\n this.tomSelect.load(\"\");\n }\n }\n\n this.rootElement.classList.add(CLASS_FOCUS);\n const focusEvent = new FocusEvent(\"focus\", {\n view: window,\n bubbles: false,\n cancelable: false,\n });\n\n this.element.dispatchEvent(focusEvent);\n this.stzhFocus.emit({\n component: \"stzh-dropdown\",\n originalEvent: {\n target: this.tomSelect.control,\n },\n });\n },\n onBlur: () => {\n this.rootElement.classList.remove(CLASS_FOCUS);\n const blurEvent = new FocusEvent(\"blur\", {\n view: window,\n bubbles: false,\n cancelable: false,\n });\n\n this.element.dispatchEvent(blurEvent);\n this.stzhBlur.emit({\n component: \"stzh-dropdown\",\n });\n },\n onInitialize: () => {\n this.stzhInit.emit({\n component: \"stzh-dropdown\",\n });\n },\n onLoad: () => {\n this._options = this.tomSelect.options;\n },\n };\n\n if (this._options) {\n tomSelectOptions.options = this._options;\n }\n\n if (this._optgroups) {\n tomSelectOptions.optgroups = this._optgroups;\n }\n\n if (this._items) {\n tomSelectOptions.items = this._items;\n }\n\n this.updateFilled();\n this.tomSelect = new TomSelect(this.select, tomSelectOptions);\n\n if (!this.openOnFocus) {\n // we still want to enable opening the dropdown by click\n this.tomSelect.control.addEventListener(\n \"click\",\n (event) => {\n try {\n event.preventDefault(); // Ensure this works without error\n } catch {console.log('preventDefault failed')}\n this.tomSelect.open();\n },\n // passive false, otherwise angular wrapper will cause error\n { passive: false }\n );\n }\n\n if (this.open) {\n this.show();\n }\n }\n\n disconnectedCallback() {\n if (this.tomSelect) {\n this.tomSelect.destroy();\n this.tomSelect = null;\n }\n }\n\n render() {\n const iconUsed = hasSlot(this.element, \"icon\") || !!this.icon;\n const descriptionUsed =\n hasSlot(this.element, \"description\") || !!this.description;\n const descriptionLongUsed =\n hasSlot(this.element, \"description-long\") || !!this.descriptionLong;\n const errorUsed = hasSlot(this.element, \"error\") || this._error?.length > 0;\n\n const classes = {\n \"stzh-dropdown\": true,\n \"stzh-dropdown--is-inline\": this.inline,\n \"stzh-dropdown--has-no-wrap\": this.noWrap,\n \"stzh-dropdown--is-multiple\": this.multiple,\n \"stzh-dropdown--is-disabled\": this.disabled,\n \"stzh-dropdown--is-required\": this.required,\n \"stzh-dropdown--is-invalid\": this.invalid || errorUsed,\n [CLASS_FILLED]: this._items && this._items.length > 0,\n \"stzh-dropdown--has-icon\": iconUsed,\n \"stzh-dropdown--has-description\": descriptionUsed,\n \"stzh-dropdown--has-description-long\": descriptionLongUsed,\n \"stzh-dropdown--has-error\": errorUsed,\n \"stzh-dropdown--has-no-search\": this.noSearch,\n \"stzh-dropdown--has-label-hidden\": this.labelHidden,\n [`stzh-dropdown--popover-placement-${this.popoverPlacement}`]:\n !!this.popoverPlacement,\n [`stzh-dropdown--popover-fullwidth-${this.popoverFullwidth}`]:\n !!this.popoverFullwidth,\n [`stzh-dropdown--size-${this.size}`]: !!this.size,\n [`stzh-dropdown--${this.variant}`]: !!this.variant,\n };\n\n return (\n <Host\n is-invalid={this.invalid || errorUsed}\n tabindex={this.disabled ? null : \"-1\"}\n onFocus={this.onRootFocus}\n >\n <div\n class={classes}\n ref={(el) => (this.rootElement = el as HTMLDivElement)}\n >\n <div class=\"stzh-dropdown__wrapper\">\n <label\n id={`${this.dropdownId}-label`}\n class={{\n \"stzh-dropdown__label\": true,\n \"no-label-truncate\": this.noLabelTruncate,\n }}\n htmlFor={this.dropdownId}\n >\n {this.label ? this.label : <slot name=\"label\"></slot>}\n {!this.hideOptional && (\n <span class=\"stzh-dropdown__marker\">\n <span class=\"stzh-dropdown__marker-symbol\" aria-hidden=\"true\">\n {this.required\n ? this.localization.$globals.requiredFieldMarker\n : this.localization.$globals.optionalFieldMarker}\n </span>\n <span class=\"stzh-dropdown__marker-text\">\n {this.required\n ? this.localization.$globals.requiredFieldText\n : this.localization.$globals.optionalFieldText}\n </span>\n </span>\n )}\n </label>\n\n <div class=\"stzh-dropdown__field-wrapper\">\n {/* tom-select replaces this select with an combobox.\n Since it doesn't support aria-(describedby/required/invalid),\n we write necessary status information in the aria-labelledby */}\n <select\n id={this.dropdownId}\n class=\"stzh-dropdown__select\"\n ref={(el) => (this.select = el as HTMLSelectElement)}\n multiple={this.multiple}\n name={this.name}\n disabled={this.disabled}\n aria-labelledby={`${this.dropdownId}-label ${\n this.dropdownId\n }-not-loading ${this.dropdownId}-no-results ${\n this.hideOptional &&\n this.required &&\n `${this.dropdownId}-required`\n } ${this.invalid && `${this.dropdownId}-invalid`} ${\n this.dropdownId\n }-description ${this.a11yDescribedby}`}\n >\n <slot></slot>\n </select>\n\n {this.inline && this.label && (\n <div class=\"stzh-dropdown__sizer\">{this.label}</div>\n )}\n\n <div class=\"stzh-dropdown__icon-angle-wrapper\">\n {this.iconAngle ? (\n <stzh-icon\n name={this.iconAngle}\n class=\"stzh-dropdown__icon-angle\"\n ></stzh-icon>\n ) : (\n <slot name=\"icon-angle\"></slot>\n )}\n </div>\n\n <div class=\"stzh-dropdown__icon-wrapper\">\n {this.icon ? (\n <stzh-icon\n class=\"stzh-dropdown__icon\"\n name={this.icon}\n ></stzh-icon>\n ) : (\n <slot name=\"icon\"></slot>\n )}\n </div>\n\n {this.hideOptional && this.required && (\n <div\n id={`${this.dropdownId}-required`}\n class=\"stzh-dropdown__vhidden\"\n >\n {this.localization.$globals.requiredFieldText}\n </div>\n )}\n\n {this.invalid && (\n <div\n id={`${this.dropdownId}-invalid`}\n class=\"stzh-dropdown__vhidden\"\n >\n {this.localization.$globals.invalidFieldText}\n </div>\n )}\n </div>\n </div>\n\n <div\n class=\"stzh-dropdown__dropdown-wrapper\"\n ref={(el) => (this.dropdownWrapperElement = el as HTMLDivElement)}\n ></div>\n\n {(this._error?.length > 0 ||\n this.description ||\n this.descriptionLong) && (\n <StzhInputDescription\n classPrefix=\"stzh-dropdown\"\n id={`${this.dropdownId}-description`}\n error={this._error}\n description={this.description}\n descriptionLong={this.descriptionLong}\n descriptionLongTitle={this.descriptionLongTitle}\n descriptionLongUsed={descriptionLongUsed}\n moreInfoButtonLabel={\n this.localization.$globals.moreInfoButtonLabel\n }\n />\n )}\n </div>\n </Host>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"stzh-dropdown.js","sourceRoot":"","sources":["../../../../src/components/stzh-dropdown/stzh-dropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,IAAI,EACJ,IAAI,EACJ,CAAC,EACD,OAAO,EACP,KAAK,EACL,MAAM,EACN,KAAK,EAEL,MAAM,GACP,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAmB5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAE5E,OAAO,SAAS,MAAM,8CAA8C,CAAC;AACrE,OAAO,qBAAqB,MAAM,gEAAgE,CAAC;AACnG,OAAO,wBAAwB,MAAM,mEAAmE,CAAC;AACzG,OAAO,sBAAsB,MAAM,iEAAiE,CAAC;AACrG,OAAO,0BAA0B,MAAM,sEAAsE,CAAC;AAE9G,MAAM,sBAAsB,GAAG,UAAU,eAAe;IACtD,MAAM,IAAI,GAAG,IAAI,CAAC;IAElB,IAAI,CAAC,EAAE,CAAC,YAAY,EAAE,GAAG,EAAE;QACzB,MAAM,KAAK,GAAG,IAAI,CAAC,aAAiC,CAAC;QACrD,IAAI,KAAK;YAAE,KAAK,CAAC,QAAQ,GAAG,IAAI,CAAC;IACnC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,MAAM,YAAY,GAAG,0BAA0B,CAAC;AAChD,MAAM,WAAW,GAAG,0BAA0B,CAAC;AAE/C,SAAS,CAAC,MAAM,CAAC,eAAe,EAAE,qBAAqB,CAAC,CAAC;AACzD,SAAS,CAAC,MAAM,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n Component,\n Host,\n Prop,\n h,\n Element,\n Watch,\n Method,\n Event,\n EventEmitter,\n Listen,\n} from \"@stencil/core\";\n\nimport { hasSlot } from \"../../utils/utils\";\n\nimport {\n StzhDropdownSize,\n StzhDropdownOption,\n StzhDropdownChangeEvent,\n StzhDropdownItemAddEvent,\n StzhDropdownItemRemoveEvent,\n StzhDropdownOptionAddEvent,\n StzhDropdownOptionRemoveEvent,\n StzhDropdownOpenEvent,\n StzhDropdowCloseEvent,\n StzhDropdownFocusEvent,\n StzhDropdownBlurEvent,\n StzhDropdowInitEvent,\n} from \"../../index\";\n\nimport { StzhDropdownLocalizedText } from \"./stzh-dropdown.localization\";\n\nimport { StzhInputDescription } from \"../stzh-input/stzh-input-description\";\n\nimport TomSelect from \"../../libraries/tom-select/esm/tom-select.js\";\nimport TomSelectRemoveButton from \"../../libraries/tom-select/esm/plugins/remove_button/plugin.js\";\nimport TomSelectCheckboxOptions from \"../../libraries/tom-select/esm/plugins/checkbox_options/plugin.js\";\nimport TomSelectInputAutogrow from \"../../libraries/tom-select/esm/plugins/input_autogrow/plugin.js\";\nimport TomSelectNoBackspaceDelete from \"../../libraries/tom-select/esm/plugins/no_backspace_delete/plugin.js\";\n\nconst TomSelectInputReadonly = function (_plugin_options) {\n const self = this;\n\n self.on(\"initialize\", () => {\n const input = self.control_input as HTMLInputElement;\n if (input) input.readOnly = true;\n });\n};\n\nconst CLASS_FILLED = \"stzh-dropdown--is-filled\";\nconst CLASS_FOCUS = \"stzh-dropdown--has-focus\";\n\nTomSelect.define(\"remove_button\", TomSelectRemoveButton);\nTomSelect.define(\"checkbox_options\", TomSelectCheckboxOptions);\nTomSelect.define(\"input_autogrow\", TomSelectInputAutogrow);\nTomSelect.define(\"no_backspace_delete\", TomSelectNoBackspaceDelete);\nTomSelect.define(\"input_readonly\", TomSelectInputReadonly);\n\nlet dropdownCounter = 0;\n\n/**\n * @slot label - Slot for label content\n * @slot description - Slot for description\n * @slot description-long - Slot for long description (in popover)\n * @slot description-long-title - Slot for long description title (in popover) / instead of descriptionLongTitle or description property\n * @slot icon - Slot for left icon\n * @slot icon-angle - Slot for angle icon\n * @slot error - Slot for error\n */\n@Component({\n tag: \"stzh-dropdown\",\n styleUrl: \"stzh-dropdown.scss\",\n})\nexport class StzhDropdown {\n /** Available options */\n @Prop() options: StzhDropdownOption[] | string;\n private _options: StzhDropdownOption[];\n\n /**\n * Option groups that options will be bucketed into.\n * Make sure each object in the array has a property named whatever `optgroupValueField` is set to.\n */\n @Prop() optgroups: any[] | string;\n private _optgroups: any[];\n\n /**\n * Set selected options. Can be array set with JS or as JSON string.\n * To get the current (user) selected options, use `getItems` method.\n */\n @Prop({ mutable: true }) items: string[] | string;\n private _items: string[];\n\n /**\n * Default items (used by reset)\n */\n @Prop({ mutable: true }) defaultItems: string[];\n\n /**\n * An array of property names to analyze when filtering options.\n * Weights can be given to each field to improve search result:\n * `[{\"field\":\"text\",\"weight\":2},{\"field\":\"text2\",\"weight\":0.5}]`\n */\n @Prop() searchField: string[] | string = [\"text\"];\n private _searchField: string[];\n\n /** Whether multiple items option can be selected */\n @Prop({ reflect: true }) multiple: boolean = false;\n\n /** Show inline (auto width) */\n @Prop({ reflect: true }) inline: boolean = false;\n\n /** Don't wrap words when using inline (auto width) */\n @Prop({ reflect: true }) noWrap: boolean = false;\n\n /** The max number of options to display in the dropdown. Set to `null` for an unlimited number of options. */\n @Prop() maxOptions: number | null = null;\n\n /** When searching for multiple terms (separated by space), this is the operator used. Can be 'and' or 'or' */\n @Prop() searchConjunction: \"and\" | \"or\" = \"and\";\n\n /** Transform applied to input value before e.g. search is executed */\n @Prop() transformLoadQuery: \"trim\" | \"trim-to-single-ws\" | \"join\" | Function =\n \"trim\";\n\n /** If true, any options with a \"\" value will be treated like a normal option. This defaults to false to accommodate the common <select> practice of having the first empty option to act as a placeholder. */\n @Prop() allowEmptyOption: boolean = false;\n\n /** Show the dropdown immediately when the control receives focus. */\n @Prop() openOnFocus: boolean = true;\n\n /** After a selection is made, the dropdown will remain open if in a multi-selection control or will close in a single-selection control. Setting closeAfterSelect to true will force the dropdown to close after selections are made. Setting closeAfterSelect to false will keep the dropdown open after selections are made. */\n @Prop() closeAfterSelect: boolean | null = null;\n\n /** Invoked when new options should be loaded from the server. Called with the current query string and a callback function to call with the results when they are loaded (or nothing when an error arises). */\n @Prop() load: (query: string, callback: Function) => any[] | null = null;\n\n /** Minimum of characters required to execute the `load` function */\n @Prop() minCharacters: number = 3;\n\n /** The number of milliseconds to wait before requesting options from the server or null. If null, throttling is disabled. Useful when loading options dynamically while the user types a search / filter expression. */\n @Prop() loadThrottle: number = 300;\n\n /** If true, the load function will be called upon control initialization (with an empty search). Alternatively it can be set to 'focus' to call the load function when control receives focus. */\n @Prop() preload: boolean | \"focus\" = false;\n\n /** The name of the property to render as an option / item label (not needed when custom rendering functions are defined). */\n @Prop() labelField: string = \"text\";\n\n /** The name of the property to use as the value when an item is selected. */\n @Prop() valueField: string = \"value\";\n\n /** Only used for Angular control value accessors. Use `items` property to define preselected options. */\n @Prop({ mutable: true }) value: string | string[] = \"\";\n\n /** The name of the property to group items by. */\n @Prop() optgroupField: string = \"optgroup\";\n\n /** The name of the property to render as an option group label (not needed when custom rendering functions are defined). */\n @Prop() optgroupLabelField: string = \"label\";\n\n /** The name of the option group property that serves as its unique identifier. */\n @Prop() optgroupValueField: string = \"value\";\n\n /** If truthy, all optgroups will be displayed in the same order as they were added (by the `$order` property). Otherwise, it will order based on the score of the results in each. */\n @Prop() lockOptgroupOrder: true;\n\n /** Name of hidden select element */\n @Prop({ reflect: true }) name: string = \"\";\n\n /** Initial open state */\n @Prop() open: boolean = false;\n\n /** Current open state (readonly) */\n @Prop({ reflect: true }) isOpen: boolean = false;\n\n /** Variant */\n @Prop({ reflect: true }) variant: \"default\" | \"plain\" | \"filter\" = \"default\";\n\n /** Size variant */\n @Prop({ reflect: true }) size: StzhDropdownSize = \"default\";\n\n /** Size variant (above small breakpoint) */\n @Prop({ reflect: true }) sizeSmall: StzhDropdownSize;\n\n /** Size variant (above medium breakpoint) */\n @Prop({ reflect: true }) sizeMedium: StzhDropdownSize;\n\n /** Size variant (above large breakpoint) */\n @Prop({ reflect: true }) sizeLarge: StzhDropdownSize;\n\n /** Size variant (above ultra breakpoint) */\n @Prop({ reflect: true }) sizeUltra: StzhDropdownSize;\n\n /** Whether the dropdown is disabled */\n @Prop({ reflect: true }) disabled: boolean = false;\n\n /** Popover placement */\n @Prop({ reflect: true }) popoverPlacement:\n | \"bottom\"\n | \"bottom-end\"\n | \"bottom-center\"\n | \"top\"\n | \"top-end\"\n | \"top-center\" = \"bottom\";\n\n /** Whether to stretch popover to fullwith of parent */\n @Prop({ reflect: true }) popoverFullwidth: \"horizontal\" | \"\" = \"\";\n\n /** Label */\n @Prop() label: string = \"\";\n\n /** Whether label should be truncate or not */\n @Prop() noLabelTruncate: boolean = false; \n\n /** Whether label should be visually hidden. */\n @Prop() labelHidden: boolean = false;\n\n /** Icon (use instead of icon slot) */\n @Prop() icon: string = \"\";\n\n /** Angle icon */\n @Prop() iconAngle: string = \"angle-down\";\n\n /** Prevent option search */\n @Prop() noSearch: boolean = false;\n\n /** Prevent backspace delete */\n @Prop() noBackspaceDelete: boolean = false;\n\n /** Invalid status */\n @Prop({ reflect: true }) invalid: boolean = false;\n\n /** Required status */\n @Prop({ reflect: true }) required: boolean = false;\n\n /** Hide `(optional)` label (or use `required` inside form to hide it) */\n @Prop({ reflect: true }) hideOptional: boolean = false;\n\n /** Description message (use description slot as alternative) */\n @Prop() description: string;\n\n /** Long description message appearing in a popover (use description-long slot as alternative) */\n @Prop() descriptionLong: string;\n\n /** Long description title appearing in a popover (use description-long-title slot as or description property alternative) */\n @Prop() descriptionLongTitle: string;\n\n /** One or multiple error message (use error slot as alternative) */\n @Prop() error: string | string[];\n private _error: string[];\n\n /** Translation strings */\n @Prop() localization: StzhDropdownLocalizedText;\n\n /** Id for element which describes the input (this will be overwritten if description prop or slot is used, used by stzh-radiogroup) */\n @Prop({ attribute: \"a11y-describedby\" }) a11yDescribedby: string = \"\";\n\n @Listen(\"reset\", { target: \"document\" })\n resetListener(event: Event) {\n if ((event.target as HTMLElement).contains(this.element)) {\n requestAnimationFrame(() => {\n this.handleReset();\n });\n }\n }\n\n @Watch(\"options\")\n optionsWatcher(newValue: any[] | string) {\n if (typeof newValue === \"string\") {\n this._options = JSON.parse(newValue);\n } else {\n this._options = newValue;\n }\n }\n\n @Watch(\"items\")\n itemsWatcher(newValue: string[] | string) {\n if (typeof newValue === \"string\") {\n this._items = JSON.parse(newValue);\n } else {\n this._items = newValue;\n }\n this.value = this._items;\n }\n\n @Watch(\"searchField\")\n searchFieldWatcher(newValue: string[] | string) {\n if (typeof newValue === \"string\") {\n this._searchField = JSON.parse(newValue);\n } else {\n this._searchField = newValue;\n }\n }\n\n @Watch(\"optgroups\")\n optgroupsWatcher(newValue: any[] | string) {\n if (typeof newValue === \"string\") {\n this._optgroups = JSON.parse(newValue);\n } else {\n this._optgroups = newValue;\n }\n }\n\n @Watch(\"error\")\n errorWatcher(newValue: string | string[]) {\n if (typeof newValue === \"string\") {\n try {\n this._error = JSON.parse(newValue);\n } catch (e) {\n if (newValue) {\n this._error = [newValue];\n } else {\n this._error = [];\n }\n }\n } else if (newValue) {\n this._error = newValue;\n } else {\n this._error = [];\n }\n }\n\n @Element() element: HTMLStzhDropdownElement;\n\n /**\n * Returns the value of the control.\n * If multiple items can be selected,\n * this returns an array, otherwise a string.\n */\n @Method()\n async getValue(): Promise<string | string[]> {\n return this.tomSelect.getValue();\n }\n\n /** Set new value */\n @Method()\n async setValue(newValue: string | string[], silent: boolean = false) {\n this.tomSelect.setValue(newValue, silent);\n }\n\n /** Reset loaded/cached search queries (calls from load property function) */\n @Method()\n async resetLoadedSearches() {\n this.tomSelect.loadedSearches = {};\n }\n\n /** Return loaded/cached search queries (calls from load property function) */\n @Method()\n async getLoadedSearches() {\n return this.tomSelect.loadedSearches;\n }\n\n /** Return current selected items */\n @Method()\n async getItems() {\n return this.tomSelect.items;\n }\n\n /** Load items by calling load property/function */\n @Method()\n async loadItems(query: string) {\n return this.tomSelect.load(query);\n }\n\n /** Show dropdown popover */\n @Method()\n async show() {\n return this.tomSelect.open();\n }\n\n /** Hide dropdown popover */\n @Method()\n async hide() {\n return this.tomSelect.close();\n }\n\n /** Dropdown change event */\n @Event() stzhChange: EventEmitter<StzhDropdownChangeEvent>;\n\n /** Dropdown item added event */\n @Event() stzhItemAdd: EventEmitter<StzhDropdownItemAddEvent>;\n\n /** Dropdown item removed event */\n @Event() stzhItemRemove: EventEmitter<StzhDropdownItemRemoveEvent>;\n\n /** Dropdown option added event */\n @Event() stzhOptionAdd: EventEmitter<StzhDropdownOptionAddEvent>;\n\n /** Dropdown option removed event */\n @Event() stzhOptionRemove: EventEmitter<StzhDropdownOptionRemoveEvent>;\n\n /** Dropdown open event */\n @Event() stzhOpen: EventEmitter<StzhDropdownOpenEvent>;\n\n /** Dropdown close event */\n @Event() stzhClose: EventEmitter<StzhDropdowCloseEvent>;\n\n /** Dropdown focus event */\n @Event() stzhFocus: EventEmitter<StzhDropdownFocusEvent>;\n\n /** Dropdown blur event */\n @Event() stzhBlur: EventEmitter<StzhDropdownBlurEvent>;\n\n /** Dropdown focus event */\n @Event() stzhInit: EventEmitter<StzhDropdowInitEvent>;\n\n private tomSelect: TomSelect;\n private select: HTMLSelectElement;\n private rootElement: HTMLElement;\n private dropdownWrapperElement: HTMLElement;\n private dropdownId: string;\n private focusedByInput: boolean = false;\n\n private updateFilled() {\n if (this._items?.length > 0) {\n this.rootElement.classList.add(CLASS_FILLED);\n this.element.setAttribute(\"is-filled\", \"true\");\n } else {\n this.rootElement.classList.remove(CLASS_FILLED);\n this.element.removeAttribute(\"is-filled\");\n }\n }\n\n private handleReset = () => {\n this.items = [...this.defaultItems];\n };\n\n private onRootFocus = () => {\n if (!this.focusedByInput) {\n this.tomSelect.focus();\n }\n\n this.focusedByInput = false;\n };\n\n async componentWillLoad() {\n this.dropdownId = `stzh-dropdown-${dropdownCounter++}`;\n\n this.optionsWatcher(this.options);\n this.optgroupsWatcher(this.optgroups);\n this.itemsWatcher(this.items);\n this.searchFieldWatcher(this.searchField);\n this.errorWatcher(this.error);\n\n this.defaultItems = this.defaultItems || this._items;\n\n if (!this.localization) {\n this.localization = await window.stzhComponents.utils.fetchTranslations(\n this.element,\n \"dropdown\"\n );\n }\n }\n\n componentShouldUpdate(_newValue, _oldValue, prop: string) {\n return [\"isOpen\", \"value\"].includes(prop) === false;\n }\n\n async componentWillUpdate() {\n if (this.tomSelect) {\n this.tomSelect.destroy();\n this.tomSelect = null;\n }\n }\n\n async componentDidRender() {\n if (this.tomSelect) {\n return;\n }\n\n const plugins = {};\n\n if (this.noSearch) {\n plugins[\"input_readonly\"] = {};\n } else {\n plugins[\"input_autogrow\"] = {};\n }\n\n if (this.noBackspaceDelete) {\n plugins[\"no_backspace_delete\"] = {};\n }\n\n if (this.multiple) {\n plugins[\"checkbox_options\"] = {};\n }\n\n if (this.multiple || this.variant === \"filter\") {\n plugins[\"remove_button\"] = {\n title: this.localization.removeButtonTitle,\n label:\n '<stzh-icon name=\"close-big\" class=\"stzh-dropdown__remove-icon\"></stzh-icon>',\n };\n }\n\n const tomSelectOptions: any = {\n dropdownParent: this.dropdownWrapperElement,\n openDisplay: \"flex\",\n plugins,\n maxItems: this.multiple ? null : 1,\n maxOptions: this.maxOptions,\n items: this._items,\n optgroups: this._optgroups,\n searchField: this._searchField,\n searchConjunction: this.searchConjunction,\n allowEmptyOption: this.allowEmptyOption,\n closeAfterSelect:\n this.closeAfterSelect !== null ? this.closeAfterSelect : !this.multiple,\n labelField: this.labelField,\n valueField: this.valueField,\n optgroupField: this.optgroupField,\n optgroupLabelField: this.optgroupLabelField,\n optgroupValueField: this.optgroupValueField,\n lockOptgroupOrder: this.lockOptgroupOrder,\n load: this.load,\n transformLoadQuery: (inputValue: string) => {\n if (typeof this.transformLoadQuery === \"function\") {\n return this.transformLoadQuery(inputValue);\n } else if (this.transformLoadQuery === \"join\") {\n const lastQueries = Array.from(this.tomSelect.controlChildren()).map(\n (element: HTMLElement) => element.innerText\n );\n\n return (\n (lastQueries.length > 0\n ? lastQueries.join(\" \") + (inputValue ? \" \" : \"\")\n : \"\") + inputValue.replace(/\\s\\s+/g, \" \")\n );\n } else if (this.transformLoadQuery === \"trim-to-single-ws\") {\n return inputValue.replace(/\\s\\s+/g, \" \");\n } else {\n return inputValue.trim();\n }\n },\n shouldLoad: (query: string) => {\n return query.length >= this.minCharacters;\n },\n loadThrottle: this.loadThrottle,\n preload: this.preload,\n openOnFocus: this.openOnFocus,\n loadingClass: \"is-loading\",\n hideSelected: false,\n duplicates: false,\n delimiter: \",\",\n copyClassesToDropdown: false,\n hidePlaceholder: null,\n // if you want the user to be able to add own items enable this option\n // (but checkbox_options plugin throws an error and would need a fix first)\n // create: function(input, callback) {\n // callback({ value: input, text: input });\n // },\n // createOnBlur: false,\n // createFilter: null,\n // persist: false,\n render: {\n option: (data, escape) => {\n return `\n <div class=\"stzh-dropdown__option\">\n <span class=\"stzh-dropdown__option-title\">\n ${escape(data[this.labelField])}\n </span>\n <stzh-icon name=\"checkmark\" class=\"stzh-dropdown__option-check\"></stzh-icon>\n </div>\n `;\n },\n item: (data, escape) => {\n return `\n <div class=\"stzh-dropdown__item\">\n ${escape(data[this.labelField])}\n </div>\n `;\n },\n option_create: (data, escape) => {\n return `\n <div class=\"stzh-dropdown__create\">\n ${this.localization.create.replace(\n /\\{x\\}/gi,\n escape(data.input)\n )}&hellip;\n </div>\n `;\n },\n no_results: (data, escape) => {\n return `\n <div class=\"stzh-dropdown__no-results\" id=\"${\n this.dropdownId\n }-no-results\">\n ${this.localization.noResults.replace(\n /\\{x\\}/gi,\n escape(data.input)\n )}\n </div>`;\n },\n not_loading:\n this.load === null\n ? null\n : (_data, escape) => {\n return `\n <div class=\"stzh-dropdown__not-loading\" id=\"${\n this.dropdownId\n }-not-loading\">\n ${this.localization.notLoading.replace(\n /\\{x\\}/gi,\n escape(this.minCharacters.toString())\n )}\n </div>\n `;\n },\n optgroup: (data) => {\n let optgroup = document.createElement(\"div\");\n optgroup.className = \"stzh-dropdown__optgroup\";\n optgroup.appendChild(data.options);\n return optgroup;\n },\n optgroup_header: (data, escape) => {\n return `\n <div class=\"stzh-dropdown__optgroup-header\">\n ${escape(data.label)}\n </div>\n `;\n },\n loading: () => {\n return `\n <div class=\"stzh-dropdown__loader\">\n <stzh-loader></stzh-loader>\n </div>\n `;\n },\n dropdown: () => {\n return `<div class=\"stzh-dropdown__dropdown\"></div>`;\n },\n },\n onChange: (value) => {\n this._items = this.tomSelect.items;\n this.updateFilled();\n this.value = this.multiple ? this._items : this._items[0];\n this.stzhChange.emit({\n component: \"stzh-dropdown\",\n value,\n });\n },\n onItemAdd: (value) => {\n this._items = this.tomSelect.items;\n this.stzhItemAdd.emit({\n component: \"stzh-dropdown\",\n value,\n });\n },\n onItemRemove: (value) => {\n this._items = this.tomSelect.items;\n this.stzhItemRemove.emit({\n component: \"stzh-dropdown\",\n value,\n });\n },\n onOptionAdd: (value) => {\n this._options = this.tomSelect.options;\n this.updateFilled();\n\n this.stzhOptionAdd.emit({\n component: \"stzh-dropdown\",\n value,\n });\n },\n onOptionRemove: (value) => {\n this._options = this.tomSelect.options;\n this.updateFilled();\n\n this.stzhOptionRemove.emit({\n component: \"stzh-dropdown\",\n value,\n });\n },\n onDropdownOpen: () => {\n this.isOpen = true;\n this.stzhOpen.emit({\n component: \"stzh-dropdown\",\n });\n },\n onDropdownClose: () => {\n this.isOpen = false;\n this.stzhClose.emit({\n component: \"stzh-dropdown\",\n });\n },\n onFocus: () => {\n this.focusedByInput = true;\n\n if (this.tomSelect.load && this.preload === \"focus\") {\n // to be able to execute load function again, we reset loaded searches\n this.resetLoadedSearches();\n\n // if results have been preloaded before, load them now directly with load function\n if (this.tomSelect.wrapper.classList.contains(\"preloaded\")) {\n // since tomSelect.preload() doesn't call tomSelect.shouldCall() method internally (to check for minCharacters),\n // we will also not call it (this.tomSelect.settings.shouldLoad.call(this.tomSelect, ''))\n this.tomSelect.load(\"\");\n }\n }\n\n this.rootElement.classList.add(CLASS_FOCUS);\n const focusEvent = new FocusEvent(\"focus\", {\n view: window,\n bubbles: false,\n cancelable: false,\n });\n\n this.element.dispatchEvent(focusEvent);\n this.stzhFocus.emit({\n component: \"stzh-dropdown\",\n originalEvent: {\n target: this.tomSelect.control,\n },\n });\n },\n onBlur: () => {\n this.rootElement.classList.remove(CLASS_FOCUS);\n const blurEvent = new FocusEvent(\"blur\", {\n view: window,\n bubbles: false,\n cancelable: false,\n });\n\n this.element.dispatchEvent(blurEvent);\n this.stzhBlur.emit({\n component: \"stzh-dropdown\",\n });\n },\n onInitialize: () => {\n this.stzhInit.emit({\n component: \"stzh-dropdown\",\n });\n },\n onLoad: () => {\n this._options = this.tomSelect.options;\n },\n };\n\n if (this._options) {\n tomSelectOptions.options = this._options;\n }\n\n if (this._optgroups) {\n tomSelectOptions.optgroups = this._optgroups;\n }\n\n if (this._items) {\n tomSelectOptions.items = this._items;\n }\n\n this.updateFilled();\n this.tomSelect = new TomSelect(this.select, tomSelectOptions);\n\n if (!this.openOnFocus) {\n // we still want to enable opening the dropdown by click\n this.tomSelect.control.addEventListener(\"click\", () => {\n this.tomSelect.open();\n });\n }\n\n if (this.open) {\n this.show();\n }\n }\n\n disconnectedCallback() {\n if (this.tomSelect) {\n this.tomSelect.destroy();\n this.tomSelect = null;\n }\n }\n\n render() {\n const iconUsed = hasSlot(this.element, \"icon\") || !!this.icon;\n const descriptionUsed =\n hasSlot(this.element, \"description\") || !!this.description;\n const descriptionLongUsed =\n hasSlot(this.element, \"description-long\") || !!this.descriptionLong;\n const errorUsed = hasSlot(this.element, \"error\") || this._error?.length > 0;\n\n const classes = {\n \"stzh-dropdown\": true,\n \"stzh-dropdown--is-inline\": this.inline,\n \"stzh-dropdown--has-no-wrap\": this.noWrap,\n \"stzh-dropdown--is-multiple\": this.multiple,\n \"stzh-dropdown--is-disabled\": this.disabled,\n \"stzh-dropdown--is-required\": this.required,\n \"stzh-dropdown--is-invalid\": this.invalid || errorUsed,\n [CLASS_FILLED]: this._items && this._items.length > 0,\n \"stzh-dropdown--has-icon\": iconUsed,\n \"stzh-dropdown--has-description\": descriptionUsed,\n \"stzh-dropdown--has-description-long\": descriptionLongUsed,\n \"stzh-dropdown--has-error\": errorUsed,\n \"stzh-dropdown--has-no-search\": this.noSearch,\n \"stzh-dropdown--has-label-hidden\": this.labelHidden,\n [`stzh-dropdown--popover-placement-${this.popoverPlacement}`]:\n !!this.popoverPlacement,\n [`stzh-dropdown--popover-fullwidth-${this.popoverFullwidth}`]:\n !!this.popoverFullwidth,\n [`stzh-dropdown--size-${this.size}`]: !!this.size,\n [`stzh-dropdown--${this.variant}`]: !!this.variant,\n };\n\n return (\n <Host\n is-invalid={this.invalid || errorUsed}\n tabindex={this.disabled ? null : \"-1\"}\n onFocus={this.onRootFocus}\n >\n <div\n class={classes}\n ref={(el) => (this.rootElement = el as HTMLDivElement)}\n >\n <div class=\"stzh-dropdown__wrapper\">\n <label\n id={`${this.dropdownId}-label`}\n class={{\n \"stzh-dropdown__label\": true,\n \"no-label-truncate\": this.noLabelTruncate,\n }}\n htmlFor={this.dropdownId}\n >\n {this.label ? this.label : <slot name=\"label\"></slot>}\n {!this.hideOptional && (\n <span class=\"stzh-dropdown__marker\">\n <span class=\"stzh-dropdown__marker-symbol\" aria-hidden=\"true\">\n {this.required\n ? this.localization.$globals.requiredFieldMarker\n : this.localization.$globals.optionalFieldMarker}\n </span>\n <span class=\"stzh-dropdown__marker-text\">\n {this.required\n ? this.localization.$globals.requiredFieldText\n : this.localization.$globals.optionalFieldText}\n </span>\n </span>\n )}\n </label>\n\n <div class=\"stzh-dropdown__field-wrapper\">\n {/* tom-select replaces this select with an combobox.\n Since it doesn't support aria-(describedby/required/invalid),\n we write necessary status information in the aria-labelledby */}\n <select\n id={this.dropdownId}\n class=\"stzh-dropdown__select\"\n ref={(el) => (this.select = el as HTMLSelectElement)}\n multiple={this.multiple}\n name={this.name}\n disabled={this.disabled}\n aria-labelledby={`${this.dropdownId}-label ${\n this.dropdownId\n }-not-loading ${this.dropdownId}-no-results ${\n this.hideOptional &&\n this.required &&\n `${this.dropdownId}-required`\n } ${this.invalid && `${this.dropdownId}-invalid`} ${\n this.dropdownId\n }-description ${this.a11yDescribedby}`}\n >\n <slot></slot>\n </select>\n\n {this.inline && this.label && (\n <div class=\"stzh-dropdown__sizer\">{this.label}</div>\n )}\n\n <div class=\"stzh-dropdown__icon-angle-wrapper\">\n {this.iconAngle ? (\n <stzh-icon\n name={this.iconAngle}\n class=\"stzh-dropdown__icon-angle\"\n ></stzh-icon>\n ) : (\n <slot name=\"icon-angle\"></slot>\n )}\n </div>\n\n <div class=\"stzh-dropdown__icon-wrapper\">\n {this.icon ? (\n <stzh-icon\n class=\"stzh-dropdown__icon\"\n name={this.icon}\n ></stzh-icon>\n ) : (\n <slot name=\"icon\"></slot>\n )}\n </div>\n\n {this.hideOptional && this.required && (\n <div\n id={`${this.dropdownId}-required`}\n class=\"stzh-dropdown__vhidden\"\n >\n {this.localization.$globals.requiredFieldText}\n </div>\n )}\n\n {this.invalid && (\n <div\n id={`${this.dropdownId}-invalid`}\n class=\"stzh-dropdown__vhidden\"\n >\n {this.localization.$globals.invalidFieldText}\n </div>\n )}\n </div>\n </div>\n\n <div\n class=\"stzh-dropdown__dropdown-wrapper\"\n ref={(el) => (this.dropdownWrapperElement = el as HTMLDivElement)}\n ></div>\n\n {(this._error?.length > 0 ||\n this.description ||\n this.descriptionLong) && (\n <StzhInputDescription\n classPrefix=\"stzh-dropdown\"\n id={`${this.dropdownId}-description`}\n error={this._error}\n description={this.description}\n descriptionLong={this.descriptionLong}\n descriptionLongTitle={this.descriptionLongTitle}\n descriptionLongUsed={descriptionLongUsed}\n moreInfoButtonLabel={\n this.localization.$globals.moreInfoButtonLabel\n }\n />\n )}\n </div>\n </Host>\n );\n }\n}\n"]}
@@ -2,7 +2,7 @@ export { g as getAssetPath, s as setAssetPath, a as setNonce, b as setPlatformOp
2
2
  export { S as StzhSocialmediastreamItemActionVariant, V as VBZ, t as tc } from './p-f5779736.js';
3
3
 
4
4
  const name = "@oiz/stzh-components";
5
- const version = "3.6.0-beta4";
5
+ const version = "3.6.0-beta5";
6
6
 
7
7
  const packageName = name.substring(name.indexOf('/')+1);
8
8
  // let focused = false;
@@ -2,7 +2,7 @@ import { p as proxyCustomElement, H, c as createEvent, h as h$1, d as Host } fro
2
2
  import { h } from './p-058d4915.js';
3
3
  import { d as defineCustomElement$6 } from './p-3b8bd05e.js';
4
4
  import { d as defineCustomElement$5 } from './p-1ecb21d3.js';
5
- import { d as defineCustomElement$4 } from './p-3f254548.js';
5
+ import { d as defineCustomElement$4 } from './p-a16a72e5.js';
6
6
  import { d as defineCustomElement$3 } from './p-479b06b2.js';
7
7
  import { d as defineCustomElement$2 } from './p-7c30c73c.js';
8
8
  import { d as defineCustomElement$1 } from './p-f1358aaf.js';
@@ -526,4 +526,4 @@ function defineCustomElement() {
526
526
 
527
527
  export { StzhCalendar as S, printISODate as a, defineCustomElement as d, parseISODate as p };
528
528
 
529
- //# sourceMappingURL=p-aa3fc1b5.js.map
529
+ //# sourceMappingURL=p-5a04123b.js.map
@@ -1 +1 @@
1
- {"file":"p-aa3fc1b5.js","mappings":";;;;;;;;;AAAO,MAAM,eAAe,GAAG,2BAA2B,CAAA;AAE1D,IAAY,UAQX;AARD,WAAY,UAAU;IACpB,+CAAU,CAAA;IACV,+CAAU,CAAA;IACV,iDAAW,CAAA;IACX,qDAAa,CAAA;IACb,mDAAY,CAAA;IACZ,+CAAU,CAAA;IACV,mDAAY,CAAA;AACd,CAAC,EARW,UAAU,KAAV,UAAU,QAQrB;SAqBe,UAAU,CAAC,IAAY,EAAE,KAAa,EAAE,GAAW;IACjE,IAAI,MAAM,GAAG,QAAQ,CAAC,GAAG,EAAE,EAAE,CAAC,CAAA;IAC9B,IAAI,QAAQ,GAAG,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC,CAAA;IAClC,IAAI,OAAO,GAAG,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,CAAA;IAEhC,MAAM,OAAO,GACX,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC;QACzB,MAAM,CAAC,SAAS,CAAC,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IAAI,CAAC,eAAe,EACnC,YAAY,EAAE,WAAW,EACzB,WAAW,EAAE,IAAI,CAAC,UAAU,EAC5B,YAAY,EAAE,IAAI,CAAC,eAAe,EAClC,oBAAoB,EAAE,IAAI,CAAC,wBAAwB,EACnD,YAAY,EAAE,IAAI,CAAC,aAAa,EAChC,YAAY,EAAE,IAAI,CAAC,YAAY,EAC/B,cAAc,EAAE,IAAI,CAAC,cAAc,EACnC,aAAa,EAAE,IAAI,CAAC,qBAAqB,EACzC,GAAG,EAAE,OAAO,EACZ,GAAG,EAAE,OAAO,EACZ,cAAc,EAAE,IAAI,CAAC,cAAc,GACnC,CACE,CACF,CACD,EACR;KACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["h"],"sources":["src/utils/date-utils.ts","src/components/stzh-calendar/stzh-calendar-day.tsx","src/components/stzh-calendar/stzh-calendar-month.tsx","src/components/stzh-calendar/stzh-calendar.scss?tag=stzh-calendar&encapsulation=scoped","src/components/stzh-calendar/stzh-calendar.tsx"],"sourcesContent":["export const ISO_DATE_FORMAT = /^(\\d{4})-(\\d{2})-(\\d{2})$/\n\nexport enum DaysOfWeek {\n Sunday = 0,\n Monday = 1,\n Tuesday = 2,\n Wednesday = 3,\n Thursday = 4,\n Friday = 5,\n Saturday = 6,\n}\n\nexport function formatTime(date: Date) {\n if (!date) {\n return \"\"\n }\n\n var h = date.getHours().toString(10)\n var m = date.getMinutes().toString(10)\n\n if (date.getHours() < 10) {\n h = `0${h}`\n }\n\n if (date.getMinutes() < 10) {\n m = `0${m}`\n }\n\n return `${h}:${m}`\n}\n\nexport function createDate(year: string, month: string, day: string): Date {\n var dayInt = parseInt(day, 10)\n var monthInt = parseInt(month, 10)\n var yearInt = parseInt(year, 10)\n\n const isValid =\n Number.isInteger(yearInt) && // all parts should be integers\n Number.isInteger(monthInt) &&\n Number.isInteger(dayInt) &&\n monthInt > 0 && // month must be 1-12\n monthInt <= 12 &&\n dayInt > 0 && // day must be 1-31\n dayInt <= 31 &&\n yearInt > 0\n\n if (isValid) {\n return new Date(yearInt, monthInt - 1, dayInt)\n }\n}\n\n/**\n * @param value date string in ISO format YYYY-MM-DD\n */\nexport function parseISODate(value: string): Date {\n if (!value) {\n return\n }\n\n const matches = value.match(ISO_DATE_FORMAT)\n\n if (matches) {\n return createDate(matches[1], matches[2], matches[3])\n }\n}\n\n/**\n * print date in format YYYY-MM-DD\n * @param date\n */\nexport function printISODate(date: Date): string {\n if (!date) {\n return \"\"\n }\n\n var d = date.getDate().toString(10)\n var m = (date.getMonth() + 1).toString(10)\n var y = date.getFullYear().toString(10)\n\n // days are not zero-indexed, so pad if less than 10\n if (date.getDate() < 10) {\n d = `0${d}`\n }\n\n // months *are* zero-indexed, pad if less than 9!\n if (date.getMonth() < 9) {\n m = `0${m}`\n }\n\n return `${y}-${m}-${d}`\n}\n\n/**\n * Compare if two dates are equal in terms of day, month, and year\n */\nexport function isEqual(a: Date, b: Date): boolean {\n if (a == null || b == null) {\n return false\n }\n\n return isEqualMonth(a, b) && a.getDate() === b.getDate()\n}\n\n/**\n * Compare if two dates are in the same month of the same year.\n */\nexport function isEqualMonth(a: Date, b: Date): boolean {\n if (a == null || b == null) {\n return false\n }\n\n return a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth()\n}\n\nexport function addDays(date: Date, days: number): Date {\n var d = new Date(date)\n d.setDate(d.getDate() + days)\n return d\n}\n\nexport function addMonths(date: Date, months: number): Date {\n const d = new Date(date)\n d.setMonth(date.getMonth() + months)\n return d\n}\n\nexport function addYears(date: Date, years: number): Date {\n const d = new Date(date)\n d.setFullYear(date.getFullYear() + years)\n return d\n}\n\nexport function startOfWeek(date: Date, firstDayOfWeek: DaysOfWeek = DaysOfWeek.Monday): Date {\n var d = new Date(date)\n var day = d.getDay()\n var diff = (day < firstDayOfWeek ? 7 : 0) + day - firstDayOfWeek\n\n d.setDate(d.getDate() - diff)\n return d\n}\n\nexport function endOfWeek(date: Date, firstDayOfWeek: DaysOfWeek = DaysOfWeek.Monday): Date {\n var d = new Date(date)\n var day = d.getDay()\n var diff = (day < firstDayOfWeek ? -7 : 0) + 6 - (day - firstDayOfWeek)\n\n d.setDate(d.getDate() + diff)\n return d\n}\n\nexport function startOfMonth(date: Date): Date {\n return new Date(date.getFullYear(), date.getMonth(), 1)\n}\n\nexport function endOfMonth(date: Date): Date {\n return new Date(date.getFullYear(), date.getMonth() + 1, 0)\n}\n\nexport function setMonth(date: Date, month: number): Date {\n const d = new Date(date)\n d.setMonth(month)\n return d\n}\n\nexport function setYear(date: Date, year: number): Date {\n const d = new Date(date)\n d.setFullYear(year)\n return d\n}\n\n/**\n * Check if date is within a min and max\n */\nexport function inRange(date: Date, min?: Date, max?: Date): boolean {\n return clamp(date, min, max) === date\n}\n\n/**\n * Ensures date is within range, returns min or max if out of bounds\n */\nexport function clamp(date: Date, min?: Date, max?: Date): Date {\n const time = date.getTime()\n\n if (min && min instanceof Date && time < min.getTime()) {\n return min\n }\n\n if (max && max instanceof Date && time > max.getTime()) {\n return max\n }\n\n return date\n}\n\n/**\n * given start and end date, return an (inclusive) array of all dates in between\n * @param start\n * @param end\n */\nfunction getDaysInRange(start: Date, end: Date): Date[] {\n const days: Date[] = []\n let current = start\n\n while (!isEqual(current, end)) {\n days.push(current)\n current = addDays(current, 1)\n }\n\n days.push(current)\n\n return days\n}\n\n/**\n * given a date, return an array of dates from a calendar perspective\n * @param date\n * @param firstDayOfWeek\n */\nexport function getViewOfMonth(date: Date, firstDayOfWeek: DaysOfWeek = DaysOfWeek.Monday): Date[] {\n const start = startOfWeek(startOfMonth(date), firstDayOfWeek)\n const end = endOfWeek(endOfMonth(date), firstDayOfWeek)\n\n return getDaysInRange(start, end)\n}\n\n/**\n * Form random hash\n */\nexport function chr4() {\n return Math.random()\n .toString(16)\n .slice(-4)\n}\n\n/**\n * Create random identifier with a prefix\n * @param prefix\n */\nexport function createIdentifier(prefix) {\n return `${prefix}-${chr4()}${chr4()}-${chr4()}-${chr4()}-${chr4()}-${chr4()}${chr4()}${chr4()}`\n}\n","import { h, FunctionalComponent } from \"@stencil/core\"\nimport { isEqual, isEqualMonth } from \"../../utils/date-utils\"\n\nexport type StzhCalendarDayProps = {\n focusedDay: Date\n today: Date\n day: Date\n disabled: boolean\n inRange: boolean\n isSelected: boolean\n dateFormatter: Intl.DateTimeFormat\n onDaySelect: (event: MouseEvent, day: Date) => void\n onKeyboardNavigation: (event: KeyboardEvent) => void\n focusedDayRef?: (element: HTMLElement) => void\n}\n\nexport const StzhCalendarDay: FunctionalComponent<StzhCalendarDayProps> = ({\n focusedDay,\n today,\n day,\n onDaySelect,\n onKeyboardNavigation,\n focusedDayRef,\n disabled,\n inRange,\n isSelected,\n dateFormatter,\n}) => {\n const isToday = isEqual(day, today)\n const isMonth = isEqualMonth(day, focusedDay)\n const isFocused = isEqual(day, focusedDay)\n const isOutsideRange = !inRange\n\n function handleClick(e) {\n onDaySelect(e, day)\n }\n\n return (\n <button\n class={{\n \"stzh-calendar__day\": true,\n \"is-outside\": isOutsideRange,\n \"is-today\": isToday,\n \"is-month\": isMonth,\n \"is-disabled\": disabled,\n }}\n tabIndex={isFocused ? 0 : -1}\n onClick={handleClick}\n onKeyDown={onKeyboardNavigation}\n aria-disabled={disabled ? \"true\" : undefined}\n disabled={isOutsideRange}\n type=\"button\"\n aria-pressed={isSelected ? \"true\" : \"false\"}\n aria-current={isToday ? \"date\" : undefined}\n s-object-id={dateFormatter.format(day)}\n ref={el => {\n if (isFocused && el && focusedDayRef) {\n focusedDayRef(el)\n }\n }}\n >\n <span aria-hidden=\"true\">{day.getDate()}</span>\n <span class=\"stzh-calendar__vhidden\">{dateFormatter.format(day)}</span>\n </button>\n )\n}\n","import { h, FunctionalComponent } from \"@stencil/core\"\nimport { getViewOfMonth, inRange, DaysOfWeek, isEqual } from \"../../utils/date-utils\"\n\nimport { StzhCalendarLocalizedText } from \"./stzh-calendar.localization\"\nimport { StzhCalendarDay, StzhCalendarDayProps } from \"./stzh-calendar-day\"\nimport { StzhCalendarDateDisabledPredicate } from \"../../index\";\n\nfunction chunk<T>(array: T[], chunkSize: number): T[][] {\n const result = []\n\n for (let i = 0; i < array.length; i += chunkSize) {\n result.push(array.slice(i, i + chunkSize))\n }\n\n return result\n}\n\nfunction mapWithOffset<T, U>(array: T[], startingOffset: number, mapFn: (item: T) => U): U[] {\n return array.map((_, i) => {\n const adjustedIndex = (i + startingOffset) % array.length\n return mapFn(array[adjustedIndex])\n })\n}\n\ntype StzhCalendarMonthProps = {\n selectedDate: Date\n focusedDate: Date\n labelledById: string\n localization: StzhCalendarLocalizedText\n firstDayOfWeek: DaysOfWeek\n min?: Date\n max?: Date\n dateFormatter: Intl.DateTimeFormat\n isDateDisabled: StzhCalendarDateDisabledPredicate\n onDateSelect: StzhCalendarDayProps[\"onDaySelect\"]\n onKeyboardNavigation: StzhCalendarDayProps[\"onKeyboardNavigation\"]\n focusedDayRef: (element: HTMLElement) => void\n}\n\nexport const StzhCalendarMonth: FunctionalComponent<StzhCalendarMonthProps> = ({\n selectedDate,\n focusedDate,\n labelledById,\n localization,\n firstDayOfWeek,\n min,\n max,\n dateFormatter,\n isDateDisabled,\n onDateSelect,\n onKeyboardNavigation,\n focusedDayRef,\n}) => {\n const today = new Date()\n const days = getViewOfMonth(focusedDate, firstDayOfWeek)\n\n return (\n <table class=\"stzh-calendar__table\" aria-labelledby={labelledById}>\n <thead>\n <tr>\n {mapWithOffset(localization.$globals.dayNames, firstDayOfWeek, dayName => (\n <th class=\"stzh-calendar__table-header\" scope=\"col\">\n <span aria-hidden=\"true\">{dayName.substring(0, 2)}</span>\n <span class=\"stzh-calendar__vhidden\">{dayName}</span>\n </th>\n ))}\n </tr>\n </thead>\n <tbody>\n {chunk(days, 7).map(week => (\n <tr class=\"stzh-calendar__row\">\n {week.map(day => (\n <td class=\"stzh-calendar__cell\">\n <StzhCalendarDay\n day={day}\n today={today}\n focusedDay={focusedDate}\n isSelected={isEqual(day, selectedDate)}\n disabled={isDateDisabled(day)}\n inRange={inRange(day, min, max)}\n onDaySelect={onDateSelect}\n dateFormatter={dateFormatter}\n onKeyboardNavigation={onKeyboardNavigation}\n focusedDayRef={focusedDayRef}\n />\n </td>\n ))}\n </tr>\n ))}\n </tbody>\n </table>\n )\n}\n","/**\n * @prop --background: Background color of calendar\n * @prop --padding-top: Padding top of calendar\n * @prop --padding-bottom: Padding bottom color of calendar\n * @prop --padding-left: Padding left color of calendar\n * @prop --padding-right: Padding right color of calendar\n * @prop --background-color: Background color of calendar\n */\n\n:host {\n --padding-top: #{space('small')};\n --padding-bottom: #{space('small')};\n --padding-left: #{space('xsmall')};\n --padding-right: #{space('xsmall')};\n\n width: #{$calendarWidth};\n}\n\n.stzh-calendar {\n --stzh-description-min-height: initial;\n\n display: flex;\n position: relative;\n text-align: left;\n touch-action: pan-y;\n user-select: none;\n overflow: hidden;\n overflow: clip;\n padding-top: var(--padding-top);\n padding-bottom: var(--padding-bottom);\n padding-left: var(--padding-left);\n padding-right: var(--padding-right);\n\n &__wrapper {\n width: 100%;\n }\n\n &__table {\n @include font;\n @include fontSize('milli');\n border-collapse: collapse;\n border-spacing: 0;\n text-align: center;\n width: 100%;\n }\n\n &__table-header,\n &__cell {\n padding: space('xxxsmall');\n\n &:first-child {\n padding-left: 0;\n }\n\n &:last-child {\n padding-right: 0;\n }\n }\n\n &__row:last-child &__cell {\n padding-bottom: 0;\n }\n\n &__table-header {\n @include font;\n @include fontSize('nano');\n text-decoration-line: none;\n padding-top: 0;\n padding-bottom: 0;\n width: 44px;\n height: 40px;\n }\n\n &__cell {\n text-align: center;\n }\n\n &__day {\n @include font;\n @include fontSize('milli');\n appearance: none;\n background: transparent;\n border: 0;\n cursor: pointer;\n display: inline-block;\n font-variant-numeric: tabular-nums;\n width: 40px;\n height: 40px;\n text-align: center;\n vertical-align: middle;\n transition-property: color, background-color;\n transition-duration: $baseTransitionAnimationSpeed;\n // position: relative;\n // padding: 0 0 1px;\n // z-index: 1;\n\n // &::before {\n // z-index: -1;\n // bottom: 0;\n // content: \"\";\n // left: 0;\n // position: absolute;\n // right: 0;\n // top: 0;\n // }\n\n &.is-today {\n @include font('heavy');\n color: $colorPrimary70;\n // box-shadow: 0 0 0 1px $colorPrimary;\n // position: relative;\n // z-index: 200;\n }\n\n &:hover {\n background: $colorGrey20;\n }\n\n // &:hover::before {\n // background: $colorGrey20;\n // }\n\n // &:focus,\n &[aria-pressed=\"true\"] {\n background: $colorSecondary30;\n // box-shadow: none;\n color: $colorPrimary70;\n }\n\n &:active {\n background: $colorSecondary30;\n // box-shadow: 0 0 5px $colorPrimary;\n color: $colorPrimary70;\n // z-index: 200;\n }\n\n // &:focus {\n // z-index: 200;\n // }\n\n // &:not(.is-month) {\n // box-shadow: none;\n // }\n\n &:not(.is-month),\n &[aria-disabled=\"true\"] {\n background: transparent;\n color: $colorGrey60;\n cursor: default;\n }\n\n // &[aria-disabled=\"true\"] {\n // &.is-today {\n // box-shadow: 0 0 0 1px $colorGrey20;\n\n // &:focus {\n // box-shadow: 0 0 5px $colorPrimary;\n // }\n // }\n\n // &::before {\n // display: none;\n // }\n // }\n\n &.is-disabled {\n text-decoration-line: line-through;\n }\n\n &.is-outside {\n color: $colorGrey60;\n background: $colorGrey20;\n // box-shadow: none;\n cursor: default;\n pointer-events: none;\n text-decoration-line: none;\n\n // &::before {\n // display: none;\n // }\n }\n }\n\n &__header {\n align-items: center;\n display: flex;\n justify-content: space-between;\n width: 100%;\n }\n\n &__nav {\n display: flex;\n align-items: center;\n\n &.is-dropdowns {\n gap: calc(#{space('xsmall')} + #{space('small')});\n margin-left: space('small');\n }\n }\n\n // &__prev,\n // &__next {\n // align-items: center;\n // appearance: none;\n // font-family: inherit;\n // background: transparent;\n // border-radius: 50%;\n // color: $colorPrimary70;\n // cursor: pointer;\n // display: inline-flex;\n // flex-shrink: 0;\n // justify-content: center;\n // margin-left: space('xsmall');\n // padding: 0;\n // transition: background-color 300ms ease;\n // height: 32px;\n // width: 32px;\n\n // &:disabled {\n // cursor: default;\n // color: $colorGrey60;\n // }\n // }\n\n stzh-dropdown#{&}__dropdown {\n --popover-width: 100%;\n --popover-height: calc(100% - #{$formInputHeightSmall} - var(--padding-top));\n --popover-max-height: initial;\n position: static;\n }\n\n &__select-wrapper {\n display: inline-flex;\n position: relative;\n\n span {\n margin-right: 0px;\n }\n }\n\n &__select {\n @include fontSize('milli');\n cursor: pointer;\n height: 100%;\n left: 0;\n opacity: 0;\n position: absolute;\n top: 0;\n width: 100%;\n z-index: 2;\n border-radius: $formInputBorderRadius;\n }\n\n &__select-label {\n @include fontSize('milli');\n appearance: none;\n border: none;\n align-items: center;\n border-radius: $formInputBorderRadius;\n color: $colorPrimary70;\n display: flex;\n gap: space('xsmall');\n padding: 0;\n padding-left: space('small');\n padding-right: space('xsmall');\n\n position: relative;\n width: 100%;\n min-height: 40px;\n z-index: 1;\n }\n\n &__select-icon {\n --size: #{iconSize('xsmall')};\n }\n\n &__vhidden {\n @include visuallyhidden;\n }\n}\n","import {\n Component,\n ComponentInterface,\n Host,\n Prop,\n Element,\n h,\n Event,\n EventEmitter,\n State,\n Method,\n Watch\n} from \"@stencil/core\"\n\nimport {\n addDays,\n startOfWeek,\n endOfWeek,\n setMonth,\n setYear,\n clamp,\n inRange,\n endOfMonth,\n startOfMonth,\n printISODate,\n parseISODate,\n DaysOfWeek,\n} from \"../../utils/date-utils\";\n\nimport { StzhCalendarChangeEvent, StzhDropdownChangeEvent } from \"../../index\";\nimport { StzhCalendarDateDisabledPredicate } from \"../../index\";\n\nimport { StzhCalendarMonth } from \"./stzh-calendar-month\";\nimport { StzhCalendarLocalizedText } from \"./stzh-calendar.localization\";\n\nfunction range(from: number, to: number) {\n var result: number[] = []\n for (var i = from; i <= to; i++) {\n result.push(i)\n }\n return result\n}\n\nconst keyCode = {\n TAB: 9,\n ESC: 27,\n SPACE: 32,\n PAGE_UP: 33,\n PAGE_DOWN: 34,\n END: 35,\n HOME: 36,\n LEFT: 37,\n UP: 38,\n RIGHT: 39,\n DOWN: 40,\n}\n\nlet calendarCounter = 0;\n\n@Component({\n tag: \"stzh-calendar\",\n styleUrl: \"stzh-calendar.scss\",\n scoped: true\n})\nexport class StzhCalendar implements ComponentInterface {\n /** Date value. Must be in IS0-8601 format: YYYY-MM-DD. */\n @Prop({ mutable: true }) value: string = \"\"\n\n /**\n * Minimum date allowed to be picked. Must be in IS0-8601 format: YYYY-MM-DD.\n * This setting can be used alone or together with the max property.\n */\n @Prop() min: string = \"\"\n\n /**\n * Maximum date allowed to be picked. Must be in IS0-8601 format: YYYY-MM-DD.\n * This setting can be used alone or together with the min property.\n */\n @Prop() max: string = \"\"\n\n /**\n * Which day is considered first day of the week? `0` for Sunday, `1` for Monday, etc.\n * Default is Monday.\n */\n @Prop() firstDayOfWeek: DaysOfWeek = DaysOfWeek.Monday\n\n /** Day names, month names, etc, used for localization. */\n @Prop() localization: StzhCalendarLocalizedText;\n\n /**\n * Controls which days are disabled and therefore disallowed.\n * For example, this can be used to disallow selection of weekends.\n */\n @Prop() isDateDisabled: StzhCalendarDateDisabledPredicate = () => false\n\n /**\n * For Adobe Analytics.\n * Will be rendered as value of `s-object-id` attribute to the previous month button element.\n * Default value will be taken from translations.\n */\n @Prop() prevMonthAnalyticsId: string;\n\n /**\n * For Adobe Analytics.\n * Will be rendered as value of `s-object-id` attribute to the next month button element.\n * Default value will be taken from translations.\n */\n @Prop() nextMonthAnalyticsId: string;\n\n @State() activeFocus = false\n @State() focusedDay = new Date()\n\n /** Event emitted when a date is selected. */\n @Event() stzhChange: EventEmitter<StzhCalendarChangeEvent>\n\n @Watch(\"localization\")\n createDateFormatters() {\n if (this.localization) {\n this.dateFormatShort = new Intl.DateTimeFormat(this.localization.$locale, { day: \"numeric\", month: \"long\" })\n }\n }\n\n @Watch(\"value\")\n valueWatcher(newValue: string) {\n if (newValue) {\n this.setFocusedDay(parseISODate(this.value));\n } else {\n this.setFocusedDay(new Date());\n }\n }\n\n /** Set focused day element by a JS Date object */\n @Method()\n async setFocusedDay(day: Date) {\n this.focusedDay = clamp(day, parseISODate(this.min), parseISODate(this.max))\n }\n\n /** Set value by a JS Date object */\n @Method()\n async setDate(date: Date) {\n this.value = printISODate(date)\n }\n\n @Element() element: HTMLStzhCalendarElement\n\n // private monthSelectId: string\n // private yearSelectId: string\n private dialogLabelId: string\n\n // private focusedDayNode: HTMLButtonElement\n\n private initialTouchX: number = null\n private initialTouchY: number = null\n\n /**\n * To format dates exclusively for the benefit of screen readers.\n *\n * We prefer DateTimeFormat over date.toLocaleDateString, as the former has\n * better performance when formatting large number of dates. See:\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleDateString#Performance\n */\n private dateFormatShort: Intl.DateTimeFormat\n\n private enableActiveFocus = () => {\n this.activeFocus = true\n }\n\n private disableActiveFocus = () => {\n this.activeFocus = false\n }\n\n private addDays(days: number) {\n this.setFocusedDay(addDays(this.focusedDay, days))\n }\n\n private addMonths(months: number) {\n this.setMonth(this.focusedDay.getMonth() + months)\n }\n\n private addYears(years: number) {\n this.setYear(this.focusedDay.getFullYear() + years)\n }\n\n private startOfWeek() {\n this.setFocusedDay(startOfWeek(this.focusedDay, this.firstDayOfWeek))\n }\n\n private endOfWeek() {\n this.setFocusedDay(endOfWeek(this.focusedDay, this.firstDayOfWeek))\n }\n\n private setMonth(month: number) {\n const min = setMonth(startOfMonth(this.focusedDay), month)\n const max = endOfMonth(min)\n const date = setMonth(this.focusedDay, month)\n\n this.setFocusedDay(clamp(date, min, max))\n }\n\n private setYear(year: number) {\n const min = setYear(startOfMonth(this.focusedDay), year)\n const max = endOfMonth(min)\n const date = setYear(this.focusedDay, year)\n\n this.setFocusedDay(clamp(date, min, max))\n }\n\n private handleTouchStart = (event: TouchEvent) => {\n const touch = event.changedTouches[0]\n this.initialTouchX = touch.pageX\n this.initialTouchY = touch.pageY\n }\n\n // private handleTouchMove = (event: TouchEvent) => {\n // event.preventDefault()\n // }\n\n private handleTouchEnd = (event: TouchEvent) => {\n const touch = event.changedTouches[0]\n const distX = touch.pageX - this.initialTouchX // get horizontal dist traveled\n const distY = touch.pageY - this.initialTouchY // get vertical dist traveled\n const threshold = 70\n\n const isHorizontalSwipe = Math.abs(distX) >= threshold && Math.abs(distY) <= threshold\n\n if (isHorizontalSwipe) {\n this.addMonths(distX < 0 ? 1 : -1)\n }\n\n this.initialTouchY = null\n this.initialTouchX = null\n }\n\n private handleNextMonthClick = (event: MouseEvent) => {\n event.preventDefault()\n this.addMonths(1)\n }\n\n private handlePreviousMonthClick = (event: MouseEvent) => {\n event.preventDefault()\n this.addMonths(-1)\n }\n\n private handleKeyboardNavigation = (event: KeyboardEvent) => {\n var handled = true\n\n switch (event.keyCode) {\n case keyCode.RIGHT:\n this.addDays(1)\n break\n case keyCode.LEFT:\n this.addDays(-1)\n break\n case keyCode.DOWN:\n this.addDays(7)\n break\n case keyCode.UP:\n this.addDays(-7)\n break\n case keyCode.PAGE_UP:\n if (event.shiftKey) {\n this.addYears(-1)\n } else {\n this.addMonths(-1)\n }\n break\n case keyCode.PAGE_DOWN:\n if (event.shiftKey) {\n this.addYears(1)\n } else {\n this.addMonths(1)\n }\n break\n case keyCode.HOME:\n this.startOfWeek()\n break\n case keyCode.END:\n this.endOfWeek()\n break\n default:\n handled = false\n }\n\n if (handled) {\n event.preventDefault()\n this.enableActiveFocus()\n }\n }\n\n private handleDaySelect = (_event: MouseEvent, day: Date) => {\n const isInRange = inRange(day, parseISODate(this.min), parseISODate(this.max))\n const isAllowed = !this.isDateDisabled(day)\n\n if (isInRange && isAllowed) {\n this.setDate(day)\n\n this.stzhChange.emit({\n component: \"stzh-calendar\",\n value: this.value,\n valueAsDate: day,\n })\n } else {\n // for consistency we should set the focused day in cases where\n // user has selected a day that has been specifically disallowed\n this.setFocusedDay(day)\n }\n }\n\n private handleMonthSelect = (event: CustomEvent<StzhDropdownChangeEvent>) => {\n const value = Array.isArray(event.detail.value) ? event.detail.value[0] : event.detail.value;\n this.setMonth(parseInt(value, 10))\n }\n\n private handleYearSelect = (event: CustomEvent<StzhDropdownChangeEvent>) => {\n const value = Array.isArray(event.detail.value) ? event.detail.value[0] : event.detail.value;\n this.setYear(parseInt(value, 10))\n }\n\n private processFocusedDayNode = (element: HTMLButtonElement) => {\n // this.focusedDayNode = element\n\n if (this.activeFocus) {\n setTimeout(() => element.focus(), 0)\n }\n }\n\n async componentWillLoad() {\n // this.monthSelectId = `stzh-calendar-month-${calendarCounter}`;\n // this.yearSelectId = `stzh-calendar-year-${calendarCounter}`;\n this.dialogLabelId = `stzh-calendar-dialog-${calendarCounter}`;\n calendarCounter++;\n\n this.valueWatcher(this.value);\n\n if (!this.localization) {\n this.localization = await window.stzhComponents.utils.fetchTranslations(this.element, 'calendar');\n }\n }\n\n connectedCallback() {\n this.createDateFormatters()\n }\n\n render() {\n const valueAsDate = parseISODate(this.value)\n const selectedYear = (valueAsDate || this.focusedDay).getFullYear()\n const focusedMonth = this.focusedDay.getMonth()\n const focusedYear = this.focusedDay.getFullYear()\n\n const minDate = parseISODate(this.min)\n const maxDate = parseISODate(this.max)\n const prevMonthDisabled =\n minDate != null && minDate.getMonth() === focusedMonth && minDate.getFullYear() === focusedYear\n const nextMonthDisabled =\n maxDate != null && maxDate.getMonth() === focusedMonth && maxDate.getFullYear() === focusedYear\n\n const minYear = minDate ? minDate.getFullYear() : selectedYear - 10\n const maxYear = maxDate ? maxDate.getFullYear() : selectedYear + 10\n\n const monthDropdownOptions = this.localization.$globals.monthNames.map((month, i) => {\n return {\n value: i.toString(),\n text: month,\n disabled: !inRange(\n new Date(focusedYear, i, 1),\n minDate ? startOfMonth(minDate) : null,\n maxDate ? endOfMonth(maxDate) : null\n ),\n }\n });\n\n const yearDropdownOptions = range(minYear, maxYear).map(year => {\n return {\n value: year.toString(),\n text: year.toString(),\n }\n });\n\n return (\n <Host>\n <div\n class={{\n \"stzh-calendar\": true\n }}\n /* onTouchMove={this.handleTouchMove} */\n onTouchStart={this.handleTouchStart}\n onTouchEnd={this.handleTouchEnd}\n >\n <div class=\"stzh-calendar__wrapper\">\n {/*\n <div class=\"stzh-calendar__mobile\" onFocusin={this.disableActiveFocus}>\n <label class=\"stzh-calendar__mobile-heading\">{this.localization.calendarHeading}</label>\n </div>\n */}\n {/* @ts-ignore */}\n <div class=\"stzh-calendar__header\" onFocusin={this.disableActiveFocus}>\n <div class=\"stzh-calendar__nav is-dropdowns\">\n <h2\n id={this.dialogLabelId}\n class=\"stzh-calendar__vhidden\"\n aria-live=\"polite\"\n aria-atomic=\"true\"\n >\n {this.localization.$globals.monthNames[focusedMonth]}\n {this.focusedDay.getFullYear()}\n </h2>\n\n <stzh-dropdown\n class=\"stzh-calendar__dropdown\"\n variant=\"plain\"\n size=\"small\"\n inline\n popover-fullwidth=\"horizontal\"\n noSearch={true}\n openOnFocus={false}\n items={[focusedMonth.toString()]}\n options={monthDropdownOptions}\n label={this.localization.monthSelectLabel}\n labelHidden={true}\n onStzhChange={this.handleMonthSelect}\n ></stzh-dropdown>\n\n <stzh-dropdown\n class=\"stzh-calendar__dropdown\"\n variant=\"plain\"\n size=\"small\"\n inline\n popover-fullwidth=\"horizontal\"\n noSearch={true}\n openOnFocus={false}\n items={[focusedYear.toString()]}\n options={yearDropdownOptions}\n label={this.localization.yearSelectLabel}\n labelHidden={true}\n onStzhChange={this.handleYearSelect}\n ></stzh-dropdown>\n\n {/* alternative for dropdown with popover:\n <stzh-popover>\n <button class=\"stzh-calendar__select-label\" aria-label={this.localization.monthSelectLabel}>\n <span>{this.localization.$globals.monthNamesShort[focusedMonth]}</span>\n <stzh-icon class=\"stzh-calendar__select-icon\" name=\"angle-down\"></stzh-icon>\n </button>\n <stzh-menu slot=\"content\">\n {this.localization.$globals.monthNames.map((month, i) => (\n <stzh-menu-item\n // onClick={this.handleMonthSelect(month)}\n active={i === focusedMonth}\n disabled={\n !inRange(\n new Date(focusedYear, i, 1),\n minDate ? startOfMonth(minDate) : null,\n maxDate ? endOfMonth(maxDate) : null\n )\n }\n >\n {month}\n </stzh-menu-item>\n ))}\n </stzh-menu>\n </stzh-popover>\n */}\n\n {/* original implmentation with native select:\n <label htmlFor={this.monthSelectId} class=\"stzh-calendar__vhidden\">\n {this.localization.monthSelectLabel}\n </label>\n\n <div class=\"stzh-calendar__select-wrapper\">\n <select\n id={this.monthSelectId}\n class=\"stzh-calendar__select stzh-calendar__select--month\"\n onChange={this.handleMonthSelect}\n >\n {this.localization.$globals.monthNames.map((month, i) => (\n <option\n key={month}\n value={i}\n selected={i === focusedMonth}\n disabled={\n !inRange(\n new Date(focusedYear, i, 1),\n minDate ? startOfMonth(minDate) : null,\n maxDate ? endOfMonth(maxDate) : null\n )\n }\n >\n {month}\n </option>\n ))}\n </select>\n <div class=\"stzh-calendar__select-label\" aria-hidden=\"true\">\n <span>{this.localization.$globals.monthNamesShort[focusedMonth]}</span>\n <stzh-icon class=\"stzh-calendar__select-icon\" name=\"angle-down\"></stzh-icon>\n </div>\n </div>\n\n <label htmlFor={this.yearSelectId} class=\"stzh-calendar__vhidden\">\n {this.localization.yearSelectLabel}\n </label>\n\n <div class=\"stzh-calendar__select-wrapper\">\n <select\n id={this.yearSelectId}\n class=\"stzh-calendar__select stzh-calendar__select--year\"\n onChange={this.handleYearSelect}\n >\n {range(minYear, maxYear).map(year => (\n <option key={year} selected={year === focusedYear}>\n {year}\n </option>\n ))}\n </select>\n <div class=\"stzh-calendar__select-label\" aria-hidden=\"true\">\n <span>{this.focusedDay.getFullYear()}</span>\n <stzh-icon class=\"stzh-calendar__select-icon\" name=\"angle-down\"></stzh-icon>\n </div>\n </div>\n */}\n\n </div>\n\n <div class=\"stzh-calendar__nav\">\n <stzh-button\n class=\"stzh-calendar__prev\"\n variant=\"tertiary\"\n size=\"small\"\n icon=\"arrow-left\"\n iconOnly={true}\n onClick={this.handlePreviousMonthClick}\n disabled={prevMonthDisabled}\n type=\"button\"\n a11yLabel={this.localization.prevMonthLabel}\n analyticsId={this.prevMonthAnalyticsId || this.localization.prevMonthLabel}\n ></stzh-button>\n <stzh-button\n class=\"stzh-calendar__next\"\n variant=\"tertiary\"\n size=\"small\"\n icon=\"arrow-right\"\n iconOnly={true}\n onClick={this.handleNextMonthClick}\n disabled={nextMonthDisabled}\n type=\"button\"\n a11yLabel={this.localization.nextMonthLabel}\n analyticsId={this.nextMonthAnalyticsId || this.localization.nextMonthLabel}\n ></stzh-button>\n </div>\n </div>\n\n <StzhCalendarMonth\n dateFormatter={this.dateFormatShort}\n selectedDate={valueAsDate}\n focusedDate={this.focusedDay}\n onDateSelect={this.handleDaySelect}\n onKeyboardNavigation={this.handleKeyboardNavigation}\n labelledById={this.dialogLabelId}\n localization={this.localization}\n firstDayOfWeek={this.firstDayOfWeek}\n focusedDayRef={this.processFocusedDayNode}\n min={minDate}\n max={maxDate}\n isDateDisabled={this.isDateDisabled}\n />\n </div>\n </div>\n </Host>\n )\n }\n}\n"],"version":3}
1
+ {"file":"p-5a04123b.js","mappings":";;;;;;;;;AAAO,MAAM,eAAe,GAAG,2BAA2B,CAAA;AAE1D,IAAY,UAQX;AARD,WAAY,UAAU;IACpB,+CAAU,CAAA;IACV,+CAAU,CAAA;IACV,iDAAW,CAAA;IACX,qDAAa,CAAA;IACb,mDAAY,CAAA;IACZ,+CAAU,CAAA;IACV,mDAAY,CAAA;AACd,CAAC,EARW,UAAU,KAAV,UAAU,QAQrB;SAqBe,UAAU,CAAC,IAAY,EAAE,KAAa,EAAE,GAAW;IACjE,IAAI,MAAM,GAAG,QAAQ,CAAC,GAAG,EAAE,EAAE,CAAC,CAAA;IAC9B,IAAI,QAAQ,GAAG,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC,CAAA;IAClC,IAAI,OAAO,GAAG,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,CAAA;IAEhC,MAAM,OAAO,GACX,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC;QACzB,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC;QAC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,EACnC,YAAY,EAAE,WAAW,EACzB,WAAW,EAAE,IAAI,CAAC,UAAU,EAC5B,YAAY,EAAE,IAAI,CAAC,eAAe,EAClC,oBAAoB,EAAE,IAAI,CAAC,wBAAwB,EACnD,YAAY,EAAE,IAAI,CAAC,aAAa,EAChC,YAAY,EAAE,IAAI,CAAC,YAAY,EAC/B,cAAc,EAAE,IAAI,CAAC,cAAc,EACnC,aAAa,EAAE,IAAI,CAAC,qBAAqB,EACzC,GAAG,EAAE,OAAO,EACZ,GAAG,EAAE,OAAO,EACZ,cAAc,EAAE,IAAI,CAAC,cAAc,GACnC,CACE,CACF,CACD,EACR;KACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["h"],"sources":["src/utils/date-utils.ts","src/components/stzh-calendar/stzh-calendar-day.tsx","src/components/stzh-calendar/stzh-calendar-month.tsx","src/components/stzh-calendar/stzh-calendar.scss?tag=stzh-calendar&encapsulation=scoped","src/components/stzh-calendar/stzh-calendar.tsx"],"sourcesContent":["export const ISO_DATE_FORMAT = /^(\\d{4})-(\\d{2})-(\\d{2})$/\n\nexport enum DaysOfWeek {\n Sunday = 0,\n Monday = 1,\n Tuesday = 2,\n Wednesday = 3,\n Thursday = 4,\n Friday = 5,\n Saturday = 6,\n}\n\nexport function formatTime(date: Date) {\n if (!date) {\n return \"\"\n }\n\n var h = date.getHours().toString(10)\n var m = date.getMinutes().toString(10)\n\n if (date.getHours() < 10) {\n h = `0${h}`\n }\n\n if (date.getMinutes() < 10) {\n m = `0${m}`\n }\n\n return `${h}:${m}`\n}\n\nexport function createDate(year: string, month: string, day: string): Date {\n var dayInt = parseInt(day, 10)\n var monthInt = parseInt(month, 10)\n var yearInt = parseInt(year, 10)\n\n const isValid =\n Number.isInteger(yearInt) && // all parts should be integers\n Number.isInteger(monthInt) &&\n Number.isInteger(dayInt) &&\n monthInt > 0 && // month must be 1-12\n monthInt <= 12 &&\n dayInt > 0 && // day must be 1-31\n dayInt <= 31 &&\n yearInt > 0\n\n if (isValid) {\n return new Date(yearInt, monthInt - 1, dayInt)\n }\n}\n\n/**\n * @param value date string in ISO format YYYY-MM-DD\n */\nexport function parseISODate(value: string): Date {\n if (!value) {\n return\n }\n\n const matches = value.match(ISO_DATE_FORMAT)\n\n if (matches) {\n return createDate(matches[1], matches[2], matches[3])\n }\n}\n\n/**\n * print date in format YYYY-MM-DD\n * @param date\n */\nexport function printISODate(date: Date): string {\n if (!date) {\n return \"\"\n }\n\n var d = date.getDate().toString(10)\n var m = (date.getMonth() + 1).toString(10)\n var y = date.getFullYear().toString(10)\n\n // days are not zero-indexed, so pad if less than 10\n if (date.getDate() < 10) {\n d = `0${d}`\n }\n\n // months *are* zero-indexed, pad if less than 9!\n if (date.getMonth() < 9) {\n m = `0${m}`\n }\n\n return `${y}-${m}-${d}`\n}\n\n/**\n * Compare if two dates are equal in terms of day, month, and year\n */\nexport function isEqual(a: Date, b: Date): boolean {\n if (a == null || b == null) {\n return false\n }\n\n return isEqualMonth(a, b) && a.getDate() === b.getDate()\n}\n\n/**\n * Compare if two dates are in the same month of the same year.\n */\nexport function isEqualMonth(a: Date, b: Date): boolean {\n if (a == null || b == null) {\n return false\n }\n\n return a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth()\n}\n\nexport function addDays(date: Date, days: number): Date {\n var d = new Date(date)\n d.setDate(d.getDate() + days)\n return d\n}\n\nexport function addMonths(date: Date, months: number): Date {\n const d = new Date(date)\n d.setMonth(date.getMonth() + months)\n return d\n}\n\nexport function addYears(date: Date, years: number): Date {\n const d = new Date(date)\n d.setFullYear(date.getFullYear() + years)\n return d\n}\n\nexport function startOfWeek(date: Date, firstDayOfWeek: DaysOfWeek = DaysOfWeek.Monday): Date {\n var d = new Date(date)\n var day = d.getDay()\n var diff = (day < firstDayOfWeek ? 7 : 0) + day - firstDayOfWeek\n\n d.setDate(d.getDate() - diff)\n return d\n}\n\nexport function endOfWeek(date: Date, firstDayOfWeek: DaysOfWeek = DaysOfWeek.Monday): Date {\n var d = new Date(date)\n var day = d.getDay()\n var diff = (day < firstDayOfWeek ? -7 : 0) + 6 - (day - firstDayOfWeek)\n\n d.setDate(d.getDate() + diff)\n return d\n}\n\nexport function startOfMonth(date: Date): Date {\n return new Date(date.getFullYear(), date.getMonth(), 1)\n}\n\nexport function endOfMonth(date: Date): Date {\n return new Date(date.getFullYear(), date.getMonth() + 1, 0)\n}\n\nexport function setMonth(date: Date, month: number): Date {\n const d = new Date(date)\n d.setMonth(month)\n return d\n}\n\nexport function setYear(date: Date, year: number): Date {\n const d = new Date(date)\n d.setFullYear(year)\n return d\n}\n\n/**\n * Check if date is within a min and max\n */\nexport function inRange(date: Date, min?: Date, max?: Date): boolean {\n return clamp(date, min, max) === date\n}\n\n/**\n * Ensures date is within range, returns min or max if out of bounds\n */\nexport function clamp(date: Date, min?: Date, max?: Date): Date {\n const time = date.getTime()\n\n if (min && min instanceof Date && time < min.getTime()) {\n return min\n }\n\n if (max && max instanceof Date && time > max.getTime()) {\n return max\n }\n\n return date\n}\n\n/**\n * given start and end date, return an (inclusive) array of all dates in between\n * @param start\n * @param end\n */\nfunction getDaysInRange(start: Date, end: Date): Date[] {\n const days: Date[] = []\n let current = start\n\n while (!isEqual(current, end)) {\n days.push(current)\n current = addDays(current, 1)\n }\n\n days.push(current)\n\n return days\n}\n\n/**\n * given a date, return an array of dates from a calendar perspective\n * @param date\n * @param firstDayOfWeek\n */\nexport function getViewOfMonth(date: Date, firstDayOfWeek: DaysOfWeek = DaysOfWeek.Monday): Date[] {\n const start = startOfWeek(startOfMonth(date), firstDayOfWeek)\n const end = endOfWeek(endOfMonth(date), firstDayOfWeek)\n\n return getDaysInRange(start, end)\n}\n\n/**\n * Form random hash\n */\nexport function chr4() {\n return Math.random()\n .toString(16)\n .slice(-4)\n}\n\n/**\n * Create random identifier with a prefix\n * @param prefix\n */\nexport function createIdentifier(prefix) {\n return `${prefix}-${chr4()}${chr4()}-${chr4()}-${chr4()}-${chr4()}-${chr4()}${chr4()}${chr4()}`\n}\n","import { h, FunctionalComponent } from \"@stencil/core\"\nimport { isEqual, isEqualMonth } from \"../../utils/date-utils\"\n\nexport type StzhCalendarDayProps = {\n focusedDay: Date\n today: Date\n day: Date\n disabled: boolean\n inRange: boolean\n isSelected: boolean\n dateFormatter: Intl.DateTimeFormat\n onDaySelect: (event: MouseEvent, day: Date) => void\n onKeyboardNavigation: (event: KeyboardEvent) => void\n focusedDayRef?: (element: HTMLElement) => void\n}\n\nexport const StzhCalendarDay: FunctionalComponent<StzhCalendarDayProps> = ({\n focusedDay,\n today,\n day,\n onDaySelect,\n onKeyboardNavigation,\n focusedDayRef,\n disabled,\n inRange,\n isSelected,\n dateFormatter,\n}) => {\n const isToday = isEqual(day, today)\n const isMonth = isEqualMonth(day, focusedDay)\n const isFocused = isEqual(day, focusedDay)\n const isOutsideRange = !inRange\n\n function handleClick(e) {\n onDaySelect(e, day)\n }\n\n return (\n <button\n class={{\n \"stzh-calendar__day\": true,\n \"is-outside\": isOutsideRange,\n \"is-today\": isToday,\n \"is-month\": isMonth,\n \"is-disabled\": disabled,\n }}\n tabIndex={isFocused ? 0 : -1}\n onClick={handleClick}\n onKeyDown={onKeyboardNavigation}\n aria-disabled={disabled ? \"true\" : undefined}\n disabled={isOutsideRange}\n type=\"button\"\n aria-pressed={isSelected ? \"true\" : \"false\"}\n aria-current={isToday ? \"date\" : undefined}\n s-object-id={dateFormatter.format(day)}\n ref={el => {\n if (isFocused && el && focusedDayRef) {\n focusedDayRef(el)\n }\n }}\n >\n <span aria-hidden=\"true\">{day.getDate()}</span>\n <span class=\"stzh-calendar__vhidden\">{dateFormatter.format(day)}</span>\n </button>\n )\n}\n","import { h, FunctionalComponent } from \"@stencil/core\"\nimport { getViewOfMonth, inRange, DaysOfWeek, isEqual } from \"../../utils/date-utils\"\n\nimport { StzhCalendarLocalizedText } from \"./stzh-calendar.localization\"\nimport { StzhCalendarDay, StzhCalendarDayProps } from \"./stzh-calendar-day\"\nimport { StzhCalendarDateDisabledPredicate } from \"../../index\";\n\nfunction chunk<T>(array: T[], chunkSize: number): T[][] {\n const result = []\n\n for (let i = 0; i < array.length; i += chunkSize) {\n result.push(array.slice(i, i + chunkSize))\n }\n\n return result\n}\n\nfunction mapWithOffset<T, U>(array: T[], startingOffset: number, mapFn: (item: T) => U): U[] {\n return array.map((_, i) => {\n const adjustedIndex = (i + startingOffset) % array.length\n return mapFn(array[adjustedIndex])\n })\n}\n\ntype StzhCalendarMonthProps = {\n selectedDate: Date\n focusedDate: Date\n labelledById: string\n localization: StzhCalendarLocalizedText\n firstDayOfWeek: DaysOfWeek\n min?: Date\n max?: Date\n dateFormatter: Intl.DateTimeFormat\n isDateDisabled: StzhCalendarDateDisabledPredicate\n onDateSelect: StzhCalendarDayProps[\"onDaySelect\"]\n onKeyboardNavigation: StzhCalendarDayProps[\"onKeyboardNavigation\"]\n focusedDayRef: (element: HTMLElement) => void\n}\n\nexport const StzhCalendarMonth: FunctionalComponent<StzhCalendarMonthProps> = ({\n selectedDate,\n focusedDate,\n labelledById,\n localization,\n firstDayOfWeek,\n min,\n max,\n dateFormatter,\n isDateDisabled,\n onDateSelect,\n onKeyboardNavigation,\n focusedDayRef,\n}) => {\n const today = new Date()\n const days = getViewOfMonth(focusedDate, firstDayOfWeek)\n\n return (\n <table class=\"stzh-calendar__table\" aria-labelledby={labelledById}>\n <thead>\n <tr>\n {mapWithOffset(localization.$globals.dayNames, firstDayOfWeek, dayName => (\n <th class=\"stzh-calendar__table-header\" scope=\"col\">\n <span aria-hidden=\"true\">{dayName.substring(0, 2)}</span>\n <span class=\"stzh-calendar__vhidden\">{dayName}</span>\n </th>\n ))}\n </tr>\n </thead>\n <tbody>\n {chunk(days, 7).map(week => (\n <tr class=\"stzh-calendar__row\">\n {week.map(day => (\n <td class=\"stzh-calendar__cell\">\n <StzhCalendarDay\n day={day}\n today={today}\n focusedDay={focusedDate}\n isSelected={isEqual(day, selectedDate)}\n disabled={isDateDisabled(day)}\n inRange={inRange(day, min, max)}\n onDaySelect={onDateSelect}\n dateFormatter={dateFormatter}\n onKeyboardNavigation={onKeyboardNavigation}\n focusedDayRef={focusedDayRef}\n />\n </td>\n ))}\n </tr>\n ))}\n </tbody>\n </table>\n )\n}\n","/**\n * @prop --background: Background color of calendar\n * @prop --padding-top: Padding top of calendar\n * @prop --padding-bottom: Padding bottom color of calendar\n * @prop --padding-left: Padding left color of calendar\n * @prop --padding-right: Padding right color of calendar\n * @prop --background-color: Background color of calendar\n */\n\n:host {\n --padding-top: #{space('small')};\n --padding-bottom: #{space('small')};\n --padding-left: #{space('xsmall')};\n --padding-right: #{space('xsmall')};\n\n width: #{$calendarWidth};\n}\n\n.stzh-calendar {\n --stzh-description-min-height: initial;\n\n display: flex;\n position: relative;\n text-align: left;\n touch-action: pan-y;\n user-select: none;\n overflow: hidden;\n overflow: clip;\n padding-top: var(--padding-top);\n padding-bottom: var(--padding-bottom);\n padding-left: var(--padding-left);\n padding-right: var(--padding-right);\n\n &__wrapper {\n width: 100%;\n }\n\n &__table {\n @include font;\n @include fontSize('milli');\n border-collapse: collapse;\n border-spacing: 0;\n text-align: center;\n width: 100%;\n }\n\n &__table-header,\n &__cell {\n padding: space('xxxsmall');\n\n &:first-child {\n padding-left: 0;\n }\n\n &:last-child {\n padding-right: 0;\n }\n }\n\n &__row:last-child &__cell {\n padding-bottom: 0;\n }\n\n &__table-header {\n @include font;\n @include fontSize('nano');\n text-decoration-line: none;\n padding-top: 0;\n padding-bottom: 0;\n width: 44px;\n height: 40px;\n }\n\n &__cell {\n text-align: center;\n }\n\n &__day {\n @include font;\n @include fontSize('milli');\n appearance: none;\n background: transparent;\n border: 0;\n cursor: pointer;\n display: inline-block;\n font-variant-numeric: tabular-nums;\n width: 40px;\n height: 40px;\n text-align: center;\n vertical-align: middle;\n transition-property: color, background-color;\n transition-duration: $baseTransitionAnimationSpeed;\n // position: relative;\n // padding: 0 0 1px;\n // z-index: 1;\n\n // &::before {\n // z-index: -1;\n // bottom: 0;\n // content: \"\";\n // left: 0;\n // position: absolute;\n // right: 0;\n // top: 0;\n // }\n\n &.is-today {\n @include font('heavy');\n color: $colorPrimary70;\n // box-shadow: 0 0 0 1px $colorPrimary;\n // position: relative;\n // z-index: 200;\n }\n\n &:hover {\n background: $colorGrey20;\n }\n\n // &:hover::before {\n // background: $colorGrey20;\n // }\n\n // &:focus,\n &[aria-pressed=\"true\"] {\n background: $colorSecondary30;\n // box-shadow: none;\n color: $colorPrimary70;\n }\n\n &:active {\n background: $colorSecondary30;\n // box-shadow: 0 0 5px $colorPrimary;\n color: $colorPrimary70;\n // z-index: 200;\n }\n\n // &:focus {\n // z-index: 200;\n // }\n\n // &:not(.is-month) {\n // box-shadow: none;\n // }\n\n &:not(.is-month),\n &[aria-disabled=\"true\"] {\n background: transparent;\n color: $colorGrey60;\n cursor: default;\n }\n\n // &[aria-disabled=\"true\"] {\n // &.is-today {\n // box-shadow: 0 0 0 1px $colorGrey20;\n\n // &:focus {\n // box-shadow: 0 0 5px $colorPrimary;\n // }\n // }\n\n // &::before {\n // display: none;\n // }\n // }\n\n &.is-disabled {\n text-decoration-line: line-through;\n }\n\n &.is-outside {\n color: $colorGrey60;\n background: $colorGrey20;\n // box-shadow: none;\n cursor: default;\n pointer-events: none;\n text-decoration-line: none;\n\n // &::before {\n // display: none;\n // }\n }\n }\n\n &__header {\n align-items: center;\n display: flex;\n justify-content: space-between;\n width: 100%;\n }\n\n &__nav {\n display: flex;\n align-items: center;\n\n &.is-dropdowns {\n gap: calc(#{space('xsmall')} + #{space('small')});\n margin-left: space('small');\n }\n }\n\n // &__prev,\n // &__next {\n // align-items: center;\n // appearance: none;\n // font-family: inherit;\n // background: transparent;\n // border-radius: 50%;\n // color: $colorPrimary70;\n // cursor: pointer;\n // display: inline-flex;\n // flex-shrink: 0;\n // justify-content: center;\n // margin-left: space('xsmall');\n // padding: 0;\n // transition: background-color 300ms ease;\n // height: 32px;\n // width: 32px;\n\n // &:disabled {\n // cursor: default;\n // color: $colorGrey60;\n // }\n // }\n\n stzh-dropdown#{&}__dropdown {\n --popover-width: 100%;\n --popover-height: calc(100% - #{$formInputHeightSmall} - var(--padding-top));\n --popover-max-height: initial;\n position: static;\n }\n\n &__select-wrapper {\n display: inline-flex;\n position: relative;\n\n span {\n margin-right: 0px;\n }\n }\n\n &__select {\n @include fontSize('milli');\n cursor: pointer;\n height: 100%;\n left: 0;\n opacity: 0;\n position: absolute;\n top: 0;\n width: 100%;\n z-index: 2;\n border-radius: $formInputBorderRadius;\n }\n\n &__select-label {\n @include fontSize('milli');\n appearance: none;\n border: none;\n align-items: center;\n border-radius: $formInputBorderRadius;\n color: $colorPrimary70;\n display: flex;\n gap: space('xsmall');\n padding: 0;\n padding-left: space('small');\n padding-right: space('xsmall');\n\n position: relative;\n width: 100%;\n min-height: 40px;\n z-index: 1;\n }\n\n &__select-icon {\n --size: #{iconSize('xsmall')};\n }\n\n &__vhidden {\n @include visuallyhidden;\n }\n}\n","import {\n Component,\n ComponentInterface,\n Host,\n Prop,\n Element,\n h,\n Event,\n EventEmitter,\n State,\n Method,\n Watch\n} from \"@stencil/core\"\n\nimport {\n addDays,\n startOfWeek,\n endOfWeek,\n setMonth,\n setYear,\n clamp,\n inRange,\n endOfMonth,\n startOfMonth,\n printISODate,\n parseISODate,\n DaysOfWeek,\n} from \"../../utils/date-utils\";\n\nimport { StzhCalendarChangeEvent, StzhDropdownChangeEvent } from \"../../index\";\nimport { StzhCalendarDateDisabledPredicate } from \"../../index\";\n\nimport { StzhCalendarMonth } from \"./stzh-calendar-month\";\nimport { StzhCalendarLocalizedText } from \"./stzh-calendar.localization\";\n\nfunction range(from: number, to: number) {\n var result: number[] = []\n for (var i = from; i <= to; i++) {\n result.push(i)\n }\n return result\n}\n\nconst keyCode = {\n TAB: 9,\n ESC: 27,\n SPACE: 32,\n PAGE_UP: 33,\n PAGE_DOWN: 34,\n END: 35,\n HOME: 36,\n LEFT: 37,\n UP: 38,\n RIGHT: 39,\n DOWN: 40,\n}\n\nlet calendarCounter = 0;\n\n@Component({\n tag: \"stzh-calendar\",\n styleUrl: \"stzh-calendar.scss\",\n scoped: true\n})\nexport class StzhCalendar implements ComponentInterface {\n /** Date value. Must be in IS0-8601 format: YYYY-MM-DD. */\n @Prop({ mutable: true }) value: string = \"\"\n\n /**\n * Minimum date allowed to be picked. Must be in IS0-8601 format: YYYY-MM-DD.\n * This setting can be used alone or together with the max property.\n */\n @Prop() min: string = \"\"\n\n /**\n * Maximum date allowed to be picked. Must be in IS0-8601 format: YYYY-MM-DD.\n * This setting can be used alone or together with the min property.\n */\n @Prop() max: string = \"\"\n\n /**\n * Which day is considered first day of the week? `0` for Sunday, `1` for Monday, etc.\n * Default is Monday.\n */\n @Prop() firstDayOfWeek: DaysOfWeek = DaysOfWeek.Monday\n\n /** Day names, month names, etc, used for localization. */\n @Prop() localization: StzhCalendarLocalizedText;\n\n /**\n * Controls which days are disabled and therefore disallowed.\n * For example, this can be used to disallow selection of weekends.\n */\n @Prop() isDateDisabled: StzhCalendarDateDisabledPredicate = () => false\n\n /**\n * For Adobe Analytics.\n * Will be rendered as value of `s-object-id` attribute to the previous month button element.\n * Default value will be taken from translations.\n */\n @Prop() prevMonthAnalyticsId: string;\n\n /**\n * For Adobe Analytics.\n * Will be rendered as value of `s-object-id` attribute to the next month button element.\n * Default value will be taken from translations.\n */\n @Prop() nextMonthAnalyticsId: string;\n\n @State() activeFocus = false\n @State() focusedDay = new Date()\n\n /** Event emitted when a date is selected. */\n @Event() stzhChange: EventEmitter<StzhCalendarChangeEvent>\n\n @Watch(\"localization\")\n createDateFormatters() {\n if (this.localization) {\n this.dateFormatShort = new Intl.DateTimeFormat(this.localization.$locale, { day: \"numeric\", month: \"long\" })\n }\n }\n\n @Watch(\"value\")\n valueWatcher(newValue: string) {\n if (newValue) {\n this.setFocusedDay(parseISODate(this.value));\n } else {\n this.setFocusedDay(new Date());\n }\n }\n\n /** Set focused day element by a JS Date object */\n @Method()\n async setFocusedDay(day: Date) {\n this.focusedDay = clamp(day, parseISODate(this.min), parseISODate(this.max))\n }\n\n /** Set value by a JS Date object */\n @Method()\n async setDate(date: Date) {\n this.value = printISODate(date)\n }\n\n @Element() element: HTMLStzhCalendarElement\n\n // private monthSelectId: string\n // private yearSelectId: string\n private dialogLabelId: string\n\n // private focusedDayNode: HTMLButtonElement\n\n private initialTouchX: number = null\n private initialTouchY: number = null\n\n /**\n * To format dates exclusively for the benefit of screen readers.\n *\n * We prefer DateTimeFormat over date.toLocaleDateString, as the former has\n * better performance when formatting large number of dates. See:\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleDateString#Performance\n */\n private dateFormatShort: Intl.DateTimeFormat\n\n private enableActiveFocus = () => {\n this.activeFocus = true\n }\n\n private disableActiveFocus = () => {\n this.activeFocus = false\n }\n\n private addDays(days: number) {\n this.setFocusedDay(addDays(this.focusedDay, days))\n }\n\n private addMonths(months: number) {\n this.setMonth(this.focusedDay.getMonth() + months)\n }\n\n private addYears(years: number) {\n this.setYear(this.focusedDay.getFullYear() + years)\n }\n\n private startOfWeek() {\n this.setFocusedDay(startOfWeek(this.focusedDay, this.firstDayOfWeek))\n }\n\n private endOfWeek() {\n this.setFocusedDay(endOfWeek(this.focusedDay, this.firstDayOfWeek))\n }\n\n private setMonth(month: number) {\n const min = setMonth(startOfMonth(this.focusedDay), month)\n const max = endOfMonth(min)\n const date = setMonth(this.focusedDay, month)\n\n this.setFocusedDay(clamp(date, min, max))\n }\n\n private setYear(year: number) {\n const min = setYear(startOfMonth(this.focusedDay), year)\n const max = endOfMonth(min)\n const date = setYear(this.focusedDay, year)\n\n this.setFocusedDay(clamp(date, min, max))\n }\n\n private handleTouchStart = (event: TouchEvent) => {\n const touch = event.changedTouches[0]\n this.initialTouchX = touch.pageX\n this.initialTouchY = touch.pageY\n }\n\n // private handleTouchMove = (event: TouchEvent) => {\n // event.preventDefault()\n // }\n\n private handleTouchEnd = (event: TouchEvent) => {\n const touch = event.changedTouches[0]\n const distX = touch.pageX - this.initialTouchX // get horizontal dist traveled\n const distY = touch.pageY - this.initialTouchY // get vertical dist traveled\n const threshold = 70\n\n const isHorizontalSwipe = Math.abs(distX) >= threshold && Math.abs(distY) <= threshold\n\n if (isHorizontalSwipe) {\n this.addMonths(distX < 0 ? 1 : -1)\n }\n\n this.initialTouchY = null\n this.initialTouchX = null\n }\n\n private handleNextMonthClick = (event: MouseEvent) => {\n event.preventDefault()\n this.addMonths(1)\n }\n\n private handlePreviousMonthClick = (event: MouseEvent) => {\n event.preventDefault()\n this.addMonths(-1)\n }\n\n private handleKeyboardNavigation = (event: KeyboardEvent) => {\n var handled = true\n\n switch (event.keyCode) {\n case keyCode.RIGHT:\n this.addDays(1)\n break\n case keyCode.LEFT:\n this.addDays(-1)\n break\n case keyCode.DOWN:\n this.addDays(7)\n break\n case keyCode.UP:\n this.addDays(-7)\n break\n case keyCode.PAGE_UP:\n if (event.shiftKey) {\n this.addYears(-1)\n } else {\n this.addMonths(-1)\n }\n break\n case keyCode.PAGE_DOWN:\n if (event.shiftKey) {\n this.addYears(1)\n } else {\n this.addMonths(1)\n }\n break\n case keyCode.HOME:\n this.startOfWeek()\n break\n case keyCode.END:\n this.endOfWeek()\n break\n default:\n handled = false\n }\n\n if (handled) {\n event.preventDefault()\n this.enableActiveFocus()\n }\n }\n\n private handleDaySelect = (_event: MouseEvent, day: Date) => {\n const isInRange = inRange(day, parseISODate(this.min), parseISODate(this.max))\n const isAllowed = !this.isDateDisabled(day)\n\n if (isInRange && isAllowed) {\n this.setDate(day)\n\n this.stzhChange.emit({\n component: \"stzh-calendar\",\n value: this.value,\n valueAsDate: day,\n })\n } else {\n // for consistency we should set the focused day in cases where\n // user has selected a day that has been specifically disallowed\n this.setFocusedDay(day)\n }\n }\n\n private handleMonthSelect = (event: CustomEvent<StzhDropdownChangeEvent>) => {\n const value = Array.isArray(event.detail.value) ? event.detail.value[0] : event.detail.value;\n this.setMonth(parseInt(value, 10))\n }\n\n private handleYearSelect = (event: CustomEvent<StzhDropdownChangeEvent>) => {\n const value = Array.isArray(event.detail.value) ? event.detail.value[0] : event.detail.value;\n this.setYear(parseInt(value, 10))\n }\n\n private processFocusedDayNode = (element: HTMLButtonElement) => {\n // this.focusedDayNode = element\n\n if (this.activeFocus) {\n setTimeout(() => element.focus(), 0)\n }\n }\n\n async componentWillLoad() {\n // this.monthSelectId = `stzh-calendar-month-${calendarCounter}`;\n // this.yearSelectId = `stzh-calendar-year-${calendarCounter}`;\n this.dialogLabelId = `stzh-calendar-dialog-${calendarCounter}`;\n calendarCounter++;\n\n this.valueWatcher(this.value);\n\n if (!this.localization) {\n this.localization = await window.stzhComponents.utils.fetchTranslations(this.element, 'calendar');\n }\n }\n\n connectedCallback() {\n this.createDateFormatters()\n }\n\n render() {\n const valueAsDate = parseISODate(this.value)\n const selectedYear = (valueAsDate || this.focusedDay).getFullYear()\n const focusedMonth = this.focusedDay.getMonth()\n const focusedYear = this.focusedDay.getFullYear()\n\n const minDate = parseISODate(this.min)\n const maxDate = parseISODate(this.max)\n const prevMonthDisabled =\n minDate != null && minDate.getMonth() === focusedMonth && minDate.getFullYear() === focusedYear\n const nextMonthDisabled =\n maxDate != null && maxDate.getMonth() === focusedMonth && maxDate.getFullYear() === focusedYear\n\n const minYear = minDate ? minDate.getFullYear() : selectedYear - 10\n const maxYear = maxDate ? maxDate.getFullYear() : selectedYear + 10\n\n const monthDropdownOptions = this.localization.$globals.monthNames.map((month, i) => {\n return {\n value: i.toString(),\n text: month,\n disabled: !inRange(\n new Date(focusedYear, i, 1),\n minDate ? startOfMonth(minDate) : null,\n maxDate ? endOfMonth(maxDate) : null\n ),\n }\n });\n\n const yearDropdownOptions = range(minYear, maxYear).map(year => {\n return {\n value: year.toString(),\n text: year.toString(),\n }\n });\n\n return (\n <Host>\n <div\n class={{\n \"stzh-calendar\": true\n }}\n /* onTouchMove={this.handleTouchMove} */\n onTouchStart={this.handleTouchStart}\n onTouchEnd={this.handleTouchEnd}\n >\n <div class=\"stzh-calendar__wrapper\">\n {/*\n <div class=\"stzh-calendar__mobile\" onFocusin={this.disableActiveFocus}>\n <label class=\"stzh-calendar__mobile-heading\">{this.localization.calendarHeading}</label>\n </div>\n */}\n {/* @ts-ignore */}\n <div class=\"stzh-calendar__header\" onFocusin={this.disableActiveFocus}>\n <div class=\"stzh-calendar__nav is-dropdowns\">\n <h2\n id={this.dialogLabelId}\n class=\"stzh-calendar__vhidden\"\n aria-live=\"polite\"\n aria-atomic=\"true\"\n >\n {this.localization.$globals.monthNames[focusedMonth]}\n {this.focusedDay.getFullYear()}\n </h2>\n\n <stzh-dropdown\n class=\"stzh-calendar__dropdown\"\n variant=\"plain\"\n size=\"small\"\n inline\n popover-fullwidth=\"horizontal\"\n noSearch={true}\n openOnFocus={false}\n items={[focusedMonth.toString()]}\n options={monthDropdownOptions}\n label={this.localization.monthSelectLabel}\n labelHidden={true}\n onStzhChange={this.handleMonthSelect}\n ></stzh-dropdown>\n\n <stzh-dropdown\n class=\"stzh-calendar__dropdown\"\n variant=\"plain\"\n size=\"small\"\n inline\n popover-fullwidth=\"horizontal\"\n noSearch={true}\n openOnFocus={false}\n items={[focusedYear.toString()]}\n options={yearDropdownOptions}\n label={this.localization.yearSelectLabel}\n labelHidden={true}\n onStzhChange={this.handleYearSelect}\n ></stzh-dropdown>\n\n {/* alternative for dropdown with popover:\n <stzh-popover>\n <button class=\"stzh-calendar__select-label\" aria-label={this.localization.monthSelectLabel}>\n <span>{this.localization.$globals.monthNamesShort[focusedMonth]}</span>\n <stzh-icon class=\"stzh-calendar__select-icon\" name=\"angle-down\"></stzh-icon>\n </button>\n <stzh-menu slot=\"content\">\n {this.localization.$globals.monthNames.map((month, i) => (\n <stzh-menu-item\n // onClick={this.handleMonthSelect(month)}\n active={i === focusedMonth}\n disabled={\n !inRange(\n new Date(focusedYear, i, 1),\n minDate ? startOfMonth(minDate) : null,\n maxDate ? endOfMonth(maxDate) : null\n )\n }\n >\n {month}\n </stzh-menu-item>\n ))}\n </stzh-menu>\n </stzh-popover>\n */}\n\n {/* original implmentation with native select:\n <label htmlFor={this.monthSelectId} class=\"stzh-calendar__vhidden\">\n {this.localization.monthSelectLabel}\n </label>\n\n <div class=\"stzh-calendar__select-wrapper\">\n <select\n id={this.monthSelectId}\n class=\"stzh-calendar__select stzh-calendar__select--month\"\n onChange={this.handleMonthSelect}\n >\n {this.localization.$globals.monthNames.map((month, i) => (\n <option\n key={month}\n value={i}\n selected={i === focusedMonth}\n disabled={\n !inRange(\n new Date(focusedYear, i, 1),\n minDate ? startOfMonth(minDate) : null,\n maxDate ? endOfMonth(maxDate) : null\n )\n }\n >\n {month}\n </option>\n ))}\n </select>\n <div class=\"stzh-calendar__select-label\" aria-hidden=\"true\">\n <span>{this.localization.$globals.monthNamesShort[focusedMonth]}</span>\n <stzh-icon class=\"stzh-calendar__select-icon\" name=\"angle-down\"></stzh-icon>\n </div>\n </div>\n\n <label htmlFor={this.yearSelectId} class=\"stzh-calendar__vhidden\">\n {this.localization.yearSelectLabel}\n </label>\n\n <div class=\"stzh-calendar__select-wrapper\">\n <select\n id={this.yearSelectId}\n class=\"stzh-calendar__select stzh-calendar__select--year\"\n onChange={this.handleYearSelect}\n >\n {range(minYear, maxYear).map(year => (\n <option key={year} selected={year === focusedYear}>\n {year}\n </option>\n ))}\n </select>\n <div class=\"stzh-calendar__select-label\" aria-hidden=\"true\">\n <span>{this.focusedDay.getFullYear()}</span>\n <stzh-icon class=\"stzh-calendar__select-icon\" name=\"angle-down\"></stzh-icon>\n </div>\n </div>\n */}\n\n </div>\n\n <div class=\"stzh-calendar__nav\">\n <stzh-button\n class=\"stzh-calendar__prev\"\n variant=\"tertiary\"\n size=\"small\"\n icon=\"arrow-left\"\n iconOnly={true}\n onClick={this.handlePreviousMonthClick}\n disabled={prevMonthDisabled}\n type=\"button\"\n a11yLabel={this.localization.prevMonthLabel}\n analyticsId={this.prevMonthAnalyticsId || this.localization.prevMonthLabel}\n ></stzh-button>\n <stzh-button\n class=\"stzh-calendar__next\"\n variant=\"tertiary\"\n size=\"small\"\n icon=\"arrow-right\"\n iconOnly={true}\n onClick={this.handleNextMonthClick}\n disabled={nextMonthDisabled}\n type=\"button\"\n a11yLabel={this.localization.nextMonthLabel}\n analyticsId={this.nextMonthAnalyticsId || this.localization.nextMonthLabel}\n ></stzh-button>\n </div>\n </div>\n\n <StzhCalendarMonth\n dateFormatter={this.dateFormatShort}\n selectedDate={valueAsDate}\n focusedDate={this.focusedDay}\n onDateSelect={this.handleDaySelect}\n onKeyboardNavigation={this.handleKeyboardNavigation}\n labelledById={this.dialogLabelId}\n localization={this.localization}\n firstDayOfWeek={this.firstDayOfWeek}\n focusedDayRef={this.processFocusedDayNode}\n min={minDate}\n max={maxDate}\n isDateDisabled={this.isDateDisabled}\n />\n </div>\n </div>\n </Host>\n )\n }\n}\n"],"version":3}