@esri/calcite-components 1.0.0-beta.95 → 1.0.0-beta.97
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/calcite/assets/date-picker/nls/messages.json +31 -0
- package/dist/calcite/assets/date-picker/t9n/index.d.ts +5 -0
- package/dist/calcite/assets/date-picker/t9n/messages.json +5 -0
- package/dist/calcite/assets/date-picker/t9n/messages_ar.json +5 -0
- package/dist/calcite/assets/date-picker/t9n/messages_bg.json +5 -0
- package/dist/calcite/assets/date-picker/t9n/messages_bs.json +5 -0
- package/dist/calcite/assets/date-picker/t9n/messages_ca.json +5 -0
- package/dist/calcite/assets/date-picker/t9n/messages_cs.json +5 -0
- package/dist/calcite/assets/date-picker/t9n/messages_da.json +5 -0
- package/dist/calcite/assets/date-picker/t9n/messages_de.json +5 -0
- package/dist/calcite/assets/date-picker/t9n/messages_el.json +5 -0
- package/dist/calcite/assets/date-picker/t9n/messages_en.json +5 -0
- package/dist/calcite/assets/date-picker/t9n/messages_es.json +5 -0
- package/dist/calcite/assets/date-picker/t9n/messages_et.json +5 -0
- package/dist/calcite/assets/date-picker/t9n/messages_fi.json +5 -0
- package/dist/calcite/assets/date-picker/t9n/messages_fr.json +5 -0
- package/dist/calcite/assets/date-picker/t9n/messages_he.json +5 -0
- package/dist/calcite/assets/date-picker/t9n/messages_hr.json +5 -0
- package/dist/calcite/assets/date-picker/t9n/messages_hu.json +5 -0
- package/dist/calcite/assets/date-picker/t9n/messages_id.json +5 -0
- package/dist/calcite/assets/date-picker/t9n/messages_it.json +5 -0
- package/dist/calcite/assets/date-picker/t9n/messages_ja.json +5 -0
- package/dist/calcite/assets/date-picker/t9n/messages_ko.json +5 -0
- package/dist/calcite/assets/date-picker/t9n/messages_lt.json +5 -0
- package/dist/calcite/assets/date-picker/t9n/messages_lv.json +5 -0
- package/dist/calcite/assets/date-picker/t9n/messages_nl.json +5 -0
- package/dist/calcite/assets/date-picker/t9n/messages_no.json +5 -0
- package/dist/calcite/assets/date-picker/t9n/messages_pl.json +5 -0
- package/dist/calcite/assets/date-picker/t9n/messages_pt-BR.json +5 -0
- package/dist/calcite/assets/date-picker/t9n/messages_pt-PT.json +5 -0
- package/dist/calcite/assets/date-picker/t9n/messages_ro.json +5 -0
- package/dist/calcite/assets/date-picker/t9n/messages_ru.json +5 -0
- package/dist/calcite/assets/date-picker/t9n/messages_sk.json +5 -0
- package/dist/calcite/assets/date-picker/t9n/messages_sl.json +5 -0
- package/dist/calcite/assets/date-picker/t9n/messages_sr.json +5 -0
- package/dist/calcite/assets/date-picker/t9n/messages_sv.json +5 -0
- package/dist/calcite/assets/date-picker/t9n/messages_th.json +5 -0
- package/dist/calcite/assets/date-picker/t9n/messages_tr.json +5 -0
- package/dist/calcite/assets/date-picker/t9n/messages_uk.json +5 -0
- package/dist/calcite/assets/date-picker/t9n/messages_vi.json +5 -0
- package/dist/calcite/assets/date-picker/t9n/messages_zh-CN.json +5 -0
- package/dist/calcite/assets/date-picker/t9n/messages_zh-HK.json +5 -0
- package/dist/calcite/assets/date-picker/t9n/messages_zh-TW.json +5 -0
- package/dist/calcite/assets/icon/dimensions16.json +1 -0
- package/dist/calcite/assets/icon/dimensions24.json +1 -0
- package/dist/calcite/assets/icon/dimensions32.json +1 -0
- package/dist/calcite/assets/icon/ellipse16.json +1 -0
- package/dist/calcite/assets/icon/ellipse24.json +1 -0
- package/dist/calcite/assets/icon/ellipse32.json +1 -0
- package/dist/calcite/assets/icon/triangle16.json +1 -0
- package/dist/calcite/assets/icon/triangle24.json +1 -0
- package/dist/calcite/assets/icon/triangle32.json +1 -0
- package/dist/calcite/calcite.css +1 -1
- package/dist/calcite/calcite.esm.js +2 -2
- package/dist/calcite/index.esm.js +1 -1
- package/dist/calcite/p-02206586.js +6 -0
- package/dist/calcite/p-0327c8e3.entry.js +6 -0
- package/dist/calcite/p-10eda8ed.entry.js +6 -0
- package/dist/calcite/p-1240fa7b.entry.js +6 -0
- package/dist/{esm-es5/index.js → calcite/p-146b4fe4.js} +2 -1
- package/dist/calcite/p-15704f21.entry.js +6 -0
- package/dist/calcite/p-166b1433.entry.js +6 -0
- package/dist/calcite/p-19d918b1.entry.js +6 -0
- package/dist/calcite/p-19de6a2c.entry.js +6 -0
- package/dist/calcite/p-1d1e8bdb.entry.js +6 -0
- package/dist/calcite/p-20ac0aba.entry.js +6 -0
- package/dist/calcite/p-21b74649.entry.js +6 -0
- package/dist/calcite/p-21c7e603.entry.js +6 -0
- package/dist/calcite/p-23a63d0d.entry.js +6 -0
- package/dist/calcite/p-25482df1.js +6 -0
- package/dist/calcite/p-311896ed.entry.js +6 -0
- package/dist/calcite/p-344b3c6c.entry.js +6 -0
- package/dist/calcite/p-3bed9a6f.entry.js +6 -0
- package/dist/calcite/p-3e539778.entry.js +6 -0
- package/dist/calcite/p-417a1880.entry.js +6 -0
- package/dist/calcite/p-481ea3fa.entry.js +6 -0
- package/dist/calcite/p-4af0a397.entry.js +6 -0
- package/dist/calcite/p-4ca93e87.js +6 -0
- package/dist/calcite/p-4d5bdb2b.entry.js +6 -0
- package/dist/calcite/{p-58a40573.js → p-4d9ab6e1.js} +1 -1
- package/dist/calcite/{p-77636ceb.js → p-4ee3752e.js} +2 -2
- package/dist/calcite/{p-af88a01c.js → p-535e2f9b.js} +1 -1
- package/dist/calcite/p-55ea8247.entry.js +6 -0
- package/dist/calcite/p-5710214d.entry.js +6 -0
- package/dist/calcite/p-5a400333.entry.js +6 -0
- package/dist/calcite/{p-80a51eb7.js → p-5ae3b7c4.js} +1 -1
- package/dist/calcite/p-5c79b811.entry.js +6 -0
- package/dist/calcite/p-5cf8cdc7.entry.js +6 -0
- package/dist/calcite/{p-966679da.js → p-5d6608fd.js} +1 -1
- package/dist/calcite/{p-48bb042f.js → p-622f8ecb.js} +1 -1
- package/dist/calcite/p-6284cc30.entry.js +6 -0
- package/dist/calcite/p-64b5872b.js +6 -0
- package/dist/calcite/{p-3053c253.js → p-698bfe4a.js} +2 -2
- package/dist/calcite/p-6c8b5581.entry.js +6 -0
- package/dist/calcite/{p-f4e3dc87.js → p-717298f3.js} +1 -1
- package/dist/calcite/p-75bb0987.entry.js +6 -0
- package/dist/calcite/p-78308811.entry.js +6 -0
- package/dist/calcite/p-84272f4b.entry.js +6 -0
- package/dist/calcite/p-85cbceca.entry.js +6 -0
- package/dist/calcite/{p-00abe273.js → p-8713e986.js} +2 -2
- package/dist/calcite/p-88798f16.entry.js +6 -0
- package/dist/calcite/p-8dc9be64.js +6 -0
- package/dist/calcite/p-91755387.js +7 -0
- package/dist/calcite/p-91b670e6.js +6 -0
- package/dist/calcite/p-92e553ee.entry.js +6 -0
- package/dist/calcite/p-94363dcc.entry.js +6 -0
- package/dist/calcite/p-96bf42e5.js +6 -0
- package/dist/calcite/p-982627c1.entry.js +6 -0
- package/dist/calcite/p-98ac3a6d.entry.js +6 -0
- package/dist/calcite/p-9b7467a5.entry.js +6 -0
- package/dist/calcite/p-9b7d5490.entry.js +6 -0
- package/dist/calcite/{p-510d1337.js → p-9c8fc268.js} +2 -2
- package/dist/calcite/p-a225f799.entry.js +6 -0
- package/dist/calcite/p-a2ddecc3.entry.js +6 -0
- package/dist/calcite/p-a2f5420b.js +6 -0
- package/dist/calcite/p-a53ca6f0.entry.js +6 -0
- package/dist/calcite/p-a6fe00fa.entry.js +6 -0
- package/dist/calcite/{p-3aaffa03.js → p-acc49c92.js} +1 -1
- package/dist/calcite/{p-901dc3de.js → p-af9e6e54.js} +1 -1
- package/dist/calcite/{p-ef082834.js → p-b675ccdc.js} +1 -1
- package/dist/calcite/p-b7f0762e.entry.js +6 -0
- package/dist/calcite/{p-4b823890.js → p-bbb9a284.js} +2 -2
- package/dist/calcite/p-bd16de0f.entry.js +6 -0
- package/dist/calcite/{p-21116f05.js → p-bd95c6d9.js} +1 -1
- package/dist/calcite/{p-46fef127.js → p-bda78a0c.js} +1 -1
- package/dist/calcite/p-be359e77.entry.js +6 -0
- package/dist/calcite/p-c25eed82.entry.js +6 -0
- package/dist/calcite/p-c40610e0.entry.js +6 -0
- package/dist/calcite/p-c469f3ba.entry.js +6 -0
- package/dist/calcite/p-c8699730.entry.js +6 -0
- package/dist/calcite/p-ce98b12c.entry.js +6 -0
- package/dist/calcite/{p-e0cd1e84.js → p-cf2d3774.js} +2 -2
- package/dist/calcite/{p-bd64d06c.js → p-d5bfadd8.js} +1 -1
- package/dist/calcite/p-d83bbe04.entry.js +6 -0
- package/dist/calcite/{p-b5326072.js → p-dd293eb9.js} +1 -1
- package/dist/calcite/p-df9a2f95.entry.js +6 -0
- package/dist/calcite/p-e3400054.entry.js +6 -0
- package/dist/calcite/p-e393bcaa.entry.js +6 -0
- package/dist/calcite/p-e7379f2a.entry.js +6 -0
- package/dist/calcite/p-e905ec51.entry.js +6 -0
- package/dist/calcite/p-ef8c4700.entry.js +6 -0
- package/dist/calcite/p-f1815b6c.entry.js +6 -0
- package/dist/calcite/p-f72104d6.entry.js +6 -0
- package/dist/calcite/p-f74d7303.entry.js +6 -0
- package/dist/cjs/{ExpandToggle-d10914db.js → ExpandToggle-e41acdfc.js} +5 -5
- package/dist/cjs/{Heading-1d94663a.js → Heading-1e87a15f.js} +2 -2
- package/dist/cjs/{app-globals-843f6f1d.js → app-globals-1cc5c95b.js} +2 -2
- package/dist/cjs/{array-7de7f400.js → array-e708c699.js} +1 -1
- package/dist/cjs/calcite-accordion_2.cjs.entry.js +14 -14
- package/dist/cjs/calcite-action-bar.cjs.entry.js +14 -14
- package/dist/cjs/calcite-action-group.cjs.entry.js +12 -12
- package/dist/cjs/calcite-action-menu.cjs.entry.js +41 -42
- package/dist/cjs/calcite-action-pad.cjs.entry.js +13 -13
- package/dist/cjs/calcite-action.cjs.entry.js +13 -13
- package/dist/cjs/calcite-alert.cjs.entry.js +25 -13
- package/dist/cjs/calcite-avatar.cjs.entry.js +7 -7
- package/dist/cjs/calcite-block_2.cjs.entry.js +33 -30
- package/dist/cjs/calcite-button.cjs.entry.js +30 -24
- package/dist/cjs/calcite-card.cjs.entry.js +15 -14
- package/dist/cjs/calcite-checkbox.cjs.entry.js +19 -17
- package/dist/cjs/calcite-chip.cjs.entry.js +17 -17
- package/dist/cjs/calcite-color-picker_3.cjs.entry.js +62 -59
- package/dist/cjs/calcite-combobox_3.cjs.entry.js +60 -47
- package/dist/cjs/calcite-date-picker_4.cjs.entry.js +63 -33
- package/dist/cjs/calcite-dropdown_3.cjs.entry.js +44 -31
- package/dist/cjs/calcite-fab.cjs.entry.js +8 -8
- package/dist/cjs/calcite-filter.cjs.entry.js +9 -9
- package/dist/cjs/calcite-flow-item.cjs.entry.js +24 -18
- package/dist/cjs/calcite-flow.cjs.entry.js +4 -4
- package/dist/cjs/calcite-graph_2.cjs.entry.js +88 -61
- package/dist/cjs/calcite-handle.cjs.entry.js +6 -6
- package/dist/cjs/calcite-icon.cjs.entry.js +7 -7
- package/dist/cjs/calcite-inline-editable.cjs.entry.js +9 -9
- package/dist/cjs/calcite-input-date-picker.cjs.entry.js +116 -61
- package/dist/cjs/calcite-input-message.cjs.entry.js +9 -9
- package/dist/cjs/calcite-input-number.cjs.entry.js +70 -45
- package/dist/cjs/calcite-input-text.cjs.entry.js +18 -18
- package/dist/cjs/calcite-input-time-picker_2.cjs.entry.js +155 -93
- package/dist/cjs/calcite-input.cjs.entry.js +89 -64
- package/dist/cjs/calcite-label.cjs.entry.js +16 -16
- package/dist/cjs/calcite-link.cjs.entry.js +9 -9
- package/dist/cjs/calcite-list_3.cjs.entry.js +15 -15
- package/dist/cjs/calcite-loader.cjs.entry.js +7 -7
- package/dist/cjs/calcite-modal.cjs.entry.js +17 -17
- package/dist/cjs/calcite-notice.cjs.entry.js +15 -15
- package/dist/cjs/calcite-option_3.cjs.entry.js +17 -17
- package/dist/cjs/calcite-pagination.cjs.entry.js +20 -13
- package/dist/cjs/calcite-panel.cjs.entry.js +33 -32
- package/dist/cjs/calcite-pick-list_3.cjs.entry.js +27 -27
- package/dist/cjs/calcite-popover_2.cjs.entry.js +56 -41
- package/dist/cjs/calcite-progress.cjs.entry.js +10 -5
- package/dist/cjs/calcite-radio-button-group.cjs.entry.js +7 -7
- package/dist/cjs/calcite-radio-button.cjs.entry.js +14 -14
- package/dist/cjs/calcite-radio-group_2.cjs.entry.js +17 -17
- package/dist/cjs/calcite-rating.cjs.entry.js +16 -16
- package/dist/cjs/calcite-scrim.cjs.entry.js +4 -4
- package/dist/cjs/calcite-shell_3.cjs.entry.js +23 -17
- package/dist/cjs/calcite-sortable-list.cjs.entry.js +6 -6
- package/dist/cjs/calcite-split-button.cjs.entry.js +10 -8
- package/dist/cjs/calcite-stepper_2.cjs.entry.js +48 -20
- package/dist/cjs/calcite-switch.cjs.entry.js +14 -14
- package/dist/cjs/calcite-tab_4.cjs.entry.js +22 -27
- package/dist/cjs/calcite-tile-select_2.cjs.entry.js +13 -13
- package/dist/cjs/calcite-tile.cjs.entry.js +13 -13
- package/dist/cjs/calcite-tip_3.cjs.entry.js +15 -15
- package/dist/cjs/calcite-tooltip_2.cjs.entry.js +38 -23
- package/dist/cjs/calcite-tree_2.cjs.entry.js +141 -90
- package/dist/cjs/calcite-value-list_2.cjs.entry.js +25 -25
- package/dist/cjs/calcite.cjs.js +6 -6
- package/dist/cjs/{conditionalSlot-ffff1ba2.js → conditionalSlot-ef852d9d.js} +3 -3
- package/dist/cjs/{debounce-3f8af6d8.js → debounce-2c8b61fb.js} +1 -1
- package/dist/cjs/{dom-df1903f9.js → dom-2ec8c9ed.js} +41 -3
- package/dist/cjs/{filter-a0274ec6.js → filter-9411bbc1.js} +3 -4
- package/dist/cjs/{floating-ui-99430551.js → floating-ui-b48c8256.js} +175 -23
- package/dist/cjs/{form-53eb189e.js → form-1d831023.js} +3 -3
- package/dist/cjs/{guid-9ba07df0.js → guid-f4f03a7a.js} +1 -1
- package/dist/cjs/{index-bbc26bc6.js → index-a0010f96.js} +1117 -946
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/{interactive-b210765f.js → interactive-32293bca.js} +1 -1
- package/dist/cjs/{interfaces-43537378.js → interfaces-971ccc32.js} +1 -1
- package/dist/cjs/{key-7c8bf01a.js → key-6a462411.js} +1 -1
- package/dist/cjs/{label-a586ee40.js → label-28060b83.js} +2 -2
- package/dist/cjs/loader.cjs.js +6 -6
- package/dist/cjs/locale-678ce361.js +414 -0
- package/dist/cjs/{math-8f7af178.js → math-f71ad83a.js} +1 -1
- package/dist/cjs/nonChromiumPlatformUtils-95812e02.js +506 -0
- package/dist/cjs/observers-5706326b.js +48 -0
- package/dist/cjs/{openCloseComponent-b884b722.js → openCloseComponent-178191c0.js} +1 -1
- package/dist/cjs/{resources-aa8679e5.js → resources-199140b3.js} +1 -1
- package/dist/cjs/{resources-ec998c3c.js → resources-4c8610b1.js} +12 -70
- package/dist/cjs/{resources-c61ea826.js → resources-8b3ba64a.js} +5 -5
- package/dist/cjs/{resources-c25710c9.js → resources-abee76d7.js} +1 -1
- package/dist/cjs/{resources-6f839761.js → resources-b5a5f8a7.js} +1 -1
- package/dist/cjs/{resources-dd0bf97d.js → resources-bd2202e9.js} +1 -1
- package/dist/cjs/{sortable.esm-6707f3f9.js → sortable.esm-673fe959.js} +1 -1
- package/dist/cjs/{utils-2cc96bc6.js → utils-1e0cd9e8.js} +1 -1
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/accordion/accordion.js +162 -153
- package/dist/collection/components/accordion/interfaces.js +0 -5
- package/dist/collection/components/accordion-item/accordion-item.js +304 -308
- package/dist/collection/components/accordion-item/interfaces.js +0 -5
- package/dist/collection/components/accordion-item/resources.js +1 -1
- package/dist/collection/components/action/action.css +1 -1
- package/dist/collection/components/action/action.js +298 -295
- package/dist/collection/components/action/resources.js +1 -1
- package/dist/collection/components/action-bar/action-bar.js +241 -234
- package/dist/collection/components/action-bar/resources.js +1 -1
- package/dist/collection/components/action-bar/utils.js +1 -1
- package/dist/collection/components/action-group/action-group.css +1 -1
- package/dist/collection/components/action-group/action-group.js +138 -135
- package/dist/collection/components/action-group/resources.js +1 -1
- package/dist/collection/components/action-menu/action-menu.js +250 -241
- package/dist/collection/components/action-menu/resources.js +1 -1
- package/dist/collection/components/action-pad/action-pad.js +198 -191
- package/dist/collection/components/action-pad/resources.js +1 -1
- package/dist/collection/components/alert/alert.css +1 -1
- package/dist/collection/components/alert/alert.js +413 -376
- package/dist/collection/components/alert/interfaces.js +1 -1
- package/dist/collection/components/alert/resources.js +1 -1
- package/dist/collection/components/avatar/avatar.js +107 -99
- package/dist/collection/components/avatar/utils.js +1 -1
- package/dist/collection/components/block/block.css +7 -0
- package/dist/collection/components/block/block.js +332 -339
- package/dist/collection/components/block/resources.js +3 -2
- package/dist/collection/components/block-section/block-section.js +150 -150
- package/dist/collection/components/block-section/interfaces.js +0 -5
- package/dist/collection/components/block-section/resources.js +1 -1
- package/dist/collection/components/button/button.js +458 -437
- package/dist/collection/components/button/interfaces.js +0 -5
- package/dist/collection/components/button/resources.js +1 -1
- package/dist/collection/components/card/card.js +181 -188
- package/dist/collection/components/card/resources.js +1 -1
- package/dist/collection/components/checkbox/checkbox.css +1 -1
- package/dist/collection/components/checkbox/checkbox.js +280 -270
- package/dist/collection/components/chip/chip.js +266 -261
- package/dist/collection/components/chip/interfaces.js +0 -5
- package/dist/collection/components/chip/resources.js +1 -1
- package/dist/collection/components/color-picker/color-picker.js +821 -817
- package/dist/collection/components/color-picker/interfaces.js +0 -5
- package/dist/collection/components/color-picker/resources.js +1 -1
- package/dist/collection/components/color-picker/utils.js +1 -1
- package/dist/collection/components/color-picker-hex-input/color-picker-hex-input.js +195 -178
- package/dist/collection/components/color-picker-hex-input/resources.js +1 -1
- package/dist/collection/components/color-picker-swatch/color-picker-swatch.js +83 -77
- package/dist/collection/components/color-picker-swatch/resources.js +1 -1
- package/dist/collection/components/combobox/combobox.css +1 -2
- package/dist/collection/components/combobox/combobox.js +595 -576
- package/dist/collection/components/combobox/interfaces.js +0 -5
- package/dist/collection/components/combobox/resources.js +1 -1
- package/dist/collection/components/combobox/utils.js +1 -1
- package/dist/collection/components/combobox-item/combobox-item.js +247 -239
- package/dist/collection/components/combobox-item/resources.js +1 -1
- package/dist/collection/components/combobox-item-group/combobox-item-group.js +50 -47
- package/dist/collection/components/combobox-item-group/resources.js +1 -1
- package/dist/collection/components/date-picker/assets/date-picker/nls/messages.json +31 -0
- package/dist/collection/components/date-picker/assets/date-picker/t9n/index.d.ts +5 -0
- package/dist/collection/components/date-picker/assets/date-picker/t9n/messages.json +5 -0
- package/dist/collection/components/date-picker/assets/date-picker/t9n/messages_ar.json +5 -0
- package/dist/collection/components/date-picker/assets/date-picker/t9n/messages_bg.json +5 -0
- package/dist/collection/components/date-picker/assets/date-picker/t9n/messages_bs.json +5 -0
- package/dist/collection/components/date-picker/assets/date-picker/t9n/messages_ca.json +5 -0
- package/dist/collection/components/date-picker/assets/date-picker/t9n/messages_cs.json +5 -0
- package/dist/collection/components/date-picker/assets/date-picker/t9n/messages_da.json +5 -0
- package/dist/collection/components/date-picker/assets/date-picker/t9n/messages_de.json +5 -0
- package/dist/collection/components/date-picker/assets/date-picker/t9n/messages_el.json +5 -0
- package/dist/collection/components/date-picker/assets/date-picker/t9n/messages_en.json +5 -0
- package/dist/collection/components/date-picker/assets/date-picker/t9n/messages_es.json +5 -0
- package/dist/collection/components/date-picker/assets/date-picker/t9n/messages_et.json +5 -0
- package/dist/collection/components/date-picker/assets/date-picker/t9n/messages_fi.json +5 -0
- package/dist/collection/components/date-picker/assets/date-picker/t9n/messages_fr.json +5 -0
- package/dist/collection/components/date-picker/assets/date-picker/t9n/messages_he.json +5 -0
- package/dist/collection/components/date-picker/assets/date-picker/t9n/messages_hr.json +5 -0
- package/dist/collection/components/date-picker/assets/date-picker/t9n/messages_hu.json +5 -0
- package/dist/collection/components/date-picker/assets/date-picker/t9n/messages_id.json +5 -0
- package/dist/collection/components/date-picker/assets/date-picker/t9n/messages_it.json +5 -0
- package/dist/collection/components/date-picker/assets/date-picker/t9n/messages_ja.json +5 -0
- package/dist/collection/components/date-picker/assets/date-picker/t9n/messages_ko.json +5 -0
- package/dist/collection/components/date-picker/assets/date-picker/t9n/messages_lt.json +5 -0
- package/dist/collection/components/date-picker/assets/date-picker/t9n/messages_lv.json +5 -0
- package/dist/collection/components/date-picker/assets/date-picker/t9n/messages_nl.json +5 -0
- package/dist/collection/components/date-picker/assets/date-picker/t9n/messages_no.json +5 -0
- package/dist/collection/components/date-picker/assets/date-picker/t9n/messages_pl.json +5 -0
- package/dist/collection/components/date-picker/assets/date-picker/t9n/messages_pt-BR.json +5 -0
- package/dist/collection/components/date-picker/assets/date-picker/t9n/messages_pt-PT.json +5 -0
- package/dist/collection/components/date-picker/assets/date-picker/t9n/messages_ro.json +5 -0
- package/dist/collection/components/date-picker/assets/date-picker/t9n/messages_ru.json +5 -0
- package/dist/collection/components/date-picker/assets/date-picker/t9n/messages_sk.json +5 -0
- package/dist/collection/components/date-picker/assets/date-picker/t9n/messages_sl.json +5 -0
- package/dist/collection/components/date-picker/assets/date-picker/t9n/messages_sr.json +5 -0
- package/dist/collection/components/date-picker/assets/date-picker/t9n/messages_sv.json +5 -0
- package/dist/collection/components/date-picker/assets/date-picker/t9n/messages_th.json +5 -0
- package/dist/collection/components/date-picker/assets/date-picker/t9n/messages_tr.json +5 -0
- package/dist/collection/components/date-picker/assets/date-picker/t9n/messages_uk.json +5 -0
- package/dist/collection/components/date-picker/assets/date-picker/t9n/messages_vi.json +5 -0
- package/dist/collection/components/date-picker/assets/date-picker/t9n/messages_zh-CN.json +5 -0
- package/dist/collection/components/date-picker/assets/date-picker/t9n/messages_zh-HK.json +5 -0
- package/dist/collection/components/date-picker/assets/date-picker/t9n/messages_zh-TW.json +5 -0
- package/dist/collection/components/date-picker/date-picker.js +489 -447
- package/dist/collection/components/date-picker/interfaces.js +0 -5
- package/dist/collection/components/date-picker/resources.js +1 -1
- package/dist/collection/components/date-picker/utils.js +2 -22
- package/dist/collection/components/date-picker-day/date-picker-day.css +48 -24
- package/dist/collection/components/date-picker-day/date-picker-day.js +280 -285
- package/dist/collection/components/date-picker-month/date-picker-month.js +257 -250
- package/dist/collection/components/date-picker-month-header/date-picker-month-header.css +3 -9
- package/dist/collection/components/date-picker-month-header/date-picker-month-header.js +249 -234
- package/dist/collection/components/date-picker-month-header/resources.js +1 -1
- package/dist/collection/components/dropdown/dropdown.css +0 -1
- package/dist/collection/components/dropdown/dropdown.js +460 -430
- package/dist/collection/components/dropdown/interfaces.js +0 -5
- package/dist/collection/components/dropdown/resources.js +1 -1
- package/dist/collection/components/dropdown-group/dropdown-group.js +113 -107
- package/dist/collection/components/dropdown-group/interfaces.js +0 -5
- package/dist/collection/components/dropdown-group/resources.js +1 -1
- package/dist/collection/components/dropdown-item/dropdown-item.js +292 -282
- package/dist/collection/components/dropdown-item/resources.js +1 -1
- package/dist/collection/components/fab/fab.js +205 -197
- package/dist/collection/components/fab/resources.js +1 -1
- package/dist/collection/components/filter/filter.js +200 -191
- package/dist/collection/components/filter/resources.js +1 -1
- package/dist/collection/components/flow/flow.js +55 -46
- package/dist/collection/components/flow/interfaces.js +0 -5
- package/dist/collection/components/flow/resources.js +1 -1
- package/dist/collection/components/flow-item/flow-item.js +419 -395
- package/dist/collection/components/flow-item/resources.js +1 -1
- package/dist/collection/components/functional/ExpandToggle.js +1 -1
- package/dist/collection/components/functional/Heading.js +1 -1
- package/dist/collection/components/graph/graph.js +125 -125
- package/dist/collection/components/graph/interfaces.js +0 -5
- package/dist/collection/components/graph/util.js +1 -1
- package/dist/collection/components/handle/handle.css +1 -1
- package/dist/collection/components/handle/handle.js +94 -85
- package/dist/collection/components/handle/resources.js +1 -1
- package/dist/collection/components/icon/assets/icon/dimensions16.json +1 -0
- package/dist/collection/components/icon/assets/icon/dimensions24.json +1 -0
- package/dist/collection/components/icon/assets/icon/dimensions32.json +1 -0
- package/dist/collection/components/icon/assets/icon/ellipse16.json +1 -0
- package/dist/collection/components/icon/assets/icon/ellipse24.json +1 -0
- package/dist/collection/components/icon/assets/icon/ellipse32.json +1 -0
- package/dist/collection/components/icon/assets/icon/triangle16.json +1 -0
- package/dist/collection/components/icon/assets/icon/triangle24.json +1 -0
- package/dist/collection/components/icon/assets/icon/triangle32.json +1 -0
- package/dist/collection/components/icon/icon.js +107 -98
- package/dist/collection/components/icon/resources.js +1 -1
- package/dist/collection/components/icon/utils.js +1 -1
- package/dist/collection/components/inline-editable/inline-editable.js +274 -266
- package/dist/collection/components/inline-editable/resources.js +1 -1
- package/dist/collection/components/input/input.css +5 -0
- package/dist/collection/components/input/input.js +882 -862
- package/dist/collection/components/input/interfaces.js +0 -5
- package/dist/collection/components/input/resources.js +1 -1
- package/dist/collection/components/input-date-picker/input-date-picker.css +1 -2
- package/dist/collection/components/input-date-picker/input-date-picker.js +900 -813
- package/dist/collection/components/input-date-picker/resources.js +1 -1
- package/dist/collection/components/input-message/input-message.css +1 -1
- package/dist/collection/components/input-message/input-message.js +124 -118
- package/dist/collection/components/input-message/interfaces.js +1 -1
- package/dist/collection/components/input-number/input-number.css +1 -20
- package/dist/collection/components/input-number/input-number.js +818 -796
- package/dist/collection/components/input-number/interfaces.js +0 -5
- package/dist/collection/components/input-number/resources.js +1 -1
- package/dist/collection/components/input-text/input-text.css +1 -20
- package/dist/collection/components/input-text/input-text.js +602 -603
- package/dist/collection/components/input-text/resources.js +1 -1
- package/dist/collection/components/input-time-picker/input-time-picker.js +671 -583
- package/dist/collection/components/interfaces.js +0 -5
- package/dist/collection/components/label/label.css +1 -1
- package/dist/collection/components/label/label.js +189 -183
- package/dist/collection/components/label/resources.js +1 -1
- package/dist/collection/components/link/link.js +186 -180
- package/dist/collection/components/list/list.js +76 -70
- package/dist/collection/components/list/resources.js +1 -1
- package/dist/collection/components/list-item/list-item.js +109 -113
- package/dist/collection/components/list-item/resources.js +1 -1
- package/dist/collection/components/list-item-group/list-item-group.js +54 -51
- package/dist/collection/components/list-item-group/resources.js +1 -1
- package/dist/collection/components/loader/loader.css +3 -3
- package/dist/collection/components/loader/loader.js +169 -172
- package/dist/collection/components/modal/interfaces.js +0 -5
- package/dist/collection/components/modal/modal.js +478 -481
- package/dist/collection/components/modal/resources.js +1 -1
- package/dist/collection/components/notice/notice.js +269 -267
- package/dist/collection/components/notice/resources.js +1 -1
- package/dist/collection/components/option/option.js +118 -108
- package/dist/collection/components/option-group/option-group.js +81 -73
- package/dist/collection/components/pagination/pagination.js +266 -258
- package/dist/collection/components/pagination/resources.js +1 -1
- package/dist/collection/components/panel/panel.css +1 -1
- package/dist/collection/components/panel/panel.js +557 -563
- package/dist/collection/components/panel/resources.js +1 -1
- package/dist/collection/components/pick-list/pick-list.js +255 -241
- package/dist/collection/components/pick-list/resources.js +1 -1
- package/dist/collection/components/pick-list/shared-list-logic.js +1 -1
- package/dist/collection/components/pick-list/shared-list-render.js +2 -9
- package/dist/collection/components/pick-list-group/pick-list-group.js +54 -52
- package/dist/collection/components/pick-list-group/resources.js +1 -1
- package/dist/collection/components/pick-list-item/pick-list-item.js +354 -352
- package/dist/collection/components/pick-list-item/resources.js +1 -1
- package/dist/collection/components/popover/PopoverManager.js +5 -2
- package/dist/collection/components/popover/popover.css +0 -1
- package/dist/collection/components/popover/popover.js +586 -562
- package/dist/collection/components/popover/resources.js +1 -1
- package/dist/collection/components/popover-manager/popover-manager.js +60 -52
- package/dist/collection/components/progress/progress.js +112 -104
- package/dist/collection/components/radio-button/radio-button.js +348 -337
- package/dist/collection/components/radio-button/resources.js +1 -1
- package/dist/collection/components/radio-button-group/radio-button-group.js +171 -160
- package/dist/collection/components/radio-group/interfaces.js +0 -5
- package/dist/collection/components/radio-group/radio-group.js +256 -244
- package/dist/collection/components/radio-group-item/radio-group-item.js +179 -176
- package/dist/collection/components/radio-group-item/resources.js +1 -1
- package/dist/collection/components/rating/rating.js +276 -277
- package/dist/collection/components/rating/resources.js +1 -1
- package/dist/collection/components/scrim/resources.js +1 -1
- package/dist/collection/components/scrim/scrim.js +57 -54
- package/dist/collection/components/select/resources.js +1 -1
- package/dist/collection/components/select/select.js +228 -219
- package/dist/collection/components/shell/resources.js +1 -1
- package/dist/collection/components/shell/shell.js +38 -43
- package/dist/collection/components/shell-center-row/resources.js +1 -1
- package/dist/collection/components/shell-center-row/shell-center-row.js +80 -76
- package/dist/collection/components/shell-panel/resources.js +1 -1
- package/dist/collection/components/shell-panel/shell-panel.js +194 -180
- package/dist/collection/components/slider/resources.js +1 -1
- package/dist/collection/components/slider/slider.js +643 -658
- package/dist/collection/components/sortable-list/resources.js +1 -1
- package/dist/collection/components/sortable-list/sortable-list.js +153 -142
- package/dist/collection/components/split-button/resources.js +1 -1
- package/dist/collection/components/split-button/split-button.js +366 -360
- package/dist/collection/components/stepper/interfaces.js +0 -5
- package/dist/collection/components/stepper/stepper.js +270 -236
- package/dist/collection/components/stepper-item/stepper-item.js +436 -400
- package/dist/collection/components/switch/switch.js +190 -182
- package/dist/collection/components/tab/interfaces.js +0 -5
- package/dist/collection/components/tab/tab.css +4 -2
- package/dist/collection/components/tab/tab.js +194 -181
- package/dist/collection/components/tab-nav/tab-nav.js +285 -275
- package/dist/collection/components/tab-title/tab-title.js +468 -456
- package/dist/collection/components/tabs/interfaces.js +0 -5
- package/dist/collection/components/tabs/resources.js +1 -1
- package/dist/collection/components/tabs/tabs.js +134 -132
- package/dist/collection/components/tile/resources.js +1 -1
- package/dist/collection/components/tile/tile.js +174 -178
- package/dist/collection/components/tile-select/interfaces.js +0 -5
- package/dist/collection/components/tile-select/resources.js +1 -1
- package/dist/collection/components/tile-select/tile-select.css +1 -0
- package/dist/collection/components/tile-select/tile-select.js +352 -338
- package/dist/collection/components/tile-select-group/interfaces.js +0 -5
- package/dist/collection/components/tile-select-group/tile-select-group.js +57 -51
- package/dist/collection/components/time-picker/resources.js +1 -1
- package/dist/collection/components/time-picker/time-picker.js +575 -550
- package/dist/collection/components/tip/resources.js +1 -1
- package/dist/collection/components/tip/tip.js +145 -146
- package/dist/collection/components/tip-group/tip-group.js +33 -27
- package/dist/collection/components/tip-manager/resources.js +1 -1
- package/dist/collection/components/tip-manager/tip-manager.js +226 -222
- package/dist/collection/components/tooltip/TooltipManager.js +6 -1
- package/dist/collection/components/tooltip/resources.js +1 -1
- package/dist/collection/components/tooltip/tooltip.css +0 -1
- package/dist/collection/components/tooltip/tooltip.js +252 -225
- package/dist/collection/components/tooltip-manager/tooltip-manager.js +38 -32
- package/dist/collection/components/tree/interfaces.js +1 -1
- package/dist/collection/components/tree/tree.js +278 -245
- package/dist/collection/components/tree/utils.js +21 -0
- package/dist/collection/components/tree-item/interfaces.js +0 -5
- package/dist/collection/components/tree-item/resources.js +1 -1
- package/dist/collection/components/tree-item/tree-item.css +17 -3
- package/dist/collection/components/tree-item/tree-item.js +306 -273
- package/dist/collection/components/value-list/interfaces.js +0 -5
- package/dist/collection/components/value-list/resources.js +1 -1
- package/dist/collection/components/value-list/utils.js +1 -1
- package/dist/collection/components/value-list/value-list.js +348 -334
- package/dist/collection/components/value-list-item/resources.js +1 -1
- package/dist/collection/components/value-list-item/value-list-item.css +1 -2
- package/dist/collection/components/value-list-item/value-list-item.js +286 -279
- package/dist/collection/demos/_assets/demo-dom-swapper.js +45 -0
- package/dist/collection/demos/_assets/demo-spacer.js +17 -0
- package/dist/collection/demos/_assets/demo-template.js +24 -0
- package/dist/collection/demos/_assets/head.js +48 -0
- package/dist/collection/demos/_assets/locales.js +223 -0
- package/dist/collection/utils/array.js +1 -1
- package/dist/collection/utils/conditionalSlot.js +1 -1
- package/dist/collection/utils/config.js +22 -0
- package/dist/collection/utils/date.js +3 -38
- package/dist/collection/utils/dom.js +37 -1
- package/dist/collection/utils/filter.js +2 -3
- package/dist/collection/utils/floating-ui/nonChromiumPlatformUtils.js +496 -0
- package/dist/collection/utils/floating-ui.js +123 -12
- package/dist/collection/utils/form.js +1 -1
- package/dist/collection/utils/globalAttributes.js +1 -1
- package/dist/collection/utils/globalScript.js +1 -1
- package/dist/collection/utils/guid.js +1 -1
- package/dist/collection/utils/interactive.js +1 -1
- package/dist/collection/utils/key.js +1 -1
- package/dist/collection/utils/label.js +1 -1
- package/dist/collection/utils/locale.js +199 -64
- package/dist/collection/utils/math.js +1 -1
- package/dist/collection/utils/number.js +36 -31
- package/dist/collection/utils/observers.js +31 -7
- package/dist/collection/utils/openCloseComponent.js +1 -1
- package/dist/collection/utils/resources.js +1 -1
- package/dist/collection/utils/t9n.js +110 -0
- package/dist/collection/utils/theme.js +1 -1
- package/dist/collection/utils/time.js +16 -14
- package/dist/components/ExpandToggle.js +1 -1
- package/dist/components/Heading.js +1 -1
- package/dist/components/action-group.js +4 -4
- package/dist/components/action-menu.js +35 -36
- package/dist/components/action.js +8 -8
- package/dist/components/array.js +1 -1
- package/dist/components/button.js +23 -17
- package/dist/components/calcite-accordion-item.js +5 -5
- package/dist/components/calcite-accordion.js +4 -4
- package/dist/components/calcite-action-bar.js +6 -6
- package/dist/components/calcite-action-group.js +1 -1
- package/dist/components/calcite-action-menu.js +1 -1
- package/dist/components/calcite-action-pad.js +4 -4
- package/dist/components/calcite-action.js +1 -1
- package/dist/components/calcite-alert.js +19 -7
- package/dist/components/calcite-avatar.js +2 -2
- package/dist/components/calcite-block-section.js +8 -6
- package/dist/components/calcite-block.js +17 -16
- package/dist/components/calcite-button.js +1 -1
- package/dist/components/calcite-card.js +9 -8
- package/dist/components/calcite-checkbox.js +1 -1
- package/dist/components/calcite-chip.js +1 -1
- package/dist/components/calcite-color-picker-hex-input.js +1 -1
- package/dist/components/calcite-color-picker-swatch.js +1 -1
- package/dist/components/calcite-color-picker.js +44 -39
- package/dist/components/calcite-combobox-item-group.js +2 -2
- package/dist/components/calcite-combobox-item.js +8 -6
- package/dist/components/calcite-combobox.js +42 -31
- package/dist/components/calcite-date-picker-day.js +1 -1
- package/dist/components/calcite-date-picker-month-header.js +1 -1
- package/dist/components/calcite-date-picker-month.js +1 -1
- package/dist/components/calcite-date-picker.js +1 -1
- package/dist/components/calcite-dropdown-group.js +2 -2
- package/dist/components/calcite-dropdown-item.js +2 -2
- package/dist/components/calcite-dropdown.js +1 -1
- package/dist/components/calcite-fab.js +3 -3
- package/dist/components/calcite-filter.js +1 -1
- package/dist/components/calcite-flow-item.js +18 -12
- package/dist/components/calcite-flow.js +2 -2
- package/dist/components/calcite-graph.js +1 -1
- package/dist/components/calcite-handle.js +1 -1
- package/dist/components/calcite-icon.js +1 -1
- package/dist/components/calcite-inline-editable.js +2 -2
- package/dist/components/calcite-input-date-picker.js +110 -53
- package/dist/components/calcite-input-message.js +5 -5
- package/dist/components/calcite-input-number.js +53 -28
- package/dist/components/calcite-input-text.js +10 -10
- package/dist/components/calcite-input-time-picker.js +83 -35
- package/dist/components/calcite-input.js +1 -1
- package/dist/components/calcite-label.js +1 -1
- package/dist/components/calcite-link.js +1 -1
- package/dist/components/calcite-list-item-group.js +2 -2
- package/dist/components/calcite-list-item.js +4 -4
- package/dist/components/calcite-list.js +3 -3
- package/dist/components/calcite-loader.js +1 -1
- package/dist/components/calcite-modal.js +11 -11
- package/dist/components/calcite-notice.js +8 -8
- package/dist/components/calcite-option-group.js +3 -3
- package/dist/components/calcite-option.js +3 -3
- package/dist/components/calcite-pagination.js +15 -11
- package/dist/components/calcite-panel.js +1 -1
- package/dist/components/calcite-pick-list-group.js +2 -2
- package/dist/components/calcite-pick-list-item.js +1 -1
- package/dist/components/calcite-pick-list.js +8 -8
- package/dist/components/calcite-popover-manager.js +2 -2
- package/dist/components/calcite-popover.js +1 -1
- package/dist/components/calcite-progress.js +1 -1
- package/dist/components/calcite-radio-button-group.js +5 -5
- package/dist/components/calcite-radio-button.js +7 -7
- package/dist/components/calcite-radio-group-item.js +6 -6
- package/dist/components/calcite-radio-group.js +5 -5
- package/dist/components/calcite-rating.js +8 -8
- package/dist/components/calcite-scrim.js +1 -1
- package/dist/components/calcite-select.js +5 -5
- package/dist/components/calcite-shell-center-row.js +4 -4
- package/dist/components/calcite-shell-panel.js +13 -7
- package/dist/components/calcite-shell.js +2 -2
- package/dist/components/calcite-slider.js +79 -53
- package/dist/components/calcite-sortable-list.js +2 -2
- package/dist/components/calcite-split-button.js +8 -6
- package/dist/components/calcite-stepper-item.js +39 -12
- package/dist/components/calcite-stepper.js +5 -4
- package/dist/components/calcite-switch.js +1 -1
- package/dist/components/calcite-tab-nav.js +1 -1
- package/dist/components/calcite-tab-title.js +1 -1
- package/dist/components/calcite-tab.js +1 -1
- package/dist/components/calcite-tabs.js +1 -1
- package/dist/components/calcite-tile-select-group.js +4 -4
- package/dist/components/calcite-tile-select.js +8 -8
- package/dist/components/calcite-tile.js +1 -1
- package/dist/components/calcite-time-picker.js +1 -1
- package/dist/components/calcite-tip-group.js +2 -2
- package/dist/components/calcite-tip-manager.js +3 -3
- package/dist/components/calcite-tip.js +5 -5
- package/dist/components/calcite-tooltip-manager.js +2 -2
- package/dist/components/calcite-tooltip.js +1 -1
- package/dist/components/calcite-tree-item.js +21 -9
- package/dist/components/calcite-tree.js +118 -78
- package/dist/components/calcite-value-list-item.js +6 -6
- package/dist/components/calcite-value-list.js +9 -9
- package/dist/components/checkbox.js +11 -9
- package/dist/components/chip.js +11 -11
- package/dist/components/color-picker-hex-input.js +8 -10
- package/dist/components/color-picker-swatch.js +4 -4
- package/dist/components/conditionalSlot.js +1 -1
- package/dist/components/date-picker-day.js +17 -9
- package/dist/components/date-picker-month-header.js +25 -11
- package/dist/components/date-picker-month.js +4 -4
- package/dist/components/date-picker.js +20 -28
- package/dist/components/date.js +5 -39
- package/dist/components/debounce.js +1 -1
- package/dist/components/dom.js +38 -2
- package/dist/components/dropdown.js +35 -23
- package/dist/components/filter.js +2 -2
- package/dist/components/filter2.js +2 -3
- package/dist/components/floating-ui.js +181 -22
- package/dist/components/form.js +2 -2
- package/dist/components/graph.js +2 -2
- package/dist/components/guid.js +1 -1
- package/dist/components/handle.js +2 -2
- package/dist/components/icon.js +2 -2
- package/dist/components/index.js +1 -1
- package/dist/components/input.js +72 -47
- package/dist/components/interactive.js +1 -1
- package/dist/components/interfaces.js +1 -1
- package/dist/components/interfaces2.js +1 -1
- package/dist/components/key.js +1 -1
- package/dist/components/label.js +11 -11
- package/dist/components/label2.js +2 -2
- package/dist/components/link.js +6 -6
- package/dist/components/loader.js +5 -5
- package/dist/components/locale.js +403 -0
- package/dist/components/math.js +1 -1
- package/dist/components/nonChromiumPlatformUtils.js +498 -0
- package/dist/components/observers.js +31 -7
- package/dist/components/openCloseComponent.js +1 -1
- package/dist/components/panel.js +24 -23
- package/dist/components/pick-list-item.js +8 -8
- package/dist/components/popover.js +47 -33
- package/dist/components/progress.js +9 -4
- package/dist/components/resources.js +1 -1
- package/dist/components/resources2.js +1 -1
- package/dist/components/resources3.js +1 -1
- package/dist/components/scrim.js +3 -3
- package/dist/components/shared-list-render.js +1 -1
- package/dist/components/sortable.esm.js +1 -1
- package/dist/components/switch.js +6 -6
- package/dist/components/tab-nav.js +3 -3
- package/dist/components/tab-title.js +6 -6
- package/dist/components/tab.js +6 -6
- package/dist/components/tabs.js +5 -10
- package/dist/components/tile.js +6 -6
- package/dist/components/time-picker.js +56 -39
- package/dist/components/tooltip.js +33 -19
- package/dist/components/utils.js +1 -1
- package/dist/components/utils2.js +2 -2
- package/dist/esm/{ExpandToggle-51cda39f.js → ExpandToggle-a4a9eace.js} +5 -5
- package/dist/esm/{Heading-3a6ae137.js → Heading-e0abf8a2.js} +2 -2
- package/dist/esm/{app-globals-8ea1c0e3.js → app-globals-59bc5b85.js} +2 -2
- package/dist/esm/{array-2db27e14.js → array-03a17827.js} +1 -1
- package/dist/esm/calcite-accordion_2.entry.js +14 -14
- package/dist/esm/calcite-action-bar.entry.js +14 -14
- package/dist/esm/calcite-action-group.entry.js +12 -12
- package/dist/esm/calcite-action-menu.entry.js +41 -42
- package/dist/esm/calcite-action-pad.entry.js +13 -13
- package/dist/esm/calcite-action.entry.js +13 -13
- package/dist/esm/calcite-alert.entry.js +25 -13
- package/dist/esm/calcite-avatar.entry.js +7 -7
- package/dist/esm/calcite-block_2.entry.js +33 -30
- package/dist/esm/calcite-button.entry.js +30 -24
- package/dist/esm/calcite-card.entry.js +15 -14
- package/dist/esm/calcite-checkbox.entry.js +19 -17
- package/dist/esm/calcite-chip.entry.js +17 -17
- package/dist/esm/calcite-color-picker_3.entry.js +62 -59
- package/dist/esm/calcite-combobox_3.entry.js +60 -47
- package/dist/esm/calcite-date-picker_4.entry.js +63 -33
- package/dist/esm/calcite-dropdown_3.entry.js +44 -31
- package/dist/esm/calcite-fab.entry.js +8 -8
- package/dist/esm/calcite-filter.entry.js +9 -9
- package/dist/esm/calcite-flow-item.entry.js +24 -18
- package/dist/esm/calcite-flow.entry.js +4 -4
- package/dist/esm/calcite-graph_2.entry.js +88 -61
- package/dist/esm/calcite-handle.entry.js +6 -6
- package/dist/esm/calcite-icon.entry.js +7 -7
- package/dist/esm/calcite-inline-editable.entry.js +9 -9
- package/dist/esm/calcite-input-date-picker.entry.js +116 -61
- package/dist/esm/calcite-input-message.entry.js +9 -9
- package/dist/esm/calcite-input-number.entry.js +61 -36
- package/dist/esm/calcite-input-text.entry.js +18 -18
- package/dist/esm/calcite-input-time-picker_2.entry.js +139 -77
- package/dist/esm/calcite-input.entry.js +80 -55
- package/dist/esm/calcite-label.entry.js +16 -16
- package/dist/esm/calcite-link.entry.js +9 -9
- package/dist/esm/calcite-list_3.entry.js +15 -15
- package/dist/esm/calcite-loader.entry.js +7 -7
- package/dist/esm/calcite-modal.entry.js +17 -17
- package/dist/esm/calcite-notice.entry.js +15 -15
- package/dist/esm/calcite-option_3.entry.js +17 -17
- package/dist/esm/calcite-pagination.entry.js +20 -13
- package/dist/esm/calcite-panel.entry.js +33 -32
- package/dist/esm/calcite-pick-list_3.entry.js +27 -27
- package/dist/esm/calcite-popover_2.entry.js +56 -41
- package/dist/esm/calcite-progress.entry.js +10 -5
- package/dist/esm/calcite-radio-button-group.entry.js +7 -7
- package/dist/esm/calcite-radio-button.entry.js +14 -14
- package/dist/esm/calcite-radio-group_2.entry.js +17 -17
- package/dist/esm/calcite-rating.entry.js +16 -16
- package/dist/esm/calcite-scrim.entry.js +4 -4
- package/dist/esm/calcite-shell_3.entry.js +23 -17
- package/dist/esm/calcite-sortable-list.entry.js +6 -6
- package/dist/esm/calcite-split-button.entry.js +10 -8
- package/dist/esm/calcite-stepper_2.entry.js +48 -20
- package/dist/esm/calcite-switch.entry.js +14 -14
- package/dist/esm/calcite-tab_4.entry.js +22 -27
- package/dist/esm/calcite-tile-select_2.entry.js +13 -13
- package/dist/esm/calcite-tile.entry.js +13 -13
- package/dist/esm/calcite-tip_3.entry.js +15 -15
- package/dist/esm/calcite-tooltip_2.entry.js +38 -23
- package/dist/esm/calcite-tree_2.entry.js +141 -90
- package/dist/esm/calcite-value-list_2.entry.js +25 -25
- package/dist/esm/calcite.js +6 -6
- package/dist/esm/{conditionalSlot-a8df5b3f.js → conditionalSlot-a3e8c63a.js} +3 -3
- package/dist/esm/{debounce-d31cc476.js → debounce-d85a6654.js} +1 -1
- package/dist/esm/{dom-24af003b.js → dom-8f0a9ff2.js} +40 -4
- package/dist/esm/{filter-72316b3f.js → filter-0e5a9913.js} +3 -4
- package/dist/esm/{floating-ui-10f8689c.js → floating-ui-5c49748f.js} +173 -22
- package/dist/esm/{form-390fdf0f.js → form-80dbd90e.js} +3 -3
- package/dist/esm/{guid-b68b1941.js → guid-9f15e57a.js} +1 -1
- package/dist/esm/{index-8384b5ec.js → index-1f9b54dc.js} +1117 -946
- package/dist/esm/index.js +1 -1
- package/dist/esm/{interactive-f2ec7825.js → interactive-5db230e8.js} +1 -1
- package/dist/esm/{interfaces-ba98f966.js → interfaces-87b65de3.js} +1 -1
- package/dist/esm/{key-ed874b7d.js → key-acc755b7.js} +1 -1
- package/dist/esm/{label-78f72c1a.js → label-333c4a4c.js} +2 -2
- package/dist/esm/loader.js +6 -6
- package/dist/esm/locale-35f81208.js +403 -0
- package/dist/esm/{math-2893cee3.js → math-dd4df0b5.js} +1 -1
- package/dist/esm/nonChromiumPlatformUtils-45c9ed51.js +502 -0
- package/dist/esm/observers-9f44e9b3.js +46 -0
- package/dist/esm/{openCloseComponent-0a4c6226.js → openCloseComponent-ba7d452b.js} +1 -1
- package/dist/esm/polyfills/css-shim.js +1 -1
- package/dist/esm/{resources-32c242fa.js → resources-3e3255c7.js} +5 -5
- package/dist/esm/{resources-f8aa3ed1.js → resources-8812a15c.js} +5 -61
- package/dist/esm/{resources-351f6f14.js → resources-9a59d78c.js} +1 -1
- package/dist/esm/{resources-ea0a60b4.js → resources-9c476cb6.js} +1 -1
- package/dist/esm/{resources-3acd3089.js → resources-a75141ea.js} +1 -1
- package/dist/esm/{resources-0497ae87.js → resources-ca31b4fd.js} +1 -1
- package/dist/esm/{sortable.esm-3d78dbdc.js → sortable.esm-8be1d379.js} +1 -1
- package/dist/esm/{utils-a7e4e0e1.js → utils-85948aeb.js} +1 -1
- package/dist/extras/docs-json.json +1948 -783
- package/dist/index.js +1 -1
- package/dist/loader/cdn.js +1 -1
- package/dist/loader/index.cjs.js +1 -1
- package/dist/loader/index.es2017.js +1 -1
- package/dist/loader/index.js +2 -2
- package/dist/loader/package.json +1 -0
- package/dist/types/components/accordion/accordion.d.ts +2 -2
- package/dist/types/components/accordion-item/accordion-item.d.ts +7 -7
- package/dist/types/components/action/action.d.ts +8 -8
- package/dist/types/components/action/assets/action/t9n/index.d.ts +3 -0
- package/dist/types/components/action-bar/action-bar.d.ts +3 -3
- package/dist/types/components/action-bar/assets/action-bar/t9n/index.d.ts +4 -0
- package/dist/types/components/action-group/action-group.d.ts +2 -2
- package/dist/types/components/action-group/assets/action-group/t9n/index.d.ts +3 -0
- package/dist/types/components/action-menu/action-menu.d.ts +7 -7
- package/dist/types/components/action-pad/action-pad.d.ts +2 -2
- package/dist/types/components/action-pad/assets/action-pad/t9n/index.d.ts +4 -0
- package/dist/types/components/alert/alert.d.ts +12 -6
- package/dist/types/components/alert/assets/alert/t9n/index.d.ts +3 -0
- package/dist/types/components/block/assets/block/t9n/index.d.ts +6 -0
- package/dist/types/components/block/block.d.ts +22 -20
- package/dist/types/components/block/resources.d.ts +2 -1
- package/dist/types/components/block-section/assets/block-section/t9n/index.d.ts +4 -0
- package/dist/types/components/block-section/block-section.d.ts +12 -10
- package/dist/types/components/button/assets/button/t9n/index.d.ts +3 -0
- package/dist/types/components/button/button.d.ts +37 -21
- package/dist/types/components/card/assets/card/t9n/index.d.ts +5 -0
- package/dist/types/components/card/card.d.ts +11 -10
- package/dist/types/components/checkbox/checkbox.d.ts +16 -14
- package/dist/types/components/chip/assets/chip/t9n/index.d.ts +3 -0
- package/dist/types/components/chip/chip.d.ts +13 -13
- package/dist/types/components/color-picker/assets/color-picker/t9n/index.d.ts +21 -0
- package/dist/types/components/color-picker/color-picker.d.ts +39 -41
- package/dist/types/components/color-picker-hex-input/color-picker-hex-input.d.ts +9 -10
- package/dist/types/components/color-picker-swatch/color-picker-swatch.d.ts +2 -2
- package/dist/types/components/combobox/assets/combobox/t9n/index.d.ts +3 -0
- package/dist/types/components/combobox/combobox.d.ts +36 -31
- package/dist/types/components/combobox-item/combobox-item.d.ts +15 -13
- package/dist/types/components/combobox-item-group/combobox-item-group.d.ts +2 -2
- package/dist/types/components/date-picker/assets/date-picker/t9n/index.d.ts +5 -0
- package/dist/types/components/date-picker/date-picker.d.ts +9 -4
- package/dist/types/components/date-picker-day/date-picker-day.d.ts +2 -3
- package/dist/types/components/date-picker-month-header/date-picker-month-header.d.ts +2 -0
- package/dist/types/components/dropdown/dropdown.d.ts +11 -6
- package/dist/types/components/dropdown-item/dropdown-item.d.ts +3 -3
- package/dist/types/components/fab/fab.d.ts +1 -1
- package/dist/types/components/filter/assets/filter/t9n/index.d.ts +4 -0
- package/dist/types/components/flow/flow.d.ts +1 -1
- package/dist/types/components/flow-item/flow-item.d.ts +12 -8
- package/dist/types/components/handle/handle.d.ts +1 -1
- package/dist/types/components/inline-editable/assets/inline-editable/t9n/index.d.ts +5 -0
- package/dist/types/components/inline-editable/inline-editable.d.ts +1 -1
- package/dist/types/components/input/assets/input/t9n/index.d.ts +4 -0
- package/dist/types/components/input/input.d.ts +31 -32
- package/dist/types/components/input-date-picker/input-date-picker.d.ts +61 -44
- package/dist/types/components/input-message/input-message.d.ts +6 -9
- package/dist/types/components/input-number/assets/input-number/t9n/index.d.ts +4 -0
- package/dist/types/components/input-number/input-number.d.ts +17 -19
- package/dist/types/components/input-text/assets/input-text/t9n/index.d.ts +4 -0
- package/dist/types/components/input-text/input-text.d.ts +10 -10
- package/dist/types/components/input-time-picker/input-time-picker.d.ts +41 -30
- package/dist/types/components/label/label.d.ts +10 -10
- package/dist/types/components/link/link.d.ts +8 -8
- package/dist/types/components/list/list.d.ts +1 -1
- package/dist/types/components/list-item/list-item.d.ts +2 -2
- package/dist/types/components/loader/loader.d.ts +9 -4
- package/dist/types/components/modal/assets/modal/t9n/index.d.ts +3 -0
- package/dist/types/components/modal/modal.d.ts +10 -10
- package/dist/types/components/notice/assets/notice/t9n/index.d.ts +3 -0
- package/dist/types/components/notice/notice.d.ts +7 -8
- package/dist/types/components/option/option.d.ts +2 -2
- package/dist/types/components/option-group/option-group.d.ts +1 -1
- package/dist/types/components/pagination/assets/pagination/t9n/index.d.ts +4 -0
- package/dist/types/components/pagination/pagination.d.ts +5 -8
- package/dist/types/components/panel/assets/panel/t9n/index.d.ts +6 -0
- package/dist/types/components/panel/panel.d.ts +21 -23
- package/dist/types/components/pick-list/assets/pick-list/t9n/index.d.ts +3 -0
- package/dist/types/components/pick-list/pick-list.d.ts +7 -7
- package/dist/types/components/pick-list-item/assets/pick-list-item/t9n/index.d.ts +3 -0
- package/dist/types/components/pick-list-item/pick-list-item.d.ts +8 -8
- package/dist/types/components/popover/assets/popover/t9n/index.d.ts +3 -0
- package/dist/types/components/popover/popover.d.ts +24 -17
- package/dist/types/components/popover-manager/popover-manager.d.ts +1 -1
- package/dist/types/components/progress/progress.d.ts +7 -2
- package/dist/types/components/radio-button/radio-button.d.ts +6 -6
- package/dist/types/components/radio-button-group/radio-button-group.d.ts +4 -4
- package/dist/types/components/radio-group/radio-group.d.ts +3 -3
- package/dist/types/components/radio-group-item/radio-group-item.d.ts +8 -8
- package/dist/types/components/rating/assets/rating/t9n/index.d.ts +4 -0
- package/dist/types/components/rating/rating.d.ts +4 -4
- package/dist/types/components/scrim/assets/scrim/t9n/index.d.ts +3 -0
- package/dist/types/components/scrim/scrim.d.ts +1 -1
- package/dist/types/components/select/select.d.ts +4 -4
- package/dist/types/components/shell-center-row/shell-center-row.d.ts +2 -2
- package/dist/types/components/shell-panel/assets/shell-panel/t9n/index.d.ts +3 -0
- package/dist/types/components/shell-panel/shell-panel.d.ts +6 -6
- package/dist/types/components/slider/slider.d.ts +24 -25
- package/dist/types/components/sortable-list/sortable-list.d.ts +1 -1
- package/dist/types/components/split-button/split-button.d.ts +9 -7
- package/dist/types/components/stepper/stepper.d.ts +7 -2
- package/dist/types/components/stepper-item/stepper-item.d.ts +15 -11
- package/dist/types/components/switch/switch.d.ts +6 -6
- package/dist/types/components/tab/tab.d.ts +3 -3
- package/dist/types/components/tab-title/tab-title.d.ts +8 -8
- package/dist/types/components/tabs/tabs.d.ts +3 -4
- package/dist/types/components/tile/tile.d.ts +5 -5
- package/dist/types/components/tile-select/tile-select.d.ts +5 -5
- package/dist/types/components/tile-select-group/tile-select-group.d.ts +2 -2
- package/dist/types/components/time-picker/assets/time-picker/t9n/index.d.ts +14 -0
- package/dist/types/components/time-picker/time-picker.d.ts +13 -8
- package/dist/types/components/tip/assets/tip/t9n/index.d.ts +3 -0
- package/dist/types/components/tip/tip.d.ts +3 -3
- package/dist/types/components/tip-manager/assets/tip-manager/t9n/index.d.ts +7 -0
- package/dist/types/components/tip-manager/tip-manager.d.ts +3 -3
- package/dist/types/components/tooltip/tooltip.d.ts +16 -7
- package/dist/types/components/tooltip-manager/tooltip-manager.d.ts +1 -1
- package/dist/types/components/tree/tree.d.ts +2 -2
- package/dist/types/components/tree/utils.d.ts +1 -0
- package/dist/types/components/tree-item/tree-item.d.ts +10 -4
- package/dist/types/components/value-list/assets/value-list/t9n/index.d.ts +7 -0
- package/dist/types/components/value-list/value-list.d.ts +16 -16
- package/dist/types/components/value-list-item/value-list-item.d.ts +4 -4
- package/dist/types/components.d.ts +1074 -1007
- package/dist/types/preact.d.ts +2 -1
- package/dist/types/stencil-public-runtime.d.ts +15 -4
- package/dist/types/utils/config.d.ts +7 -0
- package/dist/types/utils/date.d.ts +0 -20
- package/dist/types/utils/dom.d.ts +19 -0
- package/dist/types/utils/floating-ui/nonChromiumPlatformUtils.d.ts +16 -0
- package/dist/types/utils/floating-ui.d.ts +45 -2
- package/dist/types/utils/locale.d.ts +81 -11
- package/dist/types/utils/number.d.ts +3 -5
- package/dist/types/utils/observers.d.ts +5 -1
- package/dist/types/utils/t9n.d.ts +88 -0
- package/dist/types/utils/time.d.ts +29 -5
- package/hydrate/index.d.ts +1 -1
- package/hydrate/index.js +2523 -1974
- package/package.json +31 -28
- package/readme.md +2 -2
- package/dist/calcite/calcite.js +0 -131
- package/dist/calcite/p-01e0a7fb.system.entry.js +0 -6
- package/dist/calcite/p-026ebb31.system.entry.js +0 -6
- package/dist/calcite/p-0371e393.system.js +0 -6
- package/dist/calcite/p-049ccea8.system.entry.js +0 -6
- package/dist/calcite/p-06715c20.system.entry.js +0 -6
- package/dist/calcite/p-0b16f5a2.entry.js +0 -6
- package/dist/calcite/p-120e25b0.entry.js +0 -6
- package/dist/calcite/p-132242dd.system.js +0 -6
- package/dist/calcite/p-164c7993.system.entry.js +0 -6
- package/dist/calcite/p-180c45dd.js +0 -6
- package/dist/calcite/p-1927311f.system.js +0 -6
- package/dist/calcite/p-195b47d8.system.entry.js +0 -6
- package/dist/calcite/p-1a801c80.system.entry.js +0 -6
- package/dist/calcite/p-1c1808a9.system.js +0 -6
- package/dist/calcite/p-21e61d1f.system.entry.js +0 -6
- package/dist/calcite/p-2204aeed.entry.js +0 -6
- package/dist/calcite/p-2292f660.entry.js +0 -6
- package/dist/calcite/p-234334e8.system.js +0 -7
- package/dist/calcite/p-240b92fc.system.entry.js +0 -6
- package/dist/calcite/p-244e6a16.system.js +0 -6
- package/dist/calcite/p-24fc537c.entry.js +0 -6
- package/dist/calcite/p-25d9815f.entry.js +0 -6
- package/dist/calcite/p-2942f335.entry.js +0 -6
- package/dist/calcite/p-296b72ab.entry.js +0 -6
- package/dist/calcite/p-2a6d83f2.system.entry.js +0 -6
- package/dist/calcite/p-2bb5628e.system.entry.js +0 -6
- package/dist/calcite/p-2dc6b889.js +0 -6
- package/dist/calcite/p-33e2cc83.entry.js +0 -6
- package/dist/calcite/p-35df3a74.entry.js +0 -6
- package/dist/calcite/p-390ae661.entry.js +0 -6
- package/dist/calcite/p-3ba3650d.entry.js +0 -6
- package/dist/calcite/p-3c899e58.entry.js +0 -6
- package/dist/calcite/p-3d0903d1.entry.js +0 -6
- package/dist/calcite/p-3d277c10.entry.js +0 -6
- package/dist/calcite/p-3fe14113.entry.js +0 -6
- package/dist/calcite/p-421fa896.entry.js +0 -6
- package/dist/calcite/p-438e56fd.entry.js +0 -6
- package/dist/calcite/p-43f9bb67.system.js +0 -6
- package/dist/calcite/p-4450a62e.system.entry.js +0 -6
- package/dist/calcite/p-4591d14e.entry.js +0 -6
- package/dist/calcite/p-47537b0f.system.entry.js +0 -6
- package/dist/calcite/p-4776fee2.entry.js +0 -6
- package/dist/calcite/p-4a3dcaab.entry.js +0 -6
- package/dist/calcite/p-4b4c47b4.system.js +0 -6
- package/dist/calcite/p-4bd4b21b.system.js +0 -12
- package/dist/calcite/p-4d9e93ae.system.js +0 -6
- package/dist/calcite/p-50148e92.system.entry.js +0 -6
- package/dist/calcite/p-524ac193.system.js +0 -6
- package/dist/calcite/p-54dc5c4f.system.entry.js +0 -6
- package/dist/calcite/p-55051fef.js +0 -6
- package/dist/calcite/p-576b3dfd.entry.js +0 -6
- package/dist/calcite/p-57c051cd.system.entry.js +0 -6
- package/dist/calcite/p-580abaa0.system.entry.js +0 -6
- package/dist/calcite/p-59e4f11d.entry.js +0 -6
- package/dist/calcite/p-5b7d6465.system.js +0 -6
- package/dist/calcite/p-5ee0d6fc.entry.js +0 -6
- package/dist/calcite/p-5ff62aa9.system.entry.js +0 -6
- package/dist/calcite/p-61508652.system.js +0 -6
- package/dist/calcite/p-619ea68d.system.entry.js +0 -6
- package/dist/calcite/p-638c0f83.system.js +0 -6
- package/dist/calcite/p-63be4875.js +0 -7
- package/dist/calcite/p-661983f6.system.js +0 -6
- package/dist/calcite/p-66a8d6f6.entry.js +0 -6
- package/dist/calcite/p-67a854c0.entry.js +0 -6
- package/dist/calcite/p-680d6cf6.entry.js +0 -6
- package/dist/calcite/p-6941ffe8.entry.js +0 -6
- package/dist/calcite/p-6ad53382.system.entry.js +0 -6
- package/dist/calcite/p-6c421b57.entry.js +0 -6
- package/dist/calcite/p-6ca84ba8.entry.js +0 -6
- package/dist/calcite/p-6d884dae.entry.js +0 -6
- package/dist/calcite/p-6e8a4081.system.entry.js +0 -6
- package/dist/calcite/p-70c06ad4.system.entry.js +0 -6
- package/dist/calcite/p-71650d4e.system.entry.js +0 -6
- package/dist/calcite/p-74b0148d.system.js +0 -6
- package/dist/calcite/p-75cb1d5b.system.entry.js +0 -6
- package/dist/calcite/p-75f64c6d.entry.js +0 -6
- package/dist/calcite/p-7c550d9b.entry.js +0 -6
- package/dist/calcite/p-7ed2f59f.system.entry.js +0 -6
- package/dist/calcite/p-85c6e58a.system.entry.js +0 -6
- package/dist/calcite/p-89a7e6bc.entry.js +0 -6
- package/dist/calcite/p-8c66c36c.system.js +0 -6
- package/dist/calcite/p-8c95d7a0.entry.js +0 -6
- package/dist/calcite/p-8e41d2bb.system.js +0 -6
- package/dist/calcite/p-8ee1498f.entry.js +0 -6
- package/dist/calcite/p-92038736.system.entry.js +0 -6
- package/dist/calcite/p-9241c6a5.entry.js +0 -6
- package/dist/calcite/p-93970959.system.entry.js +0 -6
- package/dist/calcite/p-960c76e9.system.entry.js +0 -6
- package/dist/calcite/p-96236e5c.entry.js +0 -6
- package/dist/calcite/p-9a9fbf22.entry.js +0 -6
- package/dist/calcite/p-9ae4b555.entry.js +0 -6
- package/dist/calcite/p-9aebe377.entry.js +0 -6
- package/dist/calcite/p-9b43c40c.system.js +0 -6
- package/dist/calcite/p-9ca4f290.system.js +0 -6
- package/dist/calcite/p-9dccf007.js +0 -6
- package/dist/calcite/p-9ef7904e.js +0 -6
- package/dist/calcite/p-a304a6b7.system.entry.js +0 -6
- package/dist/calcite/p-a4cff117.system.js +0 -6
- package/dist/calcite/p-a726bcff.entry.js +0 -6
- package/dist/calcite/p-a9221536.system.js +0 -6
- package/dist/calcite/p-aa6d9dcc.system.entry.js +0 -6
- package/dist/calcite/p-ab4d0b8e.entry.js +0 -6
- package/dist/calcite/p-abdc8c60.system.entry.js +0 -6
- package/dist/calcite/p-abf5fb38.entry.js +0 -6
- package/dist/calcite/p-ad22f173.entry.js +0 -6
- package/dist/calcite/p-ad68bd9e.system.entry.js +0 -6
- package/dist/calcite/p-ad884bc4.system.js +0 -6
- package/dist/calcite/p-ae2518f0.system.js +0 -6
- package/dist/calcite/p-aef54c5f.system.entry.js +0 -6
- package/dist/calcite/p-b084a958.entry.js +0 -6
- package/dist/calcite/p-b10ce7f4.system.entry.js +0 -6
- package/dist/calcite/p-b1859703.system.entry.js +0 -6
- package/dist/calcite/p-b29859b5.system.entry.js +0 -6
- package/dist/calcite/p-b3004fac.entry.js +0 -6
- package/dist/calcite/p-b51eb86c.system.entry.js +0 -6
- package/dist/calcite/p-b5ef1019.entry.js +0 -6
- package/dist/calcite/p-b6f004c4.entry.js +0 -6
- package/dist/calcite/p-b7941592.js +0 -6
- package/dist/calcite/p-b795148e.entry.js +0 -6
- package/dist/calcite/p-b9fb0207.system.js +0 -6
- package/dist/calcite/p-bb36ddb1.system.entry.js +0 -6
- package/dist/calcite/p-bbc5fa4d.system.entry.js +0 -6
- package/dist/calcite/p-bf0d4fa9.system.entry.js +0 -6
- package/dist/calcite/p-c18b2f37.system.entry.js +0 -6
- package/dist/calcite/p-c20b0a94.system.entry.js +0 -6
- package/dist/calcite/p-c311d80b.entry.js +0 -6
- package/dist/calcite/p-c3380c86.system.entry.js +0 -6
- package/dist/calcite/p-c370487d.entry.js +0 -6
- package/dist/calcite/p-c3a76a69.js +0 -6
- package/dist/calcite/p-c75e4948.system.entry.js +0 -6
- package/dist/calcite/p-c9179809.entry.js +0 -6
- package/dist/calcite/p-ca72c4da.system.entry.js +0 -6
- package/dist/calcite/p-cd3d8542.system.js +0 -6
- package/dist/calcite/p-ce6b62ad.entry.js +0 -6
- package/dist/calcite/p-d1131b5d.system.entry.js +0 -6
- package/dist/calcite/p-d18b3ee8.entry.js +0 -6
- package/dist/calcite/p-d30e6a15.system.entry.js +0 -6
- package/dist/calcite/p-d6627d94.system.entry.js +0 -6
- package/dist/calcite/p-d686deea.system.entry.js +0 -6
- package/dist/calcite/p-dc294613.system.js +0 -6
- package/dist/calcite/p-dc346223.system.js +0 -6
- package/dist/calcite/p-dcb7c0a5.system.entry.js +0 -6
- package/dist/calcite/p-e0ecae58.system.entry.js +0 -6
- package/dist/calcite/p-e1799b74.system.js +0 -6
- package/dist/calcite/p-e1e4265f.system.js +0 -6
- package/dist/calcite/p-e30b9b3a.entry.js +0 -6
- package/dist/calcite/p-e836bdbf.system.entry.js +0 -6
- package/dist/calcite/p-e8c8a9c4.js +0 -6
- package/dist/calcite/p-eb000d01.system.entry.js +0 -6
- package/dist/calcite/p-ec32dce1.entry.js +0 -6
- package/dist/calcite/p-ed965a88.entry.js +0 -6
- package/dist/calcite/p-eddb3738.entry.js +0 -6
- package/dist/calcite/p-f22e79c7.entry.js +0 -6
- package/dist/calcite/p-f69aa7a0.system.entry.js +0 -6
- package/dist/calcite/p-f6a26297.system.entry.js +0 -6
- package/dist/calcite/p-fbb251a6.system.entry.js +0 -6
- package/dist/calcite/p-fc374bdb.system.entry.js +0 -6
- package/dist/calcite/p-fd76be2a.system.entry.js +0 -6
- package/dist/calcite/p-ff26531e.system.entry.js +0 -6
- package/dist/cjs/globalAttributes-2783566c.js +0 -335
- package/dist/cjs/observers-82a85a0c.js +0 -27
- package/dist/components/globalAttributes.js +0 -324
- package/dist/custom-elements/index.d.ts +0 -597
- package/dist/custom-elements/index.js +0 -28881
- package/dist/esm/globalAttributes-9a3874c6.js +0 -324
- package/dist/esm/observers-251355d3.js +0 -25
- package/dist/esm-es5/ExpandToggle-51cda39f.js +0 -6
- package/dist/esm-es5/Heading-3a6ae137.js +0 -6
- package/dist/esm-es5/app-globals-8ea1c0e3.js +0 -6
- package/dist/esm-es5/array-2db27e14.js +0 -6
- package/dist/esm-es5/calcite-accordion_2.entry.js +0 -6
- package/dist/esm-es5/calcite-action-bar.entry.js +0 -6
- package/dist/esm-es5/calcite-action-group.entry.js +0 -6
- package/dist/esm-es5/calcite-action-menu.entry.js +0 -6
- package/dist/esm-es5/calcite-action-pad.entry.js +0 -6
- package/dist/esm-es5/calcite-action.entry.js +0 -6
- package/dist/esm-es5/calcite-alert.entry.js +0 -6
- package/dist/esm-es5/calcite-avatar.entry.js +0 -6
- package/dist/esm-es5/calcite-block_2.entry.js +0 -6
- package/dist/esm-es5/calcite-button.entry.js +0 -6
- package/dist/esm-es5/calcite-card.entry.js +0 -6
- package/dist/esm-es5/calcite-checkbox.entry.js +0 -6
- package/dist/esm-es5/calcite-chip.entry.js +0 -6
- package/dist/esm-es5/calcite-color-picker_3.entry.js +0 -6
- package/dist/esm-es5/calcite-combobox_3.entry.js +0 -6
- package/dist/esm-es5/calcite-date-picker_4.entry.js +0 -6
- package/dist/esm-es5/calcite-dropdown_3.entry.js +0 -6
- package/dist/esm-es5/calcite-fab.entry.js +0 -6
- package/dist/esm-es5/calcite-filter.entry.js +0 -6
- package/dist/esm-es5/calcite-flow-item.entry.js +0 -6
- package/dist/esm-es5/calcite-flow.entry.js +0 -6
- package/dist/esm-es5/calcite-graph_2.entry.js +0 -6
- package/dist/esm-es5/calcite-handle.entry.js +0 -6
- package/dist/esm-es5/calcite-icon.entry.js +0 -6
- package/dist/esm-es5/calcite-inline-editable.entry.js +0 -6
- package/dist/esm-es5/calcite-input-date-picker.entry.js +0 -6
- package/dist/esm-es5/calcite-input-message.entry.js +0 -6
- package/dist/esm-es5/calcite-input-number.entry.js +0 -6
- package/dist/esm-es5/calcite-input-text.entry.js +0 -6
- package/dist/esm-es5/calcite-input-time-picker_2.entry.js +0 -6
- package/dist/esm-es5/calcite-input.entry.js +0 -6
- package/dist/esm-es5/calcite-label.entry.js +0 -6
- package/dist/esm-es5/calcite-link.entry.js +0 -6
- package/dist/esm-es5/calcite-list_3.entry.js +0 -6
- package/dist/esm-es5/calcite-loader.entry.js +0 -6
- package/dist/esm-es5/calcite-modal.entry.js +0 -6
- package/dist/esm-es5/calcite-notice.entry.js +0 -6
- package/dist/esm-es5/calcite-option_3.entry.js +0 -6
- package/dist/esm-es5/calcite-pagination.entry.js +0 -6
- package/dist/esm-es5/calcite-panel.entry.js +0 -6
- package/dist/esm-es5/calcite-pick-list_3.entry.js +0 -6
- package/dist/esm-es5/calcite-popover_2.entry.js +0 -6
- package/dist/esm-es5/calcite-progress.entry.js +0 -6
- package/dist/esm-es5/calcite-radio-button-group.entry.js +0 -6
- package/dist/esm-es5/calcite-radio-button.entry.js +0 -6
- package/dist/esm-es5/calcite-radio-group_2.entry.js +0 -6
- package/dist/esm-es5/calcite-rating.entry.js +0 -6
- package/dist/esm-es5/calcite-scrim.entry.js +0 -6
- package/dist/esm-es5/calcite-shell_3.entry.js +0 -6
- package/dist/esm-es5/calcite-sortable-list.entry.js +0 -6
- package/dist/esm-es5/calcite-split-button.entry.js +0 -6
- package/dist/esm-es5/calcite-stepper_2.entry.js +0 -6
- package/dist/esm-es5/calcite-switch.entry.js +0 -6
- package/dist/esm-es5/calcite-tab_4.entry.js +0 -6
- package/dist/esm-es5/calcite-tile-select_2.entry.js +0 -6
- package/dist/esm-es5/calcite-tile.entry.js +0 -6
- package/dist/esm-es5/calcite-tip_3.entry.js +0 -6
- package/dist/esm-es5/calcite-tooltip_2.entry.js +0 -6
- package/dist/esm-es5/calcite-tree_2.entry.js +0 -6
- package/dist/esm-es5/calcite-value-list_2.entry.js +0 -6
- package/dist/esm-es5/calcite.js +0 -6
- package/dist/esm-es5/conditionalSlot-a8df5b3f.js +0 -6
- package/dist/esm-es5/debounce-d31cc476.js +0 -6
- package/dist/esm-es5/dom-24af003b.js +0 -6
- package/dist/esm-es5/filter-72316b3f.js +0 -6
- package/dist/esm-es5/floating-ui-10f8689c.js +0 -6
- package/dist/esm-es5/form-390fdf0f.js +0 -6
- package/dist/esm-es5/globalAttributes-9a3874c6.js +0 -6
- package/dist/esm-es5/guid-b68b1941.js +0 -6
- package/dist/esm-es5/index-8384b5ec.js +0 -7
- package/dist/esm-es5/interactive-f2ec7825.js +0 -6
- package/dist/esm-es5/interfaces-ba98f966.js +0 -6
- package/dist/esm-es5/key-ed874b7d.js +0 -6
- package/dist/esm-es5/label-78f72c1a.js +0 -6
- package/dist/esm-es5/loader.js +0 -6
- package/dist/esm-es5/math-2893cee3.js +0 -6
- package/dist/esm-es5/observers-251355d3.js +0 -6
- package/dist/esm-es5/openCloseComponent-0a4c6226.js +0 -6
- package/dist/esm-es5/resources-0497ae87.js +0 -6
- package/dist/esm-es5/resources-32c242fa.js +0 -6
- package/dist/esm-es5/resources-351f6f14.js +0 -6
- package/dist/esm-es5/resources-3acd3089.js +0 -6
- package/dist/esm-es5/resources-ea0a60b4.js +0 -6
- package/dist/esm-es5/resources-f8aa3ed1.js +0 -6
- package/dist/esm-es5/sortable.esm-3d78dbdc.js +0 -12
- package/dist/esm-es5/utils-a7e4e0e1.js +0 -6
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
* See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
|
|
4
|
-
* v1.0.0-beta.
|
|
4
|
+
* v1.0.0-beta.97
|
|
5
5
|
*/
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
@@ -27,79 +27,22 @@ function _interopNamespace(e) {
|
|
|
27
27
|
|
|
28
28
|
const NAMESPACE = 'calcite';
|
|
29
29
|
|
|
30
|
+
/**
|
|
31
|
+
* Virtual DOM patching algorithm based on Snabbdom by
|
|
32
|
+
* Simon Friis Vindum (@paldepind)
|
|
33
|
+
* Licensed under the MIT License
|
|
34
|
+
* https://github.com/snabbdom/snabbdom/blob/master/LICENSE
|
|
35
|
+
*
|
|
36
|
+
* Modified for Stencil's renderer and slot projection
|
|
37
|
+
*/
|
|
30
38
|
let scopeId;
|
|
31
39
|
let hostTagName;
|
|
32
40
|
let isSvgMode = false;
|
|
33
41
|
let queuePending = false;
|
|
34
|
-
const
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
$flags$: 0,
|
|
38
|
-
$resourcesUrl$: '',
|
|
39
|
-
jmp: (h) => h(),
|
|
40
|
-
raf: (h) => requestAnimationFrame(h),
|
|
41
|
-
ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
|
|
42
|
-
rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
|
|
43
|
-
ce: (eventName, opts) => new CustomEvent(eventName, opts),
|
|
44
|
-
};
|
|
45
|
-
const supportsShadow = true;
|
|
46
|
-
const promiseResolve = (v) => Promise.resolve(v);
|
|
47
|
-
const supportsConstructableStylesheets = /*@__PURE__*/ (() => {
|
|
48
|
-
try {
|
|
49
|
-
new CSSStyleSheet();
|
|
50
|
-
return typeof new CSSStyleSheet().replaceSync === 'function';
|
|
51
|
-
}
|
|
52
|
-
catch (e) { }
|
|
53
|
-
return false;
|
|
54
|
-
})()
|
|
55
|
-
;
|
|
56
|
-
const addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
|
|
57
|
-
if (listeners) {
|
|
58
|
-
listeners.map(([flags, name, method]) => {
|
|
59
|
-
const target = getHostListenerTarget(elm, flags) ;
|
|
60
|
-
const handler = hostListenerProxy(hostRef, method);
|
|
61
|
-
const opts = hostListenerOpts(flags);
|
|
62
|
-
plt.ael(target, name, handler, opts);
|
|
63
|
-
(hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
const hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
68
|
-
try {
|
|
69
|
-
{
|
|
70
|
-
if (hostRef.$flags$ & 256 /* isListenReady */) {
|
|
71
|
-
// instance is ready, let's call it's member method for this event
|
|
72
|
-
hostRef.$lazyInstance$[methodName](ev);
|
|
73
|
-
}
|
|
74
|
-
else {
|
|
75
|
-
(hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
catch (e) {
|
|
80
|
-
consoleError(e);
|
|
81
|
-
}
|
|
82
|
-
};
|
|
83
|
-
const getHostListenerTarget = (elm, flags) => {
|
|
84
|
-
if (flags & 4 /* TargetDocument */)
|
|
85
|
-
return doc;
|
|
86
|
-
if (flags & 8 /* TargetWindow */)
|
|
87
|
-
return win;
|
|
88
|
-
if (flags & 16 /* TargetBody */)
|
|
89
|
-
return doc.body;
|
|
90
|
-
return elm;
|
|
42
|
+
const getAssetPath = (path) => {
|
|
43
|
+
const assetUrl = new URL(path, plt.$resourcesUrl$);
|
|
44
|
+
return assetUrl.origin !== win.location.origin ? assetUrl.href : assetUrl.pathname;
|
|
91
45
|
};
|
|
92
|
-
// prettier-ignore
|
|
93
|
-
const hostListenerOpts = (flags) => (flags & 2 /* Capture */) !== 0;
|
|
94
|
-
const CONTENT_REF_ID = 'r';
|
|
95
|
-
const ORG_LOCATION_ID = 'o';
|
|
96
|
-
const SLOT_NODE_ID = 's';
|
|
97
|
-
const TEXT_NODE_ID = 't';
|
|
98
|
-
const HYDRATE_ID = 's-id';
|
|
99
|
-
const HYDRATED_STYLE_ID = 'sty-id';
|
|
100
|
-
const HYDRATE_CHILD_ID = 'c-id';
|
|
101
|
-
const HYDRATED_CSS = '{visibility:hidden}[calcite-hydrated]{visibility:inherit}';
|
|
102
|
-
const XLINK_NS = 'http://www.w3.org/1999/xlink';
|
|
103
46
|
const createTime = (fnName, tagName = '') => {
|
|
104
47
|
{
|
|
105
48
|
return () => {
|
|
@@ -114,82 +57,15 @@ const uniqueTime = (key, measureText) => {
|
|
|
114
57
|
};
|
|
115
58
|
}
|
|
116
59
|
};
|
|
117
|
-
const
|
|
118
|
-
const
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
style.replaceSync(cssText);
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
else {
|
|
130
|
-
style = cssText;
|
|
131
|
-
}
|
|
132
|
-
styles.set(scopeId, style);
|
|
133
|
-
};
|
|
134
|
-
const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
|
|
135
|
-
let scopeId = getScopeId(cmpMeta);
|
|
136
|
-
const style = styles.get(scopeId);
|
|
137
|
-
// if an element is NOT connected then getRootNode() will return the wrong root node
|
|
138
|
-
// so the fallback is to always use the document for the root node in those cases
|
|
139
|
-
styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc;
|
|
140
|
-
if (style) {
|
|
141
|
-
if (typeof style === 'string') {
|
|
142
|
-
styleContainerNode = styleContainerNode.head || styleContainerNode;
|
|
143
|
-
let appliedStyles = rootAppliedStyles.get(styleContainerNode);
|
|
144
|
-
let styleElm;
|
|
145
|
-
if (!appliedStyles) {
|
|
146
|
-
rootAppliedStyles.set(styleContainerNode, (appliedStyles = new Set()));
|
|
147
|
-
}
|
|
148
|
-
if (!appliedStyles.has(scopeId)) {
|
|
149
|
-
if (styleContainerNode.host &&
|
|
150
|
-
(styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId}"]`))) {
|
|
151
|
-
// This is only happening on native shadow-dom, do not needs CSS var shim
|
|
152
|
-
styleElm.innerHTML = style;
|
|
153
|
-
}
|
|
154
|
-
else {
|
|
155
|
-
{
|
|
156
|
-
styleElm = doc.createElement('style');
|
|
157
|
-
styleElm.innerHTML = style;
|
|
158
|
-
}
|
|
159
|
-
styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
|
|
160
|
-
}
|
|
161
|
-
if (appliedStyles) {
|
|
162
|
-
appliedStyles.add(scopeId);
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
|
|
167
|
-
styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
return scopeId;
|
|
171
|
-
};
|
|
172
|
-
const attachStyles = (hostRef) => {
|
|
173
|
-
const cmpMeta = hostRef.$cmpMeta$;
|
|
174
|
-
const elm = hostRef.$hostElement$;
|
|
175
|
-
const flags = cmpMeta.$flags$;
|
|
176
|
-
const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
|
|
177
|
-
const scopeId = addStyle(elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta);
|
|
178
|
-
if (flags & 10 /* needsScopedEncapsulation */) {
|
|
179
|
-
// only required when we're NOT using native shadow dom (slot)
|
|
180
|
-
// or this browser doesn't support native shadow dom
|
|
181
|
-
// and this host element was NOT created with SSR
|
|
182
|
-
// let's pick out the inner content for slot projection
|
|
183
|
-
// create a node to represent where the original
|
|
184
|
-
// content was first placed, which is useful later on
|
|
185
|
-
// DOM WRITE!!
|
|
186
|
-
elm['s-sc'] = scopeId;
|
|
187
|
-
elm.classList.add(scopeId + '-h');
|
|
188
|
-
}
|
|
189
|
-
endAttachStyles();
|
|
190
|
-
};
|
|
191
|
-
const getScopeId = (cmp, mode) => 'sc-' + (cmp.$tagName$);
|
|
192
|
-
const convertScopedToShadow = (css) => css.replace(/\/\*!@([^\/]+)\*\/[^\{]+\{/g, '$1{');
|
|
60
|
+
const CONTENT_REF_ID = 'r';
|
|
61
|
+
const ORG_LOCATION_ID = 'o';
|
|
62
|
+
const SLOT_NODE_ID = 's';
|
|
63
|
+
const TEXT_NODE_ID = 't';
|
|
64
|
+
const HYDRATE_ID = 's-id';
|
|
65
|
+
const HYDRATED_STYLE_ID = 'sty-id';
|
|
66
|
+
const HYDRATE_CHILD_ID = 'c-id';
|
|
67
|
+
const HYDRATED_CSS = '{visibility:hidden}[calcite-hydrated]{visibility:inherit}';
|
|
68
|
+
const XLINK_NS = 'http://www.w3.org/1999/xlink';
|
|
193
69
|
/**
|
|
194
70
|
* Default style mode id
|
|
195
71
|
*/
|
|
@@ -328,433 +204,253 @@ const convertToPrivate = (node) => {
|
|
|
328
204
|
vnode.$name$ = node.vname;
|
|
329
205
|
return vnode;
|
|
330
206
|
};
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
else if (memberName === 'style') {
|
|
351
|
-
// update style attribute, css properties and values
|
|
352
|
-
{
|
|
353
|
-
for (const prop in oldValue) {
|
|
354
|
-
if (!newValue || newValue[prop] == null) {
|
|
355
|
-
if (prop.includes('-')) {
|
|
356
|
-
elm.style.removeProperty(prop);
|
|
357
|
-
}
|
|
358
|
-
else {
|
|
359
|
-
elm.style[prop] = '';
|
|
360
|
-
}
|
|
361
|
-
}
|
|
362
|
-
}
|
|
363
|
-
}
|
|
364
|
-
for (const prop in newValue) {
|
|
365
|
-
if (!oldValue || newValue[prop] !== oldValue[prop]) {
|
|
366
|
-
if (prop.includes('-')) {
|
|
367
|
-
elm.style.setProperty(prop, newValue[prop]);
|
|
368
|
-
}
|
|
369
|
-
else {
|
|
370
|
-
elm.style[prop] = newValue[prop];
|
|
371
|
-
}
|
|
372
|
-
}
|
|
373
|
-
}
|
|
207
|
+
const initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
208
|
+
const endHydrate = createTime('hydrateClient', tagName);
|
|
209
|
+
const shadowRoot = hostElm.shadowRoot;
|
|
210
|
+
const childRenderNodes = [];
|
|
211
|
+
const slotNodes = [];
|
|
212
|
+
const shadowRootNodes = shadowRoot ? [] : null;
|
|
213
|
+
const vnode = (hostRef.$vnode$ = newVNode(tagName, null));
|
|
214
|
+
if (!plt.$orgLocNodes$) {
|
|
215
|
+
initializeDocumentHydrate(doc.body, (plt.$orgLocNodes$ = new Map()));
|
|
216
|
+
}
|
|
217
|
+
hostElm[HYDRATE_ID] = hostId;
|
|
218
|
+
hostElm.removeAttribute(HYDRATE_ID);
|
|
219
|
+
clientHydrate(vnode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, hostElm, hostId);
|
|
220
|
+
childRenderNodes.map((c) => {
|
|
221
|
+
const orgLocationId = c.$hostId$ + '.' + c.$nodeId$;
|
|
222
|
+
const orgLocationNode = plt.$orgLocNodes$.get(orgLocationId);
|
|
223
|
+
const node = c.$elm$;
|
|
224
|
+
if (orgLocationNode && supportsShadow && orgLocationNode['s-en'] === '') {
|
|
225
|
+
orgLocationNode.parentNode.insertBefore(node, orgLocationNode.nextSibling);
|
|
374
226
|
}
|
|
375
|
-
|
|
376
|
-
;
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
newValue(elm);
|
|
227
|
+
if (!shadowRoot) {
|
|
228
|
+
node['s-hn'] = tagName;
|
|
229
|
+
if (orgLocationNode) {
|
|
230
|
+
node['s-ol'] = orgLocationNode;
|
|
231
|
+
node['s-ol']['s-nr'] = node;
|
|
381
232
|
}
|
|
382
233
|
}
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
// then we're assuming it's an event listener
|
|
390
|
-
if (memberName[2] === '-') {
|
|
391
|
-
// on- prefixed events
|
|
392
|
-
// allows to be explicit about the dom event to listen without any magic
|
|
393
|
-
// under the hood:
|
|
394
|
-
// <my-cmp on-click> // listens for "click"
|
|
395
|
-
// <my-cmp on-Click> // listens for "Click"
|
|
396
|
-
// <my-cmp on-ionChange> // listens for "ionChange"
|
|
397
|
-
// <my-cmp on-EVENTS> // listens for "EVENTS"
|
|
398
|
-
memberName = memberName.slice(3);
|
|
399
|
-
}
|
|
400
|
-
else if (isMemberInElement(win, ln)) {
|
|
401
|
-
// standard event
|
|
402
|
-
// the JSX attribute could have been "onMouseOver" and the
|
|
403
|
-
// member name "onmouseover" is on the window's prototype
|
|
404
|
-
// so let's add the listener "mouseover", which is all lowercased
|
|
405
|
-
memberName = ln.slice(2);
|
|
234
|
+
plt.$orgLocNodes$.delete(orgLocationId);
|
|
235
|
+
});
|
|
236
|
+
if (shadowRoot) {
|
|
237
|
+
shadowRootNodes.map((shadowRootNode) => {
|
|
238
|
+
if (shadowRootNode) {
|
|
239
|
+
shadowRoot.appendChild(shadowRootNode);
|
|
406
240
|
}
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
endHydrate();
|
|
244
|
+
};
|
|
245
|
+
const clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node, hostId) => {
|
|
246
|
+
let childNodeType;
|
|
247
|
+
let childIdSplt;
|
|
248
|
+
let childVNode;
|
|
249
|
+
let i;
|
|
250
|
+
if (node.nodeType === 1 /* NODE_TYPE.ElementNode */) {
|
|
251
|
+
childNodeType = node.getAttribute(HYDRATE_CHILD_ID);
|
|
252
|
+
if (childNodeType) {
|
|
253
|
+
// got the node data from the element's attribute
|
|
254
|
+
// `${hostId}.${nodeId}.${depth}.${index}`
|
|
255
|
+
childIdSplt = childNodeType.split('.');
|
|
256
|
+
if (childIdSplt[0] === hostId || childIdSplt[0] === '0') {
|
|
257
|
+
childVNode = {
|
|
258
|
+
$flags$: 0,
|
|
259
|
+
$hostId$: childIdSplt[0],
|
|
260
|
+
$nodeId$: childIdSplt[1],
|
|
261
|
+
$depth$: childIdSplt[2],
|
|
262
|
+
$index$: childIdSplt[3],
|
|
263
|
+
$tag$: node.tagName.toLowerCase(),
|
|
264
|
+
$elm$: node,
|
|
265
|
+
$attrs$: null,
|
|
266
|
+
$children$: null,
|
|
267
|
+
$key$: null,
|
|
268
|
+
$name$: null,
|
|
269
|
+
$text$: null,
|
|
270
|
+
};
|
|
271
|
+
childRenderNodes.push(childVNode);
|
|
272
|
+
node.removeAttribute(HYDRATE_CHILD_ID);
|
|
273
|
+
// this is a new child vnode
|
|
274
|
+
// so ensure its parent vnode has the vchildren array
|
|
275
|
+
if (!parentVNode.$children$) {
|
|
276
|
+
parentVNode.$children$ = [];
|
|
277
|
+
}
|
|
278
|
+
// add our child vnode to a specific index of the vnode's children
|
|
279
|
+
parentVNode.$children$[childVNode.$index$] = childVNode;
|
|
280
|
+
// this is now the new parent vnode for all the next child checks
|
|
281
|
+
parentVNode = childVNode;
|
|
282
|
+
if (shadowRootNodes && childVNode.$depth$ === '0') {
|
|
283
|
+
shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
|
|
284
|
+
}
|
|
417
285
|
}
|
|
418
|
-
|
|
419
|
-
|
|
286
|
+
}
|
|
287
|
+
// recursively drill down, end to start so we can remove nodes
|
|
288
|
+
for (i = node.childNodes.length - 1; i >= 0; i--) {
|
|
289
|
+
clientHydrate(parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node.childNodes[i], hostId);
|
|
290
|
+
}
|
|
291
|
+
if (node.shadowRoot) {
|
|
292
|
+
// keep drilling down through the shadow root nodes
|
|
293
|
+
for (i = node.shadowRoot.childNodes.length - 1; i >= 0; i--) {
|
|
294
|
+
clientHydrate(parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node.shadowRoot.childNodes[i], hostId);
|
|
420
295
|
}
|
|
421
296
|
}
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
297
|
+
}
|
|
298
|
+
else if (node.nodeType === 8 /* NODE_TYPE.CommentNode */) {
|
|
299
|
+
// `${COMMENT_TYPE}.${hostId}.${nodeId}.${depth}.${index}`
|
|
300
|
+
childIdSplt = node.nodeValue.split('.');
|
|
301
|
+
if (childIdSplt[1] === hostId || childIdSplt[1] === '0') {
|
|
302
|
+
// comment node for either the host id or a 0 host id
|
|
303
|
+
childNodeType = childIdSplt[0];
|
|
304
|
+
childVNode = {
|
|
305
|
+
$flags$: 0,
|
|
306
|
+
$hostId$: childIdSplt[1],
|
|
307
|
+
$nodeId$: childIdSplt[2],
|
|
308
|
+
$depth$: childIdSplt[3],
|
|
309
|
+
$index$: childIdSplt[4],
|
|
310
|
+
$elm$: node,
|
|
311
|
+
$attrs$: null,
|
|
312
|
+
$children$: null,
|
|
313
|
+
$key$: null,
|
|
314
|
+
$name$: null,
|
|
315
|
+
$tag$: null,
|
|
316
|
+
$text$: null,
|
|
317
|
+
};
|
|
318
|
+
if (childNodeType === TEXT_NODE_ID) {
|
|
319
|
+
childVNode.$elm$ = node.nextSibling;
|
|
320
|
+
if (childVNode.$elm$ && childVNode.$elm$.nodeType === 3 /* NODE_TYPE.TextNode */) {
|
|
321
|
+
childVNode.$text$ = childVNode.$elm$.textContent;
|
|
322
|
+
childRenderNodes.push(childVNode);
|
|
323
|
+
// remove the text comment since it's no longer needed
|
|
324
|
+
node.remove();
|
|
325
|
+
if (!parentVNode.$children$) {
|
|
326
|
+
parentVNode.$children$ = [];
|
|
436
327
|
}
|
|
437
|
-
|
|
438
|
-
|
|
328
|
+
parentVNode.$children$[childVNode.$index$] = childVNode;
|
|
329
|
+
if (shadowRootNodes && childVNode.$depth$ === '0') {
|
|
330
|
+
shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
|
|
439
331
|
}
|
|
440
332
|
}
|
|
441
|
-
catch (e) { }
|
|
442
|
-
}
|
|
443
|
-
/**
|
|
444
|
-
* Need to manually update attribute if:
|
|
445
|
-
* - memberName is not an attribute
|
|
446
|
-
* - if we are rendering the host element in order to reflect attribute
|
|
447
|
-
* - if it's a SVG, since properties might not work in <svg>
|
|
448
|
-
* - if the newValue is null/undefined or 'false'.
|
|
449
|
-
*/
|
|
450
|
-
let xlink = false;
|
|
451
|
-
{
|
|
452
|
-
if (ln !== (ln = ln.replace(/^xlink\:?/, ''))) {
|
|
453
|
-
memberName = ln;
|
|
454
|
-
xlink = true;
|
|
455
|
-
}
|
|
456
333
|
}
|
|
457
|
-
if (
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
334
|
+
else if (childVNode.$hostId$ === hostId) {
|
|
335
|
+
// this comment node is specifcally for this host id
|
|
336
|
+
if (childNodeType === SLOT_NODE_ID) {
|
|
337
|
+
// `${SLOT_NODE_ID}.${hostId}.${nodeId}.${depth}.${index}.${slotName}`;
|
|
338
|
+
childVNode.$tag$ = 'slot';
|
|
339
|
+
if (childIdSplt[5]) {
|
|
340
|
+
node['s-sn'] = childVNode.$name$ = childIdSplt[5];
|
|
461
341
|
}
|
|
462
342
|
else {
|
|
463
|
-
|
|
343
|
+
node['s-sn'] = '';
|
|
464
344
|
}
|
|
345
|
+
node['s-sr'] = true;
|
|
346
|
+
if (shadowRootNodes) {
|
|
347
|
+
// browser support shadowRoot and this is a shadow dom component
|
|
348
|
+
// create an actual slot element
|
|
349
|
+
childVNode.$elm$ = doc.createElement(childVNode.$tag$);
|
|
350
|
+
if (childVNode.$name$) {
|
|
351
|
+
// add the slot name attribute
|
|
352
|
+
childVNode.$elm$.setAttribute('name', childVNode.$name$);
|
|
353
|
+
}
|
|
354
|
+
// insert the new slot element before the slot comment
|
|
355
|
+
node.parentNode.insertBefore(childVNode.$elm$, node);
|
|
356
|
+
// remove the slot comment since it's not needed for shadow
|
|
357
|
+
node.remove();
|
|
358
|
+
if (childVNode.$depth$ === '0') {
|
|
359
|
+
shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
slotNodes.push(childVNode);
|
|
363
|
+
if (!parentVNode.$children$) {
|
|
364
|
+
parentVNode.$children$ = [];
|
|
365
|
+
}
|
|
366
|
+
parentVNode.$children$[childVNode.$index$] = childVNode;
|
|
465
367
|
}
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
else {
|
|
473
|
-
elm.setAttribute(memberName, newValue);
|
|
368
|
+
else if (childNodeType === CONTENT_REF_ID) {
|
|
369
|
+
// `${CONTENT_REF_ID}.${hostId}`;
|
|
370
|
+
if (shadowRootNodes) {
|
|
371
|
+
// remove the content ref comment since it's not needed for shadow
|
|
372
|
+
node.remove();
|
|
373
|
+
}
|
|
474
374
|
}
|
|
475
375
|
}
|
|
476
376
|
}
|
|
477
377
|
}
|
|
378
|
+
else if (parentVNode && parentVNode.$tag$ === 'style') {
|
|
379
|
+
const vnode = newVNode(null, node.textContent);
|
|
380
|
+
vnode.$elm$ = node;
|
|
381
|
+
vnode.$index$ = '0';
|
|
382
|
+
parentVNode.$children$ = [vnode];
|
|
383
|
+
}
|
|
478
384
|
};
|
|
479
|
-
const
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
const oldVnodeAttrs = (oldVnode && oldVnode.$attrs$) || EMPTY_OBJ;
|
|
489
|
-
const newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ;
|
|
490
|
-
{
|
|
491
|
-
// remove attributes no longer present on the vnode by setting them to undefined
|
|
492
|
-
for (memberName in oldVnodeAttrs) {
|
|
493
|
-
if (!(memberName in newVnodeAttrs)) {
|
|
494
|
-
setAccessor(elm, memberName, oldVnodeAttrs[memberName], undefined, isSvgMode, newVnode.$flags$);
|
|
385
|
+
const initializeDocumentHydrate = (node, orgLocNodes) => {
|
|
386
|
+
if (node.nodeType === 1 /* NODE_TYPE.ElementNode */) {
|
|
387
|
+
let i = 0;
|
|
388
|
+
for (; i < node.childNodes.length; i++) {
|
|
389
|
+
initializeDocumentHydrate(node.childNodes[i], orgLocNodes);
|
|
390
|
+
}
|
|
391
|
+
if (node.shadowRoot) {
|
|
392
|
+
for (i = 0; i < node.shadowRoot.childNodes.length; i++) {
|
|
393
|
+
initializeDocumentHydrate(node.shadowRoot.childNodes[i], orgLocNodes);
|
|
495
394
|
}
|
|
496
395
|
}
|
|
497
396
|
}
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
397
|
+
else if (node.nodeType === 8 /* NODE_TYPE.CommentNode */) {
|
|
398
|
+
const childIdSplt = node.nodeValue.split('.');
|
|
399
|
+
if (childIdSplt[0] === ORG_LOCATION_ID) {
|
|
400
|
+
orgLocNodes.set(childIdSplt[1] + '.' + childIdSplt[2], node);
|
|
401
|
+
node.nodeValue = '';
|
|
402
|
+
// useful to know if the original location is
|
|
403
|
+
// the root light-dom of a shadow dom component
|
|
404
|
+
node['s-en'] = childIdSplt[3];
|
|
405
|
+
}
|
|
501
406
|
}
|
|
502
407
|
};
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
408
|
+
/**
|
|
409
|
+
* Parse a new property value for a given property type.
|
|
410
|
+
*
|
|
411
|
+
* While the prop value can reasonably be expected to be of `any` type as far as TypeScript's type checker is concerned,
|
|
412
|
+
* it is not safe to assume that the string returned by evaluating `typeof propValue` matches:
|
|
413
|
+
* 1. `any`, the type given to `propValue` in the function signature
|
|
414
|
+
* 2. the type stored from `propType`.
|
|
415
|
+
*
|
|
416
|
+
* This function provides the capability to parse/coerce a property's value to potentially any other JavaScript type.
|
|
417
|
+
*
|
|
418
|
+
* Property values represented in TSX preserve their type information. In the example below, the number 0 is passed to
|
|
419
|
+
* a component. This `propValue` will preserve its type information (`typeof propValue === 'number'`). Note that is
|
|
420
|
+
* based on the type of the value being passed in, not the type declared of the class member decorated with `@Prop`.
|
|
421
|
+
* ```tsx
|
|
422
|
+
* <my-cmp prop-val={0}></my-cmp>
|
|
423
|
+
* ```
|
|
424
|
+
*
|
|
425
|
+
* HTML prop values on the other hand, will always a string
|
|
426
|
+
*
|
|
427
|
+
* @param propValue the new value to coerce to some type
|
|
428
|
+
* @param propType the type of the prop, expressed as a binary number
|
|
429
|
+
* @returns the parsed/coerced value
|
|
430
|
+
*/
|
|
431
|
+
const parsePropertyValue = (propValue, propType) => {
|
|
432
|
+
// ensure this value is of the correct prop type
|
|
433
|
+
if (propValue != null && !isComplexType(propValue)) {
|
|
434
|
+
if (propType & 4 /* MEMBER_FLAGS.Boolean */) {
|
|
435
|
+
// per the HTML spec, any string value means it is a boolean true value
|
|
436
|
+
// but we'll cheat here and say that the string "false" is the boolean false
|
|
437
|
+
return propValue === 'false' ? false : propValue === '' || !!propValue;
|
|
516
438
|
}
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
);
|
|
520
|
-
if (isSvgMode && newVNode.$tag$ === 'foreignObject') {
|
|
521
|
-
isSvgMode = false;
|
|
522
|
-
}
|
|
523
|
-
// add css classes, attrs, props, listeners, etc.
|
|
524
|
-
{
|
|
525
|
-
updateElement(null, newVNode, isSvgMode);
|
|
526
|
-
}
|
|
527
|
-
if (isDef(scopeId) && elm['s-si'] !== scopeId) {
|
|
528
|
-
// if there is a scopeId and this is the initial render
|
|
529
|
-
// then let's add the scopeId as a css class
|
|
530
|
-
elm.classList.add((elm['s-si'] = scopeId));
|
|
531
|
-
}
|
|
532
|
-
if (newVNode.$children$) {
|
|
533
|
-
for (i = 0; i < newVNode.$children$.length; ++i) {
|
|
534
|
-
// create the node
|
|
535
|
-
childNode = createElm(oldParentVNode, newVNode, i);
|
|
536
|
-
// return node could have been null
|
|
537
|
-
if (childNode) {
|
|
538
|
-
// append our new node
|
|
539
|
-
elm.appendChild(childNode);
|
|
540
|
-
}
|
|
541
|
-
}
|
|
542
|
-
}
|
|
543
|
-
{
|
|
544
|
-
if (newVNode.$tag$ === 'svg') {
|
|
545
|
-
// Only reset the SVG context when we're exiting <svg> element
|
|
546
|
-
isSvgMode = false;
|
|
547
|
-
}
|
|
548
|
-
else if (elm.tagName === 'foreignObject') {
|
|
549
|
-
// Reenter SVG context when we're exiting <foreignObject> element
|
|
550
|
-
isSvgMode = true;
|
|
551
|
-
}
|
|
552
|
-
}
|
|
553
|
-
}
|
|
554
|
-
return elm;
|
|
555
|
-
};
|
|
556
|
-
const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
|
|
557
|
-
let containerElm = (parentElm);
|
|
558
|
-
let childNode;
|
|
559
|
-
if (containerElm.shadowRoot && containerElm.tagName === hostTagName) {
|
|
560
|
-
containerElm = containerElm.shadowRoot;
|
|
561
|
-
}
|
|
562
|
-
for (; startIdx <= endIdx; ++startIdx) {
|
|
563
|
-
if (vnodes[startIdx]) {
|
|
564
|
-
childNode = createElm(null, parentVNode, startIdx);
|
|
565
|
-
if (childNode) {
|
|
566
|
-
vnodes[startIdx].$elm$ = childNode;
|
|
567
|
-
containerElm.insertBefore(childNode, before);
|
|
568
|
-
}
|
|
569
|
-
}
|
|
570
|
-
}
|
|
571
|
-
};
|
|
572
|
-
const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
|
|
573
|
-
for (; startIdx <= endIdx; ++startIdx) {
|
|
574
|
-
if ((vnode = vnodes[startIdx])) {
|
|
575
|
-
elm = vnode.$elm$;
|
|
576
|
-
callNodeRefs(vnode);
|
|
577
|
-
// remove the vnode's element from the dom
|
|
578
|
-
elm.remove();
|
|
579
|
-
}
|
|
580
|
-
}
|
|
581
|
-
};
|
|
582
|
-
const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
583
|
-
let oldStartIdx = 0;
|
|
584
|
-
let newStartIdx = 0;
|
|
585
|
-
let idxInOld = 0;
|
|
586
|
-
let i = 0;
|
|
587
|
-
let oldEndIdx = oldCh.length - 1;
|
|
588
|
-
let oldStartVnode = oldCh[0];
|
|
589
|
-
let oldEndVnode = oldCh[oldEndIdx];
|
|
590
|
-
let newEndIdx = newCh.length - 1;
|
|
591
|
-
let newStartVnode = newCh[0];
|
|
592
|
-
let newEndVnode = newCh[newEndIdx];
|
|
593
|
-
let node;
|
|
594
|
-
let elmToMove;
|
|
595
|
-
while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
|
|
596
|
-
if (oldStartVnode == null) {
|
|
597
|
-
// Vnode might have been moved left
|
|
598
|
-
oldStartVnode = oldCh[++oldStartIdx];
|
|
599
|
-
}
|
|
600
|
-
else if (oldEndVnode == null) {
|
|
601
|
-
oldEndVnode = oldCh[--oldEndIdx];
|
|
602
|
-
}
|
|
603
|
-
else if (newStartVnode == null) {
|
|
604
|
-
newStartVnode = newCh[++newStartIdx];
|
|
605
|
-
}
|
|
606
|
-
else if (newEndVnode == null) {
|
|
607
|
-
newEndVnode = newCh[--newEndIdx];
|
|
608
|
-
}
|
|
609
|
-
else if (isSameVnode(oldStartVnode, newStartVnode)) {
|
|
610
|
-
patch(oldStartVnode, newStartVnode);
|
|
611
|
-
oldStartVnode = oldCh[++oldStartIdx];
|
|
612
|
-
newStartVnode = newCh[++newStartIdx];
|
|
613
|
-
}
|
|
614
|
-
else if (isSameVnode(oldEndVnode, newEndVnode)) {
|
|
615
|
-
patch(oldEndVnode, newEndVnode);
|
|
616
|
-
oldEndVnode = oldCh[--oldEndIdx];
|
|
617
|
-
newEndVnode = newCh[--newEndIdx];
|
|
618
|
-
}
|
|
619
|
-
else if (isSameVnode(oldStartVnode, newEndVnode)) {
|
|
620
|
-
patch(oldStartVnode, newEndVnode);
|
|
621
|
-
parentElm.insertBefore(oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
|
|
622
|
-
oldStartVnode = oldCh[++oldStartIdx];
|
|
623
|
-
newEndVnode = newCh[--newEndIdx];
|
|
624
|
-
}
|
|
625
|
-
else if (isSameVnode(oldEndVnode, newStartVnode)) {
|
|
626
|
-
patch(oldEndVnode, newStartVnode);
|
|
627
|
-
parentElm.insertBefore(oldEndVnode.$elm$, oldStartVnode.$elm$);
|
|
628
|
-
oldEndVnode = oldCh[--oldEndIdx];
|
|
629
|
-
newStartVnode = newCh[++newStartIdx];
|
|
630
|
-
}
|
|
631
|
-
else {
|
|
632
|
-
// createKeyToOldIdx
|
|
633
|
-
idxInOld = -1;
|
|
634
|
-
{
|
|
635
|
-
for (i = oldStartIdx; i <= oldEndIdx; ++i) {
|
|
636
|
-
if (oldCh[i] && oldCh[i].$key$ !== null && oldCh[i].$key$ === newStartVnode.$key$) {
|
|
637
|
-
idxInOld = i;
|
|
638
|
-
break;
|
|
639
|
-
}
|
|
640
|
-
}
|
|
641
|
-
}
|
|
642
|
-
if (idxInOld >= 0) {
|
|
643
|
-
elmToMove = oldCh[idxInOld];
|
|
644
|
-
if (elmToMove.$tag$ !== newStartVnode.$tag$) {
|
|
645
|
-
node = createElm(oldCh && oldCh[newStartIdx], newVNode, idxInOld);
|
|
646
|
-
}
|
|
647
|
-
else {
|
|
648
|
-
patch(elmToMove, newStartVnode);
|
|
649
|
-
oldCh[idxInOld] = undefined;
|
|
650
|
-
node = elmToMove.$elm$;
|
|
651
|
-
}
|
|
652
|
-
newStartVnode = newCh[++newStartIdx];
|
|
653
|
-
}
|
|
654
|
-
else {
|
|
655
|
-
// new element
|
|
656
|
-
node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx);
|
|
657
|
-
newStartVnode = newCh[++newStartIdx];
|
|
658
|
-
}
|
|
659
|
-
if (node) {
|
|
660
|
-
{
|
|
661
|
-
oldStartVnode.$elm$.parentNode.insertBefore(node, oldStartVnode.$elm$);
|
|
662
|
-
}
|
|
663
|
-
}
|
|
664
|
-
}
|
|
665
|
-
}
|
|
666
|
-
if (oldStartIdx > oldEndIdx) {
|
|
667
|
-
addVnodes(parentElm, newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$, newVNode, newCh, newStartIdx, newEndIdx);
|
|
668
|
-
}
|
|
669
|
-
else if (newStartIdx > newEndIdx) {
|
|
670
|
-
removeVnodes(oldCh, oldStartIdx, oldEndIdx);
|
|
671
|
-
}
|
|
672
|
-
};
|
|
673
|
-
const isSameVnode = (vnode1, vnode2) => {
|
|
674
|
-
// compare if two vnode to see if they're "technically" the same
|
|
675
|
-
// need to have the same element tag, and same key to be the same
|
|
676
|
-
if (vnode1.$tag$ === vnode2.$tag$) {
|
|
677
|
-
{
|
|
678
|
-
return vnode1.$key$ === vnode2.$key$;
|
|
679
|
-
}
|
|
680
|
-
}
|
|
681
|
-
return false;
|
|
682
|
-
};
|
|
683
|
-
const patch = (oldVNode, newVNode) => {
|
|
684
|
-
const elm = (newVNode.$elm$ = oldVNode.$elm$);
|
|
685
|
-
const oldChildren = oldVNode.$children$;
|
|
686
|
-
const newChildren = newVNode.$children$;
|
|
687
|
-
const tag = newVNode.$tag$;
|
|
688
|
-
const text = newVNode.$text$;
|
|
689
|
-
if (text === null) {
|
|
690
|
-
{
|
|
691
|
-
// test if we're rendering an svg element, or still rendering nodes inside of one
|
|
692
|
-
// only add this to the when the compiler sees we're using an svg somewhere
|
|
693
|
-
isSvgMode = tag === 'svg' ? true : tag === 'foreignObject' ? false : isSvgMode;
|
|
694
|
-
}
|
|
695
|
-
// element node
|
|
696
|
-
{
|
|
697
|
-
if (tag === 'slot')
|
|
698
|
-
;
|
|
699
|
-
else {
|
|
700
|
-
// either this is the first render of an element OR it's an update
|
|
701
|
-
// AND we already know it's possible it could have changed
|
|
702
|
-
// this updates the element's css classes, attrs, props, listeners, etc.
|
|
703
|
-
updateElement(oldVNode, newVNode, isSvgMode);
|
|
704
|
-
}
|
|
705
|
-
}
|
|
706
|
-
if (oldChildren !== null && newChildren !== null) {
|
|
707
|
-
// looks like there's child vnodes for both the old and new vnodes
|
|
708
|
-
updateChildren(elm, oldChildren, newVNode, newChildren);
|
|
709
|
-
}
|
|
710
|
-
else if (newChildren !== null) {
|
|
711
|
-
// no old child vnodes, but there are new child vnodes to add
|
|
712
|
-
if (oldVNode.$text$ !== null) {
|
|
713
|
-
// the old vnode was text, so be sure to clear it out
|
|
714
|
-
elm.textContent = '';
|
|
715
|
-
}
|
|
716
|
-
// add the new vnode children
|
|
717
|
-
addVnodes(elm, null, newVNode, newChildren, 0, newChildren.length - 1);
|
|
718
|
-
}
|
|
719
|
-
else if (oldChildren !== null) {
|
|
720
|
-
// no new child vnodes, but there are old child vnodes to remove
|
|
721
|
-
removeVnodes(oldChildren, 0, oldChildren.length - 1);
|
|
439
|
+
if (propType & 2 /* MEMBER_FLAGS.Number */) {
|
|
440
|
+
// force it to be a number
|
|
441
|
+
return parseFloat(propValue);
|
|
722
442
|
}
|
|
723
|
-
if (
|
|
724
|
-
|
|
443
|
+
if (propType & 1 /* MEMBER_FLAGS.String */) {
|
|
444
|
+
// could have been passed as a number or boolean
|
|
445
|
+
// but we still want it as a string
|
|
446
|
+
return String(propValue);
|
|
725
447
|
}
|
|
448
|
+
// redundant return here for better minification
|
|
449
|
+
return propValue;
|
|
726
450
|
}
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
elm.data = text;
|
|
731
|
-
}
|
|
732
|
-
};
|
|
733
|
-
const callNodeRefs = (vNode) => {
|
|
734
|
-
{
|
|
735
|
-
vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
|
|
736
|
-
vNode.$children$ && vNode.$children$.map(callNodeRefs);
|
|
737
|
-
}
|
|
738
|
-
};
|
|
739
|
-
const renderVdom = (hostRef, renderFnResults) => {
|
|
740
|
-
const hostElm = hostRef.$hostElement$;
|
|
741
|
-
const cmpMeta = hostRef.$cmpMeta$;
|
|
742
|
-
const oldVNode = hostRef.$vnode$ || newVNode(null, null);
|
|
743
|
-
const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
|
|
744
|
-
hostTagName = hostElm.tagName;
|
|
745
|
-
if (cmpMeta.$attrsToReflect$) {
|
|
746
|
-
rootVnode.$attrs$ = rootVnode.$attrs$ || {};
|
|
747
|
-
cmpMeta.$attrsToReflect$.map(([propName, attribute]) => (rootVnode.$attrs$[attribute] = hostElm[propName]));
|
|
748
|
-
}
|
|
749
|
-
rootVnode.$tag$ = null;
|
|
750
|
-
rootVnode.$flags$ |= 4 /* isHost */;
|
|
751
|
-
hostRef.$vnode$ = rootVnode;
|
|
752
|
-
rootVnode.$elm$ = oldVNode.$elm$ = (hostElm.shadowRoot || hostElm );
|
|
753
|
-
{
|
|
754
|
-
scopeId = hostElm['s-sc'];
|
|
755
|
-
}
|
|
756
|
-
// synchronous patch
|
|
757
|
-
patch(oldVNode, rootVnode);
|
|
451
|
+
// not sure exactly what type we want
|
|
452
|
+
// so no need to change to a different type
|
|
453
|
+
return propValue;
|
|
758
454
|
};
|
|
759
455
|
const getElement = (ref) => (getHostRef(ref).$hostElement$ );
|
|
760
456
|
const createEvent = (ref, name, flags) => {
|
|
@@ -762,9 +458,9 @@ const createEvent = (ref, name, flags) => {
|
|
|
762
458
|
return {
|
|
763
459
|
emit: (detail) => {
|
|
764
460
|
return emitEvent(elm, name, {
|
|
765
|
-
bubbles: !!(flags & 4 /* Bubbles */),
|
|
766
|
-
composed: !!(flags & 2 /* Composed */),
|
|
767
|
-
cancelable: !!(flags & 1 /* Cancellable */),
|
|
461
|
+
bubbles: !!(flags & 4 /* EVENT_FLAGS.Bubbles */),
|
|
462
|
+
composed: !!(flags & 2 /* EVENT_FLAGS.Composed */),
|
|
463
|
+
cancelable: !!(flags & 1 /* EVENT_FLAGS.Cancellable */),
|
|
768
464
|
detail,
|
|
769
465
|
});
|
|
770
466
|
},
|
|
@@ -782,440 +478,849 @@ const emitEvent = (elm, name, opts) => {
|
|
|
782
478
|
elm.dispatchEvent(ev);
|
|
783
479
|
return ev;
|
|
784
480
|
};
|
|
785
|
-
const
|
|
786
|
-
|
|
787
|
-
|
|
481
|
+
const rootAppliedStyles = /*@__PURE__*/ new WeakMap();
|
|
482
|
+
const registerStyle = (scopeId, cssText, allowCS) => {
|
|
483
|
+
let style = styles.get(scopeId);
|
|
484
|
+
if (supportsConstructableStylesheets && allowCS) {
|
|
485
|
+
style = (style || new CSSStyleSheet());
|
|
486
|
+
if (typeof style === 'string') {
|
|
487
|
+
style = cssText;
|
|
488
|
+
}
|
|
489
|
+
else {
|
|
490
|
+
style.replaceSync(cssText);
|
|
491
|
+
}
|
|
788
492
|
}
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
{
|
|
792
|
-
hostRef.$flags$ |= 16 /* isQueuedForUpdate */;
|
|
493
|
+
else {
|
|
494
|
+
style = cssText;
|
|
793
495
|
}
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
496
|
+
styles.set(scopeId, style);
|
|
497
|
+
};
|
|
498
|
+
const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
|
|
499
|
+
let scopeId = getScopeId(cmpMeta);
|
|
500
|
+
const style = styles.get(scopeId);
|
|
501
|
+
// if an element is NOT connected then getRootNode() will return the wrong root node
|
|
502
|
+
// so the fallback is to always use the document for the root node in those cases
|
|
503
|
+
styleContainerNode = styleContainerNode.nodeType === 11 /* NODE_TYPE.DocumentFragment */ ? styleContainerNode : doc;
|
|
504
|
+
if (style) {
|
|
505
|
+
if (typeof style === 'string') {
|
|
506
|
+
styleContainerNode = styleContainerNode.head || styleContainerNode;
|
|
507
|
+
let appliedStyles = rootAppliedStyles.get(styleContainerNode);
|
|
508
|
+
let styleElm;
|
|
509
|
+
if (!appliedStyles) {
|
|
510
|
+
rootAppliedStyles.set(styleContainerNode, (appliedStyles = new Set()));
|
|
511
|
+
}
|
|
512
|
+
if (!appliedStyles.has(scopeId)) {
|
|
513
|
+
if (styleContainerNode.host &&
|
|
514
|
+
(styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId}"]`))) {
|
|
515
|
+
// This is only happening on native shadow-dom, do not needs CSS var shim
|
|
516
|
+
styleElm.innerHTML = style;
|
|
517
|
+
}
|
|
518
|
+
else {
|
|
519
|
+
{
|
|
520
|
+
styleElm = doc.createElement('style');
|
|
521
|
+
styleElm.innerHTML = style;
|
|
522
|
+
}
|
|
523
|
+
styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
|
|
524
|
+
}
|
|
525
|
+
if (appliedStyles) {
|
|
526
|
+
appliedStyles.add(scopeId);
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
|
|
531
|
+
styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
|
|
532
|
+
}
|
|
797
533
|
}
|
|
798
|
-
|
|
799
|
-
// there is no ancestor component or the ancestor component
|
|
800
|
-
// has already fired off its lifecycle update then
|
|
801
|
-
// fire off the initial update
|
|
802
|
-
const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
|
|
803
|
-
return writeTask(dispatch) ;
|
|
534
|
+
return scopeId;
|
|
804
535
|
};
|
|
805
|
-
const
|
|
806
|
-
const
|
|
807
|
-
const
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
536
|
+
const attachStyles = (hostRef) => {
|
|
537
|
+
const cmpMeta = hostRef.$cmpMeta$;
|
|
538
|
+
const elm = hostRef.$hostElement$;
|
|
539
|
+
const flags = cmpMeta.$flags$;
|
|
540
|
+
const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
|
|
541
|
+
const scopeId = addStyle(elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta);
|
|
542
|
+
if (flags & 10 /* CMP_FLAGS.needsScopedEncapsulation */) {
|
|
543
|
+
// only required when we're NOT using native shadow dom (slot)
|
|
544
|
+
// or this browser doesn't support native shadow dom
|
|
545
|
+
// and this host element was NOT created with SSR
|
|
546
|
+
// let's pick out the inner content for slot projection
|
|
547
|
+
// create a node to represent where the original
|
|
548
|
+
// content was first placed, which is useful later on
|
|
549
|
+
// DOM WRITE!!
|
|
550
|
+
elm['s-sc'] = scopeId;
|
|
551
|
+
elm.classList.add(scopeId + '-h');
|
|
552
|
+
}
|
|
553
|
+
endAttachStyles();
|
|
554
|
+
};
|
|
555
|
+
const getScopeId = (cmp, mode) => 'sc-' + (cmp.$tagName$);
|
|
556
|
+
const convertScopedToShadow = (css) => css.replace(/\/\*!@([^\/]+)\*\/[^\{]+\{/g, '$1{');
|
|
557
|
+
/**
|
|
558
|
+
* Production setAccessor() function based on Preact by
|
|
559
|
+
* Jason Miller (@developit)
|
|
560
|
+
* Licensed under the MIT License
|
|
561
|
+
* https://github.com/developit/preact/blob/master/LICENSE
|
|
562
|
+
*
|
|
563
|
+
* Modified for Stencil's compiler and vdom
|
|
564
|
+
*/
|
|
565
|
+
const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
566
|
+
if (oldValue !== newValue) {
|
|
567
|
+
let isProp = isMemberInElement(elm, memberName);
|
|
568
|
+
let ln = memberName.toLowerCase();
|
|
569
|
+
if (memberName === 'class') {
|
|
570
|
+
const classList = elm.classList;
|
|
571
|
+
const oldClasses = parseClassList(oldValue);
|
|
572
|
+
const newClasses = parseClassList(newValue);
|
|
573
|
+
classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
|
|
574
|
+
classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
|
|
575
|
+
}
|
|
576
|
+
else if (memberName === 'style') {
|
|
577
|
+
// update style attribute, css properties and values
|
|
578
|
+
{
|
|
579
|
+
for (const prop in oldValue) {
|
|
580
|
+
if (!newValue || newValue[prop] == null) {
|
|
581
|
+
if (prop.includes('-')) {
|
|
582
|
+
elm.style.removeProperty(prop);
|
|
583
|
+
}
|
|
584
|
+
else {
|
|
585
|
+
elm.style[prop] = '';
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
for (const prop in newValue) {
|
|
591
|
+
if (!oldValue || newValue[prop] !== oldValue[prop]) {
|
|
592
|
+
if (prop.includes('-')) {
|
|
593
|
+
elm.style.setProperty(prop, newValue[prop]);
|
|
594
|
+
}
|
|
595
|
+
else {
|
|
596
|
+
elm.style[prop] = newValue[prop];
|
|
597
|
+
}
|
|
598
|
+
}
|
|
815
599
|
}
|
|
816
600
|
}
|
|
817
|
-
|
|
818
|
-
|
|
601
|
+
else if (memberName === 'key')
|
|
602
|
+
;
|
|
603
|
+
else if (memberName === 'ref') {
|
|
604
|
+
// minifier will clean this up
|
|
605
|
+
if (newValue) {
|
|
606
|
+
newValue(elm);
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
else if ((!isProp ) &&
|
|
610
|
+
memberName[0] === 'o' &&
|
|
611
|
+
memberName[1] === 'n') {
|
|
612
|
+
// Event Handlers
|
|
613
|
+
// so if the member name starts with "on" and the 3rd characters is
|
|
614
|
+
// a capital letter, and it's not already a member on the element,
|
|
615
|
+
// then we're assuming it's an event listener
|
|
616
|
+
if (memberName[2] === '-') {
|
|
617
|
+
// on- prefixed events
|
|
618
|
+
// allows to be explicit about the dom event to listen without any magic
|
|
619
|
+
// under the hood:
|
|
620
|
+
// <my-cmp on-click> // listens for "click"
|
|
621
|
+
// <my-cmp on-Click> // listens for "Click"
|
|
622
|
+
// <my-cmp on-ionChange> // listens for "ionChange"
|
|
623
|
+
// <my-cmp on-EVENTS> // listens for "EVENTS"
|
|
624
|
+
memberName = memberName.slice(3);
|
|
625
|
+
}
|
|
626
|
+
else if (isMemberInElement(win, ln)) {
|
|
627
|
+
// standard event
|
|
628
|
+
// the JSX attribute could have been "onMouseOver" and the
|
|
629
|
+
// member name "onmouseover" is on the window's prototype
|
|
630
|
+
// so let's add the listener "mouseover", which is all lowercased
|
|
631
|
+
memberName = ln.slice(2);
|
|
632
|
+
}
|
|
633
|
+
else {
|
|
634
|
+
// custom event
|
|
635
|
+
// the JSX attribute could have been "onMyCustomEvent"
|
|
636
|
+
// so let's trim off the "on" prefix and lowercase the first character
|
|
637
|
+
// and add the listener "myCustomEvent"
|
|
638
|
+
// except for the first character, we keep the event name case
|
|
639
|
+
memberName = ln[2] + memberName.slice(3);
|
|
640
|
+
}
|
|
641
|
+
if (oldValue) {
|
|
642
|
+
plt.rel(elm, memberName, oldValue, false);
|
|
643
|
+
}
|
|
644
|
+
if (newValue) {
|
|
645
|
+
plt.ael(elm, memberName, newValue, false);
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
else {
|
|
649
|
+
// Set property if it exists and it's not a SVG
|
|
650
|
+
const isComplex = isComplexType(newValue);
|
|
651
|
+
if ((isProp || (isComplex && newValue !== null)) && !isSvg) {
|
|
652
|
+
try {
|
|
653
|
+
if (!elm.tagName.includes('-')) {
|
|
654
|
+
const n = newValue == null ? '' : newValue;
|
|
655
|
+
// Workaround for Safari, moving the <input> caret when re-assigning the same valued
|
|
656
|
+
if (memberName === 'list') {
|
|
657
|
+
isProp = false;
|
|
658
|
+
}
|
|
659
|
+
else if (oldValue == null || elm[memberName] != n) {
|
|
660
|
+
elm[memberName] = n;
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
else {
|
|
664
|
+
elm[memberName] = newValue;
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
catch (e) { }
|
|
668
|
+
}
|
|
669
|
+
/**
|
|
670
|
+
* Need to manually update attribute if:
|
|
671
|
+
* - memberName is not an attribute
|
|
672
|
+
* - if we are rendering the host element in order to reflect attribute
|
|
673
|
+
* - if it's a SVG, since properties might not work in <svg>
|
|
674
|
+
* - if the newValue is null/undefined or 'false'.
|
|
675
|
+
*/
|
|
676
|
+
let xlink = false;
|
|
677
|
+
{
|
|
678
|
+
if (ln !== (ln = ln.replace(/^xlink\:?/, ''))) {
|
|
679
|
+
memberName = ln;
|
|
680
|
+
xlink = true;
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
if (newValue == null || newValue === false) {
|
|
684
|
+
if (newValue !== false || elm.getAttribute(memberName) === '') {
|
|
685
|
+
if (xlink) {
|
|
686
|
+
elm.removeAttributeNS(XLINK_NS, memberName);
|
|
687
|
+
}
|
|
688
|
+
else {
|
|
689
|
+
elm.removeAttribute(memberName);
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
else if ((!isProp || flags & 4 /* VNODE_FLAGS.isHost */ || isSvg) && !isComplex) {
|
|
694
|
+
newValue = newValue === true ? '' : newValue;
|
|
695
|
+
if (xlink) {
|
|
696
|
+
elm.setAttributeNS(XLINK_NS, memberName, newValue);
|
|
697
|
+
}
|
|
698
|
+
else {
|
|
699
|
+
elm.setAttribute(memberName, newValue);
|
|
700
|
+
}
|
|
701
|
+
}
|
|
819
702
|
}
|
|
820
703
|
}
|
|
704
|
+
};
|
|
705
|
+
const parseClassListRegex = /\s/;
|
|
706
|
+
const parseClassList = (value) => (!value ? [] : value.split(parseClassListRegex));
|
|
707
|
+
const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
|
|
708
|
+
// if the element passed in is a shadow root, which is a document fragment
|
|
709
|
+
// then we want to be adding attrs/props to the shadow root's "host" element
|
|
710
|
+
// if it's not a shadow root, then we add attrs/props to the same element
|
|
711
|
+
const elm = newVnode.$elm$.nodeType === 11 /* NODE_TYPE.DocumentFragment */ && newVnode.$elm$.host
|
|
712
|
+
? newVnode.$elm$.host
|
|
713
|
+
: newVnode.$elm$;
|
|
714
|
+
const oldVnodeAttrs = (oldVnode && oldVnode.$attrs$) || EMPTY_OBJ;
|
|
715
|
+
const newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ;
|
|
821
716
|
{
|
|
822
|
-
|
|
717
|
+
// remove attributes no longer present on the vnode by setting them to undefined
|
|
718
|
+
for (memberName in oldVnodeAttrs) {
|
|
719
|
+
if (!(memberName in newVnodeAttrs)) {
|
|
720
|
+
setAccessor(elm, memberName, oldVnodeAttrs[memberName], undefined, isSvgMode, newVnode.$flags$);
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
// add new & update changed attributes
|
|
725
|
+
for (memberName in newVnodeAttrs) {
|
|
726
|
+
setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode, newVnode.$flags$);
|
|
823
727
|
}
|
|
824
|
-
endSchedule();
|
|
825
|
-
return then(promise, () => updateComponent(hostRef, instance, isInitialLoad));
|
|
826
728
|
};
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
729
|
+
/**
|
|
730
|
+
* Create a DOM Node corresponding to one of the children of a given VNode.
|
|
731
|
+
*
|
|
732
|
+
* @param oldParentVNode the parent VNode from the previous render
|
|
733
|
+
* @param newParentVNode the parent VNode from the current render
|
|
734
|
+
* @param childIndex the index of the VNode, in the _new_ parent node's
|
|
735
|
+
* children, for which we will create a new DOM node
|
|
736
|
+
* @param parentElm the parent DOM node which our new node will be a child of
|
|
737
|
+
* @returns the newly created node
|
|
738
|
+
*/
|
|
739
|
+
const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
740
|
+
// tslint:disable-next-line: prefer-const
|
|
741
|
+
const newVNode = newParentVNode.$children$[childIndex];
|
|
742
|
+
let i = 0;
|
|
743
|
+
let elm;
|
|
744
|
+
let childNode;
|
|
745
|
+
if (newVNode.$text$ !== null) {
|
|
746
|
+
// create text node
|
|
747
|
+
elm = newVNode.$elm$ = doc.createTextNode(newVNode.$text$);
|
|
835
748
|
}
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
749
|
+
else {
|
|
750
|
+
if (!isSvgMode) {
|
|
751
|
+
isSvgMode = newVNode.$tag$ === 'svg';
|
|
752
|
+
}
|
|
753
|
+
// create element
|
|
754
|
+
elm = newVNode.$elm$ = (doc.createElementNS(isSvgMode ? SVG_NS : HTML_NS, newVNode.$tag$)
|
|
755
|
+
);
|
|
756
|
+
if (isSvgMode && newVNode.$tag$ === 'foreignObject') {
|
|
757
|
+
isSvgMode = false;
|
|
758
|
+
}
|
|
759
|
+
// add css classes, attrs, props, listeners, etc.
|
|
760
|
+
{
|
|
761
|
+
updateElement(null, newVNode, isSvgMode);
|
|
762
|
+
}
|
|
763
|
+
if (isDef(scopeId) && elm['s-si'] !== scopeId) {
|
|
764
|
+
// if there is a scopeId and this is the initial render
|
|
765
|
+
// then let's add the scopeId as a css class
|
|
766
|
+
elm.classList.add((elm['s-si'] = scopeId));
|
|
767
|
+
}
|
|
768
|
+
if (newVNode.$children$) {
|
|
769
|
+
for (i = 0; i < newVNode.$children$.length; ++i) {
|
|
770
|
+
// create the node
|
|
771
|
+
childNode = createElm(oldParentVNode, newVNode, i);
|
|
772
|
+
// return node could have been null
|
|
773
|
+
if (childNode) {
|
|
774
|
+
// append our new node
|
|
775
|
+
elm.appendChild(childNode);
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
}
|
|
779
|
+
{
|
|
780
|
+
if (newVNode.$tag$ === 'svg') {
|
|
781
|
+
// Only reset the SVG context when we're exiting <svg> element
|
|
782
|
+
isSvgMode = false;
|
|
783
|
+
}
|
|
784
|
+
else if (elm.tagName === 'foreignObject') {
|
|
785
|
+
// Reenter SVG context when we're exiting <foreignObject> element
|
|
786
|
+
isSvgMode = true;
|
|
787
|
+
}
|
|
788
|
+
}
|
|
839
789
|
}
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
790
|
+
return elm;
|
|
791
|
+
};
|
|
792
|
+
const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
|
|
793
|
+
let containerElm = (parentElm);
|
|
794
|
+
let childNode;
|
|
795
|
+
if (containerElm.shadowRoot && containerElm.tagName === hostTagName) {
|
|
796
|
+
containerElm = containerElm.shadowRoot;
|
|
846
797
|
}
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
798
|
+
for (; startIdx <= endIdx; ++startIdx) {
|
|
799
|
+
if (vnodes[startIdx]) {
|
|
800
|
+
childNode = createElm(null, parentVNode, startIdx);
|
|
801
|
+
if (childNode) {
|
|
802
|
+
vnodes[startIdx].$elm$ = childNode;
|
|
803
|
+
containerElm.insertBefore(childNode, before);
|
|
804
|
+
}
|
|
854
805
|
}
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
806
|
+
}
|
|
807
|
+
};
|
|
808
|
+
const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
|
|
809
|
+
for (; startIdx <= endIdx; ++startIdx) {
|
|
810
|
+
if ((vnode = vnodes[startIdx])) {
|
|
811
|
+
elm = vnode.$elm$;
|
|
812
|
+
callNodeRefs(vnode);
|
|
813
|
+
// remove the vnode's element from the dom
|
|
814
|
+
elm.remove();
|
|
859
815
|
}
|
|
860
816
|
}
|
|
861
817
|
};
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
818
|
+
/**
|
|
819
|
+
* Reconcile the children of a new VNode with the children of an old VNode by
|
|
820
|
+
* traversing the two collections of children, identifying nodes that are
|
|
821
|
+
* conserved or changed, calling out to `patch` to make any necessary
|
|
822
|
+
* updates to the DOM, and rearranging DOM nodes as needed.
|
|
823
|
+
*
|
|
824
|
+
* The algorithm for reconciling children works by analyzing two 'windows' onto
|
|
825
|
+
* the two arrays of children (`oldCh` and `newCh`). We keep track of the
|
|
826
|
+
* 'windows' by storing start and end indices and references to the
|
|
827
|
+
* corresponding array entries. Initially the two 'windows' are basically equal
|
|
828
|
+
* to the entire array, but we progressively narrow the windows until there are
|
|
829
|
+
* no children left to update by doing the following:
|
|
830
|
+
*
|
|
831
|
+
* 1. Skip any `null` entries at the beginning or end of the two arrays, so
|
|
832
|
+
* that if we have an initial array like the following we'll end up dealing
|
|
833
|
+
* only with a window bounded by the highlighted elements:
|
|
834
|
+
*
|
|
835
|
+
* [null, null, VNode1 , ... , VNode2, null, null]
|
|
836
|
+
* ^^^^^^ ^^^^^^
|
|
837
|
+
*
|
|
838
|
+
* 2. Check to see if the elements at the head and tail positions are equal
|
|
839
|
+
* across the windows. This will basically detect elements which haven't
|
|
840
|
+
* been added, removed, or changed position, i.e. if you had the following
|
|
841
|
+
* VNode elements (represented as HTML):
|
|
842
|
+
*
|
|
843
|
+
* oldVNode: `<div><p><span>HEY</span></p></div>`
|
|
844
|
+
* newVNode: `<div><p><span>THERE</span></p></div>`
|
|
845
|
+
*
|
|
846
|
+
* Then when comparing the children of the `<div>` tag we check the equality
|
|
847
|
+
* of the VNodes corresponding to the `<p>` tags and, since they are the
|
|
848
|
+
* same tag in the same position, we'd be able to avoid completely
|
|
849
|
+
* re-rendering the subtree under them with a new DOM element and would just
|
|
850
|
+
* call out to `patch` to handle reconciling their children and so on.
|
|
851
|
+
*
|
|
852
|
+
* 3. Check, for both windows, to see if the element at the beginning of the
|
|
853
|
+
* window corresponds to the element at the end of the other window. This is
|
|
854
|
+
* a heuristic which will let us identify _some_ situations in which
|
|
855
|
+
* elements have changed position, for instance it _should_ detect that the
|
|
856
|
+
* children nodes themselves have not changed but merely moved in the
|
|
857
|
+
* following example:
|
|
858
|
+
*
|
|
859
|
+
* oldVNode: `<div><element-one /><element-two /></div>`
|
|
860
|
+
* newVNode: `<div><element-two /><element-one /></div>`
|
|
861
|
+
*
|
|
862
|
+
* If we find cases like this then we also need to move the concrete DOM
|
|
863
|
+
* elements corresponding to the moved children to write the re-order to the
|
|
864
|
+
* DOM.
|
|
865
|
+
*
|
|
866
|
+
* 4. Finally, if VNodes have the `key` attribute set on them we check for any
|
|
867
|
+
* nodes in the old children which have the same key as the first element in
|
|
868
|
+
* our window on the new children. If we find such a node we handle calling
|
|
869
|
+
* out to `patch`, moving relevant DOM nodes, and so on, in accordance with
|
|
870
|
+
* what we find.
|
|
871
|
+
*
|
|
872
|
+
* Finally, once we've narrowed our 'windows' to the point that either of them
|
|
873
|
+
* collapse (i.e. they have length 0) we then handle any remaining VNode
|
|
874
|
+
* insertion or deletion that needs to happen to get a DOM state that correctly
|
|
875
|
+
* reflects the new child VNodes. If, for instance, after our window on the old
|
|
876
|
+
* children has collapsed we still have more nodes on the new children that
|
|
877
|
+
* we haven't dealt with yet then we need to add them, or if the new children
|
|
878
|
+
* collapse but we still have unhandled _old_ children then we need to make
|
|
879
|
+
* sure the corresponding DOM nodes are removed.
|
|
880
|
+
*
|
|
881
|
+
* @param parentElm the node into which the parent VNode is rendered
|
|
882
|
+
* @param oldCh the old children of the parent node
|
|
883
|
+
* @param newVNode the new VNode which will replace the parent
|
|
884
|
+
* @param newCh the new children of the parent node
|
|
885
|
+
*/
|
|
886
|
+
const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
887
|
+
let oldStartIdx = 0;
|
|
888
|
+
let newStartIdx = 0;
|
|
889
|
+
let idxInOld = 0;
|
|
890
|
+
let i = 0;
|
|
891
|
+
let oldEndIdx = oldCh.length - 1;
|
|
892
|
+
let oldStartVnode = oldCh[0];
|
|
893
|
+
let oldEndVnode = oldCh[oldEndIdx];
|
|
894
|
+
let newEndIdx = newCh.length - 1;
|
|
895
|
+
let newStartVnode = newCh[0];
|
|
896
|
+
let newEndVnode = newCh[newEndIdx];
|
|
897
|
+
let node;
|
|
898
|
+
let elmToMove;
|
|
899
|
+
while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
|
|
900
|
+
if (oldStartVnode == null) {
|
|
901
|
+
// VNode might have been moved left
|
|
902
|
+
oldStartVnode = oldCh[++oldStartIdx];
|
|
867
903
|
}
|
|
868
|
-
{
|
|
869
|
-
|
|
904
|
+
else if (oldEndVnode == null) {
|
|
905
|
+
oldEndVnode = oldCh[--oldEndIdx];
|
|
870
906
|
}
|
|
871
|
-
{
|
|
907
|
+
else if (newStartVnode == null) {
|
|
908
|
+
newStartVnode = newCh[++newStartIdx];
|
|
909
|
+
}
|
|
910
|
+
else if (newEndVnode == null) {
|
|
911
|
+
newEndVnode = newCh[--newEndIdx];
|
|
912
|
+
}
|
|
913
|
+
else if (isSameVnode(oldStartVnode, newStartVnode)) {
|
|
914
|
+
// if the start nodes are the same then we should patch the new VNode
|
|
915
|
+
// onto the old one, and increment our `newStartIdx` and `oldStartIdx`
|
|
916
|
+
// indices to reflect that. We don't need to move any DOM Nodes around
|
|
917
|
+
// since things are matched up in order.
|
|
918
|
+
patch(oldStartVnode, newStartVnode);
|
|
919
|
+
oldStartVnode = oldCh[++oldStartIdx];
|
|
920
|
+
newStartVnode = newCh[++newStartIdx];
|
|
921
|
+
}
|
|
922
|
+
else if (isSameVnode(oldEndVnode, newEndVnode)) {
|
|
923
|
+
// likewise, if the end nodes are the same we patch new onto old and
|
|
924
|
+
// decrement our end indices, and also likewise in this case we don't
|
|
925
|
+
// need to move any DOM Nodes.
|
|
926
|
+
patch(oldEndVnode, newEndVnode);
|
|
927
|
+
oldEndVnode = oldCh[--oldEndIdx];
|
|
928
|
+
newEndVnode = newCh[--newEndIdx];
|
|
929
|
+
}
|
|
930
|
+
else if (isSameVnode(oldStartVnode, newEndVnode)) {
|
|
931
|
+
patch(oldStartVnode, newEndVnode);
|
|
932
|
+
// We need to move the element for `oldStartVnode` into a position which
|
|
933
|
+
// will be appropriate for `newEndVnode`. For this we can use
|
|
934
|
+
// `.insertBefore` and `oldEndVnode.$elm$.nextSibling`. If there is a
|
|
935
|
+
// sibling for `oldEndVnode.$elm$` then we want to move the DOM node for
|
|
936
|
+
// `oldStartVnode` between `oldEndVnode` and it's sibling, like so:
|
|
937
|
+
//
|
|
938
|
+
// <old-start-node />
|
|
939
|
+
// <some-intervening-node />
|
|
940
|
+
// <old-end-node />
|
|
941
|
+
// <!-- -> <-- `oldStartVnode.$elm$` should be inserted here
|
|
942
|
+
// <next-sibling />
|
|
943
|
+
//
|
|
944
|
+
// If instead `oldEndVnode.$elm$` has no sibling then we just want to put
|
|
945
|
+
// the node for `oldStartVnode` at the end of the children of
|
|
946
|
+
// `parentElm`. Luckily, `Node.nextSibling` will return `null` if there
|
|
947
|
+
// aren't any siblings, and passing `null` to `Node.insertBefore` will
|
|
948
|
+
// append it to the children of the parent element.
|
|
949
|
+
parentElm.insertBefore(oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
|
|
950
|
+
oldStartVnode = oldCh[++oldStartIdx];
|
|
951
|
+
newEndVnode = newCh[--newEndIdx];
|
|
952
|
+
}
|
|
953
|
+
else if (isSameVnode(oldEndVnode, newStartVnode)) {
|
|
954
|
+
patch(oldEndVnode, newStartVnode);
|
|
955
|
+
// We've already checked above if `oldStartVnode` and `newStartVnode` are
|
|
956
|
+
// the same node, so since we're here we know that they are not. Thus we
|
|
957
|
+
// can move the element for `oldEndVnode` _before_ the element for
|
|
958
|
+
// `oldStartVnode`, leaving `oldStartVnode` to be reconciled in the
|
|
959
|
+
// future.
|
|
960
|
+
parentElm.insertBefore(oldEndVnode.$elm$, oldStartVnode.$elm$);
|
|
961
|
+
oldEndVnode = oldCh[--oldEndIdx];
|
|
962
|
+
newStartVnode = newCh[++newStartIdx];
|
|
963
|
+
}
|
|
964
|
+
else {
|
|
965
|
+
// Here we do some checks to match up old and new nodes based on the
|
|
966
|
+
// `$key$` attribute, which is set by putting a `key="my-key"` attribute
|
|
967
|
+
// in the JSX for a DOM element in the implementation of a Stencil
|
|
968
|
+
// component.
|
|
969
|
+
//
|
|
970
|
+
// First we check to see if there are any nodes in the array of old
|
|
971
|
+
// children which have the same key as the first node in the new
|
|
972
|
+
// children.
|
|
973
|
+
idxInOld = -1;
|
|
872
974
|
{
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
975
|
+
for (i = oldStartIdx; i <= oldEndIdx; ++i) {
|
|
976
|
+
if (oldCh[i] && oldCh[i].$key$ !== null && oldCh[i].$key$ === newStartVnode.$key$) {
|
|
977
|
+
idxInOld = i;
|
|
978
|
+
break;
|
|
979
|
+
}
|
|
980
|
+
}
|
|
981
|
+
}
|
|
982
|
+
if (idxInOld >= 0) {
|
|
983
|
+
// We found a node in the old children which matches up with the first
|
|
984
|
+
// node in the new children! So let's deal with that
|
|
985
|
+
elmToMove = oldCh[idxInOld];
|
|
986
|
+
if (elmToMove.$tag$ !== newStartVnode.$tag$) {
|
|
987
|
+
// the tag doesn't match so we'll need a new DOM element
|
|
988
|
+
node = createElm(oldCh && oldCh[newStartIdx], newVNode, idxInOld);
|
|
989
|
+
}
|
|
990
|
+
else {
|
|
991
|
+
patch(elmToMove, newStartVnode);
|
|
992
|
+
// invalidate the matching old node so that we won't try to update it
|
|
993
|
+
// again later on
|
|
994
|
+
oldCh[idxInOld] = undefined;
|
|
995
|
+
node = elmToMove.$elm$;
|
|
996
|
+
}
|
|
997
|
+
newStartVnode = newCh[++newStartIdx];
|
|
998
|
+
}
|
|
999
|
+
else {
|
|
1000
|
+
// We either didn't find an element in the old children that matches
|
|
1001
|
+
// the key of the first new child OR the build is not using `key`
|
|
1002
|
+
// attributes at all. In either case we need to create a new element
|
|
1003
|
+
// for the new node.
|
|
1004
|
+
node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx);
|
|
1005
|
+
newStartVnode = newCh[++newStartIdx];
|
|
1006
|
+
}
|
|
1007
|
+
if (node) {
|
|
1008
|
+
// if we created a new node then handle inserting it to the DOM
|
|
876
1009
|
{
|
|
877
|
-
|
|
1010
|
+
oldStartVnode.$elm$.parentNode.insertBefore(node, oldStartVnode.$elm$);
|
|
878
1011
|
}
|
|
879
1012
|
}
|
|
880
1013
|
}
|
|
881
1014
|
}
|
|
882
|
-
|
|
883
|
-
|
|
1015
|
+
if (oldStartIdx > oldEndIdx) {
|
|
1016
|
+
// we have some more new nodes to add which don't match up with old nodes
|
|
1017
|
+
addVnodes(parentElm, newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$, newVNode, newCh, newStartIdx, newEndIdx);
|
|
884
1018
|
}
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
const endPostUpdate = createTime('postUpdate', tagName);
|
|
891
|
-
const instance = hostRef.$lazyInstance$ ;
|
|
892
|
-
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
893
|
-
{
|
|
894
|
-
safeCall(instance, 'componentDidRender');
|
|
1019
|
+
else if (newStartIdx > newEndIdx) {
|
|
1020
|
+
// there are nodes in the `oldCh` array which no longer correspond to nodes
|
|
1021
|
+
// in the new array, so lets remove them (which entails cleaning up the
|
|
1022
|
+
// relevant DOM nodes)
|
|
1023
|
+
removeVnodes(oldCh, oldStartIdx, oldEndIdx);
|
|
895
1024
|
}
|
|
896
|
-
|
|
897
|
-
|
|
1025
|
+
};
|
|
1026
|
+
/**
|
|
1027
|
+
* Compare two VNodes to determine if they are the same
|
|
1028
|
+
*
|
|
1029
|
+
* **NB**: This function is an equality _heuristic_ based on the available
|
|
1030
|
+
* information set on the two VNodes and can be misleading under certain
|
|
1031
|
+
* circumstances. In particular, if the two nodes do not have `key` attrs
|
|
1032
|
+
* (available under `$key$` on VNodes) then the function falls back on merely
|
|
1033
|
+
* checking that they have the same tag.
|
|
1034
|
+
*
|
|
1035
|
+
* So, in other words, if `key` attrs are not set on VNodes which may be
|
|
1036
|
+
* changing order within a `children` array or something along those lines then
|
|
1037
|
+
* we could obtain a false positive and then have to do needless re-rendering.
|
|
1038
|
+
*
|
|
1039
|
+
* @param leftVNode the first VNode to check
|
|
1040
|
+
* @param rightVNode the second VNode to check
|
|
1041
|
+
* @returns whether they're equal or not
|
|
1042
|
+
*/
|
|
1043
|
+
const isSameVnode = (leftVNode, rightVNode) => {
|
|
1044
|
+
// compare if two vnode to see if they're "technically" the same
|
|
1045
|
+
// need to have the same element tag, and same key to be the same
|
|
1046
|
+
if (leftVNode.$tag$ === rightVNode.$tag$) {
|
|
1047
|
+
// this will be set if components in the build have `key` attrs set on them
|
|
898
1048
|
{
|
|
899
|
-
|
|
900
|
-
addHydratedFlag(elm);
|
|
1049
|
+
return leftVNode.$key$ === rightVNode.$key$;
|
|
901
1050
|
}
|
|
1051
|
+
}
|
|
1052
|
+
return false;
|
|
1053
|
+
};
|
|
1054
|
+
/**
|
|
1055
|
+
* Handle reconciling an outdated VNode with a new one which corresponds to
|
|
1056
|
+
* it. This function handles flushing updates to the DOM and reconciling the
|
|
1057
|
+
* children of the two nodes (if any).
|
|
1058
|
+
*
|
|
1059
|
+
* @param oldVNode an old VNode whose DOM element and children we want to update
|
|
1060
|
+
* @param newVNode a new VNode representing an updated version of the old one
|
|
1061
|
+
*/
|
|
1062
|
+
const patch = (oldVNode, newVNode) => {
|
|
1063
|
+
const elm = (newVNode.$elm$ = oldVNode.$elm$);
|
|
1064
|
+
const oldChildren = oldVNode.$children$;
|
|
1065
|
+
const newChildren = newVNode.$children$;
|
|
1066
|
+
const tag = newVNode.$tag$;
|
|
1067
|
+
const text = newVNode.$text$;
|
|
1068
|
+
if (text === null) {
|
|
902
1069
|
{
|
|
903
|
-
|
|
1070
|
+
// test if we're rendering an svg element, or still rendering nodes inside of one
|
|
1071
|
+
// only add this to the when the compiler sees we're using an svg somewhere
|
|
1072
|
+
isSvgMode = tag === 'svg' ? true : tag === 'foreignObject' ? false : isSvgMode;
|
|
904
1073
|
}
|
|
905
|
-
endPostUpdate();
|
|
906
1074
|
{
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
1075
|
+
if (tag === 'slot')
|
|
1076
|
+
;
|
|
1077
|
+
else {
|
|
1078
|
+
// either this is the first render of an element OR it's an update
|
|
1079
|
+
// AND we already know it's possible it could have changed
|
|
1080
|
+
// this updates the element's css classes, attrs, props, listeners, etc.
|
|
1081
|
+
updateElement(oldVNode, newVNode, isSvgMode);
|
|
1082
|
+
}
|
|
1083
|
+
}
|
|
1084
|
+
if (oldChildren !== null && newChildren !== null) {
|
|
1085
|
+
// looks like there's child vnodes for both the old and new vnodes
|
|
1086
|
+
// so we need to call `updateChildren` to reconcile them
|
|
1087
|
+
updateChildren(elm, oldChildren, newVNode, newChildren);
|
|
1088
|
+
}
|
|
1089
|
+
else if (newChildren !== null) {
|
|
1090
|
+
// no old child vnodes, but there are new child vnodes to add
|
|
1091
|
+
if (oldVNode.$text$ !== null) {
|
|
1092
|
+
// the old vnode was text, so be sure to clear it out
|
|
1093
|
+
elm.textContent = '';
|
|
910
1094
|
}
|
|
1095
|
+
// add the new vnode children
|
|
1096
|
+
addVnodes(elm, null, newVNode, newChildren, 0, newChildren.length - 1);
|
|
911
1097
|
}
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
}
|
|
916
|
-
{
|
|
917
|
-
hostRef.$onInstanceResolve$(elm);
|
|
918
|
-
}
|
|
919
|
-
// load events fire from bottom to top
|
|
920
|
-
// the deepest elements load first then bubbles up
|
|
921
|
-
{
|
|
922
|
-
if (hostRef.$onRenderResolve$) {
|
|
923
|
-
hostRef.$onRenderResolve$();
|
|
924
|
-
hostRef.$onRenderResolve$ = undefined;
|
|
1098
|
+
else if (oldChildren !== null) {
|
|
1099
|
+
// no new child vnodes, but there are old child vnodes to remove
|
|
1100
|
+
removeVnodes(oldChildren, 0, oldChildren.length - 1);
|
|
925
1101
|
}
|
|
926
|
-
if (
|
|
927
|
-
|
|
1102
|
+
if (isSvgMode && tag === 'svg') {
|
|
1103
|
+
isSvgMode = false;
|
|
928
1104
|
}
|
|
929
|
-
hostRef.$flags$ &= ~(4 /* isWaitingForChildren */ | 512 /* needsRerender */);
|
|
930
1105
|
}
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
1106
|
+
else if (oldVNode.$text$ !== text) {
|
|
1107
|
+
// update the text content for the text only vnode
|
|
1108
|
+
// and also only if the text is different than before
|
|
1109
|
+
elm.data = text;
|
|
1110
|
+
}
|
|
934
1111
|
};
|
|
935
|
-
const
|
|
1112
|
+
const callNodeRefs = (vNode) => {
|
|
936
1113
|
{
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
if (isConnected &&
|
|
940
|
-
(hostRef.$flags$ & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
|
|
941
|
-
scheduleUpdate(hostRef, false);
|
|
942
|
-
}
|
|
943
|
-
// Returns "true" when the forced update was successfully scheduled
|
|
944
|
-
return isConnected;
|
|
1114
|
+
vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
|
|
1115
|
+
vNode.$children$ && vNode.$children$.map(callNodeRefs);
|
|
945
1116
|
}
|
|
946
1117
|
};
|
|
947
|
-
const
|
|
948
|
-
|
|
949
|
-
|
|
1118
|
+
const renderVdom = (hostRef, renderFnResults) => {
|
|
1119
|
+
const hostElm = hostRef.$hostElement$;
|
|
1120
|
+
const cmpMeta = hostRef.$cmpMeta$;
|
|
1121
|
+
const oldVNode = hostRef.$vnode$ || newVNode(null, null);
|
|
1122
|
+
const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
|
|
1123
|
+
hostTagName = hostElm.tagName;
|
|
1124
|
+
if (cmpMeta.$attrsToReflect$) {
|
|
1125
|
+
rootVnode.$attrs$ = rootVnode.$attrs$ || {};
|
|
1126
|
+
cmpMeta.$attrsToReflect$.map(([propName, attribute]) => (rootVnode.$attrs$[attribute] = hostElm[propName]));
|
|
1127
|
+
}
|
|
1128
|
+
rootVnode.$tag$ = null;
|
|
1129
|
+
rootVnode.$flags$ |= 4 /* VNODE_FLAGS.isHost */;
|
|
1130
|
+
hostRef.$vnode$ = rootVnode;
|
|
1131
|
+
rootVnode.$elm$ = oldVNode.$elm$ = (hostElm.shadowRoot || hostElm );
|
|
950
1132
|
{
|
|
951
|
-
|
|
1133
|
+
scopeId = hostElm['s-sc'];
|
|
952
1134
|
}
|
|
953
|
-
|
|
1135
|
+
// synchronous patch
|
|
1136
|
+
patch(oldVNode, rootVnode);
|
|
954
1137
|
};
|
|
955
|
-
const
|
|
956
|
-
if (
|
|
957
|
-
|
|
958
|
-
return instance[method](arg);
|
|
959
|
-
}
|
|
960
|
-
catch (e) {
|
|
961
|
-
consoleError(e);
|
|
962
|
-
}
|
|
1138
|
+
const attachToAncestor = (hostRef, ancestorComponent) => {
|
|
1139
|
+
if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent['s-p']) {
|
|
1140
|
+
ancestorComponent['s-p'].push(new Promise((r) => (hostRef.$onRenderResolve$ = r)));
|
|
963
1141
|
}
|
|
964
|
-
return undefined;
|
|
965
|
-
};
|
|
966
|
-
const then = (promise, thenFn) => {
|
|
967
|
-
return promise && promise.then ? promise.then(thenFn) : thenFn();
|
|
968
1142
|
};
|
|
969
|
-
const
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
const endHydrate = createTime('hydrateClient', tagName);
|
|
973
|
-
const shadowRoot = hostElm.shadowRoot;
|
|
974
|
-
const childRenderNodes = [];
|
|
975
|
-
const slotNodes = [];
|
|
976
|
-
const shadowRootNodes = shadowRoot ? [] : null;
|
|
977
|
-
const vnode = (hostRef.$vnode$ = newVNode(tagName, null));
|
|
978
|
-
if (!plt.$orgLocNodes$) {
|
|
979
|
-
initializeDocumentHydrate(doc.body, (plt.$orgLocNodes$ = new Map()));
|
|
1143
|
+
const scheduleUpdate = (hostRef, isInitialLoad) => {
|
|
1144
|
+
{
|
|
1145
|
+
hostRef.$flags$ |= 16 /* HOST_FLAGS.isQueuedForUpdate */;
|
|
980
1146
|
}
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
childRenderNodes.map((c) => {
|
|
985
|
-
const orgLocationId = c.$hostId$ + '.' + c.$nodeId$;
|
|
986
|
-
const orgLocationNode = plt.$orgLocNodes$.get(orgLocationId);
|
|
987
|
-
const node = c.$elm$;
|
|
988
|
-
if (orgLocationNode && supportsShadow && orgLocationNode['s-en'] === '') {
|
|
989
|
-
orgLocationNode.parentNode.insertBefore(node, orgLocationNode.nextSibling);
|
|
990
|
-
}
|
|
991
|
-
if (!shadowRoot) {
|
|
992
|
-
node['s-hn'] = tagName;
|
|
993
|
-
if (orgLocationNode) {
|
|
994
|
-
node['s-ol'] = orgLocationNode;
|
|
995
|
-
node['s-ol']['s-nr'] = node;
|
|
996
|
-
}
|
|
997
|
-
}
|
|
998
|
-
plt.$orgLocNodes$.delete(orgLocationId);
|
|
999
|
-
});
|
|
1000
|
-
if (shadowRoot) {
|
|
1001
|
-
shadowRootNodes.map((shadowRootNode) => {
|
|
1002
|
-
if (shadowRootNode) {
|
|
1003
|
-
shadowRoot.appendChild(shadowRootNode);
|
|
1004
|
-
}
|
|
1005
|
-
});
|
|
1147
|
+
if (hostRef.$flags$ & 4 /* HOST_FLAGS.isWaitingForChildren */) {
|
|
1148
|
+
hostRef.$flags$ |= 512 /* HOST_FLAGS.needsRerender */;
|
|
1149
|
+
return;
|
|
1006
1150
|
}
|
|
1007
|
-
|
|
1151
|
+
attachToAncestor(hostRef, hostRef.$ancestorComponent$);
|
|
1152
|
+
// there is no ancestor component or the ancestor component
|
|
1153
|
+
// has already fired off its lifecycle update then
|
|
1154
|
+
// fire off the initial update
|
|
1155
|
+
const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
|
|
1156
|
+
return writeTask(dispatch) ;
|
|
1008
1157
|
};
|
|
1009
|
-
const
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
let
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
if (childNodeType === TEXT_NODE_ID) {
|
|
1083
|
-
childVNode.$elm$ = node.nextSibling;
|
|
1084
|
-
if (childVNode.$elm$ && childVNode.$elm$.nodeType === 3 /* TextNode */) {
|
|
1085
|
-
childVNode.$text$ = childVNode.$elm$.textContent;
|
|
1086
|
-
childRenderNodes.push(childVNode);
|
|
1087
|
-
// remove the text comment since it's no longer needed
|
|
1088
|
-
node.remove();
|
|
1089
|
-
if (!parentVNode.$children$) {
|
|
1090
|
-
parentVNode.$children$ = [];
|
|
1091
|
-
}
|
|
1092
|
-
parentVNode.$children$[childVNode.$index$] = childVNode;
|
|
1093
|
-
if (shadowRootNodes && childVNode.$depth$ === '0') {
|
|
1094
|
-
shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
|
|
1095
|
-
}
|
|
1096
|
-
}
|
|
1097
|
-
}
|
|
1098
|
-
else if (childVNode.$hostId$ === hostId) {
|
|
1099
|
-
// this comment node is specifcally for this host id
|
|
1100
|
-
if (childNodeType === SLOT_NODE_ID) {
|
|
1101
|
-
// `${SLOT_NODE_ID}.${hostId}.${nodeId}.${depth}.${index}.${slotName}`;
|
|
1102
|
-
childVNode.$tag$ = 'slot';
|
|
1103
|
-
if (childIdSplt[5]) {
|
|
1104
|
-
node['s-sn'] = childVNode.$name$ = childIdSplt[5];
|
|
1105
|
-
}
|
|
1106
|
-
else {
|
|
1107
|
-
node['s-sn'] = '';
|
|
1108
|
-
}
|
|
1109
|
-
node['s-sr'] = true;
|
|
1110
|
-
if (shadowRootNodes) {
|
|
1111
|
-
// browser support shadowRoot and this is a shadow dom component
|
|
1112
|
-
// create an actual slot element
|
|
1113
|
-
childVNode.$elm$ = doc.createElement(childVNode.$tag$);
|
|
1114
|
-
if (childVNode.$name$) {
|
|
1115
|
-
// add the slot name attribute
|
|
1116
|
-
childVNode.$elm$.setAttribute('name', childVNode.$name$);
|
|
1117
|
-
}
|
|
1118
|
-
// insert the new slot element before the slot comment
|
|
1119
|
-
node.parentNode.insertBefore(childVNode.$elm$, node);
|
|
1120
|
-
// remove the slot comment since it's not needed for shadow
|
|
1121
|
-
node.remove();
|
|
1122
|
-
if (childVNode.$depth$ === '0') {
|
|
1123
|
-
shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
|
|
1124
|
-
}
|
|
1125
|
-
}
|
|
1126
|
-
slotNodes.push(childVNode);
|
|
1127
|
-
if (!parentVNode.$children$) {
|
|
1128
|
-
parentVNode.$children$ = [];
|
|
1129
|
-
}
|
|
1130
|
-
parentVNode.$children$[childVNode.$index$] = childVNode;
|
|
1131
|
-
}
|
|
1132
|
-
else if (childNodeType === CONTENT_REF_ID) {
|
|
1133
|
-
// `${CONTENT_REF_ID}.${hostId}`;
|
|
1134
|
-
if (shadowRootNodes) {
|
|
1135
|
-
// remove the content ref comment since it's not needed for shadow
|
|
1136
|
-
node.remove();
|
|
1137
|
-
}
|
|
1158
|
+
const dispatchHooks = (hostRef, isInitialLoad) => {
|
|
1159
|
+
const endSchedule = createTime('scheduleUpdate', hostRef.$cmpMeta$.$tagName$);
|
|
1160
|
+
const instance = hostRef.$lazyInstance$ ;
|
|
1161
|
+
let promise;
|
|
1162
|
+
if (isInitialLoad) {
|
|
1163
|
+
{
|
|
1164
|
+
hostRef.$flags$ |= 256 /* HOST_FLAGS.isListenReady */;
|
|
1165
|
+
if (hostRef.$queuedListeners$) {
|
|
1166
|
+
hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
|
|
1167
|
+
hostRef.$queuedListeners$ = null;
|
|
1168
|
+
}
|
|
1169
|
+
}
|
|
1170
|
+
{
|
|
1171
|
+
promise = safeCall(instance, 'componentWillLoad');
|
|
1172
|
+
}
|
|
1173
|
+
}
|
|
1174
|
+
{
|
|
1175
|
+
promise = then(promise, () => safeCall(instance, 'componentWillRender'));
|
|
1176
|
+
}
|
|
1177
|
+
endSchedule();
|
|
1178
|
+
return then(promise, () => updateComponent(hostRef, instance, isInitialLoad));
|
|
1179
|
+
};
|
|
1180
|
+
const updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
1181
|
+
// updateComponent
|
|
1182
|
+
const elm = hostRef.$hostElement$;
|
|
1183
|
+
const endUpdate = createTime('update', hostRef.$cmpMeta$.$tagName$);
|
|
1184
|
+
const rc = elm['s-rc'];
|
|
1185
|
+
if (isInitialLoad) {
|
|
1186
|
+
// DOM WRITE!
|
|
1187
|
+
attachStyles(hostRef);
|
|
1188
|
+
}
|
|
1189
|
+
const endRender = createTime('render', hostRef.$cmpMeta$.$tagName$);
|
|
1190
|
+
{
|
|
1191
|
+
callRender(hostRef, instance);
|
|
1192
|
+
}
|
|
1193
|
+
if (rc) {
|
|
1194
|
+
// ok, so turns out there are some child host elements
|
|
1195
|
+
// waiting on this parent element to load
|
|
1196
|
+
// let's fire off all update callbacks waiting
|
|
1197
|
+
rc.map((cb) => cb());
|
|
1198
|
+
elm['s-rc'] = undefined;
|
|
1199
|
+
}
|
|
1200
|
+
endRender();
|
|
1201
|
+
endUpdate();
|
|
1202
|
+
{
|
|
1203
|
+
const childrenPromises = elm['s-p'];
|
|
1204
|
+
const postUpdate = () => postUpdateComponent(hostRef);
|
|
1205
|
+
if (childrenPromises.length === 0) {
|
|
1206
|
+
postUpdate();
|
|
1207
|
+
}
|
|
1208
|
+
else {
|
|
1209
|
+
Promise.all(childrenPromises).then(postUpdate);
|
|
1210
|
+
hostRef.$flags$ |= 4 /* HOST_FLAGS.isWaitingForChildren */;
|
|
1211
|
+
childrenPromises.length = 0;
|
|
1212
|
+
}
|
|
1213
|
+
}
|
|
1214
|
+
};
|
|
1215
|
+
const callRender = (hostRef, instance, elm) => {
|
|
1216
|
+
try {
|
|
1217
|
+
instance = instance.render() ;
|
|
1218
|
+
{
|
|
1219
|
+
hostRef.$flags$ &= ~16 /* HOST_FLAGS.isQueuedForUpdate */;
|
|
1220
|
+
}
|
|
1221
|
+
{
|
|
1222
|
+
hostRef.$flags$ |= 2 /* HOST_FLAGS.hasRendered */;
|
|
1223
|
+
}
|
|
1224
|
+
{
|
|
1225
|
+
{
|
|
1226
|
+
// looks like we've got child nodes to render into this host element
|
|
1227
|
+
// or we need to update the css class/attrs on the host element
|
|
1228
|
+
// DOM WRITE!
|
|
1229
|
+
{
|
|
1230
|
+
renderVdom(hostRef, instance);
|
|
1138
1231
|
}
|
|
1139
1232
|
}
|
|
1140
1233
|
}
|
|
1141
1234
|
}
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
vnode.$elm$ = node;
|
|
1145
|
-
vnode.$index$ = '0';
|
|
1146
|
-
parentVNode.$children$ = [vnode];
|
|
1235
|
+
catch (e) {
|
|
1236
|
+
consoleError(e, hostRef.$hostElement$);
|
|
1147
1237
|
}
|
|
1238
|
+
return null;
|
|
1148
1239
|
};
|
|
1149
|
-
const
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1240
|
+
const postUpdateComponent = (hostRef) => {
|
|
1241
|
+
const tagName = hostRef.$cmpMeta$.$tagName$;
|
|
1242
|
+
const elm = hostRef.$hostElement$;
|
|
1243
|
+
const endPostUpdate = createTime('postUpdate', tagName);
|
|
1244
|
+
const instance = hostRef.$lazyInstance$ ;
|
|
1245
|
+
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
1246
|
+
{
|
|
1247
|
+
safeCall(instance, 'componentDidRender');
|
|
1248
|
+
}
|
|
1249
|
+
if (!(hostRef.$flags$ & 64 /* HOST_FLAGS.hasLoadedComponent */)) {
|
|
1250
|
+
hostRef.$flags$ |= 64 /* HOST_FLAGS.hasLoadedComponent */;
|
|
1251
|
+
{
|
|
1252
|
+
// DOM WRITE!
|
|
1253
|
+
addHydratedFlag(elm);
|
|
1154
1254
|
}
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1255
|
+
{
|
|
1256
|
+
safeCall(instance, 'componentDidLoad');
|
|
1257
|
+
}
|
|
1258
|
+
endPostUpdate();
|
|
1259
|
+
{
|
|
1260
|
+
hostRef.$onReadyResolve$(elm);
|
|
1261
|
+
if (!ancestorComponent) {
|
|
1262
|
+
appDidLoad();
|
|
1158
1263
|
}
|
|
1159
1264
|
}
|
|
1160
1265
|
}
|
|
1161
|
-
else
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1266
|
+
else {
|
|
1267
|
+
endPostUpdate();
|
|
1268
|
+
}
|
|
1269
|
+
{
|
|
1270
|
+
hostRef.$onInstanceResolve$(elm);
|
|
1271
|
+
}
|
|
1272
|
+
// load events fire from bottom to top
|
|
1273
|
+
// the deepest elements load first then bubbles up
|
|
1274
|
+
{
|
|
1275
|
+
if (hostRef.$onRenderResolve$) {
|
|
1276
|
+
hostRef.$onRenderResolve$();
|
|
1277
|
+
hostRef.$onRenderResolve$ = undefined;
|
|
1169
1278
|
}
|
|
1279
|
+
if (hostRef.$flags$ & 512 /* HOST_FLAGS.needsRerender */) {
|
|
1280
|
+
nextTick(() => scheduleUpdate(hostRef, false));
|
|
1281
|
+
}
|
|
1282
|
+
hostRef.$flags$ &= ~(4 /* HOST_FLAGS.isWaitingForChildren */ | 512 /* HOST_FLAGS.needsRerender */);
|
|
1170
1283
|
}
|
|
1284
|
+
// ( •_•)
|
|
1285
|
+
// ( •_•)>⌐■-■
|
|
1286
|
+
// (⌐■_■)
|
|
1171
1287
|
};
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
*
|
|
1180
|
-
* This function provides the capability to parse/coerce a property's value to potentially any other JavaScript type.
|
|
1181
|
-
*
|
|
1182
|
-
* Property values represented in TSX preserve their type information. In the example below, the number 0 is passed to
|
|
1183
|
-
* a component. This `propValue` will preserve its type information (`typeof propValue === 'number'`). Note that is
|
|
1184
|
-
* based on the type of the value being passed in, not the type declared of the class member decorated with `@Prop`.
|
|
1185
|
-
* ```tsx
|
|
1186
|
-
* <my-cmp prop-val={0}></my-cmp>
|
|
1187
|
-
* ```
|
|
1188
|
-
*
|
|
1189
|
-
* HTML prop values on the other hand, will always a string
|
|
1190
|
-
*
|
|
1191
|
-
* @param propValue the new value to coerce to some type
|
|
1192
|
-
* @param propType the type of the prop, expressed as a binary number
|
|
1193
|
-
* @returns the parsed/coerced value
|
|
1194
|
-
*/
|
|
1195
|
-
const parsePropertyValue = (propValue, propType) => {
|
|
1196
|
-
// ensure this value is of the correct prop type
|
|
1197
|
-
if (propValue != null && !isComplexType(propValue)) {
|
|
1198
|
-
if (propType & 4 /* Boolean */) {
|
|
1199
|
-
// per the HTML spec, any string value means it is a boolean true value
|
|
1200
|
-
// but we'll cheat here and say that the string "false" is the boolean false
|
|
1201
|
-
return propValue === 'false' ? false : propValue === '' || !!propValue;
|
|
1288
|
+
const forceUpdate = (ref) => {
|
|
1289
|
+
{
|
|
1290
|
+
const hostRef = getHostRef(ref);
|
|
1291
|
+
const isConnected = hostRef.$hostElement$.isConnected;
|
|
1292
|
+
if (isConnected &&
|
|
1293
|
+
(hostRef.$flags$ & (2 /* HOST_FLAGS.hasRendered */ | 16 /* HOST_FLAGS.isQueuedForUpdate */)) === 2 /* HOST_FLAGS.hasRendered */) {
|
|
1294
|
+
scheduleUpdate(hostRef, false);
|
|
1202
1295
|
}
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1296
|
+
// Returns "true" when the forced update was successfully scheduled
|
|
1297
|
+
return isConnected;
|
|
1298
|
+
}
|
|
1299
|
+
};
|
|
1300
|
+
const appDidLoad = (who) => {
|
|
1301
|
+
// on appload
|
|
1302
|
+
// we have finish the first big initial render
|
|
1303
|
+
{
|
|
1304
|
+
addHydratedFlag(doc.documentElement);
|
|
1305
|
+
}
|
|
1306
|
+
nextTick(() => emitEvent(win, 'appload', { detail: { namespace: NAMESPACE } }));
|
|
1307
|
+
};
|
|
1308
|
+
const safeCall = (instance, method, arg) => {
|
|
1309
|
+
if (instance && instance[method]) {
|
|
1310
|
+
try {
|
|
1311
|
+
return instance[method](arg);
|
|
1206
1312
|
}
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
// but we still want it as a string
|
|
1210
|
-
return String(propValue);
|
|
1313
|
+
catch (e) {
|
|
1314
|
+
consoleError(e);
|
|
1211
1315
|
}
|
|
1212
|
-
// redundant return here for better minification
|
|
1213
|
-
return propValue;
|
|
1214
1316
|
}
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1317
|
+
return undefined;
|
|
1318
|
+
};
|
|
1319
|
+
const then = (promise, thenFn) => {
|
|
1320
|
+
return promise && promise.then ? promise.then(thenFn) : thenFn();
|
|
1218
1321
|
};
|
|
1322
|
+
const addHydratedFlag = (elm) => elm.setAttribute('calcite-hydrated', '')
|
|
1323
|
+
;
|
|
1219
1324
|
const getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
|
|
1220
1325
|
const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
1221
1326
|
// check our new property value against our internal value
|
|
@@ -1228,13 +1333,13 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
1228
1333
|
// explicitly check for NaN on both sides, as `NaN === NaN` is always false
|
|
1229
1334
|
const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
|
|
1230
1335
|
const didValueChange = newVal !== oldVal && !areBothNaN;
|
|
1231
|
-
if ((!(flags & 8 /* isConstructingInstance */) || oldVal === undefined) && didValueChange) {
|
|
1336
|
+
if ((!(flags & 8 /* HOST_FLAGS.isConstructingInstance */) || oldVal === undefined) && didValueChange) {
|
|
1232
1337
|
// gadzooks! the property's value has changed!!
|
|
1233
1338
|
// set our new value!
|
|
1234
1339
|
hostRef.$instanceValues$.set(propName, newVal);
|
|
1235
1340
|
if (instance) {
|
|
1236
1341
|
// get an array of method names of watch functions to call
|
|
1237
|
-
if (cmpMeta.$watchers$ && flags & 128 /* isWatchReady */) {
|
|
1342
|
+
if (cmpMeta.$watchers$ && flags & 128 /* HOST_FLAGS.isWatchReady */) {
|
|
1238
1343
|
const watchMethods = cmpMeta.$watchers$[propName];
|
|
1239
1344
|
if (watchMethods) {
|
|
1240
1345
|
// this instance is watching for when this property changed
|
|
@@ -1249,7 +1354,7 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
1249
1354
|
});
|
|
1250
1355
|
}
|
|
1251
1356
|
}
|
|
1252
|
-
if ((flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
|
|
1357
|
+
if ((flags & (2 /* HOST_FLAGS.hasRendered */ | 16 /* HOST_FLAGS.isQueuedForUpdate */)) === 2 /* HOST_FLAGS.hasRendered */) {
|
|
1253
1358
|
if (instance.componentShouldUpdate) {
|
|
1254
1359
|
if (instance.componentShouldUpdate(newVal, oldVal, propName) === false) {
|
|
1255
1360
|
return;
|
|
@@ -1264,6 +1369,16 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
1264
1369
|
}
|
|
1265
1370
|
}
|
|
1266
1371
|
};
|
|
1372
|
+
/**
|
|
1373
|
+
* Attach a series of runtime constructs to a compiled Stencil component
|
|
1374
|
+
* constructor, including getters and setters for the `@Prop` and `@State`
|
|
1375
|
+
* decorators, callbacks for when attributes change, and so on.
|
|
1376
|
+
*
|
|
1377
|
+
* @param Cstr the constructor for a component that we need to process
|
|
1378
|
+
* @param cmpMeta metadata collected previously about the component
|
|
1379
|
+
* @param flags a number used to store a series of bit flags
|
|
1380
|
+
* @returns a reference to the same constructor passed in (but now mutated)
|
|
1381
|
+
*/
|
|
1267
1382
|
const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
1268
1383
|
if (cmpMeta.$members$) {
|
|
1269
1384
|
if (Cstr.watchers) {
|
|
@@ -1273,8 +1388,8 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1273
1388
|
const members = Object.entries(cmpMeta.$members$);
|
|
1274
1389
|
const prototype = Cstr.prototype;
|
|
1275
1390
|
members.map(([memberName, [memberFlags]]) => {
|
|
1276
|
-
if ((memberFlags & 31 /* Prop */ ||
|
|
1277
|
-
((flags & 2 /* proxyState */) && memberFlags & 32 /* State */))) {
|
|
1391
|
+
if ((memberFlags & 31 /* MEMBER_FLAGS.Prop */ ||
|
|
1392
|
+
((flags & 2 /* PROXY_FLAGS.proxyState */) && memberFlags & 32 /* MEMBER_FLAGS.State */))) {
|
|
1278
1393
|
// proxyComponent - prop
|
|
1279
1394
|
Object.defineProperty(prototype, memberName, {
|
|
1280
1395
|
get() {
|
|
@@ -1289,8 +1404,8 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1289
1404
|
enumerable: true,
|
|
1290
1405
|
});
|
|
1291
1406
|
}
|
|
1292
|
-
else if (flags & 1 /* isElementConstructor */ &&
|
|
1293
|
-
memberFlags & 64 /* Method */) {
|
|
1407
|
+
else if (flags & 1 /* PROXY_FLAGS.isElementConstructor */ &&
|
|
1408
|
+
memberFlags & 64 /* MEMBER_FLAGS.Method */) {
|
|
1294
1409
|
// proxyComponent - method
|
|
1295
1410
|
Object.defineProperty(prototype, memberName, {
|
|
1296
1411
|
value(...args) {
|
|
@@ -1300,7 +1415,7 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1300
1415
|
});
|
|
1301
1416
|
}
|
|
1302
1417
|
});
|
|
1303
|
-
if ((flags & 1 /* isElementConstructor */)) {
|
|
1418
|
+
if ((flags & 1 /* PROXY_FLAGS.isElementConstructor */)) {
|
|
1304
1419
|
const attrNameToPropName = new Map();
|
|
1305
1420
|
prototype.attributeChangedCallback = function (attrName, _oldValue, newValue) {
|
|
1306
1421
|
plt.jmp(() => {
|
|
@@ -1356,11 +1471,11 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1356
1471
|
// create an array of attributes to observe
|
|
1357
1472
|
// and also create a map of html attribute name to js property name
|
|
1358
1473
|
Cstr.observedAttributes = members
|
|
1359
|
-
.filter(([_, m]) => m[0] & 15 /* HasAttribute */) // filter to only keep props that should match attributes
|
|
1474
|
+
.filter(([_, m]) => m[0] & 15 /* MEMBER_FLAGS.HasAttribute */) // filter to only keep props that should match attributes
|
|
1360
1475
|
.map(([propName, m]) => {
|
|
1361
1476
|
const attrName = m[1] || propName;
|
|
1362
1477
|
attrNameToPropName.set(attrName, propName);
|
|
1363
|
-
if (m[0] & 512 /* ReflectAttr */) {
|
|
1478
|
+
if (m[0] & 512 /* MEMBER_FLAGS.ReflectAttr */) {
|
|
1364
1479
|
cmpMeta.$attrsToReflect$.push([propName, attrName]);
|
|
1365
1480
|
}
|
|
1366
1481
|
return attrName;
|
|
@@ -1371,10 +1486,10 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1371
1486
|
};
|
|
1372
1487
|
const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) => {
|
|
1373
1488
|
// initializeComponent
|
|
1374
|
-
if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
|
|
1489
|
+
if ((hostRef.$flags$ & 32 /* HOST_FLAGS.hasInitializedComponent */) === 0) {
|
|
1375
1490
|
{
|
|
1376
1491
|
// we haven't initialized this element yet
|
|
1377
|
-
hostRef.$flags$ |= 32 /* hasInitializedComponent */;
|
|
1492
|
+
hostRef.$flags$ |= 32 /* HOST_FLAGS.hasInitializedComponent */;
|
|
1378
1493
|
// lazy loaded components
|
|
1379
1494
|
// request the component's implementation to be
|
|
1380
1495
|
// wired up with the host element
|
|
@@ -1392,7 +1507,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
1392
1507
|
{
|
|
1393
1508
|
cmpMeta.$watchers$ = Cstr.watchers;
|
|
1394
1509
|
}
|
|
1395
|
-
proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
|
|
1510
|
+
proxyComponent(Cstr, cmpMeta, 2 /* PROXY_FLAGS.proxyState */);
|
|
1396
1511
|
Cstr.isProxied = true;
|
|
1397
1512
|
}
|
|
1398
1513
|
const endNewInstance = createTime('createInstance', cmpMeta.$tagName$);
|
|
@@ -1400,7 +1515,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
1400
1515
|
// but let's keep track of when we start and stop
|
|
1401
1516
|
// so that the getters/setters don't incorrectly step on data
|
|
1402
1517
|
{
|
|
1403
|
-
hostRef.$flags$ |= 8 /* isConstructingInstance */;
|
|
1518
|
+
hostRef.$flags$ |= 8 /* HOST_FLAGS.isConstructingInstance */;
|
|
1404
1519
|
}
|
|
1405
1520
|
// construct the lazy-loaded component implementation
|
|
1406
1521
|
// passing the hostRef is very important during
|
|
@@ -1413,10 +1528,10 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
1413
1528
|
consoleError(e);
|
|
1414
1529
|
}
|
|
1415
1530
|
{
|
|
1416
|
-
hostRef.$flags$ &= ~8 /* isConstructingInstance */;
|
|
1531
|
+
hostRef.$flags$ &= ~8 /* HOST_FLAGS.isConstructingInstance */;
|
|
1417
1532
|
}
|
|
1418
1533
|
{
|
|
1419
|
-
hostRef.$flags$ |= 128 /* isWatchReady */;
|
|
1534
|
+
hostRef.$flags$ |= 128 /* HOST_FLAGS.isWatchReady */;
|
|
1420
1535
|
}
|
|
1421
1536
|
endNewInstance();
|
|
1422
1537
|
fireConnectedCallback(hostRef.$lazyInstance$);
|
|
@@ -1427,7 +1542,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
1427
1542
|
const scopeId = getScopeId(cmpMeta);
|
|
1428
1543
|
if (!styles.has(scopeId)) {
|
|
1429
1544
|
const endRegisterStyles = createTime('registerStyles', cmpMeta.$tagName$);
|
|
1430
|
-
registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
|
|
1545
|
+
registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */));
|
|
1431
1546
|
endRegisterStyles();
|
|
1432
1547
|
}
|
|
1433
1548
|
}
|
|
@@ -1454,18 +1569,18 @@ const fireConnectedCallback = (instance) => {
|
|
|
1454
1569
|
}
|
|
1455
1570
|
};
|
|
1456
1571
|
const connectedCallback = (elm) => {
|
|
1457
|
-
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
1572
|
+
if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
|
|
1458
1573
|
const hostRef = getHostRef(elm);
|
|
1459
1574
|
const cmpMeta = hostRef.$cmpMeta$;
|
|
1460
1575
|
const endConnected = createTime('connectedCallback', cmpMeta.$tagName$);
|
|
1461
|
-
if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
|
|
1576
|
+
if (!(hostRef.$flags$ & 1 /* HOST_FLAGS.hasConnected */)) {
|
|
1462
1577
|
// first time this component has connected
|
|
1463
|
-
hostRef.$flags$ |= 1 /* hasConnected */;
|
|
1578
|
+
hostRef.$flags$ |= 1 /* HOST_FLAGS.hasConnected */;
|
|
1464
1579
|
let hostId;
|
|
1465
1580
|
{
|
|
1466
1581
|
hostId = elm.getAttribute(HYDRATE_ID);
|
|
1467
1582
|
if (hostId) {
|
|
1468
|
-
if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
1583
|
+
if (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
|
|
1469
1584
|
const scopeId = addStyle(elm.shadowRoot, cmpMeta);
|
|
1470
1585
|
elm.classList.remove(scopeId + '-h', scopeId + '-s');
|
|
1471
1586
|
}
|
|
@@ -1479,7 +1594,7 @@ const connectedCallback = (elm) => {
|
|
|
1479
1594
|
while ((ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host)) {
|
|
1480
1595
|
// climb up the ancestors looking for the first
|
|
1481
1596
|
// component that hasn't finished its lifecycle update yet
|
|
1482
|
-
if ((ancestorComponent.nodeType === 1 /* ElementNode */ &&
|
|
1597
|
+
if ((ancestorComponent.nodeType === 1 /* NODE_TYPE.ElementNode */ &&
|
|
1483
1598
|
ancestorComponent.hasAttribute('s-id') &&
|
|
1484
1599
|
ancestorComponent['s-p']) ||
|
|
1485
1600
|
ancestorComponent['s-p']) {
|
|
@@ -1494,7 +1609,7 @@ const connectedCallback = (elm) => {
|
|
|
1494
1609
|
// https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
|
|
1495
1610
|
if (cmpMeta.$members$) {
|
|
1496
1611
|
Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
|
|
1497
|
-
if (memberFlags & 31 /* Prop */ && elm.hasOwnProperty(memberName)) {
|
|
1612
|
+
if (memberFlags & 31 /* MEMBER_FLAGS.Prop */ && elm.hasOwnProperty(memberName)) {
|
|
1498
1613
|
const value = elm[memberName];
|
|
1499
1614
|
delete elm[memberName];
|
|
1500
1615
|
elm[memberName] = value;
|
|
@@ -1517,7 +1632,7 @@ const connectedCallback = (elm) => {
|
|
|
1517
1632
|
}
|
|
1518
1633
|
};
|
|
1519
1634
|
const disconnectedCallback = (elm) => {
|
|
1520
|
-
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
1635
|
+
if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
|
|
1521
1636
|
const hostRef = getHostRef(elm);
|
|
1522
1637
|
const instance = hostRef.$lazyInstance$ ;
|
|
1523
1638
|
{
|
|
@@ -1549,7 +1664,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1549
1664
|
{
|
|
1550
1665
|
// If the app is already hydrated there is not point to disable the
|
|
1551
1666
|
// async queue. This will improve the first input delay
|
|
1552
|
-
plt.$flags$ |= 2 /* appLoaded */;
|
|
1667
|
+
plt.$flags$ |= 2 /* PLATFORM_FLAGS.appLoaded */;
|
|
1553
1668
|
}
|
|
1554
1669
|
{
|
|
1555
1670
|
for (; i < styles.length; i++) {
|
|
@@ -1584,7 +1699,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1584
1699
|
super(self);
|
|
1585
1700
|
self = this;
|
|
1586
1701
|
registerHost(self, cmpMeta);
|
|
1587
|
-
if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
1702
|
+
if (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
|
|
1588
1703
|
// this component is using shadow dom
|
|
1589
1704
|
// and this browser supports shadow dom
|
|
1590
1705
|
// add the read-only property "shadowRoot" to the host element
|
|
@@ -1619,7 +1734,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1619
1734
|
cmpMeta.$lazyBundleId$ = lazyBundle[0];
|
|
1620
1735
|
if (!exclude.includes(tagName) && !customElements.get(tagName)) {
|
|
1621
1736
|
cmpTags.push(tagName);
|
|
1622
|
-
customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* isElementConstructor */));
|
|
1737
|
+
customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* PROXY_FLAGS.isElementConstructor */));
|
|
1623
1738
|
}
|
|
1624
1739
|
});
|
|
1625
1740
|
});
|
|
@@ -1641,12 +1756,46 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1641
1756
|
// Fallback appLoad event
|
|
1642
1757
|
endBootstrap();
|
|
1643
1758
|
};
|
|
1644
|
-
const getAssetPath = (path) => {
|
|
1645
|
-
const assetUrl = new URL(path, plt.$resourcesUrl$);
|
|
1646
|
-
return assetUrl.origin !== win.location.origin ? assetUrl.href : assetUrl.pathname;
|
|
1647
|
-
};
|
|
1648
1759
|
const Fragment = (_, children) => children;
|
|
1649
|
-
const
|
|
1760
|
+
const addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
|
|
1761
|
+
if (listeners) {
|
|
1762
|
+
listeners.map(([flags, name, method]) => {
|
|
1763
|
+
const target = getHostListenerTarget(elm, flags) ;
|
|
1764
|
+
const handler = hostListenerProxy(hostRef, method);
|
|
1765
|
+
const opts = hostListenerOpts(flags);
|
|
1766
|
+
plt.ael(target, name, handler, opts);
|
|
1767
|
+
(hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
|
|
1768
|
+
});
|
|
1769
|
+
}
|
|
1770
|
+
};
|
|
1771
|
+
const hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
1772
|
+
try {
|
|
1773
|
+
{
|
|
1774
|
+
if (hostRef.$flags$ & 256 /* HOST_FLAGS.isListenReady */) {
|
|
1775
|
+
// instance is ready, let's call it's member method for this event
|
|
1776
|
+
hostRef.$lazyInstance$[methodName](ev);
|
|
1777
|
+
}
|
|
1778
|
+
else {
|
|
1779
|
+
(hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
|
|
1780
|
+
}
|
|
1781
|
+
}
|
|
1782
|
+
}
|
|
1783
|
+
catch (e) {
|
|
1784
|
+
consoleError(e);
|
|
1785
|
+
}
|
|
1786
|
+
};
|
|
1787
|
+
const getHostListenerTarget = (elm, flags) => {
|
|
1788
|
+
if (flags & 4 /* LISTENER_FLAGS.TargetDocument */)
|
|
1789
|
+
return doc;
|
|
1790
|
+
if (flags & 8 /* LISTENER_FLAGS.TargetWindow */)
|
|
1791
|
+
return win;
|
|
1792
|
+
if (flags & 16 /* LISTENER_FLAGS.TargetBody */)
|
|
1793
|
+
return doc.body;
|
|
1794
|
+
return elm;
|
|
1795
|
+
};
|
|
1796
|
+
// prettier-ignore
|
|
1797
|
+
const hostListenerOpts = (flags) => (flags & 2 /* LISTENER_FLAGS.Capture */) !== 0;
|
|
1798
|
+
const hostRefs = /*@__PURE__*/ new WeakMap();
|
|
1650
1799
|
const getHostRef = (ref) => hostRefs.get(ref);
|
|
1651
1800
|
const registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef);
|
|
1652
1801
|
const registerHost = (elm, cmpMeta) => {
|
|
@@ -1691,14 +1840,36 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
1691
1840
|
return importedModule[exportName];
|
|
1692
1841
|
}, consoleError);
|
|
1693
1842
|
};
|
|
1694
|
-
const styles = new Map();
|
|
1843
|
+
const styles = /*@__PURE__*/ new Map();
|
|
1844
|
+
const win = typeof window !== 'undefined' ? window : {};
|
|
1845
|
+
const doc = win.document || { head: {} };
|
|
1846
|
+
const plt = {
|
|
1847
|
+
$flags$: 0,
|
|
1848
|
+
$resourcesUrl$: '',
|
|
1849
|
+
jmp: (h) => h(),
|
|
1850
|
+
raf: (h) => requestAnimationFrame(h),
|
|
1851
|
+
ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
|
|
1852
|
+
rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
|
|
1853
|
+
ce: (eventName, opts) => new CustomEvent(eventName, opts),
|
|
1854
|
+
};
|
|
1855
|
+
const supportsShadow = true;
|
|
1856
|
+
const promiseResolve = (v) => Promise.resolve(v);
|
|
1857
|
+
const supportsConstructableStylesheets = /*@__PURE__*/ (() => {
|
|
1858
|
+
try {
|
|
1859
|
+
new CSSStyleSheet();
|
|
1860
|
+
return typeof new CSSStyleSheet().replaceSync === 'function';
|
|
1861
|
+
}
|
|
1862
|
+
catch (e) { }
|
|
1863
|
+
return false;
|
|
1864
|
+
})()
|
|
1865
|
+
;
|
|
1695
1866
|
const queueDomReads = [];
|
|
1696
1867
|
const queueDomWrites = [];
|
|
1697
1868
|
const queueTask = (queue, write) => (cb) => {
|
|
1698
1869
|
queue.push(cb);
|
|
1699
1870
|
if (!queuePending) {
|
|
1700
1871
|
queuePending = true;
|
|
1701
|
-
if (write && plt.$flags$ & 4 /* queueSync */) {
|
|
1872
|
+
if (write && plt.$flags$ & 4 /* PLATFORM_FLAGS.queueSync */) {
|
|
1702
1873
|
nextTick(flush);
|
|
1703
1874
|
}
|
|
1704
1875
|
else {
|