@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
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
|
};
|