@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,8 +1,8 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { c } from "react-compiler-runtime";
|
|
3
2
|
import tree, { TreeNode, conductExpandParent, convertDataToEntities, convertTreeToData, useTree } from "@rc-component/tree";
|
|
4
|
-
import { forwardRef, useRef, useState } from "react";
|
|
5
|
-
import {
|
|
3
|
+
import { forwardRef, useMemo, useRef, useState } from "react";
|
|
4
|
+
import { useTaoDirection } from "../../provider/tao-context.js";
|
|
5
|
+
import { useTaoConfig } from "../../provider/tao-provider.js";
|
|
6
6
|
import { mergeRefs } from "../../utils/refs.js";
|
|
7
7
|
import { cx } from "../../utils/semantic.js";
|
|
8
8
|
import { Spinner } from "../spinner/spinner.js";
|
|
@@ -18,93 +18,51 @@ class DirectionalRcTree extends RcTreeComponent {
|
|
|
18
18
|
this.onKeyDown = (event)=>onKeyDown(treeKeyboardEvent(event, this.props.direction));
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
-
function TreeGlyph(
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
});
|
|
67
|
-
$[6] = kind;
|
|
68
|
-
$[7] = t4;
|
|
69
|
-
} else t4 = $[7];
|
|
70
|
-
let t5;
|
|
71
|
-
if ($[8] !== kind) {
|
|
72
|
-
t5 = "grip" === kind && /*#__PURE__*/ jsx("path", {
|
|
73
|
-
d: "M8 5h.01M16 5h.01M8 12h.01M16 12h.01M8 19h.01M16 19h.01",
|
|
74
|
-
strokeWidth: "3"
|
|
75
|
-
});
|
|
76
|
-
$[8] = kind;
|
|
77
|
-
$[9] = t5;
|
|
78
|
-
} else t5 = $[9];
|
|
79
|
-
let t6;
|
|
80
|
-
if ($[10] !== t1 || $[11] !== t2 || $[12] !== t3 || $[13] !== t4 || $[14] !== t5) {
|
|
81
|
-
t6 = /*#__PURE__*/ jsxs("svg", {
|
|
82
|
-
"data-tao-tree-glyph": "",
|
|
83
|
-
width: "16",
|
|
84
|
-
height: "16",
|
|
85
|
-
viewBox: "0 0 24 24",
|
|
86
|
-
fill: "none",
|
|
87
|
-
stroke: "currentColor",
|
|
88
|
-
strokeWidth: "1.8",
|
|
89
|
-
strokeLinecap: "round",
|
|
90
|
-
strokeLinejoin: "round",
|
|
91
|
-
"aria-hidden": "true",
|
|
92
|
-
children: [
|
|
93
|
-
t1,
|
|
94
|
-
t2,
|
|
95
|
-
t3,
|
|
96
|
-
t4,
|
|
97
|
-
t5
|
|
98
|
-
]
|
|
99
|
-
});
|
|
100
|
-
$[10] = t1;
|
|
101
|
-
$[11] = t2;
|
|
102
|
-
$[12] = t3;
|
|
103
|
-
$[13] = t4;
|
|
104
|
-
$[14] = t5;
|
|
105
|
-
$[15] = t6;
|
|
106
|
-
} else t6 = $[15];
|
|
107
|
-
return t6;
|
|
21
|
+
function TreeGlyph({ kind }) {
|
|
22
|
+
return /*#__PURE__*/ jsxs("svg", {
|
|
23
|
+
"data-tao-tree-glyph": "",
|
|
24
|
+
width: "16",
|
|
25
|
+
height: "16",
|
|
26
|
+
viewBox: "0 0 24 24",
|
|
27
|
+
fill: "none",
|
|
28
|
+
stroke: "currentColor",
|
|
29
|
+
strokeWidth: "1.8",
|
|
30
|
+
strokeLinecap: "round",
|
|
31
|
+
strokeLinejoin: "round",
|
|
32
|
+
"aria-hidden": "true",
|
|
33
|
+
children: [
|
|
34
|
+
'chevron' === kind && /*#__PURE__*/ jsx("path", {
|
|
35
|
+
d: "m9 6 6 6-6 6"
|
|
36
|
+
}),
|
|
37
|
+
'file' === kind && /*#__PURE__*/ jsxs(Fragment, {
|
|
38
|
+
children: [
|
|
39
|
+
/*#__PURE__*/ jsx("path", {
|
|
40
|
+
d: "M14 3H6v18h12V7l-4-4Z"
|
|
41
|
+
}),
|
|
42
|
+
/*#__PURE__*/ jsx("path", {
|
|
43
|
+
d: "M14 3v5h4"
|
|
44
|
+
})
|
|
45
|
+
]
|
|
46
|
+
}),
|
|
47
|
+
'folder' === kind && /*#__PURE__*/ jsx("path", {
|
|
48
|
+
d: "M3 6h7l2 3h9v11H3V6Z"
|
|
49
|
+
}),
|
|
50
|
+
'folder-open' === kind && /*#__PURE__*/ jsxs(Fragment, {
|
|
51
|
+
children: [
|
|
52
|
+
/*#__PURE__*/ jsx("path", {
|
|
53
|
+
d: "M3 18V6h7l2 3h8v3"
|
|
54
|
+
}),
|
|
55
|
+
/*#__PURE__*/ jsx("path", {
|
|
56
|
+
d: "M6 12h16l-3 8H3l3-8Z"
|
|
57
|
+
})
|
|
58
|
+
]
|
|
59
|
+
}),
|
|
60
|
+
'grip' === kind && /*#__PURE__*/ jsx("path", {
|
|
61
|
+
d: "M8 5h.01M16 5h.01M8 12h.01M16 12h.01M8 19h.01M16 19h.01",
|
|
62
|
+
strokeWidth: "3"
|
|
63
|
+
})
|
|
64
|
+
]
|
|
65
|
+
});
|
|
108
66
|
}
|
|
109
67
|
const TreeBase = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
110
68
|
const config = useTaoConfig();
|
|
@@ -205,27 +163,27 @@ const TreeBase = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
|
205
163
|
onSelect: onSelect && ((keys, info)=>onSelect([
|
|
206
164
|
...keys
|
|
207
165
|
], info)),
|
|
208
|
-
onCheck: onCheck && ((
|
|
209
|
-
...
|
|
166
|
+
onCheck: onCheck && ((keys, info)=>onCheck(Array.isArray(keys) ? [
|
|
167
|
+
...keys
|
|
210
168
|
] : {
|
|
211
169
|
checked: [
|
|
212
|
-
...
|
|
170
|
+
...keys.checked
|
|
213
171
|
],
|
|
214
172
|
halfChecked: [
|
|
215
|
-
...
|
|
173
|
+
...keys.halfChecked
|
|
216
174
|
]
|
|
217
|
-
},
|
|
218
|
-
...
|
|
175
|
+
}, info.halfCheckedKeys ? {
|
|
176
|
+
...info,
|
|
219
177
|
halfCheckedKeys: [
|
|
220
|
-
...
|
|
178
|
+
...info.halfCheckedKeys
|
|
221
179
|
]
|
|
222
|
-
} :
|
|
223
|
-
onExpand: onExpand && ((
|
|
224
|
-
...
|
|
225
|
-
],
|
|
226
|
-
onLoad: onLoad && ((
|
|
227
|
-
...
|
|
228
|
-
],
|
|
180
|
+
} : info)),
|
|
181
|
+
onExpand: onExpand && ((keys, info)=>onExpand([
|
|
182
|
+
...keys
|
|
183
|
+
], info)),
|
|
184
|
+
onLoad: onLoad && ((keys, info)=>onLoad([
|
|
185
|
+
...keys
|
|
186
|
+
], info)),
|
|
229
187
|
showLine: Boolean(showLine),
|
|
230
188
|
showIcon: showIcon,
|
|
231
189
|
disabled: disabled,
|
|
@@ -250,168 +208,91 @@ const TreeBase = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
|
250
208
|
});
|
|
251
209
|
TreeBase.displayName = 'Tree';
|
|
252
210
|
const DirectoryTreeBase = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
253
|
-
const
|
|
254
|
-
const
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
ordered = [];
|
|
268
|
-
t3 = convertDataToEntities(data, {
|
|
269
|
-
fieldNames: props.fieldNames,
|
|
270
|
-
processEntity (entity) {
|
|
271
|
-
ordered.push({
|
|
272
|
-
key: entity.key,
|
|
273
|
-
node: entity.node
|
|
274
|
-
});
|
|
275
|
-
}
|
|
276
|
-
});
|
|
277
|
-
$[2] = props.children;
|
|
278
|
-
$[3] = props.fieldNames;
|
|
279
|
-
$[4] = props.treeData;
|
|
280
|
-
$[5] = ordered;
|
|
281
|
-
$[6] = t3;
|
|
282
|
-
} else {
|
|
283
|
-
ordered = $[5];
|
|
284
|
-
t3 = $[6];
|
|
285
|
-
}
|
|
286
|
-
const { keyEntities } = t3;
|
|
287
|
-
let t4;
|
|
288
|
-
if ($[7] !== defaultExpandAll || $[8] !== defaultExpandParent || $[9] !== defaultExpandedKeys || $[10] !== keyEntities || $[11] !== ordered) {
|
|
289
|
-
t4 = ()=>defaultExpandAll ? ordered.map(_temp) : defaultExpandParent ? conductExpandParent(defaultExpandedKeys, keyEntities) : defaultExpandedKeys;
|
|
290
|
-
$[7] = defaultExpandAll;
|
|
291
|
-
$[8] = defaultExpandParent;
|
|
292
|
-
$[9] = defaultExpandedKeys;
|
|
293
|
-
$[10] = keyEntities;
|
|
294
|
-
$[11] = ordered;
|
|
295
|
-
$[12] = t4;
|
|
296
|
-
} else t4 = $[12];
|
|
297
|
-
const [internalExpanded, setExpanded] = useState(t4);
|
|
298
|
-
let t5;
|
|
299
|
-
if ($[13] !== props.defaultSelectedKeys) {
|
|
300
|
-
t5 = props.defaultSelectedKeys ?? [];
|
|
301
|
-
$[13] = props.defaultSelectedKeys;
|
|
302
|
-
$[14] = t5;
|
|
303
|
-
} else t5 = $[14];
|
|
304
|
-
const [internalSelected, setSelected] = useState(t5);
|
|
211
|
+
const { defaultExpandAll, defaultExpandedKeys = [], defaultExpandParent = true } = props;
|
|
212
|
+
const data = props.treeData ?? convertTreeToData(props.children);
|
|
213
|
+
const ordered = [];
|
|
214
|
+
const { keyEntities } = convertDataToEntities(data, {
|
|
215
|
+
fieldNames: props.fieldNames,
|
|
216
|
+
processEntity (entity) {
|
|
217
|
+
ordered.push({
|
|
218
|
+
key: entity.key,
|
|
219
|
+
node: entity.node
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
});
|
|
223
|
+
const [internalExpanded, setExpanded] = useState(()=>defaultExpandAll ? ordered.map(({ key })=>key) : defaultExpandParent ? conductExpandParent(defaultExpandedKeys, keyEntities) : defaultExpandedKeys);
|
|
224
|
+
const [internalSelected, setSelected] = useState(props.defaultSelectedKeys ?? []);
|
|
305
225
|
const expandedKeys = props.expandedKeys ?? internalExpanded;
|
|
306
226
|
const selectedKeys = props.selectedKeys ?? internalSelected;
|
|
307
227
|
const anchor = useRef(void 0);
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
t6 = [];
|
|
311
|
-
$[15] = t6;
|
|
312
|
-
} else t6 = $[15];
|
|
313
|
-
const selectionBeforeRange = useRef(t6);
|
|
314
|
-
let t7;
|
|
315
|
-
if ($[16] === Symbol.for("react.memo_cache_sentinel")) {
|
|
316
|
-
t7 = [];
|
|
317
|
-
$[16] = t7;
|
|
318
|
-
} else t7 = $[16];
|
|
319
|
-
const lastRequestedSelection = useRef(t7);
|
|
228
|
+
const selectionBeforeRange = useRef([]);
|
|
229
|
+
const lastRequestedSelection = useRef([]);
|
|
320
230
|
const treeRef = useRef(null);
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
];
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
231
|
+
const mergedRef = useMemo(()=>mergeRefs(treeRef, ref), [
|
|
232
|
+
ref
|
|
233
|
+
]);
|
|
234
|
+
const onSelect = (keys, info)=>{
|
|
235
|
+
const key = info.node.key;
|
|
236
|
+
let selection = [
|
|
237
|
+
key
|
|
238
|
+
];
|
|
239
|
+
if (props.multiple && (info.nativeEvent?.ctrlKey || info.nativeEvent?.metaKey)) {
|
|
240
|
+
selection = keys.filter((key)=>Object.hasOwn(keyEntities, String(key)));
|
|
241
|
+
anchor.current = key;
|
|
242
|
+
selectionBeforeRange.current = selection;
|
|
243
|
+
} else if (props.multiple && info.nativeEvent?.shiftKey) {
|
|
244
|
+
const visible = treeRef.current?.state.flattenNodes ?? [];
|
|
245
|
+
const start = visible.findIndex((node)=>node.key === anchor.current);
|
|
246
|
+
const end = visible.findIndex((node)=>node.key === key);
|
|
247
|
+
if (start < 0 || end < 0) {
|
|
248
|
+
anchor.current = key;
|
|
338
249
|
selectionBeforeRange.current = selection;
|
|
339
|
-
} else if (props.multiple && info.nativeEvent?.shiftKey) {
|
|
340
|
-
const visible = treeRef.current?.state.flattenNodes ?? [];
|
|
341
|
-
const start = visible.findIndex((node)=>node.key === anchor.current);
|
|
342
|
-
const end = visible.findIndex((node_0)=>node_0.key === key_0);
|
|
343
|
-
if (start < 0 || end < 0) {
|
|
344
|
-
anchor.current = key_0;
|
|
345
|
-
selectionBeforeRange.current = selection;
|
|
346
|
-
} else {
|
|
347
|
-
const lastRequest = lastRequestedSelection.current;
|
|
348
|
-
if (void 0 !== props.selectedKeys && (selectedKeys.length !== lastRequest.length || selectedKeys.some((key_2, index)=>key_2 !== lastRequest[index]))) selectionBeforeRange.current = selectedKeys;
|
|
349
|
-
const range = visible.slice(Math.min(start, end), Math.max(start, end) + 1).filter(_temp2).map(_temp3);
|
|
350
|
-
const existing = selectionBeforeRange.current.filter((key_3)=>Object.hasOwn(keyEntities, String(key_3)));
|
|
351
|
-
selection = [
|
|
352
|
-
...new Set([
|
|
353
|
-
...existing,
|
|
354
|
-
...range
|
|
355
|
-
])
|
|
356
|
-
];
|
|
357
|
-
}
|
|
358
250
|
} else {
|
|
359
|
-
|
|
360
|
-
selectionBeforeRange.current =
|
|
251
|
+
const lastRequest = lastRequestedSelection.current;
|
|
252
|
+
if (void 0 !== props.selectedKeys && (selectedKeys.length !== lastRequest.length || selectedKeys.some((key, index)=>key !== lastRequest[index]))) selectionBeforeRange.current = selectedKeys;
|
|
253
|
+
const range = visible.slice(Math.min(start, end), Math.max(start, end) + 1).filter(({ data })=>!data.disabled && false !== data.selectable).map((node)=>node.key);
|
|
254
|
+
const existing = selectionBeforeRange.current.filter((key)=>Object.hasOwn(keyEntities, String(key)));
|
|
255
|
+
selection = [
|
|
256
|
+
...new Set([
|
|
257
|
+
...existing,
|
|
258
|
+
...range
|
|
259
|
+
])
|
|
260
|
+
];
|
|
361
261
|
}
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
$[21] = props;
|
|
375
|
-
$[22] = selectedKeys;
|
|
376
|
-
$[23] = t9;
|
|
377
|
-
} else t9 = $[23];
|
|
378
|
-
const onSelect = t9;
|
|
379
|
-
let t10;
|
|
380
|
-
if ($[24] !== props) {
|
|
381
|
-
t10 = (keys_0, info_0)=>{
|
|
382
|
-
if (void 0 === props.expandedKeys) setExpanded(keys_0);
|
|
383
|
-
props.onExpand?.([
|
|
384
|
-
...keys_0
|
|
385
|
-
], info_0);
|
|
386
|
-
};
|
|
387
|
-
$[24] = props;
|
|
388
|
-
$[25] = t10;
|
|
389
|
-
} else t10 = $[25];
|
|
390
|
-
let t11;
|
|
391
|
-
if ($[26] !== defaultExpandParent || $[27] !== expandedKeys || $[28] !== mergedRef || $[29] !== onSelect || $[30] !== props || $[31] !== selectedKeys || $[32] !== t10) {
|
|
392
|
-
t11 = /*#__PURE__*/ jsx(TreeBase, {
|
|
393
|
-
icon: _temp5,
|
|
394
|
-
blockNode: true,
|
|
395
|
-
showIcon: true,
|
|
396
|
-
expandAction: "click",
|
|
397
|
-
...props,
|
|
398
|
-
ref: mergedRef,
|
|
399
|
-
defaultExpandParent: defaultExpandParent,
|
|
400
|
-
expandedKeys: expandedKeys,
|
|
401
|
-
selectedKeys: selectedKeys,
|
|
402
|
-
onSelect: onSelect,
|
|
403
|
-
onExpand: t10
|
|
262
|
+
} else {
|
|
263
|
+
anchor.current = key;
|
|
264
|
+
selectionBeforeRange.current = selection;
|
|
265
|
+
}
|
|
266
|
+
lastRequestedSelection.current = selection;
|
|
267
|
+
if (void 0 === props.selectedKeys) setSelected(selection);
|
|
268
|
+
props.onSelect?.([
|
|
269
|
+
...selection
|
|
270
|
+
], {
|
|
271
|
+
...info,
|
|
272
|
+
selected: selection.includes(key),
|
|
273
|
+
selectedNodes: ordered.filter((item)=>selection.includes(item.key)).map((item)=>item.node)
|
|
404
274
|
});
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
275
|
+
};
|
|
276
|
+
return /*#__PURE__*/ jsx(TreeBase, {
|
|
277
|
+
icon: (node)=>/*#__PURE__*/ jsx(TreeGlyph, {
|
|
278
|
+
kind: node.isLeaf ? 'file' : node.expanded ? 'folder-open' : 'folder'
|
|
279
|
+
}),
|
|
280
|
+
blockNode: true,
|
|
281
|
+
showIcon: true,
|
|
282
|
+
expandAction: "click",
|
|
283
|
+
...props,
|
|
284
|
+
ref: mergedRef,
|
|
285
|
+
defaultExpandParent: defaultExpandParent,
|
|
286
|
+
expandedKeys: expandedKeys,
|
|
287
|
+
selectedKeys: selectedKeys,
|
|
288
|
+
onSelect: onSelect,
|
|
289
|
+
onExpand: (keys, info)=>{
|
|
290
|
+
if (void 0 === props.expandedKeys) setExpanded(keys);
|
|
291
|
+
props.onExpand?.([
|
|
292
|
+
...keys
|
|
293
|
+
], info);
|
|
294
|
+
}
|
|
295
|
+
});
|
|
415
296
|
});
|
|
416
297
|
DirectoryTreeBase.displayName = 'DirectoryTree';
|
|
417
298
|
const DirectoryTree = DirectoryTreeBase;
|
|
@@ -420,23 +301,4 @@ const Tree = Object.assign(TreeBase, {
|
|
|
420
301
|
TreeNode: TreeNode,
|
|
421
302
|
useTree: useTree
|
|
422
303
|
});
|
|
423
|
-
function _temp(t0) {
|
|
424
|
-
const { key } = t0;
|
|
425
|
-
return key;
|
|
426
|
-
}
|
|
427
|
-
function _temp2(t0) {
|
|
428
|
-
const { data: data_0 } = t0;
|
|
429
|
-
return !data_0.disabled && false !== data_0.selectable;
|
|
430
|
-
}
|
|
431
|
-
function _temp3(node_1) {
|
|
432
|
-
return node_1.key;
|
|
433
|
-
}
|
|
434
|
-
function _temp4(item_0) {
|
|
435
|
-
return item_0.node;
|
|
436
|
-
}
|
|
437
|
-
function _temp5(node_2) {
|
|
438
|
-
return /*#__PURE__*/ jsx(TreeGlyph, {
|
|
439
|
-
kind: node_2.isLeaf ? "file" : node_2.expanded ? "folder-open" : "folder"
|
|
440
|
-
});
|
|
441
|
-
}
|
|
442
304
|
export { DirectoryTree, Tree };
|