cbvirtua 1.0.6 → 1.0.8

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.
Files changed (86) hide show
  1. package/asy.js +32 -0
  2. package/package.json +1 -1
  3. package/style/basic.less +69 -0
  4. package/style/index.less +125 -0
  5. package/style/index.tsx +2 -0
  6. package/style/mixin.less +53 -0
  7. package/style/rtl.less +68 -0
  8. package/v2/App.vue +0 -56
  9. package/v2/components/Dropdown.vue +0 -28
  10. package/v2/components/Menu.vue +0 -9
  11. package/v2/components/Popper.js +0 -1011
  12. package/v2/components/PopperContent.vue +0 -270
  13. package/v2/components/PopperMethods.js +0 -17
  14. package/v2/components/PopperWrapper.vue +0 -101
  15. package/v2/components/ResizeObserver.vue +0 -151
  16. package/v2/components/ThemeClass.js +0 -9
  17. package/v2/components/Tooltip.vue +0 -22
  18. package/v2/components/TooltipDirective.vue +0 -171
  19. package/v2/config.js +0 -133
  20. package/v2/directives/v-close-popper.js +0 -67
  21. package/v2/directives/v-tooltip.js +0 -116
  22. package/v2/floating-ui/core/computeCoordsFromPlacement.js +0 -39
  23. package/v2/floating-ui/core/computePosition.js +0 -52
  24. package/v2/floating-ui/core/detectOverflow.js +0 -36
  25. package/v2/floating-ui/core/enums.js +0 -7
  26. package/v2/floating-ui/core/index.js +0 -11
  27. package/v2/floating-ui/core/middleware/arrow.js +0 -52
  28. package/v2/floating-ui/core/middleware/autoPlacement.js +0 -84
  29. package/v2/floating-ui/core/middleware/flip.js +0 -82
  30. package/v2/floating-ui/core/middleware/hide.js +0 -36
  31. package/v2/floating-ui/core/middleware/inline.js +0 -100
  32. package/v2/floating-ui/core/middleware/offset.js +0 -26
  33. package/v2/floating-ui/core/middleware/shift.js +0 -99
  34. package/v2/floating-ui/core/middleware/size.js +0 -58
  35. package/v2/floating-ui/core/types.js +0 -11
  36. package/v2/floating-ui/core/utils/expandPaddingObject.js +0 -3
  37. package/v2/floating-ui/core/utils/getAlignment.js +0 -3
  38. package/v2/floating-ui/core/utils/getAlignmentSides.js +0 -23
  39. package/v2/floating-ui/core/utils/getBasePlacement.js +0 -3
  40. package/v2/floating-ui/core/utils/getCrossAxis.js +0 -3
  41. package/v2/floating-ui/core/utils/getExpandedPlacements.js +0 -10
  42. package/v2/floating-ui/core/utils/getLengthFromAxis.js +0 -3
  43. package/v2/floating-ui/core/utils/getMainAxisFromPlacement.js +0 -4
  44. package/v2/floating-ui/core/utils/getOppositeAlignmentPlacement.js +0 -4
  45. package/v2/floating-ui/core/utils/getOppositePlacement.js +0 -4
  46. package/v2/floating-ui/core/utils/getPaddingObject.js +0 -6
  47. package/v2/floating-ui/core/utils/math.js +0 -2
  48. package/v2/floating-ui/core/utils/rectToClientRect.js +0 -9
  49. package/v2/floating-ui/core/utils/within.js +0 -4
  50. package/v2/floating-ui/dom/index.js +0 -5
  51. package/v2/floating-ui/dom/platform.js +0 -20
  52. package/v2/floating-ui/dom/utils/contains.js +0 -22
  53. package/v2/floating-ui/dom/utils/convertOffsetParentRelativeRectToViewportRelativeRect.js +0 -35
  54. package/v2/floating-ui/dom/utils/getBoundingClientRect.js +0 -27
  55. package/v2/floating-ui/dom/utils/getClippingClientRect.js +0 -76
  56. package/v2/floating-ui/dom/utils/getComputedStyle.js +0 -4
  57. package/v2/floating-ui/dom/utils/getDimensions.js +0 -6
  58. package/v2/floating-ui/dom/utils/getDocumentElement.js +0 -4
  59. package/v2/floating-ui/dom/utils/getDocumentRect.js +0 -21
  60. package/v2/floating-ui/dom/utils/getNodeName.js +0 -4
  61. package/v2/floating-ui/dom/utils/getNodeScroll.js +0 -13
  62. package/v2/floating-ui/dom/utils/getOffsetParent.js +0 -43
  63. package/v2/floating-ui/dom/utils/getParentNode.js +0 -16
  64. package/v2/floating-ui/dom/utils/getRectRelativeToOffsetParent.js +0 -40
  65. package/v2/floating-ui/dom/utils/getScrollParent.js +0 -13
  66. package/v2/floating-ui/dom/utils/getScrollParents.js +0 -18
  67. package/v2/floating-ui/dom/utils/getViewportRect.js +0 -25
  68. package/v2/floating-ui/dom/utils/getWindowScrollBarX.js +0 -9
  69. package/v2/floating-ui/dom/utils/is.js +0 -38
  70. package/v2/floating-ui/dom/utils/math.js +0 -3
  71. package/v2/floating-ui/dom/utils/window.js +0 -13
  72. package/v2/index.js +0 -75
  73. package/v2/util/assign-deep.js +0 -12
  74. package/v2/util/env.js +0 -18
  75. package/v2/util/events.js +0 -12
  76. package/v2/util/frame.js +0 -5
  77. package/v2/util/lang.js +0 -6
  78. package/v2/util/popper.js +0 -5
  79. package/vue/ListItem.js +0 -44
  80. package/vue/ListItem.tsx +0 -64
  81. package/vue/VList.js +0 -133
  82. package/vue/VList.tsx +0 -291
  83. package/vue/ec.css +0 -48
  84. package/vue/ec.js +0 -78
  85. package/vue/index.js +0 -4
  86. package/vue/l.less +0 -69
