@nmorph/nmorph-ui-kit 2.2.43 → 2.2.45
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/assets/icons/burger.svg.js +5 -5
- package/dist/assets/icons/download.svg.js +5 -5
- package/dist/assets/icons/open.svg.js +2 -2
- package/dist/assets/icons/search.svg.js +1 -1
- package/dist/assets/icons/smile.svg.js +4 -4
- package/dist/components/basic/nmorph-button/NmorphButton.vue.js +16 -16
- package/dist/components/basic/nmorph-scroll/NmorphScroll.css +1 -1
- package/dist/components/basic/nmorph-scroll/NmorphScroll.vue.js +179 -74
- package/dist/components/data/nmorph-audio-preview/NmorphAudioPreview.css +1 -0
- package/dist/components/data/nmorph-audio-preview/NmorphAudioPreview.vue.js +207 -0
- package/dist/components/data/nmorph-audio-preview/NmorphAudioPreview.vue3.js +6 -0
- package/dist/components/data/nmorph-emoji-picker/NmorphEmojiPicker.css +1 -0
- package/dist/components/data/nmorph-emoji-picker/NmorphEmojiPicker.vue.js +405 -0
- package/dist/components/data/nmorph-emoji-picker/NmorphEmojiPicker.vue3.js +6 -0
- package/dist/components/data/nmorph-file-card/NmorphFileCard.css +1 -0
- package/dist/components/data/nmorph-file-card/NmorphFileCard.vue.js +124 -0
- package/dist/components/data/nmorph-file-card/NmorphFileCard.vue3.js +6 -0
- package/dist/components/data/nmorph-media-tile/NmorphMediaTile.vue.js +8 -8
- package/dist/components/data/nmorph-video-preview/NmorphVideoPreview.css +1 -0
- package/dist/components/data/nmorph-video-preview/NmorphVideoPreview.vue.js +147 -0
- package/dist/components/data/nmorph-video-preview/NmorphVideoPreview.vue3.js +6 -0
- package/dist/components/form/nmorph-file-upload/NmorphFileUpload.css +1 -1
- package/dist/components/form/nmorph-file-upload/NmorphFileUpload.vue.js +154 -125
- package/dist/components/form/nmorph-file-upload/types.js +9 -9
- package/dist/hooks/use-common-styles.js +92 -12
- package/dist/index.es.js +861 -849
- package/dist/index.umd.js +108 -28
- package/dist/package.json.js +1 -1
- package/dist/src/components/basic/nmorph-scroll/NmorphScroll.vue.d.ts +1 -0
- package/dist/src/components/data/index.d.ts +8 -0
- package/dist/src/components/data/nmorph-audio-preview/NmorphAudioPreview.vue.d.ts +38 -0
- package/dist/src/components/data/nmorph-audio-preview/types.d.ts +20 -0
- package/dist/src/components/data/nmorph-calendar/NmorphCalendar.vue.d.ts +1 -1
- package/dist/src/components/data/nmorph-emoji-picker/NmorphEmojiPicker.vue.d.ts +25 -0
- package/dist/src/components/data/nmorph-emoji-picker/types.d.ts +51 -0
- package/dist/src/components/data/nmorph-file-card/NmorphFileCard.vue.d.ts +30 -0
- package/dist/src/components/data/nmorph-file-card/types.d.ts +18 -0
- package/dist/src/components/data/nmorph-media-tile/NmorphMediaTile.vue.d.ts +1 -1
- package/dist/src/components/data/nmorph-video-preview/NmorphVideoPreview.vue.d.ts +41 -0
- package/dist/src/components/data/nmorph-video-preview/types.d.ts +27 -0
- package/dist/src/components/form/nmorph-date-picker/inner-components/nmorph-year-month-picker/NmorphYearMonthPicker.vue.d.ts +1 -1
- package/dist/src/components/form/nmorph-file-upload/NmorphFileUpload.vue.d.ts +1 -1
- package/dist/src/components/form/nmorph-file-upload/types.d.ts +4 -0
- package/dist/src/components/form/nmorph-number-input/NmorphNumberInput.vue.d.ts +1 -1
- package/dist/src/components/form/nmorph-slider/NmorphSlider.vue.d.ts +1 -1
- package/dist/src/components/form/nmorph-text-input/NmorphTextInput.vue.d.ts +1 -1
- package/dist/src/components/form/nmorph-textarea/NmorphTextarea.vue.d.ts +1 -1
- package/dist/src/components/navigation/nmorph-backtop/NmorphBacktop.vue.d.ts +1 -1
- package/dist/src/utils/file-types.d.ts +8 -1
- package/dist/style.css +1 -1
- package/dist/utils/file-types.js +28 -21
- package/package.json +23 -24
|
@@ -1,27 +1,31 @@
|
|
|
1
1
|
import './NmorphFileUpload.css';
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
import { useModifiers as
|
|
4
|
-
import { createCssSizeVariables as
|
|
5
|
-
import { getFileAcceptValue as ue,
|
|
6
|
-
import { useI18n as
|
|
2
|
+
import { defineComponent as ee, computed as x, inject as te, ref as R, watch as oe, onBeforeUnmount as le, openBlock as r, createElementBlock as c, normalizeStyle as ie, normalizeClass as ne, createElementVNode as u, unref as l, renderSlot as ae, createVNode as m, TransitionGroup as se, withCtx as F, Fragment as T, renderList as re, toDisplayString as $, createBlock as V, createCommentVNode as me } from "vue";
|
|
3
|
+
import { useModifiers as de } from "../../../utils/create-modifiers.js";
|
|
4
|
+
import { createCssSizeVariables as ce } from "../../../utils/common.js";
|
|
5
|
+
import { getFileAcceptValue as ue, isImageFile as N, isVideoFile as pe, isAudioFile as fe, getFileExtension as P, isFileAllowedByTypes as he } from "../../../utils/file-types.js";
|
|
6
|
+
import { useI18n as ve } from "vue-i18n";
|
|
7
7
|
import { useFormItemInput as _e, useFormItemModel as ye } from "../nmorph-form/use-form-item-input.js";
|
|
8
|
-
import
|
|
8
|
+
import A from "../../basic/nmorph-button/NmorphButton.vue.js";
|
|
9
9
|
/* empty css */
|
|
10
|
-
import
|
|
10
|
+
import xe from "../../data/nmorph-image-preview/NmorphImagePreview.vue.js";
|
|
11
11
|
/* empty css */
|
|
12
|
-
import
|
|
12
|
+
import S from "../../basic/nmorph-icon/NmorphIcon.vue.js";
|
|
13
13
|
/* empty css */
|
|
14
|
-
import
|
|
15
|
-
|
|
16
|
-
import
|
|
17
|
-
|
|
18
|
-
import
|
|
19
|
-
|
|
20
|
-
import
|
|
21
|
-
|
|
14
|
+
import Fe from "../../data/nmorph-video-preview/NmorphVideoPreview.vue.js";
|
|
15
|
+
/* empty css */
|
|
16
|
+
import ge from "../../data/nmorph-audio-preview/NmorphAudioPreview.vue.js";
|
|
17
|
+
/* empty css */
|
|
18
|
+
import be from "../../data/nmorph-file-card/NmorphFileCard.vue.js";
|
|
19
|
+
/* empty css */
|
|
20
|
+
import z from "../../../assets/icons/image.svg.js";
|
|
21
|
+
import we from "../../../assets/icons/cross.svg.js";
|
|
22
|
+
const ke = { class: "nmorph-file-upload__trigger" }, Ve = ["id", "name", "autocomplete", "tabindex", "multiple", "disabled", "accept"], Ce = {
|
|
22
23
|
key: 0,
|
|
23
24
|
class: "nmorph-file-upload__list"
|
|
24
|
-
},
|
|
25
|
+
}, Ie = { class: "nmorph-file-upload__file-info" }, Be = { class: "nmorph-file-upload__file-name" }, Re = {
|
|
26
|
+
key: 1,
|
|
27
|
+
class: "nmorph-file-upload__file-info"
|
|
28
|
+
}, Te = { class: "nmorph-file-upload__file-name" }, $e = { class: "nmorph-file-upload__remove-file" }, Ye = /* @__PURE__ */ ee({
|
|
25
29
|
__name: "NmorphFileUpload",
|
|
26
30
|
props: {
|
|
27
31
|
id: {},
|
|
@@ -39,151 +43,176 @@ const Te = { class: "nmorph-file-upload__trigger" }, Ue = ["id", "name", "autoco
|
|
|
39
43
|
fileNameWidth: { default: void 0 }
|
|
40
44
|
},
|
|
41
45
|
emits: ["update:model-value", "on-unsupported-file-type-error", "on-file-validation-error"],
|
|
42
|
-
setup(
|
|
43
|
-
const { t:
|
|
44
|
-
|
|
45
|
-
(e) =>
|
|
46
|
+
setup(E, { expose: L, emit: M }) {
|
|
47
|
+
const { t: U } = ve(), o = E, g = M, D = x(() => o.buttonText ? o.buttonText : U("selectFile")), { id: _, name: O, autocomplete: W, tabindex: j } = _e(o), { modelValue: C, updateModelValue: G } = ye(
|
|
48
|
+
o,
|
|
49
|
+
(e) => g("update:model-value", e),
|
|
46
50
|
[]
|
|
47
|
-
), b =
|
|
48
|
-
const
|
|
49
|
-
return e.type.toLowerCase().startsWith("image/") || t.some((o) => h(o, L));
|
|
50
|
-
}, G = F(() => ue(l.allowedTypes)), K = (e) => {
|
|
51
|
-
const t = A(e);
|
|
52
|
-
let o = xe;
|
|
53
|
-
return (e.type.toLowerCase().startsWith("image/") || t.some((i) => h(i, L))) && (o = ke), (e.type.toLowerCase().startsWith("audio/") || t.some((i) => h(i, Ce))) && (o = be), (e.type.toLowerCase().startsWith("video/") || t.some((i) => h(i, Ie))) && (o = Re), t.some((i) => h(i, Ne)) && (o = we), o;
|
|
54
|
-
}, m = R(null), r = R([...N.value]), c = /* @__PURE__ */ new Set(), w = () => {
|
|
55
|
-
const e = m.value;
|
|
51
|
+
), b = te("form-data", void 0), q = x(() => ue(o.allowedTypes)), H = (e) => o.photoWithPreview && N(e), p = R(null), s = R([...C.value]), f = /* @__PURE__ */ new Set(), w = () => {
|
|
52
|
+
const e = p.value;
|
|
56
53
|
e && (e.value = "");
|
|
57
|
-
}, C = (e) => {
|
|
58
|
-
c.has(e) && (URL.revokeObjectURL(e), c.delete(e));
|
|
59
|
-
}, V = (e) => {
|
|
60
|
-
const t = new Set(e.map((o) => o.previewUrl));
|
|
61
|
-
Array.from(c).forEach((o) => {
|
|
62
|
-
t.has(o) || C(o);
|
|
63
|
-
});
|
|
64
54
|
}, k = (e) => {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
55
|
+
f.has(e) && (URL.revokeObjectURL(e), f.delete(e));
|
|
56
|
+
}, I = (e) => {
|
|
57
|
+
const i = new Set(e.map((t) => t.previewUrl));
|
|
58
|
+
Array.from(f).forEach((t) => {
|
|
59
|
+
i.has(t) || k(t);
|
|
60
|
+
});
|
|
61
|
+
}, B = (e) => {
|
|
62
|
+
const i = [...e];
|
|
63
|
+
s.value = i, G(i);
|
|
64
|
+
}, J = (e) => {
|
|
65
|
+
const i = b?.validateField(_.value, e);
|
|
69
66
|
return {
|
|
70
|
-
valid:
|
|
71
|
-
errors:
|
|
67
|
+
valid: i?.valid.value ?? !0,
|
|
68
|
+
errors: i?.errors.value ?? []
|
|
72
69
|
};
|
|
73
|
-
},
|
|
74
|
-
|
|
75
|
-
},
|
|
76
|
-
if (
|
|
77
|
-
const
|
|
78
|
-
if (
|
|
79
|
-
if (!
|
|
80
|
-
|
|
70
|
+
}, K = () => {
|
|
71
|
+
o.disabled || !p.value || p.value.click();
|
|
72
|
+
}, Q = (e) => {
|
|
73
|
+
if (o.disabled) return;
|
|
74
|
+
const i = e.target, t = Array.from(i.files || []), a = o.multiple ? t : t.slice(0, 1), d = [];
|
|
75
|
+
if (a.forEach((n) => {
|
|
76
|
+
if (!he(n, o.allowedTypes)) {
|
|
77
|
+
g("on-unsupported-file-type-error", n.type || P(n.name) || n.name);
|
|
81
78
|
return;
|
|
82
79
|
}
|
|
83
|
-
const
|
|
84
|
-
if (!
|
|
85
|
-
|
|
80
|
+
const h = o.multiple ? [...s.value.map((y) => y.data), ...d, n] : [n], v = J(h);
|
|
81
|
+
if (!v.valid) {
|
|
82
|
+
g("on-file-validation-error", { file: n, errors: v.errors });
|
|
86
83
|
return;
|
|
87
84
|
}
|
|
88
|
-
|
|
89
|
-
}), w(),
|
|
90
|
-
const
|
|
91
|
-
const y = URL.createObjectURL(
|
|
92
|
-
return
|
|
93
|
-
}),
|
|
94
|
-
|
|
85
|
+
d.push(n);
|
|
86
|
+
}), w(), d.length > 0) {
|
|
87
|
+
const n = d.map((v) => {
|
|
88
|
+
const y = URL.createObjectURL(v);
|
|
89
|
+
return f.add(y), { data: v, previewUrl: y };
|
|
90
|
+
}), h = o.multiple ? [...s.value, ...n] : n;
|
|
91
|
+
I(h), B(h), b?.validateField(_.value, h);
|
|
95
92
|
}
|
|
96
|
-
},
|
|
97
|
-
if (
|
|
98
|
-
const
|
|
99
|
-
if (
|
|
100
|
-
const
|
|
101
|
-
|
|
102
|
-
const
|
|
103
|
-
|
|
93
|
+
}, X = (e) => {
|
|
94
|
+
if (o.disabled) return;
|
|
95
|
+
const i = s.value.findIndex((t) => t.data.name === e);
|
|
96
|
+
if (i !== -1) {
|
|
97
|
+
const t = s.value[i];
|
|
98
|
+
k(t.previewUrl), w();
|
|
99
|
+
const a = s.value.filter((d, n) => n !== i);
|
|
100
|
+
B(a), b?.validateField(_.value, a);
|
|
104
101
|
}
|
|
105
102
|
};
|
|
106
|
-
|
|
107
|
-
|
|
103
|
+
oe(
|
|
104
|
+
C,
|
|
108
105
|
(e) => {
|
|
109
|
-
const
|
|
110
|
-
|
|
106
|
+
const i = [...e];
|
|
107
|
+
I(i), s.value = i, i.length === 0 && w();
|
|
111
108
|
},
|
|
112
109
|
{ deep: !0 }
|
|
113
|
-
),
|
|
114
|
-
Array.from(
|
|
115
|
-
}),
|
|
116
|
-
const
|
|
117
|
-
() =>
|
|
118
|
-
"nmorph-file-upload": [
|
|
110
|
+
), le(() => {
|
|
111
|
+
Array.from(f).forEach((e) => k(e));
|
|
112
|
+
}), L({ inputDOMRef: p });
|
|
113
|
+
const Y = x(
|
|
114
|
+
() => de({
|
|
115
|
+
"nmorph-file-upload": [o.disabled && "disabled", o.compact && "compact", `layout-${o.layout}`]
|
|
119
116
|
})
|
|
120
|
-
),
|
|
121
|
-
() =>
|
|
122
|
-
"--nmorph-file-upload-name-width":
|
|
117
|
+
), Z = x(
|
|
118
|
+
() => ce({
|
|
119
|
+
"--nmorph-file-upload-name-width": o.fileNameWidth
|
|
123
120
|
})
|
|
124
121
|
);
|
|
125
|
-
return (e,
|
|
126
|
-
class:
|
|
127
|
-
style:
|
|
122
|
+
return (e, i) => (r(), c("div", {
|
|
123
|
+
class: ne(Y.value),
|
|
124
|
+
style: ie(Z.value)
|
|
128
125
|
}, [
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
id:
|
|
126
|
+
u("div", ke, [
|
|
127
|
+
u("input", {
|
|
128
|
+
id: l(_),
|
|
132
129
|
ref_key: "inputDOMRef",
|
|
133
|
-
ref:
|
|
134
|
-
name:
|
|
135
|
-
autocomplete:
|
|
136
|
-
tabindex:
|
|
130
|
+
ref: p,
|
|
131
|
+
name: l(O),
|
|
132
|
+
autocomplete: l(W),
|
|
133
|
+
tabindex: l(j),
|
|
137
134
|
type: "file",
|
|
138
|
-
multiple:
|
|
139
|
-
disabled:
|
|
140
|
-
accept:
|
|
135
|
+
multiple: o.multiple,
|
|
136
|
+
disabled: o.disabled,
|
|
137
|
+
accept: q.value,
|
|
141
138
|
class: "nmorph-native-input",
|
|
142
|
-
onChange:
|
|
143
|
-
}, null, 40,
|
|
139
|
+
onChange: Q
|
|
140
|
+
}, null, 40, Ve),
|
|
144
141
|
ae(e.$slots, "trigger", {}, () => [
|
|
145
|
-
|
|
146
|
-
text:
|
|
142
|
+
m(l(A), {
|
|
143
|
+
text: D.value,
|
|
147
144
|
fill: "",
|
|
148
|
-
disabled:
|
|
149
|
-
onClick:
|
|
145
|
+
disabled: o.disabled,
|
|
146
|
+
onClick: K
|
|
150
147
|
}, null, 8, ["text", "disabled"])
|
|
151
148
|
])
|
|
152
149
|
]),
|
|
153
|
-
|
|
154
|
-
|
|
150
|
+
s.value.length > 0 ? (r(), c("div", Ce, [
|
|
151
|
+
m(se, {
|
|
155
152
|
name: "list",
|
|
156
153
|
tag: "div"
|
|
157
154
|
}, {
|
|
158
|
-
default:
|
|
159
|
-
(
|
|
160
|
-
key:
|
|
155
|
+
default: F(() => [
|
|
156
|
+
(r(!0), c(T, null, re(s.value, ({ data: t, previewUrl: a }) => (r(), c("div", {
|
|
157
|
+
key: t.name,
|
|
161
158
|
class: "nmorph-file-upload__file"
|
|
162
159
|
}, [
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
160
|
+
H(t) ? (r(), c(T, { key: 0 }, [
|
|
161
|
+
m(l(xe), { src: a }, null, 8, ["src"]),
|
|
162
|
+
u("div", Ie, [
|
|
163
|
+
m(l(S), {
|
|
164
|
+
width: "14px",
|
|
165
|
+
height: "17px"
|
|
166
|
+
}, {
|
|
167
|
+
default: F(() => [
|
|
168
|
+
m(l(z))
|
|
169
|
+
]),
|
|
170
|
+
_: 1
|
|
171
|
+
}),
|
|
172
|
+
u("span", Be, $(t.name), 1)
|
|
173
|
+
])
|
|
174
|
+
], 64)) : l(N)(t) ? (r(), c("div", Re, [
|
|
175
|
+
m(l(S), {
|
|
169
176
|
width: "14px",
|
|
170
177
|
height: "17px"
|
|
171
178
|
}, {
|
|
172
|
-
default:
|
|
173
|
-
(
|
|
179
|
+
default: F(() => [
|
|
180
|
+
m(l(z))
|
|
174
181
|
]),
|
|
175
|
-
_:
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
]),
|
|
179
|
-
|
|
180
|
-
|
|
182
|
+
_: 1
|
|
183
|
+
}),
|
|
184
|
+
u("span", Te, $(t.name), 1)
|
|
185
|
+
])) : l(pe)(t) ? (r(), V(l(Fe), {
|
|
186
|
+
key: 2,
|
|
187
|
+
src: a,
|
|
188
|
+
name: t.name,
|
|
189
|
+
"download-href": a,
|
|
190
|
+
compact: "",
|
|
191
|
+
controls: ""
|
|
192
|
+
}, null, 8, ["src", "name", "download-href"])) : l(fe)(t) ? (r(), V(l(ge), {
|
|
193
|
+
key: 3,
|
|
194
|
+
src: a,
|
|
195
|
+
name: t.name,
|
|
196
|
+
"download-href": a,
|
|
197
|
+
compact: ""
|
|
198
|
+
}, null, 8, ["src", "name", "download-href"])) : (r(), V(l(be), {
|
|
199
|
+
key: 4,
|
|
200
|
+
name: t.name,
|
|
201
|
+
"mime-type": t.type,
|
|
202
|
+
size: t.size,
|
|
203
|
+
extension: l(P)(t.name),
|
|
204
|
+
"preview-src": a,
|
|
205
|
+
"download-href": a,
|
|
206
|
+
compact: ""
|
|
207
|
+
}, null, 8, ["name", "mime-type", "size", "extension", "preview-src", "download-href"])),
|
|
208
|
+
u("div", $e, [
|
|
209
|
+
m(l(A), {
|
|
181
210
|
height: "thin",
|
|
182
211
|
"style-type": "transparent",
|
|
183
|
-
onClick: (
|
|
212
|
+
onClick: (d) => X(t.name)
|
|
184
213
|
}, {
|
|
185
|
-
"icon-only":
|
|
186
|
-
|
|
214
|
+
"icon-only": F(() => [
|
|
215
|
+
m(l(we))
|
|
187
216
|
]),
|
|
188
217
|
_: 1
|
|
189
218
|
}, 8, ["onClick"])
|
|
@@ -192,10 +221,10 @@ const Te = { class: "nmorph-file-upload__trigger" }, Ue = ["id", "name", "autoco
|
|
|
192
221
|
]),
|
|
193
222
|
_: 1
|
|
194
223
|
})
|
|
195
|
-
])) :
|
|
224
|
+
])) : me("", !0)
|
|
196
225
|
], 6));
|
|
197
226
|
}
|
|
198
227
|
});
|
|
199
228
|
export {
|
|
200
|
-
|
|
229
|
+
Ye as default
|
|
201
230
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var p = /* @__PURE__ */ ((a) => (a.jpeg = "image/jpeg", a.jpg = "image/jpg", a.png = "image/png", a.gif = "image/gif", a["svg-xml"] = "image/svg+xml", a.webp = "image/webp", a))(p || {});
|
|
2
|
-
const
|
|
2
|
+
const g = {
|
|
3
3
|
mp4: "video/mp4",
|
|
4
4
|
webm: "video/webm",
|
|
5
5
|
"video-ogg": "video/ogg",
|
|
@@ -8,19 +8,19 @@ const d = {
|
|
|
8
8
|
*/
|
|
9
9
|
"wideo-ogg": "video/ogg"
|
|
10
10
|
};
|
|
11
|
-
var
|
|
11
|
+
var i = /* @__PURE__ */ ((a) => (a.mpeg = "audio/mpeg", a["audio-ogg"] = "audio/ogg", a.wav = "audio/wav", a))(i || {}), e = /* @__PURE__ */ ((a) => (a.pdf = "application/pdf", a.msword = "application/msword", a.docx = "application/vnd.openxmlformats-officedocument.wordprocessingml.document", a.xls = "application/vnd.ms-excel", a.xlsx = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", a.ppt = "application/vnd.ms-powerpoint", a.pptx = "application/vnd.openxmlformats-officedocument.presentationml.presentation", a.json = "application/json", a.xml = "application/xml", a))(e || {}), d = /* @__PURE__ */ ((a) => (a.zip = "application/zip", a.rar = "application/x-rar-compressed", a["7z"] = "application/x-7z-compressed", a))(d || {});
|
|
12
12
|
const n = {
|
|
13
13
|
...p,
|
|
14
|
-
...
|
|
15
|
-
...e,
|
|
14
|
+
...g,
|
|
16
15
|
...i,
|
|
17
|
-
...
|
|
16
|
+
...e,
|
|
17
|
+
...d
|
|
18
18
|
};
|
|
19
19
|
export {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
d as NmorphArchiveResolution,
|
|
21
|
+
i as NmorphAudioResolution,
|
|
22
|
+
e as NmorphDocResolution,
|
|
23
23
|
p as NmorphImageResolution,
|
|
24
|
-
|
|
24
|
+
g as NmorphVideoResolution,
|
|
25
25
|
n as resolution
|
|
26
26
|
};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { nmorphCombined as s, nmorphInset as
|
|
1
|
+
import { nmorphCombined as s, nmorphInset as r, nmorphOutset as h, title1 as l, title2 as d, title3 as c, title4 as b, body1 as e, body2 as p, body3 as a, body4 as m } from "../utils/theme-style.js";
|
|
2
2
|
const u = {
|
|
3
3
|
"nmorph-body-4": m,
|
|
4
|
-
"nmorph-body-3":
|
|
4
|
+
"nmorph-body-3": a,
|
|
5
5
|
"nmorph-body-2": p,
|
|
6
|
-
"nmorph-body-1":
|
|
6
|
+
"nmorph-body-1": e,
|
|
7
7
|
"nmorph-title-4": b,
|
|
8
8
|
"nmorph-title-3": c,
|
|
9
9
|
"nmorph-title-2": d,
|
|
10
10
|
"nmorph-title-1": l,
|
|
11
11
|
"nmorph--shadow-outset": h,
|
|
12
|
-
"nmorph--shadow-inset":
|
|
12
|
+
"nmorph--shadow-inset": r,
|
|
13
13
|
"nmorph--shadow-combined": s
|
|
14
14
|
}, w = () => {
|
|
15
|
-
let
|
|
15
|
+
let t = `
|
|
16
16
|
:root {
|
|
17
17
|
--font-size-tiny: 10px;
|
|
18
18
|
--font-size-extra-small: 12px;
|
|
@@ -112,7 +112,7 @@ const u = {
|
|
|
112
112
|
width: auto;
|
|
113
113
|
font-family: Helvetica, Roboto, Arial, sans-serif;
|
|
114
114
|
|
|
115
|
-
${
|
|
115
|
+
${e()}
|
|
116
116
|
}
|
|
117
117
|
|
|
118
118
|
h1 {
|
|
@@ -262,9 +262,89 @@ const u = {
|
|
|
262
262
|
.nmorph-scroll {
|
|
263
263
|
--thumb-color: var(--nmorph-scroll-thumb-color, var(--nmorph-text-color));
|
|
264
264
|
|
|
265
|
+
position: relative;
|
|
266
|
+
overflow: hidden;
|
|
265
267
|
color-scheme: var(--nmorph-scroll-color-scheme, light);
|
|
266
|
-
|
|
267
|
-
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
.nmorph-scroll__viewport {
|
|
271
|
+
width: 100%;
|
|
272
|
+
height: 100%;
|
|
273
|
+
box-sizing: border-box;
|
|
274
|
+
display: inherit;
|
|
275
|
+
flex-direction: inherit;
|
|
276
|
+
flex-wrap: inherit;
|
|
277
|
+
align-content: inherit;
|
|
278
|
+
align-items: inherit;
|
|
279
|
+
justify-content: inherit;
|
|
280
|
+
gap: inherit;
|
|
281
|
+
grid-auto-flow: inherit;
|
|
282
|
+
grid-template-columns: inherit;
|
|
283
|
+
grid-template-rows: inherit;
|
|
284
|
+
color-scheme: inherit;
|
|
285
|
+
scrollbar-width: none;
|
|
286
|
+
-ms-overflow-style: none;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
.nmorph-scroll__viewport::-webkit-scrollbar {
|
|
290
|
+
display: none;
|
|
291
|
+
width: 0;
|
|
292
|
+
height: 0;
|
|
293
|
+
background: transparent;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
.nmorph-scroll__bar {
|
|
297
|
+
position: absolute;
|
|
298
|
+
z-index: 1;
|
|
299
|
+
border-radius: var(--border-radius-40);
|
|
300
|
+
background: transparent;
|
|
301
|
+
${r()}
|
|
302
|
+
opacity: 0.78;
|
|
303
|
+
transition:
|
|
304
|
+
opacity ease-in-out 0.16s,
|
|
305
|
+
background-color ease-in-out 0.16s;
|
|
306
|
+
touch-action: none;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
.nmorph-scroll__bar--vertical {
|
|
310
|
+
top: 0;
|
|
311
|
+
right: 0;
|
|
312
|
+
width: var(--bar-width);
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
.nmorph-scroll__bar--horizontal {
|
|
316
|
+
right: 0;
|
|
317
|
+
bottom: 0;
|
|
318
|
+
left: 0;
|
|
319
|
+
height: var(--bar-height);
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
.nmorph-scroll__thumb {
|
|
323
|
+
position: absolute;
|
|
324
|
+
top: 0;
|
|
325
|
+
left: 0;
|
|
326
|
+
border-radius: var(--border-radius-40);
|
|
327
|
+
background-color: var(--thumb-color);
|
|
328
|
+
cursor: pointer;
|
|
329
|
+
transition: background-color ease-in-out 0.16s;
|
|
330
|
+
touch-action: none;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
.nmorph-scroll__thumb--vertical {
|
|
334
|
+
width: 100%;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
.nmorph-scroll__thumb--horizontal {
|
|
338
|
+
height: 100%;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
.nmorph-scroll--show-bars .nmorph-scroll__bar,
|
|
342
|
+
.nmorph-scroll__bar:hover {
|
|
343
|
+
opacity: 1;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
.nmorph-scroll--dragging .nmorph-scroll__thumb {
|
|
347
|
+
cursor: grabbing;
|
|
268
348
|
}
|
|
269
349
|
|
|
270
350
|
.nmorph-scroll::-webkit-scrollbar {
|
|
@@ -298,7 +378,7 @@ const u = {
|
|
|
298
378
|
|
|
299
379
|
.nmorph-scroll::-webkit-scrollbar-track {
|
|
300
380
|
border-radius: var(--border-radius-40);
|
|
301
|
-
${
|
|
381
|
+
${r()}
|
|
302
382
|
}
|
|
303
383
|
|
|
304
384
|
.nmorph-scroll::-webkit-scrollbar-thumb {
|
|
@@ -335,7 +415,7 @@ const u = {
|
|
|
335
415
|
}
|
|
336
416
|
|
|
337
417
|
.nmorph--thin-component.nmorph-native-input {
|
|
338
|
-
${
|
|
418
|
+
${a()}
|
|
339
419
|
}
|
|
340
420
|
|
|
341
421
|
.nmorph-native-input:focus {
|
|
@@ -410,12 +490,12 @@ const u = {
|
|
|
410
490
|
|
|
411
491
|
`;
|
|
412
492
|
for (const [n, i] of Object.entries(u))
|
|
413
|
-
|
|
493
|
+
t += `
|
|
414
494
|
.${n} {
|
|
415
495
|
${i()}
|
|
416
496
|
}
|
|
417
497
|
`;
|
|
418
|
-
return
|
|
498
|
+
return t;
|
|
419
499
|
}, g = () => {
|
|
420
500
|
if (typeof document > "u" || document.getElementById("nmorph-common-styles")) return;
|
|
421
501
|
const o = document.createElement("style");
|