@rockshin/tao-ui 0.0.59 → 0.1.0
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/README.md +5 -1
- package/component-manifest.json +1 -1
- package/dist/components/affix/affix.css +1 -1
- package/dist/components/affix/affix.d.ts +1 -0
- package/dist/components/affix/affix.js +18 -17
- package/dist/components/alert/alert.css +123 -119
- package/dist/components/alert/alert.js +78 -188
- package/dist/components/app/app-modals.js +49 -98
- package/dist/components/app/app-notices.d.ts +2 -2
- package/dist/components/app/app-notices.js +294 -243
- package/dist/components/app/app-types.d.ts +6 -3
- package/dist/components/app/app.css +185 -183
- package/dist/components/app/app.js +1 -1
- package/dist/components/auto-complete/auto-complete.css +30 -28
- package/dist/components/auto-complete/auto-complete.d.ts +3 -1
- package/dist/components/auto-complete/auto-complete.js +2 -1
- package/dist/components/badge/badge.js +42 -127
- package/dist/components/border-beam/border-beam.css +1 -1
- package/dist/components/border-beam/border-beam.d.ts +1 -0
- package/dist/components/border-beam/border-beam.js +1 -0
- package/dist/components/breadcrumb/breadcrumb.css +123 -120
- package/dist/components/breadcrumb/breadcrumb.js +160 -265
- package/dist/components/button/button.d.ts +1 -1
- package/dist/components/button/button.js +52 -151
- package/dist/components/calendar/calendar.js +28 -27
- package/dist/components/card/card-tabs.d.ts +56 -5
- package/dist/components/card/card-tabs.js +214 -468
- package/dist/components/card/card.d.ts +1 -2
- package/dist/components/card/card.js +64 -226
- package/dist/components/carousel/carousel.css +1 -1
- package/dist/components/carousel/carousel.d.ts +59 -4
- package/dist/components/carousel/carousel.js +299 -243
- package/dist/components/cascader/cascader.css +186 -184
- package/dist/components/cascader/cascader.d.ts +3 -1
- package/dist/components/cascader/cascader.js +29 -34
- package/dist/components/checkbox/checkbox.css +93 -90
- package/dist/components/checkbox/checkbox.d.ts +1 -1
- package/dist/components/checkbox/checkbox.js +171 -499
- package/dist/components/collapse/collapse-panels.js +145 -400
- package/dist/components/collapse/collapse.css +172 -170
- package/dist/components/collapse/collapse.d.ts +1 -1
- package/dist/components/collapse/collapse.js +62 -181
- package/dist/components/color-picker/color-picker.css +1 -1
- package/dist/components/color-picker/color-picker.js +418 -981
- package/dist/components/context-menu/context-menu.css +4 -4
- package/dist/components/context-menu/context-menu.d.ts +3 -1
- package/dist/components/context-menu/context-menu.js +54 -135
- package/dist/components/date-picker/calendar/calendar-grid.js +41 -41
- package/dist/components/date-picker/calendar/calendar-header.js +171 -337
- package/dist/components/date-picker/calendar/month-grid.js +33 -103
- package/dist/components/date-picker/calendar/time-panel.js +84 -209
- package/dist/components/date-picker/calendar/year-grid.js +36 -105
- package/dist/components/date-picker/date-localization.js +1 -1
- package/dist/components/date-picker/date-picker.css +599 -642
- package/dist/components/date-picker/date-picker.d.ts +2 -1
- package/dist/components/date-picker/date-picker.js +96 -105
- package/dist/components/date-picker/presets.js +12 -37
- package/dist/components/date-picker/range-picker.d.ts +2 -1
- package/dist/components/date-picker/range-picker.js +222 -255
- package/dist/components/date-picker/types.d.ts +2 -1
- package/dist/components/descriptions/descriptions.css +1 -1
- package/dist/components/descriptions/descriptions.js +30 -39
- package/dist/components/drawer/drawer.css +202 -200
- package/dist/components/drawer/drawer.js +28 -34
- package/dist/components/dropdown/dropdown-core.d.ts +32 -0
- package/dist/components/dropdown/dropdown-core.js +156 -0
- package/dist/components/dropdown/dropdown.css +38 -36
- package/dist/components/dropdown/dropdown.d.ts +4 -30
- package/dist/components/dropdown/dropdown.js +91 -271
- package/dist/components/empty/empty.css +30 -28
- package/dist/components/empty/empty.js +81 -236
- package/dist/components/float-button/float-button.css +1 -1
- package/dist/components/float-button/float-button.js +38 -48
- package/dist/components/form/field-control.js +2 -3
- package/dist/components/form/form-item.js +67 -129
- package/dist/components/form/form.css +36 -34
- package/dist/components/form/form.d.ts +1 -1
- package/dist/components/form/form.js +29 -100
- package/dist/components/form/index.d.ts +1 -1
- package/dist/components/form/use-form.js +48 -66
- package/dist/components/form-actions/form-actions.d.ts +1 -0
- package/dist/components/form-actions/form-actions.js +10 -36
- package/dist/components/form-field/form-field-view.d.ts +1 -0
- package/dist/components/form-field/form-field-view.js +81 -288
- package/dist/components/form-field/form-field.js +13 -31
- package/dist/components/form-field/form.css +74 -72
- package/dist/components/form-section/form-section.d.ts +1 -0
- package/dist/components/form-section/form-section.js +38 -91
- package/dist/components/image/image-icons.js +16 -31
- package/dist/components/image/image.css +1 -1
- package/dist/components/image/image.js +298 -911
- package/dist/components/input/base-input.d.ts +3 -1
- package/dist/components/input/base-input.js +8 -7
- package/dist/components/input/input-shared.css +62 -60
- package/dist/components/input/input-shared.d.ts +1 -1
- package/dist/components/input/input-shared.js +56 -100
- package/dist/components/input/input.css +222 -220
- package/dist/components/input/otp.d.ts +2 -1
- package/dist/components/input/otp.js +143 -324
- package/dist/components/input/password.js +12 -67
- package/dist/components/input/search.js +13 -13
- package/dist/components/input-number/input-number.d.ts +4 -2
- package/dist/components/input-number/input-number.js +30 -137
- package/dist/components/list/list-pagination.css +107 -105
- package/dist/components/list/list-pagination.d.ts +56 -5
- package/dist/components/list/list-pagination.js +249 -316
- package/dist/components/list/list.css +179 -177
- package/dist/components/list/list.js +170 -604
- package/dist/components/listy/listy.css +55 -53
- package/dist/components/listy/listy.d.ts +43 -4
- package/dist/components/listy/listy.js +198 -216
- package/dist/components/masonry/masonry.css +1 -1
- package/dist/components/masonry/masonry.d.ts +1 -0
- package/dist/components/masonry/masonry.js +90 -244
- package/dist/components/mentions/mentions.css +153 -151
- package/dist/components/mentions/mentions.d.ts +53 -11
- package/dist/components/mentions/mentions.js +291 -75
- package/dist/components/menu/menu-render.d.ts +7 -0
- package/dist/components/menu/menu-render.js +156 -302
- package/dist/components/menu/menu.css +142 -140
- package/dist/components/modal/confirm-dialog.js +19 -24
- package/dist/components/modal/modal.css +165 -162
- package/dist/components/modal/modal.js +285 -731
- package/dist/components/modal/use-modal.js +25 -25
- package/dist/components/pagination/pagination.css +134 -131
- package/dist/components/pagination/pagination.d.ts +4 -3
- package/dist/components/pagination/pagination.js +138 -281
- package/dist/components/popconfirm/popconfirm.css +38 -36
- package/dist/components/popconfirm/popconfirm.js +105 -288
- package/dist/components/popover/popover.css +89 -87
- package/dist/components/popover/popover.js +189 -469
- package/dist/components/progress/progress.css +153 -151
- package/dist/components/progress/progress.js +34 -43
- package/dist/components/qr-code/qr-code.css +36 -34
- package/dist/components/qr-code/qr-code.js +83 -277
- package/dist/components/radio/radio.css +95 -92
- package/dist/components/radio/radio.d.ts +1 -1
- package/dist/components/radio/radio.js +114 -376
- package/dist/components/rate/rate.css +80 -78
- package/dist/components/rate/rate.d.ts +34 -6
- package/dist/components/rate/rate.js +160 -244
- package/dist/components/result/result.css +59 -57
- package/dist/components/result/result.d.ts +1 -0
- package/dist/components/result/result.js +118 -291
- package/dist/components/scroll-area/scroll-area.css +160 -148
- package/dist/components/scroll-area/scroll-area.js +284 -488
- package/dist/components/segmented/segmented.css +1 -1
- package/dist/components/segmented/segmented.js +59 -58
- package/dist/components/select/mobile-select.css +166 -164
- package/dist/components/select/mobile-select.js +48 -131
- package/dist/components/select/select-icons.js +59 -128
- package/dist/components/select/select-model.js +1 -1
- package/dist/components/select/select-searchable-list.js +19 -19
- package/dist/components/select/select-tags.js +70 -156
- package/dist/components/select/select-types.d.ts +2 -1
- package/dist/components/select/select.css +509 -506
- package/dist/components/select/select.d.ts +1 -0
- package/dist/components/select/select.js +67 -65
- package/dist/components/select/use-select-selection.js +181 -261
- package/dist/components/skeleton/skeleton.css +105 -103
- package/dist/components/skeleton/skeleton.js +140 -399
- package/dist/components/slider/slider.css +160 -158
- package/dist/components/slider/slider.d.ts +45 -6
- package/dist/components/slider/slider.js +359 -74
- package/dist/components/sonner/index.d.ts +1 -1
- package/dist/components/sonner/sonner.css +190 -182
- package/dist/components/sonner/sonner.js +12 -11
- package/dist/components/spinner/spinner.css +80 -76
- package/dist/components/spinner/spinner.d.ts +1 -1
- package/dist/components/spinner/spinner.js +75 -219
- package/dist/components/splitter/splitter.css +157 -154
- package/dist/components/splitter/splitter.js +271 -448
- package/dist/components/statistic/statistic.css +1 -1
- package/dist/components/statistic/statistic.js +121 -406
- package/dist/components/status-icon/status-icon.js +14 -26
- package/dist/components/steps/steps-icons.js +63 -100
- package/dist/components/steps/steps.css +817 -807
- package/dist/components/steps/steps.d.ts +1 -1
- package/dist/components/steps/steps.js +38 -94
- package/dist/components/steps/use-display-steps.js +21 -54
- package/dist/components/switch/switch-touch.css +17 -15
- package/dist/components/switch/switch.css +192 -190
- package/dist/components/switch/switch.js +63 -196
- package/dist/components/table/table-filter.d.ts +3 -1
- package/dist/components/table/table-filter.js +72 -133
- package/dist/components/table/table-icons.js +77 -152
- package/dist/components/table/table-summary.js +30 -77
- package/dist/components/table/table-types.d.ts +2 -1
- package/dist/components/table/table.css +468 -465
- package/dist/components/table/table.js +86 -84
- package/dist/components/table/use-table-data.js +137 -248
- package/dist/components/tabs/tabs.css +123 -120
- package/dist/components/tabs/tabs.d.ts +4 -3
- package/dist/components/tabs/tabs.js +157 -322
- package/dist/components/tag/tag.css +231 -221
- package/dist/components/tag/tag.js +110 -248
- package/dist/components/textarea/textarea.css +2 -1
- package/dist/components/textarea/textarea.d.ts +3 -1
- package/dist/components/textarea/textarea.js +16 -15
- package/dist/components/time-picker/time-picker.d.ts +1 -0
- package/dist/components/time-picker/time-picker.js +91 -221
- package/dist/components/timeline/timeline.css +1 -1
- package/dist/components/timeline/timeline.js +17 -17
- package/dist/components/tooltip/tooltip.css +79 -77
- package/dist/components/tooltip/tooltip.d.ts +1 -1
- package/dist/components/tooltip/tooltip.js +111 -263
- package/dist/components/tour/tour.css +1 -1
- package/dist/components/tour/tour.d.ts +59 -6
- package/dist/components/tour/tour.js +343 -622
- package/dist/components/transfer/transfer-list.js +19 -19
- package/dist/components/transfer/transfer-parts.js +63 -139
- package/dist/components/transfer/transfer.css +192 -190
- package/dist/components/transfer/transfer.js +57 -56
- package/dist/components/tree/tree-check.js +25 -32
- package/dist/components/tree/tree-keyboard.js +1 -1
- package/dist/components/tree/tree.css +204 -200
- package/dist/components/tree/tree.js +139 -277
- package/dist/components/tree-select/select-engine.css +200 -197
- package/dist/components/tree-select/select-engine.js +11 -38
- package/dist/components/tree-select/tree-select.css +21 -19
- package/dist/components/tree-select/tree-select.d.ts +3 -1
- package/dist/components/tree-select/tree-select.js +12 -10
- package/dist/components/upload/upload.js +193 -308
- package/dist/components/watermark/watermark-context.js +8 -14
- package/dist/components/watermark/watermark.css +1 -1
- package/dist/components/watermark/watermark.js +209 -400
- package/dist/docs/components/stack.doc.js +1 -1
- package/dist/docs/components/table.doc.js +1 -1
- package/dist/entries/affix.d.ts +0 -2
- package/dist/entries/affix.js +0 -2
- package/dist/entries/alert.d.ts +0 -2
- package/dist/entries/alert.js +0 -2
- package/dist/entries/app.d.ts +0 -2
- package/dist/entries/app.js +0 -2
- package/dist/entries/auto-complete.d.ts +0 -2
- package/dist/entries/auto-complete.js +0 -2
- package/dist/entries/avatar.d.ts +0 -2
- package/dist/entries/avatar.js +0 -2
- package/dist/entries/badge.d.ts +0 -2
- package/dist/entries/badge.js +0 -2
- package/dist/entries/border-beam.d.ts +0 -2
- package/dist/entries/border-beam.js +0 -2
- package/dist/entries/breadcrumb.d.ts +0 -2
- package/dist/entries/breadcrumb.js +0 -2
- package/dist/entries/button.d.ts +0 -2
- package/dist/entries/button.js +0 -2
- package/dist/entries/calendar.d.ts +0 -2
- package/dist/entries/calendar.js +0 -2
- package/dist/entries/card.d.ts +0 -2
- package/dist/entries/card.js +0 -2
- package/dist/entries/carousel.d.ts +0 -2
- package/dist/entries/carousel.js +0 -2
- package/dist/entries/cascader.d.ts +0 -2
- package/dist/entries/cascader.js +0 -2
- package/dist/entries/checkbox.d.ts +0 -2
- package/dist/entries/checkbox.js +0 -2
- package/dist/entries/collapse.d.ts +0 -2
- package/dist/entries/collapse.js +0 -2
- package/dist/entries/color-picker.d.ts +0 -2
- package/dist/entries/color-picker.js +0 -2
- package/dist/entries/context-menu.d.ts +0 -2
- package/dist/entries/context-menu.js +0 -2
- package/dist/entries/date-picker.d.ts +0 -2
- package/dist/entries/date-picker.js +0 -2
- package/dist/entries/descriptions.d.ts +0 -2
- package/dist/entries/descriptions.js +0 -2
- package/dist/entries/divider.d.ts +0 -2
- package/dist/entries/divider.js +0 -2
- package/dist/entries/drawer.d.ts +0 -2
- package/dist/entries/drawer.js +0 -2
- package/dist/entries/dropdown.d.ts +0 -2
- package/dist/entries/dropdown.js +0 -2
- package/dist/entries/empty.d.ts +0 -2
- package/dist/entries/empty.js +0 -2
- package/dist/entries/float-button.d.ts +0 -2
- package/dist/entries/float-button.js +0 -2
- package/dist/entries/form-actions.d.ts +0 -2
- package/dist/entries/form-actions.js +0 -2
- package/dist/entries/form-field.d.ts +0 -2
- package/dist/entries/form-field.js +0 -2
- package/dist/entries/form-layout.d.ts +0 -2
- package/dist/entries/form-layout.js +0 -2
- package/dist/entries/form-section.d.ts +0 -2
- package/dist/entries/form-section.js +0 -2
- package/dist/entries/form.d.ts +1 -3
- package/dist/entries/form.js +0 -2
- package/dist/entries/image.d.ts +0 -2
- package/dist/entries/image.js +0 -2
- package/dist/entries/input-number.d.ts +0 -2
- package/dist/entries/input-number.js +0 -2
- package/dist/entries/input.d.ts +1 -3
- package/dist/entries/input.js +0 -2
- package/dist/entries/list.d.ts +0 -2
- package/dist/entries/list.js +0 -2
- package/dist/entries/listy.d.ts +0 -2
- package/dist/entries/listy.js +0 -2
- package/dist/entries/masonry.d.ts +0 -2
- package/dist/entries/masonry.js +0 -2
- package/dist/entries/mentions.d.ts +0 -2
- package/dist/entries/mentions.js +0 -2
- package/dist/entries/modal.d.ts +0 -2
- package/dist/entries/modal.js +0 -2
- package/dist/entries/number-input.d.ts +0 -2
- package/dist/entries/number-input.js +0 -2
- package/dist/entries/pagination.d.ts +0 -2
- package/dist/entries/pagination.js +0 -2
- package/dist/entries/popconfirm.d.ts +0 -2
- package/dist/entries/popconfirm.js +0 -2
- package/dist/entries/popover.d.ts +0 -2
- package/dist/entries/popover.js +0 -2
- package/dist/entries/progress.d.ts +0 -2
- package/dist/entries/progress.js +0 -2
- package/dist/entries/provider.d.ts +1 -3
- package/dist/entries/provider.js +1 -3
- package/dist/entries/qr-code.d.ts +0 -2
- package/dist/entries/qr-code.js +0 -2
- package/dist/entries/radio.d.ts +0 -2
- package/dist/entries/radio.js +0 -2
- package/dist/entries/range-picker.d.ts +0 -2
- package/dist/entries/range-picker.js +0 -2
- package/dist/entries/rate.d.ts +0 -2
- package/dist/entries/rate.js +0 -2
- package/dist/entries/result.d.ts +0 -2
- package/dist/entries/result.js +0 -2
- package/dist/entries/scroll-area.d.ts +0 -2
- package/dist/entries/scroll-area.js +0 -2
- package/dist/entries/segmented.d.ts +0 -2
- package/dist/entries/segmented.js +0 -2
- package/dist/entries/select.d.ts +0 -2
- package/dist/entries/select.js +0 -2
- package/dist/entries/skeleton.d.ts +0 -2
- package/dist/entries/skeleton.js +0 -2
- package/dist/entries/slider.d.ts +0 -2
- package/dist/entries/slider.js +0 -2
- package/dist/entries/sonner.d.ts +0 -2
- package/dist/entries/sonner.js +0 -2
- package/dist/entries/spinner.d.ts +0 -2
- package/dist/entries/spinner.js +0 -2
- package/dist/entries/splitter.d.ts +0 -2
- package/dist/entries/splitter.js +0 -2
- package/dist/entries/stack.d.ts +0 -2
- package/dist/entries/stack.js +0 -2
- package/dist/entries/statistic.d.ts +0 -2
- package/dist/entries/statistic.js +0 -2
- package/dist/entries/steps.d.ts +0 -2
- package/dist/entries/steps.js +0 -2
- package/dist/entries/switch.d.ts +0 -2
- package/dist/entries/switch.js +0 -2
- package/dist/entries/table.d.ts +0 -2
- package/dist/entries/table.js +0 -2
- package/dist/entries/tabs.d.ts +0 -2
- package/dist/entries/tabs.js +0 -2
- package/dist/entries/tag.d.ts +0 -2
- package/dist/entries/tag.js +0 -2
- package/dist/entries/textarea.d.ts +0 -2
- package/dist/entries/textarea.js +0 -2
- package/dist/entries/time-picker.d.ts +0 -2
- package/dist/entries/time-picker.js +0 -2
- package/dist/entries/timeline.d.ts +0 -2
- package/dist/entries/timeline.js +0 -2
- package/dist/entries/tooltip.d.ts +0 -2
- package/dist/entries/tooltip.js +0 -2
- package/dist/entries/tour.d.ts +0 -2
- package/dist/entries/tour.js +0 -2
- package/dist/entries/transfer.d.ts +0 -2
- package/dist/entries/transfer.js +0 -2
- package/dist/entries/tree-select.d.ts +0 -2
- package/dist/entries/tree-select.js +0 -2
- package/dist/entries/tree.d.ts +0 -2
- package/dist/entries/tree.js +0 -2
- package/dist/entries/upload.d.ts +0 -2
- package/dist/entries/upload.js +0 -2
- package/dist/entries/watermark.d.ts +0 -2
- package/dist/entries/watermark.js +0 -2
- package/dist/index.d.ts +5 -7
- package/dist/index.js +2 -4
- package/dist/layouts/form-layout/form-layout.d.ts +1 -0
- package/dist/layouts/form-layout/form-layout.js +10 -36
- package/dist/layouts/stack/layout.css +46 -44
- package/dist/layouts/stack/stack.d.ts +1 -0
- package/dist/layouts/stack/stack.js +16 -69
- package/dist/locales/ar-EG.js +25 -2
- package/dist/locales/create-locale.d.ts +1 -2
- package/dist/locales/create-locale.js +0 -28
- package/dist/locales/de-DE.js +25 -2
- package/dist/locales/en-US.js +24 -1
- package/dist/locales/es-ES.js +25 -2
- package/dist/locales/fr-FR.js +25 -2
- package/dist/locales/hi-IN.js +25 -2
- package/dist/locales/id-ID.js +25 -2
- package/dist/locales/index.d.ts +10 -10
- package/dist/locales/index.js +9 -9
- package/dist/locales/it-IT.js +25 -2
- package/dist/locales/ja-JP.js +25 -2
- package/dist/locales/ko-KR.js +25 -2
- package/dist/locales/pt-BR.js +25 -2
- package/dist/locales/ru-RU.js +25 -2
- package/dist/locales/th-TH.js +25 -2
- package/dist/locales/tr-TR.js +25 -2
- package/dist/locales/vi-VN.js +25 -2
- package/dist/locales/zh-CN.js +25 -2
- package/dist/locales/zh-TW.js +25 -2
- package/dist/number-input/number-input.js +24 -81
- package/dist/number-input/use-number-input.d.ts +1 -0
- package/dist/number-input/use-number-input.js +47 -43
- package/dist/provider/locale.d.ts +1 -1
- package/dist/provider/tao-context.d.ts +38 -0
- package/dist/provider/tao-context.js +92 -0
- package/dist/provider/tao-portal-scope.d.ts +14 -0
- package/dist/provider/tao-portal-scope.js +54 -0
- package/dist/provider/tao-provider.d.ts +5 -55
- package/dist/provider/tao-provider.js +94 -364
- package/dist/theme/control.css +106 -122
- package/dist/theme/theme.css +4 -2
- package/dist/utils/dialog-content.js +55 -210
- package/dist/utils/overlay.js +15 -30
- package/dist/utils/rc-compat.d.ts +13 -0
- package/dist/utils/rc-compat.js +48 -0
- package/dist/utils/refs.js +5 -19
- package/package.json +10 -16
|
@@ -1,364 +1,183 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { c } from "react-compiler-runtime";
|
|
3
2
|
import { Fragment, forwardRef, useContext, useEffect, useImperativeHandle, useRef, useState } from "react";
|
|
4
|
-
import { useTaoConfig } from "../../provider/tao-
|
|
3
|
+
import { useTaoConfig } from "../../provider/tao-context.js";
|
|
5
4
|
import { cx } from "../../utils/semantic.js";
|
|
6
5
|
import { FormFieldChangeContext } from "../form/form-context.js";
|
|
7
6
|
import { BaseInput } from "./base-input.js";
|
|
8
7
|
const otp_OTP = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
let autoComplete;
|
|
12
|
-
let autoFocus;
|
|
13
|
-
let className;
|
|
14
|
-
let customClassNames;
|
|
15
|
-
let customStyles;
|
|
16
|
-
let disabled;
|
|
17
|
-
let formatter;
|
|
18
|
-
let inputMode;
|
|
19
|
-
let onChange;
|
|
20
|
-
let onInput;
|
|
21
|
-
let rest;
|
|
22
|
-
let separator;
|
|
23
|
-
let size;
|
|
24
|
-
let status;
|
|
25
|
-
let style;
|
|
26
|
-
let t0;
|
|
27
|
-
let t1;
|
|
28
|
-
let t2;
|
|
29
|
-
let t3;
|
|
30
|
-
let value;
|
|
31
|
-
let variant;
|
|
32
|
-
if ($[0] !== props) {
|
|
33
|
-
({ value, defaultValue: t0, length: t1, formatter, separator, mask: t2, type: t3, autoComplete, disabled, status, size, variant, onChange, onInput, classNames: customClassNames, styles: customStyles, className, style, autoFocus, inputMode, "aria-required": ariaRequired, ...rest } = props);
|
|
34
|
-
$[0] = props;
|
|
35
|
-
$[1] = ariaRequired;
|
|
36
|
-
$[2] = autoComplete;
|
|
37
|
-
$[3] = autoFocus;
|
|
38
|
-
$[4] = className;
|
|
39
|
-
$[5] = customClassNames;
|
|
40
|
-
$[6] = customStyles;
|
|
41
|
-
$[7] = disabled;
|
|
42
|
-
$[8] = formatter;
|
|
43
|
-
$[9] = inputMode;
|
|
44
|
-
$[10] = onChange;
|
|
45
|
-
$[11] = onInput;
|
|
46
|
-
$[12] = rest;
|
|
47
|
-
$[13] = separator;
|
|
48
|
-
$[14] = size;
|
|
49
|
-
$[15] = status;
|
|
50
|
-
$[16] = style;
|
|
51
|
-
$[17] = t0;
|
|
52
|
-
$[18] = t1;
|
|
53
|
-
$[19] = t2;
|
|
54
|
-
$[20] = t3;
|
|
55
|
-
$[21] = value;
|
|
56
|
-
$[22] = variant;
|
|
57
|
-
} else {
|
|
58
|
-
ariaRequired = $[1];
|
|
59
|
-
autoComplete = $[2];
|
|
60
|
-
autoFocus = $[3];
|
|
61
|
-
className = $[4];
|
|
62
|
-
customClassNames = $[5];
|
|
63
|
-
customStyles = $[6];
|
|
64
|
-
disabled = $[7];
|
|
65
|
-
formatter = $[8];
|
|
66
|
-
inputMode = $[9];
|
|
67
|
-
onChange = $[10];
|
|
68
|
-
onInput = $[11];
|
|
69
|
-
rest = $[12];
|
|
70
|
-
separator = $[13];
|
|
71
|
-
size = $[14];
|
|
72
|
-
status = $[15];
|
|
73
|
-
style = $[16];
|
|
74
|
-
t0 = $[17];
|
|
75
|
-
t1 = $[18];
|
|
76
|
-
t2 = $[19];
|
|
77
|
-
t3 = $[20];
|
|
78
|
-
value = $[21];
|
|
79
|
-
variant = $[22];
|
|
80
|
-
}
|
|
81
|
-
const defaultValue = void 0 === t0 ? "" : t0;
|
|
82
|
-
const length = void 0 === t1 ? 6 : t1;
|
|
83
|
-
const mask = void 0 === t2 ? false : t2;
|
|
84
|
-
const type = void 0 === t3 ? "text" : t3;
|
|
85
|
-
if (!Number.isInteger(length) || length < 1) throw new RangeError("Input.OTP length must be a positive integer");
|
|
8
|
+
const { value, defaultValue = '', length = 6, formatter, separator, mask = false, type = 'text', autoComplete, disabled, status, size, variant, onChange, onInput, classNames: customClassNames, styles: customStyles, className, style, autoFocus, inputMode, 'aria-required': ariaRequired, ...rest } = props;
|
|
9
|
+
if (!Number.isInteger(length) || length < 1) throw new RangeError('Input.OTP length must be a positive integer');
|
|
86
10
|
const ctx = useTaoConfig();
|
|
87
11
|
const fieldChange = useContext(FormFieldChangeContext);
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
}
|
|
95
|
-
const format = t4;
|
|
96
|
-
let t5;
|
|
97
|
-
if ($[26] !== format || $[27] !== props || $[28] !== value) {
|
|
98
|
-
t5 = "value" in props ? format(value ?? "").join("") : void 0;
|
|
99
|
-
$[26] = format;
|
|
100
|
-
$[27] = props;
|
|
101
|
-
$[28] = value;
|
|
102
|
-
$[29] = t5;
|
|
103
|
-
} else t5 = $[29];
|
|
104
|
-
const formattedValue = t5;
|
|
105
|
-
let t6;
|
|
106
|
-
if ($[30] !== defaultValue || $[31] !== format || $[32] !== props || $[33] !== value) {
|
|
107
|
-
t6 = ()=>format("value" in props ? value ?? "" : defaultValue);
|
|
108
|
-
$[30] = defaultValue;
|
|
109
|
-
$[31] = format;
|
|
110
|
-
$[32] = props;
|
|
111
|
-
$[33] = value;
|
|
112
|
-
$[34] = t6;
|
|
113
|
-
} else t6 = $[34];
|
|
114
|
-
const [innerValue, setInnerValue] = useState(t6);
|
|
115
|
-
let t7;
|
|
116
|
-
if ($[35] !== formattedValue || $[36] !== value) {
|
|
117
|
-
t7 = {
|
|
118
|
-
value,
|
|
119
|
-
formattedValue
|
|
120
|
-
};
|
|
121
|
-
$[35] = formattedValue;
|
|
122
|
-
$[36] = value;
|
|
123
|
-
$[37] = t7;
|
|
124
|
-
} else t7 = $[37];
|
|
125
|
-
const [previousValue, setPreviousValue] = useState(t7);
|
|
12
|
+
const format = (text)=>Array.from(formatter ? formatter(text) : text).slice(0, length);
|
|
13
|
+
const formattedValue = 'value' in props ? format(value ?? '').join('') : void 0;
|
|
14
|
+
const [innerValue, setInnerValue] = useState(()=>format('value' in props ? value ?? '' : defaultValue));
|
|
15
|
+
const [previousValue, setPreviousValue] = useState({
|
|
16
|
+
value,
|
|
17
|
+
formattedValue
|
|
18
|
+
});
|
|
126
19
|
const [draft, setDraft] = useState(null);
|
|
127
20
|
if (previousValue.value !== value || previousValue.formattedValue !== formattedValue) {
|
|
128
21
|
setPreviousValue({
|
|
129
22
|
value,
|
|
130
23
|
formattedValue
|
|
131
24
|
});
|
|
132
|
-
setInnerValue(Array.from(formattedValue ??
|
|
25
|
+
setInnerValue(Array.from(formattedValue ?? ''));
|
|
133
26
|
setDraft(null);
|
|
134
27
|
}
|
|
135
28
|
const cells = innerValue.slice(0, length);
|
|
136
|
-
|
|
137
|
-
if ($[38] === Symbol.for("react.memo_cache_sentinel")) {
|
|
138
|
-
t8 = [];
|
|
139
|
-
$[38] = t8;
|
|
140
|
-
} else t8 = $[38];
|
|
141
|
-
const inputs = useRef(t8);
|
|
29
|
+
const inputs = useRef([]);
|
|
142
30
|
const root = useRef(null);
|
|
143
31
|
const composing = useRef(null);
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
})
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
$[44] = t11;
|
|
172
|
-
} else t11 = $[44];
|
|
173
|
-
const classNames = t11;
|
|
174
|
-
let t12;
|
|
175
|
-
if ($[45] !== customStyles || $[46] !== props) {
|
|
176
|
-
t12 = "function" == typeof customStyles ? customStyles({
|
|
177
|
-
props
|
|
178
|
-
}) : customStyles;
|
|
179
|
-
$[45] = customStyles;
|
|
180
|
-
$[46] = props;
|
|
181
|
-
$[47] = t12;
|
|
182
|
-
} else t12 = $[47];
|
|
183
|
-
const styles = t12;
|
|
184
|
-
let t13;
|
|
185
|
-
if ($[48] === Symbol.for("react.memo_cache_sentinel")) {
|
|
186
|
-
t13 = (index)=>{
|
|
187
|
-
inputs.current[index]?.focus();
|
|
188
|
-
inputs.current[index]?.select();
|
|
189
|
-
};
|
|
190
|
-
$[48] = t13;
|
|
191
|
-
} else t13 = $[48];
|
|
192
|
-
const focus = t13;
|
|
193
|
-
let t14;
|
|
194
|
-
if ($[49] === Symbol.for("react.memo_cache_sentinel")) {
|
|
195
|
-
t14 = ()=>({
|
|
196
|
-
focus: ()=>focus(0),
|
|
197
|
-
blur: ()=>inputs.current.forEach(_temp),
|
|
198
|
-
nativeElement: root.current
|
|
199
|
-
});
|
|
200
|
-
$[49] = t14;
|
|
201
|
-
} else t14 = $[49];
|
|
202
|
-
useImperativeHandle(ref, t14);
|
|
203
|
-
const update = (index_0, text_0)=>{
|
|
204
|
-
const chars = format(text_0);
|
|
32
|
+
useEffect(()=>{
|
|
33
|
+
if (null !== composing.current && composing.current >= length) {
|
|
34
|
+
composing.current = null;
|
|
35
|
+
setDraft(null);
|
|
36
|
+
}
|
|
37
|
+
}, [
|
|
38
|
+
length
|
|
39
|
+
]);
|
|
40
|
+
const classNames = 'function' == typeof customClassNames ? customClassNames({
|
|
41
|
+
props
|
|
42
|
+
}) : customClassNames;
|
|
43
|
+
const styles = 'function' == typeof customStyles ? customStyles({
|
|
44
|
+
props
|
|
45
|
+
}) : customStyles;
|
|
46
|
+
const focus = (index)=>{
|
|
47
|
+
inputs.current[index]?.focus();
|
|
48
|
+
inputs.current[index]?.select();
|
|
49
|
+
};
|
|
50
|
+
useImperativeHandle(ref, ()=>({
|
|
51
|
+
focus: ()=>focus(0),
|
|
52
|
+
blur: ()=>inputs.current.forEach((input)=>{
|
|
53
|
+
input?.blur();
|
|
54
|
+
}),
|
|
55
|
+
nativeElement: root.current
|
|
56
|
+
}));
|
|
57
|
+
const update = (index, text)=>{
|
|
58
|
+
const chars = format(text);
|
|
205
59
|
const next = Array.from({
|
|
206
60
|
length
|
|
207
|
-
}, (_, i)=>cells[i] ??
|
|
61
|
+
}, (_, i)=>cells[i] ?? '');
|
|
208
62
|
if (chars.length) chars.forEach((char, offset)=>{
|
|
209
|
-
if (
|
|
63
|
+
if (index + offset < length) next[index + offset] = char;
|
|
210
64
|
});
|
|
211
|
-
else next[
|
|
65
|
+
else next[index] = '';
|
|
212
66
|
while(next.length && !next[next.length - 1])next.pop();
|
|
213
|
-
if (next.length !== cells.length || next.some((
|
|
67
|
+
if (next.length !== cells.length || next.some((char, i)=>char !== cells[i])) {
|
|
214
68
|
setInnerValue(next);
|
|
215
69
|
onInput?.([
|
|
216
70
|
...next
|
|
217
71
|
]);
|
|
218
|
-
if (next.length === length && next.every(Boolean)) onChange?.(next.join(
|
|
72
|
+
if (next.length === length && next.every(Boolean)) onChange?.(next.join(''));
|
|
219
73
|
else if (value && fieldChange && onChange === fieldChange.onChange) {
|
|
220
74
|
setPreviousValue({
|
|
221
|
-
value:
|
|
222
|
-
formattedValue: format(
|
|
75
|
+
value: '',
|
|
76
|
+
formattedValue: format('').join('')
|
|
223
77
|
});
|
|
224
|
-
fieldChange.collect(
|
|
78
|
+
fieldChange.collect('');
|
|
225
79
|
}
|
|
226
80
|
}
|
|
227
|
-
if (chars.length) focus(Math.min(
|
|
81
|
+
if (chars.length) focus(Math.min(index + chars.length, length - 1));
|
|
228
82
|
};
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
$[52] = t18;
|
|
238
|
-
} else t18 = $[52];
|
|
239
|
-
const t19 = styles?.root;
|
|
240
|
-
let t20;
|
|
241
|
-
if ($[53] !== style || $[54] !== t19) {
|
|
242
|
-
t20 = {
|
|
243
|
-
...t19,
|
|
83
|
+
return /*#__PURE__*/ jsx("div", {
|
|
84
|
+
...rest,
|
|
85
|
+
ref: root,
|
|
86
|
+
role: rest.role ?? 'group',
|
|
87
|
+
"data-tao-input-otp": "",
|
|
88
|
+
className: cx(classNames?.root, className),
|
|
89
|
+
style: {
|
|
90
|
+
...styles?.root,
|
|
244
91
|
...style
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
92
|
+
},
|
|
93
|
+
children: Array.from({
|
|
94
|
+
length
|
|
95
|
+
}, (_, index)=>/*#__PURE__*/ jsxs(Fragment, {
|
|
96
|
+
children: [
|
|
97
|
+
/*#__PURE__*/ jsxs("div", {
|
|
98
|
+
"data-tao-otp-cell": "",
|
|
99
|
+
"data-tao-otp-masked": 'string' == typeof mask && cells[index] ? '' : void 0,
|
|
100
|
+
children: [
|
|
101
|
+
/*#__PURE__*/ jsx(BaseInput, {
|
|
102
|
+
ref: (node)=>{
|
|
103
|
+
inputs.current[index] = node;
|
|
104
|
+
},
|
|
105
|
+
value: draft?.index === index ? draft.value : cells[index] ?? '',
|
|
106
|
+
autoFocus: autoFocus && 0 === index,
|
|
107
|
+
type: true === mask ? 'password' : type,
|
|
108
|
+
inputMode: inputMode,
|
|
109
|
+
autoComplete: autoComplete,
|
|
110
|
+
disabled: disabled,
|
|
111
|
+
status: status,
|
|
112
|
+
size: size,
|
|
113
|
+
variant: variant,
|
|
114
|
+
"aria-label": ctx.locale.otpLabel?.(index + 1, length) ?? `Character ${index + 1} of ${length}`,
|
|
115
|
+
"aria-describedby": rest['aria-describedby'],
|
|
116
|
+
"aria-invalid": rest['aria-invalid'],
|
|
117
|
+
"aria-required": ariaRequired,
|
|
118
|
+
classNames: {
|
|
119
|
+
input: classNames?.input
|
|
120
|
+
},
|
|
121
|
+
styles: {
|
|
122
|
+
input: styles?.input
|
|
123
|
+
},
|
|
124
|
+
onFocus: (event)=>event.currentTarget.select(),
|
|
125
|
+
onBlur: ()=>{
|
|
126
|
+
if (composing.current === index) {
|
|
127
|
+
composing.current = null;
|
|
128
|
+
setDraft(null);
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
onChange: (event)=>{
|
|
132
|
+
if (composing.current === index) setDraft({
|
|
133
|
+
index,
|
|
134
|
+
value: event.target.value
|
|
135
|
+
});
|
|
136
|
+
else update(index, event.target.value);
|
|
137
|
+
},
|
|
138
|
+
onCompositionStart: ()=>{
|
|
139
|
+
composing.current = index;
|
|
140
|
+
},
|
|
141
|
+
onCompositionEnd: (event)=>{
|
|
284
142
|
composing.current = null;
|
|
285
143
|
setDraft(null);
|
|
144
|
+
update(index, event.currentTarget.value);
|
|
145
|
+
},
|
|
146
|
+
onPaste: (event)=>{
|
|
147
|
+
event.preventDefault();
|
|
148
|
+
update(index, event.clipboardData.getData('text'));
|
|
149
|
+
},
|
|
150
|
+
onKeyDown: (event)=>{
|
|
151
|
+
if (composing.current === index || event.nativeEvent.isComposing || 229 === event.keyCode) return;
|
|
152
|
+
if ('ArrowLeft' === event.key || 'ArrowRight' === event.key) {
|
|
153
|
+
event.preventDefault();
|
|
154
|
+
const direction = 'rtl' === getComputedStyle(root.current).direction ? -1 : 1;
|
|
155
|
+
focus(Math.min(length - 1, Math.max(0, index + ('ArrowRight' === event.key ? direction : -direction))));
|
|
156
|
+
} else if ('Backspace' === event.key && !cells[index] && index > 0) {
|
|
157
|
+
event.preventDefault();
|
|
158
|
+
update(index - 1, '');
|
|
159
|
+
focus(index - 1);
|
|
160
|
+
} else if ('Delete' === event.key) {
|
|
161
|
+
event.preventDefault();
|
|
162
|
+
update(index, '');
|
|
163
|
+
}
|
|
286
164
|
}
|
|
287
|
-
},
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
event_2.preventDefault();
|
|
305
|
-
update(index_1, event_2.clipboardData.getData("text"));
|
|
306
|
-
},
|
|
307
|
-
onKeyDown: (event_3)=>{
|
|
308
|
-
if (composing.current === index_1 || event_3.nativeEvent.isComposing || 229 === event_3.keyCode) return;
|
|
309
|
-
if ("ArrowLeft" === event_3.key || "ArrowRight" === event_3.key) {
|
|
310
|
-
event_3.preventDefault();
|
|
311
|
-
const direction = "rtl" === getComputedStyle(root.current).direction ? -1 : 1;
|
|
312
|
-
focus(Math.min(length - 1, Math.max(0, index_1 + ("ArrowRight" === event_3.key ? direction : -direction))));
|
|
313
|
-
} else if ("Backspace" === event_3.key && !cells[index_1] && index_1 > 0) {
|
|
314
|
-
event_3.preventDefault();
|
|
315
|
-
update(index_1 - 1, "");
|
|
316
|
-
focus(index_1 - 1);
|
|
317
|
-
} else if ("Delete" === event_3.key) {
|
|
318
|
-
event_3.preventDefault();
|
|
319
|
-
update(index_1, "");
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
}),
|
|
323
|
-
"string" == typeof mask && cells[index_1] && /*#__PURE__*/ jsx("span", {
|
|
324
|
-
"data-tao-otp-mask": "",
|
|
325
|
-
"aria-hidden": "true",
|
|
326
|
-
children: mask
|
|
327
|
-
})
|
|
328
|
-
]
|
|
329
|
-
}),
|
|
330
|
-
index_1 < length - 1 && null != separator && /*#__PURE__*/ jsx("span", {
|
|
331
|
-
"data-tao-otp-separator": "",
|
|
332
|
-
className: classNames?.separator,
|
|
333
|
-
style: styles?.separator,
|
|
334
|
-
children: "function" == typeof separator ? separator(index_1) : separator
|
|
335
|
-
})
|
|
336
|
-
]
|
|
337
|
-
}, `otp-${index_1}`));
|
|
338
|
-
let t22;
|
|
339
|
-
if ($[56] !== rest || $[57] !== t15 || $[58] !== t18 || $[59] !== t20 || $[60] !== t21) {
|
|
340
|
-
t22 = /*#__PURE__*/ jsx("div", {
|
|
341
|
-
...rest,
|
|
342
|
-
ref: root,
|
|
343
|
-
role: t15,
|
|
344
|
-
"data-tao-input-otp": t16,
|
|
345
|
-
className: t18,
|
|
346
|
-
style: t20,
|
|
347
|
-
children: t21
|
|
348
|
-
});
|
|
349
|
-
$[56] = rest;
|
|
350
|
-
$[57] = t15;
|
|
351
|
-
$[58] = t18;
|
|
352
|
-
$[59] = t20;
|
|
353
|
-
$[60] = t21;
|
|
354
|
-
$[61] = t22;
|
|
355
|
-
} else t22 = $[61];
|
|
356
|
-
return t22;
|
|
165
|
+
}),
|
|
166
|
+
'string' == typeof mask && cells[index] && /*#__PURE__*/ jsx("span", {
|
|
167
|
+
"data-tao-otp-mask": "",
|
|
168
|
+
"aria-hidden": "true",
|
|
169
|
+
children: mask
|
|
170
|
+
})
|
|
171
|
+
]
|
|
172
|
+
}),
|
|
173
|
+
index < length - 1 && null != separator && /*#__PURE__*/ jsx("span", {
|
|
174
|
+
"data-tao-otp-separator": "",
|
|
175
|
+
className: classNames?.separator,
|
|
176
|
+
style: styles?.separator,
|
|
177
|
+
children: 'function' == typeof separator ? separator(index) : separator
|
|
178
|
+
})
|
|
179
|
+
]
|
|
180
|
+
}, `otp-${index}`))
|
|
181
|
+
});
|
|
357
182
|
});
|
|
358
|
-
function _temp(input) {
|
|
359
|
-
input?.blur();
|
|
360
|
-
}
|
|
361
|
-
function _temp2(event) {
|
|
362
|
-
return event.currentTarget.select();
|
|
363
|
-
}
|
|
364
183
|
export { otp_OTP as OTP };
|
|
@@ -1,57 +1,30 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { c } from "react-compiler-runtime";
|
|
3
2
|
import { forwardRef, useState } from "react";
|
|
4
3
|
import { useTaoConfig } from "../../provider/tao-provider.js";
|
|
5
4
|
import { BaseInput } from "./base-input.js";
|
|
6
|
-
const password_Password = /*#__PURE__*/ forwardRef(function(
|
|
7
|
-
const $ = c(22);
|
|
8
|
-
let disabled;
|
|
9
|
-
let iconRender;
|
|
10
|
-
let props;
|
|
11
|
-
let suffix;
|
|
12
|
-
let t1;
|
|
13
|
-
if ($[0] !== t0) {
|
|
14
|
-
({ visibilityToggle: t1, iconRender, suffix, disabled, ...props } = t0);
|
|
15
|
-
$[0] = t0;
|
|
16
|
-
$[1] = disabled;
|
|
17
|
-
$[2] = iconRender;
|
|
18
|
-
$[3] = props;
|
|
19
|
-
$[4] = suffix;
|
|
20
|
-
$[5] = t1;
|
|
21
|
-
} else {
|
|
22
|
-
disabled = $[1];
|
|
23
|
-
iconRender = $[2];
|
|
24
|
-
props = $[3];
|
|
25
|
-
suffix = $[4];
|
|
26
|
-
t1 = $[5];
|
|
27
|
-
}
|
|
28
|
-
const visibilityToggle = void 0 === t1 ? true : t1;
|
|
5
|
+
const password_Password = /*#__PURE__*/ forwardRef(function({ visibilityToggle = true, iconRender, suffix, disabled, ...props }, ref) {
|
|
29
6
|
const ctx = useTaoConfig();
|
|
30
7
|
const [innerVisible, setVisible] = useState(false);
|
|
31
8
|
if (false === visibilityToggle && innerVisible) setVisible(false);
|
|
32
|
-
|
|
33
|
-
if ($[6] !== visibilityToggle) {
|
|
34
|
-
t2 = "object" == typeof visibilityToggle ? visibilityToggle : {};
|
|
35
|
-
$[6] = visibilityToggle;
|
|
36
|
-
$[7] = t2;
|
|
37
|
-
} else t2 = $[7];
|
|
38
|
-
const config = t2;
|
|
9
|
+
const config = 'object' == typeof visibilityToggle ? visibilityToggle : {};
|
|
39
10
|
const visible = false !== visibilityToggle && (config.visible ?? innerVisible);
|
|
40
11
|
const resolvedDisabled = disabled ?? ctx.disabled;
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
12
|
+
return /*#__PURE__*/ jsx(BaseInput, {
|
|
13
|
+
...props,
|
|
14
|
+
disabled: resolvedDisabled,
|
|
15
|
+
ref: ref,
|
|
16
|
+
type: visible ? 'text' : 'password',
|
|
17
|
+
suffix: visibilityToggle ? /*#__PURE__*/ jsxs(Fragment, {
|
|
45
18
|
children: [
|
|
46
19
|
suffix,
|
|
47
20
|
/*#__PURE__*/ jsx("button", {
|
|
48
21
|
type: "button",
|
|
49
22
|
"data-tao-input-action": "",
|
|
50
|
-
"aria-label": visible ? ctx.locale.hidePassword ??
|
|
23
|
+
"aria-label": visible ? ctx.locale.hidePassword ?? 'Hide password' : ctx.locale.showPassword ?? 'Show password',
|
|
51
24
|
"aria-pressed": visible,
|
|
52
25
|
tabIndex: config.tabIndex,
|
|
53
26
|
disabled: resolvedDisabled,
|
|
54
|
-
onMouseDown:
|
|
27
|
+
onMouseDown: (event)=>event.preventDefault(),
|
|
55
28
|
onClick: ()=>{
|
|
56
29
|
if (void 0 === config.visible) setVisible(!visible);
|
|
57
30
|
config.onVisibleChange?.(!visible);
|
|
@@ -78,35 +51,7 @@ const password_Password = /*#__PURE__*/ forwardRef(function(t0, ref) {
|
|
|
78
51
|
})
|
|
79
52
|
})
|
|
80
53
|
]
|
|
81
|
-
}) : suffix
|
|
82
|
-
|
|
83
|
-
$[9] = ctx;
|
|
84
|
-
$[10] = iconRender;
|
|
85
|
-
$[11] = resolvedDisabled;
|
|
86
|
-
$[12] = suffix;
|
|
87
|
-
$[13] = visibilityToggle;
|
|
88
|
-
$[14] = visible;
|
|
89
|
-
$[15] = t4;
|
|
90
|
-
} else t4 = $[15];
|
|
91
|
-
let t5;
|
|
92
|
-
if ($[16] !== props || $[17] !== ref || $[18] !== resolvedDisabled || $[19] !== t3 || $[20] !== t4) {
|
|
93
|
-
t5 = /*#__PURE__*/ jsx(BaseInput, {
|
|
94
|
-
...props,
|
|
95
|
-
disabled: resolvedDisabled,
|
|
96
|
-
ref: ref,
|
|
97
|
-
type: t3,
|
|
98
|
-
suffix: t4
|
|
99
|
-
});
|
|
100
|
-
$[16] = props;
|
|
101
|
-
$[17] = ref;
|
|
102
|
-
$[18] = resolvedDisabled;
|
|
103
|
-
$[19] = t3;
|
|
104
|
-
$[20] = t4;
|
|
105
|
-
$[21] = t5;
|
|
106
|
-
} else t5 = $[21];
|
|
107
|
-
return t5;
|
|
54
|
+
}) : suffix
|
|
55
|
+
});
|
|
108
56
|
});
|
|
109
|
-
function _temp(event) {
|
|
110
|
-
return event.preventDefault();
|
|
111
|
-
}
|
|
112
57
|
export { password_Password as Password };
|
|
@@ -37,7 +37,7 @@ const search_Search = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
|
37
37
|
title: iconOnly ? void 0 : searchLabel,
|
|
38
38
|
className: classNames?.button,
|
|
39
39
|
style: styles?.button,
|
|
40
|
-
onMouseDown: (
|
|
40
|
+
onMouseDown: (event)=>event.preventDefault(),
|
|
41
41
|
onClick: search
|
|
42
42
|
};
|
|
43
43
|
const button = customButton ? /*#__PURE__*/ cloneElement(enterButton, {
|
|
@@ -53,13 +53,13 @@ const search_Search = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
|
53
53
|
loading: isLoading,
|
|
54
54
|
size: props.size ?? enterButton.props.size
|
|
55
55
|
} : {},
|
|
56
|
-
onMouseDown: (
|
|
57
|
-
enterButton.props.onMouseDown?.(
|
|
58
|
-
|
|
56
|
+
onMouseDown: (event)=>{
|
|
57
|
+
enterButton.props.onMouseDown?.(event);
|
|
58
|
+
event.preventDefault();
|
|
59
59
|
},
|
|
60
|
-
onClick: (
|
|
61
|
-
enterButton.props.onClick?.(
|
|
62
|
-
search(
|
|
60
|
+
onClick: (event)=>{
|
|
61
|
+
enterButton.props.onClick?.(event);
|
|
62
|
+
search(event);
|
|
63
63
|
}
|
|
64
64
|
}) : /*#__PURE__*/ jsx(Button, {
|
|
65
65
|
...buttonProps,
|
|
@@ -87,15 +87,15 @@ const search_Search = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
|
87
87
|
...styles,
|
|
88
88
|
root: void 0
|
|
89
89
|
},
|
|
90
|
-
onChange: (
|
|
91
|
-
onChange?.(
|
|
92
|
-
if ('click' ===
|
|
90
|
+
onChange: (event)=>{
|
|
91
|
+
onChange?.(event);
|
|
92
|
+
if ('click' === event.type && !event.defaultPrevented && !disabled && !isLoading) onSearch?.('', event, {
|
|
93
93
|
source: 'clear'
|
|
94
94
|
});
|
|
95
95
|
},
|
|
96
|
-
onPressEnter: (
|
|
97
|
-
onPressEnter?.(
|
|
98
|
-
search(
|
|
96
|
+
onPressEnter: (event)=>{
|
|
97
|
+
onPressEnter?.(event);
|
|
98
|
+
search(event);
|
|
99
99
|
}
|
|
100
100
|
}),
|
|
101
101
|
button,
|