@quidgest/ui 0.11.0 → 0.12.1
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 +24 -0
- package/dist/ui.css +27 -2
- package/dist/ui.esm.js +700 -654
- package/dist/ui.js +8 -5
- package/dist/ui.min.css +1 -1
- package/dist/ui.min.js +147 -133
- package/dist/ui.scss +28 -3
- package/esm/components/QButton/QButton.d.ts +92 -0
- package/esm/components/QButton/QButton.d.ts.map +1 -0
- package/esm/components/QButton/QButton.vue.js +87 -0
- package/esm/components/QButton/QButton.vue2.js +4 -0
- package/esm/components/QButton/index.d.ts +4 -0
- package/esm/components/QButton/index.d.ts.map +1 -0
- package/esm/components/QButtonGroup/QButtonGroup.d.ts +51 -0
- package/esm/components/QButtonGroup/QButtonGroup.d.ts.map +1 -0
- package/esm/components/QButtonGroup/QButtonGroup.vue.js +41 -0
- package/esm/components/QButtonGroup/QButtonGroup.vue2.js +4 -0
- package/esm/components/QButtonGroup/index.d.ts +4 -0
- package/esm/components/QButtonGroup/index.d.ts.map +1 -0
- package/esm/components/QButtonToggle/QButtonToggle.d.ts +81 -0
- package/esm/components/QButtonToggle/QButtonToggle.d.ts.map +1 -0
- package/esm/components/QButtonToggle/QButtonToggle.vue.js +58 -0
- package/esm/components/QButtonToggle/QButtonToggle.vue2.js +4 -0
- package/esm/components/QButtonToggle/index.d.ts +4 -0
- package/esm/components/QButtonToggle/index.d.ts.map +1 -0
- package/esm/components/QCombobox/QCombobox.d.ts +524 -0
- package/esm/components/QCombobox/QCombobox.d.ts.map +1 -0
- package/esm/components/QCombobox/QCombobox.vue.js +381 -0
- package/esm/components/QCombobox/QCombobox.vue2.js +4 -0
- package/esm/components/QCombobox/index.d.ts +4 -0
- package/esm/components/QCombobox/index.d.ts.map +1 -0
- package/esm/components/QField/QField.d.ts +89 -0
- package/esm/components/QField/QField.d.ts.map +1 -0
- package/esm/components/QField/QField.vue.js +81 -0
- package/esm/components/QField/QField.vue2.js +4 -0
- package/esm/components/QField/index.d.ts +5 -0
- package/esm/components/QField/index.d.ts.map +1 -0
- package/esm/components/QField/index.js +6 -0
- package/esm/components/QIcon/InlineSvg.d.ts +110 -0
- package/esm/components/QIcon/InlineSvg.d.ts.map +1 -0
- package/esm/components/QIcon/InlineSvg.js +139 -0
- package/esm/components/QIcon/QIcon.d.ts +50 -0
- package/esm/components/QIcon/QIcon.d.ts.map +1 -0
- package/esm/components/QIcon/QIcon.vue.js +36 -0
- package/esm/components/QIcon/QIcon.vue2.js +4 -0
- package/esm/components/QIcon/QIconFont.d.ts +57 -0
- package/esm/components/QIcon/QIconFont.d.ts.map +1 -0
- package/esm/components/QIcon/QIconFont.vue.js +29 -0
- package/esm/components/QIcon/QIconFont.vue2.js +4 -0
- package/esm/components/QIcon/QIconImg.d.ts +38 -0
- package/esm/components/QIcon/QIconImg.d.ts.map +1 -0
- package/esm/components/QIcon/QIconImg.vue.js +22 -0
- package/esm/components/QIcon/QIconImg.vue2.js +4 -0
- package/esm/components/QIcon/QIconSvg.d.ts +72 -0
- package/esm/components/QIcon/QIconSvg.d.ts.map +1 -0
- package/esm/components/QIcon/QIconSvg.vue.js +34 -0
- package/esm/components/QIcon/QIconSvg.vue2.js +4 -0
- package/esm/components/QIcon/index.d.ts +8 -0
- package/esm/components/QIcon/index.d.ts.map +1 -0
- package/esm/components/QIcon/index.js +15 -0
- package/esm/components/QInputGroup/QInputGroup.d.ts +85 -0
- package/esm/components/QInputGroup/QInputGroup.d.ts.map +1 -0
- package/esm/components/QInputGroup/QInputGroup.vue.js +79 -0
- package/esm/components/QInputGroup/QInputGroup.vue2.js +4 -0
- package/esm/components/QInputGroup/index.d.ts +4 -0
- package/esm/components/QInputGroup/index.d.ts.map +1 -0
- package/esm/components/QLineLoader/QLineLoader.d.ts +32 -0
- package/esm/components/QLineLoader/QLineLoader.d.ts.map +1 -0
- package/esm/components/QLineLoader/QLineLoader.vue.js +22 -0
- package/esm/components/QLineLoader/QLineLoader.vue2.js +4 -0
- package/esm/components/QLineLoader/index.d.ts +4 -0
- package/esm/components/QLineLoader/index.d.ts.map +1 -0
- package/esm/components/QList/QList.d.ts +159 -0
- package/esm/components/QList/QList.d.ts.map +1 -0
- package/esm/components/QList/QList.vue.js +187 -0
- package/esm/components/QList/QList.vue2.js +4 -0
- package/esm/components/QList/QListItem.d.ts +89 -0
- package/esm/components/QList/QListItem.d.ts.map +1 -0
- package/esm/components/QList/QListItem.vue.js +102 -0
- package/esm/components/QList/QListItem.vue2.js +4 -0
- package/esm/components/QList/QListItemGroup.d.ts +43 -0
- package/esm/components/QList/QListItemGroup.d.ts.map +1 -0
- package/esm/components/QList/QListItemGroup.vue.js +29 -0
- package/esm/components/QList/QListItemGroup.vue2.js +4 -0
- package/esm/components/QList/index.d.ts +7 -0
- package/esm/components/QList/index.d.ts.map +1 -0
- package/esm/components/QList/index.js +12 -0
- package/esm/components/QOverlay/QOverlay.d.ts +236 -0
- package/esm/components/QOverlay/QOverlay.d.ts.map +1 -0
- package/esm/components/QOverlay/QOverlay.vue.js +250 -0
- package/esm/components/QOverlay/QOverlay.vue2.js +4 -0
- package/esm/components/QOverlay/index.d.ts +4 -0
- package/esm/components/QOverlay/index.d.ts.map +1 -0
- package/esm/components/QOverlay/index.js +6 -0
- package/esm/components/QPopover/QPopover.d.ts +132 -0
- package/esm/components/QPopover/QPopover.d.ts.map +1 -0
- package/esm/components/QPopover/QPopover.vue.js +71 -0
- package/esm/components/QPopover/QPopover.vue2.js +4 -0
- package/esm/components/QPopover/index.d.ts +4 -0
- package/esm/components/QPopover/index.d.ts.map +1 -0
- package/esm/components/QSelect/QSelect.d.ts +265 -0
- package/esm/components/QSelect/QSelect.d.ts.map +1 -0
- package/esm/components/QSelect/QSelect.vue.js +317 -0
- package/esm/components/QSelect/QSelect.vue2.js +4 -0
- package/esm/components/QSelect/index.d.ts +4 -0
- package/esm/components/QSelect/index.d.ts.map +1 -0
- package/esm/components/QSkeletonLoader/QSkeletonLoader.d.ts +46 -0
- package/esm/components/QSkeletonLoader/QSkeletonLoader.d.ts.map +1 -0
- package/esm/components/QSkeletonLoader/QSkeletonLoader.vue.js +39 -0
- package/esm/components/QSkeletonLoader/QSkeletonLoader.vue2.js +4 -0
- package/esm/components/QSkeletonLoader/index.d.ts +4 -0
- package/esm/components/QSkeletonLoader/index.d.ts.map +1 -0
- package/esm/components/QSpinnerLoader/QSpinnerLoader.d.ts +39 -0
- package/esm/components/QSpinnerLoader/QSpinnerLoader.d.ts.map +1 -0
- package/esm/components/QSpinnerLoader/QSpinnerLoader.vue.js +26 -0
- package/esm/components/QSpinnerLoader/QSpinnerLoader.vue2.js +4 -0
- package/esm/components/QSpinnerLoader/index.d.ts +4 -0
- package/esm/components/QSpinnerLoader/index.d.ts.map +1 -0
- package/esm/components/QSpinnerLoader/index.js +6 -0
- package/esm/components/QTextField/QTextField.d.ts +162 -0
- package/esm/components/QTextField/QTextField.d.ts.map +1 -0
- package/esm/components/QTextField/QTextField.vue.js +99 -0
- package/esm/components/QTextField/QTextField.vue2.js +4 -0
- package/esm/components/QTextField/index.d.ts +4 -0
- package/esm/components/QTextField/index.d.ts.map +1 -0
- package/esm/components/QTextField/index.js +6 -0
- package/esm/components/QThemeProvider/QThemeProvider.d.ts +25 -0
- package/esm/components/QThemeProvider/QThemeProvider.d.ts.map +1 -0
- package/esm/components/QThemeProvider/QThemeProvider.vue.js +24 -0
- package/esm/components/QThemeProvider/QThemeProvider.vue2.js +4 -0
- package/esm/components/QThemeProvider/index.d.ts +4 -0
- package/esm/components/QThemeProvider/index.d.ts.map +1 -0
- package/esm/components/QTooltip/QTooltip.d.ts +189 -0
- package/esm/components/QTooltip/QTooltip.d.ts.map +1 -0
- package/esm/components/QTooltip/QTooltip.vue.js +74 -0
- package/esm/components/QTooltip/QTooltip.vue2.js +4 -0
- package/esm/components/QTooltip/index.d.ts +4 -0
- package/esm/components/QTooltip/index.d.ts.map +1 -0
- package/esm/components/index.d.ts +18 -0
- package/esm/components/index.d.ts.map +1 -0
- package/esm/components/index.js +46 -0
- package/esm/composables/defaults.d.ts +25 -0
- package/esm/composables/defaults.d.ts.map +1 -0
- package/esm/composables/defaults.js +33 -0
- package/esm/composables/index.d.ts +2 -0
- package/esm/composables/index.d.ts.map +1 -0
- package/esm/composables/overlay.d.ts +116 -0
- package/esm/composables/overlay.d.ts.map +1 -0
- package/esm/composables/overlay.js +142 -0
- package/esm/composables/theme.d.ts +18 -0
- package/esm/composables/theme.d.ts.map +1 -0
- package/esm/composables/theme.js +20 -0
- package/esm/composables/uid.d.ts +8 -0
- package/esm/composables/uid.d.ts.map +1 -0
- package/esm/composables/uid.js +7 -0
- package/esm/framework.d.ts +29 -0
- package/esm/framework.d.ts.map +1 -0
- package/esm/framework.js +47 -0
- package/esm/index.d.ts +35 -0
- package/esm/index.d.ts.map +1 -0
- package/esm/index.js +12 -0
- package/esm/templates/index.d.ts +2 -0
- package/esm/templates/index.d.ts.map +1 -0
- package/esm/templates/index.js +5 -0
- package/esm/templates/theme.d.ts +5 -0
- package/esm/templates/theme.d.ts.map +1 -0
- package/esm/templates/theme.js +67 -0
- package/esm/types/primitive.d.ts +2 -0
- package/esm/types/primitive.d.ts.map +1 -0
- package/esm/utils/color.d.ts +105 -0
- package/esm/utils/color.d.ts.map +1 -0
- package/esm/utils/color.js +14 -0
- package/esm/utils/getCurrentInstance.d.ts +2 -0
- package/esm/utils/getCurrentInstance.d.ts.map +1 -0
- package/esm/utils/getElement.d.ts +6 -0
- package/esm/utils/getElement.d.ts.map +1 -0
- package/esm/utils/getElement.js +6 -0
- package/esm/utils/isEmpty.d.ts +2 -0
- package/esm/utils/isEmpty.d.ts.map +1 -0
- package/esm/utils/isEmpty.js +6 -0
- package/esm/utils/isObject.d.ts +2 -0
- package/esm/utils/isObject.d.ts.map +1 -0
- package/esm/utils/isObject.js +6 -0
- package/esm/utils/merge.d.ts +2 -0
- package/esm/utils/merge.d.ts.map +1 -0
- package/esm/utils/merge.js +21 -0
- package/esm/utils/setupPropsProxy.d.ts +12 -0
- package/esm/utils/setupPropsProxy.d.ts.map +1 -0
- package/esm/utils/setupPropsProxy.js +32 -0
- package/esm/utils/string.d.ts +7 -0
- package/esm/utils/string.d.ts.map +1 -0
- package/esm/utils/string.js +6 -0
- package/esm/utils/theme.d.ts +22 -0
- package/esm/utils/theme.d.ts.map +1 -0
- package/esm/utils/theme.js +40 -0
- package/package.json +48 -50
- package/dist/index.d.ts +0 -4076
- package/dist/ui.esm.js.map +0 -1
- package/dist/ui.js.map +0 -1
- package/dist/ui.min.js.map +0 -1
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { defineComponent as i, mergeModels as s, useModel as c, openBlock as a, createElementBlock as t, Fragment as p, renderSlot as m, unref as l, createVNode as u, normalizeClass as f, withCtx as h, toDisplayString as y } from "vue";
|
|
2
|
+
import "../QOverlay/index.js";
|
|
3
|
+
import { useId as g } from "../../composables/uid.js";
|
|
4
|
+
import _ from "../QOverlay/QOverlay.vue.js";
|
|
5
|
+
const b = ["innerHTML"], v = { key: 1 }, V = /* @__PURE__ */ i({
|
|
6
|
+
__name: "QTooltip",
|
|
7
|
+
props: /* @__PURE__ */ s({
|
|
8
|
+
id: { default: void 0 },
|
|
9
|
+
anchor: {},
|
|
10
|
+
appearance: { default: "inverted" },
|
|
11
|
+
arrow: { type: Boolean, default: !0 },
|
|
12
|
+
attach: { default: "body" },
|
|
13
|
+
inline: { type: Boolean },
|
|
14
|
+
delay: { default: 500 },
|
|
15
|
+
disabled: { type: Boolean },
|
|
16
|
+
html: { type: Boolean, default: !0 },
|
|
17
|
+
placement: { default: "right" },
|
|
18
|
+
text: {},
|
|
19
|
+
trigger: { default: "hover" },
|
|
20
|
+
class: { default: void 0 }
|
|
21
|
+
}, {
|
|
22
|
+
modelValue: { type: Boolean },
|
|
23
|
+
modelModifiers: {}
|
|
24
|
+
}),
|
|
25
|
+
emits: ["update:modelValue"],
|
|
26
|
+
setup(o) {
|
|
27
|
+
const e = o, n = c(o, "modelValue"), r = g(e.id);
|
|
28
|
+
return (d, B) => (a(), t(
|
|
29
|
+
p,
|
|
30
|
+
null,
|
|
31
|
+
[
|
|
32
|
+
m(d.$slots, "anchor", {
|
|
33
|
+
props: { "aria-describedby": l(r) }
|
|
34
|
+
}),
|
|
35
|
+
u(l(_), {
|
|
36
|
+
"model-value": n.value,
|
|
37
|
+
anchor: e.anchor,
|
|
38
|
+
role: "tooltip",
|
|
39
|
+
"non-modal": "",
|
|
40
|
+
id: l(r),
|
|
41
|
+
appearance: e.appearance,
|
|
42
|
+
arrow: e.arrow,
|
|
43
|
+
attach: e.attach,
|
|
44
|
+
inline: e.inline,
|
|
45
|
+
class: f(["q-tooltip", e.class]),
|
|
46
|
+
delay: e.delay,
|
|
47
|
+
disabled: e.disabled,
|
|
48
|
+
placement: e.placement,
|
|
49
|
+
trigger: e.trigger
|
|
50
|
+
}, {
|
|
51
|
+
default: h(() => [
|
|
52
|
+
e.html ? (a(), t("span", {
|
|
53
|
+
key: 0,
|
|
54
|
+
innerHTML: e.text
|
|
55
|
+
}, null, 8, b)) : (a(), t(
|
|
56
|
+
"span",
|
|
57
|
+
v,
|
|
58
|
+
y(e.text),
|
|
59
|
+
1
|
|
60
|
+
/* TEXT */
|
|
61
|
+
))
|
|
62
|
+
]),
|
|
63
|
+
_: 1
|
|
64
|
+
/* STABLE */
|
|
65
|
+
}, 8, ["model-value", "anchor", "id", "appearance", "arrow", "attach", "inline", "class", "delay", "disabled", "placement", "trigger"])
|
|
66
|
+
],
|
|
67
|
+
64
|
|
68
|
+
/* STABLE_FRAGMENT */
|
|
69
|
+
));
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
export {
|
|
73
|
+
V as default
|
|
74
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/QTooltip/index.ts"],"names":[],"mappings":"AACA,OAAO,QAAQ,MAAM,gBAAgB,CAAA;AAQrC,OAAO,EAAE,QAAQ,EAAE,CAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export * from './QButton';
|
|
2
|
+
export * from './QButtonGroup';
|
|
3
|
+
export * from './QButtonToggle';
|
|
4
|
+
export * from './QCombobox';
|
|
5
|
+
export * from './QField';
|
|
6
|
+
export * from './QIcon';
|
|
7
|
+
export * from './QInputGroup';
|
|
8
|
+
export * from './QLineLoader';
|
|
9
|
+
export * from './QList';
|
|
10
|
+
export * from './QOverlay';
|
|
11
|
+
export * from './QPopover';
|
|
12
|
+
export * from './QSelect';
|
|
13
|
+
export * from './QSkeletonLoader';
|
|
14
|
+
export * from './QSpinnerLoader';
|
|
15
|
+
export * from './QTextField';
|
|
16
|
+
export * from './QThemeProvider';
|
|
17
|
+
export * from './QTooltip';
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,aAAa,CAAA;AAC3B,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,eAAe,CAAA;AAC7B,cAAc,eAAe,CAAA;AAC7B,cAAc,SAAS,CAAA;AACvB,cAAc,YAAY,CAAA;AAC1B,cAAc,YAAY,CAAA;AAC1B,cAAc,WAAW,CAAA;AACzB,cAAc,mBAAmB,CAAA;AACjC,cAAc,kBAAkB,CAAA;AAChC,cAAc,cAAc,CAAA;AAC5B,cAAc,kBAAkB,CAAA;AAChC,cAAc,YAAY,CAAA"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { default as t } from "./QButton/QButton.vue.js";
|
|
2
|
+
import { default as a } from "./QButtonGroup/QButtonGroup.vue.js";
|
|
3
|
+
import { default as l } from "./QButtonToggle/QButtonToggle.vue.js";
|
|
4
|
+
import { default as u } from "./QCombobox/QCombobox.vue.js";
|
|
5
|
+
import { default as m } from "./QInputGroup/QInputGroup.vue.js";
|
|
6
|
+
import { default as x } from "./QLineLoader/QLineLoader.vue.js";
|
|
7
|
+
import { default as n } from "./QPopover/QPopover.vue.js";
|
|
8
|
+
import { default as I } from "./QSelect/QSelect.vue.js";
|
|
9
|
+
import { default as c } from "./QSkeletonLoader/QSkeletonLoader.vue.js";
|
|
10
|
+
import { default as v } from "./QThemeProvider/QThemeProvider.vue.js";
|
|
11
|
+
import { default as T } from "./QTooltip/QTooltip.vue.js";
|
|
12
|
+
import { default as F } from "./QField/QField.vue.js";
|
|
13
|
+
import { default as b } from "./QIcon/QIcon.vue.js";
|
|
14
|
+
import { default as h } from "./QIcon/QIconFont.vue.js";
|
|
15
|
+
import { default as y } from "./QIcon/QIconImg.vue.js";
|
|
16
|
+
import { default as O } from "./QIcon/QIconSvg.vue.js";
|
|
17
|
+
import { default as q } from "./QList/QList.vue.js";
|
|
18
|
+
import { default as z } from "./QList/QListItem.vue.js";
|
|
19
|
+
import { default as D } from "./QList/QListItemGroup.vue.js";
|
|
20
|
+
import { default as H } from "./QOverlay/QOverlay.vue.js";
|
|
21
|
+
import { default as K } from "./QSpinnerLoader/QSpinnerLoader.vue.js";
|
|
22
|
+
import { default as N } from "./QTextField/QTextField.vue.js";
|
|
23
|
+
export {
|
|
24
|
+
t as QButton,
|
|
25
|
+
a as QButtonGroup,
|
|
26
|
+
l as QButtonToggle,
|
|
27
|
+
u as QCombobox,
|
|
28
|
+
F as QField,
|
|
29
|
+
b as QIcon,
|
|
30
|
+
h as QIconFont,
|
|
31
|
+
y as QIconImg,
|
|
32
|
+
O as QIconSvg,
|
|
33
|
+
m as QInputGroup,
|
|
34
|
+
x as QLineLoader,
|
|
35
|
+
q as QList,
|
|
36
|
+
z as QListItem,
|
|
37
|
+
D as QListItemGroup,
|
|
38
|
+
H as QOverlay,
|
|
39
|
+
n as QPopover,
|
|
40
|
+
I as QSelect,
|
|
41
|
+
c as QSkeletonLoader,
|
|
42
|
+
K as QSpinnerLoader,
|
|
43
|
+
N as QTextField,
|
|
44
|
+
v as QThemeProvider,
|
|
45
|
+
T as QTooltip
|
|
46
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ComputedRef } from 'vue';
|
|
2
|
+
|
|
3
|
+
export declare const DEFAULTS_SYMBOL = "q-defaults";
|
|
4
|
+
export type Defaults = Record<string | symbol, ComponentDefaults>;
|
|
5
|
+
export type ComponentDefaults = Record<string | symbol, unknown>;
|
|
6
|
+
export declare function useDefaults(): ComputedRef<ComponentDefaults | undefined>;
|
|
7
|
+
/**
|
|
8
|
+
* Function to provide or update default values using the Vue.js `provide` function.
|
|
9
|
+
* It takes a set of default values, merges them with the existing defaults (if any),
|
|
10
|
+
* and then provides the merged defaults using the specified symbol.
|
|
11
|
+
*
|
|
12
|
+
* @param defaults - The default values to be provided or updated.
|
|
13
|
+
*/
|
|
14
|
+
export declare function provideDefaults(defaults: Defaults): void;
|
|
15
|
+
/**
|
|
16
|
+
* Function to inject default values using the Vue.js `inject` function.
|
|
17
|
+
* It retrieves the default values from the specified symbol and ensures
|
|
18
|
+
* that the returned value is of type `ComputedRef<Defaults>`.
|
|
19
|
+
*
|
|
20
|
+
* @throws {Error} Throws an error if the defaults instance is not found.
|
|
21
|
+
*
|
|
22
|
+
* @returns {ComputedRef<Defaults>} A computed reference to the default values.
|
|
23
|
+
*/
|
|
24
|
+
export declare function injectDefaults(): ComputedRef<Defaults>;
|
|
25
|
+
//# sourceMappingURL=defaults.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../src/composables/defaults.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,KAAK,CAAA;AAOtC,eAAO,MAAM,eAAe,eAAe,CAAA;AAE3C,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,GAAG,MAAM,EAAE,iBAAiB,CAAC,CAAA;AAEjE,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,GAAG,MAAM,EAAE,OAAO,CAAC,CAAA;AAEhE,wBAAgB,WAAW,IAAI,WAAW,CAAC,iBAAiB,GAAG,SAAS,CAAC,CAgBxE;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAYxD;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,IAAI,WAAW,CAAC,QAAQ,CAAC,CAMtD"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { isEmpty as s } from "../utils/isEmpty.js";
|
|
2
|
+
import { merge as a } from "../utils/merge.js";
|
|
3
|
+
import { ref as m, computed as f, provide as d, inject as p, getCurrentInstance as v } from "vue";
|
|
4
|
+
const i = "q-defaults";
|
|
5
|
+
function E() {
|
|
6
|
+
var r, u;
|
|
7
|
+
const e = v();
|
|
8
|
+
if (!e)
|
|
9
|
+
throw new Error("[Quidgest UI] useDefaults must be called from inside a setup function");
|
|
10
|
+
const t = e.type.name ?? e.type.__name;
|
|
11
|
+
if (!t)
|
|
12
|
+
throw new Error("[Quidgest UI] Could not determine component name");
|
|
13
|
+
const n = l(), o = (r = n.value) == null ? void 0 : r.Global, c = (u = n.value) == null ? void 0 : u[t];
|
|
14
|
+
return f(() => a(o, c));
|
|
15
|
+
}
|
|
16
|
+
function I(e) {
|
|
17
|
+
if (s(e))
|
|
18
|
+
return;
|
|
19
|
+
const t = l(), n = m(e), o = f(() => s(n.value) ? t.value : a(t.value, n.value));
|
|
20
|
+
d(i, o);
|
|
21
|
+
}
|
|
22
|
+
function l() {
|
|
23
|
+
const e = p(i, void 0);
|
|
24
|
+
if (!e)
|
|
25
|
+
throw new Error("[Quidgest UI] Could not find defaults instance");
|
|
26
|
+
return e;
|
|
27
|
+
}
|
|
28
|
+
export {
|
|
29
|
+
i as DEFAULTS_SYMBOL,
|
|
30
|
+
l as injectDefaults,
|
|
31
|
+
I as provideDefaults,
|
|
32
|
+
E as useDefaults
|
|
33
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/composables/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Appearance of the overlay.
|
|
3
|
+
*/
|
|
4
|
+
export type Appearance = 'regular' | 'inverted';
|
|
5
|
+
/**
|
|
6
|
+
* Triggering mechanism for the overlay.
|
|
7
|
+
*/
|
|
8
|
+
export type Trigger = 'hover' | 'click' | 'manual';
|
|
9
|
+
/**
|
|
10
|
+
* Axis along which position adjustments are made.
|
|
11
|
+
*/
|
|
12
|
+
export type Axis = 'x' | 'y';
|
|
13
|
+
/**
|
|
14
|
+
* Side of the overlay, relative to the anchor element.
|
|
15
|
+
*/
|
|
16
|
+
export type Side = 'top' | 'bottom' | 'left' | 'right';
|
|
17
|
+
/**
|
|
18
|
+
* Alignment of the overlay, along the alignment axis.
|
|
19
|
+
*/
|
|
20
|
+
export type Alignment = 'start' | 'end';
|
|
21
|
+
/**
|
|
22
|
+
* Placement of the overlay.
|
|
23
|
+
* It can be a single side or a combination of side and alignment.
|
|
24
|
+
* Example: 'top', 'bottom-start', 'left-end', etc.
|
|
25
|
+
*/
|
|
26
|
+
export type Placement = Side | `${Side}-${Alignment}`;
|
|
27
|
+
/**
|
|
28
|
+
* Coordinates interface representing the position of an element.
|
|
29
|
+
*/
|
|
30
|
+
export interface Coords {
|
|
31
|
+
x: number;
|
|
32
|
+
y: number;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Options for computing the position of the overlay.
|
|
36
|
+
*/
|
|
37
|
+
export type ComputePositionOptions = {
|
|
38
|
+
/**
|
|
39
|
+
* The preferred placement of the overlay.
|
|
40
|
+
*/
|
|
41
|
+
placement?: Placement;
|
|
42
|
+
/**
|
|
43
|
+
* The offset to fine-tune the positioning of the overlay relative to the anchor element.
|
|
44
|
+
*/
|
|
45
|
+
offset?: number;
|
|
46
|
+
/**
|
|
47
|
+
* Whether to compute the position of the overlay arrow.
|
|
48
|
+
*/
|
|
49
|
+
arrow?: boolean;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Result of computing the position of the overlay.
|
|
53
|
+
*/
|
|
54
|
+
export interface ComputePositionResult {
|
|
55
|
+
/**
|
|
56
|
+
* The computed coordinates for the overlay.
|
|
57
|
+
*/
|
|
58
|
+
overlayCoords: Coords;
|
|
59
|
+
/**
|
|
60
|
+
* The computed coordinates for the arrow.
|
|
61
|
+
*/
|
|
62
|
+
arrowCoords?: Partial<Coords>;
|
|
63
|
+
/**
|
|
64
|
+
* The chosen placement of the overlay.
|
|
65
|
+
*/
|
|
66
|
+
placement: Placement;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Computes the position of an overlay relative to an anchor element,
|
|
70
|
+
* optionally positioning an arrow element as well.
|
|
71
|
+
* @param anchorEl The anchor element to which the overlay is positioned relative.
|
|
72
|
+
* @param overlayEl The overlay element whose position is being computed.
|
|
73
|
+
* @param arrowEl Optional. The arrow element whose position is being computed, if any.
|
|
74
|
+
* @param options Optional. Additional options for computing the position.
|
|
75
|
+
* @returns An object containing the computed overlay coordinates, arrow coordinates (if applicable),
|
|
76
|
+
* and the chosen placement.
|
|
77
|
+
*/
|
|
78
|
+
export declare function computePosition(anchorEl: Element, overlayEl: Element, arrowEl?: Element, options?: ComputePositionOptions): ComputePositionResult;
|
|
79
|
+
/** Utilities */
|
|
80
|
+
/**
|
|
81
|
+
* Returns the opposite axis of the given axis.
|
|
82
|
+
* @param axis - The axis ('x' or 'y').
|
|
83
|
+
* @returns The opposite axis ('y' if 'x' is given, and vice versa).
|
|
84
|
+
*/
|
|
85
|
+
export declare function getOppositeAxis(axis: Axis): Axis;
|
|
86
|
+
/**
|
|
87
|
+
* Returns the main axis based on the placement.
|
|
88
|
+
* @param placement - The placement of the overlay relative to the anchor.
|
|
89
|
+
* @returns The main axis ('x' if placement is 'left' or 'right', otherwise 'y').
|
|
90
|
+
*/
|
|
91
|
+
export declare function getMainAxis(placement: Placement): Axis;
|
|
92
|
+
/**
|
|
93
|
+
* Returns the alignment axis based on the placement.
|
|
94
|
+
* @param placement - The placement of the overlay relative to the anchor.
|
|
95
|
+
* @returns The alignment axis ('x' if main axis is 'y', and vice versa).
|
|
96
|
+
*/
|
|
97
|
+
export declare function getAlignmentAxis(placement: Placement): Axis;
|
|
98
|
+
/**
|
|
99
|
+
* Returns the side from the given placement.
|
|
100
|
+
* @param placement - The placement of the overlay relative to the anchor.
|
|
101
|
+
* @returns The side ('top', 'bottom', 'left', or 'right').
|
|
102
|
+
*/
|
|
103
|
+
export declare function getSideFromPlacement(placement: Placement): Side;
|
|
104
|
+
/**
|
|
105
|
+
* Returns the alignment from the given placement.
|
|
106
|
+
* @param placement - The placement of the overlay relative to the anchor.
|
|
107
|
+
* @returns The alignment ('start' or 'end') or undefined if not present.
|
|
108
|
+
*/
|
|
109
|
+
export declare function getAlignmentFromPlacement(placement: Placement): Alignment | undefined;
|
|
110
|
+
/**
|
|
111
|
+
* Checks if the provided overflow result is out of bounds.
|
|
112
|
+
* @param overflowResult The result of an overflow calculation.
|
|
113
|
+
* @returns A boolean indicating whether the overflow result is out of bounds (true) or not (false).
|
|
114
|
+
*/
|
|
115
|
+
export declare function isOutOfBounds(overflowResult: number): boolean;
|
|
116
|
+
//# sourceMappingURL=overlay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"overlay.d.ts","sourceRoot":"","sources":["../../src/composables/overlay.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,UAAU,CAAA;AAE/C;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,QAAQ,CAAA;AAElD;;GAEG;AACH,MAAM,MAAM,IAAI,GAAG,GAAG,GAAG,GAAG,CAAA;AAE5B;;GAEG;AACH,MAAM,MAAM,IAAI,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAA;AAEtD;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,KAAK,CAAA;AAEvC;;;;GAIG;AACH,MAAM,MAAM,SAAS,GAAG,IAAI,GAAG,GAAG,IAAI,IAAI,SAAS,EAAE,CAAA;AAErD;;GAEG;AACH,MAAM,WAAW,MAAM;IACtB,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;CACT;AAED;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG;IACpC;;OAEG;IACH,SAAS,CAAC,EAAE,SAAS,CAAA;IAErB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IAEf;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAA;CACf,CAAA;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACrC;;OAEG;IACH,aAAa,EAAE,MAAM,CAAA;IAErB;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,CAAA;IAE7B;;OAEG;IACH,SAAS,EAAE,SAAS,CAAA;CACpB;AAKD;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAC9B,QAAQ,EAAE,OAAO,EACjB,SAAS,EAAE,OAAO,EAClB,OAAO,CAAC,EAAE,OAAO,EACjB,OAAO,CAAC,EAAE,sBAAsB,GAC9B,qBAAqB,CA8BvB;AAmPD,gBAAgB;AAEhB;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAEhD;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,SAAS,EAAE,SAAS,GAAG,IAAI,CAGtD;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,SAAS,GAAG,IAAI,CAE3D;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,SAAS,GAAG,IAAI,CAG/D;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,SAAS,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,CAGrF;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAE7D"}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
function M(t, i, n, e) {
|
|
2
|
+
const d = (e == null ? void 0 : e.offset) ?? 0, o = (e == null ? void 0 : e.placement) ?? "bottom", g = t.getBoundingClientRect(), s = i.getBoundingClientRect(), u = n == null ? void 0 : n.getBoundingClientRect(), r = b(g, s, o, d), h = k(g, s, r), f = C(h, r, d), m = p(f, s, r);
|
|
3
|
+
let a;
|
|
4
|
+
if (e != null && e.arrow) {
|
|
5
|
+
if (!u)
|
|
6
|
+
throw new Error("[Quidgest UI] The arrow element must exist to compute its position");
|
|
7
|
+
a = A(m, g, s, u, r);
|
|
8
|
+
}
|
|
9
|
+
return { overlayCoords: m, arrowCoords: a, placement: r };
|
|
10
|
+
}
|
|
11
|
+
function b(t, i, n, e) {
|
|
12
|
+
const d = c(t, i, n, e);
|
|
13
|
+
if (x(d)) {
|
|
14
|
+
const o = w(n), s = {
|
|
15
|
+
top: "bottom",
|
|
16
|
+
bottom: "top",
|
|
17
|
+
left: "right",
|
|
18
|
+
right: "left"
|
|
19
|
+
}[o], u = c(
|
|
20
|
+
t,
|
|
21
|
+
i,
|
|
22
|
+
s,
|
|
23
|
+
e
|
|
24
|
+
);
|
|
25
|
+
if (x(u))
|
|
26
|
+
return n;
|
|
27
|
+
const r = O(n);
|
|
28
|
+
return r ? `${s}-${r}` : s;
|
|
29
|
+
}
|
|
30
|
+
return n;
|
|
31
|
+
}
|
|
32
|
+
function p(t, i, n) {
|
|
33
|
+
const e = l(n), d = (g, s, u) => Math.min(Math.max(g, s), u), o = { ...t };
|
|
34
|
+
return e === "x" ? o.x = d(t.x, 8, window.innerWidth - i.width - 8) : o.y = d(t.y, 8, window.innerHeight - i.height - 8), o;
|
|
35
|
+
}
|
|
36
|
+
function C(t, i, n) {
|
|
37
|
+
const e = w(i);
|
|
38
|
+
return {
|
|
39
|
+
x: t.x + (e === "left" ? -n : e === "right" ? n : 0),
|
|
40
|
+
y: t.y + (e === "top" ? -n : e === "bottom" ? n : 0)
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
function A(t, i, n, e, d) {
|
|
44
|
+
if (l(d) === "y") {
|
|
45
|
+
const g = i.top + i.height / 2, s = t.y + n.height / 2, u = s - g, r = n.height / 2 - u - e.height / 2 + 2;
|
|
46
|
+
if (r > 0 && r < n.height - e.height)
|
|
47
|
+
return {
|
|
48
|
+
y: r
|
|
49
|
+
};
|
|
50
|
+
} else {
|
|
51
|
+
const g = i.left + i.width / 2, s = t.x + n.width / 2, u = s - g, r = n.width / 2 - u - e.width / 2 + 2;
|
|
52
|
+
if (r > 0 && r < n.width - e.width)
|
|
53
|
+
return {
|
|
54
|
+
x: r
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
function k(t, i, n) {
|
|
59
|
+
const [e, d] = n.split("-"), o = t.x + t.width / 2 - i.width / 2, g = t.y + t.height / 2 - i.height / 2;
|
|
60
|
+
let s;
|
|
61
|
+
switch (e) {
|
|
62
|
+
case "top":
|
|
63
|
+
s = { x: o, y: t.y - i.height };
|
|
64
|
+
break;
|
|
65
|
+
case "bottom":
|
|
66
|
+
s = { x: o, y: t.y + t.height };
|
|
67
|
+
break;
|
|
68
|
+
case "left":
|
|
69
|
+
s = { x: t.x - i.width, y: g };
|
|
70
|
+
break;
|
|
71
|
+
case "right":
|
|
72
|
+
s = { x: t.x + t.width, y: g };
|
|
73
|
+
break;
|
|
74
|
+
default:
|
|
75
|
+
throw new Error(`[Quidgest UI] Invalid placement value: ${n}`);
|
|
76
|
+
}
|
|
77
|
+
if (!d)
|
|
78
|
+
return s;
|
|
79
|
+
const r = l(n) === "y" ? "height" : "width", h = l(n), f = t[r] / 2 - i[r] / 2;
|
|
80
|
+
switch (d) {
|
|
81
|
+
case "start":
|
|
82
|
+
s[h] -= f;
|
|
83
|
+
break;
|
|
84
|
+
case "end":
|
|
85
|
+
s[h] += f;
|
|
86
|
+
break;
|
|
87
|
+
default:
|
|
88
|
+
throw new Error(`[Quidgest UI] Invalid alignment value: ${d}`);
|
|
89
|
+
}
|
|
90
|
+
return s;
|
|
91
|
+
}
|
|
92
|
+
function c(t, i, n, e) {
|
|
93
|
+
const d = w(n);
|
|
94
|
+
let o = 0;
|
|
95
|
+
switch (d) {
|
|
96
|
+
case "top":
|
|
97
|
+
o = t.top - (i.height + e);
|
|
98
|
+
break;
|
|
99
|
+
case "bottom":
|
|
100
|
+
o = window.innerHeight - t.bottom - (i.height + e);
|
|
101
|
+
break;
|
|
102
|
+
case "left":
|
|
103
|
+
o = t.left - (i.width + e);
|
|
104
|
+
break;
|
|
105
|
+
case "right":
|
|
106
|
+
o = window.innerWidth - t.right - (i.width + e);
|
|
107
|
+
break;
|
|
108
|
+
default:
|
|
109
|
+
throw new Error(`[Quidgest UI] Invalid side value: ${d}`);
|
|
110
|
+
}
|
|
111
|
+
return o;
|
|
112
|
+
}
|
|
113
|
+
function y(t) {
|
|
114
|
+
return t === "x" ? "y" : "x";
|
|
115
|
+
}
|
|
116
|
+
function I(t) {
|
|
117
|
+
const i = w(t);
|
|
118
|
+
return ["left", "right"].includes(i) ? "x" : "y";
|
|
119
|
+
}
|
|
120
|
+
function l(t) {
|
|
121
|
+
return y(I(t));
|
|
122
|
+
}
|
|
123
|
+
function w(t) {
|
|
124
|
+
const [i] = t.split("-");
|
|
125
|
+
return i;
|
|
126
|
+
}
|
|
127
|
+
function O(t) {
|
|
128
|
+
const [, i] = t.split("-");
|
|
129
|
+
return i;
|
|
130
|
+
}
|
|
131
|
+
function x(t) {
|
|
132
|
+
return t < 0;
|
|
133
|
+
}
|
|
134
|
+
export {
|
|
135
|
+
M as computePosition,
|
|
136
|
+
l as getAlignmentAxis,
|
|
137
|
+
O as getAlignmentFromPlacement,
|
|
138
|
+
I as getMainAxis,
|
|
139
|
+
y as getOppositeAxis,
|
|
140
|
+
w as getSideFromPlacement,
|
|
141
|
+
x as isOutOfBounds
|
|
142
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ThemeInstance } from '../framework';
|
|
2
|
+
|
|
3
|
+
export declare const THEME_SYMBOL = "q-theme";
|
|
4
|
+
/**
|
|
5
|
+
* Custom hook for accessing the theme configuration in context.
|
|
6
|
+
*
|
|
7
|
+
* @returns The current theme configuration.
|
|
8
|
+
*/
|
|
9
|
+
export declare function useTheme(): ThemeInstance;
|
|
10
|
+
/**
|
|
11
|
+
* Provides a theme with the specified name using the current theme configuration.
|
|
12
|
+
*
|
|
13
|
+
* @param name - The name of the theme to provide.
|
|
14
|
+
*
|
|
15
|
+
* @returns The active theme.
|
|
16
|
+
*/
|
|
17
|
+
export declare function provideTheme(name: string): ThemeInstance;
|
|
18
|
+
//# sourceMappingURL=theme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/composables/theme.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAKhD,eAAO,MAAM,YAAY,YAAY,CAAA;AAErC;;;;GAIG;AACH,wBAAgB,QAAQ,IAAI,aAAa,CAQxC;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,iBAWxC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { inject as r, ref as m, provide as h } from "vue";
|
|
2
|
+
const n = "q-theme";
|
|
3
|
+
function i() {
|
|
4
|
+
const e = r(n);
|
|
5
|
+
if (!e)
|
|
6
|
+
throw new Error("[Quidgest UI] Could not find theme instance");
|
|
7
|
+
return e;
|
|
8
|
+
}
|
|
9
|
+
function s(e) {
|
|
10
|
+
const o = i(), t = {
|
|
11
|
+
activeTheme: m(e),
|
|
12
|
+
themes: o.themes
|
|
13
|
+
};
|
|
14
|
+
return h(n, t), t;
|
|
15
|
+
}
|
|
16
|
+
export {
|
|
17
|
+
n as THEME_SYMBOL,
|
|
18
|
+
s as provideTheme,
|
|
19
|
+
i as useTheme
|
|
20
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uid.d.ts","sourceRoot":"","sources":["../../src/composables/uid.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,wBAAgB,KAAK,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAElD"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Defaults } from './composables/defaults';
|
|
2
|
+
import { Component, Plugin, Ref } from 'vue';
|
|
3
|
+
import { ColorScheme } from './utils/color';
|
|
4
|
+
|
|
5
|
+
export type FrameworkConfig = {
|
|
6
|
+
components?: Record<string, Component>;
|
|
7
|
+
themes?: AppThemes;
|
|
8
|
+
defaults?: Defaults;
|
|
9
|
+
};
|
|
10
|
+
export type ThemeMode = 'light' | 'dark';
|
|
11
|
+
export type AppThemes = {
|
|
12
|
+
defaultTheme: string;
|
|
13
|
+
themes: Array<{
|
|
14
|
+
name: string;
|
|
15
|
+
mode: ThemeMode;
|
|
16
|
+
colors?: Partial<ColorScheme>;
|
|
17
|
+
}>;
|
|
18
|
+
};
|
|
19
|
+
export type ThemeDefinition = {
|
|
20
|
+
name: string;
|
|
21
|
+
mode: ThemeMode;
|
|
22
|
+
scheme: ColorScheme;
|
|
23
|
+
};
|
|
24
|
+
export type ThemeInstance = {
|
|
25
|
+
activeTheme: Ref<string>;
|
|
26
|
+
themes: ThemeDefinition[];
|
|
27
|
+
};
|
|
28
|
+
export declare function createFramework(config?: FrameworkConfig): Plugin;
|
|
29
|
+
//# sourceMappingURL=framework.d.ts.map
|
|
@@ -0,0 +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,EAAO,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AACtD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAMhD,MAAM,MAAM,eAAe,GAAG;IAC7B,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAA;IACtC,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,QAAQ,CAAC,EAAE,QAAQ,CAAA;CACnB,CAAA;AAED,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,MAAM,CAAA;AAExC,MAAM,MAAM,SAAS,GAAG;IACvB,YAAY,EAAE,MAAM,CAAA;IACpB,MAAM,EAAE,KAAK,CAAC;QACb,IAAI,EAAE,MAAM,CAAA;QACZ,IAAI,EAAE,SAAS,CAAA;QACf,MAAM,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,CAAA;KAC7B,CAAC,CAAA;CACF,CAAA;AAED,MAAM,MAAM,eAAe,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,SAAS,CAAA;IACf,MAAM,EAAE,WAAW,CAAA;CACnB,CAAA;AAED,MAAM,MAAM,aAAa,GAAG;IAC3B,WAAW,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IACxB,MAAM,EAAE,eAAe,EAAE,CAAA;CACzB,CAAA;AAED,wBAAgB,eAAe,CAAC,MAAM,GAAE,eAAoB,GAAG,MAAM,CAiBpE"}
|
package/esm/framework.js
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { DEFAULTS_SYMBOL as c } from "./composables/defaults.js";
|
|
2
|
+
import { THEME_SYMBOL as i } from "./composables/theme.js";
|
|
3
|
+
import { defaultLightColorScheme as a, defaultDarkColorScheme as h } from "./templates/theme.js";
|
|
4
|
+
import { ref as n, watch as f } from "vue";
|
|
5
|
+
import { generateRootStyle as d } from "./utils/theme.js";
|
|
6
|
+
function E(m = {}) {
|
|
7
|
+
return { install: (o) => {
|
|
8
|
+
const t = m.components || {};
|
|
9
|
+
for (const l in t)
|
|
10
|
+
o.component(l, t[l]);
|
|
11
|
+
const e = m.defaults || {};
|
|
12
|
+
o.provide(c, n(e)), u(o, m.themes);
|
|
13
|
+
} };
|
|
14
|
+
}
|
|
15
|
+
function u(m, s) {
|
|
16
|
+
const o = [];
|
|
17
|
+
let t;
|
|
18
|
+
if (!s)
|
|
19
|
+
t = "default", o.push({
|
|
20
|
+
name: t,
|
|
21
|
+
mode: "light",
|
|
22
|
+
scheme: a
|
|
23
|
+
});
|
|
24
|
+
else
|
|
25
|
+
for (const e of s.themes) {
|
|
26
|
+
const r = { ...e.mode === "light" ? a : h, ...e.colors };
|
|
27
|
+
o.push({
|
|
28
|
+
name: e.name,
|
|
29
|
+
mode: e.mode,
|
|
30
|
+
scheme: r
|
|
31
|
+
}), e.name === s.defaultTheme && (t = e.name);
|
|
32
|
+
}
|
|
33
|
+
if (t) {
|
|
34
|
+
const e = {
|
|
35
|
+
activeTheme: n(t),
|
|
36
|
+
themes: o
|
|
37
|
+
};
|
|
38
|
+
d(o), f(e.activeTheme, p, { immediate: !0 }), m.provide(i, e);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
function p(m) {
|
|
42
|
+
const s = document.documentElement, t = Array.from(s.classList).filter((e) => !e.startsWith("q-theme"));
|
|
43
|
+
s.className = t.join(" "), s.classList.add(`q-theme--${m}`);
|
|
44
|
+
}
|
|
45
|
+
export {
|
|
46
|
+
E as createFramework
|
|
47
|
+
};
|