@rockshin/tao-ui 0.0.41 → 0.0.43
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 +39 -7
- package/THIRD_PARTY_NOTICES.md +34 -0
- package/component-manifest.json +1352 -24
- package/dist/components/affix/affix.css +11 -0
- package/dist/components/affix/affix.d.ts +21 -0
- package/dist/components/affix/affix.js +140 -0
- package/dist/components/alert/alert.css +1 -0
- package/dist/components/app/app-modals.d.ts +2 -0
- package/dist/components/app/app-modals.js +266 -0
- package/dist/components/app/app-notices.d.ts +6 -0
- package/dist/components/app/app-notices.js +334 -0
- package/dist/components/app/app-types.d.ts +154 -0
- package/dist/components/app/app-types.js +0 -0
- package/dist/components/app/app.css +221 -0
- package/dist/components/app/app.d.ts +7 -0
- package/dist/components/app/app.js +69 -0
- package/dist/components/auto-complete/auto-complete.css +35 -0
- package/dist/components/auto-complete/auto-complete.d.ts +47 -0
- package/dist/components/auto-complete/auto-complete.js +106 -0
- package/dist/components/avatar/avatar.css +95 -0
- package/dist/components/avatar/avatar.d.ts +50 -0
- package/dist/components/avatar/avatar.js +159 -0
- package/dist/components/badge/badge.css +165 -0
- package/dist/components/badge/badge.d.ts +48 -0
- package/dist/components/badge/badge.js +412 -0
- package/dist/components/border-beam/border-beam.css +35 -0
- package/dist/components/border-beam/border-beam.d.ts +27 -0
- package/dist/components/border-beam/border-beam.js +215 -0
- package/dist/components/button/button.css +7 -0
- package/dist/components/calendar/calendar.css +126 -0
- package/dist/components/calendar/calendar.d.ts +56 -0
- package/dist/components/calendar/calendar.js +178 -0
- package/dist/components/card/card-tabs.d.ts +43 -0
- package/dist/components/card/card-tabs.js +455 -0
- package/dist/components/card/card.css +401 -0
- package/dist/components/card/card.d.ts +74 -0
- package/dist/components/card/card.js +362 -0
- package/dist/components/carousel/carousel.css +232 -0
- package/dist/components/carousel/carousel.d.ts +35 -0
- package/dist/components/carousel/carousel.js +248 -0
- package/dist/components/cascader/cascader.css +123 -0
- package/dist/components/cascader/cascader.d.ts +58 -0
- package/dist/components/cascader/cascader.js +132 -0
- package/dist/components/checkbox/checkbox.css +7 -0
- package/dist/components/collapse/collapse-panels.d.ts +4 -0
- package/dist/components/collapse/collapse-panels.js +413 -0
- package/dist/components/collapse/collapse.css +199 -0
- package/dist/components/collapse/collapse.d.ts +77 -0
- package/dist/components/{collapsible/collapsible.js → collapse/collapse.js} +26 -10
- package/dist/components/color-picker/color-picker-types.d.ts +78 -0
- package/dist/components/color-picker/color-picker-types.js +0 -0
- package/dist/components/color-picker/color-picker.css +265 -0
- package/dist/components/color-picker/color-picker.d.ts +5 -0
- package/dist/components/color-picker/color-picker.js +1049 -0
- package/dist/components/color-picker/color.d.ts +35 -0
- package/dist/components/color-picker/color.js +65 -0
- package/dist/components/date-picker/calendar/calendar-grid.js +4 -11
- package/dist/components/date-picker/calendar/calendar-header.js +76 -69
- package/dist/components/date-picker/calendar/month-grid.js +20 -31
- package/dist/components/date-picker/calendar/time-panel.js +46 -41
- package/dist/components/date-picker/date-picker.css +22 -56
- package/dist/components/date-picker/date-picker.d.ts +2 -0
- package/dist/components/date-picker/date-picker.js +14 -9
- package/dist/components/date-picker/presets.js +5 -2
- package/dist/components/date-picker/range-picker.d.ts +2 -0
- package/dist/components/date-picker/range-picker.js +16 -13
- package/dist/components/descriptions/descriptions.css +109 -0
- package/dist/components/descriptions/descriptions.d.ts +49 -0
- package/dist/components/descriptions/descriptions.js +189 -0
- package/dist/components/divider/divider.css +71 -0
- package/dist/components/divider/divider.d.ts +31 -0
- package/dist/components/divider/divider.js +83 -0
- package/dist/components/drawer/drawer.js +199 -184
- package/dist/components/empty/empty.css +35 -0
- package/dist/components/empty/empty.d.ts +25 -0
- package/dist/components/empty/empty.js +278 -0
- package/dist/components/float-button/float-button.css +146 -0
- package/dist/components/float-button/float-button.d.ts +67 -0
- package/dist/components/float-button/float-button.js +347 -0
- package/dist/components/form/form-item.d.ts +1 -1
- package/dist/components/form/form-item.js +1 -0
- package/dist/components/form/form.css +15 -0
- package/dist/components/form/form.js +4 -1
- package/dist/components/form-field/form-field-view.d.ts +3 -1
- package/dist/components/form-field/form-field-view.js +109 -84
- package/dist/components/image/image-icons.d.ts +16 -0
- package/dist/components/image/image-icons.js +63 -0
- package/dist/components/image/image.css +253 -0
- package/dist/components/image/image.d.ts +75 -0
- package/dist/components/image/image.js +818 -0
- package/dist/components/input/base-input.d.ts +25 -0
- package/dist/components/input/base-input.js +104 -0
- package/dist/components/input/input-shared.css +75 -0
- package/dist/components/input/input-shared.d.ts +59 -0
- package/dist/components/input/input-shared.js +152 -0
- package/dist/components/input/input.css +107 -10
- package/dist/components/input/input.d.ts +12 -16
- package/dist/components/input/input.js +11 -154
- package/dist/components/input/otp.d.ts +29 -0
- package/dist/components/input/otp.js +335 -0
- package/dist/components/input/password.d.ts +12 -0
- package/dist/components/input/password.js +117 -0
- package/dist/components/input/search.d.ts +16 -0
- package/dist/components/input/search.js +99 -0
- package/dist/components/input-number/input-number.d.ts +2 -2
- package/dist/components/input-number/input-number.js +2 -2
- package/dist/components/list/list-pagination.css +127 -0
- package/dist/components/list/list-pagination.d.ts +38 -0
- package/dist/components/list/list-pagination.js +322 -0
- package/dist/components/list/list.css +225 -0
- package/dist/components/list/list.d.ts +77 -0
- package/dist/components/list/list.js +660 -0
- package/dist/components/listy/listy.css +55 -0
- package/dist/components/listy/listy.d.ts +20 -0
- package/dist/components/listy/listy.js +158 -0
- package/dist/components/masonry/masonry.css +13 -0
- package/dist/components/masonry/masonry.d.ts +39 -0
- package/dist/components/masonry/masonry.js +287 -0
- package/dist/components/mentions/mentions.css +179 -0
- package/dist/components/mentions/mentions.d.ts +48 -0
- package/dist/components/mentions/mentions.js +115 -0
- package/dist/components/modal/modal.css +1 -0
- package/dist/components/modal/modal.d.ts +30 -4
- package/dist/components/modal/modal.js +534 -241
- package/dist/components/pagination/pagination.css +10 -0
- package/dist/components/progress/progress.css +187 -0
- package/dist/components/progress/progress.d.ts +66 -0
- package/dist/components/progress/progress.js +567 -0
- package/dist/components/qr-code/qr-code.css +39 -0
- package/dist/components/qr-code/qr-code.d.ts +43 -0
- package/dist/components/qr-code/qr-code.js +286 -0
- package/dist/components/radio/radio.css +7 -0
- package/dist/components/radio/radio.d.ts +1 -1
- package/dist/components/radio/radio.js +78 -73
- package/dist/components/rate/rate.css +97 -0
- package/dist/components/rate/rate.d.ts +17 -0
- package/dist/components/rate/rate.js +172 -0
- package/dist/components/result/result.css +69 -0
- package/dist/components/result/result.d.ts +33 -0
- package/dist/components/result/result.js +320 -0
- package/dist/components/segmented/segmented.css +134 -0
- package/dist/components/segmented/segmented.d.ts +40 -0
- package/dist/components/segmented/segmented.js +169 -0
- package/dist/components/select/mobile-select.css +1 -16
- package/dist/components/select/mobile-select.d.ts +11 -4
- package/dist/components/select/mobile-select.js +172 -59
- package/dist/components/select/select-tags.js +178 -130
- package/dist/components/select/select-types.d.ts +53 -0
- package/dist/components/select/select.css +86 -8
- package/dist/components/select/select.js +59 -31
- package/dist/components/select/use-select-selection.js +44 -43
- package/dist/components/skeleton/skeleton.css +129 -0
- package/dist/components/skeleton/skeleton.d.ts +78 -0
- package/dist/components/skeleton/skeleton.js +457 -0
- package/dist/components/slider/slider.css +191 -0
- package/dist/components/slider/slider.d.ts +47 -0
- package/dist/components/slider/slider.js +310 -0
- package/dist/components/spinner/spinner.css +1 -1
- package/dist/components/statistic/statistic.css +34 -0
- package/dist/components/statistic/statistic.d.ts +46 -0
- package/dist/components/statistic/statistic.js +491 -0
- package/dist/components/steps/steps.css +53 -3
- package/dist/components/switch/switch-touch.css +20 -0
- package/dist/components/switch/switch.css +24 -13
- package/dist/components/switch/switch.js +8 -5
- package/dist/components/table/table.css +0 -5
- package/dist/components/table/table.js +21 -22
- package/dist/components/textarea/textarea.css +21 -1
- package/dist/components/textarea/textarea.d.ts +12 -6
- package/dist/components/textarea/textarea.js +120 -219
- package/dist/components/time-picker/time-picker.css +212 -0
- package/dist/components/time-picker/time-picker.d.ts +63 -0
- package/dist/components/time-picker/time-picker.js +356 -0
- package/dist/components/timeline/timeline.css +259 -0
- package/dist/components/timeline/timeline.d.ts +50 -0
- package/dist/components/timeline/timeline.js +140 -0
- package/dist/components/tour/tour.css +151 -0
- package/dist/components/tour/tour.d.ts +45 -0
- package/dist/components/tour/tour.js +575 -0
- package/dist/components/transfer/transfer-list.d.ts +2 -0
- package/dist/components/transfer/transfer-list.js +513 -0
- package/dist/components/transfer/transfer-parts.d.ts +3 -0
- package/dist/components/transfer/transfer-parts.js +163 -0
- package/dist/components/transfer/transfer-types.d.ts +163 -0
- package/dist/components/transfer/transfer-types.js +0 -0
- package/dist/components/transfer/transfer.css +226 -0
- package/dist/components/transfer/transfer.d.ts +13 -0
- package/dist/components/transfer/transfer.js +204 -0
- package/dist/components/tree/tree-check.d.ts +1 -0
- package/dist/components/tree/tree-check.js +36 -0
- package/dist/components/tree/tree.css +245 -0
- package/dist/components/tree/tree.d.ts +46 -0
- package/dist/components/tree/tree.js +388 -0
- package/dist/components/tree-select/select-engine.css +238 -0
- package/dist/components/tree-select/select-engine.d.ts +20 -0
- package/dist/components/tree-select/select-engine.js +46 -0
- package/dist/components/tree-select/tree-select.css +25 -0
- package/dist/components/tree-select/tree-select.d.ts +50 -0
- package/dist/components/tree-select/tree-select.js +130 -0
- package/dist/components/upload/upload-types.d.ts +135 -0
- package/dist/components/upload/upload-types.js +0 -0
- package/dist/components/upload/upload.css +166 -0
- package/dist/components/upload/upload.d.ts +12 -0
- package/dist/components/upload/upload.js +465 -0
- package/dist/components/watermark/watermark-context.d.ts +7 -0
- package/dist/components/watermark/watermark-context.js +20 -0
- package/dist/components/watermark/watermark.css +10 -0
- package/dist/components/watermark/watermark.d.ts +38 -0
- package/dist/components/watermark/watermark.js +436 -0
- package/dist/docs/component-docs.d.ts +35 -29
- package/dist/docs/component-docs.js +75 -3
- package/dist/docs/components/affix.doc.d.ts +14 -0
- package/dist/docs/components/affix.doc.js +22 -0
- package/dist/docs/components/app.doc.d.ts +18 -0
- package/dist/docs/components/app.doc.js +42 -0
- package/dist/docs/components/auto-complete.doc.d.ts +18 -0
- package/dist/docs/components/auto-complete.doc.js +49 -0
- package/dist/docs/components/avatar.doc.d.ts +17 -0
- package/dist/docs/components/avatar.doc.js +36 -0
- package/dist/docs/components/badge.doc.d.ts +17 -0
- package/dist/docs/components/badge.doc.js +34 -0
- package/dist/docs/components/border-beam.doc.d.ts +14 -0
- package/dist/docs/components/border-beam.doc.js +22 -0
- package/dist/docs/components/{collapsible.doc.d.ts → calendar.doc.d.ts} +1 -1
- package/dist/docs/components/calendar.doc.js +45 -0
- package/dist/docs/components/card.doc.d.ts +17 -0
- package/dist/docs/components/card.doc.js +39 -0
- package/dist/docs/components/carousel.doc.d.ts +15 -0
- package/dist/docs/components/carousel.doc.js +26 -0
- package/dist/docs/components/cascader.doc.d.ts +18 -0
- package/dist/docs/components/cascader.doc.js +54 -0
- package/dist/docs/components/collapse.doc.d.ts +18 -0
- package/dist/docs/components/collapse.doc.js +47 -0
- package/dist/docs/components/color-picker.doc.d.ts +18 -0
- package/dist/docs/components/color-picker.doc.js +46 -0
- package/dist/docs/components/descriptions.doc.d.ts +14 -0
- package/dist/docs/components/descriptions.doc.js +26 -0
- package/dist/docs/components/divider.doc.d.ts +17 -0
- package/dist/docs/components/divider.doc.js +34 -0
- package/dist/docs/components/empty.doc.d.ts +18 -0
- package/dist/docs/components/empty.doc.js +40 -0
- package/dist/docs/components/float-button.doc.d.ts +14 -0
- package/dist/docs/components/float-button.doc.js +23 -0
- package/dist/docs/components/form.doc.d.ts +1 -1
- package/dist/docs/components/image.doc.d.ts +15 -0
- package/dist/docs/components/image.doc.js +38 -0
- package/dist/docs/components/input.doc.js +11 -4
- package/dist/docs/components/list.doc.d.ts +18 -0
- package/dist/docs/components/list.doc.js +43 -0
- package/dist/docs/components/listy.doc.d.ts +18 -0
- package/dist/docs/components/listy.doc.js +40 -0
- package/dist/docs/components/masonry.doc.d.ts +14 -0
- package/dist/docs/components/masonry.doc.js +22 -0
- package/dist/docs/components/mentions.doc.d.ts +18 -0
- package/dist/docs/components/mentions.doc.js +43 -0
- package/dist/docs/components/modal.doc.js +3 -0
- package/dist/docs/components/progress.doc.d.ts +18 -0
- package/dist/docs/components/progress.doc.js +41 -0
- package/dist/docs/components/qr-code.doc.d.ts +18 -0
- package/dist/docs/components/qr-code.doc.js +41 -0
- package/dist/docs/components/rate.doc.d.ts +18 -0
- package/dist/docs/components/rate.doc.js +38 -0
- package/dist/docs/components/result.doc.d.ts +18 -0
- package/dist/docs/components/result.doc.js +42 -0
- package/dist/docs/components/segmented.doc.d.ts +14 -0
- package/dist/docs/components/segmented.doc.js +24 -0
- package/dist/docs/components/skeleton.doc.d.ts +18 -0
- package/dist/docs/components/skeleton.doc.js +42 -0
- package/dist/docs/components/slider.doc.d.ts +18 -0
- package/dist/docs/components/slider.doc.js +41 -0
- package/dist/docs/components/statistic.doc.d.ts +14 -0
- package/dist/docs/components/statistic.doc.js +27 -0
- package/dist/docs/components/textarea.doc.js +4 -2
- package/dist/docs/components/time-picker.doc.d.ts +18 -0
- package/dist/docs/components/time-picker.doc.js +45 -0
- package/dist/docs/components/timeline.doc.d.ts +14 -0
- package/dist/docs/components/timeline.doc.js +29 -0
- package/dist/docs/components/tooltip.doc.d.ts +2 -2
- package/dist/docs/components/tour.doc.d.ts +15 -0
- package/dist/docs/components/tour.doc.js +36 -0
- package/dist/docs/components/transfer.doc.d.ts +18 -0
- package/dist/docs/components/transfer.doc.js +48 -0
- package/dist/docs/components/tree-select.doc.d.ts +18 -0
- package/dist/docs/components/tree-select.doc.js +55 -0
- package/dist/docs/components/tree.doc.d.ts +18 -0
- package/dist/docs/components/tree.doc.js +46 -0
- package/dist/docs/components/upload.doc.d.ts +18 -0
- package/dist/docs/components/upload.doc.js +43 -0
- package/dist/docs/components/watermark.doc.d.ts +14 -0
- package/dist/docs/components/watermark.doc.js +22 -0
- package/dist/entries/affix.d.ts +3 -0
- package/dist/entries/{collapsible.js → affix.js} +1 -1
- package/dist/entries/app.d.ts +3 -0
- package/dist/entries/app.js +4 -0
- package/dist/entries/auto-complete.d.ts +4 -0
- package/dist/entries/auto-complete.js +4 -0
- package/dist/entries/avatar.d.ts +3 -0
- package/dist/entries/avatar.js +4 -0
- package/dist/entries/badge.d.ts +3 -0
- package/dist/entries/badge.js +4 -0
- package/dist/entries/border-beam.d.ts +3 -0
- package/dist/entries/border-beam.js +4 -0
- package/dist/entries/calendar.d.ts +3 -0
- package/dist/entries/calendar.js +4 -0
- package/dist/entries/card.d.ts +3 -0
- package/dist/entries/card.js +4 -0
- package/dist/entries/carousel.d.ts +3 -0
- package/dist/entries/carousel.js +4 -0
- package/dist/entries/cascader.d.ts +4 -0
- package/dist/entries/cascader.js +4 -0
- package/dist/entries/collapse.d.ts +3 -0
- package/dist/entries/collapse.js +4 -0
- package/dist/entries/color-picker.d.ts +5 -0
- package/dist/entries/color-picker.js +4 -0
- package/dist/entries/descriptions.d.ts +3 -0
- package/dist/entries/descriptions.js +4 -0
- package/dist/entries/divider.d.ts +3 -0
- package/dist/entries/divider.js +4 -0
- package/dist/entries/empty.d.ts +3 -0
- package/dist/entries/empty.js +4 -0
- package/dist/entries/float-button.d.ts +3 -0
- package/dist/entries/float-button.js +4 -0
- package/dist/entries/image.d.ts +3 -0
- package/dist/entries/image.js +4 -0
- package/dist/entries/input.d.ts +1 -1
- package/dist/entries/list.d.ts +3 -0
- package/dist/entries/list.js +4 -0
- package/dist/entries/listy.d.ts +3 -0
- package/dist/entries/listy.js +4 -0
- package/dist/entries/masonry.d.ts +3 -0
- package/dist/entries/masonry.js +4 -0
- package/dist/entries/mentions.d.ts +4 -0
- package/dist/entries/mentions.js +4 -0
- package/dist/entries/progress.d.ts +3 -0
- package/dist/entries/progress.js +4 -0
- package/dist/entries/provider.d.ts +1 -1
- package/dist/entries/provider.js +1 -1
- package/dist/entries/qr-code.d.ts +4 -0
- package/dist/entries/qr-code.js +4 -0
- package/dist/entries/rate.d.ts +3 -0
- package/dist/entries/rate.js +4 -0
- package/dist/entries/result.d.ts +3 -0
- package/dist/entries/result.js +4 -0
- package/dist/entries/segmented.d.ts +3 -0
- package/dist/entries/segmented.js +4 -0
- package/dist/entries/skeleton.d.ts +3 -0
- package/dist/entries/skeleton.js +4 -0
- package/dist/entries/slider.d.ts +3 -0
- package/dist/entries/slider.js +4 -0
- package/dist/entries/statistic.d.ts +3 -0
- package/dist/entries/statistic.js +4 -0
- package/dist/entries/textarea.d.ts +1 -1
- package/dist/entries/time-picker.d.ts +3 -0
- package/dist/entries/time-picker.js +4 -0
- package/dist/entries/timeline.d.ts +3 -0
- package/dist/entries/timeline.js +4 -0
- package/dist/entries/tour.d.ts +3 -0
- package/dist/entries/tour.js +4 -0
- package/dist/entries/transfer.d.ts +3 -0
- package/dist/entries/transfer.js +4 -0
- package/dist/entries/tree-select.d.ts +4 -0
- package/dist/entries/tree-select.js +4 -0
- package/dist/entries/tree.d.ts +3 -0
- package/dist/entries/tree.js +4 -0
- package/dist/entries/upload.d.ts +4 -0
- package/dist/entries/upload.js +4 -0
- package/dist/entries/util.d.ts +1 -0
- package/dist/entries/util.js +1 -0
- package/dist/entries/watermark.d.ts +3 -0
- package/dist/entries/watermark.js +4 -0
- package/dist/index.d.ts +51 -6
- package/dist/index.js +39 -3
- package/dist/provider/locale.d.ts +65 -0
- package/dist/provider/locale.js +146 -0
- package/dist/provider/tao-provider.d.ts +16 -1
- package/dist/provider/tao-provider.js +105 -87
- package/dist/theme/control.css +12 -2
- package/dist/theme/theme.css +4 -2
- package/dist/theme/tokens.d.ts +2 -2
- package/dist/theme/tokens.js +1 -0
- package/dist/utils/breakpoint.d.ts +2 -2
- package/dist/utils/breakpoint.js +3 -1
- package/dist/utils/field-label.d.ts +4 -0
- package/dist/utils/field-label.js +7 -0
- package/dist/utils/interop-default.d.ts +2 -0
- package/dist/utils/interop-default.js +4 -0
- package/dist/utils/types.d.ts +7 -0
- package/dist/utils/types.js +0 -0
- package/llms.txt +493 -22
- package/package.json +33 -9
- package/dist/components/collapsible/collapsible.css +0 -49
- package/dist/components/collapsible/collapsible.d.ts +0 -39
- package/dist/docs/components/collapsible.doc.js +0 -39
- package/dist/entries/collapsible.d.ts +0 -3
|
@@ -0,0 +1,334 @@
|
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { c } from "react-compiler-runtime";
|
|
3
|
+
import { useNotification } from "@rc-component/notification";
|
|
4
|
+
import { useEffect, useMemo, useRef } from "react";
|
|
5
|
+
import { TaoPortalScope, useTaoConfig, useTaoInternalConfig } from "../../provider/tao-provider.js";
|
|
6
|
+
import { cx } from "../../utils/semantic.js";
|
|
7
|
+
import { Spinner } from "../spinner/spinner.js";
|
|
8
|
+
import { StatusIcon } from "../status-icon/status-icon.js";
|
|
9
|
+
function resolveAppSemantic(value, props) {
|
|
10
|
+
return 'function' == typeof value ? value({
|
|
11
|
+
props
|
|
12
|
+
}) : value;
|
|
13
|
+
}
|
|
14
|
+
const slots = [
|
|
15
|
+
'list',
|
|
16
|
+
'listContent',
|
|
17
|
+
'root',
|
|
18
|
+
'wrapper',
|
|
19
|
+
'icon',
|
|
20
|
+
'title',
|
|
21
|
+
"description",
|
|
22
|
+
'actions',
|
|
23
|
+
'section',
|
|
24
|
+
'close',
|
|
25
|
+
'progress'
|
|
26
|
+
];
|
|
27
|
+
function noticeClasses(...sources) {
|
|
28
|
+
return Object.fromEntries(slots.map((part)=>[
|
|
29
|
+
part,
|
|
30
|
+
cx(`tao-app-notice-${part}`, ...sources.map((source)=>source?.[part]))
|
|
31
|
+
]));
|
|
32
|
+
}
|
|
33
|
+
function noticeStyles(...sources) {
|
|
34
|
+
return Object.fromEntries(slots.map((part)=>[
|
|
35
|
+
part,
|
|
36
|
+
Object.assign({}, ...sources.map((source)=>source?.[part]))
|
|
37
|
+
]));
|
|
38
|
+
}
|
|
39
|
+
function iconFor(type, icon) {
|
|
40
|
+
if (void 0 !== icon) return icon;
|
|
41
|
+
if (!type) return;
|
|
42
|
+
return /*#__PURE__*/ jsx("span", {
|
|
43
|
+
"data-tao-notice-status": type,
|
|
44
|
+
children: 'loading' === type ? /*#__PURE__*/ jsx(Spinner, {
|
|
45
|
+
size: "small"
|
|
46
|
+
}) : /*#__PURE__*/ jsx(StatusIcon, {
|
|
47
|
+
type: type
|
|
48
|
+
})
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
function useNoticeHolder(kind, config) {
|
|
52
|
+
const $ = c(33);
|
|
53
|
+
const { tokenStyle } = useTaoInternalConfig();
|
|
54
|
+
const notificationConfig = config;
|
|
55
|
+
const t0 = config.prefixCls ?? `tao-app-${kind}`;
|
|
56
|
+
const t1 = config.getContainer;
|
|
57
|
+
const t2 = config.duration ?? ("message" === kind ? 3 : 4.5);
|
|
58
|
+
const t3 = config.maxCount;
|
|
59
|
+
const t4 = config.pauseOnHover ?? true;
|
|
60
|
+
const t5 = notificationConfig.showProgress;
|
|
61
|
+
let t6;
|
|
62
|
+
if ($[0] !== config.stack || $[1] !== kind) {
|
|
63
|
+
t6 = config.stack ?? ("notification" === kind ? {
|
|
64
|
+
threshold: 3
|
|
65
|
+
} : false);
|
|
66
|
+
$[0] = config.stack;
|
|
67
|
+
$[1] = kind;
|
|
68
|
+
$[2] = t6;
|
|
69
|
+
} else t6 = $[2];
|
|
70
|
+
const t7 = "notification" === kind;
|
|
71
|
+
let t8;
|
|
72
|
+
if ($[3] !== config || $[4] !== notificationConfig.classNames) {
|
|
73
|
+
t8 = noticeClasses(resolveAppSemantic(notificationConfig.classNames, config));
|
|
74
|
+
$[3] = config;
|
|
75
|
+
$[4] = notificationConfig.classNames;
|
|
76
|
+
$[5] = t8;
|
|
77
|
+
} else t8 = $[5];
|
|
78
|
+
const t9 = config;
|
|
79
|
+
let t10;
|
|
80
|
+
if ($[6] !== notificationConfig.styles || $[7] !== t9) {
|
|
81
|
+
t10 = resolveAppSemantic(notificationConfig.styles, t9);
|
|
82
|
+
$[6] = notificationConfig.styles;
|
|
83
|
+
$[7] = t9;
|
|
84
|
+
$[8] = t10;
|
|
85
|
+
} else t10 = $[8];
|
|
86
|
+
let t11;
|
|
87
|
+
if ($[9] !== config) {
|
|
88
|
+
t11 = config.transitionName ? {
|
|
89
|
+
motionName: config.transitionName
|
|
90
|
+
} : void 0;
|
|
91
|
+
$[9] = config;
|
|
92
|
+
$[10] = t11;
|
|
93
|
+
} else t11 = $[10];
|
|
94
|
+
let t12;
|
|
95
|
+
if ($[11] !== config.rtl || $[12] !== config.top || $[13] !== kind || $[14] !== notificationConfig.bottom || $[15] !== tokenStyle) {
|
|
96
|
+
t12 = (node, t13)=>{
|
|
97
|
+
const { key } = t13;
|
|
98
|
+
return /*#__PURE__*/ jsx(TaoPortalScope, {
|
|
99
|
+
children: /*#__PURE__*/ jsx("div", {
|
|
100
|
+
"data-tao-app-notices": kind,
|
|
101
|
+
"data-tao-placement": key,
|
|
102
|
+
dir: void 0 === config.rtl ? void 0 : config.rtl ? "rtl" : "ltr",
|
|
103
|
+
style: {
|
|
104
|
+
...tokenStyle,
|
|
105
|
+
top: String(key).startsWith("top") ? config.top ?? 24 : void 0,
|
|
106
|
+
bottom: String(key).startsWith("bottom") ? notificationConfig.bottom ?? 24 : void 0
|
|
107
|
+
},
|
|
108
|
+
children: node
|
|
109
|
+
})
|
|
110
|
+
});
|
|
111
|
+
};
|
|
112
|
+
$[11] = config.rtl;
|
|
113
|
+
$[12] = config.top;
|
|
114
|
+
$[13] = kind;
|
|
115
|
+
$[14] = notificationConfig.bottom;
|
|
116
|
+
$[15] = tokenStyle;
|
|
117
|
+
$[16] = t12;
|
|
118
|
+
} else t12 = $[16];
|
|
119
|
+
let t13;
|
|
120
|
+
if ($[17] !== config.getContainer || $[18] !== config.maxCount || $[19] !== notificationConfig.showProgress || $[20] !== t0 || $[21] !== t10 || $[22] !== t11 || $[23] !== t12 || $[24] !== t2 || $[25] !== t4 || $[26] !== t6 || $[27] !== t7 || $[28] !== t8) {
|
|
121
|
+
t13 = {
|
|
122
|
+
prefixCls: t0,
|
|
123
|
+
getContainer: t1,
|
|
124
|
+
duration: t2,
|
|
125
|
+
maxCount: t3,
|
|
126
|
+
pauseOnHover: t4,
|
|
127
|
+
showProgress: t5,
|
|
128
|
+
stack: t6,
|
|
129
|
+
closable: t7,
|
|
130
|
+
classNames: t8,
|
|
131
|
+
styles: t10,
|
|
132
|
+
motion: t11,
|
|
133
|
+
renderNotifications: t12
|
|
134
|
+
};
|
|
135
|
+
$[17] = config.getContainer;
|
|
136
|
+
$[18] = config.maxCount;
|
|
137
|
+
$[19] = notificationConfig.showProgress;
|
|
138
|
+
$[20] = t0;
|
|
139
|
+
$[21] = t10;
|
|
140
|
+
$[22] = t11;
|
|
141
|
+
$[23] = t12;
|
|
142
|
+
$[24] = t2;
|
|
143
|
+
$[25] = t4;
|
|
144
|
+
$[26] = t6;
|
|
145
|
+
$[27] = t7;
|
|
146
|
+
$[28] = t8;
|
|
147
|
+
$[29] = t13;
|
|
148
|
+
} else t13 = $[29];
|
|
149
|
+
const [api, holder] = useNotification(t13);
|
|
150
|
+
let t14;
|
|
151
|
+
if ($[30] !== api || $[31] !== holder) {
|
|
152
|
+
t14 = [
|
|
153
|
+
api,
|
|
154
|
+
holder
|
|
155
|
+
];
|
|
156
|
+
$[30] = api;
|
|
157
|
+
$[31] = holder;
|
|
158
|
+
$[32] = t14;
|
|
159
|
+
} else t14 = $[32];
|
|
160
|
+
return t14;
|
|
161
|
+
}
|
|
162
|
+
function useAppMessages(config = {}) {
|
|
163
|
+
const [notices, holder] = useNoticeHolder('message', config);
|
|
164
|
+
const active = useRef(new Map());
|
|
165
|
+
const sequence = useRef(0);
|
|
166
|
+
const latest = useRef(config);
|
|
167
|
+
latest.current = config;
|
|
168
|
+
useEffect(()=>()=>{
|
|
169
|
+
for (const life of active.current.values())for (const resolve of life.resolve)resolve();
|
|
170
|
+
active.current.clear();
|
|
171
|
+
}, []);
|
|
172
|
+
const api = useMemo(()=>{
|
|
173
|
+
const finish = (key)=>{
|
|
174
|
+
const life_0 = active.current.get(key);
|
|
175
|
+
if (!life_0) return;
|
|
176
|
+
active.current.delete(key);
|
|
177
|
+
life_0.onClose?.();
|
|
178
|
+
for (const resolve_0 of life_0.resolve)resolve_0();
|
|
179
|
+
};
|
|
180
|
+
const close = (key_0)=>{
|
|
181
|
+
notices.close(key_0);
|
|
182
|
+
finish(key_0);
|
|
183
|
+
};
|
|
184
|
+
const open = (args)=>{
|
|
185
|
+
const defaults = latest.current;
|
|
186
|
+
const key_1 = args.key ?? `tao-app-message-${sequence.current++}`;
|
|
187
|
+
const resolvers = active.current.get(key_1)?.resolve ?? [];
|
|
188
|
+
const promise = new Promise((resolve_1)=>resolvers.push(()=>resolve_1(true)));
|
|
189
|
+
active.current.set(key_1, {
|
|
190
|
+
onClose: args.onClose,
|
|
191
|
+
resolve: resolvers
|
|
192
|
+
});
|
|
193
|
+
if (defaults.maxCount && active.current.size > defaults.maxCount) close(active.current.keys().next().value);
|
|
194
|
+
const merged = {
|
|
195
|
+
...defaults,
|
|
196
|
+
...args
|
|
197
|
+
};
|
|
198
|
+
notices.open({
|
|
199
|
+
...args,
|
|
200
|
+
key: key_1,
|
|
201
|
+
title: args.content,
|
|
202
|
+
duration: args.duration ?? defaults.duration ?? 3,
|
|
203
|
+
pauseOnHover: args.pauseOnHover ?? defaults.pauseOnHover ?? true,
|
|
204
|
+
role: 'status',
|
|
205
|
+
closable: false,
|
|
206
|
+
placement: 'top',
|
|
207
|
+
icon: iconFor(args.type, args.icon),
|
|
208
|
+
classNames: noticeClasses(resolveAppSemantic(defaults.classNames, merged), resolveAppSemantic(args.classNames, merged)),
|
|
209
|
+
styles: noticeStyles(resolveAppSemantic(defaults.styles, merged), resolveAppSemantic(args.styles, merged)),
|
|
210
|
+
onClose: ()=>finish(key_1)
|
|
211
|
+
});
|
|
212
|
+
return Object.assign(()=>close(key_1), {
|
|
213
|
+
then: promise.then.bind(promise)
|
|
214
|
+
});
|
|
215
|
+
};
|
|
216
|
+
const typed = (type)=>(content, duration, onClose)=>{
|
|
217
|
+
const args_0 = content && 'object' == typeof content && 'content' in content ? content : {
|
|
218
|
+
content
|
|
219
|
+
};
|
|
220
|
+
return open({
|
|
221
|
+
...args_0,
|
|
222
|
+
type,
|
|
223
|
+
...'number' == typeof duration ? {
|
|
224
|
+
duration
|
|
225
|
+
} : {},
|
|
226
|
+
...'function' == typeof duration ? {
|
|
227
|
+
onClose: duration
|
|
228
|
+
} : onClose ? {
|
|
229
|
+
onClose
|
|
230
|
+
} : {}
|
|
231
|
+
});
|
|
232
|
+
};
|
|
233
|
+
return {
|
|
234
|
+
open,
|
|
235
|
+
info: typed('info'),
|
|
236
|
+
success: typed('success'),
|
|
237
|
+
warning: typed('warning'),
|
|
238
|
+
error: typed('error'),
|
|
239
|
+
loading: typed('loading'),
|
|
240
|
+
destroy: (key_2)=>{
|
|
241
|
+
if (void 0 !== key_2) close(key_2);
|
|
242
|
+
else for (const current of [
|
|
243
|
+
...active.current.keys()
|
|
244
|
+
])close(current);
|
|
245
|
+
}
|
|
246
|
+
};
|
|
247
|
+
}, [
|
|
248
|
+
notices
|
|
249
|
+
]);
|
|
250
|
+
return [
|
|
251
|
+
api,
|
|
252
|
+
holder
|
|
253
|
+
];
|
|
254
|
+
}
|
|
255
|
+
function useAppNotifications(config = {}) {
|
|
256
|
+
const { locale } = useTaoConfig();
|
|
257
|
+
const closeLabel = useRef(locale.close);
|
|
258
|
+
closeLabel.current = locale.close;
|
|
259
|
+
const [notices, holder] = useNoticeHolder('notification', config);
|
|
260
|
+
const latest = useRef(config);
|
|
261
|
+
latest.current = config;
|
|
262
|
+
const api = useMemo(()=>{
|
|
263
|
+
const open = (args)=>{
|
|
264
|
+
const defaults = latest.current;
|
|
265
|
+
const merged = {
|
|
266
|
+
...defaults,
|
|
267
|
+
...args
|
|
268
|
+
};
|
|
269
|
+
const closeIcon = void 0 === args.closeIcon ? void 0 === defaults.closeIcon ? '×' : defaults.closeIcon : args.closeIcon;
|
|
270
|
+
const closable = false === args.closable || null === args.closable || false === closeIcon || null === closeIcon ? false : {
|
|
271
|
+
closeIcon,
|
|
272
|
+
'aria-label': closeLabel.current,
|
|
273
|
+
...'object' == typeof args.closable ? args.closable : {}
|
|
274
|
+
};
|
|
275
|
+
const classNames = noticeClasses(resolveAppSemantic(defaults.classNames, merged), resolveAppSemantic(args.classNames, merged));
|
|
276
|
+
const styles = noticeStyles(resolveAppSemantic(defaults.styles, merged), resolveAppSemantic(args.styles, merged));
|
|
277
|
+
const disabledClose = 'object' == typeof closable && closable?.disabled;
|
|
278
|
+
const title = args.title ?? args.message;
|
|
279
|
+
notices.open({
|
|
280
|
+
...args,
|
|
281
|
+
title: disabledClose ? /*#__PURE__*/ jsxs(Fragment, {
|
|
282
|
+
children: [
|
|
283
|
+
title,
|
|
284
|
+
/*#__PURE__*/ jsx("button", {
|
|
285
|
+
type: "button",
|
|
286
|
+
disabled: true,
|
|
287
|
+
"aria-label": closable['aria-label'] ?? closeLabel.current,
|
|
288
|
+
className: classNames.close,
|
|
289
|
+
style: styles.close,
|
|
290
|
+
children: closable.closeIcon
|
|
291
|
+
})
|
|
292
|
+
]
|
|
293
|
+
}) : title,
|
|
294
|
+
actions: args.actions ?? args.btn,
|
|
295
|
+
placement: args.placement ?? defaults.placement ?? 'topRight',
|
|
296
|
+
duration: args.duration ?? defaults.duration ?? 4.5,
|
|
297
|
+
pauseOnHover: args.pauseOnHover ?? defaults.pauseOnHover ?? true,
|
|
298
|
+
showProgress: args.showProgress ?? defaults.showProgress,
|
|
299
|
+
role: args.role ?? 'alert',
|
|
300
|
+
icon: iconFor(args.type, args.icon),
|
|
301
|
+
classNames,
|
|
302
|
+
styles,
|
|
303
|
+
closable: disabledClose ? false : closable
|
|
304
|
+
});
|
|
305
|
+
};
|
|
306
|
+
return {
|
|
307
|
+
open,
|
|
308
|
+
success: (args_0)=>open({
|
|
309
|
+
...args_0,
|
|
310
|
+
type: 'success'
|
|
311
|
+
}),
|
|
312
|
+
info: (args_1)=>open({
|
|
313
|
+
...args_1,
|
|
314
|
+
type: 'info'
|
|
315
|
+
}),
|
|
316
|
+
error: (args_2)=>open({
|
|
317
|
+
...args_2,
|
|
318
|
+
type: 'error'
|
|
319
|
+
}),
|
|
320
|
+
warning: (args_3)=>open({
|
|
321
|
+
...args_3,
|
|
322
|
+
type: 'warning'
|
|
323
|
+
}),
|
|
324
|
+
destroy: (key)=>void 0 === key ? notices.destroy() : notices.close(key)
|
|
325
|
+
};
|
|
326
|
+
}, [
|
|
327
|
+
notices
|
|
328
|
+
]);
|
|
329
|
+
return [
|
|
330
|
+
api,
|
|
331
|
+
holder
|
|
332
|
+
];
|
|
333
|
+
}
|
|
334
|
+
export { resolveAppSemantic, useAppMessages, useAppNotifications };
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import type { NotificationProps } from '@rc-component/notification';
|
|
2
|
+
import type { CSSProperties, ElementType, Key, MouseEvent, ReactNode } from 'react';
|
|
3
|
+
import type { SemanticClassNames, SemanticStyles } from '../../utils/semantic.js';
|
|
4
|
+
import type { ButtonProps } from '../button/button.js';
|
|
5
|
+
import type { ModalProps } from '../modal/modal.js';
|
|
6
|
+
export type AppSemanticPart = 'root';
|
|
7
|
+
export type AppMessageSemanticPart = 'list' | 'listContent' | 'root' | 'wrapper' | 'icon' | 'title';
|
|
8
|
+
export type AppNotificationSemanticPart = AppMessageSemanticPart | 'description' | 'actions' | 'section' | 'close' | 'progress';
|
|
9
|
+
type SemanticValue<T, P> = T | ((info: {
|
|
10
|
+
props: P;
|
|
11
|
+
}) => T);
|
|
12
|
+
export type AppNoticeType = 'info' | 'success' | 'error' | 'warning' | 'loading';
|
|
13
|
+
export type AppNotificationPlacement = 'top' | 'topLeft' | 'topRight' | 'bottom' | 'bottomLeft' | 'bottomRight';
|
|
14
|
+
export interface AppMessageArgs {
|
|
15
|
+
content: ReactNode;
|
|
16
|
+
duration?: number;
|
|
17
|
+
type?: AppNoticeType;
|
|
18
|
+
onClose?: () => void;
|
|
19
|
+
icon?: ReactNode;
|
|
20
|
+
key?: string | number;
|
|
21
|
+
style?: CSSProperties;
|
|
22
|
+
className?: string;
|
|
23
|
+
classNames?: SemanticValue<SemanticClassNames<AppMessageSemanticPart>, AppMessageArgs>;
|
|
24
|
+
styles?: SemanticValue<SemanticStyles<AppMessageSemanticPart>, AppMessageArgs>;
|
|
25
|
+
onClick?: (event: MouseEvent<HTMLDivElement>) => void;
|
|
26
|
+
pauseOnHover?: boolean;
|
|
27
|
+
}
|
|
28
|
+
export interface AppMessageConfig {
|
|
29
|
+
top?: string | number;
|
|
30
|
+
duration?: number;
|
|
31
|
+
prefixCls?: string;
|
|
32
|
+
getContainer?: () => HTMLElement;
|
|
33
|
+
transitionName?: string;
|
|
34
|
+
maxCount?: number;
|
|
35
|
+
rtl?: boolean;
|
|
36
|
+
stack?: boolean | {
|
|
37
|
+
threshold?: number;
|
|
38
|
+
};
|
|
39
|
+
pauseOnHover?: boolean;
|
|
40
|
+
classNames?: AppMessageArgs['classNames'];
|
|
41
|
+
styles?: AppMessageArgs['styles'];
|
|
42
|
+
}
|
|
43
|
+
export interface AppMessageType extends PromiseLike<boolean> {
|
|
44
|
+
(): void;
|
|
45
|
+
}
|
|
46
|
+
export type AppMessageOpen = (content: ReactNode | AppMessageArgs, duration?: number | (() => void), onClose?: () => void) => AppMessageType;
|
|
47
|
+
export interface AppMessageInstance {
|
|
48
|
+
info: AppMessageOpen;
|
|
49
|
+
success: AppMessageOpen;
|
|
50
|
+
error: AppMessageOpen;
|
|
51
|
+
warning: AppMessageOpen;
|
|
52
|
+
loading: AppMessageOpen;
|
|
53
|
+
open: (args: AppMessageArgs) => AppMessageType;
|
|
54
|
+
destroy: (key?: Key) => void;
|
|
55
|
+
}
|
|
56
|
+
export interface AppNotificationArgs {
|
|
57
|
+
/** @deprecated Use title. */
|
|
58
|
+
message?: ReactNode;
|
|
59
|
+
title?: ReactNode;
|
|
60
|
+
description?: ReactNode;
|
|
61
|
+
/** @deprecated Use actions. */
|
|
62
|
+
btn?: ReactNode;
|
|
63
|
+
actions?: ReactNode;
|
|
64
|
+
key?: Key;
|
|
65
|
+
onClose?: () => void;
|
|
66
|
+
duration?: number | false;
|
|
67
|
+
showProgress?: boolean;
|
|
68
|
+
pauseOnHover?: boolean;
|
|
69
|
+
icon?: ReactNode;
|
|
70
|
+
placement?: AppNotificationPlacement;
|
|
71
|
+
style?: CSSProperties;
|
|
72
|
+
className?: string;
|
|
73
|
+
classNames?: SemanticValue<SemanticClassNames<AppNotificationSemanticPart>, AppNotificationArgs>;
|
|
74
|
+
styles?: SemanticValue<SemanticStyles<AppNotificationSemanticPart>, AppNotificationArgs>;
|
|
75
|
+
readonly type?: Exclude<AppNoticeType, 'loading'>;
|
|
76
|
+
onClick?: () => void;
|
|
77
|
+
closeIcon?: ReactNode;
|
|
78
|
+
closable?: NotificationProps['closable'];
|
|
79
|
+
props?: NotificationProps['props'];
|
|
80
|
+
role?: 'alert' | 'status';
|
|
81
|
+
}
|
|
82
|
+
export interface AppNotificationConfig {
|
|
83
|
+
top?: number;
|
|
84
|
+
bottom?: number;
|
|
85
|
+
prefixCls?: string;
|
|
86
|
+
getContainer?: () => HTMLElement | ShadowRoot;
|
|
87
|
+
placement?: AppNotificationPlacement;
|
|
88
|
+
maxCount?: number;
|
|
89
|
+
rtl?: boolean;
|
|
90
|
+
stack?: boolean | {
|
|
91
|
+
threshold?: number;
|
|
92
|
+
};
|
|
93
|
+
duration?: number | false;
|
|
94
|
+
showProgress?: boolean;
|
|
95
|
+
pauseOnHover?: boolean;
|
|
96
|
+
closeIcon?: ReactNode;
|
|
97
|
+
classNames?: AppNotificationArgs['classNames'];
|
|
98
|
+
styles?: AppNotificationArgs['styles'];
|
|
99
|
+
}
|
|
100
|
+
export interface AppNotificationInstance {
|
|
101
|
+
success: (args: AppNotificationArgs) => void;
|
|
102
|
+
error: (args: AppNotificationArgs) => void;
|
|
103
|
+
info: (args: AppNotificationArgs) => void;
|
|
104
|
+
warning: (args: AppNotificationArgs) => void;
|
|
105
|
+
open: (args: AppNotificationArgs) => void;
|
|
106
|
+
destroy: (key?: Key) => void;
|
|
107
|
+
}
|
|
108
|
+
export interface AppModalConfig extends Omit<ModalProps, 'open' | 'onOk' | 'onClose' | 'children' | 'width' | 'classNames' | 'styles'> {
|
|
109
|
+
open?: boolean;
|
|
110
|
+
content?: ReactNode;
|
|
111
|
+
icon?: ReactNode;
|
|
112
|
+
type?: 'info' | 'success' | 'error' | 'warn' | 'warning' | 'confirm';
|
|
113
|
+
okCancel?: boolean;
|
|
114
|
+
onOk?: (close: () => void) => unknown;
|
|
115
|
+
onCancel?: (close: () => void) => unknown;
|
|
116
|
+
width?: string | number;
|
|
117
|
+
className?: string;
|
|
118
|
+
rootClassName?: string;
|
|
119
|
+
prefixCls?: string;
|
|
120
|
+
style?: CSSProperties;
|
|
121
|
+
wrapClassName?: string;
|
|
122
|
+
okType?: ButtonProps['variant'] | 'default' | 'dashed' | 'link';
|
|
123
|
+
bodyStyle?: CSSProperties;
|
|
124
|
+
maskStyle?: CSSProperties;
|
|
125
|
+
direction?: 'ltr' | 'rtl';
|
|
126
|
+
classNames?: SemanticValue<NonNullable<ModalProps['classNames']>, AppModalConfig>;
|
|
127
|
+
styles?: SemanticValue<NonNullable<ModalProps['styles']>, AppModalConfig>;
|
|
128
|
+
}
|
|
129
|
+
export interface AppModalResult extends PromiseLike<boolean> {
|
|
130
|
+
destroy: () => void;
|
|
131
|
+
update: (config: Partial<AppModalConfig> | ((previous: AppModalConfig) => AppModalConfig)) => void;
|
|
132
|
+
}
|
|
133
|
+
export type AppModalInstance = Record<'confirm' | 'info' | 'success' | 'error' | 'warning', (config: AppModalConfig) => AppModalResult>;
|
|
134
|
+
export interface AppInstance {
|
|
135
|
+
message: AppMessageInstance;
|
|
136
|
+
notification: AppNotificationInstance;
|
|
137
|
+
modal: AppModalInstance;
|
|
138
|
+
}
|
|
139
|
+
export type useAppProps = AppInstance;
|
|
140
|
+
export interface AppConfig {
|
|
141
|
+
message?: AppMessageConfig;
|
|
142
|
+
notification?: AppNotificationConfig;
|
|
143
|
+
}
|
|
144
|
+
export interface AppProps extends AppConfig {
|
|
145
|
+
children?: ReactNode;
|
|
146
|
+
component?: ElementType | false;
|
|
147
|
+
prefixCls?: string;
|
|
148
|
+
className?: string;
|
|
149
|
+
rootClassName?: string;
|
|
150
|
+
style?: CSSProperties;
|
|
151
|
+
classNames?: SemanticClassNames<AppSemanticPart>;
|
|
152
|
+
styles?: SemanticStyles<AppSemanticPart>;
|
|
153
|
+
}
|
|
154
|
+
export {};
|
|
File without changes
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
[data-tao-app] {
|
|
2
|
+
color: var(--tao-color-text);
|
|
3
|
+
font-family: var(--tao-font-family);
|
|
4
|
+
font-size: var(--tao-font-size);
|
|
5
|
+
line-height: var(--tao-line-height);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
[data-tao-app-notices] {
|
|
9
|
+
z-index: var(--tao-z-index-popup);
|
|
10
|
+
pointer-events: none;
|
|
11
|
+
max-width: calc(100vw - 32px);
|
|
12
|
+
font-family: var(--tao-font-family);
|
|
13
|
+
font-size: var(--tao-font-size);
|
|
14
|
+
line-height: var(--tao-line-height);
|
|
15
|
+
color: var(--tao-color-text);
|
|
16
|
+
position: fixed;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
[data-tao-app-notices][data-tao-placement$="Right"] {
|
|
20
|
+
right: 24px;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
[data-tao-app-notices][data-tao-placement$="Left"] {
|
|
24
|
+
left: 24px;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
[data-tao-app-notices][data-tao-placement="top"], [data-tao-app-notices][data-tao-placement="bottom"] {
|
|
28
|
+
left: 50%;
|
|
29
|
+
transform: translateX(-50%);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
[data-tao-app-notices] .tao-app-notice-list {
|
|
33
|
+
gap: 12px;
|
|
34
|
+
width: 384px;
|
|
35
|
+
max-width: calc(100vw - 32px);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
[data-tao-app-notices="message"] .tao-app-notice-list {
|
|
39
|
+
width: 560px;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
[data-tao-app-notices] .tao-app-notice-listContent {
|
|
43
|
+
position: relative;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
[data-tao-app-notices] .tao-app-notice-root {
|
|
47
|
+
inset-inline: 0;
|
|
48
|
+
z-index: calc(100 - var(--notification-index, 0));
|
|
49
|
+
transform: translateY(var(--notification-y, 0));
|
|
50
|
+
pointer-events: auto;
|
|
51
|
+
background: var(--tao-color-bg-elevated);
|
|
52
|
+
border: 1px solid var(--tao-color-border-secondary);
|
|
53
|
+
border-radius: var(--tao-radius);
|
|
54
|
+
box-shadow: var(--tao-box-shadow-secondary);
|
|
55
|
+
overflow-wrap: anywhere;
|
|
56
|
+
padding: 16px;
|
|
57
|
+
position: absolute;
|
|
58
|
+
top: 0;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
[data-tao-app-notices] .tao-app-notice-list[class*="-stack"]:not([class*="-stack-expanded"]) .tao-app-notice-root:not([class*="-stack-in-threshold"]) {
|
|
62
|
+
opacity: 0;
|
|
63
|
+
pointer-events: none;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
[data-tao-app-notices="message"] .tao-app-notice-root {
|
|
67
|
+
inset-inline: auto;
|
|
68
|
+
width: max-content;
|
|
69
|
+
max-width: 100%;
|
|
70
|
+
transform: translate(-50%, var(--notification-y, 0));
|
|
71
|
+
padding: 10px 14px;
|
|
72
|
+
left: 50%;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
[data-tao-app-notices][data-tao-placement^="bottom"] .tao-app-notice-root {
|
|
76
|
+
transform: translateY(calc(-1 * var(--notification-y, 0px)));
|
|
77
|
+
top: auto;
|
|
78
|
+
bottom: 0;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
[data-tao-app-notices] .tao-app-notice-wrapper {
|
|
82
|
+
align-items: flex-start;
|
|
83
|
+
gap: 10px;
|
|
84
|
+
display: flex;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
[data-tao-app-notices="message"] .tao-app-notice-wrapper {
|
|
88
|
+
align-items: center;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
[data-tao-app-notices] .tao-app-notice-section {
|
|
92
|
+
flex: 1;
|
|
93
|
+
min-width: 0;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
[data-tao-app-notices] .tao-app-notice-icon {
|
|
97
|
+
flex: none;
|
|
98
|
+
align-items: center;
|
|
99
|
+
font-size: 20px;
|
|
100
|
+
line-height: 1.4;
|
|
101
|
+
display: flex;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
[data-tao-app-notices] .tao-app-notice-title {
|
|
105
|
+
padding-inline-end: 16px;
|
|
106
|
+
font-weight: 600;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
[data-tao-app-notices="message"] .tao-app-notice-title {
|
|
110
|
+
padding: 0;
|
|
111
|
+
font-weight: 400;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
[data-tao-app-notices] .tao-app-notice-description {
|
|
115
|
+
color: var(--tao-color-text-secondary);
|
|
116
|
+
margin-top: 6px;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
[data-tao-app-notices] .tao-app-notice-actions {
|
|
120
|
+
justify-content: flex-end;
|
|
121
|
+
gap: 8px;
|
|
122
|
+
margin-top: 12px;
|
|
123
|
+
display: flex;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
[data-tao-app-notices] .tao-app-notice-close {
|
|
127
|
+
inset-inline-end: 8px;
|
|
128
|
+
border-radius: var(--tao-radius-sm);
|
|
129
|
+
width: 24px;
|
|
130
|
+
height: 24px;
|
|
131
|
+
color: var(--tao-color-text-secondary);
|
|
132
|
+
cursor: pointer;
|
|
133
|
+
font: inherit;
|
|
134
|
+
background: none;
|
|
135
|
+
border: 0;
|
|
136
|
+
place-items: center;
|
|
137
|
+
font-size: 20px;
|
|
138
|
+
display: grid;
|
|
139
|
+
position: absolute;
|
|
140
|
+
top: 8px;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
[data-tao-app-notices] .tao-app-notice-close:hover {
|
|
144
|
+
background: var(--tao-color-fill-secondary);
|
|
145
|
+
color: var(--tao-color-text);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
[data-tao-app-notices] .tao-app-notice-close:focus-visible {
|
|
149
|
+
outline: 2px solid var(--tao-color-primary);
|
|
150
|
+
outline-offset: 2px;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
[data-tao-app-notices] .tao-app-notice-progress {
|
|
154
|
+
appearance: none;
|
|
155
|
+
bottom: 0;
|
|
156
|
+
background: var(--tao-color-fill-secondary);
|
|
157
|
+
border-radius: 0 0 var(--tao-radius) var(--tao-radius);
|
|
158
|
+
border: 0;
|
|
159
|
+
width: 100%;
|
|
160
|
+
height: 3px;
|
|
161
|
+
position: absolute;
|
|
162
|
+
inset-inline: 0;
|
|
163
|
+
overflow: hidden;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
[data-tao-app-notices] .tao-app-notice-progress::-webkit-progress-bar {
|
|
167
|
+
background: var(--tao-color-fill-secondary);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
[data-tao-app-notices] .tao-app-notice-progress::-webkit-progress-value {
|
|
171
|
+
background: var(--tao-color-primary);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
[data-tao-app-notices] .tao-app-notice-progress::-moz-progress-bar {
|
|
175
|
+
background: var(--tao-color-primary);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
[data-tao-notice-status="success"] {
|
|
179
|
+
color: var(--tao-color-success);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
[data-tao-notice-status="error"] {
|
|
183
|
+
color: var(--tao-color-error);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
[data-tao-notice-status="warning"] {
|
|
187
|
+
color: var(--tao-color-warning);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
[data-tao-notice-status="info"], [data-tao-notice-status="loading"] {
|
|
191
|
+
color: var(--tao-color-primary);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
[data-tao-app-modal-body] {
|
|
195
|
+
align-items: flex-start;
|
|
196
|
+
gap: 12px;
|
|
197
|
+
display: flex;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
[data-tao-app-modal-content] {
|
|
201
|
+
flex: 1;
|
|
202
|
+
min-width: 0;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
@media (width <= 575px) {
|
|
206
|
+
[data-tao-app-notices][data-tao-placement$="Right"] {
|
|
207
|
+
right: 16px;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
[data-tao-app-notices][data-tao-placement$="Left"] {
|
|
211
|
+
left: 16px;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
[data-tao-app-notices] .tao-app-notice-close {
|
|
215
|
+
top: 4px;
|
|
216
|
+
width: 32px;
|
|
217
|
+
height: 32px;
|
|
218
|
+
inset-inline-end: 4px;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
|