@nmorph/nmorph-ui-kit 2.2.36 → 2.2.38
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/basic/nmorph-button/NmorphButton.vue2.js +8 -8
- package/dist/components/basic/nmorph-icon/NmorphIcon.vue2.js +3 -3
- package/dist/components/basic/nmorph-layout/NmorphLayout.vue2.js +14 -13
- package/dist/components/basic/nmorph-link/NmorphLink.vue2.js +1 -1
- package/dist/components/basic/nmorph-scroll/NmorphScroll.css +1 -0
- package/dist/components/basic/nmorph-scroll/NmorphScroll.vue.js +6 -4
- package/dist/components/basic/nmorph-scroll/NmorphScroll.vue2.js +1 -0
- package/dist/components/basic/nmorph-space/NmorphSpace.vue2.js +15 -19
- package/dist/components/data/nmorph-avatar/NmorphAvatar.css +1 -1
- package/dist/components/data/nmorph-avatar/NmorphAvatar.vue2.js +5 -5
- package/dist/components/data/nmorph-badge/NmorphBadge.vue2.js +37 -36
- package/dist/components/data/nmorph-calendar/NmorphCalendar.vue2.js +41 -40
- package/dist/components/data/nmorph-card/NmorphCard.vue2.js +19 -15
- package/dist/components/data/nmorph-collapse/components/nmorph-collapse-item/NmorphCollapseItem.vue2.js +5 -9
- package/dist/components/data/nmorph-empty/NmorphEmpty.vue.js +3 -3
- package/dist/components/data/nmorph-empty/NmorphEmpty.vue2.js +17 -14
- package/dist/components/data/nmorph-image/NmorphImage.css +1 -0
- package/dist/components/data/nmorph-image/NmorphImage.vue.js +14 -12
- package/dist/components/data/nmorph-image/NmorphImage.vue2.js +3 -2
- package/dist/components/data/nmorph-image-preview/NmorphImagePreview.vue2.js +36 -35
- package/dist/components/data/nmorph-pagination/NmorphPagination.vue2.js +1 -1
- package/dist/components/data/nmorph-progress/NmorphProgress.vue2.js +19 -18
- package/dist/components/data/nmorph-qr-code/NmorphQRCode.vue2.js +20 -19
- package/dist/components/data/nmorph-skeleton/NmorphSkeleton.vue2.js +1 -1
- package/dist/components/data/nmorph-table/NmorphTable.vue2.js +39 -43
- package/dist/components/data/nmorph-virtual-list/NmorphVirtualList.vue2.js +34 -33
- package/dist/components/feedback/nmorph-alert/NmorphAlert.vue2.js +1 -1
- package/dist/components/feedback/nmorph-callout/NmorphCallout.vue2.js +7 -6
- package/dist/components/feedback/nmorph-dialog/NmorphDialog.css +1 -1
- package/dist/components/feedback/nmorph-dialog/NmorphDialog.vue.js +25 -20
- package/dist/components/feedback/nmorph-dialog/NmorphDialog.vue2.js +37 -37
- package/dist/components/feedback/nmorph-drawer/NmorphDrawer.vue2.js +22 -21
- package/dist/components/feedback/nmorph-tooltip/NmorphTooltip.vue2.js +26 -25
- package/dist/components/form/nmorph-autocomplete/NmorphAutocomplete.vue2.js +65 -71
- package/dist/components/form/nmorph-checkbox/NmorphCheckbox.css +1 -1
- package/dist/components/form/nmorph-checkbox/NmorphCheckbox.vue2.js +30 -28
- package/dist/components/form/nmorph-checkbox-group/NmorphCheckboxGroup.vue2.js +25 -20
- package/dist/components/form/nmorph-color-picker/NmorphColorPicker.vue2.js +43 -42
- package/dist/components/form/nmorph-date-picker/NmorphDatePicker.vue2.js +53 -40
- package/dist/components/form/nmorph-file-upload/NmorphFileUpload.vue.js +20 -16
- package/dist/components/form/nmorph-file-upload/NmorphFileUpload.vue2.js +113 -86
- package/dist/components/form/nmorph-form/NmorphForm.vue2.js +9 -9
- package/dist/components/form/nmorph-form/components/nmorph-form-item/NmorphFormItem.vue2.js +33 -24
- package/dist/components/form/nmorph-form/components/nmorph-form-item/inner-components/nmorph-error-box/NmorphErrorBox.vue2.js +1 -1
- package/dist/components/form/nmorph-form/use-form-item-input.js +29 -8
- package/dist/components/form/nmorph-number-input/NmorphNumberInput.vue2.js +42 -39
- package/dist/components/form/nmorph-otp-input/NmorphOTPInput.vue2.js +66 -62
- package/dist/components/form/nmorph-radio/NmorphRadio.css +1 -1
- package/dist/components/form/nmorph-radio/NmorphRadio.vue2.js +1 -1
- package/dist/components/form/nmorph-radio-group/NmorphRadioGroup.vue2.js +24 -22
- package/dist/components/form/nmorph-select/NmorphSelect.css +1 -1
- package/dist/components/form/nmorph-select/NmorphSelect.vue2.js +83 -81
- package/dist/components/form/nmorph-select/components/nmorph-select-option/NmorphSelectOption.vue2.js +4 -4
- package/dist/components/form/nmorph-select-button/NmorphSelectButton.vue2.js +28 -25
- package/dist/components/form/nmorph-select-button/components/nmorph-select-button-item/NmorphSelectButtonItem.vue2.js +1 -1
- package/dist/components/form/nmorph-slider/NmorphSlider.vue2.js +51 -49
- package/dist/components/form/nmorph-switch/NmorphSwitch.vue2.js +35 -33
- package/dist/components/form/nmorph-text-input/NmorphTextInput.css +1 -0
- package/dist/components/form/nmorph-text-input/NmorphTextInput.vue.js +5 -3
- package/dist/components/form/nmorph-text-input/NmorphTextInput.vue2.js +37 -35
- package/dist/components/form/nmorph-textarea/NmorphTextarea.vue.js +1 -1
- package/dist/components/form/nmorph-textarea/NmorphTextarea.vue2.js +30 -26
- package/dist/components/form/nmorph-time-picker/NmorphTimePicker.vue.js +1 -1
- package/dist/components/form/nmorph-time-picker/NmorphTimePicker.vue2.js +68 -66
- package/dist/components/navigation/nmorph-backtop/NmorphBacktop.vue2.js +1 -1
- package/dist/components/navigation/nmorph-dropdown/NmorphDropdown.vue2.js +32 -31
- package/dist/components/navigation/nmorph-tabs/NmorphTabs.vue2.js +1 -1
- package/dist/components/others/nmorph-overlay/NmorphOverlay.vue2.js +1 -1
- package/dist/hooks/use-common-styles.js +18 -278
- package/dist/hooks/use-field-validation.js +71 -42
- package/dist/hooks/use-form-validation.js +62 -24
- package/dist/hooks/use-virtual-list.js +38 -32
- package/dist/index.umd.js +26 -286
- package/dist/package.json.js +1 -1
- package/dist/src/components/basic/nmorph-button/NmorphButton.vue.d.ts +2 -2
- package/dist/src/components/basic/nmorph-link/NmorphLink.vue.d.ts +1 -1
- package/dist/src/components/data/nmorph-avatar/NmorphAvatar.vue.d.ts +1 -1
- package/dist/src/components/data/nmorph-badge/NmorphBadge.vue.d.ts +1 -1
- package/dist/src/components/data/nmorph-collapse/components/nmorph-collapse-item/NmorphCollapseItem.vue.d.ts +1 -1
- package/dist/src/components/data/nmorph-empty/NmorphEmpty.vue.d.ts +1 -1
- package/dist/src/components/data/nmorph-pagination/NmorphPagination.vue.d.ts +1 -1
- package/dist/src/components/data/nmorph-progress/NmorphProgress.vue.d.ts +1 -1
- package/dist/src/components/data/nmorph-table/NmorphTable.vue.d.ts +1 -1
- package/dist/src/components/data/nmorph-tag-list/components/nmorph-tag-item/NmorphTagItem.vue.d.ts +1 -1
- package/dist/src/components/feedback/nmorph-callout/NmorphCallout.vue.d.ts +1 -1
- package/dist/src/components/feedback/nmorph-dialog/NmorphDialog.vue.d.ts +4 -4
- package/dist/src/components/form/nmorph-autocomplete/NmorphAutocomplete.vue.d.ts +1 -1
- package/dist/src/components/form/nmorph-checkbox-group/NmorphCheckboxGroup.vue.d.ts +3 -3
- package/dist/src/components/form/nmorph-color-picker/NmorphColorPicker.vue.d.ts +1 -1
- package/dist/src/components/form/nmorph-date-picker/NmorphDatePicker.vue.d.ts +3 -3
- package/dist/src/components/form/nmorph-file-upload/NmorphFileUpload.vue.d.ts +6 -3
- package/dist/src/components/form/nmorph-file-upload/types.d.ts +4 -0
- package/dist/src/components/form/nmorph-form/components/nmorph-form-item/NmorphFormItem.vue.d.ts +1 -1
- package/dist/src/components/form/nmorph-form/components/nmorph-form-item/inner-components/nmorph-error-box/NmorphErrorBox.vue.d.ts +1 -1
- package/dist/src/components/form/nmorph-form/types.d.ts +15 -5
- package/dist/src/components/form/nmorph-form/use-form-item-input.d.ts +10 -0
- package/dist/src/components/form/nmorph-number-input/NmorphNumberInput.vue.d.ts +1 -1
- package/dist/src/components/form/nmorph-otp-input/NmorphOTPInput.vue.d.ts +1 -1
- package/dist/src/components/form/nmorph-radio-group/NmorphRadioGroup.vue.d.ts +3 -3
- package/dist/src/components/form/nmorph-select/NmorphSelect.vue.d.ts +1 -1
- package/dist/src/components/form/nmorph-select-button/NmorphSelectButton.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/form/nmorph-time-picker/NmorphTimePicker.vue.d.ts +1 -1
- package/dist/src/hooks/use-field-validation.d.ts +15 -0
- package/dist/src/hooks/use-form-validation.d.ts +5 -0
- package/dist/src/hooks/use-virtual-list.d.ts +6 -0
- package/dist/src/types/index.d.ts +2 -1
- package/dist/src/utils/common.d.ts +5 -0
- package/dist/src/utils/create-modifiers.d.ts +4 -2
- package/dist/style.css +1 -1
- package/dist/utils/common.js +9 -3
- package/dist/utils/create-modifiers.js +6 -6
- package/package.json +1 -1
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import './NmorphEmpty.css';
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
import { NmorphShadowType as
|
|
4
|
-
import { useModifiers as
|
|
2
|
+
import { defineComponent as u, useSlots as f, computed as t } from "vue";
|
|
3
|
+
import { NmorphShadowType as c } from "../../../types/index.js";
|
|
4
|
+
import { useModifiers as h } from "../../../utils/create-modifiers.js";
|
|
5
|
+
import { toCssSize as r } from "../../../utils/common.js";
|
|
5
6
|
import g from "../../../assets/icons/folder-opened.svg.js";
|
|
6
|
-
import
|
|
7
|
-
const z = /* @__PURE__ */
|
|
7
|
+
import y from "../../basic/nmorph-icon/NmorphIcon.vue.js";
|
|
8
|
+
const z = /* @__PURE__ */ u({
|
|
8
9
|
__name: "NmorphEmpty",
|
|
9
10
|
props: {
|
|
10
11
|
title: { type: String, required: !1, default: "No data" },
|
|
@@ -19,23 +20,25 @@ const z = /* @__PURE__ */ f({
|
|
|
19
20
|
ariaLabel: { type: String, required: !1, default: void 0 },
|
|
20
21
|
ariaOrientation: { type: String, required: !1, default: void 0 }
|
|
21
22
|
},
|
|
22
|
-
setup(
|
|
23
|
-
|
|
24
|
-
const e =
|
|
25
|
-
() =>
|
|
26
|
-
nmorph: [e.design === "nmorph" ?
|
|
23
|
+
setup(n, { expose: p }) {
|
|
24
|
+
p();
|
|
25
|
+
const e = n, o = f(), s = t(() => !e.hideIcon || !!o.icon), a = t(() => !!(e.description || o.description)), d = t(() => e.ariaLabel || e.title), l = t(
|
|
26
|
+
() => h({
|
|
27
|
+
nmorph: [e.design === "nmorph" ? c[e.shadowType] : ""],
|
|
27
28
|
"nmorph-empty": [e.design]
|
|
28
29
|
})
|
|
29
|
-
),
|
|
30
|
+
), m = t(() => ({
|
|
30
31
|
"--nmorph-empty-icon-size": r(e.iconSize),
|
|
31
32
|
"--nmorph-empty-min-height": r(e.minHeight),
|
|
32
33
|
"--nmorph-empty-padding": r(e.padding)
|
|
33
|
-
})),
|
|
34
|
-
return
|
|
34
|
+
})), i = { props: e, slots: o, hasIcon: s, hasDescription: a, label: d, modifiers: l, styles: m, get NmorphIcon() {
|
|
35
|
+
return y;
|
|
35
36
|
}, get NmorphIconFolderOpened() {
|
|
36
37
|
return g;
|
|
38
|
+
}, get toCssSize() {
|
|
39
|
+
return r;
|
|
37
40
|
} };
|
|
38
|
-
return Object.defineProperty(
|
|
41
|
+
return Object.defineProperty(i, "__isScriptSetup", { enumerable: !1, value: !0 }), i;
|
|
39
42
|
}
|
|
40
43
|
});
|
|
41
44
|
export {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.nmorph-image{--width: auto;--height: 100%;display:flex;justify-content:center;align-items:center;width:var(--width);height:var(--height)}.nmorph-image.nmorph--shadow-combined{border:var(--nmorph-image-frame-border) solid var(--nmorph-main-color)}.nmorph-image img{width:100%;height:100%;object-fit:var(--nmorph-image-fit)}.nmorph-image__loading,.nmorph-image__load-failed{padding:1rem}.nmorph-image--hide img{width:0;height:0;opacity:0}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import './NmorphImage.css';
|
|
1
2
|
import l from "./NmorphImage.vue2.js";
|
|
2
|
-
import { openBlock as
|
|
3
|
+
import { openBlock as r, createElementBlock as e, normalizeStyle as m, normalizeClass as d, createElementVNode as c, renderSlot as i, createTextVNode as t, toDisplayString as s, createCommentVNode as n } from "vue";
|
|
4
|
+
/* empty css */
|
|
3
5
|
import _ from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
6
|
const p = ["src", "alt", "srcset"], g = {
|
|
5
7
|
key: 0,
|
|
@@ -9,12 +11,12 @@ const p = ["src", "alt", "srcset"], g = {
|
|
|
9
11
|
class: "nmorph-image__loading"
|
|
10
12
|
};
|
|
11
13
|
function h(a, y, k, o, v, L) {
|
|
12
|
-
return o.props.src ? (
|
|
14
|
+
return o.props.src ? (r(), e(
|
|
13
15
|
"div",
|
|
14
16
|
{
|
|
15
17
|
key: 0,
|
|
16
|
-
class:
|
|
17
|
-
style:
|
|
18
|
+
class: d(o.modifiers),
|
|
19
|
+
style: m(o.styles)
|
|
18
20
|
},
|
|
19
21
|
[
|
|
20
22
|
c("img", {
|
|
@@ -24,18 +26,18 @@ function h(a, y, k, o, v, L) {
|
|
|
24
26
|
onLoad: o.onImageLoad,
|
|
25
27
|
onError: o.onImageError
|
|
26
28
|
}, null, 40, p),
|
|
27
|
-
o.loadingFailed ? (
|
|
29
|
+
o.loadingFailed ? (r(), e("div", g, [
|
|
28
30
|
i(a.$slots, "error", {}, () => [
|
|
29
|
-
|
|
30
|
-
|
|
31
|
+
t(
|
|
32
|
+
s(o.computedLoadFailedText),
|
|
31
33
|
1
|
|
32
34
|
/* TEXT */
|
|
33
35
|
)
|
|
34
36
|
])
|
|
35
|
-
])) : o.imageLoadFinished ? n("v-if", !0) : (
|
|
37
|
+
])) : o.imageLoadFinished ? n("v-if", !0) : (r(), e("div", f, [
|
|
36
38
|
i(a.$slots, "loading", {}, () => [
|
|
37
|
-
|
|
38
|
-
|
|
39
|
+
t(
|
|
40
|
+
s(o.computedLoadingText),
|
|
39
41
|
1
|
|
40
42
|
/* TEXT */
|
|
41
43
|
)
|
|
@@ -46,7 +48,7 @@ function h(a, y, k, o, v, L) {
|
|
|
46
48
|
/* CLASS, STYLE */
|
|
47
49
|
)) : n("v-if", !0);
|
|
48
50
|
}
|
|
49
|
-
const
|
|
51
|
+
const S = /* @__PURE__ */ _(l, [["render", h], ["__file", "/builds/ketjo/nmorph/library/src/components/data/nmorph-image/NmorphImage.vue"]]);
|
|
50
52
|
export {
|
|
51
|
-
|
|
53
|
+
S as default
|
|
52
54
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import './NmorphImage.css';
|
|
1
2
|
import { defineComponent as _, computed as t, ref as s } from "vue";
|
|
2
3
|
import { useModifiers as y } from "../../../utils/create-modifiers.js";
|
|
3
4
|
import { useI18n as h } from "vue-i18n";
|
|
@@ -21,8 +22,8 @@ const b = /* @__PURE__ */ _({
|
|
|
21
22
|
r.value = !0, a.value = !0, d("error", i);
|
|
22
23
|
}, l = t(() => r.value && a.value), v = t(
|
|
23
24
|
() => y({
|
|
24
|
-
nmorph: [
|
|
25
|
-
"nmorph-image": [
|
|
25
|
+
nmorph: [e.frameBorder > 0 && "shadow-combined"],
|
|
26
|
+
"nmorph-image": [(l.value || !r.value) && "hide"]
|
|
26
27
|
})
|
|
27
28
|
), T = t(() => ({
|
|
28
29
|
"--nmorph-image-fit": e.fit || "cover",
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import './NmorphImagePreview.css';
|
|
2
|
-
import { defineComponent as z, ref as
|
|
2
|
+
import { defineComponent as z, ref as u, watch as F, computed as n } from "vue";
|
|
3
3
|
import { useModifiers as H } from "../../../utils/create-modifiers.js";
|
|
4
|
+
import { toCssSize as m } from "../../../utils/common.js";
|
|
4
5
|
import R from "../../../assets/icons/shrink.svg.js";
|
|
5
6
|
import T from "../../../assets/icons/rotate-right.svg.js";
|
|
6
7
|
import D from "../../../assets/icons/rotate-left.svg.js";
|
|
7
8
|
import V from "../../../assets/icons/zoom-in.svg.js";
|
|
8
9
|
import P from "../../../assets/icons/zoom-out.svg.js";
|
|
9
10
|
import Z from "../../../assets/icons/enlarge.svg.js";
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
const
|
|
11
|
+
import j from "../../../assets/icons/chevron-down.svg.js";
|
|
12
|
+
import E from "../../others/nmorph-overlay/NmorphOverlay.vue.js";
|
|
13
|
+
import G from "../../basic/nmorph-icon/NmorphIcon.vue.js";
|
|
14
|
+
import J from "../../basic/nmorph-button/NmorphButton.vue.js";
|
|
15
|
+
import K from "../nmorph-image/NmorphImage.vue.js";
|
|
16
|
+
const ue = /* @__PURE__ */ z({
|
|
16
17
|
__name: "NmorphImagePreview",
|
|
17
18
|
props: {
|
|
18
19
|
modelValue: { type: Boolean, required: !1, default: !1 },
|
|
@@ -33,23 +34,23 @@ const ie = /* @__PURE__ */ z({
|
|
|
33
34
|
emits: ["update:model-value"],
|
|
34
35
|
setup(S, { expose: I, emit: w }) {
|
|
35
36
|
I();
|
|
36
|
-
const e = S, l =
|
|
37
|
+
const e = S, l = u(e.modelValue);
|
|
37
38
|
F(
|
|
38
39
|
() => e.modelValue,
|
|
39
|
-
(
|
|
40
|
+
(a) => l.value = a
|
|
40
41
|
);
|
|
41
42
|
const q = n(
|
|
42
43
|
() => H({
|
|
43
|
-
"nmorph-image-preview": [
|
|
44
|
+
"nmorph-image-preview": [l.value && "opened"]
|
|
44
45
|
})
|
|
45
|
-
),
|
|
46
|
-
l.value = !0,
|
|
47
|
-
},
|
|
48
|
-
l.value = !1,
|
|
46
|
+
), o = u(e.initialIndex), B = n(() => typeof e.src == "string" ? e.src : e.src[o.value]), t = u(1), b = () => {
|
|
47
|
+
l.value = !0, s("update:model-value", l.value);
|
|
48
|
+
}, x = () => {
|
|
49
|
+
l.value = !1, s("update:model-value", l.value);
|
|
49
50
|
}, c = () => {
|
|
50
|
-
|
|
51
|
+
r.value = r.value + 90, r.value >= 360 && (r.value = 0);
|
|
51
52
|
}, p = () => {
|
|
52
|
-
|
|
53
|
+
r.value = r.value - 90, r.value <= -360 && (r.value = 0);
|
|
53
54
|
}, d = () => {
|
|
54
55
|
t.value < e.maxScaleLevel && (t.value += e.scaleStep), t.value = parseFloat(t.value.toFixed(3));
|
|
55
56
|
}, v = () => {
|
|
@@ -58,21 +59,21 @@ const ie = /* @__PURE__ */ z({
|
|
|
58
59
|
t.value = 1;
|
|
59
60
|
}, g = () => {
|
|
60
61
|
t.value = 1;
|
|
61
|
-
},
|
|
62
|
-
const
|
|
63
|
-
i < 0 ?
|
|
62
|
+
}, r = u(0), _ = () => {
|
|
63
|
+
const a = e.src.length - 1, i = o.value - 1;
|
|
64
|
+
i < 0 ? o.value = a : o.value = i;
|
|
64
65
|
}, L = () => {
|
|
65
|
-
const
|
|
66
|
-
i >
|
|
66
|
+
const a = e.src.length - 1, i = o.value + 1;
|
|
67
|
+
i > a ? o.value = 0 : o.value = i;
|
|
67
68
|
}, A = n(() => {
|
|
68
|
-
let
|
|
69
|
+
let a = {
|
|
69
70
|
icon: R,
|
|
70
71
|
handler: g
|
|
71
72
|
};
|
|
72
|
-
return f.value && (
|
|
73
|
+
return f.value && (a = {
|
|
73
74
|
icon: Z,
|
|
74
75
|
handler: h
|
|
75
|
-
}),
|
|
76
|
+
}), a;
|
|
76
77
|
}), C = [
|
|
77
78
|
{
|
|
78
79
|
icon: T,
|
|
@@ -90,27 +91,27 @@ const ie = /* @__PURE__ */ z({
|
|
|
90
91
|
icon: P,
|
|
91
92
|
handler: v
|
|
92
93
|
}
|
|
93
|
-
],
|
|
94
|
-
...e.width !== void 0 && { "--width":
|
|
95
|
-
...e.height !== void 0 && { "--height":
|
|
94
|
+
], s = w, N = n(() => Array.isArray(e.src) && e.src.length > 0), M = n(() => e.showNavigationButtons && N.value), O = n(() => ({
|
|
95
|
+
...e.width !== void 0 && { "--width": m(e.width) },
|
|
96
|
+
...e.height !== void 0 && { "--height": m(e.height) }
|
|
96
97
|
})), k = n(() => ({
|
|
97
98
|
...e.navigationButtonMargin !== void 0 && {
|
|
98
|
-
"--nmorph-image-preview-btn-margin":
|
|
99
|
+
"--nmorph-image-preview-btn-margin": m(e.navigationButtonMargin)
|
|
99
100
|
}
|
|
100
|
-
})), y = { props: e, open: l, modifiers: q, currentIndex:
|
|
101
|
-
return
|
|
101
|
+
})), y = { props: e, open: l, modifiers: q, currentIndex: o, triggerSource: B, scaleLevel: t, clickHandler: b, closeHandler: x, rotateRight: c, rotateLeft: p, zoomIn: d, zoomOut: v, isLevelChangedToMin: f, enlargeToNormal: h, shrinkToNormal: g, rotateLevel: r, previousHandler: _, nextHandler: L, enlargeShrinkActionData: A, actions: C, emit: s, multipleSources: N, showNavigation: M, triggerStyle: O, portalStyle: k, get NmorphImage() {
|
|
102
|
+
return K;
|
|
102
103
|
}, get NmorphButton() {
|
|
103
|
-
return
|
|
104
|
+
return J;
|
|
104
105
|
}, get NmorphIcon() {
|
|
105
|
-
return
|
|
106
|
+
return G;
|
|
106
107
|
}, get NmorphOverlay() {
|
|
107
|
-
return
|
|
108
|
+
return E;
|
|
108
109
|
}, get NmorphIconChevronDown() {
|
|
109
|
-
return
|
|
110
|
+
return j;
|
|
110
111
|
} };
|
|
111
112
|
return Object.defineProperty(y, "__isScriptSetup", { enumerable: !1, value: !0 }), y;
|
|
112
113
|
}
|
|
113
114
|
});
|
|
114
115
|
export {
|
|
115
|
-
|
|
116
|
+
ue as default
|
|
116
117
|
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import './NmorphProgress.css';
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
import { useModifiers as
|
|
4
|
-
|
|
2
|
+
import { defineComponent as v, computed as r, ref as u, onMounted as y } from "vue";
|
|
3
|
+
import { useModifiers as S } from "../../../utils/create-modifiers.js";
|
|
4
|
+
import { toCssSize as q } from "../../../utils/common.js";
|
|
5
|
+
const z = /* @__PURE__ */ v({
|
|
5
6
|
__name: "NmorphProgress",
|
|
6
7
|
props: {
|
|
7
8
|
type: { type: String, required: !1, default: "linear" },
|
|
@@ -15,28 +16,28 @@ const A = /* @__PURE__ */ y({
|
|
|
15
16
|
widthTransition: { type: String, required: !1, default: void 0 },
|
|
16
17
|
indeterminateAnimation: { type: String, required: !1, default: void 0 }
|
|
17
18
|
},
|
|
18
|
-
setup(
|
|
19
|
-
|
|
20
|
-
const e =
|
|
21
|
-
() =>
|
|
19
|
+
setup(c, { expose: p }) {
|
|
20
|
+
p();
|
|
21
|
+
const e = c, d = r(
|
|
22
|
+
() => S({
|
|
22
23
|
"nmorph-progress": []
|
|
23
24
|
})
|
|
24
|
-
),
|
|
25
|
-
|
|
25
|
+
), n = r(() => Array.isArray(e.color) ? e.color.find((h) => h.percentage <= e.percentage)?.color : typeof e.color == "function" ? e.color(e.percentage) : e.color), o = r(() => e.indeterminate ? "var(--animation)" : "none"), i = u(null), t = u(1), f = r(() => `${t.value} ${t.value}`), m = r(() => t.value - e.percentage / 100 * t.value);
|
|
26
|
+
y(() => {
|
|
26
27
|
i.value && (t.value = 2 * Math.PI * i.value.r.baseVal.value);
|
|
27
28
|
});
|
|
28
|
-
const
|
|
29
|
-
"--nmorph-progress-percentage":
|
|
30
|
-
"--nmorph-progress-color":
|
|
31
|
-
"--nmorph-progress-animation":
|
|
32
|
-
"--nmorph-progress-circle-size":
|
|
33
|
-
...e.height !== void 0 && { "--height":
|
|
29
|
+
const a = r(() => `${e.circleSize}px`), s = r(() => `${e.percentage}%`), g = r(() => ({
|
|
30
|
+
"--nmorph-progress-percentage": s.value,
|
|
31
|
+
"--nmorph-progress-color": n.value,
|
|
32
|
+
"--nmorph-progress-animation": o.value,
|
|
33
|
+
"--nmorph-progress-circle-size": a.value,
|
|
34
|
+
...e.height !== void 0 && { "--height": q(e.height) },
|
|
34
35
|
...e.widthTransition !== void 0 && { "--width-transition": e.widthTransition },
|
|
35
36
|
...e.indeterminateAnimation !== void 0 && { "--animation": e.indeterminateAnimation }
|
|
36
|
-
})),
|
|
37
|
-
return Object.defineProperty(
|
|
37
|
+
})), l = { props: e, modifiers: d, color: n, animation: o, circle: i, circumference: t, strokeDasharray: f, strokeDashoffset: m, circleContainerSize: a, displayPercentage: s, styles: g };
|
|
38
|
+
return Object.defineProperty(l, "__isScriptSetup", { enumerable: !1, value: !0 }), l;
|
|
38
39
|
}
|
|
39
40
|
});
|
|
40
41
|
export {
|
|
41
|
-
|
|
42
|
+
z as default
|
|
42
43
|
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import './NmorphQRCode.css';
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
import { useModifiers as
|
|
4
|
-
import {
|
|
5
|
-
|
|
2
|
+
import { defineComponent as g, computed as r } from "vue";
|
|
3
|
+
import { useModifiers as q } from "../../../utils/create-modifiers.js";
|
|
4
|
+
import { toCssSize as h } from "../../../utils/common.js";
|
|
5
|
+
import { createNmorphQRCode as a } from "./qr-code.js";
|
|
6
|
+
const _ = /* @__PURE__ */ g({
|
|
6
7
|
__name: "NmorphQRCode",
|
|
7
8
|
props: {
|
|
8
9
|
value: { type: [String, Number], required: !1, default: "" },
|
|
@@ -17,34 +18,34 @@ const x = /* @__PURE__ */ q({
|
|
|
17
18
|
},
|
|
18
19
|
setup(u, { expose: l }) {
|
|
19
20
|
l();
|
|
20
|
-
const e = u, n =
|
|
21
|
+
const e = u, n = r(() => {
|
|
21
22
|
try {
|
|
22
|
-
return
|
|
23
|
+
return a(String(e.value), {
|
|
23
24
|
errorCorrectionLevel: e.level,
|
|
24
25
|
minVersion: e.minVersion,
|
|
25
26
|
maxVersion: e.maxVersion
|
|
26
27
|
}), "";
|
|
27
|
-
} catch (
|
|
28
|
-
return
|
|
28
|
+
} catch (t) {
|
|
29
|
+
return t instanceof Error ? t.message : "Unable to create QR code.";
|
|
29
30
|
}
|
|
30
|
-
}),
|
|
31
|
+
}), o = r(() => n.value ? null : a(String(e.value), {
|
|
31
32
|
errorCorrectionLevel: e.level,
|
|
32
33
|
minVersion: e.minVersion,
|
|
33
34
|
maxVersion: e.maxVersion
|
|
34
|
-
})),
|
|
35
|
-
(
|
|
36
|
-
).join("") : ""),
|
|
37
|
-
"--nmorph-qr-code-size":
|
|
35
|
+
})), s = r(() => o.value ? o.value.size + e.margin * 2 : 1), m = r(() => o.value ? o.value.modules.flatMap(
|
|
36
|
+
(t, f) => t.map((c, v) => c ? `M${v + e.margin} ${f + e.margin}h1v1h-1z` : "").filter(Boolean)
|
|
37
|
+
).join("") : ""), d = r(() => ({
|
|
38
|
+
"--nmorph-qr-code-size": h(e.size),
|
|
38
39
|
"--nmorph-qr-code-color": e.color,
|
|
39
40
|
"--nmorph-qr-code-background": e.background
|
|
40
|
-
})),
|
|
41
|
-
() =>
|
|
42
|
-
"nmorph-qr-code": [
|
|
41
|
+
})), p = r(
|
|
42
|
+
() => q({
|
|
43
|
+
"nmorph-qr-code": [n.value && "error"]
|
|
43
44
|
})
|
|
44
|
-
),
|
|
45
|
-
return Object.defineProperty(
|
|
45
|
+
), i = { props: e, errorMessage: n, qrCode: o, viewBoxSize: s, path: m, styles: d, modifiers: p };
|
|
46
|
+
return Object.defineProperty(i, "__isScriptSetup", { enumerable: !1, value: !0 }), i;
|
|
46
47
|
}
|
|
47
48
|
});
|
|
48
49
|
export {
|
|
49
|
-
|
|
50
|
+
_ as default
|
|
50
51
|
};
|
|
@@ -14,7 +14,7 @@ const f = /* @__PURE__ */ d({
|
|
|
14
14
|
n();
|
|
15
15
|
const e = r, a = o(
|
|
16
16
|
() => l({
|
|
17
|
-
"nmorph-skeleton": [
|
|
17
|
+
"nmorph-skeleton": [e.animated && e.loading && "loading"]
|
|
18
18
|
})
|
|
19
19
|
), i = o(() => ({
|
|
20
20
|
...e.loadingGradient !== void 0 && { "--loading-gradient": e.loadingGradient }
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import './NmorphTable.css';
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
import { useModifiers as
|
|
4
|
-
import { generateUUID as Y } from "../../../utils/common.js";
|
|
5
|
-
import
|
|
6
|
-
import { useVirtualList as
|
|
7
|
-
const
|
|
2
|
+
import { defineComponent as K, computed as a, ref as n, provide as B, watch as Q, nextTick as V } from "vue";
|
|
3
|
+
import { useModifiers as z } from "../../../utils/create-modifiers.js";
|
|
4
|
+
import { generateUUID as Y, toCssSize as M, resolveDomElement as $ } from "../../../utils/common.js";
|
|
5
|
+
import F from "./inner-components/nmorph-sort-button/NmorphSortButton.vue.js";
|
|
6
|
+
import { useVirtualList as G } from "../../../hooks/use-virtual-list.js";
|
|
7
|
+
const le = /* @__PURE__ */ K({
|
|
8
8
|
__name: "NmorphTable",
|
|
9
9
|
props: {
|
|
10
10
|
data: { type: Array, required: !1, default: () => [] },
|
|
@@ -21,37 +21,37 @@ const re = /* @__PURE__ */ P({
|
|
|
21
21
|
cellHeight: { type: [Number, String], required: !1, default: void 0 },
|
|
22
22
|
rowHoverBackground: { type: String, required: !1, default: void 0 }
|
|
23
23
|
},
|
|
24
|
-
setup(
|
|
25
|
-
|
|
26
|
-
const t =
|
|
27
|
-
() =>
|
|
28
|
-
"nmorph-table": [
|
|
24
|
+
setup(_, { expose: T }) {
|
|
25
|
+
T();
|
|
26
|
+
const t = _, I = a(
|
|
27
|
+
() => z({
|
|
28
|
+
"nmorph-table": [t.design]
|
|
29
29
|
})
|
|
30
|
-
), o = n([...t.data]), u = a(() => t.virtual),
|
|
30
|
+
), o = n([...t.data]), u = a(() => t.virtual), b = a(() => t.virtualRowHeight), H = a(() => t.virtualOverscan), S = a(() => t.virtualDynamicHeight), r = G(o, {
|
|
31
31
|
enabled: u,
|
|
32
|
-
itemHeight:
|
|
33
|
-
overscan:
|
|
32
|
+
itemHeight: b,
|
|
33
|
+
overscan: H,
|
|
34
34
|
dynamic: S
|
|
35
|
-
}),
|
|
35
|
+
}), x = a(
|
|
36
36
|
() => u.value ? r.virtualItems.value : o.value.map((e, l) => ({ item: e, index: l }))
|
|
37
|
-
),
|
|
38
|
-
d.value && (d.value[l] = e, o.value.sort((
|
|
39
|
-
const
|
|
37
|
+
), C = a(() => x.value.map((e) => e.item)), s = n(-1), h = n(0), d = n(t.sort), W = (e, l) => {
|
|
38
|
+
d.value && (d.value[l] = e, o.value.sort((g, y) => {
|
|
39
|
+
const w = String(g[l]).toLowerCase(), i = String(y[l]).toLowerCase();
|
|
40
40
|
if (!d.value)
|
|
41
41
|
return 0;
|
|
42
42
|
const f = d.value[l];
|
|
43
|
-
return f === "ascending" ?
|
|
43
|
+
return f === "ascending" ? w.localeCompare(i) : f === "descending" ? i.localeCompare(w) : 0;
|
|
44
44
|
}));
|
|
45
|
-
},
|
|
46
|
-
|
|
45
|
+
}, m = n(null), c = n([]);
|
|
46
|
+
B("table-data", { rows: C, columns: c });
|
|
47
47
|
const D = a(() => {
|
|
48
|
-
const e = c.value.map((i) => i.width).filter((i) => !!i), l = e.length,
|
|
49
|
-
return
|
|
50
|
-
}), N = (e) => e !== "" ? e : D.value,
|
|
51
|
-
|
|
48
|
+
const e = c.value.map((i) => i.width).filter((i) => !!i), l = e.length, g = e.reduce((i, f) => (i += Number(f), i), 0), y = c.value.length - l;
|
|
49
|
+
return m.value?.clientWidth ? (m.value?.clientWidth - g) / y : 0;
|
|
50
|
+
}), N = (e) => e !== "" ? e : D.value, p = n(0);
|
|
51
|
+
Q(
|
|
52
52
|
() => t.data,
|
|
53
53
|
async () => {
|
|
54
|
-
|
|
54
|
+
p.value = p.value + 1, o.value = [...t.data], c.value = [], await V();
|
|
55
55
|
const e = r.containerRef.value;
|
|
56
56
|
e && (e.scrollTop = Math.min(
|
|
57
57
|
h.value,
|
|
@@ -62,38 +62,34 @@ const re = /* @__PURE__ */ P({
|
|
|
62
62
|
immediate: !0
|
|
63
63
|
}
|
|
64
64
|
);
|
|
65
|
-
const O = (e) => typeof e == "object" ? "" : e,
|
|
66
|
-
|
|
67
|
-
const
|
|
65
|
+
const O = (e) => typeof e == "object" ? "" : e, R = Y();
|
|
66
|
+
B("table-identifier", R);
|
|
67
|
+
const q = a(() => M(t.virtualHeight)), A = a(() => ({
|
|
68
68
|
...t.borderColor !== void 0 && { "--border-color": t.borderColor },
|
|
69
|
-
...t.cellHeight !== void 0 && { "--table-cell-height":
|
|
69
|
+
...t.cellHeight !== void 0 && { "--table-cell-height": M(t.cellHeight) },
|
|
70
70
|
...t.rowHoverBackground !== void 0 && { "--table-background-row-hover": t.rowHoverBackground }
|
|
71
|
-
})),
|
|
71
|
+
})), E = a(() => ({
|
|
72
72
|
"--table-virtual-row-height": `${t.virtualRowHeight}px`,
|
|
73
|
-
height: u.value ?
|
|
73
|
+
height: u.value ? q.value : void 0,
|
|
74
74
|
overflowY: u.value ? "auto" : void 0
|
|
75
|
-
})), L =
|
|
76
|
-
|
|
77
|
-
}
|
|
78
|
-
transform: `translateY(${r.offsetTop.value}px)`
|
|
79
|
-
})), j = (e, l) => {
|
|
80
|
-
r.measureElement(l, e);
|
|
81
|
-
}, E = () => {
|
|
75
|
+
})), L = r.spacerStyle, U = r.contentStyle, j = (e, l) => {
|
|
76
|
+
r.measureElement(l, $(e));
|
|
77
|
+
}, P = () => {
|
|
82
78
|
r.scrollHandler(), h.value = r.containerRef.value?.scrollTop || 0;
|
|
83
79
|
}, v = (e) => {
|
|
84
80
|
if (!o.value.length) return;
|
|
85
81
|
const l = s.value < 0 ? 0 : Math.min(Math.max(s.value + e, 0), o.value.length - 1);
|
|
86
82
|
s.value = l, r.scrollToIndex(l);
|
|
87
|
-
},
|
|
83
|
+
}, k = { props: t, modifiers: I, rows: o, virtualEnabled: u, virtualRowHeight: b, virtualOverscan: H, virtualDynamicHeight: S, virtualList: r, renderedRows: x, tableRows: C, activeRowIndex: s, lastScrollTop: h, sortData: d, onSort: W, nmorphDOMTable: m, columns: c, defaultColWidth: D, getWidth: N, key: p, tableData: O, tableIdentifier: R, virtualHeight: q, tableStyle: A, tableBodyStyle: E, virtualSpacerStyle: L, virtualContentStyle: U, setVirtualRowRef: j, scrollHandler: P, moveActiveRow: v, tableKeydownHandler: (e) => {
|
|
88
84
|
u.value && (e.key === "ArrowDown" ? (e.preventDefault(), v(1)) : e.key === "ArrowUp" ? (e.preventDefault(), v(-1)) : e.key === "Home" ? (e.preventDefault(), s.value = 0, r.scrollToIndex(0)) : e.key === "End" ? (e.preventDefault(), s.value = o.value.length - 1, r.scrollToIndex(o.value.length - 1)) : e.key === "PageDown" ? (e.preventDefault(), v(
|
|
89
85
|
Math.max(Math.floor((r.viewportHeight.value || t.virtualRowHeight) / t.virtualRowHeight), 1)
|
|
90
86
|
)) : e.key === "PageUp" && (e.preventDefault(), v(
|
|
91
87
|
-Math.max(Math.floor((r.viewportHeight.value || t.virtualRowHeight) / t.virtualRowHeight), 1)
|
|
92
88
|
)));
|
|
93
|
-
}, NmorphSortButton:
|
|
94
|
-
return Object.defineProperty(
|
|
89
|
+
}, NmorphSortButton: F };
|
|
90
|
+
return Object.defineProperty(k, "__isScriptSetup", { enumerable: !1, value: !0 }), k;
|
|
95
91
|
}
|
|
96
92
|
});
|
|
97
93
|
export {
|
|
98
|
-
|
|
94
|
+
le as default
|
|
99
95
|
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import './NmorphVirtualList.css';
|
|
2
|
-
import { defineComponent as K, computed as
|
|
3
|
-
import { useModifiers as
|
|
4
|
-
import {
|
|
5
|
-
|
|
2
|
+
import { defineComponent as K, computed as t } from "vue";
|
|
3
|
+
import { useModifiers as N } from "../../../utils/create-modifiers.js";
|
|
4
|
+
import { toCssSize as p } from "../../../utils/common.js";
|
|
5
|
+
import { useVirtualList as T } from "../../../hooks/use-virtual-list.js";
|
|
6
|
+
const B = /* @__PURE__ */ K({
|
|
6
7
|
__name: "NmorphVirtualList",
|
|
7
8
|
props: {
|
|
8
9
|
items: { type: Array, required: !1, default: () => [] },
|
|
@@ -17,44 +18,44 @@ const j = /* @__PURE__ */ K({
|
|
|
17
18
|
},
|
|
18
19
|
emits: ["on-scroll"],
|
|
19
20
|
setup(y, { expose: h, emit: g }) {
|
|
20
|
-
const e = y,
|
|
21
|
+
const e = y, n = g, a = t(() => e.items), o = t(() => !e.disabled), l = t(() => e.itemHeight), u = t(() => e.overscan), m = t(() => e.dynamic), r = T(a, {
|
|
21
22
|
enabled: o,
|
|
22
|
-
itemHeight:
|
|
23
|
-
overscan:
|
|
24
|
-
dynamic:
|
|
25
|
-
}),
|
|
26
|
-
() =>
|
|
27
|
-
"nmorph-virtual-list": [
|
|
23
|
+
itemHeight: l,
|
|
24
|
+
overscan: u,
|
|
25
|
+
dynamic: m
|
|
26
|
+
}), d = r.containerRef, v = t(
|
|
27
|
+
() => N({
|
|
28
|
+
"nmorph-virtual-list": [e.disabled && "disabled", e.dynamic && "dynamic"]
|
|
28
29
|
})
|
|
29
|
-
),
|
|
30
|
-
"--nmorph-virtual-list-height":
|
|
31
|
-
"--nmorph-virtual-list-max-height":
|
|
30
|
+
), b = t(() => ({
|
|
31
|
+
"--nmorph-virtual-list-height": p(e.height),
|
|
32
|
+
"--nmorph-virtual-list-max-height": p(e.maxHeight),
|
|
32
33
|
"--nmorph-virtual-list-item-height": `${e.itemHeight}px`
|
|
33
|
-
})),
|
|
34
|
-
transform: o.value ? `translateY(${
|
|
35
|
-
})),
|
|
36
|
-
height: o.value ? `${
|
|
37
|
-
})),
|
|
38
|
-
if (typeof e.itemKey == "function") return e.itemKey(
|
|
39
|
-
if (typeof e.itemKey == "string" &&
|
|
40
|
-
const
|
|
41
|
-
return
|
|
34
|
+
})), S = t(() => ({
|
|
35
|
+
transform: o.value ? `translateY(${r.offsetTop.value}px)` : void 0
|
|
36
|
+
})), _ = t(() => ({
|
|
37
|
+
height: o.value ? `${r.totalHeight.value}px` : void 0
|
|
38
|
+
})), q = t(() => r.virtualItems.value), x = (i, s) => {
|
|
39
|
+
if (typeof e.itemKey == "function") return e.itemKey(i, s);
|
|
40
|
+
if (typeof e.itemKey == "string" && i && typeof i == "object") {
|
|
41
|
+
const f = i[e.itemKey];
|
|
42
|
+
return f === void 0 ? s : String(f);
|
|
42
43
|
}
|
|
43
44
|
return s;
|
|
44
|
-
}, H = (
|
|
45
|
-
|
|
46
|
-
}, I = (
|
|
47
|
-
|
|
45
|
+
}, H = (i) => {
|
|
46
|
+
r.scrollHandler(), n("on-scroll", i);
|
|
47
|
+
}, I = (i, s) => {
|
|
48
|
+
r.measureElement(s, i);
|
|
48
49
|
};
|
|
49
50
|
h({
|
|
50
|
-
containerRef:
|
|
51
|
-
refresh:
|
|
52
|
-
scrollToIndex:
|
|
51
|
+
containerRef: d,
|
|
52
|
+
refresh: r.refresh,
|
|
53
|
+
scrollToIndex: r.scrollToIndex
|
|
53
54
|
});
|
|
54
|
-
const
|
|
55
|
-
return Object.defineProperty(
|
|
55
|
+
const c = { props: e, emit: n, items: a, enabled: o, itemHeight: l, overscan: u, dynamic: m, virtualList: r, containerRef: d, modifiers: v, styles: b, contentStyle: S, spacerStyle: _, renderedItems: q, getItemKey: x, scrollHandler: H, setItemRef: I };
|
|
56
|
+
return Object.defineProperty(c, "__isScriptSetup", { enumerable: !1, value: !0 }), c;
|
|
56
57
|
}
|
|
57
58
|
});
|
|
58
59
|
export {
|
|
59
|
-
|
|
60
|
+
B as default
|
|
60
61
|
};
|