@ionic/core 9.0.9 → 9.0.10-dev.11793383958.19a7d413
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-input-otp.js +1 -1
- package/components/ion-menu.js +1 -1
- package/components/ion-router.js +1 -1
- package/dist/cjs/ion-input-otp.cjs.entry.js +126 -10
- package/dist/cjs/ion-menu_3.cjs.entry.js +25 -7
- package/dist/cjs/ion-route_4.cjs.entry.js +121 -16
- package/dist/cjs/ionic.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/input-otp/input-otp.ios.css +30 -5
- package/dist/collection/components/input-otp/input-otp.js +191 -12
- package/dist/collection/components/input-otp/input-otp.md.css +30 -5
- package/dist/collection/components/menu/menu.js +25 -8
- package/dist/collection/components/route/route.js +9 -1
- package/dist/collection/components/route-redirect/route-redirect.js +1 -1
- package/dist/collection/components/router/utils/constants.js +2 -0
- package/dist/collection/components/router/utils/matching.js +97 -14
- package/dist/collection/components/router/utils/path.js +17 -3
- package/dist/docs.json +92 -3
- package/dist/esm/ion-input-otp.entry.js +128 -12
- package/dist/esm/ion-menu_3.entry.js +26 -8
- package/dist/esm/ion-route_4.entry.js +121 -16
- package/dist/esm/ionic.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/html.html-data.json +10 -2
- package/dist/ionic/ionic.esm.js +1 -1
- package/dist/ionic/p-095da8ec.entry.js +4 -0
- package/dist/ionic/p-705759fd.entry.js +4 -0
- package/dist/ionic/p-99c518de.entry.js +4 -0
- package/dist/types/components/input-otp/input-otp-interface.d.ts +1 -0
- package/dist/types/components/input-otp/input-otp.d.ts +40 -2
- package/dist/types/components/menu/menu.d.ts +7 -0
- package/dist/types/components/route/route.d.ts +8 -0
- package/dist/types/components/route-redirect/route-redirect.d.ts +3 -1
- package/dist/types/components/router/utils/constants.d.ts +2 -0
- package/dist/types/components/router/utils/matching.d.ts +10 -0
- package/dist/types/components/router/utils/path.d.ts +5 -1
- package/dist/types/components.d.ts +32 -6
- package/hydrate/index.js +257 -33
- package/hydrate/index.mjs +257 -33
- package/package.json +1 -1
- package/dist/ionic/p-539d6c8e.entry.js +0 -4
- package/dist/ionic/p-7ce9c6f8.entry.js +0 -4
- package/dist/ionic/p-af11d3c6.entry.js +0 -4
package/hydrate/index.mjs
CHANGED
|
@@ -21444,9 +21444,9 @@ class Input {
|
|
|
21444
21444
|
}
|
|
21445
21445
|
let inputIds$1 = 0;
|
|
21446
21446
|
|
|
21447
|
-
const inputOtpIosCss = () => `.sc-ion-input-otp-ios-h{--margin-top:0;--margin-end:0;--margin-bottom:0;--margin-start:0;--padding-top:16px;--padding-end:0;--padding-bottom:16px;--padding-start:0;--color:initial;--min-width:40px;--separator-width:8px;--separator-height:var(--separator-width);--separator-border-radius:999px;--separator-color:var(--ion-color-step-150, var(--ion-background-color-step-150, #d9d9d9));--highlight-color-focused:var(--ion-color-primary, #0054e9);--highlight-color-valid:var(--ion-color-success, #2dd55b);--highlight-color-invalid:var(--ion-color-danger, #c5000f);--highlight-color:var(--highlight-color-focused);display:block;position:relative;font-size:0.875rem}.input-otp-group.sc-ion-input-otp-ios{-webkit-margin-start:var(--margin-start);margin-inline-start:var(--margin-start);-webkit-margin-end:var(--margin-end);margin-inline-end:var(--margin-end);margin-top:var(--margin-top);margin-bottom:var(--margin-bottom);-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);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}.native-wrapper.sc-ion-input-otp-ios{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;min-width:var(--min-width)}.native-input.sc-ion-input-otp-ios{border-radius:var(--border-radius);width:var(--width);min-width:inherit;height:var(--height);border-width:var(--border-width);border-style:solid;border-color:var(--border-color);background:var(--background);color:var(--color);font-size:inherit;text-align:center;-webkit-appearance:none;-moz-appearance:none;appearance:none}.has-focus.sc-ion-input-otp-ios-h .native-input.sc-ion-input-otp-ios{caret-color:var(--highlight-color)}.input-otp-description.sc-ion-input-otp-ios{color:var(--ion-color-step-700, var(--ion-text-color-step-300, #4d4d4d));font-size:0.75rem;line-height:1.25rem;text-align:center}.input-otp-description-hidden.sc-ion-input-otp-ios{display:none}.input-otp-separator.sc-ion-input-otp-ios{border-radius:var(--separator-border-radius);-ms-flex-negative:0;flex-shrink:0;width:var(--separator-width);height:var(--separator-height);background:var(--separator-color)}.input-otp-size-small.sc-ion-input-otp-ios-h{--width:40px;--height:40px}.input-otp-size-small.sc-ion-input-otp-ios-h .input-otp-group.sc-ion-input-otp-ios{gap:8px}.input-otp-size-medium.sc-ion-input-otp-ios-h{--width:48px;--height:48px}.input-otp-size-large.sc-ion-input-otp-ios-h{--width:56px;--height:56px}.input-otp-size-medium.sc-ion-input-otp-ios-h .input-otp-group.sc-ion-input-otp-ios,.input-otp-size-large.sc-ion-input-otp-ios-h .input-otp-group.sc-ion-input-otp-ios{gap:12px}.input-otp-shape-round.sc-ion-input-otp-ios-h{--border-radius:16px}.input-otp-shape-soft.sc-ion-input-otp-ios-h{--border-radius:8px}.input-otp-shape-rectangular.sc-ion-input-otp-ios-h{--border-radius:0}.input-otp-fill-outline.sc-ion-input-otp-ios-h{--background:none}.input-otp-fill-solid.sc-ion-input-otp-ios-h{--border-color:var(--ion-color-step-50, var(--ion-background-color-step-50, #f2f2f2));--background:var(--ion-color-step-50, var(--ion-background-color-step-50, #f2f2f2))}.input-otp-disabled.sc-ion-input-otp-ios-h{--color:var(--ion-color-step-350, var(--ion-text-color-step-650, #a6a6a6))}.input-otp-fill-outline.input-otp-disabled.sc-ion-input-otp-ios-h{--background:var(--ion-color-step-50, var(--ion-background-color-step-50, #f2f2f2));--border-color:var(--ion-color-step-100, var(--ion-background-color-step-100, #e6e6e6))}.input-otp-disabled.sc-ion-input-otp-ios-h,.input-otp-disabled.sc-ion-input-otp-ios-h .native-input.sc-ion-input-otp-ios:disabled{cursor:not-allowed}.has-focus.sc-ion-input-otp-ios-h .native-input.sc-ion-input-otp-ios:focus{--border-color:var(--highlight-color);outline:none}.input-otp-fill-outline.input-otp-readonly.sc-ion-input-otp-ios-h{--background:var(--ion-color-step-50, var(--ion-background-color-step-50, #f2f2f2))}.input-otp-fill-solid.input-otp-disabled.sc-ion-input-otp-ios-h,.input-otp-fill-solid.input-otp-readonly.sc-ion-input-otp-ios-h{--border-color:var(--ion-color-step-100, var(--ion-background-color-step-100, #e6e6e6));--background:var(--ion-color-step-100, var(--ion-background-color-step-100, #e6e6e6))}.ion-touched.ion-invalid.sc-ion-input-otp-ios-h{--highlight-color:var(--highlight-color-invalid)}.ion-valid.sc-ion-input-otp-ios-h{--highlight-color:var(--highlight-color-valid)}.has-focus.ion-valid.sc-ion-input-otp-ios-h,.ion-touched.ion-invalid.sc-ion-input-otp-ios-h{--border-color:var(--highlight-color)}.ion-color.sc-ion-input-otp-ios-h{--highlight-color-focused:var(--ion-color-base)}.input-otp-fill-outline.ion-color.sc-ion-input-otp-ios-h .native-input.sc-ion-input-otp-ios,.input-otp-fill-solid.ion-color.sc-ion-input-otp-ios-h .native-input.sc-ion-input-otp-ios:focus{border-color:rgba(var(--ion-color-base-rgb), 0.6)}.input-otp-fill-outline.ion-color.ion-invalid.sc-ion-input-otp-ios-h .native-input.sc-ion-input-otp-ios,.input-otp-fill-solid.ion-color.ion-invalid.sc-ion-input-otp-ios-h .native-input.sc-ion-input-otp-ios,.input-otp-fill-outline.ion-color.has-focus.ion-invalid.sc-ion-input-otp-ios-h .native-input.sc-ion-input-otp-ios,.input-otp-fill-solid.ion-color.has-focus.ion-invalid.sc-ion-input-otp-ios-h .native-input.sc-ion-input-otp-ios{border-color:var(--ion-color-danger, #c5000f)}.input-otp-fill-outline.ion-color.ion-valid.sc-ion-input-otp-ios-h .native-input.sc-ion-input-otp-ios,.input-otp-fill-solid.ion-color.ion-valid.sc-ion-input-otp-ios-h .native-input.sc-ion-input-otp-ios,.input-otp-fill-outline.ion-color.has-focus.ion-valid.sc-ion-input-otp-ios-h .native-input.sc-ion-input-otp-ios,.input-otp-fill-solid.ion-color.has-focus.ion-valid.sc-ion-input-otp-ios-h .native-input.sc-ion-input-otp-ios{border-color:var(--ion-color-success, #2dd55b)}.input-otp-fill-outline.input-otp-disabled.ion-color.sc-ion-input-otp-ios-h .native-input.sc-ion-input-otp-ios{border-color:rgba(var(--ion-color-base-rgb), 0.3)}.sc-ion-input-otp-ios-h{--border-width:0.55px}.has-focus.sc-ion-input-otp-ios-h .native-input.sc-ion-input-otp-ios:focus{--border-width:1px}.input-otp-fill-outline.sc-ion-input-otp-ios-h{--border-color:var(--ion-item-border-color, var(--ion-border-color, var(--ion-color-step-250, var(--ion-background-color-step-250, #c8c7cc))))}`;
|
|
21447
|
+
const inputOtpIosCss = () => `.sc-ion-input-otp-ios-h{--margin-top:0;--margin-end:0;--margin-bottom:0;--margin-start:0;--padding-top:16px;--padding-end:0;--padding-bottom:16px;--padding-start:0;--color:initial;--min-width:40px;--separator-width:8px;--separator-height:var(--separator-width);--separator-border-radius:999px;--separator-color:var(--ion-color-step-150, var(--ion-background-color-step-150, #d9d9d9));--highlight-color-focused:var(--ion-color-primary, #0054e9);--highlight-color-valid:var(--ion-color-success, #2dd55b);--highlight-color-invalid:var(--ion-color-danger, #c5000f);--highlight-color:var(--highlight-color-focused);--border-color:initial;display:block;position:relative;font-size:0.875rem}.input-otp-group.sc-ion-input-otp-ios{-webkit-margin-start:var(--margin-start);margin-inline-start:var(--margin-start);-webkit-margin-end:var(--margin-end);margin-inline-end:var(--margin-end);margin-top:var(--margin-top);margin-bottom:var(--margin-bottom);-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);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}.native-wrapper.sc-ion-input-otp-ios{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;min-width:var(--min-width)}.native-input.sc-ion-input-otp-ios{border-radius:var(--border-radius);width:var(--width);min-width:inherit;height:var(--height);border-width:var(--border-width);border-style:solid;border-color:var(--border-color, var(--internal-border-color));background:var(--background);color:var(--color);font-size:inherit;text-align:center;-webkit-appearance:none;-moz-appearance:none;appearance:none}.has-focus.sc-ion-input-otp-ios-h .native-input.sc-ion-input-otp-ios{caret-color:var(--highlight-color)}.input-otp-description.sc-ion-input-otp-ios{color:var(--ion-color-step-700, var(--ion-text-color-step-300, #4d4d4d));font-size:0.75rem;line-height:1.25rem;text-align:center}.input-otp-description-hidden.sc-ion-input-otp-ios{display:none}.input-otp-bottom.sc-ion-input-otp-ios{font-size:0.75rem;line-height:1.25rem;text-align:center}.input-otp-bottom.sc-ion-input-otp-ios .error-text.sc-ion-input-otp-ios{display:none;color:var(--highlight-color-invalid)}.input-otp-bottom.sc-ion-input-otp-ios .helper-text.sc-ion-input-otp-ios{display:block;color:var(--ion-color-step-700, var(--ion-text-color-step-300, #4d4d4d))}.ion-touched.ion-invalid.sc-ion-input-otp-ios-h .input-otp-bottom.sc-ion-input-otp-ios .error-text.sc-ion-input-otp-ios{display:block}.ion-touched.ion-invalid.sc-ion-input-otp-ios-h .input-otp-bottom.sc-ion-input-otp-ios .helper-text.sc-ion-input-otp-ios{display:none}.input-otp-separator.sc-ion-input-otp-ios{border-radius:var(--separator-border-radius);-ms-flex-negative:0;flex-shrink:0;width:var(--separator-width);height:var(--separator-height);background:var(--separator-color)}.input-otp-size-small.sc-ion-input-otp-ios-h{--width:40px;--height:40px}.input-otp-size-small.sc-ion-input-otp-ios-h .input-otp-group.sc-ion-input-otp-ios{gap:8px}.input-otp-size-medium.sc-ion-input-otp-ios-h{--width:48px;--height:48px}.input-otp-size-large.sc-ion-input-otp-ios-h{--width:56px;--height:56px}.input-otp-size-medium.sc-ion-input-otp-ios-h .input-otp-group.sc-ion-input-otp-ios,.input-otp-size-large.sc-ion-input-otp-ios-h .input-otp-group.sc-ion-input-otp-ios{gap:12px}.input-otp-shape-round.sc-ion-input-otp-ios-h{--border-radius:16px}.input-otp-shape-soft.sc-ion-input-otp-ios-h{--border-radius:8px}.input-otp-shape-rectangular.sc-ion-input-otp-ios-h{--border-radius:0}.input-otp-fill-outline.sc-ion-input-otp-ios-h{--background:none}.input-otp-fill-solid.sc-ion-input-otp-ios-h{--internal-border-color:var(--ion-color-step-50, var(--ion-background-color-step-50, #f2f2f2));--background:var(--ion-color-step-50, var(--ion-background-color-step-50, #f2f2f2))}.input-otp-disabled.sc-ion-input-otp-ios-h{--color:var(--ion-color-step-350, var(--ion-text-color-step-650, #a6a6a6))}.input-otp-fill-outline.input-otp-disabled.sc-ion-input-otp-ios-h{--background:var(--ion-color-step-50, var(--ion-background-color-step-50, #f2f2f2));--internal-border-color:var(--ion-color-step-100, var(--ion-background-color-step-100, #e6e6e6))}.input-otp-disabled.sc-ion-input-otp-ios-h,.input-otp-disabled.sc-ion-input-otp-ios-h .native-input.sc-ion-input-otp-ios:disabled{cursor:not-allowed}.has-focus.sc-ion-input-otp-ios-h .native-input.sc-ion-input-otp-ios:focus{--border-color:var(--highlight-color);outline:none}.input-otp-fill-outline.input-otp-readonly.sc-ion-input-otp-ios-h{--background:var(--ion-color-step-50, var(--ion-background-color-step-50, #f2f2f2))}.input-otp-fill-solid.input-otp-disabled.sc-ion-input-otp-ios-h,.input-otp-fill-solid.input-otp-readonly.sc-ion-input-otp-ios-h{--internal-border-color:var(--ion-color-step-100, var(--ion-background-color-step-100, #e6e6e6));--background:var(--ion-color-step-100, var(--ion-background-color-step-100, #e6e6e6))}.ion-touched.ion-invalid.sc-ion-input-otp-ios-h{--highlight-color:var(--highlight-color-invalid)}.ion-valid.sc-ion-input-otp-ios-h{--highlight-color:var(--highlight-color-valid)}.has-focus.ion-valid.sc-ion-input-otp-ios-h,.ion-touched.ion-invalid.sc-ion-input-otp-ios-h{--border-color:var(--highlight-color)}.ion-color.sc-ion-input-otp-ios-h{--highlight-color-focused:var(--ion-color-base)}.input-otp-fill-outline.ion-color.sc-ion-input-otp-ios-h .native-input.sc-ion-input-otp-ios,.input-otp-fill-solid.ion-color.sc-ion-input-otp-ios-h .native-input.sc-ion-input-otp-ios:focus{border-color:rgba(var(--ion-color-base-rgb), 0.6)}.input-otp-fill-outline.ion-color.ion-invalid.sc-ion-input-otp-ios-h .native-input.sc-ion-input-otp-ios,.input-otp-fill-solid.ion-color.ion-invalid.sc-ion-input-otp-ios-h .native-input.sc-ion-input-otp-ios,.input-otp-fill-outline.ion-color.has-focus.ion-invalid.sc-ion-input-otp-ios-h .native-input.sc-ion-input-otp-ios,.input-otp-fill-solid.ion-color.has-focus.ion-invalid.sc-ion-input-otp-ios-h .native-input.sc-ion-input-otp-ios{border-color:var(--ion-color-danger, #c5000f)}.input-otp-fill-outline.ion-color.ion-valid.sc-ion-input-otp-ios-h .native-input.sc-ion-input-otp-ios,.input-otp-fill-solid.ion-color.ion-valid.sc-ion-input-otp-ios-h .native-input.sc-ion-input-otp-ios,.input-otp-fill-outline.ion-color.has-focus.ion-valid.sc-ion-input-otp-ios-h .native-input.sc-ion-input-otp-ios,.input-otp-fill-solid.ion-color.has-focus.ion-valid.sc-ion-input-otp-ios-h .native-input.sc-ion-input-otp-ios{border-color:var(--ion-color-success, #2dd55b)}.input-otp-fill-outline.input-otp-disabled.ion-color.sc-ion-input-otp-ios-h .native-input.sc-ion-input-otp-ios{border-color:rgba(var(--ion-color-base-rgb), 0.3)}.sc-ion-input-otp-ios-h{--border-width:0.55px}.has-focus.sc-ion-input-otp-ios-h .native-input.sc-ion-input-otp-ios:focus{--border-width:1px}.input-otp-fill-outline.sc-ion-input-otp-ios-h{--internal-border-color:var(--ion-item-border-color, var(--ion-border-color, var(--ion-color-step-250, var(--ion-background-color-step-250, #c8c7cc))))}`;
|
|
21448
21448
|
|
|
21449
|
-
const inputOtpMdCss = () => `.sc-ion-input-otp-md-h{--margin-top:0;--margin-end:0;--margin-bottom:0;--margin-start:0;--padding-top:16px;--padding-end:0;--padding-bottom:16px;--padding-start:0;--color:initial;--min-width:40px;--separator-width:8px;--separator-height:var(--separator-width);--separator-border-radius:999px;--separator-color:var(--ion-color-step-150, var(--ion-background-color-step-150, #d9d9d9));--highlight-color-focused:var(--ion-color-primary, #0054e9);--highlight-color-valid:var(--ion-color-success, #2dd55b);--highlight-color-invalid:var(--ion-color-danger, #c5000f);--highlight-color:var(--highlight-color-focused);display:block;position:relative;font-size:0.875rem}.input-otp-group.sc-ion-input-otp-md{-webkit-margin-start:var(--margin-start);margin-inline-start:var(--margin-start);-webkit-margin-end:var(--margin-end);margin-inline-end:var(--margin-end);margin-top:var(--margin-top);margin-bottom:var(--margin-bottom);-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);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}.native-wrapper.sc-ion-input-otp-md{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;min-width:var(--min-width)}.native-input.sc-ion-input-otp-md{border-radius:var(--border-radius);width:var(--width);min-width:inherit;height:var(--height);border-width:var(--border-width);border-style:solid;border-color:var(--border-color);background:var(--background);color:var(--color);font-size:inherit;text-align:center;-webkit-appearance:none;-moz-appearance:none;appearance:none}.has-focus.sc-ion-input-otp-md-h .native-input.sc-ion-input-otp-md{caret-color:var(--highlight-color)}.input-otp-description.sc-ion-input-otp-md{color:var(--ion-color-step-700, var(--ion-text-color-step-300, #4d4d4d));font-size:0.75rem;line-height:1.25rem;text-align:center}.input-otp-description-hidden.sc-ion-input-otp-md{display:none}.input-otp-separator.sc-ion-input-otp-md{border-radius:var(--separator-border-radius);-ms-flex-negative:0;flex-shrink:0;width:var(--separator-width);height:var(--separator-height);background:var(--separator-color)}.input-otp-size-small.sc-ion-input-otp-md-h{--width:40px;--height:40px}.input-otp-size-small.sc-ion-input-otp-md-h .input-otp-group.sc-ion-input-otp-md{gap:8px}.input-otp-size-medium.sc-ion-input-otp-md-h{--width:48px;--height:48px}.input-otp-size-large.sc-ion-input-otp-md-h{--width:56px;--height:56px}.input-otp-size-medium.sc-ion-input-otp-md-h .input-otp-group.sc-ion-input-otp-md,.input-otp-size-large.sc-ion-input-otp-md-h .input-otp-group.sc-ion-input-otp-md{gap:12px}.input-otp-shape-round.sc-ion-input-otp-md-h{--border-radius:16px}.input-otp-shape-soft.sc-ion-input-otp-md-h{--border-radius:8px}.input-otp-shape-rectangular.sc-ion-input-otp-md-h{--border-radius:0}.input-otp-fill-outline.sc-ion-input-otp-md-h{--background:none}.input-otp-fill-solid.sc-ion-input-otp-md-h{--border-color:var(--ion-color-step-50, var(--ion-background-color-step-50, #f2f2f2));--background:var(--ion-color-step-50, var(--ion-background-color-step-50, #f2f2f2))}.input-otp-disabled.sc-ion-input-otp-md-h{--color:var(--ion-color-step-350, var(--ion-text-color-step-650, #a6a6a6))}.input-otp-fill-outline.input-otp-disabled.sc-ion-input-otp-md-h{--background:var(--ion-color-step-50, var(--ion-background-color-step-50, #f2f2f2));--border-color:var(--ion-color-step-100, var(--ion-background-color-step-100, #e6e6e6))}.input-otp-disabled.sc-ion-input-otp-md-h,.input-otp-disabled.sc-ion-input-otp-md-h .native-input.sc-ion-input-otp-md:disabled{cursor:not-allowed}.has-focus.sc-ion-input-otp-md-h .native-input.sc-ion-input-otp-md:focus{--border-color:var(--highlight-color);outline:none}.input-otp-fill-outline.input-otp-readonly.sc-ion-input-otp-md-h{--background:var(--ion-color-step-50, var(--ion-background-color-step-50, #f2f2f2))}.input-otp-fill-solid.input-otp-disabled.sc-ion-input-otp-md-h,.input-otp-fill-solid.input-otp-readonly.sc-ion-input-otp-md-h{--border-color:var(--ion-color-step-100, var(--ion-background-color-step-100, #e6e6e6));--background:var(--ion-color-step-100, var(--ion-background-color-step-100, #e6e6e6))}.ion-touched.ion-invalid.sc-ion-input-otp-md-h{--highlight-color:var(--highlight-color-invalid)}.ion-valid.sc-ion-input-otp-md-h{--highlight-color:var(--highlight-color-valid)}.has-focus.ion-valid.sc-ion-input-otp-md-h,.ion-touched.ion-invalid.sc-ion-input-otp-md-h{--border-color:var(--highlight-color)}.ion-color.sc-ion-input-otp-md-h{--highlight-color-focused:var(--ion-color-base)}.input-otp-fill-outline.ion-color.sc-ion-input-otp-md-h .native-input.sc-ion-input-otp-md,.input-otp-fill-solid.ion-color.sc-ion-input-otp-md-h .native-input.sc-ion-input-otp-md:focus{border-color:rgba(var(--ion-color-base-rgb), 0.6)}.input-otp-fill-outline.ion-color.ion-invalid.sc-ion-input-otp-md-h .native-input.sc-ion-input-otp-md,.input-otp-fill-solid.ion-color.ion-invalid.sc-ion-input-otp-md-h .native-input.sc-ion-input-otp-md,.input-otp-fill-outline.ion-color.has-focus.ion-invalid.sc-ion-input-otp-md-h .native-input.sc-ion-input-otp-md,.input-otp-fill-solid.ion-color.has-focus.ion-invalid.sc-ion-input-otp-md-h .native-input.sc-ion-input-otp-md{border-color:var(--ion-color-danger, #c5000f)}.input-otp-fill-outline.ion-color.ion-valid.sc-ion-input-otp-md-h .native-input.sc-ion-input-otp-md,.input-otp-fill-solid.ion-color.ion-valid.sc-ion-input-otp-md-h .native-input.sc-ion-input-otp-md,.input-otp-fill-outline.ion-color.has-focus.ion-valid.sc-ion-input-otp-md-h .native-input.sc-ion-input-otp-md,.input-otp-fill-solid.ion-color.has-focus.ion-valid.sc-ion-input-otp-md-h .native-input.sc-ion-input-otp-md{border-color:var(--ion-color-success, #2dd55b)}.input-otp-fill-outline.input-otp-disabled.ion-color.sc-ion-input-otp-md-h .native-input.sc-ion-input-otp-md{border-color:rgba(var(--ion-color-base-rgb), 0.3)}.sc-ion-input-otp-md-h{--border-width:1px}.has-focus.sc-ion-input-otp-md-h .native-input.sc-ion-input-otp-md:focus{--border-width:2px}.input-otp-fill-outline.sc-ion-input-otp-md-h{--border-color:var(--ion-color-step-300, var(--ion-background-color-step-300, #b3b3b3))}`;
|
|
21449
|
+
const inputOtpMdCss = () => `.sc-ion-input-otp-md-h{--margin-top:0;--margin-end:0;--margin-bottom:0;--margin-start:0;--padding-top:16px;--padding-end:0;--padding-bottom:16px;--padding-start:0;--color:initial;--min-width:40px;--separator-width:8px;--separator-height:var(--separator-width);--separator-border-radius:999px;--separator-color:var(--ion-color-step-150, var(--ion-background-color-step-150, #d9d9d9));--highlight-color-focused:var(--ion-color-primary, #0054e9);--highlight-color-valid:var(--ion-color-success, #2dd55b);--highlight-color-invalid:var(--ion-color-danger, #c5000f);--highlight-color:var(--highlight-color-focused);--border-color:initial;display:block;position:relative;font-size:0.875rem}.input-otp-group.sc-ion-input-otp-md{-webkit-margin-start:var(--margin-start);margin-inline-start:var(--margin-start);-webkit-margin-end:var(--margin-end);margin-inline-end:var(--margin-end);margin-top:var(--margin-top);margin-bottom:var(--margin-bottom);-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);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}.native-wrapper.sc-ion-input-otp-md{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;min-width:var(--min-width)}.native-input.sc-ion-input-otp-md{border-radius:var(--border-radius);width:var(--width);min-width:inherit;height:var(--height);border-width:var(--border-width);border-style:solid;border-color:var(--border-color, var(--internal-border-color));background:var(--background);color:var(--color);font-size:inherit;text-align:center;-webkit-appearance:none;-moz-appearance:none;appearance:none}.has-focus.sc-ion-input-otp-md-h .native-input.sc-ion-input-otp-md{caret-color:var(--highlight-color)}.input-otp-description.sc-ion-input-otp-md{color:var(--ion-color-step-700, var(--ion-text-color-step-300, #4d4d4d));font-size:0.75rem;line-height:1.25rem;text-align:center}.input-otp-description-hidden.sc-ion-input-otp-md{display:none}.input-otp-bottom.sc-ion-input-otp-md{font-size:0.75rem;line-height:1.25rem;text-align:center}.input-otp-bottom.sc-ion-input-otp-md .error-text.sc-ion-input-otp-md{display:none;color:var(--highlight-color-invalid)}.input-otp-bottom.sc-ion-input-otp-md .helper-text.sc-ion-input-otp-md{display:block;color:var(--ion-color-step-700, var(--ion-text-color-step-300, #4d4d4d))}.ion-touched.ion-invalid.sc-ion-input-otp-md-h .input-otp-bottom.sc-ion-input-otp-md .error-text.sc-ion-input-otp-md{display:block}.ion-touched.ion-invalid.sc-ion-input-otp-md-h .input-otp-bottom.sc-ion-input-otp-md .helper-text.sc-ion-input-otp-md{display:none}.input-otp-separator.sc-ion-input-otp-md{border-radius:var(--separator-border-radius);-ms-flex-negative:0;flex-shrink:0;width:var(--separator-width);height:var(--separator-height);background:var(--separator-color)}.input-otp-size-small.sc-ion-input-otp-md-h{--width:40px;--height:40px}.input-otp-size-small.sc-ion-input-otp-md-h .input-otp-group.sc-ion-input-otp-md{gap:8px}.input-otp-size-medium.sc-ion-input-otp-md-h{--width:48px;--height:48px}.input-otp-size-large.sc-ion-input-otp-md-h{--width:56px;--height:56px}.input-otp-size-medium.sc-ion-input-otp-md-h .input-otp-group.sc-ion-input-otp-md,.input-otp-size-large.sc-ion-input-otp-md-h .input-otp-group.sc-ion-input-otp-md{gap:12px}.input-otp-shape-round.sc-ion-input-otp-md-h{--border-radius:16px}.input-otp-shape-soft.sc-ion-input-otp-md-h{--border-radius:8px}.input-otp-shape-rectangular.sc-ion-input-otp-md-h{--border-radius:0}.input-otp-fill-outline.sc-ion-input-otp-md-h{--background:none}.input-otp-fill-solid.sc-ion-input-otp-md-h{--internal-border-color:var(--ion-color-step-50, var(--ion-background-color-step-50, #f2f2f2));--background:var(--ion-color-step-50, var(--ion-background-color-step-50, #f2f2f2))}.input-otp-disabled.sc-ion-input-otp-md-h{--color:var(--ion-color-step-350, var(--ion-text-color-step-650, #a6a6a6))}.input-otp-fill-outline.input-otp-disabled.sc-ion-input-otp-md-h{--background:var(--ion-color-step-50, var(--ion-background-color-step-50, #f2f2f2));--internal-border-color:var(--ion-color-step-100, var(--ion-background-color-step-100, #e6e6e6))}.input-otp-disabled.sc-ion-input-otp-md-h,.input-otp-disabled.sc-ion-input-otp-md-h .native-input.sc-ion-input-otp-md:disabled{cursor:not-allowed}.has-focus.sc-ion-input-otp-md-h .native-input.sc-ion-input-otp-md:focus{--border-color:var(--highlight-color);outline:none}.input-otp-fill-outline.input-otp-readonly.sc-ion-input-otp-md-h{--background:var(--ion-color-step-50, var(--ion-background-color-step-50, #f2f2f2))}.input-otp-fill-solid.input-otp-disabled.sc-ion-input-otp-md-h,.input-otp-fill-solid.input-otp-readonly.sc-ion-input-otp-md-h{--internal-border-color:var(--ion-color-step-100, var(--ion-background-color-step-100, #e6e6e6));--background:var(--ion-color-step-100, var(--ion-background-color-step-100, #e6e6e6))}.ion-touched.ion-invalid.sc-ion-input-otp-md-h{--highlight-color:var(--highlight-color-invalid)}.ion-valid.sc-ion-input-otp-md-h{--highlight-color:var(--highlight-color-valid)}.has-focus.ion-valid.sc-ion-input-otp-md-h,.ion-touched.ion-invalid.sc-ion-input-otp-md-h{--border-color:var(--highlight-color)}.ion-color.sc-ion-input-otp-md-h{--highlight-color-focused:var(--ion-color-base)}.input-otp-fill-outline.ion-color.sc-ion-input-otp-md-h .native-input.sc-ion-input-otp-md,.input-otp-fill-solid.ion-color.sc-ion-input-otp-md-h .native-input.sc-ion-input-otp-md:focus{border-color:rgba(var(--ion-color-base-rgb), 0.6)}.input-otp-fill-outline.ion-color.ion-invalid.sc-ion-input-otp-md-h .native-input.sc-ion-input-otp-md,.input-otp-fill-solid.ion-color.ion-invalid.sc-ion-input-otp-md-h .native-input.sc-ion-input-otp-md,.input-otp-fill-outline.ion-color.has-focus.ion-invalid.sc-ion-input-otp-md-h .native-input.sc-ion-input-otp-md,.input-otp-fill-solid.ion-color.has-focus.ion-invalid.sc-ion-input-otp-md-h .native-input.sc-ion-input-otp-md{border-color:var(--ion-color-danger, #c5000f)}.input-otp-fill-outline.ion-color.ion-valid.sc-ion-input-otp-md-h .native-input.sc-ion-input-otp-md,.input-otp-fill-solid.ion-color.ion-valid.sc-ion-input-otp-md-h .native-input.sc-ion-input-otp-md,.input-otp-fill-outline.ion-color.has-focus.ion-valid.sc-ion-input-otp-md-h .native-input.sc-ion-input-otp-md,.input-otp-fill-solid.ion-color.has-focus.ion-valid.sc-ion-input-otp-md-h .native-input.sc-ion-input-otp-md{border-color:var(--ion-color-success, #2dd55b)}.input-otp-fill-outline.input-otp-disabled.ion-color.sc-ion-input-otp-md-h .native-input.sc-ion-input-otp-md{border-color:rgba(var(--ion-color-base-rgb), 0.3)}.sc-ion-input-otp-md-h{--border-width:1px}.has-focus.sc-ion-input-otp-md-h .native-input.sc-ion-input-otp-md:focus{--border-width:2px}.input-otp-fill-outline.sc-ion-input-otp-md-h{--internal-border-color:var(--ion-color-step-300, var(--ion-background-color-step-300, #b3b3b3))}`;
|
|
21450
21450
|
|
|
21451
21451
|
class InputOTP {
|
|
21452
21452
|
constructor(hostRef) {
|
|
@@ -21456,9 +21456,11 @@ class InputOTP {
|
|
|
21456
21456
|
this.ionComplete = createEvent(this, "ionComplete", 7);
|
|
21457
21457
|
this.ionBlur = createEvent(this, "ionBlur", 7);
|
|
21458
21458
|
this.ionFocus = createEvent(this, "ionFocus", 7);
|
|
21459
|
-
this.inheritedAttributes = {};
|
|
21460
21459
|
this.inputRefs = [];
|
|
21461
21460
|
this.inputId = `ion-input-otp-${inputIds++}`;
|
|
21461
|
+
this.helperTextId = `${this.inputId}-helper-text`;
|
|
21462
|
+
this.errorTextId = `${this.inputId}-error-text`;
|
|
21463
|
+
this.descriptionId = `${this.inputId}-description`;
|
|
21462
21464
|
this.parsedSeparators = [];
|
|
21463
21465
|
/**
|
|
21464
21466
|
* Tracks whether the user is navigating through input boxes using keyboard navigation
|
|
@@ -21474,6 +21476,7 @@ class InputOTP {
|
|
|
21474
21476
|
this.inputValues = [];
|
|
21475
21477
|
this.hasFocus = false;
|
|
21476
21478
|
this.previousInputValues = [];
|
|
21479
|
+
this.isInvalid = false;
|
|
21477
21480
|
/**
|
|
21478
21481
|
* Indicates whether and how the text value should be automatically capitalized as it is entered/edited by the user.
|
|
21479
21482
|
* Available options: `"off"`, `"none"`, `"on"`, `"sentences"`, `"words"`, `"characters"`.
|
|
@@ -21826,6 +21829,9 @@ class InputOTP {
|
|
|
21826
21829
|
this.inputRefs[tabbableIndex]?.focus();
|
|
21827
21830
|
}
|
|
21828
21831
|
}
|
|
21832
|
+
// The host keeps these (see `HOST_ARIA_ATTRIBUTES`), so re-render when they change
|
|
21833
|
+
onHostAriaChange() {
|
|
21834
|
+
}
|
|
21829
21835
|
valueChanged() {
|
|
21830
21836
|
this.initializeValues();
|
|
21831
21837
|
this.updateTabIndexes();
|
|
@@ -21882,13 +21888,29 @@ class InputOTP {
|
|
|
21882
21888
|
}
|
|
21883
21889
|
this.parsedSeparators = separatorValues.filter((pos) => pos <= length);
|
|
21884
21890
|
}
|
|
21891
|
+
connectedCallback() {
|
|
21892
|
+
const { el } = this;
|
|
21893
|
+
this.isInvalid = checkInvalidState(el);
|
|
21894
|
+
// Resumes watching after a move, since `componentWillLoad` only runs once
|
|
21895
|
+
this.ariaController?.init();
|
|
21896
|
+
}
|
|
21897
|
+
disconnectedCallback() {
|
|
21898
|
+
this.ariaController?.destroy();
|
|
21899
|
+
if (this.validationObserver) {
|
|
21900
|
+
this.validationObserver.disconnect();
|
|
21901
|
+
this.validationObserver = undefined;
|
|
21902
|
+
}
|
|
21903
|
+
}
|
|
21885
21904
|
componentWillLoad() {
|
|
21886
|
-
|
|
21905
|
+
// Only read `role` at load so a later host write isn't copied to the group
|
|
21906
|
+
this.ariaController = createAttributeController(this.el, ariaAttributes.filter((attr) => !HOST_ARIA_ATTRIBUTES.includes(attr)), () => forceUpdate(), ['role']);
|
|
21887
21907
|
this.processSeparators();
|
|
21888
21908
|
this.initializeValues();
|
|
21889
21909
|
}
|
|
21890
21910
|
componentDidLoad() {
|
|
21891
21911
|
this.updateTabIndexes();
|
|
21912
|
+
// The description only exists after the first render, so render again to reference it
|
|
21913
|
+
if (this.getDescriptionText()) ;
|
|
21892
21914
|
}
|
|
21893
21915
|
componentDidRender() {
|
|
21894
21916
|
if (this.updateTabIndexesAfterRender) {
|
|
@@ -22066,14 +22088,77 @@ class InputOTP {
|
|
|
22066
22088
|
const { length } = this;
|
|
22067
22089
|
return this.parsedSeparators.includes(index + 1) && index < length - 1;
|
|
22068
22090
|
}
|
|
22091
|
+
/**
|
|
22092
|
+
* Returns `undefined` until the first render creates the description container.
|
|
22093
|
+
*/
|
|
22094
|
+
getDescriptionText() {
|
|
22095
|
+
return this.el.querySelector('.input-otp-description')?.textContent?.trim();
|
|
22096
|
+
}
|
|
22097
|
+
getHintTextId() {
|
|
22098
|
+
const { isInvalid, helperText, errorText, helperTextId, errorTextId } = this;
|
|
22099
|
+
if (isInvalid && errorText) {
|
|
22100
|
+
return errorTextId;
|
|
22101
|
+
}
|
|
22102
|
+
if (helperText) {
|
|
22103
|
+
return helperTextId;
|
|
22104
|
+
}
|
|
22105
|
+
return undefined;
|
|
22106
|
+
}
|
|
22107
|
+
renderHintText() {
|
|
22108
|
+
const { helperText, errorText, helperTextId, errorTextId, isInvalid } = this;
|
|
22109
|
+
return [
|
|
22110
|
+
hAsync("div", { id: helperTextId, class: "helper-text", "aria-live": "polite" }, !isInvalid ? helperText : null),
|
|
22111
|
+
hAsync("div", { id: errorTextId, class: "error-text", role: "alert" }, isInvalid ? errorText : null),
|
|
22112
|
+
];
|
|
22113
|
+
}
|
|
22114
|
+
renderBottomContent() {
|
|
22115
|
+
const { helperText, errorText } = this;
|
|
22116
|
+
if (!helperText && !errorText) {
|
|
22117
|
+
return;
|
|
22118
|
+
}
|
|
22119
|
+
return hAsync("div", { class: "input-otp-bottom" }, this.renderHintText());
|
|
22120
|
+
}
|
|
22121
|
+
/**
|
|
22122
|
+
* A custom formatter is used as is so translators control the whole name.
|
|
22123
|
+
* With a host `aria-labelledby`, each box also references itself so its
|
|
22124
|
+
* position is still read.
|
|
22125
|
+
*/
|
|
22126
|
+
getInputLabelAttributes(index, hostAttributes) {
|
|
22127
|
+
const { inputId, inputLabelFormatter, length } = this;
|
|
22128
|
+
const hostLabel = hostAttributes['aria-label'];
|
|
22129
|
+
const hostLabelledBy = hostAttributes['aria-labelledby'];
|
|
22130
|
+
const position = `${index + 1} of ${length}`;
|
|
22131
|
+
if (inputLabelFormatter !== undefined) {
|
|
22132
|
+
try {
|
|
22133
|
+
return { 'aria-label': inputLabelFormatter(index, length) };
|
|
22134
|
+
}
|
|
22135
|
+
catch (e) {
|
|
22136
|
+
printIonError('[ion-input-otp] - Exception in provided `inputLabelFormatter`:', e);
|
|
22137
|
+
}
|
|
22138
|
+
}
|
|
22139
|
+
if (hostLabelledBy) {
|
|
22140
|
+
return { 'aria-label': position, 'aria-labelledby': `${hostLabelledBy} ${inputId}-${index}` };
|
|
22141
|
+
}
|
|
22142
|
+
return { 'aria-label': hostLabel ? `${hostLabel}, ${position}` : `Input ${position}` };
|
|
22143
|
+
}
|
|
22069
22144
|
render() {
|
|
22070
|
-
const { autocapitalize, color, disabled, el, fill, hasFocus,
|
|
22145
|
+
const { ariaController, autocapitalize, color, descriptionId, disabled, el, fill, hasFocus, inputId, inputRefs, inputValues, isInvalid, length, readonly, shape, size, } = this;
|
|
22071
22146
|
const mode = getIonMode$1(this);
|
|
22072
22147
|
const inputmode = this.getInputmode();
|
|
22073
22148
|
const tabbableIndex = this.getTabbableIndex();
|
|
22074
22149
|
const pattern = this.getPattern();
|
|
22075
|
-
const
|
|
22076
|
-
|
|
22150
|
+
const descriptionText = this.getDescriptionText();
|
|
22151
|
+
// Keep the description visible until the first render can check it
|
|
22152
|
+
const hasDescription = descriptionText !== '';
|
|
22153
|
+
/**
|
|
22154
|
+
* Screen readers only announce these from the focused input. The
|
|
22155
|
+
* description stays on the group so it isn't repeated for every input.
|
|
22156
|
+
*/
|
|
22157
|
+
const { 'aria-errormessage': ariaErrorMessage, 'aria-required': ariaRequired, ...groupAttributes } = ariaController?.attributes ?? {};
|
|
22158
|
+
const hostDescribedBy = el.getAttribute('aria-describedby');
|
|
22159
|
+
const hostInvalid = el.getAttribute('aria-invalid') ?? undefined;
|
|
22160
|
+
const describedBy = [hostDescribedBy, this.getHintTextId()].filter(Boolean).join(' ');
|
|
22161
|
+
return (hAsync(Host, { key: '5b13c3bed3979e269cf4409895954edb171d68f3', class: createColorClasses$1(color, {
|
|
22077
22162
|
[mode]: true,
|
|
22078
22163
|
'has-focus': hasFocus,
|
|
22079
22164
|
[`input-otp-size-${size}`]: true,
|
|
@@ -22081,7 +22166,7 @@ class InputOTP {
|
|
|
22081
22166
|
[`input-otp-fill-${fill}`]: true,
|
|
22082
22167
|
'input-otp-disabled': disabled,
|
|
22083
22168
|
'input-otp-readonly': readonly,
|
|
22084
|
-
}) }, hAsync("div", { key: '
|
|
22169
|
+
}) }, hAsync("div", { key: '6db010743f0eb5e059dc00de5822f117a264bb16', role: "group", class: "input-otp-group", ...groupAttributes, "aria-label": groupAttributes['aria-label'] || 'One-time password input', "aria-describedby": descriptionText ? descriptionId : undefined }, Array.from({ length }).map((_, index) => (hAsync(Fragment, null, hAsync("div", { class: "native-wrapper" }, hAsync("input", { class: "native-input", id: `${inputId}-${index}`, ...this.getInputLabelAttributes(index, groupAttributes), "aria-describedby": describedBy || undefined, "aria-errormessage": ariaErrorMessage, "aria-invalid": isInvalid ? 'true' : hostInvalid, "aria-required": ariaRequired, type: "text", autoCapitalize: autocapitalize, inputmode: inputmode, pattern: pattern, disabled: disabled, readOnly: readonly, tabIndex: index === tabbableIndex ? 0 : -1, value: inputValues[index] || '', autocomplete: "one-time-code", ref: (el) => {
|
|
22085
22170
|
if (el) {
|
|
22086
22171
|
inputRefs[index] = el;
|
|
22087
22172
|
}
|
|
@@ -22089,13 +22174,19 @@ class InputOTP {
|
|
|
22089
22174
|
// The input was removed, so drop its ref and any after it.
|
|
22090
22175
|
inputRefs.splice(index);
|
|
22091
22176
|
}
|
|
22092
|
-
}, onInput: this.onInput(index), onBlur: this.onBlur, onFocus: this.onFocus(index), onKeyDown: this.onKeyDown(index), onPaste: this.onPaste })), this.showSeparator(index) && hAsync("div", { class: "input-otp-separator" }))))), hAsync("div", { key: '
|
|
22177
|
+
}, onInput: this.onInput(index), onBlur: this.onBlur, onFocus: this.onFocus(index), onKeyDown: this.onKeyDown(index), onPaste: this.onPaste })), this.showSeparator(index) && hAsync("div", { class: "input-otp-separator" }))))), hAsync("div", { key: '4d55d7532dcc28fadcb2f860dd2fcd2aa45ccccc', id: descriptionId, class: {
|
|
22093
22178
|
'input-otp-description': true,
|
|
22094
22179
|
'input-otp-description-hidden': !hasDescription,
|
|
22095
|
-
} }, hAsync("slot", { key: '
|
|
22180
|
+
} }, hAsync("slot", { key: '5d6823f48a9786799c9d485ce0d6b9de2ae7f537' })), this.renderBottomContent()));
|
|
22096
22181
|
}
|
|
22097
22182
|
get el() { return getElement(this); }
|
|
22098
22183
|
static get watchers() { return {
|
|
22184
|
+
"aria-describedby": [{
|
|
22185
|
+
"onHostAriaChange": 0
|
|
22186
|
+
}],
|
|
22187
|
+
"aria-invalid": [{
|
|
22188
|
+
"onHostAriaChange": 0
|
|
22189
|
+
}],
|
|
22099
22190
|
"value": [{
|
|
22100
22191
|
"valueChanged": 0
|
|
22101
22192
|
}],
|
|
@@ -22119,7 +22210,10 @@ class InputOTP {
|
|
|
22119
22210
|
"autocapitalize": [1],
|
|
22120
22211
|
"color": [513],
|
|
22121
22212
|
"disabled": [516],
|
|
22213
|
+
"errorText": [1, "error-text"],
|
|
22122
22214
|
"fill": [1],
|
|
22215
|
+
"helperText": [1, "helper-text"],
|
|
22216
|
+
"inputLabelFormatter": [16],
|
|
22123
22217
|
"inputmode": [1],
|
|
22124
22218
|
"length": [2],
|
|
22125
22219
|
"pattern": [1],
|
|
@@ -22132,6 +22226,7 @@ class InputOTP {
|
|
|
22132
22226
|
"inputValues": [32],
|
|
22133
22227
|
"hasFocus": [32],
|
|
22134
22228
|
"previousInputValues": [32],
|
|
22229
|
+
"isInvalid": [32],
|
|
22135
22230
|
"setFocus": [64]
|
|
22136
22231
|
},
|
|
22137
22232
|
"$listeners$": undefined,
|
|
@@ -22140,6 +22235,12 @@ class InputOTP {
|
|
|
22140
22235
|
}; }
|
|
22141
22236
|
}
|
|
22142
22237
|
let inputIds = 0;
|
|
22238
|
+
/**
|
|
22239
|
+
* The attribute controller removes these from the host, so an app could never
|
|
22240
|
+
* clear them. They stay on the host instead, which only works for global
|
|
22241
|
+
* attributes since the host has no role.
|
|
22242
|
+
*/
|
|
22243
|
+
const HOST_ARIA_ATTRIBUTES = ['aria-describedby', 'aria-invalid'];
|
|
22143
22244
|
|
|
22144
22245
|
const iosInputPasswordToggleCss = () => ``;
|
|
22145
22246
|
|
|
@@ -24329,7 +24430,7 @@ class Menu {
|
|
|
24329
24430
|
* of the split pane. If the split pane is
|
|
24330
24431
|
* hidden then the menu should be too.
|
|
24331
24432
|
*/
|
|
24332
|
-
const splitPane = this.
|
|
24433
|
+
const splitPane = this.getSplitPane();
|
|
24333
24434
|
if (splitPane !== null) {
|
|
24334
24435
|
this.isPaneVisible = await splitPane.isVisible();
|
|
24335
24436
|
}
|
|
@@ -24368,8 +24469,8 @@ class Menu {
|
|
|
24368
24469
|
this.contentEl = undefined;
|
|
24369
24470
|
}
|
|
24370
24471
|
onSplitPaneChanged(ev) {
|
|
24371
|
-
const
|
|
24372
|
-
if (
|
|
24472
|
+
const splitPane = this.getSplitPane();
|
|
24473
|
+
if (splitPane !== null && splitPane === ev.target) {
|
|
24373
24474
|
this.isPaneVisible = ev.detail.visible;
|
|
24374
24475
|
this.updateState();
|
|
24375
24476
|
}
|
|
@@ -24567,6 +24668,24 @@ class Menu {
|
|
|
24567
24668
|
_isActive() {
|
|
24568
24669
|
return !this.disabled && !this.isPaneVisible;
|
|
24569
24670
|
}
|
|
24671
|
+
/**
|
|
24672
|
+
* Returns the split pane this menu is a side pane of.
|
|
24673
|
+
* A menu inside the split pane's main content, such as one
|
|
24674
|
+
* in a page, is a regular menu. The menu doesn't need to be
|
|
24675
|
+
* a direct child, since it can be wrapped in a component.
|
|
24676
|
+
*/
|
|
24677
|
+
getSplitPane() {
|
|
24678
|
+
const splitPane = this.el.closest('ion-split-pane');
|
|
24679
|
+
const main = this.el.closest('.split-pane-main');
|
|
24680
|
+
/**
|
|
24681
|
+
* A split pane can be the main content of an outer split
|
|
24682
|
+
* pane, so only this split pane's main content counts.
|
|
24683
|
+
*/
|
|
24684
|
+
if (splitPane === null || (main !== null && main !== splitPane && splitPane.contains(main))) {
|
|
24685
|
+
return null;
|
|
24686
|
+
}
|
|
24687
|
+
return splitPane;
|
|
24688
|
+
}
|
|
24570
24689
|
canSwipe() {
|
|
24571
24690
|
return this.swipeGesture && !this.isAnimating && this._isActive();
|
|
24572
24691
|
}
|
|
@@ -24809,21 +24928,21 @@ class Menu {
|
|
|
24809
24928
|
}
|
|
24810
24929
|
}
|
|
24811
24930
|
render() {
|
|
24812
|
-
const { type, disabled,
|
|
24931
|
+
const { type, disabled, isPaneVisible, inheritedAttributes, side } = this;
|
|
24813
24932
|
const mode = getIonMode$1(this);
|
|
24814
24933
|
/**
|
|
24815
24934
|
* If the Close Watcher is enabled then
|
|
24816
24935
|
* the ionBackButton listener in the menu controller
|
|
24817
24936
|
* will handle closing the menu when Escape is pressed.
|
|
24818
24937
|
*/
|
|
24819
|
-
return (hAsync(Host, { key: '
|
|
24938
|
+
return (hAsync(Host, { key: '7481c8a32a135fb0fd6d5591eecbf3fb0a8e8dde', onKeyDown: shouldUseCloseWatcher() ? null : this.onKeydown, role: "navigation", "aria-label": inheritedAttributes['aria-label'] || 'menu', class: {
|
|
24820
24939
|
[mode]: true,
|
|
24821
24940
|
[`menu-type-${type}`]: true,
|
|
24822
24941
|
'menu-enabled': !disabled,
|
|
24823
24942
|
[`menu-side-${side}`]: true,
|
|
24824
24943
|
'menu-pane-visible': isPaneVisible,
|
|
24825
|
-
'split-pane-side':
|
|
24826
|
-
} }, hAsync("div", { key: '
|
|
24944
|
+
'split-pane-side': this.getSplitPane() !== null,
|
|
24945
|
+
} }, hAsync("div", { key: '8ac2f0f531db944a46e5fef016d0b18bd7b804cc', class: "menu-inner", part: "container", ref: (el) => (this.menuInnerEl = el) }, hAsync("slot", { key: '1ac3e13ccccf1adb7915b739fc794f2889b626ce' })), hAsync("ion-backdrop", { key: 'f8becbf4de1a13feb57fb87973befecb88510bab', ref: (el) => (this.backdropEl = el), class: "menu-backdrop", tappable: false, stopPropagation: false, part: "backdrop" })));
|
|
24827
24946
|
}
|
|
24828
24947
|
get el() { return getElement(this); }
|
|
24829
24948
|
static get watchers() { return {
|
|
@@ -35717,6 +35836,14 @@ class Route {
|
|
|
35717
35836
|
*
|
|
35718
35837
|
* Accepts paths similar to expressjs so that you can define parameters
|
|
35719
35838
|
* in the url /foo/:bar where bar would be available in incoming props.
|
|
35839
|
+
*
|
|
35840
|
+
* A url ending in `*`, such as `*` or `/admin/*`, matches any remaining path,
|
|
35841
|
+
* including none, so `/admin/*` also matches `/admin`. It only wins over a
|
|
35842
|
+
* route that matches the whole path when it has more fixed segments, so
|
|
35843
|
+
* `/admin/*` wins over `/:section/:id` but not over `/admin/:id`. It always
|
|
35844
|
+
* wins over a route that matches by ignoring trailing segments, such as
|
|
35845
|
+
* `/admin` for `/admin/users`. The matched path is passed in the `pathMatch`
|
|
35846
|
+
* prop without a leading `/`. A `*` on a route with child routes is ignored.
|
|
35720
35847
|
*/
|
|
35721
35848
|
this.url = '';
|
|
35722
35849
|
}
|
|
@@ -35805,6 +35932,8 @@ class RouteRedirect {
|
|
|
35805
35932
|
const ROUTER_INTENT_NONE = 'root';
|
|
35806
35933
|
const ROUTER_INTENT_FORWARD = 'forward';
|
|
35807
35934
|
const ROUTER_INTENT_BACK = 'back';
|
|
35935
|
+
/** Param that holds the path matched by a trailing `*` in an `ion-route` url. */
|
|
35936
|
+
const WILDCARD_PARAM = 'pathMatch';
|
|
35808
35937
|
|
|
35809
35938
|
/** Join the non empty segments with "/". */
|
|
35810
35939
|
const generatePath = (segments) => {
|
|
@@ -35838,12 +35967,13 @@ const writeSegments = (history, root, useHash, segments, direction, state, query
|
|
|
35838
35967
|
*
|
|
35839
35968
|
* Notes:
|
|
35840
35969
|
* - parameter segments of the form :param are replaced with their value,
|
|
35841
|
-
* - null is returned when a value is missing for any parameter segment
|
|
35970
|
+
* - null is returned when a value is missing for any parameter segment,
|
|
35971
|
+
* - a trailing wildcard is replaced with the path it matched.
|
|
35842
35972
|
*/
|
|
35843
35973
|
const chainToSegments = (chain) => {
|
|
35844
35974
|
const segments = [];
|
|
35845
35975
|
for (const route of chain) {
|
|
35846
|
-
for (const segment of route.segments) {
|
|
35976
|
+
for (const segment of withoutWildcard(route.segments)) {
|
|
35847
35977
|
if (segment[0] === ':') {
|
|
35848
35978
|
const param = route.params && route.params[segment.slice(1)];
|
|
35849
35979
|
if (!param) {
|
|
@@ -35855,9 +35985,22 @@ const chainToSegments = (chain) => {
|
|
|
35855
35985
|
segments.push(segment);
|
|
35856
35986
|
}
|
|
35857
35987
|
}
|
|
35988
|
+
segments.push(...wildcardSegments(route));
|
|
35858
35989
|
}
|
|
35859
35990
|
return segments;
|
|
35860
35991
|
};
|
|
35992
|
+
/** Only a `*` in the last segment of a route url is a wildcard. Elsewhere it's matched literally. */
|
|
35993
|
+
const endsWithWildcard = (segments) => {
|
|
35994
|
+
return segments[segments.length - 1] === '*';
|
|
35995
|
+
};
|
|
35996
|
+
/** Returns the path segments matched by the trailing wildcard of the route. */
|
|
35997
|
+
const wildcardSegments = (route) => {
|
|
35998
|
+
const pathMatch = endsWithWildcard(route.segments) ? route.params?.[WILDCARD_PARAM] : undefined;
|
|
35999
|
+
return pathMatch ? pathMatch.split('/').filter((s) => s.length > 0) : [];
|
|
36000
|
+
};
|
|
36001
|
+
const withoutWildcard = (segments) => {
|
|
36002
|
+
return endsWithWildcard(segments) ? segments.slice(0, -1) : segments;
|
|
36003
|
+
};
|
|
35861
36004
|
/**
|
|
35862
36005
|
* Removes the prefix segments from the path segments.
|
|
35863
36006
|
*
|
|
@@ -36190,6 +36333,10 @@ const matchesIDs = (ids, chain) => {
|
|
|
36190
36333
|
if (routeId.id.toLowerCase() !== routeChain.id) {
|
|
36191
36334
|
break;
|
|
36192
36335
|
}
|
|
36336
|
+
// Weight a wildcard route when the outlet reports its `pathMatch`
|
|
36337
|
+
if (routeId.params?.[WILDCARD_PARAM] !== undefined && endsWithWildcard(routeChain.segments)) {
|
|
36338
|
+
score++;
|
|
36339
|
+
}
|
|
36193
36340
|
if (routeId.params) {
|
|
36194
36341
|
const routeIdParams = Object.keys(routeId.params);
|
|
36195
36342
|
// Only compare routes with the chain that have the same number of parameters.
|
|
@@ -36245,21 +36392,28 @@ const matchesSegments = (segments, chain) => {
|
|
|
36245
36392
|
matchesDefault = true;
|
|
36246
36393
|
}
|
|
36247
36394
|
else {
|
|
36248
|
-
|
|
36395
|
+
const params = {};
|
|
36396
|
+
for (const segment of withoutWildcard(chainSegments)) {
|
|
36249
36397
|
const data = inputSegments.next();
|
|
36250
36398
|
// data param
|
|
36251
36399
|
if (segment[0] === ':') {
|
|
36252
36400
|
if (data === '') {
|
|
36253
36401
|
return null;
|
|
36254
36402
|
}
|
|
36255
|
-
allparams = allparams || [];
|
|
36256
|
-
const params = allparams[i] || (allparams[i] = {});
|
|
36257
36403
|
params[segment.slice(1)] = data;
|
|
36258
36404
|
}
|
|
36259
36405
|
else if (data !== segment) {
|
|
36260
36406
|
return null;
|
|
36261
36407
|
}
|
|
36262
36408
|
}
|
|
36409
|
+
// A trailing `*` on a parent route has no effect. Its children match the rest of the path.
|
|
36410
|
+
if (i === chain.length - 1 && endsWithWildcard(chainSegments)) {
|
|
36411
|
+
params[WILDCARD_PARAM] = inputSegments.rest().join('/');
|
|
36412
|
+
}
|
|
36413
|
+
if (Object.keys(params).length > 0) {
|
|
36414
|
+
allparams = allparams || [];
|
|
36415
|
+
allparams[i] = params;
|
|
36416
|
+
}
|
|
36263
36417
|
matchesDefault = false;
|
|
36264
36418
|
}
|
|
36265
36419
|
}
|
|
@@ -36291,25 +36445,38 @@ const mergeParams = (a, b) => {
|
|
|
36291
36445
|
* Returns the best match or null when no match is found.
|
|
36292
36446
|
* When a chain is returned the parameters are updated from the RouteIDs.
|
|
36293
36447
|
* That is they contain both the componentProps of the <ion-route> and the parameter segment.
|
|
36448
|
+
*
|
|
36449
|
+
* When a wildcard route ties with other routes, a route without a wildcard that can build a url wins,
|
|
36450
|
+
* then the wildcard route. Otherwise the first route declared wins a tie.
|
|
36294
36451
|
*/
|
|
36295
36452
|
const findChainForIDs = (ids, chains) => {
|
|
36296
|
-
let match = null;
|
|
36297
36453
|
let maxMatches = 0;
|
|
36454
|
+
let tied = [];
|
|
36298
36455
|
for (const chain of chains) {
|
|
36299
36456
|
const score = matchesIDs(ids, chain);
|
|
36300
36457
|
if (score > maxMatches) {
|
|
36301
|
-
match = chain;
|
|
36302
36458
|
maxMatches = score;
|
|
36459
|
+
tied = [chain];
|
|
36460
|
+
}
|
|
36461
|
+
else if (score > 0 && score === maxMatches) {
|
|
36462
|
+
tied.push(chain);
|
|
36303
36463
|
}
|
|
36304
36464
|
}
|
|
36305
|
-
|
|
36306
|
-
|
|
36307
|
-
|
|
36308
|
-
|
|
36309
|
-
|
|
36310
|
-
|
|
36465
|
+
const matches = tied.map((chain) => chain.map((route, i) => ({
|
|
36466
|
+
id: route.id,
|
|
36467
|
+
segments: route.segments,
|
|
36468
|
+
params: mergeParams(route.params, ids[i]?.params),
|
|
36469
|
+
})));
|
|
36470
|
+
if (!matches.some(chainEndsWithWildcard)) {
|
|
36471
|
+
return matches.length > 0 ? matches[0] : null;
|
|
36311
36472
|
}
|
|
36312
|
-
return
|
|
36473
|
+
return matches.reduce((best, chain) => (tieRank(chain) > tieRank(best) ? chain : best));
|
|
36474
|
+
};
|
|
36475
|
+
const tieRank = (chain) => {
|
|
36476
|
+
if (chainEndsWithWildcard(chain)) {
|
|
36477
|
+
return 1;
|
|
36478
|
+
}
|
|
36479
|
+
return chainToSegments(chain) !== null ? 2 : 0;
|
|
36313
36480
|
};
|
|
36314
36481
|
/**
|
|
36315
36482
|
* Finds the best match for the segments in the chains.
|
|
@@ -36317,10 +36484,17 @@ const findChainForIDs = (ids, chains) => {
|
|
|
36317
36484
|
* Returns the best match or null when no match is found.
|
|
36318
36485
|
* When a chain is returned the parameters are updated from the segments.
|
|
36319
36486
|
* That is they contain both the componentProps of the <ion-route> and the parameter segments.
|
|
36487
|
+
*
|
|
36488
|
+
* When wildcard routes match, the one with the most fixed segments wins if it has more fixed segments than every
|
|
36489
|
+
* route that matched the whole path. Routes that only matched by ignoring trailing segments don't count.
|
|
36320
36490
|
*/
|
|
36321
36491
|
const findChainForSegments = (segments, chains) => {
|
|
36322
36492
|
let match = null;
|
|
36323
36493
|
let bestScore = 0;
|
|
36494
|
+
let fullMatch = null;
|
|
36495
|
+
let bestFullScore = 0;
|
|
36496
|
+
let maxFullFixed = -1;
|
|
36497
|
+
let wildcard = null;
|
|
36324
36498
|
for (const chain of chains) {
|
|
36325
36499
|
const matchedChain = matchesSegments(segments, chain);
|
|
36326
36500
|
if (matchedChain !== null) {
|
|
@@ -36329,9 +36503,51 @@ const findChainForSegments = (segments, chains) => {
|
|
|
36329
36503
|
bestScore = score;
|
|
36330
36504
|
match = matchedChain;
|
|
36331
36505
|
}
|
|
36506
|
+
if (chainEndsWithWildcard(matchedChain)) {
|
|
36507
|
+
if (wildcard === null || winsWildcard(matchedChain, wildcard)) {
|
|
36508
|
+
wildcard = matchedChain;
|
|
36509
|
+
}
|
|
36510
|
+
}
|
|
36511
|
+
else if (!isPartialMatch(segments, matchedChain)) {
|
|
36512
|
+
if (score > bestFullScore) {
|
|
36513
|
+
bestFullScore = score;
|
|
36514
|
+
fullMatch = matchedChain;
|
|
36515
|
+
}
|
|
36516
|
+
maxFullFixed = Math.max(maxFullFixed, countFixedSegments(matchedChain));
|
|
36517
|
+
}
|
|
36518
|
+
}
|
|
36519
|
+
}
|
|
36520
|
+
// Without a wildcard to match the rest of the path, routes can still ignore trailing segments.
|
|
36521
|
+
if (wildcard === null) {
|
|
36522
|
+
return match;
|
|
36523
|
+
}
|
|
36524
|
+
// Compare fixed segments rather than priority, since nesting under default routes raises the priority
|
|
36525
|
+
return countFixedSegments(wildcard) > maxFullFixed ? wildcard : fullMatch;
|
|
36526
|
+
};
|
|
36527
|
+
/** Returns whether the chain matched the path segments only by ignoring some trailing segments. */
|
|
36528
|
+
const isPartialMatch = (segments, chain) => {
|
|
36529
|
+
const matched = chainToSegments(chain);
|
|
36530
|
+
return matched !== null && matched.length < segments.filter((s) => s !== '').length;
|
|
36531
|
+
};
|
|
36532
|
+
const chainEndsWithWildcard = (chain) => {
|
|
36533
|
+
return endsWithWildcard(chain[chain.length - 1].segments);
|
|
36534
|
+
};
|
|
36535
|
+
/** Returns whether the wildcard chain beats `best` by fixed segments, then by priority. */
|
|
36536
|
+
const winsWildcard = (chain, best) => {
|
|
36537
|
+
const chainFixed = countFixedSegments(chain);
|
|
36538
|
+
const bestFixed = countFixedSegments(best);
|
|
36539
|
+
return chainFixed > bestFixed || (chainFixed === bestFixed && computePriority(chain) > computePriority(best));
|
|
36540
|
+
};
|
|
36541
|
+
const countFixedSegments = (chain) => {
|
|
36542
|
+
let count = 0;
|
|
36543
|
+
for (const route of chain) {
|
|
36544
|
+
for (const segment of withoutWildcard(route.segments)) {
|
|
36545
|
+
if (segment !== '' && segment[0] !== ':') {
|
|
36546
|
+
count++;
|
|
36547
|
+
}
|
|
36332
36548
|
}
|
|
36333
36549
|
}
|
|
36334
|
-
return
|
|
36550
|
+
return count;
|
|
36335
36551
|
};
|
|
36336
36552
|
/**
|
|
36337
36553
|
* Computes the priority of a chain.
|
|
@@ -36343,12 +36559,14 @@ const findChainForSegments = (segments, chains) => {
|
|
|
36343
36559
|
* - /path/to/page
|
|
36344
36560
|
*
|
|
36345
36561
|
* The second one will be given a higher priority because "page" is a fixed segment (vs ":where", a parameter segment).
|
|
36562
|
+
*
|
|
36563
|
+
* A trailing wildcard is not counted.
|
|
36346
36564
|
*/
|
|
36347
36565
|
const computePriority = (chain) => {
|
|
36348
36566
|
let score = 1;
|
|
36349
36567
|
let level = 1;
|
|
36350
36568
|
for (const route of chain) {
|
|
36351
|
-
for (const segment of route.segments) {
|
|
36569
|
+
for (const segment of withoutWildcard(route.segments)) {
|
|
36352
36570
|
if (segment[0] === ':') {
|
|
36353
36571
|
score += Math.pow(1, level);
|
|
36354
36572
|
}
|
|
@@ -36370,6 +36588,12 @@ class RouterSegments {
|
|
|
36370
36588
|
}
|
|
36371
36589
|
return '';
|
|
36372
36590
|
}
|
|
36591
|
+
/** Consumes and returns the remaining non empty segments. */
|
|
36592
|
+
rest() {
|
|
36593
|
+
const rest = this.segments.filter((s) => s !== '');
|
|
36594
|
+
this.segments = [];
|
|
36595
|
+
return rest;
|
|
36596
|
+
}
|
|
36373
36597
|
}
|
|
36374
36598
|
|
|
36375
36599
|
const readProp = (el, prop) => {
|
package/package.json
CHANGED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* (C) Ionic http://ionicframework.com - MIT License
|
|
3
|
-
*/
|
|
4
|
-
import{r as t,d as o,c as n,a as e,g as i,h as r,f as s}from"./p-BpRUsN_W.js";import{c as a,r as c,u as h}from"./p-Co7eql8D.js";import{a as u,i as l,g as f}from"./p-CXs4J83x.js";import{o as d,c as w}from"./p-byZM6qHV.js";import{b as m}from"./p-SEecsUh7.js";import"./p-Dojwmvde.js";const p=class{constructor(n){t(this,n),this.ionRouteDataChanged=o(this,"ionRouteDataChanged",7),this.url=""}onUpdate(t){this.ionRouteDataChanged.emit(t)}onComponentProps(t,o){if(t===o)return;const n=t?Object.keys(t):[],e=o?Object.keys(o):[];if(n.length===e.length){for(const e of n)if(t[e]!==o[e])return void this.onUpdate(t)}else this.onUpdate(t)}connectedCallback(){this.ionRouteDataChanged.emit()}static get watchers(){return{url:[{onUpdate:0}],component:[{onUpdate:0}],componentProps:[{onComponentProps:0}]}}},g=class{constructor(n){t(this,n),this.ionRouteRedirectChanged=o(this,"ionRouteRedirectChanged",7)}propDidChange(){this.ionRouteRedirectChanged.emit()}connectedCallback(){this.ionRouteRedirectChanged.emit()}static get watchers(){return{from:[{propDidChange:0}],to:[{propDidChange:0}]}}},b="root",y="forward",v=t=>"/"+t.filter((t=>t.length>0)).join("/"),C=t=>{let o,n,e=[""];if(null!=t){const i=t.indexOf("#");i>-1&&(n=t.substring(i+1),t=t.substring(0,i));const r=t.indexOf("?");r>-1&&(o=t.substring(r+1),t=t.substring(0,r)),e=t.split("/").map((t=>t.trim())).filter((t=>t.length>0)),0===e.length&&(e=[""])}return{segments:e,queryString:o,fragment:n}},R=async(t,o,e,i,r=!1,s)=>{try{const n=E(t);if(i>=o.length||!n)return r;await new Promise((t=>a(n,t)));const c=o[i],h=await n.setRouteId(c.id,c.params,e,s);return h.changed&&(e=b,r=!0),r=await R(h.element,o,e,i+1,r,s),h.markVisible&&await h.markVisible(),r}catch(t){return n("[ion-router] - Exception in writeNavState:",t),!1}},S=()=>new Promise((t=>c((()=>t())))),k=t=>{const o=t.closest(".ion-page");return null===o?null===document.querySelector(".ion-page"):null===o.closest(".ion-page-hidden, .tab-hidden")},j=":not([no-router]) ion-tabs, :not([no-router]) ion-router-outlet",E=t=>{if(t)return t.matches(j)?t:t.querySelector(j)??void 0},D=(t,o)=>o.find((o=>((t,o)=>{const{from:n,to:e}=o;if(void 0===e)return!1;if(n.length>t.length)return!1;for(let o=0;o<n.length;o++){const e=n[o];if("*"===e)return!0;if(e!==t[o])return!1}return n.length===t.length})(t,o))),$=(t,o)=>{const n=Math.min(t.length,o.length);let e=0;for(let i=0;i<n;i++){const n=t[i],r=o[i];if(n.id.toLowerCase()!==r.id)break;if(n.params){const t=Object.keys(n.params);if(t.length===r.segments.length){const o=t.map((t=>`:${t}`));for(let t=0;t<o.length&&o[t].toLowerCase()===r.segments[t];t++)e++}}e++}return e},x=(t,o)=>{const n=new L(t);let e,i=!1;for(let t=0;t<o.length;t++){const r=o[t].segments;if(""===r[0])i=!0;else{for(const o of r){const i=n.next();if(":"===o[0]){if(""===i)return null;e=e||[],(e[t]||(e[t]={}))[o.slice(1)]=i}else if(i!==o)return null}i=!1}}return i&&i!==(""===n.next())?null:e?o.map(((t,o)=>({id:t.id,segments:t.segments,params:T(t.params,e[o]),beforeEnter:t.beforeEnter,beforeLeave:t.beforeLeave}))):o},T=(t,o)=>t||o?{...t,...o}:void 0,U=(t,o)=>{let n=null,e=0;for(const i of o){const o=x(t,i);if(null!==o){const t=N(o);t>e&&(e=t,n=o)}}return n},N=t=>{let o=1,n=1;for(const e of t)for(const t of e.segments)":"===t[0]?o+=Math.pow(1,n):""!==t&&(o+=Math.pow(2,n)),n++;return o};class L{constructor(t){this.segments=t.slice()}next(){return this.segments.length>0?this.segments.shift():""}}const O=(t,o)=>o in t?t[o]:t.hasAttribute(o)?t.getAttribute(o):null,P=t=>Array.from(t.children).filter((t=>"ION-ROUTE-REDIRECT"===t.tagName)).map((t=>{const o=O(t,"to");return{from:C(O(t,"from")).segments,to:null==o?void 0:C(o)}})),W=t=>q(_(t)),_=t=>Array.from(t.children).filter((t=>"ION-ROUTE"===t.tagName&&Boolean(t.component))).map((t=>{const o=O(t,"component");return{segments:C(O(t,"url")).segments,id:o.toLowerCase(),params:t.componentProps,beforeLeave:t.beforeLeave,beforeEnter:t.beforeEnter,children:_(t)}})),q=t=>{const o=[];for(const n of t)F([],o,n);return o},F=(t,o,n)=>{if(t=[...t,{id:n.id,segments:n.segments,params:n.params,beforeLeave:n.beforeLeave,beforeEnter:n.beforeEnter}],0!==n.children.length)for(const e of n.children)F(t,o,e);else o.push(t)},I=class{constructor(n){t(this,n),this.ionRouteWillChange=o(this,"ionRouteWillChange",7),this.ionRouteDidChange=o(this,"ionRouteDidChange",7),this.previousPath=null,this.busy=!1,this.state=0,this.lastState=0,this.fragmentScrollToken=0,this.root="/",this.useHash=!0}async componentWillLoad(){await(E(document.body)?Promise.resolve():new Promise((t=>{const o=()=>{window.removeEventListener("ionNavWillLoad",o),clearTimeout(n),t()},n=setTimeout(o,500);window.addEventListener("ionNavWillLoad",o,{once:!0})})));const t=await this.runGuards(this.getSegments());if(!0===t)await this.onRoutesChanged()&&this.maybeScrollToFragment();else if("object"==typeof t){const{redirect:o}=t,n=C(o);this.setSegments(n.segments,b,n.queryString,n.fragment),await this.writeNavStateRoot(n.segments,b)&&this.maybeScrollToFragment()}}componentDidLoad(){window.addEventListener("ionRouteRedirectChanged",h(this.onRedirectChanged.bind(this),10)),window.addEventListener("ionRouteDataChanged",h(this.onRoutesChanged.bind(this),100))}async onPopState(){const t=this.historyDirection();let o=this.getSegments();const n=await this.runGuards(o);if(!0!==n){if("object"!=typeof n)return!1;o=C(n.redirect).segments}const e=await this.writeNavStateRoot(o,t);return e&&this.maybeScrollToFragment(),e}onBackButton(t){t.detail.register(0,(t=>{this.back(),t()}))}async canTransition(){const t=await this.runGuards();return!0===t||"object"==typeof t&&t.redirect}async push(t,o="forward",n){if(t.startsWith(".")){const o=new URL(t,`https://host/${this.previousPath??"/"}`);t=o.pathname+o.search+o.hash}let e=C(t);const i=await this.runGuards(e.segments);if(!0!==i){if("object"!=typeof i)return!1;e=C(i.redirect)}this.setSegments(e.segments,o,e.queryString,e.fragment);const r=await this.writeNavStateRoot(e.segments,o,n);return r&&this.maybeScrollToFragment(),r}back(){return window.history.back(),Promise.resolve(this.waitPromise)}async printDebug(){(t=>{console.group(`[ion-core] ROUTES[${t.length}]`);for(const o of t){const t=[];o.forEach((o=>t.push(...o.segments)));const n=o.map((t=>t.id));console.debug(`%c ${v(t)}`,"font-weight: bold; padding-left: 20px","=>\t",`(${n.join(", ")})`)}console.groupEnd()})(W(this.el)),(t=>{console.group(`[ion-core] REDIRECTS[${t.length}]`);for(const o of t)o.to&&console.debug("FROM: ",`$c ${v(o.from)}`,"font-weight: bold"," TO: ",`$c ${v(o.to.segments)}`,"font-weight: bold");console.groupEnd()})(P(this.el))}async navChanged(t){if(this.busy)return e("[ion-router] - Router is busy, navChanged was cancelled."),!1;const{ids:o,outlet:n}=await(async()=>{const t=[];let o,n=window.document.body;for(;o=E(n);){const e=await o.getRouteId();if(!e)break;n=e.element,e.element=void 0,t.push(e)}return{ids:t,outlet:o}})(),i=((t,o)=>{let n=null,e=0;for(const i of o){const o=$(t,i);o>e&&(n=i,e=o)}return n?n.map(((o,n)=>({id:o.id,segments:o.segments,params:T(o.params,t[n]?.params)}))):null})(o,W(this.el));if(!i)return e("[ion-router] - No matching URL for",o.map((t=>t.id))),!1;const r=(t=>{const o=[];for(const n of t)for(const t of n.segments)if(":"===t[0]){const e=n.params&&n.params[t.slice(1)];if(!e)return null;o.push(e)}else""!==t&&o.push(t);return o})(i);if(!r)return e("[ion-router] - Router could not match path because some required param is missing."),!1;const s=v(r)===this.previousPath?this.getFragment():void 0;return this.setSegments(r,t,void 0,s),await this.safeWriteNavState(n,i,b,r,null,o.length),!0}onRedirectChanged(){const t=this.getSegments();t&&D(t,P(this.el))&&this.writeNavStateRoot(t,b)}onRoutesChanged(){return this.writeNavStateRoot(this.getSegments(),b)}historyDirection(){const t=window;null===t.history.state&&(this.state++,t.history.replaceState(this.state,t.document.title,t.document.location?.href));const o=t.history.state,n=this.lastState;return this.lastState=o,o>n||o>=n&&n>0?y:o<n?"back":b}async writeNavStateRoot(t,o,e){if(!t)return n("[ion-router] - URL is not part of the routing set."),!1;const i=P(this.el),r=D(t,i);let s=null;if(r){const{segments:n,queryString:e,fragment:i}=r.to;this.setSegments(n,o,e,i),s=r.from,t=n}const a=W(this.el),c=U(t,a);return c?this.safeWriteNavState(document.body,c,o,t,s,0,e):(n("[ion-router] - The path does not match any route."),!1)}async safeWriteNavState(t,o,e,i,r,s=0,a){const c=await this.lock();let h=!1;try{h=await this.writeNavState(t,o,e,i,r,s,a)}catch(t){n("[ion-router] - Exception in safeWriteNavState:",t)}return c(),h}async lock(){const t=this.waitPromise;let o;return this.waitPromise=new Promise((t=>o=t)),void 0!==t&&await t,o}async runGuards(t=this.getSegments(),o){if(void 0===o&&(o=C(this.previousPath).segments),!t||!o)return!0;const n=W(this.el),e=U(o,n),i=e&&e[e.length-1].beforeLeave,r=!i||await i();if(!1===r||"object"==typeof r)return r;const s=U(t,n),a=s&&s[s.length-1].beforeEnter;return!a||a()}async writeNavState(t,o,n,i,r,s=0,a){if(this.busy)return e("[ion-router] - Router is busy, transition was cancelled."),!1;this.busy=!0;const c=this.routeChangeEvent(i,r);c&&this.ionRouteWillChange.emit(c);const h=await R(t,o,n,s,!1,a);return this.busy=!1,c&&this.ionRouteDidChange.emit(c),h}setSegments(t,o,n,e){this.state++,this.fragmentScrollToken++,((t,o,n,e,i,r,s,a)=>{const c=((t,o,n,e)=>{let i=v(t);return o&&(i="#"+i),void 0!==n&&(i+="?"+n),void 0!==e&&(i+="#"+e),i})([...C(o).segments,...e],n,s,a);i===y?t.pushState(r,"",c):t.replaceState(r,"",c)})(window.history,this.root,this.useHash,t,o,this.state,n,e)}getSegments(){return((t,o,n)=>{const e=C(this.root).segments,i=n?t.hash.slice(1):t.pathname;return((t,o)=>{if(t.length>o.length)return null;if(t.length<=1&&""===t[0])return o;for(let n=0;n<t.length;n++)if(t[n]!==o[n])return null;return o.length===t.length?[""]:o.slice(t.length)})(e,C(i).segments)})(window.location,0,this.useHash)}getFragment(){return(this.useHash?C(window.location.hash.slice(1)).fragment:window.location.hash.slice(1))||void 0}maybeScrollToFragment(){const t=this.getFragment();if(!t)return;const o=this.fragmentScrollToken;(async(t,o=()=>!0)=>{if(null==t||""===t)return!1;let e;try{e=decodeURIComponent(t)}catch{e=t}const i=await(async(t,o)=>{const n="undefined"!=typeof CSS&&"function"==typeof CSS.escape?CSS.escape(t):null;for(let e=0;e<30;e++){if(!o())return null;let e=[];if(null!==n)try{e=[...document.querySelectorAll(`#${n}, a[name="${n}"]`)]}catch{e=[...document.querySelectorAll(`#${n}`)]}else{const o=document.getElementById(t);null!==o&&(e=[o])}for(let t=e.length-1;t>=0;t--)if(k(e[t]))return e[t];await S()}return null})(e,o);if(!i||!o())return!1;try{const t=u(i);if(t&&l(t)){const n=t,e=await f(n);if(await S(),!o())return!1;const r=i.getBoundingClientRect(),s=e.getBoundingClientRect(),a=r.top-s.top+e.scrollTop;await n.scrollToPoint(e.scrollLeft,a,300)}else i.scrollIntoView({behavior:"smooth"});return!0}catch(t){return n("[ion-router] - Exception in scrollToFragment:",t),!1}})(t,(()=>o===this.fragmentScrollToken)).catch((()=>{}))}routeChangeEvent(t,o){const n=this.previousPath,e=v(t);return this.previousPath=e,e===n?null:{from:n,redirectedFrom:o?v(o):null,to:e}}get el(){return i(this)}},M=class{constructor(o){t(this,o),this.routerDirection="forward",this.onClick=t=>{d(this.href,t,this.routerDirection,this.routerAnimation)}}render(){const t=m(this),o={href:this.href,rel:this.rel,target:this.target};return r(s,{key:"8aaf732d8f5cc4ced351e2b3164605c10bd90cad",onClick:this.onClick,class:w(this.color,{[t]:!0,"ion-activatable":!0})},r("a",{key:"8f291ffbbce5b08dd10720d855eb020880bf1be1",...o},r("slot",{key:"24dc388a49204011e1c1f0a1131c9a1b0a4ae4da"})))}};M.style=":host{--background:transparent;--color:var(--ion-color-primary, #0054e9);background:var(--background);color:var(--color)}:host(.ion-color){color:var(--ion-color-base)}a{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}";export{p as ion_route,g as ion_route_redirect,I as ion_router,M as ion_router_link}
|