@nmorph/nmorph-ui-kit 2.2.51 → 2.2.52
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/components/data/nmorph-file-card/NmorphFileCard.css +1 -1
- package/dist/components/data/nmorph-file-card/NmorphFileCard.vue.js +118 -86
- package/dist/components/data/nmorph-image-preview/NmorphImagePreview.css +1 -1
- package/dist/components/data/nmorph-image-preview/NmorphImagePreview.vue.js +183 -225
- package/dist/components/data/nmorph-media-gallery/NmorphMediaGallery.css +1 -0
- package/dist/components/data/nmorph-media-gallery/NmorphMediaGallery.vue.js +298 -0
- package/dist/components/data/nmorph-media-gallery/NmorphMediaGallery.vue3.js +6 -0
- package/dist/components/data/nmorph-preview-portal/NmorphPreviewPortal.css +1 -0
- package/dist/components/data/nmorph-preview-portal/NmorphPreviewPortal.vue.js +110 -0
- package/dist/components/data/nmorph-preview-portal/NmorphPreviewPortal.vue3.js +6 -0
- package/dist/components/data/nmorph-video-preview/NmorphVideoPreview.vue.js +6 -5
- package/dist/index.es.js +866 -863
- package/dist/index.umd.js +21 -21
- package/dist/outside-hooks/use-nmorph-theme.js +16 -16
- package/dist/package.json.js +1 -1
- package/dist/src/components/data/index.d.ts +2 -0
- package/dist/src/components/data/nmorph-card/NmorphCard.vue.d.ts +1 -1
- package/dist/src/components/data/nmorph-file-card/types.d.ts +1 -1
- package/dist/src/components/data/nmorph-image-preview/NmorphImagePreview.vue.d.ts +3 -3
- package/dist/src/components/data/nmorph-media-gallery/NmorphMediaGallery.vue.d.ts +26 -0
- package/dist/src/components/data/nmorph-media-gallery/types.d.ts +34 -0
- package/dist/src/components/data/nmorph-preview-portal/NmorphPreviewPortal.vue.d.ts +43 -0
- package/dist/src/components/data/nmorph-video-preview/NmorphVideoPreview.vue.d.ts +2 -1
- package/dist/src/components/data/nmorph-video-preview/types.d.ts +2 -0
- package/dist/src/components/feedback/nmorph-drawer/NmorphDrawer.vue.d.ts +1 -1
- package/dist/src/components/navigation/nmorph-dropdown/NmorphDropdown.vue.d.ts +1 -1
- package/dist/style.css +1 -1
- package/package.json +24 -23
|
@@ -23,7 +23,7 @@ const $ = {
|
|
|
23
23
|
scrollThumb: "#687b9e",
|
|
24
24
|
accent: "#4a90e2",
|
|
25
25
|
focusText: "#ffffff",
|
|
26
|
-
placeholderText: "#
|
|
26
|
+
placeholderText: "#9aa8b3",
|
|
27
27
|
semiContrastText: "#8a9dc0",
|
|
28
28
|
contrastText: "#b4c4de"
|
|
29
29
|
}, F = {
|
|
@@ -34,7 +34,7 @@ const $ = {
|
|
|
34
34
|
scrollThumb: "#778288",
|
|
35
35
|
accent: "#006cb6",
|
|
36
36
|
focusText: "#ffffff",
|
|
37
|
-
placeholderText: "#
|
|
37
|
+
placeholderText: "#68747b",
|
|
38
38
|
semiContrastText: "#9caab0",
|
|
39
39
|
contrastText: "#c3cdd1"
|
|
40
40
|
}, T = "nmorph-data-theme", R = "dark", C = {
|
|
@@ -64,8 +64,8 @@ const $ = {
|
|
|
64
64
|
}, y = (r, e) => {
|
|
65
65
|
let n = parseInt(r.substring(1, 3), 16), a = parseInt(r.substring(3, 5), 16), s = parseInt(r.substring(5, 7), 16);
|
|
66
66
|
n = Math.round(n * (1 + e / 100)), a = Math.round(a * (1 + e / 100)), s = Math.round(s * (1 + e / 100)), n = Math.min(255, Math.max(0, n)), a = Math.min(255, Math.max(0, a)), s = Math.min(255, Math.max(0, s));
|
|
67
|
-
const
|
|
68
|
-
return `#${
|
|
67
|
+
const i = n.toString(16).padStart(2, "0"), c = a.toString(16).padStart(2, "0"), l = s.toString(16).padStart(2, "0");
|
|
68
|
+
return `#${i}${c}${l}`;
|
|
69
69
|
}, G = (r) => ({
|
|
70
70
|
themes: r?.themes ?? C.themes,
|
|
71
71
|
defaultTheme: r?.defaultTheme ?? C.defaultTheme,
|
|
@@ -87,14 +87,14 @@ const $ = {
|
|
|
87
87
|
name: `--nmorph-${E(e)}-color`,
|
|
88
88
|
color: n
|
|
89
89
|
})), P = (r, e) => {
|
|
90
|
-
const n = (
|
|
91
|
-
return Object.entries(r).forEach(([
|
|
90
|
+
const n = (i) => i.map((c) => `${c.name}: ${c.color};`).join(" "), a = Object.entries(e).map(([i, c]) => `--${E(i)}: ${c};`).join(" "), s = [];
|
|
91
|
+
return Object.entries(r).forEach(([i, c]) => {
|
|
92
92
|
const l = x($);
|
|
93
|
-
if (
|
|
93
|
+
if (i === "common") s.push(n(A(l, c)));
|
|
94
94
|
else {
|
|
95
95
|
const S = `
|
|
96
|
-
&[${T}='${
|
|
97
|
-
${n(
|
|
96
|
+
&[${T}='${i}'] {
|
|
97
|
+
${n(c)}
|
|
98
98
|
}
|
|
99
99
|
`;
|
|
100
100
|
s.push(S);
|
|
@@ -109,8 +109,8 @@ const $ = {
|
|
|
109
109
|
const e = {};
|
|
110
110
|
return Object.entries(r.themes).forEach(([n, a]) => {
|
|
111
111
|
e[n] = [];
|
|
112
|
-
const s = !!a.darkShade,
|
|
113
|
-
!!a.main && !s && !
|
|
112
|
+
const s = !!a.darkShade, i = !!a.lightShade;
|
|
113
|
+
!!a.main && !s && !i && a.main && (e[n] = x(N(r, a.main))), e[n] = [...e[n], ...x(a)];
|
|
114
114
|
}), e;
|
|
115
115
|
}, J = (r) => {
|
|
116
116
|
const e = G(r);
|
|
@@ -133,7 +133,7 @@ const $ = {
|
|
|
133
133
|
}, s = (o) => Object.entries(o).filter(([, t]) => typeof t == "string").map(([t, h]) => ({
|
|
134
134
|
name: `--nmorph-${E(t)}-color`,
|
|
135
135
|
color: h
|
|
136
|
-
})),
|
|
136
|
+
})), i = (o, t) => {
|
|
137
137
|
const h = (f) => f.map((u) => `${u.name}: ${u.color};`).join(" "), m = Object.entries(t).map(([f, u]) => `--${E(f)}: ${u};`).join(" "), b = [];
|
|
138
138
|
return Object.entries(o).forEach(([f, u]) => {
|
|
139
139
|
const k = s($);
|
|
@@ -152,7 +152,7 @@ const $ = {
|
|
|
152
152
|
${m}
|
|
153
153
|
}
|
|
154
154
|
`;
|
|
155
|
-
},
|
|
155
|
+
}, c = (o) => {
|
|
156
156
|
const t = {};
|
|
157
157
|
return Object.entries(o).forEach(([h, m]) => {
|
|
158
158
|
t[h] = [];
|
|
@@ -160,10 +160,10 @@ const $ = {
|
|
|
160
160
|
!!m.main && !b && !f && m.main && (t[h] = a(m.main)), t[h] = [...t[h], ...s(m)];
|
|
161
161
|
}), t;
|
|
162
162
|
}, l = typeof document < "u", S = H(e.defaultTheme);
|
|
163
|
-
let g =
|
|
164
|
-
l && (d = document.getElementById("nmorph-theme-styles"), d || (d = document.createElement("style"), d.id = "nmorph-theme-styles", d.type = "text/css", document.head.appendChild(d)), d.innerHTML =
|
|
163
|
+
let g = c(e.themes), d = null;
|
|
164
|
+
l && (d = document.getElementById("nmorph-theme-styles"), d || (d = document.createElement("style"), d.id = "nmorph-theme-styles", d.type = "text/css", document.head.appendChild(d)), d.innerHTML = i(g, e.other));
|
|
165
165
|
const D = () => {
|
|
166
|
-
g =
|
|
166
|
+
g = c(e.themes), d && (d.innerHTML = i(g, e.other));
|
|
167
167
|
}, p = (o) => {
|
|
168
168
|
S.value = o, l && (document.documentElement.setAttribute(T, S.value), !(typeof localStorage > "u") && (e.saveCurrentThemeToLS ? localStorage.setItem(T, o) : localStorage.removeItem(T)));
|
|
169
169
|
}, M = (o, t) => {
|
package/dist/package.json.js
CHANGED
|
@@ -23,6 +23,8 @@ export * from './nmorph-file-card/types';
|
|
|
23
23
|
export { default as NmorphImage } from './nmorph-image/NmorphImage.vue';
|
|
24
24
|
export { default as NmorphImagePreview } from './nmorph-image-preview/NmorphImagePreview.vue';
|
|
25
25
|
export * from './nmorph-image-preview/types';
|
|
26
|
+
export { default as NmorphMediaGallery } from './nmorph-media-gallery/NmorphMediaGallery.vue';
|
|
27
|
+
export * from './nmorph-media-gallery/types';
|
|
26
28
|
export { default as NmorphMediaTile } from './nmorph-media-tile/NmorphMediaTile.vue';
|
|
27
29
|
export * from './nmorph-media-tile/types';
|
|
28
30
|
export { default as NmorphPagination } from './nmorph-pagination/NmorphPagination.vue';
|
|
@@ -3,13 +3,13 @@ import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOp
|
|
|
3
3
|
declare const _default: __VLS_WithTemplateSlots< DefineComponent<INmorphCardProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<INmorphCardProps> & Readonly<{}>, {
|
|
4
4
|
fill: boolean;
|
|
5
5
|
tag: string;
|
|
6
|
+
contentClass: string;
|
|
6
7
|
radius: string | number;
|
|
7
8
|
shadowType: "inset" | "outset" | "combined" | "not-defined";
|
|
8
9
|
combinedShadowBorderWidth: number;
|
|
9
10
|
cardPadding: string | number;
|
|
10
11
|
padding: string | number;
|
|
11
12
|
contentPadding: string | number;
|
|
12
|
-
contentClass: string;
|
|
13
13
|
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>, any>;
|
|
14
14
|
export default _default;
|
|
15
15
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type NmorphFileCardSurface = 'card' | 'soft' | 'plain';
|
|
2
|
-
export type NmorphFileCardMediaPreview = 'none' | 'audio' | 'video';
|
|
2
|
+
export type NmorphFileCardMediaPreview = 'none' | 'audio' | 'video' | 'image';
|
|
3
3
|
export interface INmorphFileCardProps {
|
|
4
4
|
name: string;
|
|
5
5
|
extension?: string;
|
|
@@ -9,18 +9,18 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<INmorphImagePre
|
|
|
9
9
|
modelValue: boolean;
|
|
10
10
|
height: string | number;
|
|
11
11
|
width: string | number;
|
|
12
|
+
zIndex: number;
|
|
13
|
+
navigationButtonMargin: string | number;
|
|
14
|
+
showActionBar: boolean;
|
|
12
15
|
alt: string;
|
|
13
16
|
initialIndex: number;
|
|
14
17
|
scaleStep: number;
|
|
15
18
|
minScaleLevel: number;
|
|
16
19
|
maxScaleLevel: number;
|
|
17
|
-
zIndex: number;
|
|
18
20
|
showTrigger: boolean;
|
|
19
21
|
showNavigationButtons: boolean;
|
|
20
|
-
showActionBar: boolean;
|
|
21
22
|
radius: string | number;
|
|
22
23
|
fit: NmorphImagePreviewFit;
|
|
23
|
-
navigationButtonMargin: string | number;
|
|
24
24
|
triggerView: NmorphImagePreviewTriggerView;
|
|
25
25
|
triggerLimit: number;
|
|
26
26
|
triggerGap: string | number;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { INmorphMediaGalleryProps, NmorphMediaGalleryItem } from './types';
|
|
2
|
+
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
3
|
+
import { NmorphMediaGalleryFit } from '../..';
|
|
4
|
+
declare const _default: DefineComponent<INmorphMediaGalleryProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
|
|
5
|
+
"update:model-value": (value: boolean) => any;
|
|
6
|
+
change: (item: NmorphMediaGalleryItem, index: number) => any;
|
|
7
|
+
close: () => any;
|
|
8
|
+
"update:active-index": (value: number) => any;
|
|
9
|
+
}, string, PublicProps, Readonly<INmorphMediaGalleryProps> & Readonly<{
|
|
10
|
+
"onUpdate:model-value"?: (value: boolean) => any;
|
|
11
|
+
onChange?: (item: NmorphMediaGalleryItem, index: number) => any;
|
|
12
|
+
onClose?: () => any;
|
|
13
|
+
"onUpdate:active-index"?: (value: number) => any;
|
|
14
|
+
}>, {
|
|
15
|
+
modelValue: boolean;
|
|
16
|
+
zIndex: number;
|
|
17
|
+
showActionBar: boolean;
|
|
18
|
+
initialIndex: number;
|
|
19
|
+
showNavigationButtons: boolean;
|
|
20
|
+
activeIndex: number;
|
|
21
|
+
imageFit: NmorphMediaGalleryFit;
|
|
22
|
+
videoFit: NmorphMediaGalleryFit;
|
|
23
|
+
}, {}, {}, {}, string, ComponentProvideOptions, false, {
|
|
24
|
+
currentVideoRef: HTMLVideoElement;
|
|
25
|
+
}, any>;
|
|
26
|
+
export default _default;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export type NmorphMediaGalleryFit = 'cover' | 'contain';
|
|
2
|
+
export type NmorphMediaGalleryVideoPreload = 'none' | 'metadata' | 'auto';
|
|
3
|
+
export type NmorphMediaGalleryItem = {
|
|
4
|
+
kind: 'image';
|
|
5
|
+
src: string;
|
|
6
|
+
name?: string;
|
|
7
|
+
alt?: string;
|
|
8
|
+
} | {
|
|
9
|
+
kind: 'video';
|
|
10
|
+
src: string;
|
|
11
|
+
name?: string;
|
|
12
|
+
poster?: string;
|
|
13
|
+
controls?: boolean;
|
|
14
|
+
muted?: boolean;
|
|
15
|
+
playsinline?: boolean;
|
|
16
|
+
preload?: NmorphMediaGalleryVideoPreload;
|
|
17
|
+
};
|
|
18
|
+
export interface INmorphMediaGalleryProps {
|
|
19
|
+
modelValue?: boolean;
|
|
20
|
+
items: NmorphMediaGalleryItem[];
|
|
21
|
+
initialIndex?: number;
|
|
22
|
+
activeIndex?: number;
|
|
23
|
+
zIndex?: number;
|
|
24
|
+
showNavigationButtons?: boolean;
|
|
25
|
+
showActionBar?: boolean;
|
|
26
|
+
imageFit?: NmorphMediaGalleryFit;
|
|
27
|
+
videoFit?: NmorphMediaGalleryFit;
|
|
28
|
+
}
|
|
29
|
+
export interface INmorphMediaGalleryEmit {
|
|
30
|
+
(e: 'update:model-value', value: boolean): void;
|
|
31
|
+
(e: 'update:active-index', value: number): void;
|
|
32
|
+
(e: 'close'): void;
|
|
33
|
+
(e: 'change', item: NmorphMediaGalleryItem, index: number): void;
|
|
34
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
show: boolean;
|
|
4
|
+
zIndex?: number;
|
|
5
|
+
rootClass?: string;
|
|
6
|
+
stateClass?: string;
|
|
7
|
+
contentClass?: string;
|
|
8
|
+
leftClass?: string;
|
|
9
|
+
rightClass?: string;
|
|
10
|
+
actionsClass?: string;
|
|
11
|
+
navigationButtonMargin?: number | string;
|
|
12
|
+
showNavigation?: boolean;
|
|
13
|
+
showActionBar?: boolean;
|
|
14
|
+
};
|
|
15
|
+
declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
|
|
16
|
+
close: () => any;
|
|
17
|
+
previous: () => any;
|
|
18
|
+
next: () => any;
|
|
19
|
+
}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
20
|
+
onClose?: () => any;
|
|
21
|
+
onPrevious?: () => any;
|
|
22
|
+
onNext?: () => any;
|
|
23
|
+
}>, {
|
|
24
|
+
zIndex: number;
|
|
25
|
+
rootClass: string;
|
|
26
|
+
stateClass: string;
|
|
27
|
+
contentClass: string;
|
|
28
|
+
leftClass: string;
|
|
29
|
+
rightClass: string;
|
|
30
|
+
actionsClass: string;
|
|
31
|
+
navigationButtonMargin: string | number;
|
|
32
|
+
showNavigation: boolean;
|
|
33
|
+
showActionBar: boolean;
|
|
34
|
+
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>, {
|
|
35
|
+
default?(_: {}): any;
|
|
36
|
+
actions?(_: {}): any;
|
|
37
|
+
}>;
|
|
38
|
+
export default _default;
|
|
39
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
40
|
+
new (): {
|
|
41
|
+
$slots: S;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { INmorphVideoPreviewProps } from './types';
|
|
2
2
|
import { DefineComponent, Ref, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
3
|
-
import { NmorphVideoPreviewFit, NmorphVideoPreviewSurface } from '../..';
|
|
3
|
+
import { NmorphVideoPreviewFit, NmorphVideoPreviewSurface, NmorphVideoPreviewPreviewMode } from '../..';
|
|
4
4
|
declare const _default: __VLS_WithTemplateSlots< DefineComponent<INmorphVideoPreviewProps, {
|
|
5
5
|
videoRef: Ref<HTMLVideoElement, HTMLVideoElement>;
|
|
6
6
|
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
|
|
@@ -41,6 +41,7 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<INmorphVideoPre
|
|
|
41
41
|
playsinline: boolean;
|
|
42
42
|
showPreviewAction: boolean;
|
|
43
43
|
showFullscreenAction: boolean;
|
|
44
|
+
previewMode: NmorphVideoPreviewPreviewMode;
|
|
44
45
|
}, {}, {}, {}, string, ComponentProvideOptions, false, {
|
|
45
46
|
videoRef: HTMLVideoElement;
|
|
46
47
|
}, any>, {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export type NmorphVideoPreviewFit = 'cover' | 'contain';
|
|
2
2
|
export type NmorphVideoPreviewSurface = 'card' | 'soft' | 'plain';
|
|
3
|
+
export type NmorphVideoPreviewPreviewMode = 'internal' | 'emit';
|
|
3
4
|
export interface INmorphVideoPreviewProps {
|
|
4
5
|
src: string;
|
|
5
6
|
poster?: string;
|
|
@@ -23,6 +24,7 @@ export interface INmorphVideoPreviewProps {
|
|
|
23
24
|
showDefaultActions?: boolean;
|
|
24
25
|
showPreviewAction?: boolean;
|
|
25
26
|
showFullscreenAction?: boolean;
|
|
27
|
+
previewMode?: NmorphVideoPreviewPreviewMode;
|
|
26
28
|
}
|
|
27
29
|
export interface INmorphVideoPreviewEmit {
|
|
28
30
|
(e: 'play', val: Event): void;
|
|
@@ -11,10 +11,10 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<INmorphDrawerPr
|
|
|
11
11
|
modelValue: boolean;
|
|
12
12
|
size: string | number;
|
|
13
13
|
zIndex: number;
|
|
14
|
+
contentClass: string;
|
|
14
15
|
teleportTo: string | HTMLElement;
|
|
15
16
|
disabledTeleport: boolean;
|
|
16
17
|
closeOnEscape: boolean;
|
|
17
|
-
contentClass: string;
|
|
18
18
|
showClose: boolean;
|
|
19
19
|
closeOnOverlay: boolean;
|
|
20
20
|
placement: NmorphDrawerPlacementType;
|
|
@@ -12,11 +12,11 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<INmorphDropdown
|
|
|
12
12
|
ariaLabel: string;
|
|
13
13
|
minWidth: string | number;
|
|
14
14
|
zIndex: number;
|
|
15
|
+
contentClass: string;
|
|
15
16
|
closeOnEscape: boolean;
|
|
16
17
|
trapFocus: boolean;
|
|
17
18
|
restoreFocus: boolean;
|
|
18
19
|
role: string;
|
|
19
|
-
contentClass: string;
|
|
20
20
|
hideShadow: boolean;
|
|
21
21
|
placement: NmorphPlacementType;
|
|
22
22
|
yOffset: number;
|