@ionic/core 8.7.10-dev.11762798751.11b77c85 → 8.7.10-dev.11763413450.1212cecf
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/components/checkbox.js +63 -9
- package/components/ion-datetime.js +39 -4
- package/components/ion-input.js +7 -6
- package/components/ion-searchbar.js +6 -6
- package/components/ion-select.js +7 -6
- package/components/ion-textarea.js +2 -1
- package/components/ion-toggle.js +62 -12
- package/components/notch-controller.js +153 -0
- package/components/radio-group.js +60 -7
- package/components/validity.js +1 -150
- package/dist/cjs/{animation-D_c13yq_.js → animation-Bt3H9L1C.js} +1 -1
- package/dist/cjs/{app-globals--1qFsqEw.js → app-globals-Ciccnk9_.js} +1 -1
- package/dist/cjs/{button-active-CQiBOKCI.js → button-active-CMc8cD90.js} +1 -1
- package/dist/cjs/{config-DL8XJF0D.js → config-C5fsO43a.js} +1 -1
- package/dist/cjs/{data-DtEHxOpt.js → data-JwZKaIQB.js} +1 -1
- package/dist/cjs/{framework-delegate-DmSgIb_h.js → framework-delegate-DMJRBuDi.js} +1 -1
- package/dist/cjs/{hardware-back-button-C72O8m7E.js → hardware-back-button-VCK4V3mG.js} +1 -1
- package/dist/cjs/{helpers-xCoR213K.js → helpers-DrTqNghc.js} +1 -1
- package/dist/cjs/{index-WEBAL2Zz.js → index-094mMFB-.js} +4 -4
- package/dist/cjs/{index-DOeyHw27.js → index-C534ULug.js} +2 -2
- package/dist/cjs/{index-FugOCm8C.js → index-CO6eryBo.js} +2 -2
- package/dist/cjs/{index-qWlbeMTM.js → index-D6Wc6v08.js} +3 -41
- package/dist/cjs/{index-FdJ4-6Rg.js → index-DrMUZJj6.js} +5 -5
- package/dist/cjs/index.cjs.js +12 -12
- package/dist/cjs/{input-shims-CYpwizql.js → input-shims-CW0KUFTQ.js} +3 -3
- package/dist/cjs/{input.utils-DhlH-Ng5.js → input.utils-B_QROI2g.js} +2 -2
- package/dist/cjs/ion-accordion_2.cjs.entry.js +3 -3
- package/dist/cjs/ion-action-sheet.cjs.entry.js +8 -8
- package/dist/cjs/ion-alert.cjs.entry.js +9 -9
- package/dist/cjs/ion-app_8.cjs.entry.js +12 -12
- package/dist/cjs/ion-avatar_3.cjs.entry.js +2 -2
- package/dist/cjs/ion-back-button.cjs.entry.js +3 -3
- package/dist/cjs/ion-backdrop.cjs.entry.js +2 -2
- package/dist/cjs/ion-breadcrumb_2.cjs.entry.js +3 -3
- package/dist/cjs/ion-button_2.cjs.entry.js +3 -3
- package/dist/cjs/ion-card_5.cjs.entry.js +3 -3
- package/dist/cjs/ion-checkbox.cjs.entry.js +63 -11
- package/dist/cjs/ion-chip.cjs.entry.js +2 -2
- package/dist/cjs/ion-col_3.cjs.entry.js +2 -2
- package/dist/cjs/ion-datetime-button.cjs.entry.js +4 -4
- package/dist/cjs/ion-datetime_3.cjs.entry.js +47 -12
- package/dist/cjs/ion-fab_3.cjs.entry.js +3 -3
- package/dist/cjs/ion-img.cjs.entry.js +3 -3
- package/dist/cjs/ion-infinite-scroll_2.cjs.entry.js +5 -5
- package/dist/cjs/ion-input-otp.cjs.entry.js +3 -3
- package/dist/cjs/ion-input-password-toggle.cjs.entry.js +2 -2
- package/dist/cjs/ion-input.cjs.entry.js +11 -10
- package/dist/cjs/ion-item-option_3.cjs.entry.js +4 -4
- package/dist/cjs/ion-item_8.cjs.entry.js +3 -3
- package/dist/cjs/ion-loading.cjs.entry.js +8 -8
- package/dist/cjs/ion-menu_3.cjs.entry.js +8 -8
- package/dist/cjs/ion-modal.cjs.entry.js +9 -9
- package/dist/cjs/ion-nav_2.cjs.entry.js +6 -6
- package/dist/cjs/ion-picker-column-option.cjs.entry.js +3 -3
- package/dist/cjs/ion-picker-column.cjs.entry.js +3 -3
- package/dist/cjs/ion-picker.cjs.entry.js +2 -2
- package/dist/cjs/ion-popover.cjs.entry.js +8 -8
- package/dist/cjs/ion-progress-bar.cjs.entry.js +3 -3
- package/dist/cjs/ion-radio_2.cjs.entry.js +60 -9
- package/dist/cjs/ion-range.cjs.entry.js +4 -4
- package/dist/cjs/ion-refresher_2.cjs.entry.js +6 -6
- package/dist/cjs/ion-reorder_2.cjs.entry.js +4 -4
- package/dist/cjs/ion-ripple-effect.cjs.entry.js +2 -2
- package/dist/cjs/ion-route_4.cjs.entry.js +3 -3
- package/dist/cjs/ion-searchbar.cjs.entry.js +8 -8
- package/dist/cjs/ion-segment-content.cjs.entry.js +1 -1
- package/dist/cjs/ion-segment-view.cjs.entry.js +1 -1
- package/dist/cjs/ion-segment_2.cjs.entry.js +3 -3
- package/dist/cjs/ion-select-modal.cjs.entry.js +6 -6
- package/dist/cjs/ion-select_3.cjs.entry.js +13 -12
- package/dist/cjs/ion-spinner.cjs.entry.js +2 -2
- package/dist/cjs/ion-split-pane.cjs.entry.js +2 -2
- package/dist/cjs/ion-tab-bar_2.cjs.entry.js +3 -3
- package/dist/cjs/ion-tab_2.cjs.entry.js +3 -3
- package/dist/cjs/ion-text.cjs.entry.js +2 -2
- package/dist/cjs/ion-textarea.cjs.entry.js +7 -6
- package/dist/cjs/ion-toast.cjs.entry.js +8 -8
- package/dist/cjs/ion-toggle.cjs.entry.js +61 -13
- package/dist/cjs/{ionic-global-CR8JSFWa.js → ionic-global-HMVqOFGO.js} +1 -1
- package/dist/cjs/ionic.cjs.js +5 -5
- package/dist/cjs/{ios.transition-MQamiuLS.js → ios.transition-BOt_uW73.js} +4 -4
- package/dist/cjs/loader.cjs.js +4 -4
- package/dist/cjs/{md.transition-VK5nuqXu.js → md.transition-Dt968VXB.js} +4 -4
- package/dist/cjs/{validity-ilhIJL9Q.js → notch-controller-Bzqhjm4f.js} +1 -15
- package/dist/cjs/{overlays-DcMnmLe2.js → overlays-DxIZwUXI.js} +5 -5
- package/dist/cjs/{status-tap-C0NZlIwJ.js → status-tap-g0sWWkXk.js} +3 -3
- package/dist/cjs/{swipe-back-CdOHy9bk.js → swipe-back-BIayeNOD.js} +2 -2
- package/dist/cjs/validity-BpS37YFM.js +19 -0
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/checkbox/checkbox.js +67 -9
- package/dist/collection/components/datetime/datetime.ios.css +15 -0
- package/dist/collection/components/datetime/datetime.js +37 -2
- package/dist/collection/components/datetime/datetime.md.css +15 -0
- package/dist/collection/components/input/input.js +8 -8
- package/dist/collection/components/radio-group/radio-group.js +64 -7
- package/dist/collection/components/searchbar/searchbar.js +9 -9
- package/dist/collection/components/select/select.js +5 -5
- package/dist/collection/components/toggle/toggle.js +62 -12
- package/dist/docs.json +25 -15
- package/dist/esm/{animation-BMjqGaKJ.js → animation-Dt8bGnA-.js} +1 -1
- package/dist/esm/{app-globals-CXKe5CYv.js → app-globals-BDSf8fOA.js} +1 -1
- package/dist/esm/{button-active-DsHCf5yJ.js → button-active-L570Swow.js} +1 -1
- package/dist/esm/{config-FyGnL1d5.js → config-mCdtaoPe.js} +1 -1
- package/dist/esm/{data-VwBJONjN.js → data-DCORV9FH.js} +1 -1
- package/dist/esm/{framework-delegate-DA71As64.js → framework-delegate-BYawdMXj.js} +1 -1
- package/dist/esm/{hardware-back-button-gEuwgxq4.js → hardware-back-button-CPLxO-Ev.js} +1 -1
- package/dist/esm/{helpers-Br4puuoA.js → helpers-DEn3pfjm.js} +1 -1
- package/dist/esm/{index-nzxJGPo-.js → index-Bs3kT4bc.js} +2 -2
- package/dist/esm/{index-COOKa-0k.js → index-C8IsBmNU.js} +3 -41
- package/dist/esm/{index-DNUVD4sY.js → index-CvDIirVx.js} +5 -5
- package/dist/esm/{index-CZzUL5H7.js → index-ceb5RaMT.js} +2 -2
- package/dist/esm/{index-DKnepNGf.js → index-r2D9DEro.js} +4 -4
- package/dist/esm/index.js +12 -12
- package/dist/esm/{input-shims-G0QQ_JXi.js → input-shims-DyOpfTg6.js} +3 -3
- package/dist/esm/{input.utils-BRuJbV55.js → input.utils-DrvTa8gz.js} +2 -2
- package/dist/esm/ion-accordion_2.entry.js +3 -3
- package/dist/esm/ion-action-sheet.entry.js +8 -8
- package/dist/esm/ion-alert.entry.js +9 -9
- package/dist/esm/ion-app_8.entry.js +12 -12
- package/dist/esm/ion-avatar_3.entry.js +2 -2
- package/dist/esm/ion-back-button.entry.js +3 -3
- package/dist/esm/ion-backdrop.entry.js +2 -2
- package/dist/esm/ion-breadcrumb_2.entry.js +3 -3
- package/dist/esm/ion-button_2.entry.js +3 -3
- package/dist/esm/ion-card_5.entry.js +3 -3
- package/dist/esm/ion-checkbox.entry.js +63 -11
- package/dist/esm/ion-chip.entry.js +2 -2
- package/dist/esm/ion-col_3.entry.js +2 -2
- package/dist/esm/ion-datetime-button.entry.js +4 -4
- package/dist/esm/ion-datetime_3.entry.js +47 -12
- package/dist/esm/ion-fab_3.entry.js +3 -3
- package/dist/esm/ion-img.entry.js +3 -3
- package/dist/esm/ion-infinite-scroll_2.entry.js +5 -5
- package/dist/esm/ion-input-otp.entry.js +3 -3
- package/dist/esm/ion-input-password-toggle.entry.js +2 -2
- package/dist/esm/ion-input.entry.js +10 -9
- package/dist/esm/ion-item-option_3.entry.js +4 -4
- package/dist/esm/ion-item_8.entry.js +3 -3
- package/dist/esm/ion-loading.entry.js +8 -8
- package/dist/esm/ion-menu_3.entry.js +8 -8
- package/dist/esm/ion-modal.entry.js +9 -9
- package/dist/esm/ion-nav_2.entry.js +6 -6
- package/dist/esm/ion-picker-column-option.entry.js +3 -3
- package/dist/esm/ion-picker-column.entry.js +3 -3
- package/dist/esm/ion-picker.entry.js +2 -2
- package/dist/esm/ion-popover.entry.js +8 -8
- package/dist/esm/ion-progress-bar.entry.js +3 -3
- package/dist/esm/ion-radio_2.entry.js +60 -9
- package/dist/esm/ion-range.entry.js +4 -4
- package/dist/esm/ion-refresher_2.entry.js +6 -6
- package/dist/esm/ion-reorder_2.entry.js +4 -4
- package/dist/esm/ion-ripple-effect.entry.js +2 -2
- package/dist/esm/ion-route_4.entry.js +3 -3
- package/dist/esm/ion-searchbar.entry.js +8 -8
- package/dist/esm/ion-segment-content.entry.js +1 -1
- package/dist/esm/ion-segment-view.entry.js +1 -1
- package/dist/esm/ion-segment_2.entry.js +3 -3
- package/dist/esm/ion-select-modal.entry.js +6 -6
- package/dist/esm/ion-select_3.entry.js +12 -11
- package/dist/esm/ion-spinner.entry.js +2 -2
- package/dist/esm/ion-split-pane.entry.js +2 -2
- package/dist/esm/ion-tab-bar_2.entry.js +3 -3
- package/dist/esm/ion-tab_2.entry.js +3 -3
- package/dist/esm/ion-text.entry.js +2 -2
- package/dist/esm/ion-textarea.entry.js +6 -5
- package/dist/esm/ion-toast.entry.js +8 -8
- package/dist/esm/ion-toggle.entry.js +61 -13
- package/dist/esm/{ionic-global-ssiordoc.js → ionic-global-CDrldh-5.js} +1 -1
- package/dist/esm/ionic.js +6 -6
- package/dist/esm/{ios.transition-CdWk5te_.js → ios.transition-BDzw0_Hm.js} +4 -4
- package/dist/esm/loader.js +5 -5
- package/dist/esm/{md.transition-CTwmjwnm.js → md.transition-BzDYi3qq.js} +4 -4
- package/dist/esm/{validity-CwxNVaqN.js → notch-controller-BwelN_JM.js} +2 -15
- package/dist/esm/{overlays-DNIbGUWk.js → overlays-BymNv-BL.js} +5 -5
- package/dist/esm/{status-tap-B6uPB7F5.js → status-tap-5DQ7Fc4V.js} +3 -3
- package/dist/esm/{swipe-back-INesdA_O.js → swipe-back-BKw2CAHc.js} +2 -2
- package/dist/esm/validity-DJztqcrH.js +17 -0
- package/dist/html.html-data.json +18 -2
- package/dist/ionic/index.esm.js +1 -1
- package/dist/ionic/ionic.esm.js +1 -1
- package/dist/ionic/{p-2b9e100d.entry.js → p-020af078.entry.js} +1 -1
- package/dist/ionic/p-074839fc.entry.js +4 -0
- package/dist/ionic/{p-964e89ac.entry.js → p-0b80d700.entry.js} +1 -1
- package/dist/ionic/{p-894e8953.entry.js → p-0dfa5a37.entry.js} +1 -1
- package/dist/ionic/{p-3807749f.entry.js → p-11518b31.entry.js} +1 -1
- package/dist/ionic/{p-fcd74818.entry.js → p-15193d01.entry.js} +1 -1
- package/dist/ionic/{p-c49f0f68.entry.js → p-1647c46c.entry.js} +1 -1
- package/dist/ionic/{p-116a97cb.entry.js → p-2a939845.entry.js} +1 -1
- package/dist/ionic/{p-3c522786.entry.js → p-316c0420.entry.js} +1 -1
- package/dist/ionic/{p-860f309a.entry.js → p-31f7095f.entry.js} +1 -1
- package/dist/ionic/{p-adde497f.entry.js → p-370e4237.entry.js} +1 -1
- package/dist/ionic/{p-ef8c7682.entry.js → p-3a6caca9.entry.js} +1 -1
- package/dist/ionic/p-40c261a3.entry.js +4 -0
- package/dist/ionic/{p-06881392.entry.js → p-43ed1ef5.entry.js} +1 -1
- package/dist/ionic/{p-a66bbfa0.entry.js → p-46d74291.entry.js} +1 -1
- package/dist/ionic/{p-7047a7b7.entry.js → p-49d06882.entry.js} +1 -1
- package/dist/ionic/{p-d0f6b9a7.entry.js → p-4c85d268.entry.js} +1 -1
- package/dist/ionic/p-4e41ea20.entry.js +4 -0
- package/dist/ionic/{p-dfd6acb5.entry.js → p-510d86e1.entry.js} +1 -1
- package/dist/ionic/p-51a60e0f.entry.js +4 -0
- package/dist/ionic/{p-dfc6f4b1.entry.js → p-582824c5.entry.js} +1 -1
- package/dist/ionic/{p-259e4068.entry.js → p-6241ce47.entry.js} +1 -1
- package/dist/ionic/{p-4ede0a73.entry.js → p-639dd543.entry.js} +1 -1
- package/dist/ionic/{p-7a19f3d1.entry.js → p-6444c606.entry.js} +1 -1
- package/dist/ionic/{p-c7f3e813.entry.js → p-675b1a31.entry.js} +1 -1
- package/dist/ionic/{p-db44afdd.entry.js → p-6d070558.entry.js} +1 -1
- package/dist/ionic/{p-5dcbb52f.entry.js → p-7268efa5.entry.js} +1 -1
- package/dist/ionic/{p-c6b68ac0.entry.js → p-72c38b88.entry.js} +1 -1
- package/dist/ionic/p-7380261c.entry.js +4 -0
- package/dist/ionic/{p-a41048a1.entry.js → p-79bd78f9.entry.js} +1 -1
- package/dist/ionic/{p-295a2119.entry.js → p-7da39a4d.entry.js} +1 -1
- package/dist/ionic/{p-d24d55cb.entry.js → p-83be404e.entry.js} +1 -1
- package/dist/ionic/{p-70c66710.entry.js → p-86f53961.entry.js} +1 -1
- package/dist/ionic/{p-db648b6a.entry.js → p-94de5cfa.entry.js} +1 -1
- package/dist/ionic/{p-6fe93af5.entry.js → p-9575b654.entry.js} +1 -1
- package/dist/ionic/p-9810f7e6.entry.js +4 -0
- package/dist/ionic/{p-bef7bd83.entry.js → p-98fc09eb.entry.js} +1 -1
- package/dist/ionic/{p-BA44xiai.js → p-B0q1YL7N.js} +1 -1
- package/dist/ionic/p-BFvmZNyx.js +4 -0
- package/dist/ionic/p-BKc55Xev.js +4 -0
- package/dist/ionic/{p-baqdazzM.js → p-BOVrCkpJ.js} +1 -1
- package/dist/ionic/{p-CT3hZD31.js → p-BYEqWnSg.js} +1 -1
- package/dist/ionic/p-Bmgaetn_.js +4 -0
- package/dist/ionic/{p-CUek2VVk.js → p-C7hRNDhM.js} +1 -1
- package/dist/ionic/p-C8IsBmNU.js +5 -0
- package/dist/ionic/{p-CYTVJxfQ.js → p-CJxh_yLS.js} +1 -1
- package/dist/ionic/{p-C8VsQFea.js → p-CTfR9YZG.js} +1 -1
- package/dist/ionic/p-CwgG81ZD.js +4 -0
- package/dist/ionic/{p-UCpjvnQe.js → p-D-eFFUkA.js} +1 -1
- package/dist/ionic/{p-DddcVlzx.js → p-D0dMcSkw.js} +1 -1
- package/dist/ionic/{p-ynapDa0U.js → p-D87hU-Ly.js} +1 -1
- package/dist/ionic/{p-C9IcKRgw.js → p-DCv9sLH2.js} +1 -1
- package/dist/ionic/p-DDb5r57F.js +4 -0
- package/dist/ionic/p-DJztqcrH.js +4 -0
- package/dist/ionic/{p-yu2f42Nv.js → p-DNcfiJwE.js} +1 -1
- package/dist/ionic/{p-CETqdl8n.js → p-DUt5fQmA.js} +1 -1
- package/dist/ionic/p-DZRJwG4S.js +4 -0
- package/dist/ionic/{p-D8G3beZX.js → p-DbQ5QkTP.js} +1 -1
- package/dist/ionic/{p-BUluHF_z.js → p-Dc45iWE4.js} +1 -1
- package/dist/ionic/{p-Bzed_Vkc.js → p-QHYY4sjU.js} +1 -1
- package/dist/ionic/{p-3ca55cd6.entry.js → p-a127bee2.entry.js} +1 -1
- package/dist/ionic/{p-b3da5db0.entry.js → p-a80f1b04.entry.js} +1 -1
- package/dist/ionic/{p-948228a2.entry.js → p-ac4eb91d.entry.js} +1 -1
- package/dist/ionic/{p-7078b759.entry.js → p-b0a7585c.entry.js} +1 -1
- package/dist/ionic/{p-3549e539.entry.js → p-b57c6d3e.entry.js} +1 -1
- package/dist/ionic/p-c19f63d0.entry.js +4 -0
- package/dist/ionic/{p-e1547a17.entry.js → p-cc45bcbc.entry.js} +1 -1
- package/dist/ionic/{p-e1c3b35d.entry.js → p-d0a2a1ab.entry.js} +1 -1
- package/dist/ionic/{p-89c2d5ea.entry.js → p-d126e8d3.entry.js} +1 -1
- package/dist/ionic/p-d1f54e28.entry.js +4 -0
- package/dist/ionic/p-d3014190.entry.js +4 -0
- package/dist/ionic/{p-93d7685c.entry.js → p-da7d04cc.entry.js} +1 -1
- package/dist/ionic/p-dbbe606a.entry.js +4 -0
- package/dist/ionic/{p-0144ab54.entry.js → p-e16b69e1.entry.js} +1 -1
- package/dist/ionic/{p-d27a5c0b.entry.js → p-f8f22cc0.entry.js} +1 -1
- package/dist/types/components/checkbox/checkbox.d.ts +9 -1
- package/dist/types/components/datetime/datetime.d.ts +9 -0
- package/dist/types/components/header/header.utils.d.ts +1 -2
- package/dist/types/components/input/input.d.ts +1 -1
- package/dist/types/components/radio-group/radio-group.d.ts +9 -1
- package/dist/types/components/searchbar/searchbar.d.ts +1 -1
- package/dist/types/components/select/select.d.ts +2 -2
- package/dist/types/components/toggle/toggle.d.ts +7 -1
- package/dist/types/components.d.ts +8 -8
- package/dist/types/stencil-public-runtime.d.ts +9 -19
- package/dist/types/utils/forms/validity.d.ts +1 -1
- package/dist/types/utils/gesture/listener.d.ts +1 -2
- package/hydrate/index.js +408 -360
- package/hydrate/index.mjs +408 -360
- package/package.json +3 -3
- package/dist/ionic/p-0188f4a6.entry.js +0 -4
- package/dist/ionic/p-14e08559.entry.js +0 -4
- package/dist/ionic/p-22bcfae9.entry.js +0 -4
- package/dist/ionic/p-45c80fd7.entry.js +0 -4
- package/dist/ionic/p-49a21ffb.entry.js +0 -4
- package/dist/ionic/p-5cf136b5.entry.js +0 -4
- package/dist/ionic/p-5d600703.entry.js +0 -4
- package/dist/ionic/p-9fc9dfae.entry.js +0 -4
- package/dist/ionic/p-BS-HlVX0.js +0 -4
- package/dist/ionic/p-BWS2Niqo.js +0 -4
- package/dist/ionic/p-CCKqmAua.js +0 -4
- package/dist/ionic/p-COOKa-0k.js +0 -5
- package/dist/ionic/p-CSQuMCUi.js +0 -4
- package/dist/ionic/p-PfJ1h_Zm.js +0 -4
- package/dist/ionic/p-edcc6f4f.entry.js +0 -4
- package/dist/ionic/p-f53597ee.entry.js +0 -4
- package/dist/ionic/p-w2EzNm9e.js +0 -4
package/components/ion-toggle.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* (C) Ionic http://ionicframework.com - MIT License
|
|
3
3
|
*/
|
|
4
|
-
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
4
|
+
import { proxyCustomElement, HTMLElement, createEvent, Build, h, Host } from '@stencil/core/internal/client';
|
|
5
5
|
import { i as inheritAriaAttributes, e as renderHiddenInput } from './helpers.js';
|
|
6
|
+
import { c as checkInvalidState } from './validity.js';
|
|
6
7
|
import { d as hapticSelection } from './haptic.js';
|
|
7
8
|
import { a as isPlatform, b as getIonMode } from './ionic-global.js';
|
|
8
9
|
import { i as isRTL } from './dir.js';
|
|
@@ -33,6 +34,10 @@ const Toggle = /*@__PURE__*/ proxyCustomElement(class Toggle extends HTMLElement
|
|
|
33
34
|
this.inheritedAttributes = {};
|
|
34
35
|
this.didLoad = false;
|
|
35
36
|
this.activated = false;
|
|
37
|
+
/**
|
|
38
|
+
* Track validation state for proper aria-live announcements.
|
|
39
|
+
*/
|
|
40
|
+
this.isInvalid = false;
|
|
36
41
|
/**
|
|
37
42
|
* The name of the control, which is submitted with the form data.
|
|
38
43
|
*/
|
|
@@ -146,15 +151,52 @@ const Toggle = /*@__PURE__*/ proxyCustomElement(class Toggle extends HTMLElement
|
|
|
146
151
|
});
|
|
147
152
|
}
|
|
148
153
|
async connectedCallback() {
|
|
154
|
+
const { didLoad, el } = this;
|
|
149
155
|
/**
|
|
150
156
|
* If we have not yet rendered
|
|
151
157
|
* ion-toggle, then toggleTrack is not defined.
|
|
152
158
|
* But if we are moving ion-toggle via appendChild,
|
|
153
159
|
* then toggleTrack will be defined.
|
|
154
160
|
*/
|
|
155
|
-
if (
|
|
161
|
+
if (didLoad) {
|
|
156
162
|
this.setupGesture();
|
|
157
163
|
}
|
|
164
|
+
// Watch for class changes to update validation state.
|
|
165
|
+
if (Build.isBrowser && typeof MutationObserver !== 'undefined') {
|
|
166
|
+
this.validationObserver = new MutationObserver(() => {
|
|
167
|
+
const newIsInvalid = checkInvalidState(el);
|
|
168
|
+
if (this.isInvalid !== newIsInvalid) {
|
|
169
|
+
this.isInvalid = newIsInvalid;
|
|
170
|
+
/**
|
|
171
|
+
* Screen readers tend to announce changes
|
|
172
|
+
* to `aria-describedby` when the attribute
|
|
173
|
+
* is changed during a blur event for a
|
|
174
|
+
* native form control.
|
|
175
|
+
* However, the announcement can be spotty
|
|
176
|
+
* when using a non-native form control
|
|
177
|
+
* and `forceUpdate()`.
|
|
178
|
+
* This is due to `forceUpdate()` internally
|
|
179
|
+
* rescheduling the DOM update to a lower
|
|
180
|
+
* priority queue regardless if it's called
|
|
181
|
+
* inside a Promise or not, thus causing
|
|
182
|
+
* the screen reader to potentially miss the
|
|
183
|
+
* change.
|
|
184
|
+
* By using a State variable inside a Promise,
|
|
185
|
+
* it guarantees a re-render immediately at
|
|
186
|
+
* a higher priority.
|
|
187
|
+
*/
|
|
188
|
+
Promise.resolve().then(() => {
|
|
189
|
+
this.hintTextId = this.getHintTextId();
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
});
|
|
193
|
+
this.validationObserver.observe(el, {
|
|
194
|
+
attributes: true,
|
|
195
|
+
attributeFilter: ['class'],
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
// Always set initial state
|
|
199
|
+
this.isInvalid = checkInvalidState(el);
|
|
158
200
|
}
|
|
159
201
|
componentDidLoad() {
|
|
160
202
|
this.setupGesture();
|
|
@@ -165,9 +207,15 @@ const Toggle = /*@__PURE__*/ proxyCustomElement(class Toggle extends HTMLElement
|
|
|
165
207
|
this.gesture.destroy();
|
|
166
208
|
this.gesture = undefined;
|
|
167
209
|
}
|
|
210
|
+
// Clean up validation observer to prevent memory leaks.
|
|
211
|
+
if (this.validationObserver) {
|
|
212
|
+
this.validationObserver.disconnect();
|
|
213
|
+
this.validationObserver = undefined;
|
|
214
|
+
}
|
|
168
215
|
}
|
|
169
216
|
componentWillLoad() {
|
|
170
217
|
this.inheritedAttributes = Object.assign({}, inheritAriaAttributes(this.el));
|
|
218
|
+
this.hintTextId = this.getHintTextId();
|
|
171
219
|
}
|
|
172
220
|
onStart() {
|
|
173
221
|
this.activated = true;
|
|
@@ -208,9 +256,9 @@ const Toggle = /*@__PURE__*/ proxyCustomElement(class Toggle extends HTMLElement
|
|
|
208
256
|
get hasLabel() {
|
|
209
257
|
return this.el.textContent !== '';
|
|
210
258
|
}
|
|
211
|
-
|
|
212
|
-
const {
|
|
213
|
-
if (
|
|
259
|
+
getHintTextId() {
|
|
260
|
+
const { helperText, errorText, helperTextId, errorTextId, isInvalid } = this;
|
|
261
|
+
if (isInvalid && errorText) {
|
|
214
262
|
return errorTextId;
|
|
215
263
|
}
|
|
216
264
|
if (helperText) {
|
|
@@ -223,7 +271,7 @@ const Toggle = /*@__PURE__*/ proxyCustomElement(class Toggle extends HTMLElement
|
|
|
223
271
|
* This element should only be rendered if hint text is set.
|
|
224
272
|
*/
|
|
225
273
|
renderHintText() {
|
|
226
|
-
const { helperText, errorText, helperTextId, errorTextId } = this;
|
|
274
|
+
const { helperText, errorText, helperTextId, errorTextId, isInvalid } = this;
|
|
227
275
|
/**
|
|
228
276
|
* undefined and empty string values should
|
|
229
277
|
* be treated as not having helper/error text.
|
|
@@ -232,15 +280,15 @@ const Toggle = /*@__PURE__*/ proxyCustomElement(class Toggle extends HTMLElement
|
|
|
232
280
|
if (!hasHintText) {
|
|
233
281
|
return;
|
|
234
282
|
}
|
|
235
|
-
return (h("div", { class: "toggle-bottom" }, h("div", { id: helperTextId, class: "helper-text", part: "supporting-text helper-text" }, helperText), h("div", { id: errorTextId, class: "error-text", part: "supporting-text error-text" }, errorText)));
|
|
283
|
+
return (h("div", { class: "toggle-bottom" }, h("div", { id: helperTextId, class: "helper-text", part: "supporting-text helper-text", "aria-live": "polite" }, !isInvalid ? helperText : null), h("div", { id: errorTextId, class: "error-text", part: "supporting-text error-text", role: "alert" }, isInvalid ? errorText : null)));
|
|
236
284
|
}
|
|
237
285
|
render() {
|
|
238
|
-
const { activated, alignment, checked, color, disabled, el,
|
|
286
|
+
const { activated, alignment, checked, color, disabled, el, hasLabel, inheritedAttributes, inputId, inputLabelId, justify, labelPlacement, name, required, } = this;
|
|
239
287
|
const mode = getIonMode(this);
|
|
240
288
|
const value = this.getValue();
|
|
241
289
|
const rtl = isRTL(el) ? 'rtl' : 'ltr';
|
|
242
290
|
renderHiddenInput(true, el, name, checked ? value : '', disabled);
|
|
243
|
-
return (h(Host, { key: '
|
|
291
|
+
return (h(Host, { key: 'f569148edd89ee041a4719ffc4733c16b05229bd', role: "switch", "aria-checked": `${checked}`, "aria-describedby": this.hintTextId, "aria-invalid": this.isInvalid ? 'true' : undefined, onClick: this.onClick, "aria-labelledby": hasLabel ? inputLabelId : null, "aria-label": inheritedAttributes['aria-label'] || null, "aria-disabled": disabled ? 'true' : null, "aria-required": required ? 'true' : undefined, tabindex: disabled ? undefined : 0, onKeyDown: this.onKeyDown, onFocus: this.onFocus, onBlur: this.onBlur, class: createColorClasses(color, {
|
|
244
292
|
[mode]: true,
|
|
245
293
|
'in-item': hostContext('ion-item', el),
|
|
246
294
|
'toggle-activated': activated,
|
|
@@ -250,10 +298,10 @@ const Toggle = /*@__PURE__*/ proxyCustomElement(class Toggle extends HTMLElement
|
|
|
250
298
|
[`toggle-alignment-${alignment}`]: alignment !== undefined,
|
|
251
299
|
[`toggle-label-placement-${labelPlacement}`]: true,
|
|
252
300
|
[`toggle-${rtl}`]: true,
|
|
253
|
-
}) }, h("label", { key: '
|
|
301
|
+
}) }, h("label", { key: '3027f2ac4be6de422a14486d847fbee77f615db1', class: "toggle-wrapper", htmlFor: inputId }, h("input", Object.assign({ key: '4b0304c9e879e432b80184b4e5de37d55c11b436', type: "checkbox", role: "switch", "aria-checked": `${checked}`, checked: checked, disabled: disabled, id: inputId, required: required }, inheritedAttributes)), h("div", { key: '8ef265ec942e7f01ff31cbb202ed146c6bf94e02', class: {
|
|
254
302
|
'label-text-wrapper': true,
|
|
255
303
|
'label-text-wrapper-hidden': !hasLabel,
|
|
256
|
-
}, part: "label", id: inputLabelId, onClick: this.onDivLabelClick }, h("slot", { key: '
|
|
304
|
+
}, part: "label", id: inputLabelId, onClick: this.onDivLabelClick }, h("slot", { key: '7b162b7dd27199cca2a4c995276a18b9f8e44aaf' }), this.renderHintText()), h("div", { key: 'd13c34bd42fca01cc73ddb4ea7e471b33a282a3e', class: "native-wrapper" }, this.renderToggleControl()))));
|
|
257
305
|
}
|
|
258
306
|
get el() { return this; }
|
|
259
307
|
static get watchers() { return {
|
|
@@ -276,7 +324,9 @@ const Toggle = /*@__PURE__*/ proxyCustomElement(class Toggle extends HTMLElement
|
|
|
276
324
|
"justify": [1],
|
|
277
325
|
"alignment": [1],
|
|
278
326
|
"required": [4],
|
|
279
|
-
"activated": [32]
|
|
327
|
+
"activated": [32],
|
|
328
|
+
"isInvalid": [32],
|
|
329
|
+
"hintTextId": [32]
|
|
280
330
|
}, undefined, {
|
|
281
331
|
"disabled": ["disabledChanged"]
|
|
282
332
|
}]);
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* (C) Ionic http://ionicframework.com - MIT License
|
|
3
|
+
*/
|
|
4
|
+
import { w as win } from './index9.js';
|
|
5
|
+
import { r as raf } from './helpers.js';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* A utility to calculate the size of an outline notch
|
|
9
|
+
* width relative to the content passed. This is used in
|
|
10
|
+
* components such as `ion-select` with `fill="outline"`
|
|
11
|
+
* where we need to pass slotted HTML content. This is not
|
|
12
|
+
* needed when rendering plaintext content because we can
|
|
13
|
+
* render the plaintext again hidden with `opacity: 0` inside
|
|
14
|
+
* of the notch. As a result we can rely on the intrinsic size
|
|
15
|
+
* of the element to correctly compute the notch width. We
|
|
16
|
+
* cannot do this with slotted content because we cannot project
|
|
17
|
+
* it into 2 places at once.
|
|
18
|
+
*
|
|
19
|
+
* @internal
|
|
20
|
+
* @param el: The host element
|
|
21
|
+
* @param getNotchSpacerEl: A function that returns a reference to the notch spacer element inside of the component template.
|
|
22
|
+
* @param getLabelSlot: A function that returns a reference to the slotted content.
|
|
23
|
+
*/
|
|
24
|
+
const createNotchController = (el, getNotchSpacerEl, getLabelSlot) => {
|
|
25
|
+
let notchVisibilityIO;
|
|
26
|
+
const needsExplicitNotchWidth = () => {
|
|
27
|
+
const notchSpacerEl = getNotchSpacerEl();
|
|
28
|
+
if (
|
|
29
|
+
/**
|
|
30
|
+
* If the notch is not being used
|
|
31
|
+
* then we do not need to set the notch width.
|
|
32
|
+
*/
|
|
33
|
+
notchSpacerEl === undefined ||
|
|
34
|
+
/**
|
|
35
|
+
* If either the label property is being
|
|
36
|
+
* used or the label slot is not defined,
|
|
37
|
+
* then we do not need to estimate the notch width.
|
|
38
|
+
*/
|
|
39
|
+
el.label !== undefined ||
|
|
40
|
+
getLabelSlot() === null) {
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
return true;
|
|
44
|
+
};
|
|
45
|
+
const calculateNotchWidth = () => {
|
|
46
|
+
if (needsExplicitNotchWidth()) {
|
|
47
|
+
/**
|
|
48
|
+
* Run this the frame after
|
|
49
|
+
* the browser has re-painted the host element.
|
|
50
|
+
* Otherwise, the label element may have a width
|
|
51
|
+
* of 0 and the IntersectionObserver will be used.
|
|
52
|
+
*/
|
|
53
|
+
raf(() => {
|
|
54
|
+
setNotchWidth();
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* When using a label prop we can render
|
|
60
|
+
* the label value inside of the notch and
|
|
61
|
+
* let the browser calculate the size of the notch.
|
|
62
|
+
* However, we cannot render the label slot in multiple
|
|
63
|
+
* places so we need to manually calculate the notch dimension
|
|
64
|
+
* based on the size of the slotted content.
|
|
65
|
+
*
|
|
66
|
+
* This function should only be used to set the notch width
|
|
67
|
+
* on slotted label content. The notch width for label prop
|
|
68
|
+
* content is automatically calculated based on the
|
|
69
|
+
* intrinsic size of the label text.
|
|
70
|
+
*/
|
|
71
|
+
const setNotchWidth = () => {
|
|
72
|
+
const notchSpacerEl = getNotchSpacerEl();
|
|
73
|
+
if (notchSpacerEl === undefined) {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
if (!needsExplicitNotchWidth()) {
|
|
77
|
+
notchSpacerEl.style.removeProperty('width');
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
const width = getLabelSlot().scrollWidth;
|
|
81
|
+
if (
|
|
82
|
+
/**
|
|
83
|
+
* If the computed width of the label is 0
|
|
84
|
+
* and notchSpacerEl's offsetParent is null
|
|
85
|
+
* then that means the element is hidden.
|
|
86
|
+
* As a result, we need to wait for the element
|
|
87
|
+
* to become visible before setting the notch width.
|
|
88
|
+
*
|
|
89
|
+
* We do not check el.offsetParent because
|
|
90
|
+
* that can be null if the host element has
|
|
91
|
+
* position: fixed applied to it.
|
|
92
|
+
* notchSpacerEl does not have position: fixed.
|
|
93
|
+
*/
|
|
94
|
+
width === 0 &&
|
|
95
|
+
notchSpacerEl.offsetParent === null &&
|
|
96
|
+
win !== undefined &&
|
|
97
|
+
'IntersectionObserver' in win) {
|
|
98
|
+
/**
|
|
99
|
+
* If there is an IO already attached
|
|
100
|
+
* then that will update the notch
|
|
101
|
+
* once the element becomes visible.
|
|
102
|
+
* As a result, there is no need to create
|
|
103
|
+
* another one.
|
|
104
|
+
*/
|
|
105
|
+
if (notchVisibilityIO !== undefined) {
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
const io = (notchVisibilityIO = new IntersectionObserver((ev) => {
|
|
109
|
+
/**
|
|
110
|
+
* If the element is visible then we
|
|
111
|
+
* can try setting the notch width again.
|
|
112
|
+
*/
|
|
113
|
+
if (ev[0].intersectionRatio === 1) {
|
|
114
|
+
setNotchWidth();
|
|
115
|
+
io.disconnect();
|
|
116
|
+
notchVisibilityIO = undefined;
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
/**
|
|
120
|
+
* Set the root to be the host element
|
|
121
|
+
* This causes the IO callback
|
|
122
|
+
* to be fired in WebKit as soon as the element
|
|
123
|
+
* is visible. If we used the default root value
|
|
124
|
+
* then WebKit would only fire the IO callback
|
|
125
|
+
* after any animations (such as a modal transition)
|
|
126
|
+
* finished, and there would potentially be a flicker.
|
|
127
|
+
*/
|
|
128
|
+
{ threshold: 0.01, root: el }));
|
|
129
|
+
io.observe(notchSpacerEl);
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* If the element is visible then we can set the notch width.
|
|
134
|
+
* The notch is only visible when the label is scaled,
|
|
135
|
+
* which is why we multiply the width by 0.75 as this is
|
|
136
|
+
* the same amount the label element is scaled by in the host CSS.
|
|
137
|
+
* (See $form-control-label-stacked-scale in ionic.globals.scss).
|
|
138
|
+
*/
|
|
139
|
+
notchSpacerEl.style.setProperty('width', `${width * 0.75}px`);
|
|
140
|
+
};
|
|
141
|
+
const destroy = () => {
|
|
142
|
+
if (notchVisibilityIO) {
|
|
143
|
+
notchVisibilityIO.disconnect();
|
|
144
|
+
notchVisibilityIO = undefined;
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
return {
|
|
148
|
+
calculateNotchWidth,
|
|
149
|
+
destroy,
|
|
150
|
+
};
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
export { createNotchController as c };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* (C) Ionic http://ionicframework.com - MIT License
|
|
3
3
|
*/
|
|
4
|
-
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
4
|
+
import { proxyCustomElement, HTMLElement, createEvent, Build, h, Host } from '@stencil/core/internal/client';
|
|
5
5
|
import { e as renderHiddenInput } from './helpers.js';
|
|
6
|
+
import { c as checkInvalidState } from './validity.js';
|
|
6
7
|
import { b as getIonMode } from './ionic-global.js';
|
|
7
8
|
|
|
8
9
|
const radioGroupIosCss = "ion-radio-group{vertical-align:top}.radio-group-wrapper{display:inline}.radio-group-top{line-height:1.5}.radio-group-top .error-text{display:none;color:var(--ion-color-danger, #c5000f)}.radio-group-top .helper-text{display:block;color:var(--ion-color-step-700, var(--ion-text-color-step-300, #4d4d4d))}.ion-touched.ion-invalid .radio-group-top .error-text{display:block}.ion-touched.ion-invalid .radio-group-top .helper-text{display:none}ion-list .radio-group-top{-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px}";
|
|
@@ -21,6 +22,10 @@ const RadioGroup = /*@__PURE__*/ proxyCustomElement(class RadioGroup extends HTM
|
|
|
21
22
|
this.helperTextId = `${this.inputId}-helper-text`;
|
|
22
23
|
this.errorTextId = `${this.inputId}-error-text`;
|
|
23
24
|
this.labelId = `${this.inputId}-lbl`;
|
|
25
|
+
/**
|
|
26
|
+
* Track validation state for proper aria-live announcements.
|
|
27
|
+
*/
|
|
28
|
+
this.isInvalid = false;
|
|
24
29
|
/**
|
|
25
30
|
* If `true`, the radios can be deselected.
|
|
26
31
|
*/
|
|
@@ -102,6 +107,52 @@ const RadioGroup = /*@__PURE__*/ proxyCustomElement(class RadioGroup extends HTM
|
|
|
102
107
|
this.labelId = label.id = this.name + '-lbl';
|
|
103
108
|
}
|
|
104
109
|
}
|
|
110
|
+
// Watch for class changes to update validation state.
|
|
111
|
+
if (Build.isBrowser && typeof MutationObserver !== 'undefined') {
|
|
112
|
+
this.validationObserver = new MutationObserver(() => {
|
|
113
|
+
const newIsInvalid = checkInvalidState(this.el);
|
|
114
|
+
if (this.isInvalid !== newIsInvalid) {
|
|
115
|
+
this.isInvalid = newIsInvalid;
|
|
116
|
+
/**
|
|
117
|
+
* Screen readers tend to announce changes
|
|
118
|
+
* to `aria-describedby` when the attribute
|
|
119
|
+
* is changed during a blur event for a
|
|
120
|
+
* native form control.
|
|
121
|
+
* However, the announcement can be spotty
|
|
122
|
+
* when using a non-native form control
|
|
123
|
+
* and `forceUpdate()`.
|
|
124
|
+
* This is due to `forceUpdate()` internally
|
|
125
|
+
* rescheduling the DOM update to a lower
|
|
126
|
+
* priority queue regardless if it's called
|
|
127
|
+
* inside a Promise or not, thus causing
|
|
128
|
+
* the screen reader to potentially miss the
|
|
129
|
+
* change.
|
|
130
|
+
* By using a State variable inside a Promise,
|
|
131
|
+
* it guarantees a re-render immediately at
|
|
132
|
+
* a higher priority.
|
|
133
|
+
*/
|
|
134
|
+
Promise.resolve().then(() => {
|
|
135
|
+
this.hintTextId = this.getHintTextId();
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
this.validationObserver.observe(this.el, {
|
|
140
|
+
attributes: true,
|
|
141
|
+
attributeFilter: ['class'],
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
// Always set initial state
|
|
145
|
+
this.isInvalid = checkInvalidState(this.el);
|
|
146
|
+
}
|
|
147
|
+
componentWillLoad() {
|
|
148
|
+
this.hintTextId = this.getHintTextId();
|
|
149
|
+
}
|
|
150
|
+
disconnectedCallback() {
|
|
151
|
+
// Clean up validation observer to prevent memory leaks.
|
|
152
|
+
if (this.validationObserver) {
|
|
153
|
+
this.validationObserver.disconnect();
|
|
154
|
+
this.validationObserver = undefined;
|
|
155
|
+
}
|
|
105
156
|
}
|
|
106
157
|
getRadios() {
|
|
107
158
|
return Array.from(this.el.querySelectorAll('ion-radio'));
|
|
@@ -177,16 +228,16 @@ const RadioGroup = /*@__PURE__*/ proxyCustomElement(class RadioGroup extends HTM
|
|
|
177
228
|
* Renders the helper text or error text values
|
|
178
229
|
*/
|
|
179
230
|
renderHintText() {
|
|
180
|
-
const { helperText, errorText, helperTextId, errorTextId } = this;
|
|
231
|
+
const { helperText, errorText, helperTextId, errorTextId, isInvalid } = this;
|
|
181
232
|
const hasHintText = !!helperText || !!errorText;
|
|
182
233
|
if (!hasHintText) {
|
|
183
234
|
return;
|
|
184
235
|
}
|
|
185
|
-
return (h("div", { class: "radio-group-top" }, h("div", { id: helperTextId, class: "helper-text" }, helperText), h("div", { id: errorTextId, class: "error-text" }, errorText)));
|
|
236
|
+
return (h("div", { class: "radio-group-top" }, h("div", { id: helperTextId, class: "helper-text", "aria-live": "polite" }, !isInvalid ? helperText : null), h("div", { id: errorTextId, class: "error-text", role: "alert" }, isInvalid ? errorText : null)));
|
|
186
237
|
}
|
|
187
|
-
|
|
188
|
-
const {
|
|
189
|
-
if (
|
|
238
|
+
getHintTextId() {
|
|
239
|
+
const { helperText, errorText, helperTextId, errorTextId, isInvalid } = this;
|
|
240
|
+
if (isInvalid && errorText) {
|
|
190
241
|
return errorTextId;
|
|
191
242
|
}
|
|
192
243
|
if (helperText) {
|
|
@@ -198,7 +249,7 @@ const RadioGroup = /*@__PURE__*/ proxyCustomElement(class RadioGroup extends HTM
|
|
|
198
249
|
const { label, labelId, el, name, value } = this;
|
|
199
250
|
const mode = getIonMode(this);
|
|
200
251
|
renderHiddenInput(true, el, name, value, false);
|
|
201
|
-
return (h(Host, { key: '
|
|
252
|
+
return (h(Host, { key: 'db593b3ed511e9395e3c7bfd91b787328692cd6d', role: "radiogroup", "aria-labelledby": label ? labelId : null, "aria-describedby": this.hintTextId, "aria-invalid": this.isInvalid ? 'true' : undefined, onClick: this.onClick, class: mode }, this.renderHintText(), h("div", { key: '85045b45a0100a45f3b9a35d1c5a25ec63d525c4', class: "radio-group-wrapper" }, h("slot", { key: '53dacb87ce62398e78771fb2efaf839ab922d946' }))));
|
|
202
253
|
}
|
|
203
254
|
get el() { return this; }
|
|
204
255
|
static get watchers() { return {
|
|
@@ -215,6 +266,8 @@ const RadioGroup = /*@__PURE__*/ proxyCustomElement(class RadioGroup extends HTM
|
|
|
215
266
|
"value": [1032],
|
|
216
267
|
"helperText": [1, "helper-text"],
|
|
217
268
|
"errorText": [1, "error-text"],
|
|
269
|
+
"isInvalid": [32],
|
|
270
|
+
"hintTextId": [32],
|
|
218
271
|
"setFocus": [64]
|
|
219
272
|
}, [[4, "keydown", "onKeydown"]], {
|
|
220
273
|
"value": ["valueChanged"]
|
package/components/validity.js
CHANGED
|
@@ -1,155 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* (C) Ionic http://ionicframework.com - MIT License
|
|
3
3
|
*/
|
|
4
|
-
import { w as win } from './index9.js';
|
|
5
|
-
import { r as raf } from './helpers.js';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* A utility to calculate the size of an outline notch
|
|
9
|
-
* width relative to the content passed. This is used in
|
|
10
|
-
* components such as `ion-select` with `fill="outline"`
|
|
11
|
-
* where we need to pass slotted HTML content. This is not
|
|
12
|
-
* needed when rendering plaintext content because we can
|
|
13
|
-
* render the plaintext again hidden with `opacity: 0` inside
|
|
14
|
-
* of the notch. As a result we can rely on the intrinsic size
|
|
15
|
-
* of the element to correctly compute the notch width. We
|
|
16
|
-
* cannot do this with slotted content because we cannot project
|
|
17
|
-
* it into 2 places at once.
|
|
18
|
-
*
|
|
19
|
-
* @internal
|
|
20
|
-
* @param el: The host element
|
|
21
|
-
* @param getNotchSpacerEl: A function that returns a reference to the notch spacer element inside of the component template.
|
|
22
|
-
* @param getLabelSlot: A function that returns a reference to the slotted content.
|
|
23
|
-
*/
|
|
24
|
-
const createNotchController = (el, getNotchSpacerEl, getLabelSlot) => {
|
|
25
|
-
let notchVisibilityIO;
|
|
26
|
-
const needsExplicitNotchWidth = () => {
|
|
27
|
-
const notchSpacerEl = getNotchSpacerEl();
|
|
28
|
-
if (
|
|
29
|
-
/**
|
|
30
|
-
* If the notch is not being used
|
|
31
|
-
* then we do not need to set the notch width.
|
|
32
|
-
*/
|
|
33
|
-
notchSpacerEl === undefined ||
|
|
34
|
-
/**
|
|
35
|
-
* If either the label property is being
|
|
36
|
-
* used or the label slot is not defined,
|
|
37
|
-
* then we do not need to estimate the notch width.
|
|
38
|
-
*/
|
|
39
|
-
el.label !== undefined ||
|
|
40
|
-
getLabelSlot() === null) {
|
|
41
|
-
return false;
|
|
42
|
-
}
|
|
43
|
-
return true;
|
|
44
|
-
};
|
|
45
|
-
const calculateNotchWidth = () => {
|
|
46
|
-
if (needsExplicitNotchWidth()) {
|
|
47
|
-
/**
|
|
48
|
-
* Run this the frame after
|
|
49
|
-
* the browser has re-painted the host element.
|
|
50
|
-
* Otherwise, the label element may have a width
|
|
51
|
-
* of 0 and the IntersectionObserver will be used.
|
|
52
|
-
*/
|
|
53
|
-
raf(() => {
|
|
54
|
-
setNotchWidth();
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
/**
|
|
59
|
-
* When using a label prop we can render
|
|
60
|
-
* the label value inside of the notch and
|
|
61
|
-
* let the browser calculate the size of the notch.
|
|
62
|
-
* However, we cannot render the label slot in multiple
|
|
63
|
-
* places so we need to manually calculate the notch dimension
|
|
64
|
-
* based on the size of the slotted content.
|
|
65
|
-
*
|
|
66
|
-
* This function should only be used to set the notch width
|
|
67
|
-
* on slotted label content. The notch width for label prop
|
|
68
|
-
* content is automatically calculated based on the
|
|
69
|
-
* intrinsic size of the label text.
|
|
70
|
-
*/
|
|
71
|
-
const setNotchWidth = () => {
|
|
72
|
-
const notchSpacerEl = getNotchSpacerEl();
|
|
73
|
-
if (notchSpacerEl === undefined) {
|
|
74
|
-
return;
|
|
75
|
-
}
|
|
76
|
-
if (!needsExplicitNotchWidth()) {
|
|
77
|
-
notchSpacerEl.style.removeProperty('width');
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
const width = getLabelSlot().scrollWidth;
|
|
81
|
-
if (
|
|
82
|
-
/**
|
|
83
|
-
* If the computed width of the label is 0
|
|
84
|
-
* and notchSpacerEl's offsetParent is null
|
|
85
|
-
* then that means the element is hidden.
|
|
86
|
-
* As a result, we need to wait for the element
|
|
87
|
-
* to become visible before setting the notch width.
|
|
88
|
-
*
|
|
89
|
-
* We do not check el.offsetParent because
|
|
90
|
-
* that can be null if the host element has
|
|
91
|
-
* position: fixed applied to it.
|
|
92
|
-
* notchSpacerEl does not have position: fixed.
|
|
93
|
-
*/
|
|
94
|
-
width === 0 &&
|
|
95
|
-
notchSpacerEl.offsetParent === null &&
|
|
96
|
-
win !== undefined &&
|
|
97
|
-
'IntersectionObserver' in win) {
|
|
98
|
-
/**
|
|
99
|
-
* If there is an IO already attached
|
|
100
|
-
* then that will update the notch
|
|
101
|
-
* once the element becomes visible.
|
|
102
|
-
* As a result, there is no need to create
|
|
103
|
-
* another one.
|
|
104
|
-
*/
|
|
105
|
-
if (notchVisibilityIO !== undefined) {
|
|
106
|
-
return;
|
|
107
|
-
}
|
|
108
|
-
const io = (notchVisibilityIO = new IntersectionObserver((ev) => {
|
|
109
|
-
/**
|
|
110
|
-
* If the element is visible then we
|
|
111
|
-
* can try setting the notch width again.
|
|
112
|
-
*/
|
|
113
|
-
if (ev[0].intersectionRatio === 1) {
|
|
114
|
-
setNotchWidth();
|
|
115
|
-
io.disconnect();
|
|
116
|
-
notchVisibilityIO = undefined;
|
|
117
|
-
}
|
|
118
|
-
},
|
|
119
|
-
/**
|
|
120
|
-
* Set the root to be the host element
|
|
121
|
-
* This causes the IO callback
|
|
122
|
-
* to be fired in WebKit as soon as the element
|
|
123
|
-
* is visible. If we used the default root value
|
|
124
|
-
* then WebKit would only fire the IO callback
|
|
125
|
-
* after any animations (such as a modal transition)
|
|
126
|
-
* finished, and there would potentially be a flicker.
|
|
127
|
-
*/
|
|
128
|
-
{ threshold: 0.01, root: el }));
|
|
129
|
-
io.observe(notchSpacerEl);
|
|
130
|
-
return;
|
|
131
|
-
}
|
|
132
|
-
/**
|
|
133
|
-
* If the element is visible then we can set the notch width.
|
|
134
|
-
* The notch is only visible when the label is scaled,
|
|
135
|
-
* which is why we multiply the width by 0.75 as this is
|
|
136
|
-
* the same amount the label element is scaled by in the host CSS.
|
|
137
|
-
* (See $form-control-label-stacked-scale in ionic.globals.scss).
|
|
138
|
-
*/
|
|
139
|
-
notchSpacerEl.style.setProperty('width', `${width * 0.75}px`);
|
|
140
|
-
};
|
|
141
|
-
const destroy = () => {
|
|
142
|
-
if (notchVisibilityIO) {
|
|
143
|
-
notchVisibilityIO.disconnect();
|
|
144
|
-
notchVisibilityIO = undefined;
|
|
145
|
-
}
|
|
146
|
-
};
|
|
147
|
-
return {
|
|
148
|
-
calculateNotchWidth,
|
|
149
|
-
destroy,
|
|
150
|
-
};
|
|
151
|
-
};
|
|
152
|
-
|
|
153
4
|
/**
|
|
154
5
|
* Checks if the form element is in an invalid state based on
|
|
155
6
|
* Ionic validation classes.
|
|
@@ -163,4 +14,4 @@ const checkInvalidState = (el) => {
|
|
|
163
14
|
return hasIonTouched && hasIonInvalid;
|
|
164
15
|
};
|
|
165
16
|
|
|
166
|
-
export { checkInvalidState as
|
|
17
|
+
export { checkInvalidState as c };
|