naive-ui 2.40.4 → 2.41.1
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/index.js +3516 -1947
- package/dist/index.mjs +3510 -1949
- package/dist/index.prod.js +1 -1
- package/dist/index.prod.mjs +1 -1
- package/es/_internal/selection/src/Selection.d.ts +1 -1
- package/es/_mixins/use-form-item.d.ts +1 -1
- package/es/_utils/dom/download.d.ts +1 -0
- package/es/_utils/dom/download.mjs +3 -0
- package/es/_utils/index.d.ts +2 -2
- package/es/_utils/index.mjs +2 -2
- package/es/_utils/naive/index.d.ts +1 -0
- package/es/_utils/naive/index.mjs +1 -0
- package/es/_utils/naive/value.d.ts +1 -0
- package/es/_utils/naive/value.mjs +13 -0
- package/es/_utils/vue/get-first-slot-vnode.d.ts +1 -0
- package/es/_utils/vue/get-first-slot-vnode.mjs +13 -0
- package/es/_utils/vue/index.d.ts +2 -2
- package/es/_utils/vue/index.mjs +2 -2
- package/es/_utils/vue/resolve-slot.d.ts +1 -1
- package/es/_utils/vue/resolve-slot.mjs +1 -1
- package/es/alert/index.d.ts +1 -1
- package/es/alert/src/Alert.d.ts +7 -2
- package/es/alert/src/Alert.mjs +1 -0
- package/es/auto-complete/index.d.ts +2 -2
- package/es/auto-complete/src/AutoComplete.d.ts +10 -4
- package/es/auto-complete/src/AutoComplete.mjs +3 -2
- package/es/auto-complete/src/interface.d.ts +6 -0
- package/es/avatar/index.d.ts +1 -1
- package/es/avatar/src/Avatar.d.ts +7 -2
- package/es/avatar/src/Avatar.mjs +1 -0
- package/es/avatar-group/index.d.ts +2 -1
- package/es/avatar-group/src/AvatarGroup.d.ts +8 -2
- package/es/avatar-group/src/AvatarGroup.mjs +1 -0
- package/es/avatar-group/src/interface.d.ts +8 -0
- package/es/avatar-group/src/interface.mjs +1 -0
- package/es/breadcrumb/index.d.ts +1 -1
- package/es/breadcrumb/src/BreadcrumbItem.d.ts +6 -2
- package/es/breadcrumb/src/BreadcrumbItem.mjs +1 -0
- package/es/button/index.d.ts +1 -1
- package/es/button/src/Button.d.ts +6 -2
- package/es/button/src/Button.mjs +1 -0
- package/es/calendar/src/Calendar.d.ts +7 -3
- package/es/calendar/src/Calendar.mjs +3 -2
- package/es/calendar/src/interface.d.ts +9 -0
- package/es/card/index.d.ts +1 -1
- package/es/card/src/Card.d.ts +10 -2
- package/es/card/src/Card.mjs +1 -0
- package/es/carousel/index.d.ts +2 -2
- package/es/carousel/src/Carousel.d.ts +8 -3
- package/es/carousel/src/Carousel.mjs +4 -3
- package/es/carousel/src/interface.d.ts +12 -0
- package/es/cascader/index.d.ts +1 -1
- package/es/cascader/src/Cascader.d.ts +9 -3
- package/es/cascader/src/Cascader.mjs +1 -0
- package/es/collapse/index.d.ts +3 -2
- package/es/collapse/src/Collapse.d.ts +10 -4
- package/es/collapse/src/Collapse.mjs +1 -0
- package/es/collapse/src/CollapseItem.d.ts +9 -4
- package/es/collapse/src/CollapseItem.mjs +8 -11
- package/es/collapse/src/interface.d.ts +12 -0
- package/es/color-picker/index.d.ts +1 -1
- package/es/color-picker/src/ColorPicker.d.ts +7 -2
- package/es/color-picker/src/ColorPicker.mjs +1 -3
- package/es/color-picker/src/ColorPickerTrigger.d.ts +2 -2
- package/es/color-picker/src/ColorPickerTrigger.mjs +1 -0
- package/es/color-picker/src/context.d.ts +3 -2
- package/es/components.d.ts +1 -0
- package/es/components.mjs +1 -0
- package/es/config-provider/src/internal-interface.d.ts +2 -0
- package/es/data-table/index.d.ts +1 -1
- package/es/data-table/src/DataTable.d.ts +9 -8
- package/es/data-table/src/DataTable.mjs +7 -6
- package/es/data-table/src/TableParts/Body.d.ts +1 -3
- package/es/data-table/src/interface.d.ts +7 -2
- package/es/data-table/src/styles/index.cssr.mjs +1 -0
- package/es/data-table/src/use-group-header.mjs +4 -3
- package/es/date-picker/index.d.ts +1 -0
- package/es/date-picker/src/DatePicker.d.ts +27 -5
- package/es/date-picker/src/DatePicker.mjs +1 -0
- package/es/date-picker/src/interface.d.ts +3 -2
- package/es/date-picker/src/panel/date.d.ts +1 -3
- package/es/date-picker/src/panel/date.mjs +8 -8
- package/es/date-picker/src/panel/daterange.d.ts +1 -3
- package/es/date-picker/src/panel/daterange.mjs +12 -12
- package/es/date-picker/src/panel/datetime.d.ts +1 -3
- package/es/date-picker/src/panel/datetime.mjs +10 -10
- package/es/date-picker/src/panel/datetimerange.d.ts +1 -3
- package/es/date-picker/src/panel/datetimerange.mjs +12 -12
- package/es/date-picker/src/panel/month.d.ts +1 -3
- package/es/date-picker/src/panel/month.mjs +9 -9
- package/es/date-picker/src/panel/monthrange.d.ts +1 -3
- package/es/date-picker/src/panel/monthrange.mjs +9 -7
- package/es/date-picker/src/panel/panelHeader.d.ts +4 -12
- package/es/date-picker/src/panel/use-calendar.d.ts +1 -3
- package/es/date-picker/src/panel/use-dual-calendar.d.ts +1 -3
- package/es/date-picker/src/props.d.ts +1 -1
- package/es/descriptions/index.d.ts +2 -2
- package/es/descriptions/src/Descriptions.d.ts +7 -3
- package/es/descriptions/src/Descriptions.mjs +1 -0
- package/es/descriptions/src/DescriptionsItem.d.ts +6 -2
- package/es/descriptions/src/DescriptionsItem.mjs +1 -0
- package/es/dialog/index.d.ts +1 -0
- package/es/dialog/src/Dialog.d.ts +9 -2
- package/es/dialog/src/Dialog.mjs +1 -0
- package/es/dialog/src/DialogEnvironment.d.ts +5 -1
- package/es/dialog/src/DialogEnvironment.mjs +8 -3
- package/es/dialog/src/DialogProvider.d.ts +8 -2
- package/es/drawer/index.d.ts +1 -1
- package/es/drawer/src/Drawer.d.ts +2 -2
- package/es/drawer/src/DrawerBodyWrapper.d.ts +1 -1
- package/es/drawer/src/DrawerContent.d.ts +7 -2
- package/es/drawer/src/DrawerContent.mjs +1 -0
- package/es/dynamic-input/index.d.ts +2 -1
- package/es/dynamic-input/src/DynamicInput.d.ts +8 -2
- package/es/dynamic-input/src/DynamicInput.mjs +3 -3
- package/es/dynamic-input/src/interface.d.ts +11 -0
- package/es/dynamic-tags/index.d.ts +2 -2
- package/es/dynamic-tags/src/DynamicTags.d.ts +8 -3
- package/es/dynamic-tags/src/DynamicTags.mjs +1 -0
- package/es/dynamic-tags/src/interface.d.ts +8 -0
- package/es/ellipsis/index.d.ts +1 -1
- package/es/ellipsis/src/Ellipsis.d.ts +6 -2
- package/es/ellipsis/src/Ellipsis.mjs +1 -0
- package/es/empty/index.d.ts +1 -1
- package/es/empty/src/Empty.d.ts +7 -2
- package/es/empty/src/Empty.mjs +1 -0
- package/es/float-button/index.d.ts +1 -1
- package/es/float-button/src/FloatButton.d.ts +7 -2
- package/es/float-button/src/FloatButton.mjs +1 -0
- package/es/form/index.d.ts +1 -0
- package/es/form/src/FormItem.d.ts +1 -1
- package/es/form/src/FormItemCol.d.ts +1 -1
- package/es/form/src/FormItemGridItem.d.ts +1 -1
- package/es/form/src/interface.d.ts +0 -1
- package/es/form/src/public-types.d.ts +1 -0
- package/es/form/src/public-types.mjs +1 -0
- package/es/image/index.d.ts +1 -1
- package/es/image/src/Image.d.ts +6 -2
- package/es/image/src/Image.mjs +2 -5
- package/es/input/index.d.ts +1 -1
- package/es/input/src/Input.d.ts +14 -3
- package/es/input/src/Input.mjs +8 -8
- package/es/input/src/WordCount.mjs +2 -2
- package/es/input-number/index.d.ts +1 -1
- package/es/input-number/src/InputNumber.d.ts +9 -3
- package/es/input-number/src/InputNumber.mjs +1 -0
- package/es/input-otp/index.d.ts +3 -0
- package/es/input-otp/index.mjs +1 -0
- package/es/input-otp/src/InputOtp.d.ts +871 -0
- package/es/input-otp/src/InputOtp.mjs +317 -0
- package/es/input-otp/src/public-types.d.ts +24 -0
- package/es/input-otp/src/public-types.mjs +1 -0
- package/es/input-otp/src/styles/index.cssr.d.ts +2 -0
- package/es/input-otp/src/styles/index.cssr.mjs +11 -0
- package/es/input-otp/src/styles/input-otp-rtl.cssr.d.ts +2 -0
- package/es/input-otp/src/styles/input-otp-rtl.cssr.mjs +5 -0
- package/es/input-otp/styles/dark.d.ts +3 -0
- package/es/input-otp/styles/dark.mjs +12 -0
- package/es/input-otp/styles/index.d.ts +4 -0
- package/es/input-otp/styles/index.mjs +3 -0
- package/es/input-otp/styles/light.d.ts +81 -0
- package/es/input-otp/styles/light.mjs +22 -0
- package/es/input-otp/styles/rtl.d.ts +2 -0
- package/es/input-otp/styles/rtl.mjs +5 -0
- package/es/list/index.d.ts +2 -1
- package/es/list/src/List.d.ts +7 -2
- package/es/list/src/List.mjs +1 -0
- package/es/list/src/ListItem.d.ts +7 -1
- package/es/list/src/ListItem.mjs +1 -0
- package/es/locales/common/kmKH.d.ts +3 -0
- package/es/locales/common/kmKH.mjs +124 -0
- package/es/locales/common/ugCN.d.ts +3 -0
- package/es/locales/common/ugCN.mjs +124 -0
- package/es/locales/date/kmKH.d.ts +3 -0
- package/es/locales/date/kmKH.mjs +6 -0
- package/es/locales/date/ugCN.d.ts +3 -0
- package/es/locales/date/ugCN.mjs +6 -0
- package/es/locales/index.d.ts +3 -0
- package/es/locales/index.mjs +3 -0
- package/es/mention/index.d.ts +1 -1
- package/es/mention/src/Mention.d.ts +7 -3
- package/es/mention/src/Mention.mjs +1 -0
- package/es/modal/index.d.ts +1 -1
- package/es/modal/src/BodyWrapper.d.ts +20 -5
- package/es/modal/src/BodyWrapper.mjs +55 -13
- package/es/modal/src/Modal.d.ts +19 -8
- package/es/modal/src/Modal.mjs +3 -0
- package/es/modal/src/ModalEnvironment.d.ts +4 -2
- package/es/modal/src/ModalProvider.mjs +0 -6
- package/es/modal/src/composables.d.ts +13 -1
- package/es/modal/src/composables.mjs +105 -1
- package/es/modal/src/interface.d.ts +6 -0
- package/es/modal/src/styles/index.cssr.mjs +5 -1
- package/es/page-header/index.d.ts +1 -1
- package/es/page-header/src/PageHeader.d.ts +12 -2
- package/es/page-header/src/PageHeader.mjs +1 -0
- package/es/pagination/index.d.ts +1 -1
- package/es/pagination/src/Pagination.d.ts +12 -3
- package/es/pagination/src/Pagination.mjs +3 -2
- package/es/pagination/src/interface.d.ts +1 -0
- package/es/popconfirm/index.d.ts +1 -1
- package/es/popconfirm/src/Popconfirm.d.ts +8 -2
- package/es/popconfirm/src/Popconfirm.mjs +2 -1
- package/es/popover/index.d.ts +1 -1
- package/es/popover/src/Popover.d.ts +8 -2
- package/es/popover/src/Popover.mjs +2 -5
- package/es/popselect/index.d.ts +1 -1
- package/es/popselect/src/Popselect.d.ts +8 -2
- package/es/popselect/src/Popselect.mjs +1 -0
- package/es/progress/src/Circle.d.ts +1 -1
- package/es/progress/src/MultipleCircle.d.ts +1 -1
- package/es/progress/src/Progress.d.ts +2 -2
- package/es/result/index.d.ts +1 -1
- package/es/result/src/Result.d.ts +7 -2
- package/es/result/src/Result.mjs +1 -0
- package/es/select/index.d.ts +1 -1
- package/es/select/src/Select.d.ts +10 -3
- package/es/select/src/Select.mjs +1 -0
- package/es/slider/index.d.ts +1 -1
- package/es/slider/src/Slider.d.ts +6 -2
- package/es/slider/src/Slider.mjs +1 -0
- package/es/spin/index.d.ts +1 -1
- package/es/spin/src/Spin.d.ts +7 -2
- package/es/spin/src/Spin.mjs +1 -0
- package/es/split/index.d.ts +1 -1
- package/es/split/src/Split.d.ts +8 -2
- package/es/split/src/Split.mjs +1 -0
- package/es/statistic/index.d.ts +1 -1
- package/es/statistic/src/Statistic.d.ts +8 -1
- package/es/statistic/src/Statistic.mjs +1 -0
- package/es/steps/index.d.ts +2 -2
- package/es/steps/src/Step.d.ts +8 -5
- package/es/steps/src/Step.mjs +1 -0
- package/es/steps/src/Steps.d.ts +8 -3
- package/es/steps/src/Steps.mjs +1 -0
- package/es/styles.d.ts +1 -0
- package/es/styles.mjs +1 -0
- package/es/switch/index.d.ts +1 -1
- package/es/switch/src/Switch.d.ts +10 -2
- package/es/switch/src/Switch.mjs +1 -0
- package/es/tabs/index.d.ts +2 -2
- package/es/tabs/src/TabPane.d.ts +8 -2
- package/es/tabs/src/TabPane.mjs +1 -0
- package/es/tabs/src/Tabs.d.ts +7 -2
- package/es/tabs/src/Tabs.mjs +1 -0
- package/es/tag/index.d.ts +1 -1
- package/es/tag/src/Tag.d.ts +7 -2
- package/es/tag/src/Tag.mjs +1 -0
- package/es/themes/dark.mjs +2 -1
- package/es/themes/light.mjs +2 -0
- package/es/thing/index.d.ts +1 -1
- package/es/thing/src/Thing.d.ts +11 -2
- package/es/thing/src/Thing.mjs +1 -0
- package/es/time-picker/index.d.ts +1 -1
- package/es/time-picker/src/TimePicker.d.ts +6 -2
- package/es/timeline/index.d.ts +1 -1
- package/es/timeline/src/TimelineItem.d.ts +8 -2
- package/es/timeline/src/TimelineItem.mjs +1 -0
- package/es/tooltip/index.d.ts +1 -1
- package/es/tooltip/src/Tooltip.d.ts +5 -2
- package/es/tooltip/src/Tooltip.mjs +1 -0
- package/es/transfer/src/Transfer.d.ts +1 -1
- package/es/tree/index.d.ts +1 -1
- package/es/tree/src/Tree.d.ts +27 -19
- package/es/tree/src/Tree.mjs +5 -4
- package/es/tree-select/index.d.ts +1 -1
- package/es/tree-select/src/TreeSelect.d.ts +22 -3
- package/es/tree-select/src/TreeSelect.mjs +2 -0
- package/es/typography/src/text.d.ts +1 -1
- package/es/upload/index.d.ts +2 -0
- package/es/upload/index.mjs +1 -0
- package/es/upload/src/Upload.d.ts +11 -8
- package/es/upload/src/Upload.mjs +2 -0
- package/es/upload/src/UploadFile.mjs +8 -1
- package/es/upload/src/UploadTrigger.d.ts +7 -2
- package/es/upload/src/UploadTrigger.mjs +1 -0
- package/es/upload/src/interface.d.ts +8 -0
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/watermark/src/Watermark.d.ts +1 -1
- package/lib/_internal/selection/src/Selection.d.ts +1 -1
- package/lib/_mixins/use-form-item.d.ts +1 -1
- package/lib/_utils/dom/download.d.ts +1 -0
- package/lib/_utils/dom/download.js +4 -0
- package/lib/_utils/index.d.ts +2 -2
- package/lib/_utils/index.js +4 -2
- package/lib/_utils/naive/index.d.ts +1 -0
- package/lib/_utils/naive/index.js +3 -1
- package/lib/_utils/naive/value.d.ts +1 -0
- package/lib/_utils/naive/value.js +18 -0
- package/lib/_utils/vue/get-first-slot-vnode.d.ts +1 -0
- package/lib/_utils/vue/get-first-slot-vnode.js +15 -0
- package/lib/_utils/vue/index.d.ts +2 -2
- package/lib/_utils/vue/index.js +3 -2
- package/lib/_utils/vue/resolve-slot.d.ts +1 -1
- package/lib/_utils/vue/resolve-slot.js +2 -2
- package/lib/alert/index.d.ts +1 -1
- package/lib/alert/src/Alert.d.ts +7 -2
- package/lib/alert/src/Alert.js +1 -0
- package/lib/auto-complete/index.d.ts +2 -2
- package/lib/auto-complete/src/AutoComplete.d.ts +10 -4
- package/lib/auto-complete/src/AutoComplete.js +2 -1
- package/lib/auto-complete/src/interface.d.ts +6 -0
- package/lib/avatar/index.d.ts +1 -1
- package/lib/avatar/src/Avatar.d.ts +7 -2
- package/lib/avatar/src/Avatar.js +1 -0
- package/lib/avatar-group/index.d.ts +2 -1
- package/lib/avatar-group/src/AvatarGroup.d.ts +8 -2
- package/lib/avatar-group/src/AvatarGroup.js +1 -0
- package/lib/avatar-group/src/interface.d.ts +8 -0
- package/lib/avatar-group/src/interface.js +2 -0
- package/lib/breadcrumb/index.d.ts +1 -1
- package/lib/breadcrumb/src/BreadcrumbItem.d.ts +6 -2
- package/lib/breadcrumb/src/BreadcrumbItem.js +1 -0
- package/lib/button/index.d.ts +1 -1
- package/lib/button/src/Button.d.ts +6 -2
- package/lib/button/src/Button.js +1 -0
- package/lib/calendar/src/Calendar.d.ts +7 -3
- package/lib/calendar/src/Calendar.js +2 -1
- package/lib/calendar/src/interface.d.ts +9 -0
- package/lib/card/index.d.ts +1 -1
- package/lib/card/src/Card.d.ts +10 -2
- package/lib/card/src/Card.js +1 -0
- package/lib/carousel/index.d.ts +2 -2
- package/lib/carousel/src/Carousel.d.ts +8 -3
- package/lib/carousel/src/Carousel.js +3 -2
- package/lib/carousel/src/interface.d.ts +12 -0
- package/lib/cascader/index.d.ts +1 -1
- package/lib/cascader/src/Cascader.d.ts +9 -3
- package/lib/cascader/src/Cascader.js +1 -0
- package/lib/collapse/index.d.ts +3 -2
- package/lib/collapse/src/Collapse.d.ts +10 -4
- package/lib/collapse/src/Collapse.js +1 -0
- package/lib/collapse/src/CollapseItem.d.ts +9 -4
- package/lib/collapse/src/CollapseItem.js +6 -9
- package/lib/collapse/src/interface.d.ts +12 -0
- package/lib/color-picker/index.d.ts +1 -1
- package/lib/color-picker/src/ColorPicker.d.ts +7 -2
- package/lib/color-picker/src/ColorPicker.js +3 -4
- package/lib/color-picker/src/ColorPickerTrigger.d.ts +2 -2
- package/lib/color-picker/src/ColorPickerTrigger.js +1 -0
- package/lib/color-picker/src/context.d.ts +3 -2
- package/lib/components.d.ts +1 -0
- package/lib/components.js +1 -0
- package/lib/config-provider/src/internal-interface.d.ts +2 -0
- package/lib/data-table/index.d.ts +1 -1
- package/lib/data-table/src/DataTable.d.ts +9 -8
- package/lib/data-table/src/DataTable.js +7 -6
- package/lib/data-table/src/TableParts/Body.d.ts +1 -3
- package/lib/data-table/src/interface.d.ts +7 -2
- package/lib/data-table/src/styles/index.cssr.js +1 -0
- package/lib/data-table/src/use-group-header.js +4 -3
- package/lib/date-picker/index.d.ts +1 -0
- package/lib/date-picker/src/DatePicker.d.ts +27 -5
- package/lib/date-picker/src/DatePicker.js +1 -0
- package/lib/date-picker/src/interface.d.ts +3 -2
- package/lib/date-picker/src/panel/date.d.ts +1 -3
- package/lib/date-picker/src/panel/date.js +15 -7
- package/lib/date-picker/src/panel/daterange.d.ts +1 -3
- package/lib/date-picker/src/panel/daterange.js +27 -11
- package/lib/date-picker/src/panel/datetime.d.ts +1 -3
- package/lib/date-picker/src/panel/datetime.js +16 -8
- package/lib/date-picker/src/panel/datetimerange.d.ts +1 -3
- package/lib/date-picker/src/panel/datetimerange.js +27 -11
- package/lib/date-picker/src/panel/month.d.ts +1 -3
- package/lib/date-picker/src/panel/month.js +6 -6
- package/lib/date-picker/src/panel/monthrange.d.ts +1 -3
- package/lib/date-picker/src/panel/monthrange.js +5 -3
- package/lib/date-picker/src/panel/panelHeader.d.ts +4 -12
- package/lib/date-picker/src/panel/use-calendar.d.ts +1 -3
- package/lib/date-picker/src/panel/use-dual-calendar.d.ts +1 -3
- package/lib/date-picker/src/props.d.ts +1 -1
- package/lib/descriptions/index.d.ts +2 -2
- package/lib/descriptions/src/Descriptions.d.ts +7 -3
- package/lib/descriptions/src/Descriptions.js +1 -0
- package/lib/descriptions/src/DescriptionsItem.d.ts +6 -2
- package/lib/descriptions/src/DescriptionsItem.js +1 -0
- package/lib/dialog/index.d.ts +1 -0
- package/lib/dialog/src/Dialog.d.ts +9 -2
- package/lib/dialog/src/Dialog.js +1 -0
- package/lib/dialog/src/DialogEnvironment.d.ts +5 -1
- package/lib/dialog/src/DialogEnvironment.js +3 -3
- package/lib/dialog/src/DialogProvider.d.ts +8 -2
- package/lib/drawer/index.d.ts +1 -1
- package/lib/drawer/src/Drawer.d.ts +2 -2
- package/lib/drawer/src/DrawerBodyWrapper.d.ts +1 -1
- package/lib/drawer/src/DrawerContent.d.ts +7 -2
- package/lib/drawer/src/DrawerContent.js +1 -0
- package/lib/dynamic-input/index.d.ts +2 -1
- package/lib/dynamic-input/src/DynamicInput.d.ts +8 -2
- package/lib/dynamic-input/src/DynamicInput.js +2 -2
- package/lib/dynamic-input/src/interface.d.ts +11 -0
- package/lib/dynamic-tags/index.d.ts +2 -2
- package/lib/dynamic-tags/src/DynamicTags.d.ts +8 -3
- package/lib/dynamic-tags/src/DynamicTags.js +1 -0
- package/lib/dynamic-tags/src/interface.d.ts +8 -0
- package/lib/ellipsis/index.d.ts +1 -1
- package/lib/ellipsis/src/Ellipsis.d.ts +6 -2
- package/lib/ellipsis/src/Ellipsis.js +1 -0
- package/lib/empty/index.d.ts +1 -1
- package/lib/empty/src/Empty.d.ts +7 -2
- package/lib/empty/src/Empty.js +1 -0
- package/lib/float-button/index.d.ts +1 -1
- package/lib/float-button/src/FloatButton.d.ts +7 -2
- package/lib/float-button/src/FloatButton.js +1 -0
- package/lib/form/index.d.ts +1 -0
- package/lib/form/src/FormItem.d.ts +1 -1
- package/lib/form/src/FormItemCol.d.ts +1 -1
- package/lib/form/src/FormItemGridItem.d.ts +1 -1
- package/lib/form/src/interface.d.ts +0 -1
- package/lib/form/src/public-types.d.ts +1 -0
- package/lib/form/src/public-types.js +2 -0
- package/lib/image/index.d.ts +1 -1
- package/lib/image/src/Image.d.ts +6 -2
- package/lib/image/src/Image.js +2 -2
- package/lib/input/index.d.ts +1 -1
- package/lib/input/src/Input.d.ts +14 -3
- package/lib/input/src/Input.js +9 -8
- package/lib/input/src/WordCount.js +1 -1
- package/lib/input-number/index.d.ts +1 -1
- package/lib/input-number/src/InputNumber.d.ts +9 -3
- package/lib/input-number/src/InputNumber.js +1 -0
- package/lib/input-otp/index.d.ts +3 -0
- package/lib/input-otp/index.js +9 -0
- package/lib/input-otp/src/InputOtp.d.ts +871 -0
- package/lib/input-otp/src/InputOtp.js +242 -0
- package/lib/input-otp/src/public-types.d.ts +24 -0
- package/lib/input-otp/src/public-types.js +2 -0
- package/lib/input-otp/src/styles/index.cssr.d.ts +2 -0
- package/lib/input-otp/src/styles/index.cssr.js +16 -0
- package/lib/input-otp/src/styles/input-otp-rtl.cssr.d.ts +2 -0
- package/lib/input-otp/src/styles/input-otp-rtl.cssr.js +10 -0
- package/lib/input-otp/styles/dark.d.ts +3 -0
- package/lib/input-otp/styles/dark.js +14 -0
- package/lib/input-otp/styles/index.d.ts +4 -0
- package/lib/input-otp/styles/index.js +12 -0
- package/lib/input-otp/styles/light.d.ts +81 -0
- package/lib/input-otp/styles/light.js +25 -0
- package/lib/input-otp/styles/rtl.d.ts +2 -0
- package/lib/input-otp/styles/rtl.js +11 -0
- package/lib/list/index.d.ts +2 -1
- package/lib/list/src/List.d.ts +7 -2
- package/lib/list/src/List.js +1 -0
- package/lib/list/src/ListItem.d.ts +7 -1
- package/lib/list/src/ListItem.js +1 -0
- package/lib/locales/common/kmKH.d.ts +3 -0
- package/lib/locales/common/kmKH.js +126 -0
- package/lib/locales/common/ugCN.d.ts +3 -0
- package/lib/locales/common/ugCN.js +126 -0
- package/lib/locales/date/kmKH.d.ts +3 -0
- package/lib/locales/date/kmKH.js +8 -0
- package/lib/locales/date/ugCN.d.ts +3 -0
- package/lib/locales/date/ugCN.js +8 -0
- package/lib/locales/index.d.ts +3 -0
- package/lib/locales/index.js +8 -2
- package/lib/mention/index.d.ts +1 -1
- package/lib/mention/src/Mention.d.ts +7 -3
- package/lib/mention/src/Mention.js +1 -0
- package/lib/modal/index.d.ts +1 -1
- package/lib/modal/src/BodyWrapper.d.ts +20 -5
- package/lib/modal/src/BodyWrapper.js +47 -14
- package/lib/modal/src/Modal.d.ts +19 -8
- package/lib/modal/src/Modal.js +3 -2
- package/lib/modal/src/ModalEnvironment.d.ts +4 -2
- package/lib/modal/src/ModalProvider.js +0 -6
- package/lib/modal/src/composables.d.ts +13 -1
- package/lib/modal/src/composables.js +100 -0
- package/lib/modal/src/interface.d.ts +6 -0
- package/lib/modal/src/styles/index.cssr.js +5 -1
- package/lib/page-header/index.d.ts +1 -1
- package/lib/page-header/src/PageHeader.d.ts +12 -2
- package/lib/page-header/src/PageHeader.js +1 -0
- package/lib/pagination/index.d.ts +1 -1
- package/lib/pagination/src/Pagination.d.ts +12 -3
- package/lib/pagination/src/Pagination.js +3 -2
- package/lib/pagination/src/interface.d.ts +1 -0
- package/lib/popconfirm/index.d.ts +1 -1
- package/lib/popconfirm/src/Popconfirm.d.ts +8 -2
- package/lib/popconfirm/src/Popconfirm.js +2 -1
- package/lib/popover/index.d.ts +1 -1
- package/lib/popover/src/Popover.d.ts +8 -2
- package/lib/popover/src/Popover.js +2 -6
- package/lib/popselect/index.d.ts +1 -1
- package/lib/popselect/src/Popselect.d.ts +8 -2
- package/lib/popselect/src/Popselect.js +1 -0
- package/lib/progress/src/Circle.d.ts +1 -1
- package/lib/progress/src/MultipleCircle.d.ts +1 -1
- package/lib/progress/src/Progress.d.ts +2 -2
- package/lib/result/index.d.ts +1 -1
- package/lib/result/src/Result.d.ts +7 -2
- package/lib/result/src/Result.js +1 -0
- package/lib/select/index.d.ts +1 -1
- package/lib/select/src/Select.d.ts +10 -3
- package/lib/select/src/Select.js +1 -0
- package/lib/slider/index.d.ts +1 -1
- package/lib/slider/src/Slider.d.ts +6 -2
- package/lib/slider/src/Slider.js +1 -0
- package/lib/spin/index.d.ts +1 -1
- package/lib/spin/src/Spin.d.ts +7 -2
- package/lib/spin/src/Spin.js +1 -0
- package/lib/split/index.d.ts +1 -1
- package/lib/split/src/Split.d.ts +8 -2
- package/lib/split/src/Split.js +1 -0
- package/lib/statistic/index.d.ts +1 -1
- package/lib/statistic/src/Statistic.d.ts +8 -1
- package/lib/statistic/src/Statistic.js +1 -0
- package/lib/steps/index.d.ts +2 -2
- package/lib/steps/src/Step.d.ts +8 -5
- package/lib/steps/src/Step.js +1 -0
- package/lib/steps/src/Steps.d.ts +8 -3
- package/lib/steps/src/Steps.js +1 -0
- package/lib/styles.d.ts +1 -0
- package/lib/styles.js +99 -96
- package/lib/switch/index.d.ts +1 -1
- package/lib/switch/src/Switch.d.ts +10 -2
- package/lib/switch/src/Switch.js +1 -0
- package/lib/tabs/index.d.ts +2 -2
- package/lib/tabs/src/TabPane.d.ts +8 -2
- package/lib/tabs/src/TabPane.js +1 -0
- package/lib/tabs/src/Tabs.d.ts +7 -2
- package/lib/tabs/src/Tabs.js +1 -0
- package/lib/tag/index.d.ts +1 -1
- package/lib/tag/src/Tag.d.ts +7 -2
- package/lib/tag/src/Tag.js +1 -0
- package/lib/themes/dark.js +1 -0
- package/lib/themes/light.js +92 -90
- package/lib/thing/index.d.ts +1 -1
- package/lib/thing/src/Thing.d.ts +11 -2
- package/lib/thing/src/Thing.js +1 -0
- package/lib/time-picker/index.d.ts +1 -1
- package/lib/time-picker/src/TimePicker.d.ts +6 -2
- package/lib/timeline/index.d.ts +1 -1
- package/lib/timeline/src/TimelineItem.d.ts +8 -2
- package/lib/timeline/src/TimelineItem.js +1 -0
- package/lib/tooltip/index.d.ts +1 -1
- package/lib/tooltip/src/Tooltip.d.ts +5 -2
- package/lib/tooltip/src/Tooltip.js +1 -0
- package/lib/transfer/src/Transfer.d.ts +1 -1
- package/lib/tree/index.d.ts +1 -1
- package/lib/tree/src/Tree.d.ts +27 -19
- package/lib/tree/src/Tree.js +6 -4
- package/lib/tree-select/index.d.ts +1 -1
- package/lib/tree-select/src/TreeSelect.d.ts +22 -3
- package/lib/tree-select/src/TreeSelect.js +2 -1
- package/lib/typography/src/text.d.ts +1 -1
- package/lib/upload/index.d.ts +2 -0
- package/lib/upload/index.js +3 -1
- package/lib/upload/src/Upload.d.ts +11 -8
- package/lib/upload/src/Upload.js +2 -1
- package/lib/upload/src/UploadFile.js +7 -2
- package/lib/upload/src/UploadTrigger.d.ts +7 -2
- package/lib/upload/src/UploadTrigger.js +1 -0
- package/lib/upload/src/interface.d.ts +8 -0
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/watermark/src/Watermark.d.ts +1 -1
- package/package.json +1 -1
- package/volar.d.ts +3 -2
- package/web-types.json +142 -14
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.inputOtpProps = void 0;
|
|
18
|
+
const seemly_1 = require("seemly");
|
|
19
|
+
const vooks_1 = require("vooks");
|
|
20
|
+
const vue_1 = require("vue");
|
|
21
|
+
const _mixins_1 = require("../../_mixins");
|
|
22
|
+
const _utils_1 = require("../../_utils");
|
|
23
|
+
const input_1 = require("../../input");
|
|
24
|
+
const light_1 = __importDefault(require("../styles/light"));
|
|
25
|
+
const index_cssr_1 = __importDefault(require("./styles/index.cssr"));
|
|
26
|
+
exports.inputOtpProps = Object.assign(Object.assign({}, _mixins_1.useTheme.props), { defaultValue: { type: Array, default: [] }, value: Array, length: {
|
|
27
|
+
type: Number,
|
|
28
|
+
default: 6
|
|
29
|
+
}, size: String, disabled: Boolean, mask: Boolean, readonly: Boolean, status: String, gap: [String, Number], placeholder: { type: String, default: '' }, allowInput: Function, onBlur: [Function, Array], onFocus: [Function, Array], 'onUpdate:value': [Function, Array], onUpdateValue: [Function, Array], onFinish: [Function, Array] });
|
|
30
|
+
exports.default = (0, vue_1.defineComponent)({
|
|
31
|
+
name: 'InputOtp',
|
|
32
|
+
props: exports.inputOtpProps,
|
|
33
|
+
slots: Object,
|
|
34
|
+
setup(props) {
|
|
35
|
+
const { mergedClsPrefixRef, mergedRtlRef, inlineThemeDisabled } = (0, _mixins_1.useConfig)(props);
|
|
36
|
+
const themeRef = (0, _mixins_1.useTheme)('InputOtp', '-input-otp', index_cssr_1.default, light_1.default, props, mergedClsPrefixRef);
|
|
37
|
+
const rtlEnabledRef = (0, _mixins_1.useRtl)('InputOtp', mergedRtlRef, mergedClsPrefixRef);
|
|
38
|
+
// form-item
|
|
39
|
+
const formItem = (0, _mixins_1.useFormItem)(props);
|
|
40
|
+
const { mergedSizeRef, mergedDisabledRef, mergedStatusRef } = formItem;
|
|
41
|
+
const cssVarsRef = (0, vue_1.computed)(() => {
|
|
42
|
+
const { value: size } = mergedSizeRef;
|
|
43
|
+
const { gap: propGap } = props;
|
|
44
|
+
const { self: { [(0, _utils_1.createKey)('inputWidth', size)]: inputWidth, [(0, _utils_1.createKey)('gap', size)]: gap } } = themeRef.value;
|
|
45
|
+
return {
|
|
46
|
+
'--n-gap': propGap === undefined
|
|
47
|
+
? gap
|
|
48
|
+
: typeof propGap === 'number'
|
|
49
|
+
? (0, seemly_1.pxfy)(propGap)
|
|
50
|
+
: propGap,
|
|
51
|
+
'--n-input-width': inputWidth
|
|
52
|
+
};
|
|
53
|
+
});
|
|
54
|
+
const themeClassHandle = inlineThemeDisabled
|
|
55
|
+
? (0, _mixins_1.useThemeClass)('input-otp', (0, vue_1.computed)(() => {
|
|
56
|
+
const { value: size } = mergedSizeRef;
|
|
57
|
+
return size[0];
|
|
58
|
+
}), cssVarsRef, props)
|
|
59
|
+
: undefined;
|
|
60
|
+
const uncontrolledValueRef = (0, vue_1.ref)(props.defaultValue);
|
|
61
|
+
const controlledValueRef = (0, vue_1.toRef)(props, 'value');
|
|
62
|
+
const mergedValueRef = (0, vooks_1.useMergedState)(controlledValueRef, uncontrolledValueRef);
|
|
63
|
+
const inputRefList = (0, vue_1.ref)([]);
|
|
64
|
+
const inputTypeRef = (0, vue_1.computed)(() => props.mask ? 'password' : 'text');
|
|
65
|
+
const handleFocus = (e, index) => {
|
|
66
|
+
// If it's focused from other input element inside the component, returns
|
|
67
|
+
if (inputRefList === null || inputRefList === void 0 ? void 0 : inputRefList.value.some(inputInst => inputInst.inputElRef === e.relatedTarget)) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
const { onFocus } = props;
|
|
71
|
+
if (onFocus) {
|
|
72
|
+
(0, _utils_1.call)(onFocus, e, index);
|
|
73
|
+
}
|
|
74
|
+
const { nTriggerFormFocus } = formItem;
|
|
75
|
+
nTriggerFormFocus();
|
|
76
|
+
};
|
|
77
|
+
const handleBlur = (e, index) => {
|
|
78
|
+
// If it's blured to other input element inside the component, returns
|
|
79
|
+
if (inputRefList === null || inputRefList === void 0 ? void 0 : inputRefList.value.some(inputInst => inputInst.inputElRef === e.relatedTarget)) {
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
const { onBlur } = props;
|
|
83
|
+
const { nTriggerFormBlur } = formItem;
|
|
84
|
+
if (onBlur)
|
|
85
|
+
(0, _utils_1.call)(onBlur, e, index);
|
|
86
|
+
nTriggerFormBlur();
|
|
87
|
+
};
|
|
88
|
+
const focusOnChar = (charIndex) => {
|
|
89
|
+
if (charIndex >= props.length)
|
|
90
|
+
return;
|
|
91
|
+
if (charIndex < 0)
|
|
92
|
+
return;
|
|
93
|
+
inputRefList === null || inputRefList === void 0 ? void 0 : inputRefList.value[charIndex].focus();
|
|
94
|
+
inputRefList === null || inputRefList === void 0 ? void 0 : inputRefList.value[charIndex].select();
|
|
95
|
+
};
|
|
96
|
+
const focusOnNextChar = (currentIndex) => {
|
|
97
|
+
if (currentIndex >= props.length - 1) {
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
focusOnChar(currentIndex + 1);
|
|
101
|
+
};
|
|
102
|
+
const focusOnPrevChar = (currentIndex) => {
|
|
103
|
+
if (currentIndex <= 0) {
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
focusOnChar(currentIndex - 1);
|
|
107
|
+
};
|
|
108
|
+
const justifyValue = (value) => {
|
|
109
|
+
const justifiedValue = value ? Array.from(value) : [];
|
|
110
|
+
const length = props.length;
|
|
111
|
+
while (justifiedValue.length > length) {
|
|
112
|
+
justifiedValue.pop();
|
|
113
|
+
}
|
|
114
|
+
while (justifiedValue.length < length) {
|
|
115
|
+
justifiedValue.push('');
|
|
116
|
+
}
|
|
117
|
+
return justifiedValue;
|
|
118
|
+
};
|
|
119
|
+
function doUpdateValue(value, meta) {
|
|
120
|
+
const { nTriggerFormInput, nTriggerFormChange } = formItem;
|
|
121
|
+
if ((0, _utils_1.isArrayShallowEqual)(value, mergedValueRef.value)) {
|
|
122
|
+
nTriggerFormInput();
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
const { 'onUpdate:value': _onUpdateValue, onUpdateValue, length, onFinish } = props;
|
|
126
|
+
if (_onUpdateValue)
|
|
127
|
+
(0, _utils_1.call)(_onUpdateValue, value, meta);
|
|
128
|
+
if (onUpdateValue)
|
|
129
|
+
(0, _utils_1.call)(onUpdateValue, value, meta);
|
|
130
|
+
if (value.filter(v => v).length === length && onFinish) {
|
|
131
|
+
(0, _utils_1.call)(onFinish, value);
|
|
132
|
+
}
|
|
133
|
+
uncontrolledValueRef.value = value;
|
|
134
|
+
nTriggerFormInput();
|
|
135
|
+
nTriggerFormChange();
|
|
136
|
+
}
|
|
137
|
+
const handlePaste = (e, index) => {
|
|
138
|
+
e.preventDefault();
|
|
139
|
+
const { clipboardData } = e;
|
|
140
|
+
const text = clipboardData === null || clipboardData === void 0 ? void 0 : clipboardData.getData('text');
|
|
141
|
+
if (!text)
|
|
142
|
+
return;
|
|
143
|
+
const currentValue = justifyValue(mergedValueRef.value);
|
|
144
|
+
let startIndex = index;
|
|
145
|
+
const allowInput = props.allowInput;
|
|
146
|
+
let pasteApplied = false;
|
|
147
|
+
let appendedText = '';
|
|
148
|
+
for (let i = 0; i < text.length; ++i) {
|
|
149
|
+
if (allowInput && !allowInput(text[i], startIndex, currentValue)) {
|
|
150
|
+
continue;
|
|
151
|
+
}
|
|
152
|
+
pasteApplied = true;
|
|
153
|
+
currentValue[startIndex] = text[i];
|
|
154
|
+
appendedText += text[i];
|
|
155
|
+
startIndex++;
|
|
156
|
+
if (startIndex >= currentValue.length) {
|
|
157
|
+
break;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
if (pasteApplied) {
|
|
161
|
+
focusOnChar(startIndex);
|
|
162
|
+
doUpdateValue(currentValue, {
|
|
163
|
+
diff: appendedText,
|
|
164
|
+
index: startIndex,
|
|
165
|
+
source: 'paste'
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
const handleKeydown = (e, index) => {
|
|
170
|
+
const keyCode = e.code || e.key;
|
|
171
|
+
const currentValue = justifyValue(mergedValueRef.value);
|
|
172
|
+
if (keyCode === 'Backspace') {
|
|
173
|
+
e.preventDefault();
|
|
174
|
+
currentValue[Math.max(index, 0)] = '';
|
|
175
|
+
doUpdateValue(currentValue, { diff: '', index, source: 'delete' });
|
|
176
|
+
focusOnPrevChar(index);
|
|
177
|
+
}
|
|
178
|
+
else if (keyCode === 'ArrowLeft') {
|
|
179
|
+
e.preventDefault();
|
|
180
|
+
focusOnPrevChar(index);
|
|
181
|
+
}
|
|
182
|
+
else if (keyCode === 'ArrowRight') {
|
|
183
|
+
e.preventDefault();
|
|
184
|
+
focusOnNextChar(index);
|
|
185
|
+
}
|
|
186
|
+
};
|
|
187
|
+
const handleInput = (value, index) => {
|
|
188
|
+
const currentValue = justifyValue(mergedValueRef.value);
|
|
189
|
+
const currentValueAtIndex = currentValue[index];
|
|
190
|
+
const diff = value.replace(currentValueAtIndex, '');
|
|
191
|
+
const char = diff[diff.length - 1] || value[value.length - 1] || '';
|
|
192
|
+
const allowInput = props.allowInput;
|
|
193
|
+
if (allowInput && !allowInput(char, index, currentValue)) {
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
currentValue[index] = char;
|
|
197
|
+
doUpdateValue(currentValue, { diff: char, index, source: 'input' });
|
|
198
|
+
focusOnNextChar(index);
|
|
199
|
+
};
|
|
200
|
+
const getTemplateEvents = (index) => {
|
|
201
|
+
return {
|
|
202
|
+
onInput: (value) => handleInput(value, index),
|
|
203
|
+
onPaste: (event) => handlePaste(event, index),
|
|
204
|
+
onKeydown: (event) => handleKeydown(event, index),
|
|
205
|
+
onFocus: (event) => handleFocus(event, index),
|
|
206
|
+
onBlur: (event) => handleBlur(event, index)
|
|
207
|
+
};
|
|
208
|
+
};
|
|
209
|
+
return {
|
|
210
|
+
mergedTheme: themeRef,
|
|
211
|
+
perItemValueArray: (0, vue_1.computed)(() => justifyValue(mergedValueRef.value)),
|
|
212
|
+
mergedClsPrefix: mergedClsPrefixRef,
|
|
213
|
+
inputRefList,
|
|
214
|
+
inputType: inputTypeRef,
|
|
215
|
+
rtlEnabled: rtlEnabledRef,
|
|
216
|
+
mergedStatus: mergedStatusRef,
|
|
217
|
+
mergedDisabled: mergedDisabledRef,
|
|
218
|
+
cssVars: inlineThemeDisabled ? undefined : cssVarsRef,
|
|
219
|
+
themeClass: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass,
|
|
220
|
+
getTemplateEvents,
|
|
221
|
+
onRender: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.onRender
|
|
222
|
+
};
|
|
223
|
+
},
|
|
224
|
+
render() {
|
|
225
|
+
const { mergedTheme, mergedClsPrefix, perItemValueArray, size, placeholder, mergedDisabled, mergedStatus, readonly, inputType, $slots, getTemplateEvents, themeClass, onRender } = this;
|
|
226
|
+
onRender === null || onRender === void 0 ? void 0 : onRender();
|
|
227
|
+
return ((0, vue_1.h)("div", { style: this.cssVars, class: [
|
|
228
|
+
`${mergedClsPrefix}-input-otp`,
|
|
229
|
+
themeClass,
|
|
230
|
+
this.rtlEnabled && `${mergedClsPrefix}-input-otp--rtl`
|
|
231
|
+
] }, (0, seemly_1.repeat)(this.length, undefined).map((_, index) => (0, _utils_1.resolveSlotWithTypedProps)($slots.default, Object.assign({ index, value: perItemValueArray[index], type: inputType, size,
|
|
232
|
+
placeholder, disabled: mergedDisabled, readonly, status: mergedStatus, builtinThemeOverrides: {
|
|
233
|
+
paddingTiny: '0',
|
|
234
|
+
paddingSmall: '0',
|
|
235
|
+
paddingMedium: '0',
|
|
236
|
+
paddingLarge: '0'
|
|
237
|
+
}, theme: mergedTheme.peers.Input, themeOverrides: mergedTheme.peerOverrides.Input, ref: (el) => (this.inputRefList[index] = el) }, getTemplateEvents(index)), (_a) => {
|
|
238
|
+
var { index } = _a, restProps = __rest(_a, ["index"]);
|
|
239
|
+
return [(0, vue_1.h)(input_1.NInput, Object.assign({}, restProps, { key: index }))];
|
|
240
|
+
}))));
|
|
241
|
+
}
|
|
242
|
+
});
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { VNode } from 'vue';
|
|
2
|
+
import type { InputInst } from '../../components';
|
|
3
|
+
import type { InputProps } from '../../input/src/Input';
|
|
4
|
+
export type InputOtpAllowInput = (char: string, index: number, currentValue: string[]) => boolean;
|
|
5
|
+
export type InputOtpSize = 'small' | 'medium' | 'large';
|
|
6
|
+
export type InputOtpOnUpdateValue = (value: string[], meta: InputOtpOnUpdateValueMeta) => void;
|
|
7
|
+
export type InputOtpOnFocus = (e: FocusEvent, index: number) => void;
|
|
8
|
+
export type InputOtpOnBlur = (e: FocusEvent, index: number) => void;
|
|
9
|
+
export interface InputOtpSlots {
|
|
10
|
+
default?: InputOtpDefaultSlot;
|
|
11
|
+
}
|
|
12
|
+
export type InputOtpDefaultSlot = (props: InputProps & {
|
|
13
|
+
index: number;
|
|
14
|
+
ref: (inst: InputInst) => void;
|
|
15
|
+
}) => VNode[];
|
|
16
|
+
export type InputOtpOnFinish = (value: string[]) => void;
|
|
17
|
+
export interface InputOtpOnUpdateValueMeta {
|
|
18
|
+
diff: string;
|
|
19
|
+
index: number;
|
|
20
|
+
source: InputOtpOnUpdateValueMetaSource;
|
|
21
|
+
}
|
|
22
|
+
export type InputOtpOnUpdateValueMetaSource = 'paste' | 'input' | 'delete';
|
|
23
|
+
export interface InputOtpInst {
|
|
24
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
const cssr_1 = require("../../../_utils/cssr");
|
|
7
|
+
// --n-input-width
|
|
8
|
+
// --n-gap
|
|
9
|
+
exports.default = (0, cssr_1.c)([(0, cssr_1.cB)('input-otp', `
|
|
10
|
+
display: flex;
|
|
11
|
+
align-items: center;
|
|
12
|
+
gap: var(--n-gap);
|
|
13
|
+
`, [(0, cssr_1.cB)('input', `
|
|
14
|
+
width: var(--n-input-width);
|
|
15
|
+
text-align: center;
|
|
16
|
+
`)])]);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const common_1 = require("../../_styles/common");
|
|
4
|
+
const styles_1 = require("../../styles");
|
|
5
|
+
const light_1 = require("./light");
|
|
6
|
+
const inputOtpDark = {
|
|
7
|
+
name: 'InputOtp',
|
|
8
|
+
common: common_1.commonDark,
|
|
9
|
+
peers: {
|
|
10
|
+
Input: styles_1.inputDark
|
|
11
|
+
},
|
|
12
|
+
self: light_1.self
|
|
13
|
+
};
|
|
14
|
+
exports.default = inputOtpDark;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.inputOtpRtl = exports.inputOtpLight = exports.inputOtpDark = void 0;
|
|
7
|
+
var dark_1 = require("./dark");
|
|
8
|
+
Object.defineProperty(exports, "inputOtpDark", { enumerable: true, get: function () { return __importDefault(dark_1).default; } });
|
|
9
|
+
var light_1 = require("./light");
|
|
10
|
+
Object.defineProperty(exports, "inputOtpLight", { enumerable: true, get: function () { return __importDefault(light_1).default; } });
|
|
11
|
+
var rtl_1 = require("./rtl");
|
|
12
|
+
Object.defineProperty(exports, "inputOtpRtl", { enumerable: true, get: function () { return rtl_1.inputOtpRtl; } });
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
export declare function self(): {
|
|
2
|
+
inputWidthSmall: string;
|
|
3
|
+
inputWidthMedium: string;
|
|
4
|
+
inputWidthLarge: string;
|
|
5
|
+
gapSmall: string;
|
|
6
|
+
gapMedium: string;
|
|
7
|
+
gapLarge: string;
|
|
8
|
+
};
|
|
9
|
+
declare const inputOtpLight: import("../../_mixins").Theme<"InputOtp", {
|
|
10
|
+
inputWidthSmall: string;
|
|
11
|
+
inputWidthMedium: string;
|
|
12
|
+
inputWidthLarge: string;
|
|
13
|
+
gapSmall: string;
|
|
14
|
+
gapMedium: string;
|
|
15
|
+
gapLarge: string;
|
|
16
|
+
}, {
|
|
17
|
+
Input: import("../../_mixins").Theme<"Input", {
|
|
18
|
+
fontWeight: string;
|
|
19
|
+
countTextColorDisabled: string;
|
|
20
|
+
countTextColor: string;
|
|
21
|
+
heightTiny: string;
|
|
22
|
+
heightSmall: string;
|
|
23
|
+
heightMedium: string;
|
|
24
|
+
heightLarge: string;
|
|
25
|
+
fontSizeTiny: string;
|
|
26
|
+
fontSizeSmall: string;
|
|
27
|
+
fontSizeMedium: string;
|
|
28
|
+
fontSizeLarge: string;
|
|
29
|
+
lineHeight: string;
|
|
30
|
+
lineHeightTextarea: string;
|
|
31
|
+
borderRadius: string;
|
|
32
|
+
iconSize: string;
|
|
33
|
+
groupLabelColor: string;
|
|
34
|
+
groupLabelTextColor: string;
|
|
35
|
+
textColor: string;
|
|
36
|
+
textColorDisabled: string;
|
|
37
|
+
textDecorationColor: string;
|
|
38
|
+
caretColor: string;
|
|
39
|
+
placeholderColor: string;
|
|
40
|
+
placeholderColorDisabled: string;
|
|
41
|
+
color: string;
|
|
42
|
+
colorDisabled: string;
|
|
43
|
+
colorFocus: string;
|
|
44
|
+
groupLabelBorder: string;
|
|
45
|
+
border: string;
|
|
46
|
+
borderHover: string;
|
|
47
|
+
borderDisabled: string;
|
|
48
|
+
borderFocus: string;
|
|
49
|
+
boxShadowFocus: string;
|
|
50
|
+
loadingColor: string;
|
|
51
|
+
loadingColorWarning: string;
|
|
52
|
+
borderWarning: string;
|
|
53
|
+
borderHoverWarning: string;
|
|
54
|
+
colorFocusWarning: string;
|
|
55
|
+
borderFocusWarning: string;
|
|
56
|
+
boxShadowFocusWarning: string;
|
|
57
|
+
caretColorWarning: string;
|
|
58
|
+
loadingColorError: string;
|
|
59
|
+
borderError: string;
|
|
60
|
+
borderHoverError: string;
|
|
61
|
+
colorFocusError: string;
|
|
62
|
+
borderFocusError: string;
|
|
63
|
+
boxShadowFocusError: string;
|
|
64
|
+
caretColorError: string;
|
|
65
|
+
clearColor: string;
|
|
66
|
+
clearColorHover: string;
|
|
67
|
+
clearColorPressed: string;
|
|
68
|
+
iconColor: string;
|
|
69
|
+
iconColorDisabled: string;
|
|
70
|
+
iconColorHover: string;
|
|
71
|
+
iconColorPressed: string;
|
|
72
|
+
suffixTextColor: string;
|
|
73
|
+
paddingTiny: string;
|
|
74
|
+
paddingSmall: string;
|
|
75
|
+
paddingMedium: string;
|
|
76
|
+
paddingLarge: string;
|
|
77
|
+
clearSize: string;
|
|
78
|
+
}, any>;
|
|
79
|
+
}>;
|
|
80
|
+
export default inputOtpLight;
|
|
81
|
+
export type InputOtpTheme = typeof inputOtpLight;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.self = self;
|
|
4
|
+
const _mixins_1 = require("../../_mixins");
|
|
5
|
+
const common_1 = require("../../_styles/common");
|
|
6
|
+
const styles_1 = require("../../input/styles");
|
|
7
|
+
function self() {
|
|
8
|
+
return {
|
|
9
|
+
inputWidthSmall: '24px',
|
|
10
|
+
inputWidthMedium: '30px',
|
|
11
|
+
inputWidthLarge: '36px',
|
|
12
|
+
gapSmall: '8px',
|
|
13
|
+
gapMedium: '8px',
|
|
14
|
+
gapLarge: '8px'
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
const inputOtpLight = (0, _mixins_1.createTheme)({
|
|
18
|
+
name: 'InputOtp',
|
|
19
|
+
common: common_1.commonLight,
|
|
20
|
+
peers: {
|
|
21
|
+
Input: styles_1.inputLight
|
|
22
|
+
},
|
|
23
|
+
self
|
|
24
|
+
});
|
|
25
|
+
exports.default = inputOtpLight;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.inputOtpRtl = void 0;
|
|
7
|
+
const input_otp_rtl_cssr_1 = __importDefault(require("../src/styles/input-otp-rtl.cssr"));
|
|
8
|
+
exports.inputOtpRtl = {
|
|
9
|
+
name: 'InputOtp',
|
|
10
|
+
style: input_otp_rtl_cssr_1.default
|
|
11
|
+
};
|
package/lib/list/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { listProps, default as NList } from './src/List';
|
|
2
|
-
export type { ListProps } from './src/List';
|
|
2
|
+
export type { ListProps, ListSlots } from './src/List';
|
|
3
3
|
export { default as NListItem } from './src/ListItem';
|
|
4
|
+
export type { ListItemSlots } from './src/ListItem';
|
package/lib/list/src/List.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { PropType, Ref } from 'vue';
|
|
1
|
+
import type { PropType, Ref, SlotsType, VNode } from 'vue';
|
|
2
2
|
import { type ExtractPublicPropTypes } from '../../_utils';
|
|
3
3
|
export declare const listProps: {
|
|
4
4
|
size: {
|
|
@@ -56,6 +56,11 @@ export declare const listProps: {
|
|
|
56
56
|
}, any>>>;
|
|
57
57
|
};
|
|
58
58
|
export type ListProps = ExtractPublicPropTypes<typeof listProps>;
|
|
59
|
+
export interface ListSlots {
|
|
60
|
+
default?: () => VNode[];
|
|
61
|
+
footer?: () => VNode[];
|
|
62
|
+
header?: () => VNode[];
|
|
63
|
+
}
|
|
59
64
|
interface ListInjection {
|
|
60
65
|
showDividerRef: Ref<boolean>;
|
|
61
66
|
mergedClsPrefixRef: Ref<string>;
|
|
@@ -195,5 +200,5 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
195
200
|
clickable: boolean;
|
|
196
201
|
hoverable: boolean;
|
|
197
202
|
showDivider: boolean;
|
|
198
|
-
},
|
|
203
|
+
}, SlotsType<ListSlots>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
199
204
|
export default _default;
|
package/lib/list/src/List.js
CHANGED
|
@@ -20,6 +20,7 @@ exports.listInjectionKey = (0, _utils_1.createInjectionKey)('n-list');
|
|
|
20
20
|
exports.default = (0, vue_1.defineComponent)({
|
|
21
21
|
name: 'List',
|
|
22
22
|
props: exports.listProps,
|
|
23
|
+
slots: Object,
|
|
23
24
|
setup(props) {
|
|
24
25
|
const { mergedClsPrefixRef, inlineThemeDisabled, mergedRtlRef } = (0, _mixins_1.useConfig)(props);
|
|
25
26
|
const rtlEnabledRef = (0, _mixins_1.useRtl)('List', mergedRtlRef, mergedClsPrefixRef);
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
+
import type { SlotsType, VNode } from 'vue';
|
|
2
|
+
export interface ListItemSlots {
|
|
3
|
+
default?: () => VNode[];
|
|
4
|
+
prefix?: () => VNode[];
|
|
5
|
+
suffix?: () => VNode[];
|
|
6
|
+
}
|
|
1
7
|
declare const _default: import("vue").DefineComponent<{}, {
|
|
2
8
|
showDivider: import("vue").Ref<boolean, boolean>;
|
|
3
9
|
mergedClsPrefix: import("vue").Ref<string, string>;
|
|
4
|
-
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {},
|
|
10
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, SlotsType<ListItemSlots>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
5
11
|
export default _default;
|
package/lib/list/src/ListItem.js
CHANGED
|
@@ -5,6 +5,7 @@ const _utils_1 = require("../../_utils");
|
|
|
5
5
|
const List_1 = require("./List");
|
|
6
6
|
exports.default = (0, vue_1.defineComponent)({
|
|
7
7
|
name: 'ListItem',
|
|
8
|
+
slots: Object,
|
|
8
9
|
setup() {
|
|
9
10
|
const listInjection = (0, vue_1.inject)(List_1.listInjectionKey, null);
|
|
10
11
|
if (!listInjection) {
|