bitboss-ui 2.0.13 → 2.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index107.js +5 -5
- package/dist/index115.js +1 -1
- package/dist/index117.js +3 -3
- package/dist/index119.js +1 -1
- package/dist/index123.js +1 -1
- package/dist/index125.js +1 -1
- package/dist/index127.js +1 -1
- package/dist/index129.js +2 -2
- package/dist/index130.js +1 -1
- package/dist/index14.js +1 -1
- package/dist/index16.js +3 -3
- package/dist/index18.js +2 -2
- package/dist/index199.js +2 -81
- package/dist/index199.js.map +1 -1
- package/dist/index20.js +14 -14
- package/dist/index200.js +158 -2
- package/dist/index200.js.map +1 -1
- package/dist/index201.js +84 -4
- package/dist/index201.js.map +1 -1
- package/dist/index203.js +5 -2
- package/dist/index203.js.map +1 -1
- package/dist/index204.js +16 -5
- package/dist/index204.js.map +1 -1
- package/dist/index205.js +10 -10
- package/dist/index205.js.map +1 -1
- package/dist/index206.js +18 -15
- package/dist/index206.js.map +1 -1
- package/dist/index207.js +18 -18
- package/dist/index207.js.map +1 -1
- package/dist/index208.js +22 -14
- package/dist/index208.js.map +1 -1
- package/dist/index209.js +3 -27
- package/dist/index209.js.map +1 -1
- package/dist/index210.js +2 -3
- package/dist/index210.js.map +1 -1
- package/dist/index211.js +8 -2
- package/dist/index211.js.map +1 -1
- package/dist/index212.js +247 -6
- package/dist/index212.js.map +1 -1
- package/dist/index213.js +42 -239
- package/dist/index213.js.map +1 -1
- package/dist/index214.js +35 -43
- package/dist/index214.js.map +1 -1
- package/dist/index215.js +5 -44
- package/dist/index215.js.map +1 -1
- package/dist/index216.js +49 -5
- package/dist/index216.js.map +1 -1
- package/dist/index217.js +80 -48
- package/dist/index217.js.map +1 -1
- package/dist/index218.js +1 -1
- package/dist/index219.js +2 -2
- package/dist/index22.js +13 -13
- package/dist/index222.js +2 -44
- package/dist/index222.js.map +1 -1
- package/dist/index223.js +7 -0
- package/dist/index223.js.map +1 -0
- package/dist/index224.js +2 -13
- package/dist/index224.js.map +1 -1
- package/dist/index225.js +43 -125
- package/dist/index225.js.map +1 -1
- package/dist/index227.js +13 -2
- package/dist/index227.js.map +1 -1
- package/dist/index228.js +3 -174
- package/dist/index228.js.map +1 -1
- package/dist/index229.js +126 -5
- package/dist/index229.js.map +1 -1
- package/dist/index230.js +120 -366
- package/dist/index230.js.map +1 -1
- package/dist/index231.js +2 -158
- package/dist/index231.js.map +1 -1
- package/dist/index232.js +174 -84
- package/dist/index232.js.map +1 -1
- package/dist/index233.js +8 -0
- package/dist/index233.js.map +1 -0
- package/dist/index234.js +369 -3
- package/dist/index234.js.map +1 -1
- package/dist/index235.js +2 -106
- package/dist/index235.js.map +1 -1
- package/dist/{index240.js → index236.js} +1 -1
- package/dist/{index240.js.map → index236.js.map} +1 -1
- package/dist/index237.js +53 -47
- package/dist/index237.js.map +1 -1
- package/dist/index239.js +100 -2
- package/dist/index239.js.map +1 -1
- package/dist/index24.js +1 -1
- package/dist/index244.js +3 -4
- package/dist/index244.js.map +1 -1
- package/dist/index245.js +9 -3
- package/dist/index245.js.map +1 -1
- package/dist/index246.js +23 -9
- package/dist/index246.js.map +1 -1
- package/dist/index247.js +6 -23
- package/dist/index247.js.map +1 -1
- package/dist/index248.js +16 -281
- package/dist/index248.js.map +1 -1
- package/dist/index249.js +3 -6
- package/dist/index249.js.map +1 -1
- package/dist/index250.js +12 -2
- package/dist/index250.js.map +1 -1
- package/dist/index251.js +9 -2
- package/dist/index251.js.map +1 -1
- package/dist/index252.js +9 -2
- package/dist/index252.js.map +1 -1
- package/dist/index253.js +17 -2
- package/dist/index253.js.map +1 -1
- package/dist/index254.js +9 -2
- package/dist/index254.js.map +1 -1
- package/dist/index255.js +281 -2
- package/dist/index255.js.map +1 -1
- package/dist/index256.js +6 -2
- package/dist/index256.js.map +1 -1
- package/dist/index257.js +2 -2
- package/dist/index258.js +2 -2
- package/dist/index259.js +2 -2
- package/dist/index26.js +1 -1
- package/dist/index260.js +2 -28
- package/dist/index260.js.map +1 -1
- package/dist/index261.js +2 -22
- package/dist/index261.js.map +1 -1
- package/dist/index262.js +5 -0
- package/dist/index262.js.map +1 -0
- package/dist/index263.js +2 -7
- package/dist/index263.js.map +1 -1
- package/dist/index264.js +1 -5
- package/dist/index264.js.map +1 -1
- package/dist/index265.js +2 -16
- package/dist/index265.js.map +1 -1
- package/dist/index266.js +2 -9
- package/dist/index266.js.map +1 -1
- package/dist/index267.js +24 -427
- package/dist/index267.js.map +1 -1
- package/dist/index268.js +22 -89
- package/dist/index268.js.map +1 -1
- package/dist/index270.js +7 -3
- package/dist/index270.js.map +1 -1
- package/dist/index271.js +434 -0
- package/dist/index271.js.map +1 -0
- package/dist/index272.js +89 -2
- package/dist/index272.js.map +1 -1
- package/dist/index273.js +67 -7
- package/dist/index273.js.map +1 -1
- package/dist/index274.js +4 -2
- package/dist/index274.js.map +1 -1
- package/dist/index275.js +2 -126
- package/dist/index275.js.map +1 -1
- package/dist/index276.js +5 -22
- package/dist/index276.js.map +1 -1
- package/dist/{index269.js → index277.js} +1 -1
- package/dist/{index269.js.map → index277.js.map} +1 -1
- package/dist/index278.js +1 -1
- package/dist/index28.js +3 -3
- package/dist/index280.js +223 -8
- package/dist/index280.js.map +1 -1
- package/dist/index281.js +2 -17
- package/dist/index281.js.map +1 -1
- package/dist/index282.js +120 -218
- package/dist/index282.js.map +1 -1
- package/dist/index283.js +21 -435
- package/dist/index283.js.map +1 -1
- package/dist/index285.js +434 -67
- package/dist/index285.js.map +1 -1
- package/dist/index286.js +127 -5
- package/dist/index286.js.map +1 -1
- package/dist/index287.js +1 -1
- package/dist/index288.js +1 -1
- package/dist/index289.js +2 -2
- package/dist/index290.js +79 -15
- package/dist/index290.js.map +1 -1
- package/dist/index292.js +4 -4
- package/dist/index292.js.map +1 -1
- package/dist/index293.js +4 -59
- package/dist/index293.js.map +1 -1
- package/dist/index294.js +57 -77
- package/dist/index294.js.map +1 -1
- package/dist/index295.js +18 -0
- package/dist/index295.js.map +1 -0
- package/dist/index296.js +10 -6
- package/dist/index296.js.map +1 -1
- package/dist/index299.js +6 -34
- package/dist/index299.js.map +1 -1
- package/dist/index30.js +2 -2
- package/dist/index300.js +2 -47
- package/dist/index300.js.map +1 -1
- package/dist/index301.js +35 -2
- package/dist/index301.js.map +1 -1
- package/dist/index302.js +46 -10
- package/dist/index302.js.map +1 -1
- package/dist/index303.js +1 -1
- package/dist/index32.js +2 -2
- package/dist/index34.js +3 -3
- package/dist/index36.js +12 -12
- package/dist/index38.js +3 -3
- package/dist/index40.js +2 -2
- package/dist/index42.js +2 -2
- package/dist/index44.js +6 -6
- package/dist/index46.js +2 -2
- package/dist/index48.js +2 -2
- package/dist/index54.js +1 -1
- package/dist/index56.js +1 -1
- package/dist/index72.js +21 -21
- package/dist/index72.js.map +1 -1
- package/dist/index76.js +2 -2
- package/dist/index83.js +1 -1
- package/dist/index85.js +1 -1
- package/dist/index87.js +1 -1
- package/package.json +2 -2
- package/dist/index202.js +0 -5
- package/dist/index202.js.map +0 -1
- package/dist/index226.js +0 -126
- package/dist/index226.js.map +0 -1
- package/dist/index279.js +0 -15
- package/dist/index279.js.map +0 -1
- package/dist/index284.js +0 -130
- package/dist/index284.js.map +0 -1
- package/dist/index291.js +0 -7
- package/dist/index291.js.map +0 -1
package/dist/index230.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index230.js","sources":["../node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs"],"sourcesContent":["import { rectToClientRect, detectOverflow as detectOverflow$1, offset as offset$1, autoPlacement as autoPlacement$1, shift as shift$1, flip as flip$1, size as size$1, hide as hide$1, arrow as arrow$1, inline as inline$1, limitShift as limitShift$1, computePosition as computePosition$1 } from '@floating-ui/core';\nimport { round, createCoords, max, min, floor } from '@floating-ui/utils';\nimport { getComputedStyle, isHTMLElement, isElement, getWindow, isWebKit, getFrameElement, getDocumentElement, isTopLayer, getNodeName, isOverflowElement, getNodeScroll, getOverflowAncestors, getParentNode, isLastTraversableNode, isContainingBlock, isTableElement, getContainingBlock } from '@floating-ui/utils/dom';\nexport { getOverflowAncestors } from '@floating-ui/utils/dom';\n\nfunction getCssDimensions(element) {\n const css = getComputedStyle(element);\n // In testing environments, the `width` and `height` properties are empty\n // strings for SVG elements, returning NaN. Fallback to `0` in this case.\n let width = parseFloat(css.width) || 0;\n let height = parseFloat(css.height) || 0;\n const hasOffset = isHTMLElement(element);\n const offsetWidth = hasOffset ? element.offsetWidth : width;\n const offsetHeight = hasOffset ? element.offsetHeight : height;\n const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;\n if (shouldFallback) {\n width = offsetWidth;\n height = offsetHeight;\n }\n return {\n width,\n height,\n $: shouldFallback\n };\n}\n\nfunction unwrapElement(element) {\n return !isElement(element) ? element.contextElement : element;\n}\n\nfunction getScale(element) {\n const domElement = unwrapElement(element);\n if (!isHTMLElement(domElement)) {\n return createCoords(1);\n }\n const rect = domElement.getBoundingClientRect();\n const {\n width,\n height,\n $\n } = getCssDimensions(domElement);\n let x = ($ ? round(rect.width) : rect.width) / width;\n let y = ($ ? round(rect.height) : rect.height) / height;\n\n // 0, NaN, or Infinity should always fallback to 1.\n\n if (!x || !Number.isFinite(x)) {\n x = 1;\n }\n if (!y || !Number.isFinite(y)) {\n y = 1;\n }\n return {\n x,\n y\n };\n}\n\nconst noOffsets = /*#__PURE__*/createCoords(0);\nfunction getVisualOffsets(element) {\n const win = getWindow(element);\n if (!isWebKit() || !win.visualViewport) {\n return noOffsets;\n }\n return {\n x: win.visualViewport.offsetLeft,\n y: win.visualViewport.offsetTop\n };\n}\nfunction shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {\n if (isFixed === void 0) {\n isFixed = false;\n }\n if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {\n return false;\n }\n return isFixed;\n}\n\nfunction getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {\n if (includeScale === void 0) {\n includeScale = false;\n }\n if (isFixedStrategy === void 0) {\n isFixedStrategy = false;\n }\n const clientRect = element.getBoundingClientRect();\n const domElement = unwrapElement(element);\n let scale = createCoords(1);\n if (includeScale) {\n if (offsetParent) {\n if (isElement(offsetParent)) {\n scale = getScale(offsetParent);\n }\n } else {\n scale = getScale(element);\n }\n }\n const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);\n let x = (clientRect.left + visualOffsets.x) / scale.x;\n let y = (clientRect.top + visualOffsets.y) / scale.y;\n let width = clientRect.width / scale.x;\n let height = clientRect.height / scale.y;\n if (domElement) {\n const win = getWindow(domElement);\n const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;\n let currentWin = win;\n let currentIFrame = getFrameElement(currentWin);\n while (currentIFrame && offsetParent && offsetWin !== currentWin) {\n const iframeScale = getScale(currentIFrame);\n const iframeRect = currentIFrame.getBoundingClientRect();\n const css = getComputedStyle(currentIFrame);\n const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;\n const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;\n x *= iframeScale.x;\n y *= iframeScale.y;\n width *= iframeScale.x;\n height *= iframeScale.y;\n x += left;\n y += top;\n currentWin = getWindow(currentIFrame);\n currentIFrame = getFrameElement(currentWin);\n }\n }\n return rectToClientRect({\n width,\n height,\n x,\n y\n });\n}\n\nfunction convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {\n let {\n elements,\n rect,\n offsetParent,\n strategy\n } = _ref;\n const isFixed = strategy === 'fixed';\n const documentElement = getDocumentElement(offsetParent);\n const topLayer = elements ? isTopLayer(elements.floating) : false;\n if (offsetParent === documentElement || topLayer && isFixed) {\n return rect;\n }\n let scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n let scale = createCoords(1);\n const offsets = createCoords(0);\n const isOffsetParentAnElement = isHTMLElement(offsetParent);\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n if (isHTMLElement(offsetParent)) {\n const offsetRect = getBoundingClientRect(offsetParent);\n scale = getScale(offsetParent);\n offsets.x = offsetRect.x + offsetParent.clientLeft;\n offsets.y = offsetRect.y + offsetParent.clientTop;\n }\n }\n return {\n width: rect.width * scale.x,\n height: rect.height * scale.y,\n x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x,\n y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y\n };\n}\n\nfunction getClientRects(element) {\n return Array.from(element.getClientRects());\n}\n\nfunction getWindowScrollBarX(element) {\n // If <html> has a CSS width greater than the viewport, then this will be\n // incorrect for RTL.\n return getBoundingClientRect(getDocumentElement(element)).left + getNodeScroll(element).scrollLeft;\n}\n\n// Gets the entire size of the scrollable document area, even extending outside\n// of the `<html>` and `<body>` rect bounds if horizontally scrollable.\nfunction getDocumentRect(element) {\n const html = getDocumentElement(element);\n const scroll = getNodeScroll(element);\n const body = element.ownerDocument.body;\n const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);\n const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);\n let x = -scroll.scrollLeft + getWindowScrollBarX(element);\n const y = -scroll.scrollTop;\n if (getComputedStyle(body).direction === 'rtl') {\n x += max(html.clientWidth, body.clientWidth) - width;\n }\n return {\n width,\n height,\n x,\n y\n };\n}\n\nfunction getViewportRect(element, strategy) {\n const win = getWindow(element);\n const html = getDocumentElement(element);\n const visualViewport = win.visualViewport;\n let width = html.clientWidth;\n let height = html.clientHeight;\n let x = 0;\n let y = 0;\n if (visualViewport) {\n width = visualViewport.width;\n height = visualViewport.height;\n const visualViewportBased = isWebKit();\n if (!visualViewportBased || visualViewportBased && strategy === 'fixed') {\n x = visualViewport.offsetLeft;\n y = visualViewport.offsetTop;\n }\n }\n return {\n width,\n height,\n x,\n y\n };\n}\n\n// Returns the inner client rect, subtracting scrollbars if present.\nfunction getInnerBoundingClientRect(element, strategy) {\n const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');\n const top = clientRect.top + element.clientTop;\n const left = clientRect.left + element.clientLeft;\n const scale = isHTMLElement(element) ? getScale(element) : createCoords(1);\n const width = element.clientWidth * scale.x;\n const height = element.clientHeight * scale.y;\n const x = left * scale.x;\n const y = top * scale.y;\n return {\n width,\n height,\n x,\n y\n };\n}\nfunction getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {\n let rect;\n if (clippingAncestor === 'viewport') {\n rect = getViewportRect(element, strategy);\n } else if (clippingAncestor === 'document') {\n rect = getDocumentRect(getDocumentElement(element));\n } else if (isElement(clippingAncestor)) {\n rect = getInnerBoundingClientRect(clippingAncestor, strategy);\n } else {\n const visualOffsets = getVisualOffsets(element);\n rect = {\n ...clippingAncestor,\n x: clippingAncestor.x - visualOffsets.x,\n y: clippingAncestor.y - visualOffsets.y\n };\n }\n return rectToClientRect(rect);\n}\nfunction hasFixedPositionAncestor(element, stopNode) {\n const parentNode = getParentNode(element);\n if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {\n return false;\n }\n return getComputedStyle(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);\n}\n\n// A \"clipping ancestor\" is an `overflow` element with the characteristic of\n// clipping (or hiding) child elements. This returns all clipping ancestors\n// of the given element up the tree.\nfunction getClippingElementAncestors(element, cache) {\n const cachedResult = cache.get(element);\n if (cachedResult) {\n return cachedResult;\n }\n let result = getOverflowAncestors(element, [], false).filter(el => isElement(el) && getNodeName(el) !== 'body');\n let currentContainingBlockComputedStyle = null;\n const elementIsFixed = getComputedStyle(element).position === 'fixed';\n let currentNode = elementIsFixed ? getParentNode(element) : element;\n\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {\n const computedStyle = getComputedStyle(currentNode);\n const currentNodeIsContaining = isContainingBlock(currentNode);\n if (!currentNodeIsContaining && computedStyle.position === 'fixed') {\n currentContainingBlockComputedStyle = null;\n }\n const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && ['absolute', 'fixed'].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);\n if (shouldDropCurrentNode) {\n // Drop non-containing blocks.\n result = result.filter(ancestor => ancestor !== currentNode);\n } else {\n // Record last containing block for next iteration.\n currentContainingBlockComputedStyle = computedStyle;\n }\n currentNode = getParentNode(currentNode);\n }\n cache.set(element, result);\n return result;\n}\n\n// Gets the maximum area that the element is visible in due to any number of\n// clipping ancestors.\nfunction getClippingRect(_ref) {\n let {\n element,\n boundary,\n rootBoundary,\n strategy\n } = _ref;\n const elementClippingAncestors = boundary === 'clippingAncestors' ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);\n const clippingAncestors = [...elementClippingAncestors, rootBoundary];\n const firstClippingAncestor = clippingAncestors[0];\n const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {\n const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);\n accRect.top = max(rect.top, accRect.top);\n accRect.right = min(rect.right, accRect.right);\n accRect.bottom = min(rect.bottom, accRect.bottom);\n accRect.left = max(rect.left, accRect.left);\n return accRect;\n }, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));\n return {\n width: clippingRect.right - clippingRect.left,\n height: clippingRect.bottom - clippingRect.top,\n x: clippingRect.left,\n y: clippingRect.top\n };\n}\n\nfunction getDimensions(element) {\n const {\n width,\n height\n } = getCssDimensions(element);\n return {\n width,\n height\n };\n}\n\nfunction getRectRelativeToOffsetParent(element, offsetParent, strategy) {\n const isOffsetParentAnElement = isHTMLElement(offsetParent);\n const documentElement = getDocumentElement(offsetParent);\n const isFixed = strategy === 'fixed';\n const rect = getBoundingClientRect(element, true, isFixed, offsetParent);\n let scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n const offsets = createCoords(0);\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n if (isOffsetParentAnElement) {\n const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);\n offsets.x = offsetRect.x + offsetParent.clientLeft;\n offsets.y = offsetRect.y + offsetParent.clientTop;\n } else if (documentElement) {\n offsets.x = getWindowScrollBarX(documentElement);\n }\n }\n const x = rect.left + scroll.scrollLeft - offsets.x;\n const y = rect.top + scroll.scrollTop - offsets.y;\n return {\n x,\n y,\n width: rect.width,\n height: rect.height\n };\n}\n\nfunction isStaticPositioned(element) {\n return getComputedStyle(element).position === 'static';\n}\n\nfunction getTrueOffsetParent(element, polyfill) {\n if (!isHTMLElement(element) || getComputedStyle(element).position === 'fixed') {\n return null;\n }\n if (polyfill) {\n return polyfill(element);\n }\n return element.offsetParent;\n}\n\n// Gets the closest ancestor positioned element. Handles some edge cases,\n// such as table ancestors and cross browser bugs.\nfunction getOffsetParent(element, polyfill) {\n const win = getWindow(element);\n if (isTopLayer(element)) {\n return win;\n }\n if (!isHTMLElement(element)) {\n let svgOffsetParent = getParentNode(element);\n while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {\n if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {\n return svgOffsetParent;\n }\n svgOffsetParent = getParentNode(svgOffsetParent);\n }\n return win;\n }\n let offsetParent = getTrueOffsetParent(element, polyfill);\n while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) {\n offsetParent = getTrueOffsetParent(offsetParent, polyfill);\n }\n if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) {\n return win;\n }\n return offsetParent || getContainingBlock(element) || win;\n}\n\nconst getElementRects = async function (data) {\n const getOffsetParentFn = this.getOffsetParent || getOffsetParent;\n const getDimensionsFn = this.getDimensions;\n const floatingDimensions = await getDimensionsFn(data.floating);\n return {\n reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),\n floating: {\n x: 0,\n y: 0,\n width: floatingDimensions.width,\n height: floatingDimensions.height\n }\n };\n};\n\nfunction isRTL(element) {\n return getComputedStyle(element).direction === 'rtl';\n}\n\nconst platform = {\n convertOffsetParentRelativeRectToViewportRelativeRect,\n getDocumentElement,\n getClippingRect,\n getOffsetParent,\n getElementRects,\n getClientRects,\n getDimensions,\n getScale,\n isElement,\n isRTL\n};\n\n// https://samthor.au/2021/observing-dom/\nfunction observeMove(element, onMove) {\n let io = null;\n let timeoutId;\n const root = getDocumentElement(element);\n function cleanup() {\n var _io;\n clearTimeout(timeoutId);\n (_io = io) == null || _io.disconnect();\n io = null;\n }\n function refresh(skip, threshold) {\n if (skip === void 0) {\n skip = false;\n }\n if (threshold === void 0) {\n threshold = 1;\n }\n cleanup();\n const {\n left,\n top,\n width,\n height\n } = element.getBoundingClientRect();\n if (!skip) {\n onMove();\n }\n if (!width || !height) {\n return;\n }\n const insetTop = floor(top);\n const insetRight = floor(root.clientWidth - (left + width));\n const insetBottom = floor(root.clientHeight - (top + height));\n const insetLeft = floor(left);\n const rootMargin = -insetTop + \"px \" + -insetRight + \"px \" + -insetBottom + \"px \" + -insetLeft + \"px\";\n const options = {\n rootMargin,\n threshold: max(0, min(1, threshold)) || 1\n };\n let isFirstUpdate = true;\n function handleObserve(entries) {\n const ratio = entries[0].intersectionRatio;\n if (ratio !== threshold) {\n if (!isFirstUpdate) {\n return refresh();\n }\n if (!ratio) {\n // If the reference is clipped, the ratio is 0. Throttle the refresh\n // to prevent an infinite loop of updates.\n timeoutId = setTimeout(() => {\n refresh(false, 1e-7);\n }, 1000);\n } else {\n refresh(false, ratio);\n }\n }\n isFirstUpdate = false;\n }\n\n // Older browsers don't support a `document` as the root and will throw an\n // error.\n try {\n io = new IntersectionObserver(handleObserve, {\n ...options,\n // Handle <iframe>s\n root: root.ownerDocument\n });\n } catch (e) {\n io = new IntersectionObserver(handleObserve, options);\n }\n io.observe(element);\n }\n refresh(true);\n return cleanup;\n}\n\n/**\n * Automatically updates the position of the floating element when necessary.\n * Should only be called when the floating element is mounted on the DOM or\n * visible on the screen.\n * @returns cleanup function that should be invoked when the floating element is\n * removed from the DOM or hidden from the screen.\n * @see https://floating-ui.com/docs/autoUpdate\n */\nfunction autoUpdate(reference, floating, update, options) {\n if (options === void 0) {\n options = {};\n }\n const {\n ancestorScroll = true,\n ancestorResize = true,\n elementResize = typeof ResizeObserver === 'function',\n layoutShift = typeof IntersectionObserver === 'function',\n animationFrame = false\n } = options;\n const referenceEl = unwrapElement(reference);\n const ancestors = ancestorScroll || ancestorResize ? [...(referenceEl ? getOverflowAncestors(referenceEl) : []), ...getOverflowAncestors(floating)] : [];\n ancestors.forEach(ancestor => {\n ancestorScroll && ancestor.addEventListener('scroll', update, {\n passive: true\n });\n ancestorResize && ancestor.addEventListener('resize', update);\n });\n const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null;\n let reobserveFrame = -1;\n let resizeObserver = null;\n if (elementResize) {\n resizeObserver = new ResizeObserver(_ref => {\n let [firstEntry] = _ref;\n if (firstEntry && firstEntry.target === referenceEl && resizeObserver) {\n // Prevent update loops when using the `size` middleware.\n // https://github.com/floating-ui/floating-ui/issues/1740\n resizeObserver.unobserve(floating);\n cancelAnimationFrame(reobserveFrame);\n reobserveFrame = requestAnimationFrame(() => {\n var _resizeObserver;\n (_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating);\n });\n }\n update();\n });\n if (referenceEl && !animationFrame) {\n resizeObserver.observe(referenceEl);\n }\n resizeObserver.observe(floating);\n }\n let frameId;\n let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;\n if (animationFrame) {\n frameLoop();\n }\n function frameLoop() {\n const nextRefRect = getBoundingClientRect(reference);\n if (prevRefRect && (nextRefRect.x !== prevRefRect.x || nextRefRect.y !== prevRefRect.y || nextRefRect.width !== prevRefRect.width || nextRefRect.height !== prevRefRect.height)) {\n update();\n }\n prevRefRect = nextRefRect;\n frameId = requestAnimationFrame(frameLoop);\n }\n update();\n return () => {\n var _resizeObserver2;\n ancestors.forEach(ancestor => {\n ancestorScroll && ancestor.removeEventListener('scroll', update);\n ancestorResize && ancestor.removeEventListener('resize', update);\n });\n cleanupIo == null || cleanupIo();\n (_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect();\n resizeObserver = null;\n if (animationFrame) {\n cancelAnimationFrame(frameId);\n }\n };\n}\n\n/**\n * Resolves with an object of overflow side offsets that determine how much the\n * element is overflowing a given clipping boundary on each side.\n * - positive = overflowing the boundary by that number of pixels\n * - negative = how many pixels left before it will overflow\n * - 0 = lies flush with the boundary\n * @see https://floating-ui.com/docs/detectOverflow\n */\nconst detectOverflow = detectOverflow$1;\n\n/**\n * Modifies the placement by translating the floating element along the\n * specified axes.\n * A number (shorthand for `mainAxis` or distance), or an axes configuration\n * object may be passed.\n * @see https://floating-ui.com/docs/offset\n */\nconst offset = offset$1;\n\n/**\n * Optimizes the visibility of the floating element by choosing the placement\n * that has the most space available automatically, without needing to specify a\n * preferred placement. Alternative to `flip`.\n * @see https://floating-ui.com/docs/autoPlacement\n */\nconst autoPlacement = autoPlacement$1;\n\n/**\n * Optimizes the visibility of the floating element by shifting it in order to\n * keep it in view when it will overflow the clipping boundary.\n * @see https://floating-ui.com/docs/shift\n */\nconst shift = shift$1;\n\n/**\n * Optimizes the visibility of the floating element by flipping the `placement`\n * in order to keep it in view when the preferred placement(s) will overflow the\n * clipping boundary. Alternative to `autoPlacement`.\n * @see https://floating-ui.com/docs/flip\n */\nconst flip = flip$1;\n\n/**\n * Provides data that allows you to change the size of the floating element —\n * for instance, prevent it from overflowing the clipping boundary or match the\n * width of the reference element.\n * @see https://floating-ui.com/docs/size\n */\nconst size = size$1;\n\n/**\n * Provides data to hide the floating element in applicable situations, such as\n * when it is not in the same clipping context as the reference element.\n * @see https://floating-ui.com/docs/hide\n */\nconst hide = hide$1;\n\n/**\n * Provides data to position an inner element of the floating element so that it\n * appears centered to the reference element.\n * @see https://floating-ui.com/docs/arrow\n */\nconst arrow = arrow$1;\n\n/**\n * Provides improved positioning for inline reference elements that can span\n * over multiple lines, such as hyperlinks or range selections.\n * @see https://floating-ui.com/docs/inline\n */\nconst inline = inline$1;\n\n/**\n * Built-in `limiter` that will stop `shift()` at a certain point.\n */\nconst limitShift = limitShift$1;\n\n/**\n * Computes the `x` and `y` coordinates that will place the floating element\n * next to a given reference element.\n */\nconst computePosition = (reference, floating, options) => {\n // This caches the expensive `getClippingElementAncestors` function so that\n // multiple lifecycle resets re-use the same result. It only lives for a\n // single call. If other functions become expensive, we can add them as well.\n const cache = new Map();\n const mergedOptions = {\n platform,\n ...options\n };\n const platformWithCache = {\n ...mergedOptions.platform,\n _c: cache\n };\n return computePosition$1(reference, floating, {\n ...mergedOptions,\n platform: platformWithCache\n });\n};\n\nexport { arrow, autoPlacement, autoUpdate, computePosition, detectOverflow, flip, hide, inline, limitShift, offset, platform, shift, size };\n"],"names":["getCssDimensions","element","css","getComputedStyle","width","height","hasOffset","isHTMLElement","offsetWidth","offsetHeight","shouldFallback","round","unwrapElement","isElement","getScale","domElement","createCoords","rect","$","x","y","noOffsets","getVisualOffsets","win","getWindow","isWebKit","shouldAddVisualOffsets","isFixed","floatingOffsetParent","getBoundingClientRect","includeScale","isFixedStrategy","offsetParent","clientRect","scale","visualOffsets","offsetWin","currentWin","currentIFrame","getFrameElement","iframeScale","iframeRect","left","top","rectToClientRect","convertOffsetParentRelativeRectToViewportRelativeRect","_ref","elements","strategy","documentElement","getDocumentElement","topLayer","isTopLayer","scroll","offsets","isOffsetParentAnElement","getNodeName","isOverflowElement","getNodeScroll","offsetRect","getClientRects","getWindowScrollBarX","getDocumentRect","html","body","max","getViewportRect","visualViewport","visualViewportBased","getInnerBoundingClientRect","getClientRectFromClippingAncestor","clippingAncestor","hasFixedPositionAncestor","stopNode","parentNode","getParentNode","isLastTraversableNode","getClippingElementAncestors","cache","cachedResult","result","getOverflowAncestors","el","currentContainingBlockComputedStyle","elementIsFixed","currentNode","computedStyle","currentNodeIsContaining","isContainingBlock","ancestor","getClippingRect","boundary","rootBoundary","clippingAncestors","firstClippingAncestor","clippingRect","accRect","min","getDimensions","getRectRelativeToOffsetParent","isStaticPositioned","getTrueOffsetParent","polyfill","getOffsetParent","svgOffsetParent","isTableElement","getContainingBlock","getElementRects","data","getOffsetParentFn","getDimensionsFn","floatingDimensions","isRTL","platform","observeMove","onMove","io","timeoutId","root","cleanup","_io","refresh","skip","threshold","insetTop","floor","insetRight","insetBottom","insetLeft","options","isFirstUpdate","handleObserve","entries","ratio","autoUpdate","reference","floating","update","ancestorScroll","ancestorResize","elementResize","layoutShift","animationFrame","referenceEl","ancestors","cleanupIo","reobserveFrame","resizeObserver","firstEntry","_resizeObserver","frameId","prevRefRect","frameLoop","nextRefRect","_resizeObserver2","offset","offset$1","shift","shift$1","flip","flip$1","hide","hide$1","arrow","arrow$1","computePosition","mergedOptions","platformWithCache","computePosition$1"],"mappings":";;;AAKA,SAASA,EAAiBC,GAAS;AACjC,QAAMC,IAAMC,EAAiBF,CAAO;AAGpC,MAAIG,IAAQ,WAAWF,EAAI,KAAK,KAAK,GACjCG,IAAS,WAAWH,EAAI,MAAM,KAAK;AACvC,QAAMI,IAAYC,EAAcN,CAAO,GACjCO,IAAcF,IAAYL,EAAQ,cAAcG,GAChDK,IAAeH,IAAYL,EAAQ,eAAeI,GAClDK,IAAiBC,EAAMP,CAAK,MAAMI,KAAeG,EAAMN,CAAM,MAAMI;AACzE,SAAIC,MACFN,IAAQI,GACRH,IAASI,IAEJ;AAAA,IACL,OAAAL;AAAA,IACA,QAAAC;AAAA,IACA,GAAGK;AAAA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,CAAO;AAAA,EAElC;AACA;AAmBK,MAACK,KAASC,IAeTC,KAAQC,IAQRC,KAAOC,IAePC,KAAOC,IAOPC,KAAQC,IAkBRC,KAAkB,CAAC9B,GAAWC,GAAUP,MAAY;AAIxD,QAAMnD,IAAQ,oBAAI,OACZwF,IAAgB;AAAA,IACpB,UAAArD;AAAA,IACA,GAAGgB;AAAA,EACP,GACQsC,IAAoB;AAAA,IACxB,GAAGD,EAAc;AAAA,IACjB,IAAIxF;AAAA,EACR;AACE,SAAO0F,GAAkBjC,GAAWC,GAAU;AAAA,IAC5C,GAAG8B;AAAA,IACH,UAAUC;AAAA,EACd,CAAG;AACH;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"index230.js","sources":["../node_modules/dayjs/plugin/customParseFormat.js"],"sourcesContent":["!function(e,t){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=t():\"function\"==typeof define&&define.amd?define(t):(e=\"undefined\"!=typeof globalThis?globalThis:e||self).dayjs_plugin_customParseFormat=t()}(this,(function(){\"use strict\";var e={LTS:\"h:mm:ss A\",LT:\"h:mm A\",L:\"MM/DD/YYYY\",LL:\"MMMM D, YYYY\",LLL:\"MMMM D, YYYY h:mm A\",LLLL:\"dddd, MMMM D, YYYY h:mm A\"},t=/(\\[[^[]*\\])|([-_:/.,()\\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,n=/\\d\\d/,r=/\\d\\d?/,i=/\\d*[^-_:/,()\\s\\d]+/,o={},s=function(e){return(e=+e)+(e>68?1900:2e3)};var a=function(e){return function(t){this[e]=+t}},f=[/[+-]\\d\\d:?(\\d\\d)?|Z/,function(e){(this.zone||(this.zone={})).offset=function(e){if(!e)return 0;if(\"Z\"===e)return 0;var t=e.match(/([+-]|\\d\\d)/g),n=60*t[1]+(+t[2]||0);return 0===n?0:\"+\"===t[0]?-n:n}(e)}],h=function(e){var t=o[e];return t&&(t.indexOf?t:t.s.concat(t.f))},u=function(e,t){var n,r=o.meridiem;if(r){for(var i=1;i<=24;i+=1)if(e.indexOf(r(i,0,t))>-1){n=i>12;break}}else n=e===(t?\"pm\":\"PM\");return n},d={A:[i,function(e){this.afternoon=u(e,!1)}],a:[i,function(e){this.afternoon=u(e,!0)}],S:[/\\d/,function(e){this.milliseconds=100*+e}],SS:[n,function(e){this.milliseconds=10*+e}],SSS:[/\\d{3}/,function(e){this.milliseconds=+e}],s:[r,a(\"seconds\")],ss:[r,a(\"seconds\")],m:[r,a(\"minutes\")],mm:[r,a(\"minutes\")],H:[r,a(\"hours\")],h:[r,a(\"hours\")],HH:[r,a(\"hours\")],hh:[r,a(\"hours\")],D:[r,a(\"day\")],DD:[n,a(\"day\")],Do:[i,function(e){var t=o.ordinal,n=e.match(/\\d+/);if(this.day=n[0],t)for(var r=1;r<=31;r+=1)t(r).replace(/\\[|\\]/g,\"\")===e&&(this.day=r)}],M:[r,a(\"month\")],MM:[n,a(\"month\")],MMM:[i,function(e){var t=h(\"months\"),n=(h(\"monthsShort\")||t.map((function(e){return e.slice(0,3)}))).indexOf(e)+1;if(n<1)throw new Error;this.month=n%12||n}],MMMM:[i,function(e){var t=h(\"months\").indexOf(e)+1;if(t<1)throw new Error;this.month=t%12||t}],Y:[/[+-]?\\d+/,a(\"year\")],YY:[n,function(e){this.year=s(e)}],YYYY:[/\\d{4}/,a(\"year\")],Z:f,ZZ:f};function c(n){var r,i;r=n,i=o&&o.formats;for(var s=(n=r.replace(/(\\[[^\\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(t,n,r){var o=r&&r.toUpperCase();return n||i[r]||e[r]||i[o].replace(/(\\[[^\\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,t,n){return t||n.slice(1)}))}))).match(t),a=s.length,f=0;f<a;f+=1){var h=s[f],u=d[h],c=u&&u[0],l=u&&u[1];s[f]=l?{regex:c,parser:l}:h.replace(/^\\[|\\]$/g,\"\")}return function(e){for(var t={},n=0,r=0;n<a;n+=1){var i=s[n];if(\"string\"==typeof i)r+=i.length;else{var o=i.regex,f=i.parser,h=e.slice(r),u=o.exec(h)[0];f.call(t,u),e=e.replace(u,\"\")}}return function(e){var t=e.afternoon;if(void 0!==t){var n=e.hours;t?n<12&&(e.hours+=12):12===n&&(e.hours=0),delete e.afternoon}}(t),t}}return function(e,t,n){n.p.customParseFormat=!0,e&&e.parseTwoDigitYear&&(s=e.parseTwoDigitYear);var r=t.prototype,i=r.parse;r.parse=function(e){var t=e.date,r=e.utc,s=e.args;this.$u=r;var a=s[1];if(\"string\"==typeof a){var f=!0===s[2],h=!0===s[3],u=f||h,d=s[2];h&&(d=s[2]),o=this.$locale(),!f&&d&&(o=n.Ls[d]),this.$d=function(e,t,n){try{if([\"x\",\"X\"].indexOf(t)>-1)return new Date((\"X\"===t?1e3:1)*e);var r=c(t)(e),i=r.year,o=r.month,s=r.day,a=r.hours,f=r.minutes,h=r.seconds,u=r.milliseconds,d=r.zone,l=new Date,m=s||(i||o?1:l.getDate()),M=i||l.getFullYear(),Y=0;i&&!o||(Y=o>0?o-1:l.getMonth());var p=a||0,v=f||0,D=h||0,g=u||0;return d?new Date(Date.UTC(M,Y,m,p,v,D,g+60*d.offset*1e3)):n?new Date(Date.UTC(M,Y,m,p,v,D,g)):new Date(M,Y,m,p,v,D,g)}catch(e){return new Date(\"\")}}(t,a,r),this.init(),d&&!0!==d&&(this.$L=this.locale(d).$L),u&&t!=this.format(a)&&(this.$d=new Date(\"\")),o={}}else if(a instanceof Array)for(var l=a.length,m=1;m<=l;m+=1){s[1]=a[m-1];var M=n.apply(this,s);if(M.isValid()){this.$d=M.$d,this.$L=M.$L,this.init();break}m===l&&(this.$d=new Date(\"\"))}else i.call(this,e)}}}));"],"names":["e","t","module","this","n","r","i","o","s","a","f","h","u","d","c","l","m","M","Y","p","v","D","g"],"mappings":";;;AAAA,GAAC,SAASA,GAAEC,GAAE;AAAsD,IAAAC,EAAA,UAAeD,EAA4I;AAAA,EAAA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AAE;AAAA,YAAC;AAAA,UAAC,EAAErB,GAAEQ,GAAEJ,CAAC,GAAE,KAAK,KAAI,GAAGQ,KAAQA,MAAL,OAAS,KAAK,KAAG,KAAK,OAAOA,CAAC,EAAE,KAAID,KAAGX,KAAG,KAAK,OAAOQ,CAAC,MAAI,KAAK,KAAG,oBAAI,KAAK,EAAE,IAAGF,IAAE,CAAA;AAAA,QAAE,WAASE,aAAa,MAAM,UAAQM,IAAEN,EAAE,QAAOO,IAAE,GAAEA,KAAGD,GAAEC,KAAG,GAAE;AAAC,UAAAR,EAAE,CAAC,IAAEC,EAAEO,IAAE,CAAC;AAAE,cAAIC,IAAE,EAAE,MAAM,MAAKT,CAAC;AAAE,cAAGS,EAAE,QAAO,GAAG;AAAC,iBAAK,KAAGA,EAAE,IAAG,KAAK,KAAGA,EAAE,IAAG,KAAK,KAAM;AAAC;AAAA,UAAK;AAAC,UAAAD,MAAID,MAAI,KAAK,KAAG,oBAAI,KAAK,EAAE;AAAA,QAAE;AAAA,YAAM,CAAAT,EAAE,KAAK,MAAKN,CAAC;AAAA,MAAC;AAAA,IAAC;AAAA,EAAC,CAAC;;;;","x_google_ignoreList":[0]}
|
package/dist/index231.js
CHANGED
|
@@ -1,161 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import { last as _ } from "./index211.js";
|
|
3
|
-
import { useArray as Q } from "./index279.js";
|
|
4
|
-
import { uniqBy as $ } from "./index280.js";
|
|
5
|
-
import { useItemValue as ee } from "./index273.js";
|
|
6
|
-
import { useItemText as te } from "./index281.js";
|
|
7
|
-
import { hash as v } from "./index210.js";
|
|
8
|
-
import { isNotNil as q } from "./index131.js";
|
|
9
|
-
import { waitFor as le } from "./index220.js";
|
|
10
|
-
import { isNil as oe } from "./index126.js";
|
|
11
|
-
const he = (l) => {
|
|
12
|
-
const i = a(""), F = a(), u = (e) => {
|
|
13
|
-
F.value = e, l.emit("update:modelValue", e);
|
|
14
|
-
}, d = a([]), {
|
|
15
|
-
array: k,
|
|
16
|
-
add: E,
|
|
17
|
-
remove: P,
|
|
18
|
-
set: y
|
|
19
|
-
} = Q(), {
|
|
20
|
-
array: S,
|
|
21
|
-
add: j,
|
|
22
|
-
remove: J
|
|
23
|
-
} = Q(), { getItemText: L } = te(), { getItemValue: U } = ee(), O = (e) => {
|
|
24
|
-
const t = !!(l.disabled.value || e.disabled), o = L(e, l.itemText), n = U(e, l.itemValue);
|
|
25
|
-
if (n === void 0)
|
|
26
|
-
throw new Error(
|
|
27
|
-
'The result of extracting "value" from option was undefined. Affected item is ' + JSON.stringify(e) + " please check itemValue property is correct."
|
|
28
|
-
);
|
|
29
|
-
const X = v(n);
|
|
30
|
-
return {
|
|
31
|
-
item: e,
|
|
32
|
-
text: o,
|
|
33
|
-
value: n,
|
|
34
|
-
valueHash: X,
|
|
35
|
-
disabled: t,
|
|
36
|
-
selected: !1
|
|
37
|
-
};
|
|
38
|
-
}, T = (e) => (e.selected = q(b.value[e.valueHash]), e), V = r(() => {
|
|
39
|
-
const e = [].concat(
|
|
40
|
-
d.value.map((t) => T(O(t))),
|
|
41
|
-
S.value.map(T),
|
|
42
|
-
k.value.map(T)
|
|
43
|
-
);
|
|
44
|
-
return $(e, (t) => t.valueHash);
|
|
45
|
-
}), z = (e) => {
|
|
46
|
-
l.multiple ? (u(l.modelValue.value.concat(e.value)), l.stash && E(e), l.resetQueryOnOptionSelected && s()) : (l.stash && y(e), u(e.value), N(() => s()));
|
|
47
|
-
}, G = async (e) => {
|
|
48
|
-
if (J((t) => t.valueHash !== e.valueHash), P((t) => t.valueHash !== e.valueHash), l.multiple) {
|
|
49
|
-
const t = { ...b.value };
|
|
50
|
-
delete t[e.valueHash], u(Object.values(t));
|
|
51
|
-
} else
|
|
52
|
-
u(null), await N(), s();
|
|
53
|
-
}, b = r(() => {
|
|
54
|
-
const e = {}, t = [].concat(l.modelValue.value);
|
|
55
|
-
for (let o = 0; o < t.length; o++) {
|
|
56
|
-
const n = t[o];
|
|
57
|
-
e[v(n)] = n;
|
|
58
|
-
}
|
|
59
|
-
return e;
|
|
60
|
-
}), g = async ({ prefill: e = !1 }) => {
|
|
61
|
-
let t = [];
|
|
62
|
-
if (Array.isArray(l.items.value))
|
|
63
|
-
t = l.items.value;
|
|
64
|
-
else if (typeof l.items.value == "function") {
|
|
65
|
-
const o = ++c.value;
|
|
66
|
-
try {
|
|
67
|
-
t = await l.items.value(
|
|
68
|
-
i.value,
|
|
69
|
-
e,
|
|
70
|
-
l.modelValue.value
|
|
71
|
-
), o < c.value && (await le(() => o === c.value), t = d.value);
|
|
72
|
-
} catch (n) {
|
|
73
|
-
console.error(n);
|
|
74
|
-
}
|
|
75
|
-
c.value--;
|
|
76
|
-
}
|
|
77
|
-
d.value = t;
|
|
78
|
-
}, B = r(() => {
|
|
79
|
-
const e = {};
|
|
80
|
-
for (let t = 0; t < V.value.length; t++) {
|
|
81
|
-
const o = V.value[t], { valueHash: n } = o;
|
|
82
|
-
e[n] = o;
|
|
83
|
-
}
|
|
84
|
-
return {
|
|
85
|
-
get: (t) => e[v(t)]
|
|
86
|
-
};
|
|
87
|
-
}), f = r(() => [].concat(l.modelValue.value).reduce((e, t) => {
|
|
88
|
-
const o = B.value.get(t);
|
|
89
|
-
return o && e.push(o), e;
|
|
90
|
-
}, [])), C = (e) => q(B.value.get(e)), s = () => {
|
|
91
|
-
if (l.multiple) {
|
|
92
|
-
i.value = "";
|
|
93
|
-
return;
|
|
94
|
-
}
|
|
95
|
-
let e;
|
|
96
|
-
f.value && (e = _(f.value)), i.value = (e == null ? void 0 : e.text) || "";
|
|
97
|
-
}, K = () => {
|
|
98
|
-
const e = i.value.trim(), t = O(e);
|
|
99
|
-
j(t), s();
|
|
100
|
-
}, c = a(0), M = r(() => [].concat(l.modelValue.value).reduce(
|
|
101
|
-
(e, t) => (C(t) ? e.coherent.push(t) : e.incoherent.push(t), e),
|
|
102
|
-
{ coherent: [], incoherent: [] }
|
|
103
|
-
)), A = r(() => l.multiple && !l.modelValue.value.length || !l.multiple && oe(l.modelValue.value) ? !0 : !M.value.incoherent.length), R = () => {
|
|
104
|
-
l.enforceCoherence && !A.value && (l.multiple ? u(M.value.coherent) : u(null));
|
|
105
|
-
}, p = a(!1), I = a(!1), m = async () => {
|
|
106
|
-
I.value = !0, await g({ prefill: !0 }), R(), s(), p.value = !0, I.value = !1;
|
|
107
|
-
};
|
|
108
|
-
Y(async () => {
|
|
109
|
-
l.prefill && (await m(), l.stash && y(...f.value));
|
|
110
|
-
});
|
|
111
|
-
let h;
|
|
112
|
-
const W = () => {
|
|
113
|
-
h && clearTimeout(h), h = setTimeout(async () => {
|
|
114
|
-
try {
|
|
115
|
-
await g({ prefill: !1 });
|
|
116
|
-
} catch (e) {
|
|
117
|
-
console.error(e);
|
|
118
|
-
}
|
|
119
|
-
}, l.queryDebounceTime);
|
|
120
|
-
};
|
|
121
|
-
Z(() => clearTimeout(h));
|
|
122
|
-
let x;
|
|
123
|
-
H(
|
|
124
|
-
() => l.modelValue.value,
|
|
125
|
-
() => {
|
|
126
|
-
A.value || (x && clearTimeout(x), x = setTimeout(async () => {
|
|
127
|
-
m();
|
|
128
|
-
}, l.modelValueDebounceTime));
|
|
129
|
-
}
|
|
130
|
-
);
|
|
131
|
-
let w;
|
|
132
|
-
const D = async (e, t) => {
|
|
133
|
-
v(t) !== v(e) && p.value && (w && clearTimeout(w), w = setTimeout(async () => {
|
|
134
|
-
await m();
|
|
135
|
-
}, l.depsDebounceTime));
|
|
136
|
-
};
|
|
137
|
-
return H(() => l.items.value, D), H(() => l.dependencies.value, D), {
|
|
138
|
-
addCurrentQueryToManualItems: K,
|
|
139
|
-
alignQueryToState: s,
|
|
140
|
-
getOptions: g,
|
|
141
|
-
hasPrefilled: p,
|
|
142
|
-
innerLoading: c,
|
|
143
|
-
isPrefilling: I,
|
|
144
|
-
manualItems: S,
|
|
145
|
-
options: V,
|
|
146
|
-
prefillItems: m,
|
|
147
|
-
query: i,
|
|
148
|
-
searchByQuery: W,
|
|
149
|
-
selectedOptions: f,
|
|
150
|
-
selectOption: z,
|
|
151
|
-
setStash: y,
|
|
152
|
-
unselectOption: G,
|
|
153
|
-
updateModelValue: u,
|
|
154
|
-
valueIsSelected: C,
|
|
155
|
-
internalItems: d
|
|
156
|
-
};
|
|
157
|
-
};
|
|
1
|
+
const e = (t) => t;
|
|
158
2
|
export {
|
|
159
|
-
|
|
3
|
+
e as identity
|
|
160
4
|
};
|
|
161
5
|
//# sourceMappingURL=index231.js.map
|
package/dist/index231.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index231.js","sources":["../src/composables/useOptions.ts"],"sourcesContent":["import {\n\tcomputed,\n\tnextTick,\n\tonBeforeMount,\n\tonBeforeUnmount,\n\tref,\n\twatch,\n\ttype Ref,\n} from 'vue';\nimport type { Option as BaseOption } from '@/types/Option';\nimport { last } from '@/utilities/functions/last';\nimport { useArray } from './useArray';\nimport { uniqBy } from '@/utilities/functions/uniqBy';\nimport { useItemValue } from './useItemValue';\nimport { useItemText } from './useItemText';\nimport { hash } from '@/utilities/functions/hash';\nimport { isNotNil } from '@/utilities/functions/isNotNil';\nimport { waitFor } from '@/utilities/functions/waitFor';\nimport { isNil } from '@/utilities/functions/isNil';\n\ntype Options = {\n\tmultiple: boolean;\n\tstash: boolean;\n\titemText: string | ((item: any) => string) | undefined;\n\titemValue: string | ((item: any) => string) | undefined;\n\tmodelValue: Ref<any>;\n\tresetQueryOnOptionSelected: boolean;\n\temit: any;\n\titems: Ref<any>;\n\tenforceCoherence: boolean;\n\tprefill: boolean;\n\tmodelValueDebounceTime: number;\n\tdepsDebounceTime: number;\n\tdependencies: Ref<any[]>;\n\tqueryDebounceTime: number;\n\tdisabled: Ref<boolean>;\n};\n\nexport const useOptions = (params: Options) => {\n\tconst query = ref<string>('');\n\n\tconst lastEmittedValue = ref();\n\tconst updateModelValue = (value: any) => {\n\t\tlastEmittedValue.value = value;\n\t\tparams.emit('update:modelValue', value);\n\t};\n\n\tconst internalItems = ref<any[]>([]);\n\tconst {\n\t\tarray: innerStash,\n\t\tadd: addToStash,\n\t\tremove: removeFromStash,\n\t\tset: setStash,\n\t} = useArray<BaseOption>();\n\n\tconst {\n\t\tarray: manualItems,\n\t\tadd: addToManualItems,\n\t\tremove: removeFromManualItems,\n\t} = useArray<BaseOption>();\n\n\tconst { getItemText } = useItemText();\n\tconst { getItemValue } = useItemValue();\n\tconst createOption = (item: any): BaseOption => {\n\t\tconst disabled = !!(params.disabled.value || item.disabled);\n\t\tconst text = getItemText(item, params.itemText);\n\t\tconst value = getItemValue(item, params.itemValue);\n\n\t\t// Undefined is not supported\n\t\tif (value === undefined)\n\t\t\tthrow new Error(\n\t\t\t\t'The result of extracting \"value\" from option was undefined. Affected item is ' +\n\t\t\t\t\tJSON.stringify(item) +\n\t\t\t\t\t' please check itemValue property is correct.'\n\t\t\t);\n\t\tconst valueHash = hash(value);\n\t\tconst selected = false;\n\t\treturn {\n\t\t\titem,\n\t\t\ttext,\n\t\t\tvalue,\n\t\t\tvalueHash,\n\t\t\tdisabled,\n\t\t\tselected,\n\t\t};\n\t};\n\n\tconst setSelected = (o: BaseOption) => {\n\t\to.selected = isNotNil(modelValueIndexedByHash.value[o.valueHash]);\n\t\treturn o;\n\t};\n\tconst options = computed<BaseOption[]>(() => {\n\t\tconst base = ([] as BaseOption[]).concat(\n\t\t\tinternalItems.value.map((item) => {\n\t\t\t\treturn setSelected(createOption(item));\n\t\t\t}),\n\t\t\tmanualItems.value.map(setSelected),\n\t\t\tinnerStash.value.map(setSelected)\n\t\t);\n\t\treturn uniqBy(base, (o) => o.valueHash);\n\t});\n\n\tconst selectOption = (option: BaseOption) => {\n\t\tif (params.multiple) {\n\t\t\tupdateModelValue(params.modelValue.value.concat(option.value));\n\t\t\tif (params.stash) {\n\t\t\t\taddToStash(option);\n\t\t\t}\n\n\t\t\tif (params.resetQueryOnOptionSelected) {\n\t\t\t\talignQueryToState();\n\t\t\t}\n\t\t} else {\n\t\t\tif (params.stash) {\n\t\t\t\tsetStash(option);\n\t\t\t}\n\t\t\tupdateModelValue(option.value);\n\t\t\tnextTick(() => alignQueryToState());\n\t\t}\n\t};\n\tconst unselectOption = async (option: BaseOption) => {\n\t\tremoveFromManualItems((o) => o.valueHash !== option.valueHash);\n\t\tremoveFromStash((o) => o.valueHash !== option.valueHash);\n\t\tif (params.multiple) {\n\t\t\tconst copy = { ...modelValueIndexedByHash.value };\n\t\t\tdelete copy[option.valueHash];\n\t\t\tupdateModelValue(Object.values(copy));\n\t\t} else {\n\t\t\tupdateModelValue(null);\n\t\t\tawait nextTick();\n\t\t\talignQueryToState();\n\t\t}\n\t};\n\n\t/**\n\t * Indexes modelValue to a map of hash - value pairs so we can easily track which values are selected\n\t */\n\tconst modelValueIndexedByHash = computed(() => {\n\t\tconst map: Record<string, any> = {};\n\t\tconst arr = [].concat(params.modelValue.value);\n\t\tfor (let index = 0; index < arr.length; index++) {\n\t\t\tconst element = arr[index];\n\t\t\tmap[hash(element)] = element;\n\t\t}\n\t\treturn map;\n\t});\n\n\tconst getOptions = async ({ prefill = false }) => {\n\t\tlet items: any[] = [];\n\t\tif (Array.isArray(params.items.value)) {\n\t\t\titems = params.items.value;\n\t\t} else {\n\t\t\tif (typeof params.items.value === 'function') {\n\t\t\t\tconst order = ++innerLoading.value;\n\t\t\t\ttry {\n\t\t\t\t\titems = await params.items.value(\n\t\t\t\t\t\tquery.value,\n\t\t\t\t\t\tprefill,\n\t\t\t\t\t\tparams.modelValue.value\n\t\t\t\t\t);\n\t\t\t\t\t// If by the time this resolves another call has already been made discard this result\n\t\t\t\t\tif (order < innerLoading.value) {\n\t\t\t\t\t\tawait waitFor(() => order === innerLoading.value);\n\t\t\t\t\t\titems = internalItems.value;\n\t\t\t\t\t}\n\t\t\t\t} catch (error) {\n\t\t\t\t\tconsole.error(error);\n\t\t\t\t}\n\t\t\t\tinnerLoading.value--;\n\t\t\t}\n\t\t}\n\t\tinternalItems.value = items as any;\n\t};\n\n\t/**\n\t * Indexes options by their hash so they can be retrieved\n\t */\n\tconst optionsIndexedByHash = computed(() => {\n\t\tconst map: Record<string, BaseOption> = {};\n\t\tfor (let index = 0; index < options.value.length; index++) {\n\t\t\tconst element = options.value[index];\n\t\t\tconst { valueHash } = element;\n\t\t\tmap[valueHash] = element;\n\t\t}\n\t\treturn {\n\t\t\tget: (value: any) => {\n\t\t\t\treturn map[hash(value)];\n\t\t\t},\n\t\t};\n\t});\n\n\t/**\n\t * For every item in modelValue find the linked option if it exists.\n\t * This is used to display chips.\n\t */\n\tconst selectedOptions = computed(() => {\n\t\treturn [].concat(params.modelValue.value).reduce((acc, h) => {\n\t\t\tconst found = optionsIndexedByHash.value.get(h);\n\t\t\tif (found) {\n\t\t\t\tacc.push(found);\n\t\t\t}\n\t\t\treturn acc;\n\t\t}, [] as BaseOption[]);\n\t});\n\n\tconst valueIsSelected = (value: any) =>\n\t\tisNotNil(optionsIndexedByHash.value.get(value));\n\n\tconst alignQueryToState = () => {\n\t\tif (params.multiple) {\n\t\t\tquery.value = '';\n\t\t\treturn;\n\t\t}\n\t\tlet option: BaseOption | undefined;\n\t\tif (selectedOptions.value) {\n\t\t\toption = last(selectedOptions.value);\n\t\t}\n\t\tquery.value = option?.text || '';\n\t};\n\n\t/**\n\t * Add an option to the manual items and then reset the query\n\t */\n\tconst addCurrentQueryToManualItems = () => {\n\t\tconst text = query.value.trim();\n\t\tconst option = createOption(text);\n\t\taddToManualItems(option);\n\t\talignQueryToState();\n\t};\n\n\t/**\n\t * Use a number accumulator because if the fn takes 5 seconds\n\t * and after 2 seconds another search is run\n\t * When the first returns the second is still out for 2 seconds\n\t * and we want to track them both.\n\t * Debounce will not be enough.\n\t */\n\tconst innerLoading = ref(0);\n\n\t/**\n\t * Coherent values are values that have an option they can be linked to.\n\t * Divide coherent and incoherent values.\n\t */\n\n\tconst coherenceStatus = computed(() => {\n\t\treturn [].concat(params.modelValue.value).reduce(\n\t\t\t(acc, curr) => {\n\t\t\t\tif (valueIsSelected(curr)) {\n\t\t\t\t\tacc.coherent.push(curr);\n\t\t\t\t} else {\n\t\t\t\t\tacc.incoherent.push(curr);\n\t\t\t\t}\n\t\t\t\treturn acc;\n\t\t\t},\n\t\t\t{ coherent: [], incoherent: [] }\n\t\t);\n\t});\n\n\t/**\n\t * Model value is considered coherent when:\n\t * - multiple mode is empty\n\t * - single mode is null\n\t */\n\tconst modelValueIsCoherent = computed(() => {\n\t\tif (params.multiple && !params.modelValue.value.length) return true;\n\t\telse if (!params.multiple && isNil(params.modelValue.value)) return true;\n\t\treturn !coherenceStatus.value.incoherent.length;\n\t});\n\n\t/**\n\t * Realign selection state to the passed settings.\n\t * If modelValue has any value that is not coherent while\n\t * coherence is enforced the value should be removed\n\t */\n\tconst alignToCoherenceSettings = () => {\n\t\tif (params.enforceCoherence && !modelValueIsCoherent.value) {\n\t\t\tif (!params.multiple) updateModelValue(null);\n\t\t\telse updateModelValue(coherenceStatus.value.coherent);\n\t\t}\n\t};\n\n\t/**\n\t * Prefilling is the phase where the component understands it needs\n\t * to update its inner items due to a change in state, whether dependencies have changed, items or modelValue have changed.\n\t * It can be intended as the component aligning itself to what state is passed to it.\n\t */\n\tconst hasPrefilled = ref(false);\n\tconst isPrefilling = ref(false);\n\tconst prefillItems = async () => {\n\t\tisPrefilling.value = true;\n\t\tawait getOptions({ prefill: true });\n\t\talignToCoherenceSettings();\n\t\talignQueryToState();\n\t\thasPrefilled.value = true;\n\t\tisPrefilling.value = false;\n\t};\n\n\tonBeforeMount(async () => {\n\t\tif (params.prefill) {\n\t\t\tawait prefillItems();\n\t\t\tif (params.stash) {\n\t\t\t\tsetStash(...selectedOptions.value);\n\t\t\t}\n\t\t}\n\t});\n\n\t/**\n\t * Triggered on input when items is a function.\n\t */\n\n\tlet timeout: ReturnType<typeof setTimeout>;\n\tconst searchByQuery = () => {\n\t\tif (timeout) clearTimeout(timeout);\n\t\ttimeout = setTimeout(async () => {\n\t\t\ttry {\n\t\t\t\tawait getOptions({ prefill: false });\n\t\t\t} catch (error) {\n\t\t\t\tconsole.error(error);\n\t\t\t}\n\t\t}, params.queryDebounceTime);\n\t};\n\tonBeforeUnmount(() => clearTimeout(timeout));\n\n\t/**\n\t * When modelValue changes split behavior for single and multiple selection:\n\t */\n\tlet modelValueTimeout: ReturnType<typeof setTimeout>;\n\twatch(\n\t\t() => params.modelValue.value,\n\t\t() => {\n\t\t\tif (modelValueIsCoherent.value) return;\n\t\t\tif (modelValueTimeout) clearTimeout(modelValueTimeout);\n\t\t\tmodelValueTimeout = setTimeout(async () => {\n\t\t\t\tprefillItems();\n\t\t\t}, params.modelValueDebounceTime);\n\t\t}\n\t);\n\n\t/**\n\t * START DEPENDENCY HANDLING\n\t * Explicit dependencies (props.dependencies) and implicit dependencies (props.items)\n\t * need to trigger a pipeline of realignment whenever they change\n\t */\n\tlet depsTimeout: ReturnType<typeof setTimeout>;\n\n\tconst handleDependencyChange = async (current: any, previous: any) => {\n\t\t// Circumvent arrays defined in the template by the parent triggering the watcher\n\t\tif (hash(previous) === hash(current)) return;\n\t\t// Do not track until prefill completes\n\t\tif (!hasPrefilled.value) return;\n\t\tif (depsTimeout) clearTimeout(depsTimeout);\n\t\tdepsTimeout = setTimeout(async () => {\n\t\t\tawait prefillItems();\n\t\t}, params.depsDebounceTime);\n\t};\n\n\t/**\n\t * This is triggered to refresh static items whenever the passed array changes.\n\t * If the parent defines an array in the template this is triggered\n\t * at every render so we take counter measures\n\t * Even if the entire array changes all the previously selected values are still in the stash.\n\t */\n\twatch(() => params.items.value, handleDependencyChange);\n\n\t/**\n\t * When dependencies change\n\t * If the input has not been prefilled yet just return\n\t * Check dependencies are the same by value and not reference\n\t * Otherwise we search again for options as they might be different base on dependencies.\n\t * If coherence is enforced we set the state accordingly\n\t */\n\twatch(() => params.dependencies.value, handleDependencyChange);\n\n\t/**\n\t * END DEPENDENCIES HANDLING\n\t */\n\n\treturn {\n\t\taddCurrentQueryToManualItems,\n\t\talignQueryToState,\n\t\tgetOptions,\n\t\thasPrefilled,\n\t\tinnerLoading,\n\t\tisPrefilling,\n\t\tmanualItems,\n\t\toptions,\n\t\tprefillItems,\n\t\tquery,\n\t\tsearchByQuery,\n\t\tselectedOptions,\n\t\tselectOption,\n\t\tsetStash,\n\t\tunselectOption,\n\t\tupdateModelValue,\n\t\tvalueIsSelected,\n\t\tinternalItems,\n\t};\n};\n"],"names":["useOptions","params","query","ref","lastEmittedValue","updateModelValue","value","internalItems","innerStash","addToStash","removeFromStash","setStash","useArray","manualItems","addToManualItems","removeFromManualItems","getItemText","useItemText","getItemValue","useItemValue","createOption","item","disabled","text","valueHash","hash","setSelected","o","isNotNil","modelValueIndexedByHash","options","computed","base","uniqBy","selectOption","option","alignQueryToState","nextTick","unselectOption","copy","map","arr","index","element","getOptions","prefill","items","order","innerLoading","waitFor","error","optionsIndexedByHash","selectedOptions","acc","h","found","valueIsSelected","last","addCurrentQueryToManualItems","coherenceStatus","curr","modelValueIsCoherent","isNil","alignToCoherenceSettings","hasPrefilled","isPrefilling","prefillItems","onBeforeMount","timeout","searchByQuery","onBeforeUnmount","modelValueTimeout","watch","depsTimeout","handleDependencyChange","current","previous"],"mappings":";;;;;;;;;;AAsCa,MAAAA,KAAa,CAACC,MAAoB;AACxC,QAAAC,IAAQC,EAAY,EAAE,GAEtBC,IAAmBD,KACnBE,IAAmB,CAACC,MAAe;AACxC,IAAAF,EAAiB,QAAQE,GAClBL,EAAA,KAAK,qBAAqBK,CAAK;AAAA,EAAA,GAGjCC,IAAgBJ,EAAW,CAAA,CAAE,GAC7B;AAAA,IACL,OAAOK;AAAA,IACP,KAAKC;AAAA,IACL,QAAQC;AAAA,IACR,KAAKC;AAAA,MACFC,EAAqB,GAEnB;AAAA,IACL,OAAOC;AAAA,IACP,KAAKC;AAAA,IACL,QAAQC;AAAA,MACLH,EAAqB,GAEnB,EAAE,aAAAI,MAAgBC,MAClB,EAAE,cAAAC,MAAiBC,MACnBC,IAAe,CAACC,MAA0B;AAC/C,UAAMC,IAAW,CAAC,EA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EAAa;AAAA,IAAA,GACjBjE,EAAO,gBAAgB;AAAA,EAAA;AAS3B,SAAAuE,EAAM,MAAMvE,EAAO,MAAM,OAAOyE,CAAsB,GAStDF,EAAM,MAAMvE,EAAO,aAAa,OAAOyE,CAAsB,GAMtD;AAAA,IACN,8BAAAhB;AAAA,IACA,mBAAAtB;AAAA,IACA,YAAAQ;AAAA,IACA,cAAAoB;AAAA,IACA,cAAAhB;AAAA,IACA,cAAAiB;AAAA,IACA,aAAApD;AAAA,IACA,SAAAiB;AAAA,IACA,cAAAoC;AAAA,IACA,OAAAhE;AAAA,IACA,eAAAmE;AAAA,IACA,iBAAAjB;AAAA,IACA,cAAAlB;AAAA,IACA,UAAAvB;AAAA,IACA,gBAAA2B;AAAA,IACA,kBAAAjC;AAAA,IACA,iBAAAmD;AAAA,IACA,eAAAjD;AAAA,EAAA;AAEF;"}
|
|
1
|
+
{"version":3,"file":"index231.js","sources":["../src/utilities/functions/identity.ts"],"sourcesContent":["export const identity = <T>(x: T) => x;\n"],"names":["identity","x"],"mappings":"AAAa,MAAAA,IAAW,CAAIC,MAASA;"}
|
package/dist/index232.js
CHANGED
|
@@ -1,87 +1,177 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
1
|
+
/*! maska v2.1.11 | (c) Alexander Shabunevich | Released under the MIT license */
|
|
2
|
+
var V = Object.defineProperty, P = (a, t, e) => t in a ? V(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e, g = (a, t, e) => (P(a, typeof t != "symbol" ? t + "" : t, e), e);
|
|
3
|
+
const R = {
|
|
4
|
+
"#": { pattern: /[0-9]/ },
|
|
5
|
+
"@": { pattern: /[a-zA-Z]/ },
|
|
6
|
+
"*": { pattern: /[a-zA-Z0-9]/ }
|
|
7
|
+
};
|
|
8
|
+
class b {
|
|
9
|
+
constructor(t = {}) {
|
|
10
|
+
g(this, "opts", {}), g(this, "memo", /* @__PURE__ */ new Map());
|
|
11
|
+
const e = { ...t };
|
|
12
|
+
if (e.tokens != null) {
|
|
13
|
+
e.tokens = e.tokensReplace ? { ...e.tokens } : { ...R, ...e.tokens };
|
|
14
|
+
for (const s of Object.values(e.tokens))
|
|
15
|
+
typeof s.pattern == "string" && (s.pattern = new RegExp(s.pattern));
|
|
16
|
+
} else
|
|
17
|
+
e.tokens = R;
|
|
18
|
+
Array.isArray(e.mask) && (e.mask.length > 1 ? e.mask = [...e.mask].sort((s, n) => s.length - n.length) : e.mask = e.mask[0] ?? ""), e.mask === "" && (e.mask = null), this.opts = e;
|
|
19
|
+
}
|
|
20
|
+
masked(t) {
|
|
21
|
+
return this.process(t, this.findMask(t));
|
|
22
|
+
}
|
|
23
|
+
unmasked(t) {
|
|
24
|
+
return this.process(t, this.findMask(t), !1);
|
|
25
|
+
}
|
|
26
|
+
isEager() {
|
|
27
|
+
return this.opts.eager === !0;
|
|
28
|
+
}
|
|
29
|
+
isReversed() {
|
|
30
|
+
return this.opts.reversed === !0;
|
|
31
|
+
}
|
|
32
|
+
completed(t) {
|
|
33
|
+
const e = this.findMask(t);
|
|
34
|
+
if (this.opts.mask == null || e == null)
|
|
35
|
+
return !1;
|
|
36
|
+
const s = this.process(t, e).length;
|
|
37
|
+
return typeof this.opts.mask == "string" ? s >= this.opts.mask.length : typeof this.opts.mask == "function" ? s >= e.length : this.opts.mask.filter((n) => s >= n.length).length === this.opts.mask.length;
|
|
38
|
+
}
|
|
39
|
+
findMask(t) {
|
|
40
|
+
const e = this.opts.mask;
|
|
41
|
+
if (e == null)
|
|
42
|
+
return null;
|
|
43
|
+
if (typeof e == "string")
|
|
44
|
+
return e;
|
|
45
|
+
if (typeof e == "function")
|
|
46
|
+
return e(t);
|
|
47
|
+
const s = this.process(t, e.slice(-1).pop() ?? "", !1);
|
|
48
|
+
return e.find((n) => this.process(t, n, !1).length >= s.length) ?? "";
|
|
49
|
+
}
|
|
50
|
+
escapeMask(t) {
|
|
51
|
+
const e = [], s = [];
|
|
52
|
+
return t.split("").forEach((n, i) => {
|
|
53
|
+
n === "!" && t[i - 1] !== "!" ? s.push(i - s.length) : e.push(n);
|
|
54
|
+
}), { mask: e.join(""), escaped: s };
|
|
55
|
+
}
|
|
56
|
+
process(t, e, s = !0) {
|
|
57
|
+
if (e == null)
|
|
58
|
+
return t;
|
|
59
|
+
const n = `value=${t},mask=${e},masked=${s ? 1 : 0}`;
|
|
60
|
+
if (this.memo.has(n))
|
|
61
|
+
return this.memo.get(n);
|
|
62
|
+
const { mask: i, escaped: p } = this.escapeMask(e), o = [], k = this.opts.tokens != null ? this.opts.tokens : {}, l = this.isReversed() ? -1 : 1, m = this.isReversed() ? "unshift" : "push", c = this.isReversed() ? 0 : i.length - 1, T = this.isReversed() ? () => r > -1 && u > -1 : () => r < i.length && u < t.length, S = (d) => !this.isReversed() && d <= c || this.isReversed() && d >= c;
|
|
63
|
+
let E, f = -1, r = this.isReversed() ? i.length - 1 : 0, u = this.isReversed() ? t.length - 1 : 0, y = !1;
|
|
64
|
+
for (; T(); ) {
|
|
65
|
+
const d = i.charAt(r), h = k[d], v = (h == null ? void 0 : h.transform) != null ? h.transform(t.charAt(u)) : t.charAt(u);
|
|
66
|
+
if (!p.includes(r) && h != null ? (v.match(h.pattern) != null ? (o[m](v), h.repeated ? (f === -1 ? f = r : r === c && r !== f && (r = f - l), c === f && (r -= l)) : h.multiple && (y = !0, r -= l), r += l) : h.multiple ? y && (r += l, u -= l, y = !1) : v === E ? E = void 0 : h.optional && (r += l, u -= l), u += l) : (s && !this.isEager() && o[m](d), v === d && !this.isEager() ? u += l : E = d, this.isEager() || (r += l)), this.isEager())
|
|
67
|
+
for (; S(r) && (k[i.charAt(r)] == null || p.includes(r)); )
|
|
68
|
+
s ? o[m](i.charAt(r)) : i.charAt(r) === t.charAt(u) && (u += l), r += l;
|
|
69
|
+
}
|
|
70
|
+
return this.memo.set(n, o.join("")), this.memo.get(n);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
const O = (a) => JSON.parse(a.replaceAll("'", '"')), w = (a, t = {}) => {
|
|
74
|
+
const e = { ...t };
|
|
75
|
+
return a.dataset.maska != null && a.dataset.maska !== "" && (e.mask = W(a.dataset.maska)), a.dataset.maskaEager != null && (e.eager = M(a.dataset.maskaEager)), a.dataset.maskaReversed != null && (e.reversed = M(a.dataset.maskaReversed)), a.dataset.maskaTokensReplace != null && (e.tokensReplace = M(a.dataset.maskaTokensReplace)), a.dataset.maskaTokens != null && (e.tokens = j(a.dataset.maskaTokens)), e;
|
|
76
|
+
}, M = (a) => a !== "" ? !!JSON.parse(a) : !0, W = (a) => a.startsWith("[") && a.endsWith("]") ? O(a) : a, j = (a) => {
|
|
77
|
+
if (a.startsWith("{") && a.endsWith("}"))
|
|
78
|
+
return O(a);
|
|
79
|
+
const t = {};
|
|
80
|
+
return a.split("|").forEach((e) => {
|
|
81
|
+
const s = e.split(":");
|
|
82
|
+
t[s[0]] = {
|
|
83
|
+
pattern: new RegExp(s[1]),
|
|
84
|
+
optional: s[2] === "optional",
|
|
85
|
+
multiple: s[2] === "multiple",
|
|
86
|
+
repeated: s[2] === "repeated"
|
|
87
|
+
};
|
|
88
|
+
}), t;
|
|
89
|
+
};
|
|
90
|
+
class L {
|
|
91
|
+
constructor(t, e = {}) {
|
|
92
|
+
g(this, "items", /* @__PURE__ */ new Map()), g(this, "beforeinputEvent", (s) => {
|
|
93
|
+
const n = s.target, i = this.items.get(n);
|
|
94
|
+
i.isEager() && "inputType" in s && s.inputType.startsWith("delete") && i.unmasked(n.value).length <= 1 && this.setMaskedValue(n, "");
|
|
95
|
+
}), g(this, "inputEvent", (s) => {
|
|
96
|
+
if (s instanceof CustomEvent && s.type === "input" && s.detail != null && typeof s.detail == "object" && "masked" in s.detail)
|
|
97
|
+
return;
|
|
98
|
+
const n = s.target, i = this.items.get(n), p = n.value, o = n.selectionStart, k = n.selectionEnd;
|
|
99
|
+
let l = p;
|
|
100
|
+
if (i.isEager()) {
|
|
101
|
+
const m = i.masked(p), c = i.unmasked(p);
|
|
102
|
+
c === "" && "data" in s && s.data != null ? l = s.data : c !== i.unmasked(m) && (l = c);
|
|
103
|
+
}
|
|
104
|
+
if (this.setMaskedValue(n, l), "inputType" in s && (s.inputType.startsWith("delete") || o != null && o < p.length))
|
|
105
|
+
try {
|
|
106
|
+
n.setSelectionRange(o, k);
|
|
107
|
+
} catch {
|
|
108
|
+
}
|
|
109
|
+
}), this.options = e, typeof t == "string" ? this.init(
|
|
110
|
+
Array.from(document.querySelectorAll(t)),
|
|
111
|
+
this.getMaskOpts(e)
|
|
112
|
+
) : this.init(
|
|
113
|
+
"length" in t ? Array.from(t) : [t],
|
|
114
|
+
this.getMaskOpts(e)
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
destroy() {
|
|
118
|
+
for (const t of this.items.keys())
|
|
119
|
+
t.removeEventListener("input", this.inputEvent), t.removeEventListener("beforeinput", this.beforeinputEvent);
|
|
120
|
+
this.items.clear();
|
|
121
|
+
}
|
|
122
|
+
needUpdateOptions(t, e) {
|
|
123
|
+
const s = this.items.get(t), n = new b(w(t, this.getMaskOpts(e)));
|
|
124
|
+
return JSON.stringify(s.opts) !== JSON.stringify(n.opts);
|
|
125
|
+
}
|
|
126
|
+
needUpdateValue(t) {
|
|
127
|
+
const e = t.dataset.maskaValue;
|
|
128
|
+
return e == null && t.value !== "" || e != null && e !== t.value;
|
|
129
|
+
}
|
|
130
|
+
getMaskOpts(t) {
|
|
131
|
+
const { onMaska: e, preProcess: s, postProcess: n, ...i } = t;
|
|
132
|
+
return i;
|
|
133
|
+
}
|
|
134
|
+
init(t, e) {
|
|
135
|
+
for (const s of t) {
|
|
136
|
+
const n = new b(w(s, e));
|
|
137
|
+
this.items.set(s, n), s.value !== "" && this.setMaskedValue(s, s.value), s.addEventListener("input", this.inputEvent), s.addEventListener("beforeinput", this.beforeinputEvent);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
setMaskedValue(t, e) {
|
|
141
|
+
const s = this.items.get(t);
|
|
142
|
+
this.options.preProcess != null && (e = this.options.preProcess(e));
|
|
143
|
+
const n = s.masked(e), i = s.unmasked(s.isEager() ? n : e), p = s.completed(e), o = { masked: n, unmasked: i, completed: p };
|
|
144
|
+
e = n, this.options.postProcess != null && (e = this.options.postProcess(e)), t.value = e, t.dataset.maskaValue = e, this.options.onMaska != null && (Array.isArray(this.options.onMaska) ? this.options.onMaska.forEach((k) => k(o)) : this.options.onMaska(o)), t.dispatchEvent(new CustomEvent("maska", { detail: o })), t.dispatchEvent(new CustomEvent("input", { detail: o }));
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
const A = /* @__PURE__ */ new WeakMap(), C = (a) => {
|
|
148
|
+
setTimeout(() => {
|
|
149
|
+
var t;
|
|
150
|
+
((t = A.get(a)) == null ? void 0 : t.needUpdateValue(a)) === !0 && a.dispatchEvent(new CustomEvent("input"));
|
|
151
|
+
});
|
|
152
|
+
}, J = (a, t) => {
|
|
153
|
+
const e = a instanceof HTMLInputElement ? a : a.querySelector("input"), s = { ...t.arg };
|
|
154
|
+
if (e == null || (e == null ? void 0 : e.type) === "file")
|
|
155
|
+
return;
|
|
156
|
+
C(e);
|
|
157
|
+
const n = A.get(e);
|
|
158
|
+
if (n != null) {
|
|
159
|
+
if (!n.needUpdateOptions(e, s))
|
|
160
|
+
return;
|
|
161
|
+
n.destroy();
|
|
162
|
+
}
|
|
163
|
+
if (t.value != null) {
|
|
164
|
+
const i = t.value, p = (o) => {
|
|
165
|
+
i.masked = o.masked, i.unmasked = o.unmasked, i.completed = o.completed;
|
|
166
|
+
};
|
|
167
|
+
s.onMaska = s.onMaska == null ? p : Array.isArray(s.onMaska) ? [...s.onMaska, p] : [s.onMaska, p];
|
|
168
|
+
}
|
|
169
|
+
A.set(e, new L(e, s));
|
|
170
|
+
};
|
|
84
171
|
export {
|
|
85
|
-
|
|
172
|
+
b as Mask,
|
|
173
|
+
L as MaskInput,
|
|
174
|
+
R as tokens,
|
|
175
|
+
J as vMaska
|
|
86
176
|
};
|
|
87
177
|
//# sourceMappingURL=index232.js.map
|