1import { 2 createButtonActiveGesture 3} from "./chunk-KYQCLIVG.js"; 4import "./chunk-PPLDFVMW.js"; 5import { 6 createLockController 7} from "./chunk-GGO2XDGX.js"; 8import "./chunk-TECVDSEG.js"; 9import { 10 BACKDROP, 11 createDelegateController, 12 createTriggerController, 13 dismiss, 14 eventMethod, 15 isCancel, 16 prepareOverlay, 17 present, 18 safeCall, 19 setOverlayId 20} from "./chunk-ZUINC5PV.js"; 21import { 22 createAnimation 23} from "./chunk-5EDPYAC4.js"; 24import "./chunk-BBKSKQGE.js"; 25import { 26 getClassMap 27} from "./chunk-6RS6TFOT.js"; 28import "./chunk-MIOLVGSM.js"; 29import { 30 getIonMode 31} from "./chunk-PP7P2UY3.js"; 32import { 33 Host, 34 createEvent, 35 getElement, 36 h, 37 readTask, 38 registerInstance 39} from "./chunk-LPF5FBSP.js"; 40import "./chunk-36T2BHYJ.js"; 41import { 42 raf 43} from "./chunk-3MMB2GIP.js"; 44import "./chunk-5HYXLRJS.js"; 45import "./chunk-H32S53CR.js"; 46import "./chunk-LRRPAKOW.js"; 47import { 48 __async 49} from "./chunk-KLIBT2SQ.js"; 50 51// node_modules/@ionic/core/dist/esm/ion-action-sheet.entry.js 52var iosEnterAnimation = (baseEl) => { 53 const baseAnimation = createAnimation(); 54 const backdropAnimation = createAnimation(); 55 const wrapperAnimation = createAnimation(); 56 backdropAnimation.addElement(baseEl.querySelector("ion-backdrop")).fromTo("opacity", 0.01, "var(--backdrop-opacity)").beforeStyles({ 57 "pointer-events": "none" 58 }).afterClearStyles(["pointer-events"]); 59 wrapperAnimation.addElement(baseEl.querySelector(".action-sheet-wrapper")).fromTo("transform", "translateY(100%)", "translateY(0%)"); 60 return baseAnimation.addElement(baseEl).easing("cubic-bezier(.36,.66,.04,1)").duration(400).addAnimation([backdropAnimation, wrapperAnimation]); 61}; 62var iosLeaveAnimation = (baseEl) => { 63 const baseAnimation = createAnimation(); 64 const backdropAnimation = createAnimation(); 65 const wrapperAnimation = createAnimation(); 66 backdropAnimation.addElement(baseEl.querySelector("ion-backdrop")).fromTo("opacity", "var(--backdrop-opacity)", 0); 67 wrapperAnimation.addElement(baseEl.querySelector(".action-sheet-wrapper")).fromTo("transform", "translateY(0%)", "translateY(100%)"); 68 return baseAnimation.addElement(baseEl).easing("cubic-bezier(.36,.66,.04,1)").duration(450).addAnimation([backdropAnimation, wrapperAnimation]); 69}; 70var mdEnterAnimation = (baseEl) => { 71 const baseAnimation = createAnimation(); 72 const backdropAnimation = createAnimation(); 73 const wrapperAnimation = createAnimation(); 74 backdropAnimation.addElement(baseEl.querySelector("ion-backdrop")).fromTo("opacity", 0.01, "var(--backdrop-opacity)").beforeStyles({ 75 "pointer-events": "none" 76 }).afterClearStyles(["pointer-events"]); 77 wrapperAnimation.addElement(baseEl.querySelector(".action-sheet-wrapper")).fromTo("transform", "translateY(100%)", "translateY(0%)"); 78 return baseAnimation.addElement(baseEl).easing("cubic-bezier(.36,.66,.04,1)").duration(400).addAnimation([backdropAnimation, wrapperAnimation]); 79}; 80var mdLeaveAnimation = (baseEl) => { 81 const baseAnimation = createAnimation(); 82 const backdropAnimation = createAnimation(); 83 const wrapperAnimation = createAnimation(); 84 backdropAnimation.addElement(baseEl.querySelector("ion-backdrop")).fromTo("opacity", "var(--backdrop-opacity)", 0); 85 wrapperAnimation.addElement(baseEl.querySelector(".action-sheet-wrapper")).fromTo("transform", "translateY(0%)", "translateY(100%)"); 86 return baseAnimation.addElement(baseEl).easing("cubic-bezier(.36,.66,.04,1)").duration(450).addAnimation([backdropAnimation, wrapperAnimation]); 87}; 88var actionSheetIosCss = '.sc-ion-action-sheet-ios-h{--color:initial;--button-color-activated:var(--button-color);--button-color-focused:var(--button-color);--button-color-hover:var(--button-color);--button-color-selected:var(--button-color);--min-width:auto;--width:100%;--max-width:500px;--min-height:auto;--height:auto;--max-height:calc(100% - (var(--ion-safe-area-top) + var(--ion-safe-area-bottom)));-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;left:0;right:0;top:0;bottom:0;display:block;position:fixed;outline:none;font-family:var(--ion-font-family, inherit);-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-action-sheet-ios-h{display:none}.action-sheet-wrapper.sc-ion-action-sheet-ios{left:0;right:0;bottom:0;-webkit-transform:translate3d(0, 100%, 0);transform:translate3d(0, 100%, 0);display:block;position:absolute;width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);
88min-height:var(--min-height);max-height:var(--max-height);z-index:10;pointer-events:none}.action-sheet-button.sc-ion-action-sheet-ios{display:block;position:relative;width:100%;border:0;outline:none;background:var(--button-background);color:var(--button-color);font-family:inherit;overflow:hidden}.action-sheet-button-inner.sc-ion-action-sheet-ios{display:-ms-flexbox;display:flex;position:relative;-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;pointer-events:none;width:100%;height:100%;z-index:1}.action-sheet-container.sc-ion-action-sheet-ios{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column;-ms-flex-pack:end;justify-content:flex-end;height:100%;max-height:calc(100vh - (var(--ion-safe-area-top, 0) + var(--ion-safe-area-bottom, 0)));max-height:calc(100dvh - (var(--ion-safe-area-top, 0) + var(--ion-safe-area-bottom, 0)))}.action-sheet-group.sc-ion-action-sheet-ios{-ms-flex-negative:2;flex-shrink:2;overscroll-behavior-y:contain;overflow-y:auto;-webkit-overflow-scrolling:touch;pointer-events:all;background:var(--background)}@media (any-pointer: coarse){.action-sheet-group.sc-ion-action-sheet-ios::-webkit-scrollbar{display:none}}.action-sheet-group-cancel.sc-ion-action-sheet-ios{-ms-flex-negative:0;flex-shrink:0;overflow:hidden}.action-sheet-button.sc-ion-action-sheet-ios::after{left:0;right:0;top:0;bottom:0;position:absolute;content:"";opacity:0}.action-sheet-selected.sc-ion-action-sheet-ios{color:var(--button-color-selected)}.action-sheet-selected.sc-ion-action-sheet-ios::after{background:var(--button-background-selected);opacity:var(--button-background-selected-opacity)}.action-sheet-button.ion-activated.sc-ion-action-sheet-ios{color:var(--button-color-activated)}.action-sheet-button.ion-activated.sc-ion-action-sheet-ios::after{background:var(--button-background-activated);opacity:var(--button-background-activated-opacity)}.action-sheet-button.ion-focused.sc-ion-action-sheet-ios{color:var(--button-color-focused)}.action-sheet-button.ion-focused.sc-ion-action-sheet-ios::after{background:var(--button-background-focused);opacity:var(--button-background-focused-opacity)}@media (any-hover: hover){.action-sheet-button.sc-ion-action-sheet-ios:hover{color:var(--button-color-hover)}.action-sheet-button.sc-ion-action-sheet-ios:hover::after{background:var(--button-background-hover);opacity:var(--button-background-hover-opacity)}}.sc-ion-action-sheet-ios-h{--background:var(--ion-overlay-background-color, var(--ion-color-step-100, #f9f9f9));--backdrop-opacity:var(--ion-backdrop-opacity, 0.4);--button-background:linear-gradient(0deg, rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.08), rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.08) 50%, transparent 50%) bottom/100% 1px no-repeat transparent;--button-background-activated:var(--ion-text-color, #000);--button-background-activated-opacity:.08;--button-background-hover:currentColor;--button-background-hover-opacity:.04;--button-background-focused:currentColor;--button-background-focused-opacity:.12;--button-background-selected:var(--ion-color-step-150, var(--ion-background-color, #fff));--button-background-selected-opacity:1;--button-color:var(--ion-color-primary, #3880ff);--color:var(--ion-color-step-400, #999999);text-align:center}.action-sheet-wrapper.sc-ion-action-sheet-ios{-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;margin-top:var(--ion-safe-area-top, 0);margin-bottom:var(--ion-safe-area-bottom, 0)}.action-sheet-container.sc-ion-action-sheet-ios{-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:8px;padding-inline-end:8px;padding-top:0;padding-bottom:0}.action-sheet-group.sc-ion-action-sheet-ios{border-radius:13px;margin-bottom:8px}.action-sheet-group.sc-ion-action-sheet-ios:first-child{margin-top:10px}.action-sheet-group.sc-ion-action-sheet-ios:last-child{margin-bottom:10px}@supports ((-webkit-backdrop-filter: blur(0)) or (backdrop-filter: blur(0))){.action-sheet-translucent.sc-ion-action-sheet-ios-h .action-sheet-group.sc-ion-action-sheet-ios{background-color:transparent;-webkit-backdrop-filter:saturate(280%) blur(20px);backdrop-filter:saturate(280%) blur(20px)}.action-sheet-translucent.sc-ion-action-sheet-ios-h .action-sheet-title.sc-ion-action-sheet-ios,.action-sheet-translucent.sc-ion-action-sheet-ios-h .action-sheet-button.sc-ion-action-sheet-ios{background-color:transparent;background-image:-webkit-gradient(linear, left bottom, left top, from(rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.8)), to(rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.8))), -webkit-gradient(linear, left bottom, left top, from(rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.4)), color-stop(50%, rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.4)), color-stop(50%, rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.8)));background-image:linear-gradient(0deg, rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.8), rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.8) 100%), linear-gradient(0deg, rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.4), rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.4) 50%, rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.8) 50%);background-repeat:no-repeat;background-position:top, bottom;background-size:100% calc(100% - 1px), 100% 1px;-webkit-backdrop-filter:saturate(120%);backdrop-filter:saturate(120%)}.action-sheet-translucent.sc-ion-action-sheet-ios-h .action-sheet-button.ion-activated.sc-ion-action-sheet-ios{background-color:rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.7);background-image:none}.action-sheet-translucent.sc-ion-action-sheet-ios-h .action-sheet-cancel.
88sc-ion-action-sheet-ios{background:var(--button-background-selected)}}.action-sheet-title.sc-ion-action-sheet-ios{background:-webkit-gradient(linear, left bottom, left top, from(rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.08)), color-stop(50%, rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.08)), color-stop(50%, transparent)) bottom/100% 1px no-repeat transparent;background:linear-gradient(0deg, rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.08), rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.08) 50%, transparent 50%) bottom/100% 1px no-repeat transparent}.action-sheet-title.sc-ion-action-sheet-ios{-webkit-padding-start:10px;padding-inline-start:10px;-webkit-padding-end:10px;padding-inline-end:10px;padding-top:14px;padding-bottom:13px;color:var(--color, var(--ion-color-step-400, #999999));font-size:max(13px, 0.8125rem);font-weight:400;text-align:center}.action-sheet-title.action-sheet-has-sub-title.sc-ion-action-sheet-ios{font-weight:600}.action-sheet-sub-title.sc-ion-action-sheet-ios{padding-left:0;padding-right:0;padding-top:6px;padding-bottom:0;font-size:max(13px, 0.8125rem);font-weight:400}.action-sheet-button.sc-ion-action-sheet-ios{-webkit-padding-start:14px;padding-inline-start:14px;-webkit-padding-end:14px;padding-inline-end:14px;padding-top:14px;padding-bottom:14px;min-height:56px;font-size:max(20px, 1.25rem);contain:content}.action-sheet-button.sc-ion-action-sheet-ios .action-sheet-icon.sc-ion-action-sheet-ios{-webkit-margin-end:0.3em;margin-inline-end:0.3em;font-size:max(28px, 1.75rem);pointer-events:none}.action-sheet-button.sc-ion-action-sheet-ios:last-child{background-image:none}.action-sheet-selected.sc-ion-action-sheet-ios{font-weight:bold}.action-sheet-cancel.sc-ion-action-sheet-ios{font-weight:600}.action-sheet-cancel.sc-ion-action-sheet-ios::after{background:var(--button-background-selected);opacity:var(--button-background-selected-opacity)}.action-sheet-destructive.sc-ion-action-sheet-ios,.action-sheet-destructive.ion-activated.sc-ion-action-sheet-ios,.action-sheet-destructive.ion-focused.sc-ion-action-sheet-ios{color:var(--ion-color-danger, #eb445a)}@media (any-hover: hover){.action-sheet-destructive.sc-ion-action-sheet-ios:hover{color:var(--ion-color-danger, #eb445a)}}'; 89var actionSheetMdCss = '.sc-ion-action-sheet-md-h{--color:initial;--button-color-activated:var(--button-color);--button-color-focused:var(--button-color);--button-color-hover:var(--button-color);--button-color-selected:var(--button-color);--min-width:auto;--width:100%;--max-width:500px;--min-height:auto;--height:auto;--max-height:calc(100% - (var(--ion-safe-area-top) + var(--ion-safe-area-bottom)));-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;left:0;right:0;top:0;bottom:0;display:block;position:fixed;outline:none;font-family:var(--ion-font-family, inherit);-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-action-sheet-md-h{display:none}.action-sheet-wrapper.sc-ion-action-sheet-md{left:0;right:0;bottom:0;-webkit-transform:translate3d(0, 100%, 0);transform:translate3d(0, 100%, 0);display:block;position:absolute;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);z-index:10;pointer-events:none}.action-sheet-button.sc-ion-action-sheet-md{display:block;position:relative;width:100%;border:0;outline:none;background:var(--button-background);color:var(--button-color);font-family:inherit;overflow:hidden}.action-sheet-button-inner.sc-ion-action-sheet-md{display:-ms-flexbox;display:flex;position:relative;-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;pointer-events:none;width:100%;height:100%;z-index:1}.action-sheet-container.sc-ion-action-sheet-md{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column;-ms-flex-pack:end;justify-content:flex-end;height:100%;max-height:calc(100vh - (var(--ion-safe-area-top, 0) + var(--ion-safe-area-bottom, 0)));max-height:calc(100dvh - (var(--ion-safe-area-top, 0) + var(--ion-safe-area-bottom, 0)))}.action-sheet-group.sc-ion-action-sheet-md{-ms-flex-negative:2;flex-shrink:2;overscroll-behavior-y:contain;overflow-y:auto;-webkit-overflow-scrolling:touch;pointer-events:all;background:var(--background)}@media (any-pointer: coarse){.action-sheet-group.sc-ion-action-sheet-md::-webkit-scrollbar{display:none}}.action-sheet-group-cancel.sc-ion-action-sheet-md{-ms-flex-negative:0;flex-shrink:0;overflow:hidden}.action-sheet-button.sc-ion-action-sheet-md::after{left:0;right:0;top:0;bottom:0;position:absolute;content:"";opacity:0}
89.action-sheet-selected.sc-ion-action-sheet-md{color:var(--button-color-selected)}.action-sheet-selected.sc-ion-action-sheet-md::after{background:var(--button-background-selected);opacity:var(--button-background-selected-opacity)}.action-sheet-button.ion-activated.sc-ion-action-sheet-md{color:var(--button-color-activated)}.action-sheet-button.ion-activated.sc-ion-action-sheet-md::after{background:var(--button-background-activated);opacity:var(--button-background-activated-opacity)}.action-sheet-button.ion-focused.sc-ion-action-sheet-md{color:var(--button-color-focused)}.action-sheet-button.ion-focused.sc-ion-action-sheet-md::after{background:var(--button-background-focused);opacity:var(--button-background-focused-opacity)}@media (any-hover: hover){.action-sheet-button.sc-ion-action-sheet-md:hover{color:var(--button-color-hover)}.action-sheet-button.sc-ion-action-sheet-md:hover::after{background:var(--button-background-hover);opacity:var(--button-background-hover-opacity)}}.sc-ion-action-sheet-md-h{--background:var(--ion-overlay-background-color, var(--ion-background-color, #fff));--backdrop-opacity:var(--ion-backdrop-opacity, 0.32);--button-background:transparent;--button-background-selected:currentColor;--button-background-selected-opacity:0;--button-background-activated:transparent;--button-background-activated-opacity:0;--button-background-hover:currentColor;--button-background-hover-opacity:.04;--button-background-focused:currentColor;--button-background-focused-opacity:.12;--button-color:var(--ion-color-step-850, #262626);--color:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.54)}.action-sheet-wrapper.sc-ion-action-sheet-md{-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;margin-top:var(--ion-safe-area-top, 0);margin-bottom:0}.action-sheet-title.sc-ion-action-sheet-md{-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:20px;padding-bottom:17px;min-height:60px;color:var(--color, rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.54));font-size:1rem;text-align:start}.action-sheet-sub-title.sc-ion-action-sheet-md{padding-left:0;padding-right:0;padding-top:16px;padding-bottom:0;font-size:0.875rem}.action-sheet-group.sc-ion-action-sheet-md:first-child{padding-top:0}.action-sheet-group.sc-ion-action-sheet-md:last-child{padding-bottom:var(--ion-safe-area-bottom)}.action-sheet-button.sc-ion-action-sheet-md{-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:12px;padding-bottom:12px;position:relative;min-height:52px;font-size:1rem;text-align:start;contain:content;overflow:hidden}.action-sheet-icon.sc-ion-action-sheet-md{-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:32px;margin-inline-end:32px;margin-top:0;margin-bottom:0;color:var(--color);font-size:1.5rem}.action-sheet-button-inner.sc-ion-action-sheet-md{-ms-flex-pack:start;justify-content:flex-start}.action-sheet-selected.sc-ion-action-sheet-md{font-weight:bold}'; 90var ActionSheet = class { 91 constructor(hostRef) { 92 registerInstance(this, hostRef); 93 this.didPresent = createEvent(this, "ionActionSheetDidPresent", 7); 94 this.willPresent = createEvent(this, "ionActionSheetWillPresent", 7); 95 this.willDismiss = createEvent(this, "ionActionSheetWillDismiss", 7); 96 this.didDismiss = createEvent(this, "ionActionSheetDidDismiss", 7); 97 this.didPresentShorthand = createEvent(this, "didPresent", 7); 98 this.willPresentShorthand = createEvent(this, "willPresent", 7); 99 this.willDismissShorthand = createEvent(this, "willDismiss", 7); 100 this.didDismissShorthand = createEvent(this, "didDismiss", 7); 101 this.delegateController = createDelegateController(this); 102 this.lockController = createLockController(); 103 this.triggerController = createTriggerController(); 104 this.presented = false; 105 this.onBackdropTap = () => { 106 this.dismiss(void 0, BACKDROP); 107 }; 108 this.dispatchCancelHandler = (ev) => { 109 const role = ev.detail.role; 110 if (isCancel(role)) { 111 const cancelButton = this.getButtons().find((b) => b.role === "cancel"); 112 this.callButtonHandler(cancelButton); 113 } 114 }; 115 this.overlayIndex = void 0; 116 this.delegate = void 0; 117 this.hasController = false;
118 this.keyboardClose = true; 119 this.enterAnimation = void 0; 120 this.leaveAnimation = void 0; 121 this.buttons = []; 122 this.cssClass = void 0; 123 this.backdropDismiss = true; 124 this.header = void 0; 125 this.subHeader = void 0; 126 this.translucent = false; 127 this.animated = true; 128 this.htmlAttributes = void 0; 129 this.isOpen = false; 130 this.trigger = void 0; 131 } 132 onIsOpenChange(newValue, oldValue) { 133 if (newValue === true && oldValue === false) { 134 this.present(); 135 } else if (newValue === false && oldValue === true) { 136 this.dismiss(); 137 } 138 } 139 triggerChanged() { 140 const { trigger, el, triggerController } = this; 141 if (trigger) { 142 triggerController.addClickListener(el, trigger); 143 } 144 } 145 /** 146 * Present the action sheet overlay after it has been created. 147 */ 148 present() { 149 return __async(this, null, function* () { 150 const unlock = yield this.lockController.lock(); 151 yield this.delegateController.attachViewToDom(); 152 yield present(this, "actionSheetEnter", iosEnterAnimation, mdEnterAnimation); 153 unlock(); 154 }); 155 } 156 /** 157 * Dismiss the action sheet overlay after it has been presented. 158 * 159 * @param data Any data to emit in the dismiss events. 160 * @param role The role of the element that is dismissing the action sheet. 161 * This can be useful in a button handler for determining which button was 162 * clicked to dismiss the action sheet. 163 * Some examples include: ``"cancel"`, `"destructive"`, "selected"`, and `"backdrop"`. 164 */ 165 dismiss(data, role) { 166 return __async(this, null, function* () { 167 const unlock = yield this.lockController.lock(); 168 const dismissed = yield dismiss(this, data, role, "actionSheetLeave", iosLeaveAnimation, mdLeaveAnimation); 169 if (dismissed) { 170 this.delegateController.removeViewFromDom(); 171 } 172 unlock(); 173 return dismissed; 174 }); 175 } 176 /** 177 * Returns a promise that resolves when the action sheet did dismiss. 178 */ 179 onDidDismiss() { 180 return eventMethod(this.el, "ionActionSheetDidDismiss"); 181 } 182 /** 183 * Returns a promise that resolves when the action sheet will dismiss. 184 * 185 */ 186 onWillDismiss() { 187 return eventMethod(this.el, "ionActionSheetWillDismiss"); 188 } 189 buttonClick(button) { 190 return __async(this, null, function* () { 191 const role = button.role; 192 if (isCancel(role)) { 193 return this.dismiss(button.data, role); 194 } 195 const shouldDismiss = yield this.callButtonHandler(button); 196 if (shouldDismiss) { 197 return this.dismiss(button.data, button.role); 198 } 199 return Promise.resolve(); 200 }); 201 } 202 callButtonHandler(button) { 203 return __async(this, null, function* () { 204 if (button) { 205 const rtn = yield safeCall(button.handler); 206 if (rtn === false) { 207 return false; 208 } 209 } 210 return true; 211 }); 212 } 213 getButtons() { 214 return this.buttons.map((b) => { 215 return typeof b === "string" ? { text: b } : b; 216 }); 217 } 218 connectedCallback() { 219 prepareOverlay(this.el); 220 this.triggerChanged(); 221 } 222 disconnectedCallback() { 223 if (this.gesture) { 224 this.gesture.destroy(); 225 this.gesture = void 0; 226 } 227 this.triggerController.removeClickListener(); 228 } 229 componentWillLoad() { 230 setOverlayId(this.el); 231 } 232 componentDidLoad() { 233 const { groupEl, wrapperEl } = this; 234 if (!this.gesture && getIonMode(this) === "ios" && wrapperEl && groupEl) { 235 readTask(() => { 236 const isScrollable = groupEl.scrollHeight > groupEl.clientHeight; 237 if (!isScrollable) { 238 this.gesture = createButtonActiveGesture(wrapperEl, (refEl) => refEl.classList.contains("action-sheet-button")); 239 this.gesture.enable(true); 240 } 241 }); 242 } 243 if (this.isOpen === true) { 244 raf(() => this.present()); 245 } 246 this.triggerChanged(); 247 } 248 render() { 249 const { header, htmlAttributes, overlayIndex } = this; 250 const mode = getIonMode(this); 251 const allButtons = this.getButtons(); 252 const cancelButton = allButtons.find((b) => b.role === "cancel"); 253 const buttons = allButtons.filter((b) => b.role !== "cancel"); 254 const headerID = `action-sheet-${overlayIndex}-header`; 255 return h(Host, Object.assign({ role: "dialog", "aria-modal": "true", "aria-labelledby": header !== void 0 ? headerID : null, tabindex: "-1" }, htmlAttributes, { style: { 256 zIndex: `${2e4 + this.overlayIndex}` 257 }, class: Object.assign(Object.assign({ [mode]: true }, getClassMap(this.cssClass)), { "overlay-hidden": true, "action-sheet-translucent": this.translucent }), onIonActionSheetWillDismiss: this.dispatchCancelHandler, onIonBackdropTap: this.onBackdropTap }), h("ion-backdrop", { tappable: this.backdropDismiss }), h("div", { tabindex: "0" }), h("div", { class: "action-sheet-wrapper ion-overlay-wrapper", ref: (el) => this.wrapperEl = el }, h("div", { class: "action-sheet-container" }, h("div", { class: "action-sheet-group", ref: (el) => this.groupEl = el }, header !== void 0 && h("div", { id: headerID, class: { 258 "action-sheet-title": true, 259 "action-sheet-has-sub-title": this.subHeader !== void 0 260 } }, header, this.subHeader && h("div", { class: "action-sheet-sub-title" }, this.subHeader)), buttons.map((b) => h("button", Object.assign({}, b.htmlAttributes, { type: "button", id: b.id, class: buttonClass(b), onClick: () => this.buttonClick(b) }), h("span", { class: "action-sheet-button-inner" }, b.icon && h("ion-icon", { icon: b.icon, "aria-hidden": "true", lazy: false, class: "action-sheet-icon" }), b.text), mode === "md" && h("ion-ripple-effect", null)))), cancelButton && h("div", { class: "action-sheet-group action-sheet-group-cancel" }, h("button", Object.assign({}, cancelButton.htmlAttributes, { type: "button", class: buttonClass(cancelButton), onClick: () => this.buttonClick(cancelButton) }), h("span", { class: "action-sheet-button-inner" }, cancelButton.icon && h("ion-icon", { icon: cancelButton.icon, "aria-hidden": "true", lazy: false, class: "action-sheet-icon" }), cancelButton.text), mode === "md" && h("ion-ripple-effect", null))))), h("div", { tabindex: "0" })); 261 } 262 get el() { 263 return getElement(this); 264 } 265 static get watchers() { 266 return { 267 "isOpen": ["onIsOpenChange"], 268 "trigger": ["triggerChanged"] 269 }; 270 } 271}; 272var buttonClass = (button) => { 273 return Object.assign({ "action-sheet-button": true, "ion-activatable": true, "ion-focusable": true, [`action-sheet-${button.role}`]: button.role !== void 0 }, getClassMap(button.cssClass)); 274}; 275ActionSheet.style = { 276 ios: actionSheetIosCss, 277 md: actionSheetMdCss 278}; 279export { 280 ActionSheet as ion_action_sheet 281};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.