@six-group/ui-library 5.0.0-rc.1 → 5.0.0-rc.2

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 (122) hide show
  1. package/dist/cjs/index-C8rK7OAe.js +4 -0
  2. package/dist/cjs/loader.cjs.js +1 -1
  3. package/dist/cjs/six-range.cjs.entry.js.map +1 -1
  4. package/dist/cjs/six-range.entry.cjs.js.map +1 -1
  5. package/dist/cjs/six-rating.cjs.entry.js +126 -0
  6. package/dist/cjs/six-rating.cjs.entry.js.map +1 -0
  7. package/dist/cjs/six-rating.entry.cjs.js.map +1 -0
  8. package/dist/cjs/six-root.cjs.entry.js +1 -1
  9. package/dist/cjs/six-sidebar-item.cjs.entry.js +2 -2
  10. package/dist/cjs/six-sidebar.cjs.entry.js +2 -2
  11. package/dist/cjs/six-switch.cjs.entry.js +2 -2
  12. package/dist/cjs/six-switch.cjs.entry.js.map +1 -1
  13. package/dist/cjs/six-switch.entry.cjs.js.map +1 -1
  14. package/dist/cjs/six-tab-panel.cjs.entry.js +1 -1
  15. package/dist/cjs/six-tab.cjs.entry.js +2 -2
  16. package/dist/cjs/six-tag.cjs.entry.js +2 -2
  17. package/dist/cjs/six-textarea.cjs.entry.js +2 -2
  18. package/dist/cjs/six-tile.cjs.entry.js +5 -5
  19. package/dist/cjs/six-timepicker.cjs.entry.js +17 -9
  20. package/dist/cjs/six-timepicker.cjs.entry.js.map +1 -1
  21. package/dist/cjs/six-timepicker.entry.cjs.js.map +1 -1
  22. package/dist/cjs/six-tooltip.cjs.entry.js +2 -2
  23. package/dist/cjs/ui-library.cjs.js +1 -1
  24. package/dist/collection/collection-manifest.json +1 -0
  25. package/dist/collection/components/six-rating/six-rating.css +125 -0
  26. package/dist/collection/components/six-rating/six-rating.js +432 -0
  27. package/dist/collection/components/six-rating/six-rating.js.map +1 -0
  28. package/dist/collection/components/six-root/six-root.js +1 -1
  29. package/dist/collection/components/six-sidebar/six-sidebar.js +2 -2
  30. package/dist/collection/components/six-sidebar-item/six-sidebar-item.js +2 -2
  31. package/dist/collection/components/six-switch/six-switch.js +2 -2
  32. package/dist/collection/components/six-tab/six-tab.js +2 -2
  33. package/dist/collection/components/six-tab-panel/six-tab-panel.js +1 -1
  34. package/dist/collection/components/six-tag/six-tag.js +2 -2
  35. package/dist/collection/components/six-textarea/six-textarea.js +2 -2
  36. package/dist/collection/components/six-tile/six-tile.js +5 -5
  37. package/dist/collection/components/six-timepicker/six-timepicker.js +17 -9
  38. package/dist/collection/components/six-timepicker/six-timepicker.js.map +1 -1
  39. package/dist/collection/components/six-tooltip/six-tooltip.js +2 -2
  40. package/dist/components/index.js +2 -0
  41. package/dist/components/index.js.map +1 -1
  42. package/dist/components/{p-DnLdSdN5.js → p-CAJFkiLw.js} +19 -11
  43. package/dist/components/p-CAJFkiLw.js.map +1 -0
  44. package/dist/components/{p-Cs6mMfx-.js → p-ClylOmYH.js} +4 -4
  45. package/dist/components/{p-Cs6mMfx-.js.map → p-ClylOmYH.js.map} +1 -1
  46. package/dist/components/six-datepicker.js +1 -1
  47. package/dist/components/six-range.js.map +1 -1
  48. package/dist/components/six-rating.d.ts +11 -0
  49. package/dist/components/six-rating.js +173 -0
  50. package/dist/components/six-rating.js.map +1 -0
  51. package/dist/components/six-root.js +1 -1
  52. package/dist/components/six-sidebar-item.js +2 -2
  53. package/dist/components/six-sidebar.js +2 -2
  54. package/dist/components/six-switch.js +2 -2
  55. package/dist/components/six-switch.js.map +1 -1
  56. package/dist/components/six-tab-panel.js +1 -1
  57. package/dist/components/six-tab.js +2 -2
  58. package/dist/components/six-tag.js +3 -3
  59. package/dist/components/six-textarea.js +2 -2
  60. package/dist/components/six-tile.js +6 -6
  61. package/dist/components/six-timepicker.js +1 -1
  62. package/dist/components/six-tooltip.js +1 -1
  63. package/dist/components.json +468 -1
  64. package/dist/esm/index-JoG9I7EO.js +4 -0
  65. package/dist/esm/loader.js +1 -1
  66. package/dist/esm/six-range.entry.js.map +1 -1
  67. package/dist/esm/six-rating.entry.js +124 -0
  68. package/dist/esm/six-rating.entry.js.map +1 -0
  69. package/dist/esm/six-root.entry.js +1 -1
  70. package/dist/esm/six-sidebar-item.entry.js +2 -2
  71. package/dist/esm/six-sidebar.entry.js +2 -2
  72. package/dist/esm/six-switch.entry.js +2 -2
  73. package/dist/esm/six-switch.entry.js.map +1 -1
  74. package/dist/esm/six-tab-panel.entry.js +1 -1
  75. package/dist/esm/six-tab.entry.js +2 -2
  76. package/dist/esm/six-tag.entry.js +2 -2
  77. package/dist/esm/six-textarea.entry.js +2 -2
  78. package/dist/esm/six-tile.entry.js +5 -5
  79. package/dist/esm/six-timepicker.entry.js +17 -9
  80. package/dist/esm/six-timepicker.entry.js.map +1 -1
  81. package/dist/esm/six-tooltip.entry.js +2 -2
  82. package/dist/esm/ui-library.js +1 -1
  83. package/dist/types/components/six-rating/six-rating.d.ts +52 -0
  84. package/dist/types/components.d.ts +160 -0
  85. package/dist/ui-library/{p-01243b2e.entry.js → p-03ca4af8.entry.js} +2 -2
  86. package/dist/ui-library/p-12e7a9e1.entry.js +2 -0
  87. package/dist/ui-library/p-12e7a9e1.entry.js.map +1 -0
  88. package/dist/ui-library/{p-362ff192.entry.js → p-21cbccb1.entry.js} +2 -2
  89. package/dist/ui-library/p-39668d61.entry.js +2 -0
  90. package/dist/ui-library/p-39668d61.entry.js.map +1 -0
  91. package/dist/ui-library/{p-ea61b009.entry.js → p-6c8182fa.entry.js} +2 -2
  92. package/dist/ui-library/{p-25ff87fe.entry.js → p-83b35622.entry.js} +2 -2
  93. package/dist/ui-library/{p-f6423fca.entry.js → p-c8fbf085.entry.js} +2 -2
  94. package/dist/ui-library/p-d7c7398d.entry.js +2 -0
  95. package/dist/ui-library/{p-f4dd7b57.entry.js → p-d9e770ab.entry.js} +2 -2
  96. package/dist/ui-library/p-d9e770ab.entry.js.map +1 -0
  97. package/dist/ui-library/p-ea3bf68d.entry.js +2 -0
  98. package/dist/ui-library/p-ee980a0f.entry.js.map +1 -1
  99. package/dist/ui-library/{p-29d79fe3.entry.js → p-f54d3616.entry.js} +2 -2
  100. package/dist/ui-library/{p-285666de.entry.js → p-f6a1c20b.entry.js} +2 -2
  101. package/dist/ui-library/six-range.entry.esm.js.map +1 -1
  102. package/dist/ui-library/six-rating.entry.esm.js.map +1 -0
  103. package/dist/ui-library/six-switch.entry.esm.js.map +1 -1
  104. package/dist/ui-library/six-timepicker.entry.esm.js.map +1 -1
  105. package/dist/ui-library/ui-library.css +1 -1
  106. package/dist/ui-library/ui-library.esm.js +1 -1
  107. package/package.json +1 -1
  108. package/dist/components/p-DnLdSdN5.js.map +0 -1
  109. package/dist/ui-library/p-494546c8.entry.js +0 -2
  110. package/dist/ui-library/p-4f52c56f.entry.js +0 -2
  111. package/dist/ui-library/p-4f52c56f.entry.js.map +0 -1
  112. package/dist/ui-library/p-d36ec323.entry.js +0 -2
  113. package/dist/ui-library/p-f4dd7b57.entry.js.map +0 -1
  114. /package/dist/ui-library/{p-01243b2e.entry.js.map → p-03ca4af8.entry.js.map} +0 -0
  115. /package/dist/ui-library/{p-362ff192.entry.js.map → p-21cbccb1.entry.js.map} +0 -0
  116. /package/dist/ui-library/{p-ea61b009.entry.js.map → p-6c8182fa.entry.js.map} +0 -0
  117. /package/dist/ui-library/{p-25ff87fe.entry.js.map → p-83b35622.entry.js.map} +0 -0
  118. /package/dist/ui-library/{p-f6423fca.entry.js.map → p-c8fbf085.entry.js.map} +0 -0
  119. /package/dist/ui-library/{p-d36ec323.entry.js.map → p-d7c7398d.entry.js.map} +0 -0
  120. /package/dist/ui-library/{p-494546c8.entry.js.map → p-ea3bf68d.entry.js.map} +0 -0
  121. /package/dist/ui-library/{p-29d79fe3.entry.js.map → p-f54d3616.entry.js.map} +0 -0
  122. /package/dist/ui-library/{p-285666de.entry.js.map → p-f6a1c20b.entry.js.map} +0 -0
@@ -137,6 +137,9 @@ export class SixTimepicker {
137
137
  };
138
138
  this.handleClearClick = (event) => {
139
139
  event.stopPropagation();
140
+ if (this.inputElement != null) {
141
+ this.inputElement.value = '';
142
+ }
140
143
  this.value = '';
141
144
  this.sixClear.emit();
142
145
  this.sixChange.emit({
@@ -194,13 +197,15 @@ export class SixTimepicker {
194
197
  });
195
198
  return;
196
199
  }
197
- // update value and popup value, and emit the new value
198
- this.value = inputElement.value;
199
- this.popupValue = parseTimeString(inputElement.value, this.format);
200
- this.sixChange.emit({
201
- value: this.popupValue,
202
- valueAsString: createTimeString(this.popupValue, this.format),
203
- });
200
+ else {
201
+ // update value and popup value and emit the new value
202
+ this.value = inputElement.value;
203
+ this.popupValue = parseTimeString(inputElement.value, this.format);
204
+ this.sixChange.emit({
205
+ value: this.popupValue,
206
+ valueAsString: createTimeString(this.popupValue, this.format),
207
+ });
208
+ }
204
209
  }, this.debounce));
205
210
  }
206
211
  componentDidRender() {
@@ -214,6 +219,9 @@ export class SixTimepicker {
214
219
  if (typeof this.value !== 'string' || !isValidTimeString(this.value, this.format)) {
215
220
  this.value = '';
216
221
  }
222
+ else if (this.inputElement != null) {
223
+ this.inputElement.value = this.value;
224
+ }
217
225
  // update popup value
218
226
  if (this.value === '') {
219
227
  if (this.defaultTime == null) {
@@ -346,10 +354,10 @@ export class SixTimepicker {
346
354
  } }, icon));
347
355
  }
