@nmorph/nmorph-ui-kit 2.2.35 → 2.2.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/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/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 +13 -13
- package/dist/components/basic/nmorph-icon/NmorphIcon.vue2.js +3 -3
- package/dist/components/basic/nmorph-icon/NmorphIcons.js +617 -529
- 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 +29 -0
- 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.css +1 -0
- package/dist/components/basic/nmorph-space/NmorphSpace.vue.js +21 -0
- package/dist/components/basic/nmorph-space/NmorphSpace.vue2.js +41 -0
- package/dist/components/data/nmorph-avatar/NmorphAvatar.css +1 -1
- package/dist/components/data/nmorph-avatar/NmorphAvatar.vue.js +15 -15
- package/dist/components/data/nmorph-avatar/NmorphAvatar.vue2.js +6 -6
- package/dist/components/data/nmorph-badge/NmorphBadge.vue2.js +37 -36
- package/dist/components/data/nmorph-calendar/NmorphCalendar.vue2.js +41 -40
- package/dist/components/data/nmorph-card/NmorphCard.vue2.js +15 -14
- package/dist/components/data/nmorph-collapse/components/nmorph-collapse-item/NmorphCollapseItem.vue2.js +5 -9
- package/dist/components/data/nmorph-empty/NmorphEmpty.vue.js +3 -3
- package/dist/components/data/nmorph-empty/NmorphEmpty.vue2.js +17 -14
- package/dist/components/data/nmorph-image/NmorphImage.css +1 -0
- package/dist/components/data/nmorph-image/NmorphImage.vue.js +14 -12
- package/dist/components/data/nmorph-image/NmorphImage.vue2.js +3 -2
- package/dist/components/data/nmorph-image-preview/NmorphImagePreview.vue2.js +36 -35
- package/dist/components/data/nmorph-pagination/NmorphPagination.vue.js +31 -31
- package/dist/components/data/nmorph-pagination/NmorphPagination.vue2.js +36 -38
- package/dist/components/data/nmorph-progress/NmorphProgress.vue2.js +19 -18
- 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 +51 -0
- package/dist/components/data/nmorph-qr-code/qr-code.js +568 -0
- 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.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 +61 -0
- 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.css +1 -0
- package/dist/components/feedback/nmorph-drawer/NmorphDrawer.vue.js +81 -0
- package/dist/components/feedback/nmorph-drawer/NmorphDrawer.vue2.js +48 -0
- package/dist/components/feedback/nmorph-tooltip/NmorphTooltip.vue2.js +26 -25
- package/dist/components/form/nmorph-autocomplete/NmorphAutocomplete.vue.js +30 -30
- package/dist/components/form/nmorph-autocomplete/NmorphAutocomplete.vue2.js +59 -64
- package/dist/components/form/nmorph-checkbox/NmorphCheckbox.vue2.js +5 -5
- package/dist/components/form/nmorph-color-picker/NmorphColorPicker.vue2.js +5 -5
- package/dist/components/form/nmorph-date-picker/NmorphDatePicker.vue2.js +20 -19
- package/dist/components/form/nmorph-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.vue2.js +7 -7
- package/dist/components/form/nmorph-form/components/nmorph-form-item/NmorphFormItem.vue2.js +2 -2
- package/dist/components/form/nmorph-form/components/nmorph-form-item/inner-components/nmorph-error-box/NmorphErrorBox.vue2.js +1 -1
- package/dist/components/form/nmorph-number-input/NmorphNumberInput.vue2.js +3 -6
- package/dist/components/form/nmorph-otp-input/NmorphOTPInput.vue.js +21 -21
- package/dist/components/form/nmorph-otp-input/NmorphOTPInput.vue2.js +92 -84
- package/dist/components/form/nmorph-radio/NmorphRadio.vue2.js +1 -1
- package/dist/components/form/nmorph-select/NmorphSelect.vue.js +5 -5
- package/dist/components/form/nmorph-select/NmorphSelect.vue2.js +66 -74
- package/dist/components/form/nmorph-select/components/nmorph-select-option/NmorphSelectOption.vue2.js +4 -4
- package/dist/components/form/nmorph-select-button/NmorphSelectButton.vue2.js +18 -17
- package/dist/components/form/nmorph-select-button/components/nmorph-select-button-item/NmorphSelectButtonItem.vue2.js +1 -1
- package/dist/components/form/nmorph-slider/NmorphSlider.vue2.js +25 -24
- package/dist/components/form/nmorph-switch/NmorphSwitch.vue.js +1 -1
- package/dist/components/form/nmorph-switch/NmorphSwitch.vue2.js +22 -21
- package/dist/components/form/nmorph-text-input/NmorphTextInput.css +1 -0
- package/dist/components/form/nmorph-text-input/NmorphTextInput.vue.js +4 -2
- package/dist/components/form/nmorph-text-input/NmorphTextInput.vue2.js +17 -19
- package/dist/components/form/nmorph-textarea/NmorphTextarea.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.vue2.js +43 -42
- package/dist/components/navigation/nmorph-backtop/NmorphBacktop.vue2.js +38 -28
- package/dist/components/navigation/nmorph-dropdown/NmorphDropdown.vue2.js +32 -31
- package/dist/components/navigation/nmorph-tabs/NmorphTabs.vue2.js +1 -1
- package/dist/components/others/nmorph-overlay/NmorphOverlay.vue2.js +1 -1
- package/dist/hooks/use-common-styles.js +18 -278
- package/dist/hooks/use-virtual-list.js +38 -32
- package/dist/icons.js +621 -533
- package/dist/index.es.js +780 -678
- package/dist/index.umd.js +25 -285
- package/dist/package.json.js +1 -1
- package/dist/src/components/basic/index.d.ts +2 -0
- package/dist/src/components/basic/nmorph-button/NmorphButton.vue.d.ts +1 -1
- package/dist/src/components/basic/nmorph-icon/NmorphIcons.d.ts +48 -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-collapse/components/nmorph-collapse-item/NmorphCollapseItem.vue.d.ts +1 -1
- package/dist/src/components/data/nmorph-pagination/NmorphPagination.vue.d.ts +1 -1
- package/dist/src/components/data/nmorph-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-tag-list/components/nmorph-tag-item/NmorphTagItem.vue.d.ts +1 -1
- 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-dialog/NmorphDialog.vue.d.ts +4 -4
- 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-autocomplete/NmorphAutocomplete.vue.d.ts +1 -1
- package/dist/src/components/form/nmorph-checkbox-group/NmorphCheckboxGroup.vue.d.ts +2 -2
- package/dist/src/components/form/nmorph-color-picker/NmorphColorPicker.vue.d.ts +1 -1
- package/dist/src/components/form/nmorph-date-picker/NmorphDatePicker.vue.d.ts +1 -1
- package/dist/src/components/form/nmorph-date-picker/inner-components/nmorph-date-picker-content/NmorphDatePickerContent.vue.d.ts +2 -2
- package/dist/src/components/form/nmorph-form/components/nmorph-form-item/NmorphFormItem.vue.d.ts +1 -1
- package/dist/src/components/form/nmorph-form/components/nmorph-form-item/inner-components/nmorph-error-box/NmorphErrorBox.vue.d.ts +1 -1
- package/dist/src/components/form/nmorph-number-input/NmorphNumberInput.vue.d.ts +1 -1
- package/dist/src/components/form/nmorph-otp-input/NmorphOTPInput.vue.d.ts +1 -1
- package/dist/src/components/form/nmorph-radio-group/NmorphRadioGroup.vue.d.ts +2 -2
- 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 +48 -0
- package/dist/src/components/form/nmorph-time-picker/NmorphTimePicker.vue.d.ts +1 -1
- 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 +1 -1
- package/dist/src/components/navigation/nmorph-dropdown/NmorphDropdown.vue.d.ts +1 -1
- package/dist/src/hooks/use-virtual-list.d.ts +6 -0
- package/dist/src/types/index.d.ts +2 -1
- package/dist/src/utils/common.d.ts +5 -0
- package/dist/src/utils/create-modifiers.d.ts +4 -2
- package/dist/style.css +1 -1
- package/dist/utils/common.js +9 -2
- package/dist/utils/create-modifiers.js +6 -6
- package/package.json +1 -1
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import './NmorphSelect.css';
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
import { NmorphComponentHeight as
|
|
4
|
-
import { useModifiers as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import me from "
|
|
9
|
-
import he from "
|
|
10
|
-
import ge from "
|
|
11
|
-
import ye from "../../
|
|
12
|
-
import He from "
|
|
13
|
-
import be from "../../../assets/icons/
|
|
14
|
-
|
|
2
|
+
import { defineComponent as ne, computed as a, ref as d, watch as f, nextTick as B, onMounted as ue, onUnmounted as oe, provide as S, toRef as ie } from "vue";
|
|
3
|
+
import { NmorphComponentHeight as se } from "../../../types/index.js";
|
|
4
|
+
import { useModifiers as de } from "../../../utils/create-modifiers.js";
|
|
5
|
+
import { toCssSize as L, getNmorphOptionHeight as ve, resolveDomElement as ce } from "../../../utils/common.js";
|
|
6
|
+
import { useI18n as fe } from "vue-i18n";
|
|
7
|
+
import { useFormItemInput as pe } from "../nmorph-form/use-form-item-input.js";
|
|
8
|
+
import { useVirtualList as me } from "../../../hooks/use-virtual-list.js";
|
|
9
|
+
import he from "../../navigation/nmorph-dropdown/NmorphDropdown.vue.js";
|
|
10
|
+
import ge from "./components/nmorph-select-option/NmorphSelectOption.vue.js";
|
|
11
|
+
import ye from "../../basic/nmorph-icon/NmorphIcon.vue.js";
|
|
12
|
+
import He from "../../data/nmorph-tag-list/components/nmorph-tag-item/NmorphTagItem.vue.js";
|
|
13
|
+
import be from "../../../assets/icons/chevron-down.svg.js";
|
|
14
|
+
import qe from "../../../assets/icons/loader.svg.js";
|
|
15
|
+
const Ue = /* @__PURE__ */ ne({
|
|
15
16
|
__name: "NmorphSelect",
|
|
16
17
|
props: {
|
|
17
18
|
noElementPlaceholder: { type: String, required: !1, default: "" },
|
|
@@ -38,40 +39,40 @@ const ke = /* @__PURE__ */ ue({
|
|
|
38
39
|
tabindex: { type: Number, required: !1 }
|
|
39
40
|
},
|
|
40
41
|
emits: ["update:model-value"],
|
|
41
|
-
setup(
|
|
42
|
+
setup(R, { expose: C, emit: P }) {
|
|
42
43
|
C();
|
|
43
|
-
const { t:
|
|
44
|
-
() => t.noElementPlaceholder ? t.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:
|
|
44
|
+
const { t: w } = fe(), t = R, D = a(
|
|
45
|
+
() => t.noElementPlaceholder ? t.noElementPlaceholder : w("noElementPlaceholder")
|
|
46
|
+
), 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: T, autocomplete: W, tabindex: k } = pe(t), H = (e) => {
|
|
46
47
|
if (!v.value) {
|
|
47
48
|
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),
|
|
49
|
-
if (t.valueRequired &&
|
|
50
|
-
n ? l.value = l.value.filter((
|
|
49
|
+
const n = l.value.includes(e), ae = l.value.length === 1 && n;
|
|
50
|
+
if (t.valueRequired && ae) return;
|
|
51
|
+
n ? l.value = l.value.filter((re) => re !== e) : l.value = [...l.value, e];
|
|
51
52
|
}
|
|
52
53
|
m("update:model-value", l.value);
|
|
53
54
|
}
|
|
54
|
-
}, p = d(!1),
|
|
55
|
+
}, p = d(!1), $ = () => {
|
|
55
56
|
p.value = !0;
|
|
56
|
-
},
|
|
57
|
+
}, U = () => {
|
|
57
58
|
p.value = !1;
|
|
58
|
-
},
|
|
59
|
-
() =>
|
|
60
|
-
nmorph: [
|
|
59
|
+
}, z = a(
|
|
60
|
+
() => de({
|
|
61
|
+
nmorph: [se[t.height]],
|
|
61
62
|
"nmorph-select": [
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
63
|
+
t.disabled && "disabled",
|
|
64
|
+
t.modelValue ? "on" : "off",
|
|
65
|
+
t.loading && "loading",
|
|
66
|
+
r.value && !v.value && "open",
|
|
67
|
+
t.fill && "fill",
|
|
68
|
+
h.value && "options-auto-width",
|
|
69
|
+
g.value ? "selected-line-outset" : "selected-line-inset",
|
|
70
|
+
p.value && "focus"
|
|
70
71
|
]
|
|
71
72
|
})
|
|
72
|
-
),
|
|
73
|
-
...t.width !== void 0 && { "--base-width":
|
|
74
|
-
})),
|
|
73
|
+
), F = a(() => ({
|
|
74
|
+
...t.width !== void 0 && { "--base-width": L(t.width) }
|
|
75
|
+
})), j = () => {
|
|
75
76
|
v.value || (r.value = !r.value);
|
|
76
77
|
};
|
|
77
78
|
f(
|
|
@@ -81,7 +82,7 @@ const ke = /* @__PURE__ */ ue({
|
|
|
81
82
|
},
|
|
82
83
|
{ immediate: !0 }
|
|
83
84
|
);
|
|
84
|
-
const
|
|
85
|
+
const b = () => {
|
|
85
86
|
r.value = !1;
|
|
86
87
|
};
|
|
87
88
|
f(
|
|
@@ -90,24 +91,16 @@ const ke = /* @__PURE__ */ ue({
|
|
|
90
91
|
e && (r.value = !1);
|
|
91
92
|
}
|
|
92
93
|
);
|
|
93
|
-
const i = a(() => t.options.length > 0 ? t.options : t.optionsMap),
|
|
94
|
-
basic: 30,
|
|
95
|
-
thick: 38,
|
|
96
|
-
thin: 22
|
|
97
|
-
})[t.height || "basic"]), E = a(() => t.virtualItemHeight || A.value), V = a(() => t.virtualOverscan), _ = a(() => t.virtualDynamicHeight), s = pe(N, {
|
|
94
|
+
const i = a(() => t.options.length > 0 ? t.options : t.optionsMap), q = d(null), I = d([]), x = a(() => t.options), c = a(() => t.virtual && x.value.length > 0), M = a(() => t.virtualItemHeight || ve(t.height)), A = a(() => t.virtualOverscan), E = a(() => t.virtualDynamicHeight), s = me(x, {
|
|
98
95
|
enabled: c,
|
|
99
|
-
itemHeight:
|
|
100
|
-
overscan:
|
|
101
|
-
dynamic:
|
|
102
|
-
}),
|
|
103
|
-
|
|
104
|
-
})), Q = a(() => ({
|
|
105
|
-
transform: `translateY(${s.offsetTop.value}px)`
|
|
106
|
-
})), X = a(() => b(t.virtualMaxHeight)), O = () => {
|
|
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));
|
|
96
|
+
itemHeight: M,
|
|
97
|
+
overscan: A,
|
|
98
|
+
dynamic: E
|
|
99
|
+
}), G = a(() => s.virtualItems.value), J = s.spacerStyle, K = s.contentStyle, Q = a(() => L(t.virtualMaxHeight)), N = () => {
|
|
100
|
+
i.value.length > 0 || !q.value || (I.value = Array.from(q.value.querySelectorAll(".nmorph-select-option")).map((e) => e.getAttribute("value")).filter((e) => !!e));
|
|
108
101
|
}, o = a(
|
|
109
102
|
() => i.value.length > 0 ? i.value.map((e) => e.value) : I.value
|
|
110
|
-
),
|
|
103
|
+
), X = a(() => c.value ? Array.isArray(l.value) ? l.value : l.value ? [l.value] : [] : o.value), u = d(0), O = a(() => o.value[u.value] || ""), Y = a(() => `${y.value}-listbox`), Z = (e) => `${y.value}-option-${e.replace(/\s+/g, "-")}`;
|
|
111
104
|
f(u, (e) => {
|
|
112
105
|
r.value && c.value && s.scrollToIndex(e);
|
|
113
106
|
}), f(
|
|
@@ -118,32 +111,31 @@ const ke = /* @__PURE__ */ ue({
|
|
|
118
111
|
{ immediate: !0 }
|
|
119
112
|
), f(r, async (e) => {
|
|
120
113
|
if (e) {
|
|
121
|
-
if (await
|
|
114
|
+
if (await B(), N(), typeof l.value == "string") {
|
|
122
115
|
const n = o.value.indexOf(l.value);
|
|
123
116
|
n !== -1 && (u.value = n);
|
|
124
117
|
}
|
|
125
118
|
s.refresh(), c.value && s.scrollToIndex(u.value);
|
|
126
119
|
}
|
|
127
|
-
}),
|
|
128
|
-
await
|
|
129
|
-
}),
|
|
130
|
-
document.removeEventListener("click",
|
|
120
|
+
}), ue(async () => {
|
|
121
|
+
await B(), N(), document.addEventListener("click", b);
|
|
122
|
+
}), oe(() => {
|
|
123
|
+
document.removeEventListener("click", b);
|
|
131
124
|
});
|
|
132
|
-
const
|
|
133
|
-
|
|
134
|
-
const
|
|
135
|
-
() => h.value ? `${
|
|
136
|
-
),
|
|
125
|
+
const ee = 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), te = 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 }]);
|
|
126
|
+
S("select-selected-value", l), S("select-change-selected-value", H), S("select-height", ie(t, "height"));
|
|
127
|
+
const V = d(null), le = a(
|
|
128
|
+
() => h.value ? `${V.value?.clientWidth || 0}px` : void 0
|
|
129
|
+
), _ = { t: w, props: t, computedNoElementPlaceholder: D, emit: m, initialValue: l, open: r, disabledInput: v, autoOptionsWidth: h, selectedLineOutset: g, id: y, name: T, autocomplete: W, tabindex: k, changeHandler: H, focus: p, focusHandler: $, blurHandler: U, modifiers: z, styles: F, clickHandler: j, closeHandler: b, optionsMap: i, optionsDOMRef: q, slotDomOptions: I, renderedOptions: x, virtualEnabled: c, virtualItemHeight: M, virtualOverscan: A, virtualDynamicHeight: E, virtualList: s, virtualOptions: G, virtualSpacerStyle: J, virtualContentStyle: K, virtualMaxHeight: Q, refreshDomOptions: N, domOptions: o, nativeOptions: X, currentIndex: u, currentFocusedEl: O, listboxId: Y, getOptionId: Z, selectedValueTitle: ee, tags: te, nmorphSelectDOMRef: V, optionsMinWidth: le, spaceHandler: () => {
|
|
137
130
|
v.value || (r.value = !r.value);
|
|
138
131
|
}, arrowDownHandler: () => {
|
|
139
132
|
v.value || o.value.length !== 0 && (r.value || (r.value = !0), u.value = (u.value + 1) % o.value.length);
|
|
140
133
|
}, arrowUpHandler: () => {
|
|
141
134
|
v.value || o.value.length !== 0 && (r.value || (r.value = !0), u.value = (u.value - 1 + o.value.length) % o.value.length);
|
|
142
135
|
}, enterHandler: () => {
|
|
143
|
-
r.value &&
|
|
136
|
+
r.value && O.value && H(O.value);
|
|
144
137
|
}, setVirtualOptionRef: (e, n) => {
|
|
145
|
-
|
|
146
|
-
s.measureElement(n, w);
|
|
138
|
+
s.measureElement(n, ce(e));
|
|
147
139
|
}, escapeHandler: () => {
|
|
148
140
|
r.value = !1;
|
|
149
141
|
}, homeHandler: () => {
|
|
@@ -151,21 +143,21 @@ const ke = /* @__PURE__ */ ue({
|
|
|
151
143
|
}, endHandler: () => {
|
|
152
144
|
u.value = Math.max(o.value.length - 1, 0);
|
|
153
145
|
}, get NmorphTagItem() {
|
|
154
|
-
return
|
|
146
|
+
return He;
|
|
155
147
|
}, get NmorphIcon() {
|
|
156
|
-
return
|
|
148
|
+
return ye;
|
|
157
149
|
}, get NmorphSelectOption() {
|
|
158
|
-
return
|
|
150
|
+
return ge;
|
|
159
151
|
}, get NmorphDropdown() {
|
|
160
|
-
return
|
|
161
|
-
}, get
|
|
162
|
-
return
|
|
152
|
+
return he;
|
|
153
|
+
}, get NmorphIconLoaderDots() {
|
|
154
|
+
return qe;
|
|
163
155
|
}, get NmorphIconChevronDown() {
|
|
164
|
-
return
|
|
156
|
+
return be;
|
|
165
157
|
} };
|
|
166
|
-
return Object.defineProperty(
|
|
158
|
+
return Object.defineProperty(_, "__isScriptSetup", { enumerable: !1, value: !0 }), _;
|
|
167
159
|
}
|
|
168
160
|
});
|
|
169
161
|
export {
|
|
170
|
-
|
|
162
|
+
Ue as default
|
|
171
163
|
};
|
|
@@ -31,10 +31,10 @@ const I = /* @__PURE__ */ g({
|
|
|
31
31
|
() => S({
|
|
32
32
|
nmorph: [y[s.value]],
|
|
33
33
|
"nmorph-select-option": [
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
e.disabled && "disabled",
|
|
35
|
+
e.label && "with-label",
|
|
36
|
+
u.value && "checked",
|
|
37
|
+
e.focused && "focused"
|
|
38
38
|
]
|
|
39
39
|
})
|
|
40
40
|
), m = t(() => ({
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import './NmorphSelectButton.css';
|
|
2
|
-
import { defineComponent as c, ref as S, watch as g, computed as
|
|
2
|
+
import { defineComponent as c, ref as S, watch as g, computed as d, provide as o } from "vue";
|
|
3
3
|
import { useModifiers as y } from "../../../utils/create-modifiers.js";
|
|
4
|
+
import { toCssSize as u } from "../../../utils/common.js";
|
|
4
5
|
import b from "./components/nmorph-select-button-item/NmorphSelectButtonItem.vue.js";
|
|
5
|
-
const
|
|
6
|
+
const z = /* @__PURE__ */ c({
|
|
6
7
|
__name: "NmorphSelectButton",
|
|
7
8
|
props: {
|
|
8
9
|
modelValue: { type: String, required: !1, default: "" },
|
|
@@ -19,33 +20,33 @@ const _ = /* @__PURE__ */ c({
|
|
|
19
20
|
tabindex: { type: Number, required: !1 }
|
|
20
21
|
},
|
|
21
22
|
emits: ["update:model-value"],
|
|
22
|
-
setup(
|
|
23
|
+
setup(n, { expose: s, emit: m }) {
|
|
23
24
|
s();
|
|
24
|
-
const e =
|
|
25
|
+
const e = n, r = m, t = S(e.modelValue);
|
|
25
26
|
g(
|
|
26
27
|
() => e.modelValue,
|
|
27
|
-
(
|
|
28
|
-
|
|
28
|
+
(i) => {
|
|
29
|
+
t.value = i;
|
|
29
30
|
}
|
|
30
31
|
);
|
|
31
|
-
const f =
|
|
32
|
+
const f = d(
|
|
32
33
|
() => y({
|
|
33
|
-
"nmorph-select-button": [
|
|
34
|
+
"nmorph-select-button": [e.disabled && "disabled", e.fill && "fill", e.height]
|
|
34
35
|
})
|
|
35
|
-
),
|
|
36
|
-
...e.trackPadding !== void 0 && { "--track-padding":
|
|
37
|
-
...e.itemSize !== void 0 && { "--item-size":
|
|
36
|
+
), p = d(() => ({
|
|
37
|
+
...e.trackPadding !== void 0 && { "--track-padding": u(e.trackPadding) },
|
|
38
|
+
...e.itemSize !== void 0 && { "--item-size": u(e.itemSize) },
|
|
38
39
|
...e.itemFontSize !== void 0 && { "--item-font-size": e.itemFontSize }
|
|
39
|
-
})),
|
|
40
|
-
e.disabled || (
|
|
40
|
+
})), l = (i) => {
|
|
41
|
+
e.disabled || (t.value = i, r("update:model-value", i));
|
|
41
42
|
};
|
|
42
|
-
|
|
43
|
-
const
|
|
43
|
+
o("select-button-selected-value", t), o("select-button-change-handler", l);
|
|
44
|
+
const a = { props: e, emit: r, initialValue: t, modifiers: f, styles: p, changeHandler: l, get NmorphSelectButtonItem() {
|
|
44
45
|
return b;
|
|
45
46
|
} };
|
|
46
|
-
return Object.defineProperty(
|
|
47
|
+
return Object.defineProperty(a, "__isScriptSetup", { enumerable: !1, value: !0 }), a;
|
|
47
48
|
}
|
|
48
49
|
});
|
|
49
50
|
export {
|
|
50
|
-
|
|
51
|
+
z as default
|
|
51
52
|
};
|
|
@@ -22,7 +22,7 @@ const v = /* @__PURE__ */ c({
|
|
|
22
22
|
s({ inputDOMRef: n });
|
|
23
23
|
const l = d(() => r?.value === e.value), u = d(
|
|
24
24
|
() => f({
|
|
25
|
-
"nmorph-select-button-item": [
|
|
25
|
+
"nmorph-select-button-item": [l.value && "checked", e.disabled && "disabled"]
|
|
26
26
|
})
|
|
27
27
|
), a = { selectedValue: r, changeHandler: t, props: e, inputDOMRef: n, checked: l, modifiers: u, clickHandler: () => {
|
|
28
28
|
e.disabled || t && t(e.value);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import './NmorphSlider.css';
|
|
2
|
-
import { defineComponent as k, computed as m, ref as o, watch as
|
|
2
|
+
import { defineComponent as k, computed as m, ref as o, watch as E, onMounted as A, onUnmounted as G } from "vue";
|
|
3
3
|
import { useModifiers as J } from "../../../utils/create-modifiers.js";
|
|
4
|
+
import { toCssSize as I } from "../../../utils/common.js";
|
|
4
5
|
import { useFormItemInput as K } from "../nmorph-form/use-form-item-input.js";
|
|
5
6
|
import Q from "../../feedback/nmorph-tooltip/NmorphTooltip.vue.js";
|
|
6
7
|
const se = /* @__PURE__ */ k({
|
|
@@ -27,32 +28,32 @@ const se = /* @__PURE__ */ k({
|
|
|
27
28
|
const e = H, { id: N, name: T, tabindex: S } = K(e), _ = m(
|
|
28
29
|
() => J({
|
|
29
30
|
nmorph: [],
|
|
30
|
-
"nmorph-slider": [
|
|
31
|
+
"nmorph-slider": [e.disabled && "disabled"]
|
|
31
32
|
})
|
|
32
|
-
),
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}),
|
|
33
|
+
), w = m(() => `${e.thumbWidth}px`), p = o(e.showTooltip), g = M, n = o(e.modelValue), c = o(null);
|
|
34
|
+
E(n, () => {
|
|
35
|
+
g("update:model-value", n.value);
|
|
36
|
+
}), E(
|
|
36
37
|
() => e.modelValue,
|
|
37
38
|
(t) => {
|
|
38
39
|
n.value = t;
|
|
39
40
|
}
|
|
40
41
|
);
|
|
41
|
-
const
|
|
42
|
-
const t =
|
|
43
|
-
let
|
|
44
|
-
const
|
|
42
|
+
const x = o(null), C = m(() => {
|
|
43
|
+
const t = l.value - l.value, r = e.max - e.min + t, u = (n.value - e.min) / r * 100, a = c.value?.clientWidth || 0, d = e.thumbWidth / a * 100, D = d / 2;
|
|
44
|
+
let X = u - D;
|
|
45
|
+
const P = `${Math.max(0, Math.min(100 - d, X))}%`, W = a / 100, $ = e.thumbWidth / 2 / W, q = (x.value?.tooltipBody.clientWidth ?? 24) / 2 / W, j = q === 1 / 0 ? 1.714 : q, U = `${parseFloat(P) + $ - j}%`;
|
|
45
46
|
return {
|
|
46
|
-
thumb:
|
|
47
|
+
thumb: P,
|
|
47
48
|
tooltip: U
|
|
48
49
|
};
|
|
49
|
-
}),
|
|
50
|
-
|
|
50
|
+
}), l = o(0), f = o(0), h = () => {
|
|
51
|
+
l.value = window.innerWidth, f.value = window.innerHeight;
|
|
51
52
|
};
|
|
52
53
|
A(() => {
|
|
53
|
-
typeof window < "u" && (
|
|
54
|
+
typeof window < "u" && (l.value = window.innerWidth, f.value = window.innerHeight, window.addEventListener("resize", h));
|
|
54
55
|
}), G(() => {
|
|
55
|
-
typeof window < "u" && (document.removeEventListener("pointermove",
|
|
56
|
+
typeof window < "u" && (document.removeEventListener("pointermove", s), document.removeEventListener("pointerup", i), document.removeEventListener("pointercancel", i), window.removeEventListener("resize", h));
|
|
56
57
|
});
|
|
57
58
|
const v = (t) => {
|
|
58
59
|
b.value = !1;
|
|
@@ -63,12 +64,12 @@ const se = /* @__PURE__ */ k({
|
|
|
63
64
|
u = Math.max(0, Math.min(1, a / d)), n.value = e.min + u * (e.max - e.min);
|
|
64
65
|
}
|
|
65
66
|
n.value = Math.round(n.value / e.step) * e.step, n.value = Math.max(e.min, Math.min(e.max, n.value));
|
|
66
|
-
},
|
|
67
|
+
}, s = (t) => {
|
|
67
68
|
t.preventDefault(), v(t.clientX);
|
|
68
69
|
}, i = () => {
|
|
69
|
-
document.removeEventListener("pointermove",
|
|
70
|
+
document.removeEventListener("pointermove", s), document.removeEventListener("pointerup", i), document.removeEventListener("pointercancel", i), b.value = !0;
|
|
70
71
|
}, z = (t) => {
|
|
71
|
-
e.disabled || t.pointerType === "mouse" && t.button !== 0 || (t.preventDefault(), v(t.clientX), document.addEventListener("pointermove",
|
|
72
|
+
e.disabled || t.pointerType === "mouse" && t.button !== 0 || (t.preventDefault(), v(t.clientX), document.addEventListener("pointermove", s), document.addEventListener("pointerup", i), document.addEventListener("pointercancel", i));
|
|
72
73
|
}, F = o(null), O = () => {
|
|
73
74
|
e.showTooltip && (p.value = !0);
|
|
74
75
|
}, V = () => {
|
|
@@ -76,16 +77,16 @@ const se = /* @__PURE__ */ k({
|
|
|
76
77
|
}, B = (t) => {
|
|
77
78
|
const r = t.target;
|
|
78
79
|
n.value = Number(r.value);
|
|
79
|
-
}, b = o(!0),
|
|
80
|
-
"--nmorph-slider-thumb-width":
|
|
81
|
-
...e.sliderHeight !== void 0 && { "--slider-height":
|
|
80
|
+
}, b = o(!0), R = m(() => ({
|
|
81
|
+
"--nmorph-slider-thumb-width": w.value,
|
|
82
|
+
...e.sliderHeight !== void 0 && { "--slider-height": I(e.sliderHeight) },
|
|
82
83
|
...e.valueFixedContainerHeight !== void 0 && {
|
|
83
|
-
"--value-fixed-container-height":
|
|
84
|
+
"--value-fixed-container-height": I(e.valueFixedContainerHeight)
|
|
84
85
|
}
|
|
85
|
-
})),
|
|
86
|
+
})), y = { props: e, id: N, name: T, tabindex: S, modifiers: _, thumbWidthCss: w, tooltipVisible: p, emit: g, thumbValue: n, sliderContainer: c, tooltipRootRef: x, thumbXPercentPosition: C, windowWidth: l, windowHeight: f, resizeWindowHandler: h, updateThumbValue: v, pointerMove: s, pointerUp: i, pointerDownHandler: z, sliderFirst: F, handleMouseEnter: O, handleMouseLeave: V, nativeInputHandler: B, transitionEnabled: b, styles: R, get NmorphTooltip() {
|
|
86
87
|
return Q;
|
|
87
88
|
} };
|
|
88
|
-
return Object.defineProperty(
|
|
89
|
+
return Object.defineProperty(y, "__isScriptSetup", { enumerable: !1, value: !0 }), y;
|
|
89
90
|
}
|
|
90
91
|
});
|
|
91
92
|
export {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import './NmorphSwitch.css';
|
|
2
|
-
import { defineComponent as q, ref as
|
|
2
|
+
import { defineComponent as q, ref as i, computed as n, watch as N } from "vue";
|
|
3
3
|
import { useModifiers as V } from "../../../utils/create-modifiers.js";
|
|
4
|
+
import { toCssSize as a } from "../../../utils/common.js";
|
|
4
5
|
import { useFormItemInput as _ } from "../nmorph-form/use-form-item-input.js";
|
|
5
6
|
import w from "../../basic/nmorph-icon/NmorphIcon.vue.js";
|
|
6
7
|
import H from "../../../assets/icons/loader.svg.js";
|
|
7
|
-
const
|
|
8
|
+
const M = /* @__PURE__ */ q({
|
|
8
9
|
__name: "NmorphSwitch",
|
|
9
10
|
props: {
|
|
10
11
|
modelValue: { type: [Boolean, String, Number], required: !1, default: !1 },
|
|
@@ -23,27 +24,27 @@ const L = /* @__PURE__ */ q({
|
|
|
23
24
|
},
|
|
24
25
|
emits: ["update:model-value"],
|
|
25
26
|
setup(s, { expose: f, emit: m }) {
|
|
26
|
-
const e = s, { id: p, name: c, tabindex: h } = _(e), u = m,
|
|
27
|
-
|
|
28
|
-
},
|
|
29
|
-
|
|
27
|
+
const e = s, { id: p, name: c, tabindex: h } = _(e), u = m, r = i(!1), v = () => {
|
|
28
|
+
r.value = !0;
|
|
29
|
+
}, g = () => {
|
|
30
|
+
r.value = !1;
|
|
30
31
|
}, b = n(
|
|
31
32
|
() => V({
|
|
32
33
|
"nmorph-switch": [
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
e.disabled && "disabled",
|
|
35
|
+
t.value ? "on" : "off",
|
|
36
|
+
e.loading && "loading",
|
|
37
|
+
r.value && "focus"
|
|
37
38
|
]
|
|
38
39
|
})
|
|
39
|
-
),
|
|
40
|
+
), t = i(e.modelValue === e.activeValue), y = () => {
|
|
40
41
|
if (e.disabled) return;
|
|
41
|
-
|
|
42
|
-
const
|
|
43
|
-
u("update:model-value",
|
|
44
|
-
}, l =
|
|
42
|
+
t.value = !t.value;
|
|
43
|
+
const o = t.value ? e.activeValue : e.inactiveValue;
|
|
44
|
+
u("update:model-value", o);
|
|
45
|
+
}, l = i(null);
|
|
45
46
|
f({ inputDOMRef: l });
|
|
46
|
-
const
|
|
47
|
+
const S = n(() => ({
|
|
47
48
|
...e.width !== void 0 && { "--width": a(e.width) },
|
|
48
49
|
...e.height !== void 0 && { "--height": a(e.height) },
|
|
49
50
|
...e.offset !== void 0 && { "--offset": a(e.offset) },
|
|
@@ -51,18 +52,18 @@ const L = /* @__PURE__ */ q({
|
|
|
51
52
|
}));
|
|
52
53
|
N(
|
|
53
54
|
() => e.modelValue,
|
|
54
|
-
(
|
|
55
|
-
|
|
55
|
+
(o) => {
|
|
56
|
+
t.value = o === e.activeValue;
|
|
56
57
|
}
|
|
57
58
|
);
|
|
58
|
-
const d = { props: e, id: p, name: c, tabindex: h, emit: u, focus:
|
|
59
|
+
const d = { props: e, id: p, name: c, tabindex: h, emit: u, focus: r, focusHandler: v, blurHandler: g, modifiers: b, initialValue: t, changeHandler: y, inputDOMRef: l, styles: S, get NmorphIcon() {
|
|
59
60
|
return w;
|
|
60
|
-
}, get
|
|
61
|
+
}, get NmorphIconLoaderDots() {
|
|
61
62
|
return H;
|
|
62
63
|
} };
|
|
63
64
|
return Object.defineProperty(d, "__isScriptSetup", { enumerable: !1, value: !0 }), d;
|
|
64
65
|
}
|
|
65
66
|
});
|
|
66
67
|
export {
|
|
67
|
-
|
|
68
|
+
M as default
|
|
68
69
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.nmorph-text-input{--prepend-icon-indent: 8px;--prepend-icon-size: 14px;display:flex;flex:1 1 auto;flex-direction:column;align-items:flex-start;min-width:0}.nmorph-text-input__input-side{position:relative;display:flex;justify-content:flex-end;align-items:center;width:100%}.nmorph-text-input__prepend-icon{position:absolute;left:0;z-index:1;display:flex;justify-content:center;align-items:center;width:var(--prepend-icon-size);min-width:var(--prepend-icon-size);height:var(--prepend-icon-size);min-height:var(--prepend-icon-size);margin-left:var(--prepend-icon-indent);pointer-events:none}.nmorph-text-input__prepend-icon svg,.nmorph-text-input__prepend-icon .nmorph-icon,.nmorph-text-input__prepend-icon .nmorph-icon__content{width:100%;min-width:100%;height:100%;min-height:100%}.nmorph-text-input__prepend-icon svg{fill:var(--nmorph-text-color);stroke-width:0}.nmorph-text-input__prepend-icon path{stroke:var(--nmorph-text-color)}.nmorph-text-input input{width:100%;height:var(--height);text-indent:var(--nmorph-text-input-indentation);border:none;border-radius:var(--default-border-radius);box-shadow:var(--nmorph-shadow-inset)}.nmorph-text-input--with-action input{padding-right:calc(var(--height) + var(--indentation-03))}.nmorph-text-input input:focus{background:var(--nmorph-accent-color);outline:none;box-shadow:var(--nmorph-shadow-outset)}.nmorph-text-input.nmorph--focused .nmorph-text-input__prepend-icon svg{fill:var(--nmorph-focus-text-color)}.nmorph-text-input.nmorph--focused .nmorph-text-input__prepend-icon path{stroke:var(--nmorph-focus-text-color)}.nmorph-text-input input:-webkit-autofill,.nmorph-text-input input:-webkit-autofill:hover,.nmorph-text-input input:-webkit-autofill:active{caret-color:var(--nmorph-text-color);box-shadow:var(--nmorph-shadow-inset),inset 0 0 0 1000px var(--nmorph-main-color);-webkit-text-fill-color:var(--nmorph-text-color)}.nmorph-text-input input:-webkit-autofill:focus{caret-color:var(--nmorph-focus-text-color);outline:none;box-shadow:var(--nmorph-shadow-outset),inset 0 0 0 1000px var(--nmorph-accent-color);-webkit-text-fill-color:var(--nmorph-focus-text-color)}.nmorph-text-input input:disabled{cursor:not-allowed;opacity:.6}.nmorph-text-input__password-btn{position:absolute;right:0;height:100%}.nmorph-text-input__password-btn .nmorph-button__content{padding:var(--indentation-03)}.nmorph-text-input.nmorph-button.nmorph--thin-component .nmorph-text-input__password-btn{margin-top:var(--indentation-00)}.nmorph-text-input.nmorph-button.nmorph--thin-component .nmorph-text-input__password-btn .nmorph-button{--height: var(--thin-component)}.nmorph-text-input.nmorph-button.nmorph--focused .nmorph-text-input__password-btn .nmorph-icon{--color: var(--nmorph-white-color)}.nmorph-text-input.nmorph-button.nmorph--focused .nmorph-text-input__password-btn .nmorph-button:not(:disabled,[loading=true]):hover .nmorph-icon{--color: var(--nmorph-white-color)}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import './NmorphTextInput.css';
|
|
1
2
|
import s from "./NmorphTextInput.vue2.js";
|
|
2
3
|
import { openBlock as n, createElementBlock as r, normalizeStyle as m, normalizeClass as c, createElementVNode as i, renderSlot as h, createCommentVNode as l, mergeProps as f, withKeys as y, createBlock as d, withModifiers as _, withCtx as a, createVNode as u, resolveDynamicComponent as b } from "vue";
|
|
4
|
+
/* empty css */
|
|
3
5
|
import x from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
6
|
const v = { class: "nmorph-text-input__input-side" }, k = {
|
|
5
7
|
key: 0,
|
|
@@ -64,7 +66,7 @@ function B(p, o, N, e, C, I) {
|
|
|
64
66
|
/* CLASS, STYLE */
|
|
65
67
|
);
|
|
66
68
|
}
|
|
67
|
-
const
|
|
69
|
+
const z = /* @__PURE__ */ x(s, [["render", B], ["__file", "/builds/ketjo/nmorph/library/src/components/form/nmorph-text-input/NmorphTextInput.vue"]]);
|
|
68
70
|
export {
|
|
69
|
-
|
|
71
|
+
z as default
|
|
70
72
|
};
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
+
import './NmorphTextInput.css';
|
|
1
2
|
import { defineComponent as C, useSlots as E, computed as n, ref as l } from "vue";
|
|
2
3
|
import { NmorphComponentHeight as O } from "../../../types/index.js";
|
|
3
|
-
import { useModifiers as
|
|
4
|
-
import { useFormItemInput as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
const
|
|
4
|
+
import { useModifiers as j } from "../../../utils/create-modifiers.js";
|
|
5
|
+
import { useFormItemInput as F } from "../nmorph-form/use-form-item-input.js";
|
|
6
|
+
import H from "../../../assets/icons/eye-blocked.svg.js";
|
|
7
|
+
import M from "../../../assets/icons/eye.svg.js";
|
|
8
|
+
import A from "../../basic/nmorph-button/NmorphButton.vue.js";
|
|
9
|
+
import D from "../../basic/nmorph-icon/NmorphIcon.vue.js";
|
|
10
|
+
import R from "../../../assets/icons/error.svg.js";
|
|
11
|
+
const W = /* @__PURE__ */ C({
|
|
11
12
|
__name: "NmorphTextInput",
|
|
12
13
|
props: {
|
|
13
14
|
placeholder: { type: String, required: !1, default: "" },
|
|
@@ -25,13 +26,10 @@ const U = /* @__PURE__ */ C({
|
|
|
25
26
|
},
|
|
26
27
|
emits: ["update:model-value", "focus", "blur", "on-enter", "keydown"],
|
|
27
28
|
setup(f, { expose: m, emit: h }) {
|
|
28
|
-
const s = E(), e = f, { id: y, name: b, autocomplete: v, tabindex: g } =
|
|
29
|
-
() =>
|
|
30
|
-
nmorph: [O[e.height],
|
|
31
|
-
"nmorph-text-input": [
|
|
32
|
-
`${e.typePassword && "password"}`,
|
|
33
|
-
`${(e.typePassword || e.clearable) && "with-action"}`
|
|
34
|
-
]
|
|
29
|
+
const s = E(), e = f, { id: y, name: b, autocomplete: v, tabindex: g } = F(e), q = n(
|
|
30
|
+
() => j({
|
|
31
|
+
nmorph: [O[e.height], a.value && "focused"],
|
|
32
|
+
"nmorph-text-input": [e.typePassword && "password", (e.typePassword || e.clearable) && "with-action"]
|
|
35
33
|
})
|
|
36
34
|
), w = (P) => {
|
|
37
35
|
const k = P.target;
|
|
@@ -50,14 +48,14 @@ const U = /* @__PURE__ */ C({
|
|
|
50
48
|
o.value?.select();
|
|
51
49
|
};
|
|
52
50
|
m({ inputDOMRef: o, focus: u, blur: p, select: i });
|
|
53
|
-
const r = h, S = n(() => e.clearable ?
|
|
54
|
-
return
|
|
51
|
+
const r = h, S = n(() => e.clearable ? R : t.value ? H : M), d = n(() => e.indentation || (s["prepend-icon"] ? "28px" : "8px")), B = n(() => ({ "--nmorph-text-input-indentation": d.value })), c = { slots: s, props: e, id: y, name: b, autocomplete: v, tabindex: g, modifiers: q, handleInput: w, showPassword: t, actionButtonClickHandler: x, type: I, focused: a, handleFocus: N, handleBlur: _, inputDOMRef: o, focus: u, blur: p, select: i, emit: r, actionIcon: S, indentation: d, styles: B, get NmorphIcon() {
|
|
52
|
+
return D;
|
|
55
53
|
}, get NmorphButton() {
|
|
56
|
-
return
|
|
54
|
+
return A;
|
|
57
55
|
} };
|
|
58
56
|
return Object.defineProperty(c, "__isScriptSetup", { enumerable: !1, value: !0 }), c;
|
|
59
57
|
}
|
|
60
58
|
});
|
|
61
59
|
export {
|
|
62
|
-
|
|
60
|
+
W as default
|
|
63
61
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.nmorph-textarea{height:auto}.nmorph-textarea textarea{display:block;box-sizing:border-box;width:100%;min-width:0;padding:var(--indentation-03) var(--indentation-03) var(--indentation-03) var(--nmorph-textarea-indentation);color:var(--nmorph-text-color);font:inherit;line-height:var(--line-height-regular);background:var(--nmorph-main-color);border:none;border-radius:var(--default-border-radius);box-shadow:var(--nmorph-shadow-inset);transition:background var(--transition-02) ease,box-shadow var(--transition-02) ease,color var(--transition-02) ease;resize:var(--nmorph-textarea-resize)}.nmorph-textarea textarea:focus{color:var(--nmorph-focus-text-color);background:var(--nmorph-accent-color);outline:none;box-shadow:var(--nmorph-shadow-outset)}.nmorph-textarea textarea:disabled{cursor:not-allowed;opacity:.6;resize:none}.nmorph-textarea.nmorph-textarea--auto-size textarea{overflow-y:hidden}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import './NmorphTextarea.css';
|
|
2
|
+
import a from "./NmorphTextarea.vue2.js";
|
|
3
|
+
import { openBlock as n, createElementBlock as t, normalizeStyle as l, normalizeClass as d, createElementVNode as i, mergeProps as m, withKeys as s } from "vue";
|
|
4
|
+
/* empty css */
|
|
5
|
+
import p from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
6
|
+
const c = ["id", "name", "autocomplete", "tabindex", "placeholder", "disabled", "value", "rows"];
|
|
7
|
+
function f(x, o, h, e, b, y) {
|
|
8
|
+
return n(), t(
|
|
9
|
+
"div",
|
|
10
|
+
{
|
|
11
|
+
class: d(e.modifiers),
|
|
12
|
+
style: l(e.styles)
|
|
13
|
+
},
|
|
14
|
+
[
|
|
15
|
+
i("textarea", m({
|
|
16
|
+
id: e.id,
|
|
17
|
+
ref: "textareaDOMRef",
|
|
18
|
+
name: e.name,
|
|
19
|
+
autocomplete: e.autocomplete,
|
|
20
|
+
tabindex: e.tabindex,
|
|
21
|
+
class: "nmorph-native-input",
|
|
22
|
+
placeholder: e.props.placeholder,
|
|
23
|
+
disabled: e.props.disabled,
|
|
24
|
+
value: e.props.modelValue,
|
|
25
|
+
rows: e.rows
|
|
26
|
+
}, e.props.textareaAttrs, {
|
|
27
|
+
onInput: e.handleInput,
|
|
28
|
+
onFocus: e.handleFocus,
|
|
29
|
+
onBlur: e.handleBlur,
|
|
30
|
+
onKeydown: o[0] || (o[0] = (r) => e.emit("keydown", r)),
|
|
31
|
+
onKeyup: o[1] || (o[1] = s((r) => e.emit("on-enter"), ["enter"]))
|
|
32
|
+
}), null, 16, c)
|
|
33
|
+
],
|
|
34
|
+
6
|
|
35
|
+
/* CLASS, STYLE */
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
const k = /* @__PURE__ */ p(a, [["render", f], ["__file", "/builds/ketjo/nmorph/library/src/components/form/nmorph-textarea/NmorphTextarea.vue"]]);
|
|
39
|
+
export {
|
|
40
|
+
k as default
|
|
41
|
+
};
|