@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.
Files changed (39) hide show
  1. package/dist/assets/icons/hand.svg.js +2 -2
  2. package/dist/components/basic/nmorph-icon/NmorphIcon.css +1 -1
  3. package/dist/components/data/nmorph-calendar/NmorphCalendar.vue.js +34 -36
  4. package/dist/components/data/nmorph-calendar/NmorphCalendar.vue2.js +80 -78
  5. package/dist/components/data/nmorph-carousel/NmorphCarousel.css +1 -1
  6. package/dist/components/data/nmorph-carousel/NmorphCarousel.vue.js +26 -24
  7. package/dist/components/data/nmorph-carousel/NmorphCarousel.vue2.js +80 -30
  8. package/dist/components/data/nmorph-carousel/components/nmorph-carousel-item/NmorphCarouselItem.vue.js +21 -14
  9. package/dist/components/data/nmorph-carousel/components/nmorph-carousel-item/NmorphCarouselItem.vue2.js +20 -16
  10. package/dist/components/data/nmorph-image-preview/NmorphImagePreview.vue.js +60 -60
  11. package/dist/components/data/nmorph-image-preview/NmorphImagePreview.vue2.js +118 -94
  12. package/dist/components/data/nmorph-media-tile/NmorphMediaTile.css +1 -1
  13. package/dist/components/data/nmorph-media-tile/NmorphMediaTile.vue2.js +55 -41
  14. package/dist/components/data/nmorph-pagination/NmorphPagination.css +1 -1
  15. package/dist/components/data/nmorph-pagination/NmorphPagination.vue.js +5 -5
  16. package/dist/components/data/nmorph-pagination/NmorphPagination.vue2.js +80 -56
  17. package/dist/components/data/nmorph-table/NmorphTable.css +1 -1
  18. package/dist/components/data/nmorph-table/NmorphTable.vue.js +6 -6
  19. package/dist/components/data/nmorph-table/NmorphTable.vue2.js +41 -38
  20. package/dist/components/feedback/nmorph-drawer/NmorphDrawer.vue.js +8 -8
  21. package/dist/components/feedback/nmorph-drawer/NmorphDrawer.vue2.js +64 -24
  22. package/dist/components/navigation/nmorph-stepper/NmorphStepper.css +1 -1
  23. package/dist/components/providers/nmorph-notification-provider/NmorphNotificationProvider.vue.js +101 -96
  24. package/dist/components/providers/nmorph-notification-provider/NmorphNotificationProvider.vue2.js +84 -60
  25. package/dist/hooks/use-z-index.js +10 -10
  26. package/dist/index.umd.js +23 -23
  27. package/dist/package.json.js +1 -1
  28. package/dist/src/components/data/nmorph-carousel/NmorphCarousel.vue.d.ts +3 -1
  29. package/dist/src/components/data/nmorph-carousel/types.d.ts +1 -0
  30. package/dist/src/components/data/nmorph-media-tile/NmorphMediaTile.vue.d.ts +3 -1
  31. package/dist/src/components/data/nmorph-media-tile/types.d.ts +4 -0
  32. package/dist/src/components/data/nmorph-pagination/NmorphPagination.vue.d.ts +3 -0
  33. package/dist/src/components/data/nmorph-pagination/types.d.ts +3 -0
  34. package/dist/src/components/data/nmorph-table/NmorphTable.vue.d.ts +2 -20
  35. package/dist/src/components/data/nmorph-table/types.d.ts +11 -3
  36. package/dist/src/components/providers/nmorph-notification-provider/NmorphNotificationProvider.vue.d.ts +3 -1
  37. package/dist/src/components/providers/nmorph-notification-provider/types.d.ts +2 -0
  38. package/dist/style.css +1 -1
  39. 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 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 140c0-36.45 29.55-66 66-66s66 29.55 66 66v420h32V86c0-36.45 29.55-66 66-66s66 29.55 66 66v474h32V160c0-36.45 29.55-66 66-66s66 29.55 66 66v424h30V256c0-36.45 29.55-66 66-66s66 29.55 66 66v444c0 167.9-136.1 304-304 304h-82c-98.69 0-190.2-51.5-241.34-135.92l-244.93-233.2a70 70 0 0 1 120.06-71.76L360 780z"
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,.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 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
+ .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 n, normalizeStyle as k, normalizeClass as h, renderSlot as r, createVNode as s, withCtx as l, Fragment as c, renderList as y, createBlock as D, createElementVNode as C, createTextVNode as _, toDisplayString as m } from "vue";
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 v from "../../../_virtual/_plugin-vue_export-helper.js";
5
+ import T from "../../../_virtual/_plugin-vue_export-helper.js";
6
6
  const g = ["data-date", "onClick"];
