@rockshin/tao-ui 0.0.60 → 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 +28 -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.js +418 -982
- package/dist/components/context-menu/context-menu.css +4 -4
- package/dist/components/context-menu/context-menu.d.ts +1 -1
- package/dist/components/context-menu/context-menu.js +52 -138
- 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 +81 -210
- 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 +93 -104
- 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 +217 -252
- 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 -31
- package/dist/components/dropdown/dropdown.js +90 -276
- 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 +36 -47
- 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 -67
- 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 +2 -1
- package/dist/components/input-number/input-number.js +30 -152
- 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 +288 -73
- package/dist/components/menu/menu-render.d.ts +2 -1
- package/dist/components/menu/menu-render.js +149 -307
- package/dist/components/menu/menu.css +142 -140
- package/dist/components/modal/confirm-dialog.js +8 -18
- 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 +1 -1
- package/dist/components/pagination/pagination.js +137 -290
- 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 +168 -275
- 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-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 -269
- 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 -413
- 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 +1 -1
- package/dist/components/table/table-filter.js +68 -155
- 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 +85 -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 +1 -1
- package/dist/components/tabs/tabs.js +156 -331
- 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 +88 -220
- 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.js +105 -215
- 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 +11 -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.js +42 -42
- 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 -378
- package/dist/theme/control.css +106 -126
- package/dist/theme/theme.css +2 -0
- 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,5 +1,4 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { c } from "react-compiler-runtime";
|
|
3
2
|
import _rc_component_image from "@rc-component/image";
|
|
4
3
|
import { Children, cloneElement, createContext, isValidElement, useContext, useEffect, useRef, useState } from "react";
|
|
5
4
|
import { useTaoInternalConfig } from "../../provider/tao-provider.js";
|
|
@@ -10,972 +9,360 @@ import { interopDefault } from "../../utils/interop-default.js";
|
|
|
10
9
|
const RcImageComponent = /*#__PURE__*/ interopDefault(_rc_component_image);
|
|
11
10
|
const PreviewDisabledContext = /*#__PURE__*/ createContext(false);
|
|
12
11
|
function usePreviewContainer(getContainer, allowCreate, disabled) {
|
|
13
|
-
const $ = c(17);
|
|
14
12
|
const { tokenStyle, mode, compact } = useTaoInternalConfig();
|
|
15
13
|
const containerRef = useRef(null);
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
} else {
|
|
40
|
-
t0 = $[3];
|
|
41
|
-
t1 = $[4];
|
|
42
|
-
}
|
|
43
|
-
useEffect(t0, t1);
|
|
44
|
-
let t2;
|
|
45
|
-
let t3;
|
|
46
|
-
if ($[5] !== disabled || $[6] !== getContainer) {
|
|
47
|
-
t2 = ()=>{
|
|
48
|
-
if (!disabled && false !== getContainer) return;
|
|
14
|
+
useEffect(()=>{
|
|
15
|
+
const container = containerRef.current;
|
|
16
|
+
if (!container) return;
|
|
17
|
+
if ('light' === mode) delete container.dataset.taoTheme;
|
|
18
|
+
else container.dataset.taoTheme = mode;
|
|
19
|
+
if (compact) container.dataset.taoDensity = 'compact';
|
|
20
|
+
else delete container.dataset.taoDensity;
|
|
21
|
+
container.removeAttribute('style');
|
|
22
|
+
for (const [key, value] of Object.entries(tokenStyle ?? {}))container.style.setProperty(key, String(value));
|
|
23
|
+
}, [
|
|
24
|
+
tokenStyle,
|
|
25
|
+
mode,
|
|
26
|
+
compact
|
|
27
|
+
]);
|
|
28
|
+
useEffect(()=>{
|
|
29
|
+
if (!disabled && false !== getContainer) return;
|
|
30
|
+
containerRef.current?.remove();
|
|
31
|
+
containerRef.current = null;
|
|
32
|
+
}, [
|
|
33
|
+
disabled,
|
|
34
|
+
getContainer
|
|
35
|
+
]);
|
|
36
|
+
useEffect(()=>()=>{
|
|
49
37
|
containerRef.current?.remove();
|
|
50
38
|
containerRef.current = null;
|
|
51
|
-
};
|
|
52
|
-
t3 = [
|
|
53
|
-
disabled,
|
|
54
|
-
getContainer
|
|
55
|
-
];
|
|
56
|
-
$[5] = disabled;
|
|
57
|
-
$[6] = getContainer;
|
|
58
|
-
$[7] = t2;
|
|
59
|
-
$[8] = t3;
|
|
60
|
-
} else {
|
|
61
|
-
t2 = $[7];
|
|
62
|
-
t3 = $[8];
|
|
63
|
-
}
|
|
64
|
-
useEffect(t2, t3);
|
|
65
|
-
let t4;
|
|
66
|
-
let t5;
|
|
67
|
-
if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
|
|
68
|
-
t4 = ()=>()=>{
|
|
69
|
-
containerRef.current?.remove();
|
|
70
|
-
containerRef.current = null;
|
|
71
|
-
};
|
|
72
|
-
t5 = [];
|
|
73
|
-
$[9] = t4;
|
|
74
|
-
$[10] = t5;
|
|
75
|
-
} else {
|
|
76
|
-
t4 = $[9];
|
|
77
|
-
t5 = $[10];
|
|
78
|
-
}
|
|
79
|
-
useEffect(t4, t5);
|
|
39
|
+
}, []);
|
|
80
40
|
if (disabled) return;
|
|
81
41
|
if (false === getContainer) return false;
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
return container_0;
|
|
103
|
-
};
|
|
104
|
-
$[11] = allowCreate;
|
|
105
|
-
$[12] = compact;
|
|
106
|
-
$[13] = getContainer;
|
|
107
|
-
$[14] = mode;
|
|
108
|
-
$[15] = tokenStyle;
|
|
109
|
-
$[16] = t6;
|
|
110
|
-
} else t6 = $[16];
|
|
111
|
-
return t6;
|
|
42
|
+
return ()=>{
|
|
43
|
+
if (!allowCreate && !containerRef.current) return null;
|
|
44
|
+
const target = 'function' == typeof getContainer ? getContainer() : 'string' == typeof getContainer ? document.querySelector(getContainer) : getContainer ?? document.body;
|
|
45
|
+
const previous = containerRef.current;
|
|
46
|
+
if (previous && previous.parentNode === target) return previous;
|
|
47
|
+
if (previous) queueMicrotask(()=>previous.remove());
|
|
48
|
+
if (!target) {
|
|
49
|
+
containerRef.current = null;
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
const container = target.ownerDocument.createElement('div');
|
|
53
|
+
container.dataset.taoImagePopup = '';
|
|
54
|
+
container.dataset.taoProvider = '';
|
|
55
|
+
if ('light' !== mode) container.dataset.taoTheme = mode;
|
|
56
|
+
if (compact) container.dataset.taoDensity = 'compact';
|
|
57
|
+
for (const [key, value] of Object.entries(tokenStyle ?? {}))container.style.setProperty(key, String(value));
|
|
58
|
+
target.appendChild(container);
|
|
59
|
+
containerRef.current = container;
|
|
60
|
+
return container;
|
|
61
|
+
};
|
|
112
62
|
}
|
|
113
63
|
function usePreviewOptions(preview, internalOpen) {
|
|
114
|
-
const $ = c(54);
|
|
115
64
|
const { locale } = useTaoInternalConfig();
|
|
116
65
|
const groupDisabled = useContext(PreviewDisabledContext);
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
t0 = "object" == typeof preview ? preview : {};
|
|
120
|
-
$[0] = preview;
|
|
121
|
-
$[1] = t0;
|
|
122
|
-
} else t0 = $[1];
|
|
123
|
-
const raw = t0;
|
|
124
|
-
let getContainer;
|
|
125
|
-
let mask;
|
|
126
|
-
let open;
|
|
127
|
-
let rest;
|
|
128
|
-
let rootClassName;
|
|
129
|
-
let toolbarRender;
|
|
130
|
-
let visible;
|
|
131
|
-
if ($[2] !== raw) {
|
|
132
|
-
const { visible: t1, open: t2, rootClassName: t3, forceRender: _forceRender, destroyOnClose: _destroyOnClose, toolbarRender: t4, mask: t5, getContainer: t6, ...t7 } = raw;
|
|
133
|
-
visible = t1;
|
|
134
|
-
open = t2;
|
|
135
|
-
rootClassName = t3;
|
|
136
|
-
toolbarRender = t4;
|
|
137
|
-
mask = t5;
|
|
138
|
-
getContainer = t6;
|
|
139
|
-
rest = t7;
|
|
140
|
-
$[2] = raw;
|
|
141
|
-
$[3] = getContainer;
|
|
142
|
-
$[4] = mask;
|
|
143
|
-
$[5] = open;
|
|
144
|
-
$[6] = rest;
|
|
145
|
-
$[7] = rootClassName;
|
|
146
|
-
$[8] = toolbarRender;
|
|
147
|
-
$[9] = visible;
|
|
148
|
-
} else {
|
|
149
|
-
getContainer = $[3];
|
|
150
|
-
mask = $[4];
|
|
151
|
-
open = $[5];
|
|
152
|
-
rest = $[6];
|
|
153
|
-
rootClassName = $[7];
|
|
154
|
-
toolbarRender = $[8];
|
|
155
|
-
visible = $[9];
|
|
156
|
-
}
|
|
66
|
+
const raw = 'object' == typeof preview ? preview : {};
|
|
67
|
+
const { visible, open, rootClassName, forceRender: _forceRender, destroyOnClose: _destroyOnClose, toolbarRender, mask, getContainer, ...rest } = raw;
|
|
157
68
|
const disabled = groupDisabled || false === preview;
|
|
158
69
|
const container = usePreviewContainer(getContainer, !disabled && (open ?? visible ?? internalOpen), disabled);
|
|
159
|
-
const iterableMask = null !== mask &&
|
|
160
|
-
const maskCover =
|
|
161
|
-
const maskConfig =
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
t1 = /*#__PURE__*/ jsx(ImageControlIcon, {
|
|
70
|
+
const iterableMask = null !== mask && 'object' == typeof mask && Symbol.iterator in mask ? mask : void 0;
|
|
71
|
+
const maskCover = 'string' == typeof mask || 'number' == typeof mask || /*#__PURE__*/ isValidElement(mask) ? mask : iterableMask;
|
|
72
|
+
const maskConfig = 'object' != typeof mask || null === mask || /*#__PURE__*/ isValidElement(mask) || iterableMask ? void 0 : mask;
|
|
73
|
+
const icons = {
|
|
74
|
+
close: /*#__PURE__*/ jsx(ImageControlIcon, {
|
|
165
75
|
name: "close",
|
|
166
76
|
label: locale.close
|
|
167
|
-
})
|
|
168
|
-
|
|
169
|
-
$[11] = t1;
|
|
170
|
-
} else t1 = $[11];
|
|
171
|
-
let t2;
|
|
172
|
-
if ($[12] !== locale.previous) {
|
|
173
|
-
t2 = /*#__PURE__*/ jsx(ImageControlIcon, {
|
|
77
|
+
}),
|
|
78
|
+
prev: /*#__PURE__*/ jsx(ImageControlIcon, {
|
|
174
79
|
name: "prev",
|
|
175
80
|
label: locale.previous
|
|
176
|
-
})
|
|
177
|
-
|
|
178
|
-
$[13] = t2;
|
|
179
|
-
} else t2 = $[13];
|
|
180
|
-
let t3;
|
|
181
|
-
if ($[14] !== locale.next) {
|
|
182
|
-
t3 = /*#__PURE__*/ jsx(ImageControlIcon, {
|
|
81
|
+
}),
|
|
82
|
+
next: /*#__PURE__*/ jsx(ImageControlIcon, {
|
|
183
83
|
name: "next",
|
|
184
84
|
label: locale.next
|
|
185
|
-
})
|
|
186
|
-
|
|
187
|
-
$[15] = t3;
|
|
188
|
-
} else t3 = $[15];
|
|
189
|
-
let t4;
|
|
190
|
-
let t5;
|
|
191
|
-
let t6;
|
|
192
|
-
let t7;
|
|
193
|
-
let t8;
|
|
194
|
-
let t9;
|
|
195
|
-
if ($[16] === Symbol.for("react.memo_cache_sentinel")) {
|
|
196
|
-
t4 = /*#__PURE__*/ jsx(ImageControlIcon, {
|
|
85
|
+
}),
|
|
86
|
+
rotateLeft: /*#__PURE__*/ jsx(ImageControlIcon, {
|
|
197
87
|
name: "rotateLeft"
|
|
198
|
-
})
|
|
199
|
-
|
|
88
|
+
}),
|
|
89
|
+
rotateRight: /*#__PURE__*/ jsx(ImageControlIcon, {
|
|
200
90
|
name: "rotateRight"
|
|
201
|
-
})
|
|
202
|
-
|
|
91
|
+
}),
|
|
92
|
+
zoomIn: /*#__PURE__*/ jsx(ImageControlIcon, {
|
|
203
93
|
name: "zoomIn"
|
|
204
|
-
})
|
|
205
|
-
|
|
94
|
+
}),
|
|
95
|
+
zoomOut: /*#__PURE__*/ jsx(ImageControlIcon, {
|
|
206
96
|
name: "zoomOut"
|
|
207
|
-
})
|
|
208
|
-
|
|
97
|
+
}),
|
|
98
|
+
flipX: /*#__PURE__*/ jsx(ImageControlIcon, {
|
|
209
99
|
name: "flipX"
|
|
210
|
-
})
|
|
211
|
-
|
|
100
|
+
}),
|
|
101
|
+
flipY: /*#__PURE__*/ jsx(ImageControlIcon, {
|
|
212
102
|
name: "flipY"
|
|
103
|
+
}),
|
|
104
|
+
...raw.icons
|
|
105
|
+
};
|
|
106
|
+
const actionLabels = {
|
|
107
|
+
prev: locale.previous,
|
|
108
|
+
next: locale.next,
|
|
109
|
+
flipY: locale.messages.flipY,
|
|
110
|
+
flipX: locale.messages.flipX,
|
|
111
|
+
rotateLeft: locale.messages.rotateLeft,
|
|
112
|
+
rotateRight: locale.messages.rotateRight,
|
|
113
|
+
zoomOut: locale.messages.zoomOut,
|
|
114
|
+
zoomIn: locale.messages.zoomIn
|
|
115
|
+
};
|
|
116
|
+
const localizeAction = (node)=>{
|
|
117
|
+
if (!/*#__PURE__*/ isValidElement(node)) return node;
|
|
118
|
+
const label = actionLabels[node.props['aria-label'] ?? ''];
|
|
119
|
+
return void 0 === label ? node : /*#__PURE__*/ cloneElement(node, {
|
|
120
|
+
'aria-label': label
|
|
213
121
|
});
|
|
214
|
-
|
|
215
|
-
$[17] = t5;
|
|
216
|
-
$[18] = t6;
|
|
217
|
-
$[19] = t7;
|
|
218
|
-
$[20] = t8;
|
|
219
|
-
$[21] = t9;
|
|
220
|
-
} else {
|
|
221
|
-
t4 = $[16];
|
|
222
|
-
t5 = $[17];
|
|
223
|
-
t6 = $[18];
|
|
224
|
-
t7 = $[19];
|
|
225
|
-
t8 = $[20];
|
|
226
|
-
t9 = $[21];
|
|
227
|
-
}
|
|
228
|
-
let t10;
|
|
229
|
-
if ($[22] !== raw.icons || $[23] !== t1 || $[24] !== t2 || $[25] !== t3) {
|
|
230
|
-
t10 = {
|
|
231
|
-
close: t1,
|
|
232
|
-
prev: t2,
|
|
233
|
-
next: t3,
|
|
234
|
-
rotateLeft: t4,
|
|
235
|
-
rotateRight: t5,
|
|
236
|
-
zoomIn: t6,
|
|
237
|
-
zoomOut: t7,
|
|
238
|
-
flipX: t8,
|
|
239
|
-
flipY: t9,
|
|
240
|
-
...raw.icons
|
|
241
|
-
};
|
|
242
|
-
$[22] = raw.icons;
|
|
243
|
-
$[23] = t1;
|
|
244
|
-
$[24] = t2;
|
|
245
|
-
$[25] = t3;
|
|
246
|
-
$[26] = t10;
|
|
247
|
-
} else t10 = $[26];
|
|
248
|
-
const icons = t10;
|
|
249
|
-
let t11;
|
|
250
|
-
if ($[27] !== locale.messages.flipX || $[28] !== locale.messages.flipY || $[29] !== locale.messages.rotateLeft || $[30] !== locale.messages.rotateRight || $[31] !== locale.messages.zoomIn || $[32] !== locale.messages.zoomOut || $[33] !== locale.next || $[34] !== locale.previous) {
|
|
251
|
-
const actionLabels = {
|
|
252
|
-
prev: locale.previous,
|
|
253
|
-
next: locale.next,
|
|
254
|
-
flipY: locale.messages.flipY,
|
|
255
|
-
flipX: locale.messages.flipX,
|
|
256
|
-
rotateLeft: locale.messages.rotateLeft,
|
|
257
|
-
rotateRight: locale.messages.rotateRight,
|
|
258
|
-
zoomOut: locale.messages.zoomOut,
|
|
259
|
-
zoomIn: locale.messages.zoomIn
|
|
260
|
-
};
|
|
261
|
-
t11 = (node)=>{
|
|
262
|
-
if (!/*#__PURE__*/ isValidElement(node)) return node;
|
|
263
|
-
const label = actionLabels[node.props["aria-label"] ?? ""];
|
|
264
|
-
return void 0 === label ? node : /*#__PURE__*/ cloneElement(node, {
|
|
265
|
-
"aria-label": label
|
|
266
|
-
});
|
|
267
|
-
};
|
|
268
|
-
$[27] = locale.messages.flipX;
|
|
269
|
-
$[28] = locale.messages.flipY;
|
|
270
|
-
$[29] = locale.messages.rotateLeft;
|
|
271
|
-
$[30] = locale.messages.rotateRight;
|
|
272
|
-
$[31] = locale.messages.zoomIn;
|
|
273
|
-
$[32] = locale.messages.zoomOut;
|
|
274
|
-
$[33] = locale.next;
|
|
275
|
-
$[34] = locale.previous;
|
|
276
|
-
$[35] = t11;
|
|
277
|
-
} else t11 = $[35];
|
|
278
|
-
const localizeAction = t11;
|
|
122
|
+
};
|
|
279
123
|
const renderActions = raw.actionsRender ?? toolbarRender;
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
const t13 = false === mask || maskConfig?.enabled === false;
|
|
305
|
-
const t14 = maskConfig?.blur;
|
|
306
|
-
const t15 = open ?? visible;
|
|
307
|
-
const t16 = maskConfig?.closable ?? true;
|
|
308
|
-
let t17;
|
|
309
|
-
if ($[39] !== actionsRender || $[40] !== container || $[41] !== icons || $[42] !== rest || $[43] !== rootClassName || $[44] !== t15 || $[45] !== t16) {
|
|
310
|
-
t17 = {
|
|
124
|
+
const actionsRender = (original, info)=>{
|
|
125
|
+
const actions = original;
|
|
126
|
+
const localized = /*#__PURE__*/ cloneElement(actions, void 0, Children.map(actions.props.children, localizeAction));
|
|
127
|
+
return renderActions ? renderActions(localized, {
|
|
128
|
+
...info,
|
|
129
|
+
icons: {
|
|
130
|
+
prevIcon: localizeAction(info.icons.prevIcon),
|
|
131
|
+
nextIcon: localizeAction(info.icons.nextIcon),
|
|
132
|
+
flipYIcon: localizeAction(info.icons.flipYIcon),
|
|
133
|
+
flipXIcon: localizeAction(info.icons.flipXIcon),
|
|
134
|
+
rotateLeftIcon: localizeAction(info.icons.rotateLeftIcon),
|
|
135
|
+
rotateRightIcon: localizeAction(info.icons.rotateRightIcon),
|
|
136
|
+
zoomOutIcon: localizeAction(info.icons.zoomOutIcon),
|
|
137
|
+
zoomInIcon: localizeAction(info.icons.zoomInIcon)
|
|
138
|
+
}
|
|
139
|
+
}) : localized;
|
|
140
|
+
};
|
|
141
|
+
return {
|
|
142
|
+
disabled,
|
|
143
|
+
raw,
|
|
144
|
+
maskCover,
|
|
145
|
+
hiddenMask: false === mask || maskConfig?.enabled === false,
|
|
146
|
+
blurMask: maskConfig?.blur,
|
|
147
|
+
config: {
|
|
311
148
|
...rest,
|
|
312
|
-
open:
|
|
149
|
+
open: open ?? visible,
|
|
313
150
|
rootClassName,
|
|
314
151
|
getContainer: container,
|
|
315
152
|
icons,
|
|
316
|
-
motionName:
|
|
317
|
-
maskClosable:
|
|
153
|
+
motionName: 'tao-image-preview-fade',
|
|
154
|
+
maskClosable: maskConfig?.closable ?? true,
|
|
318
155
|
actionsRender
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
$[40] = container;
|
|
322
|
-
$[41] = icons;
|
|
323
|
-
$[42] = rest;
|
|
324
|
-
$[43] = rootClassName;
|
|
325
|
-
$[44] = t15;
|
|
326
|
-
$[45] = t16;
|
|
327
|
-
$[46] = t17;
|
|
328
|
-
} else t17 = $[46];
|
|
329
|
-
let t18;
|
|
330
|
-
if ($[47] !== disabled || $[48] !== maskCover || $[49] !== raw || $[50] !== t13 || $[51] !== t14 || $[52] !== t17) {
|
|
331
|
-
t18 = {
|
|
332
|
-
disabled,
|
|
333
|
-
raw,
|
|
334
|
-
maskCover,
|
|
335
|
-
hiddenMask: t13,
|
|
336
|
-
blurMask: t14,
|
|
337
|
-
config: t17
|
|
338
|
-
};
|
|
339
|
-
$[47] = disabled;
|
|
340
|
-
$[48] = maskCover;
|
|
341
|
-
$[49] = raw;
|
|
342
|
-
$[50] = t13;
|
|
343
|
-
$[51] = t14;
|
|
344
|
-
$[52] = t17;
|
|
345
|
-
$[53] = t18;
|
|
346
|
-
} else t18 = $[53];
|
|
347
|
-
return t18;
|
|
156
|
+
}
|
|
157
|
+
};
|
|
348
158
|
}
|
|
349
|
-
function ImageProgress(
|
|
350
|
-
const
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
}) : props.classNames;
|
|
357
|
-
$[0] = props;
|
|
358
|
-
$[1] = t1;
|
|
359
|
-
} else t1 = $[1];
|
|
360
|
-
const classes = t1;
|
|
361
|
-
let t2;
|
|
362
|
-
if ($[2] !== props) {
|
|
363
|
-
t2 = "function" == typeof props.styles ? props.styles({
|
|
364
|
-
props
|
|
365
|
-
}) : props.styles;
|
|
366
|
-
$[2] = props;
|
|
367
|
-
$[3] = t2;
|
|
368
|
-
} else t2 = $[3];
|
|
369
|
-
const styles = t2;
|
|
159
|
+
function ImageProgress({ props, progress, placeholder }) {
|
|
160
|
+
const classes = 'function' == typeof props.classNames ? props.classNames({
|
|
161
|
+
props
|
|
162
|
+
}) : props.classNames;
|
|
163
|
+
const styles = 'function' == typeof props.styles ? props.styles({
|
|
164
|
+
props
|
|
165
|
+
}) : props.styles;
|
|
370
166
|
const { tokenStyle, locale } = useTaoInternalConfig();
|
|
371
167
|
const cn = classes?.placeholder?.progress;
|
|
372
168
|
const st = styles?.placeholder?.progress;
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
const percent = t4;
|
|
388
|
-
let t5;
|
|
389
|
-
if ($[9] !== locale.numberLocale || $[10] !== percent) {
|
|
390
|
-
t5 = new Intl.NumberFormat(locale.numberLocale ?? "en-US", {
|
|
391
|
-
style: "percent"
|
|
392
|
-
}).format(percent / 100);
|
|
393
|
-
$[9] = locale.numberLocale;
|
|
394
|
-
$[10] = percent;
|
|
395
|
-
$[11] = t5;
|
|
396
|
-
} else t5 = $[11];
|
|
397
|
-
const percentText = t5;
|
|
398
|
-
const t6 = props["aria-labelledby"];
|
|
399
|
-
const t7 = props["aria-describedby"];
|
|
400
|
-
let t8;
|
|
401
|
-
if ($[12] !== hasPercent || $[13] !== locale.messages || $[14] !== percent || $[15] !== percentText || $[16] !== props) {
|
|
402
|
-
t8 = hasPercent ? {
|
|
403
|
-
role: "progressbar",
|
|
404
|
-
"aria-valuemin": 0,
|
|
405
|
-
"aria-valuemax": 100,
|
|
406
|
-
"aria-valuenow": percent,
|
|
407
|
-
"aria-label": props["aria-label"] ?? (props.alt || percentText)
|
|
169
|
+
const hasPercent = 'number' == typeof progress?.percent && Number.isFinite(progress.percent);
|
|
170
|
+
const percent = hasPercent ? Math.max(0, Math.min(100, Math.round(progress.percent))) : 0;
|
|
171
|
+
const percentText = new Intl.NumberFormat(locale.numberLocale ?? 'en-US', {
|
|
172
|
+
style: 'percent'
|
|
173
|
+
}).format(percent / 100);
|
|
174
|
+
const progressAria = {
|
|
175
|
+
'aria-labelledby': props['aria-labelledby'],
|
|
176
|
+
'aria-describedby': props['aria-describedby'],
|
|
177
|
+
...hasPercent ? {
|
|
178
|
+
role: 'progressbar',
|
|
179
|
+
'aria-valuemin': 0,
|
|
180
|
+
'aria-valuemax': 100,
|
|
181
|
+
'aria-valuenow': percent,
|
|
182
|
+
'aria-label': props['aria-label'] ?? (props.alt || percentText)
|
|
408
183
|
} : {
|
|
409
|
-
role:
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
}
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
$[19] = t7;
|
|
429
|
-
$[20] = t8;
|
|
430
|
-
$[21] = t9;
|
|
431
|
-
} else t9 = $[21];
|
|
432
|
-
const progressAria = t9;
|
|
433
|
-
let t10;
|
|
434
|
-
if ($[22] !== cn?.rail || $[23] !== hasPercent || $[24] !== percent || $[25] !== st?.rail) {
|
|
435
|
-
t10 = hasPercent ? /*#__PURE__*/ jsx("div", {
|
|
436
|
-
"data-tao-image-progress-rail": "",
|
|
437
|
-
className: cn?.rail,
|
|
438
|
-
style: st?.rail,
|
|
439
|
-
children: /*#__PURE__*/ jsx("span", {
|
|
440
|
-
style: {
|
|
441
|
-
transform: `scaleX(${percent / 100})`
|
|
442
|
-
}
|
|
443
|
-
})
|
|
444
|
-
}) : null;
|
|
445
|
-
$[22] = cn?.rail;
|
|
446
|
-
$[23] = hasPercent;
|
|
447
|
-
$[24] = percent;
|
|
448
|
-
$[25] = st?.rail;
|
|
449
|
-
$[26] = t10;
|
|
450
|
-
} else t10 = $[26];
|
|
451
|
-
const bar = t10;
|
|
452
|
-
const t11 = classes?.root;
|
|
453
|
-
const t12 = cn?.root;
|
|
454
|
-
let t13;
|
|
455
|
-
if ($[27] !== props.className || $[28] !== props.rootClassName || $[29] !== t11 || $[30] !== t12) {
|
|
456
|
-
t13 = cx(t11, t12, props.rootClassName, props.className);
|
|
457
|
-
$[27] = props.className;
|
|
458
|
-
$[28] = props.rootClassName;
|
|
459
|
-
$[29] = t11;
|
|
460
|
-
$[30] = t12;
|
|
461
|
-
$[31] = t13;
|
|
462
|
-
} else t13 = $[31];
|
|
463
|
-
const t14 = styles?.root;
|
|
464
|
-
const t15 = st?.root;
|
|
465
|
-
let t16;
|
|
466
|
-
if ($[32] !== props.height || $[33] !== props.style || $[34] !== props.width || $[35] !== props.wrapperStyle || $[36] !== t14 || $[37] !== t15 || $[38] !== tokenStyle) {
|
|
467
|
-
t16 = {
|
|
184
|
+
role: 'status',
|
|
185
|
+
'aria-label': props['aria-label'] ?? (props.alt || locale.messages.loading),
|
|
186
|
+
'aria-busy': true
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
const bar = hasPercent ? /*#__PURE__*/ jsx("div", {
|
|
190
|
+
"data-tao-image-progress-rail": "",
|
|
191
|
+
className: cn?.rail,
|
|
192
|
+
style: st?.rail,
|
|
193
|
+
children: /*#__PURE__*/ jsx("span", {
|
|
194
|
+
style: {
|
|
195
|
+
transform: `scaleX(${percent / 100})`
|
|
196
|
+
}
|
|
197
|
+
})
|
|
198
|
+
}) : null;
|
|
199
|
+
return /*#__PURE__*/ jsx("div", {
|
|
200
|
+
"data-tao-image-progress": "",
|
|
201
|
+
className: cx(classes?.root, cn?.root, props.rootClassName, props.className),
|
|
202
|
+
style: {
|
|
468
203
|
...tokenStyle,
|
|
469
204
|
width: props.width,
|
|
470
205
|
height: props.height,
|
|
471
206
|
...props.wrapperStyle,
|
|
472
|
-
...
|
|
207
|
+
...styles?.root,
|
|
473
208
|
...props.style,
|
|
474
|
-
...
|
|
475
|
-
}
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
$[34] = props.width;
|
|
479
|
-
$[35] = props.wrapperStyle;
|
|
480
|
-
$[36] = t14;
|
|
481
|
-
$[37] = t15;
|
|
482
|
-
$[38] = tokenStyle;
|
|
483
|
-
$[39] = t16;
|
|
484
|
-
} else t16 = $[39];
|
|
485
|
-
const t17 = cn?.content;
|
|
486
|
-
const t18 = st?.content;
|
|
487
|
-
let t19;
|
|
488
|
-
if ($[40] !== bar || $[41] !== cn?.indicator || $[42] !== hasPercent || $[43] !== percent || $[44] !== percentText || $[45] !== placeholder || $[46] !== progress || $[47] !== st?.indicator) {
|
|
489
|
-
t19 = placeholder ?? (progress?.render ? progress.render(bar, percent) : /*#__PURE__*/ jsxs(Fragment, {
|
|
490
|
-
children: [
|
|
491
|
-
bar,
|
|
492
|
-
hasPercent && /*#__PURE__*/ jsx("span", {
|
|
493
|
-
className: cn?.indicator,
|
|
494
|
-
style: st?.indicator,
|
|
495
|
-
children: percentText
|
|
496
|
-
})
|
|
497
|
-
]
|
|
498
|
-
}));
|
|
499
|
-
$[40] = bar;
|
|
500
|
-
$[41] = cn?.indicator;
|
|
501
|
-
$[42] = hasPercent;
|
|
502
|
-
$[43] = percent;
|
|
503
|
-
$[44] = percentText;
|
|
504
|
-
$[45] = placeholder;
|
|
505
|
-
$[46] = progress;
|
|
506
|
-
$[47] = st?.indicator;
|
|
507
|
-
$[48] = t19;
|
|
508
|
-
} else t19 = $[48];
|
|
509
|
-
let t20;
|
|
510
|
-
if ($[49] !== t17 || $[50] !== t18 || $[51] !== t19) {
|
|
511
|
-
t20 = /*#__PURE__*/ jsx("div", {
|
|
209
|
+
...st?.root
|
|
210
|
+
},
|
|
211
|
+
...progressAria,
|
|
212
|
+
children: /*#__PURE__*/ jsx("div", {
|
|
512
213
|
"data-tao-image-progress-content": "",
|
|
513
|
-
className:
|
|
514
|
-
style:
|
|
515
|
-
children:
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
style: t16,
|
|
528
|
-
...progressAria,
|
|
529
|
-
children: t20
|
|
530
|
-
});
|
|
531
|
-
$[53] = progressAria;
|
|
532
|
-
$[54] = t13;
|
|
533
|
-
$[55] = t16;
|
|
534
|
-
$[56] = t20;
|
|
535
|
-
$[57] = t21;
|
|
536
|
-
} else t21 = $[57];
|
|
537
|
-
return t21;
|
|
214
|
+
className: cn?.content,
|
|
215
|
+
style: st?.content,
|
|
216
|
+
children: placeholder ?? (progress?.render ? progress.render(bar, percent) : /*#__PURE__*/ jsxs(Fragment, {
|
|
217
|
+
children: [
|
|
218
|
+
bar,
|
|
219
|
+
hasPercent && /*#__PURE__*/ jsx("span", {
|
|
220
|
+
className: cn?.indicator,
|
|
221
|
+
style: st?.indicator,
|
|
222
|
+
children: percentText
|
|
223
|
+
})
|
|
224
|
+
]
|
|
225
|
+
}))
|
|
226
|
+
})
|
|
227
|
+
});
|
|
538
228
|
}
|
|
539
229
|
function ImageBase(props) {
|
|
540
|
-
const $ = c(68);
|
|
541
230
|
const { tokenStyle } = useTaoInternalConfig();
|
|
542
231
|
const [internalOpen, setInternalOpen] = useState(false);
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
$[0] = props;
|
|
553
|
-
$[1] = classNames;
|
|
554
|
-
$[2] = placeholder;
|
|
555
|
-
$[3] = preview;
|
|
556
|
-
$[4] = rest;
|
|
557
|
-
$[5] = styles;
|
|
558
|
-
$[6] = t0;
|
|
559
|
-
$[7] = wrapperStyle;
|
|
560
|
-
} else {
|
|
561
|
-
classNames = $[1];
|
|
562
|
-
placeholder = $[2];
|
|
563
|
-
preview = $[3];
|
|
564
|
-
rest = $[4];
|
|
565
|
-
styles = $[5];
|
|
566
|
-
t0 = $[6];
|
|
567
|
-
wrapperStyle = $[7];
|
|
568
|
-
}
|
|
569
|
-
const prefixCls = void 0 === t0 ? "tao-image" : t0;
|
|
570
|
-
let t1;
|
|
571
|
-
if ($[8] !== classNames || $[9] !== props) {
|
|
572
|
-
t1 = "function" == typeof classNames ? classNames({
|
|
573
|
-
props
|
|
574
|
-
}) : classNames;
|
|
575
|
-
$[8] = classNames;
|
|
576
|
-
$[9] = props;
|
|
577
|
-
$[10] = t1;
|
|
578
|
-
} else t1 = $[10];
|
|
579
|
-
const classes = t1;
|
|
580
|
-
let t2;
|
|
581
|
-
if ($[11] !== props || $[12] !== styles) {
|
|
582
|
-
t2 = "function" == typeof styles ? styles({
|
|
583
|
-
props
|
|
584
|
-
}) : styles;
|
|
585
|
-
$[11] = props;
|
|
586
|
-
$[12] = styles;
|
|
587
|
-
$[13] = t2;
|
|
588
|
-
} else t2 = $[13];
|
|
589
|
-
const css = t2;
|
|
590
|
-
let t3;
|
|
591
|
-
if ($[14] !== preview) {
|
|
592
|
-
t3 = "object" == typeof preview ? preview : {};
|
|
593
|
-
$[14] = preview;
|
|
594
|
-
$[15] = t3;
|
|
595
|
-
} else t3 = $[15];
|
|
596
|
-
const raw = t3;
|
|
597
|
-
const isProgressConfig = null !== placeholder && "object" == typeof placeholder && !/*#__PURE__*/ isValidElement(placeholder) && "progress" in placeholder;
|
|
232
|
+
const { preview, wrapperStyle, classNames, styles, placeholder, prefixCls = 'tao-image', ...rest } = props;
|
|
233
|
+
const classes = 'function' == typeof classNames ? classNames({
|
|
234
|
+
props
|
|
235
|
+
}) : classNames;
|
|
236
|
+
const css = 'function' == typeof styles ? styles({
|
|
237
|
+
props
|
|
238
|
+
}) : styles;
|
|
239
|
+
const raw = 'object' == typeof preview ? preview : {};
|
|
240
|
+
const isProgressConfig = null !== placeholder && 'object' == typeof placeholder && !/*#__PURE__*/ isValidElement(placeholder) && 'progress' in placeholder;
|
|
598
241
|
const progress = isProgressConfig ? placeholder.progress : void 0;
|
|
599
242
|
const showPlaceholder = !!progress || !props.src && (!!placeholder || 0 === placeholder) && !isProgressConfig;
|
|
600
243
|
const { disabled, config, hiddenMask, blurMask, maskCover } = usePreviewOptions(showPlaceholder ? false : preview, internalOpen);
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
const t9 = css?.root;
|
|
661
|
-
let t10;
|
|
662
|
-
if ($[32] !== t9 || $[33] !== tokenStyle || $[34] !== wrapperStyle) {
|
|
663
|
-
t10 = {
|
|
664
|
-
...tokenStyle,
|
|
665
|
-
...wrapperStyle,
|
|
666
|
-
...t9
|
|
667
|
-
};
|
|
668
|
-
$[32] = t9;
|
|
669
|
-
$[33] = tokenStyle;
|
|
670
|
-
$[34] = wrapperStyle;
|
|
671
|
-
$[35] = t10;
|
|
672
|
-
} else t10 = $[35];
|
|
673
|
-
const t11 = css?.popup;
|
|
674
|
-
const t12 = css?.popup?.root;
|
|
675
|
-
let t13;
|
|
676
|
-
if ($[36] !== t12 || $[37] !== tokenStyle) {
|
|
677
|
-
t13 = {
|
|
678
|
-
...tokenStyle,
|
|
679
|
-
...t12
|
|
680
|
-
};
|
|
681
|
-
$[36] = t12;
|
|
682
|
-
$[37] = tokenStyle;
|
|
683
|
-
$[38] = t13;
|
|
684
|
-
} else t13 = $[38];
|
|
685
|
-
let t14;
|
|
686
|
-
if ($[39] !== hiddenMask) {
|
|
687
|
-
t14 = hiddenMask ? {
|
|
688
|
-
background: "transparent"
|
|
689
|
-
} : {};
|
|
690
|
-
$[39] = hiddenMask;
|
|
691
|
-
$[40] = t14;
|
|
692
|
-
} else t14 = $[40];
|
|
693
|
-
let t15;
|
|
694
|
-
if ($[41] !== blurMask) {
|
|
695
|
-
t15 = blurMask ? {
|
|
696
|
-
backdropFilter: "blur(4px)"
|
|
697
|
-
} : {};
|
|
698
|
-
$[41] = blurMask;
|
|
699
|
-
$[42] = t15;
|
|
700
|
-
} else t15 = $[42];
|
|
701
|
-
const t16 = css?.popup?.mask;
|
|
702
|
-
let t17;
|
|
703
|
-
if ($[43] !== t14 || $[44] !== t15 || $[45] !== t16) {
|
|
704
|
-
t17 = {
|
|
705
|
-
...t14,
|
|
706
|
-
...t15,
|
|
707
|
-
...t16
|
|
708
|
-
};
|
|
709
|
-
$[43] = t14;
|
|
710
|
-
$[44] = t15;
|
|
711
|
-
$[45] = t16;
|
|
712
|
-
$[46] = t17;
|
|
713
|
-
} else t17 = $[46];
|
|
714
|
-
let t18;
|
|
715
|
-
if ($[47] !== t11 || $[48] !== t13 || $[49] !== t17) {
|
|
716
|
-
t18 = {
|
|
717
|
-
...t11,
|
|
718
|
-
root: t13,
|
|
719
|
-
mask: t17
|
|
720
|
-
};
|
|
721
|
-
$[47] = t11;
|
|
722
|
-
$[48] = t13;
|
|
723
|
-
$[49] = t17;
|
|
724
|
-
$[50] = t18;
|
|
725
|
-
} else t18 = $[50];
|
|
726
|
-
let t19;
|
|
727
|
-
if ($[51] !== css || $[52] !== t10 || $[53] !== t18) {
|
|
728
|
-
t19 = {
|
|
729
|
-
...css,
|
|
730
|
-
root: t10,
|
|
731
|
-
popup: t18
|
|
732
|
-
};
|
|
733
|
-
$[51] = css;
|
|
734
|
-
$[52] = t10;
|
|
735
|
-
$[53] = t18;
|
|
736
|
-
$[54] = t19;
|
|
737
|
-
} else t19 = $[54];
|
|
738
|
-
const t20 = isProgressConfig ? void 0 : placeholder;
|
|
739
|
-
let t21;
|
|
740
|
-
if ($[55] !== config || $[56] !== disabled || $[57] !== internalOpen || $[58] !== maskCover || $[59] !== raw) {
|
|
741
|
-
t21 = disabled ? false : {
|
|
742
|
-
...config,
|
|
743
|
-
open: config.open ?? internalOpen,
|
|
744
|
-
cover: raw.cover ?? maskCover ?? /*#__PURE__*/ jsx("span", {
|
|
745
|
-
"aria-hidden": "true",
|
|
746
|
-
children: "⌕"
|
|
747
|
-
}),
|
|
748
|
-
onOpenChange: (open)=>{
|
|
749
|
-
if (void 0 === config.open) setInternalOpen(open);
|
|
750
|
-
if (raw.onOpenChange) raw.onOpenChange(open);
|
|
751
|
-
else raw.onVisibleChange?.(open, !open);
|
|
244
|
+
useEffect(()=>{
|
|
245
|
+
if (disabled || void 0 !== config.open) setInternalOpen(false);
|
|
246
|
+
}, [
|
|
247
|
+
disabled,
|
|
248
|
+
config.open
|
|
249
|
+
]);
|
|
250
|
+
if (showPlaceholder) return /*#__PURE__*/ jsx(ImageProgress, {
|
|
251
|
+
props: props,
|
|
252
|
+
progress: true === progress ? {} : progress || void 0,
|
|
253
|
+
placeholder: isProgressConfig ? void 0 : placeholder
|
|
254
|
+
});
|
|
255
|
+
return /*#__PURE__*/ jsx("span", {
|
|
256
|
+
"data-tao-image-inline": "",
|
|
257
|
+
children: /*#__PURE__*/ jsx(RcImageComponent, {
|
|
258
|
+
...rest,
|
|
259
|
+
"data-tao-image": "",
|
|
260
|
+
prefixCls: prefixCls,
|
|
261
|
+
previewPrefixCls: "tao-image-preview",
|
|
262
|
+
classNames: {
|
|
263
|
+
...classes,
|
|
264
|
+
cover: cx(classes?.cover, raw.maskClassName)
|
|
265
|
+
},
|
|
266
|
+
styles: {
|
|
267
|
+
...css,
|
|
268
|
+
root: {
|
|
269
|
+
...tokenStyle,
|
|
270
|
+
...wrapperStyle,
|
|
271
|
+
...css?.root
|
|
272
|
+
},
|
|
273
|
+
popup: {
|
|
274
|
+
...css?.popup,
|
|
275
|
+
root: {
|
|
276
|
+
...tokenStyle,
|
|
277
|
+
...css?.popup?.root
|
|
278
|
+
},
|
|
279
|
+
mask: {
|
|
280
|
+
...hiddenMask ? {
|
|
281
|
+
background: 'transparent'
|
|
282
|
+
} : {},
|
|
283
|
+
...blurMask ? {
|
|
284
|
+
backdropFilter: 'blur(4px)'
|
|
285
|
+
} : {},
|
|
286
|
+
...css?.popup?.mask
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
},
|
|
290
|
+
placeholder: isProgressConfig ? void 0 : placeholder,
|
|
291
|
+
preview: disabled ? false : {
|
|
292
|
+
...config,
|
|
293
|
+
open: config.open ?? internalOpen,
|
|
294
|
+
cover: raw.cover ?? maskCover ?? /*#__PURE__*/ jsx("span", {
|
|
295
|
+
"aria-hidden": "true",
|
|
296
|
+
children: "⌕"
|
|
297
|
+
}),
|
|
298
|
+
onOpenChange: (open)=>{
|
|
299
|
+
if (void 0 === config.open) setInternalOpen(open);
|
|
300
|
+
if (raw.onOpenChange) raw.onOpenChange(open);
|
|
301
|
+
else raw.onVisibleChange?.(open, !open);
|
|
302
|
+
}
|
|
752
303
|
}
|
|
753
|
-
}
|
|
754
|
-
|
|
755
|
-
$[56] = disabled;
|
|
756
|
-
$[57] = internalOpen;
|
|
757
|
-
$[58] = maskCover;
|
|
758
|
-
$[59] = raw;
|
|
759
|
-
$[60] = t21;
|
|
760
|
-
} else t21 = $[60];
|
|
761
|
-
let t22;
|
|
762
|
-
if ($[61] !== prefixCls || $[62] !== rest || $[63] !== t19 || $[64] !== t20 || $[65] !== t21 || $[66] !== t8) {
|
|
763
|
-
t22 = /*#__PURE__*/ jsx("span", {
|
|
764
|
-
"data-tao-image-inline": "",
|
|
765
|
-
children: /*#__PURE__*/ jsx(RcImageComponent, {
|
|
766
|
-
...rest,
|
|
767
|
-
"data-tao-image": "",
|
|
768
|
-
prefixCls: prefixCls,
|
|
769
|
-
previewPrefixCls: "tao-image-preview",
|
|
770
|
-
classNames: t8,
|
|
771
|
-
styles: t19,
|
|
772
|
-
placeholder: t20,
|
|
773
|
-
preview: t21
|
|
774
|
-
})
|
|
775
|
-
});
|
|
776
|
-
$[61] = prefixCls;
|
|
777
|
-
$[62] = rest;
|
|
778
|
-
$[63] = t19;
|
|
779
|
-
$[64] = t20;
|
|
780
|
-
$[65] = t21;
|
|
781
|
-
$[66] = t8;
|
|
782
|
-
$[67] = t22;
|
|
783
|
-
} else t22 = $[67];
|
|
784
|
-
return t22;
|
|
304
|
+
})
|
|
305
|
+
});
|
|
785
306
|
}
|
|
786
307
|
function ImagePreviewGroup(props) {
|
|
787
|
-
const $ = c(53);
|
|
788
308
|
const { tokenStyle } = useTaoInternalConfig();
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
$[0] = props;
|
|
797
|
-
$[1] = children;
|
|
798
|
-
$[2] = classNames;
|
|
799
|
-
$[3] = preview;
|
|
800
|
-
$[4] = rest;
|
|
801
|
-
$[5] = styles;
|
|
802
|
-
} else {
|
|
803
|
-
children = $[1];
|
|
804
|
-
classNames = $[2];
|
|
805
|
-
preview = $[3];
|
|
806
|
-
rest = $[4];
|
|
807
|
-
styles = $[5];
|
|
808
|
-
}
|
|
809
|
-
let t0;
|
|
810
|
-
if ($[6] !== classNames || $[7] !== props) {
|
|
811
|
-
t0 = "function" == typeof classNames ? classNames({
|
|
812
|
-
props: props
|
|
813
|
-
}) : classNames;
|
|
814
|
-
$[6] = classNames;
|
|
815
|
-
$[7] = props;
|
|
816
|
-
$[8] = t0;
|
|
817
|
-
} else t0 = $[8];
|
|
818
|
-
const classes = t0;
|
|
819
|
-
let t1;
|
|
820
|
-
if ($[9] !== props || $[10] !== styles) {
|
|
821
|
-
t1 = "function" == typeof styles ? styles({
|
|
822
|
-
props: props
|
|
823
|
-
}) : styles;
|
|
824
|
-
$[9] = props;
|
|
825
|
-
$[10] = styles;
|
|
826
|
-
$[11] = t1;
|
|
827
|
-
} else t1 = $[11];
|
|
828
|
-
const css = t1;
|
|
309
|
+
const { preview, classNames, styles, children, ...rest } = props;
|
|
310
|
+
const classes = 'function' == typeof classNames ? classNames({
|
|
311
|
+
props: props
|
|
312
|
+
}) : classNames;
|
|
313
|
+
const css = 'function' == typeof styles ? styles({
|
|
314
|
+
props: props
|
|
315
|
+
}) : styles;
|
|
829
316
|
const [internalOpen, setInternalOpen] = useState(false);
|
|
830
317
|
const { disabled, config, hiddenMask, blurMask } = usePreviewOptions(preview, internalOpen);
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
} else t8 = $[22];
|
|
877
|
-
let t9;
|
|
878
|
-
if ($[23] !== blurMask) {
|
|
879
|
-
t9 = blurMask ? {
|
|
880
|
-
backdropFilter: "blur(4px)"
|
|
881
|
-
} : {};
|
|
882
|
-
$[23] = blurMask;
|
|
883
|
-
$[24] = t9;
|
|
884
|
-
} else t9 = $[24];
|
|
885
|
-
const t10 = css?.popup?.mask;
|
|
886
|
-
let t11;
|
|
887
|
-
if ($[25] !== t10 || $[26] !== t8 || $[27] !== t9) {
|
|
888
|
-
t11 = {
|
|
889
|
-
...t8,
|
|
890
|
-
...t9,
|
|
891
|
-
...t10
|
|
892
|
-
};
|
|
893
|
-
$[25] = t10;
|
|
894
|
-
$[26] = t8;
|
|
895
|
-
$[27] = t9;
|
|
896
|
-
$[28] = t11;
|
|
897
|
-
} else t11 = $[28];
|
|
898
|
-
let t12;
|
|
899
|
-
if ($[29] !== t11 || $[30] !== t5 || $[31] !== t7) {
|
|
900
|
-
t12 = {
|
|
901
|
-
...t5,
|
|
902
|
-
root: t7,
|
|
903
|
-
mask: t11
|
|
904
|
-
};
|
|
905
|
-
$[29] = t11;
|
|
906
|
-
$[30] = t5;
|
|
907
|
-
$[31] = t7;
|
|
908
|
-
$[32] = t12;
|
|
909
|
-
} else t12 = $[32];
|
|
910
|
-
let t13;
|
|
911
|
-
if ($[33] !== css || $[34] !== t12) {
|
|
912
|
-
t13 = {
|
|
913
|
-
...css,
|
|
914
|
-
popup: t12
|
|
915
|
-
};
|
|
916
|
-
$[33] = css;
|
|
917
|
-
$[34] = t12;
|
|
918
|
-
$[35] = t13;
|
|
919
|
-
} else t13 = $[35];
|
|
920
|
-
const t14 = !disabled && (config.open ?? internalOpen);
|
|
921
|
-
const t15 = disabled ? "" : config.motionName;
|
|
922
|
-
let t16;
|
|
923
|
-
if ($[36] !== config.open || $[37] !== raw) {
|
|
924
|
-
t16 = (open, info)=>{
|
|
925
|
-
if (void 0 === config.open) setInternalOpen(open);
|
|
926
|
-
if (raw.onOpenChange) raw.onOpenChange(open, info);
|
|
927
|
-
else raw.onVisibleChange?.(open, !open, info.current);
|
|
928
|
-
};
|
|
929
|
-
$[36] = config.open;
|
|
930
|
-
$[37] = raw;
|
|
931
|
-
$[38] = t16;
|
|
932
|
-
} else t16 = $[38];
|
|
933
|
-
let t17;
|
|
934
|
-
if ($[39] !== config || $[40] !== t14 || $[41] !== t15 || $[42] !== t16) {
|
|
935
|
-
t17 = {
|
|
936
|
-
...config,
|
|
937
|
-
open: t14,
|
|
938
|
-
motionName: t15,
|
|
939
|
-
onOpenChange: t16
|
|
940
|
-
};
|
|
941
|
-
$[39] = config;
|
|
942
|
-
$[40] = t14;
|
|
943
|
-
$[41] = t15;
|
|
944
|
-
$[42] = t16;
|
|
945
|
-
$[43] = t17;
|
|
946
|
-
} else t17 = $[43];
|
|
947
|
-
const t18 = t17;
|
|
948
|
-
let t19;
|
|
949
|
-
if ($[44] !== children || $[45] !== disabled) {
|
|
950
|
-
t19 = /*#__PURE__*/ jsx(PreviewDisabledContext.Provider, {
|
|
951
|
-
value: disabled,
|
|
952
|
-
children: children
|
|
953
|
-
});
|
|
954
|
-
$[44] = children;
|
|
955
|
-
$[45] = disabled;
|
|
956
|
-
$[46] = t19;
|
|
957
|
-
} else t19 = $[46];
|
|
958
|
-
let t20;
|
|
959
|
-
if ($[47] !== classes || $[48] !== rest || $[49] !== t13 || $[50] !== t18 || $[51] !== t19) {
|
|
960
|
-
t20 = /*#__PURE__*/ jsx("span", {
|
|
961
|
-
"data-tao-image-group": "",
|
|
962
|
-
children: /*#__PURE__*/ jsx(RcImageComponent.PreviewGroup, {
|
|
963
|
-
...rest,
|
|
964
|
-
previewPrefixCls: "tao-image-preview",
|
|
965
|
-
classNames: classes,
|
|
966
|
-
styles: t13,
|
|
967
|
-
preview: t18,
|
|
968
|
-
children: t19
|
|
318
|
+
const raw = 'object' == typeof preview ? preview : {};
|
|
319
|
+
useEffect(()=>{
|
|
320
|
+
if (disabled || void 0 !== config.open) setInternalOpen(false);
|
|
321
|
+
}, [
|
|
322
|
+
disabled,
|
|
323
|
+
config.open
|
|
324
|
+
]);
|
|
325
|
+
return /*#__PURE__*/ jsx("span", {
|
|
326
|
+
"data-tao-image-group": "",
|
|
327
|
+
children: /*#__PURE__*/ jsx(RcImageComponent.PreviewGroup, {
|
|
328
|
+
...rest,
|
|
329
|
+
previewPrefixCls: "tao-image-preview",
|
|
330
|
+
classNames: classes,
|
|
331
|
+
styles: {
|
|
332
|
+
...css,
|
|
333
|
+
popup: {
|
|
334
|
+
...css?.popup,
|
|
335
|
+
root: {
|
|
336
|
+
...tokenStyle,
|
|
337
|
+
...css?.popup?.root
|
|
338
|
+
},
|
|
339
|
+
mask: {
|
|
340
|
+
...hiddenMask ? {
|
|
341
|
+
background: 'transparent'
|
|
342
|
+
} : {},
|
|
343
|
+
...blurMask ? {
|
|
344
|
+
backdropFilter: 'blur(4px)'
|
|
345
|
+
} : {},
|
|
346
|
+
...css?.popup?.mask
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
},
|
|
350
|
+
preview: {
|
|
351
|
+
...config,
|
|
352
|
+
open: !disabled && (config.open ?? internalOpen),
|
|
353
|
+
motionName: disabled ? '' : config.motionName,
|
|
354
|
+
onOpenChange: (open, info)=>{
|
|
355
|
+
if (void 0 === config.open) setInternalOpen(open);
|
|
356
|
+
if (raw.onOpenChange) raw.onOpenChange(open, info);
|
|
357
|
+
else raw.onVisibleChange?.(open, !open, info.current);
|
|
358
|
+
}
|
|
359
|
+
},
|
|
360
|
+
children: /*#__PURE__*/ jsx(PreviewDisabledContext.Provider, {
|
|
361
|
+
value: disabled,
|
|
362
|
+
children: children
|
|
969
363
|
})
|
|
970
|
-
})
|
|
971
|
-
|
|
972
|
-
$[48] = rest;
|
|
973
|
-
$[49] = t13;
|
|
974
|
-
$[50] = t18;
|
|
975
|
-
$[51] = t19;
|
|
976
|
-
$[52] = t20;
|
|
977
|
-
} else t20 = $[52];
|
|
978
|
-
return t20;
|
|
364
|
+
})
|
|
365
|
+
});
|
|
979
366
|
}
|
|
980
367
|
const Image = Object.assign(ImageBase, {
|
|
981
368
|
PreviewGroup: ImagePreviewGroup
|