@nmorph/nmorph-ui-kit 2.2.10 → 2.2.13
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/README.md +11 -7
- package/dist/components/basic/nmorph-icon/NmorphIcon.css +1 -1
- package/dist/components/basic/nmorph-icon/NmorphIcon.vue2.js +11 -11
- package/dist/components/data/nmorph-avatar/NmorphAvatar.css +1 -0
- package/dist/components/data/nmorph-avatar/NmorphAvatar.vue.js +74 -46
- package/dist/components/data/nmorph-avatar/NmorphAvatar.vue2.js +26 -21
- package/dist/components/data/nmorph-carousel/NmorphCarousel.vue2.js +4 -4
- package/dist/components/data/nmorph-image-preview/NmorphImagePreview.vue.js +77 -38
- package/dist/components/data/nmorph-image-preview/NmorphImagePreview.vue2.js +31 -30
- package/dist/components/data/nmorph-pagination/NmorphPagination.css +1 -1
- package/dist/components/data/nmorph-pagination/NmorphPagination.vue.js +36 -30
- package/dist/components/data/nmorph-pagination/NmorphPagination.vue2.js +48 -41
- package/dist/components/data/nmorph-table/NmorphTable.css +1 -1
- package/dist/components/data/nmorph-table/NmorphTable.vue.js +228 -103
- package/dist/components/data/nmorph-table/NmorphTable.vue2.js +49 -30
- package/dist/components/form/nmorph-autocomplete/NmorphAutocomplete.css +1 -1
- package/dist/components/form/nmorph-autocomplete/NmorphAutocomplete.vue.js +91 -35
- package/dist/components/form/nmorph-autocomplete/NmorphAutocomplete.vue2.js +48 -35
- package/dist/components/form/nmorph-checkbox/NmorphCheckbox.css +1 -1
- package/dist/components/form/nmorph-checkbox/NmorphCheckbox.vue.js +15 -13
- package/dist/components/form/nmorph-checkbox/NmorphCheckbox.vue2.js +8 -8
- package/dist/components/form/nmorph-checkbox-group/NmorphCheckboxGroup.vue2.js +22 -14
- package/dist/components/form/nmorph-color-picker/NmorphColorPicker.vue2.js +11 -10
- package/dist/components/form/nmorph-radio/NmorphRadio.css +1 -1
- package/dist/components/form/nmorph-radio/NmorphRadio.vue.js +22 -20
- package/dist/components/form/nmorph-radio/NmorphRadio.vue2.js +7 -7
- package/dist/components/form/nmorph-radio-group/NmorphRadioGroup.vue2.js +14 -14
- package/dist/components/form/nmorph-select/NmorphSelect.css +1 -1
- package/dist/components/form/nmorph-select/NmorphSelect.vue.js +115 -58
- package/dist/components/form/nmorph-select/NmorphSelect.vue2.js +104 -75
- package/dist/components/form/nmorph-select/components/nmorph-select-option/NmorphSelectOption.vue2.js +12 -10
- package/dist/components/navigation/nmorph-backtop/NmorphBacktop.vue.js +7 -7
- package/dist/components/navigation/nmorph-dropdown/NmorphDropdown.vue.js +29 -42
- package/dist/components/navigation/nmorph-dropdown/NmorphDropdown.vue2.js +39 -20
- package/dist/components/others/nmorph-overlay/NmorphOverlay.vue.js +29 -24
- package/dist/components/others/nmorph-overlay/NmorphOverlay.vue2.js +17 -15
- package/dist/hooks/use-common-styles.js +23 -20
- package/dist/hooks/use-placement.js +76 -44
- package/dist/hooks/use-virtual-list.js +46 -0
- package/dist/index.es.js +698 -694
- package/dist/index.umd.js +46 -38
- package/dist/nuxt.mjs +21 -8
- package/dist/outside-hooks/use-nmorph-browser.js +9 -9
- package/dist/outside-hooks/use-nmorph-theme.js +133 -87
- package/dist/package.json.js +1 -1
- package/dist/plugin.js +34 -29
- package/dist/src/components/data/nmorph-badge/NmorphBadge.vue.d.ts +1 -1
- package/dist/src/components/data/nmorph-image/NmorphImage.vue.d.ts +3 -3
- package/dist/src/components/data/nmorph-image-preview/NmorphImagePreview.vue.d.ts +14 -2
- package/dist/src/components/data/nmorph-pagination/NmorphPagination.vue.d.ts +3 -0
- package/dist/src/components/data/nmorph-table/NmorphTable.vue.d.ts +9 -0
- package/dist/src/components/data/nmorph-table/types.d.ts +2 -2
- package/dist/src/components/feedback/nmorph-tooltip/NmorphTooltip.vue.d.ts +1 -1
- package/dist/src/components/form/nmorph-autocomplete/NmorphAutocomplete.vue.d.ts +11 -0
- package/dist/src/components/form/nmorph-checkbox/NmorphCheckbox.vue.d.ts +1 -0
- package/dist/src/components/form/nmorph-checkbox-group/NmorphCheckboxGroup.vue.d.ts +4 -3
- package/dist/src/components/form/nmorph-radio/NmorphRadio.vue.d.ts +1 -0
- package/dist/src/components/form/nmorph-radio-group/NmorphRadioGroup.vue.d.ts +4 -3
- package/dist/src/components/form/nmorph-select/NmorphSelect.vue.d.ts +8 -0
- package/dist/src/components/form/nmorph-select/components/nmorph-select-option/NmorphSelectOption.vue.d.ts +1 -0
- package/dist/src/components/form/nmorph-select/types.d.ts +1 -0
- package/dist/src/components/navigation/nmorph-dropdown/NmorphDropdown.vue.d.ts +3 -1
- package/dist/src/components/others/nmorph-overlay/NmorphOverlay.vue.d.ts +4 -0
- package/dist/src/components/providers/nmorph-notification-provider/NmorphNotificationProvider.vue.d.ts +1 -1
- package/dist/src/hooks/index.d.ts +1 -0
- package/dist/src/hooks/use-common-styles.d.ts +1 -0
- package/dist/src/hooks/use-placement.d.ts +8 -4
- package/dist/src/hooks/use-virtual-list.d.ts +21 -0
- package/dist/src/outside-hooks/use-nmorph-notification.d.ts +2 -2
- package/dist/src/outside-hooks/use-nmorph-theme.d.ts +1 -0
- package/dist/src/plugin.d.ts +2 -0
- package/dist/src/types/index.d.ts +12 -3
- package/dist/style.css +1 -1
- package/dist/types/index.js +14 -8
- package/package.json +1 -1
package/dist/nuxt.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineNuxtModule as
|
|
2
|
-
const
|
|
1
|
+
import { defineNuxtModule as o, addPluginTemplate as i } from "@nuxt/kit";
|
|
2
|
+
const p = o({
|
|
3
3
|
meta: {
|
|
4
4
|
name: "@nmorph/nmorph-ui-kit",
|
|
5
5
|
configKey: "nmorph",
|
|
@@ -11,14 +11,15 @@ const r = t({
|
|
|
11
11
|
styles: !1
|
|
12
12
|
},
|
|
13
13
|
setup(s, e) {
|
|
14
|
-
const { styles:
|
|
15
|
-
e.options.build.transpile.push("@nmorph/nmorph-ui-kit"),
|
|
16
|
-
filename: "nmorph.
|
|
14
|
+
const { styles: t, ...n } = s;
|
|
15
|
+
e.options.build.transpile.push("@nmorph/nmorph-ui-kit"), t === "all" && e.options.css.push("@nmorph/nmorph-ui-kit/dist/style.css"), i({
|
|
16
|
+
filename: "nmorph.mjs",
|
|
17
17
|
getContents: () => `
|
|
18
18
|
import { defineNuxtPlugin } from '#app'
|
|
19
|
-
import {
|
|
19
|
+
import { useHead } from '#imports'
|
|
20
|
+
import { NmorphLibrary, en, ru, zh, getCommonStyles, getNmorphThemeStyles } from '@nmorph/nmorph-ui-kit/plugin'
|
|
20
21
|
|
|
21
|
-
const options = ${JSON.stringify(
|
|
22
|
+
const options = ${JSON.stringify(n)}
|
|
22
23
|
const libraryMessages = { en, ru, zh }
|
|
23
24
|
|
|
24
25
|
const mergeMessages = (base, overrides = {}) => {
|
|
@@ -35,6 +36,18 @@ export default defineNuxtPlugin((nuxtApp) => {
|
|
|
35
36
|
const messages = mergeMessages(libraryMessages, i18nOptions.messages)
|
|
36
37
|
const i18n = nuxtApp.$i18n
|
|
37
38
|
|
|
39
|
+
if (import.meta.server) {
|
|
40
|
+
useHead({
|
|
41
|
+
htmlAttrs: {
|
|
42
|
+
'nmorph-data-theme': pluginOptions.theme?.defaultTheme || 'dark',
|
|
43
|
+
},
|
|
44
|
+
style: [
|
|
45
|
+
{ id: 'nmorph-theme-styles', children: getNmorphThemeStyles(pluginOptions.theme) },
|
|
46
|
+
{ id: 'nmorph-common-styles', children: getCommonStyles() },
|
|
47
|
+
],
|
|
48
|
+
})
|
|
49
|
+
}
|
|
50
|
+
|
|
38
51
|
i18nOptions.messages = messages
|
|
39
52
|
|
|
40
53
|
if (i18n?.mergeLocaleMessage) {
|
|
@@ -52,5 +65,5 @@ export default defineNuxtPlugin((nuxtApp) => {
|
|
|
52
65
|
}
|
|
53
66
|
});
|
|
54
67
|
export {
|
|
55
|
-
|
|
68
|
+
p as default
|
|
56
69
|
};
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
const
|
|
3
|
-
const e =
|
|
4
|
-
let o,
|
|
5
|
-
const
|
|
1
|
+
import { ref as t } from "vue";
|
|
2
|
+
const s = () => {
|
|
3
|
+
const e = t({ width: 0, height: 0 }), i = t(0);
|
|
4
|
+
let o, n;
|
|
5
|
+
const r = () => {
|
|
6
6
|
clearTimeout(o), o = setTimeout(() => {
|
|
7
7
|
e.value.width = window.innerWidth, e.value.height = window.innerHeight;
|
|
8
8
|
}, 400);
|
|
9
|
-
},
|
|
10
|
-
clearTimeout(
|
|
9
|
+
}, l = () => {
|
|
10
|
+
clearTimeout(n), n = setTimeout(() => {
|
|
11
11
|
i.value = window.scrollY;
|
|
12
12
|
}, 400);
|
|
13
13
|
};
|
|
14
|
-
return window && (window.addEventListener("resize",
|
|
14
|
+
return typeof window < "u" && (e.value.width = window.innerWidth, e.value.height = window.innerHeight, i.value = window.scrollY, window.addEventListener("resize", r), window.addEventListener("scroll", l)), {
|
|
15
15
|
dimensions: e,
|
|
16
16
|
scrollTop: i
|
|
17
17
|
};
|
|
18
18
|
};
|
|
19
19
|
export {
|
|
20
|
-
|
|
20
|
+
s as useNmorphBrowser
|
|
21
21
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import
|
|
3
|
-
import { nmorphLog as
|
|
4
|
-
import { camelToKebab as
|
|
5
|
-
const
|
|
1
|
+
import { ref as A, readonly as H } from "vue";
|
|
2
|
+
import _ from "../package.json.js";
|
|
3
|
+
import { nmorphLog as I } from "../outside-utils/index.js";
|
|
4
|
+
import { camelToKebab as b } from "../utils/case-transformers.js";
|
|
5
|
+
const $ = {
|
|
6
6
|
info: "#d4e5edbb",
|
|
7
7
|
infoText: "#506c80",
|
|
8
8
|
success: "#67C23A",
|
|
@@ -15,7 +15,7 @@ const v = {
|
|
|
15
15
|
white: "#ffffff",
|
|
16
16
|
black: "#000000",
|
|
17
17
|
overlay: "#00000095"
|
|
18
|
-
},
|
|
18
|
+
}, V = {
|
|
19
19
|
darkShade: "#c8c9ca",
|
|
20
20
|
main: "#e9ecec",
|
|
21
21
|
lightShade: "#fdfdfd",
|
|
@@ -26,7 +26,7 @@ const v = {
|
|
|
26
26
|
placeholderText: "#c1c9cf",
|
|
27
27
|
semiContrastText: "#8a9dc0",
|
|
28
28
|
contrastText: "#b4c4de"
|
|
29
|
-
},
|
|
29
|
+
}, w = {
|
|
30
30
|
darkShade: "#0f1112",
|
|
31
31
|
main: "#1c1f21",
|
|
32
32
|
lightShade: "#292d30",
|
|
@@ -37,11 +37,11 @@ const v = {
|
|
|
37
37
|
placeholderText: "#575757",
|
|
38
38
|
semiContrastText: "#9caab0",
|
|
39
39
|
contrastText: "#c3cdd1"
|
|
40
|
-
},
|
|
40
|
+
}, C = "nmorph-data-theme", R = "dark", S = {
|
|
41
41
|
themes: {
|
|
42
|
-
common:
|
|
43
|
-
light:
|
|
44
|
-
dark:
|
|
42
|
+
common: $,
|
|
43
|
+
light: V,
|
|
44
|
+
dark: w
|
|
45
45
|
},
|
|
46
46
|
defaultTheme: R,
|
|
47
47
|
saveCurrentThemeToLS: !0,
|
|
@@ -51,97 +51,143 @@ const v = {
|
|
|
51
51
|
baseShadowWidth: "3.5px",
|
|
52
52
|
baseShadowBlurCoefficient: "2"
|
|
53
53
|
}
|
|
54
|
-
},
|
|
55
|
-
if (!
|
|
56
|
-
return
|
|
57
|
-
},
|
|
58
|
-
const
|
|
59
|
-
return
|
|
60
|
-
|
|
61
|
-
}),
|
|
62
|
-
|
|
63
|
-
}), Object.entries(
|
|
64
|
-
},
|
|
65
|
-
let
|
|
66
|
-
|
|
67
|
-
const
|
|
68
|
-
return `#${
|
|
69
|
-
},
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
54
|
+
}, F = (t) => /^#[0-9A-Fa-f]{6}$/.test(t), v = (t) => {
|
|
55
|
+
if (!F(t)) throw new Error(`Invalid hex color: ${t}`);
|
|
56
|
+
return t;
|
|
57
|
+
}, L = (t, e) => {
|
|
58
|
+
const n = {};
|
|
59
|
+
return t.forEach(({ name: o, color: s }) => {
|
|
60
|
+
n[o] = s;
|
|
61
|
+
}), e.forEach(({ name: o, color: s }) => {
|
|
62
|
+
n[o] = s;
|
|
63
|
+
}), Object.entries(n).map(([o, s]) => ({ name: o, color: s }));
|
|
64
|
+
}, E = (t, e) => {
|
|
65
|
+
let n = parseInt(t.substring(1, 3), 16), o = parseInt(t.substring(3, 5), 16), s = parseInt(t.substring(5, 7), 16);
|
|
66
|
+
n = Math.round(n * (1 + e / 100)), o = Math.round(o * (1 + e / 100)), s = Math.round(s * (1 + e / 100)), n = Math.min(255, Math.max(0, n)), o = Math.min(255, Math.max(0, o)), s = Math.min(255, Math.max(0, s));
|
|
67
|
+
const c = n.toString(16).padStart(2, "0"), i = o.toString(16).padStart(2, "0"), d = s.toString(16).padStart(2, "0");
|
|
68
|
+
return `#${c}${i}${d}`;
|
|
69
|
+
}, G = (t) => ({
|
|
70
|
+
themes: t?.themes ?? S.themes,
|
|
71
|
+
defaultTheme: t?.defaultTheme ?? S.defaultTheme,
|
|
72
|
+
saveCurrentThemeToLS: t?.saveCurrentThemeToLS ?? S.saveCurrentThemeToLS,
|
|
73
|
+
darkShadeGeneratorCoefficient: t?.darkShadeGeneratorCoefficient ?? S.darkShadeGeneratorCoefficient,
|
|
74
|
+
lightShadeGeneratorCoefficient: t?.lightShadeGeneratorCoefficient ?? S.lightShadeGeneratorCoefficient,
|
|
75
|
+
other: t?.other ?? S.other
|
|
76
|
+
}), U = (t, e) => {
|
|
77
|
+
try {
|
|
78
|
+
const n = v(e);
|
|
79
|
+
return {
|
|
80
|
+
darkShade: E(n, t.darkShadeGeneratorCoefficient),
|
|
81
|
+
lightShade: E(n, t.lightShadeGeneratorCoefficient)
|
|
82
|
+
};
|
|
83
|
+
} catch (n) {
|
|
84
|
+
return console.error(n instanceof Error ? n.message : n), {};
|
|
85
|
+
}
|
|
86
|
+
}, x = (t) => Object.entries(t).filter(([, e]) => typeof e == "string").map(([e, n]) => ({
|
|
87
|
+
name: `--nmorph-${b(e)}-color`,
|
|
88
|
+
color: n
|
|
89
|
+
})), N = (t, e) => {
|
|
90
|
+
const n = (c) => c.map((i) => `${i.name}: ${i.color};`).join(" "), o = Object.entries(e).map(([c, i]) => `--${b(c)}: ${i};`).join(" "), s = [];
|
|
91
|
+
return Object.entries(t).forEach(([c, i]) => {
|
|
92
|
+
const d = x($);
|
|
93
|
+
if (c === "common") s.push(n(L(d, i)));
|
|
94
|
+
else {
|
|
95
|
+
const T = `
|
|
96
|
+
&[${C}='${c}'] {
|
|
97
|
+
${n(i)}
|
|
98
|
+
}
|
|
99
|
+
`;
|
|
100
|
+
s.push(T);
|
|
101
|
+
}
|
|
102
|
+
}), `
|
|
103
|
+
:root {
|
|
104
|
+
${s.join(" ")}
|
|
105
|
+
${o}
|
|
106
|
+
}
|
|
107
|
+
`;
|
|
108
|
+
}, P = (t) => {
|
|
109
|
+
const e = {};
|
|
110
|
+
return Object.entries(t.themes).forEach(([n, o]) => {
|
|
111
|
+
e[n] = [];
|
|
112
|
+
const s = !!o.darkShade, c = !!o.lightShade;
|
|
113
|
+
!!o.main && !s && !c && o.main && (e[n] = x(U(t, o.main))), e[n] = [...e[n], ...x(o)];
|
|
114
|
+
}), e;
|
|
115
|
+
}, z = (t) => {
|
|
116
|
+
const e = G(t);
|
|
117
|
+
return N(P(e), e.other);
|
|
118
|
+
}, J = (t) => {
|
|
119
|
+
I("warn", `NMORPH(v${_.version})`);
|
|
120
|
+
const e = G(t), n = (a) => {
|
|
79
121
|
try {
|
|
80
|
-
const
|
|
122
|
+
const r = v(a);
|
|
81
123
|
return {
|
|
82
|
-
darkShade:
|
|
83
|
-
lightShade:
|
|
124
|
+
darkShade: E(r, e.darkShadeGeneratorCoefficient),
|
|
125
|
+
lightShade: E(r, e.lightShadeGeneratorCoefficient)
|
|
84
126
|
};
|
|
85
|
-
} catch (
|
|
86
|
-
return console.error(
|
|
127
|
+
} catch (r) {
|
|
128
|
+
return console.error(r instanceof Error ? r.message : r), {};
|
|
87
129
|
}
|
|
88
|
-
},
|
|
89
|
-
const
|
|
90
|
-
return
|
|
91
|
-
},
|
|
92
|
-
name: `--nmorph-${
|
|
93
|
-
color:
|
|
94
|
-
})),
|
|
95
|
-
const
|
|
96
|
-
return Object.entries(a).forEach(([
|
|
97
|
-
const
|
|
98
|
-
if (
|
|
130
|
+
}, o = (a) => {
|
|
131
|
+
const r = n(a);
|
|
132
|
+
return s(r);
|
|
133
|
+
}, s = (a) => Object.entries(a).filter(([, r]) => typeof r == "string").map(([r, h]) => ({
|
|
134
|
+
name: `--nmorph-${b(r)}-color`,
|
|
135
|
+
color: h
|
|
136
|
+
})), c = (a, r) => {
|
|
137
|
+
const h = (f) => f.map((u) => `${u.name}: ${u.color};`).join(" "), l = Object.entries(r).map(([f, u]) => `--${b(f)}: ${u};`).join(" "), g = [];
|
|
138
|
+
return Object.entries(a).forEach(([f, u]) => {
|
|
139
|
+
const k = s($);
|
|
140
|
+
if (f === "common") g.push(h(L(k, u)));
|
|
99
141
|
else {
|
|
100
|
-
const
|
|
101
|
-
&[${
|
|
102
|
-
${
|
|
142
|
+
const B = `
|
|
143
|
+
&[${C}='${f}'] {
|
|
144
|
+
${h(u)}
|
|
103
145
|
}
|
|
104
146
|
`;
|
|
105
|
-
|
|
147
|
+
g.push(B);
|
|
106
148
|
}
|
|
107
149
|
}), `
|
|
108
150
|
:root {
|
|
109
|
-
${
|
|
110
|
-
${
|
|
151
|
+
${g.join(" ")}
|
|
152
|
+
${l}
|
|
111
153
|
}
|
|
112
154
|
`;
|
|
113
|
-
},
|
|
114
|
-
const
|
|
115
|
-
return Object.entries(a).forEach(([
|
|
116
|
-
|
|
117
|
-
const
|
|
118
|
-
!!
|
|
119
|
-
}),
|
|
155
|
+
}, i = (a) => {
|
|
156
|
+
const r = {};
|
|
157
|
+
return Object.entries(a).forEach(([h, l]) => {
|
|
158
|
+
r[h] = [];
|
|
159
|
+
const g = !!l.darkShade, f = !!l.lightShade;
|
|
160
|
+
!!l.main && !g && !f && l.main && (r[h] = o(l.main)), r[h] = [...r[h], ...s(l)];
|
|
161
|
+
}), r;
|
|
162
|
+
}, d = typeof document < "u", T = A(e.defaultTheme);
|
|
163
|
+
let p = i(e.themes), m = null;
|
|
164
|
+
d && (m = document.getElementById("nmorph-theme-styles"), m || (m = document.createElement("style"), m.id = "nmorph-theme-styles", m.type = "text/css", document.head.appendChild(m)), m.innerHTML = c(p, e.other));
|
|
165
|
+
const D = () => {
|
|
166
|
+
p = i(e.themes), m && (m.innerHTML = c(p, e.other));
|
|
167
|
+
}, y = (a) => {
|
|
168
|
+
T.value = a, d && (document.documentElement.setAttribute(C, T.value), !(typeof localStorage > "u") && (e.saveCurrentThemeToLS ? localStorage.setItem(C, a) : localStorage.removeItem(C)));
|
|
169
|
+
}, M = (a, r) => {
|
|
170
|
+
const h = r.main && !r.darkShade && !r.lightShade ? n(r.main) : {};
|
|
171
|
+
e.themes[a] = { ...e.themes[a], ...r, ...h }, D();
|
|
172
|
+
}, O = (a, r) => {
|
|
173
|
+
r && M(a, r), y(a);
|
|
120
174
|
};
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
f.value = a, k.setAttribute(u, f.value), t.saveCurrentThemeToLS ? localStorage.setItem(u, a) : localStorage.removeItem(u);
|
|
128
|
-
}, x = (a, e) => {
|
|
129
|
-
const c = e.main && !e.darkShade && !e.lightShade ? s(e.main) : {};
|
|
130
|
-
t.themes[a] = { ...t.themes[a], ...e, ...c }, y();
|
|
131
|
-
}, $ = (a, e) => {
|
|
132
|
-
e && x(a, e), p(a);
|
|
133
|
-
}, f = H(t.defaultTheme), k = document.documentElement, b = localStorage.getItem(u), G = b ? d[b] : void 0;
|
|
134
|
-
t.saveCurrentThemeToLS && G && (f.value = b), p(f.value);
|
|
135
|
-
const A = t;
|
|
175
|
+
if (d && typeof localStorage < "u") {
|
|
176
|
+
const a = localStorage.getItem(C), r = a ? p[a] : void 0;
|
|
177
|
+
e.saveCurrentThemeToLS && r && (T.value = a);
|
|
178
|
+
}
|
|
179
|
+
y(T.value);
|
|
180
|
+
const j = e;
|
|
136
181
|
return {
|
|
137
|
-
setTheme:
|
|
138
|
-
setThemeColors:
|
|
139
|
-
applyTheme:
|
|
140
|
-
currentTheme:
|
|
141
|
-
data:
|
|
142
|
-
getDynamicColorVariables:
|
|
182
|
+
setTheme: y,
|
|
183
|
+
setThemeColors: M,
|
|
184
|
+
applyTheme: O,
|
|
185
|
+
currentTheme: H(T),
|
|
186
|
+
data: j,
|
|
187
|
+
getDynamicColorVariables: o
|
|
143
188
|
};
|
|
144
189
|
};
|
|
145
190
|
export {
|
|
146
|
-
|
|
191
|
+
z as getNmorphThemeStyles,
|
|
192
|
+
J as useNmorphTheme
|
|
147
193
|
};
|
package/dist/package.json.js
CHANGED
package/dist/plugin.js
CHANGED
|
@@ -1,47 +1,52 @@
|
|
|
1
|
-
import { default as
|
|
1
|
+
import { default as C } from "./locales/ru.js";
|
|
2
2
|
import { default as _ } from "./locales/zh.js";
|
|
3
3
|
import { default as w } from "./locales/en.js";
|
|
4
4
|
import { nmorphLog as M } from "./outside-utils/index.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { useNmorphTheme as h } from "./outside-hooks/use-nmorph-theme.js";
|
|
6
|
+
import { getNmorphThemeStyles as E } from "./outside-hooks/use-nmorph-theme.js";
|
|
7
7
|
import { useCommonStyles as i } from "./hooks/use-common-styles.js";
|
|
8
|
-
import {
|
|
8
|
+
import { getCommonStyles as O } from "./hooks/use-common-styles.js";
|
|
9
|
+
import { AvatarShapeType as A, Locale as B, NmorphColor as F, NmorphComponentDirection as P, NmorphComponentHeight as R, NmorphComponentPosition as U, NmorphImageFit as Z, NmorphRadioStyleType as k, NmorphSelectionControlHeight as q, NmorphSelectionDateType as G, NmorphShadowType as J, NmorphSortOrder as K } from "./types/index.js";
|
|
10
|
+
import { useNmorphTranslation as f } from "./hooks/use-nmorph-translation.js";
|
|
9
11
|
import { useNmorphBrowser as c } from "./outside-hooks/use-nmorph-browser.js";
|
|
10
12
|
import { useNmorphZIndex as N } from "./outside-hooks/use-nmorph-z-index.js";
|
|
11
|
-
import { useNmorph as
|
|
12
|
-
import { useNmorphNotification as
|
|
13
|
-
const
|
|
13
|
+
import { useNmorph as W } from "./outside-hooks/use-nmorph.js";
|
|
14
|
+
import { useNmorphNotification as Y } from "./outside-hooks/use-nmorph-notification.js";
|
|
15
|
+
const g = {
|
|
14
16
|
install(e, r = {}) {
|
|
15
17
|
if (!r?.i18n?.outsideMessagesMerge) {
|
|
16
|
-
const o =
|
|
17
|
-
m ? (o.global.messages.value && Object.entries(o.global.messages.value).forEach(([
|
|
18
|
-
m.global.mergeLocaleMessage(
|
|
18
|
+
const o = f(r.i18n), m = e.__VUE_I18N__;
|
|
19
|
+
m ? (o.global.messages.value && Object.entries(o.global.messages.value).forEach(([s, n]) => {
|
|
20
|
+
m.global.mergeLocaleMessage(s, n);
|
|
19
21
|
}), o.global.locale.value && (m.global.locale.value = o.global.locale.value)) : e.use(o);
|
|
20
22
|
}
|
|
21
23
|
i();
|
|
22
|
-
const t =
|
|
23
|
-
return e.provide("nmorph",
|
|
24
|
+
const t = h(r.theme), a = c(), l = N(r.zIndex), p = { theme: t, browser: a, zIndex: l };
|
|
25
|
+
return e.provide("nmorph", p), e;
|
|
24
26
|
}
|
|
25
|
-
},
|
|
27
|
+
}, S = g;
|
|
26
28
|
export {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
29
|
+
A as AvatarShapeType,
|
|
30
|
+
B as Locale,
|
|
31
|
+
F as NmorphColor,
|
|
32
|
+
P as NmorphComponentDirection,
|
|
33
|
+
R as NmorphComponentHeight,
|
|
34
|
+
U as NmorphComponentPosition,
|
|
35
|
+
Z as NmorphImageFit,
|
|
36
|
+
S as NmorphLibrary,
|
|
37
|
+
k as NmorphRadioStyleType,
|
|
38
|
+
q as NmorphSelectionControlHeight,
|
|
39
|
+
G as NmorphSelectionDateType,
|
|
40
|
+
J as NmorphShadowType,
|
|
41
|
+
K as NmorphSortOrder,
|
|
39
42
|
w as en,
|
|
43
|
+
O as getCommonStyles,
|
|
44
|
+
E as getNmorphThemeStyles,
|
|
40
45
|
M as nmorphLog,
|
|
41
|
-
|
|
42
|
-
|
|
46
|
+
C as ru,
|
|
47
|
+
W as useNmorph,
|
|
43
48
|
c as useNmorphBrowser,
|
|
44
|
-
|
|
45
|
-
|
|
49
|
+
Y as useNmorphNotification,
|
|
50
|
+
h as useNmorphTheme,
|
|
46
51
|
_ as zh
|
|
47
52
|
};
|
|
@@ -23,12 +23,12 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<INmorphProps, {
|
|
|
23
23
|
color: string;
|
|
24
24
|
disabled: boolean;
|
|
25
25
|
hidden: boolean;
|
|
26
|
+
zIndex: number;
|
|
26
27
|
max: number;
|
|
27
28
|
isDot: boolean;
|
|
28
29
|
isTag: boolean;
|
|
29
30
|
offsetY: number;
|
|
30
31
|
offsetX: number;
|
|
31
|
-
zIndex: number;
|
|
32
32
|
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>, Readonly<{
|
|
33
33
|
default?: (props: Record<string, never>) => unknown;
|
|
34
34
|
value?: (props: NmorphBadgeValueSlotProps) => unknown;
|
|
@@ -12,12 +12,12 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<INmorphProps, {
|
|
|
12
12
|
onError?: (event: Event) => any;
|
|
13
13
|
onLoad?: (event: Event) => any;
|
|
14
14
|
}>, {
|
|
15
|
-
srcSet: string;
|
|
16
|
-
fit: "fill" | "none" | "contain" | "cover" | "scale-down";
|
|
17
15
|
alt: string;
|
|
18
|
-
|
|
16
|
+
fit: "fill" | "none" | "cover" | "contain" | "scale-down";
|
|
19
17
|
loadingText: string;
|
|
20
18
|
loadFailedText: string;
|
|
19
|
+
srcSet: string;
|
|
20
|
+
frameBorder: number;
|
|
21
21
|
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>, {
|
|
22
22
|
error?(_: {}): any;
|
|
23
23
|
loading?(_: {}): any;
|
|
@@ -8,8 +8,9 @@ interface INmorphProps {
|
|
|
8
8
|
minScaleLevel?: number;
|
|
9
9
|
maxScaleLevel?: number;
|
|
10
10
|
zIndex?: number;
|
|
11
|
+
showTrigger?: boolean;
|
|
11
12
|
}
|
|
12
|
-
declare const _default: DefineComponent<INmorphProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
|
|
13
|
+
declare const _default: __VLS_WithTemplateSlots< DefineComponent<INmorphProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
|
|
13
14
|
"update:model-value": (value: boolean) => any;
|
|
14
15
|
}, string, PublicProps, Readonly<INmorphProps> & Readonly<{
|
|
15
16
|
"onUpdate:model-value"?: (value: boolean) => any;
|
|
@@ -20,5 +21,16 @@ declare const _default: DefineComponent<INmorphProps, {}, {}, {}, {}, ComponentO
|
|
|
20
21
|
scaleStep: number;
|
|
21
22
|
minScaleLevel: number;
|
|
22
23
|
maxScaleLevel: number;
|
|
23
|
-
|
|
24
|
+
showTrigger: boolean;
|
|
25
|
+
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>, {
|
|
26
|
+
loading?(_: {}): any;
|
|
27
|
+
loading?(_: {}): any;
|
|
28
|
+
error?(_: {}): any;
|
|
29
|
+
error?(_: {}): any;
|
|
30
|
+
}>;
|
|
24
31
|
export default _default;
|
|
32
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
33
|
+
new (): {
|
|
34
|
+
$slots: S;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { NmorphComponentHeight } from '../../../types';
|
|
1
2
|
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
2
3
|
interface INmorphProps {
|
|
3
4
|
totalElementsQuantity: number;
|
|
@@ -7,12 +8,14 @@ interface INmorphProps {
|
|
|
7
8
|
hideOnSinglePage?: boolean;
|
|
8
9
|
maxVisiblePages?: number;
|
|
9
10
|
fastForwardStep?: number;
|
|
11
|
+
height?: keyof typeof NmorphComponentHeight;
|
|
10
12
|
}
|
|
11
13
|
declare const _default: DefineComponent<INmorphProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
|
|
12
14
|
"update:model-value": (currentPage: number) => any;
|
|
13
15
|
}, string, PublicProps, Readonly<INmorphProps> & Readonly<{
|
|
14
16
|
"onUpdate:model-value"?: (currentPage: number) => any;
|
|
15
17
|
}>, {
|
|
18
|
+
height: "thick" | "basic" | "thin";
|
|
16
19
|
disabled: boolean;
|
|
17
20
|
modelValue: number;
|
|
18
21
|
elementsQuantityOnPage: number;
|
|
@@ -6,6 +6,10 @@ interface INmorphProps {
|
|
|
6
6
|
bordered?: boolean;
|
|
7
7
|
sort?: NmorphTableSortType;
|
|
8
8
|
design?: 'nmorph' | 'common';
|
|
9
|
+
virtual?: boolean;
|
|
10
|
+
virtualHeight?: number | string;
|
|
11
|
+
virtualOverscan?: number;
|
|
12
|
+
virtualRowHeight?: number;
|
|
9
13
|
}
|
|
10
14
|
declare const _default: __VLS_WithTemplateSlots< DefineComponent<INmorphProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<INmorphProps> & Readonly<{}>, {
|
|
11
15
|
sort: NmorphTableSortType;
|
|
@@ -13,8 +17,13 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<INmorphProps, {
|
|
|
13
17
|
bordered: boolean;
|
|
14
18
|
design: "nmorph" | "common";
|
|
15
19
|
rowHover: boolean;
|
|
20
|
+
virtual: boolean;
|
|
21
|
+
virtualHeight: string | number;
|
|
22
|
+
virtualOverscan: number;
|
|
23
|
+
virtualRowHeight: number;
|
|
16
24
|
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>, {
|
|
17
25
|
default?(_: {}): any;
|
|
26
|
+
default?(_: {}): any;
|
|
18
27
|
}>;
|
|
19
28
|
export default _default;
|
|
20
29
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { NmorphSortOrderType } from '../../../types';
|
|
2
|
-
import { Ref } from 'vue';
|
|
2
|
+
import { ComputedRef, Ref } from 'vue';
|
|
3
3
|
export type NmorphTableSortType = Record<string, NmorphSortOrderType>;
|
|
4
4
|
export type NmorphDataTableElRecordType = Record<string, unknown>;
|
|
5
5
|
export type NmorphCellAlignmentType = 'left' | 'center' | 'right';
|
|
@@ -14,7 +14,7 @@ export interface NmorphTableColumnData extends INmorphTableColumnProps {
|
|
|
14
14
|
id?: number;
|
|
15
15
|
}
|
|
16
16
|
export interface INmorphTableDataInjection {
|
|
17
|
-
rows: Ref<NmorphDataTableElRecordType[]>;
|
|
17
|
+
rows: Ref<NmorphDataTableElRecordType[]> | ComputedRef<NmorphDataTableElRecordType[]>;
|
|
18
18
|
columns: Ref<NmorphTableColumnData[]>;
|
|
19
19
|
}
|
|
20
20
|
export type NmorphTableColumnPropertyInjectionType = string;
|
|
@@ -10,7 +10,7 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<INmorphProps, {
|
|
|
10
10
|
tooltipBody: Ref<HTMLElement, HTMLElement>;
|
|
11
11
|
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<INmorphProps> & Readonly<{}>, {
|
|
12
12
|
text: string;
|
|
13
|
-
position:
|
|
13
|
+
position: NmorphPlacementType;
|
|
14
14
|
forceShow: boolean;
|
|
15
15
|
forceCoordinate: Partial<INmorphCoords<string>>;
|
|
16
16
|
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>, {
|
|
@@ -8,6 +8,10 @@ interface INmorphProps extends INmorphCommonInputProps {
|
|
|
8
8
|
list: INmorphAutocompleteListItem[];
|
|
9
9
|
actionCallback?: NmorphAutocompleteActionCallbackType;
|
|
10
10
|
zIndex?: number;
|
|
11
|
+
virtual?: boolean;
|
|
12
|
+
virtualItemHeight?: number;
|
|
13
|
+
virtualMaxHeight?: number | string;
|
|
14
|
+
virtualOverscan?: number;
|
|
11
15
|
}
|
|
12
16
|
declare const _default: __VLS_WithTemplateSlots< DefineComponent<INmorphProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
|
|
13
17
|
select: (value: unknown) => any;
|
|
@@ -19,15 +23,22 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<INmorphProps, {
|
|
|
19
23
|
height: "thick" | "basic" | "thin";
|
|
20
24
|
disabled: boolean;
|
|
21
25
|
modelValue: string;
|
|
26
|
+
virtual: boolean;
|
|
27
|
+
virtualOverscan: number;
|
|
22
28
|
placeholder: string;
|
|
23
29
|
clearable: boolean;
|
|
24
30
|
list: INmorphAutocompleteListItem[];
|
|
25
31
|
actionCallback: NmorphAutocompleteActionCallbackType;
|
|
32
|
+
virtualItemHeight: number;
|
|
33
|
+
virtualMaxHeight: string | number;
|
|
26
34
|
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>, {
|
|
27
35
|
loader?(_: {}): any;
|
|
28
36
|
default?(_: {
|
|
29
37
|
scope: INmorphAutocompleteListItem;
|
|
30
38
|
}): any;
|
|
39
|
+
default?(_: {
|
|
40
|
+
scope: INmorphAutocompleteListItem;
|
|
41
|
+
}): any;
|
|
31
42
|
}>;
|
|
32
43
|
export default _default;
|
|
33
44
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
@@ -13,6 +13,7 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<INmorphCheckbox
|
|
|
13
13
|
modelValue: boolean;
|
|
14
14
|
design: NmorphCheckboxDesignType;
|
|
15
15
|
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>, {
|
|
16
|
+
default?(_: {}): any;
|
|
16
17
|
default?(_: {}): any;
|
|
17
18
|
label?(_: {}): any;
|
|
18
19
|
}>;
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import { INmorphCheckboxOption, INmorphCommonInputProps, NmorphCheckboxDesignType, NmorphComponentDirection } from '../../../types';
|
|
1
|
+
import { INmorphCheckboxOption, INmorphCommonInputProps, NmorphCheckboxDesignType, NmorphComponentDirection, NmorphSelectionControlHeightType } from '../../../types';
|
|
2
2
|
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
3
|
-
interface INmorphProps extends INmorphCommonInputProps {
|
|
3
|
+
interface INmorphProps extends Omit<INmorphCommonInputProps, 'height'> {
|
|
4
4
|
modelValue: string[];
|
|
5
5
|
options?: INmorphCheckboxOption[];
|
|
6
6
|
design?: NmorphCheckboxDesignType;
|
|
7
7
|
direction?: keyof typeof NmorphComponentDirection;
|
|
8
|
+
height?: NmorphSelectionControlHeightType;
|
|
8
9
|
}
|
|
9
10
|
declare const _default: __VLS_WithTemplateSlots< DefineComponent<INmorphProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
|
|
10
11
|
"update:model-value": (val: string[]) => any;
|
|
11
12
|
}, string, PublicProps, Readonly<INmorphProps> & Readonly<{
|
|
12
13
|
"onUpdate:model-value"?: (val: string[]) => any;
|
|
13
14
|
}>, {
|
|
14
|
-
height: "thick" | "basic" | "thin";
|
|
15
|
+
height: "thick" | "basic" | "thin" | "extra-thin";
|
|
15
16
|
disabled: boolean;
|
|
16
17
|
modelValue: string[];
|
|
17
18
|
design: NmorphCheckboxDesignType;
|