@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/README.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
# Neumorphic UI Library for Vue 3
|
|
1
|
+
# Neumorphic UI Library for Vue 3 and Nuxt
|
|
2
2
|
|
|
3
3
|
## Overview
|
|
4
4
|
|
|
5
|
-
This is a UI component library for Vue 3, designed using the neumorphism/skeuomorphism style. It offers a set
|
|
6
|
-
components for creating unique user interfaces with a modern, 3D-like appearance.
|
|
5
|
+
This is a UI component library for Vue 3 and Nuxt, designed using the neumorphism/skeuomorphism style. It offers a set
|
|
6
|
+
of simple components for creating unique user interfaces with a modern, 3D-like appearance.
|
|
7
7
|
|
|
8
8
|
### What is Neumorphism/Skeuomorphism?
|
|
9
9
|
|
|
@@ -19,8 +19,7 @@ its stability, fixing bugs, and ensuring high-quality components.
|
|
|
19
19
|
If you encounter any issues, please don't hesitate to report them. Your feedback is highly appreciated and will help
|
|
20
20
|
enhance the library.
|
|
21
21
|
|
|
22
|
-
**Documentation:** For detailed instructions and examples, visit the
|
|
23
|
-
[official documentation site](https://nmorph.dev).
|
|
22
|
+
**Documentation:** For detailed instructions and examples, visit the [official documentation site](https://nmorph.dev).
|
|
24
23
|
|
|
25
24
|
---
|
|
26
25
|
|
|
@@ -29,14 +28,17 @@ enhance the library.
|
|
|
29
28
|
- **Neumorphic Design:** 3D-like components with soft shadows and smooth gradients.
|
|
30
29
|
- **Customizable Themes:** Easily modify the base color, text color, and accent color to match your application's
|
|
31
30
|
design.
|
|
32
|
-
- **
|
|
31
|
+
- **Vue and Nuxt Support:** Use the library in Vue 3 apps or through the Nuxt module.
|
|
32
|
+
- **Nuxt SSR Support:** The Nuxt module installs a universal plugin so component markup can render during SSR while
|
|
33
|
+
browser-only theme and measurement effects run on the client.
|
|
34
|
+
- **Lightweight and Intuitive:** Simple integration with modern tools like Vite, Nuxt, and Composition API.
|
|
33
35
|
|
|
34
36
|
---
|
|
35
37
|
|
|
36
38
|
## Requirements
|
|
37
39
|
|
|
38
40
|
- **Node.js:** Version 18.13.0 or higher is required to use this library.
|
|
39
|
-
- **Vue 3:** Ensure your project is set up with Vue 3
|
|
41
|
+
- **Vue 3 or Nuxt:** Ensure your project is set up with Vue 3 or Nuxt 3 for best compatibility.
|
|
40
42
|
|
|
41
43
|
---
|
|
42
44
|
|
|
@@ -45,6 +47,8 @@ enhance the library.
|
|
|
45
47
|
- Neumorphism
|
|
46
48
|
- Skeuomorphism
|
|
47
49
|
- Vue 3
|
|
50
|
+
- Nuxt
|
|
51
|
+
- Nuxt Module
|
|
48
52
|
- UI Components
|
|
49
53
|
- Neumorphic Design
|
|
50
54
|
- Customizable Themes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.nmorph-icon{width:var(--width);min-width:var(--width);height:var(--height);min-height:var(--height);display:flex;align-items:center;--color: var(--nmorph-icon-color)}.nmorph-icon .nmorph-icon__content{display:flex;align-items:center;justify-content:center;width:var(--width);min-width:var(--width);height:var(--height);min-height:var(--height)}.nmorph-icon svg{width:100%;height:100%;fill:var(--color);stroke-width:0}.nmorph-icon path{stroke:var(--color)}.nmorph-icon.nmorph-icon--small{--width: 14px;--height: 14px}.nmorph-icon.nmorph-icon--medium{--width: 20px;--height: 20px}.nmorph-icon.nmorph-icon--large{--width: 32px;--height: 32px}
|
|
1
|
+
.nmorph-icon{width:var(--width);min-width:var(--width);height:var(--height);min-height:var(--height);display:flex;align-items:center;--color: var(--nmorph-icon-color, var(--nmorph-text-color))}.nmorph-icon .nmorph-icon__content{display:flex;align-items:center;justify-content:center;width:var(--width);min-width:var(--width);height:var(--height);min-height:var(--height)}.nmorph-icon svg{width:100%;height:100%;fill:var(--color);stroke-width:0}.nmorph-icon path{stroke:var(--color)}.nmorph-icon.nmorph-icon--small{--width: 14px;--height: 14px}.nmorph-icon.nmorph-icon--medium{--width: 20px;--height: 20px}.nmorph-icon.nmorph-icon--large{--width: 32px;--height: 32px}
|
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
import './NmorphIcon.css';
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
import { useModifiers as
|
|
4
|
-
const
|
|
2
|
+
import { defineComponent as h, computed as i } from "vue";
|
|
3
|
+
import { useModifiers as l } from "../../../utils/create-modifiers.js";
|
|
4
|
+
const p = /* @__PURE__ */ h({
|
|
5
5
|
__name: "NmorphIcon",
|
|
6
6
|
props: {
|
|
7
7
|
size: { type: null, required: !1, default: "small" },
|
|
8
8
|
width: { type: String, required: !1, default: void 0 },
|
|
9
9
|
height: { type: String, required: !1, default: void 0 },
|
|
10
|
-
color: { type: String, required: !1, default:
|
|
10
|
+
color: { type: String, required: !1, default: void 0 }
|
|
11
11
|
},
|
|
12
12
|
setup(r, { expose: s }) {
|
|
13
13
|
s();
|
|
14
|
-
const e = r,
|
|
15
|
-
() =>
|
|
14
|
+
const e = r, d = i(
|
|
15
|
+
() => l({
|
|
16
16
|
"nmorph-icon": [
|
|
17
17
|
`${!e.width && !e.height && e.size}`,
|
|
18
18
|
`${e.width && "custom-width"}`,
|
|
19
19
|
`${e.height && "custom-height"}`
|
|
20
20
|
]
|
|
21
21
|
})
|
|
22
|
-
),
|
|
22
|
+
), n = i(() => {
|
|
23
23
|
const t = {};
|
|
24
|
-
return e.width && (t["--width"] = e.width), e.height && (t["--height"] = e.height), t["--nmorph-icon-color"] = e.color, t;
|
|
25
|
-
}),
|
|
26
|
-
return Object.defineProperty(
|
|
24
|
+
return e.width && (t["--width"] = e.width), e.height && (t["--height"] = e.height), e.color && (t["--nmorph-icon-color"] = e.color, t["--color"] = e.color), t;
|
|
25
|
+
}), o = { props: e, modifiers: d, customStyles: n };
|
|
26
|
+
return Object.defineProperty(o, "__isScriptSetup", { enumerable: !1, value: !0 }), o;
|
|
27
27
|
}
|
|
28
28
|
});
|
|
29
29
|
export {
|
|
30
|
-
|
|
30
|
+
p as default
|
|
31
31
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.nmorph-avatar--preview:hover>.nmorph-image{filter:brightness(.8)}
|
|
@@ -1,43 +1,56 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import h from "
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import './NmorphAvatar.css';
|
|
2
|
+
import p from "./NmorphAvatar.vue2.js";
|
|
3
|
+
import { openBlock as e, createElementBlock as l, normalizeStyle as n, normalizeClass as h, createVNode as a, withCtx as o, renderSlot as t, toDisplayString as s, createBlock as i, resolveDynamicComponent as d, createCommentVNode as v } from "vue";
|
|
4
|
+
/* empty css */
|
|
5
|
+
import S from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
6
|
+
function w(c, m, _, r, y, I) {
|
|
7
|
+
return e(), l(
|
|
7
8
|
"div",
|
|
8
9
|
{
|
|
9
|
-
class:
|
|
10
|
-
style:
|
|
11
|
-
onClick:
|
|
10
|
+
class: h(r.modifiers),
|
|
11
|
+
style: n(r.styles),
|
|
12
|
+
onClick: r.openPreview
|
|
12
13
|
},
|
|
13
14
|
[
|
|
14
|
-
|
|
15
|
-
fit:
|
|
16
|
-
src:
|
|
17
|
-
"src-set":
|
|
18
|
-
alt:
|
|
15
|
+
a(r.NmorphImage, {
|
|
16
|
+
fit: r.props.fit,
|
|
17
|
+
src: r.imageSrc,
|
|
18
|
+
"src-set": r.props.srcSet,
|
|
19
|
+
alt: r.props.alt,
|
|
19
20
|
"frame-border": 0,
|
|
20
|
-
onLoad:
|
|
21
|
-
onError:
|
|
21
|
+
onLoad: r.onImageLoad,
|
|
22
|
+
onError: r.onImageError
|
|
22
23
|
}, {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
loading: o(() => [
|
|
25
|
+
a(r.NmorphIcon, {
|
|
26
|
+
size: "small",
|
|
27
|
+
color: "var(--nmorph-accent-color)"
|
|
28
|
+
}, {
|
|
29
|
+
default: o(() => [
|
|
30
|
+
a(r.NmorphIconLoader)
|
|
31
|
+
]),
|
|
32
|
+
_: 1
|
|
33
|
+
/* STABLE */
|
|
34
|
+
})
|
|
35
|
+
]),
|
|
36
|
+
error: o(() => [
|
|
37
|
+
t(c.$slots, "error", {}, () => [
|
|
38
|
+
r.initials ? (e(), l(
|
|
26
39
|
"span",
|
|
27
40
|
{
|
|
28
41
|
key: 0,
|
|
29
42
|
class: "nmorph-avatar__initials",
|
|
30
|
-
style:
|
|
43
|
+
style: n({ fontSize: r.initialsFontSize })
|
|
31
44
|
},
|
|
32
|
-
|
|
45
|
+
s(r.initials),
|
|
33
46
|
5
|
|
34
47
|
/* TEXT, STYLE */
|
|
35
|
-
)) : (
|
|
48
|
+
)) : (e(), i(r.NmorphIcon, {
|
|
36
49
|
key: 1,
|
|
37
|
-
width:
|
|
50
|
+
width: r.stubIconSize
|
|
38
51
|
}, {
|
|
39
|
-
default:
|
|
40
|
-
(
|
|
52
|
+
default: o(() => [
|
|
53
|
+
(e(), i(d(r.fallback)))
|
|
41
54
|
]),
|
|
42
55
|
_: 1
|
|
43
56
|
/* STABLE */
|
|
@@ -47,46 +60,61 @@ function y(n, t, k, e, I, g) {
|
|
|
47
60
|
_: 3
|
|
48
61
|
/* FORWARDED */
|
|
49
62
|
}, 8, ["fit", "src", "src-set", "alt"]),
|
|
50
|
-
|
|
51
|
-
|
|
63
|
+
r.imageSrc ? v("v-if", !0) : t(c.$slots, "error", { key: 0 }, () => [
|
|
64
|
+
r.initials ? (e(), l(
|
|
52
65
|
"span",
|
|
53
66
|
{
|
|
54
67
|
key: 0,
|
|
55
68
|
class: "nmorph-avatar__initials",
|
|
56
|
-
style:
|
|
69
|
+
style: n({ fontSize: r.initialsFontSize })
|
|
57
70
|
},
|
|
58
|
-
|
|
71
|
+
s(r.initials),
|
|
59
72
|
5
|
|
60
73
|
/* TEXT, STYLE */
|
|
61
|
-
)) : (
|
|
74
|
+
)) : (e(), i(r.NmorphIcon, {
|
|
62
75
|
key: 1,
|
|
63
|
-
width:
|
|
76
|
+
width: r.stubIconSize
|
|
64
77
|
}, {
|
|
65
|
-
default:
|
|
66
|
-
(
|
|
78
|
+
default: o(() => [
|
|
79
|
+
(e(), i(d(r.fallback)))
|
|
67
80
|
]),
|
|
68
81
|
_: 1
|
|
69
82
|
/* STABLE */
|
|
70
83
|
}, 8, ["width"]))
|
|
71
84
|
]),
|
|
72
|
-
|
|
85
|
+
r.previewAvailable ? (e(), i(r.NmorphImagePreview, {
|
|
73
86
|
key: 1,
|
|
74
|
-
|
|
75
|
-
"model-value":
|
|
76
|
-
src:
|
|
77
|
-
alt:
|
|
78
|
-
"initial-index":
|
|
79
|
-
"scale-step":
|
|
80
|
-
"min-scale-level":
|
|
81
|
-
"max-scale-level":
|
|
82
|
-
"onUpdate:modelValue":
|
|
83
|
-
},
|
|
87
|
+
"show-trigger": !1,
|
|
88
|
+
"model-value": r.previewOpen,
|
|
89
|
+
src: r.imagePreviewSrc,
|
|
90
|
+
alt: r.props.alt,
|
|
91
|
+
"initial-index": r.props.previewInitialIndex,
|
|
92
|
+
"scale-step": r.props.previewScaleStep,
|
|
93
|
+
"min-scale-level": r.props.previewMinScaleLevel,
|
|
94
|
+
"max-scale-level": r.props.previewMaxScaleLevel,
|
|
95
|
+
"onUpdate:modelValue": m[0] || (m[0] = (f) => r.previewOpen = f)
|
|
96
|
+
}, {
|
|
97
|
+
loading: o(() => [
|
|
98
|
+
a(r.NmorphIcon, {
|
|
99
|
+
size: "small",
|
|
100
|
+
color: "var(--nmorph-accent-color)"
|
|
101
|
+
}, {
|
|
102
|
+
default: o(() => [
|
|
103
|
+
a(r.NmorphIconLoader)
|
|
104
|
+
]),
|
|
105
|
+
_: 1
|
|
106
|
+
/* STABLE */
|
|
107
|
+
})
|
|
108
|
+
]),
|
|
109
|
+
_: 1
|
|
110
|
+
/* STABLE */
|
|
111
|
+
}, 8, ["model-value", "src", "alt", "initial-index", "scale-step", "min-scale-level", "max-scale-level"])) : v("v-if", !0)
|
|
84
112
|
],
|
|
85
113
|
6
|
|
86
114
|
/* CLASS, STYLE */
|
|
87
115
|
);
|
|
88
116
|
}
|
|
89
|
-
const
|
|
117
|
+
const b = /* @__PURE__ */ S(p, [["render", w], ["__file", "/builds/ketjo/nmorph/library/src/components/data/nmorph-avatar/NmorphAvatar.vue"]]);
|
|
90
118
|
export {
|
|
91
|
-
|
|
119
|
+
b as default
|
|
92
120
|
};
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import
|
|
1
|
+
import './NmorphAvatar.css';
|
|
2
|
+
import { defineComponent as $, ref as z, computed as a } from "vue";
|
|
2
3
|
import { useModifiers as B } from "../../../utils/create-modifiers.js";
|
|
4
|
+
import L from "../nmorph-image-preview/NmorphImagePreview.vue.js";
|
|
3
5
|
import v from "../../../assets/icons/avatar.svg.js";
|
|
4
|
-
import M from "
|
|
5
|
-
import k from "
|
|
6
|
-
|
|
6
|
+
import M from "../../../assets/icons/loader.svg.js";
|
|
7
|
+
import k from "../../basic/nmorph-icon/NmorphIcon.vue.js";
|
|
8
|
+
import C from "../nmorph-image/NmorphImage.vue.js";
|
|
9
|
+
const J = /* @__PURE__ */ $({
|
|
7
10
|
__name: "NmorphAvatar",
|
|
8
11
|
props: {
|
|
9
12
|
src: { type: [String, Array], required: !1 },
|
|
@@ -24,46 +27,48 @@ const U = /* @__PURE__ */ z({
|
|
|
24
27
|
alt: { type: String, required: !1 }
|
|
25
28
|
},
|
|
26
29
|
emits: ["error", "load"],
|
|
27
|
-
setup(g, { expose:
|
|
28
|
-
|
|
29
|
-
const r = g,
|
|
30
|
-
|
|
30
|
+
setup(g, { expose: h, emit: y }) {
|
|
31
|
+
h();
|
|
32
|
+
const r = g, o = y, S = (e) => {
|
|
33
|
+
o("error", e);
|
|
31
34
|
}, w = (e) => {
|
|
32
|
-
|
|
33
|
-
}, l =
|
|
35
|
+
o("load", e);
|
|
36
|
+
}, l = z(!1), p = (e, t = 0) => Array.isArray(e) ? e[t] : e, u = a(() => `${r.imagePadding}px`), i = a(() => `${r.size}px`), b = a(() => p(r.src)), n = a(() => r.previewSrc || r.src), m = a(() => {
|
|
34
37
|
const e = n.value;
|
|
35
38
|
return Array.isArray(e) ? e.length > 0 : !!e;
|
|
36
39
|
}), q = a(() => {
|
|
37
40
|
const e = n.value;
|
|
38
41
|
return Array.isArray(e) ? e : e || "";
|
|
39
|
-
}),
|
|
42
|
+
}), s = a(() => r.preview && m.value), N = a(
|
|
40
43
|
() => B({
|
|
41
44
|
nmorph: [`${r.frameBorder > 0 && "shadow-combined"}`],
|
|
42
|
-
"nmorph-avatar": [r.shape, `${
|
|
45
|
+
"nmorph-avatar": [r.shape, `${s.value && "preview"}`]
|
|
43
46
|
})
|
|
44
|
-
),
|
|
47
|
+
), I = a(() => `${r.size / 100 * 60}px`), x = a(() => `${Math.max(12, r.size * 0.38)}px`), c = a(() => r.shape === "circle" ? "50%" : "4px"), d = a(() => r.shape === "circle" ? "50%" : "2px"), A = a(() => ({
|
|
45
48
|
width: i.value,
|
|
46
49
|
height: i.value,
|
|
47
50
|
"--nmorph-avatar-size": i.value,
|
|
48
|
-
"--nmorph-avatar-image-padding":
|
|
49
|
-
"--nmorph-avatar-radius":
|
|
51
|
+
"--nmorph-avatar-image-padding": u.value,
|
|
52
|
+
"--nmorph-avatar-radius": c.value,
|
|
50
53
|
"--nmorph-avatar-image-radius": d.value,
|
|
51
54
|
"--nmorph-avatar-frame-border": `${r.frameBorder}px`
|
|
52
|
-
})), _ = a(() => r.fallback || v),
|
|
55
|
+
})), _ = a(() => r.fallback || v), P = a(() => {
|
|
53
56
|
const e = r.name.trim();
|
|
54
57
|
if (!e) return "";
|
|
55
58
|
const t = e.split(/\s+/);
|
|
56
59
|
return (t.length > 1 ? `${t[0][0]}${t[t.length - 1][0]}` : t[0].slice(0, 2)).toUpperCase();
|
|
57
|
-
}), f = { props: r, emit:
|
|
58
|
-
|
|
60
|
+
}), f = { props: r, emit: o, onImageError: S, onImageLoad: w, previewOpen: l, getSourceByIndex: p, imagePadding: u, size: i, imageSrc: b, previewSource: n, hasPreviewSource: m, imagePreviewSrc: q, previewAvailable: s, modifiers: N, stubIconSize: I, initialsFontSize: x, radius: c, imageRadius: d, styles: A, fallback: _, initials: P, openPreview: () => {
|
|
61
|
+
s.value && (l.value = !0);
|
|
59
62
|
}, get NmorphImage() {
|
|
60
|
-
return
|
|
63
|
+
return C;
|
|
61
64
|
}, get NmorphIcon() {
|
|
65
|
+
return k;
|
|
66
|
+
}, get NmorphIconLoader() {
|
|
62
67
|
return M;
|
|
63
|
-
} };
|
|
68
|
+
}, NmorphImagePreview: L };
|
|
64
69
|
return Object.defineProperty(f, "__isScriptSetup", { enumerable: !1, value: !0 }), f;
|
|
65
70
|
}
|
|
66
71
|
});
|
|
67
72
|
export {
|
|
68
|
-
|
|
73
|
+
J as default
|
|
69
74
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { defineComponent as y, ref as a, computed as v, provide as j, reactive as k, onMounted as x, nextTick as E, watch as O } from "vue";
|
|
2
2
|
import { useModifiers as D } from "../../../utils/create-modifiers.js";
|
|
3
3
|
import { generateUUID as w } from "../../../utils/common.js";
|
|
4
|
-
import A from "
|
|
5
|
-
import M from "
|
|
4
|
+
import A from "../../basic/nmorph-icon/NmorphIcon.vue.js";
|
|
5
|
+
import M from "../../../assets/icons/chevron-down.svg.js";
|
|
6
6
|
const L = /* @__PURE__ */ y({
|
|
7
7
|
__name: "NmorphCarousel",
|
|
8
8
|
props: {
|
|
@@ -40,9 +40,9 @@ const L = /* @__PURE__ */ y({
|
|
|
40
40
|
}, C = v(() => `translateX(-${e.value * 100}%)`), r = a(!0), m = { currentSlide: e, prevSlide: _, nextSlide: g, props: s, emit: u, modifiers: S, carouselData: c, carouselId: i, carouselWrapper: o, slidesRefs: n, addInitialCloneSlides: d, transitionEndHandler: p, setItemRef: b, translateX: C, transitionEnabled: r, isCurrentElementActive: (t) => t === e.value - 1, elementIndicator: (t) => {
|
|
41
41
|
e.value = t + 1;
|
|
42
42
|
}, get NmorphIcon() {
|
|
43
|
-
return M;
|
|
44
|
-
}, get NmorphIconChevronDown() {
|
|
45
43
|
return A;
|
|
44
|
+
}, get NmorphIconChevronDown() {
|
|
45
|
+
return M;
|
|
46
46
|
} };
|
|
47
47
|
return Object.defineProperty(m, "__isScriptSetup", { enumerable: !1, value: !0 }), m;
|
|
48
48
|
}
|
|
@@ -1,45 +1,65 @@
|
|
|
1
1
|
import './NmorphImagePreview.css';
|
|
2
|
-
import
|
|
3
|
-
import { openBlock as
|
|
2
|
+
import g from "./NmorphImagePreview.vue2.js";
|
|
3
|
+
import { openBlock as l, createElementBlock as a, Fragment as s, normalizeClass as h, createElementVNode as i, createVNode as o, createSlots as _, withCtx as r, renderSlot as m, createCommentVNode as t, createBlock as c, Teleport as p, normalizeStyle as k, renderList as N, resolveDynamicComponent as v } from "vue";
|
|
4
4
|
/* empty css */
|
|
5
|
-
import
|
|
6
|
-
const
|
|
5
|
+
import w from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
6
|
+
const y = { class: "nmorph-image-preview__content" }, C = {
|
|
7
7
|
key: 0,
|
|
8
8
|
class: "nmorph-image-preview__left"
|
|
9
|
-
},
|
|
9
|
+
}, I = {
|
|
10
10
|
key: 1,
|
|
11
11
|
class: "nmorph-image-preview__right"
|
|
12
|
-
},
|
|
13
|
-
function
|
|
14
|
-
return
|
|
15
|
-
|
|
12
|
+
}, S = { class: "nmorph-image-preview__actions" }, b = { class: "nmorph-image-preview__action-element" };
|
|
13
|
+
function B(n, z, D, e, H, L) {
|
|
14
|
+
return l(), a(
|
|
15
|
+
s,
|
|
16
16
|
null,
|
|
17
17
|
[
|
|
18
|
-
l(
|
|
18
|
+
e.props.showTrigger ? (l(), a(
|
|
19
19
|
"div",
|
|
20
20
|
{
|
|
21
|
-
|
|
21
|
+
key: 0,
|
|
22
|
+
class: h(e.modifiers)
|
|
22
23
|
},
|
|
23
24
|
[
|
|
24
|
-
|
|
25
|
+
i("div", {
|
|
25
26
|
class: "nmorph-image-preview__trigger",
|
|
26
27
|
onClick: e.clickHandler
|
|
27
28
|
}, [
|
|
28
29
|
o(e.NmorphImage, {
|
|
29
30
|
src: e.triggerSource,
|
|
30
31
|
alt: e.props.alt,
|
|
31
|
-
fit: "cover"
|
|
32
|
-
|
|
32
|
+
fit: "cover",
|
|
33
|
+
"frame-border": 0
|
|
34
|
+
}, _({
|
|
35
|
+
_: 2
|
|
36
|
+
/* DYNAMIC */
|
|
37
|
+
}, [
|
|
38
|
+
n.$slots.loading ? {
|
|
39
|
+
name: "loading",
|
|
40
|
+
fn: r(() => [
|
|
41
|
+
m(n.$slots, "loading")
|
|
42
|
+
]),
|
|
43
|
+
key: "0"
|
|
44
|
+
} : void 0,
|
|
45
|
+
n.$slots.error ? {
|
|
46
|
+
name: "error",
|
|
47
|
+
fn: r(() => [
|
|
48
|
+
m(n.$slots, "error")
|
|
49
|
+
]),
|
|
50
|
+
key: "1"
|
|
51
|
+
} : void 0
|
|
52
|
+
]), 1032, ["src", "alt"])
|
|
33
53
|
])
|
|
34
54
|
],
|
|
35
55
|
2
|
|
36
56
|
/* CLASS */
|
|
37
|
-
),
|
|
38
|
-
(
|
|
39
|
-
|
|
57
|
+
)) : t("v-if", !0),
|
|
58
|
+
(l(), c(p, { to: "body" }, [
|
|
59
|
+
i(
|
|
40
60
|
"div",
|
|
41
61
|
{
|
|
42
|
-
class:
|
|
62
|
+
class: h(["nmorph-image-preview__portal", e.modifiers])
|
|
43
63
|
},
|
|
44
64
|
[
|
|
45
65
|
o(e.NmorphOverlay, {
|
|
@@ -48,15 +68,34 @@ function y(x, B, S, e, b, u) {
|
|
|
48
68
|
onOnOutsideClick: e.closeHandler
|
|
49
69
|
}, {
|
|
50
70
|
default: r(() => [
|
|
51
|
-
|
|
71
|
+
i("div", y, [
|
|
52
72
|
o(e.NmorphImage, {
|
|
53
73
|
src: e.triggerSource,
|
|
54
74
|
alt: e.props.alt,
|
|
55
75
|
fit: "cover",
|
|
56
|
-
|
|
57
|
-
|
|
76
|
+
"frame-border": 0,
|
|
77
|
+
style: k({ transform: `rotate(${e.rotateLevel}deg) scale(${e.scaleLevel})` })
|
|
78
|
+
}, _({
|
|
79
|
+
_: 2
|
|
80
|
+
/* DYNAMIC */
|
|
81
|
+
}, [
|
|
82
|
+
n.$slots.loading ? {
|
|
83
|
+
name: "loading",
|
|
84
|
+
fn: r(() => [
|
|
85
|
+
m(n.$slots, "loading")
|
|
86
|
+
]),
|
|
87
|
+
key: "0"
|
|
88
|
+
} : void 0,
|
|
89
|
+
n.$slots.error ? {
|
|
90
|
+
name: "error",
|
|
91
|
+
fn: r(() => [
|
|
92
|
+
m(n.$slots, "error")
|
|
93
|
+
]),
|
|
94
|
+
key: "1"
|
|
95
|
+
} : void 0
|
|
96
|
+
]), 1032, ["src", "alt", "style"])
|
|
58
97
|
]),
|
|
59
|
-
e.multipleSources ? (
|
|
98
|
+
e.multipleSources ? (l(), a("div", C, [
|
|
60
99
|
o(e.NmorphButton, { onClick: e.previousHandler }, {
|
|
61
100
|
default: r(() => [
|
|
62
101
|
o(e.NmorphIcon, null, {
|
|
@@ -70,8 +109,8 @@ function y(x, B, S, e, b, u) {
|
|
|
70
109
|
_: 1
|
|
71
110
|
/* STABLE */
|
|
72
111
|
})
|
|
73
|
-
])) :
|
|
74
|
-
e.multipleSources ? (
|
|
112
|
+
])) : t("v-if", !0),
|
|
113
|
+
e.multipleSources ? (l(), a("div", I, [
|
|
75
114
|
o(e.NmorphButton, { onClick: e.nextHandler }, {
|
|
76
115
|
default: r(() => [
|
|
77
116
|
o(e.NmorphIcon, null, {
|
|
@@ -85,17 +124,17 @@ function y(x, B, S, e, b, u) {
|
|
|
85
124
|
_: 1
|
|
86
125
|
/* STABLE */
|
|
87
126
|
})
|
|
88
|
-
])) :
|
|
89
|
-
|
|
90
|
-
(
|
|
91
|
-
|
|
127
|
+
])) : t("v-if", !0),
|
|
128
|
+
i("div", S, [
|
|
129
|
+
(l(), a(
|
|
130
|
+
s,
|
|
92
131
|
null,
|
|
93
|
-
|
|
94
|
-
key:
|
|
132
|
+
N(e.actions, (d, f) => i("div", {
|
|
133
|
+
key: f,
|
|
95
134
|
class: "nmorph-image-preview__action-element"
|
|
96
135
|
}, [
|
|
97
136
|
o(e.NmorphButton, {
|
|
98
|
-
onClick:
|
|
137
|
+
onClick: d.handler
|
|
99
138
|
}, {
|
|
100
139
|
default: r(() => [
|
|
101
140
|
o(
|
|
@@ -103,7 +142,7 @@ function y(x, B, S, e, b, u) {
|
|
|
103
142
|
null,
|
|
104
143
|
{
|
|
105
144
|
default: r(() => [
|
|
106
|
-
(
|
|
145
|
+
(l(), c(v(d.icon)))
|
|
107
146
|
]),
|
|
108
147
|
_: 2
|
|
109
148
|
/* DYNAMIC */
|
|
@@ -119,7 +158,7 @@ function y(x, B, S, e, b, u) {
|
|
|
119
158
|
64
|
|
120
159
|
/* STABLE_FRAGMENT */
|
|
121
160
|
)),
|
|
122
|
-
|
|
161
|
+
i("div", b, [
|
|
123
162
|
o(e.NmorphButton, {
|
|
124
163
|
disabled: e.scaleLevel === 1,
|
|
125
164
|
onClick: e.enlargeShrinkActionData.handler
|
|
@@ -127,7 +166,7 @@ function y(x, B, S, e, b, u) {
|
|
|
127
166
|
default: r(() => [
|
|
128
167
|
o(e.NmorphIcon, null, {
|
|
129
168
|
default: r(() => [
|
|
130
|
-
(
|
|
169
|
+
(l(), c(v(e.enlargeShrinkActionData.icon)))
|
|
131
170
|
]),
|
|
132
171
|
_: 1
|
|
133
172
|
/* STABLE */
|
|
@@ -139,8 +178,8 @@ function y(x, B, S, e, b, u) {
|
|
|
139
178
|
])
|
|
140
179
|
])
|
|
141
180
|
]),
|
|
142
|
-
_:
|
|
143
|
-
/*
|
|
181
|
+
_: 3
|
|
182
|
+
/* FORWARDED */
|
|
144
183
|
}, 8, ["show", "z-index"])
|
|
145
184
|
],
|
|
146
185
|
2
|
|
@@ -152,7 +191,7 @@ function y(x, B, S, e, b, u) {
|
|
|
152
191
|
/* STABLE_FRAGMENT */
|
|
153
192
|
);
|
|
154
193
|
}
|
|
155
|
-
const
|
|
194
|
+
const E = /* @__PURE__ */ w(g, [["render", B], ["__file", "/builds/ketjo/nmorph/library/src/components/data/nmorph-image-preview/NmorphImagePreview.vue"]]);
|
|
156
195
|
export {
|
|
157
|
-
|
|
196
|
+
E as default
|
|
158
197
|
};
|