348
356
  render() {
349
- return (h("div", { key: '58240c7c32227225d1811fa59e9cf336aad03a4d', part: "container", ref: (el) => (this.wrapper = el), class: "timepicker__container" }, h("six-input", { key: '1b6e9b28d997b67a933d055fa3e73e3c0751aa53', ref: (el) => (this.inputElement = el), part: "input", onClick: () => this.openPopup(), value: this.value, placeholder: this.placeholder, readonly: this.readonly, disabled: this.disabled, errorTextCount: this.errorTextCount, errorText: this.errorText, invalid: this.invalid, size: this.size, name: this.name, label: this.label, required: this.required, class: {
357
+ return (h("div", { key: 'a3496612a52df399ccd8cb88e2f3564432758b74', part: "container", ref: (el) => (this.wrapper = el), class: "timepicker__container" }, h("six-input", { key: 'ca426a5b063102ea92550ed6779a46c56a663a22', ref: (el) => (this.inputElement = el), part: "input", onClick: () => this.openPopup(), placeholder: this.placeholder, readonly: this.readonly, disabled: this.disabled, errorTextCount: this.errorTextCount, errorText: this.errorText, invalid: this.invalid, size: this.size, name: this.name, label: this.label, required: this.required, class: {
350
358
  'input--empty': this.value === '',
351
359
  'input--hide': this.inline,
352
- } }, this.renderCustomIcon(), this.renderClearable(), hasSlot(this.host, 'label') ? (h("span", { slot: "label" }, h("slot", { name: "label" }))) : null, hasSlot(this.host, 'error-text') ? (h("span", { slot: "error-text" }, h("slot", { name: "error-text" }))) : null), this.open && (h("div", { key: 'b762116d0af1bc11d7f2cbb255b071e8fe3b52cf', ref: (el) => (this.popup = el), part: "popup", class: {
360
+ } }, this.renderCustomIcon(), this.renderClearable(), hasSlot(this.host, 'label') ? (h("span", { slot: "label" }, h("slot", { name: "label" }))) : null, hasSlot(this.host, 'error-text') ? (h("span", { slot: "error-text" }, h("slot", { name: "error-text" }))) : null), this.open && (h("div", { key: '8c03ea793c9452af88fe41699ec58b526057d834', ref: (el) => (this.popup = el), part: "popup", class: {
353
361
  timepicker__popup: true,
354
362
  'timepicker__popup--is-up': this.placement == null ? this.placement === 'top' : this.isPopupContentUp,
355
363
  'timepicker__popup--is-inline': this.inline,
@@ -1 +1 @@
1
- {"version":3,"file":"six-timepicker.js","sourceRoot":"","sources":["../../../src/components/six-timepicker/six-timepicker.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC/G,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,eAAe,GAIhB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,qBAAqB,EAAE,8BAA8B,EAAE,MAAM,+B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AAE;oBACL,iBAAiB,EAAE,IAAI;oBACvB,0BAA0B,EAAE,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,KAAK,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,gBAAgB;oBACrG,8BAA8B,EAAE,IAAI,CAAC,MAAM;iBAC5C;mBAEG,IAAI,CAAC,UAAU,EAAE;gBACpB,IAAI,CAAC,aAAa,EAAE,CACjB,CACP,CACG,CACP,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, h, Listen, Method, Prop, State, Watch } from '@stencil/core';\nimport { ItemPickerType } from '../six-item-picker/types';\nimport {\n createTimeString,\n getCurrentTime,\n isValidTimeString,\n parseTimeString,\n Time,\n TimeFormat,\n TimeProperties,\n} from '../../utils/time.util';\nimport { debounce, DEFAULT_DEBOUNCE_FAST, DEFAULT_DEBOUNCE_INSANELY_FAST } from '../../utils/execution-control';\nimport { SixItemPickerChangePayload } from '../six-item-picker/six-item-picker';\nimport { EventListeners } from '../../utils/event-listeners';\nimport { hasSlot } from '../../utils/slot';\nimport { EmptyPayload } from '../../utils/types';\nimport { adjustPopupForHoisting, movePopup } from '../../utils/popup';\n\nexport interface SixTimepickerChange {\n value?: Time;\n valueAsString: string;\n changedProperty?: string;\n}\n\ninterface SixTimeUnitPickerParams {\n min?: number;\n max?: number;\n items?: string[];\n type?: ItemPickerType;\n class?: string;\n paddingLength?: number;\n propertyName: TimeProperties;\n}\n\nconst MIN_POPUP_HEIGHT = 145;\n\n/**\n * @since 2.0.0\n * @status experimental\n *\n * @slot error-text - Error text that is shown for validation errors. Alternatively, you can use the error-text prop.\n *\n * @part input - The input field\n * @part container - The container of whole component\n * @part popup - The popup of the timepicker component\n *\n */\n@Component({\n tag: 'six-timepicker',\n styleUrl: 'six-timepicker.scss',\n shadow: true,\n})\nexport class SixTimepicker {\n private eventListeners = new EventListeners();\n private popup?: HTMLElement;\n private wrapper?: HTMLElement;\n private inputElement?: HTMLSixInputElement;\n\n @Element() host!: HTMLSixTimepickerElement;\n\n /**\n * Define the time format. Valid formats are:\n *\n * HH:mm:ss\n * hh:mm:ss:aa\n * HH:mm:ss:ms\n * hh:mm:ss:ms:aa\n * HH:mm\n * hh:mm:aa\n * HH\n * hh:aa\n * mm\n * ss\n * ms\n *\n * where HH is the 24 hour format\n * and hh is the 12 hour format\n *\n * Please notice that when using the 12-hour-clock (hh)\n * you always need a period indicator (aa). So the time can be parsed as either am or pm\n * */\n @Prop() format: TimeFormat = 'HH:mm:ss';\n\n /**\n * Define the separator to be shown between the time unit pickers.\n * Please be aware that this property will modify the displayed separator only.\n * The separator for a timestring is always expected to be a colon (eg. '13:52:20')\n * */\n @Prop() separator = ':';\n\n /**\n * The value of the timepicker provided as a string. The string mast match the provided format (or default format)\n */\n @Prop({ mutable: true }) value = '';\n\n /** Indicates whether the timepicker dropdown is open on startup. You can use this in lieu of the show/hide methods. */\n @Prop({ mutable: true, reflect: true }) open = false;\n\n /** Indicates whether the timepicker should be shown as an inline (always open) component */\n @Prop({ reflect: true }) inline = false;\n\n /**\n * If `true` the user can only select a time via the timepicker but not directly edit the input field.\n */\n @Prop() readonly = false;\n\n /**\n * If `true` the component is disabled.\n */\n @Prop() disabled = false;\n\n /**\n * The enforced placement of the dropdown panel.\n */\n @Prop() placement?: 'top' | 'bottom';\n\n /** Timepicker size. */\n @Prop() size: 'small' | 'medium' | 'large' = 'medium';\n\n /** Set to true to show an asterisk beneath the label. */\n @Prop() required = false;\n\n /**\n * The placeholder defines what text to be shown on the input element\n */\n @Prop() placeholder?: string;\n\n /** The input's error text. Alternatively, you can use the error-text slot. */\n @Prop() errorText: string | string[] = '';\n\n /** The number of error texts to be shown (if the error-text slot isn't used). Defaults to 1 */\n @Prop() errorTextCount?: number;\n\n /** The input's label. Alternatively, you can use the label slot. */\n @Prop() label = '';\n\n /** If this property is set to true and an error message is provided by `errorText`, the error message is displayed. */\n @Prop({ reflect: true }) invalid = false;\n\n /** The input's name attribute. */\n @Prop({ reflect: true }) name = '';\n\n /** Set to true to add a clear button when the input is populated. */\n @Prop() clearable = false;\n\n /** Set the position of the icon */\n @Prop() iconPosition: 'left' | 'right' = 'left';\n\n /**\n * Enable this option to prevent the panel from being clipped when the component is placed inside a container with\n * `overflow: auto|scroll`.\n */\n @Prop() hoist = false;\n\n /**\n * Set the amount of time, in milliseconds, to wait to trigger faster switching between timeunits (e.g. hours).\n */\n @Prop() timeout = DEFAULT_DEBOUNCE_FAST;\n\n /**\n * Set the amount of time, in milliseconds, to wait between switching to next timeunit (e.g. next hour) when mouse button is held pressed.\n */\n @Prop() interval = DEFAULT_DEBOUNCE_INSANELY_FAST;\n\n /**\n * The defaultTime defines the default setting for the timepicker when you open the popup. Default time must match the provided format.\n */\n @Prop() defaultTime?: string;\n\n /**\n * Set the amount of time, in milliseconds, to wait to trigger the `six-timepicker-change-debounced` event.\n * If you want your change debounce event to not trigger when keeping the nav button pressed before, make sure debounce\n * is a bit bigger than timeout, otherwise keeping the button pressed will trigger the event twice: once you click\n * (and keep pressed) and once you release\n */\n @Prop() debounce = DEFAULT_DEBOUNCE_FAST;\n\n /**\n * Emitted when the timepicker's value changes\n */\n @Event({ eventName: 'six-timepicker-change' }) sixChange!: EventEmitter<SixTimepickerChange>;\n\n /**\n * Emitted when the timepicker's value changes, but debounced\n */\n @Event({ eventName: 'six-timepicker-change-debounced' }) sixChangeDebounced!: EventEmitter<SixTimepickerChange>;\n\n /**\n * Emitted when the clear button is activated.\n */\n @Event({ eventName: 'six-timepicker-clear' }) sixClear!: EventEmitter<EmptyPayload>;\n\n @State() isPopupContentUp = false;\n\n @State() isDropDownContentUp = false;\n\n @Listen('resize', { target: 'window' })\n async resizeHandler() {\n this.calcIsPopupContentUp();\n this.moveOpenHoistedPopup();\n }\n\n @Listen('scroll', { target: 'window' })\n async scrollHandler() {\n this.calcIsPopupContentUp();\n this.moveOpenHoistedPopup();\n }\n\n /**\n * Update the native input element when the value changes\n */\n @Watch('value')\n protected valueChanged() {\n this.updateValue();\n }\n\n /** Sets focus on the datepickers input. */\n @Method()\n async setFocus(options?: FocusOptions) {\n this.inputElement?.setFocus(options);\n }\n\n /*\n * Internally the six-timepicker uses a standardized representation of time, so we don't have a mess,\n * when switching between formats\n */\n @State() private popupValue: Time = {};\n\n connectedCallback() {\n this.eventListeners.forward('six-timepicker-change', 'change', this.host);\n }\n\n componentWillLoad() {\n this.updateValue();\n\n if (this.inline) {\n this.open = true;\n }\n\n if (this.open) {\n this.eventListeners.add(document, 'mousedown', this.handleDocumentMouseDown);\n }\n }\n\n componentDidLoad() {\n if (this.inputElement == null) return;\n const inputElement = this.inputElement;\n\n // emit debounced change event\n this.eventListeners.add(\n this.host,\n 'six-timepicker-change',\n debounce((event: Event) => this.sixChangeDebounced.emit((event as CustomEvent).detail), this.debounce)\n );\n\n // update value and popup value based on input-element value\n this.eventListeners.add(\n inputElement,\n 'six-input-input',\n debounce((event: Event) => {\n event.stopPropagation();\n\n // emit empty event if time string is invalid\n if (!isValidTimeString(inputElement.value, this.format)) {\n this.value = inputElement.value;\n this.sixChange.emit({\n value: {},\n valueAsString: '',\n });\n return;\n }\n\n // update value and popup value, and emit the new value\n this.value = inputElement.value;\n this.popupValue = parseTimeString(inputElement.value, this.format);\n this.sixChange.emit({\n value: this.popupValue,\n valueAsString: createTimeString(this.popupValue, this.format),\n });\n }, this.debounce)\n );\n }\n\n componentDidRender() {\n adjustPopupForHoisting(\n this.hoist,\n this.popup,\n this.inputElement,\n this.wrapper,\n MIN_POPUP_HEIGHT,\n (isUp) => (this.isDropDownContentUp = isUp)\n );\n }\n\n disconnectedCallback() {\n this.eventListeners.removeAll();\n }\n private updateValue() {\n // normalize value\n if (typeof this.value !== 'string' || !isValidTimeString(this.value, this.format)) {\n this.value = '';\n }\n\n // update popup value\n if (this.value === '') {\n if (this.defaultTime == null) {\n this.popupValue = getCurrentTime(this.is24HourClock());\n } else {\n this.popupValue = parseTimeString(this.defaultTime, this.format);\n }\n } else {\n this.popupValue = parseTimeString(this.value, this.format);\n }\n }\n\n private calcIsPopupContentUp() {\n if (this.inputElement == null || this.wrapper == null) {\n return;\n }\n\n const inputBoundingRect = this.inputElement.getBoundingClientRect();\n const wrapperBoundingRect = this.wrapper.getBoundingClientRect();\n const minPopupHeight = Math.max(wrapperBoundingRect.height, MIN_POPUP_HEIGHT);\n\n const moreSpaceInTop = inputBoundingRect.y > window.innerHeight / 2;\n this.isPopupContentUp = moreSpaceInTop && window.innerHeight < inputBoundingRect.bottom + minPopupHeight;\n }\n\n private moveOpenHoistedPopup() {\n movePopup(this.hoist, this.open, this.popup, this.inputElement, this.wrapper, MIN_POPUP_HEIGHT);\n }\n\n private handlePickerChange = (event: CustomEvent<SixItemPickerChangePayload>, property: TimeProperties) => {\n // stop propagation, since the timepicker should not expose the events of the underlying item-picker\n event.stopPropagation();\n if (this.popupValue == null) {\n return;\n }\n\n // update the internal state\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n this.popupValue[property] = event.detail;\n\n const timeString = createTimeString(this.popupValue, this.format);\n\n // update the input value\n this.value = timeString;\n\n // emit change event\n this.sixChange.emit({\n changedProperty: property,\n value: this.popupValue,\n valueAsString: timeString,\n });\n };\n\n private getSixTimeUnitPicker(params: SixTimeUnitPickerParams) {\n return (\n <six-item-picker\n class={params.class}\n timeout={this.timeout}\n interval={this.interval}\n padded\n min={params.min}\n max={params.max}\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n value={this.popupValue[params.propertyName]}\n items={params.items}\n type={params.type || ItemPickerType.NUMBER}\n padding-length={params.paddingLength}\n onSix-item-picker-change={(event) => this.handlePickerChange(event, params.propertyName)}\n ></six-item-picker>\n );\n }\n\n private getHour24Picker() {\n if (!this.is24HourClock()) {\n return;\n }\n return this.getSixTimeUnitPicker({ min: 0, max: 23, propertyName: 'hours' });\n }\n\n private is24HourClock() {\n return this.format.includes('HH');\n }\n\n private getHour12Picker() {\n if (!this.is12HourClock()) {\n return;\n }\n return this.getSixTimeUnitPicker({ min: 0, max: 11, propertyName: 'hours' });\n }\n\n private is12HourClock() {\n return this.format.includes('hh');\n }\n\n private getAmPmPicker() {\n if (!this.is12HourClock()) {\n return;\n }\n const items = ['AM', 'PM'];\n return this.getSixTimeUnitPicker({\n items,\n type: ItemPickerType.CUSTOM,\n propertyName: 'period',\n });\n }\n\n private getMinutePicker() {\n if (!this.format.includes('mm')) {\n return;\n }\n\n return this.getSixTimeUnitPicker({ min: 0, max: 59, propertyName: 'minutes' });\n }\n\n private getSecondsPicker() {\n if (!this.format.includes('ss')) {\n return;\n }\n\n return this.getSixTimeUnitPicker({ min: 0, max: 59, propertyName: 'seconds' });\n }\n\n private getMillisecondsPicker() {\n if (!this.format.includes('ms')) {\n return;\n }\n\n return this.getSixTimeUnitPicker({\n min: 0,\n max: 999,\n class: 'timepicker__item--wide',\n paddingLength: 3,\n propertyName: 'milliseconds',\n });\n }\n\n private getSeparator() {\n return (\n <div class=\"timepicker__separator\">\n <span>{this.separator}</span>\n </div>\n );\n }\n\n private getContent() {\n const elementsInOrder = [\n this.getHour24Picker(),\n this.getHour12Picker(),\n this.getMinutePicker(),\n this.getSecondsPicker(),\n this.getMillisecondsPicker(),\n ];\n\n const visibleElements = elementsInOrder.filter((el) => el !== undefined);\n\n return visibleElements.map((el, idx) => {\n if (idx === visibleElements.length - 1) {\n return [el];\n }\n\n return [el, this.getSeparator()];\n });\n }\n\n private openPopup() {\n if (!this.open && !this.disabled) {\n this.open = true;\n this.eventListeners.add(document, 'mousedown', this.handleDocumentMouseDown);\n }\n }\n\n private closePopup() {\n if (this.inline) {\n return;\n }\n\n this.open = false;\n this.eventListeners.remove(document, 'mousedown', this.handleDocumentMouseDown);\n }\n\n private handleDocumentMouseDown = (event: Event) => {\n // Close when clicking outside the containing element\n const path = event.composedPath() as EventTarget[];\n if (!path.includes(this.host)) {\n this.closePopup();\n return;\n }\n };\n\n private handleClearClick = (event: MouseEvent) => {\n event.stopPropagation();\n this.value = '';\n this.sixClear.emit();\n this.sixChange.emit({\n value: {},\n valueAsString: '',\n });\n };\n\n private renderClearable() {\n return (\n this.clearable && (\n <button\n slot=\"suffix\"\n class={{\n timepicker_clear: true,\n 'timepicker_clear--right': this.iconPosition === 'left',\n 'timepicker_clear--left': this.iconPosition === 'right',\n }}\n type=\"button\"\n onClick={this.handleClearClick}\n tabindex=\"-1\"\n >\n <six-icon size=\"small\">clear</six-icon>\n </button>\n )\n );\n }\n\n private renderCustomIcon() {\n const icon = hasSlot(this.host, 'custom-icon') ? (\n <slot name=\"custom-icon\"></slot>\n ) : (\n <six-icon size={this.size === 'large' ? 'medium' : this.size}>watch_later</six-icon>\n );\n\n return (\n <span\n slot=\"prefix\"\n part=\"icon\"\n class={{\n prefix: true,\n 'prefix--right': this.iconPosition === 'right',\n }}\n >\n {icon}\n </span>\n );\n }\n\n render() {\n return (\n <div part=\"container\" ref={(el) => (this.wrapper = el)} class=\"timepicker__container\">\n <six-input\n ref={(el) => (this.inputElement = el)}\n part=\"input\"\n onClick={() => this.openPopup()}\n value={this.value}\n placeholder={this.placeholder}\n readonly={this.readonly}\n disabled={this.disabled}\n errorTextCount={this.errorTextCount}\n errorText={this.errorText}\n invalid={this.invalid}\n size={this.size}\n name={this.name}\n label={this.label}\n required={this.required}\n class={{\n 'input--empty': this.value === '',\n 'input--hide': this.inline,\n }}\n >\n {this.renderCustomIcon()}\n {this.renderClearable()}\n {hasSlot(this.host, 'label') ? (\n <span slot=\"label\">\n <slot name=\"label\" />\n </span>\n ) : null}\n {hasSlot(this.host, 'error-text') ? (\n <span slot=\"error-text\">\n <slot name=\"error-text\" />\n </span>\n ) : null}\n </six-input>\n {this.open && (\n <div\n ref={(el) => (this.popup = el)}\n part=\"popup\"\n class={{\n timepicker__popup: true,\n 'timepicker__popup--is-up': this.placement == null ? this.placement === 'top' : this.isPopupContentUp,\n 'timepicker__popup--is-inline': this.inline,\n }}\n >\n {...this.getContent()}\n {this.getAmPmPicker()}\n </div>\n )}\n </div>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"six-timepicker.js","sourceRoot":"","sources":["../../../src/components/six-timepicker/six-timepicker.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC/G,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,eAAe,GAIhB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,qBAAqB,EAAE,8BAA8B,EAAE,MAAM,+BAA+B,CAAC;AAEhH,OAAO,EAAE,cAAc,E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;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, h, Listen, Method, Prop, State, Watch } from '@stencil/core';\nimport { ItemPickerType } from '../six-item-picker/types';\nimport {\n createTimeString,\n getCurrentTime,\n isValidTimeString,\n parseTimeString,\n Time,\n TimeFormat,\n TimeProperties,\n} from '../../utils/time.util';\nimport { debounce, DEFAULT_DEBOUNCE_FAST, DEFAULT_DEBOUNCE_INSANELY_FAST } from '../../utils/execution-control';\nimport { SixItemPickerChangePayload } from '../six-item-picker/six-item-picker';\nimport { EventListeners } from '../../utils/event-listeners';\nimport { hasSlot } from '../../utils/slot';\nimport { EmptyPayload } from '../../utils/types';\nimport { adjustPopupForHoisting, movePopup } from '../../utils/popup';\n\nexport interface SixTimepickerChange {\n value?: Time;\n valueAsString: string;\n changedProperty?: string;\n}\n\ninterface SixTimeUnitPickerParams {\n min?: number;\n max?: number;\n items?: string[];\n type?: ItemPickerType;\n class?: string;\n paddingLength?: number;\n propertyName: TimeProperties;\n}\n\nconst MIN_POPUP_HEIGHT = 145;\n\n/**\n * @since 2.0.0\n * @status experimental\n *\n * @slot error-text - Error text that is shown for validation errors. Alternatively, you can use the error-text prop.\n *\n * @part input - The input field\n * @part container - The container of whole component\n * @part popup - The popup of the timepicker component\n *\n */\n@Component({\n tag: 'six-timepicker',\n styleUrl: 'six-timepicker.scss',\n shadow: true,\n})\nexport class SixTimepicker {\n private eventListeners = new EventListeners();\n private popup?: HTMLElement;\n private wrapper?: HTMLElement;\n private inputElement?: HTMLSixInputElement;\n\n @Element() host!: HTMLSixTimepickerElement;\n\n /**\n * Define the time format. Valid formats are:\n *\n * HH:mm:ss\n * hh:mm:ss:aa\n * HH:mm:ss:ms\n * hh:mm:ss:ms:aa\n * HH:mm\n * hh:mm:aa\n * HH\n * hh:aa\n * mm\n * ss\n * ms\n *\n * where HH is the 24 hour format\n * and hh is the 12 hour format\n *\n * Please notice that when using the 12-hour-clock (hh)\n * you always need a period indicator (aa). So the time can be parsed as either am or pm\n * */\n @Prop() format: TimeFormat = 'HH:mm:ss';\n\n /**\n * Define the separator to be shown between the time unit pickers.\n * Please be aware that this property will modify the displayed separator only.\n * The separator for a timestring is always expected to be a colon (eg. '13:52:20')\n * */\n @Prop() separator = ':';\n\n /**\n * The value of the timepicker provided as a string. The string mast match the provided format (or default format)\n */\n @Prop({ mutable: true }) value = '';\n\n /** Indicates whether the timepicker dropdown is open on startup. You can use this in lieu of the show/hide methods. */\n @Prop({ mutable: true, reflect: true }) open = false;\n\n /** Indicates whether the timepicker should be shown as an inline (always open) component */\n @Prop({ reflect: true }) inline = false;\n\n /**\n * If `true` the user can only select a time via the timepicker but not directly edit the input field.\n */\n @Prop() readonly = false;\n\n /**\n * If `true` the component is disabled.\n */\n @Prop() disabled = false;\n\n /**\n * The enforced placement of the dropdown panel.\n */\n @Prop() placement?: 'top' | 'bottom';\n\n /** Timepicker size. */\n @Prop() size: 'small' | 'medium' | 'large' = 'medium';\n\n /** Set to true to show an asterisk beneath the label. */\n @Prop() required = false;\n\n /**\n * The placeholder defines what text to be shown on the input element\n */\n @Prop() placeholder?: string;\n\n /** The input's error text. Alternatively, you can use the error-text slot. */\n @Prop() errorText: string | string[] = '';\n\n /** The number of error texts to be shown (if the error-text slot isn't used). Defaults to 1 */\n @Prop() errorTextCount?: number;\n\n /** The input's label. Alternatively, you can use the label slot. */\n @Prop() label = '';\n\n /** If this property is set to true and an error message is provided by `errorText`, the error message is displayed. */\n @Prop({ reflect: true }) invalid = false;\n\n /** The input's name attribute. */\n @Prop({ reflect: true }) name = '';\n\n /** Set to true to add a clear button when the input is populated. */\n @Prop() clearable = false;\n\n /** Set the position of the icon */\n @Prop() iconPosition: 'left' | 'right' = 'left';\n\n /**\n * Enable this option to prevent the panel from being clipped when the component is placed inside a container with\n * `overflow: auto|scroll`.\n */\n @Prop() hoist = false;\n\n /**\n * Set the amount of time, in milliseconds, to wait to trigger faster switching between timeunits (e.g. hours).\n */\n @Prop() timeout = DEFAULT_DEBOUNCE_FAST;\n\n /**\n * Set the amount of time, in milliseconds, to wait between switching to next timeunit (e.g. next hour) when mouse button is held pressed.\n */\n @Prop() interval = DEFAULT_DEBOUNCE_INSANELY_FAST;\n\n /**\n * The defaultTime defines the default setting for the timepicker when you open the popup. Default time must match the provided format.\n */\n @Prop() defaultTime?: string;\n\n /**\n * Set the amount of time, in milliseconds, to wait to trigger the `six-timepicker-change-debounced` event.\n * If you want your change debounce event to not trigger when keeping the nav button pressed before, make sure debounce\n * is a bit bigger than timeout, otherwise keeping the button pressed will trigger the event twice: once you click\n * (and keep pressed) and once you release\n */\n @Prop() debounce = DEFAULT_DEBOUNCE_FAST;\n\n /**\n * Emitted when the timepicker's value changes\n */\n @Event({ eventName: 'six-timepicker-change' }) sixChange!: EventEmitter<SixTimepickerChange>;\n\n /**\n * Emitted when the timepicker's value changes, but debounced\n */\n @Event({ eventName: 'six-timepicker-change-debounced' }) sixChangeDebounced!: EventEmitter<SixTimepickerChange>;\n\n /**\n * Emitted when the clear button is activated.\n */\n @Event({ eventName: 'six-timepicker-clear' }) sixClear!: EventEmitter<EmptyPayload>;\n\n @State() isPopupContentUp = false;\n\n @State() isDropDownContentUp = false;\n\n @Listen('resize', { target: 'window' })\n async resizeHandler() {\n this.calcIsPopupContentUp();\n this.moveOpenHoistedPopup();\n }\n\n @Listen('scroll', { target: 'window' })\n async scrollHandler() {\n this.calcIsPopupContentUp();\n this.moveOpenHoistedPopup();\n }\n\n /**\n * Update the native input element when the value changes\n */\n @Watch('value')\n protected valueChanged() {\n this.updateValue();\n }\n\n /** Sets focus on the datepickers input. */\n @Method()\n async setFocus(options?: FocusOptions) {\n this.inputElement?.setFocus(options);\n }\n\n /*\n * Internally the six-timepicker uses a standardized representation of time, so we don't have a mess,\n * when switching between formats\n */\n @State() private popupValue: Time = {};\n\n connectedCallback() {\n this.eventListeners.forward('six-timepicker-change', 'change', this.host);\n }\n\n componentWillLoad() {\n this.updateValue();\n\n if (this.inline) {\n this.open = true;\n }\n\n if (this.open) {\n this.eventListeners.add(document, 'mousedown', this.handleDocumentMouseDown);\n }\n }\n\n componentDidLoad() {\n if (this.inputElement == null) return;\n const inputElement = this.inputElement;\n\n // emit debounced change event\n this.eventListeners.add(\n this.host,\n 'six-timepicker-change',\n debounce((event: Event) => this.sixChangeDebounced.emit((event as CustomEvent).detail), this.debounce)\n );\n\n // update value and popup value based on input-element value\n this.eventListeners.add(\n inputElement,\n 'six-input-input',\n debounce((event: Event) => {\n event.stopPropagation();\n\n // emit empty event if time string is invalid\n if (!isValidTimeString(inputElement.value, this.format)) {\n this.value = inputElement.value;\n this.sixChange.emit({\n value: {},\n valueAsString: '',\n });\n return;\n } else {\n // update value and popup value and emit the new value\n this.value = inputElement.value;\n this.popupValue = parseTimeString(inputElement.value, this.format);\n this.sixChange.emit({\n value: this.popupValue,\n valueAsString: createTimeString(this.popupValue, this.format),\n });\n }\n }, this.debounce)\n );\n }\n\n componentDidRender() {\n adjustPopupForHoisting(\n this.hoist,\n this.popup,\n this.inputElement,\n this.wrapper,\n MIN_POPUP_HEIGHT,\n (isUp) => (this.isDropDownContentUp = isUp)\n );\n }\n\n disconnectedCallback() {\n this.eventListeners.removeAll();\n }\n private updateValue() {\n // normalize value\n if (typeof this.value !== 'string' || !isValidTimeString(this.value, this.format)) {\n this.value = '';\n } else if (this.inputElement != null) {\n this.inputElement.value = this.value;\n }\n\n // update popup value\n if (this.value === '') {\n if (this.defaultTime == null) {\n this.popupValue = getCurrentTime(this.is24HourClock());\n } else {\n this.popupValue = parseTimeString(this.defaultTime, this.format);\n }\n } else {\n this.popupValue = parseTimeString(this.value, this.format);\n }\n }\n\n private calcIsPopupContentUp() {\n if (this.inputElement == null || this.wrapper == null) {\n return;\n }\n\n const inputBoundingRect = this.inputElement.getBoundingClientRect();\n const wrapperBoundingRect = this.wrapper.getBoundingClientRect();\n const minPopupHeight = Math.max(wrapperBoundingRect.height, MIN_POPUP_HEIGHT);\n\n const moreSpaceInTop = inputBoundingRect.y > window.innerHeight / 2;\n this.isPopupContentUp = moreSpaceInTop && window.innerHeight < inputBoundingRect.bottom + minPopupHeight;\n }\n\n private moveOpenHoistedPopup() {\n movePopup(this.hoist, this.open, this.popup, this.inputElement, this.wrapper, MIN_POPUP_HEIGHT);\n }\n\n private handlePickerChange = (event: CustomEvent<SixItemPickerChangePayload>, property: TimeProperties) => {\n // stop propagation, since the timepicker should not expose the events of the underlying item-picker\n event.stopPropagation();\n if (this.popupValue == null) {\n return;\n }\n\n // update the internal state\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n this.popupValue[property] = event.detail;\n\n const timeString = createTimeString(this.popupValue, this.format);\n\n // update the input value\n this.value = timeString;\n\n // emit change event\n this.sixChange.emit({\n changedProperty: property,\n value: this.popupValue,\n valueAsString: timeString,\n });\n };\n\n private getSixTimeUnitPicker(params: SixTimeUnitPickerParams) {\n return (\n <six-item-picker\n class={params.class}\n timeout={this.timeout}\n interval={this.interval}\n padded\n min={params.min}\n max={params.max}\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n value={this.popupValue[params.propertyName]}\n items={params.items}\n type={params.type || ItemPickerType.NUMBER}\n padding-length={params.paddingLength}\n onSix-item-picker-change={(event) => this.handlePickerChange(event, params.propertyName)}\n ></six-item-picker>\n );\n }\n\n private getHour24Picker() {\n if (!this.is24HourClock()) {\n return;\n }\n return this.getSixTimeUnitPicker({ min: 0, max: 23, propertyName: 'hours' });\n }\n\n private is24HourClock() {\n return this.format.includes('HH');\n }\n\n private getHour12Picker() {\n if (!this.is12HourClock()) {\n return;\n }\n return this.getSixTimeUnitPicker({ min: 0, max: 11, propertyName: 'hours' });\n }\n\n private is12HourClock() {\n return this.format.includes('hh');\n }\n\n private getAmPmPicker() {\n if (!this.is12HourClock()) {\n return;\n }\n const items = ['AM', 'PM'];\n return this.getSixTimeUnitPicker({\n items,\n type: ItemPickerType.CUSTOM,\n propertyName: 'period',\n });\n }\n\n private getMinutePicker() {\n if (!this.format.includes('mm')) {\n return;\n }\n\n return this.getSixTimeUnitPicker({ min: 0, max: 59, propertyName: 'minutes' });\n }\n\n private getSecondsPicker() {\n if (!this.format.includes('ss')) {\n return;\n }\n\n return this.getSixTimeUnitPicker({ min: 0, max: 59, propertyName: 'seconds' });\n }\n\n private getMillisecondsPicker() {\n if (!this.format.includes('ms')) {\n return;\n }\n\n return this.getSixTimeUnitPicker({\n min: 0,\n max: 999,\n class: 'timepicker__item--wide',\n paddingLength: 3,\n propertyName: 'milliseconds',\n });\n }\n\n private getSeparator() {\n return (\n <div class=\"timepicker__separator\">\n <span>{this.separator}</span>\n </div>\n );\n }\n\n private getContent() {\n const elementsInOrder = [\n this.getHour24Picker(),\n this.getHour12Picker(),\n this.getMinutePicker(),\n this.getSecondsPicker(),\n this.getMillisecondsPicker(),\n ];\n\n const visibleElements = elementsInOrder.filter((el) => el !== undefined);\n\n return visibleElements.map((el, idx) => {\n if (idx === visibleElements.length - 1) {\n return [el];\n }\n\n return [el, this.getSeparator()];\n });\n }\n\n private openPopup() {\n if (!this.open && !this.disabled) {\n this.open = true;\n this.eventListeners.add(document, 'mousedown', this.handleDocumentMouseDown);\n }\n }\n\n private closePopup() {\n if (this.inline) {\n return;\n }\n\n this.open = false;\n this.eventListeners.remove(document, 'mousedown', this.handleDocumentMouseDown);\n }\n\n private handleDocumentMouseDown = (event: Event) => {\n // Close when clicking outside the containing element\n const path = event.composedPath() as EventTarget[];\n if (!path.includes(this.host)) {\n this.closePopup();\n return;\n }\n };\n\n private handleClearClick = (event: MouseEvent) => {\n event.stopPropagation();\n if (this.inputElement != null) {\n this.inputElement.value = '';\n }\n this.value = '';\n this.sixClear.emit();\n this.sixChange.emit({\n value: {},\n valueAsString: '',\n });\n };\n\n private renderClearable() {\n return (\n this.clearable && (\n <button\n slot=\"suffix\"\n class={{\n timepicker_clear: true,\n 'timepicker_clear--right': this.iconPosition === 'left',\n 'timepicker_clear--left': this.iconPosition === 'right',\n }}\n type=\"button\"\n onClick={this.handleClearClick}\n tabindex=\"-1\"\n >\n <six-icon size=\"small\">clear</six-icon>\n </button>\n )\n );\n }\n\n private renderCustomIcon() {\n const icon = hasSlot(this.host, 'custom-icon') ? (\n <slot name=\"custom-icon\"></slot>\n ) : (\n <six-icon size={this.size === 'large' ? 'medium' : this.size}>watch_later</six-icon>\n );\n\n return (\n <span\n slot=\"prefix\"\n part=\"icon\"\n class={{\n prefix: true,\n 'prefix--right': this.iconPosition === 'right',\n }}\n >\n {icon}\n </span>\n );\n }\n\n render() {\n return (\n <div part=\"container\" ref={(el) => (this.wrapper = el)} class=\"timepicker__container\">\n <six-input\n ref={(el) => (this.inputElement = el)}\n part=\"input\"\n onClick={() => this.openPopup()}\n placeholder={this.placeholder}\n readonly={this.readonly}\n disabled={this.disabled}\n errorTextCount={this.errorTextCount}\n errorText={this.errorText}\n invalid={this.invalid}\n size={this.size}\n name={this.name}\n label={this.label}\n required={this.required}\n class={{\n 'input--empty': this.value === '',\n 'input--hide': this.inline,\n }}\n >\n {this.renderCustomIcon()}\n {this.renderClearable()}\n {hasSlot(this.host, 'label') ? (\n <span slot=\"label\">\n <slot name=\"label\" />\n </span>\n ) : null}\n {hasSlot(this.host, 'error-text') ? (\n <span slot=\"error-text\">\n <slot name=\"error-text\" />\n </span>\n ) : null}\n </six-input>\n {this.open && (\n <div\n ref={(el) => (this.popup = el)}\n part=\"popup\"\n class={{\n timepicker__popup: true,\n 'timepicker__popup--is-up': this.placement == null ? this.placement === 'top' : this.isPopupContentUp,\n 'timepicker__popup--is-inline': this.inline,\n }}\n >\n {...this.getContent()}\n {this.getAmPmPicker()}\n </div>\n )}\n </div>\n );\n }\n}\n"]}
@@ -166,10 +166,10 @@ export class SixTooltip {
166
166
  });
167
167
  }
168
168
  render() {
169
- return (h(Host, { key: '661956cabaa2503c122217dd7d3fd925b7973fdd', onKeyDown: this.handleKeyDown, onMouseOver: this.handleMouseOver, onMouseOut: this.handleMouseOut }, h("slot", { key: '69ace026483240a339a411be70eadc8aaf2accc8', onSlotchange: this.handleSlotChange }), h("div", { key: '3250d4c0549864f154c83b9c5d1592f764344957', ref: (el) => (this.tooltipPositioner = el), class: "tooltip-positioner" }, h("div", { key: '857856f4c51a1dec2d82486f7df856dce73c2444', part: "base", ref: (el) => (this.tooltip = el), id: this.componentId, class: {
169
+ return (h(Host, { key: '749a6d5edac438b4ff3bd9a34402823156417b37', onKeyDown: this.handleKeyDown, onMouseOver: this.handleMouseOver, onMouseOut: this.handleMouseOut }, h("slot", { key: 'f505a21b6cfa2362537b54a7c2a5d92750a688b5', onSlotchange: this.handleSlotChange }), h("div", { key: '4c38a6ff56ea7b6a121e59fd406728d9af71712e', ref: (el) => (this.tooltipPositioner = el), class: "tooltip-positioner" }, h("div", { key: '1df2f66d1bbae1aeb864d23d91e9094ab950ff79', part: "base", ref: (el) => (this.tooltip = el), id: this.componentId, class: {
170
170
  tooltip: true,
171
171
  'tooltip--open': this.open,
172
- }, role: "tooltip", "aria-hidden": this.open ? 'false' : 'true' }, h("slot", { key: 'e97daa734056c11813bdadc58a374c2978f660c5', name: "content" }, this.content)))));
172
+ }, role: "tooltip", "aria-hidden": this.open ? 'false' : 'true' }, h("slot", { key: 'cc4a2c0d99ae6f16058ac19cef27b7dd66c33bed', name: "content" }, this.content)))));
173
173
  }
174
174
  static get is() { return "six-tooltip"; }
175
175
  static get encapsulation() { return "shadow"; }
@@ -38,6 +38,7 @@ import { SixProgressBar } from './six-progress-bar.js';
38
38
  import { SixProgressRing } from './six-progress-ring.js';
39
39
  import { SixRadio } from './six-radio.js';
40
40
  import { SixRange } from './six-range.js';
41
+ import { SixRating } from './six-rating.js';
41
42
  import { SixRoot } from './six-root.js';
42
43
  import { SixSearchField } from './six-search-field.js';
43
44
  import { SixSelect } from './six-select.js';
@@ -155,6 +156,7 @@ const defineCustomElements = (opts) => {
155
156
  SixProgressRing,
156
157
  SixRadio,
157
158
  SixRange,
159
+ SixRating,
158
160
  SixRoot,
159
161
  SixSearchField,
160
162
  SixSelect,
@@ -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,QAAA,KAAK,SAAS;AACZ,YAAA,OAAO,SAAS;AAClB,QAAA,KAAK,QAAQ;AACX,YAAA,OAAO,QAAQ;;AAErB;AAEA,SAAS,WAAW,CAAC,WAAsB,EAAA;IACzC,QAAQ,WAAW;AACjB,QAAA,KAAK,SAAS;AACZ,YAAA,OAAO,KAAK;AACd,QAAA,KAAK,MAAM;AACT,YAAA,OAAO,KAAK;AACd,QAAA,KAAK,SAAS;AACZ,YAAA,OAAO,KAAK;AACd,QAAA,KAAK,SAAS;AACZ,YAAA,OAAO,KAAK;AACd,QAAA,KAAK,QAAQ;AACX,YAAA,OAAO,KAAK;;AAElB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/utils/alert.ts"],"sourcesContent":["import { AlertType } from '../components/six-alert/six-alert';\n\n/**\n * Displays an alert on the toast stack with a specified message and optional configuration.\n *\n * @param message - The message to be displayed in the alert.\n * @param alertType - The type of the alert. Valid values are 'primary', 'info', 'success', 'warning', 'danger'. Default is 'info'.\n * @param duration - The duration in milliseconds for which the alert is displayed. If not provided, a default duration is set based on the alert type.\n * @param iconName - The name of the icon to be displayed in the alert. If not provided, a default icon is set based on the alert type.\n */\nexport function showAlert(message: string, alertType?: AlertType, duration?: number, iconName?: string): void {\n const type = alertType ?? 'info';\n const icon = iconName ?? getIcon(type);\n const alert = Object.assign(document.createElement('six-alert'), {\n type,\n duration: duration ?? getDuration(type),\n innerHTML: `<six-icon slot=\"icon\">${icon}</six-icon>${escapeHtml(message)}`,\n closable: true,\n });\n document.body.append(alert);\n alert.toast();\n}\n\nfunction escapeHtml(html: string): string {\n const div = document.createElement('div');\n div.textContent = html;\n return div.innerHTML;\n}\n\nfunction getIcon(messageType: AlertType): string {\n switch (messageType) {\n case 'primary':\n return 'info';\n case 'info':\n return 'info';\n case 'success':\n return 'check_circle';\n case 'warning':\n return 'warning';\n case 'danger':\n return 'report';\n }\n}\n\nfunction getDuration(messageType: AlertType): number {\n switch (messageType) {\n case 'primary':\n return 10000;\n case 'info':\n return 10000;\n case 'success':\n return 10000;\n case 'warning':\n return 20000;\n case 'danger':\n return 20000;\n }\n}\n"],"version":3}
1
+ {"file":"index.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA;;;;;;;AAOG;AACG,SAAU,SAAS,CAAC,OAAe,EAAE,SAAqB,EAAE,QAAiB,EAAE,QAAiB,EAAA;IACpG,MAAM,IAAI,GAAG,SAAS,KAAA,IAAA,IAAT,SAAS,KAAT,MAAA,GAAA,SAAS,GAAI,MAAM;AAChC,IAAA,MAAM,IAAI,GAAG,QAAQ,KAAA,IAAA,IAAR,QAAQ,KAAA,MAAA,GAAR,QAAQ,GAAI,OAAO,CAAC,IAAI,CAAC;AACtC,IAAA,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC,WAAW,CAAC,EAAE;QAC/D,IAAI;QACJ,QAAQ,EAAE,QAAQ,KAAA,IAAA,IAAR,QAAQ,KAAA,MAAA,GAAR,QAAQ,GAAI,WAAW,CAAC,IAAI,CAAC;QACvC,SAAS,EAAE,yBAAyB,IAAI,CAAA,WAAA,EAAc,UAAU,CAAC,OAAO,CAAC,CAAE,CAAA;AAC3E,QAAA,QAAQ,EAAE,IAAI;AACf,KAAA,CAAC;AACF,IAAA,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC;IAC3B,KAAK,CAAC,KAAK,EAAE;AACf;AAEA,SAAS,UAAU,CAAC,IAAY,EAAA;IAC9B,MAAM,GAAG,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC;AACzC,IAAA,GAAG,CAAC,WAAW,GAAG,IAAI;IACtB,OAAO,GAAG,CAAC,SAAS;AACtB;AAEA,SAAS,OAAO,CAAC,WAAsB,EAAA;IACrC,QAAQ,WAAW;AACjB,QAAA,KAAK,SAAS;AACZ,YAAA,OAAO,MAAM;AACf,QAAA,KAAK,MAAM;AACT,YAAA,OAAO,MAAM;AACf,QAAA,KAAK,SAAS;AACZ,YAAA,OAAO,cAAc;AACvB,QAAA,KAAK,SAAS;AACZ,YAAA,OAAO,SAAS;AAClB,QAAA,KAAK,QAAQ;AACX,YAAA,OAAO,QAAQ;;AAErB;AAEA,SAAS,WAAW,CAAC,WAAsB,EAAA;IACzC,QAAQ,WAAW;AACjB,QAAA,KAAK,SAAS;AACZ,YAAA,OAAO,KAAK;AACd,QAAA,KAAK,MAAM;AACT,YAAA,OAAO,KAAK;AACd,QAAA,KAAK,SAAS;AACZ,YAAA,OAAO,KAAK;AACd,QAAA,KAAK,SAAS;AACZ,YAAA,OAAO,KAAK;AACd,QAAA,KAAK,QAAQ;AACX,YAAA,OAAO,KAAK;;AAElB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/utils/alert.ts"],"sourcesContent":["import { AlertType } from '../components/six-alert/six-alert';\n\n/**\n * Displays an alert on the toast stack with a specified message and optional configuration.\n *\n * @param message - The message to be displayed in the alert.\n * @param alertType - The type of the alert. Valid values are 'primary', 'info', 'success', 'warning', 'danger'. Default is 'info'.\n * @param duration - The duration in milliseconds for which the alert is displayed. If not provided, a default duration is set based on the alert type.\n * @param iconName - The name of the icon to be displayed in the alert. If not provided, a default icon is set based on the alert type.\n */\nexport function showAlert(message: string, alertType?: AlertType, duration?: number, iconName?: string): void {\n const type = alertType ?? 'info';\n const icon = iconName ?? getIcon(type);\n const alert = Object.assign(document.createElement('six-alert'), {\n type,\n duration: duration ?? getDuration(type),\n innerHTML: `<six-icon slot=\"icon\">${icon}</six-icon>${escapeHtml(message)}`,\n closable: true,\n });\n document.body.append(alert);\n alert.toast();\n}\n\nfunction escapeHtml(html: string): string {\n const div = document.createElement('div');\n div.textContent = html;\n return div.innerHTML;\n}\n\nfunction getIcon(messageType: AlertType): string {\n switch (messageType) {\n case 'primary':\n return 'info';\n case 'info':\n return 'info';\n case 'success':\n return 'check_circle';\n case 'warning':\n return 'warning';\n case 'danger':\n return 'report';\n }\n}\n\nfunction getDuration(messageType: AlertType): number {\n switch (messageType) {\n case 'primary':\n return 10000;\n case 'info':\n return 10000;\n case 'success':\n return 10000;\n case 'warning':\n return 20000;\n case 'danger':\n return 20000;\n }\n}\n"],"version":3}
@@ -320,6 +320,9 @@ const SixTimepicker = /*@__PURE__*/ proxyCustomElement(class SixTimepicker exten
320
320
  };
321
321
  this.handleClearClick = (event) => {
322
322
  event.stopPropagation();
323
+ if (this.inputElement != null) {
324
+ this.inputElement.value = '';
325
+ }
323
326
  this.value = '';
324
327
  this.sixClear.emit();
325
328
  this.sixChange.emit({
@@ -377,13 +380,15 @@ const SixTimepicker = /*@__PURE__*/ proxyCustomElement(class SixTimepicker exten
377
380
  });
378
381
  return;
379
382
  }
380
- // update value and popup value, and emit the new value
381
- this.value = inputElement.value;
382
- this.popupValue = parseTimeString(inputElement.value, this.format);
383
- this.sixChange.emit({
384
- value: this.popupValue,
385
- valueAsString: createTimeString(this.popupValue, this.format),
386
- });
383
+ else {
384
+ // update value and popup value and emit the new value
385
+ this.value = inputElement.value;
386
+ this.popupValue = parseTimeString(inputElement.value, this.format);
387
+ this.sixChange.emit({
388
+ value: this.popupValue,
389
+ valueAsString: createTimeString(this.popupValue, this.format),
390
+ });
391
+ }
387
392
  }, this.debounce));
388
393
  }
389
394
  componentDidRender() {
@@ -397,6 +402,9 @@ const SixTimepicker = /*@__PURE__*/ proxyCustomElement(class SixTimepicker exten
397
402
  if (typeof this.value !== 'string' || !isValidTimeString(this.value, this.format)) {
398
403
  this.value = '';
399
404
  }
405
+ else if (this.inputElement != null) {
406
+ this.inputElement.value = this.value;
407
+ }
400
408
  // update popup value
401
409
  if (this.value === '') {
402
410
  if (this.defaultTime == null) {
@@ -529,10 +537,10 @@ const SixTimepicker = /*@__PURE__*/ proxyCustomElement(class SixTimepicker exten
529
537
  } }, icon));
530
538
  }
531
539
  render() {
532
- return (h("div", { key: '58240c7c32227225d1811fa59e9cf336aad03a4d', part: "container", ref: (el) => (this.wrapper = el), class: "timepicker__container" }, h("six-input", { key: '1b6e9b28d997b67a933d055fa3e73e3c0751aa53', ref: (el) => (this.inputElement = el), part: "input", onClick: () => this.openPopup(), value: this.value, placeholder: this.placeholder, readonly: this.readonly, disabled: this.disabled, errorTextCount: this.errorTextCount, errorText: this.errorText, invalid: this.invalid, size: this.size, name: this.name, label: this.label, required: this.required, class: {
540
+ return (h("div", { key: 'a3496612a52df399ccd8cb88e2f3564432758b74', part: "container", ref: (el) => (this.wrapper = el), class: "timepicker__container" }, h("six-input", { key: 'ca426a5b063102ea92550ed6779a46c56a663a22', ref: (el) => (this.inputElement = el), part: "input", onClick: () => this.openPopup(), placeholder: this.placeholder, readonly: this.readonly, disabled: this.disabled, errorTextCount: this.errorTextCount, errorText: this.errorText, invalid: this.invalid, size: this.size, name: this.name, label: this.label, required: this.required, class: {
533
541
  'input--empty': this.value === '',
534
542
  'input--hide': this.inline,
535
- } }, this.renderCustomIcon(), this.renderClearable(), hasSlot(this.host, 'label') ? (h("span", { slot: "label" }, h("slot", { name: "label" }))) : null, hasSlot(this.host, 'error-text') ? (h("span", { slot: "error-text" }, h("slot", { name: "error-text" }))) : null), this.open && (h("div", { key: 'b762116d0af1bc11d7f2cbb255b071e8fe3b52cf', ref: (el) => (this.popup = el), part: "popup", class: {
543
+ } }, this.renderCustomIcon(), this.renderClearable(), hasSlot(this.host, 'label') ? (h("span", { slot: "label" }, h("slot", { name: "label" }))) : null, hasSlot(this.host, 'error-text') ? (h("span", { slot: "error-text" }, h("slot", { name: "error-text" }))) : null), this.open && (h("div", { key: '8c03ea793c9452af88fe41699ec58b526057d834', ref: (el) => (this.popup = el), part: "popup", class: {
536
544
  timepicker__popup: true,
537
545
  'timepicker__popup--is-up': this.placement == null ? this.placement === 'top' : this.isPopupContentUp,
538
546
  'timepicker__popup--is-inline': this.inline,
@@ -609,6 +617,6 @@ function defineCustomElement() {
609
617
  }
610
618
 
611
619
  export { SixTimepicker as S, adjustPopupForHoisting as a, adjustPopupForSmallScreens as b, calcIsDropDownContentUp as c, defineCustomElement as d, movePopup as m };
612
- //# sourceMappingURL=p-DnLdSdN5.js.map
620
+ //# sourceMappingURL=p-CAJFkiLw.js.map
613
621
 
614
- //# sourceMappingURL=p-DnLdSdN5.js.map
622
+ //# sourceMappingURL=p-CAJFkiLw.js.map
@@ -0,0 +1 @@
1
+ {"file":"p-CAJFkiLw.js","mappings":";;;;;;;;;AAAA;;;AAGG;AACa,SAAA,sBAAsB,CACpC,KAAc,EACd,KAA8B,EAC9B,YAAqC,EACrC,OAAgC,EAChC,cAAsB,EACtB,wBAAiD,EAAA;AAEjD,IAAA,IAAI,CAAC,KAAK,IAAI,KAAK,IAAI,IAAI,IAAI,YAAY,IAAI,IAAI,IAAI,OAAO,IAAI,IAAI,EAAE;QACtE;;;AAGF,IAAA,MAAM,eAAe,GAAG,qBAAqB,CAAC,KAAK,CAAC;AACpD,IAAA,MAAM,eAAe,GAAG,YAAY,CAAC,qBAAqB,EAAE;AAC5D,IAAA,MAAM,QAAQ,GAAG,eAAe,CAAC,GAAG;AACpC,IAAA,MAAM,QAAQ,GAAG,eAAe,CAAC,GAAG;IAEpC,MAAM,IAAI,GAAG,uBAAuB,CAAC,YAAY,EAAE,OAAO,EAAE,cAAc,CAAC;;AAE3E,IAAA,IAAI,IAAI,IAAI,QAAQ,GAAG,QAAQ,EAAE;;AAE/B,QAAA,KAAK,CAAC,KAAK,CAAC,GAAG,GAAG,GAAG,QAAQ,GAAG,eAAe,CAAC,MAAM,GAAG,eAAe,CAAC,MAAM,IAAI;;IAErF,wBAAwB,CAAC,IAAI,CAAC;AAChC;AAEA;;;;AAIG;AACG,SAAU,0BAA0B,CAAC,KAAmB,EAAA;;IAE5D,UAAU,CAAC,MAAK;AACd,QAAA,IAAI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CAAC,EAAE,MAAM,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC,EAC9B,IAAI,EAAC,OAAO,EACZ,KAAK,EAAE;AACL,gBAAA,iBAAiB,EAAE,IAAI;AACvB,gBAAA,0BAA0B,EAAE,IAAI,CAAC,SAAS,IAAI,IAAI,GAAG,IAAI,CAAC,SAAS,KAAK,KAAK,GAAG,IAAI,CAAC,gBAAgB;gBACrG,8BAA8B,EAAE,IAAI,CAAC,MAAM;AAC5C,aAAA,EAAA,KAEG,IAAI,CAAC,UAAU,EAAE,EACpB,IAAI,CAAC,aAAa,EAAE,CACjB,CACP,CACG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/utils/popup.ts","src/utils/time.util.ts","src/components/six-timepicker/six-timepicker.scss?tag=six-timepicker&encapsulation=shadow","src/components/six-timepicker/six-timepicker.tsx"],"sourcesContent":["/**\n * If the popup is hoisted we popup is hoisted its position will change to fix to not be clipped of by a containing container.\n * To render the popup correctly we render it normally, and then assign this screenposition to the fixed popup\n */\nexport function adjustPopupForHoisting(\n hoist: boolean,\n popup: HTMLElement | undefined,\n inputElement: HTMLElement | undefined,\n wrapper: HTMLElement | undefined,\n minPopupHeight: number,\n dropdownDirectionChanged: (isUp: boolean) => void\n) {\n if (!hoist || popup == null || inputElement == null || wrapper == null) {\n return;\n }\n // take a snapshot of normally rendered popup\n const popupDimensions = setPopupAsFixPosition(popup);\n const inputDimensions = inputElement.getBoundingClientRect();\n const inputTop = inputDimensions.top;\n const popupTop = popupDimensions.top;\n\n const isUp = calcIsDropDownContentUp(inputElement, wrapper, minPopupHeight);\n // check screen position to check whether the popup should be moved above or below the trigger element\n if (isUp && inputTop < popupTop) {\n // move popup above input field if datepicker is at bottom of screen\n popup.style.top = `${popupTop - popupDimensions.height - inputDimensions.height}px`;\n }\n dropdownDirectionChanged(isUp);\n}\n\n/*\n * For small screens the datepicker popup could be cut-off even though there might still be space within the viewport.\n * This is because the popup is always aligned with the trigger input field. However in the scenario of small screens\n * we should reposition the popup to use the space available.\n */\nexport function adjustPopupForSmallScreens(popup?: HTMLElement) {\n // execute after dropdown has been rendered to make sure the popup reference is correctly set\n setTimeout(() => {\n if (popup == null) {\n return;\n }\n const popupDimensions = popup.getBoundingClientRect();\n if (\n popupDimensions.y < 0 &&\n window.innerHeight - popupDimensions.height > 0 &&\n Math.abs(popupDimensions.y) <= popupDimensions.height\n ) {\n // handle case where popup is cut-off on top but there is still space available\n setPopupAsFixPosition(popup);\n popup.style.top = '0px';\n } else if (\n window.innerHeight < popupDimensions.y + popupDimensions.height &&\n window.innerHeight > popupDimensions.height &&\n Math.abs(popupDimensions.y - window.innerHeight) <= popupDimensions.height\n ) {\n // handle case where popup is cut-off at the bottom but there is still space available above\n // apply screen position to fixed popup\n setPopupAsFixPosition(popup);\n popup.style.top = `${window.innerHeight - popupDimensions.height}px`;\n }\n\n if (\n window.innerWidth < popupDimensions.x + popupDimensions.width &&\n window.innerWidth > popupDimensions.width &&\n Math.abs(popupDimensions.x - window.innerWidth) <= popupDimensions.width\n ) {\n // handle case where popup is cut-off to the right\n setPopupAsFixPosition(popup);\n popup.style.left = `${window.innerWidth - popupDimensions.width}px`;\n }\n }, 0);\n}\n\nexport function calcIsDropDownContentUp(\n inputElement: HTMLElement,\n wrapper: HTMLElement,\n minPopupHeight: number\n): boolean {\n const inputBoundingRect = inputElement.getBoundingClientRect();\n const wrapperBoundingRect = wrapper.getBoundingClientRect();\n const popupHeight = Math.max(wrapperBoundingRect.height, minPopupHeight);\n const moreSpaceInTop = inputBoundingRect.y > window.innerHeight / 2;\n return moreSpaceInTop && window.innerHeight < inputBoundingRect.bottom + popupHeight;\n}\n\nexport function setPopupAsFixPosition(popup: HTMLElement): DOMRect {\n const popupDimensions = popup.getBoundingClientRect();\n popup.style.position = 'fixed';\n popup.style.top = popupDimensions['top'] + 'px';\n popup.style.left = popupDimensions['left'] + 'px';\n popup.style.width = popupDimensions['width'] + 'px';\n popup.style.minHeight = 'fit-content';\n return popupDimensions;\n}\n\n/*\n * The position of the hoisted datepicker needs to be correctly calculated since the position changes to fixed.\n * Thus if the user scrolls or adjusts the screen size we need to recalculate the datepicker position.\n */\nexport function movePopup(\n hoist: boolean,\n open: boolean,\n popup: HTMLElement | undefined,\n inputElement: HTMLElement | undefined,\n wrapper: HTMLElement | undefined,\n minPopupHeight: number\n) {\n if (!hoist || !open || popup == null || inputElement == null || wrapper == null) {\n return;\n }\n const popupBoundingClientRect = popup.getBoundingClientRect();\n const popupHeight = popupBoundingClientRect.height;\n const inputBoundingClientRect = inputElement.getBoundingClientRect();\n const inputTop = inputBoundingClientRect.top;\n const inputHeight = inputBoundingClientRect.height;\n\n const isUp = calcIsDropDownContentUp(inputElement, wrapper, minPopupHeight);\n\n if (isUp) {\n popup.style.top = `${inputTop - popupHeight}px`;\n } else {\n popup.style.top = `${inputTop + inputHeight}px`;\n }\n}\n","export type TimePeriod = 'AM' | 'PM';\n\nexport interface Time {\n hours?: number;\n minutes?: number;\n seconds?: number;\n milliseconds?: number;\n has24Hours?: boolean; // true => 24h, false => 12h\n period?: TimePeriod; // only needed for 12-hour clock\n}\n\nexport type TimeProperties = keyof Time;\n\nexport type TimeFormatChar =\n | 'HH' // 24h\n | 'hh' // 12h\n | 'mm' // minutes\n | 'ss' // seconds\n | 'ms' // milliseconds\n | 'aa'; // period (AM/PM)\n\n/*\n * Supported time formats\n */\nexport type TimeFormat =\n | 'HH:mm:ss'\n | 'hh:mm:ss:aa'\n | 'HH:mm:ss:ms'\n | 'hh:mm:ss:ms:aa'\n | 'HH:mm'\n | 'hh:mm:aa'\n | 'HH'\n | 'hh:aa'\n | 'mm'\n | 'ss'\n | 'ms';\n\nexport const getCurrentTimeIn24Hours = (): Time => {\n const now = new Date();\n return {\n hours: now.getHours(),\n minutes: now.getMinutes(),\n seconds: now.getSeconds(),\n milliseconds: now.getMilliseconds(),\n has24Hours: true,\n };\n};\n\nconst HOURS_IN_12_HOUR_CLOCK_FORMAT = 12;\n\nexport const getHoursIn12HourFormat = (hours: number) =>\n hours > HOURS_IN_12_HOUR_CLOCK_FORMAT ? hours - HOURS_IN_12_HOUR_CLOCK_FORMAT : hours;\n\nexport const getCurrentTimeIn12Hours = (): Time => {\n const now = new Date();\n const hours = now.getHours();\n return {\n hours: getHoursIn12HourFormat(hours),\n minutes: now.getMinutes(),\n seconds: now.getSeconds(),\n milliseconds: now.getMilliseconds(),\n has24Hours: false,\n period: hours >= HOURS_IN_12_HOUR_CLOCK_FORMAT ? 'PM' : 'AM',\n };\n};\n\nexport const getCurrentTime = (has24Hours = true): Time => {\n return has24Hours ? getCurrentTimeIn24Hours() : getCurrentTimeIn12Hours();\n};\n\nexport const isValidTimeString = (timeStr: string, format: TimeFormat) => {\n const timeStringParts = timeStr.split(':');\n const timeFormatParts = format.split(':');\n return timeStringParts.length === timeFormatParts.length;\n};\n\nexport const parseTimeString = (timeStr: string, format: TimeFormat): Time => {\n const timeParts = timeStr.split(':');\n const formatParts = format.split(':') as TimeFormatChar[];\n\n if (!isValidTimeString(timeStr, format)) {\n console.error(\n `Timestring did not match expected format.\\nExpected format: ${format}\\nReceived timestring: ${timeStr}`\n );\n }\n\n const time: Time = {};\n\n timeParts.forEach((timeStringPart, i) => {\n const formatStringPart: TimeFormatChar = formatParts[i];\n switch (formatStringPart) {\n case 'HH':\n time.hours = Number(timeStringPart);\n time.has24Hours = true;\n break;\n case 'hh':\n time.hours = Number(timeStringPart);\n time.has24Hours = false;\n break;\n case 'mm':\n time.minutes = Number(timeStringPart);\n break;\n case 'ss':\n time.seconds = Number(timeStringPart);\n break;\n case 'ms':\n time.milliseconds = Number(timeStringPart);\n break;\n case 'aa':\n time.period = timeStringPart.toUpperCase() === 'PM' ? 'PM' : 'AM';\n }\n });\n return time;\n};\n\nexport const createTimeString = (time: Time | undefined, format: TimeFormat): string => {\n if (time == null) {\n return '';\n }\n\n const formatParts = format.split(':') as TimeFormatChar[];\n\n return formatParts\n .map((timeFormatPart) => {\n switch (timeFormatPart) {\n case 'HH':\n case 'hh':\n return String(time.hours).padStart(2, '0');\n case 'mm':\n return String(time.minutes).padStart(2, '0');\n case 'ss':\n return String(time.seconds).padStart(2, '0');\n case 'ms':\n return String(time.milliseconds).padStart(3, '0');\n case 'aa':\n return String(time.period);\n }\n })\n .join(':');\n};\n","@import 'src/global/component';\n\n:host {\n display: block;\n font-family: var(--six-font-family);\n}\n\n.timepicker {\n &_clear {\n display: inline-flex;\n align-items: center;\n font-size: inherit;\n color: var(--six-input-icon-color);\n border: none;\n background: none;\n padding: 0;\n transition: var(--six-transition-fast) color;\n cursor: pointer;\n\n &:hover {\n color: var(--six-input-icon-color-hover);\n }\n\n &:focus {\n outline: none;\n }\n\n &--right {\n right: 0;\n position: absolute;\n }\n\n &--left {\n right: 35px;\n position: absolute;\n }\n }\n\n &__container {\n position: relative;\n }\n\n &__popup {\n display: flex;\n justify-content: center;\n min-width: min-content;\n background-color: white;\n padding: 0.5em;\n box-shadow:\n 0 2px 4px -1px rgb(0 0 0 / 20%),\n 0 4px 5px 0 rgb(0 0 0 / 14%),\n 0 1px 10px 0 rgb(0 0 0 / 12%);\n user-select: none;\n position: absolute;\n z-index: var(--six-z-index-dropdown);\n right: 0;\n left: 0;\n\n &--is-up {\n bottom: 100%;\n }\n\n &--is-inline {\n position: initial;\n box-shadow: none;\n border: 1px solid var(--six-color-web-rock-400);\n }\n }\n\n &__separator {\n display: flex;\n align-items: center;\n }\n\n &__item {\n &--wide {\n padding-left: 0.5rem;\n padding-right: 0.5rem;\n }\n }\n}\n\n.input--empty .timepicker_clear {\n visibility: hidden;\n}\n\n.input--hide {\n display: none;\n}\n\n// Icon position\n.prefix {\n cursor: pointer;\n\n &--right {\n right: 0;\n display: inline-flex;\n position: absolute;\n font-size: inherit;\n color: var(--six-input-icon-color);\n border: none;\n background: none;\n margin-right: var(--six-input-spacing-medium);\n transition: var(--six-transition-fast) color;\n }\n}\n","import { Component, Element, Event, EventEmitter, h, Listen, Method, Prop, State, Watch } from '@stencil/core';\nimport { ItemPickerType } from '../six-item-picker/types';\nimport {\n createTimeString,\n getCurrentTime,\n isValidTimeString,\n parseTimeString,\n Time,\n TimeFormat,\n TimeProperties,\n} from '../../utils/time.util';\nimport { debounce, DEFAULT_DEBOUNCE_FAST, DEFAULT_DEBOUNCE_INSANELY_FAST } from '../../utils/execution-control';\nimport { SixItemPickerChangePayload } from '../six-item-picker/six-item-picker';\nimport { EventListeners } from '../../utils/event-listeners';\nimport { hasSlot } from '../../utils/slot';\nimport { EmptyPayload } from '../../utils/types';\nimport { adjustPopupForHoisting, movePopup } from '../../utils/popup';\n\nexport interface SixTimepickerChange {\n value?: Time;\n valueAsString: string;\n changedProperty?: string;\n}\n\ninterface SixTimeUnitPickerParams {\n min?: number;\n max?: number;\n items?: string[];\n type?: ItemPickerType;\n class?: string;\n paddingLength?: number;\n propertyName: TimeProperties;\n}\n\nconst MIN_POPUP_HEIGHT = 145;\n\n/**\n * @since 2.0.0\n * @status experimental\n *\n * @slot error-text - Error text that is shown for validation errors. Alternatively, you can use the error-text prop.\n *\n * @part input - The input field\n * @part container - The container of whole component\n * @part popup - The popup of the timepicker component\n *\n */\n@Component({\n tag: 'six-timepicker',\n styleUrl: 'six-timepicker.scss',\n shadow: true,\n})\nexport class SixTimepicker {\n private eventListeners = new EventListeners();\n private popup?: HTMLElement;\n private wrapper?: HTMLElement;\n private inputElement?: HTMLSixInputElement;\n\n @Element() host!: HTMLSixTimepickerElement;\n\n /**\n * Define the time format. Valid formats are:\n *\n * HH:mm:ss\n * hh:mm:ss:aa\n * HH:mm:ss:ms\n * hh:mm:ss:ms:aa\n * HH:mm\n * hh:mm:aa\n * HH\n * hh:aa\n * mm\n * ss\n * ms\n *\n * where HH is the 24 hour format\n * and hh is the 12 hour format\n *\n * Please notice that when using the 12-hour-clock (hh)\n * you always need a period indicator (aa). So the time can be parsed as either am or pm\n * */\n @Prop() format: TimeFormat = 'HH:mm:ss';\n\n /**\n * Define the separator to be shown between the time unit pickers.\n * Please be aware that this property will modify the displayed separator only.\n * The separator for a timestring is always expected to be a colon (eg. '13:52:20')\n * */\n @Prop() separator = ':';\n\n /**\n * The value of the timepicker provided as a string. The string mast match the provided format (or default format)\n */\n @Prop({ mutable: true }) value = '';\n\n /** Indicates whether the timepicker dropdown is open on startup. You can use this in lieu of the show/hide methods. */\n @Prop({ mutable: true, reflect: true }) open = false;\n\n /** Indicates whether the timepicker should be shown as an inline (always open) component */\n @Prop({ reflect: true }) inline = false;\n\n /**\n * If `true` the user can only select a time via the timepicker but not directly edit the input field.\n */\n @Prop() readonly = false;\n\n /**\n * If `true` the component is disabled.\n */\n @Prop() disabled = false;\n\n /**\n * The enforced placement of the dropdown panel.\n */\n @Prop() placement?: 'top' | 'bottom';\n\n /** Timepicker size. */\n @Prop() size: 'small' | 'medium' | 'large' = 'medium';\n\n /** Set to true to show an asterisk beneath the label. */\n @Prop() required = false;\n\n /**\n * The placeholder defines what text to be shown on the input element\n */\n @Prop() placeholder?: string;\n\n /** The input's error text. Alternatively, you can use the error-text slot. */\n @Prop() errorText: string | string[] = '';\n\n /** The number of error texts to be shown (if the error-text slot isn't used). Defaults to 1 */\n @Prop() errorTextCount?: number;\n\n /** The input's label. Alternatively, you can use the label slot. */\n @Prop() label = '';\n\n /** If this property is set to true and an error message is provided by `errorText`, the error message is displayed. */\n @Prop({ reflect: true }) invalid = false;\n\n /** The input's name attribute. */\n @Prop({ reflect: true }) name = '';\n\n /** Set to true to add a clear button when the input is populated. */\n @Prop() clearable = false;\n\n /** Set the position of the icon */\n @Prop() iconPosition: 'left' | 'right' = 'left';\n\n /**\n * Enable this option to prevent the panel from being clipped when the component is placed inside a container with\n * `overflow: auto|scroll`.\n */\n @Prop() hoist = false;\n\n /**\n * Set the amount of time, in milliseconds, to wait to trigger faster switching between timeunits (e.g. hours).\n */\n @Prop() timeout = DEFAULT_DEBOUNCE_FAST;\n\n /**\n * Set the amount of time, in milliseconds, to wait between switching to next timeunit (e.g. next hour) when mouse button is held pressed.\n */\n @Prop() interval = DEFAULT_DEBOUNCE_INSANELY_FAST;\n\n /**\n * The defaultTime defines the default setting for the timepicker when you open the popup. Default time must match the provided format.\n */\n @Prop() defaultTime?: string;\n\n /**\n * Set the amount of time, in milliseconds, to wait to trigger the `six-timepicker-change-debounced` event.\n * If you want your change debounce event to not trigger when keeping the nav button pressed before, make sure debounce\n * is a bit bigger than timeout, otherwise keeping the button pressed will trigger the event twice: once you click\n * (and keep pressed) and once you release\n */\n @Prop() debounce = DEFAULT_DEBOUNCE_FAST;\n\n /**\n * Emitted when the timepicker's value changes\n */\n @Event({ eventName: 'six-timepicker-change' }) sixChange!: EventEmitter<SixTimepickerChange>;\n\n /**\n * Emitted when the timepicker's value changes, but debounced\n */\n @Event({ eventName: 'six-timepicker-change-debounced' }) sixChangeDebounced!: EventEmitter<SixTimepickerChange>;\n\n /**\n * Emitted when the clear button is activated.\n */\n @Event({ eventName: 'six-timepicker-clear' }) sixClear!: EventEmitter<EmptyPayload>;\n\n @State() isPopupContentUp = false;\n\n @State() isDropDownContentUp = false;\n\n @Listen('resize', { target: 'window' })\n async resizeHandler() {\n this.calcIsPopupContentUp();\n this.moveOpenHoistedPopup();\n }\n\n @Listen('scroll', { target: 'window' })\n async scrollHandler() {\n this.calcIsPopupContentUp();\n this.moveOpenHoistedPopup();\n }\n\n /**\n * Update the native input element when the value changes\n */\n @Watch('value')\n protected valueChanged() {\n this.updateValue();\n }\n\n /** Sets focus on the datepickers input. */\n @Method()\n async setFocus(options?: FocusOptions) {\n this.inputElement?.setFocus(options);\n }\n\n /*\n * Internally the six-timepicker uses a standardized representation of time, so we don't have a mess,\n * when switching between formats\n */\n @State() private popupValue: Time = {};\n\n connectedCallback() {\n this.eventListeners.forward('six-timepicker-change', 'change', this.host);\n }\n\n componentWillLoad() {\n this.updateValue();\n\n if (this.inline) {\n this.open = true;\n }\n\n if (this.open) {\n this.eventListeners.add(document, 'mousedown', this.handleDocumentMouseDown);\n }\n }\n\n componentDidLoad() {\n if (this.inputElement == null) return;\n const inputElement = this.inputElement;\n\n // emit debounced change event\n this.eventListeners.add(\n this.host,\n 'six-timepicker-change',\n debounce((event: Event) => this.sixChangeDebounced.emit((event as CustomEvent).detail), this.debounce)\n );\n\n // update value and popup value based on input-element value\n this.eventListeners.add(\n inputElement,\n 'six-input-input',\n debounce((event: Event) => {\n event.stopPropagation();\n\n // emit empty event if time string is invalid\n if (!isValidTimeString(inputElement.value, this.format)) {\n this.value = inputElement.value;\n this.sixChange.emit({\n value: {},\n valueAsString: '',\n });\n return;\n } else {\n // update value and popup value and emit the new value\n this.value = inputElement.value;\n this.popupValue = parseTimeString(inputElement.value, this.format);\n this.sixChange.emit({\n value: this.popupValue,\n valueAsString: createTimeString(this.popupValue, this.format),\n });\n }\n }, this.debounce)\n );\n }\n\n componentDidRender() {\n adjustPopupForHoisting(\n this.hoist,\n this.popup,\n this.inputElement,\n this.wrapper,\n MIN_POPUP_HEIGHT,\n (isUp) => (this.isDropDownContentUp = isUp)\n );\n }\n\n disconnectedCallback() {\n this.eventListeners.removeAll();\n }\n private updateValue() {\n // normalize value\n if (typeof this.value !== 'string' || !isValidTimeString(this.value, this.format)) {\n this.value = '';\n } else if (this.inputElement != null) {\n this.inputElement.value = this.value;\n }\n\n // update popup value\n if (this.value === '') {\n if (this.defaultTime == null) {\n this.popupValue = getCurrentTime(this.is24HourClock());\n } else {\n this.popupValue = parseTimeString(this.defaultTime, this.format);\n }\n } else {\n this.popupValue = parseTimeString(this.value, this.format);\n }\n }\n\n private calcIsPopupContentUp() {\n if (this.inputElement == null || this.wrapper == null) {\n return;\n }\n\n const inputBoundingRect = this.inputElement.getBoundingClientRect();\n const wrapperBoundingRect = this.wrapper.getBoundingClientRect();\n const minPopupHeight = Math.max(wrapperBoundingRect.height, MIN_POPUP_HEIGHT);\n\n const moreSpaceInTop = inputBoundingRect.y > window.innerHeight / 2;\n this.isPopupContentUp = moreSpaceInTop && window.innerHeight < inputBoundingRect.bottom + minPopupHeight;\n }\n\n private moveOpenHoistedPopup() {\n movePopup(this.hoist, this.open, this.popup, this.inputElement, this.wrapper, MIN_POPUP_HEIGHT);\n }\n\n private handlePickerChange = (event: CustomEvent<SixItemPickerChangePayload>, property: TimeProperties) => {\n // stop propagation, since the timepicker should not expose the events of the underlying item-picker\n event.stopPropagation();\n if (this.popupValue == null) {\n return;\n }\n\n // update the internal state\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n this.popupValue[property] = event.detail;\n\n const timeString = createTimeString(this.popupValue, this.format);\n\n // update the input value\n this.value = timeString;\n\n // emit change event\n this.sixChange.emit({\n changedProperty: property,\n value: this.popupValue,\n valueAsString: timeString,\n });\n };\n\n private getSixTimeUnitPicker(params: SixTimeUnitPickerParams) {\n return (\n <six-item-picker\n class={params.class}\n timeout={this.timeout}\n interval={this.interval}\n padded\n min={params.min}\n max={params.max}\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n value={this.popupValue[params.propertyName]}\n items={params.items}\n type={params.type || ItemPickerType.NUMBER}\n padding-length={params.paddingLength}\n onSix-item-picker-change={(event) => this.handlePickerChange(event, params.propertyName)}\n ></six-item-picker>\n );\n }\n\n private getHour24Picker() {\n if (!this.is24HourClock()) {\n return;\n }\n return this.getSixTimeUnitPicker({ min: 0, max: 23, propertyName: 'hours' });\n }\n\n private is24HourClock() {\n return this.format.includes('HH');\n }\n\n private getHour12Picker() {\n if (!this.is12HourClock()) {\n return;\n }\n return this.getSixTimeUnitPicker({ min: 0, max: 11, propertyName: 'hours' });\n }\n\n private is12HourClock() {\n return this.format.includes('hh');\n }\n\n private getAmPmPicker() {\n if (!this.is12HourClock()) {\n return;\n }\n const items = ['AM', 'PM'];\n return this.getSixTimeUnitPicker({\n items,\n type: ItemPickerType.CUSTOM,\n propertyName: 'period',\n });\n }\n\n private getMinutePicker() {\n if (!this.format.includes('mm')) {\n return;\n }\n\n return this.getSixTimeUnitPicker({ min: 0, max: 59, propertyName: 'minutes' });\n }\n\n private getSecondsPicker() {\n if (!this.format.includes('ss')) {\n return;\n }\n\n return this.getSixTimeUnitPicker({ min: 0, max: 59, propertyName: 'seconds' });\n }\n\n private getMillisecondsPicker() {\n if (!this.format.includes('ms')) {\n return;\n }\n\n return this.getSixTimeUnitPicker({\n min: 0,\n max: 999,\n class: 'timepicker__item--wide',\n paddingLength: 3,\n propertyName: 'milliseconds',\n });\n }\n\n private getSeparator() {\n return (\n <div class=\"timepicker__separator\">\n <span>{this.separator}</span>\n </div>\n );\n }\n\n private getContent() {\n const elementsInOrder = [\n this.getHour24Picker(),\n this.getHour12Picker(),\n this.getMinutePicker(),\n this.getSecondsPicker(),\n this.getMillisecondsPicker(),\n ];\n\n const visibleElements = elementsInOrder.filter((el) => el !== undefined);\n\n return visibleElements.map((el, idx) => {\n if (idx === visibleElements.length - 1) {\n return [el];\n }\n\n return [el, this.getSeparator()];\n });\n }\n\n private openPopup() {\n if (!this.open && !this.disabled) {\n this.open = true;\n this.eventListeners.add(document, 'mousedown', this.handleDocumentMouseDown);\n }\n }\n\n private closePopup() {\n if (this.inline) {\n return;\n }\n\n this.open = false;\n this.eventListeners.remove(document, 'mousedown', this.handleDocumentMouseDown);\n }\n\n private handleDocumentMouseDown = (event: Event) => {\n // Close when clicking outside the containing element\n const path = event.composedPath() as EventTarget[];\n if (!path.includes(this.host)) {\n this.closePopup();\n return;\n }\n };\n\n private handleClearClick = (event: MouseEvent) => {\n event.stopPropagation();\n if (this.inputElement != null) {\n this.inputElement.value = '';\n }\n this.value = '';\n this.sixClear.emit();\n this.sixChange.emit({\n value: {},\n valueAsString: '',\n });\n };\n\n private renderClearable() {\n return (\n this.clearable && (\n <button\n slot=\"suffix\"\n class={{\n timepicker_clear: true,\n 'timepicker_clear--right': this.iconPosition === 'left',\n 'timepicker_clear--left': this.iconPosition === 'right',\n }}\n type=\"button\"\n onClick={this.handleClearClick}\n tabindex=\"-1\"\n >\n <six-icon size=\"small\">clear</six-icon>\n </button>\n )\n );\n }\n\n private renderCustomIcon() {\n const icon = hasSlot(this.host, 'custom-icon') ? (\n <slot name=\"custom-icon\"></slot>\n ) : (\n <six-icon size={this.size === 'large' ? 'medium' : this.size}>watch_later</six-icon>\n );\n\n return (\n <span\n slot=\"prefix\"\n part=\"icon\"\n class={{\n prefix: true,\n 'prefix--right': this.iconPosition === 'right',\n }}\n >\n {icon}\n </span>\n );\n }\n\n render() {\n return (\n <div part=\"container\" ref={(el) => (this.wrapper = el)} class=\"timepicker__container\">\n <six-input\n ref={(el) => (this.inputElement = el)}\n part=\"input\"\n onClick={() => this.openPopup()}\n placeholder={this.placeholder}\n readonly={this.readonly}\n disabled={this.disabled}\n errorTextCount={this.errorTextCount}\n errorText={this.errorText}\n invalid={this.invalid}\n size={this.size}\n name={this.name}\n label={this.label}\n required={this.required}\n class={{\n 'input--empty': this.value === '',\n 'input--hide': this.inline,\n }}\n >\n {this.renderCustomIcon()}\n {this.renderClearable()}\n {hasSlot(this.host, 'label') ? (\n <span slot=\"label\">\n <slot name=\"label\" />\n </span>\n ) : null}\n {hasSlot(this.host, 'error-text') ? (\n <span slot=\"error-text\">\n <slot name=\"error-text\" />\n </span>\n ) : null}\n </six-input>\n {this.open && (\n <div\n ref={(el) => (this.popup = el)}\n part=\"popup\"\n class={{\n timepicker__popup: true,\n 'timepicker__popup--is-up': this.placement == null ? this.placement === 'top' : this.isPopupContentUp,\n 'timepicker__popup--is-inline': this.inline,\n }}\n >\n {...this.getContent()}\n {this.getAmPmPicker()}\n </div>\n )}\n </div>\n );\n }\n}\n"],"version":3}
@@ -165,10 +165,10 @@ const SixTooltip = /*@__PURE__*/ proxyCustomElement(class SixTooltip extends H {
165
165
  });
166
166
  }
167
167
  render() {
168
- return (h(Host, { key: '661956cabaa2503c122217dd7d3fd925b7973fdd', onKeyDown: this.handleKeyDown, onMouseOver: this.handleMouseOver, onMouseOut: this.handleMouseOut }, h("slot", { key: '69ace026483240a339a411be70eadc8aaf2accc8', onSlotchange: this.handleSlotChange }), h("div", { key: '3250d4c0549864f154c83b9c5d1592f764344957', ref: (el) => (this.tooltipPositioner = el), class: "tooltip-positioner" }, h("div", { key: '857856f4c51a1dec2d82486f7df856dce73c2444', part: "base", ref: (el) => (this.tooltip = el), id: this.componentId, class: {
168
+ return (h(Host, { key: '749a6d5edac438b4ff3bd9a34402823156417b37', onKeyDown: this.handleKeyDown, onMouseOver: this.handleMouseOver, onMouseOut: this.handleMouseOut }, h("slot", { key: 'f505a21b6cfa2362537b54a7c2a5d92750a688b5', onSlotchange: this.handleSlotChange }), h("div", { key: '4c38a6ff56ea7b6a121e59fd406728d9af71712e', ref: (el) => (this.tooltipPositioner = el), class: "tooltip-positioner" }, h("div", { key: '1df2f66d1bbae1aeb864d23d91e9094ab950ff79', part: "base", ref: (el) => (this.tooltip = el), id: this.componentId, class: {
169
169
  tooltip: true,
170
170
  'tooltip--open': this.open,
171
- }, role: "tooltip", "aria-hidden": this.open ? 'false' : 'true' }, h("slot", { key: 'e97daa734056c11813bdadc58a374c2978f660c5', name: "content" }, this.content)))));
171
+ }, role: "tooltip", "aria-hidden": this.open ? 'false' : 'true' }, h("slot", { key: 'cc4a2c0d99ae6f16058ac19cef27b7dd66c33bed', name: "content" }, this.content)))));
172
172
  }
173
173
  get host() { return this; }
174
174
  static get watchers() { return {
@@ -203,6 +203,6 @@ function defineCustomElement() {
203
203
  }
204
204
 
205
205
  export { SixTooltip as S, defineCustomElement as d };
206
- //# sourceMappingURL=p-Cs6mMfx-.js.map
206
+ //# sourceMappingURL=p-ClylOmYH.js.map
207
207
 
208
- //# sourceMappingURL=p-Cs6mMfx-.js.map
208
+ //# sourceMappingURL=p-ClylOmYH.js.map
@@ -1 +1 @@
1
- {"file":"p-Cs6mMfx-.js","mappings":";;;AAAA,MAAM,aAAa,GAAG,q5HAAq5H;;ACI36H,IAAI,EAAE,GAAG,CAAC;MAmBG,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__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/six-tooltip/six-tooltip.scss?tag=six-tooltip&encapsulation=shadow","src/components/six-tooltip/six-tooltip.tsx"],"sourcesContent":["@import 'src/global/component';\n\n/**\n * @prop --hide-delay: The amount of time to wait before hiding the tooltip.\n * @prop --hide-duration: The amount of time the hide transition takes to complete.\n * @prop --hide-timing-function: The timing function (easing) to use for the hide transition.\n * @prop --max-width: The maximum width of the tooltip.\n * @prop --show-delay: The amount of time to wait before showing the tooltip.\n * @prop --show-duration: The amount of time the show transition takes to complete.\n * @prop --show-timing-function: The timing function (easing) to use for the show transition.\n */\n:host {\n --max-width: 20rem;\n --hide-delay: 0s;\n --hide-duration: 0.125s;\n --hide-timing-function: ease;\n --show-delay: 0.125s;\n --show-duration: 0.125s;\n --show-timing-function: ease;\n\n display: contents;\n}\n\n.tooltip-positioner {\n position: fixed;\n z-index: var(--six-z-index-tooltip);\n pointer-events: none;\n}\n\n.tooltip {\n max-width: var(--max-width);\n border-radius: var(--six-border-radius-medium);\n background-color: var(--six-tooltip-background-color);\n font-family: var(--six-font-family);\n font-size: var(--six-tooltip-font-size);\n font-weight: var(--six-tooltip-font-weight);\n line-height: var(--six-tooltip-line-height);\n color: var(--six-tooltip-color);\n opacity: 0;\n padding: var(--six-spacing-xxx-small) var(--six-spacing-x-small);\n transform: scale(0.8);\n transform-origin: bottom;\n transition-property: opacity, transform;\n transition-delay: var(--hide-delay);\n transition-duration: var(--hide-duration);\n transition-timing-function: var(--hide-timing-function);\n\n &::after {\n content: '';\n position: absolute;\n width: 0;\n height: 0;\n }\n}\n\n.tooltip-positioner {\n &[data-popper-placement^='top'] .tooltip {\n transform-origin: bottom;\n }\n\n &[data-popper-placement^='bottom'] .tooltip {\n transform-origin: top;\n }\n\n &[data-popper-placement^='left'] .tooltip {\n transform-origin: right;\n }\n\n &[data-popper-placement^='right'] .tooltip {\n transform-origin: left;\n }\n\n &.popover-visible .tooltip {\n opacity: 1;\n transform: none;\n transition-delay: var(--show-delay);\n transition-duration: var(--show-duration);\n transition-timing-function: var(--show-timing-function);\n }\n}\n\n// Arrow + bottom\n.tooltip-positioner[data-popper-placement^='bottom'] .tooltip::after {\n bottom: 100%;\n left: calc(50% - var(--six-tooltip-arrow-size));\n border-bottom: var(--six-tooltip-arrow-size) solid var(--six-tooltip-background-color);\n border-left: var(--six-tooltip-arrow-size) solid transparent;\n border-right: var(--six-tooltip-arrow-size) solid transparent;\n}\n\n.tooltip-positioner[data-popper-placement='bottom-start'] .tooltip::after {\n left: var(--six-tooltip-arrow-start-end-offset);\n}\n\n.tooltip-positioner[data-popper-placement='bottom-end'] .tooltip::after {\n right: var(--six-tooltip-arrow-start-end-offset);\n left: auto;\n}\n\n// Arrow + top\n.tooltip-positioner[data-popper-placement^='top'] .tooltip::after {\n top: 100%;\n left: calc(50% - var(--six-tooltip-arrow-size));\n border-top: var(--six-tooltip-arrow-size) solid var(--six-tooltip-background-color);\n border-left: var(--six-tooltip-arrow-size) solid transparent;\n border-right: var(--six-tooltip-arrow-size) solid transparent;\n}\n\n.tooltip-positioner[data-popper-placement='top-start'] .tooltip::after {\n left: var(--six-tooltip-arrow-start-end-offset);\n}\n\n.tooltip-positioner[data-popper-placement='top-end'] .tooltip::after {\n right: var(--six-tooltip-arrow-start-end-offset);\n left: auto;\n}\n\n// Arrow + left\n.tooltip-positioner[data-popper-placement^='left'] .tooltip::after {\n top: calc(50% - var(--six-tooltip-arrow-size));\n left: 100%;\n border-left: var(--six-tooltip-arrow-size) solid var(--six-tooltip-background-color);\n border-top: var(--six-tooltip-arrow-size) solid transparent;\n border-bottom: var(--six-tooltip-arrow-size) solid transparent;\n}\n\n.tooltip-positioner[data-popper-placement='left-start'] .tooltip::after {\n top: var(--six-tooltip-arrow-start-end-offset);\n}\n\n.tooltip-positioner[data-popper-placement='left-end'] .tooltip::after {\n top: auto;\n bottom: var(--six-tooltip-arrow-start-end-offset);\n}\n\n// Arrow + right\n.tooltip-positioner[data-popper-placement^='right'] .tooltip::after {\n top: calc(50% - var(--six-tooltip-arrow-size));\n right: 100%;\n border-right: var(--six-tooltip-arrow-size) solid var(--six-tooltip-background-color);\n border-top: var(--six-tooltip-arrow-size) solid transparent;\n border-bottom: var(--six-tooltip-arrow-size) solid transparent;\n}\n\n.tooltip-positioner[data-popper-placement='right-start'] .tooltip::after {\n top: var(--six-tooltip-arrow-start-end-offset);\n}\n\n.tooltip-positioner[data-popper-placement='right-end'] .tooltip::after {\n top: auto;\n bottom: var(--six-tooltip-arrow-start-end-offset);\n}\n","import { Component, Element, Event, EventEmitter, h, Host, Method, Prop, Watch } from '@stencil/core';\nimport Popover from '../../utils/popover';\nimport { EmptyPayload } from '../../utils/types';\n\nlet id = 0;\n\n/**\n * @since 1.0\n * @status stable\n *\n * Forked from https://github.com/shoelace-style/shoelace version v2.0.0-beta27.\n *\n * @slot - The tooltip's target element. Only the first element will be used as the target.\n * @slot content - The tooltip's content. Alternatively, you can use the content prop.\n *\n * @part base - The component's base wrapper.\n */\n\n@Component({\n tag: 'six-tooltip',\n styleUrl: 'six-tooltip.scss',\n shadow: true,\n})\nexport class SixTooltip {\n private componentId = `tooltip-${++id}`;\n private isVisible = false;\n private popoverHelper?: Popover;\n private tooltipPositioner?: HTMLElement;\n private target?: HTMLElement;\n private tooltip?: HTMLElement;\n\n @Element() host!: HTMLSixTooltipElement;\n\n /** The tooltip's content. Alternatively, you can use the content slot. */\n @Prop() content = '';\n\n /**\n * The preferred placement of the tooltip. Note that the actual placement may vary as needed to keep the tooltip\n * inside the viewport.\n */\n @Prop() placement:\n | 'top'\n | 'top-start'\n | 'top-end'\n | 'right'\n | 'right-start'\n | 'right-end'\n | 'bottom'\n | 'bottom-start'\n | 'bottom-end'\n | 'left'\n | 'left-start'\n | 'left-end' = 'top';\n\n /** Set to true to disable the tooltip, so it won't show when triggered. */\n @Prop() disabled = false;\n\n /** The distance in pixels from which to offset the tooltip away from its target. */\n @Prop() distance = 10;\n\n /** Indicates whether the tooltip is open. You can use this in lieu of the show/hide methods. */\n @Prop({ mutable: true, reflect: true }) open = false;\n\n /** The distance in pixels from which to offset the tooltip along its target. */\n @Prop() skidding = 0;\n\n /**\n * Controls how the tooltip is activated. Possible options include `click`, `hover`, `focus`, and `manual`. Multiple\n * options can be passed by separating them with a space. When manual is used, the tooltip must be activated\n * programmatically.\n */\n @Prop() trigger = 'hover focus';\n\n @Watch('open')\n handleOpenChange() {\n this.open ? this.show() : this.hide();\n }\n\n /** Emitted when the tooltip begins to show. Calling `event.preventDefault()` will prevent it from being shown. */\n @Event({ eventName: 'six-tooltip-show' }) sixShow!: EventEmitter<EmptyPayload>;\n\n /** Emitted after the tooltip has shown and all transitions are complete. */\n @Event({ eventName: 'six-tooltip-after-show' }) sixAfterShow!: EventEmitter<EmptyPayload>;\n\n /** Emitted when the tooltip begins to hide. Calling `event.preventDefault()` will prevent it from being hidden. */\n @Event({ eventName: 'six-tooltip-hide' }) sixHide!: EventEmitter<EmptyPayload>;\n\n /** Emitted after the tooltip has hidden and all transitions are complete. */\n @Event({ eventName: 'six-tooltip-after-hide' }) sixAfterHide!: EventEmitter<EmptyPayload>;\n\n componentDidLoad() {\n if (this.tooltipPositioner == null) return;\n this.target = this.getTarget();\n this.popoverHelper = new Popover(this.target, this.tooltipPositioner, { strategy: 'fixed' });\n this.syncOptions();\n\n this.host.addEventListener('blur', this.handleBlur, true);\n this.host.addEventListener('click', this.handleClick, true);\n this.host.addEventListener('focus', this.handleFocus, true);\n\n // Show on init if open\n this.tooltipPositioner.hidden = !this.open;\n if (this.open) {\n this.show();\n }\n }\n\n componentDidUpdate() {\n this.syncOptions();\n }\n\n disconnectedCallback() {\n if (this.popoverHelper != null) {\n this.popoverHelper.destroy();\n }\n\n this.host.removeEventListener('blur', this.handleBlur, true);\n this.host.removeEventListener('click', this.handleClick, true);\n this.host.removeEventListener('focus', this.handleFocus, true);\n }\n\n /** Shows the tooltip. */\n @Method()\n async show() {\n // Prevent subsequent calls to the method, whether manually or triggered by the `open` watcher\n if (this.isVisible || this.disabled) {\n return;\n }\n\n const sixShow = this.sixShow.emit();\n if (sixShow.defaultPrevented) {\n this.open = false;\n return;\n }\n\n this.isVisible = true;\n this.open = true;\n this.popoverHelper?.show();\n }\n\n /** Shows the tooltip. */\n @Method()\n async hide() {\n // Prevent subsequent calls to the method, whether manually or triggered by the `open` watcher\n if (!this.isVisible || this.disabled) {\n return;\n }\n\n const sixHide = this.sixHide.emit();\n if (sixHide.defaultPrevented) {\n this.open = true;\n return;\n }\n\n this.isVisible = false;\n this.open = false;\n this.popoverHelper?.hide();\n }\n\n private getTarget() {\n // Get the first child that isn't a <style> or content slot\n const target = [...this.host.children].find(\n (el) => el.tagName.toLowerCase() !== 'style' && el.getAttribute('slot') !== 'content'\n ) as HTMLElement;\n\n if (target == null) {\n throw new Error('Invalid tooltip target: no child element was found.');\n }\n\n return target;\n }\n\n private handleBlur = () => {\n if (this.hasTrigger('focus')) {\n this.hide();\n }\n };\n\n private handleClick = () => {\n if (this.hasTrigger('click')) {\n this.open ? this.hide() : this.show();\n }\n };\n\n private handleFocus = () => {\n if (this.hasTrigger('focus')) {\n this.show();\n }\n };\n\n private handleKeyDown = (event: KeyboardEvent) => {\n // Pressing escape when the target element has focus should dismiss the tooltip\n if (this.open && event.key === 'Escape') {\n event.stopPropagation();\n this.hide();\n }\n };\n\n private handleMouseOver = () => {\n if (this.hasTrigger('hover')) {\n this.show();\n }\n };\n\n private handleMouseOut = () => {\n if (this.hasTrigger('hover')) {\n this.hide();\n }\n };\n\n private handleSlotChange = () => {\n const oldTarget = this.target;\n const newTarget = this.getTarget();\n\n if (newTarget !== oldTarget) {\n if (oldTarget != null) {\n oldTarget.removeAttribute('aria-describedby');\n }\n newTarget.setAttribute('aria-describedby', this.componentId);\n }\n };\n\n private hasTrigger(triggerType: string) {\n const triggers = this.trigger.split(' ');\n return triggers.includes(triggerType);\n }\n\n private syncOptions() {\n if (this.popoverHelper == null) return;\n\n this.popoverHelper.setOptions({\n placement: this.placement,\n distance: this.distance,\n skidding: this.skidding,\n transitionElement: this.tooltip,\n onAfterHide: () => this.sixAfterHide.emit(),\n onAfterShow: () => this.sixAfterShow.emit(),\n });\n }\n\n render() {\n return (\n <Host onKeyDown={this.handleKeyDown} onMouseOver={this.handleMouseOver} onMouseOut={this.handleMouseOut}>\n <slot onSlotchange={this.handleSlotChange} />\n <div ref={(el) => (this.tooltipPositioner = el)} class=\"tooltip-positioner\">\n <div\n part=\"base\"\n ref={(el) => (this.tooltip = el)}\n id={this.componentId}\n class={{\n tooltip: true,\n 'tooltip--open': this.open,\n }}\n role=\"tooltip\"\n aria-hidden={this.open ? 'false' : 'true'}\n >\n <slot name=\"content\">{this.content}</slot>\n </div>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
1
+ {"file":"p-ClylOmYH.js","mappings":";;;AAAA,MAAM,aAAa,GAAG,q5HAAq5H;;ACI36H,IAAI,EAAE,GAAG,CAAC;MAmBG,UAAU,iBAAAA,kBAAA,CAAA,MAAA,UAAA,SAAAC,CAAA,CAAA;AALvB,IAAA,WAAA,GAAA;;;;;;;;AAMU,QAAA,IAAA,CAAA,WAAW,GAAG,WAAW,EAAE,EAAE,EAAE;AAC/B,QAAA,IAAS,CAAA,SAAA,GAAG,KAAK;;AASjB,QAAA,IAAO,CAAA,OAAA,GAAG,EAAE;AAEpB;;;AAGG;AACK,QAAA,IAAS,CAAA,SAAA,GAYA,KAAK;;AAGd,QAAA,IAAQ,CAAA,QAAA,GAAG,KAAK;;AAGhB,QAAA,IAAQ,CAAA,QAAA,GAAG,EAAE;;AAGmB,QAAA,IAAI,CAAA,IAAA,GAAG,KAAK;;AAG5C,QAAA,IAAQ,CAAA,QAAA,GAAG,CAAC;AAEpB;;;;AAIG;AACK,QAAA,IAAO,CAAA,OAAA,GAAG,aAAa;AAqGvB,QAAA,IAAU,CAAA,UAAA,GAAG,MAAK;AACxB,YAAA,IAAI,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE;gBAC5B,IA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EAAE,KAAK,EAAC,oBAAoB,EAAA,EACzE,CACE,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,IAAI,EAAC,MAAM,EACX,GAAG,EAAE,CAAC,EAAE,MAAM,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC,EAChC,EAAE,EAAE,IAAI,CAAC,WAAW,EACpB,KAAK,EAAE;AACL,gBAAA,OAAO,EAAE,IAAI;gBACb,eAAe,EAAE,IAAI,CAAC,IAAI;AAC3B,aAAA,EACD,IAAI,EAAC,SAAS,EAAA,aAAA,EACD,IAAI,CAAC,IAAI,GAAG,OAAO,GAAG,MAAM,EAAA,EAEzC,CAAA,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAM,IAAI,EAAC,SAAS,EAAA,EAAE,IAAI,CAAC,OAAO,CAAQ,CACtC,CACF,CACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/six-tooltip/six-tooltip.scss?tag=six-tooltip&encapsulation=shadow","src/components/six-tooltip/six-tooltip.tsx"],"sourcesContent":["@import 'src/global/component';\n\n/**\n * @prop --hide-delay: The amount of time to wait before hiding the tooltip.\n * @prop --hide-duration: The amount of time the hide transition takes to complete.\n * @prop --hide-timing-function: The timing function (easing) to use for the hide transition.\n * @prop --max-width: The maximum width of the tooltip.\n * @prop --show-delay: The amount of time to wait before showing the tooltip.\n * @prop --show-duration: The amount of time the show transition takes to complete.\n * @prop --show-timing-function: The timing function (easing) to use for the show transition.\n */\n:host {\n --max-width: 20rem;\n --hide-delay: 0s;\n --hide-duration: 0.125s;\n --hide-timing-function: ease;\n --show-delay: 0.125s;\n --show-duration: 0.125s;\n --show-timing-function: ease;\n\n display: contents;\n}\n\n.tooltip-positioner {\n position: fixed;\n z-index: var(--six-z-index-tooltip);\n pointer-events: none;\n}\n\n.tooltip {\n max-width: var(--max-width);\n border-radius: var(--six-border-radius-medium);\n background-color: var(--six-tooltip-background-color);\n font-family: var(--six-font-family);\n font-size: var(--six-tooltip-font-size);\n font-weight: var(--six-tooltip-font-weight);\n line-height: var(--six-tooltip-line-height);\n color: var(--six-tooltip-color);\n opacity: 0;\n padding: var(--six-spacing-xxx-small) var(--six-spacing-x-small);\n transform: scale(0.8);\n transform-origin: bottom;\n transition-property: opacity, transform;\n transition-delay: var(--hide-delay);\n transition-duration: var(--hide-duration);\n transition-timing-function: var(--hide-timing-function);\n\n &::after {\n content: '';\n position: absolute;\n width: 0;\n height: 0;\n }\n}\n\n.tooltip-positioner {\n &[data-popper-placement^='top'] .tooltip {\n transform-origin: bottom;\n }\n\n &[data-popper-placement^='bottom'] .tooltip {\n transform-origin: top;\n }\n\n &[data-popper-placement^='left'] .tooltip {\n transform-origin: right;\n }\n\n &[data-popper-placement^='right'] .tooltip {\n transform-origin: left;\n }\n\n &.popover-visible .tooltip {\n opacity: 1;\n transform: none;\n transition-delay: var(--show-delay);\n transition-duration: var(--show-duration);\n transition-timing-function: var(--show-timing-function);\n }\n}\n\n// Arrow + bottom\n.tooltip-positioner[data-popper-placement^='bottom'] .tooltip::after {\n bottom: 100%;\n left: calc(50% - var(--six-tooltip-arrow-size));\n border-bottom: var(--six-tooltip-arrow-size) solid var(--six-tooltip-background-color);\n border-left: var(--six-tooltip-arrow-size) solid transparent;\n border-right: var(--six-tooltip-arrow-size) solid transparent;\n}\n\n.tooltip-positioner[data-popper-placement='bottom-start'] .tooltip::after {\n left: var(--six-tooltip-arrow-start-end-offset);\n}\n\n.tooltip-positioner[data-popper-placement='bottom-end'] .tooltip::after {\n right: var(--six-tooltip-arrow-start-end-offset);\n left: auto;\n}\n\n// Arrow + top\n.tooltip-positioner[data-popper-placement^='top'] .tooltip::after {\n top: 100%;\n left: calc(50% - var(--six-tooltip-arrow-size));\n border-top: var(--six-tooltip-arrow-size) solid var(--six-tooltip-background-color);\n border-left: var(--six-tooltip-arrow-size) solid transparent;\n border-right: var(--six-tooltip-arrow-size) solid transparent;\n}\n\n.tooltip-positioner[data-popper-placement='top-start'] .tooltip::after {\n left: var(--six-tooltip-arrow-start-end-offset);\n}\n\n.tooltip-positioner[data-popper-placement='top-end'] .tooltip::after {\n right: var(--six-tooltip-arrow-start-end-offset);\n left: auto;\n}\n\n// Arrow + left\n.tooltip-positioner[data-popper-placement^='left'] .tooltip::after {\n top: calc(50% - var(--six-tooltip-arrow-size));\n left: 100%;\n border-left: var(--six-tooltip-arrow-size) solid var(--six-tooltip-background-color);\n border-top: var(--six-tooltip-arrow-size) solid transparent;\n border-bottom: var(--six-tooltip-arrow-size) solid transparent;\n}\n\n.tooltip-positioner[data-popper-placement='left-start'] .tooltip::after {\n top: var(--six-tooltip-arrow-start-end-offset);\n}\n\n.tooltip-positioner[data-popper-placement='left-end'] .tooltip::after {\n top: auto;\n bottom: var(--six-tooltip-arrow-start-end-offset);\n}\n\n// Arrow + right\n.tooltip-positioner[data-popper-placement^='right'] .tooltip::after {\n top: calc(50% - var(--six-tooltip-arrow-size));\n right: 100%;\n border-right: var(--six-tooltip-arrow-size) solid var(--six-tooltip-background-color);\n border-top: var(--six-tooltip-arrow-size) solid transparent;\n border-bottom: var(--six-tooltip-arrow-size) solid transparent;\n}\n\n.tooltip-positioner[data-popper-placement='right-start'] .tooltip::after {\n top: var(--six-tooltip-arrow-start-end-offset);\n}\n\n.tooltip-positioner[data-popper-placement='right-end'] .tooltip::after {\n top: auto;\n bottom: var(--six-tooltip-arrow-start-end-offset);\n}\n","import { Component, Element, Event, EventEmitter, h, Host, Method, Prop, Watch } from '@stencil/core';\nimport Popover from '../../utils/popover';\nimport { EmptyPayload } from '../../utils/types';\n\nlet id = 0;\n\n/**\n * @since 1.0\n * @status stable\n *\n * Forked from https://github.com/shoelace-style/shoelace version v2.0.0-beta27.\n *\n * @slot - The tooltip's target element. Only the first element will be used as the target.\n * @slot content - The tooltip's content. Alternatively, you can use the content prop.\n *\n * @part base - The component's base wrapper.\n */\n\n@Component({\n tag: 'six-tooltip',\n styleUrl: 'six-tooltip.scss',\n shadow: true,\n})\nexport class SixTooltip {\n private componentId = `tooltip-${++id}`;\n private isVisible = false;\n private popoverHelper?: Popover;\n private tooltipPositioner?: HTMLElement;\n private target?: HTMLElement;\n private tooltip?: HTMLElement;\n\n @Element() host!: HTMLSixTooltipElement;\n\n /** The tooltip's content. Alternatively, you can use the content slot. */\n @Prop() content = '';\n\n /**\n * The preferred placement of the tooltip. Note that the actual placement may vary as needed to keep the tooltip\n * inside the viewport.\n */\n @Prop() placement:\n | 'top'\n | 'top-start'\n | 'top-end'\n | 'right'\n | 'right-start'\n | 'right-end'\n | 'bottom'\n | 'bottom-start'\n | 'bottom-end'\n | 'left'\n | 'left-start'\n | 'left-end' = 'top';\n\n /** Set to true to disable the tooltip, so it won't show when triggered. */\n @Prop() disabled = false;\n\n /** The distance in pixels from which to offset the tooltip away from its target. */\n @Prop() distance = 10;\n\n /** Indicates whether the tooltip is open. You can use this in lieu of the show/hide methods. */\n @Prop({ mutable: true, reflect: true }) open = false;\n\n /** The distance in pixels from which to offset the tooltip along its target. */\n @Prop() skidding = 0;\n\n /**\n * Controls how the tooltip is activated. Possible options include `click`, `hover`, `focus`, and `manual`. Multiple\n * options can be passed by separating them with a space. When manual is used, the tooltip must be activated\n * programmatically.\n */\n @Prop() trigger = 'hover focus';\n\n @Watch('open')\n handleOpenChange() {\n this.open ? this.show() : this.hide();\n }\n\n /** Emitted when the tooltip begins to show. Calling `event.preventDefault()` will prevent it from being shown. */\n @Event({ eventName: 'six-tooltip-show' }) sixShow!: EventEmitter<EmptyPayload>;\n\n /** Emitted after the tooltip has shown and all transitions are complete. */\n @Event({ eventName: 'six-tooltip-after-show' }) sixAfterShow!: EventEmitter<EmptyPayload>;\n\n /** Emitted when the tooltip begins to hide. Calling `event.preventDefault()` will prevent it from being hidden. */\n @Event({ eventName: 'six-tooltip-hide' }) sixHide!: EventEmitter<EmptyPayload>;\n\n /** Emitted after the tooltip has hidden and all transitions are complete. */\n @Event({ eventName: 'six-tooltip-after-hide' }) sixAfterHide!: EventEmitter<EmptyPayload>;\n\n componentDidLoad() {\n if (this.tooltipPositioner == null) return;\n this.target = this.getTarget();\n this.popoverHelper = new Popover(this.target, this.tooltipPositioner, { strategy: 'fixed' });\n this.syncOptions();\n\n this.host.addEventListener('blur', this.handleBlur, true);\n this.host.addEventListener('click', this.handleClick, true);\n this.host.addEventListener('focus', this.handleFocus, true);\n\n // Show on init if open\n this.tooltipPositioner.hidden = !this.open;\n if (this.open) {\n this.show();\n }\n }\n\n componentDidUpdate() {\n this.syncOptions();\n }\n\n disconnectedCallback() {\n if (this.popoverHelper != null) {\n this.popoverHelper.destroy();\n }\n\n this.host.removeEventListener('blur', this.handleBlur, true);\n this.host.removeEventListener('click', this.handleClick, true);\n this.host.removeEventListener('focus', this.handleFocus, true);\n }\n\n /** Shows the tooltip. */\n @Method()\n async show() {\n // Prevent subsequent calls to the method, whether manually or triggered by the `open` watcher\n if (this.isVisible || this.disabled) {\n return;\n }\n\n const sixShow = this.sixShow.emit();\n if (sixShow.defaultPrevented) {\n this.open = false;\n return;\n }\n\n this.isVisible = true;\n this.open = true;\n this.popoverHelper?.show();\n }\n\n /** Shows the tooltip. */\n @Method()\n async hide() {\n // Prevent subsequent calls to the method, whether manually or triggered by the `open` watcher\n if (!this.isVisible || this.disabled) {\n return;\n }\n\n const sixHide = this.sixHide.emit();\n if (sixHide.defaultPrevented) {\n this.open = true;\n return;\n }\n\n this.isVisible = false;\n this.open = false;\n this.popoverHelper?.hide();\n }\n\n private getTarget() {\n // Get the first child that isn't a <style> or content slot\n const target = [...this.host.children].find(\n (el) => el.tagName.toLowerCase() !== 'style' && el.getAttribute('slot') !== 'content'\n ) as HTMLElement;\n\n if (target == null) {\n throw new Error('Invalid tooltip target: no child element was found.');\n }\n\n return target;\n }\n\n private handleBlur = () => {\n if (this.hasTrigger('focus')) {\n this.hide();\n }\n };\n\n private handleClick = () => {\n if (this.hasTrigger('click')) {\n this.open ? this.hide() : this.show();\n }\n };\n\n private handleFocus = () => {\n if (this.hasTrigger('focus')) {\n this.show();\n }\n };\n\n private handleKeyDown = (event: KeyboardEvent) => {\n // Pressing escape when the target element has focus should dismiss the tooltip\n if (this.open && event.key === 'Escape') {\n event.stopPropagation();\n this.hide();\n }\n };\n\n private handleMouseOver = () => {\n if (this.hasTrigger('hover')) {\n this.show();\n }\n };\n\n private handleMouseOut = () => {\n if (this.hasTrigger('hover')) {\n this.hide();\n }\n };\n\n private handleSlotChange = () => {\n const oldTarget = this.target;\n const newTarget = this.getTarget();\n\n if (newTarget !== oldTarget) {\n if (oldTarget != null) {\n oldTarget.removeAttribute('aria-describedby');\n }\n newTarget.setAttribute('aria-describedby', this.componentId);\n }\n };\n\n private hasTrigger(triggerType: string) {\n const triggers = this.trigger.split(' ');\n return triggers.includes(triggerType);\n }\n\n private syncOptions() {\n if (this.popoverHelper == null) return;\n\n this.popoverHelper.setOptions({\n placement: this.placement,\n distance: this.distance,\n skidding: this.skidding,\n transitionElement: this.tooltip,\n onAfterHide: () => this.sixAfterHide.emit(),\n onAfterShow: () => this.sixAfterShow.emit(),\n });\n }\n\n render() {\n return (\n <Host onKeyDown={this.handleKeyDown} onMouseOver={this.handleMouseOver} onMouseOut={this.handleMouseOut}>\n <slot onSlotchange={this.handleSlotChange} />\n <div ref={(el) => (this.tooltipPositioner = el)} class=\"tooltip-positioner\">\n <div\n part=\"base\"\n ref={(el) => (this.tooltip = el)}\n id={this.componentId}\n class={{\n tooltip: true,\n 'tooltip--open': this.open,\n }}\n role=\"tooltip\"\n aria-hidden={this.open ? 'false' : 'true'}\n >\n <slot name=\"content\">{this.content}</slot>\n </div>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
@@ -2,7 +2,7 @@ import { h, p as proxyCustomElement, H, c as createEvent } from './p-D512q9rn.js
2
2
  import { E as EventListeners } from './p-C4h4qpGl.js';
3
3
  import { D as DEFAULT_DEBOUNCE_FAST, d as debounceEvent, a as debounce } from './p-CKhg9ibv.js';
4
4
  import { h as hasSlot } from './p-j3oIB5oT.js';
5
- import { m as movePopup, c as calcIsDropDownContentUp, a as adjustPopupForHoisting, b as adjustPopupForSmallScreens, d as defineCustomElement$2 } from './p-DnLdSdN5.js';
5
+ import { m as movePopup, c as calcIsDropDownContentUp, a as adjustPopupForHoisting, b as adjustPopupForSmallScreens, d as defineCustomElement$2 } from './p-CAJFkiLw.js';
6
6
  import { d as defineCustomElement$6 } from './p-CWKq6Dyt.js';
7
7
  import { d as defineCustomElement$5 } from './p-BSHZAiyG.js';
8
8
  import { d as defineCustomElement$4 } from './p-DsGIkEDB.js';