bromcom-ui 2.9.0-rc.8 → 2.9.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.css +1 -1
- package/dist/bromcom-ui/bromcom-ui.esm.js +1 -1
- package/dist/bromcom-ui/global/global.js +6 -0
- package/dist/bromcom-ui/global/helper/toast.ts +2 -0
- package/dist/bromcom-ui/p-08c75801.js +5 -0
- package/dist/bromcom-ui/p-0dacfdbc.entry.js +5 -0
- package/dist/bromcom-ui/{p-24f0e23a.entry.js → p-13f6e1a7.entry.js} +1 -1
- package/dist/bromcom-ui/{p-5c3e9ac9.entry.js → p-14cafd64.entry.js} +1 -1
- package/dist/bromcom-ui/p-170cf07d.js +6 -0
- package/dist/bromcom-ui/p-19634d99.js +5 -0
- package/dist/bromcom-ui/{p-e4477593.entry.js → p-1c801d0c.entry.js} +1 -1
- package/dist/bromcom-ui/{p-48f85544.entry.js → p-1c9314bd.entry.js} +1 -1
- package/dist/bromcom-ui/{p-6bcaf906.entry.js → p-1cfe5a5d.entry.js} +1 -1
- package/dist/bromcom-ui/p-20ba9769.entry.js +5 -0
- package/dist/bromcom-ui/{p-8ded5483.entry.js → p-228c74e9.entry.js} +1 -1
- package/dist/bromcom-ui/{p-65f01d32.entry.js → p-22eb4e12.entry.js} +1 -1
- package/dist/bromcom-ui/{p-f331e009.entry.js → p-26290ed5.entry.js} +1 -1
- package/dist/bromcom-ui/{p-240151d4.entry.js → p-2aaeb247.entry.js} +1 -1
- package/dist/bromcom-ui/{p-73ca7c0a.entry.js → p-2b822458.entry.js} +1 -1
- package/dist/bromcom-ui/{p-dbc4c30c.js → p-2c5a0863.js} +1 -1
- package/dist/bromcom-ui/p-304bfa08.entry.js +5 -0
- package/dist/bromcom-ui/p-3432a82d.js +19 -0
- package/dist/bromcom-ui/p-399bce44.entry.js +5 -0
- package/dist/bromcom-ui/p-41cea609.entry.js +7 -0
- package/dist/bromcom-ui/{p-6c3e9e10.entry.js → p-430c0a24.entry.js} +1 -1
- package/dist/bromcom-ui/p-434c170e.js +5 -0
- package/dist/bromcom-ui/{p-d0bb9a84.entry.js → p-440bbaaa.entry.js} +1 -1
- package/dist/bromcom-ui/p-47400be4.entry.js +5 -0
- package/dist/bromcom-ui/{p-f5bed571.entry.js → p-4a2de9ce.entry.js} +1 -1
- package/dist/bromcom-ui/p-4f42085a.entry.js +5 -0
- package/dist/bromcom-ui/{p-ff48f5b2.entry.js → p-5232e011.entry.js} +1 -1
- package/dist/bromcom-ui/p-53e91ae6.js +5 -0
- package/dist/bromcom-ui/{p-c75519d5.js → p-54211561.js} +1 -1
- package/dist/bromcom-ui/{p-dc2c4b14.entry.js → p-5699f67d.entry.js} +1 -1
- package/dist/bromcom-ui/p-5871767a.entry.js +5 -0
- package/dist/bromcom-ui/{p-45767d1d.entry.js → p-588165ef.entry.js} +1 -1
- package/dist/bromcom-ui/p-5916e844.entry.js +5 -0
- package/dist/bromcom-ui/{p-499bb928.entry.js → p-5fb0f815.entry.js} +1 -1
- package/dist/bromcom-ui/{p-2fc584c4.js → p-61db1f1f.js} +1 -1
- package/dist/bromcom-ui/{p-89e1d8c5.entry.js → p-626b805d.entry.js} +1 -1
- package/dist/bromcom-ui/{p-d389b202.entry.js → p-647de93f.entry.js} +1 -1
- package/dist/bromcom-ui/p-64fad38b.js +11 -0
- package/dist/bromcom-ui/{p-03134b6f.entry.js → p-67343ad8.entry.js} +1 -1
- package/dist/bromcom-ui/{p-bd51d347.entry.js → p-69260d36.entry.js} +1 -1
- package/dist/bromcom-ui/p-6cf1e8a2.entry.js +5 -0
- package/dist/bromcom-ui/{p-4aa0e6b1.js → p-6edf985f.js} +1 -1
- package/dist/bromcom-ui/p-73ec379d.entry.js +5 -0
- package/dist/bromcom-ui/{p-3cde7f38.js → p-74e6d2b6.js} +1 -1
- package/dist/bromcom-ui/p-75ec5cc6.entry.js +5 -0
- package/dist/bromcom-ui/p-784a7bb0.entry.js +5 -0
- package/dist/bromcom-ui/p-78f0fe00.js +5 -0
- package/dist/bromcom-ui/p-7b05abe8.entry.js +5 -0
- package/dist/bromcom-ui/{p-d995750a.entry.js → p-7c5763cc.entry.js} +1 -1
- package/dist/bromcom-ui/p-7cb30513.js +5 -0
- package/dist/bromcom-ui/{p-81eeccfa.entry.js → p-7d18ce0e.entry.js} +1 -1
- package/dist/bromcom-ui/{p-5ae0a59b.js → p-7e44e6b5.js} +1 -1
- package/dist/bromcom-ui/p-80ee3d97.entry.js +5 -0
- package/dist/bromcom-ui/p-822d590f.entry.js +5 -0
- package/dist/bromcom-ui/p-85eedabc.js +5 -0
- package/dist/bromcom-ui/p-89a28750.entry.js +5 -0
- package/dist/bromcom-ui/{p-3c7a0345.js → p-8c018ae0.js} +1 -1
- package/dist/bromcom-ui/p-8f45ba5f.entry.js +5 -0
- package/dist/bromcom-ui/p-9075a184.entry.js +5 -0
- package/dist/bromcom-ui/{p-f58c1fbe.entry.js → p-913c55ee.entry.js} +1 -1
- package/dist/bromcom-ui/p-9164639f.entry.js +5 -0
- package/dist/bromcom-ui/p-9850cbce.js +5 -0
- package/dist/bromcom-ui/{p-8bcfe3b3.entry.js → p-99824717.entry.js} +1 -1
- package/dist/bromcom-ui/p-9bd5f3b4.entry.js +5 -0
- package/dist/bromcom-ui/{p-6aeaef2a.entry.js → p-a006e404.entry.js} +1 -1
- package/dist/bromcom-ui/{p-e9842c26.js → p-a0ba474b.js} +1 -1
- package/dist/bromcom-ui/{p-b60bcecf.js → p-a1b1750c.js} +1 -1
- package/dist/bromcom-ui/{p-8fcb5846.js → p-a2c364af.js} +1 -1
- package/dist/bromcom-ui/p-a40a5474.entry.js +5 -0
- package/dist/bromcom-ui/{p-7c6e3ae5.entry.js → p-a664cc20.entry.js} +1 -1
- package/dist/bromcom-ui/p-a9eb0321.js +315 -0
- package/dist/bromcom-ui/{p-2acd6bee.entry.js → p-ab0b4d1e.entry.js} +1 -1
- package/dist/bromcom-ui/{p-ea4d8a18.entry.js → p-ae57f046.entry.js} +1 -1
- package/dist/bromcom-ui/{p-2caa75a4.entry.js → p-b4f033b4.entry.js} +1 -1
- package/dist/bromcom-ui/p-b81e8f91.js +5 -0
- package/dist/bromcom-ui/{p-503feae9.entry.js → p-b8a8bd1d.entry.js} +1 -1
- package/dist/bromcom-ui/{p-b4ac5904.js → p-b901e1ce.js} +1 -1
- package/dist/bromcom-ui/p-ba74a838.entry.js +5 -0
- package/dist/bromcom-ui/{p-c42dffea.entry.js → p-ba949d4a.entry.js} +1 -1
- package/dist/bromcom-ui/{p-f4538abb.entry.js → p-ba9eff2a.entry.js} +1 -1
- package/dist/bromcom-ui/{p-fb4b5224.entry.js → p-bd2b6de5.entry.js} +1 -1
- package/dist/bromcom-ui/{p-ebee9f45.entry.js → p-c1a992e7.entry.js} +1 -1
- package/dist/bromcom-ui/{p-908b1b5d.js → p-c8751181.js} +1 -1
- package/dist/bromcom-ui/p-ccf0872d.js +5 -0
- package/dist/bromcom-ui/p-cf659967.entry.js +5 -0
- package/dist/bromcom-ui/{p-8d0ca8c2.js → p-d153c7fc.js} +1 -1
- package/dist/bromcom-ui/p-d3db9e02.entry.js +5 -0
- package/dist/bromcom-ui/{p-7ddaedb7.entry.js → p-d551a51d.entry.js} +1 -1
- package/dist/bromcom-ui/{p-ec36d0c0.entry.js → p-d68c2c0a.entry.js} +1 -1
- package/dist/bromcom-ui/{p-e5a0d8f6.entry.js → p-d724cfa9.entry.js} +1 -1
- package/dist/bromcom-ui/{p-af0a447d.entry.js → p-d7ca94e1.entry.js} +1 -1
- package/dist/bromcom-ui/p-dd49ae28.entry.js +5 -0
- package/dist/bromcom-ui/p-e2294927.entry.js +5 -0
- package/dist/bromcom-ui/{p-1b1f4b44.entry.js → p-e688b044.entry.js} +1 -1
- package/dist/bromcom-ui/p-ec0224fb.entry.js +5 -0
- package/dist/bromcom-ui/{p-6ca980dd.entry.js → p-ece578ef.entry.js} +1 -1
- package/dist/bromcom-ui/{p-1be22601.entry.js → p-ef8c5b55.entry.js} +1 -1
- package/dist/bromcom-ui/p-f711588b.js +5 -0
- package/dist/bromcom-ui/p-fe1f2413.entry.js +5 -0
- package/dist/bromcom-ui/{p-a82f2b2a.entry.js → p-fe83cdd3.entry.js} +1 -1
- package/dist/bromcom-ui/{p-f619f9f9.entry.js → p-fff1a0f9.entry.js} +1 -1
- package/dist/bromcom-ui/static/message-bot.svg +2 -2
- package/dist/cjs/{_commonjsHelpers-bd20f4c0.js → _commonjsHelpers-ed84c3ca.js} +16 -0
- package/dist/cjs/{bcm-ab921827.js → bcm-7f703055.js} +33 -31
- package/dist/cjs/bcm-accordion.cjs.entry.js +5 -5
- package/dist/cjs/bcm-alert.cjs.entry.js +9 -9
- package/dist/cjs/bcm-attendance.cjs.entry.js +5 -5
- package/dist/cjs/bcm-autocomplete.cjs.entry.js +3 -3
- package/dist/cjs/bcm-avatar_2.cjs.entry.js +209 -0
- package/dist/cjs/bcm-box.cjs.entry.js +1 -1
- package/dist/cjs/bcm-breadcrumb.cjs.entry.js +6 -6
- package/dist/cjs/bcm-button-group.cjs.entry.js +11 -11
- package/dist/cjs/bcm-button_15.cjs.entry.js +35172 -0
- package/dist/cjs/bcm-card.cjs.entry.js +10 -10
- package/dist/cjs/bcm-checkbox-group.cjs.entry.js +29 -29
- package/dist/cjs/bcm-checkbox-lite_9.cjs.entry.js +10 -10
- package/dist/cjs/{bcm-checkbox.cjs.entry.js → bcm-checkbox_2.cjs.entry.js} +28 -17
- package/dist/cjs/bcm-chip-group.cjs.entry.js +15 -16
- package/dist/cjs/bcm-chip.cjs.entry.js +7 -7
- package/dist/cjs/bcm-collapse-group.cjs.entry.js +1 -1
- package/dist/cjs/bcm-collapse.cjs.entry.js +6 -6
- package/dist/cjs/bcm-color-input.cjs.entry.js +10 -11
- package/dist/cjs/bcm-colorpicker.cjs.entry.js +3 -3
- package/dist/cjs/bcm-content.cjs.entry.js +1 -1
- package/dist/cjs/bcm-default.cjs.entry.js +5 -5
- package/dist/cjs/bcm-drawer.cjs.entry.js +13 -14
- package/dist/cjs/bcm-dropdown.cjs.entry.js +119 -0
- package/dist/cjs/bcm-error-layout.cjs.entry.js +3 -3
- package/dist/cjs/bcm-expansion-panel.cjs.entry.js +9 -9
- package/dist/cjs/bcm-form-group.cjs.entry.js +1 -1
- package/dist/cjs/bcm-input-custom.cjs.entry.js +6 -6
- package/dist/cjs/bcm-input-dropdown.cjs.entry.js +309 -0
- package/dist/cjs/bcm-item.cjs.entry.js +72 -0
- package/dist/cjs/bcm-items.cjs.entry.js +49 -0
- package/dist/cjs/bcm-link.cjs.entry.js +6 -6
- package/dist/cjs/bcm-list_3.cjs.entry.js +169 -1691
- package/dist/cjs/bcm-menu.cjs.entry.js +150 -0
- package/dist/cjs/bcm-message.cjs.entry.js +3 -3
- package/dist/cjs/bcm-modal-2-footer.cjs.entry.js +11 -12
- package/dist/cjs/bcm-modal-2-header.cjs.entry.js +10 -11
- package/dist/cjs/bcm-modal-2.cjs.entry.js +12 -13
- package/dist/cjs/bcm-modal.cjs.entry.js +11 -11
- package/dist/cjs/bcm-notification.cjs.entry.js +3 -3
- package/dist/cjs/bcm-old-tag_2.cjs.entry.js +3 -3
- package/dist/cjs/bcm-overlay_2.cjs.entry.js +4 -4
- package/dist/cjs/bcm-popconfirm-box.cjs.entry.js +10 -10
- package/dist/cjs/bcm-popconfirm.cjs.entry.js +9 -9
- package/dist/cjs/bcm-popover.cjs.entry.js +229 -0
- package/dist/cjs/bcm-progress.cjs.entry.js +9 -9
- package/dist/cjs/bcm-radio-group.cjs.entry.js +17 -18
- package/dist/cjs/bcm-radio.cjs.entry.js +18 -19
- package/dist/cjs/bcm-range.cjs.entry.js +10 -10
- package/dist/cjs/bcm-result.cjs.entry.js +3 -3
- package/dist/cjs/bcm-select-group.cjs.entry.js +3 -3
- package/dist/cjs/bcm-select-option.cjs.entry.js +3 -3
- package/dist/cjs/bcm-select.cjs.entry.js +5 -5
- package/dist/cjs/bcm-skeleton.cjs.entry.js +5 -5
- package/dist/cjs/bcm-step.cjs.entry.js +8 -8
- package/dist/cjs/bcm-stepper.cjs.entry.js +15 -16
- package/dist/cjs/bcm-switch.cjs.entry.js +15 -15
- package/dist/cjs/bcm-tab-group.cjs.entry.js +209 -0
- package/dist/cjs/bcm-tab-item-header.cjs.entry.js +58 -0
- package/dist/cjs/bcm-tab-item.cjs.entry.js +90 -0
- package/dist/cjs/bcm-tab-pane.cjs.entry.js +3 -3
- package/dist/cjs/bcm-tab.cjs.entry.js +3 -3
- package/dist/cjs/bcm-table.cjs.entry.js +7648 -38
- package/dist/cjs/bcm-tabs-content.cjs.entry.js +3 -3
- package/dist/cjs/bcm-tabs.cjs.entry.js +3 -3
- package/dist/cjs/bcm-tag.cjs.entry.js +19 -19
- package/dist/cjs/bcm-text.cjs.entry.js +49 -0
- package/dist/cjs/bcm-textarea.cjs.entry.js +13 -13
- package/dist/cjs/bcm-timeline-item.cjs.entry.js +3 -3
- package/dist/cjs/bcm-timeline.cjs.entry.js +3 -3
- package/dist/cjs/bcm-toast.cjs.entry.js +38 -19
- package/dist/cjs/bcm-treeview-group.cjs.entry.js +1 -1
- package/dist/cjs/bromcom-ui.cjs.js +5 -4
- package/dist/cjs/{caption-template-8d099fd6.js → caption-template-81dbc490.js} +2 -2
- package/dist/cjs/{color-helper-7ab15732.js → color-helper-c3a819ea.js} +1 -1
- package/dist/cjs/{colors-e1d142ad.js → colors-078851ec.js} +1 -1
- package/dist/cjs/{floating-ui-c9fc2202.js → floating-ui-b441ea7c.js} +2 -2
- package/dist/cjs/{generate-cae9c0fb.js → generate-1dfe001a.js} +2 -2
- package/dist/cjs/{global-3ce50f9f.js → global-4a6abd46.js} +6 -1
- package/dist/cjs/index-5279dea2.js +2571 -0
- package/dist/cjs/{index-906fb4e5.js → index-7eed931f.js} +1631 -25
- package/dist/cjs/{index-fdbf5226.js → index-95ae50d0.js} +1 -1
- package/dist/cjs/{index-ddfd6d8f.js → index-c591ecec.js} +4 -0
- package/dist/cjs/{index-4506fcd7.js → index-d321de96.js} +1 -1
- package/dist/cjs/{input-template-a7f8f2e9.js → input-template-41868c68.js} +8 -8
- package/dist/cjs/{is-load-decorator-137dded1.js → is-load-decorator-15036f37.js} +3 -2
- package/dist/cjs/{json-parse-decarator-34a3d26e.js → json-parse-decarator-f29c368a.js} +2 -2
- package/dist/cjs/{label-template-4d5f99a5.js → label-template-80235581.js} +5 -5
- package/dist/cjs/loader.cjs.js +5 -4
- package/dist/cjs/{number-helper-101d8aa8.js → number-helper-2b9c1f9d.js} +1 -1
- package/dist/cjs/old-bcm-popover-box.cjs.entry.js +11 -11
- package/dist/cjs/old-bcm-popover.cjs.entry.js +9 -9
- package/dist/cjs/{package-ed8b3296.js → package-66b81414.js} +1 -1
- package/dist/cjs/{popover-placement-ccb40073.js → popover-placement-f20020a6.js} +1 -1
- package/dist/cjs/{slot-template-d70ea082.js → slot-template-873b0cd5.js} +2 -2
- package/dist/cjs/{stepper-states-308c8d3e.js → stepper-states-6ccb8ab3.js} +3 -3
- package/dist/cjs/{string-helper-d681e5c7.js → string-helper-fda7cbba.js} +5 -5
- package/dist/cjs/tooltip-helper-0eb3ef13.js +157 -0
- package/dist/cjs/{validators-26badb68.js → validators-97a46a9e.js} +6 -1
- package/dist/cjs/watermark-2c23c8f1.js +47499 -0
- package/dist/collection/assets/csv.svg +9 -0
- package/dist/collection/assets/excel.svg +9 -0
- package/dist/collection/assets/pdf.svg +9 -0
- package/dist/collection/collection-manifest.json +5 -2
- package/dist/collection/components/atoms/avatar/avatar.js +21 -23
- package/dist/collection/components/atoms/avatar/avatar.style.js +24 -21
- package/dist/collection/components/atoms/badge/badge.js +2 -1
- package/dist/collection/components/atoms/badge/badge.style.js +36 -24
- package/dist/collection/components/atoms/button/button.css +55 -0
- package/dist/collection/components/atoms/button/button.js +1 -1
- package/dist/collection/components/atoms/icon/static/message-bot.svg +2 -2
- package/dist/collection/components/molecules/dropdown/dropdown.js +1 -1
- package/dist/collection/components/molecules/input/input.js +0 -2
- package/dist/collection/components/molecules/input-dropdown/input-dropdown.css +291 -0
- package/dist/collection/components/molecules/input-dropdown/input-dropdown.js +751 -0
- package/dist/collection/components/molecules/input-dropdown/input-dropdown.style.js +73 -0
- package/dist/collection/components/molecules/linked/linked.js +5 -29
- package/dist/collection/components/molecules/popconfirm/popconfirm.js +1 -1
- package/dist/collection/components/molecules/popover/popover.js +1 -1
- package/dist/collection/components/molecules/tooltip/tooltip.js +1 -1
- package/dist/collection/components/organism/date-picker/date-picker.css +1 -1
- package/dist/collection/components/organism/date-picker/date-picker.js +20 -1
- package/dist/collection/components/organism/datetime-picker/datetime-picker.css +13 -1
- package/dist/collection/components/organism/datetime-picker/datetime-picker.js +21 -1
- package/dist/collection/components/organism/form/form.js +1 -0
- package/dist/collection/components/organism/form-2/bcm-form-components.js +4 -1
- package/dist/collection/components/organism/list/list.css +1 -1
- package/dist/collection/components/organism/list/list.js +63 -22
- package/dist/collection/components/organism/time-picker/time-picker.css +1 -1
- package/dist/collection/components/organism/time-picker/time-picker.js +20 -1
- package/dist/collection/components/other/toast/toast.js +48 -11
- package/dist/collection/components/other_deprecated/old-popover/old-popover.js +1 -1
- package/dist/collection/components/third-parts/rc-picker/date.js +862 -0
- package/dist/collection/components/third-parts/rc-picker/rc-picker.css +1009 -0
- package/dist/collection/components/third-parts/rc-picker/rc-picker.js +550 -0
- package/dist/collection/components/third-parts/table/table-definations.js +42 -0
- package/dist/collection/components/third-parts/table/table.css +136 -0
- package/dist/collection/components/third-parts/table/table.js +288 -0
- package/dist/collection/decorators/bcm-decorator.js +28 -0
- package/dist/collection/decorators/event-decorator.js +31 -0
- package/dist/collection/decorators/index.js +1 -0
- package/dist/collection/decorators/is-load-decorator.js +2 -1
- package/dist/collection/global/global.js +6 -0
- package/dist/collection/global/helper/toast.js +1 -0
- package/dist/collection/global/helper/toast.ts +2 -0
- package/dist/collection/helper/string-helper.js +2 -2
- package/dist/collection/models/bcm.js +29 -27
- package/dist/collection/templates/index.js +2 -0
- package/dist/collection/templates/toolbar-hamburger-template.js +14 -0
- package/dist/collection/templates/toolbar-template.js +15 -0
- package/dist/components/_commonjsHelpers.js +16 -1
- package/dist/components/avatar.js +46 -44
- package/dist/components/badge.js +39 -70
- package/dist/components/bcm-chip-group.js +14 -8
- package/dist/components/bcm-date-picker.js +4 -2
- package/dist/components/bcm-date.d.ts +11 -0
- package/dist/components/bcm-date.js +232 -0
- package/dist/components/bcm-form-2.js +4 -1
- package/dist/components/bcm-form.js +1 -0
- package/dist/components/bcm-input-dropdown.d.ts +11 -0
- package/dist/components/bcm-input-dropdown.js +395 -0
- package/dist/components/bcm-rc-picker.d.ts +11 -0
- package/dist/components/bcm-rc-picker.js +10 -0
- package/dist/components/bcm-table.js +55128 -41
- package/dist/components/bcm-textarea.js +1 -214
- package/dist/components/bcm-time-picker.js +4 -2
- package/dist/components/bcm-toast.js +30 -10
- package/dist/components/bcm.js +29 -27
- package/dist/components/button.js +1 -1
- package/dist/components/chip.js +12 -6
- package/dist/components/colors2.js +1 -1
- package/dist/components/datetime-picker.js +5 -2
- package/dist/components/generate.js +1 -1
- package/dist/components/index.d.ts +4 -1
- package/dist/components/index.js +9 -1
- package/dist/components/index3.js +5 -1
- package/dist/components/index5.js +2569 -0
- package/dist/components/input.js +0 -2
- package/dist/components/is-load-decorator.js +2 -1
- package/dist/components/linked.js +5 -11
- package/dist/components/list.js +22 -8
- package/dist/components/raf.js +1594 -0
- package/dist/components/rc-overflow.js +32 -1557
- package/dist/components/rc-picker.js +14030 -0
- package/dist/components/string-helper.js +2 -2
- package/dist/components/textarea.js +220 -0
- package/dist/esm/{_commonjsHelpers-3016b722.js → _commonjsHelpers-7002e5de.js} +16 -1
- package/dist/esm/bcm-accordion.entry.js +5 -5
- package/dist/esm/bcm-alert.entry.js +9 -9
- package/dist/esm/bcm-attendance.entry.js +5 -5
- package/dist/esm/bcm-autocomplete.entry.js +3 -3
- package/dist/esm/bcm-avatar_2.entry.js +204 -0
- package/dist/esm/bcm-box.entry.js +1 -1
- package/dist/esm/bcm-breadcrumb.entry.js +6 -6
- package/dist/esm/bcm-button-group.entry.js +8 -8
- package/dist/esm/bcm-button_15.entry.js +35154 -0
- package/dist/esm/bcm-card.entry.js +11 -11
- package/dist/esm/bcm-checkbox-group.entry.js +19 -19
- package/dist/esm/bcm-checkbox-lite_9.entry.js +8 -8
- package/dist/esm/{bcm-checkbox.entry.js → bcm-checkbox_2.entry.js} +24 -14
- package/dist/esm/bcm-chip-group.entry.js +16 -17
- package/dist/esm/bcm-chip.entry.js +8 -8
- package/dist/esm/bcm-collapse-group.entry.js +2 -2
- package/dist/esm/bcm-collapse.entry.js +6 -6
- package/dist/esm/bcm-color-input.entry.js +12 -13
- package/dist/esm/bcm-colorpicker.entry.js +5 -5
- package/dist/esm/bcm-content.entry.js +1 -1
- package/dist/esm/{bcm-9f50af9c.js → bcm-d45dc47d.js} +30 -28
- package/dist/esm/bcm-default.entry.js +5 -5
- package/dist/esm/bcm-drawer.entry.js +13 -14
- package/dist/esm/bcm-dropdown.entry.js +115 -0
- package/dist/esm/bcm-error-layout.entry.js +3 -3
- package/dist/esm/bcm-expansion-panel.entry.js +10 -10
- package/dist/esm/bcm-form-group.entry.js +1 -1
- package/dist/esm/bcm-input-custom.entry.js +6 -6
- package/dist/esm/bcm-input-dropdown.entry.js +305 -0
- package/dist/esm/bcm-item.entry.js +68 -0
- package/dist/esm/bcm-items.entry.js +45 -0
- package/dist/esm/bcm-link.entry.js +4 -4
- package/dist/esm/bcm-list_3.entry.js +93 -1615
- package/dist/esm/bcm-menu.entry.js +146 -0
- package/dist/esm/bcm-message.entry.js +3 -3
- package/dist/esm/bcm-modal-2-footer.entry.js +13 -14
- package/dist/esm/bcm-modal-2-header.entry.js +12 -13
- package/dist/esm/bcm-modal-2.entry.js +13 -14
- package/dist/esm/bcm-modal.entry.js +9 -9
- package/dist/esm/bcm-notification.entry.js +3 -3
- package/dist/esm/bcm-old-tag_2.entry.js +4 -4
- package/dist/esm/bcm-overlay_2.entry.js +4 -4
- package/dist/esm/bcm-popconfirm-box.entry.js +11 -11
- package/dist/esm/bcm-popconfirm.entry.js +7 -7
- package/dist/esm/bcm-popover.entry.js +225 -0
- package/dist/esm/bcm-progress.entry.js +9 -9
- package/dist/esm/bcm-radio-group.entry.js +15 -16
- package/dist/esm/bcm-radio.entry.js +13 -14
- package/dist/esm/bcm-range.entry.js +8 -8
- package/dist/esm/bcm-result.entry.js +3 -3
- package/dist/esm/bcm-select-group.entry.js +3 -3
- package/dist/esm/bcm-select-option.entry.js +3 -3
- package/dist/esm/bcm-select.entry.js +6 -6
- package/dist/esm/bcm-skeleton.entry.js +5 -5
- package/dist/esm/bcm-step.entry.js +8 -8
- package/dist/esm/bcm-stepper.entry.js +15 -16
- package/dist/esm/bcm-switch.entry.js +10 -10
- package/dist/esm/bcm-tab-group.entry.js +205 -0
- package/dist/esm/bcm-tab-item-header.entry.js +54 -0
- package/dist/esm/bcm-tab-item.entry.js +86 -0
- package/dist/esm/bcm-tab-pane.entry.js +3 -3
- package/dist/esm/bcm-tab.entry.js +3 -3
- package/dist/esm/bcm-table.entry.js +7649 -39
- package/dist/esm/bcm-tabs-content.entry.js +4 -4
- package/dist/esm/bcm-tabs.entry.js +4 -4
- package/dist/esm/bcm-tag.entry.js +9 -9
- package/dist/esm/bcm-text.entry.js +45 -0
- package/dist/esm/bcm-textarea.entry.js +11 -11
- package/dist/esm/bcm-timeline-item.entry.js +3 -3
- package/dist/esm/bcm-timeline.entry.js +3 -3
- package/dist/esm/bcm-toast.entry.js +38 -19
- package/dist/esm/bcm-treeview-group.entry.js +1 -1
- package/dist/esm/bromcom-ui.js +6 -5
- package/dist/esm/{caption-template-34a1cb44.js → caption-template-d47f338f.js} +2 -2
- package/dist/esm/{color-helper-116755ed.js → color-helper-845ba523.js} +2 -2
- package/dist/esm/{colors-44c95e7e.js → colors-ebea297f.js} +1 -1
- package/dist/esm/{element-dragger-7ea06c76.js → element-dragger-89bb52fd.js} +1 -1
- package/dist/esm/{floating-ui-e7341329.js → floating-ui-8a0c54d6.js} +1 -1
- package/dist/esm/{generate-e008f24f.js → generate-7a1258c4.js} +2 -2
- package/dist/esm/{global-9c04f017.js → global-032592ad.js} +6 -1
- package/dist/esm/{index-ed9652af.js → index-00c8a8f7.js} +1 -1
- package/dist/esm/{index-348b16ad.js → index-0615c2b8.js} +3 -1
- package/dist/esm/index-3bc8c6e3.js +2569 -0
- package/dist/esm/{index-0052017c.js → index-7e71bbc8.js} +1 -1
- package/dist/esm/{index-6310a048.js → index-e4b6a4ce.js} +1616 -26
- package/dist/esm/{input-template-0bdd4dda.js → input-template-68c29fde.js} +4 -4
- package/dist/esm/{is-load-decorator-07d3502a.js → is-load-decorator-8277e3b8.js} +3 -2
- package/dist/esm/{json-parse-decarator-40fc5701.js → json-parse-decarator-2945634b.js} +2 -2
- package/dist/esm/{label-template-98dafeb3.js → label-template-946d4062.js} +4 -4
- package/dist/esm/loader.js +6 -5
- package/dist/esm/{number-helper-ddce4326.js → number-helper-fe7d1aca.js} +1 -1
- package/dist/esm/old-bcm-popover-box.entry.js +13 -13
- package/dist/esm/old-bcm-popover.entry.js +7 -7
- package/dist/esm/{package-00ece356.js → package-acbf2052.js} +1 -1
- package/dist/esm/{popover-placement-78f86f15.js → popover-placement-be68c848.js} +1 -1
- package/dist/esm/{slot-template-672e941d.js → slot-template-fcc7846e.js} +2 -2
- package/dist/esm/{stepper-states-56644bc7.js → stepper-states-9ab8511e.js} +3 -3
- package/dist/esm/{string-helper-6bd24967.js → string-helper-b0e05041.js} +4 -4
- package/dist/esm/tooltip-helper-e5246812.js +155 -0
- package/dist/esm/{utils-b3338faf.js → utils-57652744.js} +1 -1
- package/dist/esm/{validators-77fbe47e.js → validators-22975416.js} +6 -2
- package/dist/esm/watermark-f2c6a1f9.js +47477 -0
- package/dist/types/components/atoms/avatar/avatar.d.ts +0 -2
- package/dist/types/components/atoms/avatar/avatar.style.d.ts +181 -5
- package/dist/types/components/atoms/badge/badge.style.d.ts +174 -4
- package/dist/types/components/molecules/input-dropdown/input-dropdown.d.ts +51 -0
- package/dist/types/components/molecules/input-dropdown/input-dropdown.style.d.ts +307 -0
- package/dist/types/components/molecules/linked/linked.d.ts +1 -3
- package/dist/types/components/organism/date-picker/date-picker.d.ts +1 -0
- package/dist/types/components/organism/datetime-picker/datetime-picker.d.ts +1 -0
- package/dist/types/components/organism/list/list.d.ts +4 -0
- package/dist/types/components/organism/time-picker/time-picker.d.ts +1 -0
- package/dist/types/components/other/toast/toast.d.ts +2 -0
- package/dist/types/components/third-parts/rc-picker/date.d.ts +175 -0
- package/dist/types/components/third-parts/rc-picker/rc-picker.d.ts +47 -0
- package/dist/types/components/third-parts/table/table-definations.d.ts +28 -0
- package/dist/types/components/third-parts/table/table.d.ts +37 -0
- package/dist/types/components.d.ts +244 -3
- package/dist/types/decorators/bcm-decorator.d.ts +2 -0
- package/dist/types/decorators/event-decorator.d.ts +2 -0
- package/dist/types/decorators/index.d.ts +1 -0
- package/dist/types/global/helper/toast.d.ts +2 -0
- package/dist/types/models/bcm.d.ts +256 -236
- package/dist/types/templates/index.d.ts +2 -0
- package/dist/types/templates/toolbar-hamburger-template.d.ts +12 -0
- package/dist/types/templates/toolbar-template.d.ts +13 -0
- package/helper/toast.d.ts +2 -0
- package/helper/toast.d.ts.map +1 -1
- package/helper/toast.js +1 -0
- package/package.json +9 -3
- package/dist/bromcom-ui/p-019b44bb.entry.js +0 -5
- package/dist/bromcom-ui/p-01a50abe.entry.js +0 -5
- package/dist/bromcom-ui/p-065e0f32.entry.js +0 -5
- package/dist/bromcom-ui/p-0cb5a92d.entry.js +0 -5
- package/dist/bromcom-ui/p-0f52bab9.entry.js +0 -5
- package/dist/bromcom-ui/p-15758356.entry.js +0 -5
- package/dist/bromcom-ui/p-1eabd5dc.js +0 -10
- package/dist/bromcom-ui/p-235023cc.entry.js +0 -5
- package/dist/bromcom-ui/p-2a7bdc8b.entry.js +0 -5
- package/dist/bromcom-ui/p-32028f4f.entry.js +0 -5
- package/dist/bromcom-ui/p-3a68eca1.js +0 -5
- package/dist/bromcom-ui/p-4484ed7d.entry.js +0 -5
- package/dist/bromcom-ui/p-4f8b00bc.entry.js +0 -5
- package/dist/bromcom-ui/p-4fd78dbb.entry.js +0 -5
- package/dist/bromcom-ui/p-54c0916c.js +0 -5
- package/dist/bromcom-ui/p-5d89f348.entry.js +0 -5
- package/dist/bromcom-ui/p-61c4745d.entry.js +0 -5
- package/dist/bromcom-ui/p-626a65e9.js +0 -5
- package/dist/bromcom-ui/p-663766cf.entry.js +0 -5
- package/dist/bromcom-ui/p-6d7fe687.js +0 -6
- package/dist/bromcom-ui/p-6f56f8ca.js +0 -5
- package/dist/bromcom-ui/p-74b2d896.js +0 -5
- package/dist/bromcom-ui/p-7f529bbe.entry.js +0 -5
- package/dist/bromcom-ui/p-9fe802bc.entry.js +0 -5
- package/dist/bromcom-ui/p-a19320bb.entry.js +0 -13
- package/dist/bromcom-ui/p-a429e85b.js +0 -5
- package/dist/bromcom-ui/p-a56e8c98.js +0 -5
- package/dist/bromcom-ui/p-a8033cda.entry.js +0 -5
- package/dist/bromcom-ui/p-a9692ed3.entry.js +0 -5
- package/dist/bromcom-ui/p-b1c83bb8.entry.js +0 -5
- package/dist/bromcom-ui/p-bddbd954.entry.js +0 -5
- package/dist/bromcom-ui/p-c49d038e.js +0 -5
- package/dist/bromcom-ui/p-c799b397.entry.js +0 -5
- package/dist/bromcom-ui/p-cf0ab7f0.entry.js +0 -5
- package/dist/bromcom-ui/p-d65a1e21.js +0 -11
- package/dist/bromcom-ui/p-d7f10f7f.js +0 -5
- package/dist/bromcom-ui/p-dd422dd1.js +0 -5
- package/dist/bromcom-ui/p-e09fa0dc.entry.js +0 -5
- package/dist/bromcom-ui/p-e32d9cfc.js +0 -5
- package/dist/bromcom-ui/p-ec6b45ba.entry.js +0 -5
- package/dist/bromcom-ui/p-f645d9ae.entry.js +0 -5
- package/dist/bromcom-ui/p-fdc3e5b8.entry.js +0 -5
- package/dist/cjs/bcm-avatar.cjs.entry.js +0 -127
- package/dist/cjs/bcm-badge_15.cjs.entry.js +0 -1739
- package/dist/cjs/bcm-colorful.cjs.entry.js +0 -17227
- package/dist/cjs/bcm-date-picker.cjs.entry.js +0 -181
- package/dist/cjs/bcm-datetime-picker.cjs.entry.js +0 -1449
- package/dist/cjs/bcm-form-2.cjs.entry.js +0 -209
- package/dist/cjs/bcm-form.cjs.entry.js +0 -488
- package/dist/cjs/bcm-input.cjs.entry.js +0 -371
- package/dist/cjs/bcm-label.cjs.entry.js +0 -45
- package/dist/cjs/bcm-old-input.cjs.entry.js +0 -397
- package/dist/cjs/bcm-time-picker.cjs.entry.js +0 -149
- package/dist/cjs/datetime-helper-eaf4fadb.js +0 -11
- package/dist/cjs/index-b08b037a.js +0 -52
- package/dist/collection/components/other/data-table/table.css +0 -130
- package/dist/collection/components/other/data-table/table.js +0 -88
- package/dist/esm/bcm-avatar.entry.js +0 -123
- package/dist/esm/bcm-badge_15.entry.js +0 -1721
- package/dist/esm/bcm-colorful.entry.js +0 -17223
- package/dist/esm/bcm-date-picker.entry.js +0 -177
- package/dist/esm/bcm-datetime-picker.entry.js +0 -1445
- package/dist/esm/bcm-form-2.entry.js +0 -205
- package/dist/esm/bcm-form.entry.js +0 -484
- package/dist/esm/bcm-input.entry.js +0 -367
- package/dist/esm/bcm-label.entry.js +0 -41
- package/dist/esm/bcm-old-input.entry.js +0 -393
- package/dist/esm/bcm-time-picker.entry.js +0 -145
- package/dist/esm/datetime-helper-df25808a.js +0 -9
- package/dist/esm/index-962dec74.js +0 -50
- package/dist/types/components/other/data-table/table.d.ts +0 -8
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Built with Stencil
|
|
3
3
|
* Copyright (c) Bromcom.
|
|
4
4
|
*/
|
|
5
|
-
import { proxyCustomElement, HTMLElement
|
|
5
|
+
import { proxyCustomElement, HTMLElement, createEvent } from '@stencil/core/internal/client';
|
|
6
6
|
import './color-helper.js';
|
|
7
7
|
import './validators.js';
|
|
8
8
|
import { G as Generate } from './generate.js';
|
|
@@ -12,12 +12,12 @@ import './element-dragger.js';
|
|
|
12
12
|
import './bcm.js';
|
|
13
13
|
import { r as react, a as reactDom } from './index3.js';
|
|
14
14
|
import { c as classnames } from './index2.js';
|
|
15
|
-
import {
|
|
15
|
+
import { R as RefResizeObserver, w as wrapperRaf, u as useEvent, a as useLayoutEffect } from './raf.js';
|
|
16
16
|
import { d as defineCustomElement$2 } from './icon.js';
|
|
17
17
|
import { d as defineCustomElement$1 } from './tooltip.js';
|
|
18
18
|
|
|
19
|
-
function _extends
|
|
20
|
-
_extends
|
|
19
|
+
function _extends() {
|
|
20
|
+
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
21
21
|
for (var i = 1; i < arguments.length; i++) {
|
|
22
22
|
var source = arguments[i];
|
|
23
23
|
for (var key in source) {
|
|
@@ -28,37 +28,37 @@ function _extends$1() {
|
|
|
28
28
|
}
|
|
29
29
|
return target;
|
|
30
30
|
};
|
|
31
|
-
return _extends
|
|
31
|
+
return _extends.apply(this, arguments);
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
function _typeof
|
|
34
|
+
function _typeof(obj) {
|
|
35
35
|
"@babel/helpers - typeof";
|
|
36
36
|
|
|
37
|
-
return _typeof
|
|
37
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
38
38
|
return typeof obj;
|
|
39
39
|
} : function (obj) {
|
|
40
40
|
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
41
|
-
}, _typeof
|
|
41
|
+
}, _typeof(obj);
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
function _toPrimitive
|
|
45
|
-
if (_typeof
|
|
44
|
+
function _toPrimitive(input, hint) {
|
|
45
|
+
if (_typeof(input) !== "object" || input === null) return input;
|
|
46
46
|
var prim = input[Symbol.toPrimitive];
|
|
47
47
|
if (prim !== undefined) {
|
|
48
48
|
var res = prim.call(input, hint || "default");
|
|
49
|
-
if (_typeof
|
|
49
|
+
if (_typeof(res) !== "object") return res;
|
|
50
50
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
51
51
|
}
|
|
52
52
|
return (hint === "string" ? String : Number)(input);
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
function _toPropertyKey
|
|
56
|
-
var key = _toPrimitive
|
|
57
|
-
return _typeof
|
|
55
|
+
function _toPropertyKey(arg) {
|
|
56
|
+
var key = _toPrimitive(arg, "string");
|
|
57
|
+
return _typeof(key) === "symbol" ? key : String(key);
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
function _defineProperty
|
|
61
|
-
key = _toPropertyKey
|
|
60
|
+
function _defineProperty(obj, key, value) {
|
|
61
|
+
key = _toPropertyKey(key);
|
|
62
62
|
if (key in obj) {
|
|
63
63
|
Object.defineProperty(obj, key, {
|
|
64
64
|
value: value,
|
|
@@ -72,7 +72,7 @@ function _defineProperty$1(obj, key, value) {
|
|
|
72
72
|
return obj;
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
function ownKeys
|
|
75
|
+
function ownKeys(object, enumerableOnly) {
|
|
76
76
|
var keys = Object.keys(object);
|
|
77
77
|
if (Object.getOwnPropertySymbols) {
|
|
78
78
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
@@ -82,12 +82,12 @@ function ownKeys$1(object, enumerableOnly) {
|
|
|
82
82
|
}
|
|
83
83
|
return keys;
|
|
84
84
|
}
|
|
85
|
-
function _objectSpread2
|
|
85
|
+
function _objectSpread2(target) {
|
|
86
86
|
for (var i = 1; i < arguments.length; i++) {
|
|
87
87
|
var source = null != arguments[i] ? arguments[i] : {};
|
|
88
|
-
i % 2 ? ownKeys
|
|
89
|
-
_defineProperty
|
|
90
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys
|
|
88
|
+
i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
|
|
89
|
+
_defineProperty(target, key, source[key]);
|
|
90
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
|
|
91
91
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
92
92
|
});
|
|
93
93
|
}
|
|
@@ -178,1469 +178,6 @@ function _objectWithoutProperties(source, excluded) {
|
|
|
178
178
|
return target;
|
|
179
179
|
}
|
|
180
180
|
|
|
181
|
-
function _extends() {
|
|
182
|
-
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
183
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
184
|
-
var source = arguments[i];
|
|
185
|
-
for (var key in source) {
|
|
186
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
187
|
-
target[key] = source[key];
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
return target;
|
|
192
|
-
};
|
|
193
|
-
return _extends.apply(this, arguments);
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
/** @license React v16.13.1
|
|
197
|
-
* react-is.production.min.js
|
|
198
|
-
*
|
|
199
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
200
|
-
*
|
|
201
|
-
* This source code is licensed under the MIT license found in the
|
|
202
|
-
* LICENSE file in the root directory of this source tree.
|
|
203
|
-
*/
|
|
204
|
-
var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b?
|
|
205
|
-
Symbol.for("react.suspense_list"):60120,r=b?Symbol.for("react.memo"):60115,t=b?Symbol.for("react.lazy"):60116,v=b?Symbol.for("react.block"):60121,w=b?Symbol.for("react.fundamental"):60117,x=b?Symbol.for("react.responder"):60118,y=b?Symbol.for("react.scope"):60119;
|
|
206
|
-
function z(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}var AsyncMode=l;var ConcurrentMode=m;var ContextConsumer=k;var ContextProvider=h;var Element$1=c;var ForwardRef=n;var Fragment=e;var Lazy=t;var Memo=r;var Portal=d;
|
|
207
|
-
var Profiler=g;var StrictMode=f;var Suspense=p;var isAsyncMode=function(a){return A(a)||z(a)===l};var isConcurrentMode=A;var isContextConsumer=function(a){return z(a)===k};var isContextProvider=function(a){return z(a)===h};var isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===c};var isForwardRef=function(a){return z(a)===n};var isFragment=function(a){return z(a)===e};var isLazy=function(a){return z(a)===t};
|
|
208
|
-
var isMemo=function(a){return z(a)===r};var isPortal=function(a){return z(a)===d};var isProfiler=function(a){return z(a)===g};var isStrictMode=function(a){return z(a)===f};var isSuspense=function(a){return z(a)===p};
|
|
209
|
-
var isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};var typeOf=z;
|
|
210
|
-
|
|
211
|
-
var reactIs_production_min = {
|
|
212
|
-
AsyncMode: AsyncMode,
|
|
213
|
-
ConcurrentMode: ConcurrentMode,
|
|
214
|
-
ContextConsumer: ContextConsumer,
|
|
215
|
-
ContextProvider: ContextProvider,
|
|
216
|
-
Element: Element$1,
|
|
217
|
-
ForwardRef: ForwardRef,
|
|
218
|
-
Fragment: Fragment,
|
|
219
|
-
Lazy: Lazy,
|
|
220
|
-
Memo: Memo,
|
|
221
|
-
Portal: Portal,
|
|
222
|
-
Profiler: Profiler,
|
|
223
|
-
StrictMode: StrictMode,
|
|
224
|
-
Suspense: Suspense,
|
|
225
|
-
isAsyncMode: isAsyncMode,
|
|
226
|
-
isConcurrentMode: isConcurrentMode,
|
|
227
|
-
isContextConsumer: isContextConsumer,
|
|
228
|
-
isContextProvider: isContextProvider,
|
|
229
|
-
isElement: isElement,
|
|
230
|
-
isForwardRef: isForwardRef,
|
|
231
|
-
isFragment: isFragment,
|
|
232
|
-
isLazy: isLazy,
|
|
233
|
-
isMemo: isMemo,
|
|
234
|
-
isPortal: isPortal,
|
|
235
|
-
isProfiler: isProfiler,
|
|
236
|
-
isStrictMode: isStrictMode,
|
|
237
|
-
isSuspense: isSuspense,
|
|
238
|
-
isValidElementType: isValidElementType,
|
|
239
|
-
typeOf: typeOf
|
|
240
|
-
};
|
|
241
|
-
|
|
242
|
-
createCommonjsModule(function (module, exports) {
|
|
243
|
-
});
|
|
244
|
-
|
|
245
|
-
var reactIs = createCommonjsModule(function (module) {
|
|
246
|
-
|
|
247
|
-
{
|
|
248
|
-
module.exports = reactIs_production_min;
|
|
249
|
-
}
|
|
250
|
-
});
|
|
251
|
-
|
|
252
|
-
function toArray(children) {
|
|
253
|
-
var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
254
|
-
var ret = [];
|
|
255
|
-
react.Children.forEach(children, function (child) {
|
|
256
|
-
if ((child === undefined || child === null) && !option.keepEmpty) {
|
|
257
|
-
return;
|
|
258
|
-
}
|
|
259
|
-
if (Array.isArray(child)) {
|
|
260
|
-
ret = ret.concat(toArray(child));
|
|
261
|
-
} else if (reactIs.isFragment(child) && child.props) {
|
|
262
|
-
ret = ret.concat(toArray(child.props.children, option));
|
|
263
|
-
} else {
|
|
264
|
-
ret.push(child);
|
|
265
|
-
}
|
|
266
|
-
});
|
|
267
|
-
return ret;
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
function _typeof$1(obj) {
|
|
271
|
-
"@babel/helpers - typeof";
|
|
272
|
-
|
|
273
|
-
return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
274
|
-
return typeof obj;
|
|
275
|
-
} : function (obj) {
|
|
276
|
-
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
277
|
-
}, _typeof$1(obj);
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
function _toPrimitive(input, hint) {
|
|
281
|
-
if (_typeof$1(input) !== "object" || input === null) return input;
|
|
282
|
-
var prim = input[Symbol.toPrimitive];
|
|
283
|
-
if (prim !== undefined) {
|
|
284
|
-
var res = prim.call(input, hint || "default");
|
|
285
|
-
if (_typeof$1(res) !== "object") return res;
|
|
286
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
287
|
-
}
|
|
288
|
-
return (hint === "string" ? String : Number)(input);
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
function _toPropertyKey(arg) {
|
|
292
|
-
var key = _toPrimitive(arg, "string");
|
|
293
|
-
return _typeof$1(key) === "symbol" ? key : String(key);
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
function _defineProperty(obj, key, value) {
|
|
297
|
-
key = _toPropertyKey(key);
|
|
298
|
-
if (key in obj) {
|
|
299
|
-
Object.defineProperty(obj, key, {
|
|
300
|
-
value: value,
|
|
301
|
-
enumerable: true,
|
|
302
|
-
configurable: true,
|
|
303
|
-
writable: true
|
|
304
|
-
});
|
|
305
|
-
} else {
|
|
306
|
-
obj[key] = value;
|
|
307
|
-
}
|
|
308
|
-
return obj;
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
function ownKeys(object, enumerableOnly) {
|
|
312
|
-
var keys = Object.keys(object);
|
|
313
|
-
if (Object.getOwnPropertySymbols) {
|
|
314
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
315
|
-
enumerableOnly && (symbols = symbols.filter(function (sym) {
|
|
316
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
317
|
-
})), keys.push.apply(keys, symbols);
|
|
318
|
-
}
|
|
319
|
-
return keys;
|
|
320
|
-
}
|
|
321
|
-
function _objectSpread2(target) {
|
|
322
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
323
|
-
var source = null != arguments[i] ? arguments[i] : {};
|
|
324
|
-
i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
|
|
325
|
-
_defineProperty(target, key, source[key]);
|
|
326
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
|
|
327
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
328
|
-
});
|
|
329
|
-
}
|
|
330
|
-
return target;
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
function _typeof(obj) {
|
|
334
|
-
"@babel/helpers - typeof";
|
|
335
|
-
|
|
336
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
337
|
-
return typeof obj;
|
|
338
|
-
} : function (obj) {
|
|
339
|
-
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
340
|
-
}, _typeof(obj);
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
function fillRef(ref, node) {
|
|
344
|
-
if (typeof ref === 'function') {
|
|
345
|
-
ref(node);
|
|
346
|
-
} else if (_typeof(ref) === 'object' && ref && 'current' in ref) {
|
|
347
|
-
ref.current = node;
|
|
348
|
-
}
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
/**
|
|
352
|
-
* Merge refs into one ref function to support ref passing.
|
|
353
|
-
*/
|
|
354
|
-
function composeRef() {
|
|
355
|
-
for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
356
|
-
refs[_key] = arguments[_key];
|
|
357
|
-
}
|
|
358
|
-
var refList = refs.filter(function (ref) {
|
|
359
|
-
return ref;
|
|
360
|
-
});
|
|
361
|
-
if (refList.length <= 1) {
|
|
362
|
-
return refList[0];
|
|
363
|
-
}
|
|
364
|
-
return function (node) {
|
|
365
|
-
refs.forEach(function (ref) {
|
|
366
|
-
fillRef(ref, node);
|
|
367
|
-
});
|
|
368
|
-
};
|
|
369
|
-
}
|
|
370
|
-
function supportRef(nodeOrComponent) {
|
|
371
|
-
var _type$prototype, _nodeOrComponent$prot;
|
|
372
|
-
var type = reactIs.isMemo(nodeOrComponent) ? nodeOrComponent.type.type : nodeOrComponent.type;
|
|
373
|
-
|
|
374
|
-
// Function component node
|
|
375
|
-
if (typeof type === 'function' && !((_type$prototype = type.prototype) !== null && _type$prototype !== void 0 && _type$prototype.render)) {
|
|
376
|
-
return false;
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
// Class component
|
|
380
|
-
if (typeof nodeOrComponent === 'function' && !((_nodeOrComponent$prot = nodeOrComponent.prototype) !== null && _nodeOrComponent$prot !== void 0 && _nodeOrComponent$prot.render)) {
|
|
381
|
-
return false;
|
|
382
|
-
}
|
|
383
|
-
return true;
|
|
384
|
-
}
|
|
385
|
-
/* eslint-enable */
|
|
386
|
-
|
|
387
|
-
function isDOM(node) {
|
|
388
|
-
// https://developer.mozilla.org/en-US/docs/Web/API/Element
|
|
389
|
-
// Since XULElement is also subclass of Element, we only need HTMLElement and SVGElement
|
|
390
|
-
return node instanceof HTMLElement || node instanceof SVGElement;
|
|
391
|
-
}
|
|
392
|
-
|
|
393
|
-
/**
|
|
394
|
-
* Return if a node is a DOM node. Else will return by `findDOMNode`
|
|
395
|
-
*/
|
|
396
|
-
function findDOMNode(node) {
|
|
397
|
-
if (isDOM(node)) {
|
|
398
|
-
return node;
|
|
399
|
-
}
|
|
400
|
-
if (node instanceof react.Component) {
|
|
401
|
-
return reactDom.findDOMNode(node);
|
|
402
|
-
}
|
|
403
|
-
return null;
|
|
404
|
-
}
|
|
405
|
-
|
|
406
|
-
/**
|
|
407
|
-
* A collection of shims that provide minimal functionality of the ES6 collections.
|
|
408
|
-
*
|
|
409
|
-
* These implementations are not meant to be used outside of the ResizeObserver
|
|
410
|
-
* modules as they cover only a limited range of use cases.
|
|
411
|
-
*/
|
|
412
|
-
/* eslint-disable require-jsdoc, valid-jsdoc */
|
|
413
|
-
var MapShim = (function () {
|
|
414
|
-
if (typeof Map !== 'undefined') {
|
|
415
|
-
return Map;
|
|
416
|
-
}
|
|
417
|
-
/**
|
|
418
|
-
* Returns index in provided array that matches the specified key.
|
|
419
|
-
*
|
|
420
|
-
* @param {Array<Array>} arr
|
|
421
|
-
* @param {*} key
|
|
422
|
-
* @returns {number}
|
|
423
|
-
*/
|
|
424
|
-
function getIndex(arr, key) {
|
|
425
|
-
var result = -1;
|
|
426
|
-
arr.some(function (entry, index) {
|
|
427
|
-
if (entry[0] === key) {
|
|
428
|
-
result = index;
|
|
429
|
-
return true;
|
|
430
|
-
}
|
|
431
|
-
return false;
|
|
432
|
-
});
|
|
433
|
-
return result;
|
|
434
|
-
}
|
|
435
|
-
return /** @class */ (function () {
|
|
436
|
-
function class_1() {
|
|
437
|
-
this.__entries__ = [];
|
|
438
|
-
}
|
|
439
|
-
Object.defineProperty(class_1.prototype, "size", {
|
|
440
|
-
/**
|
|
441
|
-
* @returns {boolean}
|
|
442
|
-
*/
|
|
443
|
-
get: function () {
|
|
444
|
-
return this.__entries__.length;
|
|
445
|
-
},
|
|
446
|
-
enumerable: true,
|
|
447
|
-
configurable: true
|
|
448
|
-
});
|
|
449
|
-
/**
|
|
450
|
-
* @param {*} key
|
|
451
|
-
* @returns {*}
|
|
452
|
-
*/
|
|
453
|
-
class_1.prototype.get = function (key) {
|
|
454
|
-
var index = getIndex(this.__entries__, key);
|
|
455
|
-
var entry = this.__entries__[index];
|
|
456
|
-
return entry && entry[1];
|
|
457
|
-
};
|
|
458
|
-
/**
|
|
459
|
-
* @param {*} key
|
|
460
|
-
* @param {*} value
|
|
461
|
-
* @returns {void}
|
|
462
|
-
*/
|
|
463
|
-
class_1.prototype.set = function (key, value) {
|
|
464
|
-
var index = getIndex(this.__entries__, key);
|
|
465
|
-
if (~index) {
|
|
466
|
-
this.__entries__[index][1] = value;
|
|
467
|
-
}
|
|
468
|
-
else {
|
|
469
|
-
this.__entries__.push([key, value]);
|
|
470
|
-
}
|
|
471
|
-
};
|
|
472
|
-
/**
|
|
473
|
-
* @param {*} key
|
|
474
|
-
* @returns {void}
|
|
475
|
-
*/
|
|
476
|
-
class_1.prototype.delete = function (key) {
|
|
477
|
-
var entries = this.__entries__;
|
|
478
|
-
var index = getIndex(entries, key);
|
|
479
|
-
if (~index) {
|
|
480
|
-
entries.splice(index, 1);
|
|
481
|
-
}
|
|
482
|
-
};
|
|
483
|
-
/**
|
|
484
|
-
* @param {*} key
|
|
485
|
-
* @returns {void}
|
|
486
|
-
*/
|
|
487
|
-
class_1.prototype.has = function (key) {
|
|
488
|
-
return !!~getIndex(this.__entries__, key);
|
|
489
|
-
};
|
|
490
|
-
/**
|
|
491
|
-
* @returns {void}
|
|
492
|
-
*/
|
|
493
|
-
class_1.prototype.clear = function () {
|
|
494
|
-
this.__entries__.splice(0);
|
|
495
|
-
};
|
|
496
|
-
/**
|
|
497
|
-
* @param {Function} callback
|
|
498
|
-
* @param {*} [ctx=null]
|
|
499
|
-
* @returns {void}
|
|
500
|
-
*/
|
|
501
|
-
class_1.prototype.forEach = function (callback, ctx) {
|
|
502
|
-
if (ctx === void 0) { ctx = null; }
|
|
503
|
-
for (var _i = 0, _a = this.__entries__; _i < _a.length; _i++) {
|
|
504
|
-
var entry = _a[_i];
|
|
505
|
-
callback.call(ctx, entry[1], entry[0]);
|
|
506
|
-
}
|
|
507
|
-
};
|
|
508
|
-
return class_1;
|
|
509
|
-
}());
|
|
510
|
-
})();
|
|
511
|
-
|
|
512
|
-
/**
|
|
513
|
-
* Detects whether window and document objects are available in current environment.
|
|
514
|
-
*/
|
|
515
|
-
var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && window.document === document;
|
|
516
|
-
|
|
517
|
-
// Returns global object of a current environment.
|
|
518
|
-
var global$1 = (function () {
|
|
519
|
-
if (typeof global !== 'undefined' && global.Math === Math) {
|
|
520
|
-
return global;
|
|
521
|
-
}
|
|
522
|
-
if (typeof self !== 'undefined' && self.Math === Math) {
|
|
523
|
-
return self;
|
|
524
|
-
}
|
|
525
|
-
if (typeof window !== 'undefined' && window.Math === Math) {
|
|
526
|
-
return window;
|
|
527
|
-
}
|
|
528
|
-
// eslint-disable-next-line no-new-func
|
|
529
|
-
return Function('return this')();
|
|
530
|
-
})();
|
|
531
|
-
|
|
532
|
-
/**
|
|
533
|
-
* A shim for the requestAnimationFrame which falls back to the setTimeout if
|
|
534
|
-
* first one is not supported.
|
|
535
|
-
*
|
|
536
|
-
* @returns {number} Requests' identifier.
|
|
537
|
-
*/
|
|
538
|
-
var requestAnimationFrame$1 = (function () {
|
|
539
|
-
if (typeof requestAnimationFrame === 'function') {
|
|
540
|
-
// It's required to use a bounded function because IE sometimes throws
|
|
541
|
-
// an "Invalid calling object" error if rAF is invoked without the global
|
|
542
|
-
// object on the left hand side.
|
|
543
|
-
return requestAnimationFrame.bind(global$1);
|
|
544
|
-
}
|
|
545
|
-
return function (callback) { return setTimeout(function () { return callback(Date.now()); }, 1000 / 60); };
|
|
546
|
-
})();
|
|
547
|
-
|
|
548
|
-
// Defines minimum timeout before adding a trailing call.
|
|
549
|
-
var trailingTimeout = 2;
|
|
550
|
-
/**
|
|
551
|
-
* Creates a wrapper function which ensures that provided callback will be
|
|
552
|
-
* invoked only once during the specified delay period.
|
|
553
|
-
*
|
|
554
|
-
* @param {Function} callback - Function to be invoked after the delay period.
|
|
555
|
-
* @param {number} delay - Delay after which to invoke callback.
|
|
556
|
-
* @returns {Function}
|
|
557
|
-
*/
|
|
558
|
-
function throttle (callback, delay) {
|
|
559
|
-
var leadingCall = false, trailingCall = false, lastCallTime = 0;
|
|
560
|
-
/**
|
|
561
|
-
* Invokes the original callback function and schedules new invocation if
|
|
562
|
-
* the "proxy" was called during current request.
|
|
563
|
-
*
|
|
564
|
-
* @returns {void}
|
|
565
|
-
*/
|
|
566
|
-
function resolvePending() {
|
|
567
|
-
if (leadingCall) {
|
|
568
|
-
leadingCall = false;
|
|
569
|
-
callback();
|
|
570
|
-
}
|
|
571
|
-
if (trailingCall) {
|
|
572
|
-
proxy();
|
|
573
|
-
}
|
|
574
|
-
}
|
|
575
|
-
/**
|
|
576
|
-
* Callback invoked after the specified delay. It will further postpone
|
|
577
|
-
* invocation of the original function delegating it to the
|
|
578
|
-
* requestAnimationFrame.
|
|
579
|
-
*
|
|
580
|
-
* @returns {void}
|
|
581
|
-
*/
|
|
582
|
-
function timeoutCallback() {
|
|
583
|
-
requestAnimationFrame$1(resolvePending);
|
|
584
|
-
}
|
|
585
|
-
/**
|
|
586
|
-
* Schedules invocation of the original function.
|
|
587
|
-
*
|
|
588
|
-
* @returns {void}
|
|
589
|
-
*/
|
|
590
|
-
function proxy() {
|
|
591
|
-
var timeStamp = Date.now();
|
|
592
|
-
if (leadingCall) {
|
|
593
|
-
// Reject immediately following calls.
|
|
594
|
-
if (timeStamp - lastCallTime < trailingTimeout) {
|
|
595
|
-
return;
|
|
596
|
-
}
|
|
597
|
-
// Schedule new call to be in invoked when the pending one is resolved.
|
|
598
|
-
// This is important for "transitions" which never actually start
|
|
599
|
-
// immediately so there is a chance that we might miss one if change
|
|
600
|
-
// happens amids the pending invocation.
|
|
601
|
-
trailingCall = true;
|
|
602
|
-
}
|
|
603
|
-
else {
|
|
604
|
-
leadingCall = true;
|
|
605
|
-
trailingCall = false;
|
|
606
|
-
setTimeout(timeoutCallback, delay);
|
|
607
|
-
}
|
|
608
|
-
lastCallTime = timeStamp;
|
|
609
|
-
}
|
|
610
|
-
return proxy;
|
|
611
|
-
}
|
|
612
|
-
|
|
613
|
-
// Minimum delay before invoking the update of observers.
|
|
614
|
-
var REFRESH_DELAY = 20;
|
|
615
|
-
// A list of substrings of CSS properties used to find transition events that
|
|
616
|
-
// might affect dimensions of observed elements.
|
|
617
|
-
var transitionKeys = ['top', 'right', 'bottom', 'left', 'width', 'height', 'size', 'weight'];
|
|
618
|
-
// Check if MutationObserver is available.
|
|
619
|
-
var mutationObserverSupported = typeof MutationObserver !== 'undefined';
|
|
620
|
-
/**
|
|
621
|
-
* Singleton controller class which handles updates of ResizeObserver instances.
|
|
622
|
-
*/
|
|
623
|
-
var ResizeObserverController = /** @class */ (function () {
|
|
624
|
-
/**
|
|
625
|
-
* Creates a new instance of ResizeObserverController.
|
|
626
|
-
*
|
|
627
|
-
* @private
|
|
628
|
-
*/
|
|
629
|
-
function ResizeObserverController() {
|
|
630
|
-
/**
|
|
631
|
-
* Indicates whether DOM listeners have been added.
|
|
632
|
-
*
|
|
633
|
-
* @private {boolean}
|
|
634
|
-
*/
|
|
635
|
-
this.connected_ = false;
|
|
636
|
-
/**
|
|
637
|
-
* Tells that controller has subscribed for Mutation Events.
|
|
638
|
-
*
|
|
639
|
-
* @private {boolean}
|
|
640
|
-
*/
|
|
641
|
-
this.mutationEventsAdded_ = false;
|
|
642
|
-
/**
|
|
643
|
-
* Keeps reference to the instance of MutationObserver.
|
|
644
|
-
*
|
|
645
|
-
* @private {MutationObserver}
|
|
646
|
-
*/
|
|
647
|
-
this.mutationsObserver_ = null;
|
|
648
|
-
/**
|
|
649
|
-
* A list of connected observers.
|
|
650
|
-
*
|
|
651
|
-
* @private {Array<ResizeObserverSPI>}
|
|
652
|
-
*/
|
|
653
|
-
this.observers_ = [];
|
|
654
|
-
this.onTransitionEnd_ = this.onTransitionEnd_.bind(this);
|
|
655
|
-
this.refresh = throttle(this.refresh.bind(this), REFRESH_DELAY);
|
|
656
|
-
}
|
|
657
|
-
/**
|
|
658
|
-
* Adds observer to observers list.
|
|
659
|
-
*
|
|
660
|
-
* @param {ResizeObserverSPI} observer - Observer to be added.
|
|
661
|
-
* @returns {void}
|
|
662
|
-
*/
|
|
663
|
-
ResizeObserverController.prototype.addObserver = function (observer) {
|
|
664
|
-
if (!~this.observers_.indexOf(observer)) {
|
|
665
|
-
this.observers_.push(observer);
|
|
666
|
-
}
|
|
667
|
-
// Add listeners if they haven't been added yet.
|
|
668
|
-
if (!this.connected_) {
|
|
669
|
-
this.connect_();
|
|
670
|
-
}
|
|
671
|
-
};
|
|
672
|
-
/**
|
|
673
|
-
* Removes observer from observers list.
|
|
674
|
-
*
|
|
675
|
-
* @param {ResizeObserverSPI} observer - Observer to be removed.
|
|
676
|
-
* @returns {void}
|
|
677
|
-
*/
|
|
678
|
-
ResizeObserverController.prototype.removeObserver = function (observer) {
|
|
679
|
-
var observers = this.observers_;
|
|
680
|
-
var index = observers.indexOf(observer);
|
|
681
|
-
// Remove observer if it's present in registry.
|
|
682
|
-
if (~index) {
|
|
683
|
-
observers.splice(index, 1);
|
|
684
|
-
}
|
|
685
|
-
// Remove listeners if controller has no connected observers.
|
|
686
|
-
if (!observers.length && this.connected_) {
|
|
687
|
-
this.disconnect_();
|
|
688
|
-
}
|
|
689
|
-
};
|
|
690
|
-
/**
|
|
691
|
-
* Invokes the update of observers. It will continue running updates insofar
|
|
692
|
-
* it detects changes.
|
|
693
|
-
*
|
|
694
|
-
* @returns {void}
|
|
695
|
-
*/
|
|
696
|
-
ResizeObserverController.prototype.refresh = function () {
|
|
697
|
-
var changesDetected = this.updateObservers_();
|
|
698
|
-
// Continue running updates if changes have been detected as there might
|
|
699
|
-
// be future ones caused by CSS transitions.
|
|
700
|
-
if (changesDetected) {
|
|
701
|
-
this.refresh();
|
|
702
|
-
}
|
|
703
|
-
};
|
|
704
|
-
/**
|
|
705
|
-
* Updates every observer from observers list and notifies them of queued
|
|
706
|
-
* entries.
|
|
707
|
-
*
|
|
708
|
-
* @private
|
|
709
|
-
* @returns {boolean} Returns "true" if any observer has detected changes in
|
|
710
|
-
* dimensions of it's elements.
|
|
711
|
-
*/
|
|
712
|
-
ResizeObserverController.prototype.updateObservers_ = function () {
|
|
713
|
-
// Collect observers that have active observations.
|
|
714
|
-
var activeObservers = this.observers_.filter(function (observer) {
|
|
715
|
-
return observer.gatherActive(), observer.hasActive();
|
|
716
|
-
});
|
|
717
|
-
// Deliver notifications in a separate cycle in order to avoid any
|
|
718
|
-
// collisions between observers, e.g. when multiple instances of
|
|
719
|
-
// ResizeObserver are tracking the same element and the callback of one
|
|
720
|
-
// of them changes content dimensions of the observed target. Sometimes
|
|
721
|
-
// this may result in notifications being blocked for the rest of observers.
|
|
722
|
-
activeObservers.forEach(function (observer) { return observer.broadcastActive(); });
|
|
723
|
-
return activeObservers.length > 0;
|
|
724
|
-
};
|
|
725
|
-
/**
|
|
726
|
-
* Initializes DOM listeners.
|
|
727
|
-
*
|
|
728
|
-
* @private
|
|
729
|
-
* @returns {void}
|
|
730
|
-
*/
|
|
731
|
-
ResizeObserverController.prototype.connect_ = function () {
|
|
732
|
-
// Do nothing if running in a non-browser environment or if listeners
|
|
733
|
-
// have been already added.
|
|
734
|
-
if (!isBrowser || this.connected_) {
|
|
735
|
-
return;
|
|
736
|
-
}
|
|
737
|
-
// Subscription to the "Transitionend" event is used as a workaround for
|
|
738
|
-
// delayed transitions. This way it's possible to capture at least the
|
|
739
|
-
// final state of an element.
|
|
740
|
-
document.addEventListener('transitionend', this.onTransitionEnd_);
|
|
741
|
-
window.addEventListener('resize', this.refresh);
|
|
742
|
-
if (mutationObserverSupported) {
|
|
743
|
-
this.mutationsObserver_ = new MutationObserver(this.refresh);
|
|
744
|
-
this.mutationsObserver_.observe(document, {
|
|
745
|
-
attributes: true,
|
|
746
|
-
childList: true,
|
|
747
|
-
characterData: true,
|
|
748
|
-
subtree: true
|
|
749
|
-
});
|
|
750
|
-
}
|
|
751
|
-
else {
|
|
752
|
-
document.addEventListener('DOMSubtreeModified', this.refresh);
|
|
753
|
-
this.mutationEventsAdded_ = true;
|
|
754
|
-
}
|
|
755
|
-
this.connected_ = true;
|
|
756
|
-
};
|
|
757
|
-
/**
|
|
758
|
-
* Removes DOM listeners.
|
|
759
|
-
*
|
|
760
|
-
* @private
|
|
761
|
-
* @returns {void}
|
|
762
|
-
*/
|
|
763
|
-
ResizeObserverController.prototype.disconnect_ = function () {
|
|
764
|
-
// Do nothing if running in a non-browser environment or if listeners
|
|
765
|
-
// have been already removed.
|
|
766
|
-
if (!isBrowser || !this.connected_) {
|
|
767
|
-
return;
|
|
768
|
-
}
|
|
769
|
-
document.removeEventListener('transitionend', this.onTransitionEnd_);
|
|
770
|
-
window.removeEventListener('resize', this.refresh);
|
|
771
|
-
if (this.mutationsObserver_) {
|
|
772
|
-
this.mutationsObserver_.disconnect();
|
|
773
|
-
}
|
|
774
|
-
if (this.mutationEventsAdded_) {
|
|
775
|
-
document.removeEventListener('DOMSubtreeModified', this.refresh);
|
|
776
|
-
}
|
|
777
|
-
this.mutationsObserver_ = null;
|
|
778
|
-
this.mutationEventsAdded_ = false;
|
|
779
|
-
this.connected_ = false;
|
|
780
|
-
};
|
|
781
|
-
/**
|
|
782
|
-
* "Transitionend" event handler.
|
|
783
|
-
*
|
|
784
|
-
* @private
|
|
785
|
-
* @param {TransitionEvent} event
|
|
786
|
-
* @returns {void}
|
|
787
|
-
*/
|
|
788
|
-
ResizeObserverController.prototype.onTransitionEnd_ = function (_a) {
|
|
789
|
-
var _b = _a.propertyName, propertyName = _b === void 0 ? '' : _b;
|
|
790
|
-
// Detect whether transition may affect dimensions of an element.
|
|
791
|
-
var isReflowProperty = transitionKeys.some(function (key) {
|
|
792
|
-
return !!~propertyName.indexOf(key);
|
|
793
|
-
});
|
|
794
|
-
if (isReflowProperty) {
|
|
795
|
-
this.refresh();
|
|
796
|
-
}
|
|
797
|
-
};
|
|
798
|
-
/**
|
|
799
|
-
* Returns instance of the ResizeObserverController.
|
|
800
|
-
*
|
|
801
|
-
* @returns {ResizeObserverController}
|
|
802
|
-
*/
|
|
803
|
-
ResizeObserverController.getInstance = function () {
|
|
804
|
-
if (!this.instance_) {
|
|
805
|
-
this.instance_ = new ResizeObserverController();
|
|
806
|
-
}
|
|
807
|
-
return this.instance_;
|
|
808
|
-
};
|
|
809
|
-
/**
|
|
810
|
-
* Holds reference to the controller's instance.
|
|
811
|
-
*
|
|
812
|
-
* @private {ResizeObserverController}
|
|
813
|
-
*/
|
|
814
|
-
ResizeObserverController.instance_ = null;
|
|
815
|
-
return ResizeObserverController;
|
|
816
|
-
}());
|
|
817
|
-
|
|
818
|
-
/**
|
|
819
|
-
* Defines non-writable/enumerable properties of the provided target object.
|
|
820
|
-
*
|
|
821
|
-
* @param {Object} target - Object for which to define properties.
|
|
822
|
-
* @param {Object} props - Properties to be defined.
|
|
823
|
-
* @returns {Object} Target object.
|
|
824
|
-
*/
|
|
825
|
-
var defineConfigurable = (function (target, props) {
|
|
826
|
-
for (var _i = 0, _a = Object.keys(props); _i < _a.length; _i++) {
|
|
827
|
-
var key = _a[_i];
|
|
828
|
-
Object.defineProperty(target, key, {
|
|
829
|
-
value: props[key],
|
|
830
|
-
enumerable: false,
|
|
831
|
-
writable: false,
|
|
832
|
-
configurable: true
|
|
833
|
-
});
|
|
834
|
-
}
|
|
835
|
-
return target;
|
|
836
|
-
});
|
|
837
|
-
|
|
838
|
-
/**
|
|
839
|
-
* Returns the global object associated with provided element.
|
|
840
|
-
*
|
|
841
|
-
* @param {Object} target
|
|
842
|
-
* @returns {Object}
|
|
843
|
-
*/
|
|
844
|
-
var getWindowOf = (function (target) {
|
|
845
|
-
// Assume that the element is an instance of Node, which means that it
|
|
846
|
-
// has the "ownerDocument" property from which we can retrieve a
|
|
847
|
-
// corresponding global object.
|
|
848
|
-
var ownerGlobal = target && target.ownerDocument && target.ownerDocument.defaultView;
|
|
849
|
-
// Return the local global object if it's not possible extract one from
|
|
850
|
-
// provided element.
|
|
851
|
-
return ownerGlobal || global$1;
|
|
852
|
-
});
|
|
853
|
-
|
|
854
|
-
// Placeholder of an empty content rectangle.
|
|
855
|
-
var emptyRect = createRectInit(0, 0, 0, 0);
|
|
856
|
-
/**
|
|
857
|
-
* Converts provided string to a number.
|
|
858
|
-
*
|
|
859
|
-
* @param {number|string} value
|
|
860
|
-
* @returns {number}
|
|
861
|
-
*/
|
|
862
|
-
function toFloat(value) {
|
|
863
|
-
return parseFloat(value) || 0;
|
|
864
|
-
}
|
|
865
|
-
/**
|
|
866
|
-
* Extracts borders size from provided styles.
|
|
867
|
-
*
|
|
868
|
-
* @param {CSSStyleDeclaration} styles
|
|
869
|
-
* @param {...string} positions - Borders positions (top, right, ...)
|
|
870
|
-
* @returns {number}
|
|
871
|
-
*/
|
|
872
|
-
function getBordersSize(styles) {
|
|
873
|
-
var positions = [];
|
|
874
|
-
for (var _i = 1; _i < arguments.length; _i++) {
|
|
875
|
-
positions[_i - 1] = arguments[_i];
|
|
876
|
-
}
|
|
877
|
-
return positions.reduce(function (size, position) {
|
|
878
|
-
var value = styles['border-' + position + '-width'];
|
|
879
|
-
return size + toFloat(value);
|
|
880
|
-
}, 0);
|
|
881
|
-
}
|
|
882
|
-
/**
|
|
883
|
-
* Extracts paddings sizes from provided styles.
|
|
884
|
-
*
|
|
885
|
-
* @param {CSSStyleDeclaration} styles
|
|
886
|
-
* @returns {Object} Paddings box.
|
|
887
|
-
*/
|
|
888
|
-
function getPaddings(styles) {
|
|
889
|
-
var positions = ['top', 'right', 'bottom', 'left'];
|
|
890
|
-
var paddings = {};
|
|
891
|
-
for (var _i = 0, positions_1 = positions; _i < positions_1.length; _i++) {
|
|
892
|
-
var position = positions_1[_i];
|
|
893
|
-
var value = styles['padding-' + position];
|
|
894
|
-
paddings[position] = toFloat(value);
|
|
895
|
-
}
|
|
896
|
-
return paddings;
|
|
897
|
-
}
|
|
898
|
-
/**
|
|
899
|
-
* Calculates content rectangle of provided SVG element.
|
|
900
|
-
*
|
|
901
|
-
* @param {SVGGraphicsElement} target - Element content rectangle of which needs
|
|
902
|
-
* to be calculated.
|
|
903
|
-
* @returns {DOMRectInit}
|
|
904
|
-
*/
|
|
905
|
-
function getSVGContentRect(target) {
|
|
906
|
-
var bbox = target.getBBox();
|
|
907
|
-
return createRectInit(0, 0, bbox.width, bbox.height);
|
|
908
|
-
}
|
|
909
|
-
/**
|
|
910
|
-
* Calculates content rectangle of provided HTMLElement.
|
|
911
|
-
*
|
|
912
|
-
* @param {HTMLElement} target - Element for which to calculate the content rectangle.
|
|
913
|
-
* @returns {DOMRectInit}
|
|
914
|
-
*/
|
|
915
|
-
function getHTMLElementContentRect(target) {
|
|
916
|
-
// Client width & height properties can't be
|
|
917
|
-
// used exclusively as they provide rounded values.
|
|
918
|
-
var clientWidth = target.clientWidth, clientHeight = target.clientHeight;
|
|
919
|
-
// By this condition we can catch all non-replaced inline, hidden and
|
|
920
|
-
// detached elements. Though elements with width & height properties less
|
|
921
|
-
// than 0.5 will be discarded as well.
|
|
922
|
-
//
|
|
923
|
-
// Without it we would need to implement separate methods for each of
|
|
924
|
-
// those cases and it's not possible to perform a precise and performance
|
|
925
|
-
// effective test for hidden elements. E.g. even jQuery's ':visible' filter
|
|
926
|
-
// gives wrong results for elements with width & height less than 0.5.
|
|
927
|
-
if (!clientWidth && !clientHeight) {
|
|
928
|
-
return emptyRect;
|
|
929
|
-
}
|
|
930
|
-
var styles = getWindowOf(target).getComputedStyle(target);
|
|
931
|
-
var paddings = getPaddings(styles);
|
|
932
|
-
var horizPad = paddings.left + paddings.right;
|
|
933
|
-
var vertPad = paddings.top + paddings.bottom;
|
|
934
|
-
// Computed styles of width & height are being used because they are the
|
|
935
|
-
// only dimensions available to JS that contain non-rounded values. It could
|
|
936
|
-
// be possible to utilize the getBoundingClientRect if only it's data wasn't
|
|
937
|
-
// affected by CSS transformations let alone paddings, borders and scroll bars.
|
|
938
|
-
var width = toFloat(styles.width), height = toFloat(styles.height);
|
|
939
|
-
// Width & height include paddings and borders when the 'border-box' box
|
|
940
|
-
// model is applied (except for IE).
|
|
941
|
-
if (styles.boxSizing === 'border-box') {
|
|
942
|
-
// Following conditions are required to handle Internet Explorer which
|
|
943
|
-
// doesn't include paddings and borders to computed CSS dimensions.
|
|
944
|
-
//
|
|
945
|
-
// We can say that if CSS dimensions + paddings are equal to the "client"
|
|
946
|
-
// properties then it's either IE, and thus we don't need to subtract
|
|
947
|
-
// anything, or an element merely doesn't have paddings/borders styles.
|
|
948
|
-
if (Math.round(width + horizPad) !== clientWidth) {
|
|
949
|
-
width -= getBordersSize(styles, 'left', 'right') + horizPad;
|
|
950
|
-
}
|
|
951
|
-
if (Math.round(height + vertPad) !== clientHeight) {
|
|
952
|
-
height -= getBordersSize(styles, 'top', 'bottom') + vertPad;
|
|
953
|
-
}
|
|
954
|
-
}
|
|
955
|
-
// Following steps can't be applied to the document's root element as its
|
|
956
|
-
// client[Width/Height] properties represent viewport area of the window.
|
|
957
|
-
// Besides, it's as well not necessary as the <html> itself neither has
|
|
958
|
-
// rendered scroll bars nor it can be clipped.
|
|
959
|
-
if (!isDocumentElement(target)) {
|
|
960
|
-
// In some browsers (only in Firefox, actually) CSS width & height
|
|
961
|
-
// include scroll bars size which can be removed at this step as scroll
|
|
962
|
-
// bars are the only difference between rounded dimensions + paddings
|
|
963
|
-
// and "client" properties, though that is not always true in Chrome.
|
|
964
|
-
var vertScrollbar = Math.round(width + horizPad) - clientWidth;
|
|
965
|
-
var horizScrollbar = Math.round(height + vertPad) - clientHeight;
|
|
966
|
-
// Chrome has a rather weird rounding of "client" properties.
|
|
967
|
-
// E.g. for an element with content width of 314.2px it sometimes gives
|
|
968
|
-
// the client width of 315px and for the width of 314.7px it may give
|
|
969
|
-
// 314px. And it doesn't happen all the time. So just ignore this delta
|
|
970
|
-
// as a non-relevant.
|
|
971
|
-
if (Math.abs(vertScrollbar) !== 1) {
|
|
972
|
-
width -= vertScrollbar;
|
|
973
|
-
}
|
|
974
|
-
if (Math.abs(horizScrollbar) !== 1) {
|
|
975
|
-
height -= horizScrollbar;
|
|
976
|
-
}
|
|
977
|
-
}
|
|
978
|
-
return createRectInit(paddings.left, paddings.top, width, height);
|
|
979
|
-
}
|
|
980
|
-
/**
|
|
981
|
-
* Checks whether provided element is an instance of the SVGGraphicsElement.
|
|
982
|
-
*
|
|
983
|
-
* @param {Element} target - Element to be checked.
|
|
984
|
-
* @returns {boolean}
|
|
985
|
-
*/
|
|
986
|
-
var isSVGGraphicsElement = (function () {
|
|
987
|
-
// Some browsers, namely IE and Edge, don't have the SVGGraphicsElement
|
|
988
|
-
// interface.
|
|
989
|
-
if (typeof SVGGraphicsElement !== 'undefined') {
|
|
990
|
-
return function (target) { return target instanceof getWindowOf(target).SVGGraphicsElement; };
|
|
991
|
-
}
|
|
992
|
-
// If it's so, then check that element is at least an instance of the
|
|
993
|
-
// SVGElement and that it has the "getBBox" method.
|
|
994
|
-
// eslint-disable-next-line no-extra-parens
|
|
995
|
-
return function (target) { return (target instanceof getWindowOf(target).SVGElement &&
|
|
996
|
-
typeof target.getBBox === 'function'); };
|
|
997
|
-
})();
|
|
998
|
-
/**
|
|
999
|
-
* Checks whether provided element is a document element (<html>).
|
|
1000
|
-
*
|
|
1001
|
-
* @param {Element} target - Element to be checked.
|
|
1002
|
-
* @returns {boolean}
|
|
1003
|
-
*/
|
|
1004
|
-
function isDocumentElement(target) {
|
|
1005
|
-
return target === getWindowOf(target).document.documentElement;
|
|
1006
|
-
}
|
|
1007
|
-
/**
|
|
1008
|
-
* Calculates an appropriate content rectangle for provided html or svg element.
|
|
1009
|
-
*
|
|
1010
|
-
* @param {Element} target - Element content rectangle of which needs to be calculated.
|
|
1011
|
-
* @returns {DOMRectInit}
|
|
1012
|
-
*/
|
|
1013
|
-
function getContentRect(target) {
|
|
1014
|
-
if (!isBrowser) {
|
|
1015
|
-
return emptyRect;
|
|
1016
|
-
}
|
|
1017
|
-
if (isSVGGraphicsElement(target)) {
|
|
1018
|
-
return getSVGContentRect(target);
|
|
1019
|
-
}
|
|
1020
|
-
return getHTMLElementContentRect(target);
|
|
1021
|
-
}
|
|
1022
|
-
/**
|
|
1023
|
-
* Creates rectangle with an interface of the DOMRectReadOnly.
|
|
1024
|
-
* Spec: https://drafts.fxtf.org/geometry/#domrectreadonly
|
|
1025
|
-
*
|
|
1026
|
-
* @param {DOMRectInit} rectInit - Object with rectangle's x/y coordinates and dimensions.
|
|
1027
|
-
* @returns {DOMRectReadOnly}
|
|
1028
|
-
*/
|
|
1029
|
-
function createReadOnlyRect(_a) {
|
|
1030
|
-
var x = _a.x, y = _a.y, width = _a.width, height = _a.height;
|
|
1031
|
-
// If DOMRectReadOnly is available use it as a prototype for the rectangle.
|
|
1032
|
-
var Constr = typeof DOMRectReadOnly !== 'undefined' ? DOMRectReadOnly : Object;
|
|
1033
|
-
var rect = Object.create(Constr.prototype);
|
|
1034
|
-
// Rectangle's properties are not writable and non-enumerable.
|
|
1035
|
-
defineConfigurable(rect, {
|
|
1036
|
-
x: x, y: y, width: width, height: height,
|
|
1037
|
-
top: y,
|
|
1038
|
-
right: x + width,
|
|
1039
|
-
bottom: height + y,
|
|
1040
|
-
left: x
|
|
1041
|
-
});
|
|
1042
|
-
return rect;
|
|
1043
|
-
}
|
|
1044
|
-
/**
|
|
1045
|
-
* Creates DOMRectInit object based on the provided dimensions and the x/y coordinates.
|
|
1046
|
-
* Spec: https://drafts.fxtf.org/geometry/#dictdef-domrectinit
|
|
1047
|
-
*
|
|
1048
|
-
* @param {number} x - X coordinate.
|
|
1049
|
-
* @param {number} y - Y coordinate.
|
|
1050
|
-
* @param {number} width - Rectangle's width.
|
|
1051
|
-
* @param {number} height - Rectangle's height.
|
|
1052
|
-
* @returns {DOMRectInit}
|
|
1053
|
-
*/
|
|
1054
|
-
function createRectInit(x, y, width, height) {
|
|
1055
|
-
return { x: x, y: y, width: width, height: height };
|
|
1056
|
-
}
|
|
1057
|
-
|
|
1058
|
-
/**
|
|
1059
|
-
* Class that is responsible for computations of the content rectangle of
|
|
1060
|
-
* provided DOM element and for keeping track of it's changes.
|
|
1061
|
-
*/
|
|
1062
|
-
var ResizeObservation = /** @class */ (function () {
|
|
1063
|
-
/**
|
|
1064
|
-
* Creates an instance of ResizeObservation.
|
|
1065
|
-
*
|
|
1066
|
-
* @param {Element} target - Element to be observed.
|
|
1067
|
-
*/
|
|
1068
|
-
function ResizeObservation(target) {
|
|
1069
|
-
/**
|
|
1070
|
-
* Broadcasted width of content rectangle.
|
|
1071
|
-
*
|
|
1072
|
-
* @type {number}
|
|
1073
|
-
*/
|
|
1074
|
-
this.broadcastWidth = 0;
|
|
1075
|
-
/**
|
|
1076
|
-
* Broadcasted height of content rectangle.
|
|
1077
|
-
*
|
|
1078
|
-
* @type {number}
|
|
1079
|
-
*/
|
|
1080
|
-
this.broadcastHeight = 0;
|
|
1081
|
-
/**
|
|
1082
|
-
* Reference to the last observed content rectangle.
|
|
1083
|
-
*
|
|
1084
|
-
* @private {DOMRectInit}
|
|
1085
|
-
*/
|
|
1086
|
-
this.contentRect_ = createRectInit(0, 0, 0, 0);
|
|
1087
|
-
this.target = target;
|
|
1088
|
-
}
|
|
1089
|
-
/**
|
|
1090
|
-
* Updates content rectangle and tells whether it's width or height properties
|
|
1091
|
-
* have changed since the last broadcast.
|
|
1092
|
-
*
|
|
1093
|
-
* @returns {boolean}
|
|
1094
|
-
*/
|
|
1095
|
-
ResizeObservation.prototype.isActive = function () {
|
|
1096
|
-
var rect = getContentRect(this.target);
|
|
1097
|
-
this.contentRect_ = rect;
|
|
1098
|
-
return (rect.width !== this.broadcastWidth ||
|
|
1099
|
-
rect.height !== this.broadcastHeight);
|
|
1100
|
-
};
|
|
1101
|
-
/**
|
|
1102
|
-
* Updates 'broadcastWidth' and 'broadcastHeight' properties with a data
|
|
1103
|
-
* from the corresponding properties of the last observed content rectangle.
|
|
1104
|
-
*
|
|
1105
|
-
* @returns {DOMRectInit} Last observed content rectangle.
|
|
1106
|
-
*/
|
|
1107
|
-
ResizeObservation.prototype.broadcastRect = function () {
|
|
1108
|
-
var rect = this.contentRect_;
|
|
1109
|
-
this.broadcastWidth = rect.width;
|
|
1110
|
-
this.broadcastHeight = rect.height;
|
|
1111
|
-
return rect;
|
|
1112
|
-
};
|
|
1113
|
-
return ResizeObservation;
|
|
1114
|
-
}());
|
|
1115
|
-
|
|
1116
|
-
var ResizeObserverEntry = /** @class */ (function () {
|
|
1117
|
-
/**
|
|
1118
|
-
* Creates an instance of ResizeObserverEntry.
|
|
1119
|
-
*
|
|
1120
|
-
* @param {Element} target - Element that is being observed.
|
|
1121
|
-
* @param {DOMRectInit} rectInit - Data of the element's content rectangle.
|
|
1122
|
-
*/
|
|
1123
|
-
function ResizeObserverEntry(target, rectInit) {
|
|
1124
|
-
var contentRect = createReadOnlyRect(rectInit);
|
|
1125
|
-
// According to the specification following properties are not writable
|
|
1126
|
-
// and are also not enumerable in the native implementation.
|
|
1127
|
-
//
|
|
1128
|
-
// Property accessors are not being used as they'd require to define a
|
|
1129
|
-
// private WeakMap storage which may cause memory leaks in browsers that
|
|
1130
|
-
// don't support this type of collections.
|
|
1131
|
-
defineConfigurable(this, { target: target, contentRect: contentRect });
|
|
1132
|
-
}
|
|
1133
|
-
return ResizeObserverEntry;
|
|
1134
|
-
}());
|
|
1135
|
-
|
|
1136
|
-
var ResizeObserverSPI = /** @class */ (function () {
|
|
1137
|
-
/**
|
|
1138
|
-
* Creates a new instance of ResizeObserver.
|
|
1139
|
-
*
|
|
1140
|
-
* @param {ResizeObserverCallback} callback - Callback function that is invoked
|
|
1141
|
-
* when one of the observed elements changes it's content dimensions.
|
|
1142
|
-
* @param {ResizeObserverController} controller - Controller instance which
|
|
1143
|
-
* is responsible for the updates of observer.
|
|
1144
|
-
* @param {ResizeObserver} callbackCtx - Reference to the public
|
|
1145
|
-
* ResizeObserver instance which will be passed to callback function.
|
|
1146
|
-
*/
|
|
1147
|
-
function ResizeObserverSPI(callback, controller, callbackCtx) {
|
|
1148
|
-
/**
|
|
1149
|
-
* Collection of resize observations that have detected changes in dimensions
|
|
1150
|
-
* of elements.
|
|
1151
|
-
*
|
|
1152
|
-
* @private {Array<ResizeObservation>}
|
|
1153
|
-
*/
|
|
1154
|
-
this.activeObservations_ = [];
|
|
1155
|
-
/**
|
|
1156
|
-
* Registry of the ResizeObservation instances.
|
|
1157
|
-
*
|
|
1158
|
-
* @private {Map<Element, ResizeObservation>}
|
|
1159
|
-
*/
|
|
1160
|
-
this.observations_ = new MapShim();
|
|
1161
|
-
if (typeof callback !== 'function') {
|
|
1162
|
-
throw new TypeError('The callback provided as parameter 1 is not a function.');
|
|
1163
|
-
}
|
|
1164
|
-
this.callback_ = callback;
|
|
1165
|
-
this.controller_ = controller;
|
|
1166
|
-
this.callbackCtx_ = callbackCtx;
|
|
1167
|
-
}
|
|
1168
|
-
/**
|
|
1169
|
-
* Starts observing provided element.
|
|
1170
|
-
*
|
|
1171
|
-
* @param {Element} target - Element to be observed.
|
|
1172
|
-
* @returns {void}
|
|
1173
|
-
*/
|
|
1174
|
-
ResizeObserverSPI.prototype.observe = function (target) {
|
|
1175
|
-
if (!arguments.length) {
|
|
1176
|
-
throw new TypeError('1 argument required, but only 0 present.');
|
|
1177
|
-
}
|
|
1178
|
-
// Do nothing if current environment doesn't have the Element interface.
|
|
1179
|
-
if (typeof Element === 'undefined' || !(Element instanceof Object)) {
|
|
1180
|
-
return;
|
|
1181
|
-
}
|
|
1182
|
-
if (!(target instanceof getWindowOf(target).Element)) {
|
|
1183
|
-
throw new TypeError('parameter 1 is not of type "Element".');
|
|
1184
|
-
}
|
|
1185
|
-
var observations = this.observations_;
|
|
1186
|
-
// Do nothing if element is already being observed.
|
|
1187
|
-
if (observations.has(target)) {
|
|
1188
|
-
return;
|
|
1189
|
-
}
|
|
1190
|
-
observations.set(target, new ResizeObservation(target));
|
|
1191
|
-
this.controller_.addObserver(this);
|
|
1192
|
-
// Force the update of observations.
|
|
1193
|
-
this.controller_.refresh();
|
|
1194
|
-
};
|
|
1195
|
-
/**
|
|
1196
|
-
* Stops observing provided element.
|
|
1197
|
-
*
|
|
1198
|
-
* @param {Element} target - Element to stop observing.
|
|
1199
|
-
* @returns {void}
|
|
1200
|
-
*/
|
|
1201
|
-
ResizeObserverSPI.prototype.unobserve = function (target) {
|
|
1202
|
-
if (!arguments.length) {
|
|
1203
|
-
throw new TypeError('1 argument required, but only 0 present.');
|
|
1204
|
-
}
|
|
1205
|
-
// Do nothing if current environment doesn't have the Element interface.
|
|
1206
|
-
if (typeof Element === 'undefined' || !(Element instanceof Object)) {
|
|
1207
|
-
return;
|
|
1208
|
-
}
|
|
1209
|
-
if (!(target instanceof getWindowOf(target).Element)) {
|
|
1210
|
-
throw new TypeError('parameter 1 is not of type "Element".');
|
|
1211
|
-
}
|
|
1212
|
-
var observations = this.observations_;
|
|
1213
|
-
// Do nothing if element is not being observed.
|
|
1214
|
-
if (!observations.has(target)) {
|
|
1215
|
-
return;
|
|
1216
|
-
}
|
|
1217
|
-
observations.delete(target);
|
|
1218
|
-
if (!observations.size) {
|
|
1219
|
-
this.controller_.removeObserver(this);
|
|
1220
|
-
}
|
|
1221
|
-
};
|
|
1222
|
-
/**
|
|
1223
|
-
* Stops observing all elements.
|
|
1224
|
-
*
|
|
1225
|
-
* @returns {void}
|
|
1226
|
-
*/
|
|
1227
|
-
ResizeObserverSPI.prototype.disconnect = function () {
|
|
1228
|
-
this.clearActive();
|
|
1229
|
-
this.observations_.clear();
|
|
1230
|
-
this.controller_.removeObserver(this);
|
|
1231
|
-
};
|
|
1232
|
-
/**
|
|
1233
|
-
* Collects observation instances the associated element of which has changed
|
|
1234
|
-
* it's content rectangle.
|
|
1235
|
-
*
|
|
1236
|
-
* @returns {void}
|
|
1237
|
-
*/
|
|
1238
|
-
ResizeObserverSPI.prototype.gatherActive = function () {
|
|
1239
|
-
var _this = this;
|
|
1240
|
-
this.clearActive();
|
|
1241
|
-
this.observations_.forEach(function (observation) {
|
|
1242
|
-
if (observation.isActive()) {
|
|
1243
|
-
_this.activeObservations_.push(observation);
|
|
1244
|
-
}
|
|
1245
|
-
});
|
|
1246
|
-
};
|
|
1247
|
-
/**
|
|
1248
|
-
* Invokes initial callback function with a list of ResizeObserverEntry
|
|
1249
|
-
* instances collected from active resize observations.
|
|
1250
|
-
*
|
|
1251
|
-
* @returns {void}
|
|
1252
|
-
*/
|
|
1253
|
-
ResizeObserverSPI.prototype.broadcastActive = function () {
|
|
1254
|
-
// Do nothing if observer doesn't have active observations.
|
|
1255
|
-
if (!this.hasActive()) {
|
|
1256
|
-
return;
|
|
1257
|
-
}
|
|
1258
|
-
var ctx = this.callbackCtx_;
|
|
1259
|
-
// Create ResizeObserverEntry instance for every active observation.
|
|
1260
|
-
var entries = this.activeObservations_.map(function (observation) {
|
|
1261
|
-
return new ResizeObserverEntry(observation.target, observation.broadcastRect());
|
|
1262
|
-
});
|
|
1263
|
-
this.callback_.call(ctx, entries, ctx);
|
|
1264
|
-
this.clearActive();
|
|
1265
|
-
};
|
|
1266
|
-
/**
|
|
1267
|
-
* Clears the collection of active observations.
|
|
1268
|
-
*
|
|
1269
|
-
* @returns {void}
|
|
1270
|
-
*/
|
|
1271
|
-
ResizeObserverSPI.prototype.clearActive = function () {
|
|
1272
|
-
this.activeObservations_.splice(0);
|
|
1273
|
-
};
|
|
1274
|
-
/**
|
|
1275
|
-
* Tells whether observer has active observations.
|
|
1276
|
-
*
|
|
1277
|
-
* @returns {boolean}
|
|
1278
|
-
*/
|
|
1279
|
-
ResizeObserverSPI.prototype.hasActive = function () {
|
|
1280
|
-
return this.activeObservations_.length > 0;
|
|
1281
|
-
};
|
|
1282
|
-
return ResizeObserverSPI;
|
|
1283
|
-
}());
|
|
1284
|
-
|
|
1285
|
-
// Registry of internal observers. If WeakMap is not available use current shim
|
|
1286
|
-
// for the Map collection as it has all required methods and because WeakMap
|
|
1287
|
-
// can't be fully polyfilled anyway.
|
|
1288
|
-
var observers = typeof WeakMap !== 'undefined' ? new WeakMap() : new MapShim();
|
|
1289
|
-
/**
|
|
1290
|
-
* ResizeObserver API. Encapsulates the ResizeObserver SPI implementation
|
|
1291
|
-
* exposing only those methods and properties that are defined in the spec.
|
|
1292
|
-
*/
|
|
1293
|
-
var ResizeObserver$1 = /** @class */ (function () {
|
|
1294
|
-
/**
|
|
1295
|
-
* Creates a new instance of ResizeObserver.
|
|
1296
|
-
*
|
|
1297
|
-
* @param {ResizeObserverCallback} callback - Callback that is invoked when
|
|
1298
|
-
* dimensions of the observed elements change.
|
|
1299
|
-
*/
|
|
1300
|
-
function ResizeObserver(callback) {
|
|
1301
|
-
if (!(this instanceof ResizeObserver)) {
|
|
1302
|
-
throw new TypeError('Cannot call a class as a function.');
|
|
1303
|
-
}
|
|
1304
|
-
if (!arguments.length) {
|
|
1305
|
-
throw new TypeError('1 argument required, but only 0 present.');
|
|
1306
|
-
}
|
|
1307
|
-
var controller = ResizeObserverController.getInstance();
|
|
1308
|
-
var observer = new ResizeObserverSPI(callback, controller, this);
|
|
1309
|
-
observers.set(this, observer);
|
|
1310
|
-
}
|
|
1311
|
-
return ResizeObserver;
|
|
1312
|
-
}());
|
|
1313
|
-
// Expose public methods of ResizeObserver.
|
|
1314
|
-
[
|
|
1315
|
-
'observe',
|
|
1316
|
-
'unobserve',
|
|
1317
|
-
'disconnect'
|
|
1318
|
-
].forEach(function (method) {
|
|
1319
|
-
ResizeObserver$1.prototype[method] = function () {
|
|
1320
|
-
var _a;
|
|
1321
|
-
return (_a = observers.get(this))[method].apply(_a, arguments);
|
|
1322
|
-
};
|
|
1323
|
-
});
|
|
1324
|
-
|
|
1325
|
-
var index = (function () {
|
|
1326
|
-
// Export existing implementation if available.
|
|
1327
|
-
if (typeof global$1.ResizeObserver !== 'undefined') {
|
|
1328
|
-
return global$1.ResizeObserver;
|
|
1329
|
-
}
|
|
1330
|
-
return ResizeObserver$1;
|
|
1331
|
-
})();
|
|
1332
|
-
|
|
1333
|
-
// =============================== Const ===============================
|
|
1334
|
-
var elementListeners = new Map();
|
|
1335
|
-
function onResize(entities) {
|
|
1336
|
-
entities.forEach(function (entity) {
|
|
1337
|
-
var _elementListeners$get;
|
|
1338
|
-
var target = entity.target;
|
|
1339
|
-
(_elementListeners$get = elementListeners.get(target)) === null || _elementListeners$get === void 0 ? void 0 : _elementListeners$get.forEach(function (listener) {
|
|
1340
|
-
return listener(target);
|
|
1341
|
-
});
|
|
1342
|
-
});
|
|
1343
|
-
}
|
|
1344
|
-
// Note: ResizeObserver polyfill not support option to measure border-box resize
|
|
1345
|
-
var resizeObserver = new index(onResize);
|
|
1346
|
-
// ============================== Observe ==============================
|
|
1347
|
-
function observe(element, callback) {
|
|
1348
|
-
if (!elementListeners.has(element)) {
|
|
1349
|
-
elementListeners.set(element, new Set());
|
|
1350
|
-
resizeObserver.observe(element);
|
|
1351
|
-
}
|
|
1352
|
-
elementListeners.get(element).add(callback);
|
|
1353
|
-
}
|
|
1354
|
-
function unobserve(element, callback) {
|
|
1355
|
-
if (elementListeners.has(element)) {
|
|
1356
|
-
elementListeners.get(element).delete(callback);
|
|
1357
|
-
if (!elementListeners.get(element).size) {
|
|
1358
|
-
resizeObserver.unobserve(element);
|
|
1359
|
-
elementListeners.delete(element);
|
|
1360
|
-
}
|
|
1361
|
-
}
|
|
1362
|
-
}
|
|
1363
|
-
|
|
1364
|
-
function _classCallCheck(instance, Constructor) {
|
|
1365
|
-
if (!(instance instanceof Constructor)) {
|
|
1366
|
-
throw new TypeError("Cannot call a class as a function");
|
|
1367
|
-
}
|
|
1368
|
-
}
|
|
1369
|
-
|
|
1370
|
-
function _defineProperties(target, props) {
|
|
1371
|
-
for (var i = 0; i < props.length; i++) {
|
|
1372
|
-
var descriptor = props[i];
|
|
1373
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
|
1374
|
-
descriptor.configurable = true;
|
|
1375
|
-
if ("value" in descriptor) descriptor.writable = true;
|
|
1376
|
-
Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
|
|
1377
|
-
}
|
|
1378
|
-
}
|
|
1379
|
-
function _createClass(Constructor, protoProps, staticProps) {
|
|
1380
|
-
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
1381
|
-
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
1382
|
-
Object.defineProperty(Constructor, "prototype", {
|
|
1383
|
-
writable: false
|
|
1384
|
-
});
|
|
1385
|
-
return Constructor;
|
|
1386
|
-
}
|
|
1387
|
-
|
|
1388
|
-
function _setPrototypeOf(o, p) {
|
|
1389
|
-
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
|
|
1390
|
-
o.__proto__ = p;
|
|
1391
|
-
return o;
|
|
1392
|
-
};
|
|
1393
|
-
return _setPrototypeOf(o, p);
|
|
1394
|
-
}
|
|
1395
|
-
|
|
1396
|
-
function _inherits(subClass, superClass) {
|
|
1397
|
-
if (typeof superClass !== "function" && superClass !== null) {
|
|
1398
|
-
throw new TypeError("Super expression must either be null or a function");
|
|
1399
|
-
}
|
|
1400
|
-
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
1401
|
-
constructor: {
|
|
1402
|
-
value: subClass,
|
|
1403
|
-
writable: true,
|
|
1404
|
-
configurable: true
|
|
1405
|
-
}
|
|
1406
|
-
});
|
|
1407
|
-
Object.defineProperty(subClass, "prototype", {
|
|
1408
|
-
writable: false
|
|
1409
|
-
});
|
|
1410
|
-
if (superClass) _setPrototypeOf(subClass, superClass);
|
|
1411
|
-
}
|
|
1412
|
-
|
|
1413
|
-
function _getPrototypeOf(o) {
|
|
1414
|
-
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
|
|
1415
|
-
return o.__proto__ || Object.getPrototypeOf(o);
|
|
1416
|
-
};
|
|
1417
|
-
return _getPrototypeOf(o);
|
|
1418
|
-
}
|
|
1419
|
-
|
|
1420
|
-
function _isNativeReflectConstruct() {
|
|
1421
|
-
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
1422
|
-
if (Reflect.construct.sham) return false;
|
|
1423
|
-
if (typeof Proxy === "function") return true;
|
|
1424
|
-
try {
|
|
1425
|
-
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
1426
|
-
return true;
|
|
1427
|
-
} catch (e) {
|
|
1428
|
-
return false;
|
|
1429
|
-
}
|
|
1430
|
-
}
|
|
1431
|
-
|
|
1432
|
-
function _assertThisInitialized(self) {
|
|
1433
|
-
if (self === void 0) {
|
|
1434
|
-
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
1435
|
-
}
|
|
1436
|
-
return self;
|
|
1437
|
-
}
|
|
1438
|
-
|
|
1439
|
-
function _possibleConstructorReturn(self, call) {
|
|
1440
|
-
if (call && (_typeof$1(call) === "object" || typeof call === "function")) {
|
|
1441
|
-
return call;
|
|
1442
|
-
} else if (call !== void 0) {
|
|
1443
|
-
throw new TypeError("Derived constructors may only return object or undefined");
|
|
1444
|
-
}
|
|
1445
|
-
return _assertThisInitialized(self);
|
|
1446
|
-
}
|
|
1447
|
-
|
|
1448
|
-
function _createSuper(Derived) {
|
|
1449
|
-
var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
|
1450
|
-
return function _createSuperInternal() {
|
|
1451
|
-
var Super = _getPrototypeOf(Derived),
|
|
1452
|
-
result;
|
|
1453
|
-
if (hasNativeReflectConstruct) {
|
|
1454
|
-
var NewTarget = _getPrototypeOf(this).constructor;
|
|
1455
|
-
result = Reflect.construct(Super, arguments, NewTarget);
|
|
1456
|
-
} else {
|
|
1457
|
-
result = Super.apply(this, arguments);
|
|
1458
|
-
}
|
|
1459
|
-
return _possibleConstructorReturn(this, result);
|
|
1460
|
-
};
|
|
1461
|
-
}
|
|
1462
|
-
|
|
1463
|
-
/**
|
|
1464
|
-
* Fallback to findDOMNode if origin ref do not provide any dom element
|
|
1465
|
-
*/
|
|
1466
|
-
var DomWrapper = /*#__PURE__*/function (_React$Component) {
|
|
1467
|
-
_inherits(DomWrapper, _React$Component);
|
|
1468
|
-
var _super = _createSuper(DomWrapper);
|
|
1469
|
-
function DomWrapper() {
|
|
1470
|
-
_classCallCheck(this, DomWrapper);
|
|
1471
|
-
return _super.apply(this, arguments);
|
|
1472
|
-
}
|
|
1473
|
-
_createClass(DomWrapper, [{
|
|
1474
|
-
key: "render",
|
|
1475
|
-
value: function render() {
|
|
1476
|
-
return this.props.children;
|
|
1477
|
-
}
|
|
1478
|
-
}]);
|
|
1479
|
-
return DomWrapper;
|
|
1480
|
-
}(react.Component);
|
|
1481
|
-
|
|
1482
|
-
var CollectionContext = /*#__PURE__*/react.createContext(null);
|
|
1483
|
-
/**
|
|
1484
|
-
* Collect all the resize event from children ResizeObserver
|
|
1485
|
-
*/
|
|
1486
|
-
function Collection(_ref) {
|
|
1487
|
-
var children = _ref.children,
|
|
1488
|
-
onBatchResize = _ref.onBatchResize;
|
|
1489
|
-
var resizeIdRef = react.useRef(0);
|
|
1490
|
-
var resizeInfosRef = react.useRef([]);
|
|
1491
|
-
var onCollectionResize = react.useContext(CollectionContext);
|
|
1492
|
-
var onResize = react.useCallback(function (size, element, data) {
|
|
1493
|
-
resizeIdRef.current += 1;
|
|
1494
|
-
var currentId = resizeIdRef.current;
|
|
1495
|
-
resizeInfosRef.current.push({
|
|
1496
|
-
size: size,
|
|
1497
|
-
element: element,
|
|
1498
|
-
data: data
|
|
1499
|
-
});
|
|
1500
|
-
Promise.resolve().then(function () {
|
|
1501
|
-
if (currentId === resizeIdRef.current) {
|
|
1502
|
-
onBatchResize === null || onBatchResize === void 0 ? void 0 : onBatchResize(resizeInfosRef.current);
|
|
1503
|
-
resizeInfosRef.current = [];
|
|
1504
|
-
}
|
|
1505
|
-
});
|
|
1506
|
-
// Continue bubbling if parent exist
|
|
1507
|
-
onCollectionResize === null || onCollectionResize === void 0 ? void 0 : onCollectionResize(size, element, data);
|
|
1508
|
-
}, [onBatchResize, onCollectionResize]);
|
|
1509
|
-
return /*#__PURE__*/react.createElement(CollectionContext.Provider, {
|
|
1510
|
-
value: onResize
|
|
1511
|
-
}, children);
|
|
1512
|
-
}
|
|
1513
|
-
|
|
1514
|
-
function SingleObserver(props, ref) {
|
|
1515
|
-
var children = props.children,
|
|
1516
|
-
disabled = props.disabled;
|
|
1517
|
-
var elementRef = react.useRef(null);
|
|
1518
|
-
var wrapperRef = react.useRef(null);
|
|
1519
|
-
var onCollectionResize = react.useContext(CollectionContext);
|
|
1520
|
-
// =========================== Children ===========================
|
|
1521
|
-
var isRenderProps = typeof children === 'function';
|
|
1522
|
-
var mergedChildren = isRenderProps ? children(elementRef) : children;
|
|
1523
|
-
// ============================= Size =============================
|
|
1524
|
-
var sizeRef = react.useRef({
|
|
1525
|
-
width: -1,
|
|
1526
|
-
height: -1,
|
|
1527
|
-
offsetWidth: -1,
|
|
1528
|
-
offsetHeight: -1
|
|
1529
|
-
});
|
|
1530
|
-
// ============================= Ref ==============================
|
|
1531
|
-
var canRef = !isRenderProps && /*#__PURE__*/react.isValidElement(mergedChildren) && supportRef(mergedChildren);
|
|
1532
|
-
var originRef = canRef ? mergedChildren.ref : null;
|
|
1533
|
-
var mergedRef = react.useMemo(function () {
|
|
1534
|
-
return composeRef(originRef, elementRef);
|
|
1535
|
-
}, [originRef, elementRef]);
|
|
1536
|
-
var getDom = function getDom() {
|
|
1537
|
-
return findDOMNode(elementRef.current) || findDOMNode(wrapperRef.current);
|
|
1538
|
-
};
|
|
1539
|
-
react.useImperativeHandle(ref, function () {
|
|
1540
|
-
return getDom();
|
|
1541
|
-
});
|
|
1542
|
-
// =========================== Observe ============================
|
|
1543
|
-
var propsRef = react.useRef(props);
|
|
1544
|
-
propsRef.current = props;
|
|
1545
|
-
// Handler
|
|
1546
|
-
var onInternalResize = react.useCallback(function (target) {
|
|
1547
|
-
var _propsRef$current = propsRef.current,
|
|
1548
|
-
onResize = _propsRef$current.onResize,
|
|
1549
|
-
data = _propsRef$current.data;
|
|
1550
|
-
var _target$getBoundingCl = target.getBoundingClientRect(),
|
|
1551
|
-
width = _target$getBoundingCl.width,
|
|
1552
|
-
height = _target$getBoundingCl.height;
|
|
1553
|
-
var offsetWidth = target.offsetWidth,
|
|
1554
|
-
offsetHeight = target.offsetHeight;
|
|
1555
|
-
/**
|
|
1556
|
-
* Resize observer trigger when content size changed.
|
|
1557
|
-
* In most case we just care about element size,
|
|
1558
|
-
* let's use `boundary` instead of `contentRect` here to avoid shaking.
|
|
1559
|
-
*/
|
|
1560
|
-
var fixedWidth = Math.floor(width);
|
|
1561
|
-
var fixedHeight = Math.floor(height);
|
|
1562
|
-
if (sizeRef.current.width !== fixedWidth || sizeRef.current.height !== fixedHeight || sizeRef.current.offsetWidth !== offsetWidth || sizeRef.current.offsetHeight !== offsetHeight) {
|
|
1563
|
-
var size = {
|
|
1564
|
-
width: fixedWidth,
|
|
1565
|
-
height: fixedHeight,
|
|
1566
|
-
offsetWidth: offsetWidth,
|
|
1567
|
-
offsetHeight: offsetHeight
|
|
1568
|
-
};
|
|
1569
|
-
sizeRef.current = size;
|
|
1570
|
-
// IE is strange, right?
|
|
1571
|
-
var mergedOffsetWidth = offsetWidth === Math.round(width) ? width : offsetWidth;
|
|
1572
|
-
var mergedOffsetHeight = offsetHeight === Math.round(height) ? height : offsetHeight;
|
|
1573
|
-
var sizeInfo = _objectSpread2(_objectSpread2({}, size), {}, {
|
|
1574
|
-
offsetWidth: mergedOffsetWidth,
|
|
1575
|
-
offsetHeight: mergedOffsetHeight
|
|
1576
|
-
});
|
|
1577
|
-
// Let collection know what happened
|
|
1578
|
-
onCollectionResize === null || onCollectionResize === void 0 ? void 0 : onCollectionResize(sizeInfo, target, data);
|
|
1579
|
-
if (onResize) {
|
|
1580
|
-
// defer the callback but not defer to next frame
|
|
1581
|
-
Promise.resolve().then(function () {
|
|
1582
|
-
onResize(sizeInfo, target);
|
|
1583
|
-
});
|
|
1584
|
-
}
|
|
1585
|
-
}
|
|
1586
|
-
}, []);
|
|
1587
|
-
// Dynamic observe
|
|
1588
|
-
react.useEffect(function () {
|
|
1589
|
-
var currentElement = getDom();
|
|
1590
|
-
if (currentElement && !disabled) {
|
|
1591
|
-
observe(currentElement, onInternalResize);
|
|
1592
|
-
}
|
|
1593
|
-
return function () {
|
|
1594
|
-
return unobserve(currentElement, onInternalResize);
|
|
1595
|
-
};
|
|
1596
|
-
}, [elementRef.current, disabled]);
|
|
1597
|
-
// ============================ Render ============================
|
|
1598
|
-
return /*#__PURE__*/react.createElement(DomWrapper, {
|
|
1599
|
-
ref: wrapperRef
|
|
1600
|
-
}, canRef ? /*#__PURE__*/react.cloneElement(mergedChildren, {
|
|
1601
|
-
ref: mergedRef
|
|
1602
|
-
}) : mergedChildren);
|
|
1603
|
-
}
|
|
1604
|
-
var RefSingleObserver = /*#__PURE__*/react.forwardRef(SingleObserver);
|
|
1605
|
-
|
|
1606
|
-
var INTERNAL_PREFIX_KEY = 'rc-observer-key';
|
|
1607
|
-
function ResizeObserver(props, ref) {
|
|
1608
|
-
var children = props.children;
|
|
1609
|
-
var childNodes = typeof children === 'function' ? [children] : toArray(children);
|
|
1610
|
-
return childNodes.map(function (child, index) {
|
|
1611
|
-
var key = (child === null || child === void 0 ? void 0 : child.key) || "".concat(INTERNAL_PREFIX_KEY, "-").concat(index);
|
|
1612
|
-
return /*#__PURE__*/react.createElement(RefSingleObserver, _extends({}, props, {
|
|
1613
|
-
key: key,
|
|
1614
|
-
ref: index === 0 ? ref : undefined
|
|
1615
|
-
}), child);
|
|
1616
|
-
});
|
|
1617
|
-
}
|
|
1618
|
-
var RefResizeObserver = /*#__PURE__*/react.forwardRef(ResizeObserver);
|
|
1619
|
-
RefResizeObserver.Collection = Collection;
|
|
1620
|
-
|
|
1621
|
-
function canUseDom() {
|
|
1622
|
-
return !!(typeof window !== 'undefined' && window.document && window.document.createElement);
|
|
1623
|
-
}
|
|
1624
|
-
|
|
1625
|
-
/**
|
|
1626
|
-
* Wrap `React.useLayoutEffect` which will not throw warning message in test env
|
|
1627
|
-
*/
|
|
1628
|
-
var useInternalLayoutEffect = canUseDom() ? react.useLayoutEffect : react.useEffect;
|
|
1629
|
-
var useLayoutEffect = function useLayoutEffect(callback, deps) {
|
|
1630
|
-
var firstMountRef = react.useRef(true);
|
|
1631
|
-
useInternalLayoutEffect(function () {
|
|
1632
|
-
return callback(firstMountRef.current);
|
|
1633
|
-
}, deps);
|
|
1634
|
-
|
|
1635
|
-
// We tell react that first mount has passed
|
|
1636
|
-
useInternalLayoutEffect(function () {
|
|
1637
|
-
firstMountRef.current = false;
|
|
1638
|
-
return function () {
|
|
1639
|
-
firstMountRef.current = true;
|
|
1640
|
-
};
|
|
1641
|
-
}, []);
|
|
1642
|
-
};
|
|
1643
|
-
|
|
1644
181
|
var _excluded$2 = ["prefixCls", "invalidate", "item", "renderItem", "responsive", "responsiveDisabled", "registerSize", "itemKey", "className", "style", "children", "display", "order", "component"];
|
|
1645
182
|
// Use shared variable to save bundle size
|
|
1646
183
|
var UNDEFINED = undefined;
|
|
@@ -1688,9 +225,9 @@ function InternalItem(props, ref) {
|
|
|
1688
225
|
if (mergedHidden) {
|
|
1689
226
|
overflowProps['aria-hidden'] = true;
|
|
1690
227
|
}
|
|
1691
|
-
var itemNode = /*#__PURE__*/react.createElement(Component, _extends
|
|
228
|
+
var itemNode = /*#__PURE__*/react.createElement(Component, _extends({
|
|
1692
229
|
className: classnames(!invalidate && prefixCls, className),
|
|
1693
|
-
style: _objectSpread2
|
|
230
|
+
style: _objectSpread2(_objectSpread2({}, overflowStyle), style)
|
|
1694
231
|
}, overflowProps, restProps, {
|
|
1695
232
|
ref: ref
|
|
1696
233
|
}), childNode);
|
|
@@ -1708,68 +245,6 @@ function InternalItem(props, ref) {
|
|
|
1708
245
|
var Item = /*#__PURE__*/react.forwardRef(InternalItem);
|
|
1709
246
|
Item.displayName = 'Item';
|
|
1710
247
|
|
|
1711
|
-
function useEvent(callback) {
|
|
1712
|
-
var fnRef = react.useRef();
|
|
1713
|
-
fnRef.current = callback;
|
|
1714
|
-
var memoFn = react.useCallback(function () {
|
|
1715
|
-
var _fnRef$current;
|
|
1716
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
1717
|
-
args[_key] = arguments[_key];
|
|
1718
|
-
}
|
|
1719
|
-
return (_fnRef$current = fnRef.current) === null || _fnRef$current === void 0 ? void 0 : _fnRef$current.call.apply(_fnRef$current, [fnRef].concat(args));
|
|
1720
|
-
}, []);
|
|
1721
|
-
return memoFn;
|
|
1722
|
-
}
|
|
1723
|
-
|
|
1724
|
-
var raf = function raf(callback) {
|
|
1725
|
-
return +setTimeout(callback, 16);
|
|
1726
|
-
};
|
|
1727
|
-
var caf = function caf(num) {
|
|
1728
|
-
return clearTimeout(num);
|
|
1729
|
-
};
|
|
1730
|
-
if (typeof window !== 'undefined' && 'requestAnimationFrame' in window) {
|
|
1731
|
-
raf = function raf(callback) {
|
|
1732
|
-
return window.requestAnimationFrame(callback);
|
|
1733
|
-
};
|
|
1734
|
-
caf = function caf(handle) {
|
|
1735
|
-
return window.cancelAnimationFrame(handle);
|
|
1736
|
-
};
|
|
1737
|
-
}
|
|
1738
|
-
var rafUUID = 0;
|
|
1739
|
-
var rafIds = new Map();
|
|
1740
|
-
function cleanup(id) {
|
|
1741
|
-
rafIds.delete(id);
|
|
1742
|
-
}
|
|
1743
|
-
var wrapperRaf = function wrapperRaf(callback) {
|
|
1744
|
-
var times = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
1745
|
-
rafUUID += 1;
|
|
1746
|
-
var id = rafUUID;
|
|
1747
|
-
function callRef(leftTimes) {
|
|
1748
|
-
if (leftTimes === 0) {
|
|
1749
|
-
// Clean up
|
|
1750
|
-
cleanup(id);
|
|
1751
|
-
|
|
1752
|
-
// Trigger
|
|
1753
|
-
callback();
|
|
1754
|
-
} else {
|
|
1755
|
-
// Next raf
|
|
1756
|
-
var realId = raf(function () {
|
|
1757
|
-
callRef(leftTimes - 1);
|
|
1758
|
-
});
|
|
1759
|
-
|
|
1760
|
-
// Bind real raf id
|
|
1761
|
-
rafIds.set(id, realId);
|
|
1762
|
-
}
|
|
1763
|
-
}
|
|
1764
|
-
callRef(times);
|
|
1765
|
-
return id;
|
|
1766
|
-
};
|
|
1767
|
-
wrapperRaf.cancel = function (id) {
|
|
1768
|
-
var realId = rafIds.get(id);
|
|
1769
|
-
cleanup(realId);
|
|
1770
|
-
return caf(realId);
|
|
1771
|
-
};
|
|
1772
|
-
|
|
1773
248
|
function channelUpdate(callback) {
|
|
1774
249
|
if (typeof MessageChannel === 'undefined') {
|
|
1775
250
|
wrapperRaf(callback);
|
|
@@ -1835,7 +310,7 @@ var InternalRawItem = function InternalRawItem(props, ref) {
|
|
|
1835
310
|
var _props$component = props.component,
|
|
1836
311
|
Component = _props$component === void 0 ? 'div' : _props$component,
|
|
1837
312
|
_restProps = _objectWithoutProperties(props, _excluded$1);
|
|
1838
|
-
return /*#__PURE__*/react.createElement(Component, _extends
|
|
313
|
+
return /*#__PURE__*/react.createElement(Component, _extends({}, _restProps, {
|
|
1839
314
|
ref: ref
|
|
1840
315
|
}));
|
|
1841
316
|
}
|
|
@@ -1846,7 +321,7 @@ var InternalRawItem = function InternalRawItem(props, ref) {
|
|
|
1846
321
|
// Do not pass context to sub item to avoid multiple measure
|
|
1847
322
|
return /*#__PURE__*/react.createElement(OverflowContext.Provider, {
|
|
1848
323
|
value: null
|
|
1849
|
-
}, /*#__PURE__*/react.createElement(Item, _extends
|
|
324
|
+
}, /*#__PURE__*/react.createElement(Item, _extends({
|
|
1850
325
|
ref: ref,
|
|
1851
326
|
className: classnames(contextClassName, className)
|
|
1852
327
|
}, restContext, restProps)));
|
|
@@ -2069,7 +544,7 @@ function Overflow(props, ref) {
|
|
|
2069
544
|
var key = getKey(item, index);
|
|
2070
545
|
return /*#__PURE__*/react.createElement(OverflowContext.Provider, {
|
|
2071
546
|
key: key,
|
|
2072
|
-
value: _objectSpread2
|
|
547
|
+
value: _objectSpread2(_objectSpread2({}, itemSharedProps), {}, {
|
|
2073
548
|
order: index,
|
|
2074
549
|
item: item,
|
|
2075
550
|
itemKey: key,
|
|
@@ -2079,7 +554,7 @@ function Overflow(props, ref) {
|
|
|
2079
554
|
}, renderRawItem(item, index));
|
|
2080
555
|
} : function (item, index) {
|
|
2081
556
|
var key = getKey(item, index);
|
|
2082
|
-
return /*#__PURE__*/react.createElement(Item, _extends
|
|
557
|
+
return /*#__PURE__*/react.createElement(Item, _extends({}, itemSharedProps, {
|
|
2083
558
|
order: index,
|
|
2084
559
|
key: key,
|
|
2085
560
|
item: item,
|
|
@@ -2099,17 +574,17 @@ function Overflow(props, ref) {
|
|
|
2099
574
|
};
|
|
2100
575
|
if (!renderRawRest) {
|
|
2101
576
|
var mergedRenderRest = renderRest || defaultRenderRest;
|
|
2102
|
-
restNode = /*#__PURE__*/react.createElement(Item, _extends
|
|
577
|
+
restNode = /*#__PURE__*/react.createElement(Item, _extends({}, itemSharedProps, restContextProps), typeof mergedRenderRest === 'function' ? mergedRenderRest(omittedItems) : mergedRenderRest);
|
|
2103
578
|
} else if (renderRawRest) {
|
|
2104
579
|
restNode = /*#__PURE__*/react.createElement(OverflowContext.Provider, {
|
|
2105
|
-
value: _objectSpread2
|
|
580
|
+
value: _objectSpread2(_objectSpread2({}, itemSharedProps), restContextProps)
|
|
2106
581
|
}, renderRawRest(omittedItems));
|
|
2107
582
|
}
|
|
2108
|
-
var overflowNode = /*#__PURE__*/react.createElement(Component, _extends
|
|
583
|
+
var overflowNode = /*#__PURE__*/react.createElement(Component, _extends({
|
|
2109
584
|
className: classnames(!invalidate && prefixCls, className),
|
|
2110
585
|
style: style,
|
|
2111
586
|
ref: ref
|
|
2112
|
-
}, restProps), mergedData.map(internalRenderItemNode), showRest ? restNode : null, suffix && /*#__PURE__*/react.createElement(Item, _extends
|
|
587
|
+
}, restProps), mergedData.map(internalRenderItemNode), showRest ? restNode : null, suffix && /*#__PURE__*/react.createElement(Item, _extends({}, itemSharedProps, {
|
|
2113
588
|
responsive: isResponsive,
|
|
2114
589
|
responsiveDisabled: !shouldResponsive,
|
|
2115
590
|
order: mergedDisplayCount,
|
|
@@ -2134,7 +609,7 @@ ForwardOverflow.INVALIDATE = INVALIDATE;
|
|
|
2134
609
|
|
|
2135
610
|
const rcOverflowCss = "@import url(\"https://fonts.googleapis.com/css?family=Roboto:400,500\");.size-1{font-size:12px;line-height:20px}.size-2{font-size:14px;line-height:22px}.size-3{font-size:16px;line-height:24px}.size-4{font-size:20px;line-height:28px}.size-5{font-size:24px;line-height:32px}.size-6{font-size:30px;line-height:38px}.size-7{font-size:38px;line-height:46px}.size-8{font-size:46px;line-height:54px}.size-9{font-size:56px;line-height:64px}.weight-regular{font-weight:400}.weight-semibold{font-weight:500}.input-size-large{height:40px}.input-size-medium{height:32px}.input-size-small{height:24px}.resize-none textarea{resize:none}.resize-vertical textarea{resize:vertical}.resize-auto textarea{height:auto;resize:none}.textarea-size-large{padding:4px 0 0 4px;min-height:40px}.textarea-size-large .bcm-input-element{min-height:calc((40px - 8px) + 2px)}.textarea-size-large .input-clear-button{height:calc( 40px - 16px );top:8px;padding:0;margin-right:8px}.textarea-size-medium{padding:4px 0 0 4px;min-height:32px}.textarea-size-medium .bcm-input-element{min-height:calc((32px - 8px) + 2px)}.textarea-size-medium .input-clear-button{height:calc( 32px - 16px );top:8px;padding:0;margin-right:8px}.textarea-size-small{padding:0px 0 0 4px;min-height:24px}.textarea-size-small .bcm-input-element{min-height:calc((24px - 8px) + 2px)}.textarea-size-small .input-clear-button{height:calc( 24px - 16px );top:8px;padding:0;margin-right:8px}.rc-overflow{display:flex;flex-direction:row;flex-wrap:nowrap;width:100%}.rc-overflow-item{transition:all 0.3s ease;padding:0 2px;display:flex;align-items:center;justify-content:center}";
|
|
2136
611
|
|
|
2137
|
-
const BcmRcOverflow = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
612
|
+
const BcmRcOverflow = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
2138
613
|
constructor() {
|
|
2139
614
|
super();
|
|
2140
615
|
this.__registerHost();
|