@nmorph/nmorph-ui-kit 2.2.36 → 2.2.38
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 +19 -15
- 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 +65 -71
- package/dist/components/form/nmorph-checkbox/NmorphCheckbox.css +1 -1
- package/dist/components/form/nmorph-checkbox/NmorphCheckbox.vue2.js +30 -28
- package/dist/components/form/nmorph-checkbox-group/NmorphCheckboxGroup.vue2.js +25 -20
- package/dist/components/form/nmorph-color-picker/NmorphColorPicker.vue2.js +43 -42
- package/dist/components/form/nmorph-date-picker/NmorphDatePicker.vue2.js +53 -40
- package/dist/components/form/nmorph-file-upload/NmorphFileUpload.vue.js +20 -16
- package/dist/components/form/nmorph-file-upload/NmorphFileUpload.vue2.js +113 -86
- package/dist/components/form/nmorph-form/NmorphForm.vue2.js +9 -9
- package/dist/components/form/nmorph-form/components/nmorph-form-item/NmorphFormItem.vue2.js +33 -24
- 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-form/use-form-item-input.js +29 -8
- package/dist/components/form/nmorph-number-input/NmorphNumberInput.vue2.js +42 -39
- package/dist/components/form/nmorph-otp-input/NmorphOTPInput.vue2.js +66 -62
- package/dist/components/form/nmorph-radio/NmorphRadio.css +1 -1
- package/dist/components/form/nmorph-radio/NmorphRadio.vue2.js +1 -1
- package/dist/components/form/nmorph-radio-group/NmorphRadioGroup.vue2.js +24 -22
- package/dist/components/form/nmorph-select/NmorphSelect.css +1 -1
- package/dist/components/form/nmorph-select/NmorphSelect.vue2.js +83 -81
- 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 +28 -25
- 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 +51 -49
- package/dist/components/form/nmorph-switch/NmorphSwitch.vue2.js +35 -33
- package/dist/components/form/nmorph-text-input/NmorphTextInput.css +1 -0
- package/dist/components/form/nmorph-text-input/NmorphTextInput.vue.js +5 -3
- package/dist/components/form/nmorph-text-input/NmorphTextInput.vue2.js +37 -35
- package/dist/components/form/nmorph-textarea/NmorphTextarea.vue.js +1 -1
- package/dist/components/form/nmorph-textarea/NmorphTextarea.vue2.js +30 -26
- package/dist/components/form/nmorph-time-picker/NmorphTimePicker.vue.js +1 -1
- package/dist/components/form/nmorph-time-picker/NmorphTimePicker.vue2.js +68 -66
- 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-field-validation.js +71 -42
- package/dist/hooks/use-form-validation.js +62 -24
- package/dist/hooks/use-virtual-list.js +38 -32
- package/dist/index.umd.js +26 -286
- package/dist/package.json.js +1 -1
- package/dist/src/components/basic/nmorph-button/NmorphButton.vue.d.ts +2 -2
- package/dist/src/components/basic/nmorph-link/NmorphLink.vue.d.ts +1 -1
- package/dist/src/components/data/nmorph-avatar/NmorphAvatar.vue.d.ts +1 -1
- package/dist/src/components/data/nmorph-badge/NmorphBadge.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-empty/NmorphEmpty.vue.d.ts +1 -1
- package/dist/src/components/data/nmorph-pagination/NmorphPagination.vue.d.ts +1 -1
- package/dist/src/components/data/nmorph-progress/NmorphProgress.vue.d.ts +1 -1
- package/dist/src/components/data/nmorph-table/NmorphTable.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-callout/NmorphCallout.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 +3 -3
- 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 +3 -3
- package/dist/src/components/form/nmorph-file-upload/NmorphFileUpload.vue.d.ts +6 -3
- package/dist/src/components/form/nmorph-file-upload/types.d.ts +4 -0
- 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-form/types.d.ts +15 -5
- package/dist/src/components/form/nmorph-form/use-form-item-input.d.ts +10 -0
- 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 +3 -3
- 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-field-validation.d.ts +15 -0
- package/dist/src/hooks/use-form-validation.d.ts +5 -0
- 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 -3
- 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,16 @@
|
|
|
1
1
|
import './NmorphAutocomplete.css';
|
|
2
|
-
import { defineComponent as K, ref as s, computed as
|
|
2
|
+
import { defineComponent as K, ref as s, computed as l, watch as c, nextTick as Q } from "vue";
|
|
3
3
|
import { useModifiers as M } from "../../../utils/create-modifiers.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
|
|
4
|
+
import { getNmorphOptionHeight as W, toCssSize as X, resolveDomElement as Y } from "../../../utils/common.js";
|
|
5
|
+
import { NmorphComponentHeight as ee } from "../../../types/index.js";
|
|
6
|
+
import { useFormItemModel as te } from "../nmorph-form/use-form-item-input.js";
|
|
7
|
+
import { useVirtualList as ae } from "../../../hooks/use-virtual-list.js";
|
|
8
|
+
import { useZIndex as le } from "../../../hooks/use-z-index.js";
|
|
9
|
+
import re from "../nmorph-text-input/NmorphTextInput.vue.js";
|
|
10
|
+
import oe from "../../navigation/nmorph-dropdown/NmorphDropdown.vue.js";
|
|
11
|
+
import ue from "../../basic/nmorph-icon/NmorphIcon.vue.js";
|
|
12
|
+
import ne from "../../../assets/icons/loader.svg.js";
|
|
13
|
+
const Ie = /* @__PURE__ */ K({
|
|
12
14
|
__name: "NmorphAutocomplete",
|
|
13
15
|
props: {
|
|
14
16
|
modelValue: { type: String, required: !1, default: "" },
|
|
@@ -30,92 +32,84 @@ const ve = /* @__PURE__ */ K({
|
|
|
30
32
|
tabindex: { type: Number, required: !1 }
|
|
31
33
|
},
|
|
32
34
|
emits: ["update:model-value", "select"],
|
|
33
|
-
setup(O, { expose:
|
|
34
|
-
|
|
35
|
-
const
|
|
35
|
+
setup(O, { expose: L, emit: V }) {
|
|
36
|
+
L();
|
|
37
|
+
const t = O, p = V, { modelValue: m, updateModelValue: v } = te(
|
|
38
|
+
t,
|
|
39
|
+
(e) => p("update:model-value", e),
|
|
40
|
+
""
|
|
41
|
+
), o = s(m.value), A = l(
|
|
36
42
|
() => M({
|
|
37
|
-
"nmorph-autocomplete": [
|
|
43
|
+
"nmorph-autocomplete": [a.value && "open"]
|
|
38
44
|
})
|
|
39
|
-
), i = s(!1),
|
|
40
|
-
i.value = e === "", o.value = e,
|
|
41
|
-
},
|
|
45
|
+
), i = s(!1), b = (e) => {
|
|
46
|
+
i.value = e === "", o.value = e, a.value = !i.value && r.value.length > 0, u.value = 0, v(o.value);
|
|
47
|
+
}, T = l({
|
|
42
48
|
get: () => o.value,
|
|
43
|
-
set:
|
|
44
|
-
}),
|
|
45
|
-
i.value = !0,
|
|
46
|
-
}, r =
|
|
47
|
-
basic: 30,
|
|
48
|
-
thick: 38,
|
|
49
|
-
thin: 22
|
|
50
|
-
})[a.height || "basic"]), I = t(() => a.virtualItemHeight || x.value), H = t(() => a.virtualOverscan), q = t(() => a.virtualDynamicHeight), n = X(r, {
|
|
49
|
+
set: b
|
|
50
|
+
}), a = s(!1), z = s(null), x = () => {
|
|
51
|
+
i.value = !0, a.value = !1;
|
|
52
|
+
}, r = l(() => t.list.filter((e) => Object.keys(e).some((I) => String(e[I]).toLowerCase().includes(o.value.toLowerCase())))), f = l(() => t.virtual && r.value.length > 0), H = l(() => t.virtualItemHeight || W(t.height)), q = l(() => t.virtualOverscan), N = l(() => t.virtualDynamicHeight), n = ae(r, {
|
|
51
53
|
enabled: f,
|
|
52
|
-
itemHeight:
|
|
53
|
-
overscan:
|
|
54
|
-
dynamic:
|
|
55
|
-
}),
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
c(
|
|
61
|
-
() => a.modelValue,
|
|
62
|
-
(e) => {
|
|
63
|
-
e !== o.value && (o.value = e);
|
|
64
|
-
}
|
|
65
|
-
), c(r, async (e) => {
|
|
66
|
-
l.value = !i.value && o.value !== "" && e.length > 0, u.value = 0, await Q(), n.scrollToIndex(0), n.refresh();
|
|
54
|
+
itemHeight: H,
|
|
55
|
+
overscan: q,
|
|
56
|
+
dynamic: N
|
|
57
|
+
}), B = l(() => n.virtualItems.value), E = n.spacerStyle, $ = n.contentStyle, j = l(() => X(t.virtualMaxHeight)), u = s(0), h = l(() => r.value[u.value]), g = l(() => `${t.id || t.name || "nmorph-autocomplete"}-listbox`), D = (e) => `${g.value}-option-${e}`;
|
|
58
|
+
c(m, (e) => {
|
|
59
|
+
e !== o.value && (o.value = e);
|
|
60
|
+
}), c(r, async (e) => {
|
|
61
|
+
a.value = !i.value && o.value !== "" && e.length > 0, u.value = 0, await Q(), n.scrollToIndex(0), n.refresh();
|
|
67
62
|
});
|
|
68
|
-
const
|
|
69
|
-
p("select", e), o.value = e.value,
|
|
70
|
-
i.value = !0,
|
|
63
|
+
const y = (e) => {
|
|
64
|
+
p("select", e), o.value = e.value, v(o.value), setTimeout(() => {
|
|
65
|
+
i.value = !0, a.value = !1;
|
|
71
66
|
});
|
|
72
|
-
},
|
|
73
|
-
|
|
74
|
-
},
|
|
75
|
-
i.value = !1,
|
|
67
|
+
}, F = (e) => {
|
|
68
|
+
y(e);
|
|
69
|
+
}, R = () => {
|
|
70
|
+
i.value = !1, a.value = r.value.length > 0;
|
|
76
71
|
}, d = s(!1);
|
|
77
72
|
c(o, async (e) => {
|
|
78
|
-
e !== "" &&
|
|
73
|
+
e !== "" && t.actionCallback && (d.value = !0, await t.actionCallback(), d.value = !1);
|
|
79
74
|
}), c(d, (e) => {
|
|
80
|
-
e && (
|
|
75
|
+
e && (a.value = !0);
|
|
81
76
|
}), c(u, (e) => {
|
|
82
77
|
f.value && n.scrollToIndex(e);
|
|
83
78
|
});
|
|
84
|
-
const
|
|
85
|
-
r.value.length && (
|
|
86
|
-
},
|
|
87
|
-
r.value.length && (
|
|
79
|
+
const S = () => {
|
|
80
|
+
r.value.length && (a.value = !0, u.value = (u.value + 1) % r.value.length);
|
|
81
|
+
}, w = () => {
|
|
82
|
+
r.value.length && (a.value = !0, u.value = (u.value - 1 + r.value.length) % r.value.length);
|
|
88
83
|
}, k = () => {
|
|
89
|
-
!
|
|
90
|
-
},
|
|
91
|
-
e.key === "ArrowDown" ? (e.preventDefault(),
|
|
92
|
-
},
|
|
84
|
+
!a.value || !h.value || y(h.value);
|
|
85
|
+
}, U = (e) => {
|
|
86
|
+
e.key === "ArrowDown" ? (e.preventDefault(), S()) : e.key === "ArrowUp" ? (e.preventDefault(), w()) : e.key === "Enter" ? (e.preventDefault(), k()) : e.key === "Escape" && (e.preventDefault(), x());
|
|
87
|
+
}, Z = l(() => ({
|
|
93
88
|
role: "combobox",
|
|
94
89
|
"aria-autocomplete": "list",
|
|
95
|
-
"aria-expanded":
|
|
96
|
-
"aria-controls":
|
|
97
|
-
"aria-activedescendant":
|
|
98
|
-
})), P = (e,
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
}, C = ee(l, () => a.zIndex), Y = t(() => ({
|
|
90
|
+
"aria-expanded": a.value,
|
|
91
|
+
"aria-controls": g.value,
|
|
92
|
+
"aria-activedescendant": a.value ? D(u.value) : void 0
|
|
93
|
+
})), P = (e, I) => {
|
|
94
|
+
n.measureElement(I, Y(e));
|
|
95
|
+
}, C = le(a, () => t.zIndex), G = l(() => ({
|
|
102
96
|
"--nmorph-autocomplete-input-z-index": C.value + 1
|
|
103
|
-
})),
|
|
97
|
+
})), J = l(
|
|
104
98
|
() => M({
|
|
105
|
-
nmorph: [
|
|
99
|
+
nmorph: [ee[t.height]]
|
|
106
100
|
})
|
|
107
|
-
), _ = { props:
|
|
108
|
-
return
|
|
101
|
+
), _ = { props: t, emit: p, modelValue: m, updateModelValue: v, initialValue: o, modifiers: A, userClosed: i, updateValueHandler: b, inputValue: T, open: a, nmorphAutocompleteDOMRef: z, closeHandler: x, filteredList: r, virtualEnabled: f, virtualItemHeight: H, virtualOverscan: q, virtualDynamicHeight: N, virtualList: n, virtualItems: B, virtualSpacerStyle: E, virtualContentStyle: $, virtualMaxHeight: j, currentIndex: u, activeItem: h, listboxId: g, getOptionId: D, selectItem: y, clickHandler: F, focusHandler: R, loader: d, arrowDownHandler: S, arrowUpHandler: w, enterHandler: k, keydownHandler: U, inputAttrs: Z, setVirtualItemRef: P, dropdownZIndex: C, styles: G, optionHeightModifiers: J, get NmorphIcon() {
|
|
102
|
+
return ue;
|
|
109
103
|
}, get NmorphDropdown() {
|
|
110
|
-
return
|
|
104
|
+
return oe;
|
|
111
105
|
}, get NmorphTextInput() {
|
|
112
|
-
return te;
|
|
113
|
-
}, get NmorphIconLoaderDots() {
|
|
114
106
|
return re;
|
|
107
|
+
}, get NmorphIconLoaderDots() {
|
|
108
|
+
return ne;
|
|
115
109
|
} };
|
|
116
110
|
return Object.defineProperty(_, "__isScriptSetup", { enumerable: !1, value: !0 }), _;
|
|
117
111
|
}
|
|
118
112
|
});
|
|
119
113
|
export {
|
|
120
|
-
|
|
114
|
+
Ie as default
|
|
121
115
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.nmorph-checkbox{--size: var(--height);display:inline-flex;align-items:center;vertical-align:middle;cursor:pointer}.nmorph-checkbox .nmorph-checkbox__content{position:relative;display:flex;justify-content:center;align-items:center}.nmorph-checkbox .nmorph-checkbox__input-wrapper{position:relative;width:var(--size);height:var(--size)}.nmorph-checkbox input{position:absolute;top:0;left:0;width:100%;height:100%;opacity:0}.nmorph-checkbox input:focus-visible{outline:2px solid var(--nmorph-accent-color);opacity:1;scale:.95}.nmorph-checkbox .nmorph-checkbox__fake{position:absolute;top:0;left:0;width:100%;height:100%;background:var(--nmorph-main-color);border-radius:var(--default-border-radius);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
|
|
1
|
+
.nmorph-checkbox{--size: var(--height);--nmorph-selection-control-font-size: var(--font-size-small);--nmorph-selection-control-line-height: var(--line-height-regular);--nmorph-selection-control-inline-padding: var(--indentation-03);display:inline-flex;align-items:center;vertical-align:middle;cursor:pointer}.nmorph-checkbox.nmorph{height:auto;min-height:var(--size)}.nmorph-checkbox .nmorph-checkbox__content{position:relative;display:flex;justify-content:center;align-items:center;min-height:var(--size)}.nmorph-checkbox .nmorph-checkbox__input-wrapper{position:relative;width:var(--size);height:var(--size)}.nmorph-checkbox input{position:absolute;top:0;left:0;width:100%;height:100%;opacity:0}.nmorph-checkbox input:focus-visible{outline:2px solid var(--nmorph-accent-color);opacity:1;scale:.95}.nmorph-checkbox .nmorph-checkbox__fake{position:absolute;top:0;left:0;width:100%;height:100%;background:var(--nmorph-main-color);border-radius:var(--default-border-radius);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(--nmorph-selection-control-font-size);line-height:var(--nmorph-selection-control-line-height)}.nmorph-checkbox .nmorph-checkbox__fake-checked{position:absolute;top:50%;left:50%;width:50%;height:50%;background:var(--nmorph-accent-color);border-radius:var(--border-radius-20);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;justify-content:center;align-items:center;width:auto;min-width:var(--size);height:var(--size);padding:var(--nmorph-selection-control-inline-padding);background:var(--nmorph-main-color);border-radius:var(--default-border-radius);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-selection-control-font-size: var(--font-size-tiny);--nmorph-selection-control-line-height: var(--line-height-line);--nmorph-selection-control-inline-padding: var(--indentation-02)}.nmorph-checkbox.nmorph--thin-component{--nmorph-selection-control-font-size: var(--font-size-extra-small)}.nmorph-checkbox.nmorph--basic-component{--nmorph-selection-control-font-size: var(--font-size-small)}.nmorph-checkbox.nmorph--thick-component{--nmorph-selection-control-font-size: var(--font-size-base)}.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}
|