bromcom-ui 2.7.37-rc.3 → 2.7.37-rc.4-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/bromcom-ui/bromcom-ui.esm.js +1 -1
- package/dist/bromcom-ui/p-02d75af2.js +5 -0
- package/dist/bromcom-ui/{p-a04909f2.entry.js → p-03b55cfb.entry.js} +1 -1
- package/dist/bromcom-ui/{p-a677275e.entry.js → p-05702e53.entry.js} +1 -1
- package/dist/bromcom-ui/{p-7d119b6d.js → p-0a9b00a9.js} +1 -1
- package/dist/bromcom-ui/{p-6a3c1fb9.entry.js → p-0d778313.entry.js} +1 -1
- package/dist/bromcom-ui/{p-8513e734.entry.js → p-17a333df.entry.js} +1 -1
- package/dist/bromcom-ui/{p-55cce901.entry.js → p-1b51a1a5.entry.js} +1 -1
- package/dist/bromcom-ui/{p-99dc108e.entry.js → p-1e286e48.entry.js} +1 -1
- package/dist/bromcom-ui/{p-609bc368.entry.js → p-22a0e65d.entry.js} +1 -1
- package/dist/bromcom-ui/{p-a59a0361.entry.js → p-2462b461.entry.js} +1 -1
- package/dist/bromcom-ui/{p-a661a9d5.entry.js → p-26931df9.entry.js} +1 -1
- package/dist/bromcom-ui/{p-00f2b559.entry.js → p-26f3fdba.entry.js} +1 -1
- package/dist/bromcom-ui/{p-85d1183b.entry.js → p-273f91af.entry.js} +1 -1
- package/dist/bromcom-ui/{p-76153673.entry.js → p-2ab6e327.entry.js} +1 -1
- package/dist/bromcom-ui/{p-fda9a21b.entry.js → p-2bc9235f.entry.js} +1 -1
- package/dist/bromcom-ui/{p-82ad3d24.entry.js → p-32145a6a.entry.js} +1 -1
- package/dist/bromcom-ui/{p-34f30b8b.entry.js → p-36506817.entry.js} +1 -1
- package/dist/bromcom-ui/{p-7df25164.entry.js → p-3971afee.entry.js} +1 -1
- package/dist/bromcom-ui/{p-b1d1cdb0.entry.js → p-4b318405.entry.js} +1 -1
- package/dist/bromcom-ui/{p-e75fa6be.entry.js → p-4e8fe53f.entry.js} +1 -1
- package/dist/bromcom-ui/{p-30806ec7.js → p-576c9e1a.js} +1 -1
- package/dist/bromcom-ui/{p-109d49c2.entry.js → p-5c33bc24.entry.js} +1 -1
- package/dist/bromcom-ui/p-650d0075.js +5 -0
- package/dist/bromcom-ui/{p-ea15e1f4.entry.js → p-65605e2b.entry.js} +1 -1
- package/dist/bromcom-ui/{p-47fa3046.entry.js → p-70214600.entry.js} +1 -1
- package/dist/bromcom-ui/{p-7c8d47f6.entry.js → p-71869daf.entry.js} +1 -1
- package/dist/bromcom-ui/{p-d18c5524.entry.js → p-74cb5833.entry.js} +1 -1
- package/dist/bromcom-ui/{p-2b3b55ef.entry.js → p-75bd9b2e.entry.js} +1 -1
- package/dist/bromcom-ui/{p-087d371a.entry.js → p-76be0458.entry.js} +1 -1
- package/dist/bromcom-ui/{p-11d54517.entry.js → p-82f2ad3d.entry.js} +1 -1
- package/dist/bromcom-ui/{p-65dcaa9e.entry.js → p-87065fd4.entry.js} +1 -1
- package/dist/bromcom-ui/{p-9e8eb647.entry.js → p-8a1ad072.entry.js} +1 -1
- package/dist/bromcom-ui/{p-3716c24c.entry.js → p-8e1f99b0.entry.js} +1 -1
- package/dist/bromcom-ui/{p-6c12e5dd.entry.js → p-94594729.entry.js} +1 -1
- package/dist/bromcom-ui/p-959303e6.js +5 -0
- package/dist/bromcom-ui/p-97ab8650.entry.js +5 -0
- package/dist/bromcom-ui/{p-0653fefc.entry.js → p-9c80f257.entry.js} +1 -1
- package/dist/bromcom-ui/{p-ab3f2735.entry.js → p-a0f75665.entry.js} +1 -1
- package/dist/bromcom-ui/{p-49c83e11.entry.js → p-a1d8b2f0.entry.js} +1 -1
- package/dist/bromcom-ui/{p-cd638c37.entry.js → p-a6d7b8ff.entry.js} +1 -1
- package/dist/bromcom-ui/{p-ad11bb72.entry.js → p-a8ad2743.entry.js} +1 -1
- package/dist/bromcom-ui/{p-2c3c7265.entry.js → p-c9b1cee9.entry.js} +1 -1
- package/dist/bromcom-ui/{p-f9b0e4d2.entry.js → p-cfcd67d2.entry.js} +1 -1
- package/dist/bromcom-ui/{p-fef3003b.entry.js → p-d3401faf.entry.js} +1 -1
- package/dist/bromcom-ui/{p-db7c75ac.entry.js → p-d6899b4a.entry.js} +1 -1
- package/dist/bromcom-ui/{p-31bc32d4.entry.js → p-da77656a.entry.js} +1 -1
- package/dist/bromcom-ui/{p-577cf8e3.js → p-de448df0.js} +1 -1
- package/dist/bromcom-ui/{p-b9421650.entry.js → p-de89f82d.entry.js} +1 -1
- package/dist/bromcom-ui/{p-6768e612.entry.js → p-ea1352b5.entry.js} +1 -1
- package/dist/bromcom-ui/{p-7b7caea1.entry.js → p-f6e52a9b.entry.js} +1 -1
- package/dist/bromcom-ui/{p-27f0db71.js → p-fa8fd0b1.js} +1 -1
- package/dist/bromcom-ui/{p-ce9f87de.entry.js → p-fac43984.entry.js} +1 -1
- package/dist/cjs/bcm-accordion.cjs.entry.js +1 -1
- package/dist/cjs/bcm-alert.cjs.entry.js +1 -1
- package/dist/cjs/bcm-attendance.cjs.entry.js +2 -2
- package/dist/cjs/bcm-avatar_2.cjs.entry.js +3 -3
- package/dist/cjs/bcm-breadcrumb.cjs.entry.js +1 -1
- package/dist/cjs/bcm-button-group.cjs.entry.js +1 -1
- package/dist/cjs/bcm-button_4.cjs.entry.js +1 -1
- package/dist/cjs/bcm-card.cjs.entry.js +1 -1
- package/dist/cjs/bcm-checkbox-group.cjs.entry.js +1 -1
- package/dist/cjs/bcm-checkbox-lite_9.cjs.entry.js +1 -1
- package/dist/cjs/bcm-checkbox_2.cjs.entry.js +1 -1
- package/dist/cjs/bcm-chip.cjs.entry.js +1 -1
- package/dist/cjs/bcm-collapse.cjs.entry.js +1 -1
- package/dist/cjs/bcm-date-picker.cjs.entry.js +1 -1
- package/dist/cjs/bcm-datetime-picker.cjs.entry.js +1 -1
- package/dist/cjs/bcm-default.cjs.entry.js +1 -1
- package/dist/cjs/bcm-drawer.cjs.entry.js +3 -3
- package/dist/cjs/bcm-dropdown.cjs.entry.js +2 -2
- package/dist/cjs/bcm-expansion-panel.cjs.entry.js +1 -1
- package/dist/cjs/bcm-form-2.cjs.entry.js +1 -1
- package/dist/cjs/bcm-input.cjs.entry.js +4 -4
- package/dist/cjs/bcm-item.cjs.entry.js +1 -1
- package/dist/cjs/bcm-items.cjs.entry.js +1 -1
- package/dist/cjs/bcm-label_2.cjs.entry.js +4 -4
- package/dist/cjs/bcm-linked.cjs.entry.js +3 -3
- package/dist/cjs/bcm-list.cjs.entry.js +5 -5
- package/dist/cjs/bcm-menu.cjs.entry.js +5 -5
- package/dist/cjs/bcm-popconfirm-box.cjs.entry.js +1 -1
- package/dist/cjs/bcm-popconfirm.cjs.entry.js +1 -1
- package/dist/cjs/bcm-popover.cjs.entry.js +3 -3
- package/dist/cjs/bcm-progress.cjs.entry.js +1 -1
- package/dist/cjs/bcm-radio-group.cjs.entry.js +1 -1
- package/dist/cjs/bcm-radio.cjs.entry.js +1 -1
- package/dist/cjs/bcm-range.cjs.entry.js +1 -1
- package/dist/cjs/bcm-search.cjs.entry.js +3 -3
- package/dist/cjs/bcm-skeleton.cjs.entry.js +1 -1
- package/dist/cjs/bcm-step.cjs.entry.js +2 -2
- package/dist/cjs/bcm-stepper.cjs.entry.js +3 -3
- package/dist/cjs/bcm-switch.cjs.entry.js +1 -1
- package/dist/cjs/bcm-tab-group.cjs.entry.js +1 -1
- package/dist/cjs/bcm-tag.cjs.entry.js +2 -2
- package/dist/cjs/bcm-textarea.cjs.entry.js +2 -2
- package/dist/cjs/bcm-time-picker.cjs.entry.js +1 -1
- package/dist/cjs/{generate-9444aa87.js → generate-29f6c671.js} +1 -1
- package/dist/cjs/{input-template-623d767d.js → input-template-8d49a61c.js} +1 -1
- package/dist/cjs/{json-parse-decarator-e39af071.js → json-parse-decarator-5d872ae7.js} +1 -1
- package/dist/cjs/{number-helper-ba5aa459.js → number-helper-288bbac7.js} +1 -1
- package/dist/cjs/old-bcm-popover-box.cjs.entry.js +2 -2
- package/dist/cjs/old-bcm-popover.cjs.entry.js +1 -1
- package/dist/cjs/{stepper-states-46c5f64b.js → stepper-states-902494d8.js} +1 -1
- package/dist/cjs/{tooltip-helper-5442af2e.js → tooltip-helper-4be3d320.js} +3 -3
- package/dist/cjs/{validators-e45ced35.js → validators-9af1100c.js} +1 -1
- package/dist/collection/components/atoms/avatar/avatar.js +3 -3
- package/dist/collection/components/atoms/typography/typography.js +1 -1
- package/dist/collection/components/molecules/drawer/drawer.js +3 -3
- package/dist/collection/components/molecules/linked/linked.js +4 -4
- package/dist/collection/components/molecules/menu/menu.js +2 -2
- package/dist/collection/components/molecules/popover/popover.js +3 -3
- package/dist/collection/components/molecules/tooltip/tooltip.js +3 -3
- package/dist/collection/components/organism/list/list-tag-control.js +1 -1
- package/dist/collection/components/organism/list/list.js +5 -5
- package/dist/collection/components/other_deprecated/old-popover/old-popover-box.js +1 -1
- package/dist/collection/helper/popover-helper.js +2 -2
- package/dist/collection/helper/tooltip-helper.js +2 -2
- package/dist/collection/utils/floating-ui.js +1 -1
- package/dist/components/_commonjsHelpers.js +25 -0
- package/dist/components/avatar.js +124 -0
- package/dist/components/badge.js +95 -0
- package/dist/components/bcm-accordion.d.ts +11 -0
- package/dist/components/bcm-accordion.js +101 -0
- package/dist/components/bcm-alert.d.ts +11 -0
- package/dist/components/bcm-alert.js +140 -0
- package/dist/components/bcm-attendance.d.ts +11 -0
- package/dist/components/bcm-attendance.js +72 -0
- package/dist/components/bcm-autocomplete.d.ts +11 -0
- package/dist/components/bcm-autocomplete.js +293 -0
- package/dist/components/bcm-avatar.d.ts +11 -0
- package/dist/components/bcm-avatar.js +10 -0
- package/dist/components/bcm-badge.d.ts +11 -0
- package/dist/components/bcm-badge.js +10 -0
- package/dist/components/bcm-box.d.ts +11 -0
- package/dist/components/bcm-box.js +48 -0
- package/dist/components/bcm-breadcrumb.d.ts +11 -0
- package/dist/components/bcm-breadcrumb.js +96 -0
- package/dist/components/bcm-button-group.d.ts +11 -0
- package/dist/components/bcm-button-group.js +121 -0
- package/dist/components/bcm-button.d.ts +11 -0
- package/dist/components/bcm-button.js +10 -0
- package/dist/components/bcm-card.d.ts +11 -0
- package/dist/components/bcm-card.js +91 -0
- package/dist/components/bcm-checkbox-group.d.ts +11 -0
- package/dist/components/bcm-checkbox-group.js +474 -0
- package/dist/components/bcm-checkbox-lite.d.ts +11 -0
- package/dist/components/bcm-checkbox-lite.js +10 -0
- package/dist/components/bcm-checkbox.d.ts +11 -0
- package/dist/components/bcm-checkbox.js +10 -0
- package/dist/components/bcm-chip.d.ts +11 -0
- package/dist/components/bcm-chip.js +106 -0
- package/dist/components/bcm-collapse-group.d.ts +11 -0
- package/dist/components/bcm-collapse-group.js +75 -0
- package/dist/components/bcm-collapse.d.ts +11 -0
- package/dist/components/bcm-collapse.js +77 -0
- package/dist/components/bcm-colorpicker.d.ts +11 -0
- package/dist/components/bcm-colorpicker.js +491 -0
- package/dist/components/bcm-date-picker.d.ts +11 -0
- package/dist/components/bcm-date-picker.js +249 -0
- package/dist/components/bcm-datetime-picker.d.ts +11 -0
- package/dist/components/bcm-datetime-picker.js +10 -0
- package/dist/components/bcm-default.d.ts +11 -0
- package/dist/components/bcm-default.js +61 -0
- package/dist/components/bcm-divider.d.ts +11 -0
- package/dist/components/bcm-divider.js +10 -0
- package/dist/components/bcm-drawer.d.ts +11 -0
- package/dist/components/bcm-drawer.js +141 -0
- package/dist/components/bcm-dropdown.d.ts +11 -0
- package/dist/components/bcm-dropdown.js +306 -0
- package/dist/components/bcm-empty.d.ts +11 -0
- package/dist/components/bcm-empty.js +10 -0
- package/dist/components/bcm-error-layout.d.ts +11 -0
- package/dist/components/bcm-error-layout.js +98 -0
- package/dist/components/bcm-expansion-panel.d.ts +11 -0
- package/dist/components/bcm-expansion-panel.js +159 -0
- package/dist/components/bcm-form-2.d.ts +11 -0
- package/dist/components/bcm-form-2.js +226 -0
- package/dist/components/bcm-form-group.d.ts +11 -0
- package/dist/components/bcm-form-group.js +65 -0
- package/dist/components/bcm-form.d.ts +11 -0
- package/dist/components/bcm-form.js +510 -0
- package/dist/components/bcm-icon.d.ts +11 -0
- package/dist/components/bcm-icon.js +10 -0
- package/dist/components/bcm-input.d.ts +11 -0
- package/dist/components/bcm-input.js +404 -0
- package/dist/components/bcm-item.d.ts +11 -0
- package/dist/components/bcm-item.js +98 -0
- package/dist/components/bcm-items.d.ts +11 -0
- package/dist/components/bcm-items.js +74 -0
- package/dist/components/bcm-label.d.ts +11 -0
- package/dist/components/bcm-label.js +10 -0
- package/dist/components/bcm-link.d.ts +11 -0
- package/dist/components/bcm-link.js +10 -0
- package/dist/components/bcm-linked.d.ts +11 -0
- package/dist/components/bcm-linked.js +201 -0
- package/dist/components/bcm-list.d.ts +11 -0
- package/dist/components/bcm-list.js +1859 -0
- package/dist/components/bcm-listbox-group.d.ts +11 -0
- package/dist/components/bcm-listbox-group.js +10 -0
- package/dist/components/bcm-listbox-item.d.ts +11 -0
- package/dist/components/bcm-listbox-item.js +10 -0
- package/dist/components/bcm-listbox.d.ts +11 -0
- package/dist/components/bcm-listbox.js +10 -0
- package/dist/components/bcm-menu.d.ts +11 -0
- package/dist/components/bcm-menu.js +10 -0
- package/dist/components/bcm-message.d.ts +11 -0
- package/dist/components/bcm-message.js +126 -0
- package/dist/components/bcm-modal.d.ts +11 -0
- package/dist/components/bcm-modal.js +166 -0
- package/dist/components/bcm-notification.d.ts +11 -0
- package/dist/components/bcm-notification.js +136 -0
- package/dist/components/bcm-old-input.d.ts +11 -0
- package/dist/components/bcm-old-input.js +10 -0
- package/dist/components/bcm-old-search.d.ts +11 -0
- package/dist/components/bcm-old-search.js +10 -0
- package/dist/components/bcm-old-tag.d.ts +11 -0
- package/dist/components/bcm-old-tag.js +10 -0
- package/dist/components/bcm-popconfirm-box.d.ts +11 -0
- package/dist/components/bcm-popconfirm-box.js +10 -0
- package/dist/components/bcm-popconfirm.d.ts +11 -0
- package/dist/components/bcm-popconfirm.js +160 -0
- package/dist/components/bcm-popover.d.ts +11 -0
- package/dist/components/bcm-popover.js +203 -0
- package/dist/components/bcm-progress.d.ts +11 -0
- package/dist/components/bcm-progress.js +205 -0
- package/dist/components/bcm-radio-group.d.ts +11 -0
- package/dist/components/bcm-radio-group.js +334 -0
- package/dist/components/bcm-radio.d.ts +11 -0
- package/dist/components/bcm-radio.js +10 -0
- package/dist/components/bcm-range.d.ts +11 -0
- package/dist/components/bcm-range.js +220 -0
- package/dist/components/bcm-result.d.ts +11 -0
- package/dist/components/bcm-result.js +105 -0
- package/dist/components/bcm-search.d.ts +11 -0
- package/dist/components/bcm-search.js +10 -0
- package/dist/components/bcm-select-box.d.ts +11 -0
- package/dist/components/bcm-select-box.js +10 -0
- package/dist/components/bcm-select-group.d.ts +11 -0
- package/dist/components/bcm-select-group.js +48 -0
- package/dist/components/bcm-select-option.d.ts +11 -0
- package/dist/components/bcm-select-option.js +57 -0
- package/dist/components/bcm-select.d.ts +11 -0
- package/dist/components/bcm-select.js +1385 -0
- package/dist/components/bcm-skeleton.d.ts +11 -0
- package/dist/components/bcm-skeleton.js +10 -0
- package/dist/components/bcm-step.d.ts +11 -0
- package/dist/components/bcm-step.js +10 -0
- package/dist/components/bcm-stepper.d.ts +11 -0
- package/dist/components/bcm-stepper.js +249 -0
- package/dist/components/bcm-switch.d.ts +11 -0
- package/dist/components/bcm-switch.js +201 -0
- package/dist/components/bcm-tab-group.d.ts +11 -0
- package/dist/components/bcm-tab-group.js +190 -0
- package/dist/components/bcm-tab-pane.d.ts +11 -0
- package/dist/components/bcm-tab-pane.js +89 -0
- package/dist/components/bcm-tab.d.ts +11 -0
- package/dist/components/bcm-tab.js +125 -0
- package/dist/components/bcm-table.d.ts +11 -0
- package/dist/components/bcm-table.js +93 -0
- package/dist/components/bcm-tabs-content.d.ts +11 -0
- package/dist/components/bcm-tabs-content.js +80 -0
- package/dist/components/bcm-tabs.d.ts +11 -0
- package/dist/components/bcm-tabs.js +430 -0
- package/dist/components/bcm-tag.d.ts +11 -0
- package/dist/components/bcm-tag.js +132 -0
- package/dist/components/bcm-text.d.ts +11 -0
- package/dist/components/bcm-text.js +10 -0
- package/dist/components/bcm-textarea.d.ts +11 -0
- package/dist/components/bcm-textarea.js +212 -0
- package/dist/components/bcm-time-picker.d.ts +11 -0
- package/dist/components/bcm-time-picker.js +209 -0
- package/dist/components/bcm-timeline-item.d.ts +11 -0
- package/dist/components/bcm-timeline-item.js +81 -0
- package/dist/components/bcm-timeline.d.ts +11 -0
- package/dist/components/bcm-timeline.js +91 -0
- package/dist/components/bcm-tooltip.d.ts +11 -0
- package/dist/components/bcm-tooltip.js +10 -0
- package/dist/components/bcm-treeview-group.d.ts +11 -0
- package/dist/components/bcm-treeview-group.js +37 -0
- package/dist/components/bcm-treeview-item.d.ts +11 -0
- package/dist/components/bcm-treeview-item.js +10 -0
- package/dist/components/bcm-treeview.d.ts +11 -0
- package/dist/components/bcm-treeview.js +10 -0
- package/dist/components/bcm-typography.d.ts +11 -0
- package/dist/components/bcm-typography.js +10 -0
- package/dist/components/bcm.js +446 -0
- package/dist/components/button.js +403 -0
- package/dist/components/caption-template.js +32 -0
- package/dist/components/checkbox-lite.js +97 -0
- package/dist/components/checkbox.js +231 -0
- package/dist/components/color-helper.js +488 -0
- package/dist/components/colors.js +222 -0
- package/dist/components/datetime-picker.js +1509 -0
- package/dist/components/divider.js +59 -0
- package/dist/components/element-dragger.js +277 -0
- package/dist/components/empty.js +53 -0
- package/dist/components/floating-ui.js +1453 -0
- package/dist/components/generate.js +202 -0
- package/dist/components/icon.js +53 -0
- package/dist/components/index.d.ts +105 -0
- package/dist/components/index.js +99 -0
- package/dist/components/index2.js +62 -0
- package/dist/components/index3.js +191 -0
- package/dist/components/input-template.js +97 -0
- package/dist/components/is-load-decorator.js +54 -0
- package/dist/components/json-parse-decarator.js +38 -0
- package/dist/components/label-template.js +21 -0
- package/dist/components/label.js +83 -0
- package/dist/components/link.js +84 -0
- package/dist/components/listbox-group.js +55 -0
- package/dist/components/listbox-item.js +217 -0
- package/dist/components/listbox.js +1116 -0
- package/dist/components/menu.js +274 -0
- package/dist/{esm/number-helper-75d21178.js → components/number-helper.js} +1 -1
- package/dist/components/old-bcm-popover-box.d.ts +11 -0
- package/dist/components/old-bcm-popover-box.js +10 -0
- package/dist/components/old-bcm-popover.d.ts +11 -0
- package/dist/components/old-bcm-popover.js +132 -0
- package/dist/components/old-input.js +470 -0
- package/dist/components/old-popover-box.js +184 -0
- package/dist/components/old-search.js +235 -0
- package/dist/components/old-tag.js +153 -0
- package/dist/components/popconfirm-box.js +160 -0
- package/dist/components/popover-placement.js +95 -0
- package/dist/components/property-decorators.js +31 -0
- package/dist/components/radio.js +119 -0
- package/dist/components/search.js +286 -0
- package/dist/components/select-box.js +165 -0
- package/dist/components/skeleton.js +69 -0
- package/dist/components/slot-template.js +13 -0
- package/dist/components/step.js +188 -0
- package/dist/components/string-helper.js +132 -0
- package/dist/components/text.js +72 -0
- package/dist/components/tooltip-helper.js +101 -0
- package/dist/components/tooltip.js +96 -0
- package/dist/components/treeview-item.js +419 -0
- package/dist/components/treeview.js +956 -0
- package/dist/components/types.js +32 -0
- package/dist/components/types2.js +32 -0
- package/dist/components/typography.js +45 -0
- package/dist/components/utils.js +123 -0
- package/dist/components/validators.js +35 -0
- package/dist/esm/bcm-accordion.entry.js +1 -1
- package/dist/esm/bcm-alert.entry.js +1 -1
- package/dist/esm/bcm-attendance.entry.js +2 -2
- package/dist/esm/bcm-avatar_2.entry.js +3 -3
- package/dist/esm/bcm-breadcrumb.entry.js +1 -1
- package/dist/esm/bcm-button-group.entry.js +1 -1
- package/dist/esm/bcm-button_4.entry.js +1 -1
- package/dist/esm/bcm-card.entry.js +1 -1
- package/dist/esm/bcm-checkbox-group.entry.js +1 -1
- package/dist/esm/bcm-checkbox-lite_9.entry.js +1 -1
- package/dist/esm/bcm-checkbox_2.entry.js +1 -1
- package/dist/esm/bcm-chip.entry.js +1 -1
- package/dist/esm/bcm-collapse.entry.js +1 -1
- package/dist/esm/bcm-date-picker.entry.js +1 -1
- package/dist/esm/bcm-datetime-picker.entry.js +1 -1
- package/dist/esm/bcm-default.entry.js +1 -1
- package/dist/esm/bcm-drawer.entry.js +3 -3
- package/dist/esm/bcm-dropdown.entry.js +2 -2
- package/dist/esm/bcm-expansion-panel.entry.js +1 -1
- package/dist/esm/bcm-form-2.entry.js +1 -1
- package/dist/esm/bcm-input.entry.js +4 -4
- package/dist/esm/bcm-item.entry.js +1 -1
- package/dist/esm/bcm-items.entry.js +1 -1
- package/dist/esm/bcm-label_2.entry.js +4 -4
- package/dist/esm/bcm-linked.entry.js +3 -3
- package/dist/esm/bcm-list.entry.js +5 -5
- package/dist/esm/bcm-menu.entry.js +5 -5
- package/dist/esm/bcm-popconfirm-box.entry.js +1 -1
- package/dist/esm/bcm-popconfirm.entry.js +1 -1
- package/dist/esm/bcm-popover.entry.js +3 -3
- package/dist/esm/bcm-progress.entry.js +1 -1
- package/dist/esm/bcm-radio-group.entry.js +1 -1
- package/dist/esm/bcm-radio.entry.js +1 -1
- package/dist/esm/bcm-range.entry.js +1 -1
- package/dist/esm/bcm-search.entry.js +3 -3
- package/dist/esm/bcm-skeleton.entry.js +1 -1
- package/dist/esm/bcm-step.entry.js +2 -2
- package/dist/esm/bcm-stepper.entry.js +3 -3
- package/dist/esm/bcm-switch.entry.js +1 -1
- package/dist/esm/bcm-tab-group.entry.js +1 -1
- package/dist/esm/bcm-tag.entry.js +2 -2
- package/dist/esm/bcm-textarea.entry.js +2 -2
- package/dist/esm/bcm-time-picker.entry.js +1 -1
- package/dist/esm/{generate-d57a5f95.js → generate-d766aaed.js} +1 -1
- package/dist/esm/{input-template-2044f4f6.js → input-template-c1019025.js} +1 -1
- package/dist/esm/{json-parse-decarator-50541a21.js → json-parse-decarator-31a154cf.js} +1 -1
- package/dist/esm/number-helper-02ea488e.js +18 -0
- package/dist/esm/old-bcm-popover-box.entry.js +2 -2
- package/dist/esm/old-bcm-popover.entry.js +1 -1
- package/dist/esm/{stepper-states-9f66e2b4.js → stepper-states-b515fe3a.js} +1 -1
- package/dist/esm/{tooltip-helper-bed79484.js → tooltip-helper-7bb60a6c.js} +3 -3
- package/dist/esm/{validators-6af629b4.js → validators-6d1beb42.js} +1 -1
- package/package.json +4 -3
- package/dist/bromcom-ui/p-034cd518.js +0 -5
- package/dist/bromcom-ui/p-1672aa8b.js +0 -5
- package/dist/bromcom-ui/p-2b27570e.entry.js +0 -5
- package/dist/bromcom-ui/p-ea9c10c3.js +0 -5
|
@@ -0,0 +1,1453 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Built with Stencil
|
|
3
|
+
* Copyright (c) Bromcom.
|
|
4
|
+
*/
|
|
5
|
+
import { a as Bcm } from './bcm.js';
|
|
6
|
+
|
|
7
|
+
function getSide(placement) {
|
|
8
|
+
return placement.split('-')[0];
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function getAlignment(placement) {
|
|
12
|
+
return placement.split('-')[1];
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function getMainAxisFromPlacement(placement) {
|
|
16
|
+
return ['top', 'bottom'].includes(getSide(placement)) ? 'x' : 'y';
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function getLengthFromAxis(axis) {
|
|
20
|
+
return axis === 'y' ? 'height' : 'width';
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function computeCoordsFromPlacement(_ref, placement, rtl) {
|
|
24
|
+
let {
|
|
25
|
+
reference,
|
|
26
|
+
floating
|
|
27
|
+
} = _ref;
|
|
28
|
+
const commonX = reference.x + reference.width / 2 - floating.width / 2;
|
|
29
|
+
const commonY = reference.y + reference.height / 2 - floating.height / 2;
|
|
30
|
+
const mainAxis = getMainAxisFromPlacement(placement);
|
|
31
|
+
const length = getLengthFromAxis(mainAxis);
|
|
32
|
+
const commonAlign = reference[length] / 2 - floating[length] / 2;
|
|
33
|
+
const side = getSide(placement);
|
|
34
|
+
const isVertical = mainAxis === 'x';
|
|
35
|
+
let coords;
|
|
36
|
+
|
|
37
|
+
switch (side) {
|
|
38
|
+
case 'top':
|
|
39
|
+
coords = {
|
|
40
|
+
x: commonX,
|
|
41
|
+
y: reference.y - floating.height
|
|
42
|
+
};
|
|
43
|
+
break;
|
|
44
|
+
|
|
45
|
+
case 'bottom':
|
|
46
|
+
coords = {
|
|
47
|
+
x: commonX,
|
|
48
|
+
y: reference.y + reference.height
|
|
49
|
+
};
|
|
50
|
+
break;
|
|
51
|
+
|
|
52
|
+
case 'right':
|
|
53
|
+
coords = {
|
|
54
|
+
x: reference.x + reference.width,
|
|
55
|
+
y: commonY
|
|
56
|
+
};
|
|
57
|
+
break;
|
|
58
|
+
|
|
59
|
+
case 'left':
|
|
60
|
+
coords = {
|
|
61
|
+
x: reference.x - floating.width,
|
|
62
|
+
y: commonY
|
|
63
|
+
};
|
|
64
|
+
break;
|
|
65
|
+
|
|
66
|
+
default:
|
|
67
|
+
coords = {
|
|
68
|
+
x: reference.x,
|
|
69
|
+
y: reference.y
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
switch (getAlignment(placement)) {
|
|
74
|
+
case 'start':
|
|
75
|
+
coords[mainAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);
|
|
76
|
+
break;
|
|
77
|
+
|
|
78
|
+
case 'end':
|
|
79
|
+
coords[mainAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
|
|
80
|
+
break;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
return coords;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Computes the `x` and `y` coordinates that will place the floating element
|
|
88
|
+
* next to a reference element when it is given a certain positioning strategy.
|
|
89
|
+
*
|
|
90
|
+
* This export does not have any `platform` interface logic. You will need to
|
|
91
|
+
* write one for the platform you are using Floating UI with.
|
|
92
|
+
*/
|
|
93
|
+
|
|
94
|
+
const computePosition$1 = async (reference, floating, config) => {
|
|
95
|
+
const {
|
|
96
|
+
placement = 'bottom',
|
|
97
|
+
strategy = 'absolute',
|
|
98
|
+
middleware = [],
|
|
99
|
+
platform
|
|
100
|
+
} = config;
|
|
101
|
+
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));
|
|
102
|
+
|
|
103
|
+
let rects = await platform.getElementRects({
|
|
104
|
+
reference,
|
|
105
|
+
floating,
|
|
106
|
+
strategy
|
|
107
|
+
});
|
|
108
|
+
let {
|
|
109
|
+
x,
|
|
110
|
+
y
|
|
111
|
+
} = computeCoordsFromPlacement(rects, placement, rtl);
|
|
112
|
+
let statefulPlacement = placement;
|
|
113
|
+
let middlewareData = {};
|
|
114
|
+
let resetCount = 0;
|
|
115
|
+
|
|
116
|
+
for (let i = 0; i < middleware.length; i++) {
|
|
117
|
+
const {
|
|
118
|
+
name,
|
|
119
|
+
fn
|
|
120
|
+
} = middleware[i];
|
|
121
|
+
const {
|
|
122
|
+
x: nextX,
|
|
123
|
+
y: nextY,
|
|
124
|
+
data,
|
|
125
|
+
reset
|
|
126
|
+
} = await fn({
|
|
127
|
+
x,
|
|
128
|
+
y,
|
|
129
|
+
initialPlacement: placement,
|
|
130
|
+
placement: statefulPlacement,
|
|
131
|
+
strategy,
|
|
132
|
+
middlewareData,
|
|
133
|
+
rects,
|
|
134
|
+
platform,
|
|
135
|
+
elements: {
|
|
136
|
+
reference,
|
|
137
|
+
floating
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
x = nextX != null ? nextX : x;
|
|
141
|
+
y = nextY != null ? nextY : y;
|
|
142
|
+
middlewareData = { ...middlewareData,
|
|
143
|
+
[name]: { ...middlewareData[name],
|
|
144
|
+
...data
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
if (reset && resetCount <= 50) {
|
|
149
|
+
resetCount++;
|
|
150
|
+
|
|
151
|
+
if (typeof reset === 'object') {
|
|
152
|
+
if (reset.placement) {
|
|
153
|
+
statefulPlacement = reset.placement;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
if (reset.rects) {
|
|
157
|
+
rects = reset.rects === true ? await platform.getElementRects({
|
|
158
|
+
reference,
|
|
159
|
+
floating,
|
|
160
|
+
strategy
|
|
161
|
+
}) : reset.rects;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
({
|
|
165
|
+
x,
|
|
166
|
+
y
|
|
167
|
+
} = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
i = -1;
|
|
171
|
+
continue;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
return {
|
|
176
|
+
x,
|
|
177
|
+
y,
|
|
178
|
+
placement: statefulPlacement,
|
|
179
|
+
strategy,
|
|
180
|
+
middlewareData
|
|
181
|
+
};
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
function expandPaddingObject(padding) {
|
|
185
|
+
return {
|
|
186
|
+
top: 0,
|
|
187
|
+
right: 0,
|
|
188
|
+
bottom: 0,
|
|
189
|
+
left: 0,
|
|
190
|
+
...padding
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
function getSideObjectFromPadding(padding) {
|
|
195
|
+
return typeof padding !== 'number' ? expandPaddingObject(padding) : {
|
|
196
|
+
top: padding,
|
|
197
|
+
right: padding,
|
|
198
|
+
bottom: padding,
|
|
199
|
+
left: padding
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
function rectToClientRect(rect) {
|
|
204
|
+
return { ...rect,
|
|
205
|
+
top: rect.y,
|
|
206
|
+
left: rect.x,
|
|
207
|
+
right: rect.x + rect.width,
|
|
208
|
+
bottom: rect.y + rect.height
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* Resolves with an object of overflow side offsets that determine how much the
|
|
214
|
+
* element is overflowing a given clipping boundary.
|
|
215
|
+
* - positive = overflowing the boundary by that number of pixels
|
|
216
|
+
* - negative = how many pixels left before it will overflow
|
|
217
|
+
* - 0 = lies flush with the boundary
|
|
218
|
+
* @see https://floating-ui.com/docs/detectOverflow
|
|
219
|
+
*/
|
|
220
|
+
async function detectOverflow(middlewareArguments, options) {
|
|
221
|
+
var _await$platform$isEle;
|
|
222
|
+
|
|
223
|
+
if (options === void 0) {
|
|
224
|
+
options = {};
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
const {
|
|
228
|
+
x,
|
|
229
|
+
y,
|
|
230
|
+
platform,
|
|
231
|
+
rects,
|
|
232
|
+
elements,
|
|
233
|
+
strategy
|
|
234
|
+
} = middlewareArguments;
|
|
235
|
+
const {
|
|
236
|
+
boundary = 'clippingAncestors',
|
|
237
|
+
rootBoundary = 'viewport',
|
|
238
|
+
elementContext = 'floating',
|
|
239
|
+
altBoundary = false,
|
|
240
|
+
padding = 0
|
|
241
|
+
} = options;
|
|
242
|
+
const paddingObject = getSideObjectFromPadding(padding);
|
|
243
|
+
const altContext = elementContext === 'floating' ? 'reference' : 'floating';
|
|
244
|
+
const element = elements[altBoundary ? altContext : elementContext];
|
|
245
|
+
const clippingClientRect = rectToClientRect(await platform.getClippingRect({
|
|
246
|
+
element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))),
|
|
247
|
+
boundary,
|
|
248
|
+
rootBoundary,
|
|
249
|
+
strategy
|
|
250
|
+
}));
|
|
251
|
+
const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
252
|
+
rect: elementContext === 'floating' ? { ...rects.floating,
|
|
253
|
+
x,
|
|
254
|
+
y
|
|
255
|
+
} : rects.reference,
|
|
256
|
+
offsetParent: await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating)),
|
|
257
|
+
strategy
|
|
258
|
+
}) : rects[elementContext]);
|
|
259
|
+
return {
|
|
260
|
+
top: clippingClientRect.top - elementClientRect.top + paddingObject.top,
|
|
261
|
+
bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,
|
|
262
|
+
left: clippingClientRect.left - elementClientRect.left + paddingObject.left,
|
|
263
|
+
right: elementClientRect.right - clippingClientRect.right + paddingObject.right
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
const min$1 = Math.min;
|
|
268
|
+
const max$1 = Math.max;
|
|
269
|
+
|
|
270
|
+
function within(min$1$1, value, max$1$1) {
|
|
271
|
+
return max$1(min$1$1, min$1(value, max$1$1));
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
/**
|
|
275
|
+
* Positions an inner element of the floating element such that it is centered
|
|
276
|
+
* to the reference element.
|
|
277
|
+
* @see https://floating-ui.com/docs/arrow
|
|
278
|
+
*/
|
|
279
|
+
const arrow = options => ({
|
|
280
|
+
name: 'arrow',
|
|
281
|
+
options,
|
|
282
|
+
|
|
283
|
+
async fn(middlewareArguments) {
|
|
284
|
+
// Since `element` is required, we don't Partial<> the type
|
|
285
|
+
const {
|
|
286
|
+
element,
|
|
287
|
+
padding = 0
|
|
288
|
+
} = options != null ? options : {};
|
|
289
|
+
const {
|
|
290
|
+
x,
|
|
291
|
+
y,
|
|
292
|
+
placement,
|
|
293
|
+
rects,
|
|
294
|
+
platform
|
|
295
|
+
} = middlewareArguments;
|
|
296
|
+
|
|
297
|
+
if (element == null) {
|
|
298
|
+
|
|
299
|
+
return {};
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
const paddingObject = getSideObjectFromPadding(padding);
|
|
303
|
+
const coords = {
|
|
304
|
+
x,
|
|
305
|
+
y
|
|
306
|
+
};
|
|
307
|
+
const axis = getMainAxisFromPlacement(placement);
|
|
308
|
+
const alignment = getAlignment(placement);
|
|
309
|
+
const length = getLengthFromAxis(axis);
|
|
310
|
+
const arrowDimensions = await platform.getDimensions(element);
|
|
311
|
+
const minProp = axis === 'y' ? 'top' : 'left';
|
|
312
|
+
const maxProp = axis === 'y' ? 'bottom' : 'right';
|
|
313
|
+
const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];
|
|
314
|
+
const startDiff = coords[axis] - rects.reference[axis];
|
|
315
|
+
const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element));
|
|
316
|
+
let clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;
|
|
317
|
+
|
|
318
|
+
if (clientSize === 0) {
|
|
319
|
+
clientSize = rects.floating[length];
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
const centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the floating element if the center
|
|
323
|
+
// point is outside the floating element's bounds
|
|
324
|
+
|
|
325
|
+
const min = paddingObject[minProp];
|
|
326
|
+
const max = clientSize - arrowDimensions[length] - paddingObject[maxProp];
|
|
327
|
+
const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
|
|
328
|
+
const offset = within(min, center, max); // Make sure that arrow points at the reference
|
|
329
|
+
|
|
330
|
+
const alignmentPadding = alignment === 'start' ? paddingObject[minProp] : paddingObject[maxProp];
|
|
331
|
+
const shouldAddOffset = alignmentPadding > 0 && center !== offset && rects.reference[length] <= rects.floating[length];
|
|
332
|
+
const alignmentOffset = shouldAddOffset ? center < min ? min - center : max - center : 0;
|
|
333
|
+
return {
|
|
334
|
+
[axis]: coords[axis] - alignmentOffset,
|
|
335
|
+
data: {
|
|
336
|
+
[axis]: offset,
|
|
337
|
+
centerOffset: center - offset
|
|
338
|
+
}
|
|
339
|
+
};
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
});
|
|
343
|
+
|
|
344
|
+
const hash$1 = {
|
|
345
|
+
left: 'right',
|
|
346
|
+
right: 'left',
|
|
347
|
+
bottom: 'top',
|
|
348
|
+
top: 'bottom'
|
|
349
|
+
};
|
|
350
|
+
function getOppositePlacement(placement) {
|
|
351
|
+
return placement.replace(/left|right|bottom|top/g, matched => hash$1[matched]);
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
function getAlignmentSides(placement, rects, rtl) {
|
|
355
|
+
if (rtl === void 0) {
|
|
356
|
+
rtl = false;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
const alignment = getAlignment(placement);
|
|
360
|
+
const mainAxis = getMainAxisFromPlacement(placement);
|
|
361
|
+
const length = getLengthFromAxis(mainAxis);
|
|
362
|
+
let mainAlignmentSide = mainAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';
|
|
363
|
+
|
|
364
|
+
if (rects.reference[length] > rects.floating[length]) {
|
|
365
|
+
mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
return {
|
|
369
|
+
main: mainAlignmentSide,
|
|
370
|
+
cross: getOppositePlacement(mainAlignmentSide)
|
|
371
|
+
};
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
const hash = {
|
|
375
|
+
start: 'end',
|
|
376
|
+
end: 'start'
|
|
377
|
+
};
|
|
378
|
+
function getOppositeAlignmentPlacement(placement) {
|
|
379
|
+
return placement.replace(/start|end/g, matched => hash[matched]);
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
const sides = ['top', 'right', 'bottom', 'left'];
|
|
383
|
+
|
|
384
|
+
function getExpandedPlacements(placement) {
|
|
385
|
+
const oppositePlacement = getOppositePlacement(placement);
|
|
386
|
+
return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
/**
|
|
390
|
+
* Changes the placement of the floating element to one that will fit if the
|
|
391
|
+
* initially specified `placement` does not.
|
|
392
|
+
* @see https://floating-ui.com/docs/flip
|
|
393
|
+
*/
|
|
394
|
+
const flip = function (options) {
|
|
395
|
+
if (options === void 0) {
|
|
396
|
+
options = {};
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
return {
|
|
400
|
+
name: 'flip',
|
|
401
|
+
options,
|
|
402
|
+
|
|
403
|
+
async fn(middlewareArguments) {
|
|
404
|
+
var _middlewareData$flip;
|
|
405
|
+
|
|
406
|
+
const {
|
|
407
|
+
placement,
|
|
408
|
+
middlewareData,
|
|
409
|
+
rects,
|
|
410
|
+
initialPlacement,
|
|
411
|
+
platform,
|
|
412
|
+
elements
|
|
413
|
+
} = middlewareArguments;
|
|
414
|
+
const {
|
|
415
|
+
mainAxis: checkMainAxis = true,
|
|
416
|
+
crossAxis: checkCrossAxis = true,
|
|
417
|
+
fallbackPlacements: specifiedFallbackPlacements,
|
|
418
|
+
fallbackStrategy = 'bestFit',
|
|
419
|
+
flipAlignment = true,
|
|
420
|
+
...detectOverflowOptions
|
|
421
|
+
} = options;
|
|
422
|
+
const side = getSide(placement);
|
|
423
|
+
const isBasePlacement = side === initialPlacement;
|
|
424
|
+
const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
|
|
425
|
+
const placements = [initialPlacement, ...fallbackPlacements];
|
|
426
|
+
const overflow = await detectOverflow(middlewareArguments, detectOverflowOptions);
|
|
427
|
+
const overflows = [];
|
|
428
|
+
let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
|
|
429
|
+
|
|
430
|
+
if (checkMainAxis) {
|
|
431
|
+
overflows.push(overflow[side]);
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
if (checkCrossAxis) {
|
|
435
|
+
const {
|
|
436
|
+
main,
|
|
437
|
+
cross
|
|
438
|
+
} = getAlignmentSides(placement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)));
|
|
439
|
+
overflows.push(overflow[main], overflow[cross]);
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
overflowsData = [...overflowsData, {
|
|
443
|
+
placement,
|
|
444
|
+
overflows
|
|
445
|
+
}]; // One or more sides is overflowing
|
|
446
|
+
|
|
447
|
+
if (!overflows.every(side => side <= 0)) {
|
|
448
|
+
var _middlewareData$flip$, _middlewareData$flip2;
|
|
449
|
+
|
|
450
|
+
const nextIndex = ((_middlewareData$flip$ = (_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) != null ? _middlewareData$flip$ : 0) + 1;
|
|
451
|
+
const nextPlacement = placements[nextIndex];
|
|
452
|
+
|
|
453
|
+
if (nextPlacement) {
|
|
454
|
+
// Try next placement and re-run the lifecycle
|
|
455
|
+
return {
|
|
456
|
+
data: {
|
|
457
|
+
index: nextIndex,
|
|
458
|
+
overflows: overflowsData
|
|
459
|
+
},
|
|
460
|
+
reset: {
|
|
461
|
+
placement: nextPlacement
|
|
462
|
+
}
|
|
463
|
+
};
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
let resetPlacement = 'bottom';
|
|
467
|
+
|
|
468
|
+
switch (fallbackStrategy) {
|
|
469
|
+
case 'bestFit':
|
|
470
|
+
{
|
|
471
|
+
var _overflowsData$map$so;
|
|
472
|
+
|
|
473
|
+
const placement = (_overflowsData$map$so = overflowsData.map(d => [d, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$map$so[0].placement;
|
|
474
|
+
|
|
475
|
+
if (placement) {
|
|
476
|
+
resetPlacement = placement;
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
break;
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
case 'initialPlacement':
|
|
483
|
+
resetPlacement = initialPlacement;
|
|
484
|
+
break;
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
if (placement !== resetPlacement) {
|
|
488
|
+
return {
|
|
489
|
+
reset: {
|
|
490
|
+
placement: resetPlacement
|
|
491
|
+
}
|
|
492
|
+
};
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
return {};
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
};
|
|
500
|
+
};
|
|
501
|
+
|
|
502
|
+
function getSideOffsets(overflow, rect) {
|
|
503
|
+
return {
|
|
504
|
+
top: overflow.top - rect.height,
|
|
505
|
+
right: overflow.right - rect.width,
|
|
506
|
+
bottom: overflow.bottom - rect.height,
|
|
507
|
+
left: overflow.left - rect.width
|
|
508
|
+
};
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
function isAnySideFullyClipped(overflow) {
|
|
512
|
+
return sides.some(side => overflow[side] >= 0);
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
/**
|
|
516
|
+
* Provides data to hide the floating element in applicable situations, such as
|
|
517
|
+
* when it is not in the same clipping context as the reference element.
|
|
518
|
+
* @see https://floating-ui.com/docs/hide
|
|
519
|
+
*/
|
|
520
|
+
const hide = function (_temp) {
|
|
521
|
+
let {
|
|
522
|
+
strategy = 'referenceHidden',
|
|
523
|
+
...detectOverflowOptions
|
|
524
|
+
} = _temp === void 0 ? {} : _temp;
|
|
525
|
+
return {
|
|
526
|
+
name: 'hide',
|
|
527
|
+
|
|
528
|
+
async fn(middlewareArguments) {
|
|
529
|
+
const {
|
|
530
|
+
rects
|
|
531
|
+
} = middlewareArguments;
|
|
532
|
+
|
|
533
|
+
switch (strategy) {
|
|
534
|
+
case 'referenceHidden':
|
|
535
|
+
{
|
|
536
|
+
const overflow = await detectOverflow(middlewareArguments, { ...detectOverflowOptions,
|
|
537
|
+
elementContext: 'reference'
|
|
538
|
+
});
|
|
539
|
+
const offsets = getSideOffsets(overflow, rects.reference);
|
|
540
|
+
return {
|
|
541
|
+
data: {
|
|
542
|
+
referenceHiddenOffsets: offsets,
|
|
543
|
+
referenceHidden: isAnySideFullyClipped(offsets)
|
|
544
|
+
}
|
|
545
|
+
};
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
case 'escaped':
|
|
549
|
+
{
|
|
550
|
+
const overflow = await detectOverflow(middlewareArguments, { ...detectOverflowOptions,
|
|
551
|
+
altBoundary: true
|
|
552
|
+
});
|
|
553
|
+
const offsets = getSideOffsets(overflow, rects.floating);
|
|
554
|
+
return {
|
|
555
|
+
data: {
|
|
556
|
+
escapedOffsets: offsets,
|
|
557
|
+
escaped: isAnySideFullyClipped(offsets)
|
|
558
|
+
}
|
|
559
|
+
};
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
default:
|
|
563
|
+
{
|
|
564
|
+
return {};
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
};
|
|
570
|
+
};
|
|
571
|
+
|
|
572
|
+
async function convertValueToCoords(middlewareArguments, value) {
|
|
573
|
+
const {
|
|
574
|
+
placement,
|
|
575
|
+
platform,
|
|
576
|
+
elements
|
|
577
|
+
} = middlewareArguments;
|
|
578
|
+
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
|
|
579
|
+
const side = getSide(placement);
|
|
580
|
+
const alignment = getAlignment(placement);
|
|
581
|
+
const isVertical = getMainAxisFromPlacement(placement) === 'x';
|
|
582
|
+
const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1;
|
|
583
|
+
const crossAxisMulti = rtl && isVertical ? -1 : 1;
|
|
584
|
+
const rawValue = typeof value === 'function' ? value(middlewareArguments) : value; // eslint-disable-next-line prefer-const
|
|
585
|
+
|
|
586
|
+
let {
|
|
587
|
+
mainAxis,
|
|
588
|
+
crossAxis,
|
|
589
|
+
alignmentAxis
|
|
590
|
+
} = typeof rawValue === 'number' ? {
|
|
591
|
+
mainAxis: rawValue,
|
|
592
|
+
crossAxis: 0,
|
|
593
|
+
alignmentAxis: null
|
|
594
|
+
} : {
|
|
595
|
+
mainAxis: 0,
|
|
596
|
+
crossAxis: 0,
|
|
597
|
+
alignmentAxis: null,
|
|
598
|
+
...rawValue
|
|
599
|
+
};
|
|
600
|
+
|
|
601
|
+
if (alignment && typeof alignmentAxis === 'number') {
|
|
602
|
+
crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
return isVertical ? {
|
|
606
|
+
x: crossAxis * crossAxisMulti,
|
|
607
|
+
y: mainAxis * mainAxisMulti
|
|
608
|
+
} : {
|
|
609
|
+
x: mainAxis * mainAxisMulti,
|
|
610
|
+
y: crossAxis * crossAxisMulti
|
|
611
|
+
};
|
|
612
|
+
}
|
|
613
|
+
/**
|
|
614
|
+
* Displaces the floating element from its reference element.
|
|
615
|
+
* @see https://floating-ui.com/docs/offset
|
|
616
|
+
*/
|
|
617
|
+
|
|
618
|
+
const offset = function (value) {
|
|
619
|
+
if (value === void 0) {
|
|
620
|
+
value = 0;
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
return {
|
|
624
|
+
name: 'offset',
|
|
625
|
+
options: value,
|
|
626
|
+
|
|
627
|
+
async fn(middlewareArguments) {
|
|
628
|
+
const {
|
|
629
|
+
x,
|
|
630
|
+
y
|
|
631
|
+
} = middlewareArguments;
|
|
632
|
+
const diffCoords = await convertValueToCoords(middlewareArguments, value);
|
|
633
|
+
return {
|
|
634
|
+
x: x + diffCoords.x,
|
|
635
|
+
y: y + diffCoords.y,
|
|
636
|
+
data: diffCoords
|
|
637
|
+
};
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
};
|
|
641
|
+
};
|
|
642
|
+
|
|
643
|
+
function getCrossAxis(axis) {
|
|
644
|
+
return axis === 'x' ? 'y' : 'x';
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
/**
|
|
648
|
+
* Shifts the floating element in order to keep it in view when it will overflow
|
|
649
|
+
* a clipping boundary.
|
|
650
|
+
* @see https://floating-ui.com/docs/shift
|
|
651
|
+
*/
|
|
652
|
+
const shift = function (options) {
|
|
653
|
+
if (options === void 0) {
|
|
654
|
+
options = {};
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
return {
|
|
658
|
+
name: 'shift',
|
|
659
|
+
options,
|
|
660
|
+
|
|
661
|
+
async fn(middlewareArguments) {
|
|
662
|
+
const {
|
|
663
|
+
x,
|
|
664
|
+
y,
|
|
665
|
+
placement
|
|
666
|
+
} = middlewareArguments;
|
|
667
|
+
const {
|
|
668
|
+
mainAxis: checkMainAxis = true,
|
|
669
|
+
crossAxis: checkCrossAxis = false,
|
|
670
|
+
limiter = {
|
|
671
|
+
fn: _ref => {
|
|
672
|
+
let {
|
|
673
|
+
x,
|
|
674
|
+
y
|
|
675
|
+
} = _ref;
|
|
676
|
+
return {
|
|
677
|
+
x,
|
|
678
|
+
y
|
|
679
|
+
};
|
|
680
|
+
}
|
|
681
|
+
},
|
|
682
|
+
...detectOverflowOptions
|
|
683
|
+
} = options;
|
|
684
|
+
const coords = {
|
|
685
|
+
x,
|
|
686
|
+
y
|
|
687
|
+
};
|
|
688
|
+
const overflow = await detectOverflow(middlewareArguments, detectOverflowOptions);
|
|
689
|
+
const mainAxis = getMainAxisFromPlacement(getSide(placement));
|
|
690
|
+
const crossAxis = getCrossAxis(mainAxis);
|
|
691
|
+
let mainAxisCoord = coords[mainAxis];
|
|
692
|
+
let crossAxisCoord = coords[crossAxis];
|
|
693
|
+
|
|
694
|
+
if (checkMainAxis) {
|
|
695
|
+
const minSide = mainAxis === 'y' ? 'top' : 'left';
|
|
696
|
+
const maxSide = mainAxis === 'y' ? 'bottom' : 'right';
|
|
697
|
+
const min = mainAxisCoord + overflow[minSide];
|
|
698
|
+
const max = mainAxisCoord - overflow[maxSide];
|
|
699
|
+
mainAxisCoord = within(min, mainAxisCoord, max);
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
if (checkCrossAxis) {
|
|
703
|
+
const minSide = crossAxis === 'y' ? 'top' : 'left';
|
|
704
|
+
const maxSide = crossAxis === 'y' ? 'bottom' : 'right';
|
|
705
|
+
const min = crossAxisCoord + overflow[minSide];
|
|
706
|
+
const max = crossAxisCoord - overflow[maxSide];
|
|
707
|
+
crossAxisCoord = within(min, crossAxisCoord, max);
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
const limitedCoords = limiter.fn({ ...middlewareArguments,
|
|
711
|
+
[mainAxis]: mainAxisCoord,
|
|
712
|
+
[crossAxis]: crossAxisCoord
|
|
713
|
+
});
|
|
714
|
+
return { ...limitedCoords,
|
|
715
|
+
data: {
|
|
716
|
+
x: limitedCoords.x - x,
|
|
717
|
+
y: limitedCoords.y - y
|
|
718
|
+
}
|
|
719
|
+
};
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
};
|
|
723
|
+
};
|
|
724
|
+
|
|
725
|
+
/**
|
|
726
|
+
* Provides data to change the size of the floating element. For instance,
|
|
727
|
+
* prevent it from overflowing its clipping boundary or match the width of the
|
|
728
|
+
* reference element.
|
|
729
|
+
* @see https://floating-ui.com/docs/size
|
|
730
|
+
*/
|
|
731
|
+
const size = function (options) {
|
|
732
|
+
if (options === void 0) {
|
|
733
|
+
options = {};
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
return {
|
|
737
|
+
name: 'size',
|
|
738
|
+
options,
|
|
739
|
+
|
|
740
|
+
async fn(middlewareArguments) {
|
|
741
|
+
const {
|
|
742
|
+
placement,
|
|
743
|
+
rects,
|
|
744
|
+
platform,
|
|
745
|
+
elements
|
|
746
|
+
} = middlewareArguments;
|
|
747
|
+
const {
|
|
748
|
+
apply = () => {},
|
|
749
|
+
...detectOverflowOptions
|
|
750
|
+
} = options;
|
|
751
|
+
const overflow = await detectOverflow(middlewareArguments, detectOverflowOptions);
|
|
752
|
+
const side = getSide(placement);
|
|
753
|
+
const alignment = getAlignment(placement);
|
|
754
|
+
let heightSide;
|
|
755
|
+
let widthSide;
|
|
756
|
+
|
|
757
|
+
if (side === 'top' || side === 'bottom') {
|
|
758
|
+
heightSide = side;
|
|
759
|
+
widthSide = alignment === ((await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))) ? 'start' : 'end') ? 'left' : 'right';
|
|
760
|
+
} else {
|
|
761
|
+
widthSide = side;
|
|
762
|
+
heightSide = alignment === 'end' ? 'top' : 'bottom';
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
const xMin = max$1(overflow.left, 0);
|
|
766
|
+
const xMax = max$1(overflow.right, 0);
|
|
767
|
+
const yMin = max$1(overflow.top, 0);
|
|
768
|
+
const yMax = max$1(overflow.bottom, 0);
|
|
769
|
+
const dimensions = {
|
|
770
|
+
availableHeight: rects.floating.height - (['left', 'right'].includes(placement) ? 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max$1(overflow.top, overflow.bottom)) : overflow[heightSide]),
|
|
771
|
+
availableWidth: rects.floating.width - (['top', 'bottom'].includes(placement) ? 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max$1(overflow.left, overflow.right)) : overflow[widthSide])
|
|
772
|
+
};
|
|
773
|
+
await apply({ ...middlewareArguments,
|
|
774
|
+
...dimensions
|
|
775
|
+
});
|
|
776
|
+
const nextDimensions = await platform.getDimensions(elements.floating);
|
|
777
|
+
|
|
778
|
+
if (rects.floating.width !== nextDimensions.width || rects.floating.height !== nextDimensions.height) {
|
|
779
|
+
return {
|
|
780
|
+
reset: {
|
|
781
|
+
rects: true
|
|
782
|
+
}
|
|
783
|
+
};
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
return {};
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
};
|
|
790
|
+
};
|
|
791
|
+
|
|
792
|
+
function isWindow(value) {
|
|
793
|
+
return value && value.document && value.location && value.alert && value.setInterval;
|
|
794
|
+
}
|
|
795
|
+
function getWindow(node) {
|
|
796
|
+
if (node == null) {
|
|
797
|
+
return window;
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
if (!isWindow(node)) {
|
|
801
|
+
const ownerDocument = node.ownerDocument;
|
|
802
|
+
return ownerDocument ? ownerDocument.defaultView || window : window;
|
|
803
|
+
}
|
|
804
|
+
|
|
805
|
+
return node;
|
|
806
|
+
}
|
|
807
|
+
|
|
808
|
+
function getComputedStyle(element) {
|
|
809
|
+
return getWindow(element).getComputedStyle(element);
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
function getNodeName(node) {
|
|
813
|
+
return isWindow(node) ? '' : node ? (node.nodeName || '').toLowerCase() : '';
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
function getUAString() {
|
|
817
|
+
const uaData = navigator.userAgentData;
|
|
818
|
+
|
|
819
|
+
if (uaData != null && uaData.brands) {
|
|
820
|
+
return uaData.brands.map(item => item.brand + "/" + item.version).join(' ');
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
return navigator.userAgent;
|
|
824
|
+
}
|
|
825
|
+
|
|
826
|
+
function isHTMLElement(value) {
|
|
827
|
+
return value instanceof getWindow(value).HTMLElement;
|
|
828
|
+
}
|
|
829
|
+
function isElement(value) {
|
|
830
|
+
return value instanceof getWindow(value).Element;
|
|
831
|
+
}
|
|
832
|
+
function isNode(value) {
|
|
833
|
+
return value instanceof getWindow(value).Node;
|
|
834
|
+
}
|
|
835
|
+
function isShadowRoot(node) {
|
|
836
|
+
// Browsers without `ShadowRoot` support
|
|
837
|
+
if (typeof ShadowRoot === 'undefined') {
|
|
838
|
+
return false;
|
|
839
|
+
}
|
|
840
|
+
|
|
841
|
+
const OwnElement = getWindow(node).ShadowRoot;
|
|
842
|
+
return node instanceof OwnElement || node instanceof ShadowRoot;
|
|
843
|
+
}
|
|
844
|
+
function isOverflowElement(element) {
|
|
845
|
+
// Firefox wants us to check `-x` and `-y` variations as well
|
|
846
|
+
const {
|
|
847
|
+
overflow,
|
|
848
|
+
overflowX,
|
|
849
|
+
overflowY
|
|
850
|
+
} = getComputedStyle(element);
|
|
851
|
+
return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);
|
|
852
|
+
}
|
|
853
|
+
function isTableElement(element) {
|
|
854
|
+
return ['table', 'td', 'th'].includes(getNodeName(element));
|
|
855
|
+
}
|
|
856
|
+
function isContainingBlock(element) {
|
|
857
|
+
// TODO: Try and use feature detection here instead
|
|
858
|
+
const isFirefox = /firefox/i.test(getUAString());
|
|
859
|
+
const css = getComputedStyle(element); // This is non-exhaustive but covers the most common CSS properties that
|
|
860
|
+
// create a containing block.
|
|
861
|
+
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
|
|
862
|
+
|
|
863
|
+
return css.transform !== 'none' || css.perspective !== 'none' || // @ts-ignore (TS 4.1 compat)
|
|
864
|
+
css.contain === 'paint' || ['transform', 'perspective'].includes(css.willChange) || isFirefox && css.willChange === 'filter' || isFirefox && (css.filter ? css.filter !== 'none' : false);
|
|
865
|
+
}
|
|
866
|
+
function isLayoutViewport() {
|
|
867
|
+
// Not Safari
|
|
868
|
+
return !/^((?!chrome|android).)*safari/i.test(getUAString()); // Feature detection for this fails in various ways
|
|
869
|
+
// • Always-visible scrollbar or not
|
|
870
|
+
// • Width of <html>, etc.
|
|
871
|
+
// const vV = win.visualViewport;
|
|
872
|
+
// return vV ? Math.abs(win.innerWidth / vV.scale - vV.width) < 0.5 : true;
|
|
873
|
+
}
|
|
874
|
+
|
|
875
|
+
const min = Math.min;
|
|
876
|
+
const max = Math.max;
|
|
877
|
+
const round = Math.round;
|
|
878
|
+
|
|
879
|
+
function getBoundingClientRect(element, includeScale, isFixedStrategy) {
|
|
880
|
+
var _win$visualViewport$o, _win$visualViewport, _win$visualViewport$o2, _win$visualViewport2;
|
|
881
|
+
|
|
882
|
+
if (includeScale === void 0) {
|
|
883
|
+
includeScale = false;
|
|
884
|
+
}
|
|
885
|
+
|
|
886
|
+
if (isFixedStrategy === void 0) {
|
|
887
|
+
isFixedStrategy = false;
|
|
888
|
+
}
|
|
889
|
+
|
|
890
|
+
const clientRect = element.getBoundingClientRect();
|
|
891
|
+
let scaleX = 1;
|
|
892
|
+
let scaleY = 1;
|
|
893
|
+
|
|
894
|
+
if (includeScale && isHTMLElement(element)) {
|
|
895
|
+
scaleX = element.offsetWidth > 0 ? round(clientRect.width) / element.offsetWidth || 1 : 1;
|
|
896
|
+
scaleY = element.offsetHeight > 0 ? round(clientRect.height) / element.offsetHeight || 1 : 1;
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
const win = isElement(element) ? getWindow(element) : window;
|
|
900
|
+
const addVisualOffsets = !isLayoutViewport() && isFixedStrategy;
|
|
901
|
+
const x = (clientRect.left + (addVisualOffsets ? (_win$visualViewport$o = (_win$visualViewport = win.visualViewport) == null ? void 0 : _win$visualViewport.offsetLeft) != null ? _win$visualViewport$o : 0 : 0)) / scaleX;
|
|
902
|
+
const y = (clientRect.top + (addVisualOffsets ? (_win$visualViewport$o2 = (_win$visualViewport2 = win.visualViewport) == null ? void 0 : _win$visualViewport2.offsetTop) != null ? _win$visualViewport$o2 : 0 : 0)) / scaleY;
|
|
903
|
+
const width = clientRect.width / scaleX;
|
|
904
|
+
const height = clientRect.height / scaleY;
|
|
905
|
+
return {
|
|
906
|
+
width,
|
|
907
|
+
height,
|
|
908
|
+
top: y,
|
|
909
|
+
right: x + width,
|
|
910
|
+
bottom: y + height,
|
|
911
|
+
left: x,
|
|
912
|
+
x,
|
|
913
|
+
y
|
|
914
|
+
};
|
|
915
|
+
}
|
|
916
|
+
|
|
917
|
+
function getDocumentElement(node) {
|
|
918
|
+
return ((isNode(node) ? node.ownerDocument : node.document) || window.document).documentElement;
|
|
919
|
+
}
|
|
920
|
+
|
|
921
|
+
function getNodeScroll(element) {
|
|
922
|
+
if (isElement(element)) {
|
|
923
|
+
return {
|
|
924
|
+
scrollLeft: element.scrollLeft,
|
|
925
|
+
scrollTop: element.scrollTop
|
|
926
|
+
};
|
|
927
|
+
}
|
|
928
|
+
|
|
929
|
+
return {
|
|
930
|
+
scrollLeft: element.pageXOffset,
|
|
931
|
+
scrollTop: element.pageYOffset
|
|
932
|
+
};
|
|
933
|
+
}
|
|
934
|
+
|
|
935
|
+
function getWindowScrollBarX(element) {
|
|
936
|
+
// If <html> has a CSS width greater than the viewport, then this will be
|
|
937
|
+
// incorrect for RTL.
|
|
938
|
+
return getBoundingClientRect(getDocumentElement(element)).left + getNodeScroll(element).scrollLeft;
|
|
939
|
+
}
|
|
940
|
+
|
|
941
|
+
function isScaled(element) {
|
|
942
|
+
const rect = getBoundingClientRect(element);
|
|
943
|
+
return round(rect.width) !== element.offsetWidth || round(rect.height) !== element.offsetHeight;
|
|
944
|
+
}
|
|
945
|
+
|
|
946
|
+
function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
947
|
+
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
948
|
+
const documentElement = getDocumentElement(offsetParent);
|
|
949
|
+
const rect = getBoundingClientRect(element, // @ts-ignore - checked above (TS 4.1 compat)
|
|
950
|
+
isOffsetParentAnElement && isScaled(offsetParent), strategy === 'fixed');
|
|
951
|
+
let scroll = {
|
|
952
|
+
scrollLeft: 0,
|
|
953
|
+
scrollTop: 0
|
|
954
|
+
};
|
|
955
|
+
const offsets = {
|
|
956
|
+
x: 0,
|
|
957
|
+
y: 0
|
|
958
|
+
};
|
|
959
|
+
|
|
960
|
+
if (isOffsetParentAnElement || !isOffsetParentAnElement && strategy !== 'fixed') {
|
|
961
|
+
if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
|
|
962
|
+
scroll = getNodeScroll(offsetParent);
|
|
963
|
+
}
|
|
964
|
+
|
|
965
|
+
if (isHTMLElement(offsetParent)) {
|
|
966
|
+
const offsetRect = getBoundingClientRect(offsetParent, true);
|
|
967
|
+
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
968
|
+
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
969
|
+
} else if (documentElement) {
|
|
970
|
+
offsets.x = getWindowScrollBarX(documentElement);
|
|
971
|
+
}
|
|
972
|
+
}
|
|
973
|
+
|
|
974
|
+
return {
|
|
975
|
+
x: rect.left + scroll.scrollLeft - offsets.x,
|
|
976
|
+
y: rect.top + scroll.scrollTop - offsets.y,
|
|
977
|
+
width: rect.width,
|
|
978
|
+
height: rect.height
|
|
979
|
+
};
|
|
980
|
+
}
|
|
981
|
+
|
|
982
|
+
function getParentNode(node) {
|
|
983
|
+
if (getNodeName(node) === 'html') {
|
|
984
|
+
return node;
|
|
985
|
+
}
|
|
986
|
+
|
|
987
|
+
return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle
|
|
988
|
+
// @ts-ignore
|
|
989
|
+
node.assignedSlot || // step into the shadow DOM of the parent of a slotted node
|
|
990
|
+
node.parentNode || ( // DOM Element detected
|
|
991
|
+
isShadowRoot(node) ? node.host : null) || // ShadowRoot detected
|
|
992
|
+
getDocumentElement(node) // fallback
|
|
993
|
+
|
|
994
|
+
);
|
|
995
|
+
}
|
|
996
|
+
|
|
997
|
+
function getTrueOffsetParent(element) {
|
|
998
|
+
if (!isHTMLElement(element) || getComputedStyle(element).position === 'fixed') {
|
|
999
|
+
return null;
|
|
1000
|
+
}
|
|
1001
|
+
|
|
1002
|
+
return composedOffsetParent(element);
|
|
1003
|
+
}
|
|
1004
|
+
/**
|
|
1005
|
+
* Polyfills the old offsetParent behavior from before the spec was changed:
|
|
1006
|
+
* https://github.com/w3c/csswg-drafts/issues/159
|
|
1007
|
+
*/
|
|
1008
|
+
|
|
1009
|
+
|
|
1010
|
+
function composedOffsetParent(element) {
|
|
1011
|
+
let {
|
|
1012
|
+
offsetParent
|
|
1013
|
+
} = element;
|
|
1014
|
+
let ancestor = element;
|
|
1015
|
+
let foundInsideSlot = false;
|
|
1016
|
+
|
|
1017
|
+
while (ancestor && ancestor !== offsetParent) {
|
|
1018
|
+
const {
|
|
1019
|
+
assignedSlot
|
|
1020
|
+
} = ancestor;
|
|
1021
|
+
|
|
1022
|
+
if (assignedSlot) {
|
|
1023
|
+
let newOffsetParent = assignedSlot.offsetParent;
|
|
1024
|
+
|
|
1025
|
+
if (getComputedStyle(assignedSlot).display === 'contents') {
|
|
1026
|
+
const hadStyleAttribute = assignedSlot.hasAttribute('style');
|
|
1027
|
+
const oldDisplay = assignedSlot.style.display;
|
|
1028
|
+
assignedSlot.style.display = getComputedStyle(ancestor).display;
|
|
1029
|
+
newOffsetParent = assignedSlot.offsetParent;
|
|
1030
|
+
assignedSlot.style.display = oldDisplay;
|
|
1031
|
+
|
|
1032
|
+
if (!hadStyleAttribute) {
|
|
1033
|
+
assignedSlot.removeAttribute('style');
|
|
1034
|
+
}
|
|
1035
|
+
}
|
|
1036
|
+
|
|
1037
|
+
ancestor = assignedSlot;
|
|
1038
|
+
|
|
1039
|
+
if (offsetParent !== newOffsetParent) {
|
|
1040
|
+
offsetParent = newOffsetParent;
|
|
1041
|
+
foundInsideSlot = true;
|
|
1042
|
+
}
|
|
1043
|
+
} else if (isShadowRoot(ancestor) && ancestor.host && foundInsideSlot) {
|
|
1044
|
+
break;
|
|
1045
|
+
}
|
|
1046
|
+
|
|
1047
|
+
ancestor = isShadowRoot(ancestor) && ancestor.host || ancestor.parentNode;
|
|
1048
|
+
}
|
|
1049
|
+
|
|
1050
|
+
return offsetParent;
|
|
1051
|
+
}
|
|
1052
|
+
|
|
1053
|
+
function getContainingBlock(element) {
|
|
1054
|
+
let currentNode = getParentNode(element);
|
|
1055
|
+
|
|
1056
|
+
if (isShadowRoot(currentNode)) {
|
|
1057
|
+
currentNode = currentNode.host;
|
|
1058
|
+
}
|
|
1059
|
+
|
|
1060
|
+
while (isHTMLElement(currentNode) && !['html', 'body'].includes(getNodeName(currentNode))) {
|
|
1061
|
+
if (isContainingBlock(currentNode)) {
|
|
1062
|
+
return currentNode;
|
|
1063
|
+
} else {
|
|
1064
|
+
const parent = currentNode.parentNode;
|
|
1065
|
+
currentNode = isShadowRoot(parent) ? parent.host : parent;
|
|
1066
|
+
}
|
|
1067
|
+
}
|
|
1068
|
+
|
|
1069
|
+
return null;
|
|
1070
|
+
} // Gets the closest ancestor positioned element. Handles some edge cases,
|
|
1071
|
+
// such as table ancestors and cross browser bugs.
|
|
1072
|
+
|
|
1073
|
+
|
|
1074
|
+
function getOffsetParent(element) {
|
|
1075
|
+
const window = getWindow(element);
|
|
1076
|
+
let offsetParent = getTrueOffsetParent(element);
|
|
1077
|
+
|
|
1078
|
+
while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') {
|
|
1079
|
+
offsetParent = getTrueOffsetParent(offsetParent);
|
|
1080
|
+
}
|
|
1081
|
+
|
|
1082
|
+
if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static' && !isContainingBlock(offsetParent))) {
|
|
1083
|
+
return window;
|
|
1084
|
+
}
|
|
1085
|
+
|
|
1086
|
+
return offsetParent || getContainingBlock(element) || window;
|
|
1087
|
+
}
|
|
1088
|
+
|
|
1089
|
+
function getDimensions(element) {
|
|
1090
|
+
if (isHTMLElement(element)) {
|
|
1091
|
+
return {
|
|
1092
|
+
width: element.offsetWidth,
|
|
1093
|
+
height: element.offsetHeight
|
|
1094
|
+
};
|
|
1095
|
+
}
|
|
1096
|
+
|
|
1097
|
+
const rect = getBoundingClientRect(element);
|
|
1098
|
+
return {
|
|
1099
|
+
width: rect.width,
|
|
1100
|
+
height: rect.height
|
|
1101
|
+
};
|
|
1102
|
+
}
|
|
1103
|
+
|
|
1104
|
+
function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
|
1105
|
+
let {
|
|
1106
|
+
rect,
|
|
1107
|
+
offsetParent,
|
|
1108
|
+
strategy
|
|
1109
|
+
} = _ref;
|
|
1110
|
+
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
1111
|
+
const documentElement = getDocumentElement(offsetParent);
|
|
1112
|
+
|
|
1113
|
+
if (offsetParent === documentElement) {
|
|
1114
|
+
return rect;
|
|
1115
|
+
}
|
|
1116
|
+
|
|
1117
|
+
let scroll = {
|
|
1118
|
+
scrollLeft: 0,
|
|
1119
|
+
scrollTop: 0
|
|
1120
|
+
};
|
|
1121
|
+
const offsets = {
|
|
1122
|
+
x: 0,
|
|
1123
|
+
y: 0
|
|
1124
|
+
};
|
|
1125
|
+
|
|
1126
|
+
if (isOffsetParentAnElement || !isOffsetParentAnElement && strategy !== 'fixed') {
|
|
1127
|
+
if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
|
|
1128
|
+
scroll = getNodeScroll(offsetParent);
|
|
1129
|
+
}
|
|
1130
|
+
|
|
1131
|
+
if (isHTMLElement(offsetParent)) {
|
|
1132
|
+
const offsetRect = getBoundingClientRect(offsetParent, true);
|
|
1133
|
+
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
1134
|
+
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
1135
|
+
} // This doesn't appear to be need to be negated.
|
|
1136
|
+
// else if (documentElement) {
|
|
1137
|
+
// offsets.x = getWindowScrollBarX(documentElement);
|
|
1138
|
+
// }
|
|
1139
|
+
|
|
1140
|
+
}
|
|
1141
|
+
|
|
1142
|
+
return { ...rect,
|
|
1143
|
+
x: rect.x - scroll.scrollLeft + offsets.x,
|
|
1144
|
+
y: rect.y - scroll.scrollTop + offsets.y
|
|
1145
|
+
};
|
|
1146
|
+
}
|
|
1147
|
+
|
|
1148
|
+
function getViewportRect(element, strategy) {
|
|
1149
|
+
const win = getWindow(element);
|
|
1150
|
+
const html = getDocumentElement(element);
|
|
1151
|
+
const visualViewport = win.visualViewport;
|
|
1152
|
+
let width = html.clientWidth;
|
|
1153
|
+
let height = html.clientHeight;
|
|
1154
|
+
let x = 0;
|
|
1155
|
+
let y = 0;
|
|
1156
|
+
|
|
1157
|
+
if (visualViewport) {
|
|
1158
|
+
width = visualViewport.width;
|
|
1159
|
+
height = visualViewport.height;
|
|
1160
|
+
const layoutViewport = isLayoutViewport();
|
|
1161
|
+
|
|
1162
|
+
if (layoutViewport || !layoutViewport && strategy === 'fixed') {
|
|
1163
|
+
x = visualViewport.offsetLeft;
|
|
1164
|
+
y = visualViewport.offsetTop;
|
|
1165
|
+
}
|
|
1166
|
+
}
|
|
1167
|
+
|
|
1168
|
+
return {
|
|
1169
|
+
width,
|
|
1170
|
+
height,
|
|
1171
|
+
x,
|
|
1172
|
+
y
|
|
1173
|
+
};
|
|
1174
|
+
}
|
|
1175
|
+
|
|
1176
|
+
// of the `<html>` and `<body>` rect bounds if horizontally scrollable
|
|
1177
|
+
|
|
1178
|
+
function getDocumentRect(element) {
|
|
1179
|
+
var _element$ownerDocumen;
|
|
1180
|
+
|
|
1181
|
+
const html = getDocumentElement(element);
|
|
1182
|
+
const scroll = getNodeScroll(element);
|
|
1183
|
+
const body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;
|
|
1184
|
+
const width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);
|
|
1185
|
+
const height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);
|
|
1186
|
+
let x = -scroll.scrollLeft + getWindowScrollBarX(element);
|
|
1187
|
+
const y = -scroll.scrollTop;
|
|
1188
|
+
|
|
1189
|
+
if (getComputedStyle(body || html).direction === 'rtl') {
|
|
1190
|
+
x += max(html.clientWidth, body ? body.clientWidth : 0) - width;
|
|
1191
|
+
}
|
|
1192
|
+
|
|
1193
|
+
return {
|
|
1194
|
+
width,
|
|
1195
|
+
height,
|
|
1196
|
+
x,
|
|
1197
|
+
y
|
|
1198
|
+
};
|
|
1199
|
+
}
|
|
1200
|
+
|
|
1201
|
+
function getNearestOverflowAncestor(node) {
|
|
1202
|
+
const parentNode = getParentNode(node);
|
|
1203
|
+
|
|
1204
|
+
if (['html', 'body', '#document'].includes(getNodeName(parentNode))) {
|
|
1205
|
+
// @ts-ignore assume body is always available
|
|
1206
|
+
return node.ownerDocument.body;
|
|
1207
|
+
}
|
|
1208
|
+
|
|
1209
|
+
if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
|
|
1210
|
+
return parentNode;
|
|
1211
|
+
}
|
|
1212
|
+
|
|
1213
|
+
return getNearestOverflowAncestor(parentNode);
|
|
1214
|
+
}
|
|
1215
|
+
|
|
1216
|
+
function getOverflowAncestors(node, list) {
|
|
1217
|
+
var _node$ownerDocument;
|
|
1218
|
+
|
|
1219
|
+
if (list === void 0) {
|
|
1220
|
+
list = [];
|
|
1221
|
+
}
|
|
1222
|
+
|
|
1223
|
+
const scrollableAncestor = getNearestOverflowAncestor(node);
|
|
1224
|
+
const isBody = scrollableAncestor === ((_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.body);
|
|
1225
|
+
const win = getWindow(scrollableAncestor);
|
|
1226
|
+
const target = isBody ? [win].concat(win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : []) : scrollableAncestor;
|
|
1227
|
+
const updatedList = list.concat(target);
|
|
1228
|
+
return isBody ? updatedList : // @ts-ignore: isBody tells us target will be an HTMLElement here
|
|
1229
|
+
updatedList.concat(getOverflowAncestors(target));
|
|
1230
|
+
}
|
|
1231
|
+
|
|
1232
|
+
function contains(parent, child) {
|
|
1233
|
+
const rootNode = child.getRootNode == null ? void 0 : child.getRootNode(); // First, attempt with faster native method
|
|
1234
|
+
|
|
1235
|
+
if (parent.contains(child)) {
|
|
1236
|
+
return true;
|
|
1237
|
+
} // then fallback to custom implementation with Shadow DOM support
|
|
1238
|
+
else if (rootNode && isShadowRoot(rootNode)) {
|
|
1239
|
+
let next = child;
|
|
1240
|
+
|
|
1241
|
+
do {
|
|
1242
|
+
// use `===` replace node.isSameNode()
|
|
1243
|
+
if (next && parent === next) {
|
|
1244
|
+
return true;
|
|
1245
|
+
} // @ts-ignore: need a better way to handle this...
|
|
1246
|
+
|
|
1247
|
+
|
|
1248
|
+
next = next.parentNode || next.host;
|
|
1249
|
+
} while (next);
|
|
1250
|
+
}
|
|
1251
|
+
|
|
1252
|
+
return false;
|
|
1253
|
+
}
|
|
1254
|
+
|
|
1255
|
+
function getInnerBoundingClientRect(element, strategy) {
|
|
1256
|
+
const clientRect = getBoundingClientRect(element, false, strategy === 'fixed');
|
|
1257
|
+
const top = clientRect.top + element.clientTop;
|
|
1258
|
+
const left = clientRect.left + element.clientLeft;
|
|
1259
|
+
return {
|
|
1260
|
+
top,
|
|
1261
|
+
left,
|
|
1262
|
+
x: left,
|
|
1263
|
+
y: top,
|
|
1264
|
+
right: left + element.clientWidth,
|
|
1265
|
+
bottom: top + element.clientHeight,
|
|
1266
|
+
width: element.clientWidth,
|
|
1267
|
+
height: element.clientHeight
|
|
1268
|
+
};
|
|
1269
|
+
}
|
|
1270
|
+
|
|
1271
|
+
function getClientRectFromClippingAncestor(element, clippingParent, strategy) {
|
|
1272
|
+
if (clippingParent === 'viewport') {
|
|
1273
|
+
return rectToClientRect(getViewportRect(element, strategy));
|
|
1274
|
+
}
|
|
1275
|
+
|
|
1276
|
+
if (isElement(clippingParent)) {
|
|
1277
|
+
return getInnerBoundingClientRect(clippingParent, strategy);
|
|
1278
|
+
}
|
|
1279
|
+
|
|
1280
|
+
return rectToClientRect(getDocumentRect(getDocumentElement(element)));
|
|
1281
|
+
} // A "clipping ancestor" is an overflowable container with the characteristic of
|
|
1282
|
+
// clipping (or hiding) overflowing elements with a position different from
|
|
1283
|
+
// `initial`
|
|
1284
|
+
|
|
1285
|
+
|
|
1286
|
+
function getClippingAncestors(element) {
|
|
1287
|
+
const clippingAncestors = getOverflowAncestors(element);
|
|
1288
|
+
const canEscapeClipping = ['absolute', 'fixed'].includes(getComputedStyle(element).position);
|
|
1289
|
+
const clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;
|
|
1290
|
+
|
|
1291
|
+
if (!isElement(clipperElement)) {
|
|
1292
|
+
return [];
|
|
1293
|
+
} // @ts-ignore isElement check ensures we return Array<Element>
|
|
1294
|
+
|
|
1295
|
+
|
|
1296
|
+
return clippingAncestors.filter(clippingAncestors => isElement(clippingAncestors) && contains(clippingAncestors, clipperElement) && getNodeName(clippingAncestors) !== 'body');
|
|
1297
|
+
} // Gets the maximum area that the element is visible in due to any number of
|
|
1298
|
+
// clipping ancestors
|
|
1299
|
+
|
|
1300
|
+
|
|
1301
|
+
function getClippingRect(_ref) {
|
|
1302
|
+
let {
|
|
1303
|
+
element,
|
|
1304
|
+
boundary,
|
|
1305
|
+
rootBoundary,
|
|
1306
|
+
strategy
|
|
1307
|
+
} = _ref;
|
|
1308
|
+
const mainClippingAncestors = boundary === 'clippingAncestors' ? getClippingAncestors(element) : [].concat(boundary);
|
|
1309
|
+
const clippingAncestors = [...mainClippingAncestors, rootBoundary];
|
|
1310
|
+
const firstClippingAncestor = clippingAncestors[0];
|
|
1311
|
+
const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
|
|
1312
|
+
const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);
|
|
1313
|
+
accRect.top = max(rect.top, accRect.top);
|
|
1314
|
+
accRect.right = min(rect.right, accRect.right);
|
|
1315
|
+
accRect.bottom = min(rect.bottom, accRect.bottom);
|
|
1316
|
+
accRect.left = max(rect.left, accRect.left);
|
|
1317
|
+
return accRect;
|
|
1318
|
+
}, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));
|
|
1319
|
+
return {
|
|
1320
|
+
width: clippingRect.right - clippingRect.left,
|
|
1321
|
+
height: clippingRect.bottom - clippingRect.top,
|
|
1322
|
+
x: clippingRect.left,
|
|
1323
|
+
y: clippingRect.top
|
|
1324
|
+
};
|
|
1325
|
+
}
|
|
1326
|
+
|
|
1327
|
+
const platform = {
|
|
1328
|
+
getClippingRect,
|
|
1329
|
+
convertOffsetParentRelativeRectToViewportRelativeRect,
|
|
1330
|
+
isElement,
|
|
1331
|
+
getDimensions,
|
|
1332
|
+
getOffsetParent,
|
|
1333
|
+
getDocumentElement,
|
|
1334
|
+
getElementRects: _ref => {
|
|
1335
|
+
let {
|
|
1336
|
+
reference,
|
|
1337
|
+
floating,
|
|
1338
|
+
strategy
|
|
1339
|
+
} = _ref;
|
|
1340
|
+
return {
|
|
1341
|
+
reference: getRectRelativeToOffsetParent(reference, getOffsetParent(floating), strategy),
|
|
1342
|
+
floating: { ...getDimensions(floating),
|
|
1343
|
+
x: 0,
|
|
1344
|
+
y: 0
|
|
1345
|
+
}
|
|
1346
|
+
};
|
|
1347
|
+
},
|
|
1348
|
+
getClientRects: element => Array.from(element.getClientRects()),
|
|
1349
|
+
isRTL: element => getComputedStyle(element).direction === 'rtl'
|
|
1350
|
+
};
|
|
1351
|
+
|
|
1352
|
+
/**
|
|
1353
|
+
* Computes the `x` and `y` coordinates that will place the floating element
|
|
1354
|
+
* next to a reference element when it is given a certain CSS positioning
|
|
1355
|
+
* strategy.
|
|
1356
|
+
*/
|
|
1357
|
+
|
|
1358
|
+
const computePosition = (reference, floating, options) => computePosition$1(reference, floating, {
|
|
1359
|
+
platform,
|
|
1360
|
+
...options
|
|
1361
|
+
});
|
|
1362
|
+
|
|
1363
|
+
const FloatingUI = (
|
|
1364
|
+
// el,
|
|
1365
|
+
// component,
|
|
1366
|
+
// options = {
|
|
1367
|
+
// placement: Bcm.Placement.bottom as PlacementTypes,
|
|
1368
|
+
// offset: 0,
|
|
1369
|
+
// arrow: false,
|
|
1370
|
+
// arrowColor: 'tw-bg-slate-700',
|
|
1371
|
+
// },
|
|
1372
|
+
// autoHidden = true,
|
|
1373
|
+
// autoSize = false,
|
|
1374
|
+
// style: any = {},
|
|
1375
|
+
args) => {
|
|
1376
|
+
const { ref, floating, placement: _placement = Bcm.Placement.bottom, offset: _offset = 0, arrow: _arrow = false, arrowColor = 'tw-bg-slate-700', autoHidden = true, autoSize = false, style = {}, } = args;
|
|
1377
|
+
// const { placement: _placement, offset: _offset, arrow: _arrow, arrowColor } = options;
|
|
1378
|
+
// let _middleware = [offset(_offset), flip(), shift({ padding: 5 }), hide({ padding: 10 })];
|
|
1379
|
+
let _middleware = [offset(_offset), flip(), shift({ padding: 5 })];
|
|
1380
|
+
if (autoHidden) {
|
|
1381
|
+
_middleware.push(hide({ padding: 10 }));
|
|
1382
|
+
}
|
|
1383
|
+
style &&
|
|
1384
|
+
Object.assign(floating.style, Object.assign(Object.assign({}, (style.height && { height: style.height })), (style.minHeight && { minHeight: style.minHeight })));
|
|
1385
|
+
if (autoSize && !(style === null || style === void 0 ? void 0 : style.height)) {
|
|
1386
|
+
_middleware.push(size({
|
|
1387
|
+
apply({ availableHeight }) {
|
|
1388
|
+
const maxHeight = `${availableHeight > window.innerHeight ? window.innerHeight - 10 : availableHeight}px`;
|
|
1389
|
+
Object.assign(floating.style, {
|
|
1390
|
+
maxHeight: `${style.maxHeight && maxHeight >= style.maxHeight ? style.maxHeight : maxHeight}`,
|
|
1391
|
+
});
|
|
1392
|
+
},
|
|
1393
|
+
padding: 5,
|
|
1394
|
+
}));
|
|
1395
|
+
}
|
|
1396
|
+
let arrowElement = document.getElementById(`${floating.id}-arrow`);
|
|
1397
|
+
if (_arrow) {
|
|
1398
|
+
if (!arrowElement) {
|
|
1399
|
+
arrowElement = document.createElement('div');
|
|
1400
|
+
arrowElement.setAttribute('id', `${floating.id}-arrow`);
|
|
1401
|
+
}
|
|
1402
|
+
arrowElement.setAttribute('class', `tw-absolute tw-w-2 tw-h-2 ${arrowColor} tw-transform tw-z-[-1] tw-opacity-0 tw-transition-opacity tw-duration-300
|
|
1403
|
+
tw-shadow
|
|
1404
|
+
`);
|
|
1405
|
+
floating.prepend(arrowElement);
|
|
1406
|
+
_middleware.push(arrow({ element: arrowElement, padding: 4 }));
|
|
1407
|
+
}
|
|
1408
|
+
computePosition(ref, floating, { placement: _placement, middleware: _middleware }).then(({ x, y, placement, middlewareData }) => {
|
|
1409
|
+
const { referenceHidden } = autoHidden ? middlewareData.hide : { referenceHidden: false };
|
|
1410
|
+
Object.assign(floating.style, {
|
|
1411
|
+
top: '0',
|
|
1412
|
+
left: '0',
|
|
1413
|
+
transform: `translate(${Math.round(x)}px,${Math.round(y)}px)`,
|
|
1414
|
+
opacity: referenceHidden ? '0' : '1',
|
|
1415
|
+
visibility: referenceHidden ? 'hidden' : 'visible',
|
|
1416
|
+
});
|
|
1417
|
+
if (referenceHidden) {
|
|
1418
|
+
const isHideEvent = new CustomEvent('bcm-floating-is-hide', { detail: { id: floating.id } });
|
|
1419
|
+
document.dispatchEvent(isHideEvent);
|
|
1420
|
+
floating.getAttribute('outside-of-the-screen') !== 'true' && floating.setAttribute('outside-of-the-screen', 'true');
|
|
1421
|
+
}
|
|
1422
|
+
else {
|
|
1423
|
+
floating.getAttribute('outside-of-the-screen') === 'true' && floating.removeAttribute('outside-of-the-screen');
|
|
1424
|
+
}
|
|
1425
|
+
if (_arrow) {
|
|
1426
|
+
const { x: arrowX, y: arrowY } = middlewareData.arrow;
|
|
1427
|
+
const staticSide = {
|
|
1428
|
+
top: 'bottom',
|
|
1429
|
+
right: 'left',
|
|
1430
|
+
bottom: 'top',
|
|
1431
|
+
left: 'right',
|
|
1432
|
+
}[placement.split('-')[0]];
|
|
1433
|
+
const arrowStyle = {
|
|
1434
|
+
top: 'rotate(45deg)',
|
|
1435
|
+
right: 'rotate(135deg)',
|
|
1436
|
+
bottom: 'rotate(-135deg)',
|
|
1437
|
+
left: 'rotate(-45deg)',
|
|
1438
|
+
}[placement.split('-')[0]];
|
|
1439
|
+
Object.assign(arrowElement.style, {
|
|
1440
|
+
left: arrowX != null ? `${arrowX}px` : '',
|
|
1441
|
+
top: arrowY != null ? `${arrowY}px` : '',
|
|
1442
|
+
right: '',
|
|
1443
|
+
bottom: '',
|
|
1444
|
+
[staticSide]: '-4px',
|
|
1445
|
+
opacity: 1,
|
|
1446
|
+
visibility: referenceHidden ? 'hidden' : 'visible',
|
|
1447
|
+
transform: arrowStyle,
|
|
1448
|
+
});
|
|
1449
|
+
}
|
|
1450
|
+
});
|
|
1451
|
+
};
|
|
1452
|
+
|
|
1453
|
+
export { FloatingUI as F };
|