@quidgest/ui 0.16.30 → 0.16.32
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/json/api.json +11 -2
- package/dist/ui.css +21 -27
- package/dist/ui.esm.js +1490 -1473
- package/dist/ui.js +9 -9
- package/dist/ui.min.css +1 -1
- package/dist/ui.min.js +136 -140
- package/dist/ui.scss +39 -37
- package/esm/components/QDateTimePicker/QDateTimePicker.d.ts.map +1 -1
- package/esm/components/QDateTimePicker/QDateTimePicker.vue.js +31 -30
- package/esm/components/QDropdownMenu/QDropdownMenu.d.ts +21 -1
- package/esm/components/QDropdownMenu/QDropdownMenu.d.ts.map +1 -1
- package/esm/components/QDropdownMenu/QDropdownMenu.vue.js +24 -15
- package/esm/components/QDropdownMenu/QDropdownMenuContent.d.ts +12 -5
- package/esm/components/QDropdownMenu/QDropdownMenuContent.d.ts.map +1 -1
- package/esm/components/QDropdownMenu/QDropdownMenuContent.vue.js +89 -80
- package/esm/components/QDropdownMenu/index.d.ts +69 -22
- package/esm/components/QDropdownMenu/index.d.ts.map +1 -1
- package/esm/composables/theme.d.ts +14 -15
- package/esm/composables/theme.d.ts.map +1 -1
- package/esm/composables/theme.js +13 -13
- package/esm/framework.js +14 -14
- package/esm/templates/theme.js +35 -35
- package/esm/utils/theme.d.ts +14 -14
- package/esm/utils/theme.d.ts.map +1 -1
- package/esm/utils/theme.js +33 -33
- package/package.json +1 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { QList as
|
|
3
|
-
import { QOverlay as
|
|
4
|
-
import { QIcon as
|
|
5
|
-
import { DEFAULT_ICONS as
|
|
6
|
-
const
|
|
1
|
+
import { defineComponent as F, mergeModels as x, useModel as C, ref as A, computed as M, useTemplateRef as U, resolveComponent as z, createBlock as q, openBlock as d, unref as y, normalizeClass as H, withCtx as r, createElementVNode as j, withModifiers as G, createVNode as E, renderSlot as f, createElementBlock as R, createCommentVNode as k, toDisplayString as J, Fragment as W, normalizeProps as b, guardReactiveProps as V, mergeProps as X, nextTick as Y } from "vue";
|
|
2
|
+
import { QList as Z } from "../QList/index.js";
|
|
3
|
+
import { QOverlay as K } from "../QOverlay/index.js";
|
|
4
|
+
import { QIcon as ee } from "../QIcon/index.js";
|
|
5
|
+
import { DEFAULT_ICONS as te } from "./types.js";
|
|
6
|
+
const oe = {
|
|
7
7
|
key: 0,
|
|
8
8
|
class: "q-dropdown-menu__extra"
|
|
9
|
-
},
|
|
9
|
+
}, re = /* @__PURE__ */ F({
|
|
10
10
|
__name: "QDropdownMenuContent",
|
|
11
|
-
props: /* @__PURE__ */
|
|
11
|
+
props: /* @__PURE__ */ x({
|
|
12
12
|
id: {},
|
|
13
13
|
class: {},
|
|
14
14
|
activator: {},
|
|
@@ -23,7 +23,7 @@ const te = {
|
|
|
23
23
|
delay: { default: 500 },
|
|
24
24
|
trigger: { default: "hover" },
|
|
25
25
|
depth: { default: 0 },
|
|
26
|
-
icons: { default: () =>
|
|
26
|
+
icons: { default: () => te },
|
|
27
27
|
offset: { default: 0 },
|
|
28
28
|
crossOffset: { default: -5 }
|
|
29
29
|
}, {
|
|
@@ -32,139 +32,139 @@ const te = {
|
|
|
32
32
|
highlighted: {},
|
|
33
33
|
highlightedModifiers: {}
|
|
34
34
|
}),
|
|
35
|
-
emits: /* @__PURE__ */
|
|
36
|
-
setup(
|
|
37
|
-
const e =
|
|
38
|
-
function
|
|
35
|
+
emits: /* @__PURE__ */ x(["select", "hide", "focus-previous"], ["update:modelValue", "update:highlighted"]),
|
|
36
|
+
setup(u, { emit: P }) {
|
|
37
|
+
const e = u, c = P, m = C(u, "modelValue"), i = C(u, "highlighted"), s = A(void 0), _ = A([]), S = M(() => e.depth !== 0 ? e.offset : 4), B = M(() => e.depth !== 0 ? e.crossOffset : void 0), p = U("qListRef");
|
|
38
|
+
function D(t) {
|
|
39
39
|
var o;
|
|
40
|
-
const n = (o = e.items) == null ? void 0 : o.find((
|
|
41
|
-
|
|
42
|
-
const a =
|
|
43
|
-
|
|
40
|
+
const n = (o = e.items) == null ? void 0 : o.find((l) => l[e.itemValue] === t);
|
|
41
|
+
_.value = (n == null ? void 0 : n.items) ?? [];
|
|
42
|
+
const a = _.value.length > 0;
|
|
43
|
+
i.value = t, a ? g(t) : I(t);
|
|
44
44
|
}
|
|
45
|
-
function
|
|
45
|
+
function O(t) {
|
|
46
46
|
var n;
|
|
47
47
|
if (t.key)
|
|
48
48
|
switch (["Enter", "ArrowDown", "ArrowUp", "ArrowLeft", "ArrowRight"].includes(t.key) && (t.preventDefault(), t.stopPropagation()), t.key) {
|
|
49
49
|
case "ArrowRight":
|
|
50
|
-
const a = (n =
|
|
51
|
-
e.items && (a || a === 0) && e.items[a] && (
|
|
50
|
+
const a = (n = p.value) == null ? void 0 : n.getActiveItemIndex();
|
|
51
|
+
e.items && (a || a === 0) && e.items[a] && (i.value = e.items[a].key, g(e.items[a].key));
|
|
52
52
|
break;
|
|
53
53
|
case "ArrowLeft":
|
|
54
|
-
|
|
54
|
+
h();
|
|
55
55
|
break;
|
|
56
56
|
case "Escape":
|
|
57
57
|
case "Tab":
|
|
58
|
-
|
|
58
|
+
v();
|
|
59
59
|
break;
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
|
-
function
|
|
63
|
-
e.trigger === "hover" && (
|
|
62
|
+
function $(t) {
|
|
63
|
+
e.trigger === "hover" && (i.value = t, g(t));
|
|
64
64
|
}
|
|
65
|
-
function
|
|
66
|
-
|
|
65
|
+
function I(t) {
|
|
66
|
+
c("select", t), v();
|
|
67
67
|
}
|
|
68
|
-
function
|
|
69
|
-
|
|
68
|
+
function N() {
|
|
69
|
+
h();
|
|
70
70
|
}
|
|
71
|
-
function
|
|
72
|
-
|
|
71
|
+
function h() {
|
|
72
|
+
s.value = void 0, i.value = void 0, m.value = !1, c("focus-previous");
|
|
73
73
|
}
|
|
74
|
-
function
|
|
75
|
-
|
|
74
|
+
function v() {
|
|
75
|
+
h(), c("hide");
|
|
76
76
|
}
|
|
77
|
-
function
|
|
78
|
-
|
|
77
|
+
function g(t) {
|
|
78
|
+
s.value = t;
|
|
79
79
|
}
|
|
80
|
-
function
|
|
80
|
+
function Q() {
|
|
81
81
|
var a, o;
|
|
82
82
|
const t = (a = e.items) == null ? void 0 : a.findIndex(
|
|
83
|
-
(
|
|
83
|
+
(l) => l[e.itemValue] === s.value
|
|
84
84
|
);
|
|
85
85
|
if (!t && t !== 0) return;
|
|
86
|
-
const n = (o =
|
|
87
|
-
|
|
86
|
+
const n = (o = p.value) == null ? void 0 : o.getItem(t);
|
|
87
|
+
s.value = void 0, i.value = void 0, n == null || n.focus();
|
|
88
88
|
}
|
|
89
|
-
function
|
|
90
|
-
|
|
89
|
+
function T() {
|
|
90
|
+
Y(() => {
|
|
91
91
|
var t;
|
|
92
|
-
return (t =
|
|
92
|
+
return (t = p.value) == null ? void 0 : t.$el.focus();
|
|
93
93
|
});
|
|
94
94
|
}
|
|
95
95
|
return (t, n) => {
|
|
96
|
-
const a =
|
|
97
|
-
return
|
|
96
|
+
const a = z("q-dropdown-menu-content", !0);
|
|
97
|
+
return d(), q(y(K), {
|
|
98
98
|
id: e.id,
|
|
99
|
-
modelValue:
|
|
100
|
-
"onUpdate:modelValue": n[0] || (n[0] = (o) =>
|
|
99
|
+
modelValue: m.value,
|
|
100
|
+
"onUpdate:modelValue": n[0] || (n[0] = (o) => m.value = o),
|
|
101
101
|
anchor: e.activator,
|
|
102
102
|
appearance: e.appearance,
|
|
103
103
|
inline: e.inline,
|
|
104
104
|
delay: e.delay,
|
|
105
|
-
offset:
|
|
106
|
-
"cross-offset":
|
|
105
|
+
offset: S.value,
|
|
106
|
+
"cross-offset": B.value,
|
|
107
107
|
placement: e.placement,
|
|
108
108
|
transition: e.transition,
|
|
109
|
-
class:
|
|
109
|
+
class: H(e.class),
|
|
110
110
|
"scroll-lock": "",
|
|
111
111
|
"non-modal": "",
|
|
112
|
-
onEnter:
|
|
113
|
-
onLeave:
|
|
112
|
+
onEnter: T,
|
|
113
|
+
onLeave: N
|
|
114
114
|
}, {
|
|
115
|
-
default:
|
|
116
|
-
|
|
115
|
+
default: r(() => [
|
|
116
|
+
j(
|
|
117
117
|
"div",
|
|
118
118
|
{
|
|
119
119
|
class: "q-dropdown-menu__body",
|
|
120
120
|
"data-testid": "dropdown-content",
|
|
121
121
|
tabindex: "-1",
|
|
122
|
-
onKeydown:
|
|
122
|
+
onKeydown: G(O, ["stop"])
|
|
123
123
|
},
|
|
124
124
|
[
|
|
125
|
-
|
|
125
|
+
E(y(Z), {
|
|
126
126
|
ref: "qListRef",
|
|
127
127
|
class: "q-dropdown-menu__items",
|
|
128
|
-
highlighted:
|
|
128
|
+
highlighted: i.value,
|
|
129
129
|
items: e.items,
|
|
130
130
|
groups: e.groups,
|
|
131
131
|
"item-label": e.itemLabel,
|
|
132
132
|
"item-value": e.itemValue,
|
|
133
133
|
selectable: !1,
|
|
134
|
-
onClick:
|
|
135
|
-
"onMouseenter:item":
|
|
134
|
+
onClick: D,
|
|
135
|
+
"onMouseenter:item": $
|
|
136
136
|
}, {
|
|
137
|
-
item:
|
|
138
|
-
|
|
137
|
+
item: r(({ item: o }) => [
|
|
138
|
+
f(t.$slots, "item", { item: o })
|
|
139
139
|
]),
|
|
140
|
-
"item.append":
|
|
141
|
-
var
|
|
140
|
+
"item.append": r(({ item: o, element: l }) => {
|
|
141
|
+
var L;
|
|
142
142
|
return [
|
|
143
|
-
|
|
144
|
-
o.extraInfo ? (
|
|
143
|
+
f(t.$slots, "item.append", { item: o }, () => [
|
|
144
|
+
o.extraInfo ? (d(), R(
|
|
145
145
|
"span",
|
|
146
|
-
|
|
147
|
-
|
|
146
|
+
oe,
|
|
147
|
+
J(o.extraInfo),
|
|
148
148
|
1
|
|
149
149
|
/* TEXT */
|
|
150
|
-
)) :
|
|
150
|
+
)) : k("v-if", !0)
|
|
151
151
|
]),
|
|
152
|
-
((
|
|
153
|
-
|
|
152
|
+
((L = o.items) == null ? void 0 : L.length) > 0 ? (d(), R(
|
|
153
|
+
W,
|
|
154
154
|
{ key: 0 },
|
|
155
155
|
[
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
156
|
+
E(
|
|
157
|
+
y(ee),
|
|
158
|
+
b(V(e.icons.expand)),
|
|
159
159
|
null,
|
|
160
160
|
16
|
|
161
161
|
/* FULL_PROPS */
|
|
162
162
|
),
|
|
163
|
-
|
|
163
|
+
s.value === o.key ? (d(), q(a, X({
|
|
164
164
|
key: 0,
|
|
165
|
-
"model-value":
|
|
165
|
+
"model-value": u.modelValue
|
|
166
166
|
}, e, {
|
|
167
|
-
activator:
|
|
167
|
+
activator: l,
|
|
168
168
|
items: o.items,
|
|
169
169
|
groups: o.groups,
|
|
170
170
|
depth: e.depth + 1,
|
|
@@ -172,14 +172,23 @@ const te = {
|
|
|
172
172
|
placement: "right-start",
|
|
173
173
|
"non-modal": "",
|
|
174
174
|
inline: "",
|
|
175
|
-
onHide:
|
|
176
|
-
onSelect:
|
|
177
|
-
onFocusPrevious:
|
|
178
|
-
}),
|
|
175
|
+
onHide: v,
|
|
176
|
+
onSelect: I,
|
|
177
|
+
onFocusPrevious: Q
|
|
178
|
+
}), {
|
|
179
|
+
item: r((w) => [
|
|
180
|
+
f(t.$slots, "item", b(V(w)))
|
|
181
|
+
]),
|
|
182
|
+
"item.append": r((w) => [
|
|
183
|
+
f(t.$slots, "item.append", b(V(w)))
|
|
184
|
+
]),
|
|
185
|
+
_: 2
|
|
186
|
+
/* DYNAMIC */
|
|
187
|
+
}, 1040, ["model-value", "activator", "items", "groups", "depth", "delay"])) : k("v-if", !0)
|
|
179
188
|
],
|
|
180
189
|
64
|
|
181
190
|
/* STABLE_FRAGMENT */
|
|
182
|
-
)) :
|
|
191
|
+
)) : k("v-if", !0)
|
|
183
192
|
];
|
|
184
193
|
}),
|
|
185
194
|
_: 3
|
|
@@ -197,5 +206,5 @@ const te = {
|
|
|
197
206
|
}
|
|
198
207
|
});
|
|
199
208
|
export {
|
|
200
|
-
|
|
209
|
+
re as default
|
|
201
210
|
};
|
|
@@ -1,24 +1,58 @@
|
|
|
1
|
-
declare const QDropdownMenu:
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
},
|
|
1
|
+
declare const QDropdownMenu: {
|
|
2
|
+
new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<{
|
|
3
|
+
modelValue?: boolean;
|
|
4
|
+
} & import('../../types/component').QBaseComponentProps & {
|
|
5
|
+
activator?: import('../../utils/getElement').Selector;
|
|
6
|
+
itemValue?: string;
|
|
7
|
+
itemLabel?: string;
|
|
8
|
+
items?: import('../QList/types').Item[];
|
|
9
|
+
groups?: import('../QList/types').Group[];
|
|
10
|
+
appearance?: import('../../composables/overlay').Appearance;
|
|
11
|
+
placement?: import('../../composables/overlay').Placement;
|
|
12
|
+
transition?: string;
|
|
13
|
+
inline?: boolean;
|
|
14
|
+
delay?: number;
|
|
15
|
+
trigger?: import('../../composables/overlay').Trigger;
|
|
16
|
+
depth?: number;
|
|
17
|
+
icons?: typeof import('./types').DEFAULT_ICONS;
|
|
18
|
+
}> & Readonly<{
|
|
19
|
+
onSelect?: ((item: any) => any) | undefined;
|
|
20
|
+
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
21
|
+
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
22
|
+
"update:modelValue": (value: boolean) => any;
|
|
23
|
+
} & {
|
|
24
|
+
select: (item: any) => any;
|
|
25
|
+
}, import('vue').PublicProps, {}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
|
|
26
|
+
P: {};
|
|
27
|
+
B: {};
|
|
28
|
+
D: {};
|
|
29
|
+
C: {};
|
|
30
|
+
M: {};
|
|
31
|
+
Defaults: {};
|
|
32
|
+
}, Readonly<{
|
|
33
|
+
modelValue?: boolean;
|
|
34
|
+
} & import('../../types/component').QBaseComponentProps & {
|
|
35
|
+
activator?: import('../../utils/getElement').Selector;
|
|
36
|
+
itemValue?: string;
|
|
37
|
+
itemLabel?: string;
|
|
38
|
+
items?: import('../QList/types').Item[];
|
|
39
|
+
groups?: import('../QList/types').Group[];
|
|
40
|
+
appearance?: import('../../composables/overlay').Appearance;
|
|
41
|
+
placement?: import('../../composables/overlay').Placement;
|
|
42
|
+
transition?: string;
|
|
43
|
+
inline?: boolean;
|
|
44
|
+
delay?: number;
|
|
45
|
+
trigger?: import('../../composables/overlay').Trigger;
|
|
46
|
+
depth?: number;
|
|
47
|
+
icons?: typeof import('./types').DEFAULT_ICONS;
|
|
48
|
+
}> & Readonly<{
|
|
49
|
+
onSelect?: ((item: any) => any) | undefined;
|
|
50
|
+
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
51
|
+
}>, {}, {}, {}, {}, {}>;
|
|
52
|
+
__isFragment?: never;
|
|
53
|
+
__isTeleport?: never;
|
|
54
|
+
__isSuspense?: never;
|
|
55
|
+
} & import('vue').ComponentOptionsBase<Readonly<{
|
|
22
56
|
modelValue?: boolean;
|
|
23
57
|
} & import('../../types/component').QBaseComponentProps & {
|
|
24
58
|
activator?: import('../../utils/getElement').Selector;
|
|
@@ -37,6 +71,19 @@ declare const QDropdownMenu: import('vue').DefineComponent<{
|
|
|
37
71
|
}> & Readonly<{
|
|
38
72
|
onSelect?: ((item: any) => any) | undefined;
|
|
39
73
|
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
40
|
-
}>, {}, {}, {}, {},
|
|
74
|
+
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
75
|
+
"update:modelValue": (value: boolean) => any;
|
|
76
|
+
} & {
|
|
77
|
+
select: (item: any) => any;
|
|
78
|
+
}, string, {}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
|
|
79
|
+
$slots: {
|
|
80
|
+
item?(_: {
|
|
81
|
+
item: import('../QList/types').Item;
|
|
82
|
+
}): any;
|
|
83
|
+
'item.append'?(_: {
|
|
84
|
+
item: import('../QList/types').Item;
|
|
85
|
+
}): any;
|
|
86
|
+
};
|
|
87
|
+
});
|
|
41
88
|
export { QDropdownMenu };
|
|
42
89
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/QDropdownMenu/index.ts"],"names":[],"mappings":"AAMA,QAAA,MAAM,aAAa
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/QDropdownMenu/index.ts"],"names":[],"mappings":"AAMA,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAkC,CAAA;AAGrD,OAAO,EAAE,aAAa,EAAE,CAAA"}
|
|
@@ -43,7 +43,7 @@ export type ThemeInstance = {
|
|
|
43
43
|
/** A computed reference to the current theme definition. */
|
|
44
44
|
readonly current: DeepReadonly<ComputedRef<ThemeDefinition>>;
|
|
45
45
|
/** An array of available theme definitions. */
|
|
46
|
-
readonly themes: DeepReadonly<ThemeDefinition[]
|
|
46
|
+
readonly themes: DeepReadonly<Ref<ThemeDefinition[]>>;
|
|
47
47
|
/** The theme class name. */
|
|
48
48
|
readonly class: ComputedRef<string>;
|
|
49
49
|
/** The theme CSS definition. */
|
|
@@ -56,23 +56,22 @@ export type ThemeInstance = {
|
|
|
56
56
|
*/
|
|
57
57
|
export declare function useTheme(): ThemeInstance;
|
|
58
58
|
/**
|
|
59
|
-
* Provides and manages a reactive theme instance within
|
|
59
|
+
* Provides and manages a reactive theme instance within Vue’s dependency injection system.
|
|
60
60
|
*
|
|
61
|
-
* This function
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
* to
|
|
61
|
+
* This function:
|
|
62
|
+
* - Retrieves the current list of available themes from the existing theme context.
|
|
63
|
+
* - Resolves the input (`nameOrDef`) to either a theme name or a full `ThemeDefinition`.
|
|
64
|
+
* - If a `ThemeDefinition` is provided, it is appended to the existing list of themes.
|
|
65
|
+
* - Creates a new reactive `ThemeInstance` bound to the resolved name and theme list.
|
|
66
|
+
* - Provides the new `ThemeInstance` under `ThemeSymbol`, making it available to descendants via `useTheme()`.
|
|
65
67
|
*
|
|
66
|
-
* @param nameOrDef -
|
|
67
|
-
* - A string
|
|
68
|
-
* - A `ThemeDefinition
|
|
68
|
+
* @param nameOrDef - The theme to activate, given as either:
|
|
69
|
+
* - A theme name (`string`), or a reactive source (`Ref<string>`/getter).
|
|
70
|
+
* - A `ThemeDefinition`, or a reactive source (`Ref<ThemeDefinition>`/getter).
|
|
69
71
|
*
|
|
70
|
-
* @returns The newly created and provided `ThemeInstance
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
* - `themes`: array of all available themes,
|
|
74
|
-
* - `class`: computed CSS class string for the theme,
|
|
75
|
-
* - `css`: computed CSS variables string for the theme.
|
|
72
|
+
* @returns The newly created and provided `ThemeInstance`.
|
|
73
|
+
*
|
|
74
|
+
* @throws {Error} If the resolved theme name does not exist in the available themes.
|
|
76
75
|
*/
|
|
77
76
|
export declare function provideTheme(nameOrDef: MaybeRefOrGetter<string | ThemeDefinition>): ThemeInstance;
|
|
78
77
|
//# sourceMappingURL=theme.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/composables/theme.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AACzF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAMjD,eAAO,MAAM,WAAW,EAAE,YAAY,CAAC,aAAa,CAAyB,CAAA;AAE7E;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,MAAM,CAAA;AAExC;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG;IACvB,6DAA6D;IAC7D,YAAY,EAAE,MAAM,CAAA;IAEpB,mEAAmE;IACnE,MAAM,EAAE,KAAK,CAAC;QACb,6BAA6B;QAC7B,IAAI,EAAE,MAAM,CAAA;QAEZ,mDAAmD;QACnD,IAAI,EAAE,SAAS,CAAA;QAEf,qEAAqE;QACrE,MAAM,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,CAAA;KAC7B,CAAC,CAAA;CACF,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC7B,oCAAoC;IACpC,IAAI,EAAE,MAAM,CAAA;IAEZ,mDAAmD;IACnD,IAAI,EAAE,SAAS,CAAA;IAEf,kDAAkD;IAClD,MAAM,EAAE,WAAW,CAAA;CACnB,CAAA;AAED;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG;IAC3B,yDAAyD;IACzD,QAAQ,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAE1B,4DAA4D;IAC5D,QAAQ,CAAC,OAAO,EAAE,YAAY,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC,CAAA;IAE5D,+CAA+C;IAC/C,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC,eAAe,EAAE,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/composables/theme.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AACzF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAMjD,eAAO,MAAM,WAAW,EAAE,YAAY,CAAC,aAAa,CAAyB,CAAA;AAE7E;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,MAAM,CAAA;AAExC;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG;IACvB,6DAA6D;IAC7D,YAAY,EAAE,MAAM,CAAA;IAEpB,mEAAmE;IACnE,MAAM,EAAE,KAAK,CAAC;QACb,6BAA6B;QAC7B,IAAI,EAAE,MAAM,CAAA;QAEZ,mDAAmD;QACnD,IAAI,EAAE,SAAS,CAAA;QAEf,qEAAqE;QACrE,MAAM,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,CAAA;KAC7B,CAAC,CAAA;CACF,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC7B,oCAAoC;IACpC,IAAI,EAAE,MAAM,CAAA;IAEZ,mDAAmD;IACnD,IAAI,EAAE,SAAS,CAAA;IAEf,kDAAkD;IAClD,MAAM,EAAE,WAAW,CAAA;CACnB,CAAA;AAED;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG;IAC3B,yDAAyD;IACzD,QAAQ,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAE1B,4DAA4D;IAC5D,QAAQ,CAAC,OAAO,EAAE,YAAY,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC,CAAA;IAE5D,+CAA+C;IAC/C,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC,GAAG,CAAC,eAAe,EAAE,CAAC,CAAC,CAAA;IAErD,4BAA4B;IAC5B,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;IAEnC,gCAAgC;IAChC,QAAQ,CAAC,GAAG,EAAE,WAAW,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;CAC7C,CAAA;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,IAAI,aAAa,CAQxC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,YAAY,CAAC,SAAS,EAAE,gBAAgB,CAAC,MAAM,GAAG,eAAe,CAAC,GAAG,aAAa,CA2CjG"}
|
package/esm/composables/theme.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { toValue as c, provide as
|
|
2
|
-
import { createThemeInstance as
|
|
1
|
+
import { computed as n, toValue as c, provide as a, inject as l } from "vue";
|
|
2
|
+
import { createThemeInstance as h } from "../utils/theme.js";
|
|
3
3
|
const m = Symbol.for("q-theme");
|
|
4
|
-
function
|
|
5
|
-
const e =
|
|
4
|
+
function v() {
|
|
5
|
+
const e = l(m);
|
|
6
6
|
if (!e)
|
|
7
7
|
throw new Error("[Quidgest UI] Could not find theme instance");
|
|
8
8
|
return e;
|
|
9
9
|
}
|
|
10
|
-
function
|
|
11
|
-
const s =
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
return
|
|
10
|
+
function p(e) {
|
|
11
|
+
const { themes: o } = v(), t = n(() => c(e)), s = n(() => typeof t.value != "string"), r = n(
|
|
12
|
+
() => s.value ? t.value.name : t.value
|
|
13
|
+
), u = n(
|
|
14
|
+
() => s.value ? [...o.value, t.value] : o.value
|
|
15
|
+
), i = h(r, u);
|
|
16
|
+
return a(m, i), i;
|
|
17
17
|
}
|
|
18
18
|
export {
|
|
19
19
|
m as ThemeSymbol,
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
p as provideTheme,
|
|
21
|
+
v as useTheme
|
|
22
22
|
};
|
package/esm/framework.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { DEFAULTS_SYMBOL as
|
|
1
|
+
import { DEFAULTS_SYMBOL as c } from "./composables/defaults.js";
|
|
2
2
|
import { ThemeSymbol as h } from "./composables/theme.js";
|
|
3
3
|
import { DismissibleLayerKey as f } from "./symbols/dismissibleLayer.js";
|
|
4
4
|
import { ToastSymbol as d } from "./composables/useToast/types.js";
|
|
5
5
|
import { useDismissibleLayerStack as u } from "./composables/useDismissibleLayerStack/index.js";
|
|
6
6
|
import { createToastInstance as p } from "./composables/useToast/index.js";
|
|
7
|
-
import { defaultLightColorScheme as
|
|
8
|
-
import { ref as
|
|
7
|
+
import { defaultLightColorScheme as l, defaultDarkColorScheme as i } from "./templates/theme.js";
|
|
8
|
+
import { ref as n, watch as S } from "vue";
|
|
9
9
|
import { createThemeInstance as T, generateRootStyle as L } from "./utils/theme.js";
|
|
10
10
|
function N(o = {}) {
|
|
11
11
|
return { install: (t) => {
|
|
12
12
|
const m = o.components || {};
|
|
13
|
-
for (const
|
|
14
|
-
t.component(
|
|
13
|
+
for (const a in m)
|
|
14
|
+
t.component(a, m[a]);
|
|
15
15
|
const e = o.defaults || {};
|
|
16
|
-
t.provide(
|
|
17
|
-
const
|
|
18
|
-
t.provide(f,
|
|
16
|
+
t.provide(c, n(e)), y(t, o.themes);
|
|
17
|
+
const r = u();
|
|
18
|
+
t.provide(f, r), b(t);
|
|
19
19
|
} };
|
|
20
20
|
}
|
|
21
21
|
function y(o, s) {
|
|
@@ -23,11 +23,11 @@ function y(o, s) {
|
|
|
23
23
|
let m;
|
|
24
24
|
if (s)
|
|
25
25
|
for (const e of s.themes) {
|
|
26
|
-
const
|
|
26
|
+
const a = { ...e.mode === "light" ? l : i, ...e.colors };
|
|
27
27
|
t.push({
|
|
28
28
|
name: e.name,
|
|
29
29
|
mode: e.mode,
|
|
30
|
-
scheme:
|
|
30
|
+
scheme: a
|
|
31
31
|
}), e.name === s.defaultTheme && (m = e.name);
|
|
32
32
|
}
|
|
33
33
|
else {
|
|
@@ -35,19 +35,19 @@ function y(o, s) {
|
|
|
35
35
|
{
|
|
36
36
|
name: "light",
|
|
37
37
|
mode: "light",
|
|
38
|
-
scheme:
|
|
38
|
+
scheme: l
|
|
39
39
|
},
|
|
40
40
|
{
|
|
41
41
|
name: "dark",
|
|
42
42
|
mode: "dark",
|
|
43
|
-
scheme:
|
|
43
|
+
scheme: i
|
|
44
44
|
}
|
|
45
45
|
];
|
|
46
46
|
t.push(...e), m = "light";
|
|
47
47
|
}
|
|
48
48
|
if (m) {
|
|
49
|
-
const e =
|
|
50
|
-
L(t), S(
|
|
49
|
+
const e = T(n(m), n(t));
|
|
50
|
+
L(t), S(e.class, k, { immediate: !0 }), o.provide(h, e);
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
function b(o) {
|
package/esm/templates/theme.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a = {
|
|
2
2
|
primary: "#008ad2",
|
|
3
3
|
primaryLight: "#cde5ff",
|
|
4
4
|
primaryDark: "#006398",
|
|
@@ -34,44 +34,44 @@ const f = {
|
|
|
34
34
|
onDanger: "#fff",
|
|
35
35
|
onInfo: "#fff",
|
|
36
36
|
onNeutral: "#fff"
|
|
37
|
-
},
|
|
37
|
+
}, f = {
|
|
38
38
|
primary: "#4da6e0",
|
|
39
|
-
primaryLight: "#
|
|
40
|
-
primaryDark: "#
|
|
41
|
-
secondary: "#
|
|
42
|
-
secondaryLight: "#
|
|
43
|
-
secondaryDark: "#
|
|
39
|
+
primaryLight: "#1a2832",
|
|
40
|
+
primaryDark: "#87c5f0",
|
|
41
|
+
secondary: "#b8d4e6",
|
|
42
|
+
secondaryLight: "#1a2832",
|
|
43
|
+
secondaryDark: "#e6f2ff",
|
|
44
44
|
highlight: "#ff9966",
|
|
45
|
-
highlightLight: "#
|
|
46
|
-
highlightDark: "#
|
|
47
|
-
info: "#
|
|
48
|
-
infoLight: "#
|
|
49
|
-
infoDark: "#
|
|
50
|
-
success: "#
|
|
51
|
-
successLight: "#
|
|
52
|
-
successDark: "#
|
|
53
|
-
warning: "#
|
|
54
|
-
warningLight: "#
|
|
55
|
-
warningDark: "#
|
|
56
|
-
danger: "#
|
|
57
|
-
dangerLight: "#
|
|
58
|
-
dangerDark: "#
|
|
45
|
+
highlightLight: "#2d1a0f",
|
|
46
|
+
highlightDark: "#ffb899",
|
|
47
|
+
info: "#4cb8d1",
|
|
48
|
+
infoLight: "#1f2a2d",
|
|
49
|
+
infoDark: "#7dcce0",
|
|
50
|
+
success: "#5cb85c",
|
|
51
|
+
successLight: "#1e2a20",
|
|
52
|
+
successDark: "#85d085",
|
|
53
|
+
warning: "#ffcc4d",
|
|
54
|
+
warningLight: "#332a1a",
|
|
55
|
+
warningDark: "#ffd966",
|
|
56
|
+
danger: "#e74c3c",
|
|
57
|
+
dangerLight: "#2d1a1a",
|
|
58
|
+
dangerDark: "#f17066",
|
|
59
59
|
background: "#121212",
|
|
60
60
|
container: "#1e1e1e",
|
|
61
|
-
neutral: "#
|
|
62
|
-
neutralLight: "#
|
|
63
|
-
neutralDark: "#
|
|
64
|
-
onBackground: "#
|
|
65
|
-
onPrimary: "#
|
|
66
|
-
onSecondary: "#
|
|
67
|
-
onHighlight: "#
|
|
68
|
-
onSuccess: "#
|
|
69
|
-
onWarning: "#
|
|
70
|
-
onDanger: "#
|
|
71
|
-
onInfo: "#
|
|
72
|
-
onNeutral: "#
|
|
61
|
+
neutral: "#9ca3ab",
|
|
62
|
+
neutralLight: "#2a2d31",
|
|
63
|
+
neutralDark: "#c8ced6",
|
|
64
|
+
onBackground: "#e0e0e0",
|
|
65
|
+
onPrimary: "#000",
|
|
66
|
+
onSecondary: "#000",
|
|
67
|
+
onHighlight: "#000",
|
|
68
|
+
onSuccess: "#000",
|
|
69
|
+
onWarning: "#000",
|
|
70
|
+
onDanger: "#000",
|
|
71
|
+
onInfo: "#000",
|
|
72
|
+
onNeutral: "#000"
|
|
73
73
|
};
|
|
74
74
|
export {
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
f as defaultDarkColorScheme,
|
|
76
|
+
a as defaultLightColorScheme
|
|
77
77
|
};
|