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