@quidgest/ui 0.16.31 → 0.16.33
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 +25 -1
- package/dist/ui.css +20 -11
- package/dist/ui.esm.js +6720 -6607
- package/dist/ui.js +27 -27
- package/dist/ui.min.css +1 -1
- package/dist/ui.min.js +910 -899
- package/dist/ui.scss +54 -37
- package/esm/components/QList/QList.d.ts.map +1 -1
- package/esm/components/QList/QList.vue.js +75 -73
- package/esm/components/QSelect/QSelect.d.ts +160 -13
- package/esm/components/QSelect/QSelect.d.ts.map +1 -1
- package/esm/components/QSelect/QSelect.vue.js +326 -138
- package/esm/components/QSelect/index.d.ts +82 -3
- package/esm/components/QSelect/index.d.ts.map +1 -1
- package/esm/components/QSelect/types.d.ts +12 -0
- package/esm/components/QSelect/types.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
|
@@ -16,6 +16,8 @@ declare const QSelect: {
|
|
|
16
16
|
groups?: import('../QList/types').Group[];
|
|
17
17
|
clearable?: boolean;
|
|
18
18
|
inline?: boolean;
|
|
19
|
+
multiple?: boolean;
|
|
20
|
+
badges?: boolean;
|
|
19
21
|
loading?: boolean;
|
|
20
22
|
emptyValue?: any;
|
|
21
23
|
itemValue?: string;
|
|
@@ -42,7 +44,7 @@ declare const QSelect: {
|
|
|
42
44
|
itemValue: string;
|
|
43
45
|
itemLabel: string;
|
|
44
46
|
}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {
|
|
45
|
-
|
|
47
|
+
trigger: ({
|
|
46
48
|
$: import('vue').ComponentInternalInstance;
|
|
47
49
|
$data: {};
|
|
48
50
|
$props: {
|
|
@@ -111,8 +113,81 @@ declare const QSelect: {
|
|
|
111
113
|
extras?(_: {}): any;
|
|
112
114
|
};
|
|
113
115
|
}) | null;
|
|
114
|
-
|
|
115
|
-
|
|
116
|
+
badgesContainer: HTMLSpanElement;
|
|
117
|
+
allBadges: (({
|
|
118
|
+
$: import('vue').ComponentInternalInstance;
|
|
119
|
+
$data: {};
|
|
120
|
+
$props: {
|
|
121
|
+
readonly id?: string | undefined;
|
|
122
|
+
readonly class?: string | unknown[] | undefined;
|
|
123
|
+
readonly variant?: import('../QBadge/types').QBadgeVariant | undefined;
|
|
124
|
+
readonly color?: string | undefined;
|
|
125
|
+
readonly pill?: boolean | undefined;
|
|
126
|
+
readonly size?: import('../QBadge/types').QBadgeSize | undefined;
|
|
127
|
+
readonly removable?: boolean | undefined;
|
|
128
|
+
readonly icons?: typeof import('../QBadge/types').DEFAULT_ICONS | undefined;
|
|
129
|
+
readonly texts?: typeof import('../QBadge/types').DEFAULT_TEXTS | undefined;
|
|
130
|
+
readonly "onClick:remove"?: (() => any) | undefined;
|
|
131
|
+
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
|
|
132
|
+
$attrs: {
|
|
133
|
+
[x: string]: unknown;
|
|
134
|
+
};
|
|
135
|
+
$refs: {
|
|
136
|
+
[x: string]: unknown;
|
|
137
|
+
};
|
|
138
|
+
$slots: Readonly<{
|
|
139
|
+
[name: string]: import('vue').Slot<any> | undefined;
|
|
140
|
+
}>;
|
|
141
|
+
$root: import('vue').ComponentPublicInstance | null;
|
|
142
|
+
$parent: import('vue').ComponentPublicInstance | null;
|
|
143
|
+
$host: Element | null;
|
|
144
|
+
$emit: (event: "click:remove") => void;
|
|
145
|
+
$el: HTMLSpanElement;
|
|
146
|
+
$options: import('vue').ComponentOptionsBase<Readonly<import('../QBadge/types').QBadgeProps> & Readonly<{
|
|
147
|
+
"onClick:remove"?: (() => any) | undefined;
|
|
148
|
+
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
149
|
+
"click:remove": () => any;
|
|
150
|
+
}, string, {
|
|
151
|
+
size: import('../QBadge/types').QBadgeSize;
|
|
152
|
+
color: string;
|
|
153
|
+
variant: import('../QBadge/types').QBadgeVariant;
|
|
154
|
+
icons: typeof import('../QBadge/types').DEFAULT_ICONS;
|
|
155
|
+
texts: typeof import('../QBadge/types').DEFAULT_TEXTS;
|
|
156
|
+
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & {
|
|
157
|
+
beforeCreate?: (() => void) | (() => void)[];
|
|
158
|
+
created?: (() => void) | (() => void)[];
|
|
159
|
+
beforeMount?: (() => void) | (() => void)[];
|
|
160
|
+
mounted?: (() => void) | (() => void)[];
|
|
161
|
+
beforeUpdate?: (() => void) | (() => void)[];
|
|
162
|
+
updated?: (() => void) | (() => void)[];
|
|
163
|
+
activated?: (() => void) | (() => void)[];
|
|
164
|
+
deactivated?: (() => void) | (() => void)[];
|
|
165
|
+
beforeDestroy?: (() => void) | (() => void)[];
|
|
166
|
+
beforeUnmount?: (() => void) | (() => void)[];
|
|
167
|
+
destroyed?: (() => void) | (() => void)[];
|
|
168
|
+
unmounted?: (() => void) | (() => void)[];
|
|
169
|
+
renderTracked?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
|
|
170
|
+
renderTriggered?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
|
|
171
|
+
errorCaptured?: ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void)[];
|
|
172
|
+
};
|
|
173
|
+
$forceUpdate: () => void;
|
|
174
|
+
$nextTick: typeof import('vue').nextTick;
|
|
175
|
+
$watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import('@vue/reactivity').OnCleanup]) => any : (...args: [any, any, import('@vue/reactivity').OnCleanup]) => any, options?: import('vue').WatchOptions): import('vue').WatchStopHandle;
|
|
176
|
+
} & Readonly<{
|
|
177
|
+
size: import('../QBadge/types').QBadgeSize;
|
|
178
|
+
color: string;
|
|
179
|
+
variant: import('../QBadge/types').QBadgeVariant;
|
|
180
|
+
icons: typeof import('../QBadge/types').DEFAULT_ICONS;
|
|
181
|
+
texts: typeof import('../QBadge/types').DEFAULT_TEXTS;
|
|
182
|
+
}> & Omit<Readonly<import('../QBadge/types').QBadgeProps> & Readonly<{
|
|
183
|
+
"onClick:remove"?: (() => any) | undefined;
|
|
184
|
+
}>, "size" | "color" | "variant" | "icons" | "texts"> & import('vue').ShallowUnwrapRef<{}> & {} & import('vue').ComponentCustomProperties & {} & {
|
|
185
|
+
$slots: {
|
|
186
|
+
default?(_: {}): any;
|
|
187
|
+
};
|
|
188
|
+
}) | null)[];
|
|
189
|
+
content: HTMLDivElement;
|
|
190
|
+
list: ({
|
|
116
191
|
$: import('vue').ComponentInternalInstance;
|
|
117
192
|
$data: {};
|
|
118
193
|
$props: {
|
|
@@ -312,6 +387,8 @@ declare const QSelect: {
|
|
|
312
387
|
groups?: import('../QList/types').Group[];
|
|
313
388
|
clearable?: boolean;
|
|
314
389
|
inline?: boolean;
|
|
390
|
+
multiple?: boolean;
|
|
391
|
+
badges?: boolean;
|
|
315
392
|
loading?: boolean;
|
|
316
393
|
emptyValue?: any;
|
|
317
394
|
itemValue?: string;
|
|
@@ -351,6 +428,8 @@ declare const QSelect: {
|
|
|
351
428
|
groups?: import('../QList/types').Group[];
|
|
352
429
|
clearable?: boolean;
|
|
353
430
|
inline?: boolean;
|
|
431
|
+
multiple?: boolean;
|
|
432
|
+
badges?: boolean;
|
|
354
433
|
loading?: boolean;
|
|
355
434
|
emptyValue?: any;
|
|
356
435
|
itemValue?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/QSelect/index.ts"],"names":[],"mappings":"AAMA,QAAA,MAAM,OAAO
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/QSelect/index.ts"],"names":[],"mappings":"AAMA,QAAA,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCAIuwzB,GAAG,8CAA8C,GAAG,yBAAyB,GAAG,6DAAmC,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCAAtH,GAAG,8CAA8C,GAAG,yBAAyB,GAAG,6DAAmC,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gDAAtH,GAAG,8CAA8C,GAAG,yBAAyB,GAAG,6DAAmC,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCAAtH,GAAG,8CAA8C,GAAG,yBAAyB,GAAG,6DAAmC,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAJj2zB,CAAA;AAGzC,OAAO,EAAE,OAAO,EAAE,CAAA"}
|
|
@@ -25,6 +25,18 @@ export type QSelectProps = QFieldProps & {
|
|
|
25
25
|
* @category Behavior
|
|
26
26
|
*/
|
|
27
27
|
inline?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Whether multiple options can be selected.
|
|
30
|
+
*
|
|
31
|
+
* @category Behavior
|
|
32
|
+
*/
|
|
33
|
+
multiple?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Whether to display the selected option(s) as badge(s).
|
|
36
|
+
*
|
|
37
|
+
* @category Presentation
|
|
38
|
+
*/
|
|
39
|
+
badges?: boolean;
|
|
28
40
|
/**
|
|
29
41
|
* Whether the items of the list are being loaded.
|
|
30
42
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/QSelect/types.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAE5C,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAEjD,MAAM,MAAM,YAAY,GAAG,WAAW,GAAG;IACxC;;;;OAIG;IACH,KAAK,CAAC,EAAE,IAAI,EAAE,CAAA;IAEd;;;;OAIG;IACH,MAAM,CAAC,EAAE,KAAK,EAAE,CAAA;IAEhB;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IAEnB;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;IAEhB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IAEjB;;;;;OAKG;IAEH,UAAU,CAAC,EAAE,GAAG,CAAA;IAEhB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,aAAa,CAAA;IAE5B;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,aAAa,CAAA;CAC5B,CAAA;AAGD,eAAO,MAAM,aAAa;;;;CAIQ,CAAA;AAGlC,eAAO,MAAM,aAAa;;;;;;;CAGM,CAAA"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/QSelect/types.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAE5C,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAEjD,MAAM,MAAM,YAAY,GAAG,WAAW,GAAG;IACxC;;;;OAIG;IACH,KAAK,CAAC,EAAE,IAAI,EAAE,CAAA;IAEd;;;;OAIG;IACH,MAAM,CAAC,EAAE,KAAK,EAAE,CAAA;IAEhB;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IAEnB;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;IAEhB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAElB;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;IAEhB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IAEjB;;;;;OAKG;IAEH,UAAU,CAAC,EAAE,GAAG,CAAA;IAEhB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,aAAa,CAAA;IAE5B;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,aAAa,CAAA;CAC5B,CAAA;AAGD,eAAO,MAAM,aAAa;;;;CAIQ,CAAA;AAGlC,eAAO,MAAM,aAAa;;;;;;;CAGM,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
|
};
|
package/esm/utils/theme.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DeepReadonly,
|
|
1
|
+
import { DeepReadonly, Ref } from 'vue';
|
|
2
2
|
import { ThemeDefinition, ThemeInstance } from '../composables/theme';
|
|
3
3
|
export declare const THEME_NODE_ID = "q-theme";
|
|
4
4
|
/**
|
|
@@ -33,24 +33,24 @@ export declare function generateRootStyle(themes: ThemeDefinition[]): void;
|
|
|
33
33
|
*/
|
|
34
34
|
export declare function toProperty(color: string): string;
|
|
35
35
|
/**
|
|
36
|
-
* Creates a reactive theme instance
|
|
36
|
+
* Creates a reactive theme instance bound to a given theme name and list of theme definitions.
|
|
37
37
|
*
|
|
38
|
-
* This
|
|
39
|
-
* computed properties for
|
|
38
|
+
* This function ensures the active theme is always kept in sync with the provided `name` ref,
|
|
39
|
+
* and exposes reactive/computed properties for convenient use in templates and styling.
|
|
40
40
|
*
|
|
41
|
-
* @param name -
|
|
42
|
-
* @param themes - A
|
|
41
|
+
* @param name - A reactive `Ref<string>` representing the active theme name.
|
|
42
|
+
* @param themes - A reactive `Ref<ThemeDefinition[]>` containing all available themes.
|
|
43
43
|
*
|
|
44
|
-
* @returns A `ThemeInstance` object
|
|
45
|
-
* - `name`:
|
|
46
|
-
* - `current`: a computed `Ref<ThemeDefinition>` of the active theme.
|
|
47
|
-
* - `themes`: the
|
|
48
|
-
* - `class`: a computed CSS class
|
|
49
|
-
* - `css`: a computed string of CSS variables for the active theme.
|
|
44
|
+
* @returns A `ThemeInstance` object with the following reactive properties:
|
|
45
|
+
* - `name`: the reactive `Ref<string>` of the active theme name.
|
|
46
|
+
* - `current`: a computed `Ref<ThemeDefinition>` of the active theme definition.
|
|
47
|
+
* - `themes`: the reactive `Ref<ThemeDefinition[]>` of all available themes.
|
|
48
|
+
* - `class`: a computed `Ref<string>` of the CSS class for the active theme.
|
|
49
|
+
* - `css`: a computed `Ref<string>` of the CSS variables for the active theme.
|
|
50
50
|
*
|
|
51
|
-
* @throws
|
|
51
|
+
* @throws {Error} If no theme matching the active `name` exists in `themes`.
|
|
52
52
|
*/
|
|
53
|
-
export declare function createThemeInstance(name:
|
|
53
|
+
export declare function createThemeInstance(name: Ref<string>, themes: DeepReadonly<Ref<ThemeDefinition[]>>): ThemeInstance;
|
|
54
54
|
/**
|
|
55
55
|
* Generates a CSS class name for a given theme.
|
|
56
56
|
*
|
package/esm/utils/theme.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/utils/theme.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/utils/theme.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAC5C,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAQ1E,eAAO,MAAM,aAAa,YAAY,CAAA;AAEtC;;;;GAIG;AACH,wBAAgB,YAAY,IAAI,gBAAgB,CAY/C;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,eAAe,UAoBtD;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,eAAe,EAAE,QAM1D;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,UAOvC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,mBAAmB,CAClC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,EACjB,MAAM,EAAE,YAAY,CAAC,GAAG,CAAC,eAAe,EAAE,CAAC,CAAC,GAC1C,aAAa,CAmBf;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,UAEzC"}
|
package/esm/utils/theme.js
CHANGED
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { parseColor as
|
|
3
|
-
import { toKebabCase as
|
|
4
|
-
const
|
|
5
|
-
function
|
|
1
|
+
import { computed as c } from "vue";
|
|
2
|
+
import { parseColor as d } from "./color.js";
|
|
3
|
+
import { toKebabCase as a } from "./string.js";
|
|
4
|
+
const m = "q-theme";
|
|
5
|
+
function h() {
|
|
6
6
|
let e = document.getElementById(
|
|
7
|
-
|
|
7
|
+
m
|
|
8
8
|
);
|
|
9
|
-
return e || (e = document.createElement("style"), e.id =
|
|
9
|
+
return e || (e = document.createElement("style"), e.id = m, document.head.appendChild(e)), e;
|
|
10
10
|
}
|
|
11
11
|
function i(e) {
|
|
12
|
-
let t = `.${
|
|
12
|
+
let t = `.${l(e.name)} {
|
|
13
13
|
`;
|
|
14
14
|
const n = e.scheme;
|
|
15
15
|
let o;
|
|
16
16
|
for (o in n) {
|
|
17
|
-
const
|
|
18
|
-
if (
|
|
19
|
-
t += ` ${u(o)}: ${
|
|
17
|
+
const s = n[o];
|
|
18
|
+
if (s) {
|
|
19
|
+
t += ` ${u(o)}: ${s};
|
|
20
20
|
`;
|
|
21
|
-
const
|
|
22
|
-
t += ` ${u(o)}-rgb: ${
|
|
21
|
+
const r = d(s);
|
|
22
|
+
t += ` ${u(o)}-rgb: ${r.r} ${r.g} ${r.b};
|
|
23
23
|
`;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
return t += `}
|
|
27
27
|
`, t;
|
|
28
28
|
}
|
|
29
|
-
function
|
|
29
|
+
function C(e) {
|
|
30
30
|
const t = e.map(i).join(`
|
|
31
|
-
`), n =
|
|
31
|
+
`), n = h();
|
|
32
32
|
n.textContent = t;
|
|
33
33
|
}
|
|
34
34
|
function u(e) {
|
|
35
|
-
return e ? `--q-theme-${
|
|
35
|
+
return e ? `--q-theme-${a(e)}` : "";
|
|
36
36
|
}
|
|
37
|
-
function
|
|
38
|
-
const n =
|
|
39
|
-
const
|
|
40
|
-
if (!
|
|
41
|
-
throw new Error(`Theme "${
|
|
42
|
-
return
|
|
43
|
-
}),
|
|
37
|
+
function T(e, t) {
|
|
38
|
+
const n = c(() => {
|
|
39
|
+
const r = t.value.find((f) => f.name === e.value);
|
|
40
|
+
if (!r)
|
|
41
|
+
throw new Error(`[Quidgest UI] Theme "${e.value}" not found`);
|
|
42
|
+
return r;
|
|
43
|
+
}), o = c(() => l(n.value.name)), s = c(() => i(n.value));
|
|
44
44
|
return {
|
|
45
|
-
name:
|
|
46
|
-
current:
|
|
45
|
+
name: e,
|
|
46
|
+
current: n,
|
|
47
47
|
themes: t,
|
|
48
|
-
class:
|
|
48
|
+
class: o,
|
|
49
49
|
css: s
|
|
50
50
|
};
|
|
51
51
|
}
|
|
52
|
-
function
|
|
53
|
-
return `q-theme--${
|
|
52
|
+
function l(e) {
|
|
53
|
+
return `q-theme--${a(e)}`;
|
|
54
54
|
}
|
|
55
55
|
export {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
56
|
+
m as THEME_NODE_ID,
|
|
57
|
+
T as createThemeInstance,
|
|
58
|
+
C as generateRootStyle,
|
|
59
59
|
i as generateThemeCss,
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
l as getThemeClass,
|
|
61
|
+
h as getThemeNode,
|
|
62
62
|
u as toProperty
|
|
63
63
|
};
|