95d9d2f9a8
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1035 lines
46 KiB
JavaScript
1035 lines
46 KiB
JavaScript
(self["webpackChunkapp"] = self["webpackChunkapp"] || []).push([[5473],{
|
|
|
|
/***/ 99273:
|
|
/*!*************************************************************!*\
|
|
!*** ./node_modules/@ionic/core/dist/esm/index-c4b11676.js ***!
|
|
\*************************************************************/
|
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
|
|
__webpack_require__.r(__webpack_exports__);
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ "a": () => (/* binding */ printRequiredElementError),
|
|
/* harmony export */ "b": () => (/* binding */ printIonError),
|
|
/* harmony export */ "p": () => (/* binding */ printIonWarning)
|
|
/* harmony export */ });
|
|
/*!
|
|
* (C) Ionic http://ionicframework.com - MIT License
|
|
*/
|
|
|
|
/**
|
|
* Logs a warning to the console with an Ionic prefix
|
|
* to indicate the library that is warning the developer.
|
|
*
|
|
* @param message - The string message to be logged to the console.
|
|
*/
|
|
const printIonWarning = (message, ...params) => {
|
|
return console.warn(`[Ionic Warning]: ${message}`, ...params);
|
|
};
|
|
/*
|
|
* Logs an error to the console with an Ionic prefix
|
|
* to indicate the library that is warning the developer.
|
|
*
|
|
* @param message - The string message to be logged to the console.
|
|
* @param params - Additional arguments to supply to the console.error.
|
|
*/
|
|
|
|
|
|
const printIonError = (message, ...params) => {
|
|
return console.error(`[Ionic Error]: ${message}`, ...params);
|
|
};
|
|
/**
|
|
* Prints an error informing developers that an implementation requires an element to be used
|
|
* within a specific selector.
|
|
*
|
|
* @param el The web component element this is requiring the element.
|
|
* @param targetSelectors The selector or selectors that were not found.
|
|
*/
|
|
|
|
|
|
const printRequiredElementError = (el, ...targetSelectors) => {
|
|
return console.error(`<${el.tagName.toLowerCase()}> must be used inside ${targetSelectors.join(' or ')}.`);
|
|
};
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 24311:
|
|
/*!*************************************************************!*\
|
|
!*** ./node_modules/@ionic/core/dist/esm/index-e6d1a8be.js ***!
|
|
\*************************************************************/
|
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
|
|
__webpack_require__.r(__webpack_exports__);
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ "I": () => (/* binding */ ION_CONTENT_ELEMENT_SELECTOR),
|
|
/* harmony export */ "a": () => (/* binding */ findIonContent),
|
|
/* harmony export */ "b": () => (/* binding */ ION_CONTENT_CLASS_SELECTOR),
|
|
/* harmony export */ "c": () => (/* binding */ scrollByPoint),
|
|
/* harmony export */ "d": () => (/* binding */ disableContentScrollY),
|
|
/* harmony export */ "f": () => (/* binding */ findClosestIonContent),
|
|
/* harmony export */ "g": () => (/* binding */ getScrollElement),
|
|
/* harmony export */ "i": () => (/* binding */ isIonContent),
|
|
/* harmony export */ "p": () => (/* binding */ printIonContentErrorMsg),
|
|
/* harmony export */ "r": () => (/* binding */ resetContentScrollY),
|
|
/* harmony export */ "s": () => (/* binding */ scrollToTop)
|
|
/* harmony export */ });
|
|
/* harmony import */ var _Volumes_case_workspace_work_APPS_KA_APP_WORK_NOW_KA_PASS_V2_2_6_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */ 71670);
|
|
/* harmony import */ var _helpers_3b390e48_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./helpers-3b390e48.js */ 29259);
|
|
/* harmony import */ var _index_c4b11676_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./index-c4b11676.js */ 99273);
|
|
|
|
|
|
/*!
|
|
* (C) Ionic http://ionicframework.com - MIT License
|
|
*/
|
|
|
|
|
|
const ION_CONTENT_TAG_NAME = 'ION-CONTENT';
|
|
const ION_CONTENT_ELEMENT_SELECTOR = 'ion-content';
|
|
const ION_CONTENT_CLASS_SELECTOR = '.ion-content-scroll-host';
|
|
/**
|
|
* Selector used for implementations reliant on `<ion-content>` for scroll event changes.
|
|
*
|
|
* Developers should use the `.ion-content-scroll-host` selector to target the element emitting
|
|
* scroll events. With virtual scroll implementations this will be the host element for
|
|
* the scroll viewport.
|
|
*/
|
|
|
|
const ION_CONTENT_SELECTOR = `${ION_CONTENT_ELEMENT_SELECTOR}, ${ION_CONTENT_CLASS_SELECTOR}`;
|
|
|
|
const isIonContent = el => el.tagName === ION_CONTENT_TAG_NAME;
|
|
/**
|
|
* Waits for the element host fully initialize before
|
|
* returning the inner scroll element.
|
|
*
|
|
* For `ion-content` the scroll target will be the result
|
|
* of the `getScrollElement` function.
|
|
*
|
|
* For custom implementations it will be the element host
|
|
* or a selector within the host, if supplied through `scrollTarget`.
|
|
*/
|
|
|
|
|
|
const getScrollElement = /*#__PURE__*/function () {
|
|
var _ref = (0,_Volumes_case_workspace_work_APPS_KA_APP_WORK_NOW_KA_PASS_V2_2_6_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* (el) {
|
|
if (isIonContent(el)) {
|
|
yield new Promise(resolve => (0,_helpers_3b390e48_js__WEBPACK_IMPORTED_MODULE_1__.c)(el, resolve));
|
|
return el.getScrollElement();
|
|
}
|
|
|
|
return el;
|
|
});
|
|
|
|
return function getScrollElement(_x) {
|
|
return _ref.apply(this, arguments);
|
|
};
|
|
}();
|
|
/**
|
|
* Queries the element matching the selector for IonContent.
|
|
* See ION_CONTENT_SELECTOR for the selector used.
|
|
*/
|
|
|
|
|
|
const findIonContent = el => {
|
|
/**
|
|
* First we try to query the custom scroll host selector in cases where
|
|
* the implementation is using an outer `ion-content` with an inner custom
|
|
* scroll container.
|
|
*/
|
|
const customContentHost = el.querySelector(ION_CONTENT_CLASS_SELECTOR);
|
|
|
|
if (customContentHost) {
|
|
return customContentHost;
|
|
}
|
|
|
|
return el.querySelector(ION_CONTENT_SELECTOR);
|
|
};
|
|
/**
|
|
* Queries the closest element matching the selector for IonContent.
|
|
*/
|
|
|
|
|
|
const findClosestIonContent = el => {
|
|
return el.closest(ION_CONTENT_SELECTOR);
|
|
};
|
|
/**
|
|
* Scrolls to the top of the element. If an `ion-content` is found, it will scroll
|
|
* using the public API `scrollToTop` with a duration.
|
|
*/
|
|
// TODO(FW-2832): type
|
|
|
|
|
|
const scrollToTop = (el, durationMs) => {
|
|
if (isIonContent(el)) {
|
|
const content = el;
|
|
return content.scrollToTop(durationMs);
|
|
}
|
|
|
|
return Promise.resolve(el.scrollTo({
|
|
top: 0,
|
|
left: 0,
|
|
behavior: durationMs > 0 ? 'smooth' : 'auto'
|
|
}));
|
|
};
|
|
/**
|
|
* Scrolls by a specified X/Y distance in the component. If an `ion-content` is found, it will scroll
|
|
* using the public API `scrollByPoint` with a duration.
|
|
*/
|
|
|
|
|
|
const scrollByPoint = (el, x, y, durationMs) => {
|
|
if (isIonContent(el)) {
|
|
const content = el;
|
|
return content.scrollByPoint(x, y, durationMs);
|
|
}
|
|
|
|
return Promise.resolve(el.scrollBy({
|
|
top: y,
|
|
left: x,
|
|
behavior: durationMs > 0 ? 'smooth' : 'auto'
|
|
}));
|
|
};
|
|
/**
|
|
* Prints an error informing developers that an implementation requires an element to be used
|
|
* within either the `ion-content` selector or the `.ion-content-scroll-host` class.
|
|
*/
|
|
|
|
|
|
const printIonContentErrorMsg = el => {
|
|
return (0,_index_c4b11676_js__WEBPACK_IMPORTED_MODULE_2__.a)(el, ION_CONTENT_ELEMENT_SELECTOR);
|
|
};
|
|
/**
|
|
* Several components in Ionic need to prevent scrolling
|
|
* during a gesture (card modal, range, item sliding, etc).
|
|
* Use this utility to account for ion-content and custom content hosts.
|
|
*/
|
|
|
|
|
|
const disableContentScrollY = contentEl => {
|
|
if (isIonContent(contentEl)) {
|
|
const ionContent = contentEl;
|
|
const initialScrollY = ionContent.scrollY;
|
|
ionContent.scrollY = false;
|
|
/**
|
|
* This should be passed into resetContentScrollY
|
|
* so that we can revert ion-content's scrollY to the
|
|
* correct state. For example, if scrollY = false
|
|
* initially, we do not want to enable scrolling
|
|
* when we call resetContentScrollY.
|
|
*/
|
|
|
|
return initialScrollY;
|
|
} else {
|
|
contentEl.style.setProperty('overflow', 'hidden');
|
|
return true;
|
|
}
|
|
};
|
|
|
|
const resetContentScrollY = (contentEl, initialScrollY) => {
|
|
if (isIonContent(contentEl)) {
|
|
contentEl.scrollY = initialScrollY;
|
|
} else {
|
|
contentEl.style.removeProperty('overflow');
|
|
}
|
|
};
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 35473:
|
|
/*!**********************************************************************!*\
|
|
!*** ./node_modules/@ionic/core/dist/esm/ion-item-option_3.entry.js ***!
|
|
\**********************************************************************/
|
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
|
|
__webpack_require__.r(__webpack_exports__);
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ "ion_item_option": () => (/* binding */ ItemOption),
|
|
/* harmony export */ "ion_item_options": () => (/* binding */ ItemOptions),
|
|
/* harmony export */ "ion_item_sliding": () => (/* binding */ ItemSliding)
|
|
/* harmony export */ });
|
|
/* harmony import */ var _Volumes_case_workspace_work_APPS_KA_APP_WORK_NOW_KA_PASS_V2_2_6_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */ 71670);
|
|
/* harmony import */ var _index_8e692445_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./index-8e692445.js */ 91559);
|
|
/* harmony import */ var _ionic_global_c74e4951_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ionic-global-c74e4951.js */ 95823);
|
|
/* harmony import */ var _theme_7670341c_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./theme-7670341c.js */ 50320);
|
|
/* harmony import */ var _helpers_3b390e48_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./helpers-3b390e48.js */ 29259);
|
|
/* harmony import */ var _index_e6d1a8be_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./index-e6d1a8be.js */ 24311);
|
|
/* harmony import */ var _index_c4b11676_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./index-c4b11676.js */ 99273);
|
|
|
|
|
|
/*!
|
|
* (C) Ionic http://ionicframework.com - MIT License
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const itemOptionIosCss = ":host{--background:var(--ion-color-primary, #3880ff);--color:var(--ion-color-primary-contrast, #fff);background:var(--background);color:var(--color);font-family:var(--ion-font-family, inherit)}:host(.in-list.item-options-end:last-child){padding-right:calc(0.7em + var(--ion-safe-area-right))}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){:host(.in-list.item-options-end:last-child){padding-right:unset;-webkit-padding-end:calc(0.7em + var(--ion-safe-area-right));padding-inline-end:calc(0.7em + var(--ion-safe-area-right))}}:host(.in-list.item-options-start:first-child){padding-left:calc(0.7em + var(--ion-safe-area-left))}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){:host(.in-list.item-options-start:first-child){padding-left:unset;-webkit-padding-start:calc(0.7em + var(--ion-safe-area-left));padding-inline-start:calc(0.7em + var(--ion-safe-area-left))}}:host(.ion-color){background:var(--ion-color-base);color:var(--ion-color-contrast)}.button-native{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;padding-left:0.7em;padding-right:0.7em;padding-top:0;padding-bottom:0;display:inline-block;position:relative;width:100%;height:100%;border:0;outline:none;background:transparent;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;-webkit-box-sizing:border-box;box-sizing:border-box}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.button-native{padding-left:unset;padding-right:unset;-webkit-padding-start:0.7em;padding-inline-start:0.7em;-webkit-padding-end:0.7em;padding-inline-end:0.7em}}.button-inner{display:-ms-flexbox;display:flex;-ms-flex-flow:column nowrap;flex-flow:column 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%}.horizontal-wrapper{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%}::slotted(*){-ms-flex-negative:0;flex-shrink:0}::slotted([slot=start]){margin-left:0;margin-right:5px;margin-top:0;margin-bottom:0}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){::slotted([slot=start]){margin-left:unset;margin-right:unset;-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:5px;margin-inline-end:5px}}::slotted([slot=end]){margin-left:5px;margin-right:0;margin-top:0;margin-bottom:0}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){::slotted([slot=end]){margin-left:unset;margin-right:unset;-webkit-margin-start:5px;margin-inline-start:5px;-webkit-margin-end:0;margin-inline-end:0}}::slotted([slot=icon-only]){padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;margin-left:10px;margin-right:10px;margin-top:0;margin-bottom:0;min-width:0.9em;font-size:1.8em}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){::slotted([slot=icon-only]){margin-left:unset;margin-right:unset;-webkit-margin-start:10px;margin-inline-start:10px;-webkit-margin-end:10px;margin-inline-end:10px}}:host(.item-option-expandable){-ms-flex-negative:0;flex-shrink:0;-webkit-transition-duration:0;transition-duration:0;-webkit-transition-property:none;transition-property:none;-webkit-transition-timing-function:cubic-bezier(0.65, 0.05, 0.36, 1);transition-timing-function:cubic-bezier(0.65, 0.05, 0.36, 1)}:host(.item-option-disabled){pointer-events:none}:host(.item-option-disabled) .button-native{cursor:default;opacity:0.5;pointer-events:none}:host{font-size:16px}:host(.ion-activated){background:var(--ion-color-primary-shade, #3171e0)}:host(.ion-color.ion-activated){background:var(--ion-color-shade)}";
|
|
const itemOptionMdCss = ":host{--background:var(--ion-color-primary, #3880ff);--color:var(--ion-color-primary-contrast, #fff);background:var(--background);color:var(--color);font-family:var(--ion-font-family, inherit)}:host(.in-list.item-options-end:last-child){padding-right:calc(0.7em + var(--ion-safe-area-right))}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){:host(.in-list.item-options-end:last-child){padding-right:unset;-webkit-padding-end:calc(0.7em + var(--ion-safe-area-right));padding-inline-end:calc(0.7em + var(--ion-safe-area-right))}}:host(.in-list.item-options-start:first-child){padding-left:calc(0.7em + var(--ion-safe-area-left))}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){:host(.in-list.item-options-start:first-child){padding-left:unset;-webkit-padding-start:calc(0.7em + var(--ion-safe-area-left));padding-inline-start:calc(0.7em + var(--ion-safe-area-left))}}:host(.ion-color){background:var(--ion-color-base);color:var(--ion-color-contrast)}.button-native{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;padding-left:0.7em;padding-right:0.7em;padding-top:0;padding-bottom:0;display:inline-block;position:relative;width:100%;height:100%;border:0;outline:none;background:transparent;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;-webkit-box-sizing:border-box;box-sizing:border-box}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.button-native{padding-left:unset;padding-right:unset;-webkit-padding-start:0.7em;padding-inline-start:0.7em;-webkit-padding-end:0.7em;padding-inline-end:0.7em}}.button-inner{display:-ms-flexbox;display:flex;-ms-flex-flow:column nowrap;flex-flow:column 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%}.horizontal-wrapper{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%}::slotted(*){-ms-flex-negative:0;flex-shrink:0}::slotted([slot=start]){margin-left:0;margin-right:5px;margin-top:0;margin-bottom:0}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){::slotted([slot=start]){margin-left:unset;margin-right:unset;-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:5px;margin-inline-end:5px}}::slotted([slot=end]){margin-left:5px;margin-right:0;margin-top:0;margin-bottom:0}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){::slotted([slot=end]){margin-left:unset;margin-right:unset;-webkit-margin-start:5px;margin-inline-start:5px;-webkit-margin-end:0;margin-inline-end:0}}::slotted([slot=icon-only]){padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;margin-left:10px;margin-right:10px;margin-top:0;margin-bottom:0;min-width:0.9em;font-size:1.8em}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){::slotted([slot=icon-only]){margin-left:unset;margin-right:unset;-webkit-margin-start:10px;margin-inline-start:10px;-webkit-margin-end:10px;margin-inline-end:10px}}:host(.item-option-expandable){-ms-flex-negative:0;flex-shrink:0;-webkit-transition-duration:0;transition-duration:0;-webkit-transition-property:none;transition-property:none;-webkit-transition-timing-function:cubic-bezier(0.65, 0.05, 0.36, 1);transition-timing-function:cubic-bezier(0.65, 0.05, 0.36, 1)}:host(.item-option-disabled){pointer-events:none}:host(.item-option-disabled) .button-native{cursor:default;opacity:0.5;pointer-events:none}:host{font-size:14px;font-weight:500;text-transform:uppercase}";
|
|
const ItemOption = class {
|
|
constructor(hostRef) {
|
|
(0,_index_8e692445_js__WEBPACK_IMPORTED_MODULE_1__.r)(this, hostRef);
|
|
/**
|
|
* If `true`, the user cannot interact with the item option.
|
|
*/
|
|
|
|
this.disabled = false;
|
|
/**
|
|
* If `true`, the option will expand to take up the available width and cover any other options.
|
|
*/
|
|
|
|
this.expandable = false;
|
|
/**
|
|
* The type of the button.
|
|
*/
|
|
|
|
this.type = 'button';
|
|
|
|
this.onClick = ev => {
|
|
const el = ev.target.closest('ion-item-option');
|
|
|
|
if (el) {
|
|
ev.preventDefault();
|
|
}
|
|
};
|
|
}
|
|
|
|
render() {
|
|
const {
|
|
disabled,
|
|
expandable,
|
|
href
|
|
} = this;
|
|
const TagType = href === undefined ? 'button' : 'a';
|
|
const mode = (0,_ionic_global_c74e4951_js__WEBPACK_IMPORTED_MODULE_2__.b)(this);
|
|
const attrs = TagType === 'button' ? {
|
|
type: this.type
|
|
} : {
|
|
download: this.download,
|
|
href: this.href,
|
|
target: this.target
|
|
};
|
|
return (0,_index_8e692445_js__WEBPACK_IMPORTED_MODULE_1__.h)(_index_8e692445_js__WEBPACK_IMPORTED_MODULE_1__.H, {
|
|
onClick: this.onClick,
|
|
class: (0,_theme_7670341c_js__WEBPACK_IMPORTED_MODULE_3__.c)(this.color, {
|
|
[mode]: true,
|
|
'item-option-disabled': disabled,
|
|
'item-option-expandable': expandable,
|
|
'ion-activatable': true
|
|
})
|
|
}, (0,_index_8e692445_js__WEBPACK_IMPORTED_MODULE_1__.h)(TagType, Object.assign({}, attrs, {
|
|
class: "button-native",
|
|
part: "native",
|
|
disabled: disabled
|
|
}), (0,_index_8e692445_js__WEBPACK_IMPORTED_MODULE_1__.h)("span", {
|
|
class: "button-inner"
|
|
}, (0,_index_8e692445_js__WEBPACK_IMPORTED_MODULE_1__.h)("slot", {
|
|
name: "top"
|
|
}), (0,_index_8e692445_js__WEBPACK_IMPORTED_MODULE_1__.h)("div", {
|
|
class: "horizontal-wrapper"
|
|
}, (0,_index_8e692445_js__WEBPACK_IMPORTED_MODULE_1__.h)("slot", {
|
|
name: "start"
|
|
}), (0,_index_8e692445_js__WEBPACK_IMPORTED_MODULE_1__.h)("slot", {
|
|
name: "icon-only"
|
|
}), (0,_index_8e692445_js__WEBPACK_IMPORTED_MODULE_1__.h)("slot", null), (0,_index_8e692445_js__WEBPACK_IMPORTED_MODULE_1__.h)("slot", {
|
|
name: "end"
|
|
})), (0,_index_8e692445_js__WEBPACK_IMPORTED_MODULE_1__.h)("slot", {
|
|
name: "bottom"
|
|
})), mode === 'md' && (0,_index_8e692445_js__WEBPACK_IMPORTED_MODULE_1__.h)("ion-ripple-effect", null)));
|
|
}
|
|
|
|
get el() {
|
|
return (0,_index_8e692445_js__WEBPACK_IMPORTED_MODULE_1__.i)(this);
|
|
}
|
|
|
|
};
|
|
ItemOption.style = {
|
|
ios: itemOptionIosCss,
|
|
md: itemOptionMdCss
|
|
};
|
|
const itemOptionsIosCss = "ion-item-options{top:0;right:0;-ms-flex-pack:end;justify-content:flex-end;display:none;position:absolute;height:100%;font-size:14px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:1}[dir=rtl] ion-item-options,:host-context([dir=rtl]) ion-item-options{-ms-flex-pack:start;justify-content:flex-start}[dir=rtl] ion-item-options:not(.item-options-end),:host-context([dir=rtl]) ion-item-options:not(.item-options-end){right:auto;left:0;-ms-flex-pack:end;justify-content:flex-end}.item-options-start{right:auto;left:0;-ms-flex-pack:start;justify-content:flex-start}[dir=rtl] .item-options-start,:host-context([dir=rtl]) .item-options-start{-ms-flex-pack:end;justify-content:flex-end}.item-options-start ion-item-option:first-child{padding-right:var(--ion-safe-area-left)}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.item-options-start ion-item-option:first-child{padding-right:unset;-webkit-padding-end:var(--ion-safe-area-left);padding-inline-end:var(--ion-safe-area-left)}}.item-options-end ion-item-option:last-child{padding-right:var(--ion-safe-area-right)}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.item-options-end ion-item-option:last-child{padding-right:unset;-webkit-padding-end:var(--ion-safe-area-right);padding-inline-end:var(--ion-safe-area-right)}}[dir=rtl] .item-sliding-active-slide.item-sliding-active-options-start ion-item-options:not(.item-options-end),:host-context([dir=rtl]) .item-sliding-active-slide.item-sliding-active-options-start ion-item-options:not(.item-options-end){width:100%;visibility:visible}.item-sliding-active-slide ion-item-options{display:-ms-flexbox;display:flex;visibility:hidden}.item-sliding-active-slide.item-sliding-active-options-start .item-options-start,.item-sliding-active-slide.item-sliding-active-options-end ion-item-options:not(.item-options-start){width:100%;visibility:visible}.item-options-ios{border-bottom-width:0;border-bottom-style:solid;border-bottom-color:var(--ion-item-border-color, var(--ion-border-color, var(--ion-color-step-250, #c8c7cc)))}.item-options-ios.item-options-end{border-bottom-width:0.55px}.list-ios-lines-none .item-options-ios{border-bottom-width:0}.list-ios-lines-full .item-options-ios,.list-ios-lines-inset .item-options-ios.item-options-end{border-bottom-width:0.55px}";
|
|
const itemOptionsMdCss = "ion-item-options{top:0;right:0;-ms-flex-pack:end;justify-content:flex-end;display:none;position:absolute;height:100%;font-size:14px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:1}[dir=rtl] ion-item-options,:host-context([dir=rtl]) ion-item-options{-ms-flex-pack:start;justify-content:flex-start}[dir=rtl] ion-item-options:not(.item-options-end),:host-context([dir=rtl]) ion-item-options:not(.item-options-end){right:auto;left:0;-ms-flex-pack:end;justify-content:flex-end}.item-options-start{right:auto;left:0;-ms-flex-pack:start;justify-content:flex-start}[dir=rtl] .item-options-start,:host-context([dir=rtl]) .item-options-start{-ms-flex-pack:end;justify-content:flex-end}.item-options-start ion-item-option:first-child{padding-right:var(--ion-safe-area-left)}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.item-options-start ion-item-option:first-child{padding-right:unset;-webkit-padding-end:var(--ion-safe-area-left);padding-inline-end:var(--ion-safe-area-left)}}.item-options-end ion-item-option:last-child{padding-right:var(--ion-safe-area-right)}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.item-options-end ion-item-option:last-child{padding-right:unset;-webkit-padding-end:var(--ion-safe-area-right);padding-inline-end:var(--ion-safe-area-right)}}[dir=rtl] .item-sliding-active-slide.item-sliding-active-options-start ion-item-options:not(.item-options-end),:host-context([dir=rtl]) .item-sliding-active-slide.item-sliding-active-options-start ion-item-options:not(.item-options-end){width:100%;visibility:visible}.item-sliding-active-slide ion-item-options{display:-ms-flexbox;display:flex;visibility:hidden}.item-sliding-active-slide.item-sliding-active-options-start .item-options-start,.item-sliding-active-slide.item-sliding-active-options-end ion-item-options:not(.item-options-start){width:100%;visibility:visible}.item-options-md{border-bottom-width:0;border-bottom-style:solid;border-bottom-color:var(--ion-item-border-color, var(--ion-border-color, var(--ion-color-step-150, rgba(0, 0, 0, 0.13))))}.list-md-lines-none .item-options-md{border-bottom-width:0}.list-md-lines-full .item-options-md,.list-md-lines-inset .item-options-md.item-options-end{border-bottom-width:1px}";
|
|
const ItemOptions = class {
|
|
constructor(hostRef) {
|
|
(0,_index_8e692445_js__WEBPACK_IMPORTED_MODULE_1__.r)(this, hostRef);
|
|
this.ionSwipe = (0,_index_8e692445_js__WEBPACK_IMPORTED_MODULE_1__.e)(this, "ionSwipe", 7);
|
|
/**
|
|
* The side the option button should be on. Possible values: `"start"` and `"end"`. If you have multiple `ion-item-options`, a side must be provided for each.
|
|
*
|
|
*/
|
|
|
|
this.side = 'end';
|
|
}
|
|
/** @internal */
|
|
|
|
|
|
fireSwipeEvent() {
|
|
var _this = this;
|
|
|
|
return (0,_Volumes_case_workspace_work_APPS_KA_APP_WORK_NOW_KA_PASS_V2_2_6_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () {
|
|
_this.ionSwipe.emit({
|
|
side: _this.side
|
|
});
|
|
})();
|
|
}
|
|
|
|
render() {
|
|
const mode = (0,_ionic_global_c74e4951_js__WEBPACK_IMPORTED_MODULE_2__.b)(this);
|
|
const isEnd = (0,_helpers_3b390e48_js__WEBPACK_IMPORTED_MODULE_4__.o)(this.side);
|
|
return (0,_index_8e692445_js__WEBPACK_IMPORTED_MODULE_1__.h)(_index_8e692445_js__WEBPACK_IMPORTED_MODULE_1__.H, {
|
|
class: {
|
|
[mode]: true,
|
|
// Used internally for styling
|
|
[`item-options-${mode}`]: true,
|
|
'item-options-start': !isEnd,
|
|
'item-options-end': isEnd
|
|
}
|
|
});
|
|
}
|
|
|
|
get el() {
|
|
return (0,_index_8e692445_js__WEBPACK_IMPORTED_MODULE_1__.i)(this);
|
|
}
|
|
|
|
};
|
|
ItemOptions.style = {
|
|
ios: itemOptionsIosCss,
|
|
md: itemOptionsMdCss
|
|
};
|
|
const itemSlidingCss = "ion-item-sliding{display:block;position:relative;width:100%;overflow:hidden;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}ion-item-sliding .item{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.item-sliding-active-slide .item{position:relative;-webkit-transition:-webkit-transform 500ms cubic-bezier(0.36, 0.66, 0.04, 1);transition:-webkit-transform 500ms cubic-bezier(0.36, 0.66, 0.04, 1);transition:transform 500ms cubic-bezier(0.36, 0.66, 0.04, 1);transition:transform 500ms cubic-bezier(0.36, 0.66, 0.04, 1), -webkit-transform 500ms cubic-bezier(0.36, 0.66, 0.04, 1);opacity:1;z-index:2;pointer-events:none;will-change:transform}.item-sliding-active-swipe-end .item-options-end .item-option-expandable{padding-left:100%;-ms-flex-order:1;order:1;-webkit-transition-duration:0.6s;transition-duration:0.6s;-webkit-transition-property:padding-left;transition-property:padding-left}[dir=rtl] .item-sliding-active-swipe-end .item-options-end .item-option-expandable,:host-context([dir=rtl]) .item-sliding-active-swipe-end .item-options-end .item-option-expandable{-ms-flex-order:-1;order:-1}.item-sliding-active-swipe-start .item-options-start .item-option-expandable{padding-right:100%;-ms-flex-order:-1;order:-1;-webkit-transition-duration:0.6s;transition-duration:0.6s;-webkit-transition-property:padding-right;transition-property:padding-right}[dir=rtl] .item-sliding-active-swipe-start .item-options-start .item-option-expandable,:host-context([dir=rtl]) .item-sliding-active-swipe-start .item-options-start .item-option-expandable{-ms-flex-order:1;order:1}";
|
|
const SWIPE_MARGIN = 30;
|
|
const ELASTIC_FACTOR = 0.55;
|
|
let openSlidingItem;
|
|
const ItemSliding = class {
|
|
constructor(hostRef) {
|
|
(0,_index_8e692445_js__WEBPACK_IMPORTED_MODULE_1__.r)(this, hostRef);
|
|
this.ionDrag = (0,_index_8e692445_js__WEBPACK_IMPORTED_MODULE_1__.e)(this, "ionDrag", 7);
|
|
this.item = null;
|
|
this.openAmount = 0;
|
|
this.initialOpenAmount = 0;
|
|
this.optsWidthRightSide = 0;
|
|
this.optsWidthLeftSide = 0;
|
|
this.sides = 0
|
|
/* ItemSide.None */
|
|
;
|
|
this.optsDirty = true;
|
|
this.contentEl = null;
|
|
this.initialContentScrollY = true;
|
|
this.state = 2
|
|
/* SlidingState.Disabled */
|
|
;
|
|
/**
|
|
* If `true`, the user cannot interact with the sliding item.
|
|
*/
|
|
|
|
this.disabled = false;
|
|
}
|
|
|
|
disabledChanged() {
|
|
if (this.gesture) {
|
|
this.gesture.enable(!this.disabled);
|
|
}
|
|
}
|
|
|
|
connectedCallback() {
|
|
var _this2 = this;
|
|
|
|
return (0,_Volumes_case_workspace_work_APPS_KA_APP_WORK_NOW_KA_PASS_V2_2_6_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () {
|
|
_this2.item = _this2.el.querySelector('ion-item');
|
|
_this2.contentEl = (0,_index_e6d1a8be_js__WEBPACK_IMPORTED_MODULE_5__.f)(_this2.el);
|
|
yield _this2.updateOptions();
|
|
_this2.gesture = (yield Promise.resolve(/*! import() */).then(__webpack_require__.bind(__webpack_require__, /*! ./index-422b6e83.js */ 36366))).createGesture({
|
|
el: _this2.el,
|
|
gestureName: 'item-swipe',
|
|
gesturePriority: 100,
|
|
threshold: 5,
|
|
canStart: ev => _this2.canStart(ev),
|
|
onStart: () => _this2.onStart(),
|
|
onMove: ev => _this2.onMove(ev),
|
|
onEnd: ev => _this2.onEnd(ev)
|
|
});
|
|
|
|
_this2.disabledChanged();
|
|
})();
|
|
}
|
|
|
|
disconnectedCallback() {
|
|
if (this.gesture) {
|
|
this.gesture.destroy();
|
|
this.gesture = undefined;
|
|
}
|
|
|
|
this.item = null;
|
|
this.leftOptions = this.rightOptions = undefined;
|
|
|
|
if (openSlidingItem === this.el) {
|
|
openSlidingItem = undefined;
|
|
}
|
|
}
|
|
/**
|
|
* Get the amount the item is open in pixels.
|
|
*/
|
|
|
|
|
|
getOpenAmount() {
|
|
return Promise.resolve(this.openAmount);
|
|
}
|
|
/**
|
|
* Get the ratio of the open amount of the item compared to the width of the options.
|
|
* If the number returned is positive, then the options on the right side are open.
|
|
* If the number returned is negative, then the options on the left side are open.
|
|
* If the absolute value of the number is greater than 1, the item is open more than
|
|
* the width of the options.
|
|
*/
|
|
|
|
|
|
getSlidingRatio() {
|
|
return Promise.resolve(this.getSlidingRatioSync());
|
|
}
|
|
/**
|
|
* Open the sliding item.
|
|
*
|
|
* @param side The side of the options to open. If a side is not provided, it will open the first set of options it finds within the item.
|
|
*/
|
|
|
|
|
|
open(side) {
|
|
var _this3 = this;
|
|
|
|
return (0,_Volumes_case_workspace_work_APPS_KA_APP_WORK_NOW_KA_PASS_V2_2_6_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () {
|
|
var _a;
|
|
/**
|
|
* It is possible for the item to be added to the DOM
|
|
* after the item-sliding component was created. As a result,
|
|
* if this.item is null, then we should attempt to
|
|
* query for the ion-item again.
|
|
* However, if the item is already defined then
|
|
* we do not query for it again.
|
|
*/
|
|
|
|
|
|
const item = _this3.item = (_a = _this3.item) !== null && _a !== void 0 ? _a : _this3.el.querySelector('ion-item');
|
|
|
|
if (item === null) {
|
|
return;
|
|
}
|
|
|
|
const optionsToOpen = _this3.getOptions(side);
|
|
|
|
if (!optionsToOpen) {
|
|
return;
|
|
}
|
|
/**
|
|
* If side is not set, we need to infer the side
|
|
* so we know which direction to move the options
|
|
*/
|
|
|
|
|
|
if (side === undefined) {
|
|
side = optionsToOpen === _this3.leftOptions ? 'start' : 'end';
|
|
} // In RTL we want to switch the sides
|
|
|
|
|
|
side = (0,_helpers_3b390e48_js__WEBPACK_IMPORTED_MODULE_4__.o)(side) ? 'end' : 'start';
|
|
const isStartOpen = _this3.openAmount < 0;
|
|
const isEndOpen = _this3.openAmount > 0;
|
|
/**
|
|
* If a side is open and a user tries to
|
|
* re-open the same side, we should not do anything
|
|
*/
|
|
|
|
if (isStartOpen && optionsToOpen === _this3.leftOptions) {
|
|
return;
|
|
}
|
|
|
|
if (isEndOpen && optionsToOpen === _this3.rightOptions) {
|
|
return;
|
|
}
|
|
|
|
_this3.closeOpened();
|
|
|
|
_this3.state = 4
|
|
/* SlidingState.Enabled */
|
|
;
|
|
requestAnimationFrame(() => {
|
|
_this3.calculateOptsWidth();
|
|
|
|
const width = side === 'end' ? _this3.optsWidthRightSide : -_this3.optsWidthLeftSide;
|
|
openSlidingItem = _this3.el;
|
|
|
|
_this3.setOpenAmount(width, false);
|
|
|
|
_this3.state = side === 'end' ? 8
|
|
/* SlidingState.End */
|
|
: 16
|
|
/* SlidingState.Start */
|
|
;
|
|
});
|
|
})();
|
|
}
|
|
/**
|
|
* Close the sliding item. Items can also be closed from the [List](./list).
|
|
*/
|
|
|
|
|
|
close() {
|
|
var _this4 = this;
|
|
|
|
return (0,_Volumes_case_workspace_work_APPS_KA_APP_WORK_NOW_KA_PASS_V2_2_6_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () {
|
|
_this4.setOpenAmount(0, true);
|
|
})();
|
|
}
|
|
/**
|
|
* Close all of the sliding items in the list. Items can also be closed from the [List](./list).
|
|
*/
|
|
|
|
|
|
closeOpened() {
|
|
return (0,_Volumes_case_workspace_work_APPS_KA_APP_WORK_NOW_KA_PASS_V2_2_6_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () {
|
|
if (openSlidingItem !== undefined) {
|
|
openSlidingItem.close();
|
|
openSlidingItem = undefined;
|
|
return true;
|
|
}
|
|
|
|
return false;
|
|
})();
|
|
}
|
|
/**
|
|
* Given an optional side, return the ion-item-options element.
|
|
*
|
|
* @param side This side of the options to get. If a side is not provided it will
|
|
* return the first one available.
|
|
*/
|
|
|
|
|
|
getOptions(side) {
|
|
if (side === undefined) {
|
|
return this.leftOptions || this.rightOptions;
|
|
} else if (side === 'start') {
|
|
return this.leftOptions;
|
|
} else {
|
|
return this.rightOptions;
|
|
}
|
|
}
|
|
|
|
updateOptions() {
|
|
var _this5 = this;
|
|
|
|
return (0,_Volumes_case_workspace_work_APPS_KA_APP_WORK_NOW_KA_PASS_V2_2_6_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () {
|
|
const options = _this5.el.querySelectorAll('ion-item-options');
|
|
|
|
let sides = 0; // Reset left and right options in case they were removed
|
|
|
|
_this5.leftOptions = _this5.rightOptions = undefined;
|
|
|
|
for (let i = 0; i < options.length; i++) {
|
|
const item = options.item(i);
|
|
/**
|
|
* We cannot use the componentOnReady helper
|
|
* util here since we need to wait for all of these items
|
|
* to be ready before we set `this.sides` and `this.optsDirty`.
|
|
*/
|
|
// eslint-disable-next-line custom-rules/no-component-on-ready-method
|
|
|
|
const option = item.componentOnReady !== undefined ? yield item.componentOnReady() : item;
|
|
const side = (0,_helpers_3b390e48_js__WEBPACK_IMPORTED_MODULE_4__.o)(option.side) ? 'end' : 'start';
|
|
|
|
if (side === 'start') {
|
|
_this5.leftOptions = option;
|
|
sides |= 1
|
|
/* ItemSide.Start */
|
|
;
|
|
} else {
|
|
_this5.rightOptions = option;
|
|
sides |= 2
|
|
/* ItemSide.End */
|
|
;
|
|
}
|
|
}
|
|
|
|
_this5.optsDirty = true;
|
|
_this5.sides = sides;
|
|
})();
|
|
}
|
|
|
|
canStart(gesture) {
|
|
/**
|
|
* If very close to start of the screen
|
|
* do not open left side so swipe to go
|
|
* back will still work.
|
|
*/
|
|
const rtl = document.dir === 'rtl';
|
|
const atEdge = rtl ? window.innerWidth - gesture.startX < 15 : gesture.startX < 15;
|
|
|
|
if (atEdge) {
|
|
return false;
|
|
}
|
|
|
|
const selected = openSlidingItem;
|
|
|
|
if (selected && selected !== this.el) {
|
|
this.closeOpened();
|
|
}
|
|
|
|
return !!(this.rightOptions || this.leftOptions);
|
|
}
|
|
|
|
onStart() {
|
|
/**
|
|
* We need to query for the ion-item
|
|
* every time the gesture starts. Developers
|
|
* may toggle ion-item elements via *ngIf.
|
|
*/
|
|
this.item = this.el.querySelector('ion-item');
|
|
const {
|
|
contentEl
|
|
} = this;
|
|
|
|
if (contentEl) {
|
|
this.initialContentScrollY = (0,_index_e6d1a8be_js__WEBPACK_IMPORTED_MODULE_5__.d)(contentEl);
|
|
}
|
|
|
|
openSlidingItem = this.el;
|
|
|
|
if (this.tmr !== undefined) {
|
|
clearTimeout(this.tmr);
|
|
this.tmr = undefined;
|
|
}
|
|
|
|
if (this.openAmount === 0) {
|
|
this.optsDirty = true;
|
|
this.state = 4
|
|
/* SlidingState.Enabled */
|
|
;
|
|
}
|
|
|
|
this.initialOpenAmount = this.openAmount;
|
|
|
|
if (this.item) {
|
|
this.item.style.transition = 'none';
|
|
}
|
|
}
|
|
|
|
onMove(gesture) {
|
|
if (this.optsDirty) {
|
|
this.calculateOptsWidth();
|
|
}
|
|
|
|
let openAmount = this.initialOpenAmount - gesture.deltaX;
|
|
|
|
switch (this.sides) {
|
|
case 2
|
|
/* ItemSide.End */
|
|
:
|
|
openAmount = Math.max(0, openAmount);
|
|
break;
|
|
|
|
case 1
|
|
/* ItemSide.Start */
|
|
:
|
|
openAmount = Math.min(0, openAmount);
|
|
break;
|
|
|
|
case 3
|
|
/* ItemSide.Both */
|
|
:
|
|
break;
|
|
|
|
case 0
|
|
/* ItemSide.None */
|
|
:
|
|
return;
|
|
|
|
default:
|
|
console.warn('invalid ItemSideFlags value', this.sides);
|
|
break;
|
|
}
|
|
|
|
let optsWidth;
|
|
|
|
if (openAmount > this.optsWidthRightSide) {
|
|
optsWidth = this.optsWidthRightSide;
|
|
openAmount = optsWidth + (openAmount - optsWidth) * ELASTIC_FACTOR;
|
|
} else if (openAmount < -this.optsWidthLeftSide) {
|
|
optsWidth = -this.optsWidthLeftSide;
|
|
openAmount = optsWidth + (openAmount - optsWidth) * ELASTIC_FACTOR;
|
|
}
|
|
|
|
this.setOpenAmount(openAmount, false);
|
|
}
|
|
|
|
onEnd(gesture) {
|
|
const {
|
|
contentEl,
|
|
initialContentScrollY
|
|
} = this;
|
|
|
|
if (contentEl) {
|
|
(0,_index_e6d1a8be_js__WEBPACK_IMPORTED_MODULE_5__.r)(contentEl, initialContentScrollY);
|
|
}
|
|
|
|
const velocity = gesture.velocityX;
|
|
let restingPoint = this.openAmount > 0 ? this.optsWidthRightSide : -this.optsWidthLeftSide; // Check if the drag didn't clear the buttons mid-point
|
|
// and we aren't moving fast enough to swipe open
|
|
|
|
const isResetDirection = this.openAmount > 0 === !(velocity < 0);
|
|
const isMovingFast = Math.abs(velocity) > 0.3;
|
|
const isOnCloseZone = Math.abs(this.openAmount) < Math.abs(restingPoint / 2);
|
|
|
|
if (swipeShouldReset(isResetDirection, isMovingFast, isOnCloseZone)) {
|
|
restingPoint = 0;
|
|
}
|
|
|
|
const state = this.state;
|
|
this.setOpenAmount(restingPoint, true);
|
|
|
|
if ((state & 32
|
|
/* SlidingState.SwipeEnd */
|
|
) !== 0 && this.rightOptions) {
|
|
this.rightOptions.fireSwipeEvent();
|
|
} else if ((state & 64
|
|
/* SlidingState.SwipeStart */
|
|
) !== 0 && this.leftOptions) {
|
|
this.leftOptions.fireSwipeEvent();
|
|
}
|
|
}
|
|
|
|
calculateOptsWidth() {
|
|
this.optsWidthRightSide = 0;
|
|
|
|
if (this.rightOptions) {
|
|
this.rightOptions.style.display = 'flex';
|
|
this.optsWidthRightSide = this.rightOptions.offsetWidth;
|
|
this.rightOptions.style.display = '';
|
|
}
|
|
|
|
this.optsWidthLeftSide = 0;
|
|
|
|
if (this.leftOptions) {
|
|
this.leftOptions.style.display = 'flex';
|
|
this.optsWidthLeftSide = this.leftOptions.offsetWidth;
|
|
this.leftOptions.style.display = '';
|
|
}
|
|
|
|
this.optsDirty = false;
|
|
}
|
|
|
|
setOpenAmount(openAmount, isFinal) {
|
|
if (this.tmr !== undefined) {
|
|
clearTimeout(this.tmr);
|
|
this.tmr = undefined;
|
|
}
|
|
|
|
if (!this.item) {
|
|
return;
|
|
}
|
|
|
|
const style = this.item.style;
|
|
this.openAmount = openAmount;
|
|
|
|
if (isFinal) {
|
|
style.transition = '';
|
|
}
|
|
|
|
if (openAmount > 0) {
|
|
this.state = openAmount >= this.optsWidthRightSide + SWIPE_MARGIN ? 8
|
|
/* SlidingState.End */
|
|
| 32
|
|
/* SlidingState.SwipeEnd */
|
|
: 8
|
|
/* SlidingState.End */
|
|
;
|
|
} else if (openAmount < 0) {
|
|
this.state = openAmount <= -this.optsWidthLeftSide - SWIPE_MARGIN ? 16
|
|
/* SlidingState.Start */
|
|
| 64
|
|
/* SlidingState.SwipeStart */
|
|
: 16
|
|
/* SlidingState.Start */
|
|
;
|
|
} else {
|
|
/**
|
|
* Item sliding cannot be interrupted
|
|
* while closing the item. If it did,
|
|
* it would allow the item to get into an
|
|
* inconsistent state where multiple
|
|
* items are then open at the same time.
|
|
*/
|
|
if (this.gesture) {
|
|
this.gesture.enable(false);
|
|
}
|
|
|
|
this.tmr = setTimeout(() => {
|
|
this.state = 2
|
|
/* SlidingState.Disabled */
|
|
;
|
|
this.tmr = undefined;
|
|
|
|
if (this.gesture) {
|
|
this.gesture.enable(!this.disabled);
|
|
}
|
|
}, 600);
|
|
openSlidingItem = undefined;
|
|
style.transform = '';
|
|
return;
|
|
}
|
|
|
|
style.transform = `translate3d(${-openAmount}px,0,0)`;
|
|
this.ionDrag.emit({
|
|
amount: openAmount,
|
|
ratio: this.getSlidingRatioSync()
|
|
});
|
|
}
|
|
|
|
getSlidingRatioSync() {
|
|
if (this.openAmount > 0) {
|
|
return this.openAmount / this.optsWidthRightSide;
|
|
} else if (this.openAmount < 0) {
|
|
return this.openAmount / this.optsWidthLeftSide;
|
|
} else {
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
render() {
|
|
const mode = (0,_ionic_global_c74e4951_js__WEBPACK_IMPORTED_MODULE_2__.b)(this);
|
|
return (0,_index_8e692445_js__WEBPACK_IMPORTED_MODULE_1__.h)(_index_8e692445_js__WEBPACK_IMPORTED_MODULE_1__.H, {
|
|
class: {
|
|
[mode]: true,
|
|
'item-sliding-active-slide': this.state !== 2
|
|
/* SlidingState.Disabled */
|
|
,
|
|
'item-sliding-active-options-end': (this.state & 8
|
|
/* SlidingState.End */
|
|
) !== 0,
|
|
'item-sliding-active-options-start': (this.state & 16
|
|
/* SlidingState.Start */
|
|
) !== 0,
|
|
'item-sliding-active-swipe-end': (this.state & 32
|
|
/* SlidingState.SwipeEnd */
|
|
) !== 0,
|
|
'item-sliding-active-swipe-start': (this.state & 64
|
|
/* SlidingState.SwipeStart */
|
|
) !== 0
|
|
}
|
|
});
|
|
}
|
|
|
|
get el() {
|
|
return (0,_index_8e692445_js__WEBPACK_IMPORTED_MODULE_1__.i)(this);
|
|
}
|
|
|
|
static get watchers() {
|
|
return {
|
|
"disabled": ["disabledChanged"]
|
|
};
|
|
}
|
|
|
|
};
|
|
|
|
const swipeShouldReset = (isResetDirection, isMovingFast, isOnResetZone) => {
|
|
// The logic required to know when the sliding item should close (openAmount=0)
|
|
// depends on three booleans (isResetDirection, isMovingFast, isOnResetZone)
|
|
// and it ended up being too complicated to be written manually without errors
|
|
// so the truth table is attached below: (0=false, 1=true)
|
|
// isResetDirection | isMovingFast | isOnResetZone || shouldClose
|
|
// 0 | 0 | 0 || 0
|
|
// 0 | 0 | 1 || 1
|
|
// 0 | 1 | 0 || 0
|
|
// 0 | 1 | 1 || 0
|
|
// 1 | 0 | 0 || 0
|
|
// 1 | 0 | 1 || 1
|
|
// 1 | 1 | 0 || 1
|
|
// 1 | 1 | 1 || 1
|
|
// The resulting expression was generated by resolving the K-map (Karnaugh map):
|
|
return !isMovingFast && isOnResetZone || isResetDirection && isMovingFast;
|
|
};
|
|
|
|
ItemSliding.style = itemSlidingCss;
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 50320:
|
|
/*!*************************************************************!*\
|
|
!*** ./node_modules/@ionic/core/dist/esm/theme-7670341c.js ***!
|
|
\*************************************************************/
|
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
|
|
__webpack_require__.r(__webpack_exports__);
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ "c": () => (/* binding */ createColorClasses),
|
|
/* harmony export */ "g": () => (/* binding */ getClassMap),
|
|
/* harmony export */ "h": () => (/* binding */ hostContext),
|
|
/* harmony export */ "o": () => (/* binding */ openURL)
|
|
/* harmony export */ });
|
|
/* harmony import */ var _Volumes_case_workspace_work_APPS_KA_APP_WORK_NOW_KA_PASS_V2_2_6_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */ 71670);
|
|
|
|
|
|
/*!
|
|
* (C) Ionic http://ionicframework.com - MIT License
|
|
*/
|
|
const hostContext = (selector, el) => {
|
|
return el.closest(selector) !== null;
|
|
};
|
|
/**
|
|
* Create the mode and color classes for the component based on the classes passed in
|
|
*/
|
|
|
|
|
|
const createColorClasses = (color, cssClassMap) => {
|
|
return typeof color === 'string' && color.length > 0 ? Object.assign({
|
|
'ion-color': true,
|
|
[`ion-color-${color}`]: true
|
|
}, cssClassMap) : cssClassMap;
|
|
};
|
|
|
|
const getClassList = classes => {
|
|
if (classes !== undefined) {
|
|
const array = Array.isArray(classes) ? classes : classes.split(' ');
|
|
return array.filter(c => c != null).map(c => c.trim()).filter(c => c !== '');
|
|
}
|
|
|
|
return [];
|
|
};
|
|
|
|
const getClassMap = classes => {
|
|
const map = {};
|
|
getClassList(classes).forEach(c => map[c] = true);
|
|
return map;
|
|
};
|
|
|
|
const SCHEME = /^[a-z][a-z0-9+\-.]*:/;
|
|
|
|
const openURL = /*#__PURE__*/function () {
|
|
var _ref = (0,_Volumes_case_workspace_work_APPS_KA_APP_WORK_NOW_KA_PASS_V2_2_6_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* (url, ev, direction, animation) {
|
|
if (url != null && url[0] !== '#' && !SCHEME.test(url)) {
|
|
const router = document.querySelector('ion-router');
|
|
|
|
if (router) {
|
|
if (ev != null) {
|
|
ev.preventDefault();
|
|
}
|
|
|
|
return router.push(url, direction, animation);
|
|
}
|
|
}
|
|
|
|
return false;
|
|
});
|
|
|
|
return function openURL(_x, _x2, _x3, _x4) {
|
|
return _ref.apply(this, arguments);
|
|
};
|
|
}();
|
|
|
|
|
|
|
|
/***/ })
|
|
|
|
}])
|
|
//# sourceMappingURL=5473.js.map
|