@nmorph/nmorph-ui-kit 2.2.34 → 2.2.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/dist/assets/icons/pin.svg.js +21 -0
  2. package/dist/components/basic/nmorph-icon/NmorphIcons.js +209 -207
  3. package/dist/components/data/nmorph-empty/NmorphEmpty.css +1 -1
  4. package/dist/components/form/nmorph-autocomplete/NmorphAutocomplete.css +1 -1
  5. package/dist/components/form/nmorph-autocomplete/NmorphAutocomplete.vue.js +20 -17
  6. package/dist/components/form/nmorph-autocomplete/NmorphAutocomplete.vue2.js +63 -54
  7. package/dist/components/form/nmorph-file-upload/NmorphFileUpload.vue.js +34 -30
  8. package/dist/components/form/nmorph-file-upload/NmorphFileUpload.vue2.js +94 -62
  9. package/dist/components/form/nmorph-select/NmorphSelect.vue2.js +52 -52
  10. package/dist/components/form/nmorph-select/components/nmorph-select-option/NmorphSelectOption.vue2.js +24 -21
  11. package/dist/components/form/nmorph-time-picker/NmorphTimePicker.css +1 -1
  12. package/dist/components/form/nmorph-time-picker/NmorphTimePicker.vue.js +40 -31
  13. package/dist/components/form/nmorph-time-picker/NmorphTimePicker.vue2.js +45 -41
  14. package/dist/components/navigation/nmorph-backtop/NmorphBacktop.vue.js +20 -25
  15. package/dist/components/navigation/nmorph-backtop/NmorphBacktop.vue2.js +25 -21
  16. package/dist/components/navigation/nmorph-context-menu/NmorphContextMenu.vue.js +11 -10
  17. package/dist/components/navigation/nmorph-context-menu/NmorphContextMenu.vue2.js +10 -9
  18. package/dist/components/navigation/nmorph-dropdown/NmorphDropdown.css +1 -1
  19. package/dist/components/navigation/nmorph-dropdown/NmorphDropdown.vue2.js +13 -12
  20. package/dist/hooks/use-common-styles.js +2 -1
  21. package/dist/icons.js +209 -207
  22. package/dist/index.es.js +331 -329
  23. package/dist/index.umd.js +31 -30
  24. package/dist/package.json.js +1 -1
  25. package/dist/src/components/basic/nmorph-icon/NmorphIcons.d.ts +1 -0
  26. package/dist/src/components/form/nmorph-file-upload/NmorphFileUpload.vue.d.ts +2 -2
  27. package/dist/src/components/form/nmorph-select/components/nmorph-select-option/NmorphSelectOption.vue.d.ts +0 -1
  28. package/dist/src/components/navigation/nmorph-context-menu/NmorphContextMenu.vue.d.ts +2 -0
  29. package/dist/src/components/navigation/nmorph-dropdown/NmorphDropdown.vue.d.ts +2 -0
  30. package/dist/style.css +1 -1
  31. package/package.json +1 -1
@@ -1,17 +1,17 @@
1
1
  import './NmorphSelect.css';
