@nmorph/nmorph-ui-kit 2.2.36 → 2.2.37
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/basic/nmorph-button/NmorphButton.vue2.js +8 -8
- package/dist/components/basic/nmorph-icon/NmorphIcon.vue2.js +3 -3
- package/dist/components/basic/nmorph-layout/NmorphLayout.vue2.js +14 -13
- package/dist/components/basic/nmorph-link/NmorphLink.vue2.js +1 -1
- package/dist/components/basic/nmorph-scroll/NmorphScroll.css +1 -0
- package/dist/components/basic/nmorph-scroll/NmorphScroll.vue.js +6 -4
- package/dist/components/basic/nmorph-scroll/NmorphScroll.vue2.js +1 -0
- package/dist/components/basic/nmorph-space/NmorphSpace.vue2.js +15 -19
- package/dist/components/data/nmorph-avatar/NmorphAvatar.css +1 -1
- package/dist/components/data/nmorph-avatar/NmorphAvatar.vue2.js +5 -5
- package/dist/components/data/nmorph-badge/NmorphBadge.vue2.js +37 -36
- package/dist/components/data/nmorph-calendar/NmorphCalendar.vue2.js +41 -40
- package/dist/components/data/nmorph-card/NmorphCard.vue2.js +15 -14
- package/dist/components/data/nmorph-collapse/components/nmorph-collapse-item/NmorphCollapseItem.vue2.js +5 -9
- package/dist/components/data/nmorph-empty/NmorphEmpty.vue.js +3 -3
- package/dist/components/data/nmorph-empty/NmorphEmpty.vue2.js +17 -14
- package/dist/components/data/nmorph-image/NmorphImage.css +1 -0
- package/dist/components/data/nmorph-image/NmorphImage.vue.js +14 -12
- package/dist/components/data/nmorph-image/NmorphImage.vue2.js +3 -2
- package/dist/components/data/nmorph-image-preview/NmorphImagePreview.vue2.js +36 -35
- package/dist/components/data/nmorph-pagination/NmorphPagination.vue2.js +1 -1
- package/dist/components/data/nmorph-progress/NmorphProgress.vue2.js +19 -18
- package/dist/components/data/nmorph-qr-code/NmorphQRCode.vue2.js +20 -19
- package/dist/components/data/nmorph-skeleton/NmorphSkeleton.vue2.js +1 -1
- package/dist/components/data/nmorph-table/NmorphTable.vue2.js +39 -43
- package/dist/components/data/nmorph-virtual-list/NmorphVirtualList.vue2.js +34 -33
- package/dist/components/feedback/nmorph-alert/NmorphAlert.vue2.js +1 -1
- package/dist/components/feedback/nmorph-callout/NmorphCallout.vue2.js +7 -6
- package/dist/components/feedback/nmorph-dialog/NmorphDialog.css +1 -1
- package/dist/components/feedback/nmorph-dialog/NmorphDialog.vue.js +25 -20
- package/dist/components/feedback/nmorph-dialog/NmorphDialog.vue2.js +37 -37
- package/dist/components/feedback/nmorph-drawer/NmorphDrawer.vue2.js +22 -21
- package/dist/components/feedback/nmorph-tooltip/NmorphTooltip.vue2.js +26 -25
- package/dist/components/form/nmorph-autocomplete/NmorphAutocomplete.vue2.js +54 -62
- package/dist/components/form/nmorph-checkbox/NmorphCheckbox.vue2.js +5 -5
- package/dist/components/form/nmorph-color-picker/NmorphColorPicker.vue2.js +5 -5
- package/dist/components/form/nmorph-date-picker/NmorphDatePicker.vue2.js +20 -19
- package/dist/components/form/nmorph-file-upload/NmorphFileUpload.vue2.js +7 -7
- package/dist/components/form/nmorph-form/components/nmorph-form-item/NmorphFormItem.vue2.js +2 -2
- package/dist/components/form/nmorph-form/components/nmorph-form-item/inner-components/nmorph-error-box/NmorphErrorBox.vue2.js +1 -1
- package/dist/components/form/nmorph-number-input/NmorphNumberInput.vue2.js +3 -6
- package/dist/components/form/nmorph-otp-input/NmorphOTPInput.vue2.js +6 -6
- package/dist/components/form/nmorph-radio/NmorphRadio.vue2.js +1 -1
- package/dist/components/form/nmorph-select/NmorphSelect.vue2.js +65 -73
- package/dist/components/form/nmorph-select/components/nmorph-select-option/NmorphSelectOption.vue2.js +4 -4
- package/dist/components/form/nmorph-select-button/NmorphSelectButton.vue2.js +18 -17
- package/dist/components/form/nmorph-select-button/components/nmorph-select-button-item/NmorphSelectButtonItem.vue2.js +1 -1
- package/dist/components/form/nmorph-slider/NmorphSlider.vue2.js +25 -24
- package/dist/components/form/nmorph-switch/NmorphSwitch.vue2.js +23 -22
- package/dist/components/form/nmorph-text-input/NmorphTextInput.css +1 -0
- package/dist/components/form/nmorph-text-input/NmorphTextInput.vue.js +4 -2
- package/dist/components/form/nmorph-text-input/NmorphTextInput.vue2.js +17 -19
- package/dist/components/form/nmorph-textarea/NmorphTextarea.vue2.js +9 -9
- package/dist/components/form/nmorph-time-picker/NmorphTimePicker.vue2.js +43 -42
- package/dist/components/navigation/nmorph-backtop/NmorphBacktop.vue2.js +1 -1
- package/dist/components/navigation/nmorph-dropdown/NmorphDropdown.vue2.js +32 -31
- package/dist/components/navigation/nmorph-tabs/NmorphTabs.vue2.js +1 -1
- package/dist/components/others/nmorph-overlay/NmorphOverlay.vue2.js +1 -1
- package/dist/hooks/use-common-styles.js +18 -278
- package/dist/hooks/use-virtual-list.js +38 -32
- package/dist/index.umd.js +21 -281
- package/dist/package.json.js +1 -1
- package/dist/src/components/basic/nmorph-button/NmorphButton.vue.d.ts +1 -1
- package/dist/src/components/data/nmorph-collapse/components/nmorph-collapse-item/NmorphCollapseItem.vue.d.ts +1 -1
- package/dist/src/components/data/nmorph-pagination/NmorphPagination.vue.d.ts +1 -1
- package/dist/src/components/data/nmorph-tag-list/components/nmorph-tag-item/NmorphTagItem.vue.d.ts +1 -1
- package/dist/src/components/feedback/nmorph-dialog/NmorphDialog.vue.d.ts +4 -4
- package/dist/src/components/form/nmorph-autocomplete/NmorphAutocomplete.vue.d.ts +1 -1
- package/dist/src/components/form/nmorph-checkbox-group/NmorphCheckboxGroup.vue.d.ts +1 -1
- package/dist/src/components/form/nmorph-color-picker/NmorphColorPicker.vue.d.ts +1 -1
- package/dist/src/components/form/nmorph-date-picker/NmorphDatePicker.vue.d.ts +1 -1
- package/dist/src/components/form/nmorph-form/components/nmorph-form-item/NmorphFormItem.vue.d.ts +1 -1
- package/dist/src/components/form/nmorph-form/components/nmorph-form-item/inner-components/nmorph-error-box/NmorphErrorBox.vue.d.ts +1 -1
- package/dist/src/components/form/nmorph-number-input/NmorphNumberInput.vue.d.ts +1 -1
- package/dist/src/components/form/nmorph-otp-input/NmorphOTPInput.vue.d.ts +1 -1
- package/dist/src/components/form/nmorph-radio-group/NmorphRadioGroup.vue.d.ts +1 -1
- package/dist/src/components/form/nmorph-select/NmorphSelect.vue.d.ts +1 -1
- package/dist/src/components/form/nmorph-select-button/NmorphSelectButton.vue.d.ts +1 -1
- package/dist/src/components/form/nmorph-text-input/NmorphTextInput.vue.d.ts +1 -1
- package/dist/src/components/form/nmorph-textarea/NmorphTextarea.vue.d.ts +1 -1
- package/dist/src/components/form/nmorph-time-picker/NmorphTimePicker.vue.d.ts +1 -1
- package/dist/src/hooks/use-virtual-list.d.ts +6 -0
- package/dist/src/types/index.d.ts +2 -1
- package/dist/src/utils/common.d.ts +5 -0
- package/dist/src/utils/create-modifiers.d.ts +4 -2
- package/dist/style.css +1 -1
- package/dist/utils/common.js +9 -2
- package/dist/utils/create-modifiers.js +6 -6
- package/package.json +1 -1
|
@@ -28,7 +28,7 @@ const x = /* @__PURE__ */ u({
|
|
|
28
28
|
i();
|
|
29
29
|
const e = n, r = s, a = l(
|
|
30
30
|
() => y({
|
|
31
|
-
"nmorph-alert": [e.type,
|
|
31
|
+
"nmorph-alert": [e.type, e.bordered && "bordered", e.fill && "fill"]
|
|
32
32
|
})
|
|
33
33
|
), d = l(() => ({
|
|
34
34
|
"--nmorph-alert-close-align": e.closeIconPosition,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import './NmorphCallout.css';
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
|
|
2
|
+
import { defineComponent as o, computed as l } from "vue";
|
|
3
|
+
import { toCssSize as t } from "../../../utils/common.js";
|
|
4
|
+
const s = /* @__PURE__ */ o({
|
|
4
5
|
__name: "NmorphCallout",
|
|
5
6
|
props: {
|
|
6
7
|
type: { type: String, required: !1, default: "info" },
|
|
@@ -14,9 +15,9 @@ const s = /* @__PURE__ */ l({
|
|
|
14
15
|
titleFontSize: { type: [Number, String], required: !1, default: "var(--font-size-medium)" },
|
|
15
16
|
contentFontSize: { type: [Number, String], required: !1, default: "var(--font-size-extra-small)" }
|
|
16
17
|
},
|
|
17
|
-
setup(
|
|
18
|
+
setup(i, { expose: a }) {
|
|
18
19
|
a();
|
|
19
|
-
const e =
|
|
20
|
+
const e = i, n = l(() => ({
|
|
20
21
|
"--callout-padding": t(e.padding),
|
|
21
22
|
"--callout-border-radius": t(e.borderRadius),
|
|
22
23
|
"--callout-accent-width": t(e.accentWidth),
|
|
@@ -24,8 +25,8 @@ const s = /* @__PURE__ */ l({
|
|
|
24
25
|
"--callout-title-font-size": t(e.titleFontSize),
|
|
25
26
|
"--callout-content-font-size": t(e.contentFontSize),
|
|
26
27
|
...e.color !== void 0 && { "--callout-color": e.color }
|
|
27
|
-
})),
|
|
28
|
-
return Object.defineProperty(
|
|
28
|
+
})), r = { props: e, styles: n };
|
|
29
|
+
return Object.defineProperty(r, "__isScriptSetup", { enumerable: !1, value: !0 }), r;
|
|
29
30
|
}
|
|
30
31
|
});
|
|
31
32
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.nmorph-dialog{position:absolute;top:50%;left:50%;display:flex;flex-direction:column;box-sizing:border-box;width:var(--width);max-width:var(--nmorph-dialog-max-width, calc(100vw - 32px) );max-height:var(--nmorph-dialog-max-height, var(--nmorph-dialog-default-max-height));padding:var(--indentation-03);background:var(--nmorph-main-color);border-radius:var(--default-border-radius);transform:translate(-50%,-50%);--width: var(--nmorph-dialog-width);--nmorph-dialog-default-max-height: calc(100vh - 32px) }@supports (height: 100dvh){.nmorph-dialog{--nmorph-dialog-default-max-height: calc(100dvh - 32px) }}.nmorph-dialog .nmorph-dialog__header{display:flex;flex:0 0 auto;justify-content:space-between;align-items:center;box-sizing:border-box;padding:var(--indentation-02);font-weight:600;font-size:var(--font-size-large);line-height:var(--line-height-loose)}.nmorph-dialog .nmorph-dialog__close-icon{flex:0 0 auto;cursor:pointer}.nmorph-dialog .nmorph-dialog__content{flex:1 1 auto;box-sizing:border-box;min-height:0;padding:var(--indentation-02);overflow:hidden auto}
|
|
1
|
+
.nmorph-dialog{position:absolute;top:50%;left:50%;display:flex;flex-direction:column;box-sizing:border-box;width:var(--width);max-width:var(--nmorph-dialog-max-width, calc(100vw - 32px) );max-height:var(--nmorph-dialog-max-height, var(--nmorph-dialog-default-max-height));padding:var(--indentation-03);background:var(--nmorph-main-color);border-radius:var(--default-border-radius);transform:translate(-50%,-50%);--width: var(--nmorph-dialog-width);--nmorph-dialog-default-max-height: calc(100vh - 32px) }@supports (height: 100dvh){.nmorph-dialog{--nmorph-dialog-default-max-height: calc(100dvh - 32px) }}.nmorph-dialog .nmorph-dialog__header{display:flex;flex:0 0 auto;justify-content:space-between;align-items:center;box-sizing:border-box;padding:var(--indentation-02);font-weight:600;font-size:var(--font-size-large);line-height:var(--line-height-loose)}.nmorph-dialog .nmorph-dialog__close-icon{display:inline-flex;flex:0 0 auto;justify-content:center;align-items:center;width:32px;height:32px;padding:0;color:inherit;background:transparent;border:0;cursor:pointer}.nmorph-dialog .nmorph-dialog__content{flex:1 1 auto;box-sizing:border-box;min-height:0;padding:var(--indentation-02);overflow:hidden auto}
|
|
@@ -1,38 +1,43 @@
|
|
|
1
1
|
import './NmorphDialog.css';
|
|
2
|
-
import
|
|
3
|
-
import { openBlock as
|
|
2
|
+
import c from "./NmorphDialog.vue2.js";
|
|
3
|
+
import { openBlock as e, createBlock as d, withCtx as a, createElementVNode as l, normalizeStyle as m, normalizeClass as _, createElementBlock as i, renderSlot as s, toDisplayString as p, createVNode as n, createCommentVNode as t } from "vue";
|
|
4
4
|
/* empty css */
|
|
5
5
|
import h from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
6
|
-
const f = ["aria-label"], g = {
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
const f = ["aria-label"], g = {
|
|
7
|
+
key: 0,
|
|
8
|
+
class: "nmorph-dialog__header"
|
|
9
|
+
}, y = { class: "nmorph-dialog__title" }, b = ["aria-label"], k = { class: "nmorph-dialog__content" };
|
|
10
|
+
function v(r, C, N, o, w, x) {
|
|
11
|
+
return e(), d(o.NmorphOverlay, {
|
|
9
12
|
show: o.isVisible,
|
|
10
13
|
"z-index": o.props.zIndex,
|
|
11
14
|
"close-on-escape": o.props.closeOnEscape,
|
|
12
15
|
"trap-focus": "",
|
|
13
|
-
onOnOutsideClick: o.
|
|
16
|
+
onOnOutsideClick: o.overlayClickHandler,
|
|
14
17
|
onOnEscapeKeydown: o.closeHandler
|
|
15
18
|
}, {
|
|
16
19
|
default: a(() => [
|
|
17
|
-
|
|
18
|
-
class:
|
|
19
|
-
style:
|
|
20
|
+
l("div", {
|
|
21
|
+
class: _(o.modifiers),
|
|
22
|
+
style: m(o.dialogStyle),
|
|
20
23
|
role: "dialog",
|
|
21
24
|
"aria-modal": "true",
|
|
22
25
|
"aria-label": o.props.title || void 0
|
|
23
26
|
}, [
|
|
24
|
-
e("div", g, [
|
|
25
|
-
|
|
26
|
-
|
|
27
|
+
o.hasHeader ? (e(), i("div", g, [
|
|
28
|
+
s(r.$slots, "header", {}, () => [
|
|
29
|
+
l(
|
|
27
30
|
"div",
|
|
28
|
-
|
|
29
|
-
|
|
31
|
+
y,
|
|
32
|
+
p(o.props.title),
|
|
30
33
|
1
|
|
31
34
|
/* TEXT */
|
|
32
35
|
),
|
|
33
|
-
o.props.showClose ? (
|
|
36
|
+
o.props.showClose ? (e(), i("button", {
|
|
34
37
|
key: 0,
|
|
35
38
|
class: "nmorph-dialog__close-icon",
|
|
39
|
+
type: "button",
|
|
40
|
+
"aria-label": o.props.title ? `Close ${o.props.title}` : "Close dialog",
|
|
36
41
|
onClick: o.closeHandler
|
|
37
42
|
}, [
|
|
38
43
|
n(o.NmorphIcon, null, {
|
|
@@ -42,11 +47,11 @@ function y(l, N, C, o, O, b) {
|
|
|
42
47
|
_: 1
|
|
43
48
|
/* STABLE */
|
|
44
49
|
})
|
|
45
|
-
])) :
|
|
50
|
+
], 8, b)) : t("v-if", !0)
|
|
46
51
|
])
|
|
47
|
-
]),
|
|
48
|
-
|
|
49
|
-
|
|
52
|
+
])) : t("v-if", !0),
|
|
53
|
+
l("div", k, [
|
|
54
|
+
s(r.$slots, "default")
|
|
50
55
|
])
|
|
51
56
|
], 14, f)
|
|
52
57
|
]),
|
|
@@ -54,7 +59,7 @@ function y(l, N, C, o, O, b) {
|
|
|
54
59
|
/* FORWARDED */
|
|
55
60
|
}, 8, ["show", "z-index", "close-on-escape"]);
|
|
56
61
|
}
|
|
57
|
-
const S = /* @__PURE__ */ h(
|
|
62
|
+
const S = /* @__PURE__ */ h(c, [["render", v], ["__file", "/builds/ketjo/nmorph/library/src/components/feedback/nmorph-dialog/NmorphDialog.vue"]]);
|
|
58
63
|
export {
|
|
59
64
|
S as default
|
|
60
65
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import './NmorphDialog.css';
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
import { useModifiers as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
const
|
|
2
|
+
import { defineComponent as g, useSlots as v, computed as r, ref as O, watch as T } from "vue";
|
|
3
|
+
import { useModifiers as q } from "../../../utils/create-modifiers.js";
|
|
4
|
+
import C from "../../basic/nmorph-icon/NmorphIcon.vue.js";
|
|
5
|
+
import N from "../../others/nmorph-overlay/NmorphOverlay.vue.js";
|
|
6
|
+
import _ from "../../../assets/icons/cross.svg.js";
|
|
7
|
+
const B = /* @__PURE__ */ g({
|
|
8
8
|
__name: "NmorphDialog",
|
|
9
9
|
props: {
|
|
10
10
|
modelValue: { type: Boolean, required: !1, default: !1 },
|
|
@@ -20,54 +20,54 @@ const C = /* @__PURE__ */ c({
|
|
|
20
20
|
closeOnEscape: { type: Boolean, required: !1, default: !0 }
|
|
21
21
|
},
|
|
22
22
|
emits: ["on-close", "update:model-value"],
|
|
23
|
-
setup(
|
|
24
|
-
|
|
25
|
-
const e =
|
|
26
|
-
() =>
|
|
23
|
+
setup(d, { expose: p, emit: c }) {
|
|
24
|
+
p();
|
|
25
|
+
const e = d, a = c, i = v(), f = r(
|
|
26
|
+
() => q({
|
|
27
27
|
"nmorph-dialog": []
|
|
28
28
|
})
|
|
29
|
-
),
|
|
29
|
+
), y = r(() => ({
|
|
30
30
|
"--nmorph-dialog-width": e.width,
|
|
31
31
|
...e.maxHeight && { "--nmorph-dialog-max-height": e.maxHeight }
|
|
32
|
-
})),
|
|
33
|
-
let
|
|
34
|
-
|
|
32
|
+
})), h = r(() => !!(i.header || e.title || e.showClose)), u = r(() => e.closeOnOverlay && e.closeOnClickModal), s = O(e.modelValue);
|
|
33
|
+
let t = null, l = null;
|
|
34
|
+
T(
|
|
35
35
|
() => e.modelValue,
|
|
36
|
-
(
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}, e.openDelay)) : (
|
|
40
|
-
|
|
36
|
+
(o) => {
|
|
37
|
+
o ? (l && clearTimeout(l), t = setTimeout(() => {
|
|
38
|
+
s.value = !0;
|
|
39
|
+
}, e.openDelay)) : (t && clearTimeout(t), l = setTimeout(() => {
|
|
40
|
+
s.value = !1;
|
|
41
41
|
}, e.closeDelay));
|
|
42
42
|
},
|
|
43
43
|
{ immediate: !0 }
|
|
44
44
|
);
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
const
|
|
48
|
-
|
|
45
|
+
const n = () => {
|
|
46
|
+
a("on-close"), t && clearTimeout(t);
|
|
47
|
+
const o = () => {
|
|
48
|
+
a("update:model-value", !1);
|
|
49
49
|
};
|
|
50
|
-
e.closeDelay <= 0 ?
|
|
51
|
-
},
|
|
52
|
-
return
|
|
53
|
-
}, set openTimeout(
|
|
54
|
-
|
|
50
|
+
e.closeDelay <= 0 ? o() : l = setTimeout(o, e.closeDelay);
|
|
51
|
+
}, m = { props: e, emit: a, slots: i, modifiers: f, dialogStyle: y, hasHeader: h, shouldCloseOnOverlay: u, isVisible: s, get openTimeout() {
|
|
52
|
+
return t;
|
|
53
|
+
}, set openTimeout(o) {
|
|
54
|
+
t = o;
|
|
55
55
|
}, get closeTimeout() {
|
|
56
56
|
return l;
|
|
57
|
-
}, set closeTimeout(
|
|
58
|
-
l =
|
|
59
|
-
}, closeHandler:
|
|
60
|
-
|
|
57
|
+
}, set closeTimeout(o) {
|
|
58
|
+
l = o;
|
|
59
|
+
}, closeHandler: n, overlayClickHandler: () => {
|
|
60
|
+
u.value && n();
|
|
61
61
|
}, get NmorphOverlay() {
|
|
62
|
-
return
|
|
62
|
+
return N;
|
|
63
63
|
}, get NmorphIcon() {
|
|
64
|
-
return
|
|
64
|
+
return C;
|
|
65
65
|
}, get NmorphIconCross() {
|
|
66
|
-
return
|
|
66
|
+
return _;
|
|
67
67
|
} };
|
|
68
|
-
return Object.defineProperty(
|
|
68
|
+
return Object.defineProperty(m, "__isScriptSetup", { enumerable: !1, value: !0 }), m;
|
|
69
69
|
}
|
|
70
70
|
});
|
|
71
71
|
export {
|
|
72
|
-
|
|
72
|
+
B as default
|
|
73
73
|
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import './NmorphDrawer.css';
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
import { useModifiers as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
|
|
2
|
+
import { defineComponent as m, useSlots as c, computed as o } from "vue";
|
|
3
|
+
import { useModifiers as y } from "../../../utils/create-modifiers.js";
|
|
4
|
+
import { toCssSize as h } from "../../../utils/common.js";
|
|
5
|
+
import q from "../../others/nmorph-overlay/NmorphOverlay.vue.js";
|
|
6
|
+
import _ from "../../basic/nmorph-icon/NmorphIcon.vue.js";
|
|
7
|
+
import v from "../../../assets/icons/cross.svg.js";
|
|
8
|
+
const w = /* @__PURE__ */ m({
|
|
8
9
|
__name: "NmorphDrawer",
|
|
9
10
|
props: {
|
|
10
11
|
modelValue: { type: Boolean, required: !1, default: !1 },
|
|
@@ -20,26 +21,26 @@ const w = /* @__PURE__ */ y({
|
|
|
20
21
|
contentClass: { type: String, required: !1, default: "" }
|
|
21
22
|
},
|
|
22
23
|
emits: ["on-close", "update:model-value"],
|
|
23
|
-
setup(
|
|
24
|
-
|
|
25
|
-
const e =
|
|
26
|
-
() =>
|
|
27
|
-
"nmorph-drawer": [e.placement,
|
|
24
|
+
setup(a, { expose: n, emit: u }) {
|
|
25
|
+
n();
|
|
26
|
+
const e = a, r = u, t = c(), d = o(
|
|
27
|
+
() => y({
|
|
28
|
+
"nmorph-drawer": [e.placement, e.modelValue && "open"]
|
|
28
29
|
})
|
|
29
|
-
),
|
|
30
|
-
"--nmorph-drawer-size":
|
|
31
|
-
})),
|
|
30
|
+
), p = o(() => ({
|
|
31
|
+
"--nmorph-drawer-size": h(e.size)
|
|
32
|
+
})), l = () => {
|
|
32
33
|
r("on-close"), r("update:model-value", !1);
|
|
33
|
-
},
|
|
34
|
-
e.closeOnOverlay &&
|
|
35
|
-
},
|
|
36
|
-
return
|
|
34
|
+
}, i = () => {
|
|
35
|
+
e.closeOnOverlay && l();
|
|
36
|
+
}, f = o(() => !!(t.header || e.title || e.showClose)), s = { props: e, emit: r, slots: t, modifiers: d, drawerStyle: p, closeHandler: l, overlayClickHandler: i, hasHeader: f, get NmorphIcon() {
|
|
37
|
+
return _;
|
|
37
38
|
}, get NmorphIconCross() {
|
|
38
|
-
return
|
|
39
|
+
return v;
|
|
39
40
|
}, get NmorphOverlay() {
|
|
40
|
-
return
|
|
41
|
+
return q;
|
|
41
42
|
} };
|
|
42
|
-
return Object.defineProperty(
|
|
43
|
+
return Object.defineProperty(s, "__isScriptSetup", { enumerable: !1, value: !0 }), s;
|
|
43
44
|
}
|
|
44
45
|
});
|
|
45
46
|
export {
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import './NmorphTooltip.css';
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
import { useModifiers as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
2
|
+
import { defineComponent as y, ref as o, computed as r } from "vue";
|
|
3
|
+
import { useModifiers as w } from "../../../utils/create-modifiers.js";
|
|
4
|
+
import { toCssSize as i } from "../../../utils/common.js";
|
|
5
|
+
import { usePlacement as S } from "../../../hooks/use-placement.js";
|
|
6
|
+
import { useZIndex as _ } from "../../../hooks/use-z-index.js";
|
|
7
|
+
const z = /* @__PURE__ */ y({
|
|
7
8
|
__name: "NmorphTooltip",
|
|
8
9
|
props: {
|
|
9
10
|
text: { type: String, required: !1, default: "" },
|
|
@@ -15,35 +16,35 @@ const z = /* @__PURE__ */ w({
|
|
|
15
16
|
maxWidth: { type: [Number, String], required: !1, default: void 0 },
|
|
16
17
|
height: { type: [Number, String], required: !1, default: void 0 }
|
|
17
18
|
},
|
|
18
|
-
setup(
|
|
19
|
-
const e =
|
|
19
|
+
setup(p, { expose: m }) {
|
|
20
|
+
const e = p, t = o(e.forceShow), n = o(null), l = o(null), { placement: d } = S({
|
|
20
21
|
initialPlacement: e.position,
|
|
21
|
-
contentDOMElement:
|
|
22
|
-
relativeElement:
|
|
23
|
-
}),
|
|
24
|
-
() =>
|
|
22
|
+
contentDOMElement: n,
|
|
23
|
+
relativeElement: l
|
|
24
|
+
}), c = r(
|
|
25
|
+
() => w({
|
|
25
26
|
"nmorph-tooltip": [
|
|
26
|
-
|
|
27
|
-
|
|
27
|
+
d.value,
|
|
28
|
+
!!e.forceCoordinate?.x && !!e.forceCoordinate?.y && "force-coords"
|
|
28
29
|
]
|
|
29
30
|
})
|
|
30
|
-
),
|
|
31
|
+
), h = () => {
|
|
31
32
|
t.value = !0;
|
|
32
|
-
},
|
|
33
|
+
}, v = () => {
|
|
33
34
|
e.forceShow || (t.value = !1);
|
|
34
|
-
},
|
|
35
|
+
}, a = r(() => e.forceCoordinate ? "100%" : "auto"), u = _(
|
|
35
36
|
() => t.value,
|
|
36
37
|
() => e.zIndex
|
|
37
|
-
),
|
|
38
|
-
"--nmorph-tooltip-width":
|
|
38
|
+
), x = r(() => ({
|
|
39
|
+
"--nmorph-tooltip-width": a.value,
|
|
39
40
|
"--nmorph-tooltip-z-index": u.value,
|
|
40
|
-
...e.width !== void 0 && { "--width":
|
|
41
|
-
...e.maxWidth !== void 0 && { "--max-width":
|
|
42
|
-
...e.height !== void 0 && { "--height":
|
|
43
|
-
})),
|
|
44
|
-
m({ tooltipBody:
|
|
45
|
-
const
|
|
46
|
-
return Object.defineProperty(
|
|
41
|
+
...e.width !== void 0 && { "--width": i(e.width) },
|
|
42
|
+
...e.maxWidth !== void 0 && { "--max-width": i(e.maxWidth) },
|
|
43
|
+
...e.height !== void 0 && { "--height": i(e.height) }
|
|
44
|
+
})), s = o(null);
|
|
45
|
+
m({ tooltipBody: s });
|
|
46
|
+
const f = { props: e, showTooltip: t, tooltipDOMRef: n, slotDOMRef: l, placement: d, modifiers: c, handleMouseEnter: h, handleMouseLeave: v, rootWidth: a, zIndex: u, styles: x, tooltipBody: s };
|
|
47
|
+
return Object.defineProperty(f, "__isScriptSetup", { enumerable: !1, value: !0 }), f;
|
|
47
48
|
}
|
|
48
49
|
});
|
|
49
50
|
export {
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import './NmorphAutocomplete.css';
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
import { useModifiers as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { defineComponent as G, ref as s, computed as l, watch as c, nextTick as J } from "vue";
|
|
3
|
+
import { useModifiers as C } from "../../../utils/create-modifiers.js";
|
|
4
|
+
import { getNmorphOptionHeight as K, toCssSize as Q, resolveDomElement as W } from "../../../utils/common.js";
|
|
5
|
+
import { NmorphComponentHeight as X } from "../../../types/index.js";
|
|
6
|
+
import { useVirtualList as Y } from "../../../hooks/use-virtual-list.js";
|
|
6
7
|
import { useZIndex as ee } from "../../../hooks/use-z-index.js";
|
|
7
8
|
import te from "../nmorph-text-input/NmorphTextInput.vue.js";
|
|
8
9
|
import ae from "../../navigation/nmorph-dropdown/NmorphDropdown.vue.js";
|
|
9
10
|
import le from "../../basic/nmorph-icon/NmorphIcon.vue.js";
|
|
10
11
|
import re from "../../../assets/icons/loader.svg.js";
|
|
11
|
-
const
|
|
12
|
+
const fe = /* @__PURE__ */ G({
|
|
12
13
|
__name: "NmorphAutocomplete",
|
|
13
14
|
props: {
|
|
14
15
|
modelValue: { type: String, required: !1, default: "" },
|
|
@@ -30,81 +31,72 @@ const ve = /* @__PURE__ */ K({
|
|
|
30
31
|
tabindex: { type: Number, required: !1 }
|
|
31
32
|
},
|
|
32
33
|
emits: ["update:model-value", "select"],
|
|
33
|
-
setup(
|
|
34
|
-
|
|
35
|
-
const
|
|
36
|
-
() =>
|
|
37
|
-
"nmorph-autocomplete": [
|
|
34
|
+
setup(_, { expose: O, emit: L }) {
|
|
35
|
+
O();
|
|
36
|
+
const t = _, o = s(t.modelValue), d = L, V = l(
|
|
37
|
+
() => C({
|
|
38
|
+
"nmorph-autocomplete": [a.value && "open"]
|
|
38
39
|
})
|
|
39
40
|
), i = s(!1), y = (e) => {
|
|
40
|
-
i.value = e === "", o.value = e,
|
|
41
|
-
},
|
|
41
|
+
i.value = e === "", o.value = e, a.value = !i.value && r.value.length > 0, u.value = 0, d("update:model-value", o.value);
|
|
42
|
+
}, A = l({
|
|
42
43
|
get: () => o.value,
|
|
43
44
|
set: y
|
|
44
|
-
}),
|
|
45
|
-
i.value = !0,
|
|
46
|
-
}, r =
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
itemHeight: I,
|
|
53
|
-
overscan: H,
|
|
54
|
-
dynamic: q
|
|
55
|
-
}), z = t(() => n.virtualItems.value), B = t(() => ({
|
|
56
|
-
height: `${n.totalHeight.value}px`
|
|
57
|
-
})), E = t(() => ({
|
|
58
|
-
transform: `translateY(${n.offsetTop.value}px)`
|
|
59
|
-
})), N = (e) => typeof e == "number" ? `${e}px` : e, j = t(() => N(a.virtualMaxHeight)), u = s(0), v = t(() => r.value[u.value]), m = t(() => `${a.id || a.name || "nmorph-autocomplete"}-listbox`), w = (e) => `${m.value}-option-${e}`;
|
|
45
|
+
}), a = s(!1), M = s(null), I = () => {
|
|
46
|
+
i.value = !0, a.value = !1;
|
|
47
|
+
}, r = l(() => t.list.filter((e) => Object.keys(e).some((g) => String(e[g]).toLowerCase().includes(o.value.toLowerCase())))), m = l(() => t.virtual && r.value.length > 0), b = l(() => t.virtualItemHeight || K(t.height)), x = l(() => t.virtualOverscan), H = l(() => t.virtualDynamicHeight), n = Y(r, {
|
|
48
|
+
enabled: m,
|
|
49
|
+
itemHeight: b,
|
|
50
|
+
overscan: x,
|
|
51
|
+
dynamic: H
|
|
52
|
+
}), T = l(() => n.virtualItems.value), z = n.spacerStyle, B = n.contentStyle, E = l(() => Q(t.virtualMaxHeight)), u = s(0), v = l(() => r.value[u.value]), f = l(() => `${t.id || t.name || "nmorph-autocomplete"}-listbox`), q = (e) => `${f.value}-option-${e}`;
|
|
60
53
|
c(
|
|
61
|
-
() =>
|
|
54
|
+
() => t.modelValue,
|
|
62
55
|
(e) => {
|
|
63
56
|
e !== o.value && (o.value = e);
|
|
64
57
|
}
|
|
65
58
|
), c(r, async (e) => {
|
|
66
|
-
|
|
59
|
+
a.value = !i.value && o.value !== "" && e.length > 0, u.value = 0, await J(), n.scrollToIndex(0), n.refresh();
|
|
67
60
|
});
|
|
68
61
|
const h = (e) => {
|
|
69
|
-
|
|
70
|
-
i.value = !0,
|
|
62
|
+
d("select", e), o.value = e.value, d("update:model-value", o.value), setTimeout(() => {
|
|
63
|
+
i.value = !0, a.value = !1;
|
|
71
64
|
});
|
|
72
|
-
},
|
|
65
|
+
}, $ = (e) => {
|
|
73
66
|
h(e);
|
|
74
|
-
},
|
|
75
|
-
i.value = !1,
|
|
76
|
-
},
|
|
67
|
+
}, j = () => {
|
|
68
|
+
i.value = !1, a.value = r.value.length > 0;
|
|
69
|
+
}, p = s(!1);
|
|
77
70
|
c(o, async (e) => {
|
|
78
|
-
e !== "" &&
|
|
79
|
-
}), c(
|
|
80
|
-
e && (
|
|
71
|
+
e !== "" && t.actionCallback && (p.value = !0, await t.actionCallback(), p.value = !1);
|
|
72
|
+
}), c(p, (e) => {
|
|
73
|
+
e && (a.value = !0);
|
|
81
74
|
}), c(u, (e) => {
|
|
82
|
-
|
|
75
|
+
m.value && n.scrollToIndex(e);
|
|
83
76
|
});
|
|
84
|
-
const
|
|
85
|
-
r.value.length && (
|
|
77
|
+
const N = () => {
|
|
78
|
+
r.value.length && (a.value = !0, u.value = (u.value + 1) % r.value.length);
|
|
79
|
+
}, D = () => {
|
|
80
|
+
r.value.length && (a.value = !0, u.value = (u.value - 1 + r.value.length) % r.value.length);
|
|
86
81
|
}, S = () => {
|
|
87
|
-
|
|
88
|
-
},
|
|
89
|
-
|
|
90
|
-
},
|
|
91
|
-
e.key === "ArrowDown" ? (e.preventDefault(), D()) : e.key === "ArrowUp" ? (e.preventDefault(), S()) : e.key === "Enter" ? (e.preventDefault(), k()) : e.key === "Escape" && (e.preventDefault(), b());
|
|
92
|
-
}, F = t(() => ({
|
|
82
|
+
!a.value || !v.value || h(v.value);
|
|
83
|
+
}, R = (e) => {
|
|
84
|
+
e.key === "ArrowDown" ? (e.preventDefault(), N()) : e.key === "ArrowUp" ? (e.preventDefault(), D()) : e.key === "Enter" ? (e.preventDefault(), S()) : e.key === "Escape" && (e.preventDefault(), I());
|
|
85
|
+
}, U = l(() => ({
|
|
93
86
|
role: "combobox",
|
|
94
87
|
"aria-autocomplete": "list",
|
|
95
|
-
"aria-expanded":
|
|
96
|
-
"aria-controls":
|
|
97
|
-
"aria-activedescendant":
|
|
98
|
-
})),
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
nmorph: [W[a.height]]
|
|
88
|
+
"aria-expanded": a.value,
|
|
89
|
+
"aria-controls": f.value,
|
|
90
|
+
"aria-activedescendant": a.value ? q(u.value) : void 0
|
|
91
|
+
})), Z = (e, g) => {
|
|
92
|
+
n.measureElement(g, W(e));
|
|
93
|
+
}, w = ee(a, () => t.zIndex), F = l(() => ({
|
|
94
|
+
"--nmorph-autocomplete-input-z-index": w.value + 1
|
|
95
|
+
})), P = l(
|
|
96
|
+
() => C({
|
|
97
|
+
nmorph: [X[t.height]]
|
|
106
98
|
})
|
|
107
|
-
),
|
|
99
|
+
), k = { props: t, initialValue: o, emit: d, modifiers: V, userClosed: i, updateValueHandler: y, inputValue: A, open: a, nmorphAutocompleteDOMRef: M, closeHandler: I, filteredList: r, virtualEnabled: m, virtualItemHeight: b, virtualOverscan: x, virtualDynamicHeight: H, virtualList: n, virtualItems: T, virtualSpacerStyle: z, virtualContentStyle: B, virtualMaxHeight: E, currentIndex: u, activeItem: v, listboxId: f, getOptionId: q, selectItem: h, clickHandler: $, focusHandler: j, loader: p, arrowDownHandler: N, arrowUpHandler: D, enterHandler: S, keydownHandler: R, inputAttrs: U, setVirtualItemRef: Z, dropdownZIndex: w, styles: F, optionHeightModifiers: P, get NmorphIcon() {
|
|
108
100
|
return le;
|
|
109
101
|
}, get NmorphDropdown() {
|
|
110
102
|
return ae;
|
|
@@ -113,9 +105,9 @@ const ve = /* @__PURE__ */ K({
|
|
|
113
105
|
}, get NmorphIconLoaderDots() {
|
|
114
106
|
return re;
|
|
115
107
|
} };
|
|
116
|
-
return Object.defineProperty(
|
|
108
|
+
return Object.defineProperty(k, "__isScriptSetup", { enumerable: !1, value: !0 }), k;
|
|
117
109
|
}
|
|
118
110
|
});
|
|
119
111
|
export {
|
|
120
|
-
|
|
112
|
+
fe as default
|
|
121
113
|
};
|
|
@@ -2,7 +2,7 @@ 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
4
|
import { NmorphSelectionControlHeight as S } from "../../../types/index.js";
|
|
5
|
-
const
|
|
5
|
+
const j = /* @__PURE__ */ y({
|
|
6
6
|
__name: "NmorphCheckbox",
|
|
7
7
|
props: {
|
|
8
8
|
id: { type: String, required: !1, default: "" },
|
|
@@ -41,9 +41,9 @@ const $ = /* @__PURE__ */ y({
|
|
|
41
41
|
() => x({
|
|
42
42
|
nmorph: [S[c.value]],
|
|
43
43
|
"nmorph-checkbox": [
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
s.value && "checked",
|
|
45
|
+
e.disabled && "disabled",
|
|
46
|
+
e.design === "button" && "button"
|
|
47
47
|
]
|
|
48
48
|
})
|
|
49
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 };
|
|
@@ -51,5 +51,5 @@ const $ = /* @__PURE__ */ y({
|
|
|
51
51
|
}
|
|
52
52
|
});
|
|
53
53
|
export {
|
|
54
|
-
|
|
54
|
+
j as default
|
|
55
55
|
};
|
|
@@ -42,7 +42,7 @@ const E = /* @__PURE__ */ R({
|
|
|
42
42
|
], y = (e) => {
|
|
43
43
|
const [r, t, n] = p(e);
|
|
44
44
|
return `rgb(${r}, ${t}, ${n})`;
|
|
45
|
-
},
|
|
45
|
+
}, v = (e) => {
|
|
46
46
|
const [r, t, n] = p(e).map((P) => P / 255), l = Math.max(r, t, n), u = Math.min(r, t, n), f = (l + u) / 2;
|
|
47
47
|
if (l === u)
|
|
48
48
|
return `hsl(0, 0%, ${Math.round(f * 100)}%)`;
|
|
@@ -55,11 +55,11 @@ const E = /* @__PURE__ */ R({
|
|
|
55
55
|
}), q({ inputDOMRef: c });
|
|
56
56
|
const F = C(
|
|
57
57
|
() => H({
|
|
58
|
-
nmorph: [B[o.height],
|
|
59
|
-
"nmorph-color-picker": [
|
|
58
|
+
nmorph: [B[o.height], b.value && "focused"],
|
|
59
|
+
"nmorph-color-picker": [o.disabled && "disabled", o.displayFormat]
|
|
60
60
|
})
|
|
61
|
-
), w = C(() => o.displayFormat === "rgb" ? y(a.value) : o.displayFormat === "hsl" ?
|
|
62
|
-
return Object.defineProperty(
|
|
61
|
+
), w = C(() => o.displayFormat === "rgb" ? y(a.value) : o.displayFormat === "hsl" ? v(a.value) : a.value.toUpperCase()), $ = { props: o, emit: g, id: V, name: S, tabindex: x, normalizeColor: s, inputDOMRef: c, resolveAccentColor: m, currentValue: a, focused: b, handleInput: I, hexToRgb: p, formatRgb: y, formatHsl: v, modifiers: F, displayValue: w };
|
|
62
|
+
return Object.defineProperty($, "__isScriptSetup", { enumerable: !1, value: !0 }), $;
|
|
63
63
|
}
|
|
64
64
|
});
|
|
65
65
|
export {
|