@nmorph/nmorph-ui-kit 2.2.37 → 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 +16 -13
- 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 +66 -64
- package/dist/components/form/nmorph-checkbox/NmorphCheckbox.css +1 -1
- package/dist/components/form/nmorph-checkbox/NmorphCheckbox.vue2.js +28 -26
- package/dist/components/form/nmorph-checkbox-group/NmorphCheckboxGroup.vue2.js +25 -20
- package/dist/components/form/nmorph-color-picker/NmorphColorPicker.vue.js +18 -22
- package/dist/components/form/nmorph-color-picker/NmorphColorPicker.vue2.js +52 -42
- package/dist/components/form/nmorph-date-picker/NmorphDatePicker.vue2.js +52 -40
- package/dist/components/form/nmorph-file-upload/NmorphFileUpload.css +1 -1
- package/dist/components/form/nmorph-file-upload/NmorphFileUpload.vue.js +20 -16
- package/dist/components/form/nmorph-file-upload/NmorphFileUpload.vue2.js +96 -98
- package/dist/components/form/nmorph-form/NmorphForm.vue2.js +9 -9
- package/dist/components/form/nmorph-form/components/nmorph-form-item/NmorphFormItem.css +1 -1
- package/dist/components/form/nmorph-form/components/nmorph-form-item/NmorphFormItem.vue2.js +33 -24
- package/dist/components/form/nmorph-form/components/nmorph-form-item/inner-components/nmorph-error-box/NmorphErrorBox.vue2.js +4 -4
- package/dist/components/form/nmorph-form/use-form-item-input.js +29 -8
- package/dist/components/form/nmorph-number-input/NmorphNumberInput.vue2.js +41 -35
- package/dist/components/form/nmorph-otp-input/NmorphOTPInput.vue2.js +65 -61
- package/dist/components/form/nmorph-radio/NmorphRadio.css +1 -1
- package/dist/components/form/nmorph-radio/NmorphRadio.vue2.js +1 -1
- package/dist/components/form/nmorph-radio-group/NmorphRadioGroup.vue2.js +24 -22
- package/dist/components/form/nmorph-select/NmorphSelect.css +1 -1
- package/dist/components/form/nmorph-select/NmorphSelect.vue2.js +90 -78
- 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 +31 -25
- package/dist/components/form/nmorph-slider/NmorphSlider.vue2.js +50 -49
- package/dist/components/form/nmorph-switch/NmorphSwitch.vue2.js +35 -32
- package/dist/components/form/nmorph-text-input/NmorphTextInput.css +1 -1
- package/dist/components/form/nmorph-text-input/NmorphTextInput.vue.js +17 -17
- package/dist/components/form/nmorph-text-input/NmorphTextInput.vue2.js +41 -35
- package/dist/components/form/nmorph-textarea/NmorphTextarea.vue.js +13 -13
- package/dist/components/form/nmorph-textarea/NmorphTextarea.vue2.js +38 -32
- package/dist/components/form/nmorph-time-picker/NmorphTimePicker.vue.js +17 -17
- package/dist/components/form/nmorph-time-picker/NmorphTimePicker.vue2.js +79 -71
- package/dist/components/navigation/nmorph-dropdown/NmorphDropdown.vue2.js +25 -23
- package/dist/hooks/use-field-validation.js +56 -43
- package/dist/hooks/use-focusable-input.js +27 -0
- package/dist/hooks/use-form-validation.js +62 -24
- package/dist/hooks/use-nmorph-translation.js +4 -4
- package/dist/index.es.js +842 -837
- package/dist/index.umd.js +36 -36
- 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 +2 -13
- 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 +6 -21
- package/dist/src/components/data/nmorph-avatar/types.d.ts +21 -0
- package/dist/src/components/data/nmorph-badge/NmorphBadge.vue.d.ts +4 -39
- 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 +4 -13
- 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 +2 -14
- 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 +3 -17
- 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 +3 -15
- 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 +5 -11
- 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 +5 -21
- 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 +7 -12
- package/dist/src/components/form/nmorph-file-upload/types.d.ts +21 -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 +21 -6
- package/dist/src/components/form/nmorph-form/use-form-item-input.d.ts +10 -0
- package/dist/src/components/form/nmorph-number-input/NmorphNumberInput.vue.d.ts +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 +4 -12
- 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-field-validation.d.ts +15 -0
- package/dist/src/hooks/use-focusable-input.d.ts +16 -0
- package/dist/src/hooks/use-form-validation.d.ts +4 -0
- 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 -7
- 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,10 +1,10 @@
|
|
|
1
1
|
import './NmorphOTPInput.css';
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
import { useModifiers as
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
const
|
|
2
|
+
import { defineComponent as le, ref as M, computed as c, watch as O, nextTick as R } from "vue";
|
|
3
|
+
import { useModifiers as ue } from "../../../utils/create-modifiers.js";
|
|
4
|
+
import { useFormItemInput as oe, useFormItemModel as re } from "../nmorph-form/use-form-item-input.js";
|
|
5
|
+
import ne from "../nmorph-text-input/NmorphTextInput.vue.js";
|
|
6
|
+
import { NmorphComponentHeight as se } from "../../../types/common.types.js";
|
|
7
|
+
const pe = /* @__PURE__ */ le({
|
|
8
8
|
__name: "NmorphOTPInput",
|
|
9
9
|
props: {
|
|
10
10
|
modelValue: { type: String, required: !1, default: "" },
|
|
@@ -20,128 +20,132 @@ const de = /* @__PURE__ */ te({
|
|
|
20
20
|
tabindex: { type: Number, required: !1 }
|
|
21
21
|
},
|
|
22
22
|
emits: ["update:model-value", "focus", "blur", "complete"],
|
|
23
|
-
setup(
|
|
24
|
-
const l =
|
|
23
|
+
setup(j, { expose: w, emit: N }) {
|
|
24
|
+
const l = j, f = N, { id: V, name: T, autocomplete: A, tabindex: p } = oe(l), { modelValue: v, updateModelValue: F } = re(
|
|
25
|
+
l,
|
|
26
|
+
(e) => f("update:model-value", e),
|
|
27
|
+
""
|
|
28
|
+
), i = M([]), n = M([]), d = M(!1), o = M([]), u = c(() => Math.max(1, l.length)), g = (e = "") => {
|
|
25
29
|
const t = `${e ?? ""}`;
|
|
26
30
|
return l.mode === "numeric" ? Array.from(t.replace(/\D/g, "")) : l.mode === "alphanumeric" ? Array.from(t.replace(/[^a-zA-Z0-9]/g, "")) : Array.from(t);
|
|
27
|
-
},
|
|
28
|
-
const t =
|
|
31
|
+
}, S = (e = v.value) => {
|
|
32
|
+
const t = g(e).slice(0, u.value);
|
|
29
33
|
return Array.from({ length: u.value }, (a, s) => t[s] || "");
|
|
30
|
-
},
|
|
31
|
-
if (o.value = Array.from({ length: u.value }, (s,
|
|
34
|
+
}, h = (e, t = !1) => {
|
|
35
|
+
if (o.value = Array.from({ length: u.value }, (s, b) => e[b] || ""), !t) return;
|
|
32
36
|
const a = o.value.join("");
|
|
33
|
-
|
|
37
|
+
F(a), o.value.includes("") || f("complete", a);
|
|
34
38
|
};
|
|
35
|
-
|
|
36
|
-
[
|
|
39
|
+
O(
|
|
40
|
+
[v, () => l.mode, u],
|
|
37
41
|
() => {
|
|
38
|
-
const e =
|
|
39
|
-
(e.join("") !== o.value.join("") || e.length !== o.value.length) &&
|
|
42
|
+
const e = S(v.value);
|
|
43
|
+
(e.join("") !== o.value.join("") || e.length !== o.value.length) && h(e);
|
|
40
44
|
},
|
|
41
45
|
{ immediate: !0 }
|
|
42
46
|
);
|
|
43
|
-
const
|
|
44
|
-
() =>
|
|
45
|
-
nmorph: [
|
|
47
|
+
const E = c(
|
|
48
|
+
() => ue({
|
|
49
|
+
nmorph: [se[l.height], d.value && "focused"],
|
|
46
50
|
"nmorph-otp-input": [l.disabled && "disabled"]
|
|
47
51
|
})
|
|
48
|
-
),
|
|
52
|
+
), B = c(
|
|
49
53
|
() => Array.from({ length: u.value }, (e, t) => t === 0 ? V.value : `${V.value}-${t + 1}`)
|
|
50
|
-
),
|
|
54
|
+
), C = c(() => l.mode === "numeric" ? "numeric" : "text"), P = c(() => A.value || "one-time-code"), $ = c(() => {
|
|
51
55
|
if (l.mode === "numeric") return "[0-9]*";
|
|
52
56
|
if (l.mode === "alphanumeric") return "[A-Za-z0-9]*";
|
|
53
|
-
}),
|
|
57
|
+
}), y = (e) => {
|
|
54
58
|
n.value[e] = i.value[e]?.inputDOMRef ?? null;
|
|
55
|
-
},
|
|
56
|
-
i.value[t] = e,
|
|
57
|
-
|
|
59
|
+
}, x = (e, t) => {
|
|
60
|
+
i.value[t] = e, R(() => {
|
|
61
|
+
y(t);
|
|
58
62
|
});
|
|
59
63
|
}, _ = (e) => {
|
|
60
|
-
|
|
64
|
+
y(e), i.value[e]?.select?.(), n.value[e]?.select();
|
|
61
65
|
}, r = (e = 0) => {
|
|
62
|
-
|
|
66
|
+
R(() => {
|
|
63
67
|
const t = Math.min(Math.max(e, 0), u.value - 1);
|
|
64
|
-
|
|
68
|
+
y(t), i.value[t]?.focus?.(), n.value[t]?.focus(), _(t);
|
|
65
69
|
});
|
|
66
|
-
},
|
|
70
|
+
}, k = () => {
|
|
67
71
|
i.value.forEach((e, t) => {
|
|
68
72
|
e?.blur?.(), n.value[t]?.blur();
|
|
69
73
|
});
|
|
70
74
|
};
|
|
71
|
-
|
|
75
|
+
w({
|
|
72
76
|
inputDOMRefs: n,
|
|
73
77
|
focus: r,
|
|
74
|
-
blur:
|
|
78
|
+
blur: k
|
|
75
79
|
});
|
|
76
80
|
const m = (e, t = "") => {
|
|
77
81
|
const a = [...o.value];
|
|
78
|
-
a[e] = t,
|
|
82
|
+
a[e] = t, h(a, !0);
|
|
79
83
|
}, H = (e, t) => {
|
|
80
|
-
const a =
|
|
84
|
+
const a = g(e).slice(0, u.value - t);
|
|
81
85
|
if (!a.length) {
|
|
82
86
|
m(t, "");
|
|
83
87
|
return;
|
|
84
88
|
}
|
|
85
89
|
const s = [...o.value];
|
|
86
|
-
a.forEach((
|
|
87
|
-
s[t +
|
|
88
|
-
}),
|
|
89
|
-
const
|
|
90
|
-
|
|
91
|
-
},
|
|
90
|
+
a.forEach((te, ae) => {
|
|
91
|
+
s[t + ae] = te;
|
|
92
|
+
}), h(s, !0);
|
|
93
|
+
const b = t + a.length;
|
|
94
|
+
b < u.value ? r(b) : r(u.value - 1);
|
|
95
|
+
}, z = (e, t) => {
|
|
92
96
|
H(e, t);
|
|
93
|
-
},
|
|
94
|
-
const t =
|
|
97
|
+
}, q = /* @__PURE__ */ new Map(), L = (e) => {
|
|
98
|
+
const t = q.get(e);
|
|
95
99
|
if (t) return t;
|
|
96
100
|
const a = c({
|
|
97
101
|
get: () => o.value[e] || "",
|
|
98
|
-
set: (s) =>
|
|
102
|
+
set: (s) => z(s, e)
|
|
99
103
|
});
|
|
100
|
-
return
|
|
101
|
-
},
|
|
104
|
+
return q.set(e, a), a;
|
|
105
|
+
}, D = (e) => {
|
|
102
106
|
if (o.value[e]) {
|
|
103
107
|
m(e);
|
|
104
108
|
return;
|
|
105
109
|
}
|
|
106
110
|
e > 0 && (m(e - 1), r(e - 1));
|
|
107
|
-
},
|
|
111
|
+
}, Z = (e, t) => {
|
|
108
112
|
if (e.key === "Backspace") {
|
|
109
|
-
|
|
113
|
+
D(t);
|
|
110
114
|
return;
|
|
111
115
|
}
|
|
112
116
|
m(t);
|
|
113
|
-
},
|
|
117
|
+
}, K = (e) => {
|
|
114
118
|
r(e - 1);
|
|
115
|
-
},
|
|
119
|
+
}, G = (e) => {
|
|
116
120
|
r(e + 1);
|
|
117
|
-
},
|
|
121
|
+
}, J = () => {
|
|
118
122
|
r(0);
|
|
119
|
-
},
|
|
123
|
+
}, Q = () => {
|
|
120
124
|
r(u.value - 1);
|
|
121
|
-
},
|
|
122
|
-
e.key.length === 1 && !
|
|
123
|
-
},
|
|
125
|
+
}, U = (e) => {
|
|
126
|
+
e.key.length === 1 && !g(e.key).length && e.preventDefault();
|
|
127
|
+
}, W = (e, t) => {
|
|
124
128
|
const a = e.clipboardData?.getData("text") || "";
|
|
125
129
|
H(a, t);
|
|
126
|
-
},
|
|
130
|
+
}, X = (e) => {
|
|
127
131
|
d.value || (d.value = !0, f("focus")), _(e);
|
|
128
|
-
},
|
|
132
|
+
}, Y = () => {
|
|
129
133
|
setTimeout(() => {
|
|
130
134
|
const e = document.activeElement;
|
|
131
135
|
!n.value.some((a) => a === e) && d.value && (d.value = !1, f("blur"));
|
|
132
136
|
});
|
|
133
|
-
},
|
|
134
|
-
|
|
137
|
+
}, ee = (e) => p.value > 0 ? p.value + e : p.value;
|
|
138
|
+
O(
|
|
135
139
|
() => l.autofocus,
|
|
136
140
|
(e) => {
|
|
137
141
|
e && !l.disabled && r(0);
|
|
138
142
|
},
|
|
139
143
|
{ immediate: !0 }
|
|
140
144
|
);
|
|
141
|
-
const
|
|
142
|
-
return Object.defineProperty(
|
|
145
|
+
const I = { props: l, emit: f, id: V, name: T, autocomplete: A, tabindex: p, modelValue: v, updateModelValue: F, inputRefs: i, inputDOMRefs: n, focused: d, otpValue: o, normalizedLength: u, sanitizeValue: g, normalizeOtpValue: S, syncOtpValue: h, modifiers: E, fieldIds: B, inputMode: C, resolvedAutocomplete: P, inputPattern: $, syncInputDOMRef: y, setInputRef: x, selectField: _, focusField: r, blurFields: k, updateCharAt: m, insertValue: H, inputHandler: z, fieldModels: q, getFieldModel: L, backspaceHandler: D, deleteKeyHandler: Z, arrowLeftHandler: K, arrowRightHandler: G, homeHandler: J, endHandler: Q, keydownHandler: U, pasteHandler: W, focusHandler: X, blurHandler: Y, getFieldTabindex: ee, NmorphTextInput: ne };
|
|
146
|
+
return Object.defineProperty(I, "__isScriptSetup", { enumerable: !1, value: !0 }), I;
|
|
143
147
|
}
|
|
144
148
|
});
|
|
145
149
|
export {
|
|
146
|
-
|
|
150
|
+
pe as default
|
|
147
151
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.nmorph-radio{--size: var(--height);display:inline-flex;align-items:center;cursor:pointer}.nmorph-radio .nmorph-radio__content{position:relative;display:flex;justify-content:center;align-items:center}.nmorph-radio span{margin-top:2px}.nmorph-radio .nmorph-radio__input-wrapper{position:relative;width:var(--size);height:var(--size)}.nmorph-radio input{position:absolute;top:0;left:0;width:100%;height:100%}.nmorph-radio input:focus-visible{background:var(--nmorph-main-color);box-shadow:var(--base-shadow-width) var(--base-shadow-width) var(--base-shadow-blur) var(--nmorph-dark-shade-color),calc(-1 * var(--base-shadow-width)) calc(-1 * var(--base-shadow-width)) var(--base-shadow-blur) var(--nmorph-light-shade-color)}.nmorph-radio .nmorph-radio__fake{position:absolute;top:0;left:0;width:100%;height:100%;background:var(--nmorph-main-color);border-radius:var(--border-radius-circular);box-shadow:inset var(--base-shadow-width) var(--base-shadow-width) var(--base-shadow-blur) var(--nmorph-dark-shade-color),inset calc(-1 * var(--base-shadow-width)) calc(-1 * var(--base-shadow-width)) var(--base-shadow-blur) var(--nmorph-light-shade-color)}.nmorph-radio .nmorph-radio__fake span,.nmorph-radio .nmorph-radio__label{font-weight:400;font-size:var(--font-size
|
|
1
|
+
.nmorph-radio{--size: var(--height);--nmorph-selection-control-font-size: var(--font-size-small);--nmorph-selection-control-line-height: var(--line-height-regular);--nmorph-selection-control-inline-padding: var(--indentation-03);display:inline-flex;align-items:center;cursor:pointer}.nmorph-radio.nmorph{height:auto;min-height:var(--size)}.nmorph-radio .nmorph-radio__content{position:relative;display:flex;justify-content:center;align-items:center;min-height:var(--size)}.nmorph-radio span{margin-top:2px}.nmorph-radio .nmorph-radio__input-wrapper{position:relative;width:var(--size);height:var(--size)}.nmorph-radio input{position:absolute;top:0;left:0;width:100%;height:100%}.nmorph-radio input:focus-visible{background:var(--nmorph-main-color);box-shadow:var(--base-shadow-width) var(--base-shadow-width) var(--base-shadow-blur) var(--nmorph-dark-shade-color),calc(-1 * var(--base-shadow-width)) calc(-1 * var(--base-shadow-width)) var(--base-shadow-blur) var(--nmorph-light-shade-color)}.nmorph-radio .nmorph-radio__fake{position:absolute;top:0;left:0;width:100%;height:100%;background:var(--nmorph-main-color);border-radius:var(--border-radius-circular);box-shadow:inset var(--base-shadow-width) var(--base-shadow-width) var(--base-shadow-blur) var(--nmorph-dark-shade-color),inset calc(-1 * var(--base-shadow-width)) calc(-1 * var(--base-shadow-width)) var(--base-shadow-blur) var(--nmorph-light-shade-color)}.nmorph-radio .nmorph-radio__fake span,.nmorph-radio .nmorph-radio__label{font-weight:400;font-size:var(--nmorph-selection-control-font-size);line-height:var(--nmorph-selection-control-line-height)}.nmorph-radio .nmorph-radio__fake-checked{position:absolute;top:50%;left:50%;width:50%;height:50%;background:var(--nmorph-accent-color);border-radius:var(--border-radius-circular);transform:translate(-50%,-50%)}.nmorph-radio .nmorph-radio__label{margin-left:var(--indentation-02)}.nmorph-radio.nmorph-radio--button .nmorph-radio__fake{position:relative;display:flex;justify-content:center;align-items:center;height:var(--size);padding:var(--nmorph-selection-control-inline-padding);white-space:nowrap;background:var(--nmorph-main-color);border-radius:var(--default-border-radius);box-shadow:var(--base-shadow-width) var(--base-shadow-width) var(--base-shadow-blur) var(--nmorph-dark-shade-color),calc(-1 * var(--base-shadow-width)) calc(-1 * var(--base-shadow-width)) var(--base-shadow-blur) var(--nmorph-light-shade-color)}.nmorph-radio.nmorph--extra-thin-component{--nmorph-selection-control-font-size: var(--font-size-tiny);--nmorph-selection-control-line-height: var(--line-height-line);--nmorph-selection-control-inline-padding: var(--indentation-02)}.nmorph-radio.nmorph--thin-component{--nmorph-selection-control-font-size: var(--font-size-extra-small)}.nmorph-radio.nmorph--basic-component{--nmorph-selection-control-font-size: var(--font-size-small)}.nmorph-radio.nmorph--thick-component{--nmorph-selection-control-font-size: var(--font-size-base)}.nmorph-radio.nmorph-radio--checked .nmorph-radio__fake{background:var(--nmorph-main-color);box-shadow:inset var(--base-shadow-width) var(--base-shadow-width) var(--base-shadow-blur) var(--nmorph-dark-shade-color),inset calc(-1 * var(--base-shadow-width)) calc(-1 * var(--base-shadow-width)) var(--base-shadow-blur) var(--nmorph-light-shade-color)}.nmorph-radio.nmorph-radio--disabled{cursor:not-allowed;opacity:.6}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import './NmorphRadio.css';
|
|
2
2
|
import { defineComponent as h, inject as r, computed as l, ref as m } from "vue";
|
|
3
3
|
import { useModifiers as g } from "../../../utils/create-modifiers.js";
|
|
4
|
-
import { NmorphSelectionControlHeight as v } from "../../../types/
|
|
4
|
+
import { NmorphSelectionControlHeight as v } from "../../../types/common.types.js";
|
|
5
5
|
const q = /* @__PURE__ */ h({
|
|
6
6
|
__name: "NmorphRadio",
|
|
7
7
|
props: {
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import './NmorphRadioGroup.css';
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
import { useModifiers as
|
|
4
|
-
import
|
|
5
|
-
|
|
2
|
+
import { defineComponent as h, ref as y, watch as g, computed as n, provide as a } from "vue";
|
|
3
|
+
import { useModifiers as q } from "../../../utils/create-modifiers.js";
|
|
4
|
+
import { useFormItemModel as v } from "../nmorph-form/use-form-item-input.js";
|
|
5
|
+
import _ from "../nmorph-radio/NmorphRadio.vue.js";
|
|
6
|
+
const x = /* @__PURE__ */ h({
|
|
6
7
|
__name: "NmorphRadioGroup",
|
|
7
8
|
props: {
|
|
8
|
-
modelValue: { type: String, required: !
|
|
9
|
+
modelValue: { type: String, required: !1, default: "" },
|
|
9
10
|
options: { type: Array, required: !1, default: () => [] },
|
|
10
11
|
styleType: { type: null, required: !1, default: "button" },
|
|
11
12
|
direction: { type: null, required: !1, default: "row" },
|
|
@@ -17,25 +18,26 @@ const b = /* @__PURE__ */ m({
|
|
|
17
18
|
tabindex: { type: Number, required: !1 }
|
|
18
19
|
},
|
|
19
20
|
emits: ["update:model-value"],
|
|
20
|
-
setup(
|
|
21
|
-
|
|
22
|
-
const e =
|
|
23
|
-
|
|
24
|
-
() =>
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
21
|
+
setup(s, { expose: m, emit: f }) {
|
|
22
|
+
m();
|
|
23
|
+
const e = s, i = f, { modelValue: o, updateModelValue: l } = v(
|
|
24
|
+
e,
|
|
25
|
+
(r) => i("update:model-value", r),
|
|
26
|
+
""
|
|
27
|
+
), t = y(o.value);
|
|
28
|
+
g(o, (r) => {
|
|
29
|
+
t.value = r;
|
|
30
|
+
});
|
|
31
|
+
const u = (r) => {
|
|
32
|
+
t.value = r, l(t.value);
|
|
33
|
+
}, c = n(() => q({ "nmorph-radio-group": [e.styleType, e.direction] })), d = n(() => e.height);
|
|
34
|
+
a("radio-group-selected-value", t), a("change-radio-button-value-handler", u), a("radio-group-height", d);
|
|
35
|
+
const p = { props: e, emit: i, modelValue: o, updateModelValue: l, initialValue: t, changeHandler: u, modifiers: c, height: d, get NmorphRadio() {
|
|
36
|
+
return _;
|
|
35
37
|
} };
|
|
36
|
-
return Object.defineProperty(
|
|
38
|
+
return Object.defineProperty(p, "__isScriptSetup", { enumerable: !1, value: !0 }), p;
|
|
37
39
|
}
|
|
38
40
|
});
|
|
39
41
|
export {
|
|
40
|
-
|
|
42
|
+
x as default
|
|
41
43
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.nmorph-select{--base-width: 200px;width:var(--base-width);height:var(--height);cursor:pointer}.nmorph-select .nmorph-select__content{position:relative;height:100%;background:var(--nmorph-main-color);box-shadow:var(--nmorph-shadow-outset)}.nmorph-select .nmorph-select__selected-values-line{display:flex;justify-content:space-between;align-items:center;height:100%;padding:var(--indentation-00) var(--default-indentation-input);border-radius:
|
|
1
|
+
.nmorph-select{--base-width: 200px;width:var(--base-width);height:var(--height);border-radius:var(--default-border-radius);cursor:pointer}.nmorph-select .nmorph-select__content{position:relative;height:100%;background:var(--nmorph-main-color);border-radius:inherit;box-shadow:var(--nmorph-shadow-outset)}.nmorph-select .nmorph-select__selected-values-line{display:flex;justify-content:space-between;align-items:center;height:100%;padding:var(--indentation-00) var(--default-indentation-input);border-radius:inherit}.nmorph-select .nmorph-select__selected-value{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.nmorph-select select,.nmorph-select option{position:absolute;width:0;height:0;padding:0;border:none;opacity:0}.nmorph-select.nmorph-select--loading .nmorph-select__options{display:flex;justify-content:center;padding:16px}.nmorph-select.nmorph-select--disabled{cursor:not-allowed;opacity:.6}.nmorph-select.nmorph-select--fill{width:100%}.nmorph-select.nmorph-select--options-auto-width .nmorph-select__options{width:max-content;max-width:calc(100vw - var(--indentation-02) * 2)}.nmorph-select .nmorph-select__virtual-list{overflow-y:auto}.nmorph-select .nmorph-select__virtual-spacer{position:relative}.nmorph-select .nmorph-select__virtual-content{position:absolute;top:0;right:0;left:0}.nmorph-select.nmorph-select--open .nmorph-select__chevron{transform:rotate(180deg)}.nmorph-select.nmorph-select--open .nmorph-select__content{background:var(--nmorph-main-color);box-shadow:var(--nmorph-shadow-inset)}.nmorph-select.nmorph-select--selected-line-outset .nmorph-select__content{background:var(--nmorph-main-color);box-shadow:var(--nmorph-shadow-outset)}.nmorph-select.nmorph-select--focus{outline:2px solid var(--nmorph-accent-color)}.nmorph-select.nmorph-select--focus .nmorph-select__content{box-shadow:none}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import './NmorphSelect.css';
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
import { NmorphComponentHeight as se } from "../../../types/index.js";
|
|
2
|
+
import { defineComponent as ue, computed as a, ref as d, watch as c, nextTick as R, onMounted as oe, onUnmounted as ie, provide as w, toRef as se } from "vue";
|
|
4
3
|
import { useModifiers as de } from "../../../utils/create-modifiers.js";
|
|
5
|
-
import {
|
|
6
|
-
import { useI18n as fe } from "vue-i18n";
|
|
7
|
-
import { useFormItemInput as pe } from "../nmorph-form/use-form-item-input.js";
|
|
4
|
+
import { createCssSizeVariables as ve, getNmorphOptionHeight as ce, toCssSize as fe, resolveDomElement as pe } from "../../../utils/common.js";
|
|
8
5
|
import { useVirtualList as me } from "../../../hooks/use-virtual-list.js";
|
|
9
|
-
import he from "
|
|
10
|
-
import ge from "
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
|
|
6
|
+
import { useI18n as he } from "vue-i18n";
|
|
7
|
+
import { useFormItemModel as ge, useFormItemInput as ye } from "../nmorph-form/use-form-item-input.js";
|
|
8
|
+
import { NmorphComponentHeight as He } from "../../../types/common.types.js";
|
|
9
|
+
import be from "../../navigation/nmorph-dropdown/NmorphDropdown.vue.js";
|
|
10
|
+
import qe from "./components/nmorph-select-option/NmorphSelectOption.vue.js";
|
|
11
|
+
import Ie from "../../basic/nmorph-icon/NmorphIcon.vue.js";
|
|
12
|
+
import xe from "../../data/nmorph-tag-list/components/nmorph-tag-item/NmorphTagItem.vue.js";
|
|
13
|
+
import Ne from "../../../assets/icons/chevron-down.svg.js";
|
|
14
|
+
import Se from "../../../assets/icons/loader.svg.js";
|
|
15
|
+
const Ge = /* @__PURE__ */ ue({
|
|
16
16
|
__name: "NmorphSelect",
|
|
17
17
|
props: {
|
|
18
18
|
noElementPlaceholder: { type: String, required: !1, default: "" },
|
|
@@ -39,103 +39,115 @@ const Ue = /* @__PURE__ */ ne({
|
|
|
39
39
|
tabindex: { type: Number, required: !1 }
|
|
40
40
|
},
|
|
41
41
|
emits: ["update:model-value"],
|
|
42
|
-
setup(
|
|
43
|
-
|
|
44
|
-
const { t:
|
|
45
|
-
() =>
|
|
46
|
-
),
|
|
42
|
+
setup(C, { expose: P, emit: T }) {
|
|
43
|
+
P();
|
|
44
|
+
const { t: M } = he(), l = C, D = a(
|
|
45
|
+
() => l.noElementPlaceholder ? l.noElementPlaceholder : M("noElementPlaceholder")
|
|
46
|
+
), A = T, { modelValue: p, updateModelValue: h } = ge(
|
|
47
|
+
l,
|
|
48
|
+
(e) => A("update:model-value", e),
|
|
49
|
+
""
|
|
50
|
+
), t = d(p.value), r = d(l.open), v = a(() => l.disabled || l.loading), g = a(() => l.optionsWidth === "auto"), y = d(!0), { id: H, name: W, autocomplete: k, tabindex: $ } = ye(l), b = (e) => {
|
|
47
51
|
if (!v.value) {
|
|
48
|
-
if (r.value = !1, typeof
|
|
49
|
-
const n =
|
|
50
|
-
if (
|
|
51
|
-
n ?
|
|
52
|
+
if (r.value = !1, typeof t.value == "string" && (!l.valueRequired && t.value === e ? t.value = "" : t.value = e, h(t.value)), Array.isArray(t.value)) {
|
|
53
|
+
const n = t.value.includes(e), re = t.value.length === 1 && n;
|
|
54
|
+
if (l.valueRequired && re) return;
|
|
55
|
+
n ? t.value = t.value.filter((ne) => ne !== e) : t.value = [...t.value, e];
|
|
52
56
|
}
|
|
53
|
-
|
|
57
|
+
h(t.value);
|
|
54
58
|
}
|
|
55
|
-
},
|
|
56
|
-
|
|
57
|
-
},
|
|
58
|
-
|
|
59
|
-
},
|
|
59
|
+
}, m = d(!1), z = () => {
|
|
60
|
+
m.value = !0;
|
|
61
|
+
}, F = () => {
|
|
62
|
+
m.value = !1;
|
|
63
|
+
}, U = a(
|
|
60
64
|
() => de({
|
|
61
|
-
nmorph: [
|
|
65
|
+
nmorph: [He[l.height]],
|
|
62
66
|
"nmorph-select": [
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
67
|
+
l.disabled && "disabled",
|
|
68
|
+
p.value ? "on" : "off",
|
|
69
|
+
l.loading && "loading",
|
|
66
70
|
r.value && !v.value && "open",
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
+
l.fill && "fill",
|
|
72
|
+
g.value && "options-auto-width",
|
|
73
|
+
y.value ? "selected-line-outset" : "selected-line-inset",
|
|
74
|
+
m.value && "focus"
|
|
71
75
|
]
|
|
72
76
|
})
|
|
73
|
-
),
|
|
74
|
-
|
|
75
|
-
|
|
77
|
+
), j = a(
|
|
78
|
+
() => ve({
|
|
79
|
+
"--base-width": l.width
|
|
80
|
+
})
|
|
81
|
+
), G = () => {
|
|
76
82
|
v.value || (r.value = !r.value);
|
|
77
83
|
};
|
|
78
|
-
|
|
84
|
+
c(
|
|
79
85
|
r,
|
|
80
86
|
(e) => {
|
|
81
|
-
e && (
|
|
87
|
+
e && (y.value = !1);
|
|
82
88
|
},
|
|
83
89
|
{ immediate: !0 }
|
|
84
90
|
);
|
|
85
|
-
const
|
|
91
|
+
const q = () => {
|
|
86
92
|
r.value = !1;
|
|
87
93
|
};
|
|
88
|
-
|
|
89
|
-
() =>
|
|
94
|
+
c(
|
|
95
|
+
() => l.loading,
|
|
90
96
|
(e) => {
|
|
91
97
|
e && (r.value = !1);
|
|
92
98
|
}
|
|
99
|
+
), c(
|
|
100
|
+
p,
|
|
101
|
+
(e) => {
|
|
102
|
+
t.value = e;
|
|
103
|
+
},
|
|
104
|
+
{ deep: !0 }
|
|
93
105
|
);
|
|
94
|
-
const i = a(() =>
|
|
95
|
-
enabled:
|
|
96
|
-
itemHeight:
|
|
97
|
-
overscan:
|
|
98
|
-
dynamic:
|
|
99
|
-
}),
|
|
100
|
-
i.value.length > 0 || !
|
|
106
|
+
const i = a(() => l.options.length > 0 ? l.options : l.optionsMap), I = d(null), x = d([]), N = a(() => l.options), f = a(() => l.virtual && N.value.length > 0), E = a(() => l.virtualItemHeight || ce(l.height)), V = a(() => l.virtualOverscan), _ = a(() => l.virtualDynamicHeight), s = me(N, {
|
|
107
|
+
enabled: f,
|
|
108
|
+
itemHeight: E,
|
|
109
|
+
overscan: V,
|
|
110
|
+
dynamic: _
|
|
111
|
+
}), J = a(() => s.virtualItems.value), K = s.spacerStyle, Q = s.contentStyle, X = a(() => fe(l.virtualMaxHeight)), S = () => {
|
|
112
|
+
i.value.length > 0 || !I.value || (x.value = Array.from(I.value.querySelectorAll(".nmorph-select-option")).map((e) => e.getAttribute("value")).filter((e) => !!e));
|
|
101
113
|
}, o = a(
|
|
102
|
-
() => i.value.length > 0 ? i.value.map((e) => e.value) :
|
|
103
|
-
),
|
|
104
|
-
|
|
105
|
-
r.value &&
|
|
106
|
-
}),
|
|
114
|
+
() => i.value.length > 0 ? i.value.map((e) => e.value) : x.value
|
|
115
|
+
), Y = a(() => f.value ? Array.isArray(t.value) ? t.value : t.value ? [t.value] : [] : o.value), u = d(0), O = a(() => o.value[u.value] || ""), Z = a(() => `${H.value}-listbox`), ee = (e) => `${H.value}-option-${e.replace(/\s+/g, "-")}`;
|
|
116
|
+
c(u, (e) => {
|
|
117
|
+
r.value && f.value && s.scrollToIndex(e);
|
|
118
|
+
}), c(
|
|
107
119
|
o,
|
|
108
120
|
(e) => {
|
|
109
121
|
u.value >= e.length && (u.value = Math.max(e.length - 1, 0));
|
|
110
122
|
},
|
|
111
123
|
{ immediate: !0 }
|
|
112
|
-
),
|
|
124
|
+
), c(r, async (e) => {
|
|
113
125
|
if (e) {
|
|
114
|
-
if (await
|
|
115
|
-
const n = o.value.indexOf(
|
|
126
|
+
if (await R(), S(), typeof t.value == "string") {
|
|
127
|
+
const n = o.value.indexOf(t.value);
|
|
116
128
|
n !== -1 && (u.value = n);
|
|
117
129
|
}
|
|
118
|
-
s.refresh(),
|
|
130
|
+
s.refresh(), f.value && s.scrollToIndex(u.value);
|
|
119
131
|
}
|
|
120
|
-
}),
|
|
121
|
-
await
|
|
122
|
-
}),
|
|
123
|
-
document.removeEventListener("click",
|
|
132
|
+
}), oe(async () => {
|
|
133
|
+
await R(), S(), document.addEventListener("click", q);
|
|
134
|
+
}), ie(() => {
|
|
135
|
+
document.removeEventListener("click", q);
|
|
124
136
|
});
|
|
125
|
-
const
|
|
126
|
-
|
|
127
|
-
const
|
|
128
|
-
() =>
|
|
129
|
-
),
|
|
137
|
+
const te = a(() => typeof t.value == "string" ? t.value === "" ? D.value : i.value.find((e) => e.value === t.value)?.label : i.value.find((e) => e.value === t.value)?.label), le = 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 }]);
|
|
138
|
+
w("select-selected-value", t), w("select-change-selected-value", b), w("select-height", se(l, "height"));
|
|
139
|
+
const B = d(null), ae = a(
|
|
140
|
+
() => g.value ? `${B.value?.clientWidth || 0}px` : void 0
|
|
141
|
+
), L = { t: M, props: l, computedNoElementPlaceholder: D, emit: A, modelValue: p, updateModelValue: h, initialValue: t, open: r, disabledInput: v, autoOptionsWidth: g, selectedLineOutset: y, id: H, name: W, autocomplete: k, tabindex: $, changeHandler: b, focus: m, focusHandler: z, blurHandler: F, modifiers: U, styles: j, clickHandler: G, closeHandler: q, optionsMap: i, optionsDOMRef: I, slotDomOptions: x, renderedOptions: N, virtualEnabled: f, virtualItemHeight: E, virtualOverscan: V, virtualDynamicHeight: _, virtualList: s, virtualOptions: J, virtualSpacerStyle: K, virtualContentStyle: Q, virtualMaxHeight: X, refreshDomOptions: S, domOptions: o, nativeOptions: Y, currentIndex: u, currentFocusedEl: O, listboxId: Z, getOptionId: ee, selectedValueTitle: te, tags: le, nmorphSelectDOMRef: B, optionsMinWidth: ae, spaceHandler: () => {
|
|
130
142
|
v.value || (r.value = !r.value);
|
|
131
143
|
}, arrowDownHandler: () => {
|
|
132
144
|
v.value || o.value.length !== 0 && (r.value || (r.value = !0), u.value = (u.value + 1) % o.value.length);
|
|
133
145
|
}, arrowUpHandler: () => {
|
|
134
146
|
v.value || o.value.length !== 0 && (r.value || (r.value = !0), u.value = (u.value - 1 + o.value.length) % o.value.length);
|
|
135
147
|
}, enterHandler: () => {
|
|
136
|
-
r.value && O.value &&
|
|
148
|
+
r.value && O.value && b(O.value);
|
|
137
149
|
}, setVirtualOptionRef: (e, n) => {
|
|
138
|
-
s.measureElement(n,
|
|
150
|
+
s.measureElement(n, pe(e));
|
|
139
151
|
}, escapeHandler: () => {
|
|
140
152
|
r.value = !1;
|
|
141
153
|
}, homeHandler: () => {
|
|
@@ -143,21 +155,21 @@ const Ue = /* @__PURE__ */ ne({
|
|
|
143
155
|
}, endHandler: () => {
|
|
144
156
|
u.value = Math.max(o.value.length - 1, 0);
|
|
145
157
|
}, get NmorphTagItem() {
|
|
146
|
-
return
|
|
158
|
+
return xe;
|
|
147
159
|
}, get NmorphIcon() {
|
|
148
|
-
return
|
|
160
|
+
return Ie;
|
|
149
161
|
}, get NmorphSelectOption() {
|
|
150
|
-
return
|
|
162
|
+
return qe;
|
|
151
163
|
}, get NmorphDropdown() {
|
|
152
|
-
return
|
|
164
|
+
return be;
|
|
153
165
|
}, get NmorphIconLoaderDots() {
|
|
154
|
-
return
|
|
166
|
+
return Se;
|
|
155
167
|
}, get NmorphIconChevronDown() {
|
|
156
|
-
return
|
|
168
|
+
return Ne;
|
|
157
169
|
} };
|
|
158
|
-
return Object.defineProperty(
|
|
170
|
+
return Object.defineProperty(L, "__isScriptSetup", { enumerable: !1, value: !0 }), L;
|
|
159
171
|
}
|
|
160
172
|
});
|
|
161
173
|
export {
|
|
162
|
-
|
|
174
|
+
Ge as default
|
|
163
175
|
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import './NmorphSelectOption.css';
|
|
2
2
|
import { defineComponent as g, inject as l, computed as t } from "vue";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import q from "
|
|
7
|
-
|
|
3
|
+
import { useModifiers as y } from "../../../../../utils/create-modifiers.js";
|
|
4
|
+
import { createCssVariables as b } from "../../../../../utils/common.js";
|
|
5
|
+
import { NmorphComponentHeight as S } from "../../../../../types/common.types.js";
|
|
6
|
+
import q from "../../../../basic/nmorph-icon/NmorphIcon.vue.js";
|
|
7
|
+
import _ from "../../../../../assets/icons/success.svg.js";
|
|
8
|
+
const H = /* @__PURE__ */ g({
|
|
8
9
|
__name: "NmorphSelectOption",
|
|
9
10
|
props: {
|
|
10
11
|
value: { type: String, required: !0 },
|
|
@@ -25,29 +26,31 @@ const I = /* @__PURE__ */ g({
|
|
|
25
26
|
const r = l("select-selected-value"), o = l("select-change-selected-value"), a = l(
|
|
26
27
|
"select-height",
|
|
27
28
|
void 0
|
|
28
|
-
), e = c,
|
|
29
|
-
e.disabled || (
|
|
30
|
-
},
|
|
31
|
-
() =>
|
|
32
|
-
nmorph: [
|
|
29
|
+
), e = c, s = p, f = () => {
|
|
30
|
+
e.disabled || (s("change-value", e.value), o && o(e.value));
|
|
31
|
+
}, i = t(() => typeof r?.value == "string" ? r.value === e.value : Array.isArray(r?.value) ? r.value.some((v) => v === e.value) : !1), u = t(() => e.height || a?.value || "basic"), m = t(
|
|
32
|
+
() => y({
|
|
33
|
+
nmorph: [S[u.value]],
|
|
33
34
|
"nmorph-select-option": [
|
|
34
35
|
e.disabled && "disabled",
|
|
35
36
|
e.label && "with-label",
|
|
36
|
-
|
|
37
|
+
i.value && "checked",
|
|
37
38
|
e.focused && "focused"
|
|
38
39
|
]
|
|
39
40
|
})
|
|
40
|
-
),
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
41
|
+
), h = t(
|
|
42
|
+
() => b({
|
|
43
|
+
"--hover-bg": e.hoverBackground,
|
|
44
|
+
"--hover-color": e.hoverColor
|
|
45
|
+
})
|
|
46
|
+
), n = { selectSelectedValue: r, selectChangeSelectedValue: o, selectHeight: a, props: e, emit: s, clickHandler: f, checked: i, height: u, modifiers: m, styles: h, get NmorphIcon() {
|
|
46
47
|
return q;
|
|
48
|
+
}, get NmorphIconSuccess() {
|
|
49
|
+
return _;
|
|
47
50
|
} };
|
|
48
51
|
return Object.defineProperty(n, "__isScriptSetup", { enumerable: !1, value: !0 }), n;
|
|
49
52
|
}
|
|
50
53
|
});
|
|
51
54
|
export {
|
|
52
|
-
|
|
55
|
+
H as default
|
|
53
56
|
};
|