@quidgest/ui 0.14.10 → 0.14.12
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 +2 -0
- package/dist/ui.css +95 -39
- package/dist/ui.esm.js +1931 -1578
- package/dist/ui.js +29 -29
- package/dist/ui.min.css +1 -1
- package/dist/ui.min.js +181 -158
- package/dist/ui.scss +83 -40
- package/esm/components/QAccordion/QAccordion.d.ts.map +1 -1
- package/esm/components/QAccordion/QAccordion.vue.js +2 -2
- package/esm/components/QAccordion/index.d.ts +33 -2
- package/esm/components/QAccordion/index.d.ts.map +1 -1
- package/esm/components/QBadge/QBadge.d.ts.map +1 -1
- package/esm/components/QBadge/QBadge.vue.js +7 -7
- package/esm/components/QBadge/index.d.ts +39 -2
- package/esm/components/QBadge/index.d.ts.map +1 -1
- package/esm/components/QBadge/types.d.ts.map +1 -1
- package/esm/components/QButton/QButton.d.ts +0 -2
- package/esm/components/QButton/QButton.d.ts.map +1 -1
- package/esm/components/QButton/QButton.vue.js +18 -18
- package/esm/components/QButton/index.d.ts +36 -2
- package/esm/components/QButton/index.d.ts.map +1 -1
- package/esm/components/QButtonGroup/QButtonGroup.d.ts +1 -3
- package/esm/components/QButtonGroup/QButtonGroup.d.ts.map +1 -1
- package/esm/components/QButtonGroup/QButtonGroup.vue.js +7 -7
- package/esm/components/QButtonGroup/index.d.ts +17 -2
- package/esm/components/QButtonGroup/index.d.ts.map +1 -1
- package/esm/components/QButtonToggle/QButtonToggle.d.ts.map +1 -1
- package/esm/components/QButtonToggle/QButtonToggle.vue.js +1 -1
- package/esm/components/QButtonToggle/index.d.ts +31 -2
- package/esm/components/QButtonToggle/index.d.ts.map +1 -1
- package/esm/components/QCard/QCard.d.ts +4 -9
- package/esm/components/QCard/QCard.d.ts.map +1 -1
- package/esm/components/QCard/QCard.vue.js +34 -34
- package/esm/components/QCard/index.d.ts +34 -2
- package/esm/components/QCard/index.d.ts.map +1 -1
- package/esm/components/QCheckbox/QCheckbox.d.ts +0 -3
- package/esm/components/QCheckbox/QCheckbox.d.ts.map +1 -1
- package/esm/components/QCheckbox/QCheckbox.vue.js +19 -19
- package/esm/components/QCheckbox/QCheckboxLabel.d.ts +1 -3
- package/esm/components/QCheckbox/QCheckboxLabel.d.ts.map +1 -1
- package/esm/components/QCheckbox/QCheckboxLabel.vue.js +7 -7
- package/esm/components/QCheckbox/index.d.ts +79 -2
- package/esm/components/QCheckbox/index.d.ts.map +1 -1
- package/esm/components/QCheckbox/types.d.ts +8 -4
- package/esm/components/QCheckbox/types.d.ts.map +1 -1
- package/esm/components/QCollapsible/QCollapsible.d.ts +2 -3
- package/esm/components/QCollapsible/QCollapsible.d.ts.map +1 -1
- package/esm/components/QCollapsible/QCollapsible.vue.js +54 -60
- package/esm/components/QCollapsible/index.d.ts +47 -2
- package/esm/components/QCollapsible/index.d.ts.map +1 -1
- package/esm/components/QCollapsible/types.d.ts +5 -4
- package/esm/components/QCollapsible/types.d.ts.map +1 -1
- package/esm/components/QCollapsible/types.js +4 -5
- package/esm/components/QColorPicker/QColorPicker.d.ts +34 -0
- package/esm/components/QColorPicker/QColorPicker.d.ts.map +1 -0
- package/esm/components/QColorPicker/QColorPicker.vue.js +97 -0
- package/esm/components/QColorPicker/QColorPicker.vue2.js +4 -0
- package/esm/components/QColorPicker/index.d.ts +48 -0
- package/esm/components/QColorPicker/index.d.ts.map +1 -0
- package/esm/components/QColorPicker/index.js +6 -0
- package/esm/components/QColorPicker/types.d.ts +44 -0
- package/esm/components/QColorPicker/types.d.ts.map +1 -0
- package/esm/components/QColorPicker/types.js +6 -0
- package/esm/components/QCombobox/QCombobox.d.ts +686 -81
- package/esm/components/QCombobox/QCombobox.d.ts.map +1 -1
- package/esm/components/QCombobox/QCombobox.vue.js +156 -174
- package/esm/components/QCombobox/index.d.ts +1395 -2
- package/esm/components/QCombobox/index.d.ts.map +1 -1
- package/esm/components/QCombobox/types.d.ts +14 -6
- package/esm/components/QCombobox/types.d.ts.map +1 -1
- package/esm/components/QCombobox/types.js +9 -11
- package/esm/components/QDialog/QDialog.d.ts +3 -7
- package/esm/components/QDialog/QDialog.d.ts.map +1 -1
- package/esm/components/QDialog/QDialog.vue.js +33 -33
- package/esm/components/QDialog/index.d.ts +56 -2
- package/esm/components/QDialog/index.d.ts.map +1 -1
- package/esm/components/QDialog/types.d.ts +5 -3
- package/esm/components/QDialog/types.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 +369 -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 +14 -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 +96 -0
- package/esm/components/QDropdownMenu/types.d.ts.map +1 -0
- package/esm/components/QDropdownMenu/types.js +8 -0
- package/esm/components/QField/QField.d.ts +5 -7
- package/esm/components/QField/QField.d.ts.map +1 -1
- package/esm/components/QField/QField.vue.js +25 -25
- package/esm/components/QField/index.d.ts +37 -2
- package/esm/components/QField/index.d.ts.map +1 -1
- package/esm/components/QIcon/QIcon.d.ts +0 -2
- package/esm/components/QIcon/QIcon.d.ts.map +1 -1
- package/esm/components/QIcon/QIcon.vue.js +8 -8
- package/esm/components/QIcon/QIconFont.d.ts +0 -3
- package/esm/components/QIcon/QIconFont.d.ts.map +1 -1
- package/esm/components/QIcon/QIconFont.vue.js +10 -10
- package/esm/components/QIcon/QIconImg.d.ts.map +1 -1
- package/esm/components/QIcon/QIconImg.vue.js +4 -4
- package/esm/components/QIcon/QIconSvg.d.ts +0 -2
- package/esm/components/QIcon/QIconSvg.d.ts.map +1 -1
- package/esm/components/QIcon/QIconSvg.vue.js +10 -10
- package/esm/components/QIcon/index.d.ts +16 -8
- package/esm/components/QIcon/index.d.ts.map +1 -1
- package/esm/components/QInputGroup/QInputGroup.d.ts +0 -5
- package/esm/components/QInputGroup/QInputGroup.d.ts.map +1 -1
- package/esm/components/QInputGroup/QInputGroup.vue.js +24 -24
- package/esm/components/QInputGroup/index.d.ts +26 -2
- package/esm/components/QInputGroup/index.d.ts.map +1 -1
- package/esm/components/QLineLoader/QLineLoader.d.ts +1 -3
- package/esm/components/QLineLoader/QLineLoader.d.ts.map +1 -1
- package/esm/components/QLineLoader/QLineLoader.vue.js +3 -3
- package/esm/components/QLineLoader/index.d.ts +1 -2
- package/esm/components/QLineLoader/index.d.ts.map +1 -1
- package/esm/components/QList/QList.d.ts +138 -3
- package/esm/components/QList/QList.d.ts.map +1 -1
- package/esm/components/QList/QList.vue.js +117 -99
- package/esm/components/QList/QListItem.d.ts +2 -2
- package/esm/components/QList/QListItem.d.ts.map +1 -1
- package/esm/components/QList/QListItem.vue.js +39 -37
- package/esm/components/QList/QListItemGroup.d.ts +1 -3
- package/esm/components/QList/QListItemGroup.d.ts.map +1 -1
- package/esm/components/QList/QListItemGroup.vue.js +6 -6
- package/esm/components/QList/index.d.ts +189 -6
- package/esm/components/QList/index.d.ts.map +1 -1
- package/esm/components/QList/types.d.ts +8 -10
- package/esm/components/QList/types.d.ts.map +1 -1
- package/esm/components/QOverlay/QOverlay.d.ts +5 -4
- package/esm/components/QOverlay/QOverlay.d.ts.map +1 -1
- package/esm/components/QOverlay/QOverlay.vue.js +151 -136
- package/esm/components/QOverlay/index.d.ts +78 -2
- package/esm/components/QOverlay/index.d.ts.map +1 -1
- package/esm/components/QOverlay/types.d.ts +4 -0
- package/esm/components/QOverlay/types.d.ts.map +1 -1
- package/esm/components/QPopover/QPopover.d.ts +0 -1
- package/esm/components/QPopover/QPopover.d.ts.map +1 -1
- package/esm/components/QPopover/QPopover.vue.js +6 -6
- package/esm/components/QPopover/index.d.ts +49 -2
- package/esm/components/QPopover/index.d.ts.map +1 -1
- package/esm/components/QPropertyList/QPropertyList.d.ts +8 -5
- package/esm/components/QPropertyList/QPropertyList.d.ts.map +1 -1
- package/esm/components/QPropertyList/QPropertyList.vue.js +42 -41
- package/esm/components/QPropertyList/QPropertyListGroup.d.ts +0 -1
- package/esm/components/QPropertyList/QPropertyListGroup.d.ts.map +1 -1
- package/esm/components/QPropertyList/QPropertyListGroup.vue.js +9 -9
- package/esm/components/QPropertyList/QPropertyListPanel.d.ts +0 -1
- package/esm/components/QPropertyList/QPropertyListPanel.d.ts.map +1 -1
- package/esm/components/QPropertyList/QPropertyListPanel.vue.js +9 -9
- package/esm/components/QPropertyList/QPropertyListRow.d.ts +15 -18
- package/esm/components/QPropertyList/QPropertyListRow.d.ts.map +1 -1
- package/esm/components/QPropertyList/QPropertyListRow.vue.js +59 -54
- package/esm/components/QPropertyList/index.d.ts +117 -8
- package/esm/components/QPropertyList/index.d.ts.map +1 -1
- package/esm/components/QPropertyList/types.d.ts +8 -4
- package/esm/components/QPropertyList/types.d.ts.map +1 -1
- package/esm/components/QRemoveScrollBar/QRemoveScrollBar.d.ts +0 -2
- package/esm/components/QRemoveScrollBar/QRemoveScrollBar.d.ts.map +1 -1
- package/esm/components/QRemoveScrollBar/QRemoveScrollBar.vue.js +11 -11
- package/esm/components/QRemoveScrollBar/index.d.ts +23 -2
- package/esm/components/QRemoveScrollBar/index.d.ts.map +1 -1
- package/esm/components/QSelect/QSelect.d.ts +313 -28
- package/esm/components/QSelect/QSelect.d.ts.map +1 -1
- package/esm/components/QSelect/QSelect.vue.js +112 -129
- package/esm/components/QSelect/index.d.ts +314 -2
- package/esm/components/QSelect/index.d.ts.map +1 -1
- package/esm/components/QSelect/types.d.ts +13 -5
- package/esm/components/QSelect/types.d.ts.map +1 -1
- package/esm/components/QSelect/types.js +9 -11
- package/esm/components/QSkeletonLoader/QSkeletonLoader.d.ts +1 -5
- package/esm/components/QSkeletonLoader/QSkeletonLoader.d.ts.map +1 -1
- package/esm/components/QSkeletonLoader/QSkeletonLoader.vue.js +13 -13
- package/esm/components/QSkeletonLoader/index.d.ts +1 -2
- package/esm/components/QSkeletonLoader/index.d.ts.map +1 -1
- package/esm/components/QSpinnerLoader/QSpinnerLoader.d.ts +0 -1
- package/esm/components/QSpinnerLoader/QSpinnerLoader.d.ts.map +1 -1
- package/esm/components/QSpinnerLoader/QSpinnerLoader.vue.js +8 -8
- package/esm/components/QSpinnerLoader/index.d.ts +3 -2
- package/esm/components/QSpinnerLoader/index.d.ts.map +1 -1
- package/esm/components/QTextField/QTextField.d.ts +79 -22
- package/esm/components/QTextField/QTextField.d.ts.map +1 -1
- package/esm/components/QTextField/QTextField.vue.js +18 -18
- package/esm/components/QTextField/index.d.ts +122 -2
- package/esm/components/QTextField/index.d.ts.map +1 -1
- package/esm/components/QThemeProvider/QThemeProvider.d.ts.map +1 -1
- package/esm/components/QThemeProvider/QThemeProvider.vue.js +9 -8
- package/esm/components/QThemeProvider/index.d.ts +17 -2
- package/esm/components/QThemeProvider/index.d.ts.map +1 -1
- package/esm/components/QThemeProvider/types.d.ts +1 -1
- package/esm/components/QTooltip/QTooltip.d.ts +0 -4
- package/esm/components/QTooltip/QTooltip.d.ts.map +1 -1
- package/esm/components/QTooltip/QTooltip.vue.js +17 -17
- package/esm/components/QTooltip/index.d.ts +62 -2
- package/esm/components/QTooltip/index.d.ts.map +1 -1
- package/esm/components/__internal__/QChevron/QChevron.d.ts +14 -0
- package/esm/components/__internal__/QChevron/QChevron.d.ts.map +1 -0
- package/esm/components/__internal__/QChevron/QChevron.vue.js +23 -0
- package/esm/components/__internal__/QChevron/QChevron.vue2.js +4 -0
- package/esm/components/__internal__/QChevron/index.d.ts +13 -0
- package/esm/components/__internal__/QChevron/index.d.ts.map +1 -0
- package/esm/components/__internal__/QChevron/index.js +6 -0
- package/esm/components/__internal__/QChevron/types.d.ts +16 -0
- package/esm/components/__internal__/QChevron/types.d.ts.map +1 -0
- package/esm/components/__internal__/QChevron/types.js +8 -0
- package/esm/components/__internal__/QClearButton/QClearButton.d.ts +11 -0
- package/esm/components/__internal__/QClearButton/QClearButton.d.ts.map +1 -0
- package/esm/components/__internal__/QClearButton/QClearButton.vue.js +39 -0
- package/esm/components/__internal__/QClearButton/QClearButton.vue2.js +4 -0
- package/esm/components/__internal__/QClearButton/index.d.ts +12 -0
- package/esm/components/__internal__/QClearButton/index.d.ts.map +1 -0
- package/esm/components/__internal__/QClearButton/index.js +6 -0
- package/esm/components/__internal__/QClearButton/types.d.ts +23 -0
- package/esm/components/__internal__/QClearButton/types.d.ts.map +1 -0
- package/esm/components/__internal__/QClearButton/types.js +11 -0
- package/esm/components/index.d.ts +2 -0
- package/esm/components/index.d.ts.map +1 -1
- package/esm/components/index.js +48 -44
- package/esm/composables/group.js +5 -5
- 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/composables/theme.d.ts +54 -6
- package/esm/composables/theme.d.ts.map +1 -1
- package/esm/composables/theme.js +10 -12
- package/esm/framework.d.ts +17 -20
- package/esm/framework.d.ts.map +1 -1
- package/esm/framework.js +22 -25
- package/esm/index.d.ts +2 -0
- package/esm/templates/theme.js +16 -16
- package/esm/utils/color.d.ts +2 -1
- package/esm/utils/color.d.ts.map +1 -1
- package/esm/utils/color.js +19 -19
- package/esm/utils/setupPropsProxy.d.ts +22 -9
- package/esm/utils/setupPropsProxy.d.ts.map +1 -1
- package/esm/utils/setupPropsProxy.js +22 -22
- package/esm/utils/theme.d.ts +13 -1
- package/esm/utils/theme.d.ts.map +1 -1
- package/esm/utils/theme.js +40 -24
- package/package.json +19 -54
- /package/{LICENSE.md → LICENSE} +0 -0
|
@@ -1,5 +1,50 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { ComputedRef, DeepReadonly, InjectionKey, Ref } from 'vue';
|
|
2
|
+
import { ColorScheme } from '../utils/color';
|
|
3
|
+
export declare const ThemeSymbol: InjectionKey<ThemeInstance>;
|
|
4
|
+
/**
|
|
5
|
+
* Represents the two available theme modes for the application: light and dark.
|
|
6
|
+
*/
|
|
7
|
+
export type ThemeMode = 'light' | 'dark';
|
|
8
|
+
/**
|
|
9
|
+
* Represents the theme configuration for the application, including the default theme
|
|
10
|
+
* and a list of available themes with customizable color schemes.
|
|
11
|
+
*/
|
|
12
|
+
export type AppThemes = {
|
|
13
|
+
/** The name of the default theme to be applied initially. */
|
|
14
|
+
defaultTheme: string;
|
|
15
|
+
/** An array of theme definitions available for the application. */
|
|
16
|
+
themes: Array<{
|
|
17
|
+
/** The name of the theme. */
|
|
18
|
+
name: string;
|
|
19
|
+
/** The mode of the theme (e.g., light or dark). */
|
|
20
|
+
mode: ThemeMode;
|
|
21
|
+
/** An optional object to customize the color scheme of the theme. */
|
|
22
|
+
colors?: Partial<ColorScheme>;
|
|
23
|
+
}>;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Defines the structure of a theme, including its name, mode, and color scheme.
|
|
27
|
+
*/
|
|
28
|
+
export type ThemeDefinition = {
|
|
29
|
+
/** The unique name of the theme. */
|
|
30
|
+
name: string;
|
|
31
|
+
/** The mode of the theme (e.g., light or dark). */
|
|
32
|
+
mode: ThemeMode;
|
|
33
|
+
/** The color scheme associated with the theme. */
|
|
34
|
+
scheme: ColorScheme;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Represents an instance of a theme, containing reactive properties for
|
|
38
|
+
* managing theme state and accessing theme definitions.
|
|
39
|
+
*/
|
|
40
|
+
export type ThemeInstance = {
|
|
41
|
+
/** The reactive reference to the active theme's name. */
|
|
42
|
+
readonly name: Ref<string>;
|
|
43
|
+
/** A computed reference to the current theme definition. */
|
|
44
|
+
readonly current: DeepReadonly<ComputedRef<ThemeDefinition>>;
|
|
45
|
+
/** An array of available theme definitions. */
|
|
46
|
+
readonly themes: DeepReadonly<ThemeDefinition[]>;
|
|
47
|
+
};
|
|
3
48
|
/**
|
|
4
49
|
* Custom hook for accessing the theme configuration in context.
|
|
5
50
|
*
|
|
@@ -7,11 +52,14 @@ export declare const THEME_SYMBOL = "q-theme";
|
|
|
7
52
|
*/
|
|
8
53
|
export declare function useTheme(): ThemeInstance;
|
|
9
54
|
/**
|
|
10
|
-
* Provides a theme
|
|
55
|
+
* Provides and manages a theme instance based on the specified theme name.
|
|
56
|
+
*
|
|
57
|
+
* This function retrieves the available themes from the current theme context,
|
|
58
|
+
* creates a new theme instance, and provides it to the Vue dependency injection system.
|
|
11
59
|
*
|
|
12
|
-
* @param name -
|
|
60
|
+
* @param name - A reactive reference (`Ref<string>`) representing the name of the theme to activate.
|
|
13
61
|
*
|
|
14
|
-
* @returns The
|
|
62
|
+
* @returns The newly created and provided `ThemeInstance`.
|
|
15
63
|
*/
|
|
16
|
-
export declare function provideTheme(name: string): ThemeInstance;
|
|
64
|
+
export declare function provideTheme(name: Ref<string>): ThemeInstance;
|
|
17
65
|
//# 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,
|
|
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,GAAG,EAAE,MAAM,KAAK,CAAA;AACvE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAMhD,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;CAChD,CAAA;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,IAAI,aAAa,CAQxC;AAED;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,aAAa,CAU7D"}
|
package/esm/composables/theme.js
CHANGED
|
@@ -1,20 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { createThemeInstance as r } from "../utils/theme.js";
|
|
2
|
+
import { inject as c, provide as h } from "vue";
|
|
3
|
+
const n = Symbol.for("q-theme");
|
|
4
|
+
function s() {
|
|
5
|
+
const e = c(n);
|
|
5
6
|
if (!e)
|
|
6
7
|
throw new Error("[Quidgest UI] Could not find theme instance");
|
|
7
8
|
return e;
|
|
8
9
|
}
|
|
9
|
-
function
|
|
10
|
-
const o =
|
|
11
|
-
activeTheme: m(e),
|
|
12
|
-
themes: o.themes
|
|
13
|
-
};
|
|
10
|
+
function u(e) {
|
|
11
|
+
const o = s(), m = o.themes, t = r(e, m);
|
|
14
12
|
return h(n, t), t;
|
|
15
13
|
}
|
|
16
14
|
export {
|
|
17
|
-
n as
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
n as ThemeSymbol,
|
|
16
|
+
u as provideTheme,
|
|
17
|
+
s as useTheme
|
|
20
18
|
};
|
package/esm/framework.d.ts
CHANGED
|
@@ -1,28 +1,25 @@
|
|
|
1
1
|
import { Defaults } from './composables/defaults';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { AppThemes } from './composables/theme';
|
|
3
|
+
import { Component, Plugin } from 'vue';
|
|
4
|
+
/**
|
|
5
|
+
* Configuration options for the Quidgest UI framework plugin.
|
|
6
|
+
*/
|
|
4
7
|
export type FrameworkConfig = {
|
|
8
|
+
/** An optional record of components to be registered globally in the application. */
|
|
5
9
|
components?: Record<string, Component>;
|
|
10
|
+
/** An optional configuration for the available themes and the default theme. */
|
|
6
11
|
themes?: AppThemes;
|
|
12
|
+
/** An optional object containing global default values for the application. */
|
|
7
13
|
defaults?: Defaults;
|
|
8
14
|
};
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
export type ThemeDefinition = {
|
|
19
|
-
name: string;
|
|
20
|
-
mode: ThemeMode;
|
|
21
|
-
scheme: ColorScheme;
|
|
22
|
-
};
|
|
23
|
-
export type ThemeInstance = {
|
|
24
|
-
activeTheme: Ref<string>;
|
|
25
|
-
themes: ThemeDefinition[];
|
|
26
|
-
};
|
|
15
|
+
/**
|
|
16
|
+
* Creates the Quidgest UI framework plugin that installs components, sets up global defaults,
|
|
17
|
+
* and configures themes based on the provided configuration.
|
|
18
|
+
*
|
|
19
|
+
* @param config - The framework configuration, including components, defaults, and themes.
|
|
20
|
+
* Defaults to an empty object if no configuration is provided.
|
|
21
|
+
*
|
|
22
|
+
* @returns A Vue plugin (`Plugin`) with an `install` function to set up the framework.
|
|
23
|
+
*/
|
|
27
24
|
export declare function createFramework(config?: FrameworkConfig): Plugin;
|
|
28
25
|
//# sourceMappingURL=framework.d.ts.map
|
package/esm/framework.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"framework.d.ts","sourceRoot":"","sources":["../src/framework.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAA;AACtD,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"framework.d.ts","sourceRoot":"","sources":["../src/framework.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAA;AACtD,OAAO,KAAK,EAAE,SAAS,EAAmB,MAAM,qBAAqB,CAAA;AACrE,OAAO,KAAK,EAAO,SAAS,EAAE,MAAM,EAAE,MAAM,KAAK,CAAA;AAMjD;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC7B,qFAAqF;IACrF,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAA;IAEtC,gFAAgF;IAChF,MAAM,CAAC,EAAE,SAAS,CAAA;IAElB,+EAA+E;IAC/E,QAAQ,CAAC,EAAE,QAAQ,CAAA;CACnB,CAAA;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,MAAM,GAAE,eAAoB,GAAG,MAAM,CAiBpE"}
|
package/esm/framework.js
CHANGED
|
@@ -1,47 +1,44 @@
|
|
|
1
1
|
import { DEFAULTS_SYMBOL as c } from "./composables/defaults.js";
|
|
2
|
-
import {
|
|
3
|
-
import { defaultLightColorScheme as
|
|
4
|
-
import { ref as
|
|
5
|
-
import {
|
|
6
|
-
function
|
|
2
|
+
import { ThemeSymbol as h } from "./composables/theme.js";
|
|
3
|
+
import { defaultLightColorScheme as l, defaultDarkColorScheme as i } from "./templates/theme.js";
|
|
4
|
+
import { ref as a, watch as f } from "vue";
|
|
5
|
+
import { createThemeInstance as d, generateRootStyle as u } from "./utils/theme.js";
|
|
6
|
+
function D(s = {}) {
|
|
7
7
|
return { install: (o) => {
|
|
8
|
-
const t =
|
|
9
|
-
for (const
|
|
10
|
-
o.component(
|
|
11
|
-
const e =
|
|
12
|
-
o.provide(c,
|
|
8
|
+
const t = s.components || {};
|
|
9
|
+
for (const n in t)
|
|
10
|
+
o.component(n, t[n]);
|
|
11
|
+
const e = s.defaults || {};
|
|
12
|
+
o.provide(c, a(e)), p(o, s.themes);
|
|
13
13
|
} };
|
|
14
14
|
}
|
|
15
|
-
function
|
|
15
|
+
function p(s, m) {
|
|
16
16
|
const o = [];
|
|
17
17
|
let t;
|
|
18
|
-
if (!
|
|
18
|
+
if (!m)
|
|
19
19
|
t = "default", o.push({
|
|
20
20
|
name: t,
|
|
21
21
|
mode: "light",
|
|
22
|
-
scheme:
|
|
22
|
+
scheme: l
|
|
23
23
|
});
|
|
24
24
|
else
|
|
25
|
-
for (const e of
|
|
26
|
-
const r = { ...e.mode === "light" ?
|
|
25
|
+
for (const e of m.themes) {
|
|
26
|
+
const r = { ...e.mode === "light" ? l : i, ...e.colors };
|
|
27
27
|
o.push({
|
|
28
28
|
name: e.name,
|
|
29
29
|
mode: e.mode,
|
|
30
30
|
scheme: r
|
|
31
|
-
}), e.name ===
|
|
31
|
+
}), e.name === m.defaultTheme && (t = e.name);
|
|
32
32
|
}
|
|
33
33
|
if (t) {
|
|
34
|
-
const e =
|
|
35
|
-
|
|
36
|
-
themes: o
|
|
37
|
-
};
|
|
38
|
-
d(o), f(e.activeTheme, p, { immediate: !0 }), m.provide(i, e);
|
|
34
|
+
const e = a(t), n = d(e, o);
|
|
35
|
+
u(o), f(n.name, S, { immediate: !0 }), s.provide(h, n);
|
|
39
36
|
}
|
|
40
37
|
}
|
|
41
|
-
function
|
|
42
|
-
const
|
|
43
|
-
|
|
38
|
+
function S(s) {
|
|
39
|
+
const m = document.documentElement, t = Array.from(m.classList).filter((e) => !e.startsWith("q-theme"));
|
|
40
|
+
m.className = t.join(" "), m.classList.add(`q-theme--${s}`);
|
|
44
41
|
}
|
|
45
42
|
export {
|
|
46
|
-
|
|
43
|
+
D as createFramework
|
|
47
44
|
};
|
package/esm/index.d.ts
CHANGED
|
@@ -15,8 +15,10 @@ declare module '@vue/runtime-core' {
|
|
|
15
15
|
QCard: typeof import('@quidgest/ui/components')['QCard']
|
|
16
16
|
QCheckbox: typeof import('@quidgest/ui/components')['QCheckbox']
|
|
17
17
|
QCollapsible: typeof import('@quidgest/ui/components')['QCollapsible']
|
|
18
|
+
QColorPicker: typeof import('@quidgest/ui/components')['QColorPicker']
|
|
18
19
|
QCombobox: typeof import('@quidgest/ui/components')['QCombobox']
|
|
19
20
|
QDialog: typeof import('@quidgest/ui/components')['QDialog']
|
|
21
|
+
QDropdownMenu: typeof import('@quidgest/ui/components')['QDropdownMenu']
|
|
20
22
|
QField: typeof import('@quidgest/ui/components')['QField']
|
|
21
23
|
QIcon: typeof import('@quidgest/ui/components')['QIcon']
|
|
22
24
|
QIconFont: typeof import('@quidgest/ui/components')['QIconFont']
|
package/esm/templates/theme.js
CHANGED
|
@@ -30,28 +30,28 @@ const f = {
|
|
|
30
30
|
onDanger: "#fff",
|
|
31
31
|
onInfo: "#fff"
|
|
32
32
|
}, a = {
|
|
33
|
-
primary: "#
|
|
34
|
-
primaryLight: "#
|
|
35
|
-
primaryDark: "#
|
|
33
|
+
primary: "#008ad2",
|
|
34
|
+
primaryLight: "#006398",
|
|
35
|
+
primaryDark: "#cde5ff",
|
|
36
36
|
secondary: "#003552",
|
|
37
37
|
highlight: "#f65600",
|
|
38
|
-
info: "#
|
|
39
|
-
infoLight: "#
|
|
40
|
-
infoDark: "#
|
|
41
|
-
success: "#
|
|
42
|
-
successLight: "#
|
|
43
|
-
successDark: "#
|
|
38
|
+
info: "#17a2b8",
|
|
39
|
+
infoLight: "#11798a",
|
|
40
|
+
infoDark: "#bceff7",
|
|
41
|
+
success: "#28a745",
|
|
42
|
+
successLight: "#1e7d34",
|
|
43
|
+
successDark: "#c2f0cd",
|
|
44
44
|
warning: "#ffa900",
|
|
45
|
-
warningLight: "#
|
|
46
|
-
warningDark: "#
|
|
47
|
-
danger: "#
|
|
48
|
-
dangerLight: "#
|
|
49
|
-
dangerDark: "#
|
|
45
|
+
warningLight: "#bf7f00",
|
|
46
|
+
warningDark: "#ffeabf",
|
|
47
|
+
danger: "#b71c1c",
|
|
48
|
+
dangerLight: "#891515",
|
|
49
|
+
dangerDark: "#f7cccc",
|
|
50
50
|
background: "#202428",
|
|
51
51
|
container: "#202428",
|
|
52
52
|
neutral: "#9299a0",
|
|
53
|
-
neutralLight: "#
|
|
54
|
-
neutralDark: "#
|
|
53
|
+
neutralLight: "#40474f",
|
|
54
|
+
neutralDark: "#c4c5ca",
|
|
55
55
|
onBackground: "#fff",
|
|
56
56
|
onPrimary: "#fff",
|
|
57
57
|
onSecondary: "#fff",
|
package/esm/utils/color.d.ts
CHANGED
|
@@ -49,9 +49,10 @@ export type HSL = {
|
|
|
49
49
|
/**
|
|
50
50
|
* Checks if the given string represents a valid hexadecimal color code.
|
|
51
51
|
* @param hexColorCode - The color code to validate.
|
|
52
|
+
* @param enforceSixChars - Whether to enforce only the 6-character format (default is false).
|
|
52
53
|
* @returns True if the color code is valid, false otherwise.
|
|
53
54
|
*/
|
|
54
|
-
export declare function isValidHex(hexColorCode: string): boolean;
|
|
55
|
+
export declare function isValidHex(hexColorCode: string, enforceSixChars?: boolean): boolean;
|
|
55
56
|
/**
|
|
56
57
|
* Tries to parse a string in the format 'rgb(r, g, b)' to an RGB object.
|
|
57
58
|
* @param tr The input string to parse, expected in the format 'rgb(r, g, b)'.
|
package/esm/utils/color.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"color.d.ts","sourceRoot":"","sources":["../../src/utils/color.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GAAG;IAEzB,OAAO,EAAE,MAAM,CAAA;IACf,YAAY,EAAE,MAAM,CAAA;IACpB,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;IAEjB,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE,MAAM,CAAA;IAEnB,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE,MAAM,CAAA;IAGnB,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;IAEd,OAAO,EAAE,MAAM,CAAA;IACf,YAAY,EAAE,MAAM,CAAA;IACpB,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;IAEjB,OAAO,EAAE,MAAM,CAAA;IACf,YAAY,EAAE,MAAM,CAAA;IACpB,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;IAEjB,MAAM,EAAE,MAAM,CAAA;IACd,WAAW,EAAE,MAAM,CAAA;IACnB,UAAU,EAAE,MAAM,CAAA;IAClB,QAAQ,EAAE,MAAM,CAAA;IAGhB,UAAU,EAAE,MAAM,CAAA;IAClB,YAAY,EAAE,MAAM,CAAA;IAEpB,SAAS,EAAE,MAAM,CAAA;IAGjB,OAAO,EAAE,MAAM,CAAA;IACf,YAAY,EAAE,MAAM,CAAA;IACpB,WAAW,EAAE,MAAM,CAAA;CACnB,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,GAAG,GAAG;IACjB,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;CACT,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,GAAG,GAAG;IACjB,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;CACT,CAAA;AAED
|
|
1
|
+
{"version":3,"file":"color.d.ts","sourceRoot":"","sources":["../../src/utils/color.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GAAG;IAEzB,OAAO,EAAE,MAAM,CAAA;IACf,YAAY,EAAE,MAAM,CAAA;IACpB,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;IAEjB,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE,MAAM,CAAA;IAEnB,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE,MAAM,CAAA;IAGnB,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;IAEd,OAAO,EAAE,MAAM,CAAA;IACf,YAAY,EAAE,MAAM,CAAA;IACpB,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;IAEjB,OAAO,EAAE,MAAM,CAAA;IACf,YAAY,EAAE,MAAM,CAAA;IACpB,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;IAEjB,MAAM,EAAE,MAAM,CAAA;IACd,WAAW,EAAE,MAAM,CAAA;IACnB,UAAU,EAAE,MAAM,CAAA;IAClB,QAAQ,EAAE,MAAM,CAAA;IAGhB,UAAU,EAAE,MAAM,CAAA;IAClB,YAAY,EAAE,MAAM,CAAA;IAEpB,SAAS,EAAE,MAAM,CAAA;IAGjB,OAAO,EAAE,MAAM,CAAA;IACf,YAAY,EAAE,MAAM,CAAA;IACpB,WAAW,EAAE,MAAM,CAAA;CACnB,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,GAAG,GAAG;IACjB,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;CACT,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,GAAG,GAAG;IACjB,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;CACT,CAAA;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,YAAY,EAAE,MAAM,EAAE,eAAe,GAAE,OAAe,GAAG,OAAO,CAQ1F;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,GAAG,SAAS,CASxD;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,CAkB7C;AAED;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,GAAG,GAAG,CAYrD;AAED;;;;;GAKG;AACH,wBAAgB,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,GAAG,GAAG,CAYpD;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM,CAM3C;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,CAqCtC;AAED;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,CAuBtC;AAED;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAOhE;AAED,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,mBAIpD;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAU3D"}
|
package/esm/utils/color.js
CHANGED
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
function
|
|
2
|
-
return /^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/.test(t);
|
|
1
|
+
function h(t, n = !1) {
|
|
2
|
+
return n ? /^#[a-fA-F0-9]{6}$/.test(t) : /^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/.test(t);
|
|
3
3
|
}
|
|
4
|
-
function
|
|
4
|
+
function d(t) {
|
|
5
5
|
const n = t.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);
|
|
6
6
|
if (n) {
|
|
7
7
|
const s = parseInt(n[1], 10), e = parseInt(n[2], 10), r = parseInt(n[3], 10);
|
|
8
8
|
return { r: s, g: e, b: r };
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
|
-
function
|
|
12
|
-
if (
|
|
11
|
+
function o(t) {
|
|
12
|
+
if (h(t)) {
|
|
13
13
|
t.length === 4 && (t = "#" + t[1] + t[1] + t[2] + t[2] + t[3] + t[3]);
|
|
14
14
|
const n = parseInt(t.slice(1, 3), 16), s = parseInt(t.slice(3, 5), 16), e = parseInt(t.slice(5, 7), 16);
|
|
15
15
|
return { r: n, g: s, b: e };
|
|
16
16
|
} else {
|
|
17
|
-
const n =
|
|
17
|
+
const n = d(t);
|
|
18
18
|
if (n) return n;
|
|
19
19
|
}
|
|
20
20
|
throw new Error("Invalid color format");
|
|
21
21
|
}
|
|
22
22
|
function b(t) {
|
|
23
23
|
const n = t.r / 255, s = t.g / 255, e = t.b / 255, r = Math.max(n, s, e), i = Math.min(n, s, e);
|
|
24
|
-
let a = 0,
|
|
25
|
-
const
|
|
24
|
+
let a = 0, c;
|
|
25
|
+
const u = (r + i) / 2;
|
|
26
26
|
if (r === i)
|
|
27
|
-
a =
|
|
27
|
+
a = c = 0;
|
|
28
28
|
else {
|
|
29
|
-
const
|
|
30
|
-
switch (
|
|
29
|
+
const f = r - i;
|
|
30
|
+
switch (c = u > 0.5 ? f / (2 - r - i) : f / (r + i), r) {
|
|
31
31
|
case n:
|
|
32
|
-
a = (s - e) /
|
|
32
|
+
a = (s - e) / f + (s < e ? 6 : 0);
|
|
33
33
|
break;
|
|
34
34
|
case s:
|
|
35
|
-
a = (e - n) /
|
|
35
|
+
a = (e - n) / f + 2;
|
|
36
36
|
break;
|
|
37
37
|
case e:
|
|
38
|
-
a = (n - s) /
|
|
38
|
+
a = (n - s) / f + 4;
|
|
39
39
|
break;
|
|
40
40
|
}
|
|
41
41
|
a /= 6;
|
|
42
42
|
}
|
|
43
43
|
return {
|
|
44
44
|
h: Math.round(a * 360),
|
|
45
|
-
s: Math.round(
|
|
46
|
-
l: Math.round(
|
|
45
|
+
s: Math.round(c * 100),
|
|
46
|
+
l: Math.round(u * 100)
|
|
47
47
|
};
|
|
48
48
|
}
|
|
49
49
|
function g(t) {
|
|
@@ -51,8 +51,8 @@ function g(t) {
|
|
|
51
51
|
}
|
|
52
52
|
export {
|
|
53
53
|
g as getContrastingColor,
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
h as isValidHex,
|
|
55
|
+
o as parseColor,
|
|
56
56
|
b as rgbToHsl,
|
|
57
|
-
|
|
57
|
+
d as tryParseRgb
|
|
58
58
|
};
|
|
@@ -1,11 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { VNode } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* Checks if a given property is defined in the `vnode` props.
|
|
4
|
+
*
|
|
5
|
+
* @param vnode The Vue component's VNode instance.
|
|
6
|
+
* @param prop The property name to check.
|
|
7
|
+
* @returns `true` if the property exists in the vnode props, `false` otherwise.
|
|
8
|
+
*/
|
|
8
9
|
export declare function propIsDefined(vnode: VNode, prop: string): boolean;
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Sets up a proxy for a Vue component's props.
|
|
12
|
+
* This proxy allows for fetching prop defaults from context.
|
|
13
|
+
*
|
|
14
|
+
* @template C The type of the component.
|
|
15
|
+
* @param component The component to wrap with the proxy.
|
|
16
|
+
* @returns The component with the `setup` function enhanced to use the proxy for props.
|
|
17
|
+
*
|
|
18
|
+
* Example usage:
|
|
19
|
+
* ```ts
|
|
20
|
+
* const QButton = setupPropsProxy(_QButton);
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export declare function setupPropsProxy<C>(component: C): C;
|
|
11
24
|
//# sourceMappingURL=setupPropsProxy.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setupPropsProxy.d.ts","sourceRoot":"","sources":["../../src/utils/setupPropsProxy.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"setupPropsProxy.d.ts","sourceRoot":"","sources":["../../src/utils/setupPropsProxy.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAgB,KAAK,EAAE,MAAM,KAAK,CAAA;AAO9C;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,WAQvD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,GAAG,CAAC,CAkClD"}
|
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
import { useDefaults as m } from "../composables/defaults.js";
|
|
2
|
-
import { getCurrentInstance as
|
|
3
|
-
import { isEmpty as
|
|
4
|
-
import { toKebabCase as
|
|
5
|
-
function
|
|
6
|
-
var
|
|
7
|
-
const
|
|
8
|
-
return
|
|
2
|
+
import { getCurrentInstance as d } from "vue";
|
|
3
|
+
import { isEmpty as v } from "./isEmpty.js";
|
|
4
|
+
import { toKebabCase as y } from "./string.js";
|
|
5
|
+
function g(r, n) {
|
|
6
|
+
var t;
|
|
7
|
+
const e = y(n);
|
|
8
|
+
return e ? typeof ((t = r.props) == null ? void 0 : t[e]) < "u" : !1;
|
|
9
9
|
}
|
|
10
|
-
function
|
|
11
|
-
const
|
|
12
|
-
return
|
|
13
|
-
const
|
|
14
|
-
if (
|
|
15
|
-
const
|
|
16
|
-
if (
|
|
17
|
-
const a = new Proxy(
|
|
10
|
+
function I(r) {
|
|
11
|
+
const n = r, e = n.setup;
|
|
12
|
+
return e && (n.setup = (t, o) => {
|
|
13
|
+
const s = m();
|
|
14
|
+
if (v(s.value)) return e(t, o);
|
|
15
|
+
const f = d();
|
|
16
|
+
if (f === null) return e(t, o);
|
|
17
|
+
const a = new Proxy(t, {
|
|
18
18
|
get(l, u) {
|
|
19
|
-
var
|
|
20
|
-
const
|
|
21
|
-
return typeof u == "string" && !
|
|
19
|
+
var p;
|
|
20
|
+
const i = Reflect.get(l, u), c = (p = s.value) == null ? void 0 : p[u];
|
|
21
|
+
return typeof u == "string" && !g(f.vnode, u) ? c ?? i : i;
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
|
-
return
|
|
25
|
-
}),
|
|
24
|
+
return e(a, o);
|
|
25
|
+
}), r;
|
|
26
26
|
}
|
|
27
27
|
export {
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
g as propIsDefined,
|
|
29
|
+
I as setupPropsProxy
|
|
30
30
|
};
|
package/esm/utils/theme.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { ThemeDefinition } from '../
|
|
1
|
+
import { ThemeDefinition, ThemeInstance } from '../composables/theme';
|
|
2
|
+
import { DeepReadonly, Ref } from 'vue';
|
|
3
|
+
export declare const THEME_NODE_ID = "q-theme";
|
|
2
4
|
/**
|
|
3
5
|
* Gets or creates a style node for applying dynamic themes.
|
|
4
6
|
*
|
|
@@ -18,4 +20,14 @@ export declare function generateRootStyle(themes: ThemeDefinition[]): void;
|
|
|
18
20
|
* @returns The corresponding CSS variable name.
|
|
19
21
|
*/
|
|
20
22
|
export declare function toProperty(color: string): string;
|
|
23
|
+
/**
|
|
24
|
+
* Creates a theme instance that allows reactive access to a specific theme.
|
|
25
|
+
*
|
|
26
|
+
* @param name - The name of the theme to use.
|
|
27
|
+
* @param themes - A readonly array of available theme definitions.
|
|
28
|
+
* @returns A ThemeInstance object containing the current theme and metadata.
|
|
29
|
+
*
|
|
30
|
+
* @throws Will throw an error if the specified theme name is not found.
|
|
31
|
+
*/
|
|
32
|
+
export declare function createThemeInstance(name: Ref<string>, themes: DeepReadonly<ThemeDefinition[]>): ThemeInstance;
|
|
21
33
|
//# sourceMappingURL=theme.d.ts.map
|
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":"
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/utils/theme.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACzE,OAAO,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAQ5C,eAAO,MAAM,aAAa,YAAY,CAAA;AAEtC;;;;GAIG;AACH,wBAAgB,YAAY,IAAI,gBAAgB,CAY/C;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,eAAe,EAAE,QA2B1D;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,UAOvC;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAClC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,EACjB,MAAM,EAAE,YAAY,CAAC,eAAe,EAAE,CAAC,GACrC,aAAa,CAgBf"}
|
package/esm/utils/theme.js
CHANGED
|
@@ -1,40 +1,56 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { parseColor as
|
|
3
|
-
import { toKebabCase as
|
|
4
|
-
|
|
1
|
+
import { computed as h } from "vue";
|
|
2
|
+
import { parseColor as i } from "./color.js";
|
|
3
|
+
import { toKebabCase as d } from "./string.js";
|
|
4
|
+
const u = "q-theme";
|
|
5
|
+
function a() {
|
|
5
6
|
let e = document.getElementById(
|
|
6
|
-
|
|
7
|
+
u
|
|
7
8
|
);
|
|
8
|
-
return e || (e = document.createElement("style"), e.id =
|
|
9
|
+
return e || (e = document.createElement("style"), e.id = u, document.head.appendChild(e)), e;
|
|
9
10
|
}
|
|
10
|
-
function
|
|
11
|
+
function g(e) {
|
|
11
12
|
let t = "";
|
|
12
|
-
for (const
|
|
13
|
-
t += `.q-theme--${
|
|
13
|
+
for (const c of e) {
|
|
14
|
+
t += `.q-theme--${c.name} {
|
|
14
15
|
`;
|
|
15
|
-
const
|
|
16
|
-
let
|
|
17
|
-
for (
|
|
18
|
-
const
|
|
19
|
-
if (
|
|
20
|
-
t += ` ${
|
|
16
|
+
const o = c.scheme;
|
|
17
|
+
let n;
|
|
18
|
+
for (n in o) {
|
|
19
|
+
const m = o[n];
|
|
20
|
+
if (m) {
|
|
21
|
+
t += ` ${f(n)}: ${m};
|
|
21
22
|
`;
|
|
22
|
-
const
|
|
23
|
-
t += ` ${
|
|
23
|
+
const s = i(m);
|
|
24
|
+
t += ` ${f(n)}-rgb: ${s.r} ${s.g} ${s.b};
|
|
24
25
|
`;
|
|
25
26
|
}
|
|
26
27
|
}
|
|
27
28
|
t += `}
|
|
28
29
|
`;
|
|
29
30
|
}
|
|
30
|
-
const
|
|
31
|
-
|
|
31
|
+
const r = a();
|
|
32
|
+
r.textContent = t;
|
|
32
33
|
}
|
|
33
|
-
function
|
|
34
|
-
return e ? `--q-theme-${
|
|
34
|
+
function f(e) {
|
|
35
|
+
return e ? `--q-theme-${d(e)}` : "";
|
|
36
|
+
}
|
|
37
|
+
function E(e, t) {
|
|
38
|
+
const r = h(() => {
|
|
39
|
+
const o = t.find((n) => n.name === e.value);
|
|
40
|
+
if (!o)
|
|
41
|
+
throw new Error(`Theme "${e}" not found`);
|
|
42
|
+
return o;
|
|
43
|
+
});
|
|
44
|
+
return {
|
|
45
|
+
name: e,
|
|
46
|
+
current: r,
|
|
47
|
+
themes: t
|
|
48
|
+
};
|
|
35
49
|
}
|
|
36
50
|
export {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
51
|
+
u as THEME_NODE_ID,
|
|
52
|
+
E as createThemeInstance,
|
|
53
|
+
g as generateRootStyle,
|
|
54
|
+
a as getThemeNode,
|
|
55
|
+
f as toProperty
|
|
40
56
|
};
|