@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,6 +1,8 @@
|
|
|
1
1
|
import { type InputHTMLAttributes, type ReactNode } from 'react';
|
|
2
|
-
import { type
|
|
2
|
+
import { type TaoStatus } from '../../provider/tao-context.js';
|
|
3
|
+
import type { TaoSize } from '../../provider/tao-provider.js';
|
|
3
4
|
import { type SemanticClassNames, type SemanticStyles } from '../../utils/semantic.js';
|
|
5
|
+
import '../../theme/control.css';
|
|
4
6
|
import './input.css';
|
|
5
7
|
import { type InputFocusOptions, type InputSemanticValue, type InputVariant, type TextControlProps } from './input-shared.js';
|
|
6
8
|
export type InputSemanticPart = 'root' | 'input' | 'prefix' | 'suffix' | 'clear' | 'count' | 'addonBefore' | 'addonAfter';
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { isReactRenderable } from "@rc-component/util";
|
|
3
2
|
import { forwardRef, useRef } from "react";
|
|
4
|
-
import { useTaoConfig } from "../../provider/tao-
|
|
3
|
+
import { useTaoConfig } from "../../provider/tao-context.js";
|
|
4
|
+
import { isReactRenderable } from "../../utils/rc-compat.js";
|
|
5
5
|
import { cx } from "../../utils/semantic.js";
|
|
6
|
+
import "../../theme/control.css";
|
|
6
7
|
import "./input.css";
|
|
7
8
|
import { InputClear, useTextControl, useTextControlRef } from "./input-shared.js";
|
|
8
9
|
const hasAffixContent = (node)=>true !== node && isReactRenderable(node);
|
|
@@ -63,13 +64,13 @@ const BaseInput = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
|
63
64
|
onKeyDown?.(event);
|
|
64
65
|
if ('Enter' === event.key && !event.defaultPrevented && !field.composing.current && !event.nativeEvent.isComposing && 229 !== event.keyCode) onPressEnter?.(event);
|
|
65
66
|
},
|
|
66
|
-
onCompositionStart: (
|
|
67
|
+
onCompositionStart: (event)=>{
|
|
67
68
|
field.composing.current = true;
|
|
68
|
-
onCompositionStart?.(
|
|
69
|
+
onCompositionStart?.(event);
|
|
69
70
|
},
|
|
70
|
-
onCompositionEnd: (
|
|
71
|
-
field.endComposition(
|
|
72
|
-
onCompositionEnd?.(
|
|
71
|
+
onCompositionEnd: (event)=>{
|
|
72
|
+
field.endComposition(event);
|
|
73
|
+
onCompositionEnd?.(event);
|
|
73
74
|
}
|
|
74
75
|
}),
|
|
75
76
|
allowClear && field.value && !resolvedDisabled && !rest.readOnly && /*#__PURE__*/ jsx(InputClear, {
|
|
@@ -1,75 +1,77 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
@layer components {
|
|
2
|
+
[data-tao-input-action] {
|
|
3
|
+
padding: var(--tao-padding-xxs);
|
|
4
|
+
color: var(--tao-color-text-tertiary);
|
|
5
|
+
cursor: pointer;
|
|
6
|
+
border-radius: var(--tao-radius-sm);
|
|
7
|
+
background: none;
|
|
8
|
+
border: 0;
|
|
9
|
+
flex-shrink: 0;
|
|
10
|
+
justify-content: center;
|
|
11
|
+
align-items: center;
|
|
12
|
+
display: inline-flex;
|
|
13
|
+
}
|
|
13
14
|
|
|
14
|
-
[data-tao-input-action]:hover {
|
|
15
|
-
|
|
16
|
-
}
|
|
15
|
+
[data-tao-input-action]:hover {
|
|
16
|
+
color: var(--tao-color-text);
|
|
17
|
+
}
|
|
17
18
|
|
|
18
|
-
[data-tao-input-action]:disabled {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
19
|
+
[data-tao-input-action]:disabled {
|
|
20
|
+
color: var(--tao-color-text-disabled);
|
|
21
|
+
cursor: not-allowed;
|
|
22
|
+
}
|
|
22
23
|
|
|
23
|
-
[data-tao-input-action]:focus-visible {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
24
|
+
[data-tao-input-action]:focus-visible {
|
|
25
|
+
outline: 2px solid var(--tao-primary);
|
|
26
|
+
outline-offset: -2px;
|
|
27
|
+
}
|
|
27
28
|
|
|
28
|
-
[data-tao-input-action] svg {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
29
|
+
[data-tao-input-action] svg {
|
|
30
|
+
width: 16px;
|
|
31
|
+
height: 16px;
|
|
32
|
+
}
|
|
32
33
|
|
|
33
|
-
[data-tao-input-count] {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
34
|
+
[data-tao-input-count] {
|
|
35
|
+
color: var(--tao-color-text-tertiary);
|
|
36
|
+
font-size: var(--tao-font-size-sm);
|
|
37
|
+
white-space: nowrap;
|
|
38
|
+
font-variant-numeric: tabular-nums;
|
|
39
|
+
}
|
|
39
40
|
|
|
40
|
-
[data-tao-input-count][data-tao-exceeded] {
|
|
41
|
-
|
|
42
|
-
}
|
|
41
|
+
[data-tao-input-count][data-tao-exceeded] {
|
|
42
|
+
color: var(--tao-error);
|
|
43
|
+
}
|
|
43
44
|
|
|
44
|
-
@media (hover: hover) and (pointer: fine) {
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
@media (hover: hover) and (pointer: fine) {
|
|
46
|
+
:is([data-tao-input], [data-tao-textarea]):not(:hover):not(:focus-within) [data-tao-input-clear] {
|
|
47
|
+
opacity: 0;
|
|
48
|
+
}
|
|
47
49
|
}
|
|
48
|
-
}
|
|
49
50
|
|
|
50
|
-
:is([data-tao-input], [data-tao-textarea])[data-tao-control][data-tao-variant="underlined"] {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
51
|
+
:is([data-tao-input], [data-tao-textarea])[data-tao-control][data-tao-variant="underlined"] {
|
|
52
|
+
border: var(--tao-line-width) solid transparent;
|
|
53
|
+
border-block-end-color: var(--tao-color-border);
|
|
54
|
+
background: none;
|
|
55
|
+
border-radius: 0;
|
|
56
|
+
}
|
|
56
57
|
|
|
57
|
-
:is([data-tao-input], [data-tao-textarea])[data-tao-variant="underlined"]:not([data-disabled]):is(:hover, :focus-within) {
|
|
58
|
-
|
|
59
|
-
}
|
|
58
|
+
:is([data-tao-input], [data-tao-textarea])[data-tao-variant="underlined"]:not([data-disabled]):is(:hover, :focus-within) {
|
|
59
|
+
border-block-end-color: var(--tao-input-underline-status, var(--tao-primary));
|
|
60
|
+
}
|
|
60
61
|
|
|
61
|
-
:is([data-tao-input], [data-tao-textarea])[data-tao-variant="underlined"][data-tao-warning] {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
62
|
+
:is([data-tao-input], [data-tao-textarea])[data-tao-variant="underlined"][data-tao-warning] {
|
|
63
|
+
--tao-input-underline-status: var(--tao-warning);
|
|
64
|
+
border-block-end-color: var(--tao-warning);
|
|
65
|
+
}
|
|
65
66
|
|
|
66
|
-
:is([data-tao-input], [data-tao-textarea])[data-tao-variant="underlined"][data-tao-error] {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}
|
|
67
|
+
:is([data-tao-input], [data-tao-textarea])[data-tao-variant="underlined"][data-tao-error] {
|
|
68
|
+
--tao-input-underline-status: var(--tao-error);
|
|
69
|
+
border-block-end-color: var(--tao-error);
|
|
70
|
+
}
|
|
70
71
|
|
|
71
|
-
:is([data-tao-input], [data-tao-textarea])[data-tao-variant="underlined"][data-disabled] {
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
:is([data-tao-input], [data-tao-textarea])[data-tao-variant="underlined"][data-disabled] {
|
|
73
|
+
color: var(--tao-color-text-disabled);
|
|
74
|
+
cursor: not-allowed;
|
|
75
|
+
}
|
|
74
76
|
}
|
|
75
77
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ChangeEvent, type CompositionEvent, type CSSProperties, type FocusEvent, type KeyboardEvent, type MouseEvent, type ReactNode, type Ref, type RefObject } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import type { TaoVariant } from '../../provider/tao-provider.js';
|
|
3
3
|
import './input-shared.css';
|
|
4
4
|
export type InputVariant = TaoVariant | 'underlined';
|
|
5
5
|
export interface InputFocusOptions extends FocusOptions {
|
|
@@ -1,48 +1,33 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { c } from "react-compiler-runtime";
|
|
3
2
|
import { useEffect, useImperativeHandle, useRef, useState } from "react";
|
|
4
|
-
import { useTaoConfig } from "../../provider/tao-
|
|
3
|
+
import { useTaoConfig } from "../../provider/tao-context.js";
|
|
5
4
|
import { mergeRefs } from "../../utils/refs.js";
|
|
6
5
|
import { CloseIcon } from "../select/select-icons.js";
|
|
7
6
|
import "./input-shared.css";
|
|
8
7
|
function useTextControlRef(ref, nodeRef, rootRef) {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
if (options?.cursor && ("textarea" === node.localName || [
|
|
29
|
-
"text",
|
|
30
|
-
"search",
|
|
31
|
-
"password",
|
|
32
|
-
"tel",
|
|
33
|
-
"url"
|
|
34
|
-
].includes(node.type))) {
|
|
35
|
-
const end = node.value.length;
|
|
36
|
-
node.setSelectionRange("end" === options.cursor ? end : 0, "start" === options.cursor ? 0 : end);
|
|
37
|
-
}
|
|
8
|
+
useImperativeHandle(mergeRefs(ref), ()=>{
|
|
9
|
+
const node = nodeRef.current;
|
|
10
|
+
const nativeFocus = Object.getPrototypeOf(node).focus;
|
|
11
|
+
if (!nativeFocus) return node;
|
|
12
|
+
return Object.assign(node, {
|
|
13
|
+
input: node,
|
|
14
|
+
textArea: node,
|
|
15
|
+
nativeElement: rootRef.current,
|
|
16
|
+
focus (options) {
|
|
17
|
+
nativeFocus.call(node, options);
|
|
18
|
+
if (options?.cursor && ('textarea' === node.localName || [
|
|
19
|
+
'text',
|
|
20
|
+
'search',
|
|
21
|
+
'password',
|
|
22
|
+
'tel',
|
|
23
|
+
'url'
|
|
24
|
+
].includes(node.type))) {
|
|
25
|
+
const end = node.value.length;
|
|
26
|
+
node.setSelectionRange('end' === options.cursor ? end : 0, 'start' === options.cursor ? 0 : end);
|
|
38
27
|
}
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
$[3] = rootRef;
|
|
43
|
-
$[4] = t1;
|
|
44
|
-
} else t1 = $[4];
|
|
45
|
-
useImperativeHandle(t0, t1);
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
});
|
|
46
31
|
}
|
|
47
32
|
function useTextControl(props, nodeRef) {
|
|
48
33
|
const [innerValue, setInnerValue] = useState(String(props.defaultValue ?? ''));
|
|
@@ -64,23 +49,23 @@ function useTextControl(props, nodeRef) {
|
|
|
64
49
|
max
|
|
65
50
|
}) : next;
|
|
66
51
|
};
|
|
67
|
-
const applyChange = (event,
|
|
68
|
-
event.target.value =
|
|
69
|
-
if (!controlled) setInnerValue(
|
|
52
|
+
const applyChange = (event, next)=>{
|
|
53
|
+
event.target.value = next;
|
|
54
|
+
if (!controlled) setInnerValue(next);
|
|
70
55
|
props.onChange?.(event);
|
|
71
56
|
};
|
|
72
|
-
const change = (
|
|
73
|
-
applyChange(
|
|
57
|
+
const change = (event, next = event.target.value)=>{
|
|
58
|
+
applyChange(event, composing.current ? next : normalize(next));
|
|
74
59
|
};
|
|
75
|
-
const blur = (
|
|
60
|
+
const blur = (event)=>{
|
|
76
61
|
composing.current = false;
|
|
77
|
-
props.onBlur?.(
|
|
62
|
+
props.onBlur?.(event);
|
|
78
63
|
};
|
|
79
|
-
const endComposition = (
|
|
64
|
+
const endComposition = (event)=>{
|
|
80
65
|
composing.current = false;
|
|
81
|
-
const target =
|
|
66
|
+
const target = event.currentTarget;
|
|
82
67
|
const normalized = normalize(target.value);
|
|
83
|
-
if (normalized !== target.value) applyChange(Object.create(
|
|
68
|
+
if (normalized !== target.value) applyChange(Object.create(event, {
|
|
84
69
|
target: {
|
|
85
70
|
value: target
|
|
86
71
|
}
|
|
@@ -88,9 +73,9 @@ function useTextControl(props, nodeRef) {
|
|
|
88
73
|
};
|
|
89
74
|
useEffect(()=>{
|
|
90
75
|
const form = nodeRef.current?.form;
|
|
91
|
-
const reset = (
|
|
76
|
+
const reset = (event)=>{
|
|
92
77
|
queueMicrotask(()=>{
|
|
93
|
-
if (
|
|
78
|
+
if (event.defaultPrevented) return;
|
|
94
79
|
composing.current = false;
|
|
95
80
|
if (!controlled) setInnerValue(String(props.defaultValue ?? ''));
|
|
96
81
|
});
|
|
@@ -103,15 +88,15 @@ function useTextControl(props, nodeRef) {
|
|
|
103
88
|
props.defaultValue,
|
|
104
89
|
props.form
|
|
105
90
|
]);
|
|
106
|
-
const clear = (
|
|
107
|
-
const
|
|
108
|
-
|
|
109
|
-
change(Object.create(
|
|
91
|
+
const clear = (event)=>{
|
|
92
|
+
const target = nodeRef.current.cloneNode(true);
|
|
93
|
+
target.value = '';
|
|
94
|
+
change(Object.create(event, {
|
|
110
95
|
target: {
|
|
111
|
-
value:
|
|
96
|
+
value: target
|
|
112
97
|
},
|
|
113
98
|
currentTarget: {
|
|
114
|
-
value:
|
|
99
|
+
value: target
|
|
115
100
|
}
|
|
116
101
|
}), '');
|
|
117
102
|
props.onClear?.();
|
|
@@ -128,50 +113,21 @@ function useTextControl(props, nodeRef) {
|
|
|
128
113
|
exceeded: void 0 !== max && count > max
|
|
129
114
|
};
|
|
130
115
|
}
|
|
131
|
-
function InputClear(
|
|
132
|
-
const $ = c(12);
|
|
133
|
-
const { config, onClick, className, style } = t0;
|
|
116
|
+
function InputClear({ config, onClick, className, style }) {
|
|
134
117
|
const { locale } = useTaoConfig();
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
if ($[4] !== className || $[5] !== locale.clear || $[6] !== onClick || $[7] !== options.disabled || $[8] !== options.tabIndex || $[9] !== style || $[10] !== t2) {
|
|
150
|
-
t3 = /*#__PURE__*/ jsx("button", {
|
|
151
|
-
type: "button",
|
|
152
|
-
"data-tao-input-clear": "",
|
|
153
|
-
"data-tao-input-action": "",
|
|
154
|
-
className: className,
|
|
155
|
-
style: style,
|
|
156
|
-
"aria-label": locale.clear,
|
|
157
|
-
disabled: options.disabled,
|
|
158
|
-
tabIndex: options.tabIndex,
|
|
159
|
-
onMouseDown: _temp,
|
|
160
|
-
onClick: onClick,
|
|
161
|
-
children: t2
|
|
162
|
-
});
|
|
163
|
-
$[4] = className;
|
|
164
|
-
$[5] = locale.clear;
|
|
165
|
-
$[6] = onClick;
|
|
166
|
-
$[7] = options.disabled;
|
|
167
|
-
$[8] = options.tabIndex;
|
|
168
|
-
$[9] = style;
|
|
169
|
-
$[10] = t2;
|
|
170
|
-
$[11] = t3;
|
|
171
|
-
} else t3 = $[11];
|
|
172
|
-
return t3;
|
|
173
|
-
}
|
|
174
|
-
function _temp(event) {
|
|
175
|
-
return event.preventDefault();
|
|
118
|
+
const options = 'object' == typeof config ? config : {};
|
|
119
|
+
return /*#__PURE__*/ jsx("button", {
|
|
120
|
+
type: "button",
|
|
121
|
+
"data-tao-input-clear": "",
|
|
122
|
+
"data-tao-input-action": "",
|
|
123
|
+
className: className,
|
|
124
|
+
style: style,
|
|
125
|
+
"aria-label": locale.clear,
|
|
126
|
+
disabled: options.disabled,
|
|
127
|
+
tabIndex: options.tabIndex,
|
|
128
|
+
onMouseDown: (event)=>event.preventDefault(),
|
|
129
|
+
onClick: onClick,
|
|
130
|
+
children: options.clearIcon ?? /*#__PURE__*/ jsx(CloseIcon, {})
|
|
131
|
+
});
|
|
176
132
|
}
|
|
177
133
|
export { InputClear, useTextControl, useTextControlRef };
|