@ionic/core 9.0.12-dev.11794925657.15984d14 → 9.0.12-dev.11795023599.110c163a
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/ion-action-sheet.js +1 -1
- package/components/ion-alert.js +1 -1
- package/components/ion-datetime.js +1 -1
- package/components/ion-fab-button.js +1 -1
- package/components/ion-picker-column.js +1 -1
- package/components/ion-range.js +1 -1
- package/components/ion-refresher.js +1 -1
- package/components/ion-reorder-group.js +1 -1
- package/components/ion-select.js +1 -1
- package/components/ion-toggle.js +1 -1
- package/components/{p-Bl36leJI.js → p-BeEHsJM3.js} +1 -1
- package/components/p-CXQ6JEmL.js +4 -0
- package/components/{p-fCziDtBc.js → p-DUJ2gcEe.js} +1 -1
- package/components/{p-C6Eoe8TE.js → p-DfrQs1O0.js} +1 -1
- package/components/{p-DSGxE4YQ.js → p-yyRjU9O9.js} +1 -1
- package/dist/cjs/{button-active-B9Tkc4mf.js → button-active-D5wEis5p.js} +1 -1
- package/dist/cjs/{haptic-CRRCyhfL.js → haptic-CqVhfNKl.js} +6 -2
- package/dist/cjs/ion-action-sheet.cjs.entry.js +2 -2
- package/dist/cjs/ion-alert.cjs.entry.js +2 -2
- package/dist/cjs/ion-fab_3.cjs.entry.js +12 -5
- package/dist/cjs/ion-picker-column.cjs.entry.js +1 -1
- package/dist/cjs/ion-range.cjs.entry.js +61 -37
- package/dist/cjs/ion-refresher_2.cjs.entry.js +1 -1
- package/dist/cjs/ion-reorder_2.cjs.entry.js +1 -1
- package/dist/cjs/ion-toggle.cjs.entry.js +15 -7
- package/dist/cjs/ionic.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/fab-button/fab-button.ios.css +32 -6
- package/dist/collection/components/fab-button/fab-button.js +32 -3
- package/dist/collection/components/fab-button/fab-button.md.css +24 -5
- package/dist/collection/components/range/range.js +61 -37
- package/dist/collection/components/toggle/toggle.ios.css +11 -1
- package/dist/collection/components/toggle/toggle.js +51 -5
- package/dist/collection/utils/native/haptic.js +6 -2
- package/dist/docs.json +92 -3
- package/dist/esm/{button-active-C2jz6R8a.js → button-active-DuvOEEsE.js} +1 -1
- package/dist/esm/{haptic-ChR8my2M.js → haptic-C9ma6MwT.js} +6 -2
- package/dist/esm/ion-action-sheet.entry.js +2 -2
- package/dist/esm/ion-alert.entry.js +2 -2
- package/dist/esm/ion-fab_3.entry.js +13 -6
- package/dist/esm/ion-picker-column.entry.js +1 -1
- package/dist/esm/ion-range.entry.js +61 -37
- package/dist/esm/ion-refresher_2.entry.js +1 -1
- package/dist/esm/ion-reorder_2.entry.js +1 -1
- package/dist/esm/ion-toggle.entry.js +15 -7
- package/dist/esm/ionic.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/html.html-data.json +12 -0
- package/dist/ionic/ionic.esm.js +1 -1
- package/dist/ionic/{p-6e7d46fa.entry.js → p-498073c0.entry.js} +1 -1
- package/dist/ionic/{p-1ae4b282.entry.js → p-6c854d4a.entry.js} +1 -1
- package/dist/ionic/{p-d7749f70.entry.js → p-7f3c7fec.entry.js} +1 -1
- package/dist/ionic/p-99fd4028.entry.js +4 -0
- package/dist/ionic/{p-RJtRqfIz.js → p-BaU5Mt_n.js} +1 -1
- package/dist/ionic/p-CdqNYSOD.js +4 -0
- package/dist/ionic/{p-2f68b3c0.entry.js → p-c118ade8.entry.js} +1 -1
- package/dist/ionic/p-d0d4482d.entry.js +4 -0
- package/dist/ionic/{p-52186d6b.entry.js → p-d3b2bd6a.entry.js} +1 -1
- package/dist/ionic/p-e892e218.entry.js +4 -0
- package/dist/types/components/fab-button/fab-button.d.ts +6 -0
- package/dist/types/components/range/range-interface.d.ts +2 -30
- package/dist/types/components/range/range.d.ts +12 -5
- package/dist/types/components/toggle/toggle.d.ts +16 -1
- package/dist/types/components.d.ts +29 -0
- package/dist/types/interface.d.ts +1 -8
- package/dist/types/utils/config.d.ts +16 -0
- package/dist/types/utils/native/haptic.d.ts +2 -2
- package/hydrate/index.js +96 -50
- package/hydrate/index.mjs +96 -50
- package/package.json +1 -1
- package/components/p-CEW4RXZO.js +0 -4
- package/dist/ionic/p-74dda4e5.entry.js +0 -4
- package/dist/ionic/p-9a2b5db2.entry.js +0 -4
- package/dist/ionic/p-C_0lvVN_.js +0 -4
- package/dist/ionic/p-fcc5b886.entry.js +0 -4
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* (C) Ionic http://ionicframework.com - MIT License
|
|
3
3
|
*/
|
|
4
|
-
import { r as registerInstance, h, f as Host, g as getElement, d as createEvent, a as printIonWarning, j as forceUpdate } from './index-BGtO2Fhf.js';
|
|
4
|
+
import { r as registerInstance, h, f as Host, g as getElement, d as createEvent, a as printIonWarning, i as config, j as forceUpdate } from './index-BGtO2Fhf.js';
|
|
5
5
|
import { b as getIonMode } from './ionic-global-BDyJ_8I-.js';
|
|
6
6
|
import { c as createTabindexController } from './attribute-controller-ClTQeZiJ.js';
|
|
7
7
|
import { k as hasShadowDom, i as inheritAriaAttributes } from './helpers-BvbUHGGm.js';
|
|
@@ -80,9 +80,9 @@ const Fab = class {
|
|
|
80
80
|
};
|
|
81
81
|
Fab.style = fabCss();
|
|
82
82
|
|
|
83
|
-
const fabButtonIosCss = () => `:host{--color-activated:var(--color);--color-focused:var(--color);--color-hover:var(--color);--background-hover:var(--ion-color-primary-contrast, #fff);--background-hover-opacity:.08;--transition:background-color, opacity 100ms linear;--ripple-color:currentColor;--border-radius:50%;--border-width:0;--border-style:none;--border-color:initial;--padding-top:0;--padding-end:0;--padding-bottom:0;--padding-start:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;display:block;width:56px;height:56px;font-size:14px;text-align:center;text-overflow:ellipsis;text-transform:none;white-space:nowrap;-webkit-font-kerning:none;font-kerning:none}.button-native{border-radius:var(--border-radius);-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;display:block;position:relative;width:100%;height:100%;-webkit-transform:var(--transform);transform:var(--transform)
|
|
83
|
+
const fabButtonIosCss = () => `:host{--color-activated:var(--color);--color-focused:var(--color);--color-hover:var(--color);--background-hover:var(--ion-color-primary-contrast, #fff);--background-hover-opacity:.08;--transition:background-color, opacity 100ms linear;--ripple-color:currentColor;--border-radius:50%;--border-width:0;--border-style:none;--border-color:initial;--padding-top:0;--padding-end:0;--padding-bottom:0;--padding-start:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;display:block;width:56px;height:56px;font-size:14px;text-align:center;text-overflow:ellipsis;text-transform:none;white-space:nowrap;-webkit-font-kerning:none;font-kerning:none}.button-native{border-radius:var(--border-radius);-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;display:block;position:relative;width:100%;height:100%;-webkit-transform:var(--transform);transform:var(--transform);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);outline:none;background:var(--background);background-clip:padding-box;color:var(--color);-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow);contain:strict;cursor:pointer;overflow:hidden;z-index:0;-webkit-appearance:none;-moz-appearance:none;appearance:none;-webkit-box-sizing:border-box;box-sizing:border-box}::slotted(ion-icon){line-height:1}.button-native::after{left:0;right:0;top:0;bottom:0;position:absolute;content:"";opacity:0}.button-inner{left:0;right:0;top:0;display:-ms-flexbox;display:flex;position:absolute;-ms-flex-flow:row nowrap;flex-flow:row nowrap;-ms-flex-negative:0;flex-shrink:0;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;height:100%;z-index:1}:host(.fab-button-disabled){cursor:default;opacity:0.5;pointer-events:none}@media (any-hover: hover){:host(:hover) .button-native{color:var(--color-hover)}:host(:hover) .button-native::after{background:var(--background-hover);opacity:var(--background-hover-opacity)}}:host(.ion-focused) .button-native{color:var(--color-focused)}:host(.ion-focused) .button-native::after{background:var(--background-focused);opacity:var(--background-focused-opacity)}:host(.ion-activated) .button-native{color:var(--color-activated)}:host(.ion-activated) .button-native::after{background:var(--background-activated);opacity:var(--background-activated-opacity)}::slotted(ion-icon){line-height:1}:host(.fab-button-small){-webkit-margin-start:8px;margin-inline-start:8px;-webkit-margin-end:8px;margin-inline-end:8px;margin-top:8px;margin-bottom:8px;width:40px;height:40px}.close-icon{-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;margin-top:0;margin-bottom:0;left:0;right:0;top:0;position:absolute;height:100%;-webkit-transform:scale(0.4) rotateZ(-45deg);transform:scale(0.4) rotateZ(-45deg);font-size:var(--close-icon-font-size);opacity:0;z-index:1}:host(.fab-button-close-active) .close-icon{-webkit-transform:scale(1) rotateZ(0deg);transform:scale(1) rotateZ(0deg);opacity:1}:host(.fab-button-close-active) .button-inner{-webkit-transform:scale(0.4) rotateZ(45deg);transform:scale(0.4) rotateZ(45deg);opacity:0}ion-ripple-effect{color:var(--ripple-color)}:host(.fab-button-animated) .button-native{-webkit-transition:var(--transition);transition:var(--transition)}:host(.fab-button-animated) .button-inner,:host(.fab-button-animated) .close-icon{-webkit-transition:all ease-in-out 300ms;transition:all ease-in-out 300ms;-webkit-transition-property:opacity, -webkit-transform;transition-property:opacity, -webkit-transform;transition-property:transform, opacity;transition-property:transform, opacity, -webkit-transform}@media (prefers-reduced-motion: reduce){:host(.fab-button-animated) .button-native{-webkit-transform:none;transform:none}:host(.fab-button-animated) .button-inner,:host(.fab-button-animated) .close-icon{-webkit-transform:none;transform:none;-webkit-transition-property:opacity;transition-property:opacity}}@supports ((-webkit-backdrop-filter: blur(0)) or (backdrop-filter: blur(0))){:host(.fab-button-translucent) .button-native{-webkit-backdrop-filter:var(--backdrop-filter);backdrop-filter:var(--backdrop-filter)}}:host(.ion-color) .button-native{background:var(--ion-color-base);color:var(--ion-color-contrast)}:host{--background:var(--ion-color-primary, #0054e9);--background-activated:var(--ion-color-primary-shade, #004acd);--background-focused:var(--ion-color-primary-shade, #004acd);--background-hover:var(--ion-color-primary-tint, #1a65eb);--background-activated-opacity:1;--background-focused-opacity:1;--background-hover-opacity:1;--color:var(--ion-color-primary-contrast, #fff);--box-shadow:0 4px 16px rgba(0, 0, 0, 0.12);--transition:0.2s transform cubic-bezier(0.25, 1.11, 0.78, 1.59);--close-icon-font-size:28px}:host(.ion-activated){--box-shadow:0 4px 16px rgba(0, 0, 0, 0.12);--transition:0.2s transform ease-out}:host(.fab-button-animated.ion-activated){--transform:scale(1.1)}::slotted(ion-icon){font-size:28px}:host(.fab-button-in-list){--background:var(--ion-color-light, #f4f5f8);--background-activated:var(--ion-color-light-shade, #d7d8da);--background-focused:var(--background-activated);--background-hover:var(--ion-color-light-tint, #f5f6f9);--color:var(--ion-color-light-contrast, #000);--color-activated:var(--ion-color-light-contrast, #000);--color-focused:var(--color-activated);--transition:transform 200ms ease 10ms, opacity 200ms ease 10ms}:host(.fab-button-in-list) ::slotted(ion-icon){font-size:18px}:host(.ion-color.ion-focused) .button-native::after{background:var(--ion-color-shade)}:host(.ion-color.ion-focused) .button-native,:host(.ion-color.ion-activated) .button-native{color:var(--ion-color-contrast)}:host(.ion-color.ion-focused) .button-native::after,:host(.ion-color.ion-activated) .button-native::after{background:var(--ion-color-shade)}@media (any-hover: hover){:host(.ion-color:hover) .button-native{color:var(--ion-color-contrast)}:host(.ion-color:hover) .button-native::after{background:var(--ion-color-tint)}}@supports ((-webkit-backdrop-filter: blur(0)) or (backdrop-filter: blur(0))){:host(.fab-button-translucent){--background:rgba(var(--ion-color-primary-rgb, 0, 84, 233), 0.9);--background-hover:rgba(var(--ion-color-primary-rgb, 0, 84, 233), 0.8);--background-focused:rgba(var(--ion-color-primary-rgb, 0, 84, 233), 0.82);--backdrop-filter:saturate(180%) blur(20px)}:host(.fab-button-translucent-in-list){--background:rgba(var(--ion-color-light-rgb, 244, 245, 248), 0.9);--background-hover:rgba(var(--ion-color-light-rgb, 244, 245, 248), 0.8);--background-focused:rgba(var(--ion-color-light-rgb, 244, 245, 248), 0.82)}}@supports ((-webkit-backdrop-filter: blur(0)) or (backdrop-filter: blur(0))){@media (any-hover: hover){:host(.fab-button-translucent.ion-color:hover) .button-native{background:rgba(var(--ion-color-base-rgb), 0.8)}}:host(.ion-color.fab-button-translucent) .button-native{background:rgba(var(--ion-color-base-rgb), 0.9)}:host(.ion-color.ion-focused.fab-button-translucent) .button-native,:host(.ion-color.ion-activated.fab-button-translucent) .button-native{background:var(--ion-color-base)}}`;
|
|
84
84
|
|
|
85
|
-
const fabButtonMdCss = () => `:host{--color-activated:var(--color);--color-focused:var(--color);--color-hover:var(--color);--background-hover:var(--ion-color-primary-contrast, #fff);--background-hover-opacity:.08;--transition:background-color, opacity 100ms linear;--ripple-color:currentColor;--border-radius:50%;--border-width:0;--border-style:none;--border-color:initial;--padding-top:0;--padding-end:0;--padding-bottom:0;--padding-start:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;display:block;width:56px;height:56px;font-size:14px;text-align:center;text-overflow:ellipsis;text-transform:none;white-space:nowrap;-webkit-font-kerning:none;font-kerning:none}.button-native{border-radius:var(--border-radius);-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;display:block;position:relative;width:100%;height:100%;-webkit-transform:var(--transform);transform:var(--transform)
|
|
85
|
+
const fabButtonMdCss = () => `:host{--color-activated:var(--color);--color-focused:var(--color);--color-hover:var(--color);--background-hover:var(--ion-color-primary-contrast, #fff);--background-hover-opacity:.08;--transition:background-color, opacity 100ms linear;--ripple-color:currentColor;--border-radius:50%;--border-width:0;--border-style:none;--border-color:initial;--padding-top:0;--padding-end:0;--padding-bottom:0;--padding-start:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;display:block;width:56px;height:56px;font-size:14px;text-align:center;text-overflow:ellipsis;text-transform:none;white-space:nowrap;-webkit-font-kerning:none;font-kerning:none}.button-native{border-radius:var(--border-radius);-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;display:block;position:relative;width:100%;height:100%;-webkit-transform:var(--transform);transform:var(--transform);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);outline:none;background:var(--background);background-clip:padding-box;color:var(--color);-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow);contain:strict;cursor:pointer;overflow:hidden;z-index:0;-webkit-appearance:none;-moz-appearance:none;appearance:none;-webkit-box-sizing:border-box;box-sizing:border-box}::slotted(ion-icon){line-height:1}.button-native::after{left:0;right:0;top:0;bottom:0;position:absolute;content:"";opacity:0}.button-inner{left:0;right:0;top:0;display:-ms-flexbox;display:flex;position:absolute;-ms-flex-flow:row nowrap;flex-flow:row nowrap;-ms-flex-negative:0;flex-shrink:0;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;height:100%;z-index:1}:host(.fab-button-disabled){cursor:default;opacity:0.5;pointer-events:none}@media (any-hover: hover){:host(:hover) .button-native{color:var(--color-hover)}:host(:hover) .button-native::after{background:var(--background-hover);opacity:var(--background-hover-opacity)}}:host(.ion-focused) .button-native{color:var(--color-focused)}:host(.ion-focused) .button-native::after{background:var(--background-focused);opacity:var(--background-focused-opacity)}:host(.ion-activated) .button-native{color:var(--color-activated)}:host(.ion-activated) .button-native::after{background:var(--background-activated);opacity:var(--background-activated-opacity)}::slotted(ion-icon){line-height:1}:host(.fab-button-small){-webkit-margin-start:8px;margin-inline-start:8px;-webkit-margin-end:8px;margin-inline-end:8px;margin-top:8px;margin-bottom:8px;width:40px;height:40px}.close-icon{-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;margin-top:0;margin-bottom:0;left:0;right:0;top:0;position:absolute;height:100%;-webkit-transform:scale(0.4) rotateZ(-45deg);transform:scale(0.4) rotateZ(-45deg);font-size:var(--close-icon-font-size);opacity:0;z-index:1}:host(.fab-button-close-active) .close-icon{-webkit-transform:scale(1) rotateZ(0deg);transform:scale(1) rotateZ(0deg);opacity:1}:host(.fab-button-close-active) .button-inner{-webkit-transform:scale(0.4) rotateZ(45deg);transform:scale(0.4) rotateZ(45deg);opacity:0}ion-ripple-effect{color:var(--ripple-color)}:host(.fab-button-animated) .button-native{-webkit-transition:var(--transition);transition:var(--transition)}:host(.fab-button-animated) .button-inner,:host(.fab-button-animated) .close-icon{-webkit-transition:all ease-in-out 300ms;transition:all ease-in-out 300ms;-webkit-transition-property:opacity, -webkit-transform;transition-property:opacity, -webkit-transform;transition-property:transform, opacity;transition-property:transform, opacity, -webkit-transform}@media (prefers-reduced-motion: reduce){:host(.fab-button-animated) .button-native{-webkit-transform:none;transform:none}:host(.fab-button-animated) .button-inner,:host(.fab-button-animated) .close-icon{-webkit-transform:none;transform:none;-webkit-transition-property:opacity;transition-property:opacity}}@supports ((-webkit-backdrop-filter: blur(0)) or (backdrop-filter: blur(0))){:host(.fab-button-translucent) .button-native{-webkit-backdrop-filter:var(--backdrop-filter);backdrop-filter:var(--backdrop-filter)}}:host(.ion-color) .button-native{background:var(--ion-color-base);color:var(--ion-color-contrast)}:host{--background:var(--ion-color-primary, #0054e9);--background-activated:transparent;--background-focused:currentColor;--background-hover:currentColor;--background-activated-opacity:0;--background-focused-opacity:.24;--background-hover-opacity:.08;--color:var(--ion-color-primary-contrast, #fff);--box-shadow:0 3px 5px -1px rgba(0, 0, 0, 0.2), 0 6px 10px 0 rgba(0, 0, 0, 0.14), 0 1px 18px 0 rgba(0, 0, 0, 0.12);--transition:box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1), background-color 280ms cubic-bezier(0.4, 0, 0.2, 1), color 280ms cubic-bezier(0.4, 0, 0.2, 1), opacity 15ms linear 30ms, transform 270ms cubic-bezier(0, 0, 0.2, 1) 0ms;--close-icon-font-size:24px}:host(.ion-activated){--box-shadow:0 7px 8px -4px rgba(0, 0, 0, 0.2), 0 12px 17px 2px rgba(0, 0, 0, 0.14), 0 5px 22px 4px rgba(0, 0, 0, 0.12)}::slotted(ion-icon){font-size:24px}:host(.fab-button-in-list){--color:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.54);--color-activated:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.54);--color-focused:var(--color-activated);--background:var(--ion-color-light, #f4f5f8);--background-activated:transparent;--background-focused:var(--ion-color-light-shade, #d7d8da);--background-hover:var(--ion-color-light-tint, #f5f6f9)}:host(.fab-button-in-list) ::slotted(ion-icon){font-size:18px}:host(.ion-color.ion-focused) .button-native{color:var(--ion-color-contrast)}:host(.ion-color.ion-focused) .button-native::after{background:var(--ion-color-contrast)}:host(.ion-color.ion-activated) .button-native{color:var(--ion-color-contrast)}:host(.ion-color.ion-activated) .button-native::after{background:transparent}@media (any-hover: hover){:host(.ion-color:hover) .button-native{color:var(--ion-color-contrast)}:host(.ion-color:hover) .button-native::after{background:var(--ion-color-contrast)}}`;
|
|
86
86
|
|
|
87
87
|
const FabButton = class {
|
|
88
88
|
constructor(hostRef) {
|
|
@@ -98,6 +98,11 @@ const FabButton = class {
|
|
|
98
98
|
* If `true`, the fab button will be show a close icon.
|
|
99
99
|
*/
|
|
100
100
|
this.activated = false;
|
|
101
|
+
/**
|
|
102
|
+
* If `true`, the fab button will animate between states, such as
|
|
103
|
+
* swapping its content for the close icon.
|
|
104
|
+
*/
|
|
105
|
+
this.animated = true;
|
|
101
106
|
/**
|
|
102
107
|
* If `true`, the user cannot interact with the fab button.
|
|
103
108
|
*/
|
|
@@ -217,9 +222,10 @@ const FabButton = class {
|
|
|
217
222
|
this.tabindexController = createTabindexController(this.el, () => forceUpdate(this));
|
|
218
223
|
}
|
|
219
224
|
render() {
|
|
220
|
-
const { el, disabled, color, href, activated, show, translucent, size, inheritedAttributes, type } = this;
|
|
225
|
+
const { el, disabled, color, href, activated, animated, show, translucent, size, inheritedAttributes, type } = this;
|
|
221
226
|
const inList = hostContext('ion-fab-list', el);
|
|
222
227
|
const mode = getIonMode(this);
|
|
228
|
+
const shouldAnimate = animated && config.getBoolean('animated', true);
|
|
223
229
|
const tabindexAttributes = this.tabindexController?.attributes ?? {};
|
|
224
230
|
const TagType = href === undefined ? 'button' : 'a';
|
|
225
231
|
const attrs = TagType === 'button'
|
|
@@ -237,18 +243,19 @@ const FabButton = class {
|
|
|
237
243
|
if (type !== 'button') {
|
|
238
244
|
this.renderHiddenButton();
|
|
239
245
|
}
|
|
240
|
-
return (h(Host, { key: '
|
|
246
|
+
return (h(Host, { key: '78e48dd691cd7462ae43fb7d702d3bbd487ea578', onClick: this.onClick, "aria-disabled": disabled ? 'true' : null, class: createColorClasses(color, {
|
|
241
247
|
[mode]: true,
|
|
242
248
|
'fab-button-in-list': inList,
|
|
243
249
|
'fab-button-translucent-in-list': inList && translucent,
|
|
244
250
|
'fab-button-close-active': activated,
|
|
251
|
+
'fab-button-animated': shouldAnimate,
|
|
245
252
|
'fab-button-show': show,
|
|
246
253
|
'fab-button-disabled': disabled,
|
|
247
254
|
'fab-button-translucent': translucent,
|
|
248
255
|
'ion-activatable': true,
|
|
249
256
|
'ion-focusable': true,
|
|
250
257
|
[`fab-button-${size}`]: size !== undefined,
|
|
251
|
-
}) }, h(TagType, { key: '
|
|
258
|
+
}) }, h(TagType, { key: '38959b36a66ab9bf5e4b112db9081392c6b78219', ...attrs, class: "button-native", part: "native", disabled: disabled, onFocus: this.onFocus, onBlur: this.onBlur, onClick: (ev) => type === 'button' && openURL(href, ev, this.routerDirection, this.routerAnimation), ...inheritedAttributes, ...tabindexAttributes }, h("ion-icon", { key: 'c61e747b33cc1aee9d546a1adf1158374a742cb1', "aria-hidden": "true", icon: this.closeIcon, part: "close-icon", class: "close-icon", lazy: false }), h("span", { key: '3520c1d6cf7de8792e7e689ae5b7bd669adac789', class: "button-inner", part: "inner" }, h("slot", { key: '71b0c63be1461e87ef494eea8085f1be4f8cc4fc' })), mode === 'md' && h("ion-ripple-effect", { key: '4642494db6f0a4e3171e243eea4030c945a1d1c2' }))));
|
|
252
259
|
}
|
|
253
260
|
get el() { return getElement(this); }
|
|
254
261
|
static get watchers() { return {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { r as registerInstance, d as createEvent, h, f as Host, g as getElement } from './index-BGtO2Fhf.js';
|
|
5
5
|
import { n as doc, r as raf } from './helpers-BvbUHGGm.js';
|
|
6
|
-
import { h as hapticSelectionEnd, b as hapticSelectionStart, a as hapticSelectionChanged } from './haptic-
|
|
6
|
+
import { h as hapticSelectionEnd, b as hapticSelectionStart, a as hapticSelectionChanged } from './haptic-C9ma6MwT.js';
|
|
7
7
|
import { a as isPlatform, b as getIonMode } from './ionic-global-BDyJ_8I-.js';
|
|
8
8
|
import { c as createColorClasses } from './theme-byZM6qHV.js';
|
|
9
9
|
import './dir-Dj4J3LkD.js';
|
|
@@ -185,7 +185,7 @@ const Range = class {
|
|
|
185
185
|
* should not move.
|
|
186
186
|
*/
|
|
187
187
|
threshold: 10,
|
|
188
|
-
onStart: (
|
|
188
|
+
onStart: () => this.onStart(),
|
|
189
189
|
onMove: (ev) => this.onMove(ev),
|
|
190
190
|
onEnd: (ev) => this.onEnd(ev),
|
|
191
191
|
});
|
|
@@ -218,22 +218,23 @@ const Range = class {
|
|
|
218
218
|
syncActivated();
|
|
219
219
|
};
|
|
220
220
|
this.handleKeyboard = (knob, isIncrease) => {
|
|
221
|
+
const { ensureValueInBounds } = this;
|
|
221
222
|
let step = this.step;
|
|
222
223
|
step = step > 0 ? step : 1;
|
|
223
224
|
step = step / (this.max - this.min);
|
|
224
225
|
if (!isIncrease) {
|
|
225
226
|
step *= -1;
|
|
226
227
|
}
|
|
227
|
-
this.ionKnobMoveStart.emit(this.getKnobMoveDetail(knob));
|
|
228
228
|
if (knob === 'A') {
|
|
229
229
|
this.ratioA = clamp(0, this.ratioA + step, 1);
|
|
230
230
|
}
|
|
231
231
|
else {
|
|
232
232
|
this.ratioB = clamp(0, this.ratioB + step, 1);
|
|
233
233
|
}
|
|
234
|
+
this.ionKnobMoveStart.emit({ value: ensureValueInBounds(this.value) });
|
|
234
235
|
this.updateValue();
|
|
235
236
|
this.emitValueChange();
|
|
236
|
-
this.ionKnobMoveEnd.emit(this.
|
|
237
|
+
this.ionKnobMoveEnd.emit({ value: ensureValueInBounds(this.value) });
|
|
237
238
|
};
|
|
238
239
|
this.onBlur = () => {
|
|
239
240
|
if (this.hasFocus) {
|
|
@@ -426,32 +427,55 @@ const Range = class {
|
|
|
426
427
|
this.ionChange.emit({ value: this.value });
|
|
427
428
|
}
|
|
428
429
|
/**
|
|
429
|
-
*
|
|
430
|
-
*
|
|
431
|
-
*
|
|
430
|
+
* The value should be updated on touch end or
|
|
431
|
+
* when the component is being dragged.
|
|
432
|
+
* This follows the native behavior of mobile devices.
|
|
432
433
|
*
|
|
433
|
-
*
|
|
434
|
+
* For example: When the user lifts their finger from the
|
|
435
|
+
* screen after tapping the bar or dragging the bar or knob.
|
|
434
436
|
*/
|
|
435
|
-
onStart(
|
|
436
|
-
|
|
437
|
-
if (contentEl) {
|
|
438
|
-
this.initialContentScrollY = disableContentScrollY(contentEl);
|
|
439
|
-
}
|
|
440
|
-
/**
|
|
441
|
-
* Pick the knob before emitting so the start event can
|
|
442
|
-
* report it. It stays the same for the rest of the drag.
|
|
443
|
-
*/
|
|
444
|
-
const knob = this.setPressedKnob(startX);
|
|
445
|
-
this.ionKnobMoveStart.emit(this.getKnobMoveDetail(knob));
|
|
437
|
+
onStart() {
|
|
438
|
+
this.ionKnobMoveStart.emit({ value: this.ensureValueInBounds(this.value) });
|
|
446
439
|
}
|
|
447
440
|
/**
|
|
448
441
|
* The value should be updated while dragging the
|
|
449
442
|
* bar or knob.
|
|
450
443
|
*
|
|
444
|
+
* While the user is dragging, the view
|
|
445
|
+
* should not scroll. This is to prevent the user from
|
|
446
|
+
* feeling disoriented while dragging.
|
|
447
|
+
*
|
|
448
|
+
* The user can scroll on the view if the knob or
|
|
449
|
+
* bar is not being dragged.
|
|
450
|
+
*
|
|
451
451
|
* @param detail The details of the gesture event.
|
|
452
452
|
*/
|
|
453
453
|
onMove(detail) {
|
|
454
|
-
this
|
|
454
|
+
const { contentEl, pressedKnob } = this;
|
|
455
|
+
const currentX = detail.currentX;
|
|
456
|
+
/**
|
|
457
|
+
* Since the user is dragging on the bar or knob, the view should not scroll.
|
|
458
|
+
*
|
|
459
|
+
* This only needs to be done once.
|
|
460
|
+
*/
|
|
461
|
+
if (contentEl && this.pressedKnob === undefined) {
|
|
462
|
+
this.initialContentScrollY = disableContentScrollY(contentEl);
|
|
463
|
+
}
|
|
464
|
+
/**
|
|
465
|
+
* The `pressedKnob` can be undefined if the user just
|
|
466
|
+
* started dragging the knob.
|
|
467
|
+
*
|
|
468
|
+
* This is necessary to determine which knob the user is dragging,
|
|
469
|
+
* especially when using dual knobs.
|
|
470
|
+
* Plus, it determines when to apply certain styles.
|
|
471
|
+
*
|
|
472
|
+
* This only needs to be done once since the knob won't change
|
|
473
|
+
* while the user is dragging.
|
|
474
|
+
*/
|
|
475
|
+
if (pressedKnob === undefined) {
|
|
476
|
+
this.setPressedKnob(currentX);
|
|
477
|
+
}
|
|
478
|
+
this.update(currentX);
|
|
455
479
|
}
|
|
456
480
|
/**
|
|
457
481
|
* The value should be updated on touch end:
|
|
@@ -463,26 +487,35 @@ const Range = class {
|
|
|
463
487
|
onEnd(detail) {
|
|
464
488
|
const { contentEl, initialContentScrollY } = this;
|
|
465
489
|
const currentX = detail.currentX ?? detail.clientX;
|
|
490
|
+
/**
|
|
491
|
+
* The `pressedKnob` can be undefined if the user never
|
|
492
|
+
* dragged the knob. They just tapped on the bar.
|
|
493
|
+
*
|
|
494
|
+
* This is necessary to determine which knob the user is changing,
|
|
495
|
+
* especially when using dual knobs.
|
|
496
|
+
* Plus, it determines when to apply certain styles.
|
|
497
|
+
*/
|
|
498
|
+
if (this.pressedKnob === undefined) {
|
|
499
|
+
this.setPressedKnob(currentX);
|
|
500
|
+
}
|
|
466
501
|
/**
|
|
467
502
|
* The user is no longer dragging the bar or
|
|
468
503
|
* knob (if they were dragging it).
|
|
469
504
|
*
|
|
470
505
|
* The user can now scroll on the view in the next gesture event.
|
|
471
506
|
*/
|
|
472
|
-
if (contentEl) {
|
|
507
|
+
if (contentEl && this.pressedKnob !== undefined) {
|
|
473
508
|
resetContentScrollY(contentEl, initialContentScrollY);
|
|
474
509
|
}
|
|
475
510
|
// update the active knob's position
|
|
476
511
|
this.update(currentX);
|
|
477
|
-
// The pressed knob is always set because `onStart` runs first.
|
|
478
|
-
const knob = this.pressedKnob;
|
|
479
512
|
/**
|
|
480
513
|
* Reset the pressed knob to undefined since the user
|
|
481
514
|
* may start dragging a different knob in the next gesture event.
|
|
482
515
|
*/
|
|
483
516
|
this.pressedKnob = undefined;
|
|
484
517
|
this.emitValueChange();
|
|
485
|
-
this.ionKnobMoveEnd.emit(this.
|
|
518
|
+
this.ionKnobMoveEnd.emit({ value: this.ensureValueInBounds(this.value) });
|
|
486
519
|
}
|
|
487
520
|
update(currentX) {
|
|
488
521
|
// figure out where the pointer is currently at
|
|
@@ -506,13 +539,6 @@ const Range = class {
|
|
|
506
539
|
// Update input value
|
|
507
540
|
this.updateValue();
|
|
508
541
|
}
|
|
509
|
-
getKnobMoveDetail(knob) {
|
|
510
|
-
return {
|
|
511
|
-
value: this.ensureValueInBounds(this.value),
|
|
512
|
-
knob,
|
|
513
|
-
position: getKnobPosition(knob, this.ratioA, this.ratioB, this.dualKnobs),
|
|
514
|
-
};
|
|
515
|
-
}
|
|
516
542
|
setPressedKnob(currentX) {
|
|
517
543
|
const rect = (this.rect = this.rangeSlider.getBoundingClientRect());
|
|
518
544
|
// figure out which knob they started closer to
|
|
@@ -520,9 +546,7 @@ const Range = class {
|
|
|
520
546
|
if (isRTL(this.el)) {
|
|
521
547
|
ratio = 1 - ratio;
|
|
522
548
|
}
|
|
523
|
-
|
|
524
|
-
this.pressedKnob = knob;
|
|
525
|
-
return knob;
|
|
549
|
+
this.pressedKnob = !this.dualKnobs || Math.abs(this.ratioA - ratio) < Math.abs(this.ratioB - ratio) ? 'A' : 'B';
|
|
526
550
|
}
|
|
527
551
|
get valA() {
|
|
528
552
|
return ratioToValue(this.ratioA, this.min, this.max, this.step);
|
|
@@ -687,7 +711,7 @@ const Range = class {
|
|
|
687
711
|
* dragged, the pressedKnob will be defined.
|
|
688
712
|
*/
|
|
689
713
|
if (this.pressedKnob === undefined) {
|
|
690
|
-
this.onStart(
|
|
714
|
+
this.onStart();
|
|
691
715
|
this.onEnd(ev);
|
|
692
716
|
}
|
|
693
717
|
} }, ticks.map((tick) => (h("div", { style: tickStyle(tick), role: "presentation", class: {
|
|
@@ -771,7 +795,7 @@ const Range = class {
|
|
|
771
795
|
const valueAtMin = dualKnobs ? this.valA === min || this.valB === min : this.valA === min;
|
|
772
796
|
const valueAtMax = dualKnobs ? this.valA === max || this.valB === max : this.valA === max;
|
|
773
797
|
renderHiddenInput(true, el, this.name, JSON.stringify(this.getValue()), disabled);
|
|
774
|
-
return (h(Host, { key: '
|
|
798
|
+
return (h(Host, { key: '72f253ee1514b4c5874a6720c2f954fae7a7c4d4', onFocusin: this.onFocus, onFocusout: this.onBlur, id: rangeId, class: createColorClasses(this.color, {
|
|
775
799
|
[mode]: true,
|
|
776
800
|
'in-item': inItem,
|
|
777
801
|
'range-disabled': disabled,
|
|
@@ -785,10 +809,10 @@ const Range = class {
|
|
|
785
809
|
'range-item-end-adjustment': needsEndAdjustment,
|
|
786
810
|
'range-value-min': valueAtMin,
|
|
787
811
|
'range-value-max': valueAtMax,
|
|
788
|
-
}) }, h("label", { key: '
|
|
812
|
+
}) }, h("label", { key: '9b96b83a6118ee2a79d8adbb0a58197470308179', class: "range-wrapper", id: "range-label" }, h("div", { key: 'c7b31a7c87c20857a26624bd94501df6420fceec', class: {
|
|
789
813
|
'label-text-wrapper': true,
|
|
790
814
|
'label-text-wrapper-hidden': !hasLabel,
|
|
791
|
-
}, part: "label" }, label !== undefined ? h("div", { class: "label-text" }, label) : h("slot", { name: "label" })), h("div", { key: '
|
|
815
|
+
}, part: "label" }, label !== undefined ? h("div", { class: "label-text" }, label) : h("slot", { name: "label" })), h("div", { key: '4ca15b9370097e140550489ff24979f3a959e65b', class: "native-wrapper" }, h("slot", { key: 'f110896c68741bad92239f98b6028cbe0ad5122f', name: "start" }), this.renderRangeSlider(), h("slot", { key: '5c4031c4403fa643ee2e11637b2420ddd8cbc4ce', name: "end" })))));
|
|
792
816
|
}
|
|
793
817
|
get el() { return getElement(this); }
|
|
794
818
|
static get watchers() { return {
|
|
@@ -5,7 +5,7 @@ import { w as writeTask, r as registerInstance, d as createEvent, e as readTask,
|
|
|
5
5
|
import { g as getTimeGivenProgression } from './cubic-bezier-hHmYLOfE.js';
|
|
6
6
|
import { I as ION_CONTENT_CLASS_SELECTOR, c as ION_CONTENT_ELEMENT_SELECTOR, p as printIonContentErrorMsg, e as findRefresherScrollHost, g as getScrollElement } from './index-BObCPR8a.js';
|
|
7
7
|
import { c as componentOnReady, t as transitionEndAsync, e as clamp, g as getElementRoot, r as raf } from './helpers-BvbUHGGm.js';
|
|
8
|
-
import { d as hapticImpact, I as ImpactStyle } from './haptic-
|
|
8
|
+
import { d as hapticImpact, I as ImpactStyle } from './haptic-C9ma6MwT.js';
|
|
9
9
|
import { b as getIonMode } from './ionic-global-BDyJ_8I-.js';
|
|
10
10
|
import { c as createAnimation } from './animation-DC5AcIYI.js';
|
|
11
11
|
import { E as ENABLE_HTML_CONTENT_DEFAULT } from './config-DWCzVL3Y.js';
|
|
@@ -6,7 +6,7 @@ import { n as reorderThreeOutline, o as reorderTwoSharp } from './index-BvabGprD
|
|
|
6
6
|
import { b as getIonMode } from './ionic-global-BDyJ_8I-.js';
|
|
7
7
|
import { a as findClosestIonContent, g as getScrollElement } from './index-BObCPR8a.js';
|
|
8
8
|
import { r as raf } from './helpers-BvbUHGGm.js';
|
|
9
|
-
import { b as hapticSelectionStart, a as hapticSelectionChanged, h as hapticSelectionEnd } from './haptic-
|
|
9
|
+
import { b as hapticSelectionStart, a as hapticSelectionChanged, h as hapticSelectionEnd } from './haptic-C9ma6MwT.js';
|
|
10
10
|
import './dir-Dj4J3LkD.js';
|
|
11
11
|
import './capacitor-Bt0eJ0hM.js';
|
|
12
12
|
|
|
@@ -6,13 +6,13 @@ import { i as inheritAriaAttributes, a as renderHiddenInput } from './helpers-Bv
|
|
|
6
6
|
import { i as isRTL } from './dir-Dj4J3LkD.js';
|
|
7
7
|
import { c as createItemMultipleInputsObserver } from './item-multiple-inputs-IPlsPhUJ.js';
|
|
8
8
|
import { c as checkInvalidState } from './validity-DJztqcrH.js';
|
|
9
|
-
import { c as hapticSelection } from './haptic-
|
|
9
|
+
import { c as hapticSelection } from './haptic-C9ma6MwT.js';
|
|
10
10
|
import { a as isPlatform, b as getIonMode } from './ionic-global-BDyJ_8I-.js';
|
|
11
11
|
import { h as hostContext, c as createColorClasses } from './theme-byZM6qHV.js';
|
|
12
12
|
import { j as checkmarkOutline, r as removeOutline, k as ellipseOutline } from './index-BvabGprD.js';
|
|
13
13
|
import './capacitor-Bt0eJ0hM.js';
|
|
14
14
|
|
|
15
|
-
const toggleIosCss = () => `:host{-webkit-box-sizing:content-box !important;box-sizing:content-box !important;display:inline-block;position:relative;max-width:100%;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:2}:host(.in-item){-ms-flex:1 1 0px;flex:1 1 0;width:100%;height:100%}:host([slot=start]),:host([slot=end]){-ms-flex:initial;flex:initial;width:auto}:host(.toggle-disabled){pointer-events:none}input{display:none}:host(:focus){outline:none}.toggle-wrapper{display:-ms-flexbox;display:flex;position:relative;-ms-flex-positive:1;flex-grow:1;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;height:inherit;-webkit-transition:background-color 15ms linear;transition:background-color 15ms linear;cursor:inherit}.label-text-wrapper{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}:host(.in-item) .label-text-wrapper{margin-top:10px;margin-bottom:10px}:host(.in-item.toggle-label-placement-stacked) .label-text-wrapper{margin-top:10px;margin-bottom:16px}:host(.in-item.toggle-label-placement-stacked) .native-wrapper{margin-bottom:10px}.label-text-wrapper-hidden{display:none}.native-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.toggle-bottom{padding-top:4px;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;font-size:0.75rem;white-space:normal}:host(.toggle-label-placement-stacked) .toggle-bottom{font-size:1rem}.toggle-bottom .error-text{display:none;color:var(--ion-color-danger, #c5000f)}.toggle-bottom .helper-text{display:block;color:var(--ion-color-step-700, var(--ion-text-color-step-300, #4d4d4d))}:host(.ion-touched.ion-invalid) .toggle-bottom .error-text{display:block}:host(.ion-touched.ion-invalid) .toggle-bottom .helper-text{display:none}:host(.toggle-label-placement-start) .toggle-wrapper{-ms-flex-direction:row;flex-direction:row}:host(.toggle-label-placement-start) .label-text-wrapper{-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:16px;margin-inline-end:16px}:host(.toggle-label-placement-end) .toggle-wrapper{-ms-flex-direction:row-reverse;flex-direction:row-reverse;-ms-flex-pack:start;justify-content:start}:host(.toggle-label-placement-end) .label-text-wrapper{-webkit-margin-start:16px;margin-inline-start:16px;-webkit-margin-end:0;margin-inline-end:0}:host(.toggle-label-placement-fixed) .label-text-wrapper{-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:16px;margin-inline-end:16px}:host(.toggle-label-placement-fixed) .label-text-wrapper{-ms-flex:0 0 100px;flex:0 0 100px;width:100px;min-width:100px;max-width:200px}:host(.toggle-label-placement-stacked) .toggle-wrapper{-ms-flex-direction:column;flex-direction:column;text-align:center}:host(.toggle-label-placement-stacked) .label-text-wrapper{-webkit-transform:scale(0.75);transform:scale(0.75);margin-left:0;margin-right:0;margin-bottom:16px;max-width:calc(100% / 0.75)}:host(.toggle-label-placement-stacked.toggle-alignment-start) .label-text-wrapper{-webkit-transform-origin:left top;transform-origin:left top}:host-context([dir=rtl]):host(.toggle-label-placement-stacked.toggle-alignment-start) .label-text-wrapper,:host-context([dir=rtl]).toggle-label-placement-stacked.toggle-alignment-start .label-text-wrapper{-webkit-transform-origin:right top;transform-origin:right top}@supports selector(:dir(rtl)){:host(.toggle-label-placement-stacked.toggle-alignment-start:dir(rtl)) .label-text-wrapper{-webkit-transform-origin:right top;transform-origin:right top}}:host(.toggle-label-placement-stacked.toggle-alignment-center) .label-text-wrapper{-webkit-transform-origin:center top;transform-origin:center top}:host-context([dir=rtl]):host(.toggle-label-placement-stacked.toggle-alignment-center) .label-text-wrapper,:host-context([dir=rtl]).toggle-label-placement-stacked.toggle-alignment-center .label-text-wrapper{-webkit-transform-origin:calc(100% - center) top;transform-origin:calc(100% - center) top}@supports selector(:dir(rtl)){:host(.toggle-label-placement-stacked.toggle-alignment-center:dir(rtl)) .label-text-wrapper{-webkit-transform-origin:calc(100% - center) top;transform-origin:calc(100% - center) top}}:host(.toggle-justify-space-between) .toggle-wrapper{-ms-flex-pack:justify;justify-content:space-between}:host(.toggle-justify-start) .toggle-wrapper{-ms-flex-pack:start;justify-content:start}:host(.toggle-justify-end) .toggle-wrapper{-ms-flex-pack:end;justify-content:end}:host(.toggle-alignment-start) .toggle-wrapper{-ms-flex-align:start;align-items:start}:host(.toggle-alignment-center) .toggle-wrapper{-ms-flex-align:center;align-items:center}:host(.toggle-justify-space-between),:host(.toggle-justify-start),:host(.toggle-justify-end),:host(.toggle-alignment-start),:host(.toggle-alignment-center){display:block}.toggle-icon-wrapper{display:-ms-flexbox;display:flex;position:relative;-ms-flex-align:center;align-items:center;width:100%;height:100%;-webkit-transition:var(--handle-transition);transition:var(--handle-transition);will-change:transform}.toggle-icon{border-radius:var(--border-radius);display:block;position:relative;width:100%;height:100%;background:var(--track-background);overflow:inherit}:host(.toggle-checked) .toggle-icon{background:var(--track-background-checked)}.toggle-inner{border-radius:var(--handle-border-radius);position:absolute;left:var(--handle-spacing);width:var(--handle-width);height:var(--handle-height);max-height:var(--handle-max-height);-webkit-transition:var(--handle-transition);transition:var(--handle-transition);background:var(--handle-background);-webkit-box-shadow:var(--handle-box-shadow);box-shadow:var(--handle-box-shadow);contain:strict}:host(.toggle-ltr) .toggle-inner{left:var(--handle-spacing)}:host(.toggle-rtl) .toggle-inner{right:var(--handle-spacing)}:host(.toggle-ltr.toggle-checked) .toggle-icon-wrapper{-webkit-transform:translate3d(calc(100% - var(--handle-width)), 0, 0);transform:translate3d(calc(100% - var(--handle-width)), 0, 0)}:host(.toggle-rtl.toggle-checked) .toggle-icon-wrapper{-webkit-transform:translate3d(calc(-100% + var(--handle-width)), 0, 0);transform:translate3d(calc(-100% + var(--handle-width)), 0, 0)}:host(.toggle-checked) .toggle-inner{background:var(--handle-background-checked)}:host(.toggle-ltr.toggle-checked) .toggle-inner{-webkit-transform:translate3d(calc(var(--handle-spacing) * -2), 0, 0);transform:translate3d(calc(var(--handle-spacing) * -2), 0, 0)}:host(.toggle-rtl.toggle-checked) .toggle-inner{-webkit-transform:translate3d(calc(var(--handle-spacing) * 2), 0, 0);transform:translate3d(calc(var(--handle-spacing) * 2), 0, 0)}:host{--track-background:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.088);--track-background-checked:var(--ion-color-primary, #0054e9);--border-radius:15.5px;--handle-background:#ffffff;--handle-background-checked:#ffffff;--handle-border-radius:25.5px;--handle-box-shadow:0 3px 4px rgba(0, 0, 0, 0.06), 0 3px 8px rgba(0, 0, 0, 0.06);--handle-height:calc(31px - (2px * 2));--handle-max-height:calc(100% - var(--handle-spacing) * 2);--handle-width:calc(31px - (2px * 2));--handle-spacing:2px;--handle-transition:transform 300ms, width 120ms ease-in-out 80ms, left 110ms ease-in-out 80ms, right 110ms ease-in-out 80ms}.native-wrapper .toggle-icon{width:51px;height:31px;overflow:hidden}:host(.ion-color.toggle-checked) .toggle-icon{background:var(--ion-color-base)}:host(.toggle-activated) .toggle-switch-icon{opacity:0}.toggle-icon{-webkit-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);-webkit-transition:background-color 300ms;transition:background-color 300ms}.toggle-inner{will-change:transform}.toggle-switch-icon{position:absolute;top:50%;width:11px;height:11px;-webkit-transform:translateY(-50%);transform:translateY(-50%);-webkit-transition:opacity 300ms, color 300ms;transition:opacity 300ms, color 300ms}.toggle-switch-icon{position:absolute;color:var(--ion-color-dark, #222428)}:host(.toggle-ltr) .toggle-switch-icon{right:6px}:host(.toggle-rtl) .toggle-switch-icon{right:initial;left:6px;}:host(.toggle-checked) .toggle-switch-icon.toggle-switch-icon-checked{color:var(--ion-color-contrast, #fff)}:host(.toggle-checked) .toggle-switch-icon:not(.toggle-switch-icon-checked){opacity:0}.toggle-switch-icon-checked{position:absolute;width:15px;height:15px;-webkit-transform:translateY(-50%) rotate(90deg);transform:translateY(-50%) rotate(90deg)}:host(.toggle-ltr) .toggle-switch-icon-checked{right:initial;left:4px;}:host(.toggle-rtl) .toggle-switch-icon-checked{right:4px}:host(.toggle-activated) .toggle-icon::before,:host(.toggle-checked) .toggle-icon::before{-webkit-transform:scale3d(0, 0, 0);transform:scale3d(0, 0, 0)}:host(.toggle-activated.toggle-checked) .toggle-inner::before{-webkit-transform:scale3d(0, 0, 0);transform:scale3d(0, 0, 0)}:host(.toggle-activated) .toggle-inner{width:calc(var(--handle-width) + 6px)}:host(.toggle-ltr.toggle-activated.toggle-checked) .toggle-icon-wrapper{-webkit-transform:translate3d(calc(100% - var(--handle-width) - 6px), 0, 0);transform:translate3d(calc(100% - var(--handle-width) - 6px), 0, 0)}:host(.toggle-rtl.toggle-activated.toggle-checked) .toggle-icon-wrapper{-webkit-transform:translate3d(calc(-100% + var(--handle-width) + 6px), 0, 0);transform:translate3d(calc(-100% + var(--handle-width) + 6px), 0, 0)}:host(.toggle-disabled){opacity:0.3}:host(.ion-focused:not(.toggle-defers-indicator)) .toggle-icon{-webkit-box-shadow:0 0 0 4px rgba(var(--ion-color-primary-rgb, 0, 84, 233), 0.2);box-shadow:0 0 0 4px rgba(var(--ion-color-primary-rgb, 0, 84, 233), 0.2)}:host(.ion-color.ion-focused.toggle-checked:not(.toggle-defers-indicator)) .toggle-icon{-webkit-box-shadow:0 0 0 4px rgba(var(--ion-color-base-rgb), 0.2);box-shadow:0 0 0 4px rgba(var(--ion-color-base-rgb), 0.2)}`;
|
|
15
|
+
const toggleIosCss = () => `:host{-webkit-box-sizing:content-box !important;box-sizing:content-box !important;display:inline-block;position:relative;max-width:100%;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:2}:host(.in-item){-ms-flex:1 1 0px;flex:1 1 0;width:100%;height:100%}:host([slot=start]),:host([slot=end]){-ms-flex:initial;flex:initial;width:auto}:host(.toggle-disabled){pointer-events:none}input{display:none}:host(:focus){outline:none}.toggle-wrapper{display:-ms-flexbox;display:flex;position:relative;-ms-flex-positive:1;flex-grow:1;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;height:inherit;-webkit-transition:background-color 15ms linear;transition:background-color 15ms linear;cursor:inherit}.label-text-wrapper{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}:host(.in-item) .label-text-wrapper{margin-top:10px;margin-bottom:10px}:host(.in-item.toggle-label-placement-stacked) .label-text-wrapper{margin-top:10px;margin-bottom:16px}:host(.in-item.toggle-label-placement-stacked) .native-wrapper{margin-bottom:10px}.label-text-wrapper-hidden{display:none}.native-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.toggle-bottom{padding-top:4px;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;font-size:0.75rem;white-space:normal}:host(.toggle-label-placement-stacked) .toggle-bottom{font-size:1rem}.toggle-bottom .error-text{display:none;color:var(--ion-color-danger, #c5000f)}.toggle-bottom .helper-text{display:block;color:var(--ion-color-step-700, var(--ion-text-color-step-300, #4d4d4d))}:host(.ion-touched.ion-invalid) .toggle-bottom .error-text{display:block}:host(.ion-touched.ion-invalid) .toggle-bottom .helper-text{display:none}:host(.toggle-label-placement-start) .toggle-wrapper{-ms-flex-direction:row;flex-direction:row}:host(.toggle-label-placement-start) .label-text-wrapper{-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:16px;margin-inline-end:16px}:host(.toggle-label-placement-end) .toggle-wrapper{-ms-flex-direction:row-reverse;flex-direction:row-reverse;-ms-flex-pack:start;justify-content:start}:host(.toggle-label-placement-end) .label-text-wrapper{-webkit-margin-start:16px;margin-inline-start:16px;-webkit-margin-end:0;margin-inline-end:0}:host(.toggle-label-placement-fixed) .label-text-wrapper{-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:16px;margin-inline-end:16px}:host(.toggle-label-placement-fixed) .label-text-wrapper{-ms-flex:0 0 100px;flex:0 0 100px;width:100px;min-width:100px;max-width:200px}:host(.toggle-label-placement-stacked) .toggle-wrapper{-ms-flex-direction:column;flex-direction:column;text-align:center}:host(.toggle-label-placement-stacked) .label-text-wrapper{-webkit-transform:scale(0.75);transform:scale(0.75);margin-left:0;margin-right:0;margin-bottom:16px;max-width:calc(100% / 0.75)}:host(.toggle-label-placement-stacked.toggle-alignment-start) .label-text-wrapper{-webkit-transform-origin:left top;transform-origin:left top}:host-context([dir=rtl]):host(.toggle-label-placement-stacked.toggle-alignment-start) .label-text-wrapper,:host-context([dir=rtl]).toggle-label-placement-stacked.toggle-alignment-start .label-text-wrapper{-webkit-transform-origin:right top;transform-origin:right top}@supports selector(:dir(rtl)){:host(.toggle-label-placement-stacked.toggle-alignment-start:dir(rtl)) .label-text-wrapper{-webkit-transform-origin:right top;transform-origin:right top}}:host(.toggle-label-placement-stacked.toggle-alignment-center) .label-text-wrapper{-webkit-transform-origin:center top;transform-origin:center top}:host-context([dir=rtl]):host(.toggle-label-placement-stacked.toggle-alignment-center) .label-text-wrapper,:host-context([dir=rtl]).toggle-label-placement-stacked.toggle-alignment-center .label-text-wrapper{-webkit-transform-origin:calc(100% - center) top;transform-origin:calc(100% - center) top}@supports selector(:dir(rtl)){:host(.toggle-label-placement-stacked.toggle-alignment-center:dir(rtl)) .label-text-wrapper{-webkit-transform-origin:calc(100% - center) top;transform-origin:calc(100% - center) top}}:host(.toggle-justify-space-between) .toggle-wrapper{-ms-flex-pack:justify;justify-content:space-between}:host(.toggle-justify-start) .toggle-wrapper{-ms-flex-pack:start;justify-content:start}:host(.toggle-justify-end) .toggle-wrapper{-ms-flex-pack:end;justify-content:end}:host(.toggle-alignment-start) .toggle-wrapper{-ms-flex-align:start;align-items:start}:host(.toggle-alignment-center) .toggle-wrapper{-ms-flex-align:center;align-items:center}:host(.toggle-justify-space-between),:host(.toggle-justify-start),:host(.toggle-justify-end),:host(.toggle-alignment-start),:host(.toggle-alignment-center){display:block}.toggle-icon-wrapper{display:-ms-flexbox;display:flex;position:relative;-ms-flex-align:center;align-items:center;width:100%;height:100%;-webkit-transition:var(--handle-transition);transition:var(--handle-transition);will-change:transform}.toggle-icon{border-radius:var(--border-radius);display:block;position:relative;width:100%;height:100%;background:var(--track-background);overflow:inherit}:host(.toggle-checked) .toggle-icon{background:var(--track-background-checked)}.toggle-inner{border-radius:var(--handle-border-radius);position:absolute;left:var(--handle-spacing);width:var(--handle-width);height:var(--handle-height);max-height:var(--handle-max-height);-webkit-transition:var(--handle-transition);transition:var(--handle-transition);background:var(--handle-background);-webkit-box-shadow:var(--handle-box-shadow);box-shadow:var(--handle-box-shadow);contain:strict}:host(.toggle-ltr) .toggle-inner{left:var(--handle-spacing)}:host(.toggle-rtl) .toggle-inner{right:var(--handle-spacing)}:host(.toggle-ltr.toggle-checked) .toggle-icon-wrapper{-webkit-transform:translate3d(calc(100% - var(--handle-width)), 0, 0);transform:translate3d(calc(100% - var(--handle-width)), 0, 0)}:host(.toggle-rtl.toggle-checked) .toggle-icon-wrapper{-webkit-transform:translate3d(calc(-100% + var(--handle-width)), 0, 0);transform:translate3d(calc(-100% + var(--handle-width)), 0, 0)}:host(.toggle-checked) .toggle-inner{background:var(--handle-background-checked)}:host(.toggle-ltr.toggle-checked) .toggle-inner{-webkit-transform:translate3d(calc(var(--handle-spacing) * -2), 0, 0);transform:translate3d(calc(var(--handle-spacing) * -2), 0, 0)}:host(.toggle-rtl.toggle-checked) .toggle-inner{-webkit-transform:translate3d(calc(var(--handle-spacing) * 2), 0, 0);transform:translate3d(calc(var(--handle-spacing) * 2), 0, 0)}:host{--track-background:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.088);--track-background-checked:var(--ion-color-primary, #0054e9);--border-radius:15.5px;--handle-background:#ffffff;--handle-background-checked:#ffffff;--handle-border-radius:25.5px;--handle-box-shadow:0 3px 4px rgba(0, 0, 0, 0.06), 0 3px 8px rgba(0, 0, 0, 0.06);--handle-height:calc(31px - (2px * 2));--handle-max-height:calc(100% - var(--handle-spacing) * 2);--handle-width:calc(31px - (2px * 2));--handle-spacing:2px;--handle-transition:transform 300ms, width 120ms ease-in-out 80ms, left 110ms ease-in-out 80ms, right 110ms ease-in-out 80ms}.native-wrapper .toggle-icon{width:51px;height:31px;overflow:hidden}:host(.ion-color.toggle-checked) .toggle-icon{background:var(--ion-color-base)}:host(.toggle-activated) .toggle-switch-icon{opacity:0}.toggle-icon{-webkit-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);-webkit-transition:background-color 300ms;transition:background-color 300ms}.toggle-inner{will-change:transform}.toggle-switch-icon{position:absolute;top:50%;width:11px;height:11px;-webkit-transform:translateY(-50%);transform:translateY(-50%);-webkit-transition:opacity 300ms, color 300ms;transition:opacity 300ms, color 300ms}.toggle-switch-icon{position:absolute;color:var(--ion-color-dark, #222428)}:host(.toggle-ltr) .toggle-switch-icon{right:6px}:host(.toggle-rtl) .toggle-switch-icon{right:initial;left:6px;}:host(.toggle-checked) .toggle-switch-icon.toggle-switch-icon-checked{color:var(--ion-color-contrast, #fff)}:host(.toggle-checked) .toggle-switch-icon:not(.toggle-switch-icon-checked){opacity:0}.toggle-switch-icon-checked:not(.toggle-switch-icon-custom){position:absolute;width:15px;height:15px;-webkit-transform:translateY(-50%) rotate(90deg);transform:translateY(-50%) rotate(90deg)}:host(.toggle-ltr) .toggle-switch-icon-checked{right:initial;left:4px;}:host(.toggle-rtl) .toggle-switch-icon-checked{right:4px}:host(.toggle-ltr) .toggle-switch-icon-checked.toggle-switch-icon-custom{left:6px}:host(.toggle-rtl) .toggle-switch-icon-checked.toggle-switch-icon-custom{right:6px}:host(.toggle-activated) .toggle-icon::before,:host(.toggle-checked) .toggle-icon::before{-webkit-transform:scale3d(0, 0, 0);transform:scale3d(0, 0, 0)}:host(.toggle-activated.toggle-checked) .toggle-inner::before{-webkit-transform:scale3d(0, 0, 0);transform:scale3d(0, 0, 0)}:host(.toggle-activated) .toggle-inner{width:calc(var(--handle-width) + 6px)}:host(.toggle-ltr.toggle-activated.toggle-checked) .toggle-icon-wrapper{-webkit-transform:translate3d(calc(100% - var(--handle-width) - 6px), 0, 0);transform:translate3d(calc(100% - var(--handle-width) - 6px), 0, 0)}:host(.toggle-rtl.toggle-activated.toggle-checked) .toggle-icon-wrapper{-webkit-transform:translate3d(calc(-100% + var(--handle-width) + 6px), 0, 0);transform:translate3d(calc(-100% + var(--handle-width) + 6px), 0, 0)}:host(.toggle-disabled){opacity:0.3}:host(.ion-focused:not(.toggle-defers-indicator)) .toggle-icon{-webkit-box-shadow:0 0 0 4px rgba(var(--ion-color-primary-rgb, 0, 84, 233), 0.2);box-shadow:0 0 0 4px rgba(var(--ion-color-primary-rgb, 0, 84, 233), 0.2)}:host(.ion-color.ion-focused.toggle-checked:not(.toggle-defers-indicator)) .toggle-icon{-webkit-box-shadow:0 0 0 4px rgba(var(--ion-color-base-rgb), 0.2);box-shadow:0 0 0 4px rgba(var(--ion-color-base-rgb), 0.2)}`;
|
|
16
16
|
|
|
17
17
|
const toggleMdCss = () => `:host{-webkit-box-sizing:content-box !important;box-sizing:content-box !important;display:inline-block;position:relative;max-width:100%;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:2}:host(.in-item){-ms-flex:1 1 0px;flex:1 1 0;width:100%;height:100%}:host([slot=start]),:host([slot=end]){-ms-flex:initial;flex:initial;width:auto}:host(.toggle-disabled){pointer-events:none}input{display:none}:host(:focus){outline:none}.toggle-wrapper{display:-ms-flexbox;display:flex;position:relative;-ms-flex-positive:1;flex-grow:1;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;height:inherit;-webkit-transition:background-color 15ms linear;transition:background-color 15ms linear;cursor:inherit}.label-text-wrapper{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}:host(.in-item) .label-text-wrapper{margin-top:10px;margin-bottom:10px}:host(.in-item.toggle-label-placement-stacked) .label-text-wrapper{margin-top:10px;margin-bottom:16px}:host(.in-item.toggle-label-placement-stacked) .native-wrapper{margin-bottom:10px}.label-text-wrapper-hidden{display:none}.native-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.toggle-bottom{padding-top:4px;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;font-size:0.75rem;white-space:normal}:host(.toggle-label-placement-stacked) .toggle-bottom{font-size:1rem}.toggle-bottom .error-text{display:none;color:var(--ion-color-danger, #c5000f)}.toggle-bottom .helper-text{display:block;color:var(--ion-color-step-700, var(--ion-text-color-step-300, #4d4d4d))}:host(.ion-touched.ion-invalid) .toggle-bottom .error-text{display:block}:host(.ion-touched.ion-invalid) .toggle-bottom .helper-text{display:none}:host(.toggle-label-placement-start) .toggle-wrapper{-ms-flex-direction:row;flex-direction:row}:host(.toggle-label-placement-start) .label-text-wrapper{-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:16px;margin-inline-end:16px}:host(.toggle-label-placement-end) .toggle-wrapper{-ms-flex-direction:row-reverse;flex-direction:row-reverse;-ms-flex-pack:start;justify-content:start}:host(.toggle-label-placement-end) .label-text-wrapper{-webkit-margin-start:16px;margin-inline-start:16px;-webkit-margin-end:0;margin-inline-end:0}:host(.toggle-label-placement-fixed) .label-text-wrapper{-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:16px;margin-inline-end:16px}:host(.toggle-label-placement-fixed) .label-text-wrapper{-ms-flex:0 0 100px;flex:0 0 100px;width:100px;min-width:100px;max-width:200px}:host(.toggle-label-placement-stacked) .toggle-wrapper{-ms-flex-direction:column;flex-direction:column;text-align:center}:host(.toggle-label-placement-stacked) .label-text-wrapper{-webkit-transform:scale(0.75);transform:scale(0.75);margin-left:0;margin-right:0;margin-bottom:16px;max-width:calc(100% / 0.75)}:host(.toggle-label-placement-stacked.toggle-alignment-start) .label-text-wrapper{-webkit-transform-origin:left top;transform-origin:left top}:host-context([dir=rtl]):host(.toggle-label-placement-stacked.toggle-alignment-start) .label-text-wrapper,:host-context([dir=rtl]).toggle-label-placement-stacked.toggle-alignment-start .label-text-wrapper{-webkit-transform-origin:right top;transform-origin:right top}@supports selector(:dir(rtl)){:host(.toggle-label-placement-stacked.toggle-alignment-start:dir(rtl)) .label-text-wrapper{-webkit-transform-origin:right top;transform-origin:right top}}:host(.toggle-label-placement-stacked.toggle-alignment-center) .label-text-wrapper{-webkit-transform-origin:center top;transform-origin:center top}:host-context([dir=rtl]):host(.toggle-label-placement-stacked.toggle-alignment-center) .label-text-wrapper,:host-context([dir=rtl]).toggle-label-placement-stacked.toggle-alignment-center .label-text-wrapper{-webkit-transform-origin:calc(100% - center) top;transform-origin:calc(100% - center) top}@supports selector(:dir(rtl)){:host(.toggle-label-placement-stacked.toggle-alignment-center:dir(rtl)) .label-text-wrapper{-webkit-transform-origin:calc(100% - center) top;transform-origin:calc(100% - center) top}}:host(.toggle-justify-space-between) .toggle-wrapper{-ms-flex-pack:justify;justify-content:space-between}:host(.toggle-justify-start) .toggle-wrapper{-ms-flex-pack:start;justify-content:start}:host(.toggle-justify-end) .toggle-wrapper{-ms-flex-pack:end;justify-content:end}:host(.toggle-alignment-start) .toggle-wrapper{-ms-flex-align:start;align-items:start}:host(.toggle-alignment-center) .toggle-wrapper{-ms-flex-align:center;align-items:center}:host(.toggle-justify-space-between),:host(.toggle-justify-start),:host(.toggle-justify-end),:host(.toggle-alignment-start),:host(.toggle-alignment-center){display:block}.toggle-icon-wrapper{display:-ms-flexbox;display:flex;position:relative;-ms-flex-align:center;align-items:center;width:100%;height:100%;-webkit-transition:var(--handle-transition);transition:var(--handle-transition);will-change:transform}.toggle-icon{border-radius:var(--border-radius);display:block;position:relative;width:100%;height:100%;background:var(--track-background);overflow:inherit}:host(.toggle-checked) .toggle-icon{background:var(--track-background-checked)}.toggle-inner{border-radius:var(--handle-border-radius);position:absolute;left:var(--handle-spacing);width:var(--handle-width);height:var(--handle-height);max-height:var(--handle-max-height);-webkit-transition:var(--handle-transition);transition:var(--handle-transition);background:var(--handle-background);-webkit-box-shadow:var(--handle-box-shadow);box-shadow:var(--handle-box-shadow);contain:strict}:host(.toggle-ltr) .toggle-inner{left:var(--handle-spacing)}:host(.toggle-rtl) .toggle-inner{right:var(--handle-spacing)}:host(.toggle-ltr.toggle-checked) .toggle-icon-wrapper{-webkit-transform:translate3d(calc(100% - var(--handle-width)), 0, 0);transform:translate3d(calc(100% - var(--handle-width)), 0, 0)}:host(.toggle-rtl.toggle-checked) .toggle-icon-wrapper{-webkit-transform:translate3d(calc(-100% + var(--handle-width)), 0, 0);transform:translate3d(calc(-100% + var(--handle-width)), 0, 0)}:host(.toggle-checked) .toggle-inner{background:var(--handle-background-checked)}:host(.toggle-ltr.toggle-checked) .toggle-inner{-webkit-transform:translate3d(calc(var(--handle-spacing) * -2), 0, 0);transform:translate3d(calc(var(--handle-spacing) * -2), 0, 0)}:host(.toggle-rtl.toggle-checked) .toggle-inner{-webkit-transform:translate3d(calc(var(--handle-spacing) * 2), 0, 0);transform:translate3d(calc(var(--handle-spacing) * 2), 0, 0)}:host{--track-background:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.39);--track-background-checked:rgba(var(--ion-color-primary-rgb, 0, 84, 233), 0.5);--border-radius:14px;--handle-background:#ffffff;--handle-background-checked:var(--ion-color-primary, #0054e9);--handle-border-radius:50%;--handle-box-shadow:0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12);--handle-width:20px;--handle-height:20px;--handle-max-height:calc(100% + 6px);--handle-spacing:0px;--handle-transition:transform 160ms cubic-bezier(0.4, 0, 0.2, 1), background-color 160ms cubic-bezier(0.4, 0, 0.2, 1)}.native-wrapper .toggle-icon{width:36px;height:14px}:host(.ion-color.toggle-checked) .toggle-icon{background:rgba(var(--ion-color-base-rgb), 0.5)}:host(.ion-color.toggle-checked) .toggle-inner{background:var(--ion-color-base)}:host(.toggle-checked) .toggle-inner{color:var(--ion-color-contrast, #fff)}.toggle-icon{-webkit-transition:background-color 160ms;transition:background-color 160ms}.toggle-inner{will-change:background-color, transform;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;color:#000}.toggle-inner .toggle-switch-icon{-webkit-padding-start:1px;padding-inline-start:1px;-webkit-padding-end:1px;padding-inline-end:1px;padding-top:1px;padding-bottom:1px;width:100%;height:100%}:host(.ion-focused:not(.toggle-defers-indicator)) .toggle-icon-wrapper::after{border-radius:50%;display:block;position:absolute;width:36px;height:36px;-webkit-transform:translateY(-50%);transform:translateY(-50%);background:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.12);content:"";z-index:-1;inset-block-start:50%}:host(.toggle-ltr.ion-focused) .toggle-icon-wrapper::after{left:calc(var(--handle-spacing) + (var(--handle-width) - 36px) / 2)}:host(.toggle-rtl.ion-focused) .toggle-icon-wrapper::after{right:calc(var(--handle-spacing) + (var(--handle-width) - 36px) / 2)}:host(.toggle-ltr.ion-focused.toggle-checked) .toggle-icon-wrapper::after{-webkit-transform:translate(calc(var(--handle-spacing) * -2), -50%);transform:translate(calc(var(--handle-spacing) * -2), -50%)}:host(.toggle-rtl.ion-focused.toggle-checked) .toggle-icon-wrapper::after{-webkit-transform:translate(calc(var(--handle-spacing) * 2), -50%);transform:translate(calc(var(--handle-spacing) * 2), -50%)}:host(.ion-focused.toggle-checked) .toggle-icon-wrapper::after{background:rgba(var(--ion-color-primary-rgb, 0, 84, 233), 0.2)}:host(.ion-color.ion-focused.toggle-checked) .toggle-icon-wrapper::after{background:rgba(var(--ion-color-base-rgb), 0.2)}:host(.toggle-disabled){opacity:0.38}`;
|
|
18
18
|
|
|
@@ -126,7 +126,13 @@ const Toggle = class {
|
|
|
126
126
|
this.onBlur = () => {
|
|
127
127
|
this.ionBlur.emit();
|
|
128
128
|
};
|
|
129
|
-
this.
|
|
129
|
+
this.getCustomSwitchLabelIcon = (checked) => {
|
|
130
|
+
const { checkedIcon, uncheckedIcon } = this;
|
|
131
|
+
return checked
|
|
132
|
+
? checkedIcon ?? config.get('toggleCheckedIcon')
|
|
133
|
+
: uncheckedIcon ?? config.get('toggleUncheckedIcon');
|
|
134
|
+
};
|
|
135
|
+
this.getDefaultSwitchLabelIcon = (mode, checked) => {
|
|
130
136
|
if (mode === 'md') {
|
|
131
137
|
return checked ? checkmarkOutline : removeOutline;
|
|
132
138
|
}
|
|
@@ -248,10 +254,12 @@ const Toggle = class {
|
|
|
248
254
|
this.el.focus();
|
|
249
255
|
}
|
|
250
256
|
renderOnOffSwitchLabels(mode, checked) {
|
|
251
|
-
const
|
|
257
|
+
const customIcon = this.getCustomSwitchLabelIcon(checked);
|
|
258
|
+
const icon = customIcon ?? this.getDefaultSwitchLabelIcon(mode, checked);
|
|
252
259
|
return (h("ion-icon", { class: {
|
|
253
260
|
'toggle-switch-icon': true,
|
|
254
261
|
'toggle-switch-icon-checked': checked,
|
|
262
|
+
'toggle-switch-icon-custom': customIcon != null,
|
|
255
263
|
}, icon: icon, "aria-hidden": "true" }));
|
|
256
264
|
}
|
|
257
265
|
renderToggleControl() {
|
|
@@ -301,7 +309,7 @@ const Toggle = class {
|
|
|
301
309
|
// The attributes are matched too because the class needs the item to render.
|
|
302
310
|
const inClickableItem = hostContext('ion-item.ion-activatable, ion-item[button], ion-item[href]', el);
|
|
303
311
|
renderHiddenInput(true, el, name, checked ? value : '', disabled);
|
|
304
|
-
return (h(Host, { key: '
|
|
312
|
+
return (h(Host, { key: '8c7da2d3478830d1f599f602c80c71c0dee6e068', 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, {
|
|
305
313
|
[mode]: true,
|
|
306
314
|
'in-item': inItem,
|
|
307
315
|
// `ion-focusable` has to stay on because it is what makes the item focusable.
|
|
@@ -315,10 +323,10 @@ const Toggle = class {
|
|
|
315
323
|
[`toggle-alignment-${alignment}`]: alignment !== undefined,
|
|
316
324
|
[`toggle-label-placement-${labelPlacement}`]: true,
|
|
317
325
|
[`toggle-${rtl}`]: true,
|
|
318
|
-
}) }, h("label", { key: '
|
|
326
|
+
}) }, h("label", { key: 'f49a869a6008ad626fa7bbdc927cba6c4e780581', class: "toggle-wrapper", htmlFor: inputId }, h("input", { key: '5c478d219f89caa1f0b0b116773ddfaf008309c6', type: "checkbox", role: "switch", "aria-checked": `${checked}`, checked: checked, disabled: disabled, id: inputId, required: required, ...inheritedAttributes }), h("div", { key: '4f2baf8a21b0498f89b7ce003943e5005b585a35', class: {
|
|
319
327
|
'label-text-wrapper': true,
|
|
320
328
|
'label-text-wrapper-hidden': !hasLabel,
|
|
321
|
-
}, part: "label", id: inputLabelId, onClick: this.onDivLabelClick }, h("slot", { key: '
|
|
329
|
+
}, part: "label", id: inputLabelId, onClick: this.onDivLabelClick }, h("slot", { key: '6f6d915fe534addbb59671452272a1924603798b' }), this.renderHintText()), h("div", { key: 'e455a0cab17a24ba514946bc2537eaf63c668d3e', class: "native-wrapper" }, this.renderToggleControl()))));
|
|
322
330
|
}
|
|
323
331
|
get el() { return getElement(this); }
|
|
324
332
|
static get watchers() { return {
|