@nmorph/nmorph-ui-kit 2.2.10 → 2.2.12

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 (37) hide show
  1. package/dist/components/data/nmorph-avatar/NmorphAvatar.css +1 -0
  2. package/dist/components/data/nmorph-avatar/NmorphAvatar.vue.js +74 -46
  3. package/dist/components/data/nmorph-avatar/NmorphAvatar.vue2.js +26 -21
  4. package/dist/components/data/nmorph-carousel/NmorphCarousel.vue2.js +4 -4
  5. package/dist/components/data/nmorph-image-preview/NmorphImagePreview.vue.js +77 -38
  6. package/dist/components/data/nmorph-image-preview/NmorphImagePreview.vue2.js +31 -30
  7. package/dist/components/data/nmorph-pagination/NmorphPagination.css +1 -1
  8. package/dist/components/data/nmorph-pagination/NmorphPagination.vue.js +33 -28
  9. package/dist/components/data/nmorph-pagination/NmorphPagination.vue2.js +18 -17
  10. package/dist/components/form/nmorph-autocomplete/NmorphAutocomplete.vue2.js +8 -8
  11. package/dist/components/form/nmorph-checkbox/NmorphCheckbox.css +1 -1
  12. package/dist/components/form/nmorph-checkbox/NmorphCheckbox.vue.js +15 -13
  13. package/dist/components/form/nmorph-checkbox/NmorphCheckbox.vue2.js +8 -8
  14. package/dist/components/form/nmorph-checkbox-group/NmorphCheckboxGroup.vue2.js +22 -14
  15. package/dist/components/form/nmorph-radio/NmorphRadio.css +1 -1
  16. package/dist/components/form/nmorph-radio/NmorphRadio.vue.js +22 -20
  17. package/dist/components/form/nmorph-radio/NmorphRadio.vue2.js +7 -7
  18. package/dist/components/form/nmorph-radio-group/NmorphRadioGroup.vue2.js +14 -14
  19. package/dist/components/navigation/nmorph-backtop/NmorphBacktop.vue.js +7 -7
  20. package/dist/hooks/use-common-styles.js +10 -11
  21. package/dist/index.es.js +695 -694
  22. package/dist/index.umd.js +27 -28
  23. package/dist/nuxt.mjs +36 -7
  24. package/dist/package.json.js +1 -1
  25. package/dist/plugin.js +21 -20
  26. package/dist/src/components/data/nmorph-badge/NmorphBadge.vue.d.ts +1 -1
  27. package/dist/src/components/data/nmorph-image/NmorphImage.vue.d.ts +3 -3
  28. package/dist/src/components/data/nmorph-image-preview/NmorphImagePreview.vue.d.ts +14 -2
  29. package/dist/src/components/data/nmorph-pagination/NmorphPagination.vue.d.ts +3 -0
  30. package/dist/src/components/form/nmorph-checkbox/NmorphCheckbox.vue.d.ts +1 -0
  31. package/dist/src/components/form/nmorph-checkbox-group/NmorphCheckboxGroup.vue.d.ts +4 -3
  32. package/dist/src/components/form/nmorph-radio/NmorphRadio.vue.d.ts +1 -0
  33. package/dist/src/components/form/nmorph-radio-group/NmorphRadioGroup.vue.d.ts +4 -3
  34. package/dist/src/types/index.d.ts +9 -2
  35. package/dist/style.css +1 -1
  36. package/dist/types/index.js +14 -8
  37. package/package.json +1 -1
@@ -1,25 +1,26 @@
1
1
  import './NmorphPagination.css';
2
- import d from "./NmorphPagination.vue2.js";
3
- import { openBlock as e, createElementBlock as i, normalizeClass as l, createVNode as a, withCtx as r, Fragment as p, renderList as c, createBlock as t, mergeProps as m, createCommentVNode as _ } from "vue";
2
+ import h from "./NmorphPagination.vue2.js";
3
+ import { openBlock as a, createElementBlock as r, normalizeClass as l, createVNode as e, withCtx as i, Fragment as d, renderList as p, createBlock as t, mergeProps as c, createCommentVNode as m } from "vue";
4
4
  /* empty css */
