bromcom-ui 2.7.37-rc.9 → 2.7.38-rc.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/p-0122ae3d.js +6 -0
- package/dist/bromcom-ui/p-04c8b756.js +1 -1
- package/dist/bromcom-ui/p-0a29a882.entry.js +5 -0
- package/dist/bromcom-ui/p-0a46b931.entry.js +5 -0
- package/dist/bromcom-ui/{p-151d7bec.entry.js → p-0dff677e.entry.js} +1 -1
- package/dist/bromcom-ui/{p-2444a19c.js → p-0e8b8316.js} +1 -1
- package/dist/bromcom-ui/{p-ae327774.js → p-1192f094.js} +1 -1
- package/dist/bromcom-ui/p-13077a28.entry.js +5 -0
- package/dist/bromcom-ui/p-1978e4ae.entry.js +5 -0
- package/dist/bromcom-ui/p-1af75960.entry.js +5 -0
- package/dist/bromcom-ui/p-1c207a2d.entry.js +5 -0
- package/dist/bromcom-ui/{p-2b332236.entry.js → p-20c45a95.entry.js} +1 -1
- package/dist/bromcom-ui/p-24bfaf3c.entry.js +5 -0
- package/dist/bromcom-ui/{p-34b815f5.entry.js → p-2a7f29b6.entry.js} +1 -1
- package/dist/bromcom-ui/{p-b68fcefb.entry.js → p-2f4d6b32.entry.js} +1 -1
- package/dist/bromcom-ui/p-341f55bf.entry.js +5 -0
- package/dist/bromcom-ui/p-38e67de7.entry.js +5 -0
- package/dist/bromcom-ui/p-3b07a0b1.entry.js +5 -0
- package/dist/bromcom-ui/p-3b43ad99.entry.js +5 -0
- package/dist/bromcom-ui/p-3e6e1e62.entry.js +5 -0
- package/dist/bromcom-ui/p-41df4c5d.entry.js +5 -0
- package/dist/bromcom-ui/p-42d537ac.entry.js +5 -0
- package/dist/bromcom-ui/p-44dd9f7a.entry.js +5 -0
- package/dist/bromcom-ui/p-455f416f.entry.js +5 -0
- package/dist/bromcom-ui/{p-fe3e3210.js → p-45704915.js} +1 -1
- package/dist/bromcom-ui/p-487f7b46.js +5 -0
- package/dist/bromcom-ui/{p-b2693a0f.js → p-4db160cc.js} +1 -1
- package/dist/bromcom-ui/p-4eb1b6e1.entry.js +5 -0
- package/dist/bromcom-ui/{p-6f30d39e.entry.js → p-516b3b59.entry.js} +1 -1
- package/dist/bromcom-ui/p-52e9eb72.entry.js +5 -0
- package/dist/bromcom-ui/p-581f703b.entry.js +5 -0
- package/dist/bromcom-ui/p-59b121e1.entry.js +5 -0
- package/dist/bromcom-ui/{p-591b3100.entry.js → p-5c20b83c.entry.js} +1 -1
- package/dist/bromcom-ui/{p-b1e3b913.entry.js → p-5f002c1c.entry.js} +1 -1
- package/dist/bromcom-ui/p-62bb8bf1.entry.js +5 -0
- package/dist/bromcom-ui/{p-8255f60a.entry.js → p-6720d135.entry.js} +1 -1
- package/dist/bromcom-ui/p-68ab7a63.entry.js +5 -0
- package/dist/bromcom-ui/p-68f57e0b.entry.js +5 -0
- package/dist/bromcom-ui/p-6c92a756.entry.js +5 -0
- package/dist/bromcom-ui/p-6f1b3d34.entry.js +5 -0
- package/dist/bromcom-ui/p-758a20ad.entry.js +5 -0
- package/dist/bromcom-ui/p-765ee6c1.js +5 -0
- package/dist/{esm/bcm-dropdown.entry.js → bromcom-ui/p-77e0d2b5.entry.js} +1 -231
- package/dist/bromcom-ui/p-78cf8966.entry.js +5 -0
- package/dist/bromcom-ui/{p-78d48636.entry.js → p-7b5e88c5.entry.js} +1 -1
- package/dist/bromcom-ui/p-7b7f4c29.entry.js +5 -0
- package/dist/bromcom-ui/{p-0cd7e628.entry.js → p-7df747c7.entry.js} +1 -1
- package/dist/bromcom-ui/p-906848af.entry.js +5 -0
- package/dist/bromcom-ui/p-937e2bed.js +5 -0
- package/dist/bromcom-ui/{p-cd0490e2.js → p-96287124.js} +1 -1
- package/dist/bromcom-ui/{p-a0c10e3e.entry.js → p-96525d60.entry.js} +1 -1
- package/dist/bromcom-ui/p-980e5824.entry.js +5 -0
- package/dist/bromcom-ui/p-99bed73b.entry.js +5 -0
- package/dist/bromcom-ui/p-9c6de630.js +5 -0
- package/dist/bromcom-ui/p-a2710121.entry.js +5 -0
- package/dist/bromcom-ui/p-a95d388e.js +5 -0
- package/dist/bromcom-ui/{p-f9cb7ae4.js → p-acb048b5.js} +1 -1
- package/dist/bromcom-ui/p-b1b377e8.entry.js +5 -0
- package/dist/bromcom-ui/p-c3fc854c.entry.js +5 -0
- package/dist/bromcom-ui/p-c78bc99b.js +5 -0
- package/dist/bromcom-ui/p-c9bd85e9.js +1 -1
- package/dist/bromcom-ui/{p-f1b09912.entry.js → p-cf337431.entry.js} +1 -1
- package/dist/bromcom-ui/p-da7603b0.entry.js +5 -0
- package/dist/bromcom-ui/p-dcf02363.entry.js +5 -0
- package/dist/bromcom-ui/p-e0cb6ac3.entry.js +5 -0
- package/dist/bromcom-ui/p-e14fb705.entry.js +5 -0
- package/dist/bromcom-ui/p-e2fe4755.entry.js +5 -0
- package/dist/bromcom-ui/p-e48c96b5.entry.js +5 -0
- package/dist/bromcom-ui/{p-f33f5581.entry.js → p-e6d92da4.entry.js} +1 -1
- package/dist/bromcom-ui/p-eb3aa16b.entry.js +5 -0
- package/dist/bromcom-ui/{p-3c60d68f.entry.js → p-eb639e76.entry.js} +1 -1
- package/dist/bromcom-ui/{p-993c912d.entry.js → p-f0b62f8e.entry.js} +1 -1
- package/dist/bromcom-ui/p-f495426e.entry.js +5 -0
- package/dist/bromcom-ui/{p-d9fb53c9.entry.js → p-f5ae5381.entry.js} +1 -1
- package/dist/bromcom-ui/p-f6685330.entry.js +5 -0
- package/dist/cjs/bcm-accordion.cjs.entry.js +3 -3
- package/dist/cjs/bcm-alert.cjs.entry.js +9 -10
- package/dist/cjs/bcm-attendance.cjs.entry.js +3 -7
- package/dist/cjs/bcm-autocomplete.cjs.entry.js +3 -2
- package/dist/cjs/bcm-avatar_15.cjs.entry.js +1954 -0
- package/dist/cjs/bcm-box.cjs.entry.js +2 -2
- package/dist/cjs/bcm-breadcrumb.cjs.entry.js +4 -3
- package/dist/cjs/bcm-button-group.cjs.entry.js +10 -8
- package/dist/cjs/bcm-card.cjs.entry.js +9 -7
- package/dist/cjs/bcm-checkbox-group.cjs.entry.js +17 -11
- package/dist/cjs/bcm-checkbox-lite_9.cjs.entry.js +44 -21
- package/dist/cjs/bcm-checkbox_2.cjs.entry.js +18 -16
- package/dist/cjs/bcm-chip.cjs.entry.js +7 -3
- package/dist/cjs/bcm-collapse-group.cjs.entry.js +2 -2
- package/dist/cjs/bcm-collapse.cjs.entry.js +3 -3
- package/dist/cjs/bcm-colorpicker.cjs.entry.js +8 -9
- package/dist/cjs/bcm-date-picker.cjs.entry.js +12 -5
- package/dist/cjs/bcm-datetime-picker.cjs.entry.js +19 -16
- package/dist/cjs/bcm-default.cjs.entry.js +3 -3
- package/dist/cjs/bcm-drawer.cjs.entry.js +10 -13
- package/dist/cjs/bcm-error-layout.cjs.entry.js +2 -2
- package/dist/cjs/bcm-expansion-panel.cjs.entry.js +6 -5
- package/dist/cjs/{bcm-2c51bf0c.js → bcm-f00ec62c.js} +4 -4
- package/dist/cjs/bcm-form-2.cjs.entry.js +8 -8
- package/dist/cjs/bcm-form-group.cjs.entry.js +3 -2
- package/dist/cjs/bcm-input.cjs.entry.js +35 -18
- package/dist/cjs/bcm-link.cjs.entry.js +8 -5
- package/dist/cjs/bcm-list.cjs.entry.js +45 -43
- package/dist/cjs/bcm-message.cjs.entry.js +2 -5
- package/dist/cjs/{bcm-label_2.cjs.entry.js → bcm-modal.cjs.entry.js} +101 -78
- package/dist/cjs/bcm-notification.cjs.entry.js +4 -2
- package/dist/cjs/bcm-old-input.cjs.entry.js +17 -4
- package/dist/cjs/bcm-old-tag_2.cjs.entry.js +4 -2
- package/dist/cjs/bcm-popconfirm-box.cjs.entry.js +11 -6
- package/dist/cjs/bcm-popconfirm.cjs.entry.js +7 -6
- package/dist/cjs/bcm-progress.cjs.entry.js +5 -5
- package/dist/cjs/bcm-radio-group.cjs.entry.js +19 -10
- package/dist/cjs/bcm-radio.cjs.entry.js +10 -9
- package/dist/cjs/bcm-range.cjs.entry.js +13 -7
- package/dist/cjs/bcm-result.cjs.entry.js +6 -2
- package/dist/cjs/bcm-search.cjs.entry.js +12 -16
- package/dist/cjs/bcm-select-group.cjs.entry.js +2 -1
- package/dist/cjs/bcm-select-option.cjs.entry.js +4 -1
- package/dist/cjs/bcm-select.cjs.entry.js +26 -15
- package/dist/cjs/bcm-skeleton.cjs.entry.js +3 -3
- package/dist/cjs/bcm-step.cjs.entry.js +10 -9
- package/dist/cjs/bcm-stepper.cjs.entry.js +8 -12
- package/dist/cjs/bcm-tab-group.cjs.entry.js +9 -9
- package/dist/cjs/bcm-tab-pane.cjs.entry.js +2 -2
- package/dist/cjs/bcm-tab.cjs.entry.js +2 -5
- package/dist/cjs/bcm-table.cjs.entry.js +2 -2
- package/dist/cjs/bcm-tabs-content.cjs.entry.js +2 -2
- package/dist/cjs/bcm-tabs.cjs.entry.js +2 -8
- package/dist/cjs/bcm-tag.cjs.entry.js +19 -16
- package/dist/cjs/bcm-textarea.cjs.entry.js +20 -10
- package/dist/cjs/bcm-time-picker.cjs.entry.js +12 -5
- package/dist/cjs/bcm-timeline-item.cjs.entry.js +3 -5
- package/dist/cjs/bcm-timeline.cjs.entry.js +3 -5
- package/dist/cjs/bcm-treeview-group.cjs.entry.js +1 -1
- package/dist/cjs/bromcom-ui.cjs.js +3 -3
- package/dist/cjs/{caption-template-954d34bc.js → caption-template-95c791a2.js} +1 -1
- package/dist/cjs/{floating-ui-dae608ba.js → floating-ui-2a4a79ff.js} +4 -3
- package/dist/cjs/{generate-73db206b.js → generate-0d51cba6.js} +14 -14
- package/dist/cjs/{index-f8547ecd.js → index-1d2ce51d.js} +1 -1
- package/dist/cjs/{index-9d98aa56.js → index-1fda1524.js} +473 -275
- package/dist/cjs/{input-template-c8ceb3ff.js → input-template-d7f600a5.js} +7 -7
- package/dist/cjs/{is-load-decorator-65755a67.js → is-load-decorator-77664890.js} +1 -1
- package/dist/cjs/{label-template-1ed6a569.js → label-template-e56264b3.js} +4 -4
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/{number-helper-2253d3ad.js → number-helper-1d113d3e.js} +1 -1
- package/dist/cjs/old-bcm-popover-box.cjs.entry.js +14 -8
- package/dist/cjs/old-bcm-popover.cjs.entry.js +9 -10
- package/dist/cjs/{popover-placement-87901bb3.js → popover-placement-ac98d407.js} +1 -1
- package/dist/cjs/{slot-template-2ff0d22a.js → slot-template-a4505c70.js} +2 -2
- package/dist/cjs/{stepper-states-c4dbafba.js → stepper-states-f66c2ae8.js} +2 -2
- package/dist/cjs/{string-helper-df40a475.js → string-helper-145cd64f.js} +2 -2
- package/dist/cjs/{tooltip-helper-88c00766.js → tooltip-helper-eff66c97.js} +37 -5
- package/dist/cjs/{validators-e5907199.js → validators-424a487a.js} +1 -1
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/atoms/avatar/avatar.js +197 -184
- package/dist/collection/components/atoms/badge/badge.js +174 -164
- package/dist/collection/components/atoms/box/box.js +8 -5
- package/dist/collection/components/atoms/button/button.js +392 -373
- package/dist/collection/components/atoms/chip/chip.js +143 -133
- package/dist/collection/components/atoms/divider/divider.js +61 -53
- package/dist/collection/components/atoms/icon/icon.js +57 -47
- package/dist/collection/components/atoms/label/label.js +192 -182
- package/dist/collection/components/atoms/link/link.js +138 -127
- package/dist/collection/components/atoms/tag/tag.js +286 -273
- package/dist/collection/components/atoms/typography/typography.js +8 -5
- package/dist/collection/components/molecules/accordion/accordion.js +72 -61
- package/dist/collection/components/molecules/alert/alert.js +218 -217
- package/dist/collection/components/molecules/breadcrumb/breadcrumb.js +110 -104
- package/dist/collection/components/molecules/breadcrumb/types.js +0 -4
- package/dist/collection/components/molecules/button-group/button-group.js +159 -144
- package/dist/collection/components/molecules/card/card.js +83 -73
- package/dist/collection/components/molecules/checkbox/checkbox-lite.js +175 -176
- package/dist/collection/components/molecules/checkbox/checkbox.js +536 -524
- package/dist/collection/components/molecules/checkbox/group.js +589 -571
- package/dist/collection/components/molecules/drawer/drawer.js +193 -189
- package/dist/collection/components/molecules/dropdown/dropdown.js +610 -782
- package/dist/collection/components/molecules/empty/empty.js +32 -26
- package/dist/collection/components/molecules/error-layout/error-layout.js +126 -111
- package/dist/collection/components/molecules/error-layout/types.js +0 -4
- package/dist/collection/components/molecules/expansion-panel/expansion-panel.js +212 -212
- package/dist/collection/components/molecules/input/input.js +891 -857
- package/dist/collection/components/molecules/item/item.js +95 -85
- package/dist/collection/components/molecules/items/items.js +46 -38
- package/dist/collection/components/molecules/linked/linked.js +285 -241
- package/dist/collection/components/molecules/menu/menu.js +368 -538
- package/dist/collection/components/molecules/message/message.js +149 -144
- package/dist/collection/components/molecules/modal/modal.js +261 -252
- package/dist/collection/components/molecules/notification/notification.js +167 -161
- package/dist/collection/components/molecules/popconfirm/popconfirm-box.js +299 -285
- package/dist/collection/components/molecules/popconfirm/popconfirm.js +293 -277
- package/dist/collection/components/molecules/popover/popover.js +190 -181
- package/dist/collection/components/molecules/progress/progress.js +255 -262
- package/dist/collection/components/molecules/radio/group.js +516 -494
- package/dist/collection/components/molecules/radio/radio.js +212 -207
- package/dist/collection/components/molecules/range/range.js +289 -285
- package/dist/collection/components/molecules/result/result.js +104 -97
- package/dist/collection/components/molecules/search/search.js +308 -295
- package/dist/collection/components/molecules/skeleton/skeleton.js +47 -52
- package/dist/collection/components/molecules/stepper/step.js +281 -271
- package/dist/collection/components/molecules/stepper/stepper.js +309 -300
- package/dist/collection/components/molecules/switch/switch.js +598 -583
- package/dist/collection/components/molecules/tab-group/tab-group.js +126 -120
- package/dist/collection/components/molecules/textarea/textarea.js +622 -597
- package/dist/collection/components/molecules/timeline/timeline-item.js +125 -120
- package/dist/collection/components/molecules/timeline/timeline.js +79 -71
- package/dist/collection/components/molecules/tooltip/tooltip.js +173 -164
- package/dist/collection/components/organism/autocomplete/autocomplete.js +260 -247
- package/dist/collection/components/organism/colorpicker/colorpicker.js +360 -368
- package/dist/collection/components/organism/date-picker/date-picker.js +626 -604
- package/dist/collection/components/organism/datetime-picker/datetime-picker.js +750 -775
- package/dist/collection/components/organism/form/form-group.js +108 -99
- package/dist/collection/components/organism/form/form.js +253 -238
- package/dist/collection/components/organism/form-2/form-2.js +164 -149
- package/dist/collection/components/organism/list/list.js +1133 -1128
- package/dist/collection/components/organism/time-picker/time-picker.js +502 -484
- package/dist/collection/components/other/attendance/attendance.js +60 -61
- package/dist/collection/components/other/data-table/table.js +40 -30
- package/dist/collection/components/other/default/default.js +40 -32
- package/dist/collection/components/other_deprecated/collapse/collapse.js +125 -119
- package/dist/collection/components/other_deprecated/collapse/group.js +90 -83
- package/dist/collection/components/other_deprecated/listbox/listbox-group.js +68 -68
- package/dist/collection/components/other_deprecated/listbox/listbox-item.js +500 -495
- package/dist/collection/components/other_deprecated/listbox/listbox.js +1067 -1071
- package/dist/collection/components/other_deprecated/old-input/old-input.js +786 -775
- package/dist/collection/components/other_deprecated/old-popover/old-popover-box.js +285 -267
- package/dist/collection/components/other_deprecated/old-popover/old-popover.js +214 -202
- package/dist/collection/components/other_deprecated/old-search/old-search.js +333 -314
- package/dist/collection/components/other_deprecated/old-tag/old-tag.js +247 -241
- package/dist/collection/components/other_deprecated/select/group.js +68 -67
- package/dist/collection/components/other_deprecated/select/option.js +120 -111
- package/dist/collection/components/other_deprecated/select/select-box.js +77 -71
- package/dist/collection/components/other_deprecated/select/select.js +1096 -1093
- package/dist/collection/components/other_deprecated/tabs/tab-pane.js +121 -111
- package/dist/collection/components/other_deprecated/tabs/tab.js +229 -226
- package/dist/collection/components/other_deprecated/tabs/tabs-content.js +108 -98
- package/dist/collection/components/other_deprecated/tabs/tabs.js +423 -411
- package/dist/collection/components/other_deprecated/text/text.js +125 -117
- package/dist/collection/components/other_deprecated/treeview/treeview-group.js +11 -7
- package/dist/collection/components/other_deprecated/treeview/treeview-item.js +651 -646
- package/dist/collection/components/other_deprecated/treeview/treeview.js +882 -874
- package/dist/collection/index.js +0 -4
- package/dist/collection/models/bcm-types.js +0 -4
- package/dist/collection/models/states/atoms/bcm-atoms-state.js +0 -4
- package/dist/collection/models/states/molecules/bcm-molecules-state.js +0 -4
- package/dist/collection/models/states/organisms/bcm-organisms-state.js +0 -4
- package/dist/collection/templates/button-template.js +1 -12
- package/dist/collection/templates/caption-template.js +3 -14
- package/dist/collection/templates/checkbox-template.js +1 -5
- package/dist/collection/templates/info-footer-template.js +1 -6
- package/dist/collection/templates/input-template.js +8 -29
- package/dist/collection/templates/label-template.js +1 -5
- package/dist/collection/templates/list-item-template.js +2 -9
- package/dist/collection/templates/list-template.js +1 -14
- package/dist/collection/templates/slot-template.js +1 -2
- package/dist/collection/templates/step-template.js +1 -5
- package/dist/collection/templates/tag-template.js +1 -10
- package/dist/collection/types/index.js +0 -4
- package/dist/collection/utils/floating-ui.js +2 -1
- package/dist/components/avatar.js +5 -0
- package/dist/components/badge.js +4 -0
- package/dist/components/bcm-alert.js +3 -4
- package/dist/components/bcm-attendance.js +0 -4
- package/dist/components/bcm-autocomplete.js +1 -0
- package/dist/components/bcm-breadcrumb.js +1 -0
- package/dist/components/bcm-button-group.js +2 -0
- package/dist/components/bcm-card.js +3 -1
- package/dist/components/bcm-checkbox-group.js +6 -0
- package/dist/components/bcm-chip.js +4 -0
- package/dist/components/bcm-colorpicker.js +6 -7
- package/dist/components/bcm-date-picker.js +7 -0
- package/dist/components/bcm-drawer.js +1 -4
- package/dist/components/bcm-dropdown.js +38 -167
- package/dist/components/bcm-expansion-panel.js +1 -0
- package/dist/components/bcm-form-2.js +2 -2
- package/dist/components/bcm-form-group.js +1 -0
- package/dist/components/bcm-form.js +1 -0
- package/dist/components/bcm-input.js +22 -5
- package/dist/components/bcm-item.js +1 -0
- package/dist/components/bcm-linked.js +1 -192
- package/dist/components/bcm-list.js +15 -12
- package/dist/components/bcm-message.js +0 -3
- package/dist/components/bcm-modal.js +2 -0
- package/dist/components/bcm-notification.js +2 -0
- package/dist/components/bcm-popconfirm.js +1 -0
- package/dist/components/bcm-radio-group.js +9 -0
- package/dist/components/bcm-range.js +6 -0
- package/dist/components/bcm-result.js +4 -0
- package/dist/components/bcm-select-group.js +1 -0
- package/dist/components/bcm-select-option.js +3 -0
- package/dist/components/bcm-select.js +22 -11
- package/dist/components/bcm-stepper.js +0 -4
- package/dist/components/bcm-switch.js +11 -1
- package/dist/components/bcm-tab-group.js +1 -1
- package/dist/components/bcm-tab.js +0 -3
- package/dist/components/bcm-tabs.js +0 -6
- package/dist/components/bcm-tag.js +3 -0
- package/dist/components/bcm-textarea.js +11 -1
- package/dist/components/bcm-time-picker.js +7 -0
- package/dist/components/bcm-timeline-item.js +1 -3
- package/dist/components/bcm-timeline.js +1 -3
- package/dist/components/button.js +6 -0
- package/dist/components/checkbox.js +6 -4
- package/dist/components/datetime-picker.js +9 -6
- package/dist/components/empty.js +1 -0
- package/dist/components/floating-ui.js +2 -1
- package/dist/components/generate.js +1 -1
- package/dist/components/icon.js +1 -0
- package/dist/components/label.js +4 -1
- package/dist/components/link.js +3 -0
- package/dist/{esm/bcm-linked.entry.js → components/linked.js} +60 -22
- package/dist/components/listbox-group.js +1 -0
- package/dist/components/listbox-item.js +7 -0
- package/dist/components/listbox.js +16 -9
- package/dist/components/menu.js +11 -126
- package/dist/components/old-bcm-popover.js +3 -4
- package/dist/components/old-input.js +14 -1
- package/dist/components/old-popover-box.js +6 -0
- package/dist/components/old-tag.js +2 -0
- package/dist/components/popconfirm-box.js +5 -0
- package/dist/components/radio.js +3 -2
- package/dist/components/search.js +4 -8
- package/dist/components/step.js +5 -4
- package/dist/components/text.js +2 -0
- package/dist/components/treeview-item.js +5 -1
- package/dist/components/treeview.js +7 -4
- package/dist/esm/bcm-accordion.entry.js +3 -3
- package/dist/esm/bcm-alert.entry.js +7 -8
- package/dist/esm/bcm-attendance.entry.js +3 -7
- package/dist/esm/bcm-autocomplete.entry.js +3 -2
- package/dist/esm/bcm-avatar_15.entry.js +1936 -0
- package/dist/esm/bcm-b8d8a236.js +1 -1
- package/dist/esm/bcm-box.entry.js +2 -2
- package/dist/esm/bcm-breadcrumb.entry.js +4 -3
- package/dist/esm/bcm-button-group.entry.js +6 -4
- package/dist/esm/bcm-card.entry.js +7 -5
- package/dist/esm/bcm-checkbox-group.entry.js +13 -7
- package/dist/esm/bcm-checkbox-lite_9.entry.js +41 -18
- package/dist/esm/bcm-checkbox_2.entry.js +12 -10
- package/dist/esm/bcm-chip.entry.js +7 -3
- package/dist/esm/bcm-collapse-group.entry.js +2 -2
- package/dist/esm/bcm-collapse.entry.js +3 -3
- package/dist/esm/bcm-colorpicker.entry.js +8 -9
- package/dist/esm/bcm-date-picker.entry.js +11 -4
- package/dist/esm/bcm-datetime-picker.entry.js +15 -12
- package/dist/esm/bcm-default.entry.js +3 -3
- package/dist/esm/bcm-drawer.entry.js +7 -10
- package/dist/esm/bcm-error-layout.entry.js +2 -2
- package/dist/esm/bcm-expansion-panel.entry.js +4 -3
- package/dist/esm/bcm-form-2.entry.js +6 -6
- package/dist/esm/bcm-form-group.entry.js +3 -2
- package/dist/esm/bcm-input.entry.js +30 -13
- package/dist/esm/bcm-link.entry.js +6 -3
- package/dist/esm/bcm-list.entry.js +27 -25
- package/dist/esm/bcm-message.entry.js +2 -5
- package/dist/esm/{bcm-label_2.entry.js → bcm-modal.entry.js} +101 -77
- package/dist/esm/bcm-notification.entry.js +4 -2
- package/dist/esm/bcm-old-input.entry.js +17 -4
- package/dist/esm/bcm-old-tag_2.entry.js +4 -2
- package/dist/esm/bcm-popconfirm-box.entry.js +8 -3
- package/dist/esm/bcm-popconfirm.entry.js +5 -4
- package/dist/esm/bcm-progress.entry.js +4 -4
- package/dist/esm/bcm-radio-group.entry.js +15 -6
- package/dist/esm/bcm-radio.entry.js +8 -7
- package/dist/esm/bcm-range.entry.js +10 -4
- package/dist/esm/bcm-result.entry.js +6 -2
- package/dist/esm/bcm-search.entry.js +10 -14
- package/dist/esm/bcm-select-group.entry.js +2 -1
- package/dist/esm/bcm-select-option.entry.js +4 -1
- package/dist/esm/bcm-select.entry.js +24 -13
- package/dist/esm/bcm-skeleton.entry.js +3 -3
- package/dist/esm/bcm-step.entry.js +10 -9
- package/dist/esm/bcm-stepper.entry.js +6 -10
- package/dist/esm/bcm-tab-group.entry.js +5 -5
- package/dist/esm/bcm-tab-pane.entry.js +2 -2
- package/dist/esm/bcm-tab.entry.js +2 -5
- package/dist/esm/bcm-table.entry.js +2 -2
- package/dist/esm/bcm-tabs-content.entry.js +2 -2
- package/dist/esm/bcm-tabs.entry.js +2 -8
- package/dist/esm/bcm-tag.entry.js +8 -5
- package/dist/esm/bcm-textarea.entry.js +17 -7
- package/dist/esm/bcm-time-picker.entry.js +11 -4
- package/dist/esm/bcm-timeline-item.entry.js +3 -5
- package/dist/esm/bcm-timeline.entry.js +3 -5
- package/dist/esm/bcm-treeview-group.entry.js +1 -1
- package/dist/esm/bromcom-ui.js +3 -3
- package/dist/esm/{caption-template-d54ee0c3.js → caption-template-e7d51661.js} +1 -1
- package/dist/esm/{floating-ui-f03a96ce.js → floating-ui-700d0b98.js} +3 -2
- package/dist/esm/{generate-a7f3d168.js → generate-30f32431.js} +14 -14
- package/dist/esm/{index-2a3eeccc.js → index-58077b32.js} +473 -275
- package/dist/esm/{index-6e950253.js → index-6bdec00d.js} +1 -1
- package/dist/esm/{input-template-928c8d17.js → input-template-0131cb6b.js} +3 -3
- package/dist/esm/{is-load-decorator-b990575a.js → is-load-decorator-d57b8f9e.js} +1 -1
- package/dist/esm/{label-template-e3eebfbc.js → label-template-f352ef5b.js} +3 -3
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{number-helper-f3b67bd2.js → number-helper-49efb3a0.js} +1 -1
- package/dist/esm/old-bcm-popover-box.entry.js +11 -5
- package/dist/esm/old-bcm-popover.entry.js +7 -8
- package/dist/esm/polyfills/css-shim.js +1 -1
- package/dist/esm/{slot-template-877c4e01.js → slot-template-aee2ff75.js} +1 -1
- package/dist/esm/{stepper-states-e2489128.js → stepper-states-204a065e.js} +2 -2
- package/dist/esm/string-helper-74a1648f.js +1 -1
- package/dist/esm/{tooltip-helper-99202557.js → tooltip-helper-968148fa.js} +36 -5
- package/dist/esm/{validators-0f31a959.js → validators-e1c02a1a.js} +1 -1
- package/dist/types/components/molecules/dropdown/dropdown.d.ts +2 -15
- package/dist/types/components/molecules/linked/linked.d.ts +3 -1
- package/dist/types/components/molecules/menu/menu.d.ts +1 -13
- package/dist/types/components.d.ts +12 -13
- package/dist/types/stencil-public-runtime.d.ts +20 -4
- package/loader/package.json +1 -0
- package/package.json +1 -1
- package/dist/bromcom-ui/assets +0 -0
- package/dist/bromcom-ui/p-0031ea84.entry.js +0 -5
- package/dist/bromcom-ui/p-00fb02e5.entry.js +0 -5
- package/dist/bromcom-ui/p-02892da0.entry.js +0 -5
- package/dist/bromcom-ui/p-046bc94c.entry.js +0 -5
- package/dist/bromcom-ui/p-0594c485.entry.js +0 -5
- package/dist/bromcom-ui/p-0ae411fe.entry.js +0 -5
- package/dist/bromcom-ui/p-0d37438e.entry.js +0 -5
- package/dist/bromcom-ui/p-10caf4ce.js +0 -6
- package/dist/bromcom-ui/p-12e845fb.entry.js +0 -5
- package/dist/bromcom-ui/p-1507f99a.entry.js +0 -5
- package/dist/bromcom-ui/p-1808adae.entry.js +0 -5
- package/dist/bromcom-ui/p-23de3629.entry.js +0 -5
- package/dist/bromcom-ui/p-2b91dab0.entry.js +0 -5
- package/dist/bromcom-ui/p-2cfa8d1a.js +0 -5
- package/dist/bromcom-ui/p-3057e85a.entry.js +0 -5
- package/dist/bromcom-ui/p-34c2069d.entry.js +0 -5
- package/dist/bromcom-ui/p-35be5c95.entry.js +0 -5
- package/dist/bromcom-ui/p-3b581c7d.entry.js +0 -5
- package/dist/bromcom-ui/p-3bcefb6e.entry.js +0 -5
- package/dist/bromcom-ui/p-3ee2e4fe.entry.js +0 -5
- package/dist/bromcom-ui/p-41cbecc7.entry.js +0 -5
- package/dist/bromcom-ui/p-42197730.entry.js +0 -5
- package/dist/bromcom-ui/p-44d68311.js +0 -5
- package/dist/bromcom-ui/p-4533663c.entry.js +0 -5
- package/dist/bromcom-ui/p-4be4c5bf.js +0 -5
- package/dist/bromcom-ui/p-4caf9f93.js +0 -5
- package/dist/bromcom-ui/p-4dbbb202.entry.js +0 -5
- package/dist/bromcom-ui/p-522c96a2.js +0 -5
- package/dist/bromcom-ui/p-5273d935.entry.js +0 -5
- package/dist/bromcom-ui/p-52ffb8e1.js +0 -5
- package/dist/bromcom-ui/p-5ad079a6.entry.js +0 -5
- package/dist/bromcom-ui/p-640244fa.entry.js +0 -5
- package/dist/bromcom-ui/p-6ad01d01.entry.js +0 -5
- package/dist/bromcom-ui/p-6c7eb43f.entry.js +0 -5
- package/dist/bromcom-ui/p-6e89ceb2.entry.js +0 -5
- package/dist/bromcom-ui/p-70b13097.entry.js +0 -5
- package/dist/bromcom-ui/p-721534bd.entry.js +0 -5
- package/dist/bromcom-ui/p-7385899c.js +0 -5
- package/dist/bromcom-ui/p-751c94dd.entry.js +0 -5
- package/dist/bromcom-ui/p-799a5570.entry.js +0 -5
- package/dist/bromcom-ui/p-7d76a273.entry.js +0 -5
- package/dist/bromcom-ui/p-7f065a45.entry.js +0 -5
- package/dist/bromcom-ui/p-8907162c.entry.js +0 -5
- package/dist/bromcom-ui/p-92fa0a00.entry.js +0 -5
- package/dist/bromcom-ui/p-99a2cb36.entry.js +0 -5
- package/dist/bromcom-ui/p-9e2b4b55.entry.js +0 -5
- package/dist/bromcom-ui/p-9efe118a.entry.js +0 -5
- package/dist/bromcom-ui/p-a0042349.entry.js +0 -5
- package/dist/bromcom-ui/p-a1c849e7.js +0 -5
- package/dist/bromcom-ui/p-a628aed8.entry.js +0 -5
- package/dist/bromcom-ui/p-a98aecdf.entry.js +0 -5
- package/dist/bromcom-ui/p-b088a98d.entry.js +0 -5
- package/dist/bromcom-ui/p-b4cbf3bd.entry.js +0 -5
- package/dist/bromcom-ui/p-b9983e4b.entry.js +0 -5
- package/dist/bromcom-ui/p-be39c24b.entry.js +0 -5
- package/dist/bromcom-ui/p-bf30bf7f.entry.js +0 -5
- package/dist/bromcom-ui/p-c0e8c481.entry.js +0 -5
- package/dist/bromcom-ui/p-dbb106a4.entry.js +0 -5
- package/dist/bromcom-ui/p-e467d49f.entry.js +0 -5
- package/dist/bromcom-ui/p-e50f0098.entry.js +0 -5
- package/dist/bromcom-ui/p-ebb01d57.entry.js +0 -5
- package/dist/bromcom-ui/p-f4936482.entry.js +0 -5
- package/dist/bromcom-ui/p-fa42b2de.entry.js +0 -5
- package/dist/cjs/bcm-avatar_2.cjs.entry.js +0 -156
- package/dist/cjs/bcm-button_3.cjs.entry.js +0 -530
- package/dist/cjs/bcm-dropdown.cjs.entry.js +0 -239
- package/dist/cjs/bcm-form.cjs.entry.js +0 -486
- package/dist/cjs/bcm-item.cjs.entry.js +0 -83
- package/dist/cjs/bcm-items.cjs.entry.js +0 -61
- package/dist/cjs/bcm-linked.cjs.entry.js +0 -179
- package/dist/cjs/bcm-menu.cjs.entry.js +0 -248
- package/dist/cjs/bcm-popover.cjs.entry.js +0 -183
- package/dist/cjs/bcm-switch.cjs.entry.js +0 -139
- package/dist/cjs/bcm-text.cjs.entry.js +0 -60
- package/dist/cjs/json-parse-decarator-4d8d8097.js +0 -40
- package/dist/cjs/property-decorators-cb2155ed.js +0 -33
- package/dist/collection/assets +0 -0
- package/dist/components/property-decorators.js +0 -31
- package/dist/esm/bcm-avatar_2.entry.js +0 -151
- package/dist/esm/bcm-button_3.entry.js +0 -524
- package/dist/esm/bcm-form.entry.js +0 -482
- package/dist/esm/bcm-item.entry.js +0 -79
- package/dist/esm/bcm-items.entry.js +0 -57
- package/dist/esm/bcm-menu.entry.js +0 -244
- package/dist/esm/bcm-popover.entry.js +0 -179
- package/dist/esm/bcm-switch.entry.js +0 -135
- package/dist/esm/bcm-text.entry.js +0 -56
- package/dist/esm/json-parse-decarator-58394179.js +0 -38
- package/dist/esm/property-decorators-f3f1e7de.js +0 -31
|
@@ -26,6 +26,14 @@ function _interopNamespace(e) {
|
|
|
26
26
|
|
|
27
27
|
const NAMESPACE = 'bromcom-ui';
|
|
28
28
|
|
|
29
|
+
/**
|
|
30
|
+
* Virtual DOM patching algorithm based on Snabbdom by
|
|
31
|
+
* Simon Friis Vindum (@paldepind)
|
|
32
|
+
* Licensed under the MIT License
|
|
33
|
+
* https://github.com/snabbdom/snabbdom/blob/master/LICENSE
|
|
34
|
+
*
|
|
35
|
+
* Modified for Stencil's renderer and slot projection
|
|
36
|
+
*/
|
|
29
37
|
let scopeId;
|
|
30
38
|
let contentRef;
|
|
31
39
|
let hostTagName;
|
|
@@ -35,65 +43,10 @@ let checkSlotRelocate = false;
|
|
|
35
43
|
let isSvgMode = false;
|
|
36
44
|
let renderingRef = null;
|
|
37
45
|
let queuePending = false;
|
|
38
|
-
const
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
$flags$: 0,
|
|
42
|
-
$resourcesUrl$: '',
|
|
43
|
-
jmp: (h) => h(),
|
|
44
|
-
raf: (h) => requestAnimationFrame(h),
|
|
45
|
-
ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
|
|
46
|
-
rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
|
|
47
|
-
ce: (eventName, opts) => new CustomEvent(eventName, opts),
|
|
48
|
-
};
|
|
49
|
-
const promiseResolve = (v) => Promise.resolve(v);
|
|
50
|
-
const supportsConstructableStylesheets = /*@__PURE__*/ (() => {
|
|
51
|
-
try {
|
|
52
|
-
new CSSStyleSheet();
|
|
53
|
-
return typeof new CSSStyleSheet().replaceSync === 'function';
|
|
54
|
-
}
|
|
55
|
-
catch (e) { }
|
|
56
|
-
return false;
|
|
57
|
-
})()
|
|
58
|
-
;
|
|
59
|
-
const addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
|
|
60
|
-
if (listeners) {
|
|
61
|
-
listeners.map(([flags, name, method]) => {
|
|
62
|
-
const target = getHostListenerTarget(elm, flags) ;
|
|
63
|
-
const handler = hostListenerProxy(hostRef, method);
|
|
64
|
-
const opts = hostListenerOpts(flags);
|
|
65
|
-
plt.ael(target, name, handler, opts);
|
|
66
|
-
(hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
const hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
71
|
-
try {
|
|
72
|
-
{
|
|
73
|
-
if (hostRef.$flags$ & 256 /* isListenReady */) {
|
|
74
|
-
// instance is ready, let's call it's member method for this event
|
|
75
|
-
hostRef.$lazyInstance$[methodName](ev);
|
|
76
|
-
}
|
|
77
|
-
else {
|
|
78
|
-
(hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
catch (e) {
|
|
83
|
-
consoleError(e);
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
const getHostListenerTarget = (elm, flags) => {
|
|
87
|
-
if (flags & 4 /* TargetDocument */)
|
|
88
|
-
return doc;
|
|
89
|
-
if (flags & 8 /* TargetWindow */)
|
|
90
|
-
return win;
|
|
91
|
-
return elm;
|
|
46
|
+
const getAssetPath = (path) => {
|
|
47
|
+
const assetUrl = new URL(path, plt.$resourcesUrl$);
|
|
48
|
+
return assetUrl.origin !== win.location.origin ? assetUrl.href : assetUrl.pathname;
|
|
92
49
|
};
|
|
93
|
-
// prettier-ignore
|
|
94
|
-
const hostListenerOpts = (flags) => (flags & 2 /* Capture */) !== 0;
|
|
95
|
-
const HYDRATED_CSS = '{visibility:hidden}[hydrated]{visibility:inherit}';
|
|
96
|
-
const XLINK_NS = 'http://www.w3.org/1999/xlink';
|
|
97
50
|
const createTime = (fnName, tagName = '') => {
|
|
98
51
|
{
|
|
99
52
|
return () => {
|
|
@@ -108,76 +61,8 @@ const uniqueTime = (key, measureText) => {
|
|
|
108
61
|
};
|
|
109
62
|
}
|
|
110
63
|
};
|
|
111
|
-
const
|
|
112
|
-
const
|
|
113
|
-
let style = styles.get(scopeId);
|
|
114
|
-
if (supportsConstructableStylesheets && allowCS) {
|
|
115
|
-
style = (style || new CSSStyleSheet());
|
|
116
|
-
if (typeof style === 'string') {
|
|
117
|
-
style = cssText;
|
|
118
|
-
}
|
|
119
|
-
else {
|
|
120
|
-
style.replaceSync(cssText);
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
else {
|
|
124
|
-
style = cssText;
|
|
125
|
-
}
|
|
126
|
-
styles.set(scopeId, style);
|
|
127
|
-
};
|
|
128
|
-
const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
|
|
129
|
-
let scopeId = getScopeId(cmpMeta);
|
|
130
|
-
const style = styles.get(scopeId);
|
|
131
|
-
// if an element is NOT connected then getRootNode() will return the wrong root node
|
|
132
|
-
// so the fallback is to always use the document for the root node in those cases
|
|
133
|
-
styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc;
|
|
134
|
-
if (style) {
|
|
135
|
-
if (typeof style === 'string') {
|
|
136
|
-
styleContainerNode = styleContainerNode.head || styleContainerNode;
|
|
137
|
-
let appliedStyles = rootAppliedStyles.get(styleContainerNode);
|
|
138
|
-
let styleElm;
|
|
139
|
-
if (!appliedStyles) {
|
|
140
|
-
rootAppliedStyles.set(styleContainerNode, (appliedStyles = new Set()));
|
|
141
|
-
}
|
|
142
|
-
if (!appliedStyles.has(scopeId)) {
|
|
143
|
-
{
|
|
144
|
-
{
|
|
145
|
-
styleElm = doc.createElement('style');
|
|
146
|
-
styleElm.innerHTML = style;
|
|
147
|
-
}
|
|
148
|
-
styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
|
|
149
|
-
}
|
|
150
|
-
if (appliedStyles) {
|
|
151
|
-
appliedStyles.add(scopeId);
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
|
|
156
|
-
styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
return scopeId;
|
|
160
|
-
};
|
|
161
|
-
const attachStyles = (hostRef) => {
|
|
162
|
-
const cmpMeta = hostRef.$cmpMeta$;
|
|
163
|
-
const elm = hostRef.$hostElement$;
|
|
164
|
-
const flags = cmpMeta.$flags$;
|
|
165
|
-
const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
|
|
166
|
-
const scopeId = addStyle(elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta);
|
|
167
|
-
if (flags & 10 /* needsScopedEncapsulation */) {
|
|
168
|
-
// only required when we're NOT using native shadow dom (slot)
|
|
169
|
-
// or this browser doesn't support native shadow dom
|
|
170
|
-
// and this host element was NOT created with SSR
|
|
171
|
-
// let's pick out the inner content for slot projection
|
|
172
|
-
// create a node to represent where the original
|
|
173
|
-
// content was first placed, which is useful later on
|
|
174
|
-
// DOM WRITE!!
|
|
175
|
-
elm['s-sc'] = scopeId;
|
|
176
|
-
elm.classList.add(scopeId + '-h');
|
|
177
|
-
}
|
|
178
|
-
endAttachStyles();
|
|
179
|
-
};
|
|
180
|
-
const getScopeId = (cmp, mode) => 'sc-' + (cmp.$tagName$);
|
|
64
|
+
const HYDRATED_CSS = '{visibility:hidden}[hydrated]{visibility:inherit}';
|
|
65
|
+
const XLINK_NS = 'http://www.w3.org/1999/xlink';
|
|
181
66
|
/**
|
|
182
67
|
* Default style mode id
|
|
183
68
|
*/
|
|
@@ -326,6 +211,149 @@ const convertToPrivate = (node) => {
|
|
|
326
211
|
vnode.$name$ = node.vname;
|
|
327
212
|
return vnode;
|
|
328
213
|
};
|
|
214
|
+
/**
|
|
215
|
+
* Parse a new property value for a given property type.
|
|
216
|
+
*
|
|
217
|
+
* While the prop value can reasonably be expected to be of `any` type as far as TypeScript's type checker is concerned,
|
|
218
|
+
* it is not safe to assume that the string returned by evaluating `typeof propValue` matches:
|
|
219
|
+
* 1. `any`, the type given to `propValue` in the function signature
|
|
220
|
+
* 2. the type stored from `propType`.
|
|
221
|
+
*
|
|
222
|
+
* This function provides the capability to parse/coerce a property's value to potentially any other JavaScript type.
|
|
223
|
+
*
|
|
224
|
+
* Property values represented in TSX preserve their type information. In the example below, the number 0 is passed to
|
|
225
|
+
* a component. This `propValue` will preserve its type information (`typeof propValue === 'number'`). Note that is
|
|
226
|
+
* based on the type of the value being passed in, not the type declared of the class member decorated with `@Prop`.
|
|
227
|
+
* ```tsx
|
|
228
|
+
* <my-cmp prop-val={0}></my-cmp>
|
|
229
|
+
* ```
|
|
230
|
+
*
|
|
231
|
+
* HTML prop values on the other hand, will always a string
|
|
232
|
+
*
|
|
233
|
+
* @param propValue the new value to coerce to some type
|
|
234
|
+
* @param propType the type of the prop, expressed as a binary number
|
|
235
|
+
* @returns the parsed/coerced value
|
|
236
|
+
*/
|
|
237
|
+
const parsePropertyValue = (propValue, propType) => {
|
|
238
|
+
// ensure this value is of the correct prop type
|
|
239
|
+
if (propValue != null && !isComplexType(propValue)) {
|
|
240
|
+
if (propType & 4 /* MEMBER_FLAGS.Boolean */) {
|
|
241
|
+
// per the HTML spec, any string value means it is a boolean true value
|
|
242
|
+
// but we'll cheat here and say that the string "false" is the boolean false
|
|
243
|
+
return propValue === 'false' ? false : propValue === '' || !!propValue;
|
|
244
|
+
}
|
|
245
|
+
if (propType & 2 /* MEMBER_FLAGS.Number */) {
|
|
246
|
+
// force it to be a number
|
|
247
|
+
return parseFloat(propValue);
|
|
248
|
+
}
|
|
249
|
+
if (propType & 1 /* MEMBER_FLAGS.String */) {
|
|
250
|
+
// could have been passed as a number or boolean
|
|
251
|
+
// but we still want it as a string
|
|
252
|
+
return String(propValue);
|
|
253
|
+
}
|
|
254
|
+
// redundant return here for better minification
|
|
255
|
+
return propValue;
|
|
256
|
+
}
|
|
257
|
+
// not sure exactly what type we want
|
|
258
|
+
// so no need to change to a different type
|
|
259
|
+
return propValue;
|
|
260
|
+
};
|
|
261
|
+
const getElement = (ref) => (getHostRef(ref).$hostElement$ );
|
|
262
|
+
const createEvent = (ref, name, flags) => {
|
|
263
|
+
const elm = getElement(ref);
|
|
264
|
+
return {
|
|
265
|
+
emit: (detail) => {
|
|
266
|
+
return emitEvent(elm, name, {
|
|
267
|
+
bubbles: !!(flags & 4 /* EVENT_FLAGS.Bubbles */),
|
|
268
|
+
composed: !!(flags & 2 /* EVENT_FLAGS.Composed */),
|
|
269
|
+
cancelable: !!(flags & 1 /* EVENT_FLAGS.Cancellable */),
|
|
270
|
+
detail,
|
|
271
|
+
});
|
|
272
|
+
},
|
|
273
|
+
};
|
|
274
|
+
};
|
|
275
|
+
/**
|
|
276
|
+
* Helper function to create & dispatch a custom Event on a provided target
|
|
277
|
+
* @param elm the target of the Event
|
|
278
|
+
* @param name the name to give the custom Event
|
|
279
|
+
* @param opts options for configuring a custom Event
|
|
280
|
+
* @returns the custom Event
|
|
281
|
+
*/
|
|
282
|
+
const emitEvent = (elm, name, opts) => {
|
|
283
|
+
const ev = plt.ce(name, opts);
|
|
284
|
+
elm.dispatchEvent(ev);
|
|
285
|
+
return ev;
|
|
286
|
+
};
|
|
287
|
+
const rootAppliedStyles = /*@__PURE__*/ new WeakMap();
|
|
288
|
+
const registerStyle = (scopeId, cssText, allowCS) => {
|
|
289
|
+
let style = styles.get(scopeId);
|
|
290
|
+
if (supportsConstructableStylesheets && allowCS) {
|
|
291
|
+
style = (style || new CSSStyleSheet());
|
|
292
|
+
if (typeof style === 'string') {
|
|
293
|
+
style = cssText;
|
|
294
|
+
}
|
|
295
|
+
else {
|
|
296
|
+
style.replaceSync(cssText);
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
else {
|
|
300
|
+
style = cssText;
|
|
301
|
+
}
|
|
302
|
+
styles.set(scopeId, style);
|
|
303
|
+
};
|
|
304
|
+
const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
|
|
305
|
+
let scopeId = getScopeId(cmpMeta);
|
|
306
|
+
const style = styles.get(scopeId);
|
|
307
|
+
// if an element is NOT connected then getRootNode() will return the wrong root node
|
|
308
|
+
// so the fallback is to always use the document for the root node in those cases
|
|
309
|
+
styleContainerNode = styleContainerNode.nodeType === 11 /* NODE_TYPE.DocumentFragment */ ? styleContainerNode : doc;
|
|
310
|
+
if (style) {
|
|
311
|
+
if (typeof style === 'string') {
|
|
312
|
+
styleContainerNode = styleContainerNode.head || styleContainerNode;
|
|
313
|
+
let appliedStyles = rootAppliedStyles.get(styleContainerNode);
|
|
314
|
+
let styleElm;
|
|
315
|
+
if (!appliedStyles) {
|
|
316
|
+
rootAppliedStyles.set(styleContainerNode, (appliedStyles = new Set()));
|
|
317
|
+
}
|
|
318
|
+
if (!appliedStyles.has(scopeId)) {
|
|
319
|
+
{
|
|
320
|
+
{
|
|
321
|
+
styleElm = doc.createElement('style');
|
|
322
|
+
styleElm.innerHTML = style;
|
|
323
|
+
}
|
|
324
|
+
styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
|
|
325
|
+
}
|
|
326
|
+
if (appliedStyles) {
|
|
327
|
+
appliedStyles.add(scopeId);
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
|
|
332
|
+
styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
return scopeId;
|
|
336
|
+
};
|
|
337
|
+
const attachStyles = (hostRef) => {
|
|
338
|
+
const cmpMeta = hostRef.$cmpMeta$;
|
|
339
|
+
const elm = hostRef.$hostElement$;
|
|
340
|
+
const flags = cmpMeta.$flags$;
|
|
341
|
+
const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
|
|
342
|
+
const scopeId = addStyle(elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta);
|
|
343
|
+
if (flags & 10 /* CMP_FLAGS.needsScopedEncapsulation */) {
|
|
344
|
+
// only required when we're NOT using native shadow dom (slot)
|
|
345
|
+
// or this browser doesn't support native shadow dom
|
|
346
|
+
// and this host element was NOT created with SSR
|
|
347
|
+
// let's pick out the inner content for slot projection
|
|
348
|
+
// create a node to represent where the original
|
|
349
|
+
// content was first placed, which is useful later on
|
|
350
|
+
// DOM WRITE!!
|
|
351
|
+
elm['s-sc'] = scopeId;
|
|
352
|
+
elm.classList.add(scopeId + '-h');
|
|
353
|
+
}
|
|
354
|
+
endAttachStyles();
|
|
355
|
+
};
|
|
356
|
+
const getScopeId = (cmp, mode) => 'sc-' + (cmp.$tagName$);
|
|
329
357
|
/**
|
|
330
358
|
* Production setAccessor() function based on Preact by
|
|
331
359
|
* Jason Miller (@developit)
|
|
@@ -462,7 +490,7 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
462
490
|
}
|
|
463
491
|
}
|
|
464
492
|
}
|
|
465
|
-
else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex) {
|
|
493
|
+
else if ((!isProp || flags & 4 /* VNODE_FLAGS.isHost */ || isSvg) && !isComplex) {
|
|
466
494
|
newValue = newValue === true ? '' : newValue;
|
|
467
495
|
if (xlink) {
|
|
468
496
|
elm.setAttributeNS(XLINK_NS, memberName, newValue);
|
|
@@ -480,7 +508,7 @@ const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
|
|
|
480
508
|
// if the element passed in is a shadow root, which is a document fragment
|
|
481
509
|
// then we want to be adding attrs/props to the shadow root's "host" element
|
|
482
510
|
// if it's not a shadow root, then we add attrs/props to the same element
|
|
483
|
-
const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host
|
|
511
|
+
const elm = newVnode.$elm$.nodeType === 11 /* NODE_TYPE.DocumentFragment */ && newVnode.$elm$.host
|
|
484
512
|
? newVnode.$elm$.host
|
|
485
513
|
: newVnode.$elm$;
|
|
486
514
|
const oldVnodeAttrs = (oldVnode && oldVnode.$attrs$) || EMPTY_OBJ;
|
|
@@ -498,6 +526,16 @@ const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
|
|
|
498
526
|
setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode, newVnode.$flags$);
|
|
499
527
|
}
|
|
500
528
|
};
|
|
529
|
+
/**
|
|
530
|
+
* Create a DOM Node corresponding to one of the children of a given VNode.
|
|
531
|
+
*
|
|
532
|
+
* @param oldParentVNode the parent VNode from the previous render
|
|
533
|
+
* @param newParentVNode the parent VNode from the current render
|
|
534
|
+
* @param childIndex the index of the VNode, in the _new_ parent node's
|
|
535
|
+
* children, for which we will create a new DOM node
|
|
536
|
+
* @param parentElm the parent DOM node which our new node will be a child of
|
|
537
|
+
* @returns the newly created node
|
|
538
|
+
*/
|
|
501
539
|
const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
502
540
|
// tslint:disable-next-line: prefer-const
|
|
503
541
|
const newVNode = newParentVNode.$children$[childIndex];
|
|
@@ -515,16 +553,16 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
515
553
|
}
|
|
516
554
|
newVNode.$flags$ |= newVNode.$children$
|
|
517
555
|
? // slot element has fallback content
|
|
518
|
-
2 /* isSlotFallback */
|
|
556
|
+
2 /* VNODE_FLAGS.isSlotFallback */
|
|
519
557
|
: // slot element does not have fallback content
|
|
520
|
-
1 /* isSlotReference */;
|
|
558
|
+
1 /* VNODE_FLAGS.isSlotReference */;
|
|
521
559
|
}
|
|
522
560
|
}
|
|
523
561
|
if (newVNode.$text$ !== null) {
|
|
524
562
|
// create text node
|
|
525
563
|
elm = newVNode.$elm$ = doc.createTextNode(newVNode.$text$);
|
|
526
564
|
}
|
|
527
|
-
else if (newVNode.$flags$ & 1 /* isSlotReference */) {
|
|
565
|
+
else if (newVNode.$flags$ & 1 /* VNODE_FLAGS.isSlotReference */) {
|
|
528
566
|
// create a slot reference node
|
|
529
567
|
elm = newVNode.$elm$ =
|
|
530
568
|
doc.createTextNode('');
|
|
@@ -534,7 +572,7 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
534
572
|
isSvgMode = newVNode.$tag$ === 'svg';
|
|
535
573
|
}
|
|
536
574
|
// create element
|
|
537
|
-
elm = newVNode.$elm$ = (doc.createElementNS(isSvgMode ? SVG_NS : HTML_NS, newVNode.$flags$ & 2 /* isSlotFallback */
|
|
575
|
+
elm = newVNode.$elm$ = (doc.createElementNS(isSvgMode ? SVG_NS : HTML_NS, newVNode.$flags$ & 2 /* VNODE_FLAGS.isSlotFallback */
|
|
538
576
|
? 'slot-fb'
|
|
539
577
|
: newVNode.$tag$)
|
|
540
578
|
);
|
|
@@ -574,7 +612,7 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
574
612
|
}
|
|
575
613
|
{
|
|
576
614
|
elm['s-hn'] = hostTagName;
|
|
577
|
-
if (newVNode.$flags$ & (2 /* isSlotFallback */ | 1 /* isSlotReference */)) {
|
|
615
|
+
if (newVNode.$flags$ & (2 /* VNODE_FLAGS.isSlotFallback */ | 1 /* VNODE_FLAGS.isSlotReference */)) {
|
|
578
616
|
// remember the content reference comment
|
|
579
617
|
elm['s-sr'] = true;
|
|
580
618
|
// remember the content reference comment
|
|
@@ -593,7 +631,7 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
593
631
|
return elm;
|
|
594
632
|
};
|
|
595
633
|
const putBackInOriginalLocation = (parentElm, recursive) => {
|
|
596
|
-
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
634
|
+
plt.$flags$ |= 1 /* PLATFORM_FLAGS.isTmpDisconnected */;
|
|
597
635
|
const oldSlotChildNodes = parentElm.childNodes;
|
|
598
636
|
for (let i = oldSlotChildNodes.length - 1; i >= 0; i--) {
|
|
599
637
|
const childNode = oldSlotChildNodes[i];
|
|
@@ -614,7 +652,7 @@ const putBackInOriginalLocation = (parentElm, recursive) => {
|
|
|
614
652
|
putBackInOriginalLocation(childNode, recursive);
|
|
615
653
|
}
|
|
616
654
|
}
|
|
617
|
-
plt.$flags$ &= ~1 /* isTmpDisconnected */;
|
|
655
|
+
plt.$flags$ &= ~1 /* PLATFORM_FLAGS.isTmpDisconnected */;
|
|
618
656
|
};
|
|
619
657
|
const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
|
|
620
658
|
let containerElm = ((parentElm['s-cr'] && parentElm['s-cr'].parentNode) || parentElm);
|
|
@@ -656,6 +694,74 @@ const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
|
|
|
656
694
|
}
|
|
657
695
|
}
|
|
658
696
|
};
|
|
697
|
+
/**
|
|
698
|
+
* Reconcile the children of a new VNode with the children of an old VNode by
|
|
699
|
+
* traversing the two collections of children, identifying nodes that are
|
|
700
|
+
* conserved or changed, calling out to `patch` to make any necessary
|
|
701
|
+
* updates to the DOM, and rearranging DOM nodes as needed.
|
|
702
|
+
*
|
|
703
|
+
* The algorithm for reconciling children works by analyzing two 'windows' onto
|
|
704
|
+
* the two arrays of children (`oldCh` and `newCh`). We keep track of the
|
|
705
|
+
* 'windows' by storing start and end indices and references to the
|
|
706
|
+
* corresponding array entries. Initially the two 'windows' are basically equal
|
|
707
|
+
* to the entire array, but we progressively narrow the windows until there are
|
|
708
|
+
* no children left to update by doing the following:
|
|
709
|
+
*
|
|
710
|
+
* 1. Skip any `null` entries at the beginning or end of the two arrays, so
|
|
711
|
+
* that if we have an initial array like the following we'll end up dealing
|
|
712
|
+
* only with a window bounded by the highlighted elements:
|
|
713
|
+
*
|
|
714
|
+
* [null, null, VNode1 , ... , VNode2, null, null]
|
|
715
|
+
* ^^^^^^ ^^^^^^
|
|
716
|
+
*
|
|
717
|
+
* 2. Check to see if the elements at the head and tail positions are equal
|
|
718
|
+
* across the windows. This will basically detect elements which haven't
|
|
719
|
+
* been added, removed, or changed position, i.e. if you had the following
|
|
720
|
+
* VNode elements (represented as HTML):
|
|
721
|
+
*
|
|
722
|
+
* oldVNode: `<div><p><span>HEY</span></p></div>`
|
|
723
|
+
* newVNode: `<div><p><span>THERE</span></p></div>`
|
|
724
|
+
*
|
|
725
|
+
* Then when comparing the children of the `<div>` tag we check the equality
|
|
726
|
+
* of the VNodes corresponding to the `<p>` tags and, since they are the
|
|
727
|
+
* same tag in the same position, we'd be able to avoid completely
|
|
728
|
+
* re-rendering the subtree under them with a new DOM element and would just
|
|
729
|
+
* call out to `patch` to handle reconciling their children and so on.
|
|
730
|
+
*
|
|
731
|
+
* 3. Check, for both windows, to see if the element at the beginning of the
|
|
732
|
+
* window corresponds to the element at the end of the other window. This is
|
|
733
|
+
* a heuristic which will let us identify _some_ situations in which
|
|
734
|
+
* elements have changed position, for instance it _should_ detect that the
|
|
735
|
+
* children nodes themselves have not changed but merely moved in the
|
|
736
|
+
* following example:
|
|
737
|
+
*
|
|
738
|
+
* oldVNode: `<div><element-one /><element-two /></div>`
|
|
739
|
+
* newVNode: `<div><element-two /><element-one /></div>`
|
|
740
|
+
*
|
|
741
|
+
* If we find cases like this then we also need to move the concrete DOM
|
|
742
|
+
* elements corresponding to the moved children to write the re-order to the
|
|
743
|
+
* DOM.
|
|
744
|
+
*
|
|
745
|
+
* 4. Finally, if VNodes have the `key` attribute set on them we check for any
|
|
746
|
+
* nodes in the old children which have the same key as the first element in
|
|
747
|
+
* our window on the new children. If we find such a node we handle calling
|
|
748
|
+
* out to `patch`, moving relevant DOM nodes, and so on, in accordance with
|
|
749
|
+
* what we find.
|
|
750
|
+
*
|
|
751
|
+
* Finally, once we've narrowed our 'windows' to the point that either of them
|
|
752
|
+
* collapse (i.e. they have length 0) we then handle any remaining VNode
|
|
753
|
+
* insertion or deletion that needs to happen to get a DOM state that correctly
|
|
754
|
+
* reflects the new child VNodes. If, for instance, after our window on the old
|
|
755
|
+
* children has collapsed we still have more nodes on the new children that
|
|
756
|
+
* we haven't dealt with yet then we need to add them, or if the new children
|
|
757
|
+
* collapse but we still have unhandled _old_ children then we need to make
|
|
758
|
+
* sure the corresponding DOM nodes are removed.
|
|
759
|
+
*
|
|
760
|
+
* @param parentElm the node into which the parent VNode is rendered
|
|
761
|
+
* @param oldCh the old children of the parent node
|
|
762
|
+
* @param newVNode the new VNode which will replace the parent
|
|
763
|
+
* @param newCh the new children of the parent node
|
|
764
|
+
*/
|
|
659
765
|
const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
660
766
|
let oldStartIdx = 0;
|
|
661
767
|
let newStartIdx = 0;
|
|
@@ -671,7 +777,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
671
777
|
let elmToMove;
|
|
672
778
|
while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
|
|
673
779
|
if (oldStartVnode == null) {
|
|
674
|
-
//
|
|
780
|
+
// VNode might have been moved left
|
|
675
781
|
oldStartVnode = oldCh[++oldStartIdx];
|
|
676
782
|
}
|
|
677
783
|
else if (oldEndVnode == null) {
|
|
@@ -684,37 +790,100 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
684
790
|
newEndVnode = newCh[--newEndIdx];
|
|
685
791
|
}
|
|
686
792
|
else if (isSameVnode(oldStartVnode, newStartVnode)) {
|
|
793
|
+
// if the start nodes are the same then we should patch the new VNode
|
|
794
|
+
// onto the old one, and increment our `newStartIdx` and `oldStartIdx`
|
|
795
|
+
// indices to reflect that. We don't need to move any DOM Nodes around
|
|
796
|
+
// since things are matched up in order.
|
|
687
797
|
patch(oldStartVnode, newStartVnode);
|
|
688
798
|
oldStartVnode = oldCh[++oldStartIdx];
|
|
689
799
|
newStartVnode = newCh[++newStartIdx];
|
|
690
800
|
}
|
|
691
801
|
else if (isSameVnode(oldEndVnode, newEndVnode)) {
|
|
802
|
+
// likewise, if the end nodes are the same we patch new onto old and
|
|
803
|
+
// decrement our end indices, and also likewise in this case we don't
|
|
804
|
+
// need to move any DOM Nodes.
|
|
692
805
|
patch(oldEndVnode, newEndVnode);
|
|
693
806
|
oldEndVnode = oldCh[--oldEndIdx];
|
|
694
807
|
newEndVnode = newCh[--newEndIdx];
|
|
695
808
|
}
|
|
696
809
|
else if (isSameVnode(oldStartVnode, newEndVnode)) {
|
|
697
|
-
// Vnode moved right
|
|
810
|
+
// case: "Vnode moved right"
|
|
811
|
+
//
|
|
812
|
+
// We've found that the last node in our window on the new children is
|
|
813
|
+
// the same VNode as the _first_ node in our window on the old children
|
|
814
|
+
// we're dealing with now. Visually, this is the layout of these two
|
|
815
|
+
// nodes:
|
|
816
|
+
//
|
|
817
|
+
// newCh: [..., newStartVnode , ... , newEndVnode , ...]
|
|
818
|
+
// ^^^^^^^^^^^
|
|
819
|
+
// oldCh: [..., oldStartVnode , ... , oldEndVnode , ...]
|
|
820
|
+
// ^^^^^^^^^^^^^
|
|
821
|
+
//
|
|
822
|
+
// In this situation we need to patch `newEndVnode` onto `oldStartVnode`
|
|
823
|
+
// and move the DOM element for `oldStartVnode`.
|
|
698
824
|
if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
|
|
699
825
|
putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
|
|
700
826
|
}
|
|
701
827
|
patch(oldStartVnode, newEndVnode);
|
|
828
|
+
// We need to move the element for `oldStartVnode` into a position which
|
|
829
|
+
// will be appropriate for `newEndVnode`. For this we can use
|
|
830
|
+
// `.insertBefore` and `oldEndVnode.$elm$.nextSibling`. If there is a
|
|
831
|
+
// sibling for `oldEndVnode.$elm$` then we want to move the DOM node for
|
|
832
|
+
// `oldStartVnode` between `oldEndVnode` and it's sibling, like so:
|
|
833
|
+
//
|
|
834
|
+
// <old-start-node />
|
|
835
|
+
// <some-intervening-node />
|
|
836
|
+
// <old-end-node />
|
|
837
|
+
// <!-- -> <-- `oldStartVnode.$elm$` should be inserted here
|
|
838
|
+
// <next-sibling />
|
|
839
|
+
//
|
|
840
|
+
// If instead `oldEndVnode.$elm$` has no sibling then we just want to put
|
|
841
|
+
// the node for `oldStartVnode` at the end of the children of
|
|
842
|
+
// `parentElm`. Luckily, `Node.nextSibling` will return `null` if there
|
|
843
|
+
// aren't any siblings, and passing `null` to `Node.insertBefore` will
|
|
844
|
+
// append it to the children of the parent element.
|
|
702
845
|
parentElm.insertBefore(oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
|
|
703
846
|
oldStartVnode = oldCh[++oldStartIdx];
|
|
704
847
|
newEndVnode = newCh[--newEndIdx];
|
|
705
848
|
}
|
|
706
849
|
else if (isSameVnode(oldEndVnode, newStartVnode)) {
|
|
707
|
-
// Vnode moved left
|
|
850
|
+
// case: "Vnode moved left"
|
|
851
|
+
//
|
|
852
|
+
// We've found that the first node in our window on the new children is
|
|
853
|
+
// the same VNode as the _last_ node in our window on the old children.
|
|
854
|
+
// Visually, this is the layout of these two nodes:
|
|
855
|
+
//
|
|
856
|
+
// newCh: [..., newStartVnode , ... , newEndVnode , ...]
|
|
857
|
+
// ^^^^^^^^^^^^^
|
|
858
|
+
// oldCh: [..., oldStartVnode , ... , oldEndVnode , ...]
|
|
859
|
+
// ^^^^^^^^^^^
|
|
860
|
+
//
|
|
861
|
+
// In this situation we need to patch `newStartVnode` onto `oldEndVnode`
|
|
862
|
+
// (which will handle updating any changed attributes, reconciling their
|
|
863
|
+
// children etc) but we also need to move the DOM node to which
|
|
864
|
+
// `oldEndVnode` corresponds.
|
|
708
865
|
if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
|
|
709
866
|
putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
|
|
710
867
|
}
|
|
711
868
|
patch(oldEndVnode, newStartVnode);
|
|
869
|
+
// We've already checked above if `oldStartVnode` and `newStartVnode` are
|
|
870
|
+
// the same node, so since we're here we know that they are not. Thus we
|
|
871
|
+
// can move the element for `oldEndVnode` _before_ the element for
|
|
872
|
+
// `oldStartVnode`, leaving `oldStartVnode` to be reconciled in the
|
|
873
|
+
// future.
|
|
712
874
|
parentElm.insertBefore(oldEndVnode.$elm$, oldStartVnode.$elm$);
|
|
713
875
|
oldEndVnode = oldCh[--oldEndIdx];
|
|
714
876
|
newStartVnode = newCh[++newStartIdx];
|
|
715
877
|
}
|
|
716
878
|
else {
|
|
717
|
-
//
|
|
879
|
+
// Here we do some checks to match up old and new nodes based on the
|
|
880
|
+
// `$key$` attribute, which is set by putting a `key="my-key"` attribute
|
|
881
|
+
// in the JSX for a DOM element in the implementation of a Stencil
|
|
882
|
+
// component.
|
|
883
|
+
//
|
|
884
|
+
// First we check to see if there are any nodes in the array of old
|
|
885
|
+
// children which have the same key as the first node in the new
|
|
886
|
+
// children.
|
|
718
887
|
idxInOld = -1;
|
|
719
888
|
{
|
|
720
889
|
for (i = oldStartIdx; i <= oldEndIdx; ++i) {
|
|
@@ -725,23 +894,32 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
725
894
|
}
|
|
726
895
|
}
|
|
727
896
|
if (idxInOld >= 0) {
|
|
897
|
+
// We found a node in the old children which matches up with the first
|
|
898
|
+
// node in the new children! So let's deal with that
|
|
728
899
|
elmToMove = oldCh[idxInOld];
|
|
729
900
|
if (elmToMove.$tag$ !== newStartVnode.$tag$) {
|
|
901
|
+
// the tag doesn't match so we'll need a new DOM element
|
|
730
902
|
node = createElm(oldCh && oldCh[newStartIdx], newVNode, idxInOld, parentElm);
|
|
731
903
|
}
|
|
732
904
|
else {
|
|
733
905
|
patch(elmToMove, newStartVnode);
|
|
906
|
+
// invalidate the matching old node so that we won't try to update it
|
|
907
|
+
// again later on
|
|
734
908
|
oldCh[idxInOld] = undefined;
|
|
735
909
|
node = elmToMove.$elm$;
|
|
736
910
|
}
|
|
737
911
|
newStartVnode = newCh[++newStartIdx];
|
|
738
912
|
}
|
|
739
913
|
else {
|
|
740
|
-
//
|
|
914
|
+
// We either didn't find an element in the old children that matches
|
|
915
|
+
// the key of the first new child OR the build is not using `key`
|
|
916
|
+
// attributes at all. In either case we need to create a new element
|
|
917
|
+
// for the new node.
|
|
741
918
|
node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx, parentElm);
|
|
742
919
|
newStartVnode = newCh[++newStartIdx];
|
|
743
920
|
}
|
|
744
921
|
if (node) {
|
|
922
|
+
// if we created a new node then handle inserting it to the DOM
|
|
745
923
|
{
|
|
746
924
|
parentReferenceNode(oldStartVnode.$elm$).insertBefore(node, referenceNode(oldStartVnode.$elm$));
|
|
747
925
|
}
|
|
@@ -749,21 +927,43 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
749
927
|
}
|
|
750
928
|
}
|
|
751
929
|
if (oldStartIdx > oldEndIdx) {
|
|
930
|
+
// we have some more new nodes to add which don't match up with old nodes
|
|
752
931
|
addVnodes(parentElm, newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$, newVNode, newCh, newStartIdx, newEndIdx);
|
|
753
932
|
}
|
|
754
933
|
else if (newStartIdx > newEndIdx) {
|
|
934
|
+
// there are nodes in the `oldCh` array which no longer correspond to nodes
|
|
935
|
+
// in the new array, so lets remove them (which entails cleaning up the
|
|
936
|
+
// relevant DOM nodes)
|
|
755
937
|
removeVnodes(oldCh, oldStartIdx, oldEndIdx);
|
|
756
938
|
}
|
|
757
939
|
};
|
|
758
|
-
|
|
940
|
+
/**
|
|
941
|
+
* Compare two VNodes to determine if they are the same
|
|
942
|
+
*
|
|
943
|
+
* **NB**: This function is an equality _heuristic_ based on the available
|
|
944
|
+
* information set on the two VNodes and can be misleading under certain
|
|
945
|
+
* circumstances. In particular, if the two nodes do not have `key` attrs
|
|
946
|
+
* (available under `$key$` on VNodes) then the function falls back on merely
|
|
947
|
+
* checking that they have the same tag.
|
|
948
|
+
*
|
|
949
|
+
* So, in other words, if `key` attrs are not set on VNodes which may be
|
|
950
|
+
* changing order within a `children` array or something along those lines then
|
|
951
|
+
* we could obtain a false positive and then have to do needless re-rendering.
|
|
952
|
+
*
|
|
953
|
+
* @param leftVNode the first VNode to check
|
|
954
|
+
* @param rightVNode the second VNode to check
|
|
955
|
+
* @returns whether they're equal or not
|
|
956
|
+
*/
|
|
957
|
+
const isSameVnode = (leftVNode, rightVNode) => {
|
|
759
958
|
// compare if two vnode to see if they're "technically" the same
|
|
760
959
|
// need to have the same element tag, and same key to be the same
|
|
761
|
-
if (
|
|
762
|
-
if (
|
|
763
|
-
return
|
|
960
|
+
if (leftVNode.$tag$ === rightVNode.$tag$) {
|
|
961
|
+
if (leftVNode.$tag$ === 'slot') {
|
|
962
|
+
return leftVNode.$name$ === rightVNode.$name$;
|
|
764
963
|
}
|
|
964
|
+
// this will be set if components in the build have `key` attrs set on them
|
|
765
965
|
{
|
|
766
|
-
return
|
|
966
|
+
return leftVNode.$key$ === rightVNode.$key$;
|
|
767
967
|
}
|
|
768
968
|
}
|
|
769
969
|
return false;
|
|
@@ -776,6 +976,14 @@ const referenceNode = (node) => {
|
|
|
776
976
|
return (node && node['s-ol']) || node;
|
|
777
977
|
};
|
|
778
978
|
const parentReferenceNode = (node) => (node['s-ol'] ? node['s-ol'] : node).parentNode;
|
|
979
|
+
/**
|
|
980
|
+
* Handle reconciling an outdated VNode with a new one which corresponds to
|
|
981
|
+
* it. This function handles flushing updates to the DOM and reconciling the
|
|
982
|
+
* children of the two nodes (if any).
|
|
983
|
+
*
|
|
984
|
+
* @param oldVNode an old VNode whose DOM element and children we want to update
|
|
985
|
+
* @param newVNode a new VNode representing an updated version of the old one
|
|
986
|
+
*/
|
|
779
987
|
const patch = (oldVNode, newVNode) => {
|
|
780
988
|
const elm = (newVNode.$elm$ = oldVNode.$elm$);
|
|
781
989
|
const oldChildren = oldVNode.$children$;
|
|
@@ -789,7 +997,6 @@ const patch = (oldVNode, newVNode) => {
|
|
|
789
997
|
// only add this to the when the compiler sees we're using an svg somewhere
|
|
790
998
|
isSvgMode = tag === 'svg' ? true : tag === 'foreignObject' ? false : isSvgMode;
|
|
791
999
|
}
|
|
792
|
-
// element node
|
|
793
1000
|
{
|
|
794
1001
|
if (tag === 'slot')
|
|
795
1002
|
;
|
|
@@ -802,6 +1009,7 @@ const patch = (oldVNode, newVNode) => {
|
|
|
802
1009
|
}
|
|
803
1010
|
if (oldChildren !== null && newChildren !== null) {
|
|
804
1011
|
// looks like there's child vnodes for both the old and new vnodes
|
|
1012
|
+
// so we need to call `updateChildren` to reconcile them
|
|
805
1013
|
updateChildren(elm, oldChildren, newVNode, newChildren);
|
|
806
1014
|
}
|
|
807
1015
|
else if (newChildren !== null) {
|
|
@@ -842,7 +1050,7 @@ const updateFallbackSlotVisibility = (elm) => {
|
|
|
842
1050
|
let nodeType;
|
|
843
1051
|
for (i = 0, ilen = childNodes.length; i < ilen; i++) {
|
|
844
1052
|
childNode = childNodes[i];
|
|
845
|
-
if (childNode.nodeType === 1 /* ElementNode */) {
|
|
1053
|
+
if (childNode.nodeType === 1 /* NODE_TYPE.ElementNode */) {
|
|
846
1054
|
if (childNode['s-sr']) {
|
|
847
1055
|
// this is a slot fallback node
|
|
848
1056
|
// get the slot name for this slot reference node
|
|
@@ -854,7 +1062,7 @@ const updateFallbackSlotVisibility = (elm) => {
|
|
|
854
1062
|
nodeType = childNodes[j].nodeType;
|
|
855
1063
|
if (childNodes[j]['s-hn'] !== childNode['s-hn'] || slotNameAttr !== '') {
|
|
856
1064
|
// this sibling node is from a different component OR is a named fallback slot node
|
|
857
|
-
if (nodeType === 1 /* ElementNode */ && slotNameAttr === childNodes[j].getAttribute('slot')) {
|
|
1065
|
+
if (nodeType === 1 /* NODE_TYPE.ElementNode */ && slotNameAttr === childNodes[j].getAttribute('slot')) {
|
|
858
1066
|
childNode.hidden = true;
|
|
859
1067
|
break;
|
|
860
1068
|
}
|
|
@@ -863,8 +1071,8 @@ const updateFallbackSlotVisibility = (elm) => {
|
|
|
863
1071
|
// this is a default fallback slot node
|
|
864
1072
|
// any element or text node (with content)
|
|
865
1073
|
// should hide the default fallback slot node
|
|
866
|
-
if (nodeType === 1 /* ElementNode */ ||
|
|
867
|
-
(nodeType === 3 /* TextNode */ && childNodes[j].textContent.trim() !== '')) {
|
|
1074
|
+
if (nodeType === 1 /* NODE_TYPE.ElementNode */ ||
|
|
1075
|
+
(nodeType === 3 /* NODE_TYPE.TextNode */ && childNodes[j].textContent.trim() !== '')) {
|
|
868
1076
|
childNode.hidden = true;
|
|
869
1077
|
break;
|
|
870
1078
|
}
|
|
@@ -942,13 +1150,13 @@ const relocateSlotContent = (elm) => {
|
|
|
942
1150
|
}
|
|
943
1151
|
}
|
|
944
1152
|
}
|
|
945
|
-
if (childNode.nodeType === 1 /* ElementNode */) {
|
|
1153
|
+
if (childNode.nodeType === 1 /* NODE_TYPE.ElementNode */) {
|
|
946
1154
|
relocateSlotContent(childNode);
|
|
947
1155
|
}
|
|
948
1156
|
}
|
|
949
1157
|
};
|
|
950
1158
|
const isNodeLocatedInSlot = (nodeToRelocate, slotNameAttr) => {
|
|
951
|
-
if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
|
|
1159
|
+
if (nodeToRelocate.nodeType === 1 /* NODE_TYPE.ElementNode */) {
|
|
952
1160
|
if (nodeToRelocate.getAttribute('slot') === null && slotNameAttr === '') {
|
|
953
1161
|
return true;
|
|
954
1162
|
}
|
|
@@ -979,7 +1187,7 @@ const renderVdom = (hostRef, renderFnResults) => {
|
|
|
979
1187
|
cmpMeta.$attrsToReflect$.map(([propName, attribute]) => (rootVnode.$attrs$[attribute] = hostElm[propName]));
|
|
980
1188
|
}
|
|
981
1189
|
rootVnode.$tag$ = null;
|
|
982
|
-
rootVnode.$flags$ |= 4 /* isHost */;
|
|
1190
|
+
rootVnode.$flags$ |= 4 /* VNODE_FLAGS.isHost */;
|
|
983
1191
|
hostRef.$vnode$ = rootVnode;
|
|
984
1192
|
rootVnode.$elm$ = oldVNode.$elm$ = (hostElm.shadowRoot || hostElm );
|
|
985
1193
|
{
|
|
@@ -987,7 +1195,7 @@ const renderVdom = (hostRef, renderFnResults) => {
|
|
|
987
1195
|
}
|
|
988
1196
|
{
|
|
989
1197
|
contentRef = hostElm['s-cr'];
|
|
990
|
-
useNativeShadowDom = (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
|
|
1198
|
+
useNativeShadowDom = (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) !== 0;
|
|
991
1199
|
// always reset
|
|
992
1200
|
checkSlotFallbackVisibility = false;
|
|
993
1201
|
}
|
|
@@ -996,7 +1204,7 @@ const renderVdom = (hostRef, renderFnResults) => {
|
|
|
996
1204
|
{
|
|
997
1205
|
// while we're moving nodes around existing nodes, temporarily disable
|
|
998
1206
|
// the disconnectCallback from working
|
|
999
|
-
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
1207
|
+
plt.$flags$ |= 1 /* PLATFORM_FLAGS.isTmpDisconnected */;
|
|
1000
1208
|
if (checkSlotRelocate) {
|
|
1001
1209
|
relocateSlotContent(rootVnode.$elm$);
|
|
1002
1210
|
let relocateData;
|
|
@@ -1054,7 +1262,7 @@ const renderVdom = (hostRef, renderFnResults) => {
|
|
|
1054
1262
|
}
|
|
1055
1263
|
else {
|
|
1056
1264
|
// this node doesn't have a slot home to go to, so let's hide it
|
|
1057
|
-
if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
|
|
1265
|
+
if (nodeToRelocate.nodeType === 1 /* NODE_TYPE.ElementNode */) {
|
|
1058
1266
|
nodeToRelocate.hidden = true;
|
|
1059
1267
|
}
|
|
1060
1268
|
}
|
|
@@ -1065,37 +1273,11 @@ const renderVdom = (hostRef, renderFnResults) => {
|
|
|
1065
1273
|
}
|
|
1066
1274
|
// done moving nodes around
|
|
1067
1275
|
// allow the disconnect callback to work again
|
|
1068
|
-
plt.$flags$ &= ~1 /* isTmpDisconnected */;
|
|
1276
|
+
plt.$flags$ &= ~1 /* PLATFORM_FLAGS.isTmpDisconnected */;
|
|
1069
1277
|
// always reset
|
|
1070
1278
|
relocateNodes.length = 0;
|
|
1071
1279
|
}
|
|
1072
1280
|
};
|
|
1073
|
-
const getElement = (ref) => (getHostRef(ref).$hostElement$ );
|
|
1074
|
-
const createEvent = (ref, name, flags) => {
|
|
1075
|
-
const elm = getElement(ref);
|
|
1076
|
-
return {
|
|
1077
|
-
emit: (detail) => {
|
|
1078
|
-
return emitEvent(elm, name, {
|
|
1079
|
-
bubbles: !!(flags & 4 /* Bubbles */),
|
|
1080
|
-
composed: !!(flags & 2 /* Composed */),
|
|
1081
|
-
cancelable: !!(flags & 1 /* Cancellable */),
|
|
1082
|
-
detail,
|
|
1083
|
-
});
|
|
1084
|
-
},
|
|
1085
|
-
};
|
|
1086
|
-
};
|
|
1087
|
-
/**
|
|
1088
|
-
* Helper function to create & dispatch a custom Event on a provided target
|
|
1089
|
-
* @param elm the target of the Event
|
|
1090
|
-
* @param name the name to give the custom Event
|
|
1091
|
-
* @param opts options for configuring a custom Event
|
|
1092
|
-
* @returns the custom Event
|
|
1093
|
-
*/
|
|
1094
|
-
const emitEvent = (elm, name, opts) => {
|
|
1095
|
-
const ev = plt.ce(name, opts);
|
|
1096
|
-
elm.dispatchEvent(ev);
|
|
1097
|
-
return ev;
|
|
1098
|
-
};
|
|
1099
1281
|
const attachToAncestor = (hostRef, ancestorComponent) => {
|
|
1100
1282
|
if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent['s-p']) {
|
|
1101
1283
|
ancestorComponent['s-p'].push(new Promise((r) => (hostRef.$onRenderResolve$ = r)));
|
|
@@ -1103,10 +1285,10 @@ const attachToAncestor = (hostRef, ancestorComponent) => {
|
|
|
1103
1285
|
};
|
|
1104
1286
|
const scheduleUpdate = (hostRef, isInitialLoad) => {
|
|
1105
1287
|
{
|
|
1106
|
-
hostRef.$flags$ |= 16 /* isQueuedForUpdate */;
|
|
1288
|
+
hostRef.$flags$ |= 16 /* HOST_FLAGS.isQueuedForUpdate */;
|
|
1107
1289
|
}
|
|
1108
|
-
if (hostRef.$flags$ & 4 /* isWaitingForChildren */) {
|
|
1109
|
-
hostRef.$flags$ |= 512 /* needsRerender */;
|
|
1290
|
+
if (hostRef.$flags$ & 4 /* HOST_FLAGS.isWaitingForChildren */) {
|
|
1291
|
+
hostRef.$flags$ |= 512 /* HOST_FLAGS.needsRerender */;
|
|
1110
1292
|
return;
|
|
1111
1293
|
}
|
|
1112
1294
|
attachToAncestor(hostRef, hostRef.$ancestorComponent$);
|
|
@@ -1122,7 +1304,7 @@ const dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
1122
1304
|
let promise;
|
|
1123
1305
|
if (isInitialLoad) {
|
|
1124
1306
|
{
|
|
1125
|
-
hostRef.$flags$ |= 256 /* isListenReady */;
|
|
1307
|
+
hostRef.$flags$ |= 256 /* HOST_FLAGS.isListenReady */;
|
|
1126
1308
|
if (hostRef.$queuedListeners$) {
|
|
1127
1309
|
hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
|
|
1128
1310
|
hostRef.$queuedListeners$ = null;
|
|
@@ -1173,7 +1355,7 @@ const updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
1173
1355
|
}
|
|
1174
1356
|
else {
|
|
1175
1357
|
Promise.all(childrenPromises).then(postUpdate);
|
|
1176
|
-
hostRef.$flags$ |= 4 /* isWaitingForChildren */;
|
|
1358
|
+
hostRef.$flags$ |= 4 /* HOST_FLAGS.isWaitingForChildren */;
|
|
1177
1359
|
childrenPromises.length = 0;
|
|
1178
1360
|
}
|
|
1179
1361
|
}
|
|
@@ -1183,10 +1365,10 @@ const callRender = (hostRef, instance, elm) => {
|
|
|
1183
1365
|
renderingRef = instance;
|
|
1184
1366
|
instance = instance.render() ;
|
|
1185
1367
|
{
|
|
1186
|
-
hostRef.$flags$ &= ~16 /* isQueuedForUpdate */;
|
|
1368
|
+
hostRef.$flags$ &= ~16 /* HOST_FLAGS.isQueuedForUpdate */;
|
|
1187
1369
|
}
|
|
1188
1370
|
{
|
|
1189
|
-
hostRef.$flags$ |= 2 /* hasRendered */;
|
|
1371
|
+
hostRef.$flags$ |= 2 /* HOST_FLAGS.hasRendered */;
|
|
1190
1372
|
}
|
|
1191
1373
|
{
|
|
1192
1374
|
{
|
|
@@ -1215,8 +1397,8 @@ const postUpdateComponent = (hostRef) => {
|
|
|
1215
1397
|
{
|
|
1216
1398
|
safeCall(instance, 'componentDidRender');
|
|
1217
1399
|
}
|
|
1218
|
-
if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
|
|
1219
|
-
hostRef.$flags$ |= 64 /* hasLoadedComponent */;
|
|
1400
|
+
if (!(hostRef.$flags$ & 64 /* HOST_FLAGS.hasLoadedComponent */)) {
|
|
1401
|
+
hostRef.$flags$ |= 64 /* HOST_FLAGS.hasLoadedComponent */;
|
|
1220
1402
|
{
|
|
1221
1403
|
// DOM WRITE!
|
|
1222
1404
|
addHydratedFlag(elm);
|
|
@@ -1248,10 +1430,10 @@ const postUpdateComponent = (hostRef) => {
|
|
|
1248
1430
|
hostRef.$onRenderResolve$();
|
|
1249
1431
|
hostRef.$onRenderResolve$ = undefined;
|
|
1250
1432
|
}
|
|
1251
|
-
if (hostRef.$flags$ & 512 /* needsRerender */) {
|
|
1433
|
+
if (hostRef.$flags$ & 512 /* HOST_FLAGS.needsRerender */) {
|
|
1252
1434
|
nextTick(() => scheduleUpdate(hostRef, false));
|
|
1253
1435
|
}
|
|
1254
|
-
hostRef.$flags$ &= ~(4 /* isWaitingForChildren */ | 512 /* needsRerender */);
|
|
1436
|
+
hostRef.$flags$ &= ~(4 /* HOST_FLAGS.isWaitingForChildren */ | 512 /* HOST_FLAGS.needsRerender */);
|
|
1255
1437
|
}
|
|
1256
1438
|
// ( •_•)
|
|
1257
1439
|
// ( •_•)>⌐■-■
|
|
@@ -1262,7 +1444,7 @@ const forceUpdate = (ref) => {
|
|
|
1262
1444
|
const hostRef = getHostRef(ref);
|
|
1263
1445
|
const isConnected = hostRef.$hostElement$.isConnected;
|
|
1264
1446
|
if (isConnected &&
|
|
1265
|
-
(hostRef.$flags$ & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
|
|
1447
|
+
(hostRef.$flags$ & (2 /* HOST_FLAGS.hasRendered */ | 16 /* HOST_FLAGS.isQueuedForUpdate */)) === 2 /* HOST_FLAGS.hasRendered */) {
|
|
1266
1448
|
scheduleUpdate(hostRef, false);
|
|
1267
1449
|
}
|
|
1268
1450
|
// Returns "true" when the forced update was successfully scheduled
|
|
@@ -1293,53 +1475,6 @@ const then = (promise, thenFn) => {
|
|
|
1293
1475
|
};
|
|
1294
1476
|
const addHydratedFlag = (elm) => elm.setAttribute('hydrated', '')
|
|
1295
1477
|
;
|
|
1296
|
-
/**
|
|
1297
|
-
* Parse a new property value for a given property type.
|
|
1298
|
-
*
|
|
1299
|
-
* While the prop value can reasonably be expected to be of `any` type as far as TypeScript's type checker is concerned,
|
|
1300
|
-
* it is not safe to assume that the string returned by evaluating `typeof propValue` matches:
|
|
1301
|
-
* 1. `any`, the type given to `propValue` in the function signature
|
|
1302
|
-
* 2. the type stored from `propType`.
|
|
1303
|
-
*
|
|
1304
|
-
* This function provides the capability to parse/coerce a property's value to potentially any other JavaScript type.
|
|
1305
|
-
*
|
|
1306
|
-
* Property values represented in TSX preserve their type information. In the example below, the number 0 is passed to
|
|
1307
|
-
* a component. This `propValue` will preserve its type information (`typeof propValue === 'number'`). Note that is
|
|
1308
|
-
* based on the type of the value being passed in, not the type declared of the class member decorated with `@Prop`.
|
|
1309
|
-
* ```tsx
|
|
1310
|
-
* <my-cmp prop-val={0}></my-cmp>
|
|
1311
|
-
* ```
|
|
1312
|
-
*
|
|
1313
|
-
* HTML prop values on the other hand, will always a string
|
|
1314
|
-
*
|
|
1315
|
-
* @param propValue the new value to coerce to some type
|
|
1316
|
-
* @param propType the type of the prop, expressed as a binary number
|
|
1317
|
-
* @returns the parsed/coerced value
|
|
1318
|
-
*/
|
|
1319
|
-
const parsePropertyValue = (propValue, propType) => {
|
|
1320
|
-
// ensure this value is of the correct prop type
|
|
1321
|
-
if (propValue != null && !isComplexType(propValue)) {
|
|
1322
|
-
if (propType & 4 /* Boolean */) {
|
|
1323
|
-
// per the HTML spec, any string value means it is a boolean true value
|
|
1324
|
-
// but we'll cheat here and say that the string "false" is the boolean false
|
|
1325
|
-
return propValue === 'false' ? false : propValue === '' || !!propValue;
|
|
1326
|
-
}
|
|
1327
|
-
if (propType & 2 /* Number */) {
|
|
1328
|
-
// force it to be a number
|
|
1329
|
-
return parseFloat(propValue);
|
|
1330
|
-
}
|
|
1331
|
-
if (propType & 1 /* String */) {
|
|
1332
|
-
// could have been passed as a number or boolean
|
|
1333
|
-
// but we still want it as a string
|
|
1334
|
-
return String(propValue);
|
|
1335
|
-
}
|
|
1336
|
-
// redundant return here for better minification
|
|
1337
|
-
return propValue;
|
|
1338
|
-
}
|
|
1339
|
-
// not sure exactly what type we want
|
|
1340
|
-
// so no need to change to a different type
|
|
1341
|
-
return propValue;
|
|
1342
|
-
};
|
|
1343
1478
|
const getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
|
|
1344
1479
|
const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
1345
1480
|
// check our new property value against our internal value
|
|
@@ -1352,13 +1487,13 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
1352
1487
|
// explicitly check for NaN on both sides, as `NaN === NaN` is always false
|
|
1353
1488
|
const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
|
|
1354
1489
|
const didValueChange = newVal !== oldVal && !areBothNaN;
|
|
1355
|
-
if ((!(flags & 8 /* isConstructingInstance */) || oldVal === undefined) && didValueChange) {
|
|
1490
|
+
if ((!(flags & 8 /* HOST_FLAGS.isConstructingInstance */) || oldVal === undefined) && didValueChange) {
|
|
1356
1491
|
// gadzooks! the property's value has changed!!
|
|
1357
1492
|
// set our new value!
|
|
1358
1493
|
hostRef.$instanceValues$.set(propName, newVal);
|
|
1359
1494
|
if (instance) {
|
|
1360
1495
|
// get an array of method names of watch functions to call
|
|
1361
|
-
if (cmpMeta.$watchers$ && flags & 128 /* isWatchReady */) {
|
|
1496
|
+
if (cmpMeta.$watchers$ && flags & 128 /* HOST_FLAGS.isWatchReady */) {
|
|
1362
1497
|
const watchMethods = cmpMeta.$watchers$[propName];
|
|
1363
1498
|
if (watchMethods) {
|
|
1364
1499
|
// this instance is watching for when this property changed
|
|
@@ -1373,7 +1508,7 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
1373
1508
|
});
|
|
1374
1509
|
}
|
|
1375
1510
|
}
|
|
1376
|
-
if ((flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
|
|
1511
|
+
if ((flags & (2 /* HOST_FLAGS.hasRendered */ | 16 /* HOST_FLAGS.isQueuedForUpdate */)) === 2 /* HOST_FLAGS.hasRendered */) {
|
|
1377
1512
|
if (instance.componentShouldUpdate) {
|
|
1378
1513
|
if (instance.componentShouldUpdate(newVal, oldVal, propName) === false) {
|
|
1379
1514
|
return;
|
|
@@ -1388,6 +1523,16 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
1388
1523
|
}
|
|
1389
1524
|
}
|
|
1390
1525
|
};
|
|
1526
|
+
/**
|
|
1527
|
+
* Attach a series of runtime constructs to a compiled Stencil component
|
|
1528
|
+
* constructor, including getters and setters for the `@Prop` and `@State`
|
|
1529
|
+
* decorators, callbacks for when attributes change, and so on.
|
|
1530
|
+
*
|
|
1531
|
+
* @param Cstr the constructor for a component that we need to process
|
|
1532
|
+
* @param cmpMeta metadata collected previously about the component
|
|
1533
|
+
* @param flags a number used to store a series of bit flags
|
|
1534
|
+
* @returns a reference to the same constructor passed in (but now mutated)
|
|
1535
|
+
*/
|
|
1391
1536
|
const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
1392
1537
|
if (cmpMeta.$members$) {
|
|
1393
1538
|
if (Cstr.watchers) {
|
|
@@ -1397,8 +1542,8 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1397
1542
|
const members = Object.entries(cmpMeta.$members$);
|
|
1398
1543
|
const prototype = Cstr.prototype;
|
|
1399
1544
|
members.map(([memberName, [memberFlags]]) => {
|
|
1400
|
-
if ((memberFlags & 31 /* Prop */ ||
|
|
1401
|
-
((flags & 2 /* proxyState */) && memberFlags & 32 /* State */))) {
|
|
1545
|
+
if ((memberFlags & 31 /* MEMBER_FLAGS.Prop */ ||
|
|
1546
|
+
((flags & 2 /* PROXY_FLAGS.proxyState */) && memberFlags & 32 /* MEMBER_FLAGS.State */))) {
|
|
1402
1547
|
// proxyComponent - prop
|
|
1403
1548
|
Object.defineProperty(prototype, memberName, {
|
|
1404
1549
|
get() {
|
|
@@ -1413,8 +1558,8 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1413
1558
|
enumerable: true,
|
|
1414
1559
|
});
|
|
1415
1560
|
}
|
|
1416
|
-
else if (flags & 1 /* isElementConstructor */ &&
|
|
1417
|
-
memberFlags & 64 /* Method */) {
|
|
1561
|
+
else if (flags & 1 /* PROXY_FLAGS.isElementConstructor */ &&
|
|
1562
|
+
memberFlags & 64 /* MEMBER_FLAGS.Method */) {
|
|
1418
1563
|
// proxyComponent - method
|
|
1419
1564
|
Object.defineProperty(prototype, memberName, {
|
|
1420
1565
|
value(...args) {
|
|
@@ -1424,7 +1569,7 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1424
1569
|
});
|
|
1425
1570
|
}
|
|
1426
1571
|
});
|
|
1427
|
-
if ((flags & 1 /* isElementConstructor */)) {
|
|
1572
|
+
if ((flags & 1 /* PROXY_FLAGS.isElementConstructor */)) {
|
|
1428
1573
|
const attrNameToPropName = new Map();
|
|
1429
1574
|
prototype.attributeChangedCallback = function (attrName, _oldValue, newValue) {
|
|
1430
1575
|
plt.jmp(() => {
|
|
@@ -1480,11 +1625,11 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1480
1625
|
// create an array of attributes to observe
|
|
1481
1626
|
// and also create a map of html attribute name to js property name
|
|
1482
1627
|
Cstr.observedAttributes = members
|
|
1483
|
-
.filter(([_, m]) => m[0] & 15 /* HasAttribute */) // filter to only keep props that should match attributes
|
|
1628
|
+
.filter(([_, m]) => m[0] & 15 /* MEMBER_FLAGS.HasAttribute */) // filter to only keep props that should match attributes
|
|
1484
1629
|
.map(([propName, m]) => {
|
|
1485
1630
|
const attrName = m[1] || propName;
|
|
1486
1631
|
attrNameToPropName.set(attrName, propName);
|
|
1487
|
-
if (m[0] & 512 /* ReflectAttr */) {
|
|
1632
|
+
if (m[0] & 512 /* MEMBER_FLAGS.ReflectAttr */) {
|
|
1488
1633
|
cmpMeta.$attrsToReflect$.push([propName, attrName]);
|
|
1489
1634
|
}
|
|
1490
1635
|
return attrName;
|
|
@@ -1495,10 +1640,10 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1495
1640
|
};
|
|
1496
1641
|
const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) => {
|
|
1497
1642
|
// initializeComponent
|
|
1498
|
-
if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
|
|
1643
|
+
if ((hostRef.$flags$ & 32 /* HOST_FLAGS.hasInitializedComponent */) === 0) {
|
|
1499
1644
|
{
|
|
1500
1645
|
// we haven't initialized this element yet
|
|
1501
|
-
hostRef.$flags$ |= 32 /* hasInitializedComponent */;
|
|
1646
|
+
hostRef.$flags$ |= 32 /* HOST_FLAGS.hasInitializedComponent */;
|
|
1502
1647
|
// lazy loaded components
|
|
1503
1648
|
// request the component's implementation to be
|
|
1504
1649
|
// wired up with the host element
|
|
@@ -1516,7 +1661,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
1516
1661
|
{
|
|
1517
1662
|
cmpMeta.$watchers$ = Cstr.watchers;
|
|
1518
1663
|
}
|
|
1519
|
-
proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
|
|
1664
|
+
proxyComponent(Cstr, cmpMeta, 2 /* PROXY_FLAGS.proxyState */);
|
|
1520
1665
|
Cstr.isProxied = true;
|
|
1521
1666
|
}
|
|
1522
1667
|
const endNewInstance = createTime('createInstance', cmpMeta.$tagName$);
|
|
@@ -1524,7 +1669,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
1524
1669
|
// but let's keep track of when we start and stop
|
|
1525
1670
|
// so that the getters/setters don't incorrectly step on data
|
|
1526
1671
|
{
|
|
1527
|
-
hostRef.$flags$ |= 8 /* isConstructingInstance */;
|
|
1672
|
+
hostRef.$flags$ |= 8 /* HOST_FLAGS.isConstructingInstance */;
|
|
1528
1673
|
}
|
|
1529
1674
|
// construct the lazy-loaded component implementation
|
|
1530
1675
|
// passing the hostRef is very important during
|
|
@@ -1537,10 +1682,10 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
1537
1682
|
consoleError(e);
|
|
1538
1683
|
}
|
|
1539
1684
|
{
|
|
1540
|
-
hostRef.$flags$ &= ~8 /* isConstructingInstance */;
|
|
1685
|
+
hostRef.$flags$ &= ~8 /* HOST_FLAGS.isConstructingInstance */;
|
|
1541
1686
|
}
|
|
1542
1687
|
{
|
|
1543
|
-
hostRef.$flags$ |= 128 /* isWatchReady */;
|
|
1688
|
+
hostRef.$flags$ |= 128 /* HOST_FLAGS.isWatchReady */;
|
|
1544
1689
|
}
|
|
1545
1690
|
endNewInstance();
|
|
1546
1691
|
fireConnectedCallback(hostRef.$lazyInstance$);
|
|
@@ -1551,7 +1696,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
1551
1696
|
const scopeId = getScopeId(cmpMeta);
|
|
1552
1697
|
if (!styles.has(scopeId)) {
|
|
1553
1698
|
const endRegisterStyles = createTime('registerStyles', cmpMeta.$tagName$);
|
|
1554
|
-
registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
|
|
1699
|
+
registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */));
|
|
1555
1700
|
endRegisterStyles();
|
|
1556
1701
|
}
|
|
1557
1702
|
}
|
|
@@ -1578,19 +1723,19 @@ const fireConnectedCallback = (instance) => {
|
|
|
1578
1723
|
}
|
|
1579
1724
|
};
|
|
1580
1725
|
const connectedCallback = (elm) => {
|
|
1581
|
-
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
1726
|
+
if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
|
|
1582
1727
|
const hostRef = getHostRef(elm);
|
|
1583
1728
|
const cmpMeta = hostRef.$cmpMeta$;
|
|
1584
1729
|
const endConnected = createTime('connectedCallback', cmpMeta.$tagName$);
|
|
1585
|
-
if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
|
|
1730
|
+
if (!(hostRef.$flags$ & 1 /* HOST_FLAGS.hasConnected */)) {
|
|
1586
1731
|
// first time this component has connected
|
|
1587
|
-
hostRef.$flags$ |= 1 /* hasConnected */;
|
|
1732
|
+
hostRef.$flags$ |= 1 /* HOST_FLAGS.hasConnected */;
|
|
1588
1733
|
{
|
|
1589
1734
|
// initUpdate
|
|
1590
1735
|
// if the slot polyfill is required we'll need to put some nodes
|
|
1591
1736
|
// in here to act as original content anchors as we move nodes around
|
|
1592
1737
|
// host element has been connected to the DOM
|
|
1593
|
-
if ((cmpMeta.$flags$ & (4 /* hasSlotRelocation */ | 8 /* needsShadowDomShim */))) {
|
|
1738
|
+
if ((cmpMeta.$flags$ & (4 /* CMP_FLAGS.hasSlotRelocation */ | 8 /* CMP_FLAGS.needsShadowDomShim */))) {
|
|
1594
1739
|
setContentReference(elm);
|
|
1595
1740
|
}
|
|
1596
1741
|
}
|
|
@@ -1613,7 +1758,7 @@ const connectedCallback = (elm) => {
|
|
|
1613
1758
|
// https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
|
|
1614
1759
|
if (cmpMeta.$members$) {
|
|
1615
1760
|
Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
|
|
1616
|
-
if (memberFlags & 31 /* Prop */ && elm.hasOwnProperty(memberName)) {
|
|
1761
|
+
if (memberFlags & 31 /* MEMBER_FLAGS.Prop */ && elm.hasOwnProperty(memberName)) {
|
|
1617
1762
|
const value = elm[memberName];
|
|
1618
1763
|
delete elm[memberName];
|
|
1619
1764
|
elm[memberName] = value;
|
|
@@ -1647,7 +1792,7 @@ const setContentReference = (elm) => {
|
|
|
1647
1792
|
elm.insertBefore(contentRefElm, elm.firstChild);
|
|
1648
1793
|
};
|
|
1649
1794
|
const disconnectedCallback = (elm) => {
|
|
1650
|
-
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
1795
|
+
if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
|
|
1651
1796
|
const hostRef = getHostRef(elm);
|
|
1652
1797
|
const instance = hostRef.$lazyInstance$ ;
|
|
1653
1798
|
{
|
|
@@ -1702,7 +1847,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1702
1847
|
super(self);
|
|
1703
1848
|
self = this;
|
|
1704
1849
|
registerHost(self, cmpMeta);
|
|
1705
|
-
if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
1850
|
+
if (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
|
|
1706
1851
|
// this component is using shadow dom
|
|
1707
1852
|
// and this browser supports shadow dom
|
|
1708
1853
|
// add the read-only property "shadowRoot" to the host element
|
|
@@ -1737,7 +1882,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1737
1882
|
cmpMeta.$lazyBundleId$ = lazyBundle[0];
|
|
1738
1883
|
if (!exclude.includes(tagName) && !customElements.get(tagName)) {
|
|
1739
1884
|
cmpTags.push(tagName);
|
|
1740
|
-
customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* isElementConstructor */));
|
|
1885
|
+
customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* PROXY_FLAGS.isElementConstructor */));
|
|
1741
1886
|
}
|
|
1742
1887
|
});
|
|
1743
1888
|
});
|
|
@@ -1759,11 +1904,43 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1759
1904
|
// Fallback appLoad event
|
|
1760
1905
|
endBootstrap();
|
|
1761
1906
|
};
|
|
1762
|
-
const
|
|
1763
|
-
|
|
1764
|
-
|
|
1907
|
+
const addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
|
|
1908
|
+
if (listeners) {
|
|
1909
|
+
listeners.map(([flags, name, method]) => {
|
|
1910
|
+
const target = getHostListenerTarget(elm, flags) ;
|
|
1911
|
+
const handler = hostListenerProxy(hostRef, method);
|
|
1912
|
+
const opts = hostListenerOpts(flags);
|
|
1913
|
+
plt.ael(target, name, handler, opts);
|
|
1914
|
+
(hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
|
|
1915
|
+
});
|
|
1916
|
+
}
|
|
1917
|
+
};
|
|
1918
|
+
const hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
1919
|
+
try {
|
|
1920
|
+
{
|
|
1921
|
+
if (hostRef.$flags$ & 256 /* HOST_FLAGS.isListenReady */) {
|
|
1922
|
+
// instance is ready, let's call it's member method for this event
|
|
1923
|
+
hostRef.$lazyInstance$[methodName](ev);
|
|
1924
|
+
}
|
|
1925
|
+
else {
|
|
1926
|
+
(hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
|
|
1927
|
+
}
|
|
1928
|
+
}
|
|
1929
|
+
}
|
|
1930
|
+
catch (e) {
|
|
1931
|
+
consoleError(e);
|
|
1932
|
+
}
|
|
1765
1933
|
};
|
|
1766
|
-
const
|
|
1934
|
+
const getHostListenerTarget = (elm, flags) => {
|
|
1935
|
+
if (flags & 4 /* LISTENER_FLAGS.TargetDocument */)
|
|
1936
|
+
return doc;
|
|
1937
|
+
if (flags & 8 /* LISTENER_FLAGS.TargetWindow */)
|
|
1938
|
+
return win;
|
|
1939
|
+
return elm;
|
|
1940
|
+
};
|
|
1941
|
+
// prettier-ignore
|
|
1942
|
+
const hostListenerOpts = (flags) => (flags & 2 /* LISTENER_FLAGS.Capture */) !== 0;
|
|
1943
|
+
const hostRefs = /*@__PURE__*/ new WeakMap();
|
|
1767
1944
|
const getHostRef = (ref) => hostRefs.get(ref);
|
|
1768
1945
|
const registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef);
|
|
1769
1946
|
const registerHost = (elm, cmpMeta) => {
|
|
@@ -1808,14 +1985,35 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
1808
1985
|
return importedModule[exportName];
|
|
1809
1986
|
}, consoleError);
|
|
1810
1987
|
};
|
|
1811
|
-
const styles = new Map();
|
|
1988
|
+
const styles = /*@__PURE__*/ new Map();
|
|
1989
|
+
const win = typeof window !== 'undefined' ? window : {};
|
|
1990
|
+
const doc = win.document || { head: {} };
|
|
1991
|
+
const plt = {
|
|
1992
|
+
$flags$: 0,
|
|
1993
|
+
$resourcesUrl$: '',
|
|
1994
|
+
jmp: (h) => h(),
|
|
1995
|
+
raf: (h) => requestAnimationFrame(h),
|
|
1996
|
+
ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
|
|
1997
|
+
rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
|
|
1998
|
+
ce: (eventName, opts) => new CustomEvent(eventName, opts),
|
|
1999
|
+
};
|
|
2000
|
+
const promiseResolve = (v) => Promise.resolve(v);
|
|
2001
|
+
const supportsConstructableStylesheets = /*@__PURE__*/ (() => {
|
|
2002
|
+
try {
|
|
2003
|
+
new CSSStyleSheet();
|
|
2004
|
+
return typeof new CSSStyleSheet().replaceSync === 'function';
|
|
2005
|
+
}
|
|
2006
|
+
catch (e) { }
|
|
2007
|
+
return false;
|
|
2008
|
+
})()
|
|
2009
|
+
;
|
|
1812
2010
|
const queueDomReads = [];
|
|
1813
2011
|
const queueDomWrites = [];
|
|
1814
2012
|
const queueTask = (queue, write) => (cb) => {
|
|
1815
2013
|
queue.push(cb);
|
|
1816
2014
|
if (!queuePending) {
|
|
1817
2015
|
queuePending = true;
|
|
1818
|
-
if (write && plt.$flags$ & 4 /* queueSync */) {
|
|
2016
|
+
if (write && plt.$flags$ & 4 /* PLATFORM_FLAGS.queueSync */) {
|
|
1819
2017
|
nextTick(flush);
|
|
1820
2018
|
}
|
|
1821
2019
|
else {
|