@nmorph/nmorph-ui-kit 2.2.38 → 2.2.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/basic/nmorph-button/NmorphButton.vue2.js +4 -4
- package/dist/components/basic/nmorph-layout/NmorphLayout.vue2.js +12 -10
- package/dist/components/basic/nmorph-link/NmorphLink.vue2.js +19 -16
- package/dist/components/data/nmorph-badge/NmorphBadge.css +1 -1
- package/dist/components/data/nmorph-badge/NmorphBadge.vue2.js +30 -26
- package/dist/components/data/nmorph-calendar/NmorphCalendar.vue2.js +42 -40
- package/dist/components/data/nmorph-card/NmorphCard.vue2.js +6 -6
- package/dist/components/data/nmorph-collapse/components/nmorph-collapse-item/NmorphCollapseItem.vue2.js +24 -21
- package/dist/components/data/nmorph-empty/NmorphEmpty.vue2.js +23 -21
- package/dist/components/data/nmorph-image-preview/NmorphImagePreview.vue.js +43 -42
- package/dist/components/data/nmorph-image-preview/NmorphImagePreview.vue2.js +47 -45
- package/dist/components/data/nmorph-progress/NmorphProgress.vue2.js +18 -14
- package/dist/components/data/nmorph-qr-code/NmorphQRCode.vue2.js +15 -11
- package/dist/components/data/nmorph-skeleton/NmorphSkeleton.vue2.js +15 -12
- package/dist/components/data/nmorph-table/NmorphTable.vue2.js +44 -40
- package/dist/components/data/nmorph-tag-list/components/nmorph-tag-item/NmorphTagItem.vue2.js +1 -1
- package/dist/components/data/nmorph-virtual-list/NmorphVirtualList.vue2.js +21 -19
- package/dist/components/feedback/nmorph-alert/NmorphAlert.vue2.js +27 -24
- package/dist/components/feedback/nmorph-callout/NmorphCallout.vue2.js +19 -15
- package/dist/components/feedback/nmorph-drawer/NmorphDrawer.vue2.js +10 -8
- package/dist/components/feedback/nmorph-tooltip/NmorphTooltip.vue2.js +25 -23
- package/dist/components/form/nmorph-autocomplete/NmorphAutocomplete.vue2.js +8 -8
- package/dist/components/form/nmorph-checkbox/NmorphCheckbox.vue2.js +4 -4
- package/dist/components/form/nmorph-color-picker/NmorphColorPicker.vue.js +18 -22
- package/dist/components/form/nmorph-color-picker/NmorphColorPicker.vue2.js +42 -33
- package/dist/components/form/nmorph-date-picker/NmorphDatePicker.vue2.js +32 -32
- package/dist/components/form/nmorph-file-upload/NmorphFileUpload.css +1 -1
- package/dist/components/form/nmorph-file-upload/NmorphFileUpload.vue2.js +77 -106
- package/dist/components/form/nmorph-form/components/nmorph-form-item/NmorphFormItem.css +1 -1
- package/dist/components/form/nmorph-form/components/nmorph-form-item/inner-components/nmorph-error-box/NmorphErrorBox.vue2.js +4 -4
- package/dist/components/form/nmorph-number-input/NmorphNumberInput.vue2.js +7 -7
- package/dist/components/form/nmorph-otp-input/NmorphOTPInput.vue2.js +6 -6
- package/dist/components/form/nmorph-radio/NmorphRadio.vue2.js +1 -1
- package/dist/components/form/nmorph-select/NmorphSelect.vue2.js +51 -49
- package/dist/components/form/nmorph-select/components/nmorph-select-option/NmorphSelectOption.vue2.js +21 -18
- package/dist/components/form/nmorph-select-button/NmorphSelectButton.vue2.js +28 -24
- package/dist/components/form/nmorph-slider/NmorphSlider.vue2.js +30 -30
- package/dist/components/form/nmorph-switch/NmorphSwitch.vue2.js +34 -32
- package/dist/components/form/nmorph-text-input/NmorphTextInput.vue.js +16 -16
- package/dist/components/form/nmorph-text-input/NmorphTextInput.vue2.js +37 -35
- package/dist/components/form/nmorph-textarea/NmorphTextarea.vue.js +12 -12
- package/dist/components/form/nmorph-textarea/NmorphTextarea.vue2.js +34 -32
- package/dist/components/form/nmorph-time-picker/NmorphTimePicker.vue.js +16 -16
- package/dist/components/form/nmorph-time-picker/NmorphTimePicker.vue2.js +64 -57
- package/dist/components/navigation/nmorph-dropdown/NmorphDropdown.vue2.js +25 -23
- package/dist/hooks/use-field-validation.js +50 -66
- package/dist/hooks/use-focusable-input.js +27 -0
- package/dist/hooks/use-nmorph-translation.js +4 -4
- package/dist/index.es.js +842 -837
- package/dist/index.umd.js +32 -32
- package/dist/package.json.js +1 -1
- package/dist/plugin.js +47 -42
- package/dist/src/components/basic/nmorph-button/NmorphButton.vue.d.ts +4 -17
- package/dist/src/components/basic/nmorph-button/types.d.ts +13 -0
- package/dist/src/components/basic/nmorph-icon/NmorphIcon.vue.d.ts +3 -9
- package/dist/src/components/basic/nmorph-icon/types.d.ts +6 -0
- package/dist/src/components/basic/nmorph-layout/NmorphLayout.vue.d.ts +2 -9
- package/dist/src/components/basic/nmorph-layout/types.d.ts +8 -0
- package/dist/src/components/basic/nmorph-link/NmorphLink.vue.d.ts +3 -14
- package/dist/src/components/basic/nmorph-link/types.d.ts +11 -0
- package/dist/src/components/basic/nmorph-scroll/NmorphScroll.vue.d.ts +2 -2
- package/dist/src/components/basic/nmorph-scroll/types.d.ts +5 -0
- package/dist/src/components/basic/nmorph-space/NmorphSpace.vue.d.ts +2 -15
- package/dist/src/components/basic/nmorph-space/types.d.ts +14 -0
- package/dist/src/components/data/nmorph-avatar/NmorphAvatar.vue.d.ts +5 -20
- package/dist/src/components/data/nmorph-avatar/types.d.ts +21 -0
- package/dist/src/components/data/nmorph-badge/NmorphBadge.vue.d.ts +5 -40
- package/dist/src/components/data/nmorph-badge/types.d.ts +34 -0
- package/dist/src/components/data/nmorph-calendar/NmorphCalendar.vue.d.ts +4 -12
- package/dist/src/components/data/nmorph-calendar/inner-components/nmorph-calendar-header/NmorphCalendarHeader.vue.d.ts +3 -9
- package/dist/src/components/data/nmorph-calendar/inner-components/nmorph-calendar-header/types.d.ts +12 -0
- package/dist/src/components/data/nmorph-calendar/types.d.ts +13 -0
- package/dist/src/components/data/nmorph-card/NmorphCard.vue.d.ts +2 -10
- package/dist/src/components/data/nmorph-card/types.d.ts +9 -0
- package/dist/src/components/data/nmorph-carousel/NmorphCarousel.vue.d.ts +3 -5
- package/dist/src/components/data/nmorph-carousel/components/nmorph-carousel-item/NmorphCarouselItem.vue.d.ts +2 -4
- package/dist/src/components/data/nmorph-carousel/components/nmorph-carousel-item/types.d.ts +3 -0
- package/dist/src/components/data/nmorph-carousel/types.d.ts +6 -0
- package/dist/src/components/data/nmorph-collapse/NmorphCollapse.vue.d.ts +3 -7
- package/dist/src/components/data/nmorph-collapse/components/nmorph-collapse-item/NmorphCollapseItem.vue.d.ts +4 -10
- package/dist/src/components/data/nmorph-collapse/components/nmorph-collapse-item/types.d.ts +13 -0
- package/dist/src/components/data/nmorph-collapse/types.d.ts +7 -0
- package/dist/src/components/data/nmorph-empty/NmorphEmpty.vue.d.ts +3 -12
- package/dist/src/components/data/nmorph-empty/types.d.ts +11 -0
- package/dist/src/components/data/nmorph-image/NmorphImage.vue.d.ts +3 -8
- package/dist/src/components/data/nmorph-image/types.d.ts +10 -0
- package/dist/src/components/data/nmorph-image-preview/NmorphImagePreview.vue.d.ts +3 -18
- package/dist/src/components/data/nmorph-image-preview/types.d.ts +19 -0
- package/dist/src/components/data/nmorph-pagination/NmorphPagination.vue.d.ts +3 -13
- package/dist/src/components/data/nmorph-pagination/types.d.ts +14 -0
- package/dist/src/components/data/nmorph-progress/NmorphProgress.vue.d.ts +3 -15
- package/dist/src/components/data/nmorph-progress/types.d.ts +12 -0
- package/dist/src/components/data/nmorph-qr-code/NmorphQRCode.vue.d.ts +5 -15
- package/dist/src/components/data/nmorph-qr-code/types.d.ts +12 -0
- package/dist/src/components/data/nmorph-skeleton/NmorphSkeleton.vue.d.ts +2 -7
- package/dist/src/components/data/nmorph-skeleton/components/NmorphSkeletonItem.vue.d.ts +3 -9
- package/dist/src/components/data/nmorph-skeleton/components/types.d.ts +8 -0
- package/dist/src/components/data/nmorph-skeleton/types.d.ts +6 -0
- package/dist/src/components/data/nmorph-table/NmorphTable.vue.d.ts +4 -18
- package/dist/src/components/data/nmorph-table/components/nmorph-table-cell/NmorphTableCell.vue.d.ts +2 -4
- package/dist/src/components/data/nmorph-table/components/nmorph-table-cell/types.d.ts +3 -0
- package/dist/src/components/data/nmorph-table/components/nmorph-table-column/NmorphTableColumn.vue.d.ts +4 -5
- package/dist/src/components/data/nmorph-table/components/nmorph-table-column/types.d.ts +3 -0
- package/dist/src/components/data/nmorph-table/inner-components/nmorph-sort-button/NmorphSortButton.vue.d.ts +4 -6
- package/dist/src/components/data/nmorph-table/inner-components/nmorph-sort-button/types.d.ts +7 -0
- package/dist/src/components/data/nmorph-table/types.d.ts +15 -0
- package/dist/src/components/data/nmorph-tag-list/NmorphTagList.vue.d.ts +5 -8
- package/dist/src/components/data/nmorph-tag-list/components/nmorph-tag-item/NmorphTagItem.vue.d.ts +3 -5
- package/dist/src/components/data/nmorph-tag-list/components/nmorph-tag-item/types.d.ts +6 -0
- package/dist/src/components/data/nmorph-tag-list/types.d.ts +7 -0
- package/dist/src/components/data/nmorph-virtual-list/NmorphVirtualList.vue.d.ts +3 -14
- package/dist/src/components/data/nmorph-virtual-list/types.d.ts +15 -0
- package/dist/src/components/feedback/nmorph-alert/NmorphAlert.vue.d.ts +5 -7
- package/dist/src/components/feedback/nmorph-alert/types.d.ts +5 -0
- package/dist/src/components/feedback/nmorph-callout/NmorphCallout.vue.d.ts +4 -16
- package/dist/src/components/feedback/nmorph-callout/types.d.ts +12 -0
- package/dist/src/components/feedback/nmorph-dialog/NmorphDialog.vue.d.ts +4 -19
- package/dist/src/components/feedback/nmorph-dialog/types.d.ts +20 -0
- package/dist/src/components/feedback/nmorph-drawer/NmorphDrawer.vue.d.ts +4 -17
- package/dist/src/components/feedback/nmorph-drawer/types.d.ts +18 -0
- package/dist/src/components/feedback/nmorph-tooltip/NmorphTooltip.vue.d.ts +5 -14
- package/dist/src/components/feedback/nmorph-tooltip/types.d.ts +11 -0
- package/dist/src/components/form/nmorph-autocomplete/NmorphAutocomplete.vue.d.ts +6 -19
- package/dist/src/components/form/nmorph-autocomplete/types.d.ts +18 -0
- package/dist/src/components/form/nmorph-checkbox/NmorphCheckbox.vue.d.ts +1 -1
- package/dist/src/components/form/nmorph-checkbox/types.d.ts +3 -0
- package/dist/src/components/form/nmorph-checkbox-group/NmorphCheckboxGroup.vue.d.ts +4 -10
- package/dist/src/components/form/nmorph-checkbox-group/types.d.ts +11 -0
- package/dist/src/components/form/nmorph-color-picker/NmorphColorPicker.vue.d.ts +6 -11
- package/dist/src/components/form/nmorph-color-picker/types.d.ts +11 -0
- package/dist/src/components/form/nmorph-date-picker/NmorphDatePicker.vue.d.ts +4 -20
- package/dist/src/components/form/nmorph-date-picker/inner-components/nmorph-clear-button/types.d.ts +3 -0
- package/dist/src/components/form/nmorph-date-picker/inner-components/nmorph-date-picker-content/NmorphDatePickerContent.vue.d.ts +3 -8
- package/dist/src/components/form/nmorph-date-picker/inner-components/nmorph-date-picker-content/types.d.ts +10 -0
- package/dist/src/components/form/nmorph-date-picker/inner-components/nmorph-date-picker-header/NmorphDatePickerHeader.vue.d.ts +3 -6
- package/dist/src/components/form/nmorph-date-picker/inner-components/nmorph-date-picker-header/types.d.ts +12 -0
- package/dist/src/components/form/nmorph-date-picker/inner-components/nmorph-year-month-picker/NmorphYearMonthPicker.vue.d.ts +3 -6
- package/dist/src/components/form/nmorph-date-picker/inner-components/nmorph-year-month-picker/types.d.ts +9 -0
- package/dist/src/components/form/nmorph-date-picker/types.d.ts +21 -0
- package/dist/src/components/form/nmorph-file-upload/NmorphFileUpload.vue.d.ts +5 -13
- package/dist/src/components/form/nmorph-file-upload/types.d.ts +17 -0
- package/dist/src/components/form/nmorph-form/NmorphForm.vue.d.ts +4 -8
- package/dist/src/components/form/nmorph-form/components/nmorph-form-item/NmorphFormItem.vue.d.ts +3 -12
- package/dist/src/components/form/nmorph-form/components/nmorph-form-item/inner-components/nmorph-error-box/NmorphErrorBox.vue.d.ts +3 -8
- package/dist/src/components/form/nmorph-form/components/nmorph-form-item/inner-components/nmorph-error-box/types.d.ts +7 -0
- package/dist/src/components/form/nmorph-form/components/nmorph-form-item/inner-components/nmorph-validation-icon/NmorphValidationIcon.vue.d.ts +3 -6
- package/dist/src/components/form/nmorph-form/components/nmorph-form-item/inner-components/nmorph-validation-icon/types.d.ts +5 -0
- package/dist/src/components/form/nmorph-form/components/nmorph-form-item/types.d.ts +10 -0
- package/dist/src/components/form/nmorph-form/types.d.ts +6 -1
- package/dist/src/components/form/nmorph-number-input/NmorphNumberInput.vue.d.ts +3 -10
- package/dist/src/components/form/nmorph-number-input/types.d.ts +11 -0
- package/dist/src/components/form/nmorph-otp-input/NmorphOTPInput.vue.d.ts +5 -13
- package/dist/src/components/form/nmorph-otp-input/types.d.ts +21 -0
- package/dist/src/components/form/nmorph-radio/NmorphRadio.vue.d.ts +4 -9
- package/dist/src/components/form/nmorph-radio/types.d.ts +6 -0
- package/dist/src/components/form/nmorph-radio-group/NmorphRadioGroup.vue.d.ts +3 -11
- package/dist/src/components/form/nmorph-radio-group/types.d.ts +12 -0
- package/dist/src/components/form/nmorph-select/NmorphSelect.vue.d.ts +3 -21
- package/dist/src/components/form/nmorph-select/components/nmorph-select-option/NmorphSelectOption.vue.d.ts +1 -1
- package/dist/src/components/form/nmorph-select/components/nmorph-select-option/types.d.ts +3 -0
- package/dist/src/components/form/nmorph-select/types.d.ts +21 -0
- package/dist/src/components/form/nmorph-select-button/NmorphSelectButton.vue.d.ts +4 -12
- package/dist/src/components/form/nmorph-select-button/components/nmorph-select-button-item/NmorphSelectButtonItem.vue.d.ts +3 -6
- package/dist/src/components/form/nmorph-select-button/components/nmorph-select-button-item/types.d.ts +4 -0
- package/dist/src/components/form/nmorph-select-button/types.d.ts +12 -0
- package/dist/src/components/form/nmorph-slider/NmorphSlider.vue.d.ts +111 -0
- package/dist/src/components/form/nmorph-slider/types.d.ts +3 -0
- package/dist/src/components/form/nmorph-switch/NmorphSwitch.vue.d.ts +3 -14
- package/dist/src/components/form/nmorph-switch/types.d.ts +15 -0
- package/dist/src/components/form/nmorph-text-input/NmorphTextInput.vue.d.ts +6 -14
- package/dist/src/components/form/nmorph-text-input/types.d.ts +16 -0
- package/dist/src/components/form/nmorph-textarea/NmorphTextarea.vue.d.ts +6 -18
- package/dist/src/components/form/nmorph-textarea/types.d.ts +20 -0
- package/dist/src/components/form/nmorph-time-picker/NmorphTimePicker.vue.d.ts +6 -20
- package/dist/src/components/form/nmorph-time-picker/types.d.ts +24 -0
- package/dist/src/components/navigation/index.d.ts +1 -1
- package/dist/src/components/navigation/nmorph-backtop/NmorphBacktop.vue.d.ts +4 -12
- package/dist/src/components/navigation/nmorph-backtop/types.d.ts +14 -0
- package/dist/src/components/navigation/nmorph-breadcrumb/NmorphBreadcrumb.vue.d.ts +2 -4
- package/dist/src/components/navigation/nmorph-breadcrumb/components/nmorph-breadcrumb-item/NmorphBreadcrumbItem.vue.d.ts +2 -4
- package/dist/src/components/navigation/nmorph-breadcrumb/components/nmorph-breadcrumb-item/types.d.ts +3 -0
- package/dist/src/components/navigation/nmorph-breadcrumb/types.d.ts +3 -0
- package/dist/src/components/navigation/nmorph-context-menu/NmorphContextMenu.vue.d.ts +10 -31
- package/dist/src/components/navigation/nmorph-context-menu/types.d.ts +42 -0
- package/dist/src/components/navigation/nmorph-dropdown/NmorphDropdown.vue.d.ts +6 -24
- package/dist/src/components/navigation/nmorph-dropdown/types.d.ts +24 -0
- package/dist/src/components/navigation/nmorph-tabs/NmorphTabs.vue.d.ts +4 -8
- package/dist/src/components/navigation/nmorph-tabs/components/nmorph-tab-pane/NmorphTabPane.vue.d.ts +4 -5
- package/dist/src/components/navigation/nmorph-tabs/components/nmorph-tab-pane/types.d.ts +3 -0
- package/dist/src/components/navigation/nmorph-tabs/{type.d.ts → types.d.ts} +9 -0
- package/dist/src/components/navigation/nmorph-tabs/utils.d.ts +1 -1
- package/dist/src/components/others/nmorph-divider/NmorphDivider.vue.d.ts +2 -5
- package/dist/src/components/others/nmorph-divider/types.d.ts +3 -0
- package/dist/src/components/others/nmorph-overlay/NmorphOverlay.vue.d.ts +3 -12
- package/dist/src/components/others/nmorph-overlay/types.d.ts +14 -0
- package/dist/src/components/providers/nmorph-notification-provider/NmorphNotificationProvider.vue.d.ts +2 -8
- package/dist/src/components/providers/nmorph-notification-provider/types.d.ts +9 -0
- package/dist/src/hooks/use-focusable-input.d.ts +16 -0
- package/dist/src/hooks/use-form-validation.d.ts +1 -2
- package/dist/src/plugin.d.ts +4 -1
- package/dist/src/types/app.types.d.ts +21 -0
- package/dist/src/types/common.types.d.ts +62 -0
- package/dist/src/types/date.types.d.ts +7 -0
- package/dist/src/types/image.types.d.ts +17 -0
- package/dist/src/types/index.d.ts +8 -206
- package/dist/src/types/selection.types.d.ts +26 -0
- package/dist/src/types/table.types.d.ts +5 -0
- package/dist/src/types/theme.types.d.ts +55 -0
- package/dist/src/types/translation.types.d.ts +20 -0
- package/dist/src/utils/common.d.ts +3 -0
- package/dist/src/utils/file-types.d.ts +8 -0
- package/dist/src/utils/index.d.ts +1 -0
- package/dist/style.css +1 -1
- package/dist/types/common.types.js +14 -0
- package/dist/types/date.types.js +4 -0
- package/dist/types/image.types.js +5 -0
- package/dist/types/selection.types.js +4 -0
- package/dist/types/table.types.js +4 -0
- package/dist/types/translation.types.js +4 -0
- package/dist/utils/common.js +16 -6
- package/dist/utils/file-types.js +41 -0
- package/package.json +1 -1
- package/dist/src/components/data/nmorph-calendar/hooks/index.d.ts +0 -2
- package/dist/src/hooks/index.d.ts +0 -9
- package/dist/src/outside-hooks/index.d.ts +0 -5
- package/dist/types/index.js +0 -20
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import './NmorphTextInput.css';
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { defineComponent as k, useSlots as C, computed as o, ref as E } from "vue";
|
|
3
|
+
import { useModifiers as O } from "../../../utils/create-modifiers.js";
|
|
4
|
+
import { useFocusableInput as V } from "../../../hooks/use-focusable-input.js";
|
|
5
5
|
import { useFormItemInput as j, useFormItemModel as H } from "../nmorph-form/use-form-item-input.js";
|
|
6
|
+
import { NmorphComponentHeight as R } from "../../../types/common.types.js";
|
|
6
7
|
import A from "../../../assets/icons/eye-blocked.svg.js";
|
|
7
8
|
import D from "../../../assets/icons/eye.svg.js";
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
const
|
|
9
|
+
import T from "../../basic/nmorph-button/NmorphButton.vue.js";
|
|
10
|
+
import z from "../../basic/nmorph-icon/NmorphIcon.vue.js";
|
|
11
|
+
import G from "../../../assets/icons/error.svg.js";
|
|
12
|
+
const ee = /* @__PURE__ */ k({
|
|
12
13
|
__name: "NmorphTextInput",
|
|
13
14
|
props: {
|
|
14
15
|
placeholder: { type: String, required: !1, default: "" },
|
|
@@ -25,41 +26,42 @@ const Z = /* @__PURE__ */ E({
|
|
|
25
26
|
tabindex: { type: Number, required: !1 }
|
|
26
27
|
},
|
|
27
28
|
emits: ["update:model-value", "focus", "blur", "on-enter", "keydown"],
|
|
28
|
-
setup(
|
|
29
|
-
const
|
|
29
|
+
setup(f, { expose: h, emit: y }) {
|
|
30
|
+
const l = C(), e = f, r = y, { id: b, name: g, autocomplete: q, tabindex: I } = j(e), { modelValue: v, updateModelValue: n } = H(
|
|
30
31
|
e,
|
|
31
|
-
(
|
|
32
|
+
(a) => r("update:model-value", a),
|
|
32
33
|
""
|
|
33
|
-
),
|
|
34
|
-
() =>
|
|
35
|
-
nmorph: [
|
|
34
|
+
), w = o(
|
|
35
|
+
() => O({
|
|
36
|
+
nmorph: [R[e.height], u.value && "focused"],
|
|
36
37
|
"nmorph-text-input": [e.typePassword && "password", (e.typePassword || e.clearable) && "with-action"]
|
|
37
38
|
})
|
|
38
|
-
),
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
}, t =
|
|
42
|
-
e.clearable ?
|
|
43
|
-
},
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
39
|
+
), x = (a) => {
|
|
40
|
+
const M = a.target;
|
|
41
|
+
n(M.value);
|
|
42
|
+
}, t = E(!1), N = () => {
|
|
43
|
+
e.clearable ? n("") : t.value = !t.value;
|
|
44
|
+
}, _ = o(() => e.typePassword && !t.value && !e.clearable ? "password" : "text"), {
|
|
45
|
+
elementRef: s,
|
|
46
|
+
focused: u,
|
|
47
|
+
handleFocus: B,
|
|
48
|
+
handleBlur: S,
|
|
49
|
+
focus: p,
|
|
50
|
+
blur: i,
|
|
51
|
+
select: d
|
|
52
|
+
} = V({
|
|
53
|
+
onFocus: () => r("focus"),
|
|
54
|
+
onBlur: () => r("blur")
|
|
55
|
+
});
|
|
56
|
+
h({ inputDOMRef: s, focus: p, blur: i, select: d });
|
|
57
|
+
const P = o(() => e.clearable ? G : t.value ? A : D), m = o(() => e.indentation || (l["prepend-icon"] ? "28px" : "8px")), F = o(() => ({ "--nmorph-text-input-indentation": m.value })), c = { slots: l, props: e, emit: r, id: b, name: g, autocomplete: q, tabindex: I, modelValue: v, updateModelValue: n, modifiers: w, handleInput: x, showPassword: t, actionButtonClickHandler: N, type: _, inputDOMRef: s, focused: u, handleFocus: B, handleBlur: S, focus: p, blur: i, select: d, actionIcon: P, indentation: m, styles: F, get NmorphIcon() {
|
|
58
|
+
return z;
|
|
57
59
|
}, get NmorphButton() {
|
|
58
|
-
return
|
|
60
|
+
return T;
|
|
59
61
|
} };
|
|
60
|
-
return Object.defineProperty(
|
|
62
|
+
return Object.defineProperty(c, "__isScriptSetup", { enumerable: !1, value: !0 }), c;
|
|
61
63
|
}
|
|
62
64
|
});
|
|
63
65
|
export {
|
|
64
|
-
|
|
66
|
+
ee as default
|
|
65
67
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import './NmorphTextarea.css';
|
|
2
|
-
import
|
|
3
|
-
import { openBlock as
|
|
2
|
+
import n from "./NmorphTextarea.vue2.js";
|
|
3
|
+
import { openBlock as a, createElementBlock as l, normalizeStyle as t, normalizeClass as d, createElementVNode as i, mergeProps as m, withKeys as s } from "vue";
|
|
4
4
|
/* empty css */
|
|
5
5
|
import p from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
6
|
-
const
|
|
7
|
-
function
|
|
8
|
-
return
|
|
6
|
+
const f = ["id", "name", "autocomplete", "tabindex", "placeholder", "disabled", "value", "rows"];
|
|
7
|
+
function x(c, o, b, e, h, y) {
|
|
8
|
+
return a(), l(
|
|
9
9
|
"div",
|
|
10
10
|
{
|
|
11
11
|
class: d(e.modifiers),
|
|
12
|
-
style:
|
|
12
|
+
style: t(e.styles)
|
|
13
13
|
},
|
|
14
14
|
[
|
|
15
15
|
i("textarea", m({
|
|
@@ -25,17 +25,17 @@ function f(x, o, h, e, b, y) {
|
|
|
25
25
|
rows: e.rows
|
|
26
26
|
}, e.props.textareaAttrs, {
|
|
27
27
|
onInput: e.handleInput,
|
|
28
|
-
onFocus: e.handleFocus,
|
|
29
|
-
onBlur: e.handleBlur,
|
|
30
|
-
onKeydown: o[
|
|
31
|
-
onKeyup: o[
|
|
32
|
-
}), null, 16,
|
|
28
|
+
onFocus: o[0] || (o[0] = (...r) => e.handleFocus && e.handleFocus(...r)),
|
|
29
|
+
onBlur: o[1] || (o[1] = (...r) => e.handleBlur && e.handleBlur(...r)),
|
|
30
|
+
onKeydown: o[2] || (o[2] = (r) => e.emit("keydown", r)),
|
|
31
|
+
onKeyup: o[3] || (o[3] = s((r) => e.emit("on-enter"), ["enter"]))
|
|
32
|
+
}), null, 16, f)
|
|
33
33
|
],
|
|
34
34
|
6
|
|
35
35
|
/* CLASS, STYLE */
|
|
36
36
|
);
|
|
37
37
|
}
|
|
38
|
-
const k = /* @__PURE__ */ p(
|
|
38
|
+
const k = /* @__PURE__ */ p(n, [["render", x], ["__file", "/builds/ketjo/nmorph/library/src/components/form/nmorph-textarea/NmorphTextarea.vue"]]);
|
|
39
39
|
export {
|
|
40
40
|
k as default
|
|
41
41
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import './NmorphTextarea.css';
|
|
2
|
-
import { defineComponent as B,
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { useFormItemInput as
|
|
6
|
-
|
|
2
|
+
import { defineComponent as B, computed as n, watch as C, onMounted as T, nextTick as V } from "vue";
|
|
3
|
+
import { useModifiers as O } from "../../../utils/create-modifiers.js";
|
|
4
|
+
import { useFocusableInput as j } from "../../../hooks/use-focusable-input.js";
|
|
5
|
+
import { useFormItemInput as k, useFormItemModel as P } from "../nmorph-form/use-form-item-input.js";
|
|
6
|
+
import { NmorphComponentHeight as A } from "../../../types/common.types.js";
|
|
7
|
+
const J = /* @__PURE__ */ B({
|
|
7
8
|
__name: "NmorphTextarea",
|
|
8
9
|
props: {
|
|
9
10
|
placeholder: { type: String, required: !1, default: "" },
|
|
@@ -23,49 +24,50 @@ const G = /* @__PURE__ */ B({
|
|
|
23
24
|
tabindex: { type: Number, required: !1 }
|
|
24
25
|
},
|
|
25
26
|
emits: ["update:model-value", "focus", "blur", "on-enter", "keydown"],
|
|
26
|
-
setup(
|
|
27
|
-
const e =
|
|
27
|
+
setup(g, { expose: x, emit: b }) {
|
|
28
|
+
const e = g, r = b, { id: w, name: q, autocomplete: S, tabindex: v } = k(e), { modelValue: s, updateModelValue: l } = P(
|
|
28
29
|
e,
|
|
29
|
-
(t) =>
|
|
30
|
+
(t) => r("update:model-value", t),
|
|
30
31
|
""
|
|
31
|
-
),
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
), {
|
|
33
|
+
elementRef: i,
|
|
34
|
+
focused: u,
|
|
35
|
+
handleFocus: _,
|
|
36
|
+
handleBlur: z,
|
|
37
|
+
focus: d,
|
|
38
|
+
blur: p,
|
|
39
|
+
select: m
|
|
40
|
+
} = j({
|
|
41
|
+
onFocus: () => r("focus"),
|
|
42
|
+
onBlur: () => r("blur")
|
|
43
|
+
}), F = n(
|
|
44
|
+
() => O({
|
|
45
|
+
nmorph: [A[e.height], u.value && "focused"],
|
|
34
46
|
"nmorph-textarea": [e.disabled && "disabled", e.autoSize && "auto-size"]
|
|
35
47
|
})
|
|
36
|
-
),
|
|
48
|
+
), f = (t) => {
|
|
37
49
|
const o = window.getComputedStyle(t);
|
|
38
50
|
return parseFloat(o.paddingTop) + parseFloat(o.paddingBottom);
|
|
39
|
-
},
|
|
51
|
+
}, a = async () => {
|
|
40
52
|
if (!e.autoSize) return;
|
|
41
|
-
await
|
|
42
|
-
const t =
|
|
53
|
+
await V();
|
|
54
|
+
const t = i.value;
|
|
43
55
|
if (!t) return;
|
|
44
56
|
t.style.height = "auto";
|
|
45
|
-
const o = window.getComputedStyle(t),
|
|
46
|
-
t.style.height = `${
|
|
57
|
+
const o = window.getComputedStyle(t), I = parseFloat(o.lineHeight) || 20, y = e.maxRows ? e.maxRows * I + f(t) : 1 / 0, N = Math.min(t.scrollHeight, y);
|
|
58
|
+
t.style.height = `${N}px`, t.style.overflowY = t.scrollHeight > y ? "auto" : "hidden";
|
|
47
59
|
}, M = (t) => {
|
|
48
60
|
const o = t.target;
|
|
49
|
-
|
|
50
|
-
}, H = () => {
|
|
51
|
-
n("focus"), s.value = !0;
|
|
52
|
-
}, R = () => {
|
|
53
|
-
n("blur"), s.value = !1;
|
|
54
|
-
}, p = () => {
|
|
55
|
-
a.value?.focus();
|
|
56
|
-
}, m = () => {
|
|
57
|
-
a.value?.blur();
|
|
58
|
-
}, f = () => {
|
|
59
|
-
a.value?.select();
|
|
61
|
+
l(o.value), a();
|
|
60
62
|
};
|
|
61
|
-
|
|
62
|
-
const c =
|
|
63
|
+
C(s, a), T(a), x({ textareaDOMRef: i, focus: d, blur: p, select: m, resizeToContent: a });
|
|
64
|
+
const c = n(() => Math.max(e.minRows, 1)), R = n(() => Math.max(e.rows, c.value)), H = n(() => ({
|
|
63
65
|
"--nmorph-textarea-resize": e.autoSize ? "none" : e.resize,
|
|
64
66
|
"--nmorph-textarea-indentation": e.indentation
|
|
65
|
-
})), h = { props: e, emit:
|
|
67
|
+
})), h = { props: e, emit: r, id: w, name: q, autocomplete: S, tabindex: v, modelValue: s, updateModelValue: l, textareaDOMRef: i, focused: u, handleFocus: _, handleBlur: z, focus: d, blur: p, select: m, modifiers: F, getVerticalPadding: f, resizeToContent: a, handleInput: M, minRows: c, rows: R, styles: H };
|
|
66
68
|
return Object.defineProperty(h, "__isScriptSetup", { enumerable: !1, value: !0 }), h;
|
|
67
69
|
}
|
|
68
70
|
});
|
|
69
71
|
export {
|
|
70
|
-
|
|
72
|
+
J as default
|
|
71
73
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
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
|
|
3
|
+
import { openBlock as i, createElementBlock as n, normalizeStyle as v, normalizeClass as a, 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
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"],
|
|
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"], H = {
|
|
7
7
|
class: "nmorph-time-picker__column",
|
|
8
8
|
role: "listbox",
|
|
9
9
|
"aria-label": "Hours"
|
|
10
|
-
},
|
|
10
|
+
}, g = ["disabled", "onClick"], O = {
|
|
11
11
|
class: "nmorph-time-picker__column",
|
|
12
12
|
role: "listbox",
|
|
13
13
|
"aria-label": "Minutes"
|
|
@@ -16,11 +16,11 @@ const y = ["aria-expanded", "aria-controls", "tabindex", "onKeydown"], w = ["id"
|
|
|
16
16
|
role: "listbox",
|
|
17
17
|
"aria-label": "Seconds"
|
|
18
18
|
}, V = ["disabled", "onClick"];
|
|
19
|
-
function I(S,
|
|
19
|
+
function I(S, l, z, e, B, D) {
|
|
20
20
|
return i(), n(
|
|
21
21
|
"div",
|
|
22
22
|
{
|
|
23
|
-
class:
|
|
23
|
+
class: a(e.modifiers),
|
|
24
24
|
style: v(e.styles)
|
|
25
25
|
},
|
|
26
26
|
[
|
|
@@ -32,8 +32,8 @@ function I(S, a, z, e, B, D) {
|
|
|
32
32
|
"aria-controls": `${e.id}-dropdown`,
|
|
33
33
|
tabindex: e.props.disabled ? -1 : e.tabindex,
|
|
34
34
|
onClick: e.toggleOpen,
|
|
35
|
-
onFocus: e.focusHandler,
|
|
36
|
-
onBlur: e.blurHandler,
|
|
35
|
+
onFocus: l[0] || (l[0] = (...o) => e.focusHandler && e.focusHandler(...o)),
|
|
36
|
+
onBlur: l[1] || (l[1] = (...o) => e.blurHandler && e.blurHandler(...o)),
|
|
37
37
|
onKeydown: [
|
|
38
38
|
m(t(e.toggleOpen, ["prevent"]), ["space"]),
|
|
39
39
|
m(t(e.toggleOpen, ["prevent"]), ["enter"]),
|
|
@@ -98,41 +98,41 @@ function I(S, a, z, e, B, D) {
|
|
|
98
98
|
default: p(() => [
|
|
99
99
|
r("div", {
|
|
100
100
|
id: `${e.id}-dropdown`,
|
|
101
|
-
class:
|
|
101
|
+
class: a(["nmorph-time-picker__panel", { "nmorph-time-picker__panel--with-seconds": e.props.showSeconds }])
|
|
102
102
|
}, [
|
|
103
|
-
r("div",
|
|
103
|
+
r("div", H, [
|
|
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:
|
|
110
|
+
class: a(["nmorph-time-picker__option", [
|
|
111
111
|
e.optionHeightModifiers,
|
|
112
112
|
{ "nmorph-time-picker__option--active": o.value === e.pickerValue.hour }
|
|
113
113
|
]]),
|
|
114
114
|
disabled: o.disabled,
|
|
115
115
|
onClick: (k) => e.selectUnit("hour", o.value)
|
|
116
|
-
}, c(o.label), 11,
|
|
116
|
+
}, c(o.label), 11, g))),
|
|
117
117
|
128
|
|
118
118
|
/* KEYED_FRAGMENT */
|
|
119
119
|
))
|
|
120
120
|
]),
|
|
121
|
-
|
|
121
|
+
l[3] || (l[3] = r(
|
|
122
122
|
"div",
|
|
123
123
|
{ class: "nmorph-time-picker__separator" },
|
|
124
124
|
":",
|
|
125
125
|
-1
|
|
126
126
|
/* CACHED */
|
|
127
127
|
)),
|
|
128
|
-
r("div",
|
|
128
|
+
r("div", O, [
|
|
129
129
|
(i(!0), n(
|
|
130
130
|
s,
|
|
131
131
|
null,
|
|
132
132
|
h(e.minuteOptions, (o) => (i(), n("button", {
|
|
133
133
|
key: o.value,
|
|
134
134
|
type: "button",
|
|
135
|
-
class:
|
|
135
|
+
class: a(["nmorph-time-picker__option", [
|
|
136
136
|
e.optionHeightModifiers,
|
|
137
137
|
{ "nmorph-time-picker__option--active": o.value === e.pickerValue.minute }
|
|
138
138
|
]]),
|
|
@@ -147,7 +147,7 @@ function I(S, a, z, e, B, D) {
|
|
|
147
147
|
s,
|
|
148
148
|
{ key: 0 },
|
|
149
149
|
[
|
|
150
|
-
|
|
150
|
+
l[2] || (l[2] = r(
|
|
151
151
|
"div",
|
|
152
152
|
{ class: "nmorph-time-picker__separator" },
|
|
153
153
|
":",
|
|
@@ -161,7 +161,7 @@ function I(S, a, z, e, B, D) {
|
|
|
161
161
|
h(e.secondOptions, (o) => (i(), n("button", {
|
|
162
162
|
key: o.value,
|
|
163
163
|
type: "button",
|
|
164
|
-
class:
|
|
164
|
+
class: a(["nmorph-time-picker__option", [
|
|
165
165
|
e.optionHeightModifiers,
|
|
166
166
|
{ "nmorph-time-picker__option--active": o.value === e.pickerValue.second }
|
|
167
167
|
]]),
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import './NmorphTimePicker.css';
|
|
2
|
-
import { defineComponent as te, ref as
|
|
3
|
-
import { NmorphComponentHeight as O } from "../../../types/index.js";
|
|
2
|
+
import { defineComponent as te, ref as _, computed as n, watch as oe } from "vue";
|
|
4
3
|
import { useI18n as re } from "vue-i18n";
|
|
5
|
-
import { useModifiers as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import se from "
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
|
|
4
|
+
import { useModifiers as O } from "../../../utils/create-modifiers.js";
|
|
5
|
+
import { createCssSizeVariables as ne } from "../../../utils/common.js";
|
|
6
|
+
import { useFocusableInput as ue } from "../../../hooks/use-focusable-input.js";
|
|
7
|
+
import { useFormItemInput as le, useFormItemModel as se } from "../nmorph-form/use-form-item-input.js";
|
|
8
|
+
import { NmorphComponentHeight as B } from "../../../types/common.types.js";
|
|
9
|
+
import ae from "../../../assets/icons/clock.svg.js";
|
|
10
|
+
import ie from "../../../assets/icons/circle-close.svg.js";
|
|
11
|
+
import de from "../../basic/nmorph-icon/NmorphIcon.vue.js";
|
|
12
|
+
import ce from "../../navigation/nmorph-dropdown/NmorphDropdown.vue.js";
|
|
13
|
+
const Ie = /* @__PURE__ */ te({
|
|
13
14
|
__name: "NmorphTimePicker",
|
|
14
15
|
props: {
|
|
15
16
|
modelValue: { type: [String, null], required: !1, default: null },
|
|
@@ -31,87 +32,93 @@ const Ne = /* @__PURE__ */ te({
|
|
|
31
32
|
tabindex: { type: Number, required: !1 }
|
|
32
33
|
},
|
|
33
34
|
emits: ["update:model-value", "focus", "blur"],
|
|
34
|
-
setup(
|
|
35
|
-
const t =
|
|
35
|
+
setup(H, { expose: M, emit: k }) {
|
|
36
|
+
const t = H, m = k, { t: I } = re(), { id: F, name: P, autocomplete: $, tabindex: z } = le(t), { modelValue: s, updateModelValue: p } = se(
|
|
36
37
|
t,
|
|
37
38
|
(e) => m("update:model-value", e),
|
|
38
39
|
null
|
|
39
|
-
), a =
|
|
40
|
+
), a = _(!1), {
|
|
41
|
+
elementRef: T,
|
|
42
|
+
focused: w,
|
|
43
|
+
handleFocus: D,
|
|
44
|
+
handleBlur: R
|
|
45
|
+
} = ue({
|
|
46
|
+
onFocus: () => m("focus"),
|
|
47
|
+
onBlur: () => m("blur")
|
|
48
|
+
}), c = (e) => String(e).padStart(2, "0"), f = (e) => Math.max(1, Math.floor(Number.isFinite(e) ? e : 1)), i = (e) => {
|
|
40
49
|
if (!e) return null;
|
|
41
50
|
const o = e.match(/^(\d{1,2}):(\d{2})(?::(\d{2}))?$/);
|
|
42
51
|
if (!o) return null;
|
|
43
|
-
const r = Number(o[1]),
|
|
44
|
-
return r > 23 ||
|
|
45
|
-
},
|
|
52
|
+
const r = Number(o[1]), v = Number(o[2]), d = Number(o[3] || 0);
|
|
53
|
+
return r > 23 || v > 59 || d > 59 ? null : { hour: r, minute: v, second: d };
|
|
54
|
+
}, g = (e) => {
|
|
46
55
|
const o = `${c(e.hour)}:${c(e.minute)}`;
|
|
47
56
|
return t.showSeconds ? `${o}:${c(e.second)}` : o;
|
|
48
|
-
},
|
|
57
|
+
}, h = (e) => e.hour * 3600 + e.minute * 60 + e.second, y = n(() => i(t.minTime)), N = n(() => i(t.maxTime)), x = n(() => i(s.value)), l = _(x.value || { hour: 0, minute: 0, second: 0 }), C = n(() => t.placeholder || I("pickATime"));
|
|
49
58
|
oe(s, (e) => {
|
|
50
59
|
const o = i(e);
|
|
51
|
-
o && (
|
|
60
|
+
o && (l.value = o);
|
|
52
61
|
});
|
|
53
|
-
const
|
|
54
|
-
const o =
|
|
55
|
-
return !!(
|
|
56
|
-
},
|
|
57
|
-
const
|
|
58
|
-
for (let
|
|
59
|
-
return d.add(
|
|
60
|
-
const
|
|
62
|
+
const b = (e) => {
|
|
63
|
+
const o = h(e);
|
|
64
|
+
return !!(y.value && o < h(y.value) || N.value && o > h(N.value));
|
|
65
|
+
}, S = (e, o, r) => {
|
|
66
|
+
const v = f(r), d = /* @__PURE__ */ new Set();
|
|
67
|
+
for (let u = 0; u <= o; u += v) d.add(u);
|
|
68
|
+
return d.add(l.value[e]), Array.from(d).filter((u) => u >= 0 && u <= o).sort((u, q) => u - q).map((u) => {
|
|
69
|
+
const q = { ...l.value, [e]: u };
|
|
61
70
|
return {
|
|
62
|
-
label: c(
|
|
63
|
-
value:
|
|
64
|
-
disabled:
|
|
71
|
+
label: c(u),
|
|
72
|
+
value: u,
|
|
73
|
+
disabled: b(q)
|
|
65
74
|
};
|
|
66
75
|
});
|
|
67
|
-
},
|
|
68
|
-
const r = { ...
|
|
69
|
-
|
|
70
|
-
}, j = () => {
|
|
71
|
-
p(null), a.value = !1;
|
|
72
|
-
}, E = () => {
|
|
73
|
-
a.value = !1;
|
|
76
|
+
}, A = n(() => S("hour", 23, t.hourStep)), U = n(() => S("minute", 59, t.minuteStep)), j = n(() => S("second", 59, t.secondStep)), E = (e, o) => {
|
|
77
|
+
const r = { ...l.value, [e]: o };
|
|
78
|
+
b(r) || (l.value = r, p(g(r)));
|
|
74
79
|
}, G = () => {
|
|
75
|
-
|
|
80
|
+
p(null), a.value = !1;
|
|
76
81
|
}, J = () => {
|
|
77
|
-
|
|
82
|
+
a.value = !1;
|
|
78
83
|
}, K = () => {
|
|
79
|
-
|
|
84
|
+
t.disabled || (a.value = !a.value);
|
|
80
85
|
}, L = (e) => {
|
|
81
86
|
const o = e.target, r = i(o.value);
|
|
82
|
-
!r ||
|
|
83
|
-
}, Q = n(() => s.value ||
|
|
84
|
-
() => t.showSeconds ?
|
|
87
|
+
!r || b(r) || (l.value = r, p(g(r)));
|
|
88
|
+
}, Q = n(() => s.value || C.value), W = n(
|
|
89
|
+
() => t.showSeconds ? f(t.secondStep) : f(t.minuteStep) * 60
|
|
85
90
|
), X = n(() => t.clearable && !!s.value && !t.disabled), Y = n(
|
|
86
|
-
() =>
|
|
87
|
-
nmorph: [
|
|
91
|
+
() => O({
|
|
92
|
+
nmorph: [B[t.height]],
|
|
88
93
|
"nmorph-time-picker": [
|
|
89
94
|
t.disabled && "disabled",
|
|
90
95
|
a.value && "open",
|
|
91
|
-
|
|
96
|
+
w.value && "focus",
|
|
92
97
|
!s.value && "placeholder"
|
|
93
98
|
]
|
|
94
99
|
})
|
|
95
100
|
), Z = n(
|
|
96
|
-
() =>
|
|
97
|
-
nmorph: [
|
|
101
|
+
() => O({
|
|
102
|
+
nmorph: [B[t.height]]
|
|
98
103
|
})
|
|
99
|
-
), ee = n(
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
104
|
+
), ee = n(
|
|
105
|
+
() => ne({
|
|
106
|
+
"--width": t.width
|
|
107
|
+
})
|
|
108
|
+
);
|
|
109
|
+
M({ inputDOMRef: T });
|
|
110
|
+
const V = { props: t, emit: m, t: I, id: F, name: P, autocomplete: $, tabindex: z, modelValue: s, updateModelValue: p, open: a, inputDOMRef: T, focused: w, focusHandler: D, blurHandler: R, pad: c, normalizeStep: f, parseTime: i, formatTime: g, timeToSeconds: h, minTimeParts: y, maxTimeParts: N, modelTimeParts: x, pickerValue: l, placeholderText: C, isOutsideRange: b, getUnitOptions: S, hourOptions: A, minuteOptions: U, secondOptions: j, selectUnit: E, clearHandler: G, closeHandler: J, toggleOpen: K, nativeInputHandler: L, displayValue: Q, inputStep: W, showClearButton: X, modifiers: Y, optionHeightModifiers: Z, styles: ee, get NmorphDropdown() {
|
|
111
|
+
return ce;
|
|
105
112
|
}, get NmorphIcon() {
|
|
106
|
-
return
|
|
113
|
+
return de;
|
|
107
114
|
}, get NmorphIconCircleClose() {
|
|
108
|
-
return
|
|
115
|
+
return ie;
|
|
109
116
|
}, get NmorphIconClock() {
|
|
110
|
-
return
|
|
117
|
+
return ae;
|
|
111
118
|
} };
|
|
112
119
|
return Object.defineProperty(V, "__isScriptSetup", { enumerable: !1, value: !0 }), V;
|
|
113
120
|
}
|
|
114
121
|
});
|
|
115
122
|
export {
|
|
116
|
-
|
|
123
|
+
Ie as default
|
|
117
124
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import './NmorphDropdown.css';
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
import { useModifiers as
|
|
4
|
-
import { toCssSize as
|
|
5
|
-
import { usePlacement as
|
|
2
|
+
import { defineComponent as y, ref as v, toRef as t, computed as i, watch as w } from "vue";
|
|
3
|
+
import { useModifiers as q } from "../../../utils/create-modifiers.js";
|
|
4
|
+
import { toCssSize as b, createCssSizeVariables as x } from "../../../utils/common.js";
|
|
5
|
+
import { usePlacement as S } from "../../../hooks/use-placement.js";
|
|
6
6
|
import O from "../../others/nmorph-overlay/NmorphOverlay.vue.js";
|
|
7
|
-
const B = /* @__PURE__ */
|
|
7
|
+
const B = /* @__PURE__ */ y({
|
|
8
8
|
__name: "NmorphDropdown",
|
|
9
9
|
props: {
|
|
10
10
|
open: { type: Boolean, required: !0 },
|
|
@@ -26,44 +26,46 @@ const B = /* @__PURE__ */ w({
|
|
|
26
26
|
hideShadow: { type: Boolean, required: !1, default: !1 }
|
|
27
27
|
},
|
|
28
28
|
emits: ["on-outside-click", "on-escape-keydown"],
|
|
29
|
-
setup(
|
|
30
|
-
|
|
31
|
-
const e =
|
|
29
|
+
setup(u, { expose: p, emit: f }) {
|
|
30
|
+
p();
|
|
31
|
+
const e = u, r = f, l = v(null), { placementCoords: o, placementReady: d, adjustPlacement: a } = S({
|
|
32
32
|
initialPlacement: t(e, "placement"),
|
|
33
|
-
contentDOMElement:
|
|
33
|
+
contentDOMElement: l,
|
|
34
34
|
relativeElement: t(e, "relativeElement"),
|
|
35
35
|
yOffset: t(e, "yOffset"),
|
|
36
36
|
xOffset: t(e, "xOffset"),
|
|
37
37
|
enabled: t(e, "open")
|
|
38
|
-
}),
|
|
39
|
-
() =>
|
|
38
|
+
}), m = i(
|
|
39
|
+
() => q({
|
|
40
40
|
"nmorph-dropdown": [!e.open && "closed", e.hideShadow && "hide-shadow"]
|
|
41
41
|
})
|
|
42
|
-
),
|
|
43
|
-
() => e.fillWidth && e.relativeElement ? `${e.relativeElement.clientWidth}px` :
|
|
44
|
-
),
|
|
45
|
-
"--nmorph-dropdown-width":
|
|
46
|
-
|
|
47
|
-
|
|
42
|
+
), n = i(
|
|
43
|
+
() => e.fillWidth && e.relativeElement ? `${e.relativeElement.clientWidth}px` : b(e.width)
|
|
44
|
+
), c = i(() => ({
|
|
45
|
+
"--nmorph-dropdown-width": n.value,
|
|
46
|
+
...x({
|
|
47
|
+
"--nmorph-dropdown-min-width": e.minWidth === void 0 ? "auto" : e.minWidth,
|
|
48
|
+
"--nmorph-dropdown-max-width": e.maxWidth === void 0 ? "none" : e.maxWidth
|
|
49
|
+
}),
|
|
48
50
|
left: o.value.x,
|
|
49
51
|
top: o.value.y,
|
|
50
|
-
visibility: e.open &&
|
|
52
|
+
visibility: e.open && d.value ? "visible" : "hidden"
|
|
51
53
|
}));
|
|
52
|
-
|
|
54
|
+
w(
|
|
53
55
|
() => e.open,
|
|
54
|
-
(
|
|
55
|
-
|
|
56
|
+
(h) => {
|
|
57
|
+
h && a();
|
|
56
58
|
},
|
|
57
59
|
{ flush: "post" }
|
|
58
60
|
);
|
|
59
|
-
const
|
|
61
|
+
const s = { props: e, emit: r, dropdownDOMRef: l, placementCoords: o, placementReady: d, adjustPlacement: a, modifiers: m, width: n, dropdownStyle: c, outsideClickHandler: () => {
|
|
60
62
|
r("on-outside-click");
|
|
61
63
|
}, escapeHandler: () => {
|
|
62
64
|
r("on-escape-keydown");
|
|
63
65
|
}, get NmorphOverlay() {
|
|
64
66
|
return O;
|
|
65
67
|
} };
|
|
66
|
-
return Object.defineProperty(
|
|
68
|
+
return Object.defineProperty(s, "__isScriptSetup", { enumerable: !1, value: !0 }), s;
|
|
67
69
|
}
|
|
68
70
|
});
|
|
69
71
|
export {
|