aiber-test/www/27-es2015.js.map
2020-12-18 09:30:04 +00:00

1 line
13 KiB
Plaintext

{"version":3,"sources":["./node_modules/@ionic/core/dist/esm/ion-reorder_2.entry.js"],"names":[],"mappings":";;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA6G;AAChD;AAC0D;;AAEvH,qCAAqC,aAAa,cAAc,YAAY,cAAc,cAAc,eAAe,cAAc,eAAe,YAAY;;AAEhK,oCAAoC,aAAa,cAAc,YAAY,cAAc,cAAc,eAAe,cAAc,eAAe,YAAY;;AAE/J;AACA;AACA,IAAI,4DAAgB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,mEAAU;AAC3B;AACA,YAAY,4DAAC,CAAC,oDAAI,GAAG,cAAc,EAAE,4DAAC,eAAe,4DAAC,cAAc,sEAAsE;AAC1I;AACA,YAAY,QAAQ,4DAAU,OAAO;AACrC;AACA;AACA;AACA;AACA;;AAEA,gDAAgD,2CAA2C,mCAAmC,2BAA2B,oDAAoD,sBAAsB,iBAAiB,yBAAyB,sBAAsB,qBAAqB,iBAAiB,6BAA6B,cAAc,oBAAoB,YAAY,mBAAmB,sBAAsB,kBAAkB,gDAAgD,wBAAwB,gBAAgB,kBAAkB,kBAAkB,mCAAmC,2BAA2B,+CAA+C,uCAAuC,YAAY,YAAY,2CAA2C,yCAAyC,iCAAiC;;AAE52B;AACA;AACA,IAAI,4DAAgB;AACpB,0BAA0B,4DAAW;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,yJAA6B;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,qBAAqB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,6DAAoB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,6DAAsB;AAC5B;AACA;AACA;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,IAAI,6DAAkB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,SAAS;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,qBAAqB;AACxC;AACA;AACA;AACA,8BAA8B,YAAY;AAC1C;AACA;AACA,8BAA8B,WAAW;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,mEAAU;AAC3B,YAAY,4DAAC,CAAC,oDAAI,GAAG;AACrB;AACA;AACA;AACA,OAAO,EAAE;AACT;AACA,YAAY,QAAQ,4DAAU,OAAO;AACrC,yBAAyB;AACzB;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEqE","file":"27-es2015.js","sourcesContent":["import { r as registerInstance, h, H as Host, i as getElement, e as createEvent } from './index-e806d1f6.js';\nimport { b as getIonMode } from './ionic-global-9d5c8ee3.js';\nimport { a as hapticSelectionStart, b as hapticSelectionChanged, h as hapticSelectionEnd } from './haptic-27b3f981.js';\n\nconst reorderIosCss = \":host([slot]){display:none;line-height:0;z-index:100}.reorder-icon{display:block;font-size:22px}.reorder-icon{font-size:34px;opacity:0.4}\";\n\nconst reorderMdCss = \":host([slot]){display:none;line-height:0;z-index:100}.reorder-icon{display:block;font-size:22px}.reorder-icon{font-size:31px;opacity:0.3}\";\n\nconst Reorder = class {\n constructor(hostRef) {\n registerInstance(this, hostRef);\n }\n onClick(ev) {\n const reorderGroup = this.el.closest('ion-reorder-group');\n ev.preventDefault();\n // Only stop event propagation if the reorder is inside of an enabled\n // reorder group. This allows interaction with clickable children components.\n if (!reorderGroup || !reorderGroup.disabled) {\n ev.stopImmediatePropagation();\n }\n }\n render() {\n const mode = getIonMode(this);\n const reorderIcon = mode === 'ios' ? 'reorder-three-outline' : 'reorder-two-sharp';\n return (h(Host, { class: mode }, h(\"slot\", null, h(\"ion-icon\", { name: reorderIcon, lazy: false, class: \"reorder-icon\", part: \"icon\" }))));\n }\n get el() { return getElement(this); }\n};\nReorder.style = {\n ios: reorderIosCss,\n md: reorderMdCss\n};\n\nconst reorderGroupCss = \".reorder-list-active>*{-webkit-transition:-webkit-transform 300ms;transition:-webkit-transform 300ms;transition:transform 300ms;transition:transform 300ms, -webkit-transform 300ms;will-change:transform}.reorder-enabled{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.reorder-enabled ion-reorder{display:block;cursor:-webkit-grab;cursor:grab;pointer-events:all;-ms-touch-action:none;touch-action:none}.reorder-selected,.reorder-selected ion-reorder{cursor:-webkit-grabbing;cursor:grabbing}.reorder-selected{position:relative;-webkit-transition:none !important;transition:none !important;-webkit-box-shadow:0 0 10px rgba(0, 0, 0, 0.4);box-shadow:0 0 10px rgba(0, 0, 0, 0.4);opacity:0.8;z-index:100}.reorder-visible ion-reorder .reorder-icon{-webkit-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0)}\";\n\nconst ReorderGroup = class {\n constructor(hostRef) {\n registerInstance(this, hostRef);\n this.ionItemReorder = createEvent(this, \"ionItemReorder\", 7);\n this.lastToIndex = -1;\n this.cachedHeights = [];\n this.scrollElTop = 0;\n this.scrollElBottom = 0;\n this.scrollElInitial = 0;\n this.containerTop = 0;\n this.containerBottom = 0;\n this.state = 0 /* Idle */;\n /**\n * If `true`, the reorder will be hidden.\n */\n this.disabled = true;\n }\n disabledChanged() {\n if (this.gesture) {\n this.gesture.enable(!this.disabled);\n }\n }\n async connectedCallback() {\n const contentEl = this.el.closest('ion-content');\n if (contentEl) {\n this.scrollEl = await contentEl.getScrollElement();\n }\n this.gesture = (await import('./index-f49d994d.js')).createGesture({\n el: this.el,\n gestureName: 'reorder',\n gesturePriority: 110,\n threshold: 0,\n direction: 'y',\n passive: false,\n canStart: detail => this.canStart(detail),\n onStart: ev => this.onStart(ev),\n onMove: ev => this.onMove(ev),\n onEnd: () => this.onEnd(),\n });\n this.disabledChanged();\n }\n disconnectedCallback() {\n this.onEnd();\n if (this.gesture) {\n this.gesture.destroy();\n this.gesture = undefined;\n }\n }\n /**\n * Completes the reorder operation. Must be called by the `ionItemReorder` event.\n *\n * If a list of items is passed, the list will be reordered and returned in the\n * proper order.\n *\n * If no parameters are passed or if `true` is passed in, the reorder will complete\n * and the item will remain in the position it was dragged to. If `false` is passed,\n * the reorder will complete and the item will bounce back to its original position.\n *\n * @param listOrReorder A list of items to be sorted and returned in the new order or a\n * boolean of whether or not the reorder should reposition the item.\n */\n complete(listOrReorder) {\n return Promise.resolve(this.completeSync(listOrReorder));\n }\n canStart(ev) {\n if (this.selectedItemEl || this.state !== 0 /* Idle */) {\n return false;\n }\n const target = ev.event.target;\n const reorderEl = target.closest('ion-reorder');\n if (!reorderEl) {\n return false;\n }\n const item = findReorderItem(reorderEl, this.el);\n if (!item) {\n return false;\n }\n ev.data = item;\n return true;\n }\n onStart(ev) {\n ev.event.preventDefault();\n const item = this.selectedItemEl = ev.data;\n const heights = this.cachedHeights;\n heights.length = 0;\n const el = this.el;\n const children = el.children;\n if (!children || children.length === 0) {\n return;\n }\n let sum = 0;\n for (let i = 0; i < children.length; i++) {\n const child = children[i];\n sum += child.offsetHeight;\n heights.push(sum);\n child.$ionIndex = i;\n }\n const box = el.getBoundingClientRect();\n this.containerTop = box.top;\n this.containerBottom = box.bottom;\n if (this.scrollEl) {\n const scrollBox = this.scrollEl.getBoundingClientRect();\n this.scrollElInitial = this.scrollEl.scrollTop;\n this.scrollElTop = scrollBox.top + AUTO_SCROLL_MARGIN;\n this.scrollElBottom = scrollBox.bottom - AUTO_SCROLL_MARGIN;\n }\n else {\n this.scrollElInitial = 0;\n this.scrollElTop = 0;\n this.scrollElBottom = 0;\n }\n this.lastToIndex = indexForItem(item);\n this.selectedItemHeight = item.offsetHeight;\n this.state = 1 /* Active */;\n item.classList.add(ITEM_REORDER_SELECTED);\n hapticSelectionStart();\n }\n onMove(ev) {\n const selectedItem = this.selectedItemEl;\n if (!selectedItem) {\n return;\n }\n // Scroll if we reach the scroll margins\n const scroll = this.autoscroll(ev.currentY);\n // // Get coordinate\n const top = this.containerTop - scroll;\n const bottom = this.containerBottom - scroll;\n const currentY = Math.max(top, Math.min(ev.currentY, bottom));\n const deltaY = scroll + currentY - ev.startY;\n const normalizedY = currentY - top;\n const toIndex = this.itemIndexForTop(normalizedY);\n if (toIndex !== this.lastToIndex) {\n const fromIndex = indexForItem(selectedItem);\n this.lastToIndex = toIndex;\n hapticSelectionChanged();\n this.reorderMove(fromIndex, toIndex);\n }\n // Update selected item position\n selectedItem.style.transform = `translateY(${deltaY}px)`;\n }\n onEnd() {\n const selectedItemEl = this.selectedItemEl;\n this.state = 2 /* Complete */;\n if (!selectedItemEl) {\n this.state = 0 /* Idle */;\n return;\n }\n const toIndex = this.lastToIndex;\n const fromIndex = indexForItem(selectedItemEl);\n if (toIndex === fromIndex) {\n this.completeSync();\n }\n else {\n this.ionItemReorder.emit({\n from: fromIndex,\n to: toIndex,\n complete: this.completeSync.bind(this)\n });\n }\n hapticSelectionEnd();\n }\n completeSync(listOrReorder) {\n const selectedItemEl = this.selectedItemEl;\n if (selectedItemEl && this.state === 2 /* Complete */) {\n const children = this.el.children;\n const len = children.length;\n const toIndex = this.lastToIndex;\n const fromIndex = indexForItem(selectedItemEl);\n if (toIndex !== fromIndex && (listOrReorder === undefined || listOrReorder === true)) {\n const ref = (fromIndex < toIndex)\n ? children[toIndex + 1]\n : children[toIndex];\n this.el.insertBefore(selectedItemEl, ref);\n }\n if (Array.isArray(listOrReorder)) {\n listOrReorder = reorderArray(listOrReorder, fromIndex, toIndex);\n }\n for (let i = 0; i < len; i++) {\n children[i].style['transform'] = '';\n }\n selectedItemEl.style.transition = '';\n selectedItemEl.classList.remove(ITEM_REORDER_SELECTED);\n this.selectedItemEl = undefined;\n this.state = 0 /* Idle */;\n }\n return listOrReorder;\n }\n itemIndexForTop(deltaY) {\n const heights = this.cachedHeights;\n let i = 0;\n // TODO: since heights is a sorted array of integers, we can do\n // speed up the search using binary search. Remember that linear-search is still\n // faster than binary-search for small arrays (<64) due CPU branch misprediction.\n for (i = 0; i < heights.length; i++) {\n if (heights[i] > deltaY) {\n break;\n }\n }\n return i;\n }\n /********* DOM WRITE ********* */\n reorderMove(fromIndex, toIndex) {\n const itemHeight = this.selectedItemHeight;\n const children = this.el.children;\n for (let i = 0; i < children.length; i++) {\n const style = children[i].style;\n let value = '';\n if (i > fromIndex && i <= toIndex) {\n value = `translateY(${-itemHeight}px)`;\n }\n else if (i < fromIndex && i >= toIndex) {\n value = `translateY(${itemHeight}px)`;\n }\n style['transform'] = value;\n }\n }\n autoscroll(posY) {\n if (!this.scrollEl) {\n return 0;\n }\n let amount = 0;\n if (posY < this.scrollElTop) {\n amount = -SCROLL_JUMP;\n }\n else if (posY > this.scrollElBottom) {\n amount = SCROLL_JUMP;\n }\n if (amount !== 0) {\n this.scrollEl.scrollBy(0, amount);\n }\n return this.scrollEl.scrollTop - this.scrollElInitial;\n }\n render() {\n const mode = getIonMode(this);\n return (h(Host, { class: {\n [mode]: true,\n 'reorder-enabled': !this.disabled,\n 'reorder-list-active': this.state !== 0 /* Idle */,\n } }));\n }\n get el() { return getElement(this); }\n static get watchers() { return {\n \"disabled\": [\"disabledChanged\"]\n }; }\n};\nconst indexForItem = (element) => {\n return element['$ionIndex'];\n};\nconst findReorderItem = (node, container) => {\n let parent;\n while (node) {\n parent = node.parentElement;\n if (parent === container) {\n return node;\n }\n node = parent;\n }\n return undefined;\n};\nconst AUTO_SCROLL_MARGIN = 60;\nconst SCROLL_JUMP = 10;\nconst ITEM_REORDER_SELECTED = 'reorder-selected';\nconst reorderArray = (array, from, to) => {\n const element = array[from];\n array.splice(from, 1);\n array.splice(to, 0, element);\n return array.slice();\n};\nReorderGroup.style = reorderGroupCss;\n\nexport { Reorder as ion_reorder, ReorderGroup as ion_reorder_group };\n"],"sourceRoot":"webpack:///"}