@haiilo/catalyst 5.3.0 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/catalyst/catalyst.css +1127 -39
- package/dist/catalyst/catalyst.esm.js +1 -1
- package/dist/catalyst/catalyst.esm.js.map +1 -1
- package/dist/catalyst/index.cdn.js +7 -0
- package/dist/catalyst/index.esm.js +2 -2
- package/dist/catalyst/index.esm.js.map +1 -1
- package/dist/catalyst/p-ad5fca6b.entry.js +10 -0
- package/dist/catalyst/p-ad5fca6b.entry.js.map +1 -0
- package/dist/catalyst/{p-d1fb9d96.js → p-ce6a1db2.js} +1 -1
- package/dist/catalyst/p-ce6a1db2.js.map +1 -0
- package/dist/catalyst/p-d7dc291a.js +2 -0
- package/dist/catalyst/p-d7dc291a.js.map +1 -0
- package/dist/catalyst/scss/_snippets/_checkbox-hint.scss +20 -0
- package/dist/catalyst/scss/index.scss +2 -0
- package/dist/catalyst/scss/utils/_border.scss +14 -0
- package/dist/catalyst/scss/utils/_media.mixins.scss +0 -1
- package/dist/catalyst/scss/utils/_typography.mixins.scss +1 -0
- package/dist/catalyst/scss/vendor/_flatpickr.scss +314 -0
- package/dist/cjs/cat-alert_25.cjs.entry.js +3391 -506
- package/dist/cjs/cat-alert_25.cjs.entry.js.map +1 -1
- package/dist/cjs/{cat-icon-registry-671af264.js → cat-icon-registry-6161e2ee.js} +56 -3
- package/dist/cjs/cat-icon-registry-6161e2ee.js.map +1 -0
- package/dist/cjs/catalyst.cjs.js +3 -3
- package/dist/cjs/catalyst.cjs.js.map +1 -1
- package/dist/cjs/{index-01312a2e.js → index-4258b31e.js} +8 -1
- package/dist/{catalyst/p-d1fb9d96.js.map → cjs/index-4258b31e.js.map} +1 -1
- package/dist/cjs/index.cjs.js +13 -15
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/loader.cjs.js.map +1 -1
- package/dist/collection/collection-manifest.json +3 -3
- package/dist/collection/components/cat-alert/cat-alert.js +5 -5
- package/dist/collection/components/cat-alert/cat-alert.js.map +1 -1
- package/dist/collection/components/cat-avatar/cat-avatar.js +5 -5
- package/dist/collection/components/cat-avatar/cat-avatar.js.map +1 -1
- package/dist/collection/components/cat-button/cat-button.css +7 -7
- package/dist/collection/components/cat-button/cat-button.js +11 -31
- package/dist/collection/components/cat-button/cat-button.js.map +1 -1
- package/dist/collection/components/cat-checkbox/cat-checkbox.css +24 -1
- package/dist/collection/components/cat-checkbox/cat-checkbox.js +38 -37
- package/dist/collection/components/cat-checkbox/cat-checkbox.js.map +1 -1
- package/dist/collection/components/cat-datepicker/cat-datepicker.config.js +22 -0
- package/dist/collection/components/cat-datepicker/cat-datepicker.config.js.map +1 -0
- package/dist/collection/components/cat-datepicker/cat-datepicker.css +18 -0
- package/dist/collection/components/cat-datepicker/cat-datepicker.js +669 -0
- package/dist/collection/components/cat-datepicker/cat-datepicker.js.map +1 -0
- package/dist/collection/components/cat-datepicker/cat-datepicker.locale.js +51 -0
- package/dist/collection/components/cat-datepicker/cat-datepicker.locale.js.map +1 -0
- package/dist/collection/components/cat-dropdown/cat-dropdown.css +1 -0
- package/dist/collection/components/cat-dropdown/cat-dropdown.js +18 -14
- package/dist/collection/components/cat-dropdown/cat-dropdown.js.map +1 -1
- package/dist/collection/components/cat-form-group/cat-form-group.js +4 -5
- package/dist/collection/components/cat-form-group/cat-form-group.js.map +1 -1
- package/dist/collection/components/cat-form-hint/cat-form-hint.js +2 -6
- package/dist/collection/components/cat-form-hint/cat-form-hint.js.map +1 -1
- package/dist/collection/components/cat-i18n/cat-i18n-registry.js +13 -1
- package/dist/collection/components/cat-i18n/cat-i18n-registry.js.map +1 -1
- package/dist/collection/components/cat-icon/cat-icon-registry.js +29 -1
- package/dist/collection/components/cat-icon/cat-icon-registry.js.map +1 -1
- package/dist/collection/components/cat-input/cat-input.css +7 -11
- package/dist/collection/components/cat-input/cat-input.js +13 -35
- package/dist/collection/components/cat-input/cat-input.js.map +1 -1
- package/dist/collection/components/cat-input/input-type.js.map +1 -1
- package/dist/collection/components/cat-notification/cat-notification.js +12 -14
- package/dist/collection/components/cat-notification/cat-notification.js.map +1 -1
- package/dist/collection/components/cat-pagination/cat-pagination.js +28 -6
- package/dist/collection/components/cat-pagination/cat-pagination.js.map +1 -1
- package/dist/collection/components/cat-radio/cat-radio.css +24 -1
- package/dist/collection/components/cat-radio/cat-radio.js +10 -31
- package/dist/collection/components/cat-radio/cat-radio.js.map +1 -1
- package/dist/collection/components/cat-radio-group/cat-radio-group.js +40 -10
- package/dist/collection/components/cat-radio-group/cat-radio-group.js.map +1 -1
- package/dist/collection/components/cat-scrollable/cat-scrollable.css +1 -4
- package/dist/collection/components/cat-scrollable/cat-scrollable.js +2 -3
- package/dist/collection/components/cat-scrollable/cat-scrollable.js.map +1 -1
- package/dist/collection/components/cat-select/cat-select.css +8 -11
- package/dist/collection/components/cat-select/cat-select.js +76 -62
- package/dist/collection/components/cat-select/cat-select.js.map +1 -1
- package/dist/collection/components/cat-select-demo/cat-select-demo.js +21 -25
- package/dist/collection/components/cat-select-demo/cat-select-demo.js.map +1 -1
- package/dist/collection/components/cat-skeleton/cat-skeleton.css +1 -1
- package/dist/collection/components/cat-tabs/cat-tabs.js +4 -7
- package/dist/collection/components/cat-tabs/cat-tabs.js.map +1 -1
- package/dist/collection/components/cat-textarea/cat-textarea.css +9 -12
- package/dist/collection/components/cat-textarea/cat-textarea.js +16 -16
- package/dist/collection/components/cat-textarea/cat-textarea.js.map +1 -1
- package/dist/collection/components/cat-toggle/cat-toggle.css +24 -1
- package/dist/collection/components/cat-toggle/cat-toggle.js +37 -36
- package/dist/collection/components/cat-toggle/cat-toggle.js.map +1 -1
- package/dist/collection/components/cat-tooltip/cat-tooltip.css +1 -1
- package/dist/collection/components/cat-tooltip/cat-tooltip.js +17 -22
- package/dist/collection/components/cat-tooltip/cat-tooltip.js.map +1 -1
- package/dist/collection/index.cdn.js +7 -0
- package/dist/collection/scss/_snippets/_checkbox-hint.scss +20 -0
- package/dist/collection/scss/index.scss +2 -0
- package/dist/collection/scss/utils/_border.scss +14 -0
- package/dist/collection/scss/utils/_media.mixins.scss +0 -1
- package/dist/collection/scss/utils/_typography.mixins.scss +1 -0
- package/dist/collection/scss/vendor/_flatpickr.scss +314 -0
- package/dist/collection/utils/platform.js +1 -1
- package/dist/collection/utils/platform.js.map +1 -1
- package/dist/components/cat-alert.js +5 -5
- package/dist/components/cat-alert.js.map +1 -1
- package/dist/components/cat-avatar2.js +5 -5
- package/dist/components/cat-avatar2.js.map +1 -1
- package/dist/components/cat-button2.js +13 -17
- package/dist/components/cat-button2.js.map +1 -1
- package/dist/components/cat-checkbox2.js +15 -16
- package/dist/components/cat-checkbox2.js.map +1 -1
- package/dist/components/{cat-label.d.ts → cat-datepicker.d.ts} +4 -4
- package/dist/components/cat-datepicker.js +2907 -0
- package/dist/components/cat-datepicker.js.map +1 -0
- package/dist/components/cat-dropdown2.js +188 -66
- package/dist/components/cat-dropdown2.js.map +1 -1
- package/dist/components/cat-form-group.js +4 -5
- package/dist/components/cat-form-group.js.map +1 -1
- package/dist/components/cat-form-hint.js +2 -6
- package/dist/components/cat-form-hint.js.map +1 -1
- package/dist/components/cat-i18n-registry.js +13 -1
- package/dist/components/cat-i18n-registry.js.map +1 -1
- package/dist/components/cat-icon-registry.js +42 -1
- package/dist/components/cat-icon-registry.js.map +1 -1
- package/dist/components/cat-input.js +1 -226
- package/dist/components/cat-input.js.map +1 -1
- package/dist/components/cat-input2.js +223 -0
- package/dist/components/cat-input2.js.map +1 -0
- package/dist/components/cat-pagination.js +10 -5
- package/dist/components/cat-pagination.js.map +1 -1
- package/dist/components/cat-radio-group.js +15 -9
- package/dist/components/cat-radio-group.js.map +1 -1
- package/dist/components/cat-radio.js +6 -13
- package/dist/components/cat-radio.js.map +1 -1
- package/dist/components/cat-scrollable2.js +9 -8
- package/dist/components/cat-scrollable2.js.map +1 -1
- package/dist/components/cat-select-demo.js +23 -27
- package/dist/components/cat-select-demo.js.map +1 -1
- package/dist/components/cat-select2.js +70 -60
- package/dist/components/cat-select2.js.map +1 -1
- package/dist/components/cat-skeleton2.js +1 -1
- package/dist/components/cat-skeleton2.js.map +1 -1
- package/dist/components/cat-tabs.js +4 -7
- package/dist/components/cat-tabs.js.map +1 -1
- package/dist/components/cat-textarea.js +13 -13
- package/dist/components/cat-textarea.js.map +1 -1
- package/dist/components/cat-toggle.js +15 -16
- package/dist/components/cat-toggle.js.map +1 -1
- package/dist/components/cat-tooltip.js +18 -23
- package/dist/components/cat-tooltip.js.map +1 -1
- package/dist/components/floating-ui.dom.esm.js +119 -130
- package/dist/components/floating-ui.dom.esm.js.map +1 -1
- package/dist/components/index.js +12 -14
- package/dist/components/index.js.map +1 -1
- package/dist/esm/cat-alert_25.entry.js +3391 -506
- package/dist/esm/cat-alert_25.entry.js.map +1 -1
- package/dist/esm/{cat-icon-registry-d6b80490.js → cat-icon-registry-f15b29d9.js} +56 -3
- package/dist/esm/cat-icon-registry-f15b29d9.js.map +1 -0
- package/dist/esm/catalyst.js +4 -4
- package/dist/esm/catalyst.js.map +1 -1
- package/dist/esm/{index-fc2f91a4.js → index-636ce8d6.js} +8 -1
- package/dist/esm/index-636ce8d6.js.map +1 -0
- package/dist/esm/index.js +14 -16
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/loader.js +4 -4
- package/dist/esm/loader.js.map +1 -1
- package/dist/types/@types/Intl.d.ts +3 -0
- package/dist/types/components/cat-button/cat-button.d.ts +0 -5
- package/dist/types/components/cat-checkbox/cat-checkbox.d.ts +11 -9
- package/dist/types/components/cat-datepicker/cat-datepicker.config.d.ts +1 -0
- package/dist/types/components/cat-datepicker/cat-datepicker.d.ts +143 -0
- package/dist/types/components/cat-datepicker/cat-datepicker.locale.d.ts +3 -0
- package/dist/types/components/cat-i18n/cat-i18n-registry.d.ts +3 -0
- package/dist/types/components/cat-input/cat-input.d.ts +2 -6
- package/dist/types/components/cat-input/input-type.d.ts +1 -1
- package/dist/types/components/cat-pagination/cat-pagination.d.ts +6 -0
- package/dist/types/components/cat-radio/cat-radio.d.ts +3 -7
- package/dist/types/components/cat-radio-group/cat-radio-group.d.ts +6 -1
- package/dist/types/components/cat-select/cat-select.d.ts +6 -1
- package/dist/types/components/cat-textarea/cat-textarea.d.ts +4 -4
- package/dist/types/components/cat-toggle/cat-toggle.d.ts +10 -8
- package/dist/types/components.d.ts +298 -117
- package/package.json +21 -19
- package/dist/catalyst/p-ba081831.entry.js +0 -10
- package/dist/catalyst/p-ba081831.entry.js.map +0 -1
- package/dist/catalyst/p-ccfebe33.js +0 -2
- package/dist/catalyst/p-ccfebe33.js.map +0 -1
- package/dist/cjs/cat-icon-registry-671af264.js.map +0 -1
- package/dist/cjs/index-01312a2e.js.map +0 -1
- package/dist/collection/components/cat-label/cat-label.css +0 -22
- package/dist/collection/components/cat-label/cat-label.js +0 -134
- package/dist/collection/components/cat-label/cat-label.js.map +0 -1
- package/dist/components/cat-label.js +0 -73
- package/dist/components/cat-label.js.map +0 -1
- package/dist/esm/cat-icon-registry-d6b80490.js.map +0 -1
- package/dist/esm/index-fc2f91a4.js.map +0 -1
- package/dist/types/components/cat-label/cat-label.d.ts +0 -27
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"cat-tooltip.js","mappings":";;;AAAA,MAAM,aAAa,GAAG,cAAc,IAAI,MAAM,IAAI,SAAS,CAAC,cAAc,GAAG,CAAC;;ACA9E,MAAM,aAAa,GAAG,4rCAA4rC;;ACIltC,IAAI,YAAY,GAAG,CAAC,CAAC;MAORA,YAAU;;;;;IAGJ,OAAE,GAAG,eAAe,YAAY,EAAE,EAAE,CAAC;IAM9C,WAAM,GAAG,KAAK,CAAC;6BAKM,KAAK;mBAKhB,EAAE;oBAMD,KAAK;qBAKO,KAAK;iBAKpB,KAAK;gBAKW,GAAG;qBAKf,GAAG;qBAKH,CAAC;6BAKO,IAAI;;EAGhC,aAAa,CAAC,EAAE,GAAG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,CAAC,CAAC;KACtF;IACD,CAAC,IAAI,CAAC,MAAM,KAAI,MAAA,IAAI,CAAC,OAAO,0CAAE,SAAS,CAAC,GAAG,CAAC,cAAc,CAAC,CAAA,CAAC;GAC7D;EAEO,WAAW;IACjB,IAAI,IAAI,CAAC,iBAAiB,EAAE;MAC1B,IAAI,CAAC,iBAAiB,EAAE,CAAC;KAC1B;GACF;;;;;;;;;;;;;;AApLuBA,mBAAM,GAAG,CAAC,CAAC;AACXA,0BAAa,GAAG,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;","names":["CatTooltip","isTouchScreen"],"sources":["./src/utils/is-touch-screen.ts","./src/components/cat-tooltip/cat-tooltip.scss?tag=cat-tooltip&encapsulation=shadow","./src/components/cat-tooltip/cat-tooltip.tsx"],"sourcesContent":["const isTouchDevice = 'ontouchstart' in window || navigator.maxTouchPoints > 0;\n\nexport default isTouchDevice;\n","@use 'variables' as *;\n@use 'mixins' as *;\n\n$-max-width: 20rem;\n$-box-shadow: rgb(0 0 0 / 8%) 0 1px 8px 0;\n$-shift-padding: 0.25rem; // padding given to the shift() middleware\n\n:host {\n display: contents;\n}\n\n:host([hidden]) {\n display: none;\n}\n\n.tooltip {\n --cat-font-color-head: cat-token('color.ui.font.tooltip', $wrap: false);\n --cat-font-color-body: cat-token('color.ui.font.tooltip', $wrap: false);\n position: fixed;\n width: max-content;\n top: 0;\n left: 0;\n box-sizing: border-box;\n @include cat-body('s', 500);\n background-color: cat-token('color.ui.background.tooltip');\n border-radius: cat-border-radius('m');\n color: cat-token('color.ui.font.tooltip');\n transition: opacity cat-token('time.transition.m') linear, visibility cat-token('time.transition.m') linear;\n visibility: hidden;\n opacity: 0;\n box-shadow: $-box-shadow;\n z-index: $cat-tooltip-z-index;\n max-width: min(calc(100vw - 2 * $-shift-padding), $-max-width);\n\n &-hidden {\n @include cat-visually-hidden;\n }\n\n &-show {\n opacity: 1;\n visibility: visible;\n }\n}\n\n// ----- round\n\n.tooltip-round {\n border-radius: 10rem;\n}\n\n// ----- size\n\n.tooltip-s {\n padding: 0.375rem 0.5rem;\n\n &.tooltip-round {\n padding: 0.375rem 0.75rem;\n }\n}\n\n.tooltip-m {\n padding: 0.75rem;\n\n &.tooltip-round {\n padding: 0.75rem 1rem;\n }\n}\n\n.tooltip-l {\n padding: 1rem;\n\n &.tooltip-round {\n padding: 1rem 1.5rem;\n }\n}\n","import { autoUpdate, computePosition, flip, offset, Placement, shift } from '@floating-ui/dom';\nimport { Component, Element, h, Host, Listen, Prop, State } from '@stencil/core';\nimport isTouchScreen from '../../utils/is-touch-screen';\n\nlet nextUniqueId = 0;\n\n@Component({\n tag: 'cat-tooltip',\n styleUrl: 'cat-tooltip.scss',\n shadow: true\n})\nexport class CatTooltip {\n private static readonly OFFSET = 4;\n private static readonly SHIFT_PADDING = 4;\n private readonly id = `cat-tooltip-${nextUniqueId++}`;\n private tooltip?: HTMLElement;\n private trigger?: Element;\n private showTimeout?: number;\n private hideTimeout?: number;\n private touchTimeout?: number;\n private hidden = false;\n private cleanupFloatingUi?: () => void;\n\n @Element() hostElement!: HTMLElement;\n\n @State() hasSlottedContent = false;\n\n /**\n * The content of the tooltip.\n */\n @Prop() content = '';\n\n /**\n * Specifies that the tooltip should be disabled. A disabled tooltip is unusable,\n * and invisible. Corresponds with the native HTML disabled attribute.\n */\n @Prop() disabled = false;\n\n /**\n * The placement of the tooltip.\n */\n @Prop() placement: Placement = 'top';\n\n /**\n * Use round tooltip edges.\n */\n @Prop() round = false;\n\n /**\n * The size of the tooltip.\n */\n @Prop() size: 's' | 'm' | 'l' = 'm';\n\n /**\n * The delay time for showing tooltip in ms.\n */\n @Prop() showDelay = 250;\n\n /**\n * The delay time for hiding tooltip in ms.\n */\n @Prop() hideDelay = 0;\n\n /**\n * The duration of tap to show the tooltip.\n */\n @Prop() longTouchDuration = 1000;\n\n @Listen('keydown')\n handleKeyDown({ key }: KeyboardEvent) {\n key === 'Escape' && this.hideListener();\n }\n\n componentDidLoad(): void {\n const slot = this.hostElement.shadowRoot?.querySelector('slot');\n this.trigger = slot?.assignedElements?.()?.[0];\n if (this.trigger && !this.trigger.hasAttribute('aria-describedby')) {\n this.trigger.setAttribute('aria-describedby', this.id);\n }\n\n if (isTouchScreen) {\n window.addEventListener('touchstart', this.windowTouchStartListener.bind(this));\n this.trigger?.addEventListener('touchstart', this.touchStartListener.bind(this));\n this.trigger?.addEventListener('touchend', this.touchEndListener.bind(this));\n } else {\n this.trigger?.addEventListener('focusin', this.showListener.bind(this));\n this.trigger?.addEventListener('focusout', this.hideListener.bind(this));\n this.trigger?.addEventListener('mouseenter', this.showListener.bind(this));\n this.trigger?.addEventListener('mouseleave', this.hideListener.bind(this));\n }\n }\n\n componentWillRender(): void {\n this.hasSlottedContent = !!this.hostElement.querySelector('[slot=\"content\"]');\n this.hidden = this.disabled || (!this.content && !this.hasSlottedContent);\n }\n\n disconnectedCallback(): void {\n if (isTouchScreen) {\n window.removeEventListener('touchstart', this.windowTouchStartListener.bind(this));\n this.trigger?.removeEventListener('touchstart', this.touchStartListener.bind(this));\n this.trigger?.removeEventListener('touchend', this.touchEndListener.bind(this));\n } else {\n this.trigger?.removeEventListener('mouseenter', this.showListener.bind(this));\n this.trigger?.removeEventListener('mouseleave', this.hideListener.bind(this));\n this.trigger?.removeEventListener('focusin', this.showListener.bind(this));\n this.trigger?.removeEventListener('focusout', this.hideListener.bind(this));\n }\n }\n\n render() {\n return (\n <Host>\n <slot />\n <div\n ref={el => (this.tooltip = el)}\n id={this.id}\n aria-hidden={this.hidden}\n class={{\n tooltip: true,\n 'tooltip-hidden': this.hidden,\n 'tooltip-round': this.round,\n [`tooltip-${this.size}`]: Boolean(this.size)\n }}\n >\n {this.hasSlottedContent ? <slot name=\"content\" /> : this.content}\n </div>\n </Host>\n );\n }\n\n private async update() {\n if (this.trigger && this.tooltip) {\n await computePosition(this.trigger, this.tooltip, {\n strategy: 'fixed',\n placement: this.placement,\n middleware: [offset(CatTooltip.OFFSET), flip(), shift({ padding: CatTooltip.SHIFT_PADDING })]\n }).then(({ x, y }) => {\n if (this.tooltip) {\n Object.assign(this.tooltip.style, {\n left: `${Math.max(0, x)}px`,\n top: `${y}px`\n });\n }\n });\n }\n }\n\n private showListener() {\n window.clearTimeout(this.hideTimeout);\n this.showTimeout = window.setTimeout(() => {\n this.showTooltip();\n }, this.showDelay);\n }\n\n private hideListener() {\n window.clearTimeout(this.showTimeout);\n this.hideTimeout = window.setTimeout(() => {\n this.tooltip?.classList.remove('tooltip-show');\n this.hideTooltip();\n }, this.hideDelay);\n }\n\n private touchStartListener(event: Event) {\n event.stopPropagation();\n this.touchTimeout = window.setTimeout(() => {\n this.showTooltip();\n }, this.longTouchDuration);\n }\n\n private touchEndListener() {\n if (this.touchTimeout) {\n window.clearTimeout(this.touchTimeout);\n this.hideTooltip();\n }\n }\n\n private windowTouchStartListener() {\n this.tooltip?.classList.remove('tooltip-show');\n }\n\n private showTooltip() {\n if (this.trigger && this.tooltip) {\n this.cleanupFloatingUi = autoUpdate(this.trigger, this.tooltip, () => this.update());\n }\n !this.hidden && this.tooltip?.classList.add('tooltip-show');\n }\n\n private hideTooltip() {\n if (this.cleanupFloatingUi) {\n this.cleanupFloatingUi();\n }\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"cat-tooltip.js","mappings":";;;AAAA,MAAM,aAAa,GAAG,cAAc,IAAI,MAAM,IAAI,SAAS,CAAC,cAAc,GAAG,CAAC;;ACA9E,MAAM,aAAa,GAAG,gsCAAgsC;;ACIttC,IAAI,YAAY,GAAG,CAAC,CAAC;MAORA,YAAU;;;;;IAGJ,OAAE,GAAG,eAAe,YAAY,EAAE,EAAE,CAAC;IAM9C,WAAM,GAAG,KAAK,CAAC;6BAKM,KAAK;mBAKhB,EAAE;oBAMD,KAAK;qBAKO,KAAK;iBAKpB,KAAK;gBAKW,GAAG;qBAKf,GAAG;qBAKH,CAAC;6BAKO,IAAI;;EAGhC,aAAa,CAAC,EAAE,GAAG,EAAiB;IAClC,GAAG,KA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AC1B,IAAI,CAAC,iBAAiB,EAAE,CAAC;KAC1B;GACF;;;;;;;;;;;;;;AApLuBA,mBAAM,GAAG,CAAC,CAAC;AACXA,0BAAa,GAAG,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;","names":["CatTooltip","isTouchScreen"],"sources":["./src/utils/is-touch-screen.ts","./src/components/cat-tooltip/cat-tooltip.scss?tag=cat-tooltip&encapsulation=shadow","./src/components/cat-tooltip/cat-tooltip.tsx"],"sourcesContent":["const isTouchDevice = 'ontouchstart' in window || navigator.maxTouchPoints > 0;\n\nexport default isTouchDevice;\n","@use 'variables' as *;\n@use 'mixins' as *;\n\n$-max-width: 20rem;\n$-box-shadow: rgb(0 0 0 / 8%) 0 1px 8px 0;\n$-shift-padding: 0.25rem; // padding given to the shift() middleware\n\n:host {\n display: contents;\n}\n\n:host([hidden]) {\n display: none;\n}\n\n.tooltip {\n --cat-font-color-head: cat-token('color.ui.font.tooltip', $wrap: false);\n --cat-font-color-body: cat-token('color.ui.font.tooltip', $wrap: false);\n position: fixed;\n width: max-content;\n top: 0;\n left: 0;\n box-sizing: border-box;\n @include cat-body('s', 500);\n background-color: cat-token('color.ui.background.tooltip');\n border-radius: cat-border-radius('m');\n color: cat-token('color.ui.font.tooltip');\n transition: opacity cat-token('time.transition.m') linear, visibility cat-token('time.transition.m') linear;\n visibility: hidden;\n opacity: 0;\n box-shadow: $-box-shadow;\n z-index: $cat-tooltip-z-index;\n max-width: min(calc(100vw - 2 * $-shift-padding), $-max-width);\n\n &-hidden {\n @include cat-visually-hidden;\n }\n\n &-show {\n opacity: 1;\n visibility: visible;\n }\n}\n\n// ----- round\n\n.tooltip-round {\n border-radius: 10rem;\n}\n\n// ----- size\n\n.tooltip-s {\n padding: 0.375rem 0.5rem;\n\n &.tooltip-round {\n padding: 0.375rem 0.75rem;\n }\n}\n\n.tooltip-m {\n padding: 0.75rem;\n\n &.tooltip-round {\n padding: 0.75rem 1rem;\n }\n}\n\n.tooltip-l {\n padding: 1rem;\n\n &.tooltip-round {\n padding: 1rem 1.5rem;\n }\n}\n","import { autoUpdate, computePosition, flip, offset, Placement, shift } from '@floating-ui/dom';\nimport { Component, Element, h, Host, Listen, Prop, State } from '@stencil/core';\nimport isTouchScreen from '../../utils/is-touch-screen';\n\nlet nextUniqueId = 0;\n\n@Component({\n tag: 'cat-tooltip',\n styleUrl: 'cat-tooltip.scss',\n shadow: true\n})\nexport class CatTooltip {\n private static readonly OFFSET = 4;\n private static readonly SHIFT_PADDING = 4;\n private readonly id = `cat-tooltip-${nextUniqueId++}`;\n private tooltip?: HTMLElement;\n private trigger?: Element;\n private showTimeout?: number;\n private hideTimeout?: number;\n private touchTimeout?: number;\n private hidden = false;\n private cleanupFloatingUi?: () => void;\n\n @Element() hostElement!: HTMLElement;\n\n @State() hasSlottedContent = false;\n\n /**\n * The content of the tooltip.\n */\n @Prop() content = '';\n\n /**\n * Specifies that the tooltip should be disabled. A disabled tooltip is unusable,\n * and invisible. Corresponds with the native HTML disabled attribute.\n */\n @Prop() disabled = false;\n\n /**\n * The placement of the tooltip.\n */\n @Prop() placement: Placement = 'top';\n\n /**\n * Use round tooltip edges.\n */\n @Prop() round = false;\n\n /**\n * The size of the tooltip.\n */\n @Prop() size: 's' | 'm' | 'l' = 'm';\n\n /**\n * The delay time for showing tooltip in ms.\n */\n @Prop() showDelay = 250;\n\n /**\n * The delay time for hiding tooltip in ms.\n */\n @Prop() hideDelay = 0;\n\n /**\n * The duration of tap to show the tooltip.\n */\n @Prop() longTouchDuration = 1000;\n\n @Listen('keydown')\n handleKeyDown({ key }: KeyboardEvent) {\n key === 'Escape' && this.hideListener();\n }\n\n componentDidLoad(): void {\n const slot = this.hostElement.shadowRoot?.querySelector('slot');\n this.trigger = slot?.assignedElements?.()?.[0];\n if (this.trigger && !this.trigger.hasAttribute('aria-describedby')) {\n this.trigger.setAttribute('aria-describedby', this.id);\n }\n\n if (isTouchScreen) {\n window.addEventListener('touchstart', this.windowTouchStartListener.bind(this));\n this.trigger?.addEventListener('touchstart', this.touchStartListener.bind(this));\n this.trigger?.addEventListener('touchend', this.touchEndListener.bind(this));\n } else {\n this.trigger?.addEventListener('focusin', this.showListener.bind(this));\n this.trigger?.addEventListener('focusout', this.hideListener.bind(this));\n this.trigger?.addEventListener('mouseenter', this.showListener.bind(this));\n this.trigger?.addEventListener('mouseleave', this.hideListener.bind(this));\n }\n }\n\n componentWillRender(): void {\n this.hasSlottedContent = !!this.hostElement.querySelector('[slot=\"content\"]');\n this.hidden = this.disabled || (!this.content && !this.hasSlottedContent);\n }\n\n disconnectedCallback(): void {\n if (isTouchScreen) {\n window.removeEventListener('touchstart', this.windowTouchStartListener.bind(this));\n this.trigger?.removeEventListener('touchstart', this.touchStartListener.bind(this));\n this.trigger?.removeEventListener('touchend', this.touchEndListener.bind(this));\n } else {\n this.trigger?.removeEventListener('mouseenter', this.showListener.bind(this));\n this.trigger?.removeEventListener('mouseleave', this.hideListener.bind(this));\n this.trigger?.removeEventListener('focusin', this.showListener.bind(this));\n this.trigger?.removeEventListener('focusout', this.hideListener.bind(this));\n }\n }\n\n render() {\n return (\n <Host>\n <slot />\n <div\n ref={el => (this.tooltip = el)}\n id={this.id}\n aria-hidden={this.hidden}\n class={{\n tooltip: true,\n 'tooltip-hidden': this.hidden,\n 'tooltip-round': this.round,\n [`tooltip-${this.size}`]: Boolean(this.size)\n }}\n >\n {this.hasSlottedContent ? <slot name=\"content\" /> : this.content}\n </div>\n </Host>\n );\n }\n\n private async update() {\n if (this.trigger && this.tooltip) {\n await computePosition(this.trigger, this.tooltip, {\n strategy: 'fixed',\n placement: this.placement,\n middleware: [offset(CatTooltip.OFFSET), flip(), shift({ padding: CatTooltip.SHIFT_PADDING })]\n }).then(({ x, y }) => {\n if (this.tooltip) {\n Object.assign(this.tooltip.style, {\n left: `${Math.max(0, x)}px`,\n top: `${y}px`\n });\n }\n });\n }\n }\n\n private showListener() {\n window.clearTimeout(this.hideTimeout);\n this.showTimeout = window.setTimeout(() => {\n this.showTooltip();\n }, this.showDelay);\n }\n\n private hideListener() {\n window.clearTimeout(this.showTimeout);\n this.hideTimeout = window.setTimeout(() => {\n this.tooltip?.classList.remove('tooltip-show');\n this.hideTooltip();\n }, this.hideDelay);\n }\n\n private touchStartListener(event: Event) {\n event.stopPropagation();\n this.touchTimeout = window.setTimeout(() => {\n this.showTooltip();\n }, this.longTouchDuration);\n }\n\n private touchEndListener() {\n if (this.touchTimeout) {\n window.clearTimeout(this.touchTimeout);\n this.hideTooltip();\n }\n }\n\n private windowTouchStartListener() {\n this.tooltip?.classList.remove('tooltip-show');\n }\n\n private showTooltip() {\n if (this.trigger && this.tooltip) {\n this.cleanupFloatingUi = autoUpdate(this.trigger, this.tooltip, () => this.update());\n }\n !this.hidden && this.tooltip?.classList.add('tooltip-show');\n }\n\n private hideTooltip() {\n if (this.cleanupFloatingUi) {\n this.cleanupFloatingUi();\n }\n }\n}\n"],"version":3}
|
|
@@ -161,6 +161,10 @@ const computePosition$1 = async (reference, floating, config) => {
|
|
|
161
161
|
};
|
|
162
162
|
};
|
|
163
163
|
|
|
164
|
+
function evaluate(value, param) {
|
|
165
|
+
return typeof value === 'function' ? value(param) : value;
|
|
166
|
+
}
|
|
167
|
+
|
|
164
168
|
function expandPaddingObject(padding) {
|
|
165
169
|
return {
|
|
166
170
|
top: 0,
|
|
@@ -217,7 +221,7 @@ async function detectOverflow(state, options) {
|
|
|
217
221
|
elementContext = 'floating',
|
|
218
222
|
altBoundary = false,
|
|
219
223
|
padding = 0
|
|
220
|
-
} = options;
|
|
224
|
+
} = evaluate(options, state);
|
|
221
225
|
const paddingObject = getSideObjectFromPadding(padding);
|
|
222
226
|
const altContext = elementContext === 'floating' ? 'reference' : 'floating';
|
|
223
227
|
const element = elements[altBoundary ? altContext : elementContext];
|
|
@@ -360,7 +364,7 @@ const flip = function (options) {
|
|
|
360
364
|
fallbackAxisSideDirection = 'none',
|
|
361
365
|
flipAlignment = true,
|
|
362
366
|
...detectOverflowOptions
|
|
363
|
-
} = options;
|
|
367
|
+
} = evaluate(options, state);
|
|
364
368
|
const side = getSide(placement);
|
|
365
369
|
const isBasePlacement = getSide(initialPlacement) === initialPlacement;
|
|
366
370
|
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
|
|
@@ -439,7 +443,7 @@ const flip = function (options) {
|
|
|
439
443
|
};
|
|
440
444
|
};
|
|
441
445
|
|
|
442
|
-
async function convertValueToCoords(state,
|
|
446
|
+
async function convertValueToCoords(state, options) {
|
|
443
447
|
const {
|
|
444
448
|
placement,
|
|
445
449
|
platform,
|
|
@@ -451,7 +455,7 @@ async function convertValueToCoords(state, value) {
|
|
|
451
455
|
const isVertical = getMainAxisFromPlacement(placement) === 'x';
|
|
452
456
|
const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1;
|
|
453
457
|
const crossAxisMulti = rtl && isVertical ? -1 : 1;
|
|
454
|
-
const rawValue =
|
|
458
|
+
const rawValue = evaluate(options, state);
|
|
455
459
|
|
|
456
460
|
// eslint-disable-next-line prefer-const
|
|
457
461
|
let {
|
|
@@ -487,19 +491,19 @@ async function convertValueToCoords(state, value) {
|
|
|
487
491
|
* object may be passed.
|
|
488
492
|
* @see https://floating-ui.com/docs/offset
|
|
489
493
|
*/
|
|
490
|
-
const offset = function (
|
|
491
|
-
if (
|
|
492
|
-
|
|
494
|
+
const offset = function (options) {
|
|
495
|
+
if (options === void 0) {
|
|
496
|
+
options = 0;
|
|
493
497
|
}
|
|
494
498
|
return {
|
|
495
499
|
name: 'offset',
|
|
496
|
-
options
|
|
500
|
+
options,
|
|
497
501
|
async fn(state) {
|
|
498
502
|
const {
|
|
499
503
|
x,
|
|
500
504
|
y
|
|
501
505
|
} = state;
|
|
502
|
-
const diffCoords = await convertValueToCoords(state,
|
|
506
|
+
const diffCoords = await convertValueToCoords(state, options);
|
|
503
507
|
return {
|
|
504
508
|
x: x + diffCoords.x,
|
|
505
509
|
y: y + diffCoords.y,
|
|
@@ -547,7 +551,7 @@ const shift = function (options) {
|
|
|
547
551
|
}
|
|
548
552
|
},
|
|
549
553
|
...detectOverflowOptions
|
|
550
|
-
} = options;
|
|
554
|
+
} = evaluate(options, state);
|
|
551
555
|
const coords = {
|
|
552
556
|
x,
|
|
553
557
|
y
|
|
@@ -610,7 +614,7 @@ const size = function (options) {
|
|
|
610
614
|
const {
|
|
611
615
|
apply = () => {},
|
|
612
616
|
...detectOverflowOptions
|
|
613
|
-
} = options;
|
|
617
|
+
} = evaluate(options, state);
|
|
614
618
|
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
615
619
|
const side = getSide(placement);
|
|
616
620
|
const alignment = getAlignment(placement);
|
|
@@ -631,18 +635,17 @@ const size = function (options) {
|
|
|
631
635
|
}
|
|
632
636
|
const overflowAvailableHeight = height - overflow[heightSide];
|
|
633
637
|
const overflowAvailableWidth = width - overflow[widthSide];
|
|
638
|
+
const noShift = !state.middlewareData.shift;
|
|
634
639
|
let availableHeight = overflowAvailableHeight;
|
|
635
640
|
let availableWidth = overflowAvailableWidth;
|
|
636
641
|
if (isXAxis) {
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
width - overflow.right - overflow.left, overflowAvailableWidth);
|
|
642
|
+
const maximumClippingWidth = width - overflow.left - overflow.right;
|
|
643
|
+
availableWidth = alignment || noShift ? min$1(overflowAvailableWidth, maximumClippingWidth) : maximumClippingWidth;
|
|
640
644
|
} else {
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
height - overflow.bottom - overflow.top, overflowAvailableHeight);
|
|
645
|
+
const maximumClippingHeight = height - overflow.top - overflow.bottom;
|
|
646
|
+
availableHeight = alignment || noShift ? min$1(overflowAvailableHeight, maximumClippingHeight) : maximumClippingHeight;
|
|
644
647
|
}
|
|
645
|
-
if (
|
|
648
|
+
if (noShift && !alignment) {
|
|
646
649
|
const xMin = max$1(overflow.left, 0);
|
|
647
650
|
const xMax = max$1(overflow.right, 0);
|
|
648
651
|
const yMin = max$1(overflow.top, 0);
|
|
@@ -680,54 +683,19 @@ function getComputedStyle$1(element) {
|
|
|
680
683
|
return getWindow(element).getComputedStyle(element);
|
|
681
684
|
}
|
|
682
685
|
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
const round = Math.round;
|
|
686
|
-
|
|
687
|
-
function getCssDimensions(element) {
|
|
688
|
-
const css = getComputedStyle$1(element);
|
|
689
|
-
let width = parseFloat(css.width);
|
|
690
|
-
let height = parseFloat(css.height);
|
|
691
|
-
const offsetWidth = element.offsetWidth;
|
|
692
|
-
const offsetHeight = element.offsetHeight;
|
|
693
|
-
const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;
|
|
694
|
-
if (shouldFallback) {
|
|
695
|
-
width = offsetWidth;
|
|
696
|
-
height = offsetHeight;
|
|
697
|
-
}
|
|
698
|
-
return {
|
|
699
|
-
width,
|
|
700
|
-
height,
|
|
701
|
-
fallback: shouldFallback
|
|
702
|
-
};
|
|
686
|
+
function isNode(value) {
|
|
687
|
+
return value instanceof getWindow(value).Node;
|
|
703
688
|
}
|
|
704
|
-
|
|
705
689
|
function getNodeName(node) {
|
|
706
690
|
return isNode(node) ? (node.nodeName || '').toLowerCase() : '';
|
|
707
691
|
}
|
|
708
692
|
|
|
709
|
-
let uaString;
|
|
710
|
-
function getUAString() {
|
|
711
|
-
if (uaString) {
|
|
712
|
-
return uaString;
|
|
713
|
-
}
|
|
714
|
-
const uaData = navigator.userAgentData;
|
|
715
|
-
if (uaData && Array.isArray(uaData.brands)) {
|
|
716
|
-
uaString = uaData.brands.map(item => item.brand + "/" + item.version).join(' ');
|
|
717
|
-
return uaString;
|
|
718
|
-
}
|
|
719
|
-
return navigator.userAgent;
|
|
720
|
-
}
|
|
721
|
-
|
|
722
693
|
function isHTMLElement(value) {
|
|
723
694
|
return value instanceof getWindow(value).HTMLElement;
|
|
724
695
|
}
|
|
725
696
|
function isElement(value) {
|
|
726
697
|
return value instanceof getWindow(value).Element;
|
|
727
698
|
}
|
|
728
|
-
function isNode(value) {
|
|
729
|
-
return value instanceof getWindow(value).Node;
|
|
730
|
-
}
|
|
731
699
|
function isShadowRoot(node) {
|
|
732
700
|
// Browsers without `ShadowRoot` support.
|
|
733
701
|
if (typeof ShadowRoot === 'undefined') {
|
|
@@ -749,41 +717,45 @@ function isTableElement(element) {
|
|
|
749
717
|
return ['table', 'td', 'th'].includes(getNodeName(element));
|
|
750
718
|
}
|
|
751
719
|
function isContainingBlock(element) {
|
|
752
|
-
|
|
753
|
-
const isFirefox = /firefox/i.test(getUAString());
|
|
720
|
+
const safari = isSafari();
|
|
754
721
|
const css = getComputedStyle$1(element);
|
|
755
|
-
const backdropFilter = css.backdropFilter || css.WebkitBackdropFilter;
|
|
756
722
|
|
|
757
|
-
// This is non-exhaustive but covers the most common CSS properties that
|
|
758
|
-
// create a containing block.
|
|
759
723
|
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
|
|
760
|
-
return css.transform !== 'none' || css.perspective !== 'none' || (backdropFilter ? backdropFilter !== 'none' : false) ||
|
|
761
|
-
// Add type check for old browsers.
|
|
762
|
-
const contain = css.contain;
|
|
763
|
-
return contain != null ? contain.includes(value) : false;
|
|
764
|
-
});
|
|
724
|
+
return css.transform !== 'none' || css.perspective !== 'none' || !safari && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !safari && (css.filter ? css.filter !== 'none' : false) || ['transform', 'perspective', 'filter'].some(value => (css.willChange || '').includes(value)) || ['paint', 'layout', 'strict', 'content'].some(value => (css.contain || '').includes(value));
|
|
765
725
|
}
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
* viewport offsets. In Safari, the `x`/`y` offsets are values relative to the
|
|
770
|
-
* visual viewport, while in other engines, they are values relative to the
|
|
771
|
-
* layout viewport.
|
|
772
|
-
*/
|
|
773
|
-
function isClientRectVisualViewportBased() {
|
|
774
|
-
// TODO: Try to use feature detection here instead. Feature detection for
|
|
775
|
-
// this can fail in various ways, making the userAgent check the most
|
|
776
|
-
// reliable:
|
|
777
|
-
// • Always-visible scrollbar or not
|
|
778
|
-
// • Width of <html>
|
|
779
|
-
|
|
780
|
-
// Is Safari.
|
|
781
|
-
return /^((?!chrome|android).)*safari/i.test(getUAString());
|
|
726
|
+
function isSafari() {
|
|
727
|
+
if (typeof CSS === 'undefined' || !CSS.supports) return false;
|
|
728
|
+
return CSS.supports('-webkit-backdrop-filter', 'none');
|
|
782
729
|
}
|
|
783
730
|
function isLastTraversableNode(node) {
|
|
784
731
|
return ['html', 'body', '#document'].includes(getNodeName(node));
|
|
785
732
|
}
|
|
786
733
|
|
|
734
|
+
const min = Math.min;
|
|
735
|
+
const max = Math.max;
|
|
736
|
+
const round = Math.round;
|
|
737
|
+
|
|
738
|
+
function getCssDimensions(element) {
|
|
739
|
+
const css = getComputedStyle$1(element);
|
|
740
|
+
// In testing environments, the `width` and `height` properties are empty
|
|
741
|
+
// strings for SVG elements, returning NaN. Fallback to `0` in this case.
|
|
742
|
+
let width = parseFloat(css.width) || 0;
|
|
743
|
+
let height = parseFloat(css.height) || 0;
|
|
744
|
+
const hasOffset = isHTMLElement(element);
|
|
745
|
+
const offsetWidth = hasOffset ? element.offsetWidth : width;
|
|
746
|
+
const offsetHeight = hasOffset ? element.offsetHeight : height;
|
|
747
|
+
const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;
|
|
748
|
+
if (shouldFallback) {
|
|
749
|
+
width = offsetWidth;
|
|
750
|
+
height = offsetHeight;
|
|
751
|
+
}
|
|
752
|
+
return {
|
|
753
|
+
width,
|
|
754
|
+
height,
|
|
755
|
+
fallback: shouldFallback
|
|
756
|
+
};
|
|
757
|
+
}
|
|
758
|
+
|
|
787
759
|
function unwrapElement(element) {
|
|
788
760
|
return !isElement(element) ? element.contextElement : element;
|
|
789
761
|
}
|
|
@@ -820,8 +792,29 @@ function getScale(element) {
|
|
|
820
792
|
};
|
|
821
793
|
}
|
|
822
794
|
|
|
823
|
-
|
|
795
|
+
const noOffsets = {
|
|
796
|
+
x: 0,
|
|
797
|
+
y: 0
|
|
798
|
+
};
|
|
799
|
+
function getVisualOffsets(element, isFixed, floatingOffsetParent) {
|
|
824
800
|
var _win$visualViewport, _win$visualViewport2;
|
|
801
|
+
if (isFixed === void 0) {
|
|
802
|
+
isFixed = true;
|
|
803
|
+
}
|
|
804
|
+
if (!isSafari()) {
|
|
805
|
+
return noOffsets;
|
|
806
|
+
}
|
|
807
|
+
const win = element ? getWindow(element) : window;
|
|
808
|
+
if (!floatingOffsetParent || isFixed && floatingOffsetParent !== win) {
|
|
809
|
+
return noOffsets;
|
|
810
|
+
}
|
|
811
|
+
return {
|
|
812
|
+
x: ((_win$visualViewport = win.visualViewport) == null ? void 0 : _win$visualViewport.offsetLeft) || 0,
|
|
813
|
+
y: ((_win$visualViewport2 = win.visualViewport) == null ? void 0 : _win$visualViewport2.offsetTop) || 0
|
|
814
|
+
};
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
|
|
825
818
|
if (includeScale === void 0) {
|
|
826
819
|
includeScale = false;
|
|
827
820
|
}
|
|
@@ -840,10 +833,9 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
|
|
|
840
833
|
scale = getScale(element);
|
|
841
834
|
}
|
|
842
835
|
}
|
|
843
|
-
const
|
|
844
|
-
|
|
845
|
-
let
|
|
846
|
-
let y = (clientRect.top + (addVisualOffsets ? ((_win$visualViewport2 = win.visualViewport) == null ? void 0 : _win$visualViewport2.offsetTop) || 0 : 0)) / scale.y;
|
|
836
|
+
const visualOffsets = getVisualOffsets(domElement, isFixedStrategy, offsetParent);
|
|
837
|
+
let x = (clientRect.left + visualOffsets.x) / scale.x;
|
|
838
|
+
let y = (clientRect.top + visualOffsets.y) / scale.y;
|
|
847
839
|
let width = clientRect.width / scale.x;
|
|
848
840
|
let height = clientRect.height / scale.y;
|
|
849
841
|
if (domElement) {
|
|
@@ -865,16 +857,12 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
|
|
|
865
857
|
currentIFrame = getWindow(currentIFrame).frameElement;
|
|
866
858
|
}
|
|
867
859
|
}
|
|
868
|
-
return {
|
|
860
|
+
return rectToClientRect({
|
|
869
861
|
width,
|
|
870
862
|
height,
|
|
871
|
-
top: y,
|
|
872
|
-
right: x + width,
|
|
873
|
-
bottom: y + height,
|
|
874
|
-
left: x,
|
|
875
863
|
x,
|
|
876
864
|
y
|
|
877
|
-
};
|
|
865
|
+
});
|
|
878
866
|
}
|
|
879
867
|
|
|
880
868
|
function getDocumentElement(node) {
|
|
@@ -1017,7 +1005,7 @@ function getViewportRect(element, strategy) {
|
|
|
1017
1005
|
if (visualViewport) {
|
|
1018
1006
|
width = visualViewport.width;
|
|
1019
1007
|
height = visualViewport.height;
|
|
1020
|
-
const visualViewportBased =
|
|
1008
|
+
const visualViewportBased = isSafari();
|
|
1021
1009
|
if (!visualViewportBased || visualViewportBased && strategy === 'fixed') {
|
|
1022
1010
|
x = visualViewport.offsetLeft;
|
|
1023
1011
|
y = visualViewport.offsetTop;
|
|
@@ -1060,19 +1048,22 @@ function getClientRectFromClippingAncestor(element, clippingAncestor, strategy)
|
|
|
1060
1048
|
} else if (isElement(clippingAncestor)) {
|
|
1061
1049
|
rect = getInnerBoundingClientRect(clippingAncestor, strategy);
|
|
1062
1050
|
} else {
|
|
1063
|
-
const
|
|
1064
|
-
|
|
1051
|
+
const visualOffsets = getVisualOffsets(element);
|
|
1052
|
+
rect = {
|
|
1053
|
+
...clippingAncestor,
|
|
1054
|
+
x: clippingAncestor.x - visualOffsets.x,
|
|
1055
|
+
y: clippingAncestor.y - visualOffsets.y
|
|
1065
1056
|
};
|
|
1066
|
-
if (isClientRectVisualViewportBased()) {
|
|
1067
|
-
var _win$visualViewport, _win$visualViewport2;
|
|
1068
|
-
const win = getWindow(element);
|
|
1069
|
-
mutableRect.x -= ((_win$visualViewport = win.visualViewport) == null ? void 0 : _win$visualViewport.offsetLeft) || 0;
|
|
1070
|
-
mutableRect.y -= ((_win$visualViewport2 = win.visualViewport) == null ? void 0 : _win$visualViewport2.offsetTop) || 0;
|
|
1071
|
-
}
|
|
1072
|
-
rect = mutableRect;
|
|
1073
1057
|
}
|
|
1074
1058
|
return rectToClientRect(rect);
|
|
1075
1059
|
}
|
|
1060
|
+
function hasFixedPositionAncestor(element, stopNode) {
|
|
1061
|
+
const parentNode = getParentNode(element);
|
|
1062
|
+
if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {
|
|
1063
|
+
return false;
|
|
1064
|
+
}
|
|
1065
|
+
return getComputedStyle$1(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);
|
|
1066
|
+
}
|
|
1076
1067
|
|
|
1077
1068
|
// A "clipping ancestor" is an `overflow` element with the characteristic of
|
|
1078
1069
|
// clipping (or hiding) child elements. This returns all clipping ancestors
|
|
@@ -1090,19 +1081,17 @@ function getClippingElementAncestors(element, cache) {
|
|
|
1090
1081
|
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
|
|
1091
1082
|
while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
1092
1083
|
const computedStyle = getComputedStyle$1(currentNode);
|
|
1093
|
-
const
|
|
1094
|
-
|
|
1095
|
-
if (shouldIgnoreCurrentNode) {
|
|
1084
|
+
const currentNodeIsContaining = isContainingBlock(currentNode);
|
|
1085
|
+
if (!currentNodeIsContaining && computedStyle.position === 'fixed') {
|
|
1096
1086
|
currentContainingBlockComputedStyle = null;
|
|
1087
|
+
}
|
|
1088
|
+
const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && ['absolute', 'fixed'].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
|
|
1089
|
+
if (shouldDropCurrentNode) {
|
|
1090
|
+
// Drop non-containing blocks.
|
|
1091
|
+
result = result.filter(ancestor => ancestor !== currentNode);
|
|
1097
1092
|
} else {
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
// Drop non-containing blocks.
|
|
1101
|
-
result = result.filter(ancestor => ancestor !== currentNode);
|
|
1102
|
-
} else {
|
|
1103
|
-
// Record last containing block for next iteration.
|
|
1104
|
-
currentContainingBlockComputedStyle = computedStyle;
|
|
1105
|
-
}
|
|
1093
|
+
// Record last containing block for next iteration.
|
|
1094
|
+
currentContainingBlockComputedStyle = computedStyle;
|
|
1106
1095
|
}
|
|
1107
1096
|
currentNode = getParentNode(currentNode);
|
|
1108
1097
|
}
|
|
@@ -1139,10 +1128,7 @@ function getClippingRect(_ref) {
|
|
|
1139
1128
|
}
|
|
1140
1129
|
|
|
1141
1130
|
function getDimensions(element) {
|
|
1142
|
-
|
|
1143
|
-
return getCssDimensions(element);
|
|
1144
|
-
}
|
|
1145
|
-
return element.getBoundingClientRect();
|
|
1131
|
+
return getCssDimensions(element);
|
|
1146
1132
|
}
|
|
1147
1133
|
|
|
1148
1134
|
function getTrueOffsetParent(element, polyfill) {
|
|
@@ -1170,6 +1156,9 @@ function getContainingBlock(element) {
|
|
|
1170
1156
|
// such as table ancestors and cross browser bugs.
|
|
1171
1157
|
function getOffsetParent(element, polyfill) {
|
|
1172
1158
|
const window = getWindow(element);
|
|
1159
|
+
if (!isHTMLElement(element)) {
|
|
1160
|
+
return window;
|
|
1161
|
+
}
|
|
1173
1162
|
let offsetParent = getTrueOffsetParent(element, polyfill);
|
|
1174
1163
|
while (offsetParent && isTableElement(offsetParent) && getComputedStyle$1(offsetParent).position === 'static') {
|
|
1175
1164
|
offsetParent = getTrueOffsetParent(offsetParent, polyfill);
|
|
@@ -1183,7 +1172,8 @@ function getOffsetParent(element, polyfill) {
|
|
|
1183
1172
|
function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
1184
1173
|
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
1185
1174
|
const documentElement = getDocumentElement(offsetParent);
|
|
1186
|
-
const
|
|
1175
|
+
const isFixed = strategy === 'fixed';
|
|
1176
|
+
const rect = getBoundingClientRect(element, true, isFixed, offsetParent);
|
|
1187
1177
|
let scroll = {
|
|
1188
1178
|
scrollLeft: 0,
|
|
1189
1179
|
scrollTop: 0
|
|
@@ -1192,12 +1182,12 @@ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
|
1192
1182
|
x: 0,
|
|
1193
1183
|
y: 0
|
|
1194
1184
|
};
|
|
1195
|
-
if (isOffsetParentAnElement || !isOffsetParentAnElement &&
|
|
1185
|
+
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
|
1196
1186
|
if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
|
|
1197
1187
|
scroll = getNodeScroll(offsetParent);
|
|
1198
1188
|
}
|
|
1199
1189
|
if (isHTMLElement(offsetParent)) {
|
|
1200
|
-
const offsetRect = getBoundingClientRect(offsetParent, true);
|
|
1190
|
+
const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);
|
|
1201
1191
|
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
1202
1192
|
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
1203
1193
|
} else if (documentElement) {
|
|
@@ -1254,27 +1244,26 @@ function autoUpdate(reference, floating, update, options) {
|
|
|
1254
1244
|
options = {};
|
|
1255
1245
|
}
|
|
1256
1246
|
const {
|
|
1257
|
-
ancestorScroll
|
|
1247
|
+
ancestorScroll = true,
|
|
1258
1248
|
ancestorResize = true,
|
|
1259
1249
|
elementResize = true,
|
|
1260
1250
|
animationFrame = false
|
|
1261
1251
|
} = options;
|
|
1262
|
-
const ancestorScroll = _ancestorScroll && !animationFrame;
|
|
1263
1252
|
const ancestors = ancestorScroll || ancestorResize ? [...(isElement(reference) ? getOverflowAncestors(reference) : reference.contextElement ? getOverflowAncestors(reference.contextElement) : []), ...getOverflowAncestors(floating)] : [];
|
|
1264
1253
|
ancestors.forEach(ancestor => {
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1254
|
+
// ignores Window, checks for [object VisualViewport]
|
|
1255
|
+
const isVisualViewport = !isElement(ancestor) && ancestor.toString().includes('V');
|
|
1256
|
+
if (ancestorScroll && (animationFrame ? isVisualViewport : true)) {
|
|
1257
|
+
ancestor.addEventListener('scroll', update, {
|
|
1258
|
+
passive: true
|
|
1259
|
+
});
|
|
1260
|
+
}
|
|
1268
1261
|
ancestorResize && ancestor.addEventListener('resize', update);
|
|
1269
1262
|
});
|
|
1270
1263
|
let observer = null;
|
|
1271
1264
|
if (elementResize) {
|
|
1272
|
-
let initialUpdate = true;
|
|
1273
1265
|
observer = new ResizeObserver(() => {
|
|
1274
|
-
|
|
1275
|
-
update();
|
|
1276
|
-
}
|
|
1277
|
-
initialUpdate = false;
|
|
1266
|
+
update();
|
|
1278
1267
|
});
|
|
1279
1268
|
isElement(reference) && !animationFrame && observer.observe(reference);
|
|
1280
1269
|
if (!isElement(reference) && reference.contextElement && !animationFrame) {
|