UNPKG

43.6 kBJavaScriptView Raw
1'use strict';
2
3Object.defineProperty(exports, '__esModule', { value: true });
4
5const index = require('./index-a0a08b2a.js');
6const ionicGlobal = require('./ionic-global-06f21c1a.js');
7const buttonActive = require('./button-active-59a73c71.js');
8const overlays = require('./overlays-59863ad4.js');
9const index$1 = require('./index-e1bb33c3.js');
10const theme = require('./theme-30b7a575.js');
11const animation = require('./animation-13cbbb20.js');
12require('./haptic-9f199ada.js');
13require('./index-a1dd5c93.js');
14require('./gesture-controller-29adda71.js');
15require('./hardware-back-button-148ce546.js');
16require('./helpers-d381ec4d.js');
17
18/**
19 * iOS Alert Enter Animation
20 */
21const iosEnterAnimation = (baseEl) => {
22 const baseAnimation = animation.createAnimation();
23 const backdropAnimation = animation.createAnimation();
24 const wrapperAnimation = animation.createAnimation();
25 backdropAnimation
26 .addElement(baseEl.querySelector('ion-backdrop'))
27 .fromTo('opacity', 0.01, 'var(--backdrop-opacity)')
28 .beforeStyles({
29 'pointer-events': 'none'
30 })
31 .afterClearStyles(['pointer-events']);
32 wrapperAnimation
33 .addElement(baseEl.querySelector('.alert-wrapper'))
34 .keyframes([
35 { offset: 0, opacity: '0.01', transform: 'scale(1.1)' },
36 { offset: 1, opacity: '1', transform: 'scale(1)' }
37 ]);
38 return baseAnimation
39 .addElement(baseEl)
40 .easing('ease-in-out')
41 .duration(200)
42 .addAnimation([backdropAnimation, wrapperAnimation]);
43};
44
45/**
46 * iOS Alert Leave Animation
47 */
48const iosLeaveAnimation = (baseEl) => {
49 const baseAnimation = animation.createAnimation();
50 const backdropAnimation = animation.createAnimation();
51 const wrapperAnimation = animation.createAnimation();
52 backdropAnimation
53 .addElement(baseEl.querySelector('ion-backdrop'))
54 .fromTo('opacity', 'var(--backdrop-opacity)', 0);
55 wrapperAnimation
56 .addElement(baseEl.querySelector('.alert-wrapper'))
57 .keyframes([
58 { offset: 0, opacity: 0.99, transform: 'scale(1)' },
59 { offset: 1, opacity: 0, transform: 'scale(0.9)' }
60 ]);
61 return baseAnimation
62 .addElement(baseEl)
63 .easing('ease-in-out')
64 .duration(200)
65 .addAnimation([backdropAnimation, wrapperAnimation]);
66};
67
68/**
69 * Md Alert Enter Animation
70 */
71const mdEnterAnimation = (baseEl) => {
72 const baseAnimation = animation.createAnimation();
73 const backdropAnimation = animation.createAnimation();
74 const wrapperAnimation = animation.createAnimation();
75 backdropAnimation
76 .addElement(baseEl.querySelector('ion-backdrop'))
77 .fromTo('opacity', 0.01, 'var(--backdrop-opacity)')
78 .beforeStyles({
79 'pointer-events': 'none'
80 })
81 .afterClearStyles(['pointer-events']);
82 wrapperAnimation
83 .addElement(baseEl.querySelector('.alert-wrapper'))
84 .keyframes([
85 { offset: 0, opacity: '0.01', transform: 'scale(0.9)' },
86 { offset: 1, opacity: '1', transform: 'scale(1)' }
87 ]);
88 return baseAnimation
89 .addElement(baseEl)
90 .easing('ease-in-out')
91 .duration(150)
92 .addAnimation([backdropAnimation, wrapperAnimation]);
93};
94
95/**
96 * Md Alert Leave Animation
97 */
98const mdLeaveAnimation = (baseEl) => {
99 const baseAnimation = animation.createAnimation();
100 const backdropAnimation = animation.createAnimation();
101 const wrapperAnimation = animation.createAnimation();
102 backdropAnimation
103 .addElement(baseEl.querySelector('ion-backdrop'))
104 .fromTo('opacity', 'var(--backdrop-opacity)', 0);
105 wrapperAnimation
106 .addElement(baseEl.querySelector('.alert-wrapper'))
107 .fromTo('opacity', 0.99, 0);
108 return baseAnimation
109 .addElement(baseEl)
110 .easing('ease-in-out')
111 .duration(150)
112 .addAnimation([backdropAnimation, wrapperAnimation]);
113};
114
115const alertIosCss = ".sc-ion-alert-ios-h{--min-width:250px;--width:auto;--min-height:auto;--height:auto;--max-height:90%;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;left:0;right:0;top:0;bottom:0;display:-ms-flexbox;display:flex;position:absolute;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;outline:none;font-family:var(--ion-font-family, inherit);contain:strict;-ms-touch-action:none;touch-action:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:1001}.overlay-hidden.sc-ion-alert-ios-h{display:none}.alert-top.sc-ion-alert-ios-h{padding-top:50px;-ms-flex-align:start;align-items:flex-start}.alert-wrapper.sc-ion-alert-ios{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);background:var(--background);contain:content;opacity:0;z-index:10}.alert-title.sc-ion-alert-ios{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0}.alert-sub-title.sc-ion-alert-ios{margin-left:0;margin-right:0;margin-top:5px;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;font-weight:normal}.alert-message.sc-ion-alert-ios{-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-overflow-scrolling:touch;overflow-y:auto;overscroll-behavior-y:contain}.alert-checkbox-group.sc-ion-alert-ios::-webkit-scrollbar,.alert-radio-group.sc-ion-alert-ios::-webkit-scrollbar,.alert-message.sc-ion-alert-ios::-webkit-scrollbar{display:none}.alert-input.sc-ion-alert-ios{padding-left:0;padding-right:0;padding-top:10px;padding-bottom:10px;width:100%;border:0;background:inherit;font:inherit;-webkit-box-sizing:border-box;box-sizing:border-box}.alert-button-group.sc-ion-alert-ios{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;width:100%}.alert-button-group-vertical.sc-ion-alert-ios{-ms-flex-direction:column;flex-direction:column;-ms-flex-wrap:nowrap;flex-wrap:nowrap}.alert-button.sc-ion-alert-ios{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;display:block;border:0;font-size:14px;line-height:20px;z-index:0}.alert-button.ion-focused.sc-ion-alert-ios,.alert-tappable.ion-focused.sc-ion-alert-ios{background:var(--ion-color-step-100, #e6e6e6)}.alert-button-inner.sc-ion-alert-ios{display:-ms-flexbox;display:flex;-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;width:100%;height:100%}.alert-input-disabled.sc-ion-alert-ios,.alert-checkbox-button-disabled.sc-ion-alert-ios .alert-button-inner.sc-ion-alert-ios,.alert-radio-button-disabled.sc-ion-alert-ios .alert-button-inner.sc-ion-alert-ios{cursor:default;opacity:0.5;pointer-events:none}.alert-tappable.sc-ion-alert-ios{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;display:-ms-flexbox;display:flex;width:100%;border:0;background:transparent;font-size:inherit;line-height:initial;text-align:start;-webkit-appearance:none;-moz-appearance:none;appearance:none;contain:strict}.alert-button.sc-ion-alert-ios,.alert-checkbox.sc-ion-alert-ios,.alert-input.sc-ion-alert-ios,.alert-radio.sc-ion-alert-ios{outline:none}.alert-radio-icon.sc-ion-alert-ios,.alert-checkbox-icon.sc-ion-alert-ios,.alert-checkbox-inner.sc-ion-alert-ios{-webkit-box-sizing:border-box;box-sizing:border-box}textarea.alert-input.sc-ion-alert-ios{min-height:37px;resize:none}.sc-ion-alert-ios-h{--background:var(--ion-overlay-background-color, var(--ion-color-step-100, #f9f9f9));--max-width:270px;--backdrop-opacity:var(--ion-backdrop-opacity, 0.3);font-size:14px}.alert-wrapper.sc-ion-alert-ios{border-radius:13px;-webkit-box-shadow:none;box-shadow:none;overflow:hidden}.alert-button.sc-ion-alert-ios .alert-button-inner.sc-ion-alert-ios{pointer-events:none}@supports ((-webkit-backdrop-filter: blur(0)) or (backdrop-filter: blur(0))){.alert-translucent.sc-ion-alert-ios-h .alert-wrapper.sc-ion-alert-ios{background:rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.9);-webkit-backdrop-filter:saturate(180%) blur(20px);backdrop-filter:saturate(180%) blur(20px)}}.alert-head.sc-ion-alert-ios{padding-left:16px;padding-right:16px;padding-top:12px;padding-bottom:7px;text-align:center}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.alert-head.sc-ion-alert-ios{padding-left:unset;padding-right:unset;-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px}}.alert-title.sc-ion-alert-ios{margin-top:8px;color:var(--ion-text-color, #000);font-size:17px;font-weight:600}.alert-sub-title.sc-ion-alert-ios{color:var(--ion-color-step-600, #666666);font-size:14px}.alert-message.sc-ion-alert-ios,.alert-input-group.sc-ion-alert-ios{padding-left:16px;padding-right:16px;padding-top:0;padding-bottom:21px;color:var(--ion-text-color, #000);font-size:13px;text-align:center}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.alert-message.sc-ion-alert-ios,.alert-input-group.sc-ion-alert-ios{padding-left:unset;padding-right:unset;-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px}}.alert-message.sc-ion-alert-ios{max-height:240px}.alert-message.sc-ion-alert-ios:empty{padding-left:0;padding-right:0;padding-top:0;padding-bottom:12px}.alert-input.sc-ion-alert-ios{border-radius:4px;margin-top:10px;padding-left:6px;padding-right:6px;padding-top:6px;padding-bottom:6px;border:0.55px solid var(--ion-color-step-250, #bfbfbf);background-color:var(--ion-background-color, #fff);-webkit-appearance:none;-moz-appearance:none;appearance:none}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.alert-input.sc-ion-alert-ios{padding-left:unset;padding-right:unset;-webkit-padding-start:6px;padding-inline-start:6px;-webkit-padding-end:6px;padding-inline-end:6px}}.alert-input.sc-ion-alert-ios::-webkit-input-placeholder{color:var(--ion-placeholder-color, var(--ion-color-step-400, #999999));font-family:inherit;font-weight:inherit}.alert-input.sc-ion-alert-ios::-moz-placeholder{color:var(--ion-placeholder-color, var(--ion-color-step-400, #999999));font-family:inherit;font-weight:inherit}.alert-input.sc-ion-alert-ios:-ms-input-placeholder{color:var(--ion-placeholder-color, var(--ion-color-step-400, #999999));font-family:inherit;font-weight:inherit}.alert-input.sc-ion-alert-ios::-ms-input-placeholder{color:var(--ion-placeholder-color, var(--ion-color-step-400, #999999));font-family:inherit;font-weight:inherit}.alert-input.sc-ion-alert-ios::placeholder{color:var(--ion-placeholder-color, var(--ion-color-step-400, #999999));font-family:inherit;font-weight:inherit}.alert-input.sc-ion-alert-ios::-ms-clear{display:none}.alert-radio-group.sc-ion-alert-ios,.alert-checkbox-group.sc-ion-alert-ios{-ms-scroll-chaining:none;overscroll-behavior:contain;max-height:240px;border-top:0.55px solid rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.2);overflow-y:auto;-webkit-overflow-scrolling:touch}.alert-tappable.sc-ion-alert-ios{height:44px}.alert-radio-label.sc-ion-alert-ios{padding-left:13px;padding-right:13px;padding-top:13px;padding-bottom:13px;-ms-flex:1;flex:1;-ms-flex-order:0;order:0;color:var(--ion-text-color, #000);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.alert-radio-label.sc-ion-alert-ios{padding-left:unset;padding-right:unset;-webkit-padding-start:13px;padding-inline-start:13px;-webkit-padding-end:13px;padding-inline-end:13px}}[aria-checked=true].sc-ion-alert-ios .alert-radio-label.sc-ion-alert-ios{color:var(--ion-color-primary, #3880ff)}.alert-radio-icon.sc-ion-alert-ios{position:relative;-ms-flex-order:1;order:1;min-width:30px}[aria-checked=true].sc-ion-alert-ios .alert-radio-inner.sc-ion-alert-ios{left:7px;top:-7px;position:absolute;width:6px;height:12px;-webkit-transform:rotate(45deg);transform:rotate(45deg);border-width:2px;border-top-width:0;border-left-width:0;border-style:solid;border-color:var(--ion-color-primary, #3880ff)}[dir=rtl].sc-ion-alert-ios [aria-checked=true].sc-ion-alert-ios .alert-radio-inner.sc-ion-alert-ios,[dir=rtl].sc-ion-alert-ios-h [aria-checked=true].sc-ion-alert-ios .alert-radio-inner.sc-ion-alert-ios,[dir=rtl] .sc-ion-alert-ios-h [aria-checked=true].sc-ion-alert-ios .alert-radio-inner.sc-ion-alert-ios{left:unset;right:unset;right:7px}.alert-checkbox-label.sc-ion-alert-ios{padding-left:13px;padding-right:13px;padding-top:13px;padding-bottom:13px;-ms-flex:1;flex:1;color:var(--ion-text-color, #000);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.alert-checkbox-label.sc-ion-alert-ios{padding-left:unset;padding-right:unset;-webkit-padding-start:13px;padding-inline-start:13px;-webkit-padding-end:13px;padding-inline-end:13px}}.alert-checkbox-icon.sc-ion-alert-ios{border-radius:50%;margin-left:16px;margin-right:6px;margin-top:10px;margin-bottom:10px;position:relative;width:24px;height:24px;border-width:1px;border-style:solid;border-color:var(--ion-item-border-color, var(--ion-border-color, var(--ion-color-step-250, #c8c7cc)));background-color:var(--ion-item-background, var(--ion-background-color, #fff));contain:strict}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.alert-checkbox-icon.sc-ion-alert-ios{margin-left:unset;margin-right:unset;-webkit-margin-start:16px;margin-inline-start:16px;-webkit-margin-end:6px;margin-inline-end:6px}}[aria-checked=true].sc-ion-alert-ios .alert-checkbox-icon.sc-ion-alert-ios{border-color:var(--ion-color-primary, #3880ff);background-color:var(--ion-color-primary, #3880ff)}[aria-checked=true].sc-ion-alert-ios .alert-checkbox-inner.sc-ion-alert-ios{left:9px;top:4px;position:absolute;width:5px;height:12px;-webkit-transform:rotate(45deg);transform:rotate(45deg);border-width:1px;border-top-width:0;border-left-width:0;border-style:solid;border-color:var(--ion-background-color, #fff)}[dir=rtl].sc-ion-alert-ios [aria-checked=true].sc-ion-alert-ios .alert-checkbox-inner.sc-ion-alert-ios,[dir=rtl].sc-ion-alert-ios-h [aria-checked=true].sc-ion-alert-ios .alert-checkbox-inner.sc-ion-alert-ios,[dir=rtl] .sc-ion-alert-ios-h [aria-checked=true].sc-ion-alert-ios .alert-checkbox-inner.sc-ion-alert-ios{left:unset;right:unset;right:9px}.alert-button-group.sc-ion-alert-ios{margin-right:-0.55px;-ms-flex-wrap:wrap;flex-wrap:wrap}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.alert-button-group.sc-ion-alert-ios{margin-right:unset;-webkit-margin-end:-0.55px;margin-inline-end:-0.55px}}.alert-button.sc-ion-alert-ios{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;border-radius:0;-ms-flex:1 1 auto;flex:1 1 auto;min-width:50%;height:44px;border-top:0.55px solid rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.2);border-right:0.55px solid rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.2);background-color:transparent;color:var(--ion-color-primary, #3880ff);font-size:17px;overflow:hidden}[dir=rtl].sc-ion-alert-ios .alert-button.sc-ion-alert-ios:first-child,[dir=rtl].sc-ion-alert-ios-h .alert-button.sc-ion-alert-ios:first-child,[dir=rtl] .sc-ion-alert-ios-h .alert-button.sc-ion-alert-ios:first-child{border-right:0}.alert-button.sc-ion-alert-ios:last-child{border-right:0;font-weight:bold}[dir=rtl].sc-ion-alert-ios .alert-button.sc-ion-alert-ios:last-child,[dir=rtl].sc-ion-alert-ios-h .alert-button.sc-ion-alert-ios:last-child,[dir=rtl] .sc-ion-alert-ios-h .alert-button.sc-ion-alert-ios:last-child{border-right:0.55px solid rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.2)}.alert-button.ion-activated.sc-ion-alert-ios{background-color:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.1)}.alert-button-role-destructive.sc-ion-alert-ios,.alert-button-role-destructive.ion-activated.sc-ion-alert-ios,.alert-button-role-destructive.ion-focused.sc-ion-alert-ios{color:var(--ion-color-danger, #eb445a)}";
116
117const alertMdCss = ".sc-ion-alert-md-h{--min-width:250px;--width:auto;--min-height:auto;--height:auto;--max-height:90%;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;left:0;right:0;top:0;bottom:0;display:-ms-flexbox;display:flex;position:absolute;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;outline:none;font-family:var(--ion-font-family, inherit);contain:strict;-ms-touch-action:none;touch-action:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:1001}.overlay-hidden.sc-ion-alert-md-h{display:none}.alert-top.sc-ion-alert-md-h{padding-top:50px;-ms-flex-align:start;align-items:flex-start}.alert-wrapper.sc-ion-alert-md{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);background:var(--background);contain:content;opacity:0;z-index:10}.alert-title.sc-ion-alert-md{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0}.alert-sub-title.sc-ion-alert-md{margin-left:0;margin-right:0;margin-top:5px;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;font-weight:normal}.alert-message.sc-ion-alert-md{-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-overflow-scrolling:touch;overflow-y:auto;overscroll-behavior-y:contain}.alert-checkbox-group.sc-ion-alert-md::-webkit-scrollbar,.alert-radio-group.sc-ion-alert-md::-webkit-scrollbar,.alert-message.sc-ion-alert-md::-webkit-scrollbar{display:none}.alert-input.sc-ion-alert-md{padding-left:0;padding-right:0;padding-top:10px;padding-bottom:10px;width:100%;border:0;background:inherit;font:inherit;-webkit-box-sizing:border-box;box-sizing:border-box}.alert-button-group.sc-ion-alert-md{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;width:100%}.alert-button-group-vertical.sc-ion-alert-md{-ms-flex-direction:column;flex-direction:column;-ms-flex-wrap:nowrap;flex-wrap:nowrap}.alert-button.sc-ion-alert-md{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;display:block;border:0;font-size:14px;line-height:20px;z-index:0}.alert-button.ion-focused.sc-ion-alert-md,.alert-tappable.ion-focused.sc-ion-alert-md{background:var(--ion-color-step-100, #e6e6e6)}.alert-button-inner.sc-ion-alert-md{display:-ms-flexbox;display:flex;-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;width:100%;height:100%}.alert-input-disabled.sc-ion-alert-md,.alert-checkbox-button-disabled.sc-ion-alert-md .alert-button-inner.sc-ion-alert-md,.alert-radio-button-disabled.sc-ion-alert-md .alert-button-inner.sc-ion-alert-md{cursor:default;opacity:0.5;pointer-events:none}.alert-tappable.sc-ion-alert-md{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;display:-ms-flexbox;display:flex;width:100%;border:0;background:transparent;font-size:inherit;line-height:initial;text-align:start;-webkit-appearance:none;-moz-appearance:none;appearance:none;contain:strict}.alert-button.sc-ion-alert-md,.alert-checkbox.sc-ion-alert-md,.alert-input.sc-ion-alert-md,.alert-radio.sc-ion-alert-md{outline:none}.alert-radio-icon.sc-ion-alert-md,.alert-checkbox-icon.sc-ion-alert-md,.alert-checkbox-inner.sc-ion-alert-md{-webkit-box-sizing:border-box;box-sizing:border-box}textarea.alert-input.sc-ion-alert-md{min-height:37px;resize:none}.sc-ion-alert-md-h{--background:var(--ion-overlay-background-color, var(--ion-background-color, #fff));--max-width:280px;--backdrop-opacity:var(--ion-backdrop-opacity, 0.32);font-size:14px}.alert-wrapper.sc-ion-alert-md{border-radius:4px;-webkit-box-shadow:0 11px 15px -7px rgba(0, 0, 0, 0.2), 0 24px 38px 3px rgba(0, 0, 0, 0.14), 0 9px 46px 8px rgba(0, 0, 0, 0.12);box-shadow:0 11px 15px -7px rgba(0, 0, 0, 0.2), 0 24px 38px 3px rgba(0, 0, 0, 0.14), 0 9px 46px 8px rgba(0, 0, 0, 0.12)}.alert-head.sc-ion-alert-md{padding-left:23px;padding-right:23px;padding-top:20px;padding-bottom:15px;text-align:start}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.alert-head.sc-ion-alert-md{padding-left:unset;padding-right:unset;-webkit-padding-start:23px;padding-inline-start:23px;-webkit-padding-end:23px;padding-inline-end:23px}}.alert-title.sc-ion-alert-md{color:var(--ion-text-color, #000);font-size:20px;font-weight:500}.alert-sub-title.sc-ion-alert-md{color:var(--ion-text-color, #000);font-size:16px}.alert-message.sc-ion-alert-md,.alert-input-group.sc-ion-alert-md{padding-left:24px;padding-right:24px;padding-top:20px;padding-bottom:20px;color:var(--ion-color-step-550, #737373)}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.alert-message.sc-ion-alert-md,.alert-input-group.sc-ion-alert-md{padding-left:unset;padding-right:unset;-webkit-padding-start:24px;padding-inline-start:24px;-webkit-padding-end:24px;padding-inline-end:24px}}.alert-message.sc-ion-alert-md{max-height:240px;font-size:16px}.alert-message.sc-ion-alert-md:empty{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0}.alert-head.sc-ion-alert-md+.alert-message.sc-ion-alert-md{padding-top:0}.alert-input.sc-ion-alert-md{margin-left:0;margin-right:0;margin-top:5px;margin-bottom:5px;border-bottom:1px solid var(--ion-color-step-150, #d9d9d9);color:var(--ion-text-color, #000)}.alert-input.sc-ion-alert-md::-webkit-input-placeholder{color:var(--ion-placeholder-color, var(--ion-color-step-400, #999999));font-family:inherit;font-weight:inherit}.alert-input.sc-ion-alert-md::-moz-placeholder{color:var(--ion-placeholder-color, var(--ion-color-step-400, #999999));font-family:inherit;font-weight:inherit}.alert-input.sc-ion-alert-md:-ms-input-placeholder{color:var(--ion-placeholder-color, var(--ion-color-step-400, #999999));font-family:inherit;font-weight:inherit}.alert-input.sc-ion-alert-md::-ms-input-placeholder{color:var(--ion-placeholder-color, var(--ion-color-step-400, #999999));font-family:inherit;font-weight:inherit}.alert-input.sc-ion-alert-md::placeholder{color:var(--ion-placeholder-color, var(--ion-color-step-400, #999999));font-family:inherit;font-weight:inherit}.alert-input.sc-ion-alert-md::-ms-clear{display:none}.alert-input.sc-ion-alert-md:focus{margin-bottom:4px;border-bottom:2px solid var(--ion-color-primary, #3880ff)}.alert-radio-group.sc-ion-alert-md,.alert-checkbox-group.sc-ion-alert-md{position:relative;max-height:240px;border-top:1px solid var(--ion-color-step-150, #d9d9d9);border-bottom:1px solid var(--ion-color-step-150, #d9d9d9);overflow:auto}.alert-tappable.sc-ion-alert-md{position:relative;height:48px;overflow:hidden}.alert-radio-label.sc-ion-alert-md{padding-left:52px;padding-right:26px;padding-top:13px;padding-bottom:13px;-ms-flex:1;flex:1;color:var(--ion-color-step-850, #262626);font-size:16px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.alert-radio-label.sc-ion-alert-md{padding-left:unset;padding-right:unset;-webkit-padding-start:52px;padding-inline-start:52px;-webkit-padding-end:26px;padding-inline-end:26px}}.alert-radio-icon.sc-ion-alert-md{left:26px;top:0;border-radius:50%;display:block;position:relative;width:20px;height:20px;border-width:2px;border-style:solid;border-color:var(--ion-color-step-550, #737373)}[dir=rtl].sc-ion-alert-md .alert-radio-icon.sc-ion-alert-md,[dir=rtl].sc-ion-alert-md-h .alert-radio-icon.sc-ion-alert-md,[dir=rtl] .sc-ion-alert-md-h .alert-radio-icon.sc-ion-alert-md{left:unset;right:unset;right:26px}.alert-radio-inner.sc-ion-alert-md{left:3px;top:3px;border-radius:50%;position:absolute;width:10px;height:10px;-webkit-transform:scale3d(0, 0, 0);transform:scale3d(0, 0, 0);-webkit-transition:-webkit-transform 280ms cubic-bezier(0.4, 0, 0.2, 1);transition:-webkit-transform 280ms cubic-bezier(0.4, 0, 0.2, 1);transition:transform 280ms cubic-bezier(0.4, 0, 0.2, 1);transition:transform 280ms cubic-bezier(0.4, 0, 0.2, 1), -webkit-transform 280ms cubic-bezier(0.4, 0, 0.2, 1);background-color:var(--ion-color-primary, #3880ff)}[dir=rtl].sc-ion-alert-md .alert-radio-inner.sc-ion-alert-md,[dir=rtl].sc-ion-alert-md-h .alert-radio-inner.sc-ion-alert-md,[dir=rtl] .sc-ion-alert-md-h .alert-radio-inner.sc-ion-alert-md{left:unset;right:unset;right:3px}[aria-checked=true].sc-ion-alert-md .alert-radio-label.sc-ion-alert-md{color:var(--ion-color-step-850, #262626)}[aria-checked=true].sc-ion-alert-md .alert-radio-icon.sc-ion-alert-md{border-color:var(--ion-color-primary, #3880ff)}[aria-checked=true].sc-ion-alert-md .alert-radio-inner.sc-ion-alert-md{-webkit-transform:scale3d(1, 1, 1);transform:scale3d(1, 1, 1)}.alert-checkbox-label.sc-ion-alert-md{padding-left:53px;padding-right:26px;padding-top:13px;padding-bottom:13px;-ms-flex:1;flex:1;color:var(--ion-color-step-850, #262626);font-size:16px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.alert-checkbox-label.sc-ion-alert-md{padding-left:unset;padding-right:unset;-webkit-padding-start:53px;padding-inline-start:53px;-webkit-padding-end:26px;padding-inline-end:26px}}.alert-checkbox-icon.sc-ion-alert-md{left:26px;top:0;border-radius:2px;position:relative;width:16px;height:16px;border-width:2px;border-style:solid;border-color:var(--ion-color-step-550, #737373);contain:strict}[dir=rtl].sc-ion-alert-md .alert-checkbox-icon.sc-ion-alert-md,[dir=rtl].sc-ion-alert-md-h .alert-checkbox-icon.sc-ion-alert-md,[dir=rtl] .sc-ion-alert-md-h .alert-checkbox-icon.sc-ion-alert-md{left:unset;right:unset;right:26px}[aria-checked=true].sc-ion-alert-md .alert-checkbox-icon.sc-ion-alert-md{border-color:var(--ion-color-primary, #3880ff);background-color:var(--ion-color-primary, #3880ff)}[aria-checked=true].sc-ion-alert-md .alert-checkbox-inner.sc-ion-alert-md{left:3px;top:0;position:absolute;width:6px;height:10px;-webkit-transform:rotate(45deg);transform:rotate(45deg);border-width:2px;border-top-width:0;border-left-width:0;border-style:solid;border-color:var(--ion-color-primary-contrast, #fff)}[dir=rtl].sc-ion-alert-md [aria-checked=true].sc-ion-alert-md .alert-checkbox-inner.sc-ion-alert-md,[dir=rtl].sc-ion-alert-md-h [aria-checked=true].sc-ion-alert-md .alert-checkbox-inner.sc-ion-alert-md,[dir=rtl] .sc-ion-alert-md-h [aria-checked=true].sc-ion-alert-md .alert-checkbox-inner.sc-ion-alert-md{left:unset;right:unset;right:3px}.alert-button-group.sc-ion-alert-md{padding-left:8px;padding-right:8px;padding-top:8px;padding-bottom:8px;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-wrap:wrap-reverse;flex-wrap:wrap-reverse;-ms-flex-pack:end;justify-content:flex-end}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.alert-button-group.sc-ion-alert-md{padding-left:unset;padding-right:unset;-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:8px;padding-inline-end:8px}}.alert-button.sc-ion-alert-md{border-radius:2px;margin-left:0;margin-right:8px;margin-top:0;margin-bottom:0;padding-left:10px;padding-right:10px;padding-top:10px;padding-bottom:10px;position:relative;background-color:transparent;color:var(--ion-color-primary, #3880ff);font-weight:500;text-align:end;text-transform:uppercase;overflow:hidden}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.alert-button.sc-ion-alert-md{margin-left:unset;margin-right:unset;-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:8px;margin-inline-end:8px}}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.alert-button.sc-ion-alert-md{padding-left:unset;padding-right:unset;-webkit-padding-start:10px;padding-inline-start:10px;-webkit-padding-end:10px;padding-inline-end:10px}}.alert-button-inner.sc-ion-alert-md{-ms-flex-pack:end;justify-content:flex-end}";
118
119const Alert = class {
120 constructor(hostRef) {
121 index.registerInstance(this, hostRef);
122 this.didPresent = index.createEvent(this, "ionAlertDidPresent", 7);
123 this.willPresent = index.createEvent(this, "ionAlertWillPresent", 7);
124 this.willDismiss = index.createEvent(this, "ionAlertWillDismiss", 7);
125 this.didDismiss = index.createEvent(this, "ionAlertDidDismiss", 7);
126 this.processedInputs = [];
127 this.processedButtons = [];
128 this.presented = false;
129 /**
130 * If `true`, the keyboard will be automatically dismissed when the overlay is presented.
131 */
132 this.keyboardClose = true;
133 /**
134 * Array of buttons to be added to the alert.
135 */
136 this.buttons = [];
137 /**
138 * Array of input to show in the alert.
139 */
140 this.inputs = [];
141 /**
142 * If `true`, the alert will be dismissed when the backdrop is clicked.
143 */
144 this.backdropDismiss = true;
145 /**
146 * If `true`, the alert will be translucent.
147 * Only applies when the mode is `"ios"` and the device supports
148 * [`backdrop-filter`](https://developer.mozilla.org/en-US/docs/Web/CSS/backdrop-filter#Browser_compatibility).
149 */
150 this.translucent = false;
151 /**
152 * If `true`, the alert will animate.
153 */
154 this.animated = true;
155 this.onBackdropTap = () => {
156 this.dismiss(undefined, overlays.BACKDROP);
157 };
158 this.dispatchCancelHandler = (ev) => {
159 const role = ev.detail.role;
160 if (overlays.isCancel(role)) {
161 const cancelButton = this.processedButtons.find(b => b.role === 'cancel');
162 this.callButtonHandler(cancelButton);
163 }
164 };
165 }
166 onKeydown(ev) {
167 const inputTypes = new Set(this.processedInputs.map(i => i.type));
168 // The only inputs we want to navigate between using arrow keys are the radios
169 // ignore the keydown event if it is not on a radio button
170 if (!inputTypes.has('radio')
171 || (ev.target && !this.el.contains(ev.target))
172 || ev.target.classList.contains('alert-button')) {
173 return;
174 }
175 // Get all radios inside of the radio group and then
176 // filter out disabled radios since we need to skip those
177 const query = this.el.querySelectorAll('.alert-radio');
178 const radios = Array.from(query).filter(radio => !radio.disabled);
179 // The focused radio is the one that shares the same id as
180 // the event target
181 const index = radios.findIndex(radio => radio.id === ev.target.id);
182 // We need to know what the next radio element should
183 // be in order to change the focus
184 let nextEl;
185 // If hitting arrow down or arrow right, move to the next radio
186 // If we're on the last radio, move to the first radio
187 if (['ArrowDown', 'ArrowRight'].includes(ev.code)) {
188 nextEl = (index === radios.length - 1)
189 ? radios[0]
190 : radios[index + 1];
191 }
192 // If hitting arrow up or arrow left, move to the previous radio
193 // If we're on the first radio, move to the last radio
194 if (['ArrowUp', 'ArrowLeft'].includes(ev.code)) {
195 nextEl = (index === 0)
196 ? radios[radios.length - 1]
197 : radios[index - 1];
198 }
199 if (nextEl && radios.includes(nextEl)) {
200 const nextProcessed = this.processedInputs.find(input => input.id === (nextEl === null || nextEl === void 0 ? void 0 : nextEl.id));
201 if (nextProcessed) {
202 this.rbClick(nextProcessed);
203 nextEl.focus();
204 }
205 }
206 }
207 buttonsChanged() {
208 const buttons = this.buttons;
209 this.processedButtons = buttons.map(btn => {
210 return (typeof btn === 'string')
211 ? { text: btn, role: btn.toLowerCase() === 'cancel' ? 'cancel' : undefined }
212 : btn;
213 });
214 }
215 inputsChanged() {
216 const inputs = this.inputs;
217 // Get the first input that is not disabled and the checked one
218 // If an enabled checked input exists, set it to be the focusable input
219 // otherwise we default to focus the first input
220 // This will only be used when the input is type radio
221 const first = inputs.find(input => !input.disabled);
222 const checked = inputs.find(input => input.checked && !input.disabled);
223 const focusable = checked || first;
224 // An alert can be created with several different inputs. Radios,
225 // checkboxes and inputs are all accepted, but they cannot be mixed.
226 const inputTypes = new Set(inputs.map(i => i.type));
227 if (inputTypes.has('checkbox') && inputTypes.has('radio')) {
228 console.warn(`Alert cannot mix input types: ${(Array.from(inputTypes.values()).join('/'))}. Please see alert docs for more info.`);
229 }
230 this.inputType = inputTypes.values().next().value;
231 this.processedInputs = inputs.map((i, index) => ({
232 type: i.type || 'text',
233 name: i.name || `${index}`,
234 placeholder: i.placeholder || '',
235 value: i.value,
236 label: i.label,
237 checked: !!i.checked,
238 disabled: !!i.disabled,
239 id: i.id || `alert-input-${this.overlayIndex}-${index}`,
240 handler: i.handler,
241 min: i.min,
242 max: i.max,
243 cssClass: i.cssClass || '',
244 attributes: i.attributes || {},
245 tabindex: (i.type === 'radio' && i !== focusable) ? -1 : 0
246 }));
247 }
248 connectedCallback() {
249 overlays.prepareOverlay(this.el);
250 }
251 componentWillLoad() {
252 this.inputsChanged();
253 this.buttonsChanged();
254 }
255 disconnectedCallback() {
256 if (this.gesture) {
257 this.gesture.destroy();
258 this.gesture = undefined;
259 }
260 }
261 componentDidLoad() {
262 /**
263 * Do not create gesture if:
264 * 1. A gesture already exists
265 * 2. App is running in MD mode
266 * 3. A wrapper ref does not exist
267 */
268 if (this.gesture || ionicGlobal.getIonMode(this) === 'md' || !this.wrapperEl) {
269 return;
270 }
271 this.gesture = buttonActive.createButtonActiveGesture(this.wrapperEl, (refEl) => refEl.classList.contains('alert-button'));
272 this.gesture.enable(true);
273 }
274 /**
275 * Present the alert overlay after it has been created.
276 */
277 present() {
278 return overlays.present(this, 'alertEnter', iosEnterAnimation, mdEnterAnimation);
279 }
280 /**
281 * Dismiss the alert overlay after it has been presented.
282 *
283 * @param data Any data to emit in the dismiss events.
284 * @param role The role of the element that is dismissing the alert.
285 * This can be useful in a button handler for determining which button was
286 * clicked to dismiss the alert.
287 * Some examples include: ``"cancel"`, `"destructive"`, "selected"`, and `"backdrop"`.
288 */
289 dismiss(data, role) {
290 return overlays.dismiss(this, data, role, 'alertLeave', iosLeaveAnimation, mdLeaveAnimation);
291 }
292 /**
293 * Returns a promise that resolves when the alert did dismiss.
294 */
295 onDidDismiss() {
296 return overlays.eventMethod(this.el, 'ionAlertDidDismiss');
297 }
298 /**
299 * Returns a promise that resolves when the alert will dismiss.
300 */
301 onWillDismiss() {
302 return overlays.eventMethod(this.el, 'ionAlertWillDismiss');
303 }
304 rbClick(selectedInput) {
305 for (const input of this.processedInputs) {
306 input.checked = input === selectedInput;
307 input.tabindex = input === selectedInput ? 0 : -1;
308 }
309 this.activeId = selectedInput.id;
310 overlays.safeCall(selectedInput.handler, selectedInput);
311 index.forceUpdate(this);
312 }
313 cbClick(selectedInput) {
314 selectedInput.checked = !selectedInput.checked;
315 overlays.safeCall(selectedInput.handler, selectedInput);
316 index.forceUpdate(this);
317 }
318 buttonClick(button) {
319 const role = button.role;
320 const values = this.getValues();
321 if (overlays.isCancel(role)) {
322 return this.dismiss({ values }, role);
323 }
324 const returnData = this.callButtonHandler(button, values);
325 if (returnData !== false) {
326 return this.dismiss(Object.assign({ values }, returnData), button.role);
327 }
328 return Promise.resolve(false);
329 }
330 callButtonHandler(button, data) {
331 if (button && button.handler) {
332 // a handler has been provided, execute it
333 // pass the handler the values from the inputs
334 const returnData = overlays.safeCall(button.handler, data);
335 if (returnData === false) {
336 // if the return value of the handler is false then do not dismiss
337 return false;
338 }
339 if (typeof returnData === 'object') {
340 return returnData;
341 }
342 }
343 return {};
344 }
345 getValues() {
346 if (this.processedInputs.length === 0) {
347 // this is an alert without any options/inputs at all
348 return undefined;
349 }
350 if (this.inputType === 'radio') {
351 // this is an alert with radio buttons (single value select)
352 // return the one value which is checked, otherwise undefined
353 const checkedInput = this.processedInputs.find(i => !!i.checked);
354 return checkedInput ? checkedInput.value : undefined;
355 }
356 if (this.inputType === 'checkbox') {
357 // this is an alert with checkboxes (multiple value select)
358 // return an array of all the checked values
359 return this.processedInputs.filter(i => i.checked).map(i => i.value);
360 }
361 // this is an alert with text inputs
362 // return an object of all the values with the input name as the key
363 const values = {};
364 this.processedInputs.forEach(i => {
365 values[i.name] = i.value || '';
366 });
367 return values;
368 }
369 renderAlertInputs() {
370 switch (this.inputType) {
371 case 'checkbox': return this.renderCheckbox();
372 case 'radio': return this.renderRadio();
373 default: return this.renderInput();
374 }
375 }
376 renderCheckbox() {
377 const inputs = this.processedInputs;
378 const mode = ionicGlobal.getIonMode(this);
379 if (inputs.length === 0) {
380 return null;
381 }
382 return (index.h("div", { class: "alert-checkbox-group" }, inputs.map(i => (index.h("button", { type: "button", onClick: () => this.cbClick(i), "aria-checked": `${i.checked}`, id: i.id, disabled: i.disabled, tabIndex: i.tabindex, role: "checkbox", class: Object.assign(Object.assign({}, theme.getClassMap(i.cssClass)), { 'alert-tappable': true, 'alert-checkbox': true, 'alert-checkbox-button': true, 'ion-focusable': true, 'alert-checkbox-button-disabled': i.disabled || false }) }, index.h("div", { class: "alert-button-inner" }, index.h("div", { class: "alert-checkbox-icon" }, index.h("div", { class: "alert-checkbox-inner" })), index.h("div", { class: "alert-checkbox-label" }, i.label)), mode === 'md' && index.h("ion-ripple-effect", null))))));
383 }
384 renderRadio() {
385 const inputs = this.processedInputs;
386 if (inputs.length === 0) {
387 return null;
388 }
389 return (index.h("div", { class: "alert-radio-group", role: "radiogroup", "aria-activedescendant": this.activeId }, inputs.map(i => (index.h("button", { type: "button", onClick: () => this.rbClick(i), "aria-checked": `${i.checked}`, disabled: i.disabled, id: i.id, tabIndex: i.tabindex, class: Object.assign(Object.assign({}, theme.getClassMap(i.cssClass)), { 'alert-radio-button': true, 'alert-tappable': true, 'alert-radio': true, 'ion-focusable': true, 'alert-radio-button-disabled': i.disabled || false }), role: "radio" }, index.h("div", { class: "alert-button-inner" }, index.h("div", { class: "alert-radio-icon" }, index.h("div", { class: "alert-radio-inner" })), index.h("div", { class: "alert-radio-label" }, i.label)))))));
390 }
391 renderInput() {
392 const inputs = this.processedInputs;
393 if (inputs.length === 0) {
394 return null;
395 }
396 return (index.h("div", { class: "alert-input-group" }, inputs.map(i => {
397 var _a, _b, _c, _d;
398 if (i.type === 'textarea') {
399 return (index.h("div", { class: "alert-input-wrapper" }, index.h("textarea", Object.assign({ placeholder: i.placeholder, value: i.value, id: i.id, tabIndex: i.tabindex }, i.attributes, { disabled: (_b = (_a = i.attributes) === null || _a === void 0 ? void 0 : _a.disabled) !== null && _b !== void 0 ? _b : i.disabled, class: inputClass(i), onInput: e => {
400 var _a;
401 i.value = e.target.value;
402 if ((_a = i.attributes) === null || _a === void 0 ? void 0 : _a.onInput) {
403 i.attributes.onInput(e);
404 }
405 } }))));
406 }
407 else {
408 return (index.h("div", { class: "alert-input-wrapper" }, index.h("input", Object.assign({ placeholder: i.placeholder, type: i.type, min: i.min, max: i.max, value: i.value, id: i.id, tabIndex: i.tabindex }, i.attributes, { disabled: (_d = (_c = i.attributes) === null || _c === void 0 ? void 0 : _c.disabled) !== null && _d !== void 0 ? _d : i.disabled, class: inputClass(i), onInput: e => {
409 var _a;
410 i.value = e.target.value;
411 if ((_a = i.attributes) === null || _a === void 0 ? void 0 : _a.onInput) {
412 i.attributes.onInput(e);
413 }
414 } }))));
415 }
416 })));
417 }
418 renderAlertButtons() {
419 const buttons = this.processedButtons;
420 const mode = ionicGlobal.getIonMode(this);
421 const alertButtonGroupClass = {
422 'alert-button-group': true,
423 'alert-button-group-vertical': buttons.length > 2
424 };
425 return (index.h("div", { class: alertButtonGroupClass }, buttons.map(button => index.h("button", { type: "button", class: buttonClass(button), tabIndex: 0, onClick: () => this.buttonClick(button) }, index.h("span", { class: "alert-button-inner" }, button.text), mode === 'md' && index.h("ion-ripple-effect", null)))));
426 }
427 render() {
428 const { overlayIndex, header, subHeader } = this;
429 const mode = ionicGlobal.getIonMode(this);
430 const hdrId = `alert-${overlayIndex}-hdr`;
431 const subHdrId = `alert-${overlayIndex}-sub-hdr`;
432 const msgId = `alert-${overlayIndex}-msg`;
433 return (index.h(index.Host, { role: "dialog", "aria-modal": "true", tabindex: "-1", style: {
434 zIndex: `${20000 + overlayIndex}`,
435 }, class: Object.assign(Object.assign({}, theme.getClassMap(this.cssClass)), { [mode]: true, 'alert-translucent': this.translucent }), onIonAlertWillDismiss: this.dispatchCancelHandler, onIonBackdropTap: this.onBackdropTap }, index.h("ion-backdrop", { tappable: this.backdropDismiss }), index.h("div", { tabindex: "0" }), index.h("div", { class: "alert-wrapper ion-overlay-wrapper", ref: el => this.wrapperEl = el }, index.h("div", { class: "alert-head" }, header && index.h("h2", { id: hdrId, class: "alert-title" }, header), subHeader && index.h("h2", { id: subHdrId, class: "alert-sub-title" }, subHeader)), index.h("div", { id: msgId, class: "alert-message", innerHTML: index$1.sanitizeDOMString(this.message) }), this.renderAlertInputs(), this.renderAlertButtons()), index.h("div", { tabindex: "0" })));
436 }
437 get el() { return index.getElement(this); }
438 static get watchers() { return {
439 "buttons": ["buttonsChanged"],
440 "inputs": ["inputsChanged"]
441 }; }
442};
443const inputClass = (input) => {
444 var _a, _b, _c;
445 return Object.assign(Object.assign({ 'alert-input': true, 'alert-input-disabled': ((_b = (_a = input.attributes) === null || _a === void 0 ? void 0 : _a.disabled) !== null && _b !== void 0 ? _b : input.disabled) || false }, theme.getClassMap(input.cssClass)), theme.getClassMap(input.attributes ? (_c = input.attributes.class) === null || _c === void 0 ? void 0 : _c.toString() : ''));
446};
447const buttonClass = (button) => {
448 return Object.assign({ 'alert-button': true, 'ion-focusable': true, 'ion-activatable': true, [`alert-button-role-${button.role}`]: button.role !== undefined }, theme.getClassMap(button.cssClass));
449};
450Alert.style = {
451 ios: alertIosCss,
452 md: alertMdCss
453};
454
455exports.ion_alert = Alert;