7
- function T(d, p, B, a, M, w) {
8
- return o(), n(
7
+ function p(d, B, M, a, w, x) {
8
+ return o(), r(
9
9
  "div",
10
10
  {
11
- class: h(a.modifiers),
11
+ class: i(a.modifiers),
12
12
  style: k(a.styles)
13
13
  },
14
14
  [
15
- r(d.$slots, "header", {}, () => [
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
- r(d.$slots, "content", {}, () => [
29
- s(a.NmorphTable, {
28
+ n(d.$slots, "content", {}, () => [
29
+ s(a.NmorphTable, C({
30
30
  data: a.calendar,
31
- bordered: "",
32
- "row-hover": !1,
33
- design: a.props.design
34
- }, {
31
+ "row-hover": !1
32
+ }, a.tableDesignProps), {
35
33
  default: l(() => [
36
- (o(!0), n(
34
+ (o(!0), r(
37
35
  c,
38
36
  null,
39
- y(a.days, (e) => (o(), D(a.NmorphTableColumn, {
40
- key: `${e}`,
41
- prop: e,
42
- label: e.toUpperCase()
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), n(
43
+ (o(!0), r(
46
44
  c,
47
45
  null,
48
- y(b.rows, (t, i) => (o(), D(a.NmorphTableCell, {
49
- key: i,
50
- row: i
46
+ y(b.rows, (e, h) => (o(), D(a.NmorphTableCell, {
47
+ key: h,
48
+ row: h
51
49
  }, {
52
50
  default: l(() => [
53
- C("div", {
54
- "data-date": `${a.dateData(t[e]).date}`,
55
- class: h([
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[e]).monthType}`,
55
+ `nmorph-calendar-date--${a.dateData(e[t]).monthType}`,
58
56
  {
59
- "nmorph-calendar-date--today": a.dateData(t[e]).isToday && !a.dateData(t[e]).hidden && a.props.markToday
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[e]).hidden },
59
+ { "nmorph-calendar-date--hidden": a.dateData(e[t]).hidden },
62
60
  {
63
- "nmorph-calendar-date--selected": a.isValueSelected(a.dateData(t[e]).date)
61
+ "nmorph-calendar-date--selected": a.isValueSelected(a.dateData(e[t]).date)
64
62
  }
65
63
  ]),
66
- onClick: (x) => a.clickDate(a.dateData(t[e]))
64
+ onClick: (P) => a.clickDate(a.dateData(e[t]))
67
65
  }, [
68
- r(d.$slots, "date-cell", {
66
+ n(d.$slots, "date-cell", {
69
67
  scope: {
70
- ...a.dateData(t[e]),
71
- selected: a.isValueSelected(a.dateData(t[e]).date)
68
+ ...a.dateData(e[t]),
69
+ selected: a.isValueSelected(a.dateData(e[t]).date)
72
70
  }
73
71
  }, () => [
74
72
  _(
75
- m(a.dateData(t[e]).hidden ? "-" : a.dateData(t[e]).value),
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
- }, 8, ["data", "design"])
96
+ }, 16, ["data"])
99
97
  ])
100
98
  ],
101
99
  6
102
100
  /* CLASS, STYLE */
103
101
  );
104
102
  }
105
- const z = /* @__PURE__ */ v(f, [["render", T], ["__file", "/builds/ketjo/nmorph/library/src/components/data/nmorph-calendar/NmorphCalendar.vue"]]);
103
+ const E = /* @__PURE__ */ T(f, [["render", p], ["__file", "/builds/ketjo/nmorph/library/src/components/data/nmorph-calendar/NmorphCalendar.vue"]]);
106
104
  export {
107
- z as default
105
+ E as default
108
106
  };
@@ -1,14 +1,14 @@
1
1
  import './NmorphCalendar.css';
2
- import { defineComponent as R, ref as x, onMounted as O, reactive as k, watch as v, computed as s } from "vue";
3
- import { useModifiers as j } from "../../../utils/create-modifiers.js";
4
- import { createCssSizeVariables as z } from "../../../utils/common.js";
5
- import W from "./inner-components/nmorph-calendar-header/NmorphCalendarHeader.vue.js";
6
- import { useCalendarTexts as Z } from "./hooks/use-calendar-texts.js";
7
- import { hasAnyRangeDateInPrevMonth as F, hasAnyRangeDateInNextMonth as G, isTodayInMonthRange as J, resetTimeToZero as d, getMonthDaysByWeek as K } from "./utils.js";
8
- import L from "../nmorph-table/components/nmorph-table-cell/NmorphTableCell.vue.js";
9
- import Q from "../nmorph-table/components/nmorph-table-column/NmorphTableColumn.vue.js";
10
- import U from "../nmorph-table/NmorphTable.vue.js";
11
- const ue = /* @__PURE__ */ R({
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 r = N, i = _, { days: h } = Z(), y = () => {
26
- l.value = M.value;
25
+ const a = N, s = _, { days: v } = F(), y = () => {
26
+ o.value = M.value;
27
27
  }, C = () => {
28
- l.value = /* @__PURE__ */ new Date();
28
+ o.value = /* @__PURE__ */ new Date();
29
29
  }, g = () => {
30
- l.value = A.value;
31
- }, u = () => {
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 (r.type === "date") {
35
+ if (a.type === "date") {
36
36
  if (e instanceof Date)
37
37
  return d(e);
38
- u();
38
+ i();
39
39
  }
40
- const o = Array.isArray(e) && e.every((a) => a instanceof Date);
41
- if (r.type === "dates") {
42
- if (o)
43
- return e.map((a) => d(a));
44
- u();
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 (r.type === "daterange") {
47
- if (o)
48
- return e.map((a) => d(a)).slice(0, 2);
49
- u();
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: o, hidden: a } = e;
54
- if (a) return;
55
- o === "next" && g(), o === "previous" && y();
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 (r.type === "date" && (t.value = n, i("update:model-value", t.value)), r.type === "dates") {
58
- if (!Array.isArray(t.value)) return u();
59
- const m = n.toDateString(), w = t.value.map((P) => P.toDateString()).indexOf(m);
60
- w !== -1 ? t.value.splice(w, 1) : t.value.push(n), i("update:model-value", t.value);
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 (r.type === "daterange") {
63
- if (!Array.isArray(t.value)) return u();
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], i("update:model-value", t.value.slice(0, 2));
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, o) => {
67
- const [a, n] = o;
68
- return o.length === 1 ? e.toDateString() === a.toDateString() : a && n ? e >= d(a) && e <= d(n) : !1;
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 (r.type === "date")
72
- return Array.isArray(t.value) ? u() : t.value.toDateString() === e.toDateString();
73
- if (r.type === "dates")
74
- return Array.isArray(t.value) ? !!t.value.find((a) => a.toDateString() === e.toDateString()) : u();
75
- if (r.type === "daterange")
76
- return Array.isArray(t.value) ? D(e, t.value) : u();
77
- }, l = x(r.initialDate), t = x(c(r.modelValue));
78
- O(() => {
79
- i("update:model-value", t.value);
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 = k([]);
81
+ let p = j([]);
82
82
  const f = () => {
83
- p = [], K(l, r.range).forEach((o) => {
84
- const a = {};
85
- o.forEach((n, m) => {
86
- const T = h[m];
87
- a[T] = n;
88
- }), p.push(a);
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
- v(
92
- () => r.initialDate,
91
+ h(
92
+ () => a.initialDate,
93
93
  (e) => {
94
- l.value = e;
94
+ o.value = e;
95
95
  },
96
96
  {
97
97
  deep: !0
98
98
  }
99
- ), v(l, () => {
100
- f(), i("update-initial-date", l.value);
101
- }), v(
102
- () => r.modelValue,
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 = s(() => new Date(l.value.setMonth(l.value.getMonth() - 1))), A = s(() => new Date(l.value.setMonth(l.value.getMonth() + 1))), V = s(() => {
108
- const { range: e } = r, o = e ? F(l.value, e[0]) : !0, a = e ? G(l.value, e[1]) : !0, n = J(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: o,
111
- showNextMonthButton: a,
110
+ showPreviousMonthButton: l,
111
+ showNextMonthButton: r,
112
112
  showTodayButton: n
113
113
  };
114
- }), E = s(
115
- () => j({
114
+ }), E = u(
115
+ () => z({
116
116
  "nmorph-calendar": []
117
117
  })
118
- ), H = s(
119
- () => z({
120
- "--nmorph-private-calendar-cell-height": r.cellHeight
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: r, emit: i, days: h, setPreviousMonth: y, setTodayMonth: C, setNextMonth: g, wrongType: u, convertValue: c, clickDate: q, isDateInRange: D, isValueSelected: B, initialDate: l, selectedValue: t, get calendar() {
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 U;
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 Q;
133
+ return U;
132
134
  }, get NmorphTableCell() {
133
- return L;
134
- }, NmorphCalendarHeader: W };
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
- ue as default
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{right:var(--nmorph-private-carousel-action-offset)}.nmorph-carousel .nmorph-carousel__next{left: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
+ .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 d from "./NmorphCarousel.vue2.js";
3
- import { openBlock as e, createElementBlock as o, normalizeClass as c, createElementVNode as n, normalizeStyle as h, Fragment as i, renderList as s, createVNode as l, withCtx as m, renderSlot as p } from "vue";
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 v = ["id"], f = { class: "nmorph-carousel__elements-indicator" }, C = ["onClick"];
7
- function k(_, N, I, r, b, y) {
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: c(r.modifiers)
11
+ class: i(r.modifiers)
12
12
  },
13
13
  [
14
14
  n(
15
15
  "div",
16
16
  {
17
- class: "nmorph-carousel__wrapper transition-enabled",
18
- style: h({ transform: r.translateX })
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
- i,
24
+ c,
23
25
  null,
24
- s(r.carouselData, (a) => (e(), o("div", {
25
- id: `nmorph-carousel-item-${r.carouselId}-${a}`,
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, v))),
30
+ }, null, 8, f))),
29
31
  128
30
32
  /* KEYED_FRAGMENT */
31
33
  ))
32
34
  ],
33
- 4
34
- /* STYLE */
35
+ 38
36
+ /* CLASS, STYLE, NEED_HYDRATION */
35
37
  ),
36
- n("div", f, [
38
+ n("div", v, [
37
39
  (e(!0), o(
38
- i,
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: (S) => r.elementIndicator(t)
45
+ onClick: (w) => r.elementIndicator(t)
44
46
  }, [
45
47
  n(
46
48
  "div",
47
49
  {
48
- class: c(["nmorph-carousel__element-indicator", { "nmorph-carousel__element-indicator--active": r.isCurrentElementActive(t) }])
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.nextSlide
63
+ onClick: r.prevSlide
62
64
  }, [
63
65
  l(r.NmorphIcon, null, {
64
66
  default: m(() => [
65
- l(r.NmorphIconChevronRight)
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.prevSlide
75
+ onClick: r.nextSlide
74
76
  }, [
75
77
  l(r.NmorphIcon, null, {
76
78
  default: m(() => [
77
- l(r.NmorphIconChevronLeft)
79
+ l(r.NmorphIconChevronRight)
78
80
  ]),
79
81
  _: 1
80
82
  /* STABLE */
81
83
  })
82
84
  ]),
83
- p(_.$slots, "default")
85
+ p(d.$slots, "default")
84
86
  ],
85
87
  2
86
88
  /* CLASS */
87
89
  );
88
90
  }
89
- const z = /* @__PURE__ */ u(d, [["render", k], ["__file", "/builds/ketjo/nmorph/library/src/components/data/nmorph-carousel/NmorphCarousel.vue"]]);
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 x, ref as p, computed as u, provide as M, watch as d } from "vue";
3
- import { useModifiers as y } from "../../../utils/create-modifiers.js";
4
- import { generateUUID as b } from "../../../utils/common.js";
5
- import q from "../../../assets/icons/chevron-right.svg.js";
6
- import w from "../../../assets/icons/chevron-left.svg.js";
7
- import D from "../../basic/nmorph-icon/NmorphIcon.vue.js";
8
- const A = /* @__PURE__ */ x({
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(h, { expose: f, emit: v }) {
16
- f();
17
- const e = p(0), o = h, l = v, g = u(
18
- () => y({
19
- nmorph: [o.design === "nmorph" ? "shadow-outset" : ""],
20
- "nmorph-carousel": [o.design]
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
- ), a = p([]), s = b();
23
- M("carousel-data", { data: a, carouselId: s });
24
- const r = u(() => a.value.length), i = (t) => r.value ? o.loop ? (t + r.value) % r.value : Math.min(Math.max(t, 0), r.value - 1) : 0, n = (t) => {
25
- const c = i(t);
26
- c !== e.value && (e.value = c);
27
- }, I = () => n(e.value - 1), _ = () => n(e.value + 1), C = u(() => `translateX(-${e.value * 100}%)`), S = (t) => t === e.value, N = (t) => {
28
- n(t);
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
- d(r, (t) => {
31
- e.value > t - 1 && (e.value = Math.max(t - 1, 0));
32
- }), d(e, () => {
33
- l("change", e.value);
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 m = { currentSlide: e, props: o, emit: l, modifiers: g, carouselData: a, carouselId: s, slideCount: r, normalizeSlideIndex: i, goToSlide: n, prevSlide: I, nextSlide: _, translateX: C, isCurrentElementActive: S, elementIndicator: N, get NmorphIcon() {
36
- return D;
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 w;
88
+ return H;
39
89
  }, get NmorphIconChevronRight() {
40
- return q;
90
+ return B;
41
91
  } };
42
- return Object.defineProperty(m, "__isScriptSetup", { enumerable: !1, value: !0 }), m;
92
+ return Object.defineProperty(_, "__isScriptSetup", { enumerable: !1, value: !0 }), _;
43
93
  }
44
94
  });
45
95
  export {
46
- A as default
96
+ V as default
47
97
  };