@nmorph/nmorph-ui-kit 2.2.18 → 2.2.20
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/circle-close.svg.js +4 -4
- package/dist/assets/icons/clock.svg.js +2 -2
- package/dist/assets/icons/folder-opened.svg.js +8 -8
- package/dist/components/basic/nmorph-button/NmorphButton.css +1 -1
- package/dist/components/basic/nmorph-link/NmorphLink.vue.js +16 -15
- package/dist/components/basic/nmorph-link/NmorphLink.vue2.js +17 -14
- package/dist/components/data/nmorph-badge/NmorphBadge.css +1 -1
- package/dist/components/data/nmorph-badge/NmorphBadge.vue.js +23 -23
- package/dist/components/data/nmorph-badge/NmorphBadge.vue2.js +27 -23
- package/dist/components/data/nmorph-calendar/NmorphCalendar.vue.js +14 -13
- package/dist/components/data/nmorph-calendar/NmorphCalendar.vue2.js +68 -65
- package/dist/components/data/nmorph-calendar/utils.js +4 -3
- package/dist/components/data/nmorph-card/NmorphCard.css +1 -1
- package/dist/components/data/nmorph-card/NmorphCard.vue.js +27 -26
- package/dist/components/data/nmorph-card/NmorphCard.vue2.js +21 -13
- package/dist/components/data/nmorph-carousel/NmorphCarousel.vue.js +39 -42
- package/dist/components/data/nmorph-carousel/NmorphCarousel.vue2.js +25 -36
- package/dist/components/data/nmorph-carousel/components/nmorph-carousel-item/NmorphCarouselItem.vue2.js +15 -11
- package/dist/components/data/nmorph-collapse/components/nmorph-collapse-item/NmorphCollapseItem.css +1 -1
- package/dist/components/data/nmorph-collapse/components/nmorph-collapse-item/NmorphCollapseItem.vue.js +14 -13
- package/dist/components/data/nmorph-collapse/components/nmorph-collapse-item/NmorphCollapseItem.vue2.js +42 -27
- package/dist/components/data/nmorph-empty/NmorphEmpty.css +1 -0
- package/dist/components/data/nmorph-empty/NmorphEmpty.vue.js +64 -0
- package/dist/components/data/nmorph-empty/NmorphEmpty.vue2.js +43 -0
- package/dist/components/data/nmorph-image-preview/NmorphImagePreview.css +1 -1
- package/dist/components/data/nmorph-image-preview/NmorphImagePreview.vue.js +64 -61
- package/dist/components/data/nmorph-image-preview/NmorphImagePreview.vue2.js +70 -60
- package/dist/components/data/nmorph-progress/NmorphProgress.vue.js +24 -29
- package/dist/components/data/nmorph-progress/NmorphProgress.vue2.js +25 -14
- package/dist/components/data/nmorph-skeleton/NmorphSkeleton.vue.js +20 -19
- package/dist/components/data/nmorph-skeleton/NmorphSkeleton.vue2.js +15 -12
- package/dist/components/data/nmorph-table/NmorphTable.vue.js +35 -31
- package/dist/components/data/nmorph-table/NmorphTable.vue2.js +64 -50
- package/dist/components/data/nmorph-tag-list/components/nmorph-tag-item/NmorphTagItem.css +1 -1
- package/dist/components/feedback/nmorph-alert/NmorphAlert.vue.js +8 -8
- package/dist/components/feedback/nmorph-alert/NmorphAlert.vue2.js +26 -22
- package/dist/components/feedback/nmorph-callout/NmorphCallout.css +1 -1
- package/dist/components/feedback/nmorph-callout/NmorphCallout.vue.js +16 -15
- package/dist/components/feedback/nmorph-callout/NmorphCallout.vue2.js +11 -8
- package/dist/components/feedback/nmorph-tooltip/NmorphTooltip.css +1 -1
- package/dist/components/feedback/nmorph-tooltip/NmorphTooltip.vue.js +13 -13
- package/dist/components/feedback/nmorph-tooltip/NmorphTooltip.vue2.js +33 -19
- package/dist/components/form/nmorph-autocomplete/NmorphAutocomplete.vue.js +1 -1
- package/dist/components/form/nmorph-date-picker/NmorphDatePicker.css +1 -1
- package/dist/components/form/nmorph-date-picker/NmorphDatePicker.vue.js +16 -15
- package/dist/components/form/nmorph-date-picker/NmorphDatePicker.vue2.js +39 -32
- package/dist/components/form/nmorph-number-input/NmorphNumberInput.css +1 -1
- package/dist/components/form/nmorph-number-input/NmorphNumberInput.vue.js +7 -7
- package/dist/components/form/nmorph-select/NmorphSelect.vue.js +40 -39
- package/dist/components/form/nmorph-select/NmorphSelect.vue2.js +53 -50
- package/dist/components/form/nmorph-select/components/nmorph-select-option/NmorphSelectOption.vue.js +16 -15
- package/dist/components/form/nmorph-select/components/nmorph-select-option/NmorphSelectOption.vue2.js +21 -16
- package/dist/components/form/nmorph-select-button/NmorphSelectButton.vue.js +16 -15
- package/dist/components/form/nmorph-select-button/NmorphSelectButton.vue2.js +26 -19
- package/dist/components/form/nmorph-slider/NmorphSlider.vue.js +4 -4
- package/dist/components/form/nmorph-slider/NmorphSlider.vue2.js +48 -38
- package/dist/components/form/nmorph-switch/NmorphSwitch.css +1 -1
- package/dist/components/form/nmorph-switch/NmorphSwitch.vue.js +18 -17
- package/dist/components/form/nmorph-switch/NmorphSwitch.vue2.js +38 -27
- package/dist/components/form/nmorph-time-picker/NmorphTimePicker.css +1 -0
- package/dist/components/form/nmorph-time-picker/NmorphTimePicker.vue.js +183 -0
- package/dist/components/form/nmorph-time-picker/NmorphTimePicker.vue2.js +111 -0
- package/dist/components/navigation/nmorph-context-menu/NmorphContextMenu.css +1 -1
- package/dist/components/providers/nmorph-notification-provider/NmorphNotificationProvider.vue.js +9 -8
- package/dist/components/providers/nmorph-notification-provider/NmorphNotificationProvider.vue2.js +14 -14
- package/dist/hooks/use-common-styles.js +75 -9
- package/dist/hooks/use-virtual-list.js +3 -1
- package/dist/index.es.js +654 -650
- package/dist/index.umd.js +101 -35
- package/dist/locales/en.js +1 -0
- package/dist/locales/ru.js +1 -0
- package/dist/locales/zh.js +1 -0
- package/dist/package.json.js +1 -1
- package/dist/src/components/basic/nmorph-link/NmorphLink.vue.d.ts +2 -0
- package/dist/src/components/data/index.d.ts +1 -0
- package/dist/src/components/data/nmorph-badge/NmorphBadge.vue.d.ts +2 -0
- package/dist/src/components/data/nmorph-calendar/NmorphCalendar.vue.d.ts +2 -0
- package/dist/src/components/data/nmorph-card/NmorphCard.vue.d.ts +7 -5
- package/dist/src/components/data/nmorph-carousel/NmorphCarousel.vue.d.ts +1 -3
- package/dist/src/components/data/nmorph-collapse/components/nmorph-collapse-item/NmorphCollapseItem.vue.d.ts +2 -0
- package/dist/src/components/data/nmorph-empty/NmorphEmpty.vue.d.ts +36 -0
- package/dist/src/components/data/nmorph-image-preview/NmorphImagePreview.vue.d.ts +6 -0
- package/dist/src/components/data/nmorph-progress/NmorphProgress.vue.d.ts +6 -0
- package/dist/src/components/data/nmorph-skeleton/NmorphSkeleton.vue.d.ts +2 -0
- package/dist/src/components/data/nmorph-table/NmorphTable.vue.d.ts +6 -0
- package/dist/src/components/feedback/nmorph-alert/NmorphAlert.vue.d.ts +1 -0
- package/dist/src/components/feedback/nmorph-alert/types.d.ts +1 -0
- package/dist/src/components/feedback/nmorph-callout/NmorphCallout.vue.d.ts +2 -0
- package/dist/src/components/feedback/nmorph-tooltip/NmorphTooltip.vue.d.ts +8 -0
- package/dist/src/components/form/index.d.ts +2 -0
- package/dist/src/components/form/nmorph-date-picker/NmorphDatePicker.vue.d.ts +4 -0
- package/dist/src/components/form/nmorph-select/NmorphSelect.vue.d.ts +2 -0
- package/dist/src/components/form/nmorph-select/components/nmorph-select-option/NmorphSelectOption.vue.d.ts +2 -0
- package/dist/src/components/form/nmorph-select/types.d.ts +2 -0
- package/dist/src/components/form/nmorph-select-button/NmorphSelectButton.vue.d.ts +6 -0
- package/dist/src/components/form/nmorph-slider/types.d.ts +4 -0
- package/dist/src/components/form/nmorph-switch/NmorphSwitch.vue.d.ts +8 -0
- package/dist/src/components/form/nmorph-time-picker/NmorphTimePicker.vue.d.ts +44 -0
- package/dist/src/components/form/nmorph-time-picker/types.d.ts +6 -0
- package/dist/src/components/navigation/nmorph-context-menu/NmorphContextMenu.vue.d.ts +3 -3
- package/dist/src/components/navigation/nmorph-dropdown/NmorphDropdown.vue.d.ts +2 -2
- package/dist/src/outside-hooks/use-nmorph-notification.d.ts +2 -0
- package/dist/style.css +1 -1
- package/package.json +6 -5
|
@@ -1,133 +1,136 @@
|
|
|
1
1
|
import './NmorphCalendar.css';
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
import { useModifiers as
|
|
4
|
-
import
|
|
5
|
-
import { useCalendarTexts as
|
|
6
|
-
import { hasAnyRangeDateInPrevMonth as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
const
|
|
2
|
+
import { defineComponent as O, ref as N, onMounted as k, reactive as j, watch as h, computed as i } from "vue";
|
|
3
|
+
import { useModifiers as z } from "../../../utils/create-modifiers.js";
|
|
4
|
+
import W from "./inner-components/nmorph-calendar-header/NmorphCalendarHeader.vue.js";
|
|
5
|
+
import { useCalendarTexts as Z } from "./hooks/use-calendar-texts.js";
|
|
6
|
+
import { hasAnyRangeDateInPrevMonth as $, hasAnyRangeDateInNextMonth as F, isTodayInMonthRange as G, resetTimeToZero as d, getMonthDaysByWeek as J } from "./utils.js";
|
|
7
|
+
import K from "../nmorph-table/components/nmorph-table-cell/NmorphTableCell.vue.js";
|
|
8
|
+
import L from "../nmorph-table/components/nmorph-table-column/NmorphTableColumn.vue.js";
|
|
9
|
+
import Q from "../nmorph-table/NmorphTable.vue.js";
|
|
10
|
+
const le = /* @__PURE__ */ O({
|
|
11
11
|
__name: "NmorphCalendar",
|
|
12
12
|
props: {
|
|
13
13
|
markToday: { type: Boolean, required: !1, default: !0 },
|
|
14
14
|
initialDate: { type: Date, required: !1, default: () => /* @__PURE__ */ new Date() },
|
|
15
15
|
range: { type: null, required: !1, default: void 0 },
|
|
16
16
|
type: { type: null, required: !1, default: "date" },
|
|
17
|
-
modelValue: { type: [Date, Array, null], required: !1, default: () => /* @__PURE__ */ new Date() }
|
|
17
|
+
modelValue: { type: [Date, Array, null], required: !1, default: () => /* @__PURE__ */ new Date() },
|
|
18
|
+
cellHeight: { type: [Number, String], required: !1, default: void 0 }
|
|
18
19
|
},
|
|
19
20
|
emits: ["update:model-value", "update-initial-date"],
|
|
20
|
-
setup(
|
|
21
|
+
setup(b, { expose: _, emit: C }) {
|
|
21
22
|
_();
|
|
22
|
-
const
|
|
23
|
+
const a = b, s = C, { days: v } = Z(), y = () => {
|
|
23
24
|
o.value = M.value;
|
|
24
25
|
}, B = () => {
|
|
25
26
|
o.value = /* @__PURE__ */ new Date();
|
|
26
|
-
},
|
|
27
|
+
}, g = () => {
|
|
27
28
|
o.value = A.value;
|
|
28
29
|
}, u = () => {
|
|
29
30
|
throw new Error("model value and type prop not matched");
|
|
30
31
|
}, c = (e) => {
|
|
31
32
|
if (e === null) return null;
|
|
32
|
-
if (
|
|
33
|
+
if (a.type === "date") {
|
|
33
34
|
if (e instanceof Date)
|
|
34
|
-
return
|
|
35
|
+
return d(e);
|
|
35
36
|
u();
|
|
36
37
|
}
|
|
37
|
-
const l = Array.isArray(e) && e.every((
|
|
38
|
-
if (
|
|
38
|
+
const l = Array.isArray(e) && e.every((r) => r instanceof Date);
|
|
39
|
+
if (a.type === "dates") {
|
|
39
40
|
if (l)
|
|
40
|
-
return e.map((
|
|
41
|
+
return e.map((r) => d(r));
|
|
41
42
|
u();
|
|
42
43
|
}
|
|
43
|
-
if (
|
|
44
|
+
if (a.type === "daterange") {
|
|
44
45
|
if (l)
|
|
45
|
-
return e.map((
|
|
46
|
+
return e.map((r) => d(r)).slice(0, 2);
|
|
46
47
|
u();
|
|
47
48
|
}
|
|
48
|
-
},
|
|
49
|
+
}, q = (e) => {
|
|
49
50
|
if (t.value === null) return;
|
|
50
|
-
const { monthType: l, hidden:
|
|
51
|
-
if (
|
|
52
|
-
l === "next" &&
|
|
51
|
+
const { monthType: l, hidden: r } = e;
|
|
52
|
+
if (r) return;
|
|
53
|
+
l === "next" && g(), l === "previous" && y();
|
|
53
54
|
const { date: n } = e;
|
|
54
|
-
if (
|
|
55
|
+
if (a.type === "date" && (t.value = n, s("update:model-value", t.value)), a.type === "dates") {
|
|
55
56
|
if (!Array.isArray(t.value)) return u();
|
|
56
|
-
const m = n.toDateString(),
|
|
57
|
-
|
|
57
|
+
const m = n.toDateString(), w = t.value.map((R) => R.toDateString()).indexOf(m);
|
|
58
|
+
w !== -1 ? t.value.splice(w, 1) : t.value.push(n), s("update:model-value", t.value);
|
|
58
59
|
}
|
|
59
|
-
if (
|
|
60
|
+
if (a.type === "daterange") {
|
|
60
61
|
if (!Array.isArray(t.value)) return u();
|
|
61
62
|
t.value.length === 0 ? t.value.push(n) : t.value.length === 1 ? n < t.value[0] ? t.value = [n, t.value[0]] : t.value.push(n) : t.value = [n], s("update:model-value", t.value.slice(0, 2));
|
|
62
63
|
}
|
|
63
|
-
},
|
|
64
|
-
const [
|
|
65
|
-
return l.length === 1 ? e.toDateString() ===
|
|
64
|
+
}, D = (e, l) => {
|
|
65
|
+
const [r, n] = l;
|
|
66
|
+
return l.length === 1 ? e.toDateString() === r.toDateString() : r && n ? e >= d(r) && e <= d(n) : !1;
|
|
66
67
|
}, V = (e) => {
|
|
67
68
|
if (t.value === null) return !1;
|
|
68
|
-
if (
|
|
69
|
+
if (a.type === "date")
|
|
69
70
|
return Array.isArray(t.value) ? u() : t.value.toDateString() === e.toDateString();
|
|
70
|
-
if (
|
|
71
|
-
return Array.isArray(t.value) ? !!t.value.find((
|
|
72
|
-
if (
|
|
73
|
-
return Array.isArray(t.value) ?
|
|
74
|
-
}, o =
|
|
75
|
-
|
|
71
|
+
if (a.type === "dates")
|
|
72
|
+
return Array.isArray(t.value) ? !!t.value.find((r) => r.toDateString() === e.toDateString()) : u();
|
|
73
|
+
if (a.type === "daterange")
|
|
74
|
+
return Array.isArray(t.value) ? D(e, t.value) : u();
|
|
75
|
+
}, o = N(a.initialDate), t = N(c(a.modelValue));
|
|
76
|
+
k(() => {
|
|
76
77
|
s("update:model-value", t.value);
|
|
77
78
|
});
|
|
78
|
-
let
|
|
79
|
+
let p = j([]);
|
|
79
80
|
const f = () => {
|
|
80
|
-
|
|
81
|
-
const
|
|
81
|
+
p = [], J(o, a.range).forEach((l) => {
|
|
82
|
+
const r = {};
|
|
82
83
|
l.forEach((n, m) => {
|
|
83
|
-
const
|
|
84
|
-
|
|
85
|
-
}),
|
|
84
|
+
const T = v[m];
|
|
85
|
+
r[T] = n;
|
|
86
|
+
}), p.push(r);
|
|
86
87
|
});
|
|
87
88
|
};
|
|
88
|
-
|
|
89
|
-
() =>
|
|
89
|
+
h(
|
|
90
|
+
() => a.initialDate,
|
|
90
91
|
(e) => {
|
|
91
92
|
o.value = e;
|
|
92
93
|
},
|
|
93
94
|
{
|
|
94
95
|
deep: !0
|
|
95
96
|
}
|
|
96
|
-
),
|
|
97
|
+
), h(o, () => {
|
|
97
98
|
f(), s("update-initial-date", o.value);
|
|
98
|
-
}),
|
|
99
|
-
() =>
|
|
99
|
+
}), h(
|
|
100
|
+
() => a.modelValue,
|
|
100
101
|
(e) => {
|
|
101
102
|
t.value = c(e);
|
|
102
103
|
}
|
|
103
104
|
);
|
|
104
|
-
const M =
|
|
105
|
-
const { range: e } =
|
|
105
|
+
const M = i(() => new Date(o.value.setMonth(o.value.getMonth() - 1))), A = i(() => new Date(o.value.setMonth(o.value.getMonth() + 1))), E = i(() => {
|
|
106
|
+
const { range: e } = a, l = e ? $(o.value, e[0]) : !0, r = e ? F(o.value, e[1]) : !0, n = G(e);
|
|
106
107
|
return {
|
|
107
108
|
showPreviousMonthButton: l,
|
|
108
|
-
showNextMonthButton:
|
|
109
|
+
showNextMonthButton: r,
|
|
109
110
|
showTodayButton: n
|
|
110
111
|
};
|
|
111
|
-
}),
|
|
112
|
-
() =>
|
|
112
|
+
}), H = i(
|
|
113
|
+
() => z({
|
|
113
114
|
"nmorph-calendar": []
|
|
114
115
|
})
|
|
115
|
-
),
|
|
116
|
+
), x = (e) => typeof e == "number" ? `${e}px` : e, I = i(() => ({
|
|
117
|
+
...a.cellHeight !== void 0 && { "--table-data-cell-height": x(a.cellHeight) }
|
|
118
|
+
})), P = (e) => e;
|
|
116
119
|
f();
|
|
117
|
-
const
|
|
118
|
-
return
|
|
120
|
+
const S = { props: a, emit: s, days: v, setPreviousMonth: y, setTodayMonth: B, setNextMonth: g, wrongType: u, convertValue: c, clickDate: q, isDateInRange: D, isValueSelected: V, initialDate: o, selectedValue: t, get calendar() {
|
|
121
|
+
return p;
|
|
119
122
|
}, set calendar(e) {
|
|
120
|
-
|
|
121
|
-
}, updateCalendar: f, prevMonth: M, nextMonth: A, showHeaderButtons:
|
|
122
|
-
return
|
|
123
|
+
p = e;
|
|
124
|
+
}, updateCalendar: f, prevMonth: M, nextMonth: A, showHeaderButtons: E, modifiers: H, getCssSize: x, styles: I, dateData: P, get NmorphTable() {
|
|
125
|
+
return Q;
|
|
123
126
|
}, get NmorphTableColumn() {
|
|
124
|
-
return
|
|
127
|
+
return L;
|
|
125
128
|
}, get NmorphTableCell() {
|
|
126
|
-
return
|
|
127
|
-
}, NmorphCalendarHeader:
|
|
128
|
-
return Object.defineProperty(
|
|
129
|
+
return K;
|
|
130
|
+
}, NmorphCalendarHeader: W };
|
|
131
|
+
return Object.defineProperty(S, "__isScriptSetup", { enumerable: !1, value: !0 }), S;
|
|
129
132
|
}
|
|
130
133
|
});
|
|
131
134
|
export {
|
|
132
|
-
|
|
135
|
+
le as default
|
|
133
136
|
};
|
|
@@ -20,9 +20,10 @@ const H = (t) => {
|
|
|
20
20
|
return e.replace(/YYYY|YY|MM|M|DD|D/g, (n) => a[n]);
|
|
21
21
|
}, P = (t, e = {}) => {
|
|
22
22
|
if (!t) return;
|
|
23
|
-
const a = (n) => e.formatter ? e.formatter(n) : e.format ? C(n, e.format) : new Intl.DateTimeFormat(
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
const a = (n) => e.formatter ? e.formatter(n) : e.format ? C(n, e.format) : new Intl.DateTimeFormat(
|
|
24
|
+
e.locale || "en-CA",
|
|
25
|
+
e.options || W
|
|
26
|
+
).format(n);
|
|
26
27
|
return Array.isArray(t) ? t.map((n) => n ? a(n) : null) : a(t);
|
|
27
28
|
}, Z = (t) => P(t), b = (t, e) => t.getMonth() > e.getMonth(), j = (t, e) => t.getMonth() < e.getMonth(), q = (t) => {
|
|
28
29
|
const e = /* @__PURE__ */ new Date();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.nmorph-card{--card-padding: var(--indentation-04);display:flex;flex-direction:column;width:100%;padding:var(--card-padding);border-radius:var(--default-border-radius)}.nmorph-card .nmorph-card__content{height:100%}.nmorph-card .nmorph-card__header{font-weight:600;font-size:var(--font-size-large);line-height:var(--line-height-loose)}.nmorph-card .nmorph-card__footer{height:fit-content;margin-top:4px;font-weight:400;font-size:var(--font-size-extra-small);line-height:var(--line-height-regular)}.nmorph-card.nmorph--shadow-combined{background:var(--nmorph-main-color);border:var(--nmorph-card-combined-border-width) solid var(--nmorph-main-color);box-shadow:var(--base-shadow-width) var(--base-shadow-width) var(--base-shadow-blur) var(--nmorph-dark-shade-color),calc(-1 * var(--base-shadow-width)) calc(-1 * var(--base-shadow-width)) var(--base-shadow-blur) var(--nmorph-light-shade-color),inset var(--base-shadow-width) var(--base-shadow-width) var(--base-shadow-blur) var(--nmorph-dark-shade-color),inset calc(-1 * var(--base-shadow-width)) calc(-.5 * var(--base-shadow-width)) var(--base-shadow-blur) var(--nmorph-light-shade-color)}
|
|
1
|
+
.nmorph-card{--card-padding: var(--indentation-04);display:flex;flex-direction:column;width:fit-content;max-width:100%;padding:var(--card-padding);border-radius:var(--default-border-radius)}.nmorph-card.nmorph-card--fill{width:100%}.nmorph-card .nmorph-card__content{height:100%}.nmorph-card .nmorph-card__header{font-weight:600;font-size:var(--font-size-large);line-height:var(--line-height-loose)}.nmorph-card .nmorph-card__footer{height:fit-content;margin-top:4px;font-weight:400;font-size:var(--font-size-extra-small);line-height:var(--line-height-regular)}.nmorph-card.nmorph--shadow-combined{background:var(--nmorph-main-color);border:var(--nmorph-card-combined-border-width) solid var(--nmorph-main-color);box-shadow:var(--base-shadow-width) var(--base-shadow-width) var(--base-shadow-blur) var(--nmorph-dark-shade-color),calc(-1 * var(--base-shadow-width)) calc(-1 * var(--base-shadow-width)) var(--base-shadow-blur) var(--nmorph-light-shade-color),inset var(--base-shadow-width) var(--base-shadow-width) var(--base-shadow-blur) var(--nmorph-dark-shade-color),inset calc(-1 * var(--base-shadow-width)) calc(-.5 * var(--base-shadow-width)) var(--base-shadow-blur) var(--nmorph-light-shade-color)}
|
|
@@ -1,35 +1,36 @@
|
|
|
1
1
|
import './NmorphCard.css';
|
|
2
|
-
import
|
|
3
|
-
import { openBlock as
|
|
2
|
+
import l from "./NmorphCard.vue2.js";
|
|
3
|
+
import { openBlock as r, createBlock as n, resolveDynamicComponent as c, normalizeStyle as d, normalizeClass as m, withCtx as i, createElementBlock as s, renderSlot as t, createCommentVNode as a, createElementVNode as _ } from "vue";
|
|
4
4
|
/* empty css */
|
|
5
|
-
import
|
|
6
|
-
const
|
|
5
|
+
import f from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
6
|
+
const p = {
|
|
7
7
|
key: 0,
|
|
8
|
+
class: "nmorph-card__header"
|
|
9
|
+
}, h = { class: "nmorph-card__content" }, y = {
|
|
10
|
+
key: 1,
|
|
8
11
|
class: "nmorph-card__footer"
|
|
9
12
|
};
|
|
10
|
-
function
|
|
11
|
-
return
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
function v(e, k, C, o, u, N) {
|
|
14
|
+
return r(), n(c(o.props.tag), {
|
|
15
|
+
class: m(o.modifiers),
|
|
16
|
+
style: d(o.styles)
|
|
17
|
+
}, {
|
|
18
|
+
default: i(() => [
|
|
19
|
+
o.slots.header ? (r(), s("div", p, [
|
|
20
|
+
t(e.$slots, "header")
|
|
21
|
+
])) : a("v-if", !0),
|
|
22
|
+
_("div", h, [
|
|
23
|
+
t(e.$slots, "default")
|
|
20
24
|
]),
|
|
21
|
-
|
|
22
|
-
e
|
|
23
|
-
]),
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
6
|
|
29
|
-
/* CLASS, STYLE */
|
|
30
|
-
);
|
|
25
|
+
o.slots.footer ? (r(), s("div", y, [
|
|
26
|
+
t(e.$slots, "footer")
|
|
27
|
+
])) : a("v-if", !0)
|
|
28
|
+
]),
|
|
29
|
+
_: 3
|
|
30
|
+
/* FORWARDED */
|
|
31
|
+
}, 8, ["class", "style"]);
|
|
31
32
|
}
|
|
32
|
-
const
|
|
33
|
+
const S = /* @__PURE__ */ f(l, [["render", v], ["__file", "/builds/ketjo/nmorph/library/src/components/data/nmorph-card/NmorphCard.vue"]]);
|
|
33
34
|
export {
|
|
34
|
-
|
|
35
|
+
S as default
|
|
35
36
|
};
|
|
@@ -1,24 +1,32 @@
|
|
|
1
1
|
import './NmorphCard.css';
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
import { NmorphShadowType as
|
|
4
|
-
import { useModifiers as
|
|
5
|
-
const
|
|
2
|
+
import { defineComponent as f, useSlots as u, computed as t } from "vue";
|
|
3
|
+
import { NmorphShadowType as l } from "../../../types/index.js";
|
|
4
|
+
import { useModifiers as m } from "../../../utils/create-modifiers.js";
|
|
5
|
+
const b = /* @__PURE__ */ f({
|
|
6
6
|
__name: "NmorphCard",
|
|
7
7
|
props: {
|
|
8
8
|
shadowType: { type: null, required: !1, default: "outset" },
|
|
9
|
-
combinedShadowBorderWidth: { type: Number, required: !1, default: 0 }
|
|
9
|
+
combinedShadowBorderWidth: { type: Number, required: !1, default: 0 },
|
|
10
|
+
cardPadding: { type: [Number, String], required: !1, default: void 0 },
|
|
11
|
+
fill: { type: Boolean, required: !1, default: !0 },
|
|
12
|
+
tag: { type: String, required: !1, default: "div" }
|
|
10
13
|
},
|
|
11
|
-
setup(
|
|
12
|
-
|
|
13
|
-
const e =
|
|
14
|
-
() =>
|
|
15
|
-
nmorph: [
|
|
16
|
-
"nmorph-card": [e.shadowType]
|
|
14
|
+
setup(i, { expose: s }) {
|
|
15
|
+
s();
|
|
16
|
+
const e = i, a = u(), n = t(
|
|
17
|
+
() => m({
|
|
18
|
+
nmorph: [l[e.shadowType]],
|
|
19
|
+
"nmorph-card": [e.shadowType, e.fill ? "fill" : "fit-content"]
|
|
17
20
|
})
|
|
18
|
-
),
|
|
21
|
+
), d = (r) => typeof r == "number" ? `${r}px` : r, p = t(() => ({
|
|
22
|
+
...e.shadowType === "combined" && {
|
|
23
|
+
"--nmorph-card-combined-border-width": `${e.combinedShadowBorderWidth}px`
|
|
24
|
+
},
|
|
25
|
+
...e.cardPadding !== void 0 && { "--card-padding": d(e.cardPadding) }
|
|
26
|
+
})), o = { props: e, slots: a, modifiers: n, getCssSize: d, styles: p };
|
|
19
27
|
return Object.defineProperty(o, "__isScriptSetup", { enumerable: !1, value: !0 }), o;
|
|
20
28
|
}
|
|
21
29
|
});
|
|
22
30
|
export {
|
|
23
|
-
|
|
31
|
+
b as default
|
|
24
32
|
};
|
|
@@ -1,93 +1,90 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { openBlock as o, createElementBlock as
|
|
3
|
-
import
|
|
4
|
-
const v = ["id"],
|
|
5
|
-
function
|
|
6
|
-
return o(),
|
|
1
|
+
import d from "./NmorphCarousel.vue2.js";
|
|
2
|
+
import { openBlock as o, createElementBlock as e, normalizeClass as t, createElementVNode as n, normalizeStyle as h, Fragment as i, renderList as s, createVNode as l, withCtx as m, renderSlot as u } from "vue";
|
|
3
|
+
import p from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const v = ["id"], f = { class: "nmorph-carousel__elements-indicator" }, C = ["onClick"];
|
|
5
|
+
function k(_, N, I, r, b, w) {
|
|
6
|
+
return o(), e(
|
|
7
7
|
"div",
|
|
8
8
|
{
|
|
9
|
-
class:
|
|
9
|
+
class: t(r.modifiers)
|
|
10
10
|
},
|
|
11
11
|
[
|
|
12
|
-
|
|
12
|
+
n(
|
|
13
13
|
"div",
|
|
14
14
|
{
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
style: u({ transform: r.translateX })
|
|
15
|
+
class: "nmorph-carousel__wrapper transition-enabled",
|
|
16
|
+
style: h({ transform: r.translateX })
|
|
18
17
|
},
|
|
19
18
|
[
|
|
20
|
-
(o(!0),
|
|
21
|
-
|
|
19
|
+
(o(!0), e(
|
|
20
|
+
i,
|
|
22
21
|
null,
|
|
23
|
-
|
|
24
|
-
id: `nmorph-carousel-item-${r.carouselId}-${
|
|
25
|
-
key:
|
|
26
|
-
ref_for: !0,
|
|
27
|
-
ref: (i) => r.setItemRef(i, e),
|
|
22
|
+
s(r.carouselData, (a) => (o(), e("div", {
|
|
23
|
+
id: `nmorph-carousel-item-${r.carouselId}-${a}`,
|
|
24
|
+
key: a,
|
|
28
25
|
class: "nmorph-carousel__item"
|
|
29
26
|
}, null, 8, v))),
|
|
30
27
|
128
|
|
31
28
|
/* KEYED_FRAGMENT */
|
|
32
29
|
))
|
|
33
30
|
],
|
|
34
|
-
|
|
35
|
-
/*
|
|
31
|
+
4
|
|
32
|
+
/* STYLE */
|
|
36
33
|
),
|
|
37
|
-
|
|
38
|
-
(o(!0),
|
|
39
|
-
|
|
34
|
+
n("div", f, [
|
|
35
|
+
(o(!0), e(
|
|
36
|
+
i,
|
|
40
37
|
null,
|
|
41
|
-
|
|
42
|
-
key:
|
|
38
|
+
s(r.carouselData, (a, c) => (o(), e("div", {
|
|
39
|
+
key: c,
|
|
43
40
|
class: "nmorph-carousel__element-indicator-wrapper",
|
|
44
|
-
onClick: (
|
|
41
|
+
onClick: (y) => r.elementIndicator(c)
|
|
45
42
|
}, [
|
|
46
|
-
|
|
43
|
+
n(
|
|
47
44
|
"div",
|
|
48
45
|
{
|
|
49
|
-
class:
|
|
46
|
+
class: t(["nmorph-carousel__element-indicator", { "nmorph-carousel__element-indicator--active": r.isCurrentElementActive(c) }])
|
|
50
47
|
},
|
|
51
48
|
null,
|
|
52
49
|
2
|
|
53
50
|
/* CLASS */
|
|
54
51
|
)
|
|
55
|
-
], 8,
|
|
52
|
+
], 8, C))),
|
|
56
53
|
128
|
|
57
54
|
/* KEYED_FRAGMENT */
|
|
58
55
|
))
|
|
59
56
|
]),
|
|
60
|
-
|
|
57
|
+
n("div", {
|
|
61
58
|
class: "nmorph-carousel__action-btn nmorph-carousel__prev",
|
|
62
|
-
onClick: r.
|
|
59
|
+
onClick: r.nextSlide
|
|
63
60
|
}, [
|
|
64
|
-
|
|
65
|
-
default:
|
|
66
|
-
|
|
61
|
+
l(r.NmorphIcon, null, {
|
|
62
|
+
default: m(() => [
|
|
63
|
+
l(r.NmorphIconChevronDown)
|
|
67
64
|
]),
|
|
68
65
|
_: 1
|
|
69
66
|
/* STABLE */
|
|
70
67
|
})
|
|
71
68
|
]),
|
|
72
|
-
|
|
69
|
+
n("div", {
|
|
73
70
|
class: "nmorph-carousel__action-btn nmorph-carousel__next",
|
|
74
|
-
onClick: r.
|
|
71
|
+
onClick: r.prevSlide
|
|
75
72
|
}, [
|
|
76
|
-
|
|
77
|
-
default:
|
|
78
|
-
|
|
73
|
+
l(r.NmorphIcon, null, {
|
|
74
|
+
default: m(() => [
|
|
75
|
+
l(r.NmorphIconChevronDown)
|
|
79
76
|
]),
|
|
80
77
|
_: 1
|
|
81
78
|
/* STABLE */
|
|
82
79
|
})
|
|
83
80
|
]),
|
|
84
|
-
|
|
81
|
+
u(_.$slots, "default")
|
|
85
82
|
],
|
|
86
83
|
2
|
|
87
84
|
/* CLASS */
|
|
88
85
|
);
|
|
89
86
|
}
|
|
90
|
-
const
|
|
87
|
+
const E = /* @__PURE__ */ p(d, [["render", k], ["__file", "/builds/ketjo/nmorph/library/src/components/data/nmorph-carousel/NmorphCarousel.vue"]]);
|
|
91
88
|
export {
|
|
92
|
-
|
|
89
|
+
E as default
|
|
93
90
|
};
|
|
@@ -1,52 +1,41 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useModifiers as
|
|
1
|
+
import { defineComponent as N, ref as p, computed as a, provide as D, watch as d } from "vue";
|
|
2
|
+
import { useModifiers as M } from "../../../utils/create-modifiers.js";
|
|
3
3
|
import { generateUUID as w } from "../../../utils/common.js";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
const
|
|
4
|
+
import b from "../../basic/nmorph-icon/NmorphIcon.vue.js";
|
|
5
|
+
import y from "../../../assets/icons/chevron-down.svg.js";
|
|
6
|
+
const A = /* @__PURE__ */ N({
|
|
7
7
|
__name: "NmorphCarousel",
|
|
8
8
|
props: {
|
|
9
9
|
loop: { type: Boolean, required: !1, default: !0 }
|
|
10
10
|
},
|
|
11
11
|
emits: ["change"],
|
|
12
|
-
setup(
|
|
13
|
-
|
|
14
|
-
const e =
|
|
15
|
-
|
|
16
|
-
}, g = () => {
|
|
17
|
-
e.value = e.value - 1;
|
|
18
|
-
}, s = f, u = I, S = v(
|
|
19
|
-
() => D({
|
|
12
|
+
setup(v, { expose: f, emit: h }) {
|
|
13
|
+
f();
|
|
14
|
+
const e = p(0), u = v, l = h, _ = a(
|
|
15
|
+
() => M({
|
|
20
16
|
"nmorph-carousel": []
|
|
21
17
|
})
|
|
22
|
-
),
|
|
23
|
-
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
},
|
|
28
|
-
|
|
18
|
+
), n = p([]), s = w();
|
|
19
|
+
D("carousel-data", { data: n, carouselId: s });
|
|
20
|
+
const r = a(() => n.value.length), c = (t) => r.value ? u.loop ? (t + r.value) % r.value : Math.min(Math.max(t, 0), r.value - 1) : 0, o = (t) => {
|
|
21
|
+
const m = c(t);
|
|
22
|
+
m !== e.value && (e.value = m);
|
|
23
|
+
}, I = () => o(e.value - 1), S = () => o(e.value + 1), g = a(() => `translateX(-${e.value * 100}%)`), x = (t) => t === e.value, C = (t) => {
|
|
24
|
+
o(t);
|
|
29
25
|
};
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}),
|
|
33
|
-
|
|
34
|
-
r.value = !0;
|
|
35
|
-
});
|
|
26
|
+
d(r, (t) => {
|
|
27
|
+
e.value > t - 1 && (e.value = Math.max(t - 1, 0));
|
|
28
|
+
}), d(e, () => {
|
|
29
|
+
l("change", e.value);
|
|
36
30
|
});
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
n[l] = N;
|
|
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
|
-
e.value = t + 1;
|
|
42
|
-
}, get NmorphIcon() {
|
|
43
|
-
return A;
|
|
31
|
+
const i = { currentSlide: e, props: u, emit: l, modifiers: _, carouselData: n, carouselId: s, slideCount: r, normalizeSlideIndex: c, goToSlide: o, prevSlide: I, nextSlide: S, translateX: g, isCurrentElementActive: x, elementIndicator: C, get NmorphIcon() {
|
|
32
|
+
return b;
|
|
44
33
|
}, get NmorphIconChevronDown() {
|
|
45
|
-
return
|
|
34
|
+
return y;
|
|
46
35
|
} };
|
|
47
|
-
return Object.defineProperty(
|
|
36
|
+
return Object.defineProperty(i, "__isScriptSetup", { enumerable: !1, value: !0 }), i;
|
|
48
37
|
}
|
|
49
38
|
});
|
|
50
39
|
export {
|
|
51
|
-
|
|
40
|
+
A as default
|
|
52
41
|
};
|
|
@@ -1,24 +1,28 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useModifiers as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as i, computed as p, inject as m, ref as c, onMounted as d, onBeforeUnmount as f } from "vue";
|
|
2
|
+
import { useModifiers as l } from "../../../../../utils/create-modifiers.js";
|
|
3
|
+
const x = /* @__PURE__ */ i({
|
|
4
4
|
__name: "NmorphCarouselItem",
|
|
5
5
|
props: {
|
|
6
6
|
name: { type: String, required: !0 }
|
|
7
7
|
},
|
|
8
|
-
setup(
|
|
9
|
-
|
|
10
|
-
const t =
|
|
11
|
-
() =>
|
|
8
|
+
setup(a, { expose: u }) {
|
|
9
|
+
u();
|
|
10
|
+
const t = a, s = p(
|
|
11
|
+
() => l({
|
|
12
12
|
"nmorph-carousel-item": []
|
|
13
13
|
})
|
|
14
|
-
), e =
|
|
15
|
-
|
|
14
|
+
), e = m("carousel-data"), r = c(!1);
|
|
15
|
+
d(() => {
|
|
16
16
|
r.value = !0, e && e.data.value.push(t.name);
|
|
17
|
+
}), f(() => {
|
|
18
|
+
if (!e) return;
|
|
19
|
+
const n = e.data.value.indexOf(t.name);
|
|
20
|
+
n !== -1 && e.data.value.splice(n, 1);
|
|
17
21
|
});
|
|
18
|
-
const o = { props: t, modifiers:
|
|
22
|
+
const o = { props: t, modifiers: s, carouselData: e, isMounted: r };
|
|
19
23
|
return Object.defineProperty(o, "__isScriptSetup", { enumerable: !1, value: !0 }), o;
|
|
20
24
|
}
|
|
21
25
|
});
|
|
22
26
|
export {
|
|
23
|
-
|
|
27
|
+
x as default
|
|
24
28
|
};
|
package/dist/components/data/nmorph-collapse/components/nmorph-collapse-item/NmorphCollapseItem.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.nmorph-collapse-item{--transition-speed: .2s;margin-bottom:var(--indentation-03)}.nmorph-collapse-item .nmorph-collapse-item__title{display:flex;align-items:center;padding:var(--indentation-02);background:var(--nmorph-main-color);border-radius:var(--default-border-radius);box-shadow:var(--base-shadow-width) var(--base-shadow-width) var(--base-shadow-blur) var(--nmorph-dark-shade-color),calc(-1 * var(--base-shadow-width)) calc(-1 * var(--base-shadow-width)) var(--base-shadow-blur) var(--nmorph-light-shade-color)}.nmorph-collapse-item .nmorph-collapse-item__content{box-sizing:content-box;overflow:hidden;background:var(--nmorph-main-color);border-radius:var(--default-border-radius);box-shadow:inset var(--base-shadow-width) var(--base-shadow-width) var(--base-shadow-blur) var(--nmorph-dark-shade-color),inset calc(-1 * var(--base-shadow-width)) calc(-1 * var(--base-shadow-width)) var(--base-shadow-blur) var(--nmorph-light-shade-color);transition:height var(--transition-speed) ease-in-out}.nmorph-collapse-item .nmorph-collapse-item__inner-wrapper{padding:var(--indentation-03)}.nmorph-collapse-item.nmorph-collapse-item--disabled{cursor:not-allowed;opacity:.6}
|
|
1
|
+
.nmorph-collapse-item{--transition-speed: .2s;margin-bottom:var(--indentation-03)}.nmorph-collapse-item .nmorph-collapse-item__title{display:flex;align-items:center;padding:var(--indentation-02);background:var(--nmorph-main-color);border-radius:var(--default-border-radius);box-shadow:var(--base-shadow-width) var(--base-shadow-width) var(--base-shadow-blur) var(--nmorph-dark-shade-color),calc(-1 * var(--base-shadow-width)) calc(-1 * var(--base-shadow-width)) var(--base-shadow-blur) var(--nmorph-light-shade-color);cursor:pointer}.nmorph-collapse-item .nmorph-collapse-item__content{box-sizing:content-box;overflow:hidden;background:var(--nmorph-main-color);border-radius:var(--default-border-radius);box-shadow:inset var(--base-shadow-width) var(--base-shadow-width) var(--base-shadow-blur) var(--nmorph-dark-shade-color),inset calc(-1 * var(--base-shadow-width)) calc(-1 * var(--base-shadow-width)) var(--base-shadow-blur) var(--nmorph-light-shade-color);transition:height var(--transition-speed) ease-in-out}.nmorph-collapse-item .nmorph-collapse-item__inner-wrapper{padding:var(--indentation-03)}.nmorph-collapse-item.nmorph-collapse-item--disabled{cursor:not-allowed;opacity:.6}.nmorph-collapse-item.nmorph-collapse-item--disabled .nmorph-collapse-item__title{cursor:not-allowed}.nmorph-collapse-item.nmorph-collapse-item--block .nmorph-collapse-item__title{cursor:default}
|