@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,8 +1,8 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { c } from "react-compiler-runtime";
|
|
3
2
|
import color_picker, { Color } from "@rc-component/color-picker";
|
|
4
3
|
import { cloneElement, createContext, forwardRef, isValidElement, useContext, useEffect, useId, useLayoutEffect, useRef, useState } from "react";
|
|
5
|
-
import {
|
|
4
|
+
import { useTaoConfig } from "../../provider/tao-context.js";
|
|
5
|
+
import { TaoPortalScope } from "../../provider/tao-provider.js";
|
|
6
6
|
import { asTriggerChild } from "../../utils/overlay.js";
|
|
7
7
|
import { cx } from "../../utils/semantic.js";
|
|
8
8
|
import { Button } from "../button/button.js";
|
|
@@ -27,238 +27,71 @@ function colorKeys() {
|
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
29
|
function PickerPanel() {
|
|
30
|
-
const $ = c(29);
|
|
31
30
|
const fieldId = useId();
|
|
32
|
-
const { locale:
|
|
33
|
-
const { messages } = t0;
|
|
31
|
+
const { locale: { messages } } = useTaoConfig();
|
|
34
32
|
const keyForColor = colorKeys();
|
|
35
33
|
const panel = useContext(PanelContext);
|
|
36
34
|
const { value, active, props, mode, modes, setMode, format, setFormat } = panel;
|
|
37
|
-
const stops = value.getColors();
|
|
38
|
-
const
|
|
39
|
-
const selected = "gradient" === mode ? stops[activeIndex].color : value;
|
|
35
|
+
const stops = value.getColors(), activeIndex = Math.min(active, stops.length - 1);
|
|
36
|
+
const selected = 'gradient' === mode ? stops[activeIndex].color : value;
|
|
40
37
|
const hex = selected.toHexString();
|
|
41
38
|
const [draft, setDraft] = useState(hex);
|
|
42
39
|
const pendingStopColor = useRef(null);
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
];
|
|
48
|
-
$[0] = hex;
|
|
49
|
-
$[1] = t1;
|
|
50
|
-
} else t1 = $[1];
|
|
51
|
-
useEffect(()=>setDraft(hex), t1);
|
|
52
|
-
const replace = (next)=>"gradient" === mode ? new external_color_js_Color(stops.map((stop, index)=>({
|
|
40
|
+
useEffect(()=>setDraft(hex), [
|
|
41
|
+
hex
|
|
42
|
+
]);
|
|
43
|
+
const replace = (next)=>'gradient' === mode ? new external_color_js_Color(stops.map((stop, index)=>({
|
|
53
44
|
...stop,
|
|
54
45
|
color: index === activeIndex ? next : stop.color
|
|
55
46
|
}))) : next;
|
|
56
|
-
const changeSelected = (
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
let t3;
|
|
61
|
-
if ($[2] !== fieldId) {
|
|
62
|
-
t3 = (channel, label, number, max, change, t4)=>{
|
|
63
|
-
const step = void 0 === t4 ? 1 : t4;
|
|
64
|
-
return /*#__PURE__*/ jsxs("label", {
|
|
65
|
-
"data-tao-color-field": "",
|
|
66
|
-
htmlFor: `${fieldId}-${channel}`,
|
|
67
|
-
children: [
|
|
68
|
-
/*#__PURE__*/ jsx("span", {
|
|
69
|
-
children: label
|
|
70
|
-
}),
|
|
71
|
-
/*#__PURE__*/ jsx(BaseInput, {
|
|
72
|
-
id: `${fieldId}-${channel}`,
|
|
73
|
-
size: "small",
|
|
74
|
-
disabled: false,
|
|
75
|
-
type: "number",
|
|
76
|
-
"aria-label": label,
|
|
77
|
-
min: 0,
|
|
78
|
-
max: max,
|
|
79
|
-
step: step,
|
|
80
|
-
value: number,
|
|
81
|
-
onChange: (event)=>{
|
|
82
|
-
const parsed = Number(event.target.value);
|
|
83
|
-
if ("" !== event.target.value && Number.isFinite(parsed)) change(clamp(parsed, max));
|
|
84
|
-
}
|
|
85
|
-
})
|
|
86
|
-
]
|
|
87
|
-
});
|
|
88
|
-
};
|
|
89
|
-
$[2] = fieldId;
|
|
90
|
-
$[3] = t3;
|
|
91
|
-
} else t3 = $[3];
|
|
92
|
-
const numberInput = t3;
|
|
93
|
-
const rgb = selected.toRgb();
|
|
94
|
-
const hsb = selected.toHsb();
|
|
95
|
-
const prefix = props.prefixCls ?? "tao-color-engine";
|
|
96
|
-
let t4;
|
|
97
|
-
if ($[4] !== messages.colorGradient || $[5] !== messages.colorMode || $[6] !== messages.colorSingle || $[7] !== mode || $[8] !== modes.length || $[9] !== setMode) {
|
|
98
|
-
t4 = modes.length > 1 && /*#__PURE__*/ jsx(Segmented, {
|
|
99
|
-
"aria-label": messages.colorMode,
|
|
100
|
-
size: "small",
|
|
101
|
-
disabled: false,
|
|
102
|
-
value: mode,
|
|
103
|
-
onChange: setMode,
|
|
104
|
-
options: [
|
|
105
|
-
{
|
|
106
|
-
value: "single",
|
|
107
|
-
label: messages.colorSingle
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
value: "gradient",
|
|
111
|
-
label: messages.colorGradient
|
|
112
|
-
}
|
|
113
|
-
]
|
|
114
|
-
});
|
|
115
|
-
$[4] = messages.colorGradient;
|
|
116
|
-
$[5] = messages.colorMode;
|
|
117
|
-
$[6] = messages.colorSingle;
|
|
118
|
-
$[7] = mode;
|
|
119
|
-
$[8] = modes.length;
|
|
120
|
-
$[9] = setMode;
|
|
121
|
-
$[10] = t4;
|
|
122
|
-
} else t4 = $[10];
|
|
123
|
-
const t5 = "";
|
|
124
|
-
const t6 = messages.colorFormat;
|
|
125
|
-
const t7 = messages.colorFormat;
|
|
126
|
-
let t8;
|
|
127
|
-
let t9;
|
|
128
|
-
if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
|
|
129
|
-
t8 = {
|
|
130
|
-
width: "5.5em",
|
|
131
|
-
flexShrink: 0
|
|
132
|
-
};
|
|
133
|
-
t9 = {
|
|
134
|
-
popup: {
|
|
135
|
-
zIndex: "calc(var(--tao-z-index-popup) + 10)"
|
|
136
|
-
}
|
|
137
|
-
};
|
|
138
|
-
$[11] = t8;
|
|
139
|
-
$[12] = t9;
|
|
140
|
-
} else {
|
|
141
|
-
t8 = $[11];
|
|
142
|
-
t9 = $[12];
|
|
143
|
-
}
|
|
144
|
-
const t10 = props.disabledFormat ?? false;
|
|
145
|
-
let t11;
|
|
146
|
-
if ($[13] !== setFormat) {
|
|
147
|
-
t11 = (next_5)=>setFormat(next_5);
|
|
148
|
-
$[13] = setFormat;
|
|
149
|
-
$[14] = t11;
|
|
150
|
-
} else t11 = $[14];
|
|
151
|
-
let t12;
|
|
152
|
-
if ($[15] === Symbol.for("react.memo_cache_sentinel")) {
|
|
153
|
-
t12 = [
|
|
154
|
-
"hex",
|
|
155
|
-
"rgb",
|
|
156
|
-
"hsb"
|
|
157
|
-
].map(_temp3);
|
|
158
|
-
$[15] = t12;
|
|
159
|
-
} else t12 = $[15];
|
|
160
|
-
let t13;
|
|
161
|
-
if ($[16] !== format || $[17] !== messages.colorFormat || $[18] !== t10 || $[19] !== t11) {
|
|
162
|
-
t13 = /*#__PURE__*/ jsx(Select, {
|
|
163
|
-
"aria-label": t6,
|
|
164
|
-
mobileTitle: t7,
|
|
165
|
-
size: "small",
|
|
166
|
-
style: t8,
|
|
167
|
-
styles: t9,
|
|
168
|
-
value: format,
|
|
169
|
-
disabled: t10,
|
|
170
|
-
onChange: t11,
|
|
171
|
-
options: t12
|
|
172
|
-
});
|
|
173
|
-
$[16] = format;
|
|
174
|
-
$[17] = messages.colorFormat;
|
|
175
|
-
$[18] = t10;
|
|
176
|
-
$[19] = t11;
|
|
177
|
-
$[20] = t13;
|
|
178
|
-
} else t13 = $[20];
|
|
179
|
-
const t14 = "hex" === format ? /*#__PURE__*/ jsx(BaseInput, {
|
|
180
|
-
size: "small",
|
|
181
|
-
disabled: false,
|
|
182
|
-
"aria-label": messages.colorHex,
|
|
183
|
-
value: draft,
|
|
184
|
-
"aria-invalid": !/^#?(?:[\da-f]{3}|[\da-f]{4}|[\da-f]{6}|[\da-f]{8})$/i.test(draft),
|
|
185
|
-
onChange: (event_0)=>{
|
|
186
|
-
setDraft(event_0.target.value);
|
|
187
|
-
if (/^#?(?:[\da-f]{6}|[\da-f]{8})$/i.test(event_0.target.value)) changeSelected(new external_color_js_Color(`#${event_0.target.value.replace(/^#/, "")}`));
|
|
188
|
-
},
|
|
189
|
-
onBlur: (event_1)=>{
|
|
190
|
-
if (/^#?(?:[\da-f]{3}|[\da-f]{4})$/i.test(event_1.target.value)) changeSelected(new external_color_js_Color(`#${event_1.target.value.replace(/^#/, "")}`));
|
|
191
|
-
}
|
|
192
|
-
}) : "rgb" === format ? /*#__PURE__*/ jsxs(Fragment, {
|
|
193
|
-
children: [
|
|
194
|
-
numberInput("red", messages.colorRed, rgb.r, 255, (r)=>changeSelected(new external_color_js_Color({
|
|
195
|
-
...rgb,
|
|
196
|
-
r
|
|
197
|
-
}))),
|
|
198
|
-
numberInput("green", messages.colorGreen, rgb.g, 255, (g)=>changeSelected(new external_color_js_Color({
|
|
199
|
-
...rgb,
|
|
200
|
-
g
|
|
201
|
-
}))),
|
|
202
|
-
numberInput("blue", messages.colorBlue, rgb.b, 255, (b_1)=>changeSelected(new external_color_js_Color({
|
|
203
|
-
...rgb,
|
|
204
|
-
b: b_1
|
|
205
|
-
})))
|
|
206
|
-
]
|
|
207
|
-
}) : /*#__PURE__*/ jsxs(Fragment, {
|
|
208
|
-
children: [
|
|
209
|
-
numberInput("hue", messages.colorHue, Math.round(hsb.h), 360, (h)=>changeSelected(new external_color_js_Color({
|
|
210
|
-
...hsb,
|
|
211
|
-
h
|
|
212
|
-
}))),
|
|
213
|
-
numberInput("saturation", messages.colorSaturation, Math.round(100 * hsb.s), 100, (s)=>changeSelected(new external_color_js_Color({
|
|
214
|
-
...hsb,
|
|
215
|
-
s: s / 100
|
|
216
|
-
}))),
|
|
217
|
-
numberInput("brightness", messages.colorBrightness, Math.round(100 * hsb.b), 100, (b_2)=>changeSelected(new external_color_js_Color({
|
|
218
|
-
...hsb,
|
|
219
|
-
b: b_2 / 100
|
|
220
|
-
})))
|
|
221
|
-
]
|
|
222
|
-
});
|
|
223
|
-
const t15 = !props.disabledAlpha && numberInput("alpha", messages.colorAlpha, Math.round(100 * rgb.a), 100, (alpha)=>changeSelected(new external_color_js_Color({
|
|
224
|
-
...hsb,
|
|
225
|
-
a: alpha / 100
|
|
226
|
-
})));
|
|
227
|
-
let t16;
|
|
228
|
-
if ($[21] !== t13 || $[22] !== t14 || $[23] !== t15) {
|
|
229
|
-
t16 = /*#__PURE__*/ jsxs("div", {
|
|
230
|
-
"data-tao-color-inputs": t5,
|
|
47
|
+
const changeSelected = (next, complete = true)=>panel.change(replace(next), complete);
|
|
48
|
+
const numberInput = (channel, label, number, max, change, step = 1)=>/*#__PURE__*/ jsxs("label", {
|
|
49
|
+
"data-tao-color-field": "",
|
|
50
|
+
htmlFor: `${fieldId}-${channel}`,
|
|
231
51
|
children: [
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
52
|
+
/*#__PURE__*/ jsx("span", {
|
|
53
|
+
children: label
|
|
54
|
+
}),
|
|
55
|
+
/*#__PURE__*/ jsx(BaseInput, {
|
|
56
|
+
id: `${fieldId}-${channel}`,
|
|
57
|
+
size: "small",
|
|
58
|
+
disabled: false,
|
|
59
|
+
type: "number",
|
|
60
|
+
"aria-label": label,
|
|
61
|
+
min: 0,
|
|
62
|
+
max: max,
|
|
63
|
+
step: step,
|
|
64
|
+
value: number,
|
|
65
|
+
onChange: (event)=>{
|
|
66
|
+
const parsed = Number(event.target.value);
|
|
67
|
+
if ('' !== event.target.value && Number.isFinite(parsed)) change(clamp(parsed, max));
|
|
68
|
+
}
|
|
69
|
+
})
|
|
235
70
|
]
|
|
236
71
|
});
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
$[23] = t15;
|
|
240
|
-
$[24] = t16;
|
|
241
|
-
} else t16 = $[24];
|
|
242
|
-
let t17;
|
|
243
|
-
if ($[25] !== messages.clearColor || $[26] !== panel.clear || $[27] !== props.allowClear) {
|
|
244
|
-
t17 = props.allowClear && /*#__PURE__*/ jsx(Button, {
|
|
245
|
-
variant: "ghost",
|
|
246
|
-
size: "small",
|
|
247
|
-
disabled: false,
|
|
248
|
-
"data-tao-color-clear": "",
|
|
249
|
-
onClick: panel.clear,
|
|
250
|
-
children: messages.clearColor
|
|
251
|
-
});
|
|
252
|
-
$[25] = messages.clearColor;
|
|
253
|
-
$[26] = panel.clear;
|
|
254
|
-
$[27] = props.allowClear;
|
|
255
|
-
$[28] = t17;
|
|
256
|
-
} else t17 = $[28];
|
|
72
|
+
const rgb = selected.toRgb(), hsb = selected.toHsb();
|
|
73
|
+
const prefix = props.prefixCls ?? 'tao-color-engine';
|
|
257
74
|
return /*#__PURE__*/ jsxs("div", {
|
|
258
75
|
"data-tao-color-picker-controls": "",
|
|
259
76
|
children: [
|
|
260
|
-
|
|
261
|
-
|
|
77
|
+
modes.length > 1 && /*#__PURE__*/ jsx(Segmented, {
|
|
78
|
+
"aria-label": messages.colorMode,
|
|
79
|
+
size: "small",
|
|
80
|
+
disabled: false,
|
|
81
|
+
value: mode,
|
|
82
|
+
onChange: setMode,
|
|
83
|
+
options: [
|
|
84
|
+
{
|
|
85
|
+
value: 'single',
|
|
86
|
+
label: messages.colorSingle
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
value: 'gradient',
|
|
90
|
+
label: messages.colorGradient
|
|
91
|
+
}
|
|
92
|
+
]
|
|
93
|
+
}),
|
|
94
|
+
'gradient' === mode && /*#__PURE__*/ jsxs("div", {
|
|
262
95
|
"data-tao-color-stops": "",
|
|
263
96
|
children: [
|
|
264
97
|
/*#__PURE__*/ jsx("div", {
|
|
@@ -270,15 +103,15 @@ function PickerPanel() {
|
|
|
270
103
|
/*#__PURE__*/ jsxs("div", {
|
|
271
104
|
"data-tao-color-stop-list": "",
|
|
272
105
|
children: [
|
|
273
|
-
stops.map((
|
|
106
|
+
stops.map((stop, index)=>/*#__PURE__*/ jsx("button", {
|
|
274
107
|
type: "button",
|
|
275
|
-
"aria-label": `${messages.colorStop} ${
|
|
276
|
-
"aria-pressed":
|
|
277
|
-
onClick: ()=>panel.setActive(
|
|
108
|
+
"aria-label": `${messages.colorStop} ${index + 1}`,
|
|
109
|
+
"aria-pressed": index === activeIndex,
|
|
110
|
+
onClick: ()=>panel.setActive(index),
|
|
278
111
|
style: {
|
|
279
|
-
background:
|
|
112
|
+
background: stop.color.toCssString()
|
|
280
113
|
}
|
|
281
|
-
}, keyForColor(`${
|
|
114
|
+
}, keyForColor(`${stop.percent}:${stop.color.toCssString()}`))),
|
|
282
115
|
/*#__PURE__*/ jsx(Button, {
|
|
283
116
|
variant: "bare",
|
|
284
117
|
disabled: false,
|
|
@@ -289,12 +122,12 @@ function PickerPanel() {
|
|
|
289
122
|
color: selected,
|
|
290
123
|
percent: 50
|
|
291
124
|
};
|
|
292
|
-
const
|
|
125
|
+
const next = [
|
|
293
126
|
...stops,
|
|
294
127
|
added
|
|
295
|
-
].sort(
|
|
296
|
-
panel.setActive(
|
|
297
|
-
panel.change(new external_color_js_Color(
|
|
128
|
+
].sort((a, b)=>a.percent - b.percent);
|
|
129
|
+
panel.setActive(next.indexOf(added));
|
|
130
|
+
panel.change(new external_color_js_Color(next));
|
|
298
131
|
},
|
|
299
132
|
children: "+"
|
|
300
133
|
}),
|
|
@@ -305,7 +138,7 @@ function PickerPanel() {
|
|
|
305
138
|
"aria-label": messages.removeColorStop,
|
|
306
139
|
onClick: ()=>{
|
|
307
140
|
panel.setActive(Math.max(0, activeIndex - 1));
|
|
308
|
-
panel.change(new external_color_js_Color(stops.filter((_,
|
|
141
|
+
panel.change(new external_color_js_Color(stops.filter((_, index)=>index !== activeIndex)));
|
|
309
142
|
},
|
|
310
143
|
children: "−"
|
|
311
144
|
})
|
|
@@ -331,16 +164,16 @@ function PickerPanel() {
|
|
|
331
164
|
...stops[activeIndex],
|
|
332
165
|
percent
|
|
333
166
|
};
|
|
334
|
-
const
|
|
335
|
-
panel.setActive(
|
|
336
|
-
const color = new external_color_js_Color(
|
|
167
|
+
const next = stops.map((stop, index)=>index === activeIndex ? moved : stop).sort((a, b)=>a.percent - b.percent);
|
|
168
|
+
panel.setActive(next.indexOf(moved));
|
|
169
|
+
const color = new external_color_js_Color(next);
|
|
337
170
|
pendingStopColor.current = color;
|
|
338
171
|
panel.change(color, false);
|
|
339
172
|
},
|
|
340
173
|
onChangeComplete: ()=>{
|
|
341
|
-
const
|
|
174
|
+
const color = pendingStopColor.current ?? value;
|
|
342
175
|
pendingStopColor.current = null;
|
|
343
|
-
panel.complete(
|
|
176
|
+
panel.complete(color);
|
|
344
177
|
}
|
|
345
178
|
}),
|
|
346
179
|
/*#__PURE__*/ jsxs("span", {
|
|
@@ -357,85 +190,132 @@ function PickerPanel() {
|
|
|
357
190
|
prefixCls: prefix,
|
|
358
191
|
value: new Color(selected.toHsb()),
|
|
359
192
|
disabledAlpha: props.disabledAlpha,
|
|
360
|
-
onChange: (
|
|
361
|
-
onChangeComplete: (
|
|
193
|
+
onChange: (next)=>changeSelected(new external_color_js_Color(next.toHsb()), false),
|
|
194
|
+
onChangeComplete: (next)=>panel.complete(replace(new external_color_js_Color(next.toHsb())))
|
|
362
195
|
}),
|
|
363
|
-
|
|
364
|
-
|
|
196
|
+
/*#__PURE__*/ jsxs("div", {
|
|
197
|
+
"data-tao-color-inputs": "",
|
|
198
|
+
children: [
|
|
199
|
+
/*#__PURE__*/ jsx(Select, {
|
|
200
|
+
"aria-label": messages.colorFormat,
|
|
201
|
+
mobileTitle: messages.colorFormat,
|
|
202
|
+
size: "small",
|
|
203
|
+
style: {
|
|
204
|
+
width: '5.5em',
|
|
205
|
+
flexShrink: 0
|
|
206
|
+
},
|
|
207
|
+
styles: {
|
|
208
|
+
popup: {
|
|
209
|
+
zIndex: 'calc(var(--tao-z-index-popup) + 10)'
|
|
210
|
+
}
|
|
211
|
+
},
|
|
212
|
+
value: format,
|
|
213
|
+
disabled: props.disabledFormat ?? false,
|
|
214
|
+
onChange: (next)=>setFormat(next),
|
|
215
|
+
options: [
|
|
216
|
+
'hex',
|
|
217
|
+
'rgb',
|
|
218
|
+
'hsb'
|
|
219
|
+
].map((item)=>({
|
|
220
|
+
value: item,
|
|
221
|
+
label: item.toUpperCase()
|
|
222
|
+
}))
|
|
223
|
+
}),
|
|
224
|
+
'hex' === format ? /*#__PURE__*/ jsx(BaseInput, {
|
|
225
|
+
size: "small",
|
|
226
|
+
disabled: false,
|
|
227
|
+
"aria-label": messages.colorHex,
|
|
228
|
+
value: draft,
|
|
229
|
+
"aria-invalid": !/^#?(?:[\da-f]{3}|[\da-f]{4}|[\da-f]{6}|[\da-f]{8})$/i.test(draft),
|
|
230
|
+
onChange: (event)=>{
|
|
231
|
+
setDraft(event.target.value);
|
|
232
|
+
if (/^#?(?:[\da-f]{6}|[\da-f]{8})$/i.test(event.target.value)) changeSelected(new external_color_js_Color(`#${event.target.value.replace(/^#/, '')}`));
|
|
233
|
+
},
|
|
234
|
+
onBlur: (event)=>{
|
|
235
|
+
if (/^#?(?:[\da-f]{3}|[\da-f]{4})$/i.test(event.target.value)) changeSelected(new external_color_js_Color(`#${event.target.value.replace(/^#/, '')}`));
|
|
236
|
+
}
|
|
237
|
+
}) : 'rgb' === format ? /*#__PURE__*/ jsxs(Fragment, {
|
|
238
|
+
children: [
|
|
239
|
+
numberInput('red', messages.colorRed, rgb.r, 255, (r)=>changeSelected(new external_color_js_Color({
|
|
240
|
+
...rgb,
|
|
241
|
+
r
|
|
242
|
+
}))),
|
|
243
|
+
numberInput('green', messages.colorGreen, rgb.g, 255, (g)=>changeSelected(new external_color_js_Color({
|
|
244
|
+
...rgb,
|
|
245
|
+
g
|
|
246
|
+
}))),
|
|
247
|
+
numberInput('blue', messages.colorBlue, rgb.b, 255, (b)=>changeSelected(new external_color_js_Color({
|
|
248
|
+
...rgb,
|
|
249
|
+
b
|
|
250
|
+
})))
|
|
251
|
+
]
|
|
252
|
+
}) : /*#__PURE__*/ jsxs(Fragment, {
|
|
253
|
+
children: [
|
|
254
|
+
numberInput('hue', messages.colorHue, Math.round(hsb.h), 360, (h)=>changeSelected(new external_color_js_Color({
|
|
255
|
+
...hsb,
|
|
256
|
+
h
|
|
257
|
+
}))),
|
|
258
|
+
numberInput('saturation', messages.colorSaturation, Math.round(100 * hsb.s), 100, (s)=>changeSelected(new external_color_js_Color({
|
|
259
|
+
...hsb,
|
|
260
|
+
s: s / 100
|
|
261
|
+
}))),
|
|
262
|
+
numberInput('brightness', messages.colorBrightness, Math.round(100 * hsb.b), 100, (b)=>changeSelected(new external_color_js_Color({
|
|
263
|
+
...hsb,
|
|
264
|
+
b: b / 100
|
|
265
|
+
})))
|
|
266
|
+
]
|
|
267
|
+
}),
|
|
268
|
+
!props.disabledAlpha && numberInput('alpha', messages.colorAlpha, Math.round(100 * rgb.a), 100, (alpha)=>changeSelected(new external_color_js_Color({
|
|
269
|
+
...hsb,
|
|
270
|
+
a: alpha / 100
|
|
271
|
+
})))
|
|
272
|
+
]
|
|
273
|
+
}),
|
|
274
|
+
props.allowClear && /*#__PURE__*/ jsx(Button, {
|
|
275
|
+
variant: "ghost",
|
|
276
|
+
size: "small",
|
|
277
|
+
disabled: false,
|
|
278
|
+
"data-tao-color-clear": "",
|
|
279
|
+
onClick: panel.clear,
|
|
280
|
+
children: messages.clearColor
|
|
281
|
+
})
|
|
365
282
|
]
|
|
366
283
|
});
|
|
367
284
|
}
|
|
368
|
-
function _temp3(item) {
|
|
369
|
-
return {
|
|
370
|
-
value: item,
|
|
371
|
-
label: item.toUpperCase()
|
|
372
|
-
};
|
|
373
|
-
}
|
|
374
|
-
function _temp2(a_0, b_0) {
|
|
375
|
-
return a_0.percent - b_0.percent;
|
|
376
|
-
}
|
|
377
|
-
function _temp(a, b) {
|
|
378
|
-
return a.percent - b.percent;
|
|
379
|
-
}
|
|
380
285
|
function PresetsPanel() {
|
|
381
|
-
const $ = c(6);
|
|
382
286
|
const keyForColor = colorKeys();
|
|
383
287
|
const { props, change } = useContext(PanelContext);
|
|
384
|
-
const { locale:
|
|
385
|
-
const { messages } = t0;
|
|
288
|
+
const { locale: { messages } } = useTaoConfig();
|
|
386
289
|
if (!props.presets?.length) return null;
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
}
|
|
413
|
-
})
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
let t7;
|
|
417
|
-
if ($[2] !== T0 || $[3] !== t5 || $[4] !== t6) {
|
|
418
|
-
t7 = /*#__PURE__*/ jsx("div", {
|
|
419
|
-
"data-tao-color-presets": t1,
|
|
420
|
-
children: /*#__PURE__*/ jsx(T0, {
|
|
421
|
-
ghost: t2,
|
|
422
|
-
disabled: t3,
|
|
423
|
-
size: t4,
|
|
424
|
-
defaultActiveKey: t5,
|
|
425
|
-
items: t6
|
|
426
|
-
})
|
|
427
|
-
});
|
|
428
|
-
$[2] = T0;
|
|
429
|
-
$[3] = t5;
|
|
430
|
-
$[4] = t6;
|
|
431
|
-
$[5] = t7;
|
|
432
|
-
} else t7 = $[5];
|
|
433
|
-
return t7;
|
|
434
|
-
}
|
|
435
|
-
function _temp4(preset, index) {
|
|
436
|
-
return preset.defaultOpen ?? true ? [
|
|
437
|
-
String(preset.key ?? index)
|
|
438
|
-
] : [];
|
|
290
|
+
return /*#__PURE__*/ jsx("div", {
|
|
291
|
+
"data-tao-color-presets": "",
|
|
292
|
+
children: /*#__PURE__*/ jsx(Collapse, {
|
|
293
|
+
ghost: true,
|
|
294
|
+
disabled: false,
|
|
295
|
+
size: "small",
|
|
296
|
+
defaultActiveKey: props.presets.flatMap((preset, index)=>preset.defaultOpen ?? true ? [
|
|
297
|
+
String(preset.key ?? index)
|
|
298
|
+
] : []),
|
|
299
|
+
items: props.presets.map((preset, index)=>({
|
|
300
|
+
key: String(preset.key ?? index),
|
|
301
|
+
label: preset.label,
|
|
302
|
+
children: /*#__PURE__*/ jsx("div", {
|
|
303
|
+
"data-tao-color-swatches": "",
|
|
304
|
+
children: preset.colors.map((value)=>{
|
|
305
|
+
const color = new external_color_js_Color(value);
|
|
306
|
+
return /*#__PURE__*/ jsx("button", {
|
|
307
|
+
type: "button",
|
|
308
|
+
"aria-label": `${messages.colorPreset} ${color.isGradient() ? color.toCssString() : color.toHexString()}`,
|
|
309
|
+
style: {
|
|
310
|
+
background: color.toCssString()
|
|
311
|
+
},
|
|
312
|
+
onClick: ()=>change(color)
|
|
313
|
+
}, keyForColor(color.toCssString()));
|
|
314
|
+
})
|
|
315
|
+
})
|
|
316
|
+
}))
|
|
317
|
+
})
|
|
318
|
+
});
|
|
439
319
|
}
|
|
440
320
|
function opaque(value) {
|
|
441
321
|
return value.isGradient() ? new external_color_js_Color(value.getColors().map((stop)=>({
|
|
@@ -450,86 +330,39 @@ function opaque(value) {
|
|
|
450
330
|
});
|
|
451
331
|
}
|
|
452
332
|
const color_picker_PickerSurface = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
453
|
-
const
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
t1 = /*#__PURE__*/ jsx("div", {
|
|
459
|
-
...props,
|
|
460
|
-
ref: t0
|
|
461
|
-
});
|
|
462
|
-
$[0] = props;
|
|
463
|
-
$[1] = t0;
|
|
464
|
-
$[2] = t1;
|
|
465
|
-
} else t1 = $[2];
|
|
466
|
-
return t1;
|
|
333
|
+
const hidden = props['data-tao-keep-alive'] && 'closed' === props['data-state'];
|
|
334
|
+
return /*#__PURE__*/ jsx("div", {
|
|
335
|
+
...props,
|
|
336
|
+
ref: hidden ? null : ref
|
|
337
|
+
});
|
|
467
338
|
});
|
|
468
339
|
function ColorPicker(props) {
|
|
469
|
-
const $ = c(185);
|
|
470
340
|
const config = useTaoConfig();
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
const [innerValue, setValue] = useState(t0);
|
|
478
|
-
const [innerOpen, setOpen] = useState(false);
|
|
479
|
-
const [innerFormat, setFormat] = useState(props.defaultFormat ?? "hex");
|
|
480
|
-
const [active, setActive] = useState(0);
|
|
481
|
-
const [triggerElement, setTriggerElement] = useState(null);
|
|
482
|
-
const controlled = "value" in props;
|
|
483
|
-
let t1;
|
|
484
|
-
if ($[2] !== controlled || $[3] !== innerValue || $[4] !== props.mode || $[5] !== props.value) {
|
|
485
|
-
t1 = ()=>(controlled ? new external_color_js_Color(props.value) : innerValue).isGradient() ? "gradient" : (Array.isArray(props.mode) ? props.mode[0] : props.mode) ?? "single";
|
|
486
|
-
$[2] = controlled;
|
|
487
|
-
$[3] = innerValue;
|
|
488
|
-
$[4] = props.mode;
|
|
489
|
-
$[5] = props.value;
|
|
490
|
-
$[6] = t1;
|
|
491
|
-
} else t1 = $[6];
|
|
492
|
-
const [innerMode, setMode] = useState(t1);
|
|
493
|
-
const cachedGradient = useRef(null);
|
|
494
|
-
const hoverTimer = useRef(void 0);
|
|
341
|
+
const [innerValue, setValue] = useState(()=>new external_color_js_Color(void 0 === props.defaultValue ? '#1677ff' : props.defaultValue));
|
|
342
|
+
const [innerOpen, setOpen] = useState(false), [innerFormat, setFormat] = useState(props.defaultFormat ?? 'hex');
|
|
343
|
+
const [active, setActive] = useState(0), [triggerElement, setTriggerElement] = useState(null);
|
|
344
|
+
const controlled = 'value' in props;
|
|
345
|
+
const [innerMode, setMode] = useState(()=>(controlled ? new external_color_js_Color(props.value) : innerValue).isGradient() ? 'gradient' : (Array.isArray(props.mode) ? props.mode[0] : props.mode) ?? 'single');
|
|
346
|
+
const cachedGradient = useRef(null), hoverTimer = useRef(void 0);
|
|
495
347
|
const keyboardOpening = useRef(false);
|
|
496
348
|
const touchPointer = useRef(false);
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
} else t2 = $[8];
|
|
507
|
-
const configuredModes = t2;
|
|
508
|
-
let t3;
|
|
509
|
-
if ($[9] !== configuredModes) {
|
|
510
|
-
t3 = configuredModes.length ? configuredModes : [
|
|
511
|
-
"single"
|
|
512
|
-
];
|
|
513
|
-
$[9] = configuredModes;
|
|
514
|
-
$[10] = t3;
|
|
515
|
-
} else t3 = $[10];
|
|
516
|
-
const modes = t3;
|
|
517
|
-
let t4;
|
|
518
|
-
if ($[11] !== innerMode || $[12] !== modes) {
|
|
519
|
-
t4 = modes.includes(innerMode) ? innerMode : modes[0];
|
|
520
|
-
$[11] = innerMode;
|
|
521
|
-
$[12] = modes;
|
|
522
|
-
$[13] = t4;
|
|
523
|
-
} else t4 = $[13];
|
|
524
|
-
const mode = t4;
|
|
349
|
+
const configuredModes = props.mode ? Array.isArray(props.mode) ? props.mode : [
|
|
350
|
+
props.mode
|
|
351
|
+
] : [
|
|
352
|
+
'single'
|
|
353
|
+
];
|
|
354
|
+
const modes = configuredModes.length ? configuredModes : [
|
|
355
|
+
'single'
|
|
356
|
+
];
|
|
357
|
+
const mode = modes.includes(innerMode) ? innerMode : modes[0];
|
|
525
358
|
const rawColor = controlled ? new external_color_js_Color(props.value) : innerValue;
|
|
526
359
|
const isGradient = rawColor.isGradient();
|
|
527
360
|
useEffect(()=>{
|
|
528
|
-
setMode(isGradient ?
|
|
361
|
+
setMode(isGradient ? 'gradient' : 'single');
|
|
529
362
|
}, [
|
|
530
363
|
isGradient
|
|
531
364
|
]);
|
|
532
|
-
const value =
|
|
365
|
+
const value = 'gradient' !== mode || rawColor.isGradient() || rawColor.cleared ? rawColor : new external_color_js_Color([
|
|
533
366
|
{
|
|
534
367
|
color: rawColor,
|
|
535
368
|
percent: 0
|
|
@@ -539,182 +372,87 @@ function ColorPicker(props) {
|
|
|
539
372
|
percent: 100
|
|
540
373
|
}
|
|
541
374
|
]);
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
]) : value;
|
|
554
|
-
$[14] = mode;
|
|
555
|
-
$[15] = value;
|
|
556
|
-
$[16] = t5;
|
|
557
|
-
} else t5 = $[16];
|
|
558
|
-
const panelValue = t5;
|
|
559
|
-
const format = props.format ?? innerFormat;
|
|
560
|
-
const disabled = props.disabled ?? config.disabled;
|
|
375
|
+
const panelValue = 'gradient' === mode && value.cleared ? new external_color_js_Color([
|
|
376
|
+
{
|
|
377
|
+
color: 'transparent',
|
|
378
|
+
percent: 0
|
|
379
|
+
},
|
|
380
|
+
{
|
|
381
|
+
color: 'transparent',
|
|
382
|
+
percent: 100
|
|
383
|
+
}
|
|
384
|
+
]) : value;
|
|
385
|
+
const format = props.format ?? innerFormat, disabled = props.disabled ?? config.disabled;
|
|
561
386
|
const open = !disabled && (props.open ?? innerOpen);
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
$[19] = t6;
|
|
575
|
-
$[20] = t7;
|
|
576
|
-
} else {
|
|
577
|
-
t6 = $[19];
|
|
578
|
-
t7 = $[20];
|
|
579
|
-
}
|
|
580
|
-
useEffect(t6, t7);
|
|
581
|
-
const hoverEnabled = "hover" === props.trigger && open;
|
|
582
|
-
let t8;
|
|
583
|
-
let t9;
|
|
584
|
-
if ($[21] !== hoverEnabled) {
|
|
585
|
-
t8 = ()=>{
|
|
586
|
-
if (hoverEnabled) return ()=>clearTimeout(hoverTimer.current);
|
|
587
|
-
};
|
|
588
|
-
t9 = [
|
|
589
|
-
hoverEnabled
|
|
590
|
-
];
|
|
591
|
-
$[21] = hoverEnabled;
|
|
592
|
-
$[22] = t8;
|
|
593
|
-
$[23] = t9;
|
|
594
|
-
} else {
|
|
595
|
-
t8 = $[22];
|
|
596
|
-
t9 = $[23];
|
|
597
|
-
}
|
|
598
|
-
useEffect(t8, t9);
|
|
387
|
+
useEffect(()=>{
|
|
388
|
+
if (disabled && void 0 === props.open) setOpen(false);
|
|
389
|
+
}, [
|
|
390
|
+
disabled,
|
|
391
|
+
props.open
|
|
392
|
+
]);
|
|
393
|
+
const hoverEnabled = 'hover' === props.trigger && open;
|
|
394
|
+
useEffect(()=>{
|
|
395
|
+
if (hoverEnabled) return ()=>clearTimeout(hoverTimer.current);
|
|
396
|
+
}, [
|
|
397
|
+
hoverEnabled
|
|
398
|
+
]);
|
|
599
399
|
const keepAlive = !(props.destroyOnHidden || props.destroyTooltipOnHide);
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
$[25] = t10;
|
|
607
|
-
} else t10 = $[25];
|
|
608
|
-
const names = t10;
|
|
609
|
-
let t11;
|
|
610
|
-
if ($[26] !== props) {
|
|
611
|
-
t11 = "function" == typeof props.styles ? props.styles({
|
|
612
|
-
props
|
|
613
|
-
}) : props.styles;
|
|
614
|
-
$[26] = props;
|
|
615
|
-
$[27] = t11;
|
|
616
|
-
} else t11 = $[27];
|
|
617
|
-
const styles = t11;
|
|
400
|
+
const names = 'function' == typeof props.classNames ? props.classNames({
|
|
401
|
+
props
|
|
402
|
+
}) : props.classNames;
|
|
403
|
+
const styles = 'function' == typeof props.styles ? props.styles({
|
|
404
|
+
props
|
|
405
|
+
}) : props.styles;
|
|
618
406
|
const { messages } = config.locale;
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
}
|
|
633
|
-
const complete = t13;
|
|
634
|
-
let t14;
|
|
635
|
-
if ($[33] !== complete || $[34] !== controlled || $[35] !== normalize || $[36] !== props) {
|
|
636
|
-
t14 = (next_1, t15)=>{
|
|
637
|
-
const finished = void 0 === t15 ? true : t15;
|
|
638
|
-
const color = normalize(next_1);
|
|
639
|
-
if (!controlled) setValue(color);
|
|
640
|
-
cachedGradient.current = null;
|
|
641
|
-
props.onChange?.(new external_color_js_Color(color), color.toCssString());
|
|
642
|
-
if (finished) complete(color);
|
|
643
|
-
};
|
|
644
|
-
$[33] = complete;
|
|
645
|
-
$[34] = controlled;
|
|
646
|
-
$[35] = normalize;
|
|
647
|
-
$[36] = props;
|
|
648
|
-
$[37] = t14;
|
|
649
|
-
} else t14 = $[37];
|
|
650
|
-
const change = t14;
|
|
651
|
-
let t15;
|
|
652
|
-
if ($[38] !== disabled || $[39] !== props) {
|
|
653
|
-
t15 = (next_2)=>{
|
|
654
|
-
if (next_2 && disabled) return;
|
|
655
|
-
if (void 0 === props.open) setOpen(next_2);
|
|
656
|
-
props.onOpenChange?.(next_2);
|
|
657
|
-
};
|
|
658
|
-
$[38] = disabled;
|
|
659
|
-
$[39] = props;
|
|
660
|
-
$[40] = t15;
|
|
661
|
-
} else t15 = $[40];
|
|
662
|
-
const openChange = t15;
|
|
407
|
+
const normalize = (next)=>props.disabledAlpha && !next.cleared ? opaque(next) : next;
|
|
408
|
+
const complete = (next)=>props.onChangeComplete?.(new external_color_js_Color(normalize(next)));
|
|
409
|
+
const change = (next, finished = true)=>{
|
|
410
|
+
const color = normalize(next);
|
|
411
|
+
if (!controlled) setValue(color);
|
|
412
|
+
cachedGradient.current = null;
|
|
413
|
+
props.onChange?.(new external_color_js_Color(color), color.toCssString());
|
|
414
|
+
if (finished) complete(color);
|
|
415
|
+
};
|
|
416
|
+
const openChange = (next)=>{
|
|
417
|
+
if (next && disabled) return;
|
|
418
|
+
if (void 0 === props.open) setOpen(next);
|
|
419
|
+
props.onOpenChange?.(next);
|
|
420
|
+
};
|
|
663
421
|
const latestOpenChange = useRef(openChange);
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
422
|
+
useLayoutEffect(()=>{
|
|
423
|
+
latestOpenChange.current = openChange;
|
|
424
|
+
});
|
|
425
|
+
const enter = (event)=>{
|
|
426
|
+
if ('touch' === event.pointerType) return;
|
|
427
|
+
clearTimeout(hoverTimer.current);
|
|
428
|
+
if ('hover' === props.trigger && !open) {
|
|
429
|
+
keyboardOpening.current = false;
|
|
430
|
+
openChange(true);
|
|
431
|
+
}
|
|
432
|
+
};
|
|
433
|
+
const leave = (event)=>{
|
|
434
|
+
if (hoverEnabled && 'touch' !== event.pointerType) {
|
|
677
435
|
clearTimeout(hoverTimer.current);
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
}
|
|
696
|
-
};
|
|
697
|
-
$[47] = hoverEnabled;
|
|
698
|
-
$[48] = t18;
|
|
699
|
-
} else t18 = $[48];
|
|
700
|
-
const leave = t18;
|
|
701
|
-
let t19;
|
|
702
|
-
if ($[49] !== format || $[50] !== props) {
|
|
703
|
-
t19 = (next_3)=>{
|
|
704
|
-
if (void 0 === props.format) setFormat(next_3);
|
|
705
|
-
if (format !== next_3) props.onFormatChange?.(next_3);
|
|
706
|
-
};
|
|
707
|
-
$[49] = format;
|
|
708
|
-
$[50] = props;
|
|
709
|
-
$[51] = t19;
|
|
710
|
-
} else t19 = $[51];
|
|
711
|
-
let t20;
|
|
712
|
-
if ($[52] !== change || $[53] !== value) {
|
|
713
|
-
t20 = (next_4)=>{
|
|
714
|
-
setMode(next_4);
|
|
436
|
+
hoverTimer.current = setTimeout(()=>latestOpenChange.current(false), 100);
|
|
437
|
+
}
|
|
438
|
+
};
|
|
439
|
+
const panelState = {
|
|
440
|
+
props,
|
|
441
|
+
value: panelValue,
|
|
442
|
+
active,
|
|
443
|
+
setActive,
|
|
444
|
+
format,
|
|
445
|
+
setFormat: (next)=>{
|
|
446
|
+
if (void 0 === props.format) setFormat(next);
|
|
447
|
+
if (format !== next) props.onFormatChange?.(next);
|
|
448
|
+
},
|
|
449
|
+
mode,
|
|
450
|
+
modes,
|
|
451
|
+
setMode: (next)=>{
|
|
452
|
+
setMode(next);
|
|
715
453
|
setActive(0);
|
|
716
454
|
const cached = value.isGradient() ? value : cachedGradient.current;
|
|
717
|
-
change(
|
|
455
|
+
change('single' === next ? value.getColors()[0].color : cached ?? new external_color_js_Color([
|
|
718
456
|
{
|
|
719
457
|
color: value,
|
|
720
458
|
percent: 0
|
|
@@ -725,451 +463,149 @@ function ColorPicker(props) {
|
|
|
725
463
|
}
|
|
726
464
|
]));
|
|
727
465
|
cachedGradient.current = cached;
|
|
728
|
-
}
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
} else t20 = $[54];
|
|
733
|
-
let t21;
|
|
734
|
-
if ($[55] !== change || $[56] !== props) {
|
|
735
|
-
t21 = ()=>{
|
|
466
|
+
},
|
|
467
|
+
change,
|
|
468
|
+
complete,
|
|
469
|
+
clear: ()=>{
|
|
736
470
|
change(new external_color_js_Color(null));
|
|
737
471
|
props.onClear?.();
|
|
738
|
-
}
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
if ($[70] === Symbol.for("react.memo_cache_sentinel")) {
|
|
775
|
-
t23 = /*#__PURE__*/ jsxs(Fragment, {
|
|
776
|
-
children: [
|
|
777
|
-
/*#__PURE__*/ jsx(PickerPanel, {}),
|
|
778
|
-
/*#__PURE__*/ jsx(PresetsPanel, {})
|
|
779
|
-
]
|
|
780
|
-
});
|
|
781
|
-
$[70] = t23;
|
|
782
|
-
} else t23 = $[70];
|
|
783
|
-
const basicPanel = t23;
|
|
784
|
-
const placement = props.placement ?? "bottomLeft";
|
|
785
|
-
const side = placement.startsWith("top") ? "top" : placement.startsWith("left") ? "left" : placement.startsWith("right") ? "right" : "bottom";
|
|
786
|
-
const align = "object" == typeof props.arrow && props.arrow.pointAtCenter ? "center" : /Left|Top/.test(placement) ? "start" : /Right|Bottom/.test(placement) ? "end" : "center";
|
|
787
|
-
let t24;
|
|
788
|
-
if ($[71] !== format || $[72] !== messages.colorGradient || $[73] !== messages.colorTransparent || $[74] !== props.showText || $[75] !== value) {
|
|
789
|
-
t24 = "function" == typeof props.showText ? props.showText(value) : value.cleared ? messages.colorTransparent : value.isGradient() ? messages.colorGradient : "rgb" === format ? value.toRgbString() : "hsb" === format ? value.toHsbString() : value.toHexString();
|
|
790
|
-
$[71] = format;
|
|
791
|
-
$[72] = messages.colorGradient;
|
|
792
|
-
$[73] = messages.colorTransparent;
|
|
793
|
-
$[74] = props.showText;
|
|
794
|
-
$[75] = value;
|
|
795
|
-
$[76] = t24;
|
|
796
|
-
} else t24 = $[76];
|
|
797
|
-
const text = t24;
|
|
798
|
-
let t25;
|
|
799
|
-
if ($[77] !== props) {
|
|
800
|
-
t25 = Object.fromEntries(Object.entries(props).filter(_temp5));
|
|
801
|
-
$[77] = props;
|
|
802
|
-
$[78] = t25;
|
|
803
|
-
} else t25 = $[78];
|
|
804
|
-
const dataProps = t25;
|
|
805
|
-
const t26 = messages.chooseColor;
|
|
806
|
-
let t27;
|
|
807
|
-
if ($[79] !== value) {
|
|
808
|
-
t27 = value.toHexString();
|
|
809
|
-
$[79] = value;
|
|
810
|
-
$[80] = t27;
|
|
811
|
-
} else t27 = $[80];
|
|
812
|
-
const t28 = `${t26} ${t27}`;
|
|
813
|
-
const t29 = names?.body;
|
|
814
|
-
const t30 = styles?.body;
|
|
815
|
-
const t31 = names?.content;
|
|
816
|
-
let t32;
|
|
817
|
-
if ($[81] !== value) {
|
|
818
|
-
t32 = value.toCssString();
|
|
819
|
-
$[81] = value;
|
|
820
|
-
$[82] = t32;
|
|
821
|
-
} else t32 = $[82];
|
|
822
|
-
const t33 = styles?.content;
|
|
823
|
-
let t34;
|
|
824
|
-
if ($[83] !== t32 || $[84] !== t33) {
|
|
825
|
-
t34 = {
|
|
826
|
-
background: t32,
|
|
827
|
-
...t33
|
|
828
|
-
};
|
|
829
|
-
$[83] = t32;
|
|
830
|
-
$[84] = t33;
|
|
831
|
-
$[85] = t34;
|
|
832
|
-
} else t34 = $[85];
|
|
833
|
-
let t35;
|
|
834
|
-
if ($[86] !== t31 || $[87] !== t34) {
|
|
835
|
-
t35 = /*#__PURE__*/ jsx("span", {
|
|
836
|
-
"data-tao-color-content": "",
|
|
837
|
-
className: t31,
|
|
838
|
-
style: t34
|
|
839
|
-
});
|
|
840
|
-
$[86] = t31;
|
|
841
|
-
$[87] = t34;
|
|
842
|
-
$[88] = t35;
|
|
843
|
-
} else t35 = $[88];
|
|
844
|
-
let t36;
|
|
845
|
-
if ($[89] !== t29 || $[90] !== t30 || $[91] !== t35) {
|
|
846
|
-
t36 = /*#__PURE__*/ jsx("span", {
|
|
847
|
-
"data-tao-color-body": "",
|
|
848
|
-
className: t29,
|
|
849
|
-
style: t30,
|
|
850
|
-
children: t35
|
|
851
|
-
});
|
|
852
|
-
$[89] = t29;
|
|
853
|
-
$[90] = t30;
|
|
854
|
-
$[91] = t35;
|
|
855
|
-
$[92] = t36;
|
|
856
|
-
} else t36 = $[92];
|
|
857
|
-
let t37;
|
|
858
|
-
if ($[93] !== names?.description || $[94] !== props.showText || $[95] !== styles?.description || $[96] !== text) {
|
|
859
|
-
t37 = props.showText && /*#__PURE__*/ jsx("span", {
|
|
860
|
-
"data-tao-color-description": "",
|
|
861
|
-
className: names?.description,
|
|
862
|
-
style: styles?.description,
|
|
863
|
-
children: text
|
|
864
|
-
});
|
|
865
|
-
$[93] = names?.description;
|
|
866
|
-
$[94] = props.showText;
|
|
867
|
-
$[95] = styles?.description;
|
|
868
|
-
$[96] = text;
|
|
869
|
-
$[97] = t37;
|
|
870
|
-
} else t37 = $[97];
|
|
871
|
-
let t38;
|
|
872
|
-
if ($[98] !== disabled || $[99] !== t28 || $[100] !== t36 || $[101] !== t37) {
|
|
873
|
-
t38 = /*#__PURE__*/ jsxs("button", {
|
|
874
|
-
type: "button",
|
|
875
|
-
disabled: disabled,
|
|
876
|
-
"aria-label": t28,
|
|
877
|
-
children: [
|
|
878
|
-
t36,
|
|
879
|
-
t37
|
|
880
|
-
]
|
|
881
|
-
});
|
|
882
|
-
$[98] = disabled;
|
|
883
|
-
$[99] = t28;
|
|
884
|
-
$[100] = t36;
|
|
885
|
-
$[101] = t37;
|
|
886
|
-
$[102] = t38;
|
|
887
|
-
} else t38 = $[102];
|
|
888
|
-
const defaultTrigger = t38;
|
|
889
|
-
let t39;
|
|
890
|
-
if ($[103] !== disabled || $[104] !== props.children) {
|
|
891
|
-
const customTrigger = /*#__PURE__*/ isValidElement(props.children) ? asTriggerChild(props.children) : props.children;
|
|
892
|
-
t39 = disabled && /*#__PURE__*/ isValidElement(customTrigger) && ("button" === customTrigger.type || customTrigger.type === Button) ? /*#__PURE__*/ cloneElement(customTrigger, {
|
|
893
|
-
disabled: true
|
|
894
|
-
}) : customTrigger;
|
|
895
|
-
$[103] = disabled;
|
|
896
|
-
$[104] = props.children;
|
|
897
|
-
$[105] = t39;
|
|
898
|
-
} else t39 = $[105];
|
|
899
|
-
const trigger = t39;
|
|
900
|
-
const t40 = "middle" === props.size ? "medium" : props.size ?? config.size;
|
|
901
|
-
const t41 = disabled || void 0;
|
|
902
|
-
const t42 = names?.root;
|
|
903
|
-
let t43;
|
|
904
|
-
if ($[106] !== props.className || $[107] !== props.rootClassName || $[108] !== t42) {
|
|
905
|
-
t43 = cx(t42, props.className, props.rootClassName);
|
|
906
|
-
$[106] = props.className;
|
|
907
|
-
$[107] = props.rootClassName;
|
|
908
|
-
$[108] = t42;
|
|
909
|
-
$[109] = t43;
|
|
910
|
-
} else t43 = $[109];
|
|
911
|
-
const t44 = styles?.root;
|
|
912
|
-
let t45;
|
|
913
|
-
if ($[110] !== props.style || $[111] !== t44) {
|
|
914
|
-
t45 = {
|
|
915
|
-
...t44,
|
|
916
|
-
...props.style
|
|
917
|
-
};
|
|
918
|
-
$[110] = props.style;
|
|
919
|
-
$[111] = t44;
|
|
920
|
-
$[112] = t45;
|
|
921
|
-
} else t45 = $[112];
|
|
922
|
-
let t46;
|
|
923
|
-
if ($[113] === Symbol.for("react.memo_cache_sentinel")) {
|
|
924
|
-
t46 = (event_1)=>{
|
|
925
|
-
touchPointer.current = "touch" === event_1.pointerType;
|
|
926
|
-
};
|
|
927
|
-
$[113] = t46;
|
|
928
|
-
} else t46 = $[113];
|
|
929
|
-
let t47;
|
|
930
|
-
if ($[114] !== disabled || $[115] !== open || $[116] !== props.trigger) {
|
|
931
|
-
t47 = (event_2)=>{
|
|
932
|
-
const touch = touchPointer.current;
|
|
933
|
-
touchPointer.current = false;
|
|
934
|
-
if (disabled || "hover" === props.trigger && 0 !== event_2.detail && !touch) event_2.preventDefault();
|
|
935
|
-
else if (!open) keyboardOpening.current = 0 === event_2.detail;
|
|
936
|
-
};
|
|
937
|
-
$[114] = disabled;
|
|
938
|
-
$[115] = open;
|
|
939
|
-
$[116] = props.trigger;
|
|
940
|
-
$[117] = t47;
|
|
941
|
-
} else t47 = $[117];
|
|
942
|
-
let t48;
|
|
943
|
-
if ($[118] !== defaultTrigger || $[119] !== disabled || $[120] !== trigger) {
|
|
944
|
-
t48 = /*#__PURE__*/ isValidElement(trigger) ? trigger : trigger || 0 === trigger ? /*#__PURE__*/ jsx("button", {
|
|
945
|
-
type: "button",
|
|
946
|
-
disabled: disabled,
|
|
947
|
-
children: trigger
|
|
948
|
-
}) : defaultTrigger;
|
|
949
|
-
$[118] = defaultTrigger;
|
|
950
|
-
$[119] = disabled;
|
|
951
|
-
$[120] = trigger;
|
|
952
|
-
$[121] = t48;
|
|
953
|
-
} else t48 = $[121];
|
|
954
|
-
let t49;
|
|
955
|
-
if ($[122] !== enter || $[123] !== leave || $[124] !== t47 || $[125] !== t48) {
|
|
956
|
-
t49 = /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_popover_c8444160.Trigger, {
|
|
957
|
-
asChild: true,
|
|
958
|
-
onPointerEnter: enter,
|
|
959
|
-
onPointerLeave: leave,
|
|
960
|
-
onPointerDown: t46,
|
|
961
|
-
onClick: t47,
|
|
962
|
-
children: t48
|
|
963
|
-
});
|
|
964
|
-
$[122] = enter;
|
|
965
|
-
$[123] = leave;
|
|
966
|
-
$[124] = t47;
|
|
967
|
-
$[125] = t48;
|
|
968
|
-
$[126] = t49;
|
|
969
|
-
} else t49 = $[126];
|
|
970
|
-
let t50;
|
|
971
|
-
if ($[127] !== props.getPopupContainer || $[128] !== triggerElement) {
|
|
972
|
-
t50 = triggerElement ? props.getPopupContainer?.(triggerElement) : void 0;
|
|
973
|
-
$[127] = props.getPopupContainer;
|
|
974
|
-
$[128] = triggerElement;
|
|
975
|
-
$[129] = t50;
|
|
976
|
-
} else t50 = $[129];
|
|
977
|
-
const t51 = keepAlive || void 0;
|
|
978
|
-
const t52 = keepAlive || void 0;
|
|
979
|
-
const t53 = props.autoAdjustOverflow ?? true;
|
|
980
|
-
let t54;
|
|
981
|
-
if ($[130] !== open) {
|
|
982
|
-
t54 = (event_3)=>{
|
|
983
|
-
if (!open) event_3.preventDefault();
|
|
984
|
-
};
|
|
985
|
-
$[130] = open;
|
|
986
|
-
$[131] = t54;
|
|
987
|
-
} else t54 = $[131];
|
|
988
|
-
const t55 = names?.popup?.root;
|
|
989
|
-
const t56 = styles?.popup?.root;
|
|
990
|
-
let t57;
|
|
991
|
-
if ($[132] !== open) {
|
|
992
|
-
t57 = open ? {} : {
|
|
993
|
-
display: "none"
|
|
994
|
-
};
|
|
995
|
-
$[132] = open;
|
|
996
|
-
$[133] = t57;
|
|
997
|
-
} else t57 = $[133];
|
|
998
|
-
let t58;
|
|
999
|
-
if ($[134] !== t56 || $[135] !== t57) {
|
|
1000
|
-
t58 = {
|
|
1001
|
-
...t56,
|
|
1002
|
-
...t57
|
|
1003
|
-
};
|
|
1004
|
-
$[134] = t56;
|
|
1005
|
-
$[135] = t57;
|
|
1006
|
-
$[136] = t58;
|
|
1007
|
-
} else t58 = $[136];
|
|
1008
|
-
let t59;
|
|
1009
|
-
if ($[137] !== props.trigger) {
|
|
1010
|
-
t59 = (event_4)=>{
|
|
1011
|
-
if ("hover" === props.trigger && !keyboardOpening.current) event_4.preventDefault();
|
|
1012
|
-
keyboardOpening.current = false;
|
|
1013
|
-
};
|
|
1014
|
-
$[137] = props.trigger;
|
|
1015
|
-
$[138] = t59;
|
|
1016
|
-
} else t59 = $[138];
|
|
1017
|
-
const t60 = names?.popup?.container;
|
|
1018
|
-
const t61 = styles?.popupOverlayInner;
|
|
1019
|
-
const t62 = styles?.popup?.container;
|
|
1020
|
-
let t63;
|
|
1021
|
-
if ($[139] !== t61 || $[140] !== t62) {
|
|
1022
|
-
t63 = {
|
|
1023
|
-
...t61,
|
|
1024
|
-
...t62
|
|
1025
|
-
};
|
|
1026
|
-
$[139] = t61;
|
|
1027
|
-
$[140] = t62;
|
|
1028
|
-
$[141] = t63;
|
|
1029
|
-
} else t63 = $[141];
|
|
1030
|
-
let t64;
|
|
1031
|
-
if ($[142] !== props.panelRender) {
|
|
1032
|
-
t64 = props.panelRender ? props.panelRender(basicPanel, {
|
|
1033
|
-
components: {
|
|
1034
|
-
Picker: PickerPanel,
|
|
1035
|
-
Presets: PresetsPanel
|
|
1036
|
-
}
|
|
1037
|
-
}) : basicPanel;
|
|
1038
|
-
$[142] = props.panelRender;
|
|
1039
|
-
$[143] = t64;
|
|
1040
|
-
} else t64 = $[143];
|
|
1041
|
-
let t65;
|
|
1042
|
-
if ($[144] !== panelState || $[145] !== t64) {
|
|
1043
|
-
t65 = /*#__PURE__*/ jsx(PanelContext.Provider, {
|
|
1044
|
-
value: panelState,
|
|
1045
|
-
children: t64
|
|
1046
|
-
});
|
|
1047
|
-
$[144] = panelState;
|
|
1048
|
-
$[145] = t64;
|
|
1049
|
-
$[146] = t65;
|
|
1050
|
-
} else t65 = $[146];
|
|
1051
|
-
let t66;
|
|
1052
|
-
if ($[147] !== t60 || $[148] !== t63 || $[149] !== t65) {
|
|
1053
|
-
t66 = /*#__PURE__*/ jsx("div", {
|
|
1054
|
-
"data-tao-color-container": "",
|
|
1055
|
-
className: t60,
|
|
1056
|
-
style: t63,
|
|
1057
|
-
children: t65
|
|
1058
|
-
});
|
|
1059
|
-
$[147] = t60;
|
|
1060
|
-
$[148] = t63;
|
|
1061
|
-
$[149] = t65;
|
|
1062
|
-
$[150] = t66;
|
|
1063
|
-
} else t66 = $[150];
|
|
1064
|
-
let t67;
|
|
1065
|
-
if ($[151] !== props.arrow) {
|
|
1066
|
-
t67 = false !== props.arrow && /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_popover_c8444160.Arrow, {
|
|
1067
|
-
"data-tao-color-arrow": ""
|
|
1068
|
-
});
|
|
1069
|
-
$[151] = props.arrow;
|
|
1070
|
-
$[152] = t67;
|
|
1071
|
-
} else t67 = $[152];
|
|
1072
|
-
let t68;
|
|
1073
|
-
if ($[153] !== t66 || $[154] !== t67) {
|
|
1074
|
-
t68 = /*#__PURE__*/ jsxs(color_picker_PickerSurface, {
|
|
1075
|
-
children: [
|
|
1076
|
-
t66,
|
|
1077
|
-
t67
|
|
1078
|
-
]
|
|
1079
|
-
});
|
|
1080
|
-
$[153] = t66;
|
|
1081
|
-
$[154] = t67;
|
|
1082
|
-
$[155] = t68;
|
|
1083
|
-
} else t68 = $[155];
|
|
1084
|
-
let t69;
|
|
1085
|
-
if ($[156] !== align || $[157] !== enter || $[158] !== leave || $[159] !== messages.colorPicker || $[160] !== side || $[161] !== t52 || $[162] !== t53 || $[163] !== t54 || $[164] !== t55 || $[165] !== t58 || $[166] !== t59 || $[167] !== t68) {
|
|
1086
|
-
t69 = /*#__PURE__*/ jsx(TaoPortalScope, {
|
|
1087
|
-
asChild: true,
|
|
1088
|
-
children: /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_popover_c8444160.Content, {
|
|
1089
|
-
asChild: true,
|
|
1090
|
-
"data-tao-color-popup": "",
|
|
1091
|
-
"data-tao-keep-alive": t52,
|
|
1092
|
-
"aria-label": messages.colorPicker,
|
|
1093
|
-
side: side,
|
|
1094
|
-
align: align,
|
|
1095
|
-
sideOffset: 6,
|
|
1096
|
-
collisionPadding: 12,
|
|
1097
|
-
avoidCollisions: t53,
|
|
1098
|
-
onPointerEnter: enter,
|
|
1099
|
-
onPointerLeave: leave,
|
|
1100
|
-
onInteractOutside: t54,
|
|
1101
|
-
className: t55,
|
|
1102
|
-
style: t58,
|
|
1103
|
-
onOpenAutoFocus: t59,
|
|
1104
|
-
children: t68
|
|
472
|
+
}
|
|
473
|
+
};
|
|
474
|
+
const basicPanel = /*#__PURE__*/ jsxs(Fragment, {
|
|
475
|
+
children: [
|
|
476
|
+
/*#__PURE__*/ jsx(PickerPanel, {}),
|
|
477
|
+
/*#__PURE__*/ jsx(PresetsPanel, {})
|
|
478
|
+
]
|
|
479
|
+
});
|
|
480
|
+
const placement = props.placement ?? 'bottomLeft';
|
|
481
|
+
const side = placement.startsWith('top') ? 'top' : placement.startsWith('left') ? 'left' : placement.startsWith('right') ? 'right' : 'bottom';
|
|
482
|
+
const align = 'object' == typeof props.arrow && props.arrow.pointAtCenter ? 'center' : /Left|Top/.test(placement) ? 'start' : /Right|Bottom/.test(placement) ? 'end' : 'center';
|
|
483
|
+
const text = 'function' == typeof props.showText ? props.showText(value) : value.cleared ? messages.colorTransparent : value.isGradient() ? messages.colorGradient : 'rgb' === format ? value.toRgbString() : 'hsb' === format ? value.toHsbString() : value.toHexString();
|
|
484
|
+
const dataProps = Object.fromEntries(Object.entries(props).filter(([key])=>key.startsWith('data-')));
|
|
485
|
+
const defaultTrigger = /*#__PURE__*/ jsxs("button", {
|
|
486
|
+
type: "button",
|
|
487
|
+
disabled: disabled,
|
|
488
|
+
"aria-label": `${messages.chooseColor} ${value.toHexString()}`,
|
|
489
|
+
children: [
|
|
490
|
+
/*#__PURE__*/ jsx("span", {
|
|
491
|
+
"data-tao-color-body": "",
|
|
492
|
+
className: names?.body,
|
|
493
|
+
style: styles?.body,
|
|
494
|
+
children: /*#__PURE__*/ jsx("span", {
|
|
495
|
+
"data-tao-color-content": "",
|
|
496
|
+
className: names?.content,
|
|
497
|
+
style: {
|
|
498
|
+
background: value.toCssString(),
|
|
499
|
+
...styles?.content
|
|
500
|
+
}
|
|
501
|
+
})
|
|
502
|
+
}),
|
|
503
|
+
props.showText && /*#__PURE__*/ jsx("span", {
|
|
504
|
+
"data-tao-color-description": "",
|
|
505
|
+
className: names?.description,
|
|
506
|
+
style: styles?.description,
|
|
507
|
+
children: text
|
|
1105
508
|
})
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
container: t50,
|
|
1125
|
-
forceMount: t51,
|
|
1126
|
-
children: t69
|
|
1127
|
-
});
|
|
1128
|
-
$[169] = t50;
|
|
1129
|
-
$[170] = t51;
|
|
1130
|
-
$[171] = t69;
|
|
1131
|
-
$[172] = t70;
|
|
1132
|
-
} else t70 = $[172];
|
|
1133
|
-
let t71;
|
|
1134
|
-
if ($[173] !== open || $[174] !== openChange || $[175] !== t49 || $[176] !== t70) {
|
|
1135
|
-
t71 = /*#__PURE__*/ jsxs(__rspack_external__radix_ui_react_popover_c8444160.Root, {
|
|
509
|
+
]
|
|
510
|
+
});
|
|
511
|
+
const customTrigger = /*#__PURE__*/ isValidElement(props.children) ? asTriggerChild(props.children) : props.children;
|
|
512
|
+
const trigger = disabled && /*#__PURE__*/ isValidElement(customTrigger) && ('button' === customTrigger.type || customTrigger.type === Button) ? /*#__PURE__*/ cloneElement(customTrigger, {
|
|
513
|
+
disabled: true
|
|
514
|
+
}) : customTrigger;
|
|
515
|
+
return /*#__PURE__*/ jsx("span", {
|
|
516
|
+
ref: setTriggerElement,
|
|
517
|
+
"data-tao-color-picker": "",
|
|
518
|
+
"data-tao-size": 'middle' === props.size ? 'medium' : props.size ?? config.size,
|
|
519
|
+
"data-disabled": disabled || void 0,
|
|
520
|
+
className: cx(names?.root, props.className, props.rootClassName),
|
|
521
|
+
style: {
|
|
522
|
+
...styles?.root,
|
|
523
|
+
...props.style
|
|
524
|
+
},
|
|
525
|
+
...dataProps,
|
|
526
|
+
children: /*#__PURE__*/ jsxs(__rspack_external__radix_ui_react_popover_c8444160.Root, {
|
|
1136
527
|
open: open,
|
|
1137
528
|
onOpenChange: openChange,
|
|
1138
529
|
children: [
|
|
1139
|
-
|
|
1140
|
-
|
|
530
|
+
/*#__PURE__*/ jsx(__rspack_external__radix_ui_react_popover_c8444160.Trigger, {
|
|
531
|
+
asChild: true,
|
|
532
|
+
onPointerEnter: enter,
|
|
533
|
+
onPointerLeave: leave,
|
|
534
|
+
onPointerDown: (event)=>{
|
|
535
|
+
touchPointer.current = 'touch' === event.pointerType;
|
|
536
|
+
},
|
|
537
|
+
onClick: (event)=>{
|
|
538
|
+
const touch = touchPointer.current;
|
|
539
|
+
touchPointer.current = false;
|
|
540
|
+
if (disabled || 'hover' === props.trigger && 0 !== event.detail && !touch) event.preventDefault();
|
|
541
|
+
else if (!open) keyboardOpening.current = 0 === event.detail;
|
|
542
|
+
},
|
|
543
|
+
children: /*#__PURE__*/ isValidElement(trigger) ? trigger : trigger || 0 === trigger ? /*#__PURE__*/ jsx("button", {
|
|
544
|
+
type: "button",
|
|
545
|
+
disabled: disabled,
|
|
546
|
+
children: trigger
|
|
547
|
+
}) : defaultTrigger
|
|
548
|
+
}),
|
|
549
|
+
/*#__PURE__*/ jsx(__rspack_external__radix_ui_react_popover_c8444160.Portal, {
|
|
550
|
+
container: triggerElement ? props.getPopupContainer?.(triggerElement) : void 0,
|
|
551
|
+
forceMount: keepAlive || void 0,
|
|
552
|
+
children: /*#__PURE__*/ jsx(TaoPortalScope, {
|
|
553
|
+
asChild: true,
|
|
554
|
+
children: /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_popover_c8444160.Content, {
|
|
555
|
+
asChild: true,
|
|
556
|
+
"data-tao-color-popup": "",
|
|
557
|
+
"data-tao-keep-alive": keepAlive || void 0,
|
|
558
|
+
"aria-label": messages.colorPicker,
|
|
559
|
+
side: side,
|
|
560
|
+
align: align,
|
|
561
|
+
sideOffset: 6,
|
|
562
|
+
collisionPadding: 12,
|
|
563
|
+
avoidCollisions: props.autoAdjustOverflow ?? true,
|
|
564
|
+
onPointerEnter: enter,
|
|
565
|
+
onPointerLeave: leave,
|
|
566
|
+
onInteractOutside: (event)=>{
|
|
567
|
+
if (!open) event.preventDefault();
|
|
568
|
+
},
|
|
569
|
+
className: names?.popup?.root,
|
|
570
|
+
style: {
|
|
571
|
+
...styles?.popup?.root,
|
|
572
|
+
...open ? {} : {
|
|
573
|
+
display: 'none'
|
|
574
|
+
}
|
|
575
|
+
},
|
|
576
|
+
onOpenAutoFocus: (event)=>{
|
|
577
|
+
if ('hover' === props.trigger && !keyboardOpening.current) event.preventDefault();
|
|
578
|
+
keyboardOpening.current = false;
|
|
579
|
+
},
|
|
580
|
+
children: /*#__PURE__*/ jsxs(color_picker_PickerSurface, {
|
|
581
|
+
children: [
|
|
582
|
+
/*#__PURE__*/ jsx("div", {
|
|
583
|
+
"data-tao-color-container": "",
|
|
584
|
+
className: names?.popup?.container,
|
|
585
|
+
style: {
|
|
586
|
+
...styles?.popupOverlayInner,
|
|
587
|
+
...styles?.popup?.container
|
|
588
|
+
},
|
|
589
|
+
children: /*#__PURE__*/ jsx(PanelContext.Provider, {
|
|
590
|
+
value: panelState,
|
|
591
|
+
children: props.panelRender ? props.panelRender(basicPanel, {
|
|
592
|
+
components: {
|
|
593
|
+
Picker: PickerPanel,
|
|
594
|
+
Presets: PresetsPanel
|
|
595
|
+
}
|
|
596
|
+
}) : basicPanel
|
|
597
|
+
})
|
|
598
|
+
}),
|
|
599
|
+
false !== props.arrow && /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_popover_c8444160.Arrow, {
|
|
600
|
+
"data-tao-color-arrow": ""
|
|
601
|
+
})
|
|
602
|
+
]
|
|
603
|
+
})
|
|
604
|
+
})
|
|
605
|
+
})
|
|
606
|
+
})
|
|
1141
607
|
]
|
|
1142
|
-
})
|
|
1143
|
-
|
|
1144
|
-
$[174] = openChange;
|
|
1145
|
-
$[175] = t49;
|
|
1146
|
-
$[176] = t70;
|
|
1147
|
-
$[177] = t71;
|
|
1148
|
-
} else t71 = $[177];
|
|
1149
|
-
let t72;
|
|
1150
|
-
if ($[178] !== dataProps || $[179] !== t40 || $[180] !== t41 || $[181] !== t43 || $[182] !== t45 || $[183] !== t71) {
|
|
1151
|
-
t72 = /*#__PURE__*/ jsx("span", {
|
|
1152
|
-
ref: setTriggerElement,
|
|
1153
|
-
"data-tao-color-picker": "",
|
|
1154
|
-
"data-tao-size": t40,
|
|
1155
|
-
"data-disabled": t41,
|
|
1156
|
-
className: t43,
|
|
1157
|
-
style: t45,
|
|
1158
|
-
...dataProps,
|
|
1159
|
-
children: t71
|
|
1160
|
-
});
|
|
1161
|
-
$[178] = dataProps;
|
|
1162
|
-
$[179] = t40;
|
|
1163
|
-
$[180] = t41;
|
|
1164
|
-
$[181] = t43;
|
|
1165
|
-
$[182] = t45;
|
|
1166
|
-
$[183] = t71;
|
|
1167
|
-
$[184] = t72;
|
|
1168
|
-
} else t72 = $[184];
|
|
1169
|
-
return t72;
|
|
1170
|
-
}
|
|
1171
|
-
function _temp5(t0) {
|
|
1172
|
-
const [key] = t0;
|
|
1173
|
-
return key.startsWith("data-");
|
|
608
|
+
})
|
|
609
|
+
});
|
|
1174
610
|
}
|
|
1175
611
|
export { ColorPicker };
|