@quidgest/ui 0.14.10 → 0.14.11
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/manifest/components.json +1 -0
- package/dist/ui.css +21 -0
- package/dist/ui.esm.js +1228 -1028
- package/dist/ui.js +22 -22
- package/dist/ui.min.css +1 -1
- package/dist/ui.min.js +90 -74
- package/dist/ui.scss +23 -1
- package/esm/components/QCombobox/QCombobox.d.ts +5 -0
- package/esm/components/QCombobox/QCombobox.d.ts.map +1 -1
- package/esm/components/QDropdownMenu/QDropdownMenu.d.ts +16 -0
- package/esm/components/QDropdownMenu/QDropdownMenu.d.ts.map +1 -0
- package/esm/components/QDropdownMenu/QDropdownMenu.vue.js +38 -0
- package/esm/components/QDropdownMenu/QDropdownMenu.vue2.js +4 -0
- package/esm/components/QDropdownMenu/QDropdownMenuContent.d.ts +148 -0
- package/esm/components/QDropdownMenu/QDropdownMenuContent.d.ts.map +1 -0
- package/esm/components/QDropdownMenu/QDropdownMenuContent.vue.js +153 -0
- package/esm/components/QDropdownMenu/QDropdownMenuContent.vue2.js +4 -0
- package/esm/components/QDropdownMenu/index.d.ts +4 -0
- package/esm/components/QDropdownMenu/index.d.ts.map +1 -0
- package/esm/components/QDropdownMenu/index.js +6 -0
- package/esm/components/QDropdownMenu/types.d.ts +95 -0
- package/esm/components/QDropdownMenu/types.d.ts.map +1 -0
- package/esm/components/QDropdownMenu/types.js +8 -0
- package/esm/components/QList/QList.d.ts +74 -0
- package/esm/components/QList/QList.d.ts.map +1 -1
- package/esm/components/QList/QList.vue.js +118 -100
- package/esm/components/QList/QListItem.d.ts +2 -0
- package/esm/components/QList/QListItem.d.ts.map +1 -1
- package/esm/components/QList/QListItem.vue.js +32 -30
- package/esm/components/QList/types.d.ts +0 -7
- package/esm/components/QList/types.d.ts.map +1 -1
- package/esm/components/QOverlay/QOverlay.d.ts +1 -0
- package/esm/components/QOverlay/QOverlay.d.ts.map +1 -1
- package/esm/components/QOverlay/QOverlay.vue.js +87 -82
- package/esm/components/QOverlay/types.d.ts +4 -0
- package/esm/components/QOverlay/types.d.ts.map +1 -1
- package/esm/components/QSelect/QSelect.d.ts +5 -0
- package/esm/components/QSelect/QSelect.d.ts.map +1 -1
- package/esm/components/index.d.ts +1 -0
- package/esm/components/index.d.ts.map +1 -1
- package/esm/components/index.js +44 -42
- package/esm/composables/overlay.d.ts +4 -0
- package/esm/composables/overlay.d.ts.map +1 -1
- package/esm/composables/overlay.js +69 -62
- package/esm/index.d.ts +1 -0
- package/package.json +2 -33
- /package/{LICENSE.md → LICENSE} +0 -0
|
@@ -1,130 +1,137 @@
|
|
|
1
|
-
function
|
|
2
|
-
const
|
|
3
|
-
let
|
|
1
|
+
function $(t, i, n, e) {
|
|
2
|
+
const o = (e == null ? void 0 : e.offset) ?? 0, r = (e == null ? void 0 : e.crossOffset) ?? 0, g = (e == null ? void 0 : e.placement) ?? "bottom", s = t.getBoundingClientRect(), u = i.getBoundingClientRect(), d = n == null ? void 0 : n.getBoundingClientRect(), h = C(s, u, g, o), l = I(s, u, h), b = y(l, h, o), p = O(b, h, r), c = A(p, u, h);
|
|
3
|
+
let w;
|
|
4
4
|
if (e != null && e.arrow) {
|
|
5
|
-
if (!
|
|
5
|
+
if (!d)
|
|
6
6
|
throw new Error("[Quidgest UI] The arrow element must exist to compute its position");
|
|
7
|
-
|
|
7
|
+
w = k(c, s, u, d, h);
|
|
8
8
|
}
|
|
9
|
-
return { overlayCoords:
|
|
9
|
+
return { overlayCoords: c, arrowCoords: w, placement: h };
|
|
10
10
|
}
|
|
11
|
-
function
|
|
12
|
-
const
|
|
13
|
-
if (x(
|
|
14
|
-
const
|
|
11
|
+
function C(t, i, n, e) {
|
|
12
|
+
const o = a(t, i, n, e);
|
|
13
|
+
if (x(o)) {
|
|
14
|
+
const r = f(n), s = {
|
|
15
15
|
top: "bottom",
|
|
16
16
|
bottom: "top",
|
|
17
17
|
left: "right",
|
|
18
18
|
right: "left"
|
|
19
|
-
}[
|
|
19
|
+
}[r], u = a(
|
|
20
20
|
t,
|
|
21
21
|
i,
|
|
22
22
|
s,
|
|
23
23
|
e
|
|
24
24
|
);
|
|
25
|
-
if (x(
|
|
25
|
+
if (x(u))
|
|
26
26
|
return n;
|
|
27
|
-
const
|
|
28
|
-
return
|
|
27
|
+
const d = S(n);
|
|
28
|
+
return d ? `${s}-${d}` : s;
|
|
29
29
|
}
|
|
30
30
|
return n;
|
|
31
31
|
}
|
|
32
|
-
function
|
|
33
|
-
const e =
|
|
34
|
-
return e === "x" ?
|
|
32
|
+
function A(t, i, n) {
|
|
33
|
+
const e = m(n), o = (g, s, u) => Math.min(Math.max(g, s), u), r = { ...t };
|
|
34
|
+
return e === "x" ? r.x = o(t.x, 8, window.innerWidth - i.width - 8) : r.y = o(t.y, 8, window.innerHeight - i.height - 8), r;
|
|
35
35
|
}
|
|
36
|
-
function
|
|
37
|
-
const e =
|
|
36
|
+
function y(t, i, n) {
|
|
37
|
+
const e = f(i);
|
|
38
38
|
return {
|
|
39
39
|
x: t.x + (e === "left" ? -n : e === "right" ? n : 0),
|
|
40
40
|
y: t.y + (e === "top" ? -n : e === "bottom" ? n : 0)
|
|
41
41
|
};
|
|
42
42
|
}
|
|
43
|
-
function
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
43
|
+
function O(t, i, n) {
|
|
44
|
+
const e = f(i);
|
|
45
|
+
return {
|
|
46
|
+
x: t.x + (e === "top" || e === "bottom" ? n : 0),
|
|
47
|
+
y: t.y + (e === "right" || e === "left" ? n : 0)
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
function k(t, i, n, e, o) {
|
|
51
|
+
if (m(o) === "y") {
|
|
52
|
+
const g = i.top + i.height / 2, s = t.y + n.height / 2, u = s - g, d = n.height / 2 - u - e.height / 2 + 2;
|
|
53
|
+
if (d > 0 && d < n.height - e.height)
|
|
47
54
|
return {
|
|
48
|
-
y:
|
|
55
|
+
y: d
|
|
49
56
|
};
|
|
50
57
|
} else {
|
|
51
|
-
const
|
|
52
|
-
if (
|
|
58
|
+
const g = i.left + i.width / 2, s = t.x + n.width / 2, u = s - g, d = n.width / 2 - u - e.width / 2 + 2;
|
|
59
|
+
if (d > 0 && d < n.width - e.width)
|
|
53
60
|
return {
|
|
54
|
-
x:
|
|
61
|
+
x: d
|
|
55
62
|
};
|
|
56
63
|
}
|
|
57
64
|
}
|
|
58
|
-
function
|
|
59
|
-
const [e,
|
|
65
|
+
function I(t, i, n) {
|
|
66
|
+
const [e, o] = n.split("-"), r = t.x + t.width / 2 - i.width / 2, g = t.y + t.height / 2 - i.height / 2;
|
|
60
67
|
let s;
|
|
61
68
|
switch (e) {
|
|
62
69
|
case "top":
|
|
63
|
-
s = { x:
|
|
70
|
+
s = { x: r, y: t.y - i.height };
|
|
64
71
|
break;
|
|
65
72
|
case "bottom":
|
|
66
|
-
s = { x:
|
|
73
|
+
s = { x: r, y: t.y + t.height };
|
|
67
74
|
break;
|
|
68
75
|
case "left":
|
|
69
|
-
s = { x: t.x - i.width, y:
|
|
76
|
+
s = { x: t.x - i.width, y: g };
|
|
70
77
|
break;
|
|
71
78
|
case "right":
|
|
72
|
-
s = { x: t.x + t.width, y:
|
|
79
|
+
s = { x: t.x + t.width, y: g };
|
|
73
80
|
break;
|
|
74
81
|
default:
|
|
75
82
|
throw new Error(`[Quidgest UI] Invalid placement value: ${n}`);
|
|
76
83
|
}
|
|
77
|
-
if (!
|
|
84
|
+
if (!o)
|
|
78
85
|
return s;
|
|
79
|
-
const
|
|
80
|
-
switch (
|
|
86
|
+
const d = m(n) === "y" ? "height" : "width", h = m(n), l = t[d] / 2 - i[d] / 2;
|
|
87
|
+
switch (o) {
|
|
81
88
|
case "start":
|
|
82
|
-
s[h] -=
|
|
89
|
+
s[h] -= l;
|
|
83
90
|
break;
|
|
84
91
|
case "end":
|
|
85
|
-
s[h] +=
|
|
92
|
+
s[h] += l;
|
|
86
93
|
break;
|
|
87
94
|
default:
|
|
88
|
-
throw new Error(`[Quidgest UI] Invalid alignment value: ${
|
|
95
|
+
throw new Error(`[Quidgest UI] Invalid alignment value: ${o}`);
|
|
89
96
|
}
|
|
90
97
|
return s;
|
|
91
98
|
}
|
|
92
|
-
function
|
|
93
|
-
const
|
|
94
|
-
let
|
|
95
|
-
switch (
|
|
99
|
+
function a(t, i, n, e) {
|
|
100
|
+
const o = f(n);
|
|
101
|
+
let r = 0;
|
|
102
|
+
switch (o) {
|
|
96
103
|
case "top":
|
|
97
|
-
|
|
104
|
+
r = t.top - (i.height + e);
|
|
98
105
|
break;
|
|
99
106
|
case "bottom":
|
|
100
|
-
|
|
107
|
+
r = window.innerHeight - t.bottom - (i.height + e);
|
|
101
108
|
break;
|
|
102
109
|
case "left":
|
|
103
|
-
|
|
110
|
+
r = t.left - (i.width + e);
|
|
104
111
|
break;
|
|
105
112
|
case "right":
|
|
106
|
-
|
|
113
|
+
r = window.innerWidth - t.right - (i.width + e);
|
|
107
114
|
break;
|
|
108
115
|
default:
|
|
109
|
-
throw new Error(`[Quidgest UI] Invalid side value: ${
|
|
116
|
+
throw new Error(`[Quidgest UI] Invalid side value: ${o}`);
|
|
110
117
|
}
|
|
111
|
-
return
|
|
118
|
+
return r;
|
|
112
119
|
}
|
|
113
|
-
function
|
|
120
|
+
function M(t) {
|
|
114
121
|
return t === "x" ? "y" : "x";
|
|
115
122
|
}
|
|
116
|
-
function
|
|
117
|
-
const i =
|
|
123
|
+
function P(t) {
|
|
124
|
+
const i = f(t);
|
|
118
125
|
return ["left", "right"].includes(i) ? "x" : "y";
|
|
119
126
|
}
|
|
120
|
-
function
|
|
121
|
-
return
|
|
127
|
+
function m(t) {
|
|
128
|
+
return M(P(t));
|
|
122
129
|
}
|
|
123
|
-
function
|
|
130
|
+
function f(t) {
|
|
124
131
|
const [i] = t.split("-");
|
|
125
132
|
return i;
|
|
126
133
|
}
|
|
127
|
-
function
|
|
134
|
+
function S(t) {
|
|
128
135
|
const [, i] = t.split("-");
|
|
129
136
|
return i;
|
|
130
137
|
}
|
|
@@ -132,11 +139,11 @@ function x(t) {
|
|
|
132
139
|
return t < 0;
|
|
133
140
|
}
|
|
134
141
|
export {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
142
|
+
$ as computePosition,
|
|
143
|
+
m as getAlignmentAxis,
|
|
144
|
+
S as getAlignmentFromPlacement,
|
|
145
|
+
P as getMainAxis,
|
|
146
|
+
M as getOppositeAxis,
|
|
147
|
+
f as getSideFromPlacement,
|
|
141
148
|
x as isOutOfBounds
|
|
142
149
|
};
|
package/esm/index.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ declare module '@vue/runtime-core' {
|
|
|
17
17
|
QCollapsible: typeof import('@quidgest/ui/components')['QCollapsible']
|
|
18
18
|
QCombobox: typeof import('@quidgest/ui/components')['QCombobox']
|
|
19
19
|
QDialog: typeof import('@quidgest/ui/components')['QDialog']
|
|
20
|
+
QDropdownMenu: typeof import('@quidgest/ui/components')['QDropdownMenu']
|
|
20
21
|
QField: typeof import('@quidgest/ui/components')['QField']
|
|
21
22
|
QIcon: typeof import('@quidgest/ui/components')['QIcon']
|
|
22
23
|
QIconFont: typeof import('@quidgest/ui/components')['QIconFont']
|
package/package.json
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quidgest/ui",
|
|
3
3
|
"description": "Quidgest's UI framework",
|
|
4
|
-
"version": "0.14.
|
|
4
|
+
"version": "0.14.11",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"author": "Quidgest",
|
|
8
8
|
"license": "MIT",
|
|
9
|
-
"engines": {
|
|
10
|
-
"node": ">=22.0.0"
|
|
11
|
-
},
|
|
12
9
|
"keywords": [
|
|
13
10
|
"vue",
|
|
14
11
|
"component-library",
|
|
@@ -57,39 +54,18 @@
|
|
|
57
54
|
"@storybook/theming": "^8.4.7",
|
|
58
55
|
"@storybook/vue3": "^8.4.7",
|
|
59
56
|
"@storybook/vue3-vite": "^8.4.7",
|
|
60
|
-
"@tsconfig/node20": "^20.1.4",
|
|
61
|
-
"@types/node": "^22.10.5",
|
|
62
|
-
"@typescript-eslint/eslint-plugin": "^8.19.0",
|
|
63
|
-
"@typescript-eslint/parser": "^8.19.0",
|
|
64
57
|
"@vitejs/plugin-vue": "^5.2.1",
|
|
65
|
-
"@vitest/coverage-v8": "^2.1.8",
|
|
66
|
-
"@vitest/eslint-plugin": "^1.1.24",
|
|
67
|
-
"@vitest/ui": "^2.1.8",
|
|
68
|
-
"@vue/eslint-config-prettier": "^10.1.0",
|
|
69
|
-
"@vue/eslint-config-typescript": "^14.2.0",
|
|
70
58
|
"@vue/test-utils": "^2.4.6",
|
|
71
59
|
"@vue/tsconfig": "^0.7.0",
|
|
72
60
|
"acorn-walk": "^8.3.4",
|
|
73
61
|
"autoprefixer": "^10.4.20",
|
|
74
62
|
"cssnano": "^7.0.6",
|
|
75
|
-
"eslint": "^9.17.0",
|
|
76
|
-
"eslint-plugin-prettier": "^5.2.1",
|
|
77
|
-
"eslint-plugin-storybook": "^0.11.2",
|
|
78
|
-
"eslint-plugin-vue": "^9.32.0",
|
|
79
|
-
"happy-dom": "^16.3.0",
|
|
80
|
-
"husky": "^9.1.7",
|
|
81
|
-
"lint-staged": "^15.3.0",
|
|
82
63
|
"postcss": "^8.4.49",
|
|
83
|
-
"prettier": "^3.4.2",
|
|
84
|
-
"rimraf": "^6.0.1",
|
|
85
64
|
"sass": "^1.83.1",
|
|
86
65
|
"storybook": "^8.4.7",
|
|
87
|
-
"stylelint": "^16.12.0",
|
|
88
|
-
"stylelint-config-sass-guidelines": "^12.1.0",
|
|
89
66
|
"typescript": "~5.6.3",
|
|
90
67
|
"vite": "^6.0.7",
|
|
91
68
|
"vite-plugin-dts": "^4.4.0",
|
|
92
|
-
"vitest": "^2.1.8",
|
|
93
69
|
"vue-eslint-parser": "^9.4.3",
|
|
94
70
|
"vue-tsc": "^2.2.0"
|
|
95
71
|
},
|
|
@@ -102,14 +78,7 @@
|
|
|
102
78
|
"build:dist": "vite build",
|
|
103
79
|
"build:esm": "node build/esm.js",
|
|
104
80
|
"build:css": "node build/css.js",
|
|
105
|
-
"type-check": "vue-tsc --noEmit
|
|
106
|
-
"format": "prettier . --check",
|
|
107
|
-
"format:fix": "prettier . --write",
|
|
108
|
-
"lint": "eslint --max-warnings 0 .",
|
|
109
|
-
"lint:fix": "eslint . --fix",
|
|
110
|
-
"lint:style": "stylelint \"**/*.scss\"",
|
|
111
|
-
"test": "vitest",
|
|
112
|
-
"test:coverage": "vitest run --coverage",
|
|
81
|
+
"type-check": "vue-tsc --noEmit --composite false",
|
|
113
82
|
"storybook": "storybook dev -p 6006",
|
|
114
83
|
"build:storybook": "storybook build"
|
|
115
84
|
}
|
/package/{LICENSE.md → LICENSE}
RENAMED
|
File without changes
|