-
Notifications
You must be signed in to change notification settings - Fork 0
/
27-es5.js.map
1 lines (1 loc) · 21.2 KB
/
27-es5.js.map
1
{"version":3,"sources":["webpack:///node_modules/@ionic/core/dist/esm/ion-reorder_2.entry.js"],"names":["reorderIosCss","reorderMdCss","Reorder","hostRef","ev","reorderGroup","el","closest","preventDefault","disabled","stopImmediatePropagation","mode","reorderIcon","name","lazy","part","style","ios","md","reorderGroupCss","ReorderGroup","ionItemReorder","lastToIndex","cachedHeights","scrollElTop","scrollElBottom","scrollElInitial","containerTop","containerBottom","state","gesture","enable","contentEl","getScrollElement","scrollEl","createGesture","gestureName","gesturePriority","threshold","direction","passive","canStart","detail","onStart","onMove","onEnd","disabledChanged","destroy","undefined","listOrReorder","Promise","resolve","completeSync","selectedItemEl","target","event","reorderEl","item","findReorderItem","data","heights","length","children","sum","i","child","offsetHeight","push","$ionIndex","box","getBoundingClientRect","top","bottom","scrollBox","scrollTop","AUTO_SCROLL_MARGIN","indexForItem","selectedItemHeight","classList","add","ITEM_REORDER_SELECTED","selectedItem","scroll","autoscroll","currentY","Math","max","min","deltaY","startY","normalizedY","toIndex","itemIndexForTop","fromIndex","reorderMove","transform","emit","from","to","complete","bind","len","ref","insertBefore","Array","isArray","reorderArray","transition","remove","itemHeight","value","posY","amount","SCROLL_JUMP","scrollBy","element","node","container","parent","parentElement","array","splice","slice"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;;;AAAA;AAAA;AAAA;AAAA;;;AAAA;AAAA;AAAA;AAAA;;;AAAA;AAAA;AAAA;AAAA;;;AAAA;AAAA;AAAA;AAAA;;;AAAA;AAAA;AAAA;;AAIA,UAAMA,aAAa,GAAG,2IAAtB;AAEA,UAAMC,YAAY,GAAG,2IAArB;;AAEA,UAAMC,OAAO;AACX,yBAAYC,OAAZ,EAAqB;AAAA;;AACnB,uEAAiB,IAAjB,EAAuBA,OAAvB;AACD;;AAHU;AAAA;AAAA,kCAIHC,EAJG,EAIC;AACV,gBAA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,cAAID,MAAM,KAAKD,SAAf,EAA0B;AACxB,mBAAOD,IAAP;AACD;;AACDA,cAAI,GAAGE,MAAP;AACD;;AACD,eAAOtE,SAAP;AACD,OAVD;;AAWA,UAAM2B,kBAAkB,GAAG,EAA3B;AACA,UAAMsC,WAAW,GAAG,EAApB;AACA,UAAMjC,qBAAqB,GAAG,kBAA9B;;AACA,UAAM0B,YAAY,GAAG,SAAfA,YAAe,CAACc,KAAD,EAAQvB,IAAR,EAAcC,EAAd,EAAqB;AACxC,YAAMiB,OAAO,GAAGK,KAAK,CAACvB,IAAD,CAArB;AACAuB,aAAK,CAACC,MAAN,CAAaxB,IAAb,EAAmB,CAAnB;AACAuB,aAAK,CAACC,MAAN,CAAavB,EAAb,EAAiB,CAAjB,EAAoBiB,OAApB;AACA,eAAOK,KAAK,CAACE,KAAN,EAAP;AACD,OALD;;AAMAtG,kBAAY,CAACJ,KAAb,GAAqBG,eAArB","file":"27-es5.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"]}