@nmorph/nmorph-ui-kit 2.2.34 → 2.2.36
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/assets/icons/baseball.svg.js +28 -0
- package/dist/assets/icons/basketball.svg.js +21 -0
- package/dist/assets/icons/bowl.svg.js +21 -0
- package/dist/assets/icons/box.svg.js +35 -0
- package/dist/assets/icons/briefcase.svg.js +21 -0
- package/dist/assets/icons/brush-filled.svg.js +21 -0
- package/dist/assets/icons/brush.svg.js +21 -0
- package/dist/assets/icons/camera-filled.svg.js +21 -0
- package/dist/assets/icons/chevron-double-left.svg.js +28 -0
- package/dist/assets/icons/chevron-double-right.svg.js +28 -0
- package/dist/assets/icons/chevron-double-up.svg.js +28 -0
- package/dist/assets/icons/chevron-left.svg.js +21 -0
- package/dist/assets/icons/chevron-right.svg.js +21 -0
- package/dist/assets/icons/chevron-up.svg.js +21 -0
- package/dist/assets/icons/chicken.svg.js +21 -0
- package/dist/assets/icons/clipboard-check.svg.js +25 -0
- package/dist/assets/icons/clipboard.svg.js +25 -0
- package/dist/assets/icons/close-bold.svg.js +21 -0
- package/dist/assets/icons/cold-drink.svg.js +21 -0
- package/dist/assets/icons/comment.svg.js +21 -0
- package/dist/assets/icons/database.svg.js +25 -0
- package/dist/assets/icons/drag-handle.svg.js +21 -0
- package/dist/assets/icons/external-link.svg.js +28 -0
- package/dist/assets/icons/filter-off.svg.js +28 -0
- package/dist/assets/icons/fingerprint.svg.js +44 -0
- package/dist/assets/icons/folder-remove.svg.js +21 -0
- package/dist/assets/icons/goblet.svg.js +21 -0
- package/dist/assets/icons/ice-tea.svg.js +21 -0
- package/dist/assets/icons/inbox.svg.js +25 -0
- package/dist/assets/icons/mail.svg.js +25 -0
- package/dist/assets/icons/odometer.svg.js +35 -0
- package/dist/assets/icons/open.svg.js +28 -0
- package/dist/assets/icons/pagination.svg.js +8 -0
- package/dist/assets/icons/pin.svg.js +21 -0
- package/dist/assets/icons/redo.svg.js +21 -0
- package/dist/assets/icons/save.svg.js +25 -0
- package/dist/assets/icons/server.svg.js +32 -0
- package/dist/assets/icons/shield-check.svg.js +25 -0
- package/dist/assets/icons/shield.svg.js +25 -0
- package/dist/assets/icons/sliders.svg.js +31 -0
- package/dist/assets/icons/stopwatch.svg.js +28 -0
- package/dist/assets/icons/suitcase-line.svg.js +22 -0
- package/dist/assets/icons/undo.svg.js +21 -0
- package/dist/assets/icons/video-camera.svg.js +21 -0
- package/dist/components/basic/nmorph-button/NmorphButton.vue.js +10 -10
- package/dist/components/basic/nmorph-button/NmorphButton.vue2.js +5 -5
- package/dist/components/basic/nmorph-icon/NmorphIcons.js +617 -527
- package/dist/components/basic/nmorph-layout/NmorphLayout.css +1 -0
- package/dist/components/basic/nmorph-layout/NmorphLayout.vue.js +50 -0
- package/dist/components/basic/nmorph-layout/NmorphLayout.vue2.js +28 -0
- package/dist/components/basic/nmorph-space/NmorphSpace.css +1 -0
- package/dist/components/basic/nmorph-space/NmorphSpace.vue.js +21 -0
- package/dist/components/basic/nmorph-space/NmorphSpace.vue2.js +45 -0
- package/dist/components/data/nmorph-avatar/NmorphAvatar.vue.js +15 -15
- package/dist/components/data/nmorph-avatar/NmorphAvatar.vue2.js +1 -1
- package/dist/components/data/nmorph-empty/NmorphEmpty.css +1 -1
- package/dist/components/data/nmorph-pagination/NmorphPagination.vue.js +31 -31
- package/dist/components/data/nmorph-pagination/NmorphPagination.vue2.js +36 -38
- package/dist/components/data/nmorph-qr-code/NmorphQRCode.css +1 -0
- package/dist/components/data/nmorph-qr-code/NmorphQRCode.vue.js +59 -0
- package/dist/components/data/nmorph-qr-code/NmorphQRCode.vue2.js +50 -0
- package/dist/components/data/nmorph-qr-code/qr-code.js +568 -0
- package/dist/components/data/nmorph-virtual-list/NmorphVirtualList.css +1 -0
- package/dist/components/data/nmorph-virtual-list/NmorphVirtualList.vue.js +86 -0
- package/dist/components/data/nmorph-virtual-list/NmorphVirtualList.vue2.js +60 -0
- package/dist/components/feedback/nmorph-drawer/NmorphDrawer.css +1 -0
- package/dist/components/feedback/nmorph-drawer/NmorphDrawer.vue.js +81 -0
- package/dist/components/feedback/nmorph-drawer/NmorphDrawer.vue2.js +47 -0
- package/dist/components/form/nmorph-autocomplete/NmorphAutocomplete.css +1 -1
- package/dist/components/form/nmorph-autocomplete/NmorphAutocomplete.vue.js +30 -27
- package/dist/components/form/nmorph-autocomplete/NmorphAutocomplete.vue2.js +75 -63
- package/dist/components/form/nmorph-date-picker/inner-components/nmorph-date-picker-content/NmorphDatePickerContent.vue.js +13 -13
- package/dist/components/form/nmorph-date-picker/inner-components/nmorph-date-picker-content/NmorphDatePickerContent.vue2.js +28 -27
- package/dist/components/form/nmorph-date-picker/inner-components/nmorph-year-month-picker/NmorphYearMonthPicker.vue.js +16 -16
- package/dist/components/form/nmorph-date-picker/inner-components/nmorph-year-month-picker/NmorphYearMonthPicker.vue2.js +20 -17
- package/dist/components/form/nmorph-file-upload/NmorphFileUpload.vue.js +34 -30
- package/dist/components/form/nmorph-file-upload/NmorphFileUpload.vue2.js +94 -62
- package/dist/components/form/nmorph-otp-input/NmorphOTPInput.vue.js +21 -21
- package/dist/components/form/nmorph-otp-input/NmorphOTPInput.vue2.js +92 -84
- package/dist/components/form/nmorph-select/NmorphSelect.vue.js +5 -5
- package/dist/components/form/nmorph-select/NmorphSelect.vue2.js +53 -53
- package/dist/components/form/nmorph-select/components/nmorph-select-option/NmorphSelectOption.vue2.js +24 -21
- package/dist/components/form/nmorph-switch/NmorphSwitch.vue.js +1 -1
- package/dist/components/form/nmorph-switch/NmorphSwitch.vue2.js +16 -16
- package/dist/components/form/nmorph-textarea/NmorphTextarea.css +1 -0
- package/dist/components/form/nmorph-textarea/NmorphTextarea.vue.js +41 -0
- package/dist/components/form/nmorph-textarea/NmorphTextarea.vue2.js +67 -0
- package/dist/components/form/nmorph-time-picker/NmorphTimePicker.css +1 -1
- package/dist/components/form/nmorph-time-picker/NmorphTimePicker.vue.js +40 -31
- package/dist/components/form/nmorph-time-picker/NmorphTimePicker.vue2.js +45 -41
- package/dist/components/navigation/nmorph-backtop/NmorphBacktop.vue.js +20 -25
- package/dist/components/navigation/nmorph-backtop/NmorphBacktop.vue2.js +41 -27
- package/dist/components/navigation/nmorph-context-menu/NmorphContextMenu.vue.js +11 -10
- package/dist/components/navigation/nmorph-context-menu/NmorphContextMenu.vue2.js +10 -9
- package/dist/components/navigation/nmorph-dropdown/NmorphDropdown.css +1 -1
- package/dist/components/navigation/nmorph-dropdown/NmorphDropdown.vue2.js +13 -12
- package/dist/hooks/use-common-styles.js +2 -1
- package/dist/icons.js +621 -531
- package/dist/index.es.js +781 -677
- package/dist/index.umd.js +31 -30
- package/dist/package.json.js +1 -1
- package/dist/src/components/basic/index.d.ts +2 -0
- package/dist/src/components/basic/nmorph-icon/NmorphIcons.d.ts +49 -3
- package/dist/src/components/basic/nmorph-layout/NmorphLayout.vue.d.ts +22 -0
- package/dist/src/components/basic/nmorph-space/NmorphSpace.vue.d.ts +33 -0
- package/dist/src/components/data/index.d.ts +4 -0
- package/dist/src/components/data/nmorph-qr-code/NmorphQRCode.vue.d.ts +34 -0
- package/dist/src/components/data/nmorph-qr-code/qr-code.d.ts +12 -0
- package/dist/src/components/data/nmorph-virtual-list/NmorphVirtualList.vue.d.ts +46 -0
- package/dist/src/components/data/nmorph-virtual-list/types.d.ts +4 -0
- package/dist/src/components/feedback/index.d.ts +1 -0
- package/dist/src/components/feedback/nmorph-drawer/NmorphDrawer.vue.d.ts +40 -0
- package/dist/src/components/form/index.d.ts +1 -0
- package/dist/src/components/form/nmorph-checkbox-group/NmorphCheckboxGroup.vue.d.ts +1 -1
- package/dist/src/components/form/nmorph-date-picker/inner-components/nmorph-date-picker-content/NmorphDatePickerContent.vue.d.ts +2 -2
- package/dist/src/components/form/nmorph-file-upload/NmorphFileUpload.vue.d.ts +2 -2
- package/dist/src/components/form/nmorph-radio-group/NmorphRadioGroup.vue.d.ts +1 -1
- package/dist/src/components/form/nmorph-select/components/nmorph-select-option/NmorphSelectOption.vue.d.ts +0 -1
- package/dist/src/components/form/nmorph-textarea/NmorphTextarea.vue.d.ts +48 -0
- package/dist/src/components/navigation/nmorph-backtop/NmorphBacktop.vue.d.ts +1 -1
- package/dist/src/components/navigation/nmorph-context-menu/NmorphContextMenu.vue.d.ts +3 -1
- package/dist/src/components/navigation/nmorph-dropdown/NmorphDropdown.vue.d.ts +3 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import './NmorphDrawer.css';
|
|
2
|
+
import c from "./NmorphDrawer.vue2.js";
|
|
3
|
+
import { openBlock as e, createBlock as p, withCtx as n, createElementVNode as l, normalizeStyle as m, normalizeClass as d, createElementBlock as a, renderSlot as t, toDisplayString as _, createVNode as i, createCommentVNode as s } from "vue";
|
|
4
|
+
/* empty css */
|
|
5
|
+
import h from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
6
|
+
const f = ["aria-label"], w = {
|
|
7
|
+
key: 0,
|
|
8
|
+
class: "nmorph-drawer__header"
|
|
9
|
+
}, b = { class: "nmorph-drawer__title" }, y = ["aria-label"], k = {
|
|
10
|
+
key: 1,
|
|
11
|
+
class: "nmorph-drawer__footer"
|
|
12
|
+
};
|
|
13
|
+
function v(r, C, N, o, z, O) {
|
|
14
|
+
return e(), p(o.NmorphOverlay, {
|
|
15
|
+
show: o.props.modelValue,
|
|
16
|
+
"z-index": o.props.zIndex,
|
|
17
|
+
"teleport-to": o.props.teleportTo,
|
|
18
|
+
"disabled-teleport": o.props.disabledTeleport,
|
|
19
|
+
"close-on-escape": o.props.closeOnEscape,
|
|
20
|
+
"trap-focus": "",
|
|
21
|
+
onOnOutsideClick: o.overlayClickHandler,
|
|
22
|
+
onOnEscapeKeydown: o.closeHandler
|
|
23
|
+
}, {
|
|
24
|
+
default: n(() => [
|
|
25
|
+
l("aside", {
|
|
26
|
+
class: d(o.modifiers),
|
|
27
|
+
style: m(o.drawerStyle),
|
|
28
|
+
role: "dialog",
|
|
29
|
+
"aria-modal": "true",
|
|
30
|
+
"aria-label": o.props.title || void 0
|
|
31
|
+
}, [
|
|
32
|
+
o.hasHeader ? (e(), a("div", w, [
|
|
33
|
+
t(r.$slots, "header", {}, () => [
|
|
34
|
+
l(
|
|
35
|
+
"div",
|
|
36
|
+
b,
|
|
37
|
+
_(o.props.title),
|
|
38
|
+
1
|
|
39
|
+
/* TEXT */
|
|
40
|
+
),
|
|
41
|
+
o.props.showClose ? (e(), a("button", {
|
|
42
|
+
key: 0,
|
|
43
|
+
class: "nmorph-drawer__close",
|
|
44
|
+
type: "button",
|
|
45
|
+
"aria-label": o.props.title ? `Close ${o.props.title}` : "Close drawer",
|
|
46
|
+
onClick: o.closeHandler
|
|
47
|
+
}, [
|
|
48
|
+
i(o.NmorphIcon, null, {
|
|
49
|
+
default: n(() => [
|
|
50
|
+
i(o.NmorphIconCross)
|
|
51
|
+
]),
|
|
52
|
+
_: 1
|
|
53
|
+
/* STABLE */
|
|
54
|
+
})
|
|
55
|
+
], 8, y)) : s("v-if", !0)
|
|
56
|
+
])
|
|
57
|
+
])) : s("v-if", !0),
|
|
58
|
+
l(
|
|
59
|
+
"div",
|
|
60
|
+
{
|
|
61
|
+
class: d(["nmorph-drawer__content", o.props.contentClass])
|
|
62
|
+
},
|
|
63
|
+
[
|
|
64
|
+
t(r.$slots, "default")
|
|
65
|
+
],
|
|
66
|
+
2
|
|
67
|
+
/* CLASS */
|
|
68
|
+
),
|
|
69
|
+
o.slots.footer ? (e(), a("div", k, [
|
|
70
|
+
t(r.$slots, "footer")
|
|
71
|
+
])) : s("v-if", !0)
|
|
72
|
+
], 14, f)
|
|
73
|
+
]),
|
|
74
|
+
_: 3
|
|
75
|
+
/* FORWARDED */
|
|
76
|
+
}, 8, ["show", "z-index", "teleport-to", "disabled-teleport", "close-on-escape"]);
|
|
77
|
+
}
|
|
78
|
+
const V = /* @__PURE__ */ h(c, [["render", v], ["__file", "/builds/ketjo/nmorph/library/src/components/feedback/nmorph-drawer/NmorphDrawer.vue"]]);
|
|
79
|
+
export {
|
|
80
|
+
V as default
|
|
81
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import './NmorphDrawer.css';
|
|
2
|
+
import { defineComponent as y, useSlots as h, computed as o } from "vue";
|
|
3
|
+
import { useModifiers as q } from "../../../utils/create-modifiers.js";
|
|
4
|
+
import _ from "../../others/nmorph-overlay/NmorphOverlay.vue.js";
|
|
5
|
+
import g from "../../basic/nmorph-icon/NmorphIcon.vue.js";
|
|
6
|
+
import N from "../../../assets/icons/cross.svg.js";
|
|
7
|
+
const w = /* @__PURE__ */ y({
|
|
8
|
+
__name: "NmorphDrawer",
|
|
9
|
+
props: {
|
|
10
|
+
modelValue: { type: Boolean, required: !1, default: !1 },
|
|
11
|
+
title: { type: String, required: !1, default: "" },
|
|
12
|
+
placement: { type: String, required: !1, default: "right" },
|
|
13
|
+
size: { type: [Number, String], required: !1, default: "360px" },
|
|
14
|
+
showClose: { type: Boolean, required: !1, default: !0 },
|
|
15
|
+
closeOnOverlay: { type: Boolean, required: !1, default: !0 },
|
|
16
|
+
closeOnEscape: { type: Boolean, required: !1, default: !0 },
|
|
17
|
+
zIndex: { type: Number, required: !1, default: void 0 },
|
|
18
|
+
teleportTo: { type: null, required: !1, default: "body" },
|
|
19
|
+
disabledTeleport: { type: Boolean, required: !1, default: !1 },
|
|
20
|
+
contentClass: { type: String, required: !1, default: "" }
|
|
21
|
+
},
|
|
22
|
+
emits: ["on-close", "update:model-value"],
|
|
23
|
+
setup(p, { expose: u, emit: d }) {
|
|
24
|
+
u();
|
|
25
|
+
const e = p, r = d, l = h(), i = o(
|
|
26
|
+
() => q({
|
|
27
|
+
"nmorph-drawer": [e.placement, `${e.modelValue && "open"}`]
|
|
28
|
+
})
|
|
29
|
+
), s = (t) => typeof t == "number" ? `${t}px` : t, f = o(() => ({
|
|
30
|
+
"--nmorph-drawer-size": s(e.size)
|
|
31
|
+
})), a = () => {
|
|
32
|
+
r("on-close"), r("update:model-value", !1);
|
|
33
|
+
}, m = () => {
|
|
34
|
+
e.closeOnOverlay && a();
|
|
35
|
+
}, c = o(() => !!(l.header || e.title || e.showClose)), n = { props: e, emit: r, slots: l, modifiers: i, getCssSize: s, drawerStyle: f, closeHandler: a, overlayClickHandler: m, hasHeader: c, get NmorphIcon() {
|
|
36
|
+
return g;
|
|
37
|
+
}, get NmorphIconCross() {
|
|
38
|
+
return N;
|
|
39
|
+
}, get NmorphOverlay() {
|
|
40
|
+
return _;
|
|
41
|
+
} };
|
|
42
|
+
return Object.defineProperty(n, "__isScriptSetup", { enumerable: !1, value: !0 }), n;
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
export {
|
|
46
|
+
w as default
|
|
47
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.nmorph-autocomplete .nmorph-autocomplete__input-content{position:relative}.nmorph-autocomplete.nmorph-autocomplete--open .nmorph-autocomplete__input-content{z-index:var(--nmorph-autocomplete-input-z-index)}.nmorph-autocomplete__list{padding:var(--indentation-01) 0}.nmorph-autocomplete__list-item{box-sizing:border-box;padding:var(--indentation-00) var(--default-indentation-input);cursor:pointer}.nmorph-autocomplete__loading{display:flex;justify-content:center;align-items:center;height:100px}.nmorph-autocomplete__list-item:hover,.nmorph-autocomplete__list-item--focused{color:var(--nmorph-white-color);background:var(--nmorph-accent-color)}.nmorph-autocomplete__list--virtual{overflow-y:auto}.nmorph-autocomplete__list--virtual .nmorph-autocomplete__list-item{height:var(--autocomplete-virtual-item-height);overflow:hidden}.nmorph-autocomplete__list--dynamic .nmorph-autocomplete__list-item{height:auto}.nmorph-autocomplete__virtual-spacer{position:relative}.nmorph-autocomplete__virtual-content{position:absolute;top:0;right:0;left:0}
|
|
1
|
+
.nmorph-autocomplete .nmorph-autocomplete__input-content{position:relative}.nmorph-autocomplete.nmorph-autocomplete--open .nmorph-autocomplete__input-content{z-index:var(--nmorph-autocomplete-input-z-index)}.nmorph-autocomplete__list{padding:var(--indentation-01) 0}.nmorph-autocomplete__list-item{display:flex;align-items:center;box-sizing:border-box;min-width:0;padding:var(--indentation-00) var(--default-indentation-input);overflow:hidden;white-space:nowrap;text-overflow:ellipsis;cursor:pointer}.nmorph-autocomplete__loading{display:flex;justify-content:center;align-items:center;height:100px}.nmorph-autocomplete__list-item:hover,.nmorph-autocomplete__list-item--focused{color:var(--nmorph-white-color);background:var(--nmorph-accent-color)}.nmorph-autocomplete__list--virtual{overflow-y:auto}.nmorph-autocomplete__list--virtual .nmorph-autocomplete__list-item{height:var(--autocomplete-virtual-item-height);overflow:hidden}.nmorph-autocomplete__list--dynamic .nmorph-autocomplete__list-item{height:auto}.nmorph-autocomplete__virtual-spacer{position:relative}.nmorph-autocomplete__virtual-content{position:absolute;top:0;right:0;left:0}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import './NmorphAutocomplete.css';
|
|
2
2
|
import v from "./NmorphAutocomplete.vue2.js";
|
|
3
|
-
import { openBlock as l, createElementBlock as t, normalizeStyle as n, normalizeClass as a, createElementVNode as
|
|
3
|
+
import { openBlock as l, createElementBlock as t, normalizeStyle as n, normalizeClass as a, createElementVNode as d, createVNode as m, createBlock as y, withCtx as p, renderSlot as s, Fragment as _, renderList as h, createTextVNode as f, toDisplayString as u, createCommentVNode as x } from "vue";
|
|
4
4
|
/* empty css */
|
|
5
5
|
import k from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
6
|
-
const
|
|
6
|
+
const g = { class: "nmorph-autocomplete__input-content" }, b = {
|
|
7
7
|
ref: "nmorphAutocompleteDOMRef",
|
|
8
8
|
class: "nmorph-autocomplete__input"
|
|
9
9
|
}, H = {
|
|
10
10
|
key: 0,
|
|
11
11
|
class: "nmorph-autocomplete__loading"
|
|
12
|
-
}, N = ["id"],
|
|
13
|
-
function
|
|
12
|
+
}, N = ["id"], V = ["id", "aria-selected", "onClick"], C = ["id"], I = ["id", "aria-selected", "onClick"];
|
|
13
|
+
function O(c, i, w, e, D, S) {
|
|
14
14
|
return l(), t(
|
|
15
15
|
"div",
|
|
16
16
|
{
|
|
@@ -18,25 +18,25 @@ function V(d, s, w, e, S, A) {
|
|
|
18
18
|
style: n(e.styles)
|
|
19
19
|
},
|
|
20
20
|
[
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
d("div", g, [
|
|
22
|
+
d(
|
|
23
23
|
"div",
|
|
24
|
-
|
|
24
|
+
b,
|
|
25
25
|
[
|
|
26
|
-
|
|
26
|
+
m(e.NmorphTextInput, {
|
|
27
27
|
id: e.props.id,
|
|
28
|
+
modelValue: e.inputValue,
|
|
29
|
+
"onUpdate:modelValue": i[0] || (i[0] = (o) => e.inputValue = o),
|
|
28
30
|
name: e.props.name,
|
|
29
31
|
autocomplete: e.props.autocomplete,
|
|
30
32
|
height: e.props.height,
|
|
31
33
|
disabled: e.props.disabled,
|
|
32
|
-
"model-value": e.initialValue,
|
|
33
34
|
placeholder: e.props.placeholder,
|
|
34
35
|
clearable: e.props.clearable,
|
|
35
36
|
"input-attrs": e.inputAttrs,
|
|
36
37
|
onFocus: e.focusHandler,
|
|
37
|
-
onKeydown: e.keydownHandler
|
|
38
|
-
|
|
39
|
-
}, null, 8, ["id", "name", "autocomplete", "height", "disabled", "model-value", "placeholder", "clearable", "input-attrs"])
|
|
38
|
+
onKeydown: e.keydownHandler
|
|
39
|
+
}, null, 8, ["id", "modelValue", "name", "autocomplete", "height", "disabled", "placeholder", "clearable", "input-attrs"])
|
|
40
40
|
],
|
|
41
41
|
512
|
|
42
42
|
/* NEED_PATCH */
|
|
@@ -56,10 +56,10 @@ function V(d, s, w, e, S, A) {
|
|
|
56
56
|
}, {
|
|
57
57
|
default: p(() => [
|
|
58
58
|
e.loader ? (l(), t("div", H, [
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
s(c.$slots, "loader", {}, () => [
|
|
60
|
+
m(e.NmorphIcon, { size: "large" }, {
|
|
61
61
|
default: p(() => [
|
|
62
|
-
|
|
62
|
+
m(e.NmorphIconLoaderDots)
|
|
63
63
|
]),
|
|
64
64
|
_: 1
|
|
65
65
|
/* STABLE */
|
|
@@ -72,16 +72,16 @@ function V(d, s, w, e, S, A) {
|
|
|
72
72
|
class: a(["nmorph-autocomplete__list nmorph-autocomplete__list--virtual", { "nmorph-autocomplete__list--dynamic": e.virtualDynamicHeight }]),
|
|
73
73
|
style: n({ "--autocomplete-virtual-item-height": `${e.virtualItemHeight}px`, maxHeight: e.virtualMaxHeight }),
|
|
74
74
|
role: "listbox",
|
|
75
|
-
onScroll:
|
|
75
|
+
onScroll: i[1] || (i[1] = (...o) => e.virtualList.scrollHandler && e.virtualList.scrollHandler(...o))
|
|
76
76
|
}, [
|
|
77
|
-
|
|
77
|
+
d(
|
|
78
78
|
"div",
|
|
79
79
|
{
|
|
80
80
|
class: "nmorph-autocomplete__virtual-spacer",
|
|
81
81
|
style: n(e.virtualSpacerStyle)
|
|
82
82
|
},
|
|
83
83
|
[
|
|
84
|
-
|
|
84
|
+
d(
|
|
85
85
|
"div",
|
|
86
86
|
{
|
|
87
87
|
class: "nmorph-autocomplete__virtual-content",
|
|
@@ -96,12 +96,15 @@ function V(d, s, w, e, S, A) {
|
|
|
96
96
|
ref_for: !0,
|
|
97
97
|
ref: (r) => e.setVirtualItemRef(r, o.index),
|
|
98
98
|
key: o.index,
|
|
99
|
-
class: a(["nmorph-autocomplete__list-item",
|
|
99
|
+
class: a(["nmorph-autocomplete__list-item", [
|
|
100
|
+
e.optionHeightModifiers,
|
|
101
|
+
{ "nmorph-autocomplete__list-item--focused": o.index === e.currentIndex }
|
|
102
|
+
]]),
|
|
100
103
|
role: "option",
|
|
101
104
|
"aria-selected": o.index === e.currentIndex,
|
|
102
105
|
onClick: () => e.clickHandler(o.item)
|
|
103
106
|
}, [
|
|
104
|
-
|
|
107
|
+
s(c.$slots, "default", {
|
|
105
108
|
scope: o.item
|
|
106
109
|
}, () => [
|
|
107
110
|
f(
|
|
@@ -110,7 +113,7 @@ function V(d, s, w, e, S, A) {
|
|
|
110
113
|
/* TEXT */
|
|
111
114
|
)
|
|
112
115
|
])
|
|
113
|
-
], 10,
|
|
116
|
+
], 10, V))),
|
|
114
117
|
128
|
|
115
118
|
/* KEYED_FRAGMENT */
|
|
116
119
|
))
|
|
@@ -134,23 +137,23 @@ function V(d, s, w, e, S, A) {
|
|
|
134
137
|
h(e.filteredList, (o, r) => (l(), t("div", {
|
|
135
138
|
id: e.getOptionId(r),
|
|
136
139
|
key: r,
|
|
137
|
-
class: a(["nmorph-autocomplete__list-item", { "nmorph-autocomplete__list-item--focused": r === e.currentIndex }]),
|
|
140
|
+
class: a(["nmorph-autocomplete__list-item", [e.optionHeightModifiers, { "nmorph-autocomplete__list-item--focused": r === e.currentIndex }]]),
|
|
138
141
|
role: "option",
|
|
139
142
|
"aria-selected": r === e.currentIndex,
|
|
140
143
|
onClick: () => e.clickHandler(o)
|
|
141
144
|
}, [
|
|
142
|
-
|
|
145
|
+
s(c.$slots, "default", { scope: o }, () => [
|
|
143
146
|
f(
|
|
144
147
|
u(o.value),
|
|
145
148
|
1
|
|
146
149
|
/* TEXT */
|
|
147
150
|
)
|
|
148
151
|
])
|
|
149
|
-
], 10,
|
|
152
|
+
], 10, I))),
|
|
150
153
|
128
|
|
151
154
|
/* KEYED_FRAGMENT */
|
|
152
155
|
))
|
|
153
|
-
], 8,
|
|
156
|
+
], 8, C))
|
|
154
157
|
]),
|
|
155
158
|
_: 3
|
|
156
159
|
/* FORWARDED */
|
|
@@ -160,7 +163,7 @@ function V(d, s, w, e, S, A) {
|
|
|
160
163
|
/* CLASS, STYLE */
|
|
161
164
|
);
|
|
162
165
|
}
|
|
163
|
-
const
|
|
166
|
+
const R = /* @__PURE__ */ k(v, [["render", O], ["__file", "/builds/ketjo/nmorph/library/src/components/form/nmorph-autocomplete/NmorphAutocomplete.vue"]]);
|
|
164
167
|
export {
|
|
165
|
-
|
|
168
|
+
R as default
|
|
166
169
|
};
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import './NmorphAutocomplete.css';
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
import { useModifiers as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
|
|
2
|
+
import { defineComponent as K, ref as s, computed as t, watch as c, nextTick as Q } from "vue";
|
|
3
|
+
import { useModifiers as M } from "../../../utils/create-modifiers.js";
|
|
4
|
+
import { NmorphComponentHeight as W } from "../../../types/index.js";
|
|
5
|
+
import { useVirtualList as X } from "../../../hooks/use-virtual-list.js";
|
|
6
|
+
import { useZIndex as ee } from "../../../hooks/use-z-index.js";
|
|
7
|
+
import te from "../nmorph-text-input/NmorphTextInput.vue.js";
|
|
8
|
+
import ae from "../../navigation/nmorph-dropdown/NmorphDropdown.vue.js";
|
|
9
|
+
import le from "../../basic/nmorph-icon/NmorphIcon.vue.js";
|
|
10
|
+
import re from "../../../assets/icons/loader.svg.js";
|
|
11
|
+
const ve = /* @__PURE__ */ K({
|
|
11
12
|
__name: "NmorphAutocomplete",
|
|
12
13
|
props: {
|
|
13
14
|
modelValue: { type: String, required: !1, default: "" },
|
|
@@ -17,7 +18,7 @@ const se = /* @__PURE__ */ P({
|
|
|
17
18
|
actionCallback: { type: Function, required: !1, default: void 0 },
|
|
18
19
|
zIndex: { type: Number, required: !1, default: void 0 },
|
|
19
20
|
virtual: { type: Boolean, required: !1, default: !1 },
|
|
20
|
-
virtualItemHeight: { type: Number, required: !1, default:
|
|
21
|
+
virtualItemHeight: { type: Number, required: !1, default: void 0 },
|
|
21
22
|
virtualMaxHeight: { type: [Number, String], required: !1, default: 240 },
|
|
22
23
|
virtualOverscan: { type: Number, required: !1, default: 5 },
|
|
23
24
|
virtualDynamicHeight: { type: Boolean, required: !1, default: !1 },
|
|
@@ -29,81 +30,92 @@ const se = /* @__PURE__ */ P({
|
|
|
29
30
|
tabindex: { type: Number, required: !1 }
|
|
30
31
|
},
|
|
31
32
|
emits: ["update:model-value", "select"],
|
|
32
|
-
setup(
|
|
33
|
-
|
|
34
|
-
const
|
|
35
|
-
() =>
|
|
36
|
-
"nmorph-autocomplete": [`${
|
|
33
|
+
setup(O, { expose: $, emit: L }) {
|
|
34
|
+
$();
|
|
35
|
+
const a = O, o = s(a.modelValue), p = L, T = t(
|
|
36
|
+
() => M({
|
|
37
|
+
"nmorph-autocomplete": [`${l.value && "open"}`]
|
|
37
38
|
})
|
|
38
|
-
), i = s(!1),
|
|
39
|
-
i.value = e === "",
|
|
40
|
-
},
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
), i = s(!1), y = (e) => {
|
|
40
|
+
i.value = e === "", o.value = e, l.value = !i.value && r.value.length > 0, u.value = 0, p("update:model-value", o.value);
|
|
41
|
+
}, V = t({
|
|
42
|
+
get: () => o.value,
|
|
43
|
+
set: y
|
|
44
|
+
}), l = s(!1), A = s(null), b = () => {
|
|
45
|
+
i.value = !0, l.value = !1;
|
|
46
|
+
}, r = t(() => a.list.filter((e) => Object.keys(e).some((g) => String(e[g]).toLowerCase().includes(o.value.toLowerCase())))), f = t(() => a.virtual && r.value.length > 0), x = t(() => ({
|
|
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, {
|
|
43
51
|
enabled: f,
|
|
44
|
-
itemHeight:
|
|
45
|
-
overscan:
|
|
46
|
-
dynamic:
|
|
47
|
-
}),
|
|
52
|
+
itemHeight: I,
|
|
53
|
+
overscan: H,
|
|
54
|
+
dynamic: q
|
|
55
|
+
}), z = t(() => n.virtualItems.value), B = t(() => ({
|
|
48
56
|
height: `${n.totalHeight.value}px`
|
|
49
|
-
})),
|
|
57
|
+
})), E = t(() => ({
|
|
50
58
|
transform: `translateY(${n.offsetTop.value}px)`
|
|
51
|
-
})),
|
|
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}`;
|
|
52
60
|
c(
|
|
53
|
-
() =>
|
|
61
|
+
() => a.modelValue,
|
|
54
62
|
(e) => {
|
|
55
|
-
e !==
|
|
63
|
+
e !== o.value && (o.value = e);
|
|
56
64
|
}
|
|
57
65
|
), c(r, async (e) => {
|
|
58
|
-
|
|
66
|
+
l.value = !i.value && o.value !== "" && e.length > 0, u.value = 0, await Q(), n.scrollToIndex(0), n.refresh();
|
|
59
67
|
});
|
|
60
68
|
const h = (e) => {
|
|
61
|
-
|
|
62
|
-
i.value = !0,
|
|
69
|
+
p("select", e), o.value = e.value, p("update:model-value", o.value), setTimeout(() => {
|
|
70
|
+
i.value = !0, l.value = !1;
|
|
63
71
|
});
|
|
64
|
-
},
|
|
72
|
+
}, R = (e) => {
|
|
65
73
|
h(e);
|
|
66
|
-
},
|
|
67
|
-
i.value = !1,
|
|
68
|
-
},
|
|
69
|
-
c(
|
|
70
|
-
e !== "" &&
|
|
71
|
-
}), c(
|
|
72
|
-
e && (
|
|
73
|
-
}), c(
|
|
74
|
+
}, U = () => {
|
|
75
|
+
i.value = !1, l.value = r.value.length > 0;
|
|
76
|
+
}, d = s(!1);
|
|
77
|
+
c(o, async (e) => {
|
|
78
|
+
e !== "" && a.actionCallback && (d.value = !0, await a.actionCallback(), d.value = !1);
|
|
79
|
+
}), c(d, (e) => {
|
|
80
|
+
e && (l.value = !0);
|
|
81
|
+
}), c(u, (e) => {
|
|
74
82
|
f.value && n.scrollToIndex(e);
|
|
75
83
|
});
|
|
76
|
-
const
|
|
77
|
-
r.value.length && (
|
|
78
|
-
}, N = () => {
|
|
79
|
-
r.value.length && (a.value = !0, o.value = (o.value - 1 + r.value.length) % r.value.length);
|
|
84
|
+
const D = () => {
|
|
85
|
+
r.value.length && (l.value = !0, u.value = (u.value + 1) % r.value.length);
|
|
80
86
|
}, S = () => {
|
|
81
|
-
|
|
82
|
-
},
|
|
83
|
-
|
|
84
|
-
},
|
|
87
|
+
r.value.length && (l.value = !0, u.value = (u.value - 1 + r.value.length) % r.value.length);
|
|
88
|
+
}, k = () => {
|
|
89
|
+
!l.value || !v.value || h(v.value);
|
|
90
|
+
}, Z = (e) => {
|
|
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(() => ({
|
|
85
93
|
role: "combobox",
|
|
86
94
|
"aria-autocomplete": "list",
|
|
87
|
-
"aria-expanded":
|
|
95
|
+
"aria-expanded": l.value,
|
|
88
96
|
"aria-controls": m.value,
|
|
89
|
-
"aria-activedescendant":
|
|
90
|
-
})),
|
|
91
|
-
const
|
|
92
|
-
n.measureElement(g,
|
|
93
|
-
},
|
|
94
|
-
"--nmorph-autocomplete-input-z-index":
|
|
95
|
-
})),
|
|
96
|
-
|
|
97
|
+
"aria-activedescendant": l.value ? w(u.value) : void 0
|
|
98
|
+
})), P = (e, g) => {
|
|
99
|
+
const J = e instanceof Element ? e : e?.$el;
|
|
100
|
+
n.measureElement(g, J);
|
|
101
|
+
}, C = ee(l, () => a.zIndex), Y = t(() => ({
|
|
102
|
+
"--nmorph-autocomplete-input-z-index": C.value + 1
|
|
103
|
+
})), G = t(
|
|
104
|
+
() => M({
|
|
105
|
+
nmorph: [W[a.height]]
|
|
106
|
+
})
|
|
107
|
+
), _ = { props: a, initialValue: o, emit: p, modifiers: T, userClosed: i, updateValueHandler: y, inputValue: V, open: l, nmorphAutocompleteDOMRef: A, closeHandler: b, filteredList: r, virtualEnabled: f, defaultOptionHeight: x, virtualItemHeight: I, virtualOverscan: H, virtualDynamicHeight: q, virtualList: n, virtualItems: z, virtualSpacerStyle: B, virtualContentStyle: E, getCssSize: N, virtualMaxHeight: j, currentIndex: u, activeItem: v, listboxId: m, getOptionId: w, selectItem: h, clickHandler: R, focusHandler: U, loader: d, arrowDownHandler: D, arrowUpHandler: S, enterHandler: k, keydownHandler: Z, inputAttrs: F, setVirtualItemRef: P, dropdownZIndex: C, styles: Y, optionHeightModifiers: G, get NmorphIcon() {
|
|
108
|
+
return le;
|
|
97
109
|
}, get NmorphDropdown() {
|
|
98
|
-
return
|
|
110
|
+
return ae;
|
|
99
111
|
}, get NmorphTextInput() {
|
|
100
|
-
return
|
|
101
|
-
}, get
|
|
102
|
-
return
|
|
112
|
+
return te;
|
|
113
|
+
}, get NmorphIconLoaderDots() {
|
|
114
|
+
return re;
|
|
103
115
|
} };
|
|
104
|
-
return Object.defineProperty(
|
|
116
|
+
return Object.defineProperty(_, "__isScriptSetup", { enumerable: !1, value: !0 }), _;
|
|
105
117
|
}
|
|
106
118
|
});
|
|
107
119
|
export {
|
|
108
|
-
|
|
120
|
+
ve as default
|
|
109
121
|
};
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { openBlock as a, createElementBlock as
|
|
3
|
-
import
|
|
4
|
-
function
|
|
5
|
-
return a(),
|
|
1
|
+
import l from "./NmorphDatePickerContent.vue2.js";
|
|
2
|
+
import { openBlock as a, createElementBlock as i, normalizeClass as d, createBlock as r, withCtx as c, createVNode as m, createCommentVNode as n } from "vue";
|
|
3
|
+
import h from "../../../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
function k(Y, t, f, e, p, y) {
|
|
5
|
+
return a(), i(
|
|
6
6
|
"div",
|
|
7
7
|
{
|
|
8
|
-
class:
|
|
8
|
+
class: d(e.modifiers)
|
|
9
9
|
},
|
|
10
10
|
[
|
|
11
11
|
e.selectedPicker === "calendar" ? (a(), r(e.NmorphCalendar, {
|
|
12
12
|
key: 0,
|
|
13
|
+
modelValue: e.selectedValuesModel,
|
|
14
|
+
"onUpdate:modelValue": t[0] || (t[0] = (o) => e.selectedValuesModel = o),
|
|
13
15
|
type: e.props.type,
|
|
14
16
|
"initial-date": e.initialDate,
|
|
15
|
-
"model-value": e.props.selectedValues,
|
|
16
|
-
"onUpdate:modelValue": e.updateSelectedDate,
|
|
17
17
|
onUpdateInitialDate: e.updateInitialDate
|
|
18
18
|
}, {
|
|
19
|
-
header:
|
|
20
|
-
|
|
19
|
+
header: c(() => [
|
|
20
|
+
m(e.NmorphDatePickerHeader, {
|
|
21
21
|
year: e.initialDate.getFullYear(),
|
|
22
22
|
month: e.initialDate.getMonth(),
|
|
23
23
|
onPrevMonth: e.prevMonthHandler,
|
|
@@ -30,7 +30,7 @@ function h(m, k, p, e, Y, f) {
|
|
|
30
30
|
]),
|
|
31
31
|
_: 1
|
|
32
32
|
/* STABLE */
|
|
33
|
-
}, 8, ["
|
|
33
|
+
}, 8, ["modelValue", "type", "initial-date"])) : n("v-if", !0),
|
|
34
34
|
e.selectedPicker === "year" ? (a(), r(e.NmorphYearMonthPicker, {
|
|
35
35
|
key: 1,
|
|
36
36
|
type: "year",
|
|
@@ -50,7 +50,7 @@ function h(m, k, p, e, Y, f) {
|
|
|
50
50
|
/* CLASS */
|
|
51
51
|
);
|
|
52
52
|
}
|
|
53
|
-
const
|
|
53
|
+
const N = /* @__PURE__ */ h(l, [["render", k], ["__file", "/builds/ketjo/nmorph/library/src/components/form/nmorph-date-picker/inner-components/nmorph-date-picker-content/NmorphDatePickerContent.vue"]]);
|
|
54
54
|
export {
|
|
55
|
-
|
|
55
|
+
N as default
|
|
56
56
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useModifiers as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
const O = /* @__PURE__ */
|
|
1
|
+
import { defineComponent as x, computed as n, ref as i } from "vue";
|
|
2
|
+
import { useModifiers as b } from "../../../../../utils/create-modifiers.js";
|
|
3
|
+
import F from "../nmorph-date-picker-header/NmorphDatePickerHeader.vue.js";
|
|
4
|
+
import P from "../nmorph-year-month-picker/NmorphYearMonthPicker.vue.js";
|
|
5
|
+
import C from "../../../../data/nmorph-calendar/NmorphCalendar.vue.js";
|
|
6
|
+
const O = /* @__PURE__ */ x({
|
|
7
7
|
__name: "NmorphDatePickerContent",
|
|
8
8
|
props: {
|
|
9
9
|
initialDate: { type: Date, required: !1, default: () => /* @__PURE__ */ new Date() },
|
|
@@ -13,37 +13,38 @@ const O = /* @__PURE__ */ H({
|
|
|
13
13
|
emits: ["update-selected-value"],
|
|
14
14
|
setup(v, { expose: m, emit: h }) {
|
|
15
15
|
m();
|
|
16
|
-
const
|
|
17
|
-
() =>
|
|
16
|
+
const r = v, o = h, D = n(
|
|
17
|
+
() => b({
|
|
18
18
|
"nmorph-date-picker-content": []
|
|
19
19
|
})
|
|
20
|
-
), e = i(
|
|
20
|
+
), e = i(r.initialDate), a = i("calendar"), u = n(() => new Date(e.value.setMonth(e.value.getMonth() - 1))), s = n(() => new Date(e.value.setMonth(e.value.getMonth() + 1))), c = n(() => new Date(e.value.setFullYear(e.value.getFullYear() - 1))), d = n(() => new Date(e.value.setFullYear(e.value.getFullYear() + 1))), f = () => {
|
|
21
21
|
e.value = u.value;
|
|
22
|
-
},
|
|
23
|
-
e.value = d.value;
|
|
24
|
-
}, prevYearHandler: () => {
|
|
22
|
+
}, M = () => {
|
|
25
23
|
e.value = s.value;
|
|
26
|
-
},
|
|
24
|
+
}, Y = () => {
|
|
27
25
|
e.value = c.value;
|
|
28
|
-
},
|
|
26
|
+
}, H = () => {
|
|
27
|
+
e.value = d.value;
|
|
28
|
+
}, _ = () => {
|
|
29
29
|
a.value = "year";
|
|
30
|
-
},
|
|
30
|
+
}, g = () => {
|
|
31
31
|
a.value = "month";
|
|
32
|
-
},
|
|
33
|
-
const
|
|
34
|
-
e.value =
|
|
35
|
-
},
|
|
36
|
-
const
|
|
37
|
-
e.value =
|
|
38
|
-
},
|
|
32
|
+
}, y = (t) => {
|
|
33
|
+
const l = new Date(e.value.setFullYear(Number(t)));
|
|
34
|
+
e.value = l, a.value = "month";
|
|
35
|
+
}, w = (t) => {
|
|
36
|
+
const l = new Date(e.value.setMonth(Number(t)));
|
|
37
|
+
e.value = l, a.value = "calendar";
|
|
38
|
+
}, N = () => {
|
|
39
39
|
a.value = "year";
|
|
40
|
-
},
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
}, k = n({
|
|
41
|
+
get: () => r.selectedValues,
|
|
42
|
+
set: (t) => o("update-selected-value", t)
|
|
43
|
+
}), p = { props: r, emit: o, modifiers: D, initialDate: e, selectedPicker: a, prevMonth: u, nextMonth: s, prevYear: c, nextYear: d, prevMonthHandler: f, nextMonthHandler: M, prevYearHandler: Y, nextYearHandler: H, changeYearHandler: _, changeMonthHandler: g, updateYearHandler: y, updateMonthHandler: w, backToYearsHandler: N, selectedValuesModel: k, updateInitialDate: (t) => {
|
|
43
44
|
e.value = t;
|
|
44
45
|
}, get NmorphCalendar() {
|
|
45
|
-
return
|
|
46
|
-
}, NmorphDatePickerHeader:
|
|
46
|
+
return C;
|
|
47
|
+
}, NmorphDatePickerHeader: F, NmorphYearMonthPicker: P };
|
|
47
48
|
return Object.defineProperty(p, "__isScriptSetup", { enumerable: !1, value: !0 }), p;
|
|
48
49
|
}
|
|
49
50
|
});
|