@@ -1,22 +0,0 @@
1
- import { isShadowRoot } from './is';
2
- export function contains(parent, child) {
3
- var _a;
4
- const rootNode = (_a = child.getRootNode) === null || _a === void 0 ? void 0 : _a.call(child);
5
- // First, attempt with faster native method
6
- if (parent.contains(child)) {
7
- return true;
8
- }
9
- // then fallback to custom implementation with Shadow DOM support
10
- else if (rootNode && isShadowRoot(rootNode)) {
11
- let next = child;
12
- do {
13
- // use `===` replace node.isSameNode()
14
- if (next && parent === next) {
15
- return true;
16
- }
17
- // @ts-ignore: need a better way to handle this...
18
- next = next.parentNode || next.host;
19
- } while (next);
20
- }
21
- return false;
22
- }
@@ -1,35 +0,0 @@
1
- import { getBoundingClientRect } from './getBoundingClientRect';
2
- import { getNodeScroll } from './getNodeScroll';
3
- import { getNodeName } from './getNodeName';
4
- import { getDocumentElement } from './getDocumentElement';
5
- import { isHTMLElement, isScrollParent } from './is';
6
- export function convertOffsetParentRelativeRectToViewportRelativeRect({ rect, offsetParent, strategy, }) {
7
- const isOffsetParentAnElement = isHTMLElement(offsetParent);
8
- const documentElement = getDocumentElement(offsetParent);
9
- if (offsetParent === documentElement) {
10
- return rect;
11
- }
12
- let scroll = { scrollLeft: 0, scrollTop: 0 };
13
- const offsets = { x: 0, y: 0 };
14
- if (isOffsetParentAnElement ||
15
- (!isOffsetParentAnElement && strategy !== 'fixed')) {
16
- if (getNodeName(offsetParent) !== 'body' ||
17
- isScrollParent(documentElement)) {
18
- scroll = getNodeScroll(offsetParent);
19
- }
20
- if (isHTMLElement(offsetParent)) {
21
- const offsetRect = getBoundingClientRect(offsetParent, true);
22
- offsets.x = offsetRect.x + offsetParent.clientLeft;
23
- offsets.y = offsetRect.y + offsetParent.clientTop;
24
- }
25
- // This doesn't appear to be need to be negated.
26
- // else if (documentElement) {
27
- // offsets.x = getWindowScrollBarX(documentElement);
28
- // }
29
- }
30
- return {
31
- ...rect,
32
- x: rect.x - scroll.scrollLeft + offsets.x,
33
- y: rect.y - scroll.scrollTop + offsets.y,
34
- };
35
- }
@@ -1,27 +0,0 @@
1
- import { isHTMLElement } from './is';
2
- import { round } from './math';
3
- export function getBoundingClientRect(element, includeScale = false) {
4
- const clientRect = element.getBoundingClientRect();
5
- let scaleX = 1;
6
- let scaleY = 1;
7
- if (includeScale && isHTMLElement(element)) {
8
- scaleX =
9
- element.offsetWidth > 0
10
- ? round(clientRect.width) / element.offsetWidth || 1
11
- : 1;
12
- scaleY =
13
- element.offsetHeight > 0
14
- ? round(clientRect.height) / element.offsetHeight || 1
15
- : 1;
16
- }
17
- return {
18
- width: clientRect.width / scaleX,
19
- height: clientRect.height / scaleY,
20
- top: clientRect.top / scaleY,
21
- right: clientRect.right / scaleX,
22
- bottom: clientRect.bottom / scaleY,
23
- left: clientRect.left / scaleX,
24
- x: clientRect.left / scaleX,
25
- y: clientRect.top / scaleY,
26
- };
27
- }
@@ -1,76 +0,0 @@
1
- import { rectToClientRect, } from '../../core/';
2
- import { getViewportRect } from './getViewportRect';
3
- import { getDocumentRect } from './getDocumentRect';
4
- import { getScrollParents } from './getScrollParents';
5
- import { getOffsetParent } from './getOffsetParent';
6
- import { getDocumentElement } from './getDocumentElement';
7
- import { getComputedStyle } from './getComputedStyle';
8
- import { isElement, isHTMLElement } from './is';
9
- import { getBoundingClientRect } from './getBoundingClientRect';
10
- import { getParentNode } from './getParentNode';
11
- import { contains } from './contains';
12
- import { getNodeName } from './getNodeName';
13
- import { max, min } from './math';
14
- function getInnerBoundingClientRect(element) {
15
- const clientRect = getBoundingClientRect(element);
16
- const top = clientRect.top + element.clientTop;
17
- const left = clientRect.left + element.clientLeft;
18
- return {
19
- top,
20
- left,
21
- x: left,
22
- y: top,
23
- right: left + element.clientWidth,
24
- bottom: top + element.clientHeight,
25
- width: element.clientWidth,
26
- height: element.clientHeight,
27
- };
28
- }
29
- function getClientRectFromClippingParent(element, clippingParent) {
30
- if (clippingParent === 'viewport') {
31
- return rectToClientRect(getViewportRect(element));
32
- }
33
- if (isElement(clippingParent)) {
34
- return getInnerBoundingClientRect(clippingParent);
35
- }
36
- return rectToClientRect(getDocumentRect(getDocumentElement(element)));
37
- }
38
- // A "clipping parent" is an overflowable container with the characteristic of
39
- // clipping (or hiding) overflowing elements with a position different from
40
- // `initial`
41
- function getClippingParents(element) {
42
- const clippingParents = getScrollParents(getParentNode(element));
43
- const canEscapeClipping = ['absolute', 'fixed'].includes(getComputedStyle(element).position);
44
- const clipperElement = canEscapeClipping && isHTMLElement(element)
45
- ? getOffsetParent(element)
46
- : element;
47
- if (!isElement(clipperElement)) {
48
- return [];
49
- }
50
- // @ts-ignore isElement check ensures we return Array<Element>
51
- return clippingParents.filter((clippingParent) => isElement(clippingParent) &&
52
- contains(clippingParent, clipperElement) &&
53
- getNodeName(clippingParent) !== 'body');
54
- }
55
- // Gets the maximum area that the element is visible in due to any number of
56
- // clipping parents
57
- export function getClippingClientRect({ element, boundary, rootBoundary, }) {
58
- const mainClippingParents = boundary === 'clippingParents'
59
- ? getClippingParents(element)
60
- : [].concat(boundary);
61
- const clippingParents = [...mainClippingParents, rootBoundary];
62
- const firstClippingParent = clippingParents[0];
63
- const clippingRect = clippingParents.reduce((accRect, clippingParent) => {
64
- const rect = getClientRectFromClippingParent(element, clippingParent);
65
- accRect.top = max(rect.top, accRect.top);
66
- accRect.right = min(rect.right, accRect.right);
67
- accRect.bottom = min(rect.bottom, accRect.bottom);
68
- accRect.left = max(rect.left, accRect.left);
69
- return accRect;
70
- }, getClientRectFromClippingParent(element, firstClippingParent));
71
- clippingRect.width = clippingRect.right - clippingRect.left;
72
- clippingRect.height = clippingRect.bottom - clippingRect.top;
73
- clippingRect.x = clippingRect.left;
74
- clippingRect.y = clippingRect.top;
75
- return clippingRect;
76
- }
@@ -1,4 +0,0 @@
1
- import { getWindow } from './window';
2
- export function getComputedStyle(element) {
3
- return getWindow(element).getComputedStyle(element);
4
- }
@@ -1,6 +0,0 @@
1
- export function getDimensions(element) {
2
- return {
3
- width: element.offsetWidth,
4
- height: element.offsetHeight,
5
- };
6
- }
@@ -1,4 +0,0 @@
1
- import { isNode } from './is';
2
- export function getDocumentElement(node) {
3
- return ((isNode(node) ? node.ownerDocument : node.document) || window.document).documentElement;
4
- }
@@ -1,21 +0,0 @@
1
- import { getDocumentElement } from './getDocumentElement';
2
- import { getComputedStyle } from './getComputedStyle';
3
- import getWindowScrollBarX from './getWindowScrollBarX';
4
- import { getNodeScroll } from './getNodeScroll';
5
- import { max } from './math';
6
- // Gets the entire size of the scrollable document area, even extending outside
7
- // of the `<html>` and `<body>` rect bounds if horizontally scrollable
8
- export function getDocumentRect(element) {
9
- var _a;
10
- const html = getDocumentElement(element);
11
- const scroll = getNodeScroll(element);
12
- const body = (_a = element.ownerDocument) === null || _a === void 0 ? void 0 : _a.body;
13
- const width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);
14
- const height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);
15
- let x = -scroll.scrollLeft + getWindowScrollBarX(element);
16
- const y = -scroll.scrollTop;
17
- if (getComputedStyle(body || html).direction === 'rtl') {
18
- x += max(html.clientWidth, body ? body.clientWidth : 0) - width;
19
- }
20
- return { width, height, x, y };
21
- }
@@ -1,4 +0,0 @@
1
- import { isWindow } from './window';
2
- export function getNodeName(node) {
3
- return isWindow(node) ? '' : node ? (node.nodeName || '').toLowerCase() : '';
4
- }
@@ -1,13 +0,0 @@
1
- import { isWindow } from './window';
2
- export function getNodeScroll(element) {
3
- if (isWindow(element)) {
4
- return {
5
- scrollLeft: element.pageXOffset,
6
- scrollTop: element.pageYOffset,
7
- };
8
- }
9
- return {
10
- scrollLeft: element.scrollLeft,
11
- scrollTop: element.scrollTop,
12
- };
13
- }
@@ -1,43 +0,0 @@
1
- import { getNodeName } from './getNodeName';
2
- import { getParentNode } from './getParentNode';
3
- import { getWindow } from './window';
4
- import { isContainingBlock, isHTMLElement, isTableElement } from './is';
5
- function getTrueOffsetParent(element) {
6
- if (!isHTMLElement(element) ||
7
- getComputedStyle(element).position === 'fixed') {
8
- return null;
9
- }
10
- return element.offsetParent;
11
- }
12
- function getContainingBlock(element) {
13
- let currentNode = getParentNode(element);
14
- while (isHTMLElement(currentNode) &&
15
- !['html', 'body'].includes(getNodeName(currentNode))) {
16
- if (isContainingBlock(currentNode)) {
17
- return currentNode;
18
- }
19
- else {
20
- currentNode = currentNode.parentNode;
21
- }
22
- }
23
- return null;
24
- }
25
- // Gets the closest ancestor positioned element. Handles some edge cases,
26
- // such as table ancestors and cross browser bugs.
27
- export function getOffsetParent(element) {
28
- const window = getWindow(element);
29
- let offsetParent = getTrueOffsetParent(element);
30
- while (offsetParent &&
31
- isTableElement(offsetParent) &&
32
- getComputedStyle(offsetParent).position === 'static') {
33
- offsetParent = getTrueOffsetParent(offsetParent);
34
- }
35
- if (offsetParent &&
36
- (getNodeName(offsetParent) === 'html' ||
37
- (getNodeName(offsetParent) === 'body' &&
38
- getComputedStyle(offsetParent).position === 'static' &&
39
- !isContainingBlock(offsetParent)))) {
40
- return window;
41
- }
42
- return offsetParent || getContainingBlock(element) || window;
43
- }
@@ -1,16 +0,0 @@
1
- import { getNodeName } from './getNodeName';
2
- import { getDocumentElement } from './getDocumentElement';
3
- import { isShadowRoot } from './is';
4
- export function getParentNode(node) {
5
- if (getNodeName(node) === 'html') {
6
- return node;
7
- }
8
- return (
9
- // this is a quicker (but less type safe) way to save quite some bytes from the bundle
10
- // @ts-ignore
11
- node.assignedSlot || // step into the shadow DOM of the parent of a slotted node
12
- node.parentNode || // DOM Element detected
13
- (isShadowRoot(node) ? node.host : null) || // ShadowRoot detected
14
- getDocumentElement(node) // fallback
15
- );
16
- }
@@ -1,40 +0,0 @@
1
- import { getBoundingClientRect } from './getBoundingClientRect';
2
- import { getDocumentElement } from './getDocumentElement';
3
- import { getNodeName } from './getNodeName';
4
- import { getNodeScroll } from './getNodeScroll';
5
- import getWindowScrollBarX from './getWindowScrollBarX';
6
- import { isHTMLElement, isScrollParent } from './is';
7
- import { round } from './math';
8
- function isScaled(element) {
9
- const rect = getBoundingClientRect(element);
10
- return (round(rect.width) !== element.offsetWidth ||
11
- round(rect.height) !== element.offsetHeight);
12
- }
13
- export function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
14
- const isOffsetParentAnElement = isHTMLElement(offsetParent);
15
- const documentElement = getDocumentElement(offsetParent);
16
- const rect = getBoundingClientRect(element, isOffsetParentAnElement && isScaled(offsetParent));
17
- let scroll = { scrollLeft: 0, scrollTop: 0 };
18
- const offsets = { x: 0, y: 0 };
19
- if (isOffsetParentAnElement ||
20
- (!isOffsetParentAnElement && strategy !== 'fixed')) {
21
- if (getNodeName(offsetParent) !== 'body' ||
22
- isScrollParent(documentElement)) {
23
- scroll = getNodeScroll(offsetParent);
24
- }
25
- if (isHTMLElement(offsetParent)) {
26
- const offsetRect = getBoundingClientRect(offsetParent, true);
27
- offsets.x = offsetRect.x + offsetParent.clientLeft;
28
- offsets.y = offsetRect.y + offsetParent.clientTop;
29
- }
30
- else if (documentElement) {
31
- offsets.x = getWindowScrollBarX(documentElement);
32
- }
33
- }
34
- return {
35
- x: rect.left + scroll.scrollLeft - offsets.x,
36
- y: rect.top + scroll.scrollTop - offsets.y,
37
- width: rect.width,
38
- height: rect.height,
39
- };
40
- }
@@ -1,13 +0,0 @@
1
- import { getParentNode } from './getParentNode';
2
- import { getNodeName } from './getNodeName';
3
- import { isScrollParent, isHTMLElement } from './is';
4
- export function getScrollParent(node) {
5
- if (['html', 'body', '#document'].includes(getNodeName(node))) {
6
- // @ts-ignore assume body is always available
7
- return node.ownerDocument.body;
8
- }
9
- if (isHTMLElement(node) && isScrollParent(node)) {
10
- return node;
11
- }
12
- return getScrollParent(getParentNode(node));
13
- }
@@ -1,18 +0,0 @@
1
- import { getScrollParent } from './getScrollParent';
2
- import { getParentNode } from './getParentNode';
3
- import { getWindow } from './window';
4
- import { isScrollParent } from './is';
5
- export function getScrollParents(node, list = []) {
6
- var _a;
7
- const scrollParent = getScrollParent(node);
8
- const isBody = scrollParent === ((_a = node.ownerDocument) === null || _a === void 0 ? void 0 : _a.body);
9
- const win = getWindow(scrollParent);
10
- const target = isBody
11
- ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : [])
12
- : scrollParent;
13
- const updatedList = list.concat(target);
14
- return isBody
15
- ? updatedList
16
- : // @ts-ignore: isBody tells us target will be an HTMLElement here
17
- updatedList.concat(getScrollParents(getParentNode(target)));
18
- }
@@ -1,25 +0,0 @@
1
- import { getWindow } from './window';
2
- import { getDocumentElement } from './getDocumentElement';
3
- export function getViewportRect(element) {
4
- const win = getWindow(element);
5
- const html = getDocumentElement(element);
6
- const visualViewport = win.visualViewport;
7
- let width = html.clientWidth;
8
- let height = html.clientHeight;
9
- let x = 0;
10
- let y = 0;
11
- if (visualViewport) {
12
- width = visualViewport.width;
13
- height = visualViewport.height;
14
- // Uses Layout Viewport (like Chrome; Safari does not currently)
15
- // In Chrome, it returns a value very close to 0 (+/-) but contains rounding
16
- // errors due to floating point numbers, so we need to check precision.
17
- // Safari returns a number <= 0, usually < -1 when pinch-zoomed
18
- if (Math.abs(win.innerWidth / visualViewport.scale - visualViewport.width) <
19
- 0.01) {
20
- x = visualViewport.offsetLeft;
21
- y = visualViewport.offsetTop;
22
- }
23
- }
24
- return { width, height, x, y };
25
- }
@@ -1,9 +0,0 @@
1
- import { getBoundingClientRect } from './getBoundingClientRect';
2
- import { getDocumentElement } from './getDocumentElement';
3
- import { getNodeScroll } from './getNodeScroll';
4
- export default function getWindowScrollBarX(element) {
5
- // If <html> has a CSS width greater than the viewport, then this will be
6
- // incorrect for RTL.
7
- return (getBoundingClientRect(getDocumentElement(element)).left +
8
- getNodeScroll(element).scrollLeft);
9
- }
@@ -1,38 +0,0 @@
1
- import { getComputedStyle } from './getComputedStyle';
2
- import { getNodeName } from './getNodeName';
3
- import { getWindow } from './window';
4
- export function isHTMLElement(value) {
5
- return value instanceof getWindow(value).HTMLElement;
6
- }
7
- export function isElement(value) {
8
- return value instanceof getWindow(value).Element;
9
- }
10
- export function isNode(value) {
11
- return value instanceof getWindow(value).Node;
12
- }
13
- export function isShadowRoot(node) {
14
- const OwnElement = getWindow(node).ShadowRoot;
15
- return node instanceof OwnElement || node instanceof ShadowRoot;
16
- }
17
- export function isScrollParent(element) {
18
- // Firefox wants us to check `-x` and `-y` variations as well
19
- const { overflow, overflowX, overflowY } = getComputedStyle(element);
20
- return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);
21
- }
22
- export function isTableElement(element) {
23
- return ['table', 'td', 'th'].includes(getNodeName(element));
24
- }
25
- export function isContainingBlock(element) {
26
- // TODO: Try and use feature detection here instead
27
- const isFirefox = navigator.userAgent.toLowerCase().includes('firefox');
28
- const css = getComputedStyle(element);
29
- // This is non-exhaustive but covers the most common CSS properties that
30
- // create a containing block.
31
- // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
32
- return (css.transform !== 'none' ||
33
- css.perspective !== 'none' ||
34
- css.contain === 'paint' ||
35
- ['transform', 'perspective'].includes(css.willChange) ||
36
- (isFirefox && css.willChange === 'filter') ||
37
- (isFirefox && (css.filter ? css.filter !== 'none' : false)));
38
- }
@@ -1,3 +0,0 @@
1
- export const min = Math.min;
2
- export const max = Math.max;
3
- export const round = Math.round;
@@ -1,13 +0,0 @@
1
- export function isWindow(value) {
2
- return (value === null || value === void 0 ? void 0 : value.toString()) === '[object Window]';
3
- }
4
- export function getWindow(node) {
5
- if (node == null) {
6
- return window;
7
- }
8
- if (!isWindow(node)) {
9
- const ownerDocument = node.ownerDocument;
10
- return ownerDocument ? ownerDocument.defaultView || window : window;
11
- }
12
- return node;
13
- }
package/v2/index.js DELETED
@@ -1,75 +0,0 @@
1
- import { assign } from './util/assign-deep';
2
- import { config } from './config';
3
- import 'vue-resize/dist/vue-resize.css';
4
- // Components
5
- import PrivateDropdown from './components/Dropdown.vue';
6
- import PrivateMenu from './components/Menu.vue';
7
- import PrivatePopper from './components/Popper';
8
- import PrivatePopperContent from './components/PopperContent.vue';
9
- import PrivatePopperMethods from './components/PopperMethods';
10
- import PrivatePopperWrapper from './components/PopperWrapper.vue';
11
- import PrivateThemeClass from './components/ThemeClass';
12
- import PrivateTooltip from './components/Tooltip.vue';
13
- import PrivateTooltipDirective from './components/TooltipDirective.vue';
14
- // Directives
15
- import PrivateVTooltip from './directives/v-tooltip';
16
- import PrivateVClosePopper from './directives/v-close-popper';
17
- /* Exports */
18
- export const options = config;
19
- // Directive
20
- export const VTooltip = PrivateVTooltip;
21
- export { createTooltip, destroyTooltip } from './directives/v-tooltip';
22
- export const VClosePopper = PrivateVClosePopper;
23
- console.log(PrivateVClosePopper)
24
- // Components
25
- export const Dropdown = PrivateDropdown;
26
- export const Menu = PrivateMenu;
27
- export const Popper = PrivatePopper;
28
- export const PopperContent = PrivatePopperContent;
29
- export const PopperMethods = PrivatePopperMethods;
30
- export const PopperWrapper = PrivatePopperWrapper;
31
- export const ThemeClass = PrivateThemeClass;
32
- export const Tooltip = PrivateTooltip;
33
- export const TooltipDirective = PrivateTooltipDirective;
34
- // Utils
35
- export { hideAllPoppers } from './components/Popper';
36
- export * from './util/events';
37
- export { placements } from './util/popper';
38
- /* Vue plugin */
39
- export function install(app, options = {}) {
40
- if (app.$_vTooltipInstalled)
41
- return;
42
- app.$_vTooltipInstalled = true;
43
- assign(config, options);
44
- // Directive
45
- app.directive('tooltip', PrivateVTooltip);
46
- app.directive('close-popper', PrivateVClosePopper);
47
- // Components
48
- // eslint-disable-next-line vue/component-definition-name-casing
49
- app.component('v-tooltip', PrivateTooltip);
50
- app.component('VTooltip', PrivateTooltip);
51
- // eslint-disable-next-line vue/component-definition-name-casing
52
- app.component('v-dropdown', PrivateDropdown);
53
- app.component('VDropdown', PrivateDropdown);
54
- // eslint-disable-next-line vue/component-definition-name-casing
55
- app.component('v-menu', PrivateMenu);
56
- app.component('VMenu', PrivateMenu);
57
- }
58
- const plugin = {
59
- // eslint-disable-next-line no-undef
60
- //version: VERSION,
61
- install,
62
- options: config,
63
- };
64
- // Auto-install
65
- let GlobalVue = null;
66
- if (typeof window !== 'undefined') {
67
- GlobalVue = window.Vue;
68
- }
69
- else if (typeof global !== 'undefined') {
70
- GlobalVue = global.Vue;
71
- }
72
- if (GlobalVue) {
73
- GlobalVue.use(plugin);
74
- }
75
- export default plugin;
@@ -1,12 +0,0 @@
1
- export function assign(to, from) {
2
- for (const key in from) {
3
- if (Object.prototype.hasOwnProperty.call(from, key)) {
4
- if (typeof from[key] === 'object' && to[key]) {
5
- assign(to[key], from[key]);
6
- }
7
- else {
8
- to[key] = from[key];
9
- }
10
- }
11
- }
12
- }
package/v2/util/env.js DELETED
@@ -1,18 +0,0 @@
1
- export let supportsPassive = false;
2
- if (typeof window !== 'undefined') {
3
- supportsPassive = false;
4
- try {
5
- const opts = Object.defineProperty({}, 'passive', {
6
- get() {
7
- supportsPassive = true;
8
- },
9
- });
10
- window.addEventListener('test', null, opts);
11
- }
12
- catch (e) { }
13
- }
14
- export let isIOS = false;
15
- if (typeof window !== 'undefined' && typeof navigator !== 'undefined') {
16
- // @ts-expect-error MSStream is missing in window type
17
- isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
18
- }
package/v2/util/events.js DELETED
@@ -1,12 +0,0 @@
1
- export const SHOW_EVENT_MAP = {
2
- hover: 'mouseenter',
3
- focus: 'focus',
4
- click: 'click',
5
- touch: 'touchstart',
6
- };
7
- export const HIDE_EVENT_MAP = {
8
- hover: 'mouseleave',
9
- focus: 'blur',
10
- click: 'click',
11
- touch: 'touchend',
12
- };
package/v2/util/frame.js DELETED
@@ -1,5 +0,0 @@
1
- export function nextFrame() {
2
- return new Promise(resolve => requestAnimationFrame(() => {
3
- requestAnimationFrame(resolve);
4
- }));
5
- }
package/v2/util/lang.js DELETED
@@ -1,6 +0,0 @@
1
- export function removeFromArray(array, item) {
2
- const index = array.indexOf(item);
3
- if (index !== -1) {
4
- array.splice(index, 1);
5
- }
6
- }
package/v2/util/popper.js DELETED
@@ -1,5 +0,0 @@
1
- export const placements = ['auto', 'top', 'bottom', 'left', 'right'].reduce((acc, base) => acc.concat([
2
- base,
3
- `${base}-start`,
4
- `${base}-end`,
5
- ]), []);
package/vue/ListItem.js DELETED
@@ -1,44 +0,0 @@
1
- import { jsx as _jsx } from "vue/jsx-runtime";
2
- /** @jsxImportSource vue */
3
- import { ref, defineComponent, watch } from "vue";
4
- import { isRTLDocument } from "../core/environment";
5
- /**
6
- * @internal
7
- */
8
- export const ListItem = /*#__PURE__*/ defineComponent({
9
- props: {
10
- _children: { type: Object, required: true },
11
- _resizer: { type: Object, required: true },
12
- _index: { type: Number, required: true },
13
- _offset: { type: Number, required: true },
14
- _hide: { type: Boolean },
15
- _isHorizontal: { type: Boolean },
16
- _element: { type: String, required: true },
17
- },
18
- setup(props) {
19
- const elementRef = ref();
20
- // The index may be changed if elements are inserted to or removed from the start of props.children
21
- watch(() => elementRef.value && props._index, (_, __, onCleanup) => {
22
- const cleanupObserver = props._resizer(elementRef.value, props._index);
23
- onCleanup(cleanupObserver);
24
- }, {
25
- flush: "post",
26
- });
27
- return () => {
28
- const { _children: children, _offset: offset, _hide: hide, _element: Element, _isHorizontal: isHorizontal, } = props;
29
- const style = {
30
- margin: 0,
31
- padding: 0,
32
- position: "absolute",
33
- [isHorizontal ? "height" : "width"]: "100%",
34
- [isHorizontal ? "top" : "left"]: "0px",
35
- [isHorizontal ? (isRTLDocument() ? "right" : "left") : "top"]: offset + "px",
36
- visibility: hide ? "hidden" : "visible",
37
- };
38
- if (isHorizontal) {
39
- style.display = "flex";
40
- }
41
- return (_jsx(Element, { ref: elementRef, style: style, children: children }));
42
- };
43
- },
44
- });