@nmorph/nmorph-ui-kit 3.0.6 → 3.0.8
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/hand.svg.js +2 -2
- package/dist/components/basic/nmorph-icon/NmorphIcon.css +1 -1
- package/dist/components/data/nmorph-calendar/NmorphCalendar.vue.js +34 -36
- package/dist/components/data/nmorph-calendar/NmorphCalendar.vue2.js +80 -78
- package/dist/components/data/nmorph-carousel/NmorphCarousel.css +1 -1
- package/dist/components/data/nmorph-carousel/NmorphCarousel.vue.js +26 -24
- package/dist/components/data/nmorph-carousel/NmorphCarousel.vue2.js +80 -30
- package/dist/components/data/nmorph-carousel/components/nmorph-carousel-item/NmorphCarouselItem.vue.js +21 -14
- package/dist/components/data/nmorph-carousel/components/nmorph-carousel-item/NmorphCarouselItem.vue2.js +20 -16
- package/dist/components/data/nmorph-image-preview/NmorphImagePreview.vue.js +60 -60
- package/dist/components/data/nmorph-image-preview/NmorphImagePreview.vue2.js +118 -94
- package/dist/components/data/nmorph-media-tile/NmorphMediaTile.css +1 -1
- package/dist/components/data/nmorph-media-tile/NmorphMediaTile.vue2.js +55 -41
- package/dist/components/data/nmorph-pagination/NmorphPagination.css +1 -1
- package/dist/components/data/nmorph-pagination/NmorphPagination.vue.js +5 -5
- package/dist/components/data/nmorph-pagination/NmorphPagination.vue2.js +80 -56
- package/dist/components/data/nmorph-table/NmorphTable.css +1 -1
- package/dist/components/data/nmorph-table/NmorphTable.vue.js +6 -6
- package/dist/components/data/nmorph-table/NmorphTable.vue2.js +41 -38
- package/dist/components/feedback/nmorph-drawer/NmorphDrawer.vue.js +8 -8
- package/dist/components/feedback/nmorph-drawer/NmorphDrawer.vue2.js +64 -24
- package/dist/components/navigation/nmorph-stepper/NmorphStepper.css +1 -1
- package/dist/components/providers/nmorph-notification-provider/NmorphNotificationProvider.vue.js +101 -96
- package/dist/components/providers/nmorph-notification-provider/NmorphNotificationProvider.vue2.js +84 -60
- package/dist/hooks/use-z-index.js +10 -10
- package/dist/index.umd.js +23 -23
- package/dist/package.json.js +1 -1
- package/dist/src/components/data/nmorph-carousel/NmorphCarousel.vue.d.ts +3 -1
- package/dist/src/components/data/nmorph-carousel/types.d.ts +1 -0
- package/dist/src/components/data/nmorph-media-tile/NmorphMediaTile.vue.d.ts +3 -1
- package/dist/src/components/data/nmorph-media-tile/types.d.ts +4 -0
- package/dist/src/components/data/nmorph-pagination/NmorphPagination.vue.d.ts +3 -0
- package/dist/src/components/data/nmorph-pagination/types.d.ts +3 -0
- package/dist/src/components/data/nmorph-table/NmorphTable.vue.d.ts +2 -20
- package/dist/src/components/data/nmorph-table/types.d.ts +11 -3
- package/dist/src/components/providers/nmorph-notification-provider/NmorphNotificationProvider.vue.d.ts +3 -1
- package/dist/src/components/providers/nmorph-notification-provider/types.d.ts +2 -0
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { openBlock as t, createElementBlock as o, createElementVNode as r } from "vue";
|
|
2
2
|
const n = {
|
|
3
3
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4
|
-
viewBox: "0 0 1024
|
|
4
|
+
viewBox: "0 0 1024 1088"
|
|
5
5
|
};
|
|
6
6
|
function c(l, e) {
|
|
7
7
|
return t(), o("svg", n, [...e[0] || (e[0] = [
|
|
@@ -9,7 +9,7 @@ function c(l, e) {
|
|
|
9
9
|
"path",
|
|
10
10
|
{
|
|
11
11
|
fill: "currentColor",
|
|
12
|
-
d: "M360
|
|
12
|
+
d: "M360 131.2c0-39.366 29.55-71.28 66-71.28s66 31.914 66 71.28v453.6h32V72.88c0-39.366 29.55-71.28 66-71.28s66 31.914 66 71.28V584.8h32v-432c0-39.366 29.55-71.28 66-71.28s66 31.914 66 71.28v457.92h30V256.48c0-39.366 29.55-71.28 66-71.28s66 31.914 66 71.28V736c0 181.332-136.1 328.32-304 328.32h-82c-98.69 0-190.2-55.62-241.34-146.794L109.73 665.67a70 75.6 0 0 1 120.06-77.5L360 822.4z"
|
|
13
13
|
},
|
|
14
14
|
null,
|
|
15
15
|
-1
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.nmorph-icon
|
|
1
|
+
.nmorph-icon{display:flex;justify-content:center;align-items:center;width:var(--nmorph-private-icon-width);min-width:var(--nmorph-private-icon-width);height:var(--nmorph-private-icon-height);min-height:var(--nmorph-private-icon-height);color:var(--nmorph-private-icon-color)}.nmorph-icon .nmorph-icon__content{display:flex;justify-content:center;align-items:center;width:var(--nmorph-private-icon-width);min-width:var(--nmorph-private-icon-width);height:var(--nmorph-private-icon-height);min-height:var(--nmorph-private-icon-height)}.nmorph-icon svg{width:100%;height:100%;fill:var(--nmorph-private-icon-color)}.nmorph-icon svg,.nmorph-icon svg *{color:var(--nmorph-private-icon-color)}.nmorph-icon path[stroke],.nmorph-icon path[stroke-width],.nmorph-icon path[fill=none],.nmorph-icon rect[stroke],.nmorph-icon rect[stroke-width],.nmorph-icon rect[fill=none],.nmorph-icon line[stroke],.nmorph-icon line[stroke-width],.nmorph-icon polyline[stroke],.nmorph-icon polyline[stroke-width],.nmorph-icon polygon[stroke],.nmorph-icon polygon[stroke-width]{stroke:var(--nmorph-private-icon-color)}.nmorph-icon.nmorph-icon--small{--nmorph-private-icon-width: 14px;--nmorph-private-icon-height: 14px}.nmorph-icon.nmorph-icon--medium{--nmorph-private-icon-width: 20px;--nmorph-private-icon-height: 20px}.nmorph-icon.nmorph-icon--large{--nmorph-private-icon-width: 32px;--nmorph-private-icon-height: 32px}.nmorph-icon{--nmorph-private-icon-color: var(--nmorph-text-color)}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import './NmorphCalendar.css';
|
|
2
2
|
import f from "./NmorphCalendar.vue2.js";
|
|
3
|
-
import { openBlock as o, createElementBlock as
|
|
3
|
+
import { openBlock as o, createElementBlock as r, normalizeStyle as k, normalizeClass as i, renderSlot as n, createVNode as s, mergeProps as C, withCtx as l, Fragment as c, renderList as y, createBlock as D, createElementVNode as m, createTextVNode as _, toDisplayString as v } from "vue";
|
|
4
4
|
/* empty css */
|
|
5
|
-
import
|
|
5
|
+
import T from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
6
6
|
const g = ["data-date", "onClick"];
|
|
7
|
-
function
|
|
8
|
-
return o(),
|
|
7
|
+
function p(d, B, M, a, w, x) {
|
|
8
|
+
return o(), r(
|
|
9
9
|
"div",
|
|
10
10
|
{
|
|
11
|
-
class:
|
|
11
|
+
class: i(a.modifiers),
|
|
12
12
|
style: k(a.styles)
|
|
13
13
|
},
|
|
14
14
|
[
|
|
15
|
-
|
|
15
|
+
n(d.$slots, "header", {}, () => [
|
|
16
16
|
s(a.NmorphCalendarHeader, {
|
|
17
17
|
year: a.initialDate.getFullYear(),
|
|
18
18
|
month: a.initialDate.getMonth(),
|
|
@@ -25,54 +25,52 @@ function T(d, p, B, a, M, w) {
|
|
|
25
25
|
onClickToday: a.setTodayMonth
|
|
26
26
|
}, null, 8, ["year", "month", "design", "show-previous-month-button", "show-today-button", "show-next-month-button"])
|
|
27
27
|
]),
|
|
28
|
-
|
|
29
|
-
s(a.NmorphTable, {
|
|
28
|
+
n(d.$slots, "content", {}, () => [
|
|
29
|
+
s(a.NmorphTable, C({
|
|
30
30
|
data: a.calendar,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
design: a.props.design
|
|
34
|
-
}, {
|
|
31
|
+
"row-hover": !1
|
|
32
|
+
}, a.tableDesignProps), {
|
|
35
33
|
default: l(() => [
|
|
36
|
-
(o(!0),
|
|
34
|
+
(o(!0), r(
|
|
37
35
|
c,
|
|
38
36
|
null,
|
|
39
|
-
y(a.days, (
|
|
40
|
-
key: `${
|
|
41
|
-
prop:
|
|
42
|
-
label:
|
|
37
|
+
y(a.days, (t) => (o(), D(a.NmorphTableColumn, {
|
|
38
|
+
key: `${t}`,
|
|
39
|
+
prop: t,
|
|
40
|
+
label: t.toUpperCase()
|
|
43
41
|
}, {
|
|
44
42
|
default: l(({ scope: b }) => [
|
|
45
|
-
(o(!0),
|
|
43
|
+
(o(!0), r(
|
|
46
44
|
c,
|
|
47
45
|
null,
|
|
48
|
-
y(b.rows, (
|
|
49
|
-
key:
|
|
50
|
-
row:
|
|
46
|
+
y(b.rows, (e, h) => (o(), D(a.NmorphTableCell, {
|
|
47
|
+
key: h,
|
|
48
|
+
row: h
|
|
51
49
|
}, {
|
|
52
50
|
default: l(() => [
|
|
53
|
-
|
|
54
|
-
"data-date": `${a.dateData(t
|
|
55
|
-
class:
|
|
51
|
+
m("div", {
|
|
52
|
+
"data-date": `${a.dateData(e[t]).date}`,
|
|
53
|
+
class: i([
|
|
56
54
|
"nmorph-calendar-date",
|
|
57
|
-
`nmorph-calendar-date--${a.dateData(t
|
|
55
|
+
`nmorph-calendar-date--${a.dateData(e[t]).monthType}`,
|
|
58
56
|
{
|
|
59
|
-
"nmorph-calendar-date--today": a.dateData(t
|
|
57
|
+
"nmorph-calendar-date--today": a.dateData(e[t]).isToday && !a.dateData(e[t]).hidden && a.props.markToday
|
|
60
58
|
},
|
|
61
|
-
{ "nmorph-calendar-date--hidden": a.dateData(t
|
|
59
|
+
{ "nmorph-calendar-date--hidden": a.dateData(e[t]).hidden },
|
|
62
60
|
{
|
|
63
|
-
"nmorph-calendar-date--selected": a.isValueSelected(a.dateData(t
|
|
61
|
+
"nmorph-calendar-date--selected": a.isValueSelected(a.dateData(e[t]).date)
|
|
64
62
|
}
|
|
65
63
|
]),
|
|
66
|
-
onClick: (
|
|
64
|
+
onClick: (P) => a.clickDate(a.dateData(e[t]))
|
|
67
65
|
}, [
|
|
68
|
-
|
|
66
|
+
n(d.$slots, "date-cell", {
|
|
69
67
|
scope: {
|
|
70
|
-
...a.dateData(t
|
|
71
|
-
selected: a.isValueSelected(a.dateData(t
|
|
68
|
+
...a.dateData(e[t]),
|
|
69
|
+
selected: a.isValueSelected(a.dateData(e[t]).date)
|
|
72
70
|
}
|
|
73
71
|
}, () => [
|
|
74
72
|
_(
|
|
75
|
-
|
|
73
|
+
v(a.dateData(e[t]).hidden ? "-" : a.dateData(e[t]).value),
|
|
76
74
|
1
|
|
77
75
|
/* TEXT */
|
|
78
76
|
)
|
|
@@ -95,14 +93,14 @@ function T(d, p, B, a, M, w) {
|
|
|
95
93
|
]),
|
|
96
94
|
_: 3
|
|
97
95
|
/* FORWARDED */
|
|
98
|
-
},
|
|
96
|
+
}, 16, ["data"])
|
|
99
97
|
])
|
|
100
98
|
],
|
|
101
99
|
6
|
|
102
100
|
/* CLASS, STYLE */
|
|
103
101
|
);
|
|
104
102
|
}
|
|
105
|
-
const
|
|
103
|
+
const E = /* @__PURE__ */ T(f, [["render", p], ["__file", "/builds/ketjo/nmorph/library/src/components/data/nmorph-calendar/NmorphCalendar.vue"]]);
|
|
106
104
|
export {
|
|
107
|
-
|
|
105
|
+
E as default
|
|
108
106
|
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import './NmorphCalendar.css';
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
import { useModifiers as
|
|
4
|
-
import { createCssSizeVariables as
|
|
5
|
-
import
|
|
6
|
-
import { useCalendarTexts as
|
|
7
|
-
import { hasAnyRangeDateInPrevMonth as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
const
|
|
2
|
+
import { defineComponent as O, ref as x, onMounted as k, reactive as j, watch as h, computed as u } from "vue";
|
|
3
|
+
import { useModifiers as z } from "../../../utils/create-modifiers.js";
|
|
4
|
+
import { createCssSizeVariables as W } from "../../../utils/common.js";
|
|
5
|
+
import Z from "./inner-components/nmorph-calendar-header/NmorphCalendarHeader.vue.js";
|
|
6
|
+
import { useCalendarTexts as F } from "./hooks/use-calendar-texts.js";
|
|
7
|
+
import { hasAnyRangeDateInPrevMonth as G, hasAnyRangeDateInNextMonth as J, isTodayInMonthRange as K, resetTimeToZero as d, getMonthDaysByWeek as L } from "./utils.js";
|
|
8
|
+
import Q from "../nmorph-table/components/nmorph-table-cell/NmorphTableCell.vue.js";
|
|
9
|
+
import U from "../nmorph-table/components/nmorph-table-column/NmorphTableColumn.vue.js";
|
|
10
|
+
import X from "../nmorph-table/NmorphTable.vue.js";
|
|
11
|
+
const se = /* @__PURE__ */ O({
|
|
12
12
|
__name: "NmorphCalendar",
|
|
13
13
|
props: {
|
|
14
14
|
markToday: { type: Boolean, required: !1, default: !0 },
|
|
@@ -22,119 +22,121 @@ const ue = /* @__PURE__ */ R({
|
|
|
22
22
|
emits: ["update:model-value", "update-initial-date"],
|
|
23
23
|
setup(N, { expose: b, emit: _ }) {
|
|
24
24
|
b();
|
|
25
|
-
const
|
|
26
|
-
|
|
25
|
+
const a = N, s = _, { days: v } = F(), y = () => {
|
|
26
|
+
o.value = M.value;
|
|
27
27
|
}, C = () => {
|
|
28
|
-
|
|
28
|
+
o.value = /* @__PURE__ */ new Date();
|
|
29
29
|
}, g = () => {
|
|
30
|
-
|
|
31
|
-
},
|
|
30
|
+
o.value = A.value;
|
|
31
|
+
}, i = () => {
|
|
32
32
|
throw new Error("model value and type prop not matched");
|
|
33
33
|
}, c = (e) => {
|
|
34
34
|
if (e === null) return null;
|
|
35
|
-
if (
|
|
35
|
+
if (a.type === "date") {
|
|
36
36
|
if (e instanceof Date)
|
|
37
37
|
return d(e);
|
|
38
|
-
|
|
38
|
+
i();
|
|
39
39
|
}
|
|
40
|
-
const
|
|
41
|
-
if (
|
|
42
|
-
if (
|
|
43
|
-
return e.map((
|
|
44
|
-
|
|
40
|
+
const l = Array.isArray(e) && e.every((r) => r instanceof Date);
|
|
41
|
+
if (a.type === "dates") {
|
|
42
|
+
if (l)
|
|
43
|
+
return e.map((r) => d(r));
|
|
44
|
+
i();
|
|
45
45
|
}
|
|
46
|
-
if (
|
|
47
|
-
if (
|
|
48
|
-
return e.map((
|
|
49
|
-
|
|
46
|
+
if (a.type === "daterange") {
|
|
47
|
+
if (l)
|
|
48
|
+
return e.map((r) => d(r)).slice(0, 2);
|
|
49
|
+
i();
|
|
50
50
|
}
|
|
51
51
|
}, q = (e) => {
|
|
52
52
|
if (t.value === null) return;
|
|
53
|
-
const { monthType:
|
|
54
|
-
if (
|
|
55
|
-
|
|
53
|
+
const { monthType: l, hidden: r } = e;
|
|
54
|
+
if (r) return;
|
|
55
|
+
l === "next" && g(), l === "previous" && y();
|
|
56
56
|
const { date: n } = e;
|
|
57
|
-
if (
|
|
58
|
-
if (!Array.isArray(t.value)) return
|
|
59
|
-
const m = n.toDateString(), w = t.value.map((
|
|
60
|
-
w !== -1 ? t.value.splice(w, 1) : t.value.push(n),
|
|
57
|
+
if (a.type === "date" && (t.value = n, s("update:model-value", t.value)), a.type === "dates") {
|
|
58
|
+
if (!Array.isArray(t.value)) return i();
|
|
59
|
+
const m = n.toDateString(), w = t.value.map((R) => R.toDateString()).indexOf(m);
|
|
60
|
+
w !== -1 ? t.value.splice(w, 1) : t.value.push(n), s("update:model-value", t.value);
|
|
61
61
|
}
|
|
62
|
-
if (
|
|
63
|
-
if (!Array.isArray(t.value)) return
|
|
64
|
-
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],
|
|
62
|
+
if (a.type === "daterange") {
|
|
63
|
+
if (!Array.isArray(t.value)) return i();
|
|
64
|
+
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));
|
|
65
65
|
}
|
|
66
|
-
}, D = (e,
|
|
67
|
-
const [
|
|
68
|
-
return
|
|
66
|
+
}, D = (e, l) => {
|
|
67
|
+
const [r, n] = l;
|
|
68
|
+
return l.length === 1 ? e.toDateString() === r.toDateString() : r && n ? e >= d(r) && e <= d(n) : !1;
|
|
69
69
|
}, B = (e) => {
|
|
70
70
|
if (t.value === null) return !1;
|
|
71
|
-
if (
|
|
72
|
-
return Array.isArray(t.value) ?
|
|
73
|
-
if (
|
|
74
|
-
return Array.isArray(t.value) ? !!t.value.find((
|
|
75
|
-
if (
|
|
76
|
-
return Array.isArray(t.value) ? D(e, t.value) :
|
|
77
|
-
},
|
|
78
|
-
|
|
79
|
-
|
|
71
|
+
if (a.type === "date")
|
|
72
|
+
return Array.isArray(t.value) ? i() : t.value.toDateString() === e.toDateString();
|
|
73
|
+
if (a.type === "dates")
|
|
74
|
+
return Array.isArray(t.value) ? !!t.value.find((r) => r.toDateString() === e.toDateString()) : i();
|
|
75
|
+
if (a.type === "daterange")
|
|
76
|
+
return Array.isArray(t.value) ? D(e, t.value) : i();
|
|
77
|
+
}, o = x(a.initialDate), t = x(c(a.modelValue));
|
|
78
|
+
k(() => {
|
|
79
|
+
s("update:model-value", t.value);
|
|
80
80
|
});
|
|
81
|
-
let p =
|
|
81
|
+
let p = j([]);
|
|
82
82
|
const f = () => {
|
|
83
|
-
p = [],
|
|
84
|
-
const
|
|
85
|
-
|
|
86
|
-
const T =
|
|
87
|
-
|
|
88
|
-
}), p.push(
|
|
83
|
+
p = [], L(o, a.range).forEach((l) => {
|
|
84
|
+
const r = {};
|
|
85
|
+
l.forEach((n, m) => {
|
|
86
|
+
const T = v[m];
|
|
87
|
+
r[T] = n;
|
|
88
|
+
}), p.push(r);
|
|
89
89
|
});
|
|
90
90
|
};
|
|
91
|
-
|
|
92
|
-
() =>
|
|
91
|
+
h(
|
|
92
|
+
() => a.initialDate,
|
|
93
93
|
(e) => {
|
|
94
|
-
|
|
94
|
+
o.value = e;
|
|
95
95
|
},
|
|
96
96
|
{
|
|
97
97
|
deep: !0
|
|
98
98
|
}
|
|
99
|
-
),
|
|
100
|
-
f(),
|
|
101
|
-
}),
|
|
102
|
-
() =>
|
|
99
|
+
), h(o, () => {
|
|
100
|
+
f(), s("update-initial-date", o.value);
|
|
101
|
+
}), h(
|
|
102
|
+
() => a.modelValue,
|
|
103
103
|
(e) => {
|
|
104
104
|
t.value = c(e);
|
|
105
105
|
}
|
|
106
106
|
);
|
|
107
|
-
const M =
|
|
108
|
-
const { range: e } =
|
|
107
|
+
const M = u(() => new Date(o.value.setMonth(o.value.getMonth() - 1))), A = u(() => new Date(o.value.setMonth(o.value.getMonth() + 1))), V = u(() => {
|
|
108
|
+
const { range: e } = a, l = e ? G(o.value, e[0]) : !0, r = e ? J(o.value, e[1]) : !0, n = K(e);
|
|
109
109
|
return {
|
|
110
|
-
showPreviousMonthButton:
|
|
111
|
-
showNextMonthButton:
|
|
110
|
+
showPreviousMonthButton: l,
|
|
111
|
+
showNextMonthButton: r,
|
|
112
112
|
showTodayButton: n
|
|
113
113
|
};
|
|
114
|
-
}), E =
|
|
115
|
-
() =>
|
|
114
|
+
}), E = u(
|
|
115
|
+
() => z({
|
|
116
116
|
"nmorph-calendar": []
|
|
117
117
|
})
|
|
118
|
-
),
|
|
119
|
-
() =>
|
|
120
|
-
"--nmorph-private-calendar-cell-height":
|
|
118
|
+
), P = u(
|
|
119
|
+
() => W({
|
|
120
|
+
"--nmorph-private-calendar-cell-height": a.cellHeight
|
|
121
121
|
})
|
|
122
|
+
), H = u(
|
|
123
|
+
() => a.design === "plain" ? { design: "plain", bordered: !0 } : { design: "nmorph" }
|
|
122
124
|
), I = (e) => e;
|
|
123
125
|
f();
|
|
124
|
-
const S = { props:
|
|
126
|
+
const S = { props: a, emit: s, days: v, setPreviousMonth: y, setTodayMonth: C, setNextMonth: g, wrongType: i, convertValue: c, clickDate: q, isDateInRange: D, isValueSelected: B, initialDate: o, selectedValue: t, get calendar() {
|
|
125
127
|
return p;
|
|
126
128
|
}, set calendar(e) {
|
|
127
129
|
p = e;
|
|
128
|
-
}, updateCalendar: f, prevMonth: M, nextMonth: A, showHeaderButtons: V, modifiers: E, styles: H, dateData: I, get NmorphTable() {
|
|
129
|
-
return
|
|
130
|
+
}, updateCalendar: f, prevMonth: M, nextMonth: A, showHeaderButtons: V, modifiers: E, styles: P, tableDesignProps: H, dateData: I, get NmorphTable() {
|
|
131
|
+
return X;
|
|
130
132
|
}, get NmorphTableColumn() {
|
|
131
|
-
return
|
|
133
|
+
return U;
|
|
132
134
|
}, get NmorphTableCell() {
|
|
133
|
-
return
|
|
134
|
-
}, NmorphCalendarHeader:
|
|
135
|
+
return Q;
|
|
136
|
+
}, NmorphCalendarHeader: Z };
|
|
135
137
|
return Object.defineProperty(S, "__isScriptSetup", { enumerable: !1, value: !0 }), S;
|
|
136
138
|
}
|
|
137
139
|
});
|
|
138
140
|
export {
|
|
139
|
-
|
|
141
|
+
se as default
|
|
140
142
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.nmorph-carousel{--nmorph-private-carousel-height: 500px;--nmorph-private-carousel-frame-border: 10px;--nmorph-private-carousel-action-size: 36px;--nmorph-private-carousel-action-offset: var(--indentation-02);position:relative;box-sizing:border-box;height:var(--nmorph-private-carousel-height);overflow:hidden;border-radius:var(--default-border-radius)}.nmorph-carousel .nmorph-carousel__wrapper{display:flex;height:100%}.nmorph-carousel .transition-enabled{transition:transform .4s ease}.nmorph-carousel .nmorph-carousel__element-indicator-wrapper{padding:4px;cursor:pointer}.nmorph-carousel .nmorph-carousel__elements-indicator{position:absolute;bottom:16px;display:flex;justify-content:center;width:100%}.nmorph-carousel .nmorph-carousel__element-indicator{width:30px;height:2px;margin-right:var(--indentation-02);background:var(--nmorph-gray-color)}.nmorph-carousel .nmorph-carousel__element-indicator--active{background:var(--nmorph-white-color)}.nmorph-carousel .nmorph-carousel__action-btn{position:absolute;top:50%;display:flex;justify-content:center;align-items:center;box-sizing:border-box;width:var(--nmorph-private-carousel-action-size);height:var(--nmorph-private-carousel-action-size);padding:0;background:var(--nmorph-info-color);border-radius:var(--default-border-radius);transform:translateY(-50%);cursor:pointer}.nmorph-carousel .nmorph-carousel__action-btn:hover{background:var(--nmorph-info-color)}.nmorph-carousel .nmorph-carousel__action-btn .nmorph-icon{--nmorph-private-icon-color: var(--nmorph-white-color)}.nmorph-carousel .nmorph-carousel__prev{
|
|
1
|
+
.nmorph-carousel{--nmorph-private-carousel-height: 500px;--nmorph-private-carousel-frame-border: 10px;--nmorph-private-carousel-action-size: 36px;--nmorph-private-carousel-action-offset: var(--indentation-02);position:relative;box-sizing:border-box;height:var(--nmorph-private-carousel-height);overflow:hidden;border-radius:var(--default-border-radius)}.nmorph-carousel .nmorph-carousel__wrapper{display:flex;height:100%}.nmorph-carousel .transition-enabled{transition:transform .4s ease}.nmorph-carousel .nmorph-carousel__element-indicator-wrapper{padding:4px;cursor:pointer}.nmorph-carousel .nmorph-carousel__elements-indicator{position:absolute;bottom:16px;display:flex;justify-content:center;width:100%}.nmorph-carousel .nmorph-carousel__element-indicator{width:30px;height:2px;margin-right:var(--indentation-02);background:var(--nmorph-gray-color)}.nmorph-carousel .nmorph-carousel__element-indicator--active{background:var(--nmorph-white-color)}.nmorph-carousel .nmorph-carousel__action-btn{position:absolute;top:50%;display:flex;justify-content:center;align-items:center;box-sizing:border-box;width:var(--nmorph-private-carousel-action-size);height:var(--nmorph-private-carousel-action-size);padding:0;background:var(--nmorph-info-color);border-radius:var(--default-border-radius);transform:translateY(-50%);cursor:pointer}.nmorph-carousel .nmorph-carousel__action-btn:hover{background:var(--nmorph-info-color)}.nmorph-carousel .nmorph-carousel__action-btn .nmorph-icon{--nmorph-private-icon-color: var(--nmorph-white-color)}.nmorph-carousel .nmorph-carousel__prev{left:var(--nmorph-private-carousel-action-offset)}.nmorph-carousel .nmorph-carousel__next{right:var(--nmorph-private-carousel-action-offset)}.nmorph-carousel .nmorph-carousel__item{flex-shrink:0;width:100%;height:100%}.nmorph-carousel--nmorph{background:var(--nmorph-main-color);border:var(--nmorph-private-carousel-frame-border) solid var(--nmorph-main-color)}.nmorph-carousel--plain{background:var(--nmorph-main-color);border:var(--nmorph-plain-border);box-shadow:none}.nmorph-carousel--plain .nmorph-carousel__action-btn{color:var(--nmorph-text-color);background:var(--nmorph-main-color);border:var(--nmorph-plain-border);box-shadow:none}.nmorph-carousel--plain .nmorph-carousel__action-btn .nmorph-icon{--nmorph-private-icon-color: currentColor}.nmorph-carousel--plain .nmorph-carousel__action-btn:hover{color:var(--nmorph-accent-color);background:var(--nmorph-main-color);border-color:var(--nmorph-accent-color)}
|
|
@@ -1,51 +1,53 @@
|
|
|
1
1
|
import './NmorphCarousel.css';
|
|
2
|
-
import
|
|
3
|
-
import { openBlock as e, createElementBlock as o, normalizeClass as
|
|
2
|
+
import _ from "./NmorphCarousel.vue2.js";
|
|
3
|
+
import { openBlock as e, createElementBlock as o, normalizeClass as i, createElementVNode as n, normalizeStyle as h, Fragment as c, renderList as s, createVNode as l, withCtx as m, renderSlot as p } from "vue";
|
|
4
4
|
/* empty css */
|
|
5
5
|
import u from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
6
|
-
const
|
|
7
|
-
function k(
|
|
6
|
+
const f = ["id"], v = { class: "nmorph-carousel__elements-indicator" }, C = ["onClick"];
|
|
7
|
+
function k(d, N, b, r, y, I) {
|
|
8
8
|
return e(), o(
|
|
9
9
|
"div",
|
|
10
10
|
{
|
|
11
|
-
class:
|
|
11
|
+
class: i(r.modifiers)
|
|
12
12
|
},
|
|
13
13
|
[
|
|
14
14
|
n(
|
|
15
15
|
"div",
|
|
16
16
|
{
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
ref: "wrapperRef",
|
|
18
|
+
class: i(["nmorph-carousel__wrapper", { "transition-enabled": r.transitionEnabled }]),
|
|
19
|
+
style: h({ transform: r.translateX }),
|
|
20
|
+
onTransitionend: r.wrapperTransitionEndHandler
|
|
19
21
|
},
|
|
20
22
|
[
|
|
21
23
|
(e(!0), o(
|
|
22
|
-
|
|
24
|
+
c,
|
|
23
25
|
null,
|
|
24
|
-
s(r.
|
|
25
|
-
id:
|
|
26
|
-
key: a,
|
|
26
|
+
s(r.renderedCarouselItems, (a) => (e(), o("div", {
|
|
27
|
+
id: a.id,
|
|
28
|
+
key: a.key,
|
|
27
29
|
class: "nmorph-carousel__item"
|
|
28
|
-
}, null, 8,
|
|
30
|
+
}, null, 8, f))),
|
|
29
31
|
128
|
|
30
32
|
/* KEYED_FRAGMENT */
|
|
31
33
|
))
|
|
32
34
|
],
|
|
33
|
-
|
|
34
|
-
/* STYLE */
|
|
35
|
+
38
|
|
36
|
+
/* CLASS, STYLE, NEED_HYDRATION */
|
|
35
37
|
),
|
|
36
|
-
n("div",
|
|
38
|
+
n("div", v, [
|
|
37
39
|
(e(!0), o(
|
|
38
|
-
|
|
40
|
+
c,
|
|
39
41
|
null,
|
|
40
42
|
s(r.carouselData, (a, t) => (e(), o("div", {
|
|
41
43
|
key: t,
|
|
42
44
|
class: "nmorph-carousel__element-indicator-wrapper",
|
|
43
|
-
onClick: (
|
|
45
|
+
onClick: (w) => r.elementIndicator(t)
|
|
44
46
|
}, [
|
|
45
47
|
n(
|
|
46
48
|
"div",
|
|
47
49
|
{
|
|
48
|
-
class:
|
|
50
|
+
class: i(["nmorph-carousel__element-indicator", { "nmorph-carousel__element-indicator--active": r.isCurrentElementActive(t) }])
|
|
49
51
|
},
|
|
50
52
|
null,
|
|
51
53
|
2
|
|
@@ -58,11 +60,11 @@ function k(_, N, I, r, b, y) {
|
|
|
58
60
|
]),
|
|
59
61
|
n("div", {
|
|
60
62
|
class: "nmorph-carousel__action-btn nmorph-carousel__prev",
|
|
61
|
-
onClick: r.
|
|
63
|
+
onClick: r.prevSlide
|
|
62
64
|
}, [
|
|
63
65
|
l(r.NmorphIcon, null, {
|
|
64
66
|
default: m(() => [
|
|
65
|
-
l(r.
|
|
67
|
+
l(r.NmorphIconChevronLeft)
|
|
66
68
|
]),
|
|
67
69
|
_: 1
|
|
68
70
|
/* STABLE */
|
|
@@ -70,23 +72,23 @@ function k(_, N, I, r, b, y) {
|
|
|
70
72
|
]),
|
|
71
73
|
n("div", {
|
|
72
74
|
class: "nmorph-carousel__action-btn nmorph-carousel__next",
|
|
73
|
-
onClick: r.
|
|
75
|
+
onClick: r.nextSlide
|
|
74
76
|
}, [
|
|
75
77
|
l(r.NmorphIcon, null, {
|
|
76
78
|
default: m(() => [
|
|
77
|
-
l(r.
|
|
79
|
+
l(r.NmorphIconChevronRight)
|
|
78
80
|
]),
|
|
79
81
|
_: 1
|
|
80
82
|
/* STABLE */
|
|
81
83
|
})
|
|
82
84
|
]),
|
|
83
|
-
p(
|
|
85
|
+
p(d.$slots, "default")
|
|
84
86
|
],
|
|
85
87
|
2
|
|
86
88
|
/* CLASS */
|
|
87
89
|
);
|
|
88
90
|
}
|
|
89
|
-
const z = /* @__PURE__ */ u(
|
|
91
|
+
const z = /* @__PURE__ */ u(_, [["render", k], ["__file", "/builds/ketjo/nmorph/library/src/components/data/nmorph-carousel/NmorphCarousel.vue"]]);
|
|
90
92
|
export {
|
|
91
93
|
z as default
|
|
92
94
|
};
|
|
@@ -1,47 +1,97 @@
|
|
|
1
1
|
import './NmorphCarousel.css';
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
import { useModifiers as
|
|
4
|
-
import { generateUUID as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
const
|
|
2
|
+
import { defineComponent as j, ref as i, computed as m, provide as F, watch as y, nextTick as U } from "vue";
|
|
3
|
+
import { useModifiers as X } from "../../../utils/create-modifiers.js";
|
|
4
|
+
import { generateUUID as z } from "../../../utils/common.js";
|
|
5
|
+
import B from "../../../assets/icons/chevron-right.svg.js";
|
|
6
|
+
import H from "../../../assets/icons/chevron-left.svg.js";
|
|
7
|
+
import J from "../../basic/nmorph-icon/NmorphIcon.vue.js";
|
|
8
|
+
const V = /* @__PURE__ */ j({
|
|
9
9
|
__name: "NmorphCarousel",
|
|
10
10
|
props: {
|
|
11
11
|
design: { type: null, required: !1, default: "nmorph" },
|
|
12
12
|
loop: { type: Boolean, required: !1, default: !0 }
|
|
13
13
|
},
|
|
14
14
|
emits: ["change"],
|
|
15
|
-
setup(
|
|
16
|
-
|
|
17
|
-
const
|
|
18
|
-
() =>
|
|
19
|
-
nmorph: [
|
|
20
|
-
"nmorph-carousel": [
|
|
15
|
+
setup(N, { expose: $, emit: b }) {
|
|
16
|
+
$();
|
|
17
|
+
const r = i(0), a = i(0), c = i(!0), o = i(null), C = i(null), l = N, S = b, w = m(
|
|
18
|
+
() => X({
|
|
19
|
+
nmorph: [l.design === "nmorph" ? "shadow-outset" : ""],
|
|
20
|
+
"nmorph-carousel": [l.design]
|
|
21
21
|
})
|
|
22
|
-
),
|
|
23
|
-
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
22
|
+
), u = i([]), f = z(), n = m(() => u.value.length), v = m(() => l.loop && n.value > 1);
|
|
23
|
+
F("carousel-data", { data: u, carouselId: f, hasLoopClones: v });
|
|
24
|
+
const p = (e, t) => `nmorph-carousel-item-${f}-${e}${t ? `-${t}` : ""}`, h = (e) => n.value ? l.loop ? (e + n.value) % n.value : Math.min(Math.max(e, 0), n.value - 1) : 0, d = (e) => v.value ? e + 1 : e, T = async () => {
|
|
25
|
+
await U(), C.value?.offsetWidth;
|
|
26
|
+
const e = typeof requestAnimationFrame == "function" ? requestAnimationFrame : (t) => setTimeout(() => t(Date.now()), 0);
|
|
27
|
+
e(() => {
|
|
28
|
+
e(() => {
|
|
29
|
+
c.value = !0;
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
}, I = (e) => {
|
|
33
|
+
c.value = !1, a.value = e, T();
|
|
34
|
+
}, g = (e) => {
|
|
35
|
+
const t = h(e);
|
|
36
|
+
t !== r.value && (r.value = t, o.value = null, c.value = !0, a.value = d(t));
|
|
37
|
+
}, x = (e) => {
|
|
38
|
+
if (!n.value) return;
|
|
39
|
+
if (!l.loop || !v.value) {
|
|
40
|
+
g(r.value + e);
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
const t = r.value, s = h(t + e);
|
|
44
|
+
if (s !== t) {
|
|
45
|
+
if (r.value = s, c.value = !0, e > 0 && t === n.value - 1) {
|
|
46
|
+
a.value = n.value + 1, o.value = 1;
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
if (e < 0 && t === 0) {
|
|
50
|
+
a.value = 0, o.value = n.value;
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
o.value = null, a.value = d(s);
|
|
54
|
+
}
|
|
55
|
+
}, R = () => x(-1), q = () => x(1), A = m(() => `translateX(-${a.value * 100}%)`), M = m(() => {
|
|
56
|
+
const e = u.value.map((k) => ({
|
|
57
|
+
id: p(k),
|
|
58
|
+
key: k
|
|
59
|
+
}));
|
|
60
|
+
if (!v.value || !e.length) return e;
|
|
61
|
+
const t = u.value[0], s = u.value[u.value.length - 1];
|
|
62
|
+
return [
|
|
63
|
+
{
|
|
64
|
+
id: p(s, "before"),
|
|
65
|
+
key: `${s}-loop-before`
|
|
66
|
+
},
|
|
67
|
+
...e,
|
|
68
|
+
{
|
|
69
|
+
id: p(t, "after"),
|
|
70
|
+
key: `${t}-loop-after`
|
|
71
|
+
}
|
|
72
|
+
];
|
|
73
|
+
}), D = (e) => e === r.value, E = (e) => {
|
|
74
|
+
g(e);
|
|
75
|
+
}, L = (e) => {
|
|
76
|
+
if (e.target !== e.currentTarget || o.value === null) return;
|
|
77
|
+
const t = o.value;
|
|
78
|
+
o.value = null, I(t);
|
|
29
79
|
};
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}),
|
|
33
|
-
|
|
80
|
+
y([n, () => l.loop], ([e]) => {
|
|
81
|
+
r.value > e - 1 && (r.value = Math.max(e - 1, 0)), o.value = null, I(d(r.value));
|
|
82
|
+
}), y(r, () => {
|
|
83
|
+
S("change", r.value);
|
|
34
84
|
});
|
|
35
|
-
const
|
|
36
|
-
return
|
|
85
|
+
const _ = { currentSlide: r, trackIndex: a, transitionEnabled: c, loopResetTrackIndex: o, wrapperRef: C, props: l, emit: S, modifiers: w, carouselData: u, carouselId: f, slideCount: n, hasLoopClones: v, getCarouselItemId: p, normalizeSlideIndex: h, getRealTrackIndex: d, enableTransitionAfterJump: T, jumpToTrackIndex: I, goToSlide: g, moveSlide: x, prevSlide: R, nextSlide: q, translateX: A, renderedCarouselItems: M, isCurrentElementActive: D, elementIndicator: E, wrapperTransitionEndHandler: L, get NmorphIcon() {
|
|
86
|
+
return J;
|
|
37
87
|
}, get NmorphIconChevronLeft() {
|
|
38
|
-
return
|
|
88
|
+
return H;
|
|
39
89
|
}, get NmorphIconChevronRight() {
|
|
40
|
-
return
|
|
90
|
+
return B;
|
|
41
91
|
} };
|
|
42
|
-
return Object.defineProperty(
|
|
92
|
+
return Object.defineProperty(_, "__isScriptSetup", { enumerable: !1, value: !0 }), _;
|
|
43
93
|
}
|
|
44
94
|
});
|
|
45
95
|
export {
|
|
46
|
-
|
|
96
|
+
V as default
|
|
47
97
|
};
|