@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.
- package/dist/components/data/nmorph-avatar/NmorphAvatar.css +1 -0
- package/dist/components/data/nmorph-avatar/NmorphAvatar.vue.js +74 -46
- package/dist/components/data/nmorph-avatar/NmorphAvatar.vue2.js +26 -21
- package/dist/components/data/nmorph-carousel/NmorphCarousel.vue2.js +4 -4
- package/dist/components/data/nmorph-image-preview/NmorphImagePreview.vue.js +77 -38
- package/dist/components/data/nmorph-image-preview/NmorphImagePreview.vue2.js +31 -30
- package/dist/components/data/nmorph-pagination/NmorphPagination.css +1 -1
- package/dist/components/data/nmorph-pagination/NmorphPagination.vue.js +33 -28
- package/dist/components/data/nmorph-pagination/NmorphPagination.vue2.js +18 -17
- package/dist/components/form/nmorph-autocomplete/NmorphAutocomplete.vue2.js +8 -8
- package/dist/components/form/nmorph-checkbox/NmorphCheckbox.css +1 -1
- package/dist/components/form/nmorph-checkbox/NmorphCheckbox.vue.js +15 -13
- package/dist/components/form/nmorph-checkbox/NmorphCheckbox.vue2.js +8 -8
- package/dist/components/form/nmorph-checkbox-group/NmorphCheckboxGroup.vue2.js +22 -14
- package/dist/components/form/nmorph-radio/NmorphRadio.css +1 -1
- package/dist/components/form/nmorph-radio/NmorphRadio.vue.js +22 -20
- package/dist/components/form/nmorph-radio/NmorphRadio.vue2.js +7 -7
- package/dist/components/form/nmorph-radio-group/NmorphRadioGroup.vue2.js +14 -14
- package/dist/components/navigation/nmorph-backtop/NmorphBacktop.vue.js +7 -7
- package/dist/hooks/use-common-styles.js +10 -11
- package/dist/index.es.js +695 -694
- package/dist/index.umd.js +27 -28
- package/dist/nuxt.mjs +36 -7
- package/dist/package.json.js +1 -1
- package/dist/plugin.js +21 -20
- package/dist/src/components/data/nmorph-badge/NmorphBadge.vue.d.ts +1 -1
- package/dist/src/components/data/nmorph-image/NmorphImage.vue.d.ts +3 -3
- package/dist/src/components/data/nmorph-image-preview/NmorphImagePreview.vue.d.ts +14 -2
- package/dist/src/components/data/nmorph-pagination/NmorphPagination.vue.d.ts +3 -0
- package/dist/src/components/form/nmorph-checkbox/NmorphCheckbox.vue.d.ts +1 -0
- package/dist/src/components/form/nmorph-checkbox-group/NmorphCheckboxGroup.vue.d.ts +4 -3
- package/dist/src/components/form/nmorph-radio/NmorphRadio.vue.d.ts +1 -0
- package/dist/src/components/form/nmorph-radio-group/NmorphRadioGroup.vue.d.ts +4 -3
- package/dist/src/types/index.d.ts +9 -2
- package/dist/style.css +1 -1
- package/dist/types/index.js +14 -8
- package/package.json +1 -1
|
@@ -1,25 +1,26 @@
|
|
|
1
1
|
import './NmorphPagination.css';
|
|
2
|
-
import
|
|
3
|
-
import { openBlock as
|
|
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
|
|
6
|
-
function
|
|
7
|
-
return o.show ? (
|
|
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
|
-
|
|
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:
|
|
20
|
-
|
|
21
|
-
default:
|
|
22
|
-
|
|
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
|
-
|
|
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:
|
|
38
|
-
(
|
|
39
|
-
|
|
39
|
+
default: i(() => [
|
|
40
|
+
(a(!0), r(
|
|
41
|
+
d,
|
|
40
42
|
null,
|
|
41
|
-
|
|
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" ? (
|
|
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"])) : (
|
|
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
|
-
|
|
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:
|
|
72
|
-
|
|
73
|
-
default:
|
|
74
|
-
|
|
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
|
-
)) :
|
|
91
|
+
)) : m("v-if", !0);
|
|
87
92
|
}
|
|
88
|
-
const P = /* @__PURE__ */
|
|
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
|
|
3
|
-
import { useModifiers as
|
|
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 =
|
|
24
|
-
() =>
|
|
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 =
|
|
32
|
-
const e = a.totalElementsQuantity / a.elementsQuantityOnPage + 1,
|
|
33
|
-
return Array.from({ length: e +
|
|
34
|
-
}), b =
|
|
35
|
-
|
|
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 =
|
|
41
|
-
const e = t.value.length,
|
|
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
|
|
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(
|
|
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:
|
|
53
|
-
const
|
|
54
|
-
let l = e === "prev" ?
|
|
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 "
|
|
5
|
-
import I from "
|
|
6
|
-
import w from "../../
|
|
7
|
-
import x from "
|
|
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
|
|
53
|
+
}, get NmorphDropdown() {
|
|
56
54
|
return I;
|
|
57
|
-
}, get
|
|
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
|
|
3
|
-
import { openBlock as o, createElementBlock as c, normalizeClass as
|
|
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(
|
|
28
|
+
function C(s, d, g, e, N, D) {
|
|
29
29
|
return o(), c(
|
|
30
30
|
"label",
|
|
31
31
|
{
|
|
32
|
-
class:
|
|
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
|
-
|
|
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)) :
|
|
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
|
-
|
|
58
|
+
a(e.props.label),
|
|
59
59
|
1
|
|
60
60
|
/* TEXT */
|
|
61
61
|
)
|
|
62
62
|
])) : (o(), c("div", f, [
|
|
63
|
-
|
|
63
|
+
r(s.$slots, "default")
|
|
64
64
|
]))
|
|
65
|
-
])) :
|
|
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
|
-
|
|
78
|
+
a(e.props.label),
|
|
79
79
|
1
|
|
80
80
|
/* TEXT */
|
|
81
81
|
)
|
|
82
82
|
])) : (o(), c("div", u, [
|
|
83
|
-
|
|
83
|
+
r(s.$slots, "label", {}, () => [
|
|
84
|
+
r(s.$slots, "default")
|
|
85
|
+
])
|
|
84
86
|
]))
|
|
85
|
-
])) :
|
|
87
|
+
])) : l("v-if", !0)
|
|
86
88
|
],
|
|
87
89
|
2
|
|
88
90
|
/* CLASS */
|
|
89
91
|
);
|
|
90
92
|
}
|
|
91
|
-
const R = /* @__PURE__ */ t(
|
|
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 {
|
|
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: "
|
|
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
|
-
),
|
|
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
|
|
31
|
-
m({ inputDOMRef:
|
|
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 ||
|
|
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: [
|
|
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:
|
|
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
|
|
4
|
-
import
|
|
5
|
-
const
|
|
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: "
|
|
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)
|
|
23
|
-
|
|
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
|
-
() =>
|
|
33
|
+
() => b({
|
|
26
34
|
"nmorph-checkbox-group": [r.design, r.direction]
|
|
27
35
|
})
|
|
28
|
-
),
|
|
29
|
-
o("checkbox-group-selected-value", e), o("change-checkbox-value-handler",
|
|
30
|
-
const i = { props: r, initialValue: e, emit: u, changeHandler:
|
|
31
|
-
return
|
|
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
|
-
|
|
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
|
|
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(
|
|
26
|
-
return o(),
|
|
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(),
|
|
34
|
-
|
|
35
|
-
|
|
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
|
-
|
|
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(),
|
|
51
|
+
e.checked ? (o(), a("div", k)) : i("v-if", !0)
|
|
52
52
|
]),
|
|
53
|
-
e.props.label ? (o(),
|
|
53
|
+
e.props.label ? (o(), a(
|
|
54
54
|
"span",
|
|
55
55
|
b,
|
|
56
|
-
|
|
56
|
+
d(e.props.label),
|
|
57
57
|
1
|
|
58
58
|
/* TEXT */
|
|
59
|
-
)) :
|
|
60
|
-
])) :
|
|
61
|
-
e.props.styleType === "button" ? (o(),
|
|
62
|
-
|
|
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(),
|
|
73
|
-
|
|
72
|
+
e.props.label ? (o(), a("div", u, [
|
|
73
|
+
r(
|
|
74
74
|
"span",
|
|
75
75
|
null,
|
|
76
|
-
|
|
76
|
+
d(e.props.label),
|
|
77
77
|
1
|
|
78
78
|
/* TEXT */
|
|
79
79
|
)
|
|
80
|
-
])) : (o(),
|
|
81
|
-
|
|
80
|
+
])) : (o(), a("div", x, [
|
|
81
|
+
l(n.$slots, "label", {}, () => [
|
|
82
|
+
l(n.$slots, "default")
|
|
83
|
+
])
|
|
82
84
|
]))
|
|
83
|
-
])) :
|
|
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
|
|
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 {
|
|
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: "
|
|
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
|
|
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
|
-
),
|
|
23
|
+
), a = r("radio-group-height", void 0), e = s, c = () => {
|
|
24
24
|
t && !e.disabled && t(e.value);
|
|
25
|
-
}, d =
|
|
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:
|
|
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
|
});
|