@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,111 +1,41 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { c } from "react-compiler-runtime";
|
|
3
|
-
import { getMonths } from "./use-calendar.js";
|
|
4
2
|
import { useTaoConfig } from "../../../provider/tao-provider.js";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const { viewDate, value, rangeStart, rangeEnd, committedRange, onSelect, disabledDate, minDate, maxDate, className, style, cellClassName, cellStyle } = t0;
|
|
3
|
+
import { getMonths } from "./use-calendar.js";
|
|
4
|
+
function MonthGrid({ viewDate, value, rangeStart, rangeEnd, committedRange, onSelect, disabledDate, minDate, maxDate, className, style, cellClassName, cellStyle }) {
|
|
8
5
|
const { locale } = useTaoConfig();
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
6
|
+
const months = getMonths(viewDate.year());
|
|
7
|
+
const accessibleSelection = void 0 === committedRange ? [
|
|
8
|
+
value,
|
|
9
|
+
rangeStart,
|
|
10
|
+
rangeEnd
|
|
11
|
+
] : committedRange ?? [];
|
|
12
|
+
return /*#__PURE__*/ jsx("div", {
|
|
13
|
+
"data-tao-month-grid": "",
|
|
14
|
+
className: className,
|
|
15
|
+
style: style,
|
|
16
|
+
children: months.map((m, i)=>{
|
|
17
|
+
const isSelected = [
|
|
18
18
|
value,
|
|
19
19
|
rangeStart,
|
|
20
20
|
rangeEnd
|
|
21
|
-
]
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
const inRange = rangeStart && rangeEnd && m.isAfter(rangeStart, "month") && m.isBefore(rangeEnd, "month");
|
|
41
|
-
const disabled = disabledDate?.(m) || null != minDate && m.isBefore(minDate, "month") || null != maxDate && m.isAfter(maxDate, "month");
|
|
42
|
-
return /*#__PURE__*/ jsx("button", {
|
|
43
|
-
type: "button",
|
|
44
|
-
"data-tao-month-cell": "",
|
|
45
|
-
"data-tao-calendar-date": m.format("YYYY-MM"),
|
|
46
|
-
className: cellClassName,
|
|
47
|
-
style: cellStyle,
|
|
48
|
-
"data-tao-in-range": inRange || void 0,
|
|
49
|
-
"data-tao-selected": isSelected || void 0,
|
|
50
|
-
"aria-pressed": accessibleSelection.some((date_0)=>date_0?.isSame(m, "month")),
|
|
51
|
-
"data-tao-disabled": disabled || void 0,
|
|
52
|
-
disabled: disabled,
|
|
53
|
-
onClick: ()=>onSelect(m),
|
|
54
|
-
children: locale.months[i]
|
|
55
|
-
}, m.format("YYYY-MM"));
|
|
56
|
-
};
|
|
57
|
-
$[23] = accessibleSelection;
|
|
58
|
-
$[24] = cellClassName;
|
|
59
|
-
$[25] = cellStyle;
|
|
60
|
-
$[26] = disabledDate;
|
|
61
|
-
$[27] = locale;
|
|
62
|
-
$[28] = maxDate;
|
|
63
|
-
$[29] = minDate;
|
|
64
|
-
$[30] = onSelect;
|
|
65
|
-
$[31] = rangeEnd;
|
|
66
|
-
$[32] = rangeStart;
|
|
67
|
-
$[33] = value;
|
|
68
|
-
$[34] = t6;
|
|
69
|
-
} else t6 = $[34];
|
|
70
|
-
t4 = months.map(t6);
|
|
71
|
-
$[0] = cellClassName;
|
|
72
|
-
$[1] = cellStyle;
|
|
73
|
-
$[2] = className;
|
|
74
|
-
$[3] = committedRange;
|
|
75
|
-
$[4] = disabledDate;
|
|
76
|
-
$[5] = locale;
|
|
77
|
-
$[6] = maxDate;
|
|
78
|
-
$[7] = minDate;
|
|
79
|
-
$[8] = onSelect;
|
|
80
|
-
$[9] = rangeEnd;
|
|
81
|
-
$[10] = rangeStart;
|
|
82
|
-
$[11] = style;
|
|
83
|
-
$[12] = value;
|
|
84
|
-
$[13] = viewDate;
|
|
85
|
-
$[14] = t1;
|
|
86
|
-
$[15] = t2;
|
|
87
|
-
$[16] = t3;
|
|
88
|
-
$[17] = t4;
|
|
89
|
-
} else {
|
|
90
|
-
t1 = $[14];
|
|
91
|
-
t2 = $[15];
|
|
92
|
-
t3 = $[16];
|
|
93
|
-
t4 = $[17];
|
|
94
|
-
}
|
|
95
|
-
let t5;
|
|
96
|
-
if ($[35] !== t1 || $[36] !== t2 || $[37] !== t3 || $[38] !== t4) {
|
|
97
|
-
t5 = /*#__PURE__*/ jsx("div", {
|
|
98
|
-
"data-tao-month-grid": t1,
|
|
99
|
-
className: t2,
|
|
100
|
-
style: t3,
|
|
101
|
-
children: t4
|
|
102
|
-
});
|
|
103
|
-
$[35] = t1;
|
|
104
|
-
$[36] = t2;
|
|
105
|
-
$[37] = t3;
|
|
106
|
-
$[38] = t4;
|
|
107
|
-
$[39] = t5;
|
|
108
|
-
} else t5 = $[39];
|
|
109
|
-
return t5;
|
|
21
|
+
].some((date)=>date?.isSame(m, 'month'));
|
|
22
|
+
const inRange = rangeStart && rangeEnd && m.isAfter(rangeStart, 'month') && m.isBefore(rangeEnd, 'month');
|
|
23
|
+
const disabled = disabledDate?.(m) || null != minDate && m.isBefore(minDate, 'month') || null != maxDate && m.isAfter(maxDate, 'month');
|
|
24
|
+
return /*#__PURE__*/ jsx("button", {
|
|
25
|
+
type: "button",
|
|
26
|
+
"data-tao-month-cell": "",
|
|
27
|
+
"data-tao-calendar-date": m.format('YYYY-MM'),
|
|
28
|
+
className: cellClassName,
|
|
29
|
+
style: cellStyle,
|
|
30
|
+
"data-tao-in-range": inRange || void 0,
|
|
31
|
+
"data-tao-selected": isSelected || void 0,
|
|
32
|
+
"aria-pressed": accessibleSelection.some((date)=>date?.isSame(m, 'month')),
|
|
33
|
+
"data-tao-disabled": disabled || void 0,
|
|
34
|
+
disabled: disabled,
|
|
35
|
+
onClick: ()=>onSelect(m),
|
|
36
|
+
children: locale.months[i]
|
|
37
|
+
}, m.format('YYYY-MM'));
|
|
38
|
+
})
|
|
39
|
+
});
|
|
110
40
|
}
|
|
111
41
|
export { MonthGrid };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import { useEffect, useRef } from "react";
|
|
2
|
+
import { useCallback, useEffect, useMemo, useRef } from "react";
|
|
4
3
|
import { useTaoConfig } from "../../../provider/tao-provider.js";
|
|
5
4
|
function getTimeUnits(format = '') {
|
|
6
5
|
const tokens = format.replace(/\[[^\]]*]/g, '');
|
|
@@ -11,130 +10,57 @@ function getTimeUnits(format = '') {
|
|
|
11
10
|
second: !any || tokens.includes('s')
|
|
12
11
|
};
|
|
13
12
|
}
|
|
14
|
-
function TimePanel(
|
|
15
|
-
const $ = c(42);
|
|
16
|
-
const { hour, minute, second, disabled, onChange, config, format, scrollKey } = t0;
|
|
13
|
+
function TimePanel({ hour, minute, second, disabled, onChange, config, format, scrollKey }) {
|
|
17
14
|
const { locale } = useTaoConfig();
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
t1 = getTimeUnits(format);
|
|
21
|
-
$[0] = format;
|
|
22
|
-
$[1] = t1;
|
|
23
|
-
} else t1 = $[1];
|
|
24
|
-
const units = t1;
|
|
25
|
-
const normalizeStep = _temp;
|
|
15
|
+
const units = getTimeUnits(format);
|
|
16
|
+
const normalizeStep = (step)=>step && Number.isFinite(step) && step > 0 ? Math.max(1, Math.trunc(step)) : 1;
|
|
26
17
|
const hourStep = normalizeStep(config?.hourStep);
|
|
27
18
|
const minuteStep = normalizeStep(config?.minuteStep);
|
|
28
19
|
const secondStep = normalizeStep(config?.secondStep);
|
|
29
|
-
|
|
30
|
-
if ($[2] !== hourStep) {
|
|
31
|
-
t2 = Array.from({
|
|
20
|
+
const hours = useMemo(()=>Array.from({
|
|
32
21
|
length: Math.ceil(24 / hourStep)
|
|
33
|
-
}, (_, i)=>i * hourStep)
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
const hours = t2;
|
|
38
|
-
let t3;
|
|
39
|
-
if ($[4] !== minuteStep) {
|
|
40
|
-
t3 = Array.from({
|
|
22
|
+
}, (_, i)=>i * hourStep), [
|
|
23
|
+
hourStep
|
|
24
|
+
]);
|
|
25
|
+
const minutes = useMemo(()=>Array.from({
|
|
41
26
|
length: Math.ceil(60 / minuteStep)
|
|
42
|
-
}, (
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
const minutes = t3;
|
|
47
|
-
let t4;
|
|
48
|
-
if ($[6] !== secondStep) {
|
|
49
|
-
t4 = Array.from({
|
|
27
|
+
}, (_, i)=>i * minuteStep), [
|
|
28
|
+
minuteStep
|
|
29
|
+
]);
|
|
30
|
+
const seconds = useMemo(()=>Array.from({
|
|
50
31
|
length: Math.ceil(60 / secondStep)
|
|
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
|
-
label: locale.minute,
|
|
84
|
-
disabled: disabled,
|
|
85
|
-
scrollKey: scrollKey
|
|
86
|
-
});
|
|
87
|
-
$[18] = disabled;
|
|
88
|
-
$[19] = hour;
|
|
89
|
-
$[20] = locale;
|
|
90
|
-
$[21] = minute;
|
|
91
|
-
$[22] = minutes;
|
|
92
|
-
$[23] = onChange;
|
|
93
|
-
$[24] = scrollKey;
|
|
94
|
-
$[25] = second;
|
|
95
|
-
$[26] = units.minute;
|
|
96
|
-
$[27] = t6;
|
|
97
|
-
} else t6 = $[27];
|
|
98
|
-
let t7;
|
|
99
|
-
if ($[28] !== disabled || $[29] !== hour || $[30] !== locale || $[31] !== minute || $[32] !== onChange || $[33] !== scrollKey || $[34] !== second || $[35] !== seconds || $[36] !== units.second) {
|
|
100
|
-
t7 = units.second && /*#__PURE__*/ jsx(TimeColumn, {
|
|
101
|
-
values: seconds,
|
|
102
|
-
selected: second,
|
|
103
|
-
onSelect: (v_1)=>onChange(hour, minute, v_1),
|
|
104
|
-
label: locale.second,
|
|
105
|
-
disabled: disabled,
|
|
106
|
-
scrollKey: scrollKey
|
|
107
|
-
});
|
|
108
|
-
$[28] = disabled;
|
|
109
|
-
$[29] = hour;
|
|
110
|
-
$[30] = locale;
|
|
111
|
-
$[31] = minute;
|
|
112
|
-
$[32] = onChange;
|
|
113
|
-
$[33] = scrollKey;
|
|
114
|
-
$[34] = second;
|
|
115
|
-
$[35] = seconds;
|
|
116
|
-
$[36] = units.second;
|
|
117
|
-
$[37] = t7;
|
|
118
|
-
} else t7 = $[37];
|
|
119
|
-
let t8;
|
|
120
|
-
if ($[38] !== t5 || $[39] !== t6 || $[40] !== t7) {
|
|
121
|
-
t8 = /*#__PURE__*/ jsxs("div", {
|
|
122
|
-
"data-tao-time-panel": "",
|
|
123
|
-
children: [
|
|
124
|
-
t5,
|
|
125
|
-
t6,
|
|
126
|
-
t7
|
|
127
|
-
]
|
|
128
|
-
});
|
|
129
|
-
$[38] = t5;
|
|
130
|
-
$[39] = t6;
|
|
131
|
-
$[40] = t7;
|
|
132
|
-
$[41] = t8;
|
|
133
|
-
} else t8 = $[41];
|
|
134
|
-
return t8;
|
|
135
|
-
}
|
|
136
|
-
function _temp(step) {
|
|
137
|
-
return step && Number.isFinite(step) && step > 0 ? Math.max(1, Math.trunc(step)) : 1;
|
|
32
|
+
}, (_, i)=>i * secondStep), [
|
|
33
|
+
secondStep
|
|
34
|
+
]);
|
|
35
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
36
|
+
"data-tao-time-panel": "",
|
|
37
|
+
children: [
|
|
38
|
+
units.hour && /*#__PURE__*/ jsx(TimeColumn, {
|
|
39
|
+
values: hours,
|
|
40
|
+
selected: hour,
|
|
41
|
+
onSelect: (v)=>onChange(v, minute, second),
|
|
42
|
+
label: locale.hour,
|
|
43
|
+
disabled: disabled,
|
|
44
|
+
scrollKey: scrollKey
|
|
45
|
+
}),
|
|
46
|
+
units.minute && /*#__PURE__*/ jsx(TimeColumn, {
|
|
47
|
+
values: minutes,
|
|
48
|
+
selected: minute,
|
|
49
|
+
onSelect: (v)=>onChange(hour, v, second),
|
|
50
|
+
label: locale.minute,
|
|
51
|
+
disabled: disabled,
|
|
52
|
+
scrollKey: scrollKey
|
|
53
|
+
}),
|
|
54
|
+
units.second && /*#__PURE__*/ jsx(TimeColumn, {
|
|
55
|
+
values: seconds,
|
|
56
|
+
selected: second,
|
|
57
|
+
onSelect: (v)=>onChange(hour, minute, v),
|
|
58
|
+
label: locale.second,
|
|
59
|
+
disabled: disabled,
|
|
60
|
+
scrollKey: scrollKey
|
|
61
|
+
})
|
|
62
|
+
]
|
|
63
|
+
});
|
|
138
64
|
}
|
|
139
65
|
function centerSelected(list, behavior) {
|
|
140
66
|
const selected = list.querySelector('[data-tao-selected]');
|
|
@@ -144,97 +70,42 @@ function centerSelected(list, behavior) {
|
|
|
144
70
|
behavior
|
|
145
71
|
});
|
|
146
72
|
}
|
|
147
|
-
function TimeColumn(
|
|
148
|
-
const $ = c(21);
|
|
149
|
-
const { values, selected, onSelect, label, disabled, scrollKey } = t0;
|
|
73
|
+
function TimeColumn({ values, selected, onSelect, label, disabled, scrollKey }) {
|
|
150
74
|
const listRef = useRef(null);
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
$[5] = label;
|
|
187
|
-
$[6] = t4;
|
|
188
|
-
} else t4 = $[6];
|
|
189
|
-
let t5;
|
|
190
|
-
if ($[7] !== onSelect || $[8] !== selected || $[9] !== values) {
|
|
191
|
-
let t6;
|
|
192
|
-
if ($[11] !== onSelect || $[12] !== selected) {
|
|
193
|
-
t6 = (v)=>/*#__PURE__*/ jsx("button", {
|
|
194
|
-
type: "button",
|
|
195
|
-
"data-tao-time-cell": "",
|
|
196
|
-
"data-tao-selected": v === selected || void 0,
|
|
197
|
-
"aria-pressed": v === selected,
|
|
198
|
-
onClick: ()=>onSelect(v),
|
|
199
|
-
children: String(v).padStart(2, "0")
|
|
200
|
-
}, v);
|
|
201
|
-
$[11] = onSelect;
|
|
202
|
-
$[12] = selected;
|
|
203
|
-
$[13] = t6;
|
|
204
|
-
} else t6 = $[13];
|
|
205
|
-
t5 = values.map(t6);
|
|
206
|
-
$[7] = onSelect;
|
|
207
|
-
$[8] = selected;
|
|
208
|
-
$[9] = values;
|
|
209
|
-
$[10] = t5;
|
|
210
|
-
} else t5 = $[10];
|
|
211
|
-
let t6;
|
|
212
|
-
if ($[14] !== t5) {
|
|
213
|
-
t6 = /*#__PURE__*/ jsx("div", {
|
|
214
|
-
"data-tao-time-column-list": "",
|
|
215
|
-
ref: initRef,
|
|
216
|
-
children: t5
|
|
217
|
-
});
|
|
218
|
-
$[14] = t5;
|
|
219
|
-
$[15] = t6;
|
|
220
|
-
} else t6 = $[15];
|
|
221
|
-
let t7;
|
|
222
|
-
if ($[16] !== disabled || $[17] !== label || $[18] !== t4 || $[19] !== t6) {
|
|
223
|
-
t7 = /*#__PURE__*/ jsxs("fieldset", {
|
|
224
|
-
"data-tao-time-column": "",
|
|
225
|
-
"aria-label": label,
|
|
226
|
-
disabled: disabled,
|
|
227
|
-
children: [
|
|
228
|
-
t4,
|
|
229
|
-
t6
|
|
230
|
-
]
|
|
231
|
-
});
|
|
232
|
-
$[16] = disabled;
|
|
233
|
-
$[17] = label;
|
|
234
|
-
$[18] = t4;
|
|
235
|
-
$[19] = t6;
|
|
236
|
-
$[20] = t7;
|
|
237
|
-
} else t7 = $[20];
|
|
238
|
-
return t7;
|
|
75
|
+
const initRef = useCallback((el)=>{
|
|
76
|
+
listRef.current = el;
|
|
77
|
+
if (el) centerSelected(el, 'instant');
|
|
78
|
+
}, []);
|
|
79
|
+
useEffect(()=>{
|
|
80
|
+
const el = listRef.current;
|
|
81
|
+
if (!el) return;
|
|
82
|
+
centerSelected(el, 'smooth');
|
|
83
|
+
}, [
|
|
84
|
+
selected,
|
|
85
|
+
scrollKey
|
|
86
|
+
]);
|
|
87
|
+
return /*#__PURE__*/ jsxs("fieldset", {
|
|
88
|
+
"data-tao-time-column": "",
|
|
89
|
+
"aria-label": label,
|
|
90
|
+
disabled: disabled,
|
|
91
|
+
children: [
|
|
92
|
+
/*#__PURE__*/ jsx("div", {
|
|
93
|
+
"data-tao-time-column-title": "",
|
|
94
|
+
children: label
|
|
95
|
+
}),
|
|
96
|
+
/*#__PURE__*/ jsx("div", {
|
|
97
|
+
"data-tao-time-column-list": "",
|
|
98
|
+
ref: initRef,
|
|
99
|
+
children: values.map((v)=>/*#__PURE__*/ jsx("button", {
|
|
100
|
+
type: "button",
|
|
101
|
+
"data-tao-time-cell": "",
|
|
102
|
+
"data-tao-selected": v === selected || void 0,
|
|
103
|
+
"aria-pressed": v === selected,
|
|
104
|
+
onClick: ()=>onSelect(v),
|
|
105
|
+
children: String(v).padStart(2, '0')
|
|
106
|
+
}, v))
|
|
107
|
+
})
|
|
108
|
+
]
|
|
109
|
+
});
|
|
239
110
|
}
|
|
240
111
|
export { TimePanel, getTimeUnits };
|
|
@@ -1,112 +1,43 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { c } from "react-compiler-runtime";
|
|
3
2
|
import { getYears } from "./use-calendar.js";
|
|
4
|
-
function YearGrid(
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
3
|
+
function YearGrid({ viewDate, value, rangeStart, rangeEnd, committedRange, onSelect, disabledDate, minDate, maxDate, className, style, cellClassName, cellStyle }) {
|
|
4
|
+
const years = getYears(viewDate.year());
|
|
5
|
+
const decadeStart = 10 * Math.floor(viewDate.year() / 10);
|
|
6
|
+
const accessibleSelection = void 0 === committedRange ? [
|
|
7
|
+
value,
|
|
8
|
+
rangeStart,
|
|
9
|
+
rangeEnd
|
|
10
|
+
] : committedRange ?? [];
|
|
11
|
+
return /*#__PURE__*/ jsx("div", {
|
|
12
|
+
"data-tao-year-grid": "",
|
|
13
|
+
className: className,
|
|
14
|
+
style: style,
|
|
15
|
+
children: years.map((y)=>{
|
|
16
|
+
const yr = y.year();
|
|
17
|
+
const isSelected = [
|
|
17
18
|
value,
|
|
18
19
|
rangeStart,
|
|
19
20
|
rangeEnd
|
|
20
|
-
]
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
const isOutside = yr < decadeStart || yr > decadeStart + 9;
|
|
42
|
-
const disabled = disabledDate?.(y) || null != minDate && y.isBefore(minDate, "year") || null != maxDate && y.isAfter(maxDate, "year");
|
|
43
|
-
return /*#__PURE__*/ jsx("button", {
|
|
44
|
-
type: "button",
|
|
45
|
-
"data-tao-year-cell": "",
|
|
46
|
-
"data-tao-calendar-date": y.format("YYYY"),
|
|
47
|
-
className: cellClassName,
|
|
48
|
-
style: cellStyle,
|
|
49
|
-
"data-tao-in-range": inRange || void 0,
|
|
50
|
-
"data-tao-selected": isSelected || void 0,
|
|
51
|
-
"aria-pressed": accessibleSelection.some((date_0)=>date_0?.isSame(y, "year")),
|
|
52
|
-
"data-tao-other-month": isOutside || void 0,
|
|
53
|
-
"data-tao-disabled": disabled || void 0,
|
|
54
|
-
disabled: disabled,
|
|
55
|
-
onClick: ()=>onSelect(y),
|
|
56
|
-
children: yr
|
|
57
|
-
}, yr);
|
|
58
|
-
};
|
|
59
|
-
$[22] = accessibleSelection;
|
|
60
|
-
$[23] = cellClassName;
|
|
61
|
-
$[24] = cellStyle;
|
|
62
|
-
$[25] = decadeStart;
|
|
63
|
-
$[26] = disabledDate;
|
|
64
|
-
$[27] = maxDate;
|
|
65
|
-
$[28] = minDate;
|
|
66
|
-
$[29] = onSelect;
|
|
67
|
-
$[30] = rangeEnd;
|
|
68
|
-
$[31] = rangeStart;
|
|
69
|
-
$[32] = value;
|
|
70
|
-
$[33] = t6;
|
|
71
|
-
} else t6 = $[33];
|
|
72
|
-
t4 = years.map(t6);
|
|
73
|
-
$[0] = cellClassName;
|
|
74
|
-
$[1] = cellStyle;
|
|
75
|
-
$[2] = className;
|
|
76
|
-
$[3] = committedRange;
|
|
77
|
-
$[4] = disabledDate;
|
|
78
|
-
$[5] = maxDate;
|
|
79
|
-
$[6] = minDate;
|
|
80
|
-
$[7] = onSelect;
|
|
81
|
-
$[8] = rangeEnd;
|
|
82
|
-
$[9] = rangeStart;
|
|
83
|
-
$[10] = style;
|
|
84
|
-
$[11] = value;
|
|
85
|
-
$[12] = viewDate;
|
|
86
|
-
$[13] = t1;
|
|
87
|
-
$[14] = t2;
|
|
88
|
-
$[15] = t3;
|
|
89
|
-
$[16] = t4;
|
|
90
|
-
} else {
|
|
91
|
-
t1 = $[13];
|
|
92
|
-
t2 = $[14];
|
|
93
|
-
t3 = $[15];
|
|
94
|
-
t4 = $[16];
|
|
95
|
-
}
|
|
96
|
-
let t5;
|
|
97
|
-
if ($[34] !== t1 || $[35] !== t2 || $[36] !== t3 || $[37] !== t4) {
|
|
98
|
-
t5 = /*#__PURE__*/ jsx("div", {
|
|
99
|
-
"data-tao-year-grid": t1,
|
|
100
|
-
className: t2,
|
|
101
|
-
style: t3,
|
|
102
|
-
children: t4
|
|
103
|
-
});
|
|
104
|
-
$[34] = t1;
|
|
105
|
-
$[35] = t2;
|
|
106
|
-
$[36] = t3;
|
|
107
|
-
$[37] = t4;
|
|
108
|
-
$[38] = t5;
|
|
109
|
-
} else t5 = $[38];
|
|
110
|
-
return t5;
|
|
21
|
+
].some((date)=>date?.isSame(y, 'year'));
|
|
22
|
+
const inRange = rangeStart && rangeEnd && y.isAfter(rangeStart, 'year') && y.isBefore(rangeEnd, 'year');
|
|
23
|
+
const isOutside = yr < decadeStart || yr > decadeStart + 9;
|
|
24
|
+
const disabled = disabledDate?.(y) || null != minDate && y.isBefore(minDate, 'year') || null != maxDate && y.isAfter(maxDate, 'year');
|
|
25
|
+
return /*#__PURE__*/ jsx("button", {
|
|
26
|
+
type: "button",
|
|
27
|
+
"data-tao-year-cell": "",
|
|
28
|
+
"data-tao-calendar-date": y.format('YYYY'),
|
|
29
|
+
className: cellClassName,
|
|
30
|
+
style: cellStyle,
|
|
31
|
+
"data-tao-in-range": inRange || void 0,
|
|
32
|
+
"data-tao-selected": isSelected || void 0,
|
|
33
|
+
"aria-pressed": accessibleSelection.some((date)=>date?.isSame(y, 'year')),
|
|
34
|
+
"data-tao-other-month": isOutside || void 0,
|
|
35
|
+
"data-tao-disabled": disabled || void 0,
|
|
36
|
+
disabled: disabled,
|
|
37
|
+
onClick: ()=>onSelect(y),
|
|
38
|
+
children: yr
|
|
39
|
+
}, yr);
|
|
40
|
+
})
|
|
41
|
+
});
|
|
111
42
|
}
|
|
112
43
|
export { YearGrid };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import dayjs from "dayjs";
|
|
2
2
|
import customParseFormat from "dayjs/plugin/customParseFormat";
|
|
3
|
-
import localizedFormat from "dayjs/plugin/localizedFormat";
|
|
4
3
|
import localeData from "dayjs/plugin/localeData";
|
|
4
|
+
import localizedFormat from "dayjs/plugin/localizedFormat";
|
|
5
5
|
import { normalizeDigits, resolveNumberFormat } from "../../number-input/locale.js";
|
|
6
6
|
dayjs.extend(customParseFormat);
|
|
7
7
|
dayjs.extend(localizedFormat);
|