2
- import { defineComponent as ue, computed as a, ref as d, watch as f, nextTick as L, onMounted as oe, onUnmounted as ie, provide as R } from "vue";
3
- import { NmorphComponentHeight as se } from "../../../types/index.js";
4
- import { useModifiers as de } from "../../../utils/create-modifiers.js";
5
- import { useI18n as ve } from "vue-i18n";
6
- import { useFormItemInput as ce } from "../nmorph-form/use-form-item-input.js";
7
- import { useVirtualList as fe } from "../../../hooks/use-virtual-list.js";
8
- import pe from "../../navigation/nmorph-dropdown/NmorphDropdown.vue.js";
9
- import me from "./components/nmorph-select-option/NmorphSelectOption.vue.js";
10
- import he from "../../basic/nmorph-icon/NmorphIcon.vue.js";
11
- import ge from "../../data/nmorph-tag-list/components/nmorph-tag-item/NmorphTagItem.vue.js";
12
- import ye from "../../../assets/icons/chevron-down.svg.js";
13
- import He from "../../../assets/icons/loader.svg.js";
14
- const Pe = /* @__PURE__ */ ue({
2
+ import { defineComponent as ue, computed as a, ref as d, watch as f, nextTick as R, onMounted as oe, onUnmounted as ie, provide as M, toRef as se } from "vue";
3
+ import { NmorphComponentHeight as de } from "../../../types/index.js";
4
+ import { useModifiers as ve } from "../../../utils/create-modifiers.js";
5
+ import { useI18n as ce } from "vue-i18n";
6
+ import { useFormItemInput as fe } from "../nmorph-form/use-form-item-input.js";
7
+ import { useVirtualList as pe } from "../../../hooks/use-virtual-list.js";
8
+ import me from "../../navigation/nmorph-dropdown/NmorphDropdown.vue.js";
9
+ import he from "./components/nmorph-select-option/NmorphSelectOption.vue.js";
10
+ import ge from "../../basic/nmorph-icon/NmorphIcon.vue.js";
11
+ import ye from "../../data/nmorph-tag-list/components/nmorph-tag-item/NmorphTagItem.vue.js";
12
+ import He from "../../../assets/icons/chevron-down.svg.js";
13
+ import be from "../../../assets/icons/loader.svg.js";
14
+ const ke = /* @__PURE__ */ ue({
15
15
  __name: "NmorphSelect",
16
16
  props: {
17
17
  noElementPlaceholder: { type: String, required: !1, default: "" },
@@ -40,37 +40,37 @@ const Pe = /* @__PURE__ */ ue({
40
40
  emits: ["update:model-value"],
41
41
  setup(T, { expose: C, emit: P }) {
42
42
  C();
43
- const { t: M } = ve(), l = T, $ = a(
44
- () => l.noElementPlaceholder ? l.noElementPlaceholder : M("noElementPlaceholder")
45
- ), m = P, t = d(l.modelValue), r = d(l.open), v = a(() => l.disabled || l.loading), h = a(() => l.optionsWidth === "auto"), g = d(!0), { id: y, name: k, autocomplete: W, tabindex: U } = ce(l), H = (e) => {
43
+ const { t: $ } = ce(), t = T, D = a(
44
+ () => t.noElementPlaceholder ? t.noElementPlaceholder : $("noElementPlaceholder")
45
+ ), m = P, l = d(t.modelValue), r = d(t.open), v = a(() => t.disabled || t.loading), h = a(() => t.optionsWidth === "auto"), g = d(!0), { id: y, name: k, autocomplete: W, tabindex: U } = fe(t), H = (e) => {
46
46
  if (!v.value) {
47
- if (r.value = !1, typeof t.value == "string" && (!l.valueRequired && t.value === e ? t.value = "" : t.value = e, m("update:model-value", t.value)), Array.isArray(t.value)) {
48
- const n = t.value.includes(e), w = t.value.length === 1 && n;
49
- if (l.valueRequired && w) return;
50
- n ? t.value = t.value.filter((ne) => ne !== e) : t.value = [...t.value, e];
47
+ if (r.value = !1, typeof l.value == "string" && (!t.valueRequired && l.value === e ? l.value = "" : l.value = e, m("update:model-value", l.value)), Array.isArray(l.value)) {
48
+ const n = l.value.includes(e), w = l.value.length === 1 && n;
49
+ if (t.valueRequired && w) return;
50
+ n ? l.value = l.value.filter((ne) => ne !== e) : l.value = [...l.value, e];
51
51
  }
52
- m("update:model-value", t.value);
52
+ m("update:model-value", l.value);
53
53
  }
54
54
  }, p = d(!1), z = () => {
55
55
  p.value = !0;
56
56
  }, F = () => {
57
57
  p.value = !1;
58
58
  }, j = a(
59
- () => de({
60
- nmorph: [se[l.height]],
59
+ () => ve({
60
+ nmorph: [de[t.height]],
61
61
  "nmorph-select": [
62
- `${l.disabled && "disabled"}`,
63
- `${l.modelValue ? "on" : "off"}`,
64
- `${l.loading && "loading"}`,
62
+ `${t.disabled && "disabled"}`,
63
+ `${t.modelValue ? "on" : "off"}`,
64
+ `${t.loading && "loading"}`,
65
65
  `${r.value && !v.value && "open"}`,
66
- `${l.fill && "fill"}`,
66
+ `${t.fill && "fill"}`,
67
67
  `${h.value && "options-auto-width"}`,
68
68
  `${g.value ? "selected-line-outset" : "selected-line-inset"}`,
69
69
  `${p.value && "focus"}`
70
70
  ]
71
71
  })
72
72
  ), b = (e) => typeof e == "number" ? `${e}px` : e, Y = a(() => ({
73
- ...l.width !== void 0 && { "--base-width": b(l.width) }
73
+ ...t.width !== void 0 && { "--base-width": b(t.width) }
74
74
  })), G = () => {
75
75
  v.value || (r.value = !r.value);
76
76
  };
@@ -85,29 +85,29 @@ const Pe = /* @__PURE__ */ ue({
85
85
  r.value = !1;
86
86
  };
87
87
  f(
88
- () => l.loading,
88
+ () => t.loading,
89
89
  (e) => {
90
90
  e && (r.value = !1);
91
91
  }
92
92
  );
93
- const i = a(() => l.options.length > 0 ? l.options : l.optionsMap), x = d(null), I = d([]), N = a(() => l.options), c = a(() => l.virtual && N.value.length > 0), D = a(() => ({
93
+ const i = a(() => t.options.length > 0 ? t.options : t.optionsMap), x = d(null), I = d([]), N = a(() => t.options), c = a(() => t.virtual && N.value.length > 0), A = a(() => ({
94
94
  basic: 30,
95
95
  thick: 38,
96
96
  thin: 22
97
- })[l.height || "basic"]), A = a(() => l.virtualItemHeight || D.value), E = a(() => l.virtualOverscan), V = a(() => l.virtualDynamicHeight), s = fe(N, {
97
+ })[t.height || "basic"]), E = a(() => t.virtualItemHeight || A.value), V = a(() => t.virtualOverscan), _ = a(() => t.virtualDynamicHeight), s = pe(N, {
98
98
  enabled: c,
99
- itemHeight: A,
100
- overscan: E,
101
- dynamic: V
99
+ itemHeight: E,
100
+ overscan: V,
101
+ dynamic: _
102
102
  }), J = a(() => s.virtualItems.value), K = a(() => ({
103
103
  height: `${s.totalHeight.value}px`
104
104
  })), Q = a(() => ({
105
105
  transform: `translateY(${s.offsetTop.value}px)`
106
- })), X = a(() => b(l.virtualMaxHeight)), O = () => {
106
+ })), X = a(() => b(t.virtualMaxHeight)), O = () => {
107
107
  i.value.length > 0 || !x.value || (I.value = Array.from(x.value.querySelectorAll(".nmorph-select-option")).map((e) => e.getAttribute("value")).filter((e) => !!e));
108
108
  }, o = a(
109
109
  () => i.value.length > 0 ? i.value.map((e) => e.value) : I.value
110
- ), Z = a(() => c.value ? Array.isArray(t.value) ? t.value : t.value ? [t.value] : [] : o.value), u = d(0), S = a(() => o.value[u.value] || ""), ee = a(() => `${y.value}-listbox`), te = (e) => `${y.value}-option-${e.replace(/\s+/g, "-")}`;
110
+ ), Z = a(() => c.value ? Array.isArray(l.value) ? l.value : l.value ? [l.value] : [] : o.value), u = d(0), S = a(() => o.value[u.value] || ""), ee = a(() => `${y.value}-listbox`), te = (e) => `${y.value}-option-${e.replace(/\s+/g, "-")}`;
111
111
  f(u, (e) => {
112
112
  r.value && c.value && s.scrollToIndex(e);
113
113
  }), f(
@@ -118,22 +118,22 @@ const Pe = /* @__PURE__ */ ue({
118
118
  { immediate: !0 }
119
119
  ), f(r, async (e) => {
120
120
  if (e) {
121
- if (await L(), O(), typeof t.value == "string") {
122
- const n = o.value.indexOf(t.value);
121
+ if (await R(), O(), typeof l.value == "string") {
122
+ const n = o.value.indexOf(l.value);
123
123
  n !== -1 && (u.value = n);
124
124
  }
125
125
  s.refresh(), c.value && s.scrollToIndex(u.value);
126
126
  }
127
127
  }), oe(async () => {
128
- await L(), O(), document.addEventListener("click", q);
128
+ await R(), O(), document.addEventListener("click", q);
129
129
  }), ie(() => {
130
130
  document.removeEventListener("click", q);
131
131
  });
132
- const le = a(() => typeof t.value == "string" ? t.value === "" ? $.value : i.value.find((e) => e.value === t.value)?.label : i.value.find((e) => e.value === t.value)?.label), ae = a(() => i.value.length > 0 ? i.value.filter((n) => t.value.includes(n.value)).map((n) => ({ text: n.label, value: n.value })) : Array.isArray(t.value) ? t.value.map((n) => ({ text: n, value: n })) : [{ text: t.value, value: t.value }]);
133
- R("select-selected-value", t), R("select-change-selected-value", H);
134
- const _ = d(null), re = a(
135
- () => h.value ? `${_.value?.clientWidth || 0}px` : void 0
136
- ), B = { t: M, props: l, computedNoElementPlaceholder: $, emit: m, initialValue: t, open: r, disabledInput: v, autoOptionsWidth: h, selectedLineOutset: g, id: y, name: k, autocomplete: W, tabindex: U, changeHandler: H, focus: p, focusHandler: z, blurHandler: F, modifiers: j, getCssSize: b, styles: Y, clickHandler: G, closeHandler: q, optionsMap: i, optionsDOMRef: x, slotDomOptions: I, renderedOptions: N, virtualEnabled: c, defaultOptionHeight: D, virtualItemHeight: A, virtualOverscan: E, virtualDynamicHeight: V, virtualList: s, virtualOptions: J, virtualSpacerStyle: K, virtualContentStyle: Q, virtualMaxHeight: X, refreshDomOptions: O, domOptions: o, nativeOptions: Z, currentIndex: u, currentFocusedEl: S, listboxId: ee, getOptionId: te, selectedValueTitle: le, tags: ae, nmorphSelectDOMRef: _, optionsMinWidth: re, spaceHandler: () => {
132
+ const le = a(() => typeof l.value == "string" ? l.value === "" ? D.value : i.value.find((e) => e.value === l.value)?.label : i.value.find((e) => e.value === l.value)?.label), ae = a(() => i.value.length > 0 ? i.value.filter((n) => l.value.includes(n.value)).map((n) => ({ text: n.label, value: n.value })) : Array.isArray(l.value) ? l.value.map((n) => ({ text: n, value: n })) : [{ text: l.value, value: l.value }]);
133
+ M("select-selected-value", l), M("select-change-selected-value", H), M("select-height", se(t, "height"));
134
+ const B = d(null), re = a(
135
+ () => h.value ? `${B.value?.clientWidth || 0}px` : void 0
136
+ ), L = { t: $, props: t, computedNoElementPlaceholder: D, emit: m, initialValue: l, open: r, disabledInput: v, autoOptionsWidth: h, selectedLineOutset: g, id: y, name: k, autocomplete: W, tabindex: U, changeHandler: H, focus: p, focusHandler: z, blurHandler: F, modifiers: j, getCssSize: b, styles: Y, clickHandler: G, closeHandler: q, optionsMap: i, optionsDOMRef: x, slotDomOptions: I, renderedOptions: N, virtualEnabled: c, defaultOptionHeight: A, virtualItemHeight: E, virtualOverscan: V, virtualDynamicHeight: _, virtualList: s, virtualOptions: J, virtualSpacerStyle: K, virtualContentStyle: Q, virtualMaxHeight: X, refreshDomOptions: O, domOptions: o, nativeOptions: Z, currentIndex: u, currentFocusedEl: S, listboxId: ee, getOptionId: te, selectedValueTitle: le, tags: ae, nmorphSelectDOMRef: B, optionsMinWidth: re, spaceHandler: () => {
137
137
  v.value || (r.value = !r.value);
138
138
  }, arrowDownHandler: () => {
139
139
  v.value || o.value.length !== 0 && (r.value || (r.value = !0), u.value = (u.value + 1) % o.value.length);
@@ -151,21 +151,21 @@ const Pe = /* @__PURE__ */ ue({
151
151
  }, endHandler: () => {
152
152
  u.value = Math.max(o.value.length - 1, 0);
153
153
  }, get NmorphTagItem() {
154
- return ge;
154
+ return ye;
155
155
  }, get NmorphIcon() {
156
- return he;
156
+ return ge;
157
157
  }, get NmorphSelectOption() {
158
- return me;
158
+ return he;
159
159
  }, get NmorphDropdown() {
160
- return pe;
160
+ return me;
161
161
  }, get NmorphIconLoader() {
162
- return He;
162
+ return be;
163
163
  }, get NmorphIconChevronDown() {
164
- return ye;
164
+ return He;
165
165
  } };
166
- return Object.defineProperty(B, "__isScriptSetup", { enumerable: !1, value: !0 }), B;
166
+ return Object.defineProperty(L, "__isScriptSetup", { enumerable: !1, value: !0 }), L;
167
167
  }
168
168
  });
169
169
  export {
170
- Pe as default
170
+ ke as default
171
171
  };
@@ -1,10 +1,10 @@
1
1
  import './NmorphSelectOption.css';
2
- import { defineComponent as h, inject as i, computed as o } from "vue";
3
- import { NmorphComponentHeight as v } from "../../../../../types/index.js";
4
- import { useModifiers as g } from "../../../../../utils/create-modifiers.js";
5
- import y from "../../../../basic/nmorph-icon/NmorphIcon.vue.js";
6
- import S from "../../../../../assets/icons/success.svg.js";
7
- const C = /* @__PURE__ */ h({
2
+ import { defineComponent as g, inject as l, computed as t } from "vue";
3
+ import { NmorphComponentHeight as y } from "../../../../../types/index.js";
4
+ import { useModifiers as S } from "../../../../../utils/create-modifiers.js";
5
+ import b from "../../../../basic/nmorph-icon/NmorphIcon.vue.js";
6
+ import q from "../../../../../assets/icons/success.svg.js";
7
+ const I = /* @__PURE__ */ g({
8
8
  __name: "NmorphSelectOption",
9
9
  props: {
10
10
  value: { type: String, required: !0 },
@@ -15,36 +15,39 @@ const C = /* @__PURE__ */ h({
15
15
  id: { type: String, required: !1 },
16
16
  name: { type: String, required: !1 },
17
17
  autocomplete: { type: String, required: !1 },
18
- height: { type: null, required: !1, default: "basic" },
18
+ height: { type: null, required: !1 },
19
19
  disabled: { type: Boolean, required: !1, default: !1 },
20
20
  tabindex: { type: Number, required: !1 }
21
21
  },
22
22
  emits: ["change-value"],
23
- setup(n, { expose: s, emit: c }) {
24
- s();
25
- const r = i("select-selected-value"), t = i("select-change-selected-value"), e = n, l = c, d = () => {
26
- e.disabled || (l("change-value", e.value), t && t(e.value));
27
- }, a = o(() => typeof r?.value == "string" ? r.value === e.value : Array.isArray(r?.value) ? r.value.some((m) => m === e.value) : !1), p = o(
28
- () => g({
29
- nmorph: [v[e.height]],
23
+ setup(c, { expose: d, emit: p }) {
24
+ d();
25
+ const r = l("select-selected-value"), o = l("select-change-selected-value"), a = l(
26
+ "select-height",
27
+ void 0
28
+ ), e = c, i = p, f = () => {
29
+ e.disabled || (i("change-value", e.value), o && o(e.value));
30
+ }, u = t(() => typeof r?.value == "string" ? r.value === e.value : Array.isArray(r?.value) ? r.value.some((v) => v === e.value) : !1), s = t(() => e.height || a?.value || "basic"), h = t(
31
+ () => S({
32
+ nmorph: [y[s.value]],
30
33
  "nmorph-select-option": [
31
34
  `${e.disabled && "disabled"}`,
32
35
  `${e.label && "with-label"}`,
33
- `${a.value && "checked"}`,
36
+ `${u.value && "checked"}`,
34
37
  `${e.focused && "focused"}`
35
38
  ]
36
39
  })
37
- ), f = o(() => ({
40
+ ), m = t(() => ({
38
41
  ...e.hoverBackground !== void 0 && { "--hover-bg": e.hoverBackground },
39
42
  ...e.hoverColor !== void 0 && { "--hover-color": e.hoverColor }
40
- })), u = { selectSelectedValue: r, selectChangeSelectedValue: t, props: e, emit: l, clickHandler: d, checked: a, modifiers: p, styles: f, get NmorphIcon() {
41
- return y;
43
+ })), n = { selectSelectedValue: r, selectChangeSelectedValue: o, selectHeight: a, props: e, emit: i, clickHandler: f, checked: u, height: s, modifiers: h, styles: m, get NmorphIcon() {
44
+ return b;
42
45
  }, get NmorphIconSuccess() {
43
- return S;
46
+ return q;
44
47
  } };
45
- return Object.defineProperty(u, "__isScriptSetup", { enumerable: !1, value: !0 }), u;
48
+ return Object.defineProperty(n, "__isScriptSetup", { enumerable: !1, value: !0 }), n;
46
49
  }
47
50
  });
48
51
  export {
49
- C as default
52
+ I as default
50
53
  };
@@ -1 +1 @@
1
- .nmorph-time-picker{--width: 160px;position:relative;width:var(--width);height:var(--height)}.nmorph-time-picker .nmorph-time-picker__input{display:flex;align-items:center;height:100%;padding:0 var(--default-indentation-input);overflow:hidden;background:var(--nmorph-main-color);border-radius:var(--default-border-radius);box-shadow:var(--nmorph-shadow-outset);cursor:pointer}.nmorph-time-picker .nmorph-time-picker__native{position:absolute;width:0;height:0;padding:0;border:0;opacity:0;pointer-events:none}.nmorph-time-picker .nmorph-time-picker__clock-icon{flex:0 0 auto;margin-right:6px}.nmorph-time-picker .nmorph-time-picker__selected-value{flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.nmorph-time-picker .nmorph-time-picker__clear{display:inline-flex;flex:0 0 auto;justify-content:center;align-items:center;width:18px;height:18px;padding:0;color:var(--nmorph-text-color);background:transparent;border:0;cursor:pointer}.nmorph-time-picker .nmorph-time-picker__panel{display:grid;grid-template-columns:minmax(48px,1fr) auto minmax(48px,1fr);gap:4px;padding:8px}.nmorph-time-picker .nmorph-time-picker__panel--with-seconds{grid-template-columns:minmax(48px,1fr) auto minmax(48px,1fr) auto minmax(48px,1fr)}.nmorph-time-picker .nmorph-time-picker__column{display:grid;max-height:220px;overflow-y:auto}.nmorph-time-picker .nmorph-time-picker__separator{display:flex;justify-content:center;align-items:center;color:var(--nmorph-semi-contrast-text-color);font-weight:700}.nmorph-time-picker .nmorph-time-picker__option{min-height:28px;padding:0 8px;color:var(--nmorph-text-color);background:transparent;border:0;border-radius:4px;cursor:pointer}.nmorph-time-picker .nmorph-time-picker__option:hover,.nmorph-time-picker .nmorph-time-picker__option--active{color:var(--nmorph-focus-text-color);background:var(--nmorph-accent-color)}.nmorph-time-picker .nmorph-time-picker__option:disabled{cursor:not-allowed;opacity:.35}.nmorph-time-picker.nmorph-time-picker--open .nmorph-time-picker__input{box-shadow:var(--nmorph-shadow-inset)}.nmorph-time-picker.nmorph-time-picker--focus{outline:2px solid var(--nmorph-accent-color)}.nmorph-time-picker.nmorph-time-picker--placeholder .nmorph-time-picker__selected-value{color:var(--nmorph-placeholder-text-color)}.nmorph-time-picker.nmorph-time-picker--disabled{cursor:not-allowed;opacity:.6}.nmorph-time-picker.nmorph-time-picker--disabled .nmorph-time-picker__input{pointer-events:none}
1
+ .nmorph-time-picker{--width: 160px;position:relative;width:var(--width);height:var(--height)}.nmorph-time-picker .nmorph-time-picker__input{display:flex;align-items:center;height:100%;padding:0 var(--default-indentation-input);overflow:hidden;background:var(--nmorph-main-color);border-radius:var(--default-border-radius);box-shadow:var(--nmorph-shadow-outset);cursor:pointer}.nmorph-time-picker .nmorph-time-picker__native{position:absolute;width:0;height:0;padding:0;border:0;opacity:0;pointer-events:none}.nmorph-time-picker .nmorph-time-picker__clock-icon{flex:0 0 auto;margin-right:6px}.nmorph-time-picker .nmorph-time-picker__selected-value{flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.nmorph-time-picker .nmorph-time-picker__clear{display:inline-flex;flex:0 0 auto;justify-content:center;align-items:center;width:18px;height:18px;padding:0;color:var(--nmorph-text-color);background:transparent;border:0;cursor:pointer}.nmorph-time-picker .nmorph-time-picker__panel{display:grid;grid-template-columns:minmax(48px,1fr) auto minmax(48px,1fr);gap:4px;padding:8px}.nmorph-time-picker .nmorph-time-picker__panel--with-seconds{grid-template-columns:minmax(48px,1fr) auto minmax(48px,1fr) auto minmax(48px,1fr)}.nmorph-time-picker .nmorph-time-picker__column{display:grid;max-height:220px;overflow-y:auto}.nmorph-time-picker .nmorph-time-picker__separator{display:flex;justify-content:center;align-items:center;color:var(--nmorph-semi-contrast-text-color);font-weight:700}.nmorph-time-picker .nmorph-time-picker__option{padding:0 8px;color:var(--nmorph-text-color);background:transparent;border:0;border-radius:4px;cursor:pointer}.nmorph-time-picker .nmorph-time-picker__option:hover,.nmorph-time-picker .nmorph-time-picker__option--active{color:var(--nmorph-focus-text-color);background:var(--nmorph-accent-color)}.nmorph-time-picker .nmorph-time-picker__option:disabled{cursor:not-allowed;opacity:.35}.nmorph-time-picker.nmorph-time-picker--open .nmorph-time-picker__input{box-shadow:var(--nmorph-shadow-inset)}.nmorph-time-picker.nmorph-time-picker--focus{outline:2px solid var(--nmorph-accent-color)}.nmorph-time-picker.nmorph-time-picker--placeholder .nmorph-time-picker__selected-value{color:var(--nmorph-placeholder-text-color)}.nmorph-time-picker.nmorph-time-picker--disabled{cursor:not-allowed;opacity:.6}.nmorph-time-picker.nmorph-time-picker--disabled .nmorph-time-picker__input{pointer-events:none}
@@ -1,30 +1,30 @@
1
1
  import './NmorphTimePicker.css';
2
2
  import b from "./NmorphTimePicker.vue2.js";
3
- import { openBlock as i, createElementBlock as n, normalizeStyle as v, normalizeClass as r, createElementVNode as l, withKeys as m, withModifiers as t, createVNode as c, withCtx as p, toDisplayString as d, createCommentVNode as _, createBlock as u, Fragment as s, renderList as h } from "vue";
3
+ import { openBlock as i, createElementBlock as n, normalizeStyle as v, normalizeClass as l, createElementVNode as r, withKeys as m, withModifiers as t, createVNode as d, withCtx as p, toDisplayString as c, createCommentVNode as _, createBlock as f, Fragment as s, renderList as h } from "vue";
4
4
  /* empty css */
5
- import f from "../../../_virtual/_plugin-vue_export-helper.js";
6
- const y = ["aria-expanded", "aria-controls", "tabindex", "onKeydown"], w = ["id", "name", "autocomplete", "step", "value", "disabled"], x = { class: "nmorph-time-picker__selected-value" }, C = ["id"], O = {
5
+ import u from "../../../_virtual/_plugin-vue_export-helper.js";
6
+ const y = ["aria-expanded", "aria-controls", "tabindex", "onKeydown"], w = ["id", "name", "autocomplete", "step", "value", "disabled"], x = { class: "nmorph-time-picker__selected-value" }, C = ["id"], g = {
7
7
  class: "nmorph-time-picker__column",
8
8
  role: "listbox",
9
9
  "aria-label": "Hours"
10
- }, N = ["disabled", "onClick"], g = {
10
+ }, O = ["disabled", "onClick"], H = {
11
11
  class: "nmorph-time-picker__column",
12
12
  role: "listbox",
13
13
  "aria-label": "Minutes"
14
- }, H = ["disabled", "onClick"], V = {
14
+ }, N = ["disabled", "onClick"], M = {
15
15
  class: "nmorph-time-picker__column",
16
16
  role: "listbox",
17
17
  "aria-label": "Seconds"
18
- }, I = ["disabled", "onClick"];
19
- function S(z, a, B, e, D, M) {
18
+ }, V = ["disabled", "onClick"];
19
+ function I(S, a, z, e, B, D) {
20
20
  return i(), n(
21
21
  "div",
22
22
  {
23
- class: r(e.modifiers),
23
+ class: l(e.modifiers),
24
24
  style: v(e.styles)
25
25
  },
26
26
  [
27
- l("div", {
27
+ r("div", {
28
28
  ref: "inputDOMRef",
29
29
  class: "nmorph-time-picker__input",
30
30
  role: "combobox",
@@ -40,7 +40,7 @@ function S(z, a, B, e, D, M) {
40
40
  m(t(e.closeHandler, ["prevent"]), ["escape"])
41
41
  ]
42
42
  }, [
43
- l("input", {
43
+ r("input", {
44
44
  id: e.id,
45
45
  class: "nmorph-time-picker__native",
46
46
  name: e.name,
@@ -51,17 +51,17 @@ function S(z, a, B, e, D, M) {
51
51
  disabled: e.props.disabled,
52
52
  onInput: e.nativeInputHandler
53
53
  }, null, 40, w),
54
- c(e.NmorphIcon, { class: "nmorph-time-picker__clock-icon" }, {
54
+ d(e.NmorphIcon, { class: "nmorph-time-picker__clock-icon" }, {
55
55
  default: p(() => [
56
- c(e.NmorphIconClock)
56
+ d(e.NmorphIconClock)
57
57
  ]),
58
58
  _: 1
59
59
  /* STABLE */
60
60
  }),
61
- l(
61
+ r(
62
62
  "div",
63
63
  x,
64
- d(e.displayValue),
64
+ c(e.displayValue),
65
65
  1
66
66
  /* TEXT */
67
67
  ),
@@ -72,19 +72,19 @@ function S(z, a, B, e, D, M) {
72
72
  "aria-label": "Clear time",
73
73
  onClick: t(e.clearHandler, ["stop"])
74
74
  }, [
75
- c(e.NmorphIcon, {
75
+ d(e.NmorphIcon, {
76
76
  width: "14px",
77
77
  height: "14px"
78
78
  }, {
79
79
  default: p(() => [
80
- c(e.NmorphIconCircleClose)
80
+ d(e.NmorphIconCircleClose)
81
81
  ]),
82
82
  _: 1
83
83
  /* STABLE */
84
84
  })
85
85
  ])) : _("v-if", !0)
86
86
  ], 40, y),
87
- e.inputDOMRef && !e.props.disabled ? (i(), u(e.NmorphDropdown, {
87
+ e.inputDOMRef && !e.props.disabled ? (i(), f(e.NmorphDropdown, {
88
88
  key: 0,
89
89
  open: e.open,
90
90
  "relative-element": e.inputDOMRef,
@@ -96,43 +96,49 @@ function S(z, a, B, e, D, M) {
96
96
  onOnEscapeKeydown: e.closeHandler
97
97
  }, {
98
98
  default: p(() => [
99
- l("div", {
99
+ r("div", {
100
100
  id: `${e.id}-dropdown`,
101
- class: r(["nmorph-time-picker__panel", { "nmorph-time-picker__panel--with-seconds": e.props.showSeconds }])
101
+ class: l(["nmorph-time-picker__panel", { "nmorph-time-picker__panel--with-seconds": e.props.showSeconds }])
102
102
  }, [
103
- l("div", O, [
103
+ r("div", g, [
104
104
  (i(!0), n(
105
105
  s,
106
106
  null,
107
107
  h(e.hourOptions, (o) => (i(), n("button", {
108
108
  key: o.value,
109
109
  type: "button",
110
- class: r(["nmorph-time-picker__option", { "nmorph-time-picker__option--active": o.value === e.pickerValue.hour }]),
110
+ class: l(["nmorph-time-picker__option", [
111
+ e.optionHeightModifiers,
112
+ { "nmorph-time-picker__option--active": o.value === e.pickerValue.hour }
113
+ ]]),
111
114
  disabled: o.disabled,
112
115
  onClick: (k) => e.selectUnit("hour", o.value)
113
- }, d(o.label), 11, N))),
116
+ }, c(o.label), 11, O))),
114
117
  128
115
118
  /* KEYED_FRAGMENT */
116
119
  ))
117
120
  ]),
118
- a[1] || (a[1] = l(
121
+ a[1] || (a[1] = r(
119
122
  "div",
120
123
  { class: "nmorph-time-picker__separator" },
121
124
  ":",
122
125
  -1
123
126
  /* CACHED */
124
127
  )),
125
- l("div", g, [
128
+ r("div", H, [
126
129
  (i(!0), n(
127
130
  s,
128
131
  null,
129
132
  h(e.minuteOptions, (o) => (i(), n("button", {
130
133
  key: o.value,
131
134
  type: "button",
132
- class: r(["nmorph-time-picker__option", { "nmorph-time-picker__option--active": o.value === e.pickerValue.minute }]),
135
+ class: l(["nmorph-time-picker__option", [
136
+ e.optionHeightModifiers,
137
+ { "nmorph-time-picker__option--active": o.value === e.pickerValue.minute }
138
+ ]]),
133
139
  disabled: o.disabled,
134
140
  onClick: (k) => e.selectUnit("minute", o.value)
135
- }, d(o.label), 11, H))),
141
+ }, c(o.label), 11, N))),
136
142
  128
137
143
  /* KEYED_FRAGMENT */
138
144
  ))
@@ -141,24 +147,27 @@ function S(z, a, B, e, D, M) {
141
147
  s,
142
148
  { key: 0 },
143
149
  [
144
- a[0] || (a[0] = l(
150
+ a[0] || (a[0] = r(
145
151
  "div",
146
152
  { class: "nmorph-time-picker__separator" },
147
153
  ":",
148
154
  -1
149
155
  /* CACHED */
150
156
  )),
151
- l("div", V, [
157
+ r("div", M, [
152
158
  (i(!0), n(
153
159
  s,
154
160
  null,
155
161
  h(e.secondOptions, (o) => (i(), n("button", {
156
162
  key: o.value,
157
163
  type: "button",
158
- class: r(["nmorph-time-picker__option", { "nmorph-time-picker__option--active": o.value === e.pickerValue.second }]),
164
+ class: l(["nmorph-time-picker__option", [
165
+ e.optionHeightModifiers,
166
+ { "nmorph-time-picker__option--active": o.value === e.pickerValue.second }
167
+ ]]),
159
168
  disabled: o.disabled,
160
169
  onClick: (k) => e.selectUnit("second", o.value)
161
- }, d(o.label), 11, I))),
170
+ }, c(o.label), 11, V))),
162
171
  128
163
172
  /* KEYED_FRAGMENT */
164
173
  ))
@@ -177,7 +186,7 @@ function S(z, a, B, e, D, M) {
177
186
  /* CLASS, STYLE */
178
187
  );
179
188
  }
180
- const F = /* @__PURE__ */ f(b, [["render", S], ["__file", "/builds/ketjo/nmorph/library/src/components/form/nmorph-time-picker/NmorphTimePicker.vue"]]);
189
+ const F = /* @__PURE__ */ u(b, [["render", I], ["__file", "/builds/ketjo/nmorph/library/src/components/form/nmorph-time-picker/NmorphTimePicker.vue"]]);
181
190
  export {
182
191
  F as default
183
192
  };
@@ -1,14 +1,14 @@
1
1
  import './NmorphTimePicker.css';
2
- import { defineComponent as X, ref as v, computed as l, watch as Y } from "vue";
3
- import { NmorphComponentHeight as Z } from "../../../types/index.js";
4
- import { useI18n as ee } from "vue-i18n";
5
- import { useModifiers as te } from "../../../utils/create-modifiers.js";
6
- import { useFormItemInput as oe } from "../nmorph-form/use-form-item-input.js";
7
- import re from "../../../assets/icons/clock.svg.js";
8
- import ne from "../../../assets/icons/circle-close.svg.js";
9
- import le from "../../basic/nmorph-icon/NmorphIcon.vue.js";
10
- import ue from "../../navigation/nmorph-dropdown/NmorphDropdown.vue.js";
11
- const be = /* @__PURE__ */ X({
2
+ import { defineComponent as ee, ref as g, computed as n, watch as te } from "vue";
3
+ import { NmorphComponentHeight as _ } from "../../../types/index.js";
4
+ import { useI18n as oe } from "vue-i18n";
5
+ import { useModifiers as $ } from "../../../utils/create-modifiers.js";
6
+ import { useFormItemInput as re } from "../nmorph-form/use-form-item-input.js";
7
+ import ne from "../../../assets/icons/clock.svg.js";
8
+ import le from "../../../assets/icons/circle-close.svg.js";
9
+ import ue from "../../basic/nmorph-icon/NmorphIcon.vue.js";
10
+ import se from "../../navigation/nmorph-dropdown/NmorphDropdown.vue.js";
11
+ const Se = /* @__PURE__ */ ee({
12
12
  __name: "NmorphTimePicker",
13
13
  props: {
14
14
  modelValue: { type: [String, null], required: !1, default: null },
@@ -30,18 +30,18 @@ const be = /* @__PURE__ */ X({
30
30
  tabindex: { type: Number, required: !1 }
31
31
  },
32
32
  emits: ["update:model-value", "focus", "blur"],
33
- setup(_, { expose: $, emit: O }) {
34
- const t = _, s = O, { t: T } = ee(), { id: k, name: H, autocomplete: B, tabindex: P } = oe(t), a = v(!1), c = v(!1), w = v(null), m = (e) => String(e).padStart(2, "0"), p = (e) => Math.max(1, Math.floor(Number.isFinite(e) ? e : 1)), i = (e) => {
33
+ setup(O, { expose: H, emit: k }) {
34
+ const t = O, s = k, { t: T } = oe(), { id: B, name: M, autocomplete: P, tabindex: z } = re(t), a = g(!1), c = g(!1), w = g(null), m = (e) => String(e).padStart(2, "0"), p = (e) => Math.max(1, Math.floor(Number.isFinite(e) ? e : 1)), i = (e) => {
35
35
  if (!e) return null;
36
36
  const o = e.match(/^(\d{1,2}):(\d{2})(?::(\d{2}))?$/);
37
37
  if (!o) return null;
38
38
  const r = Number(o[1]), S = Number(o[2]), d = Number(o[3] || 0);
39
39
  return r > 23 || S > 59 || d > 59 ? null : { hour: r, minute: S, second: d };
40
- }, g = (e) => {
40
+ }, v = (e) => {
41
41
  const o = `${m(e.hour)}:${m(e.minute)}`;
42
42
  return t.showSeconds ? `${o}:${m(e.second)}` : o;
43
- }, f = (e) => e.hour * 3600 + e.minute * 60 + e.second, y = l(() => i(t.minTime)), N = l(() => i(t.maxTime)), x = l(() => i(t.modelValue)), u = v(x.value || { hour: 0, minute: 0, second: 0 }), V = l(() => t.placeholder || T("pickATime"));
44
- Y(
43
+ }, f = (e) => e.hour * 3600 + e.minute * 60 + e.second, y = n(() => i(t.minTime)), N = n(() => i(t.maxTime)), x = n(() => i(t.modelValue)), u = g(x.value || { hour: 0, minute: 0, second: 0 }), V = n(() => t.placeholder || T("pickATime"));
44
+ te(
45
45
  () => t.modelValue,
46
46
  (e) => {
47
47
  const o = i(e);
@@ -53,36 +53,36 @@ const be = /* @__PURE__ */ X({
53
53
  return !!(y.value && o < f(y.value) || N.value && o > f(N.value));
54
54
  }, b = (e, o, r) => {
55
55
  const S = p(r), d = /* @__PURE__ */ new Set();
56
- for (let n = 0; n <= o; n += S) d.add(n);
57
- return d.add(u.value[e]), Array.from(d).filter((n) => n >= 0 && n <= o).sort((n, q) => n - q).map((n) => {
58
- const q = { ...u.value, [e]: n };
56
+ for (let l = 0; l <= o; l += S) d.add(l);
57
+ return d.add(u.value[e]), Array.from(d).filter((l) => l >= 0 && l <= o).sort((l, q) => l - q).map((l) => {
58
+ const q = { ...u.value, [e]: l };
59
59
  return {
60
- label: m(n),
61
- value: n,
60
+ label: m(l),
61
+ value: l,
62
62
  disabled: h(q)
63
63
  };
64
64
  });
65
- }, z = l(() => b("hour", 23, t.hourStep)), M = l(() => b("minute", 59, t.minuteStep)), D = l(() => b("second", 59, t.secondStep)), A = (e, o) => {
65
+ }, D = n(() => b("hour", 23, t.hourStep)), A = n(() => b("minute", 59, t.minuteStep)), F = n(() => b("second", 59, t.secondStep)), R = (e, o) => {
66
66
  const r = { ...u.value, [e]: o };
67
- h(r) || (u.value = r, s("update:model-value", g(r)));
68
- }, F = () => {
67
+ h(r) || (u.value = r, s("update:model-value", v(r)));
68
+ }, U = () => {
69
69
  s("update:model-value", null), a.value = !1;
70
- }, R = () => {
70
+ }, j = () => {
71
71
  a.value = !1;
72
- }, U = () => {
72
+ }, E = () => {
73
73
  t.disabled || (a.value = !a.value);
74
- }, j = () => {
74
+ }, G = () => {
75
75
  c.value = !0, s("focus");
76
- }, E = () => {
76
+ }, J = () => {
77
77
  c.value = !1, s("blur");
78
- }, G = (e) => {
78
+ }, K = (e) => {
79
79
  const o = e.target, r = i(o.value);
80
- !r || h(r) || (u.value = r, s("update:model-value", g(r)));
81
- }, J = l(() => t.modelValue || V.value), K = l(
80
+ !r || h(r) || (u.value = r, s("update:model-value", v(r)));
81
+ }, L = n(() => t.modelValue || V.value), Q = n(
82
82
  () => t.showSeconds ? p(t.secondStep) : p(t.minuteStep) * 60
83
- ), L = l(() => t.clearable && !!t.modelValue && !t.disabled), Q = l(
84
- () => te({
85
- nmorph: [Z[t.height]],
83
+ ), W = n(() => t.clearable && !!t.modelValue && !t.disabled), X = n(
84
+ () => $({
85
+ nmorph: [_[t.height]],
86
86
  "nmorph-time-picker": [
87
87
  `${t.disabled && "disabled"}`,
88
88
  `${a.value && "open"}`,
@@ -90,22 +90,26 @@ const be = /* @__PURE__ */ X({
90
90
  `${!t.modelValue && "placeholder"}`
91
91
  ]
92
92
  })
93
- ), I = (e) => typeof e == "number" ? `${e}px` : e, W = l(() => ({
93
+ ), Y = n(
94
+ () => $({
95
+ nmorph: [_[t.height]]
96
+ })
97
+ ), I = (e) => typeof e == "number" ? `${e}px` : e, Z = n(() => ({
94
98
  ...t.width !== void 0 && { "--width": I(t.width) }
95
99
  }));
96
- $({ inputDOMRef: w });
97
- const C = { props: t, emit: s, t: T, id: k, name: H, autocomplete: B, tabindex: P, open: a, focused: c, inputDOMRef: w, pad: m, normalizeStep: p, parseTime: i, formatTime: g, timeToSeconds: f, minTimeParts: y, maxTimeParts: N, modelTimeParts: x, pickerValue: u, placeholderText: V, isOutsideRange: h, getUnitOptions: b, hourOptions: z, minuteOptions: M, secondOptions: D, selectUnit: A, clearHandler: F, closeHandler: R, toggleOpen: U, focusHandler: j, blurHandler: E, nativeInputHandler: G, displayValue: J, inputStep: K, showClearButton: L, modifiers: Q, getCssSize: I, styles: W, get NmorphDropdown() {
98
- return ue;
100
+ H({ inputDOMRef: w });
101
+ const C = { props: t, emit: s, t: T, id: B, name: M, autocomplete: P, tabindex: z, open: a, focused: c, inputDOMRef: w, pad: m, normalizeStep: p, parseTime: i, formatTime: v, timeToSeconds: f, minTimeParts: y, maxTimeParts: N, modelTimeParts: x, pickerValue: u, placeholderText: V, isOutsideRange: h, getUnitOptions: b, hourOptions: D, minuteOptions: A, secondOptions: F, selectUnit: R, clearHandler: U, closeHandler: j, toggleOpen: E, focusHandler: G, blurHandler: J, nativeInputHandler: K, displayValue: L, inputStep: Q, showClearButton: W, modifiers: X, optionHeightModifiers: Y, getCssSize: I, styles: Z, get NmorphDropdown() {
102
+ return se;
99
103
  }, get NmorphIcon() {
100
- return le;
104
+ return ue;
101
105
  }, get NmorphIconCircleClose() {
102
- return ne;
106
+ return le;
103
107
  }, get NmorphIconClock() {
104
- return re;
108
+ return ne;
105
109
  } };
106
110
  return Object.defineProperty(C, "__isScriptSetup", { enumerable: !1, value: !0 }), C;
107
111
  }
108
112
  });
109
113
  export {
110
- be as default
114
+ Se as default
111
115
  };