@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,523 +1,195 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { useTaoConfig } from "../../provider/tao-provider.js";
|
|
2
|
+
import { createContext, forwardRef, useCallback, useContext, useEffect, useLayoutEffect, useRef, useState } from "react";
|
|
3
|
+
import { useTaoConfig } from "../../provider/tao-context.js";
|
|
5
4
|
import { mergeRefs } from "../../utils/refs.js";
|
|
6
5
|
import { cx } from "../../utils/semantic.js";
|
|
7
6
|
import "./checkbox.css";
|
|
8
7
|
const CheckboxGroupContext = /*#__PURE__*/ createContext(null);
|
|
9
8
|
const checkbox_Checkbox = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
10
|
-
const
|
|
11
|
-
let ariaProps;
|
|
12
|
-
let checked;
|
|
13
|
-
let children;
|
|
14
|
-
let classNames;
|
|
15
|
-
let defaultChecked;
|
|
16
|
-
let disabled;
|
|
17
|
-
let indeterminate;
|
|
18
|
-
let onChange;
|
|
19
|
-
let styles;
|
|
20
|
-
let value;
|
|
21
|
-
if ($[0] !== props) {
|
|
22
|
-
({ checked, defaultChecked, indeterminate, disabled, onChange, value, children, classNames, styles, ...ariaProps } = props);
|
|
23
|
-
$[0] = props;
|
|
24
|
-
$[1] = ariaProps;
|
|
25
|
-
$[2] = checked;
|
|
26
|
-
$[3] = children;
|
|
27
|
-
$[4] = classNames;
|
|
28
|
-
$[5] = defaultChecked;
|
|
29
|
-
$[6] = disabled;
|
|
30
|
-
$[7] = indeterminate;
|
|
31
|
-
$[8] = onChange;
|
|
32
|
-
$[9] = styles;
|
|
33
|
-
$[10] = value;
|
|
34
|
-
} else {
|
|
35
|
-
ariaProps = $[1];
|
|
36
|
-
checked = $[2];
|
|
37
|
-
children = $[3];
|
|
38
|
-
classNames = $[4];
|
|
39
|
-
defaultChecked = $[5];
|
|
40
|
-
disabled = $[6];
|
|
41
|
-
indeterminate = $[7];
|
|
42
|
-
onChange = $[8];
|
|
43
|
-
styles = $[9];
|
|
44
|
-
value = $[10];
|
|
45
|
-
}
|
|
9
|
+
const { checked, defaultChecked, indeterminate, disabled, onChange, value, children, classNames, styles, ...ariaProps } = props;
|
|
46
10
|
const ctx = useTaoConfig();
|
|
47
11
|
const groupCtx = useContext(CheckboxGroupContext);
|
|
48
12
|
const inputRef = useRef(null);
|
|
49
13
|
const resolvedDisabled = disabled ?? groupCtx?.disabled ?? ctx.disabled ?? false;
|
|
50
14
|
const grouped = groupCtx && null != value;
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
$[31] = value;
|
|
119
|
-
$[32] = t6;
|
|
120
|
-
} else t6 = $[32];
|
|
121
|
-
const handleChange = t6;
|
|
122
|
-
const t7 = resolvedDisabled || void 0;
|
|
123
|
-
const t8 = groupCtx?.size ?? ctx.size;
|
|
124
|
-
const t9 = classNames?.root;
|
|
125
|
-
let t10;
|
|
126
|
-
if ($[33] !== t9) {
|
|
127
|
-
t10 = cx(t9);
|
|
128
|
-
$[33] = t9;
|
|
129
|
-
$[34] = t10;
|
|
130
|
-
} else t10 = $[34];
|
|
131
|
-
const t11 = styles?.root;
|
|
132
|
-
let t12;
|
|
133
|
-
if ($[35] !== ref) {
|
|
134
|
-
t12 = mergeRefs(inputRef, ref);
|
|
135
|
-
$[35] = ref;
|
|
136
|
-
$[36] = t12;
|
|
137
|
-
} else t12 = $[36];
|
|
138
|
-
const t13 = void 0 === resolvedChecked ? defaultChecked : void 0;
|
|
139
|
-
const t14 = indeterminate ? "mixed" : void 0;
|
|
140
|
-
let t15;
|
|
141
|
-
if ($[37] !== ariaProps || $[38] !== handleChange || $[39] !== resolvedChecked || $[40] !== resolvedDisabled || $[41] !== t12 || $[42] !== t13 || $[43] !== t14 || $[44] !== value) {
|
|
142
|
-
t15 = /*#__PURE__*/ jsx("input", {
|
|
143
|
-
...ariaProps,
|
|
144
|
-
ref: t12,
|
|
145
|
-
type: "checkbox",
|
|
146
|
-
value: value,
|
|
147
|
-
checked: resolvedChecked,
|
|
148
|
-
defaultChecked: t13,
|
|
149
|
-
disabled: resolvedDisabled,
|
|
150
|
-
onChange: handleChange,
|
|
151
|
-
"aria-checked": t14,
|
|
152
|
-
"data-tao-checkbox-input": ""
|
|
153
|
-
});
|
|
154
|
-
$[37] = ariaProps;
|
|
155
|
-
$[38] = handleChange;
|
|
156
|
-
$[39] = resolvedChecked;
|
|
157
|
-
$[40] = resolvedDisabled;
|
|
158
|
-
$[41] = t12;
|
|
159
|
-
$[42] = t13;
|
|
160
|
-
$[43] = t14;
|
|
161
|
-
$[44] = value;
|
|
162
|
-
$[45] = t15;
|
|
163
|
-
} else t15 = $[45];
|
|
164
|
-
const t16 = resolvedChecked || void 0;
|
|
165
|
-
const t17 = indeterminate || void 0;
|
|
166
|
-
const t18 = classNames?.indicator;
|
|
167
|
-
let t19;
|
|
168
|
-
if ($[46] !== t18) {
|
|
169
|
-
t19 = cx(t18);
|
|
170
|
-
$[46] = t18;
|
|
171
|
-
$[47] = t19;
|
|
172
|
-
} else t19 = $[47];
|
|
173
|
-
const t20 = styles?.indicator;
|
|
174
|
-
let t21;
|
|
175
|
-
if ($[48] !== indeterminate) {
|
|
176
|
-
t21 = !indeterminate && /*#__PURE__*/ jsx(CheckIcon, {});
|
|
177
|
-
$[48] = indeterminate;
|
|
178
|
-
$[49] = t21;
|
|
179
|
-
} else t21 = $[49];
|
|
180
|
-
let t22;
|
|
181
|
-
if ($[50] !== indeterminate) {
|
|
182
|
-
t22 = indeterminate && /*#__PURE__*/ jsx(MinusIcon, {});
|
|
183
|
-
$[50] = indeterminate;
|
|
184
|
-
$[51] = t22;
|
|
185
|
-
} else t22 = $[51];
|
|
186
|
-
let t23;
|
|
187
|
-
if ($[52] !== t16 || $[53] !== t17 || $[54] !== t19 || $[55] !== t20 || $[56] !== t21 || $[57] !== t22) {
|
|
188
|
-
t23 = /*#__PURE__*/ jsxs("span", {
|
|
189
|
-
"data-tao-checkbox": "",
|
|
190
|
-
"data-tao-checked": t16,
|
|
191
|
-
"data-tao-indeterminate": t17,
|
|
192
|
-
className: t19,
|
|
193
|
-
style: t20,
|
|
194
|
-
children: [
|
|
195
|
-
t21,
|
|
196
|
-
t22
|
|
197
|
-
]
|
|
198
|
-
});
|
|
199
|
-
$[52] = t16;
|
|
200
|
-
$[53] = t17;
|
|
201
|
-
$[54] = t19;
|
|
202
|
-
$[55] = t20;
|
|
203
|
-
$[56] = t21;
|
|
204
|
-
$[57] = t22;
|
|
205
|
-
$[58] = t23;
|
|
206
|
-
} else t23 = $[58];
|
|
207
|
-
let t24;
|
|
208
|
-
if ($[59] !== t15 || $[60] !== t23) {
|
|
209
|
-
t24 = /*#__PURE__*/ jsxs("span", {
|
|
210
|
-
"data-tao-checkbox-control": "",
|
|
211
|
-
children: [
|
|
212
|
-
t15,
|
|
213
|
-
t23
|
|
214
|
-
]
|
|
215
|
-
});
|
|
216
|
-
$[59] = t15;
|
|
217
|
-
$[60] = t23;
|
|
218
|
-
$[61] = t24;
|
|
219
|
-
} else t24 = $[61];
|
|
220
|
-
let t25;
|
|
221
|
-
if ($[62] !== children || $[63] !== classNames?.label || $[64] !== styles?.label) {
|
|
222
|
-
t25 = null != children && /*#__PURE__*/ jsx("span", {
|
|
223
|
-
"data-tao-checkbox-label": "",
|
|
224
|
-
className: cx(classNames?.label),
|
|
225
|
-
style: styles?.label,
|
|
226
|
-
children: children
|
|
227
|
-
});
|
|
228
|
-
$[62] = children;
|
|
229
|
-
$[63] = classNames?.label;
|
|
230
|
-
$[64] = styles?.label;
|
|
231
|
-
$[65] = t25;
|
|
232
|
-
} else t25 = $[65];
|
|
233
|
-
let t26;
|
|
234
|
-
if ($[66] !== t10 || $[67] !== t11 || $[68] !== t24 || $[69] !== t25 || $[70] !== t7 || $[71] !== t8) {
|
|
235
|
-
t26 = /*#__PURE__*/ jsxs("label", {
|
|
236
|
-
"data-tao-checkbox-wrapper": "",
|
|
237
|
-
"data-tao-disabled": t7,
|
|
238
|
-
"data-tao-size": t8,
|
|
239
|
-
className: t10,
|
|
240
|
-
style: t11,
|
|
241
|
-
children: [
|
|
242
|
-
t24,
|
|
243
|
-
t25
|
|
244
|
-
]
|
|
245
|
-
});
|
|
246
|
-
$[66] = t10;
|
|
247
|
-
$[67] = t11;
|
|
248
|
-
$[68] = t24;
|
|
249
|
-
$[69] = t25;
|
|
250
|
-
$[70] = t7;
|
|
251
|
-
$[71] = t8;
|
|
252
|
-
$[72] = t26;
|
|
253
|
-
} else t26 = $[72];
|
|
254
|
-
return t26;
|
|
15
|
+
const resolvedChecked = grouped ? groupCtx.value.includes(value) : 'checked' in props ? checked ?? false : void 0;
|
|
16
|
+
const resetChecked = grouped ? groupCtx.resetValue.includes(value) : resolvedChecked;
|
|
17
|
+
useLayoutEffect(()=>{
|
|
18
|
+
const input = inputRef.current;
|
|
19
|
+
if (input?.form && void 0 !== resetChecked) input.defaultChecked = resetChecked;
|
|
20
|
+
}, [
|
|
21
|
+
resetChecked
|
|
22
|
+
]);
|
|
23
|
+
useEffect(()=>{
|
|
24
|
+
if (inputRef.current) inputRef.current.indeterminate = !!indeterminate;
|
|
25
|
+
}, [
|
|
26
|
+
indeterminate
|
|
27
|
+
]);
|
|
28
|
+
const handleChange = useCallback((e)=>{
|
|
29
|
+
const nextChecked = e.currentTarget.checked;
|
|
30
|
+
if (indeterminate) e.currentTarget.indeterminate = true;
|
|
31
|
+
onChange?.(e);
|
|
32
|
+
if (!e.defaultPrevented && groupCtx && null != value) groupCtx.onChange(value, nextChecked);
|
|
33
|
+
}, [
|
|
34
|
+
groupCtx,
|
|
35
|
+
value,
|
|
36
|
+
indeterminate,
|
|
37
|
+
onChange
|
|
38
|
+
]);
|
|
39
|
+
return /*#__PURE__*/ jsxs("label", {
|
|
40
|
+
"data-tao-checkbox-wrapper": "",
|
|
41
|
+
"data-tao-disabled": resolvedDisabled || void 0,
|
|
42
|
+
"data-tao-size": groupCtx?.size ?? ctx.size,
|
|
43
|
+
className: cx(classNames?.root),
|
|
44
|
+
style: styles?.root,
|
|
45
|
+
children: [
|
|
46
|
+
/*#__PURE__*/ jsxs("span", {
|
|
47
|
+
"data-tao-checkbox-control": "",
|
|
48
|
+
children: [
|
|
49
|
+
/*#__PURE__*/ jsx("input", {
|
|
50
|
+
...ariaProps,
|
|
51
|
+
ref: mergeRefs(inputRef, ref),
|
|
52
|
+
type: "checkbox",
|
|
53
|
+
value: value,
|
|
54
|
+
checked: resolvedChecked,
|
|
55
|
+
defaultChecked: void 0 === resolvedChecked ? defaultChecked : void 0,
|
|
56
|
+
disabled: resolvedDisabled,
|
|
57
|
+
onChange: handleChange,
|
|
58
|
+
"aria-checked": indeterminate ? 'mixed' : void 0,
|
|
59
|
+
"data-tao-checkbox-input": ""
|
|
60
|
+
}),
|
|
61
|
+
/*#__PURE__*/ jsxs("span", {
|
|
62
|
+
"data-tao-checkbox": "",
|
|
63
|
+
"data-tao-checked": resolvedChecked || void 0,
|
|
64
|
+
"data-tao-indeterminate": indeterminate || void 0,
|
|
65
|
+
className: cx(classNames?.indicator),
|
|
66
|
+
style: styles?.indicator,
|
|
67
|
+
children: [
|
|
68
|
+
!indeterminate && /*#__PURE__*/ jsx(CheckIcon, {}),
|
|
69
|
+
indeterminate && /*#__PURE__*/ jsx(MinusIcon, {})
|
|
70
|
+
]
|
|
71
|
+
})
|
|
72
|
+
]
|
|
73
|
+
}),
|
|
74
|
+
null != children && /*#__PURE__*/ jsx("span", {
|
|
75
|
+
"data-tao-checkbox-label": "",
|
|
76
|
+
className: cx(classNames?.label),
|
|
77
|
+
style: styles?.label,
|
|
78
|
+
children: children
|
|
79
|
+
})
|
|
80
|
+
]
|
|
81
|
+
});
|
|
255
82
|
});
|
|
256
83
|
function CheckboxGroup(props) {
|
|
257
|
-
const
|
|
258
|
-
const { options, value, defaultValue, onChange, onBlur, disabled, size, direction: t0, children } = props;
|
|
259
|
-
const direction = void 0 === t0 ? "horizontal" : t0;
|
|
84
|
+
const { options, value, defaultValue, onChange, onBlur, disabled, size, direction = 'horizontal', children } = props;
|
|
260
85
|
const ctx = useTaoConfig();
|
|
261
86
|
const resolvedDisabled = disabled ?? ctx.disabled ?? false;
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
$[0] = defaultValue;
|
|
268
|
-
$[1] = t1;
|
|
269
|
-
} else t1 = $[1];
|
|
270
|
-
const [internalValue, setInternalValue] = useState(t1);
|
|
271
|
-
const isControlled = "value" in props;
|
|
272
|
-
let t2;
|
|
273
|
-
if ($[2] !== internalValue || $[3] !== isControlled || $[4] !== value) {
|
|
274
|
-
t2 = isControlled ? value ?? [] : internalValue;
|
|
275
|
-
$[2] = internalValue;
|
|
276
|
-
$[3] = isControlled;
|
|
277
|
-
$[4] = value;
|
|
278
|
-
$[5] = t2;
|
|
279
|
-
} else t2 = $[5];
|
|
280
|
-
const resolvedValue = t2;
|
|
87
|
+
const [internalValue, setInternalValue] = useState(()=>[
|
|
88
|
+
...new Set(defaultValue ?? [])
|
|
89
|
+
]);
|
|
90
|
+
const isControlled = 'value' in props;
|
|
91
|
+
const resolvedValue = isControlled ? value ?? [] : internalValue;
|
|
281
92
|
const root = useRef(null);
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
...new Set(defaultValue ?? [])
|
|
292
|
-
]);
|
|
293
|
-
});
|
|
294
|
-
};
|
|
295
|
-
form?.addEventListener("reset", reset);
|
|
296
|
-
return ()=>form?.removeEventListener("reset", reset);
|
|
93
|
+
useEffect(()=>{
|
|
94
|
+
if (isControlled) return;
|
|
95
|
+
const form = root.current?.form;
|
|
96
|
+
const reset = (event)=>{
|
|
97
|
+
queueMicrotask(()=>{
|
|
98
|
+
if (!event.defaultPrevented) setInternalValue([
|
|
99
|
+
...new Set(defaultValue ?? [])
|
|
100
|
+
]);
|
|
101
|
+
});
|
|
297
102
|
};
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
103
|
+
form?.addEventListener('reset', reset);
|
|
104
|
+
return ()=>form?.removeEventListener('reset', reset);
|
|
105
|
+
}, [
|
|
106
|
+
isControlled,
|
|
107
|
+
defaultValue
|
|
108
|
+
]);
|
|
109
|
+
const handleItemChange = useCallback((itemValue, checked)=>{
|
|
110
|
+
const next = [
|
|
111
|
+
...new Set(checked ? [
|
|
112
|
+
...resolvedValue,
|
|
113
|
+
itemValue
|
|
114
|
+
] : resolvedValue.filter((v)=>v !== itemValue))
|
|
301
115
|
];
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
t8 = {
|
|
343
|
-
value: resolvedValue,
|
|
344
|
-
resetValue: t6,
|
|
345
|
-
disabled: resolvedDisabled,
|
|
346
|
-
size: t7,
|
|
347
|
-
onChange: handleItemChange
|
|
348
|
-
};
|
|
349
|
-
$[18] = handleItemChange;
|
|
350
|
-
$[19] = resolvedDisabled;
|
|
351
|
-
$[20] = resolvedValue;
|
|
352
|
-
$[21] = t6;
|
|
353
|
-
$[22] = t7;
|
|
354
|
-
$[23] = t8;
|
|
355
|
-
} else t8 = $[23];
|
|
356
|
-
const groupCtxValue = t8;
|
|
357
|
-
let T0;
|
|
358
|
-
let t10;
|
|
359
|
-
let t11;
|
|
360
|
-
let t12;
|
|
361
|
-
let t13;
|
|
362
|
-
let t14;
|
|
363
|
-
let t15;
|
|
364
|
-
let t16;
|
|
365
|
-
let t17;
|
|
366
|
-
let t18;
|
|
367
|
-
let t19;
|
|
368
|
-
let t20;
|
|
369
|
-
let t9;
|
|
370
|
-
if ($[24] !== children || $[25] !== direction || $[26] !== groupCtxValue || $[27] !== onBlur || $[28] !== options || $[29] !== props) {
|
|
371
|
-
const normalizedOptions = options?.map(_temp);
|
|
372
|
-
T0 = CheckboxGroupContext.Provider;
|
|
373
|
-
t20 = groupCtxValue;
|
|
374
|
-
t9 = root;
|
|
375
|
-
t10 = "";
|
|
376
|
-
t11 = direction;
|
|
377
|
-
t12 = props.id;
|
|
378
|
-
t13 = props["aria-label"];
|
|
379
|
-
t14 = props["aria-labelledby"];
|
|
380
|
-
t15 = props["aria-describedby"];
|
|
381
|
-
t16 = props["aria-errormessage"];
|
|
382
|
-
t17 = props["aria-invalid"];
|
|
383
|
-
t18 = onBlur;
|
|
384
|
-
t19 = normalizedOptions ? normalizedOptions.map(_temp2) : children;
|
|
385
|
-
$[24] = children;
|
|
386
|
-
$[25] = direction;
|
|
387
|
-
$[26] = groupCtxValue;
|
|
388
|
-
$[27] = onBlur;
|
|
389
|
-
$[28] = options;
|
|
390
|
-
$[29] = props;
|
|
391
|
-
$[30] = T0;
|
|
392
|
-
$[31] = t10;
|
|
393
|
-
$[32] = t11;
|
|
394
|
-
$[33] = t12;
|
|
395
|
-
$[34] = t13;
|
|
396
|
-
$[35] = t14;
|
|
397
|
-
$[36] = t15;
|
|
398
|
-
$[37] = t16;
|
|
399
|
-
$[38] = t17;
|
|
400
|
-
$[39] = t18;
|
|
401
|
-
$[40] = t19;
|
|
402
|
-
$[41] = t20;
|
|
403
|
-
$[42] = t9;
|
|
404
|
-
} else {
|
|
405
|
-
T0 = $[30];
|
|
406
|
-
t10 = $[31];
|
|
407
|
-
t11 = $[32];
|
|
408
|
-
t12 = $[33];
|
|
409
|
-
t13 = $[34];
|
|
410
|
-
t14 = $[35];
|
|
411
|
-
t15 = $[36];
|
|
412
|
-
t16 = $[37];
|
|
413
|
-
t17 = $[38];
|
|
414
|
-
t18 = $[39];
|
|
415
|
-
t19 = $[40];
|
|
416
|
-
t20 = $[41];
|
|
417
|
-
t9 = $[42];
|
|
418
|
-
}
|
|
419
|
-
let t21;
|
|
420
|
-
if ($[43] !== t10 || $[44] !== t11 || $[45] !== t12 || $[46] !== t13 || $[47] !== t14 || $[48] !== t15 || $[49] !== t16 || $[50] !== t17 || $[51] !== t18 || $[52] !== t19 || $[53] !== t9) {
|
|
421
|
-
t21 = /*#__PURE__*/ jsx("fieldset", {
|
|
422
|
-
ref: t9,
|
|
423
|
-
"data-tao-checkbox-group": t10,
|
|
424
|
-
"data-tao-direction": t11,
|
|
425
|
-
id: t12,
|
|
426
|
-
"aria-label": t13,
|
|
427
|
-
"aria-labelledby": t14,
|
|
428
|
-
"aria-describedby": t15,
|
|
429
|
-
"aria-errormessage": t16,
|
|
430
|
-
"aria-invalid": t17,
|
|
431
|
-
onBlur: t18,
|
|
432
|
-
children: t19
|
|
433
|
-
});
|
|
434
|
-
$[43] = t10;
|
|
435
|
-
$[44] = t11;
|
|
436
|
-
$[45] = t12;
|
|
437
|
-
$[46] = t13;
|
|
438
|
-
$[47] = t14;
|
|
439
|
-
$[48] = t15;
|
|
440
|
-
$[49] = t16;
|
|
441
|
-
$[50] = t17;
|
|
442
|
-
$[51] = t18;
|
|
443
|
-
$[52] = t19;
|
|
444
|
-
$[53] = t9;
|
|
445
|
-
$[54] = t21;
|
|
446
|
-
} else t21 = $[54];
|
|
447
|
-
let t22;
|
|
448
|
-
if ($[55] !== T0 || $[56] !== t20 || $[57] !== t21) {
|
|
449
|
-
t22 = /*#__PURE__*/ jsx(T0, {
|
|
450
|
-
value: t20,
|
|
451
|
-
children: t21
|
|
452
|
-
});
|
|
453
|
-
$[55] = T0;
|
|
454
|
-
$[56] = t20;
|
|
455
|
-
$[57] = t21;
|
|
456
|
-
$[58] = t22;
|
|
457
|
-
} else t22 = $[58];
|
|
458
|
-
return t22;
|
|
459
|
-
}
|
|
460
|
-
function _temp2(opt_0) {
|
|
461
|
-
return /*#__PURE__*/ jsx(checkbox_Checkbox, {
|
|
462
|
-
value: opt_0.value,
|
|
463
|
-
disabled: opt_0.disabled,
|
|
464
|
-
children: opt_0.label
|
|
465
|
-
}, opt_0.value);
|
|
466
|
-
}
|
|
467
|
-
function _temp(opt) {
|
|
468
|
-
return "string" == typeof opt ? {
|
|
469
|
-
label: opt,
|
|
470
|
-
value: opt
|
|
471
|
-
} : opt;
|
|
116
|
+
if (!isControlled) setInternalValue(next);
|
|
117
|
+
onChange?.([
|
|
118
|
+
...next
|
|
119
|
+
]);
|
|
120
|
+
}, [
|
|
121
|
+
resolvedValue,
|
|
122
|
+
onChange,
|
|
123
|
+
isControlled
|
|
124
|
+
]);
|
|
125
|
+
const groupCtxValue = {
|
|
126
|
+
value: resolvedValue,
|
|
127
|
+
resetValue: isControlled ? resolvedValue : defaultValue ?? [],
|
|
128
|
+
disabled: resolvedDisabled,
|
|
129
|
+
size: size ?? ctx.size,
|
|
130
|
+
onChange: handleItemChange
|
|
131
|
+
};
|
|
132
|
+
const normalizedOptions = options?.map((opt)=>'string' == typeof opt ? {
|
|
133
|
+
label: opt,
|
|
134
|
+
value: opt
|
|
135
|
+
} : opt);
|
|
136
|
+
return /*#__PURE__*/ jsx(CheckboxGroupContext.Provider, {
|
|
137
|
+
value: groupCtxValue,
|
|
138
|
+
children: /*#__PURE__*/ jsx("fieldset", {
|
|
139
|
+
ref: root,
|
|
140
|
+
"data-tao-checkbox-group": "",
|
|
141
|
+
"data-tao-direction": direction,
|
|
142
|
+
id: props.id,
|
|
143
|
+
"aria-label": props['aria-label'],
|
|
144
|
+
"aria-labelledby": props['aria-labelledby'],
|
|
145
|
+
"aria-describedby": props['aria-describedby'],
|
|
146
|
+
"aria-errormessage": props['aria-errormessage'],
|
|
147
|
+
"aria-invalid": props['aria-invalid'],
|
|
148
|
+
onBlur: onBlur,
|
|
149
|
+
children: normalizedOptions ? normalizedOptions.map((opt)=>/*#__PURE__*/ jsx(checkbox_Checkbox, {
|
|
150
|
+
value: opt.value,
|
|
151
|
+
disabled: opt.disabled,
|
|
152
|
+
children: opt.label
|
|
153
|
+
}, opt.value)) : children
|
|
154
|
+
})
|
|
155
|
+
});
|
|
472
156
|
}
|
|
473
157
|
function CheckIcon() {
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
points: "20 6 9 17 4 12"
|
|
491
|
-
})
|
|
492
|
-
});
|
|
493
|
-
$[0] = t0;
|
|
494
|
-
} else t0 = $[0];
|
|
495
|
-
return t0;
|
|
158
|
+
return /*#__PURE__*/ jsx("svg", {
|
|
159
|
+
"data-tao-checkbox-icon": "",
|
|
160
|
+
"aria-hidden": "true",
|
|
161
|
+
focusable: "false",
|
|
162
|
+
width: "12",
|
|
163
|
+
height: "12",
|
|
164
|
+
viewBox: "0 0 24 24",
|
|
165
|
+
fill: "none",
|
|
166
|
+
stroke: "currentColor",
|
|
167
|
+
strokeWidth: "3",
|
|
168
|
+
strokeLinecap: "round",
|
|
169
|
+
strokeLinejoin: "round",
|
|
170
|
+
children: /*#__PURE__*/ jsx("polyline", {
|
|
171
|
+
points: "20 6 9 17 4 12"
|
|
172
|
+
})
|
|
173
|
+
});
|
|
496
174
|
}
|
|
497
175
|
function MinusIcon() {
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
y2: "12"
|
|
517
|
-
})
|
|
518
|
-
});
|
|
519
|
-
$[0] = t0;
|
|
520
|
-
} else t0 = $[0];
|
|
521
|
-
return t0;
|
|
176
|
+
return /*#__PURE__*/ jsx("svg", {
|
|
177
|
+
"data-tao-checkbox-icon": "",
|
|
178
|
+
"aria-hidden": "true",
|
|
179
|
+
focusable: "false",
|
|
180
|
+
width: "12",
|
|
181
|
+
height: "12",
|
|
182
|
+
viewBox: "0 0 24 24",
|
|
183
|
+
fill: "none",
|
|
184
|
+
stroke: "currentColor",
|
|
185
|
+
strokeWidth: "3",
|
|
186
|
+
strokeLinecap: "round",
|
|
187
|
+
children: /*#__PURE__*/ jsx("line", {
|
|
188
|
+
x1: "5",
|
|
189
|
+
y1: "12",
|
|
190
|
+
x2: "19",
|
|
191
|
+
y2: "12"
|
|
192
|
+
})
|
|
193
|
+
});
|
|
522
194
|
}
|
|
523
195
|
export { CheckboxGroup, checkbox_Checkbox as Checkbox };
|