5
- import s from "../../../_virtual/_plugin-vue_export-helper.js";
6
- function b(h, v, f, o, g, k) {
7
- return o.show ? (e(), i(
5
+ import _ from "../../../_virtual/_plugin-vue_export-helper.js";
6
+ function s(g, b, v, o, f, k) {
7
+ return o.show ? (a(), r(
8
8
  "div",
9
9
  {
10
10
  key: 0,
11
11
  class: l(o.modifiers)
12
12
  },
13
13
  [
14
- a(o.NmorphButton, {
14
+ e(o.NmorphButton, {
15
15
  class: "nmorph-pagination__btn nmorph-pagination__prev-btn",
16
+ height: o.props.height,
16
17
  disabled: o.blockPrevButton || o.props.disabled,
17
18
  onClick: o.prevClick
18
19
  }, {
19
- default: r(() => [
20
- a(o.NmorphIcon, { class: "nmorph-pagination__prev-icon" }, {
21
- default: r(() => [
22
- a(o.NmorphIconChevronDown)
20
+ default: i(() => [
21
+ e(o.NmorphIcon, { class: "nmorph-pagination__prev-icon" }, {
22
+ default: i(() => [
23
+ e(o.NmorphIconChevronDown)
23
24
  ]),
24
25
  _: 1
25
26
  /* STABLE */
@@ -27,34 +28,37 @@ function b(h, v, f, o, g, k) {
27
28
  ]),
28
29
  _: 1
29
30
  /* STABLE */
30
- }, 8, ["disabled"]),
31
- a(o.NmorphRadioGroup, {
31
+ }, 8, ["height", "disabled"]),
32
+ e(o.NmorphRadioGroup, {
32
33
  "model-value": o.selectedPage,
33
34
  class: "nmorph-pagination__page-group",
35
+ height: o.props.height,
34
36
  disabled: o.props.disabled,
35
37
  "onUpdate:modelValue": o.updateSelectedValue
36
38
  }, {
37
- default: r(() => [
38
- (e(!0), i(
39
- p,
39
+ default: i(() => [
40
+ (a(!0), r(
41
+ d,
40
42
  null,
41
- c(o.visiblePages, (n) => (e(), i("div", {
43
+ p(o.visiblePages, (n) => (a(), r("div", {
42
44
  key: n.value,
43
45
  class: "nmorph-pagination__page-btn-wrapper"
44
46
  }, [
45
- n.value === "prev" || n.value === "next" ? (e(), t(o.NmorphButton, {
47
+ n.value === "prev" || n.value === "next" ? (a(), t(o.NmorphButton, {
46
48
  key: 0,
47
49
  class: l(`nmorph-pagination__page-btn nmorph-pagination__${n.value}`),
48
50
  text: n.label,
51
+ height: o.props.height,
49
52
  disabled: o.props.disabled,
50
53
  onClick: (N) => o.bigStepUpdate(n.value)
51
- }, null, 8, ["class", "text", "disabled", "onClick"])) : (e(), t(o.NmorphRadio, m({
54
+ }, null, 8, ["class", "text", "height", "disabled", "onClick"])) : (a(), t(o.NmorphRadio, c({
52
55
  key: 1,
53
56
  ref_for: !0
54
57
  }, n, {
55
58
  class: "nmorph-pagination__page-btn",
59
+ height: o.props.height,
56
60
  disabled: o.props.disabled
57
- }), null, 16, ["disabled"]))
61
+ }), null, 16, ["height", "disabled"]))
58
62
  ]))),
59
63
  128
60
64
  /* KEYED_FRAGMENT */
@@ -62,16 +66,17 @@ function b(h, v, f, o, g, k) {
62
66
  ]),
63
67
  _: 1
64
68
  /* STABLE */
65
- }, 8, ["model-value", "disabled"]),
66
- a(o.NmorphButton, {
69
+ }, 8, ["model-value", "height", "disabled"]),
70
+ e(o.NmorphButton, {
67
71
  class: "nmorph-pagination__btn nmorph-pagination__next-btn",
72
+ height: o.props.height,
68
73
  disabled: o.blockNextButton || o.props.disabled,
69
74
  onClick: o.nextClick
70
75
  }, {
71
- default: r(() => [
72
- a(o.NmorphIcon, { class: "nmorph-pagination__next-icon" }, {
73
- default: r(() => [
74
- a(o.NmorphIconChevronDown)
76
+ default: i(() => [
77
+ e(o.NmorphIcon, { class: "nmorph-pagination__next-icon" }, {
78
+ default: i(() => [
79
+ e(o.NmorphIconChevronDown)
75
80
  ]),
76
81
  _: 1
77
82
  /* STABLE */
@@ -79,13 +84,13 @@ function b(h, v, f, o, g, k) {
79
84
  ]),
80
85
  _: 1
81
86
  /* STABLE */
82
- }, 8, ["disabled"])
87
+ }, 8, ["height", "disabled"])
83
88
  ],
84
89
  2
85
90
  /* CLASS */
86
- )) : _("v-if", !0);
91
+ )) : m("v-if", !0);
87
92
  }
88
- const P = /* @__PURE__ */ s(d, [["render", b], ["__file", "/builds/ketjo/nmorph/library/src/components/data/nmorph-pagination/NmorphPagination.vue"]]);
93
+ const P = /* @__PURE__ */ _(h, [["render", s], ["__file", "/builds/ketjo/nmorph/library/src/components/data/nmorph-pagination/NmorphPagination.vue"]]);
89
94
  export {
90
95
  P as default
91
96
  };
@@ -1,6 +1,6 @@
1
1
  import './NmorphPagination.css';
2
- import { defineComponent as P, computed as u, ref as _, watch as x } from "vue";
3
- import { useModifiers as q } from "../../../utils/create-modifiers.js";
2
+ import { defineComponent as P, computed as o, ref as _, watch as q } from "vue";
3
+ import { useModifiers as x } from "../../../utils/create-modifiers.js";
4
4
  import w from "../../form/nmorph-radio/NmorphRadio.vue.js";
5
5
  import B from "../../basic/nmorph-icon/NmorphIcon.vue.js";
6
6
  import O from "../../basic/nmorph-button/NmorphButton.vue.js";
@@ -15,43 +15,44 @@ const M = /* @__PURE__ */ P({
15
15
  disabled: { type: Boolean, required: !1, default: !1 },
16
16
  hideOnSinglePage: { type: Boolean, required: !1, default: !0 },
17
17
  maxVisiblePages: { type: Number, required: !1, default: 9 },
18
- fastForwardStep: { type: Number, required: !1, default: 5 }
18
+ fastForwardStep: { type: Number, required: !1, default: 5 },
19
+ height: { type: null, required: !1, default: "basic" }
19
20
  },
20
21
  emits: ["update:model-value"],
21
22
  setup(p, { expose: d, emit: c }) {
22
23
  d();
23
- const a = p, s = c, f = u(
24
- () => q({
24
+ const a = p, s = c, f = o(
25
+ () => x({
25
26
  "nmorph-pagination": [`${a.disabled && "disabled"}`]
26
27
  })
27
28
  ), v = () => {
28
29
  r.value = String(Number(r.value) - 1);
29
30
  }, g = () => {
30
31
  r.value = String(Number(r.value) + 1);
31
- }, r = _(String(a.modelValue)), t = u(() => {
32
- const e = a.totalElementsQuantity / a.elementsQuantityOnPage + 1, o = e % 1 === 0 ? -1 : 0;
33
- return Array.from({ length: e + o }, (n, m) => ({ value: String(m + 1), label: String(m + 1) }));
34
- }), b = u(() => a.hideOnSinglePage || a.totalElementsQuantity / a.elementsQuantityOnPage > 1);
35
- x(r, (e) => {
32
+ }, r = _(String(a.modelValue)), t = o(() => {
33
+ const e = a.totalElementsQuantity / a.elementsQuantityOnPage + 1, u = e % 1 === 0 ? -1 : 0;
34
+ return Array.from({ length: e + u }, (n, m) => ({ value: String(m + 1), label: String(m + 1) }));
35
+ }), b = o(() => a.hideOnSinglePage || a.totalElementsQuantity / a.elementsQuantityOnPage > 1);
36
+ q(r, (e) => {
36
37
  s("update:model-value", Number(e));
37
38
  });
38
39
  const h = (e) => {
39
40
  r.value = e;
40
- }, N = u(() => Number(r.value) === 1), S = u(() => t.value.length === Number(r.value)), y = u(() => {
41
- const e = t.value.length, o = Number(r.value), l = a.maxVisiblePages;
41
+ }, N = o(() => Number(r.value) === 1), y = o(() => t.value.length === Number(r.value)), S = o(() => {
42
+ const e = t.value.length, u = Number(r.value), l = a.maxVisiblePages;
42
43
  if (e <= l)
43
44
  return t.value;
44
45
  const n = Math.floor(l / 2);
45
- return o <= n ? [...t.value.slice(0, l - 2), { value: "next", label: "..." }, t.value[e - 1]] : o >= e - n ? [t.value[0], { value: "prev", label: "..." }, ...t.value.slice(e - (l - 2))] : [
46
+ return u <= n ? [...t.value.slice(0, l - 2), { value: "next", label: "..." }, t.value[e - 1]] : u >= e - n ? [t.value[0], { value: "prev", label: "..." }, ...t.value.slice(e - (l - 2))] : [
46
47
  t.value[0],
47
48
  { value: "prev", label: "..." },
48
- ...t.value.slice(o - n, o + n - 1),
49
+ ...t.value.slice(u - n, u + n - 1),
49
50
  { value: "next", label: "..." },
50
51
  t.value[e - 1]
51
52
  ];
52
- }), i = { props: a, emit: s, modifiers: f, prevClick: v, nextClick: g, selectedPage: r, pages: t, show: b, updateSelectedValue: h, blockPrevButton: N, blockNextButton: S, visiblePages: y, bigStepUpdate: (e) => {
53
- const o = Number(r.value);
54
- let l = e === "prev" ? o - a.fastForwardStep : o + a.fastForwardStep;
53
+ }), i = { props: a, emit: s, modifiers: f, prevClick: v, nextClick: g, selectedPage: r, pages: t, show: b, updateSelectedValue: h, blockPrevButton: N, blockNextButton: y, visiblePages: S, bigStepUpdate: (e) => {
54
+ const u = Number(r.value);
55
+ let l = e === "prev" ? u - a.fastForwardStep : u + a.fastForwardStep;
55
56
  l <= 0 && (l = 1), l >= t.value.length && (l = t.value.length), r.value = String(l);
56
57
  }, get NmorphRadioGroup() {
57
58
  return Q;
@@ -1,10 +1,10 @@
1
1
  import './NmorphAutocomplete.css';
2
2
  import { defineComponent as N, ref as a, computed as p, watch as i } from "vue";
3
3
  import { useModifiers as _ } from "../../../utils/create-modifiers.js";
4
- import S from "../../../assets/icons/loader.svg.js";
5
- import I from "../nmorph-text-input/NmorphTextInput.vue.js";
6
- import w from "../../navigation/nmorph-dropdown/NmorphDropdown.vue.js";
7
- import x from "../../basic/nmorph-icon/NmorphIcon.vue.js";
4
+ import S from "../nmorph-text-input/NmorphTextInput.vue.js";
5
+ import I from "../../navigation/nmorph-dropdown/NmorphDropdown.vue.js";
6
+ import w from "../../basic/nmorph-icon/NmorphIcon.vue.js";
7
+ import x from "../../../assets/icons/loader.svg.js";
8
8
  const D = /* @__PURE__ */ N({
9
9
  __name: "NmorphAutocomplete",
10
10
  props: {
@@ -49,13 +49,13 @@ const D = /* @__PURE__ */ N({
49
49
  e && (r.value = !0);
50
50
  });
51
51
  const s = { props: o, initialValue: t, emit: u, modifiers: f, updateValueHandler: h, open: r, nmorphAutocompleteDOMRef: v, closeHandler: y, filteredList: n, clickHandler: g, focusHandler: b, loader: l, get NmorphIcon() {
52
- return x;
53
- }, get NmorphDropdown() {
54
52
  return w;
55
- }, get NmorphTextInput() {
53
+ }, get NmorphDropdown() {
56
54
  return I;
57
- }, get NmorphIconLoader() {
55
+ }, get NmorphTextInput() {
58
56
  return S;
57
+ }, get NmorphIconLoader() {
58
+ return x;
59
59
  } };
60
60
  return Object.defineProperty(s, "__isScriptSetup", { enumerable: !1, value: !0 }), s;
61
61
  }
@@ -1 +1 @@
1
- .nmorph-checkbox{--size: var(--height);display:inline-flex;align-items:center;cursor:pointer}.nmorph-checkbox .nmorph-checkbox__content{position:relative;display:flex;align-items:center;justify-content:center}.nmorph-checkbox .nmorph-checkbox__input-wrapper{position:relative;width:var(--size);height:var(--size)}.nmorph-checkbox input{opacity:0;position:absolute;top:0;left:0;width:100%;height:100%}.nmorph-checkbox input:focus-visible{opacity:1;scale:.95;outline:2px solid var(--nmorph-accent-color)}.nmorph-checkbox .nmorph-checkbox__fake{border-radius:var(--default-border-radius);width:100%;height:100%;position:absolute;top:0;left:0;background:var(--nmorph-main-color);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)}.nmorph-checkbox .nmorph-checkbox__label,.nmorph-checkbox .nmorph-checkbox__fake span{font-weight:400;font-size:var(--font-size-small);line-height:var(--line-height-regular)}.nmorph-checkbox .nmorph-checkbox__fake-checked{width:50%;height:50%;background:var(--nmorph-accent-color);border-radius:var(--border-radius-20);position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.nmorph-checkbox .nmorph-checkbox__label{margin-left:var(--indentation-02);line-height:1}.nmorph-checkbox .nmorph-checkbox__fake span{line-height:.8}.nmorph-checkbox.nmorph-checkbox--button .nmorph-checkbox__fake{position:relative;display:flex;align-items:center;height:var(--size);padding:var(--indentation-03);border-radius:var(--default-border-radius);background: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)}.nmorph-checkbox.nmorph-checkbox--checked .nmorph-checkbox__fake{background:var(--nmorph-main-color);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)}.nmorph-checkbox.nmorph-checkbox--disabled{cursor:not-allowed;opacity:.6}
1
+ .nmorph-checkbox{--size: var(--height);display:inline-flex;align-items:center;cursor:pointer}.nmorph-checkbox .nmorph-checkbox__content{position:relative;display:flex;align-items:center;justify-content:center}.nmorph-checkbox .nmorph-checkbox__input-wrapper{position:relative;width:var(--size);height:var(--size)}.nmorph-checkbox input{opacity:0;position:absolute;top:0;left:0;width:100%;height:100%}.nmorph-checkbox input:focus-visible{opacity:1;scale:.95;outline:2px solid var(--nmorph-accent-color)}.nmorph-checkbox .nmorph-checkbox__fake{border-radius:var(--default-border-radius);width:100%;height:100%;position:absolute;top:0;left:0;background:var(--nmorph-main-color);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)}.nmorph-checkbox .nmorph-checkbox__label,.nmorph-checkbox .nmorph-checkbox__fake span{font-weight:400;font-size:var(--font-size-small);line-height:var(--line-height-regular)}.nmorph-checkbox .nmorph-checkbox__fake-checked{width:50%;height:50%;background:var(--nmorph-accent-color);border-radius:var(--border-radius-20);position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.nmorph-checkbox .nmorph-checkbox__label{margin-left:var(--indentation-02);line-height:1}.nmorph-checkbox .nmorph-checkbox__fake span{line-height:.8}.nmorph-checkbox.nmorph-checkbox--button .nmorph-checkbox__fake{position:relative;display:flex;align-items:center;height:var(--size);padding:var(--indentation-03);border-radius:var(--default-border-radius);background: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)}.nmorph-checkbox.nmorph--extra-thin-component .nmorph-checkbox__label,.nmorph-checkbox.nmorph--extra-thin-component .nmorph-checkbox__fake span{font-size:var(--font-size-extra-small);line-height:var(--line-height-line)}.nmorph-checkbox.nmorph--extra-thin-component.nmorph-checkbox--button .nmorph-checkbox__fake{padding:var(--indentation-02)}.nmorph-checkbox.nmorph-checkbox--checked .nmorph-checkbox__fake{background:var(--nmorph-main-color);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)}.nmorph-checkbox.nmorph-checkbox--disabled{cursor:not-allowed;opacity:.6}
@@ -1,6 +1,6 @@
1
1
  import './NmorphCheckbox.css';
2
- import i from "./NmorphCheckbox.vue2.js";
3
- import { openBlock as o, createElementBlock as c, normalizeClass as a, createElementVNode as n, createCommentVNode as s, toDisplayString as d, renderSlot as h } from "vue";
2
+ import h from "./NmorphCheckbox.vue2.js";
3
+ import { openBlock as o, createElementBlock as c, normalizeClass as i, createElementVNode as n, createCommentVNode as l, toDisplayString as a, renderSlot as r } from "vue";
4
4
  /* empty css */
5
5
  import t from "../../../_virtual/_plugin-vue_export-helper.js";
6
6
  const _ = {
@@ -25,11 +25,11 @@ const _ = {
25
25
  key: 1,
26
26
  class: "nmorph-checkbox__fake"
27
27
  };
28
- function C(l, r, g, e, N, D) {
28
+ function C(s, d, g, e, N, D) {
29
29
  return o(), c(
30
30
  "label",
31
31
  {
32
- class: a(e.modifiers)
32
+ class: i(e.modifiers)
33
33
  },
34
34
  [
35
35
  e.props.design === "checkbox" ? (o(), c("div", _, [
@@ -42,27 +42,27 @@ function C(l, r, g, e, N, D) {
42
42
  class: "nmorph-native-input",
43
43
  onChange: e.handleChange
44
44
  }, null, 40, k),
45
- r[0] || (r[0] = n(
45
+ d[0] || (d[0] = n(
46
46
  "div",
47
47
  { class: "nmorph-checkbox__fake" },
48
48
  null,
49
49
  -1
50
50
  /* HOISTED */
51
51
  )),
52
- e.checked ? (o(), c("div", b)) : s("v-if", !0)
52
+ e.checked ? (o(), c("div", b)) : l("v-if", !0)
53
53
  ]),
54
54
  e.props.label ? (o(), c("div", m, [
55
55
  n(
56
56
  "span",
57
57
  null,
58
- d(e.props.label),
58
+ a(e.props.label),
59
59
  1
60
60
  /* TEXT */
61
61
  )
62
62
  ])) : (o(), c("div", f, [
63
- h(l.$slots, "default")
63
+ r(s.$slots, "default")
64
64
  ]))
65
- ])) : s("v-if", !0),
65
+ ])) : l("v-if", !0),
66
66
  e.props.design === "button" ? (o(), c("div", x, [
67
67
  n("input", {
68
68
  ref: "inputDOMRef",
@@ -75,20 +75,22 @@ function C(l, r, g, e, N, D) {
75
75
  n(
76
76
  "span",
77
77
  null,
78
- d(e.props.label),
78
+ a(e.props.label),
79
79
  1
80
80
  /* TEXT */
81
81
  )
82
82
  ])) : (o(), c("div", u, [
83
- h(l.$slots, "label")
83
+ r(s.$slots, "label", {}, () => [
84
+ r(s.$slots, "default")
85
+ ])
84
86
  ]))
85
- ])) : s("v-if", !0)
87
+ ])) : l("v-if", !0)
86
88
  ],
87
89
  2
88
90
  /* CLASS */
89
91
  );
90
92
  }
91
- const R = /* @__PURE__ */ t(i, [["render", C], ["__file", "/builds/ketjo/nmorph/library/src/components/form/nmorph-checkbox/NmorphCheckbox.vue"]]);
93
+ const R = /* @__PURE__ */ t(h, [["render", C], ["__file", "/builds/ketjo/nmorph/library/src/components/form/nmorph-checkbox/NmorphCheckbox.vue"]]);
92
94
  export {
93
95
  R as default
94
96
  };
@@ -1,7 +1,7 @@
1
1
  import './NmorphCheckbox.css';
2
2
  import { defineComponent as y, inject as u, watch as k, ref as i, computed as r } from "vue";
3
3
  import { useModifiers as x } from "../../../utils/create-modifiers.js";
4
- import { NmorphComponentHeight as V } from "../../../types/index.js";
4
+ import { NmorphSelectionControlHeight as S } from "../../../types/index.js";
5
5
  const $ = /* @__PURE__ */ y({
6
6
  __name: "NmorphCheckbox",
7
7
  props: {
@@ -9,7 +9,7 @@ const $ = /* @__PURE__ */ y({
9
9
  disabled: { type: Boolean, required: !1, default: !1 },
10
10
  modelValue: { type: Boolean, required: !1, default: !1 },
11
11
  label: { type: String, required: !1, default: "" },
12
- design: { type: String, required: !1, default: "checkbox" },
12
+ design: { type: String, required: !1, default: "button" },
13
13
  height: { type: null, required: !1 }
14
14
  },
15
15
  emits: ["update:model-value"],
@@ -20,16 +20,16 @@ const $ = /* @__PURE__ */ y({
20
20
  ), a = u(
21
21
  "change-checkbox-value-handler",
22
22
  void 0
23
- ), d = u("checkbox-group-height", void 0), e = f;
23
+ ), n = u("checkbox-group-height", void 0), e = f;
24
24
  k(
25
25
  () => e.modelValue,
26
26
  (_) => {
27
27
  t.value = _;
28
28
  }
29
29
  );
30
- const n = i(null);
31
- m({ inputDOMRef: n });
32
- const o = l !== void 0, t = o ? i(l.value) : i(e.modelValue), s = r(() => o ? l.value.includes(e.id) : e.modelValue), c = r(() => e.height || d?.value || "thin"), p = v, g = () => {
30
+ const d = i(null);
31
+ m({ inputDOMRef: d });
32
+ const o = l !== void 0, t = o ? i(l.value) : i(e.modelValue), s = r(() => o ? l.value.includes(e.id) : e.modelValue), c = r(() => e.height || n?.value || "thin"), p = v, g = () => {
33
33
  if (!e.disabled) {
34
34
  if (!o) {
35
35
  t.value = !t.value, p("update:model-value", t.value);
@@ -39,14 +39,14 @@ const $ = /* @__PURE__ */ y({
39
39
  }
40
40
  }, b = r(
41
41
  () => x({
42
- nmorph: [V[c.value]],
42
+ nmorph: [S[c.value]],
43
43
  "nmorph-checkbox": [
44
44
  `${s.value && "checked"}`,
45
45
  `${e.disabled && "disabled"}`,
46
46
  `${e.design === "button" && "button"}`
47
47
  ]
48
48
  })
49
- ), h = { groupSelectedValue: l, changeValue: a, groupHeight: d, props: e, inputDOMRef: n, hasGroup: o, initialValue: t, checked: s, height: c, emit: p, handleChange: g, modifiers: b };
49
+ ), h = { groupSelectedValue: l, changeValue: a, groupHeight: n, props: e, inputDOMRef: d, hasGroup: o, initialValue: t, checked: s, height: c, emit: p, handleChange: g, modifiers: b };
50
50
  return Object.defineProperty(h, "__isScriptSetup", { enumerable: !1, value: !0 }), h;
51
51
  }
52
52
  });
@@ -1,38 +1,46 @@
1
1
  import './NmorphCheckboxGroup.css';
2
- import { defineComponent as m, ref as h, computed as d, provide as o } from "vue";
3
- import { useModifiers as g } from "../../../utils/create-modifiers.js";
4
- import b from "../nmorph-checkbox/NmorphCheckbox.vue.js";
5
- const q = /* @__PURE__ */ m({
2
+ import { defineComponent as m, ref as h, watch as g, computed as d, provide as o } from "vue";
3
+ import { useModifiers as b } from "../../../utils/create-modifiers.js";
4
+ import y from "../nmorph-checkbox/NmorphCheckbox.vue.js";
5
+ const _ = /* @__PURE__ */ m({
6
6
  __name: "NmorphCheckboxGroup",
7
7
  props: {
8
8
  modelValue: { type: Array, required: !0, default: () => [] },
9
9
  options: { type: Array, required: !1, default: () => [] },
10
- design: { type: String, required: !1, default: "checkbox" },
10
+ design: { type: String, required: !1, default: "button" },
11
11
  direction: { type: null, required: !1, default: "row" },
12
+ height: { type: null, required: !1, default: "thin" },
12
13
  id: { type: String, required: !1 },
13
14
  name: { type: String, required: !1 },
14
15
  autocomplete: { type: String, required: !1 },
15
- height: { type: null, required: !1, default: "thin" },
16
16
  disabled: { type: Boolean, required: !1, default: !1 },
17
17
  tabindex: { type: Number, required: !1 }
18
18
  },
19
19
  emits: ["update:model-value"],
20
20
  setup(n, { expose: p, emit: s }) {
21
21
  p();
22
- const r = n, e = h(r.modelValue), u = s, l = (t) => {
23
- e.value.includes(t) ? e.value = e.value.filter((f) => f !== t) : e.value.push(t), u("update:model-value", e.value);
22
+ const r = n, e = h([...r.modelValue]);
23
+ g(
24
+ () => r.modelValue,
25
+ (t) => {
26
+ e.value = [...t];
27
+ },
28
+ { deep: !0 }
29
+ );
30
+ const u = s, a = (t) => {
31
+ e.value = e.value.includes(t) ? e.value.filter((f) => f !== t) : [...e.value, t], u("update:model-value", e.value);
24
32
  }, c = d(
25
- () => g({
33
+ () => b({
26
34
  "nmorph-checkbox-group": [r.design, r.direction]
27
35
  })
28
- ), a = d(() => r.height);
29
- o("checkbox-group-selected-value", e), o("change-checkbox-value-handler", l), o("checkbox-group-height", a);
30
- const i = { props: r, initialValue: e, emit: u, changeHandler: l, modifiers: c, height: a, get NmorphCheckbox() {
31
- return b;
36
+ ), l = d(() => r.height);
37
+ o("checkbox-group-selected-value", e), o("change-checkbox-value-handler", a), o("checkbox-group-height", l);
38
+ const i = { props: r, initialValue: e, emit: u, changeHandler: a, modifiers: c, height: l, get NmorphCheckbox() {
39
+ return y;
32
40
  } };
33
41
  return Object.defineProperty(i, "__isScriptSetup", { enumerable: !1, value: !0 }), i;
34
42
  }
35
43
  });
36
44
  export {
37
- q as default
45
+ _ as default
38
46
  };
@@ -1 +1 @@
1
- .nmorph-radio{--size: var(--height);display:inline-flex;align-items:center;cursor:pointer}.nmorph-radio .nmorph-radio__content{position:relative;display:flex;align-items:center;justify-content:center}.nmorph-radio span{margin-top:2px}.nmorph-radio .nmorph-radio__input-wrapper{position:relative;width:var(--size);height:var(--size)}.nmorph-radio input{position:absolute;top:0;left:0;width:100%;height:100%}.nmorph-radio input:focus-visible{background: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)}.nmorph-radio .nmorph-radio__fake{border-radius:var(--border-radius-circular);width:100%;height:100%;position:absolute;top:0;left:0;background:var(--nmorph-main-color);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)}.nmorph-radio .nmorph-radio__fake span,.nmorph-radio .nmorph-radio__label{font-weight:400;font-size:var(--font-size-small);line-height:var(--line-height-regular)}.nmorph-radio .nmorph-radio__fake-checked{width:50%;height:50%;background:var(--nmorph-accent-color);border-radius:var(--border-radius-circular);position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.nmorph-radio .nmorph-radio__label{margin-left:var(--indentation-02)}.nmorph-radio.nmorph-radio--button .nmorph-radio__fake{position:relative;display:flex;align-items:center;justify-content:center;height:var(--size);padding:var(--indentation-03);white-space:nowrap;border-radius:var(--default-border-radius);background: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)}.nmorph-radio.nmorph-radio--checked .nmorph-radio__fake{background:var(--nmorph-main-color);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)}.nmorph-radio.nmorph-radio--disabled{cursor:not-allowed;opacity:.6}
1
+ .nmorph-radio{--size: var(--height);display:inline-flex;align-items:center;cursor:pointer}.nmorph-radio .nmorph-radio__content{position:relative;display:flex;align-items:center;justify-content:center}.nmorph-radio span{margin-top:2px}.nmorph-radio .nmorph-radio__input-wrapper{position:relative;width:var(--size);height:var(--size)}.nmorph-radio input{position:absolute;top:0;left:0;width:100%;height:100%}.nmorph-radio input:focus-visible{background: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)}.nmorph-radio .nmorph-radio__fake{border-radius:var(--border-radius-circular);width:100%;height:100%;position:absolute;top:0;left:0;background:var(--nmorph-main-color);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)}.nmorph-radio .nmorph-radio__fake span,.nmorph-radio .nmorph-radio__label{font-weight:400;font-size:var(--font-size-small);line-height:var(--line-height-regular)}.nmorph-radio .nmorph-radio__fake-checked{width:50%;height:50%;background:var(--nmorph-accent-color);border-radius:var(--border-radius-circular);position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.nmorph-radio .nmorph-radio__label{margin-left:var(--indentation-02)}.nmorph-radio.nmorph-radio--button .nmorph-radio__fake{position:relative;display:flex;align-items:center;justify-content:center;height:var(--size);padding:var(--indentation-03);white-space:nowrap;border-radius:var(--default-border-radius);background: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)}.nmorph-radio.nmorph--extra-thin-component .nmorph-radio__fake span,.nmorph-radio.nmorph--extra-thin-component .nmorph-radio__label{font-size:var(--font-size-extra-small);line-height:var(--line-height-line)}.nmorph-radio.nmorph--extra-thin-component.nmorph-radio--button .nmorph-radio__fake{padding:var(--indentation-02)}.nmorph-radio.nmorph-radio--checked .nmorph-radio__fake{background:var(--nmorph-main-color);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)}.nmorph-radio.nmorph-radio--disabled{cursor:not-allowed;opacity:.6}
@@ -1,6 +1,6 @@
1
1
  import './NmorphRadio.css';
2
2
  import t from "./NmorphRadio.vue2.js";
3
- import { openBlock as o, createElementBlock as r, withModifiers as p, normalizeClass as c, createElementVNode as a, createCommentVNode as n, toDisplayString as s, renderSlot as d } from "vue";
3
+ import { openBlock as o, createElementBlock as a, withModifiers as p, normalizeClass as c, createElementVNode as r, createCommentVNode as i, toDisplayString as d, renderSlot as l } from "vue";
4
4
  /* empty css */
5
5
  import _ from "../../../_virtual/_plugin-vue_export-helper.js";
6
6
  const m = {
@@ -22,17 +22,17 @@ const m = {
22
22
  key: 1,
23
23
  class: "nmorph-radio__fake"
24
24
  };
25
- function N(i, l, R, e, C, D) {
26
- return o(), r(
25
+ function N(n, s, R, e, C, D) {
26
+ return o(), a(
27
27
  "label",
28
28
  {
29
29
  class: c(e.modifiers),
30
30
  onClick: p(e.changeHandler, ["prevent"])
31
31
  },
32
32
  [
33
- e.props.styleType === "radio-style" ? (o(), r("div", m, [
34
- a("div", h, [
35
- a("input", {
33
+ e.props.styleType === "radio-style" ? (o(), a("div", m, [
34
+ r("div", h, [
35
+ r("input", {
36
36
  ref: "inputDOMRef",
37
37
  type: "radio",
38
38
  name: e.props.label,
@@ -41,25 +41,25 @@ function N(i, l, R, e, C, D) {
41
41
  tabindex: e.props.tabindex,
42
42
  class: "nmorph-native-input"
43
43
  }, null, 8, f),
44
- l[0] || (l[0] = a(
44
+ s[0] || (s[0] = r(
45
45
  "div",
46
46
  { class: "nmorph-radio__fake" },
47
47
  null,
48
48
  -1
49
49
  /* HOISTED */
50
50
  )),
51
- e.checked ? (o(), r("div", k)) : n("v-if", !0)
51
+ e.checked ? (o(), a("div", k)) : i("v-if", !0)
52
52
  ]),
53
- e.props.label ? (o(), r(
53
+ e.props.label ? (o(), a(
54
54
  "span",
55
55
  b,
56
- s(e.props.label),
56
+ d(e.props.label),
57
57
  1
58
58
  /* TEXT */
59
- )) : d(i.$slots, "label", { key: 1 })
60
- ])) : n("v-if", !0),
61
- e.props.styleType === "button" ? (o(), r("div", v, [
62
- a("input", {
59
+ )) : l(n.$slots, "label", { key: 1 })
60
+ ])) : i("v-if", !0),
61
+ e.props.styleType === "button" ? (o(), a("div", v, [
62
+ r("input", {
63
63
  ref: "inputDOMRef",
64
64
  type: "radio",
65
65
  disabled: e.props.disabled,
@@ -69,18 +69,20 @@ function N(i, l, R, e, C, D) {
69
69
  tabindex: e.props.tabindex,
70
70
  class: "nmorph-native-input"
71
71
  }, null, 8, y),
72
- e.props.label ? (o(), r("div", u, [
73
- a(
72
+ e.props.label ? (o(), a("div", u, [
73
+ r(
74
74
  "span",
75
75
  null,
76
- s(e.props.label),
76
+ d(e.props.label),
77
77
  1
78
78
  /* TEXT */
79
79
  )
80
- ])) : (o(), r("div", x, [
81
- d(i.$slots, "label")
80
+ ])) : (o(), a("div", x, [
81
+ l(n.$slots, "label", {}, () => [
82
+ l(n.$slots, "default")
83
+ ])
82
84
  ]))
83
- ])) : n("v-if", !0)
85
+ ])) : i("v-if", !0)
84
86
  ],
85
87
  2
86
88
  /* CLASS */
@@ -1,12 +1,12 @@
1
1
  import './NmorphRadio.css';
2
- import { defineComponent as h, inject as r, computed as a, ref as m } from "vue";
2
+ import { defineComponent as h, inject as r, computed as l, ref as m } from "vue";
3
3
  import { useModifiers as g } from "../../../utils/create-modifiers.js";
4
- import { NmorphComponentHeight as v } from "../../../types/index.js";
4
+ import { NmorphSelectionControlHeight as v } from "../../../types/index.js";
5
5
  const q = /* @__PURE__ */ h({
6
6
  __name: "NmorphRadio",
7
7
  props: {
8
8
  value: { type: String, required: !1, default: "" },
9
- styleType: { type: null, required: !1, default: "radio-style" },
9
+ styleType: { type: null, required: !1, default: "button" },
10
10
  checked: { type: Boolean, required: !1, default: !1 },
11
11
  disabled: { type: Boolean, required: !1, default: !1 },
12
12
  label: { type: String, required: !1, default: "" },
@@ -14,22 +14,22 @@ const q = /* @__PURE__ */ h({
14
14
  height: { type: null, required: !1 }
15
15
  },
16
16
  setup(s, { expose: p }) {
17
- const l = r(
17
+ const o = r(
18
18
  "radio-group-selected-value",
19
19
  void 0
20
20
  ), t = r(
21
21
  "change-radio-button-value-handler",
22
22
  void 0
23
- ), o = r("radio-group-height", void 0), e = s, c = () => {
23
+ ), a = r("radio-group-height", void 0), e = s, c = () => {
24
24
  t && !e.disabled && t(e.value);
25
- }, d = a(() => l?.value === e.value || e.checked), i = a(() => e.height || o?.value || "thin"), f = a(
25
+ }, d = l(() => o?.value === e.value || e.checked), i = l(() => e.height || a?.value || "thin"), f = l(
26
26
  () => g({
27
27
  nmorph: [v[i.value]],
28
28
  "nmorph-radio": [`${e.disabled && "disabled"}`, `${d.value && "checked"}`, e.styleType]
29
29
  })
30
30
  ), u = m(null);
31
31
  p({ inputDOMRef: u });
32
- const n = { groupSelectedValue: l, changeValue: t, groupHeight: o, props: e, changeHandler: c, checked: d, height: i, modifiers: f, inputDOMRef: u };
32
+ const n = { groupSelectedValue: o, changeValue: t, groupHeight: a, props: e, changeHandler: c, checked: d, height: i, modifiers: f, inputDOMRef: u };
33
33
  return Object.defineProperty(n, "__isScriptSetup", { enumerable: !1, value: !0 }), n;
34
34
  }
35
35
  });