@qw-ui/core 0.3.0-next.40 → 0.3.0-next.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 +21 -37
- package/dist/action-sheet/action-sheet.d.ts +110 -0
- package/dist/action-sheet/index.d.ts +2 -0
- package/dist/action-sheet/index.js +2 -0
- package/dist/action-sheet-Cvcr1S_m.js +183 -0
- package/dist/action-sheet-Cvcr1S_m.js.map +1 -0
- package/dist/area-picker/area-picker.d.ts +113 -0
- package/dist/area-picker/index.d.ts +1 -0
- package/dist/area-picker/index.js +348 -0
- package/dist/area-picker/index.js.map +1 -0
- package/dist/aria-description-CimD2M_C.js +13 -0
- package/dist/aria-description-CimD2M_C.js.map +1 -0
- package/dist/aria-description.d.ts +2 -0
- package/dist/avatar/avatar-load.d.ts +76 -0
- package/dist/avatar/avatar.d.ts +22 -5
- package/dist/avatar/index.d.ts +1 -0
- package/dist/avatar/index.js +57 -18
- package/dist/avatar/index.js.map +1 -1
- package/dist/avatar-load-w9dq05oV.js +139 -0
- package/dist/avatar-load-w9dq05oV.js.map +1 -0
- package/dist/back-top/back-top.d.ts +77 -0
- package/dist/back-top/index.d.ts +1 -0
- package/dist/back-top/index.js +189 -0
- package/dist/back-top/index.js.map +1 -0
- package/dist/badge/badge.d.ts +9 -0
- package/dist/badge/index.js +14 -1
- package/dist/badge/index.js.map +1 -1
- package/dist/button/button.d.ts +13 -0
- package/dist/button/index.js +3 -5
- package/dist/button/index.js.map +1 -1
- package/dist/calendar/calendar.d.ts +100 -0
- package/dist/calendar/index.d.ts +1 -0
- package/dist/calendar/index.js +2 -0
- package/dist/calendar-CmpK3stz.js +363 -0
- package/dist/calendar-CmpK3stz.js.map +1 -0
- package/dist/card/card.d.ts +68 -0
- package/dist/card/index.d.ts +2 -0
- package/dist/card/index.js +2 -0
- package/dist/card-DRtWa6Cr.js +107 -0
- package/dist/card-DRtWa6Cr.js.map +1 -0
- package/dist/cascader/cascader.d.ts +115 -0
- package/dist/cascader/index.d.ts +1 -0
- package/dist/cascader/index.js +2 -0
- package/dist/cascader-D-xMjs7P.js +333 -0
- package/dist/cascader-D-xMjs7P.js.map +1 -0
- package/dist/cell/cell.d.ts +41 -0
- package/dist/cell/index.d.ts +1 -0
- package/dist/cell/index.js +43 -0
- package/dist/cell/index.js.map +1 -0
- package/dist/check-list/check-list.d.ts +78 -0
- package/dist/check-list/index.d.ts +2 -0
- package/dist/check-list/index.js +2 -0
- package/dist/check-list-BvZHQt5w.js +60 -0
- package/dist/check-list-BvZHQt5w.js.map +1 -0
- package/dist/checkbox/checkbox.d.ts +59 -0
- package/dist/checkbox/index.d.ts +2 -0
- package/dist/checkbox/index.js +2 -0
- package/dist/checkbox-BlndJrz5.js +127 -0
- package/dist/checkbox-BlndJrz5.js.map +1 -0
- package/dist/checkbox-group/checkbox-group.d.ts +86 -0
- package/dist/checkbox-group/index.d.ts +3 -0
- package/dist/checkbox-group/index.js +2 -0
- package/dist/checkbox-group-gGfsTv-e.js +223 -0
- package/dist/checkbox-group-gGfsTv-e.js.map +1 -0
- package/dist/choice-group-C4c9m0qe.js +373 -0
- package/dist/choice-group-C4c9m0qe.js.map +1 -0
- package/dist/circle/circle.d.ts +97 -0
- package/dist/circle/index.d.ts +1 -0
- package/dist/circle/index.js +119 -0
- package/dist/circle/index.js.map +1 -0
- package/dist/collapse/collapse.d.ts +98 -0
- package/dist/collapse/index.d.ts +2 -0
- package/dist/collapse/index.js +2 -0
- package/dist/collapse-B969h7-H.js +226 -0
- package/dist/collapse-B969h7-H.js.map +1 -0
- package/dist/countdown/countdown.d.ts +114 -0
- package/dist/countdown/index.d.ts +1 -0
- package/dist/countdown/index.js +309 -0
- package/dist/countdown/index.js.map +1 -0
- package/dist/date-picker/date-picker.d.ts +168 -0
- package/dist/date-picker/index.d.ts +1 -0
- package/dist/date-picker/index.js +401 -0
- package/dist/date-picker/index.js.map +1 -0
- package/dist/descriptions/descriptions.d.ts +69 -0
- package/dist/descriptions/index.d.ts +1 -0
- package/dist/descriptions/index.js +86 -0
- package/dist/descriptions/index.js.map +1 -0
- package/dist/dialog/dialog.d.ts +32 -3
- package/dist/dialog/index.js +58 -3
- package/dist/dialog/index.js.map +1 -1
- package/dist/divider/divider.d.ts +18 -2
- package/dist/divider/index.js +20 -2
- package/dist/divider/index.js.map +1 -1
- package/dist/dropdown/dropdown.d.ts +172 -0
- package/dist/dropdown/index.d.ts +2 -0
- package/dist/dropdown/index.js +467 -0
- package/dist/dropdown/index.js.map +1 -0
- package/dist/ellipsis/ellipsis-layout.d.ts +34 -0
- package/dist/ellipsis/ellipsis.d.ts +88 -0
- package/dist/ellipsis/index.d.ts +2 -0
- package/dist/ellipsis/index.js +320 -0
- package/dist/ellipsis/index.js.map +1 -0
- package/dist/empty/empty-illustration.d.ts +3 -0
- package/dist/empty/empty.d.ts +43 -1
- package/dist/empty/index.js +2 -21
- package/dist/empty-CAgyvhUI.js +166 -0
- package/dist/empty-CAgyvhUI.js.map +1 -0
- package/dist/field/field.d.ts +95 -0
- package/dist/field/index.d.ts +2 -0
- package/dist/field/index.js +2 -0
- package/dist/field-DMHGIMZF.js +241 -0
- package/dist/field-DMHGIMZF.js.map +1 -0
- package/dist/floating-bubble/floating-bubble.d.ts +116 -0
- package/dist/floating-bubble/index.d.ts +1 -0
- package/dist/floating-bubble/index.js +333 -0
- package/dist/floating-bubble/index.js.map +1 -0
- package/dist/floating-panel/floating-panel.d.ts +80 -0
- package/dist/floating-panel/index.d.ts +2 -0
- package/dist/floating-panel/index.js +2 -0
- package/dist/floating-panel-Cbm5njBJ.js +363 -0
- package/dist/floating-panel-Cbm5njBJ.js.map +1 -0
- package/dist/footer/footer.d.ts +94 -0
- package/dist/footer/index.d.ts +1 -0
- package/dist/footer/index.js +154 -0
- package/dist/footer/index.js.map +1 -0
- package/dist/form/connect.d.ts +6 -0
- package/dist/form/form.d.ts +100 -0
- package/dist/form/ids.d.ts +14 -0
- package/dist/form/index.d.ts +13 -0
- package/dist/form/index.js +3 -0
- package/dist/form/methods.d.ts +5 -0
- package/dist/form/model.d.ts +24 -0
- package/dist/form/native.d.ts +25 -0
- package/dist/form/rules.d.ts +40 -0
- package/dist/form/ssr.d.ts +7 -0
- package/dist/form/types.d.ts +150 -0
- package/dist/form-BAGkIEMY.js +1354 -0
- package/dist/form-BAGkIEMY.js.map +1 -0
- package/dist/format-BDUY0C_c.js +89 -0
- package/dist/format-BDUY0C_c.js.map +1 -0
- package/dist/gesture-_SRHIvBm.js +30 -0
- package/dist/gesture-_SRHIvBm.js.map +1 -0
- package/dist/grid/grid-item.d.ts +22 -0
- package/dist/grid/grid.d.ts +42 -0
- package/dist/grid/index.d.ts +2 -0
- package/dist/grid/index.js +73 -0
- package/dist/grid/index.js.map +1 -0
- package/dist/icon/icon.d.ts +37 -1
- package/dist/icon/identity.d.ts +3 -0
- package/dist/icon/index.js +2 -20
- package/dist/icon-Cgdbnk1u.js +77 -0
- package/dist/icon-Cgdbnk1u.js.map +1 -0
- package/dist/image/image-load.d.ts +24 -0
- package/dist/image/image.d.ts +45 -8
- package/dist/image/index.d.ts +1 -0
- package/dist/image/index.js +116 -14
- package/dist/image/index.js.map +1 -1
- package/dist/image-preview/image-preview.d.ts +124 -0
- package/dist/image-preview/index.d.ts +1 -0
- package/dist/image-preview/index.js +450 -0
- package/dist/image-preview/index.js.map +1 -0
- package/dist/index-bar/index-bar.d.ts +121 -0
- package/dist/index-bar/index.d.ts +1 -0
- package/dist/index-bar/index.js +386 -0
- package/dist/index-bar/index.js.map +1 -0
- package/dist/index.d.ts +107 -14
- package/dist/index.js +148 -14
- package/dist/index.js.map +1 -0
- package/dist/infinite-scroll/index.d.ts +1 -0
- package/dist/infinite-scroll/index.js +248 -0
- package/dist/infinite-scroll/index.js.map +1 -0
- package/dist/infinite-scroll/infinite-scroll.d.ts +95 -0
- package/dist/input/index.js +181 -22
- package/dist/input/index.js.map +1 -1
- package/dist/input/input.d.ts +44 -1
- package/dist/layer-IpFrl5--.js +414 -0
- package/dist/layer-IpFrl5--.js.map +1 -0
- package/dist/layout-BRSqi4AQ.js +43 -0
- package/dist/layout-BRSqi4AQ.js.map +1 -0
- package/dist/layout.d.ts +13 -0
- package/dist/list/index.d.ts +2 -0
- package/dist/list/index.js +2 -0
- package/dist/list/list.d.ts +30 -0
- package/dist/list-6-iz-Irh.js +28 -0
- package/dist/list-6-iz-Irh.js.map +1 -0
- package/dist/loading/index.js +45 -2
- package/dist/loading/index.js.map +1 -1
- package/dist/loading/loading.d.ts +45 -2
- package/dist/modal-dialog-machine-CF9_z3Dm.js +487 -0
- package/dist/modal-dialog-machine-CF9_z3Dm.js.map +1 -0
- package/dist/modal-dialog-machine.d.ts +21 -0
- package/dist/modal-dismissable-lifetime.d.ts +21 -0
- package/dist/modal-registry.d.ts +24 -0
- package/dist/modal-render-hydration.d.ts +35 -0
- package/dist/modal-render-runtime.d.ts +19 -0
- package/dist/modal-render-scope.d.ts +63 -0
- package/dist/nav-bar/index.d.ts +1 -0
- package/dist/nav-bar/index.js +115 -0
- package/dist/nav-bar/index.js.map +1 -0
- package/dist/nav-bar/nav-bar.d.ts +76 -0
- package/dist/notice-bar/index.d.ts +2 -0
- package/dist/notice-bar/index.js +2 -0
- package/dist/notice-bar/notice-bar.d.ts +103 -0
- package/dist/notice-bar-DMpwLvRb.js +231 -0
- package/dist/notice-bar-DMpwLvRb.js.map +1 -0
- package/dist/notify/index.d.ts +1 -0
- package/dist/notify/index.js +251 -0
- package/dist/notify/index.js.map +1 -0
- package/dist/notify/notify.d.ts +123 -0
- package/dist/number-keyboard/index.d.ts +1 -0
- package/dist/number-keyboard/index.js +333 -0
- package/dist/number-keyboard/index.js.map +1 -0
- package/dist/number-keyboard/number-keyboard.d.ts +141 -0
- package/dist/page-indicator/index.d.ts +1 -0
- package/dist/page-indicator/index.js +138 -0
- package/dist/page-indicator/index.js.map +1 -0
- package/dist/page-indicator/page-indicator.d.ts +93 -0
- package/dist/pagination/index.d.ts +1 -0
- package/dist/pagination/index.js +198 -0
- package/dist/pagination/index.js.map +1 -0
- package/dist/pagination/pagination.d.ts +125 -0
- package/dist/password-input/index.d.ts +1 -0
- package/dist/password-input/index.js +317 -0
- package/dist/password-input/index.js.map +1 -0
- package/dist/password-input/password-input.d.ts +144 -0
- package/dist/picker/index.d.ts +8 -0
- package/dist/picker/index.js +2 -0
- package/dist/picker/picker-machine.d.ts +80 -0
- package/dist/picker/picker.d.ts +121 -0
- package/dist/picker/platform.d.ts +84 -0
- package/dist/picker/selection-connect.d.ts +90 -0
- package/dist/picker/selection-model.d.ts +211 -0
- package/dist/picker-BykFntQN.js +1675 -0
- package/dist/picker-BykFntQN.js.map +1 -0
- package/dist/popover/index.d.ts +3 -0
- package/dist/popover/index.js +253 -0
- package/dist/popover/index.js.map +1 -0
- package/dist/popover/layer.d.ts +44 -0
- package/dist/popover/popover.d.ts +104 -0
- package/dist/popover/positioning.d.ts +132 -0
- package/dist/popup/index.d.ts +2 -0
- package/dist/popup/index.js +2 -0
- package/dist/popup/popup.d.ts +60 -0
- package/dist/popup-z5d8IYCt.js +576 -0
- package/dist/popup-z5d8IYCt.js.map +1 -0
- package/dist/portal-BHCNTWhg.js +78 -0
- package/dist/portal-BHCNTWhg.js.map +1 -0
- package/dist/portal.d.ts +61 -0
- package/dist/price/format.d.ts +19 -0
- package/dist/price/index.d.ts +1 -0
- package/dist/price/index.js +154 -0
- package/dist/price/index.js.map +1 -0
- package/dist/price/price.d.ts +88 -0
- package/dist/progress/index.d.ts +1 -0
- package/dist/progress/index.js +2 -0
- package/dist/progress/progress.d.ts +32 -0
- package/dist/progress-f3iYEfdA.js +37 -0
- package/dist/progress-f3iYEfdA.js.map +1 -0
- package/dist/pull-refresh/index.d.ts +1 -0
- package/dist/pull-refresh/index.js +414 -0
- package/dist/pull-refresh/index.js.map +1 -0
- package/dist/pull-refresh/pull-refresh.d.ts +118 -0
- package/dist/radio-group/index.d.ts +3 -0
- package/dist/radio-group/index.js +2 -0
- package/dist/radio-group/radio-group.d.ts +78 -0
- package/dist/radio-group-BOIMuqnS.js +230 -0
- package/dist/radio-group-BOIMuqnS.js.map +1 -0
- package/dist/rate/index.d.ts +1 -0
- package/dist/rate/index.js +2 -0
- package/dist/rate/rate-form.d.ts +28 -0
- package/dist/rate/rate.d.ts +144 -0
- package/dist/rate-5XsU2QkY.js +631 -0
- package/dist/rate-5XsU2QkY.js.map +1 -0
- package/dist/reorder/index.d.ts +1 -0
- package/dist/reorder/index.js +720 -0
- package/dist/reorder/index.js.map +1 -0
- package/dist/reorder/reorder.d.ts +190 -0
- package/dist/result/index.d.ts +1 -0
- package/dist/result/index.js +123 -0
- package/dist/result/index.js.map +1 -0
- package/dist/result/result.d.ts +88 -0
- package/dist/safe-area/index.d.ts +1 -0
- package/dist/safe-area/index.js +42 -0
- package/dist/safe-area/index.js.map +1 -0
- package/dist/safe-area/safe-area.d.ts +28 -0
- package/dist/search-bar/index.js +3 -1
- package/dist/search-bar/index.js.map +1 -1
- package/dist/search-bar/search-bar.d.ts +4 -0
- package/dist/segmented/index.d.ts +2 -0
- package/dist/segmented/index.js +2 -0
- package/dist/segmented/segmented.d.ts +127 -0
- package/dist/segmented-BaU38_L4.js +367 -0
- package/dist/segmented-BaU38_L4.js.map +1 -0
- package/dist/selection-form-BOM_odUk.js +88 -0
- package/dist/selection-form-BOM_odUk.js.map +1 -0
- package/dist/selection-form.d.ts +27 -0
- package/dist/selection-ivXqO1eu.js +55 -0
- package/dist/selection-ivXqO1eu.js.map +1 -0
- package/dist/selection.d.ts +29 -0
- package/dist/selector/choice-group.d.ts +114 -0
- package/dist/selector/index.d.ts +2 -0
- package/dist/selector/index.js +2 -0
- package/dist/selector/selector.d.ts +90 -0
- package/dist/selector-BU2MMJ4N.js +93 -0
- package/dist/selector-BU2MMJ4N.js.map +1 -0
- package/dist/share-sheet/index.d.ts +1 -0
- package/dist/share-sheet/index.js +138 -0
- package/dist/share-sheet/index.js.map +1 -0
- package/dist/share-sheet/share-sheet.d.ts +139 -0
- package/dist/skeleton/index.js +51 -2
- package/dist/skeleton/index.js.map +1 -1
- package/dist/skeleton/skeleton.d.ts +34 -3
- package/dist/slider/index.d.ts +1 -0
- package/dist/slider/index.js +482 -0
- package/dist/slider/index.js.map +1 -0
- package/dist/slider/slider.d.ts +174 -0
- package/dist/space/index.d.ts +1 -0
- package/dist/space/index.js +52 -0
- package/dist/space/index.js.map +1 -0
- package/dist/space/space.d.ts +46 -0
- package/dist/statistic/index.d.ts +1 -0
- package/dist/statistic/index.js +152 -0
- package/dist/statistic/index.js.map +1 -0
- package/dist/statistic/statistic.d.ts +101 -0
- package/dist/stepper/index.js +62 -3
- package/dist/stepper/index.js.map +1 -1
- package/dist/stepper/stepper.d.ts +44 -4
- package/dist/steps/index.d.ts +1 -0
- package/dist/steps/index.js +72 -0
- package/dist/steps/index.js.map +1 -0
- package/dist/steps/steps.d.ts +67 -0
- package/dist/sticky/index.d.ts +1 -0
- package/dist/sticky/index.js +145 -0
- package/dist/sticky/index.js.map +1 -0
- package/dist/sticky/sticky.d.ts +70 -0
- package/dist/swipe-action/index.d.ts +1 -0
- package/dist/swipe-action/index.js +417 -0
- package/dist/swipe-action/index.js.map +1 -0
- package/dist/swipe-action/swipe-action.d.ts +148 -0
- package/dist/swiper/gesture.d.ts +32 -0
- package/dist/swiper/index.d.ts +1 -0
- package/dist/swiper/index.js +2 -0
- package/dist/swiper/swiper.d.ts +177 -0
- package/dist/swiper-BKivDkHp.js +550 -0
- package/dist/swiper-BKivDkHp.js.map +1 -0
- package/dist/switch/index.js +135 -10
- package/dist/switch/index.js.map +1 -1
- package/dist/switch/switch.d.ts +93 -6
- package/dist/tabbar/index.js +46 -1
- package/dist/tabbar/index.js.map +1 -1
- package/dist/tabbar/tabbar.d.ts +50 -0
- package/dist/tabs/index.js +22 -1
- package/dist/tabs/index.js.map +1 -1
- package/dist/tabs/tabs.d.ts +12 -8
- package/dist/tag/index.js +123 -2
- package/dist/tag/index.js.map +1 -1
- package/dist/tag/tag.d.ts +67 -1
- package/dist/textarea/index.d.ts +2 -0
- package/dist/textarea/index.js +2 -242
- package/dist/textarea/platform.d.ts +22 -0
- package/dist/textarea/textarea.d.ts +165 -46
- package/dist/textarea-qbnruDUG.js +775 -0
- package/dist/textarea-qbnruDUG.js.map +1 -0
- package/dist/time-picker/index.d.ts +1 -0
- package/dist/time-picker/index.js +228 -0
- package/dist/time-picker/index.js.map +1 -0
- package/dist/time-picker/time-picker.d.ts +83 -0
- package/dist/timeline/index.d.ts +1 -0
- package/dist/timeline/index.js +131 -0
- package/dist/timeline/index.js.map +1 -0
- package/dist/timeline/timeline.d.ts +79 -0
- package/dist/toast/index.js +47 -4
- package/dist/toast/index.js.map +1 -1
- package/dist/toast/toast.d.ts +26 -3
- package/dist/top-bar/index.js +16 -2
- package/dist/top-bar/index.js.map +1 -1
- package/dist/top-bar/top-bar.d.ts +13 -2
- package/dist/tree-select/index.d.ts +1 -0
- package/dist/tree-select/index.js +512 -0
- package/dist/tree-select/index.js.map +1 -0
- package/dist/tree-select/tree-select.d.ts +215 -0
- package/dist/typography/index.d.ts +1 -0
- package/dist/typography/index.js +82 -0
- package/dist/typography/index.js.map +1 -0
- package/dist/typography/typography.d.ts +54 -0
- package/dist/upload/index.d.ts +1 -0
- package/dist/upload/index.js +458 -0
- package/dist/upload/index.js.map +1 -0
- package/dist/upload/upload.d.ts +172 -0
- package/dist/virtual-list/index.d.ts +1 -0
- package/dist/virtual-list/index.js +445 -0
- package/dist/virtual-list/index.js.map +1 -0
- package/dist/virtual-list/virtual-list.d.ts +160 -0
- package/dist/visual-manifest.d.ts +6 -0
- package/dist/watermark/index.d.ts +1 -0
- package/dist/watermark/index.js +260 -0
- package/dist/watermark/index.js.map +1 -0
- package/dist/watermark/watermark.d.ts +106 -0
- package/package.json +399 -50
- package/dist/empty/index.js.map +0 -1
- package/dist/icon/index.js.map +0 -1
- package/dist/textarea/index.js.map +0 -1
|
@@ -1,54 +1,167 @@
|
|
|
1
1
|
import type { MachineSchema, Service } from "@zag-js/core";
|
|
2
2
|
import type { PropTypes, NormalizeProps } from "@zag-js/types";
|
|
3
|
+
/**
|
|
4
|
+
* 平台快照与 sink。字段与 `contracts/platform.md` 逐字一致。
|
|
5
|
+
* 平台模块可以各自声明同结构类型;这里是 Core 侧事实源。
|
|
6
|
+
*/
|
|
7
|
+
export type TextAreaBoxSizing = "border-box" | "content-box";
|
|
8
|
+
export type TextAreaClipboardFailure = "unsupported" | "denied" | "aborted" | "stale";
|
|
9
|
+
export interface TextAreaControlSnapshot {
|
|
10
|
+
/** 当前 textarea.value,原样返回。 */
|
|
11
|
+
readonly value: string;
|
|
12
|
+
/**
|
|
13
|
+
* 控件自身的 disabled 属性结果,含 fieldset 与第一个 legend 的例外。
|
|
14
|
+
* 不解释 readOnly、maxLength 或是否接受该值。
|
|
15
|
+
*/
|
|
16
|
+
readonly disabled: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface TextAreaSizeSnapshot {
|
|
19
|
+
/** height 临时为 auto 时读到的 scrollHeight。含 padding,不含 border。 */
|
|
20
|
+
readonly scrollHeight: number;
|
|
21
|
+
/** 行内可用尺寸,单位 px。为 0 表示尚未布局。 */
|
|
22
|
+
readonly inlineSize: number;
|
|
23
|
+
/** 已解析成 px 的行高。关键字未能解析时视为无效度量。 */
|
|
24
|
+
readonly lineHeight: number;
|
|
25
|
+
readonly paddingBlockSize: number;
|
|
26
|
+
readonly borderBlockSize: number;
|
|
27
|
+
readonly boxSizing: TextAreaBoxSizing;
|
|
28
|
+
/** display 不是 none,且具有非零布局盒。 */
|
|
29
|
+
readonly visible: boolean;
|
|
30
|
+
}
|
|
31
|
+
export interface TextAreaEditEvent {
|
|
32
|
+
readonly type: "input" | "composition-start" | "composition-update" | "composition-end";
|
|
33
|
+
readonly value: string;
|
|
34
|
+
}
|
|
35
|
+
export interface TextAreaResetNotice {
|
|
36
|
+
/** 必须是该次 reset 派发完全结束后的值。 */
|
|
37
|
+
readonly defaultPrevented: boolean;
|
|
38
|
+
}
|
|
39
|
+
export interface TextAreaPlatformClient {
|
|
40
|
+
readControl(): TextAreaControlSnapshot;
|
|
41
|
+
measureIntrinsic(): TextAreaSizeSnapshot;
|
|
42
|
+
writeValue(value: string, defaultValue: string): void;
|
|
43
|
+
writeHeight(height: number | undefined): void;
|
|
44
|
+
focus(): void;
|
|
45
|
+
blur(): void;
|
|
46
|
+
readClipboardText(): Promise<string>;
|
|
47
|
+
}
|
|
48
|
+
export interface TextAreaPlatformSink {
|
|
49
|
+
commit(client: TextAreaPlatformClient): void;
|
|
50
|
+
changed(): void;
|
|
51
|
+
edit(event: TextAreaEditEvent): void;
|
|
52
|
+
focusChanged(focused: boolean): void;
|
|
53
|
+
reset(notice: TextAreaResetNotice): void;
|
|
54
|
+
detach(): void;
|
|
55
|
+
}
|
|
56
|
+
export interface TextAreaHeightInput {
|
|
57
|
+
readonly autoSize: boolean;
|
|
58
|
+
/** 缺省与非法值由 Core 先规范成不小于 1 的整数,缺省 4。 */
|
|
59
|
+
readonly rows: number;
|
|
60
|
+
/**
|
|
61
|
+
* 可选上限。缺省、非有限,或 floor 后不大于 0 时不封顶。
|
|
62
|
+
* floor 后小于 rows 时,有效上限等于 rows。只在 autoSize 时参与计算。
|
|
63
|
+
*/
|
|
64
|
+
readonly maxRows?: number;
|
|
65
|
+
readonly metrics: TextAreaSizeSnapshot | undefined;
|
|
66
|
+
}
|
|
67
|
+
export interface TextAreaPasteDetail {
|
|
68
|
+
value: string;
|
|
69
|
+
status: "accepted" | "unavailable";
|
|
70
|
+
reason?: TextAreaClipboardFailure;
|
|
71
|
+
}
|
|
72
|
+
/** 原生事件 detail。框架 onChange 仍是字符串;这些回调只给原生传输。 */
|
|
73
|
+
interface TextAreaNativeCallbacks {
|
|
74
|
+
onTextareaValue?: (detail: {
|
|
75
|
+
value: string;
|
|
76
|
+
}) => void;
|
|
77
|
+
onTextareaChange?: (detail: {
|
|
78
|
+
value: string;
|
|
79
|
+
}) => void;
|
|
80
|
+
onTextareaClear?: (detail: {
|
|
81
|
+
value: "";
|
|
82
|
+
}) => void;
|
|
83
|
+
onTextareaPaste?: (detail: TextAreaPasteDetail) => void;
|
|
84
|
+
onTextareaFocus?: (detail: {
|
|
85
|
+
focused: boolean;
|
|
86
|
+
}) => void;
|
|
87
|
+
}
|
|
3
88
|
/**
|
|
4
89
|
* TextArea 公共 props 契约(双栈共享)。
|
|
90
|
+
* autoSize 保持布尔。可选 maxRows 只在自动高度时封顶。
|
|
5
91
|
*/
|
|
6
92
|
export interface QwTextAreaProps {
|
|
7
93
|
/** 唯一 id 前缀。 */
|
|
8
94
|
id?: string;
|
|
9
|
-
/**
|
|
95
|
+
/** 受控值。传入任意字符串(含 "")即为受控。 */
|
|
10
96
|
value?: string;
|
|
11
|
-
/**
|
|
97
|
+
/** 非受控初始值,也是 reset 目标。 */
|
|
12
98
|
defaultValue?: string;
|
|
13
99
|
/** 占位符。 */
|
|
14
100
|
placeholder?: string;
|
|
15
|
-
/**
|
|
101
|
+
/** 最大字符数。仅有限整数 > 0 时生效。 */
|
|
16
102
|
maxLength?: number;
|
|
103
|
+
/** 最小长度。仅有限整数 > 0 时反射为 minlength。 */
|
|
104
|
+
minLength?: number;
|
|
17
105
|
/** 禁用态。 */
|
|
18
106
|
disabled?: boolean;
|
|
19
|
-
/**
|
|
107
|
+
/** 只读态。可聚焦、可选择、可提交,不可编辑。 */
|
|
20
108
|
readOnly?: boolean;
|
|
21
|
-
/**
|
|
109
|
+
/** 可视行数(最小高度)。小于 1 或非有限时按 4。 */
|
|
22
110
|
rows?: number;
|
|
23
|
-
/**
|
|
111
|
+
/**
|
|
112
|
+
* 自动高度的行数上限。仅 autoSize 为 true 且 floor 后大于 0 时生效。
|
|
113
|
+
* 小于 rows 时高度仍不低于 rows。缺省或非法值不封顶。
|
|
114
|
+
*/
|
|
115
|
+
maxRows?: number;
|
|
116
|
+
/** 自适应高度。布尔,不接受 { minRows, maxRows } 对象。 */
|
|
24
117
|
autoSize?: boolean;
|
|
25
118
|
/** 显示底部操作按钮。 */
|
|
26
119
|
showActions?: boolean;
|
|
27
120
|
/** name 属性。 */
|
|
28
121
|
name?: string;
|
|
122
|
+
/** 外部 form 的 id。 */
|
|
123
|
+
form?: string;
|
|
124
|
+
/** 内层 textarea required。 */
|
|
125
|
+
required?: boolean;
|
|
126
|
+
/** 为 true 时写 aria-invalid。 */
|
|
127
|
+
invalid?: boolean;
|
|
128
|
+
/** textarea aria-label。 */
|
|
129
|
+
accessibleLabel?: string;
|
|
130
|
+
/** textarea aria-labelledby。 */
|
|
131
|
+
labelledBy?: string;
|
|
132
|
+
/** 并入 textarea aria-describedby。 */
|
|
133
|
+
describedBy?: string;
|
|
134
|
+
/** textarea aria-errormessage。 */
|
|
135
|
+
errorId?: string;
|
|
29
136
|
/** 清除按钮 aria-label,默认「清除内容」。 */
|
|
30
137
|
clearLabel?: string;
|
|
31
138
|
/** 粘贴按钮 aria-label,默认「粘贴并识别」。 */
|
|
32
139
|
pasteLabel?: string;
|
|
33
|
-
/**
|
|
140
|
+
/** 清除按钮可见文字,默认「一键清除」。 */
|
|
141
|
+
clearText?: string;
|
|
142
|
+
/** 识别按钮可见文字,默认「粘贴并识别」。 */
|
|
143
|
+
pasteText?: string;
|
|
144
|
+
/** 仅 final commit。 */
|
|
34
145
|
onChange?: (value: string) => void;
|
|
35
|
-
/**
|
|
146
|
+
/** 清空成功时。 */
|
|
36
147
|
onClear?: () => void;
|
|
37
|
-
/**
|
|
148
|
+
/** 仅识别成功。参数是替换用的文本。 */
|
|
38
149
|
onPasteRecognize?: (value: string) => void;
|
|
150
|
+
/** 识别失败或 ticket 过期。 */
|
|
151
|
+
onPasteError?: (reason: TextAreaClipboardFailure) => void;
|
|
39
152
|
/** 聚焦回调。 */
|
|
40
153
|
onFocus?: () => void;
|
|
41
154
|
/** 失焦回调。 */
|
|
42
155
|
onBlur?: () => void;
|
|
43
156
|
}
|
|
44
|
-
/**
|
|
45
|
-
* 内部 schema,用于 createMachine 类型推导。
|
|
46
|
-
*/
|
|
47
157
|
interface TextAreaSchema extends MachineSchema {
|
|
48
|
-
props: QwTextAreaProps;
|
|
158
|
+
props: QwTextAreaProps & TextAreaNativeCallbacks;
|
|
49
159
|
context: {
|
|
50
|
-
|
|
160
|
+
uncontrolled: string;
|
|
51
161
|
focused: boolean;
|
|
162
|
+
composing: boolean;
|
|
163
|
+
draft: string;
|
|
164
|
+
controlDisabled: boolean;
|
|
52
165
|
};
|
|
53
166
|
computed: {
|
|
54
167
|
charCount: number;
|
|
@@ -57,62 +170,68 @@ interface TextAreaSchema extends MachineSchema {
|
|
|
57
170
|
};
|
|
58
171
|
state: "idle";
|
|
59
172
|
event: {
|
|
60
|
-
type: "
|
|
61
|
-
value: string;
|
|
62
|
-
} | {
|
|
63
|
-
type: "VALUE.CLEAR";
|
|
64
|
-
} | {
|
|
65
|
-
type: "FOCUS.SET";
|
|
66
|
-
focused: boolean;
|
|
67
|
-
} | {
|
|
68
|
-
type: "PASTE_RECOGNIZE";
|
|
69
|
-
value?: string;
|
|
173
|
+
type: "NOP";
|
|
70
174
|
};
|
|
71
|
-
action: "
|
|
175
|
+
action: "noop";
|
|
72
176
|
}
|
|
177
|
+
export type { TextAreaSchema };
|
|
73
178
|
/**
|
|
74
|
-
*
|
|
75
|
-
* 所有交互逻辑唯一来源:value、focus、clear、pasteRecognize。
|
|
179
|
+
* UTF-16 安全截断。maxLength 为空、非有限,或 floor 后不大于 0 时原样返回。
|
|
76
180
|
*/
|
|
77
|
-
export declare
|
|
181
|
+
export declare function clampUtf16(value: string, maxLength: number | undefined): string;
|
|
182
|
+
/**
|
|
183
|
+
* 自动高度像素。下限是 rows;有效 maxRows 把 border-box 再夹住。
|
|
184
|
+
* 无法度量时返回 undefined,调用方不得写成 0。不读取 DOM。
|
|
185
|
+
*/
|
|
186
|
+
export declare function computeTextAreaHeight(input: TextAreaHeightInput): number | undefined;
|
|
78
187
|
/**
|
|
79
|
-
* TextArea
|
|
188
|
+
* TextArea zag.js machine。
|
|
189
|
+
* 值、草稿、ticket 与高度结论都在这里;没有第二份 value watcher。
|
|
80
190
|
*/
|
|
191
|
+
export declare const machine: import("@zag-js/core").Machine<TextAreaSchema>;
|
|
192
|
+
/** connect 返回的业务 api。 */
|
|
81
193
|
export interface TextAreaApi<T extends PropTypes = PropTypes> {
|
|
82
|
-
/**
|
|
194
|
+
/** 已提交值。 */
|
|
83
195
|
value: string;
|
|
84
|
-
/**
|
|
196
|
+
/** 组合期间为草稿,否则为已提交值。供原生视图投影,不替代 writeValue。 */
|
|
197
|
+
displayValue: string;
|
|
198
|
+
/** field 是否聚焦。 */
|
|
85
199
|
focused: boolean;
|
|
86
|
-
/**
|
|
200
|
+
/** 是否处于草稿阶段。 */
|
|
201
|
+
composing: boolean;
|
|
202
|
+
/** 草稿阶段用草稿的 UTF-16 长度,否则用已提交值。 */
|
|
87
203
|
charCount: number;
|
|
88
|
-
/**
|
|
204
|
+
/** 是否存在有限正整数上限。 */
|
|
89
205
|
hasMaxLength: boolean;
|
|
90
|
-
/**
|
|
206
|
+
/** 已提交值非空,且未禁用、非只读。 */
|
|
91
207
|
showClear: boolean;
|
|
92
|
-
/**
|
|
208
|
+
/** 规范化后的正整数上限;没有上限时为 undefined。 */
|
|
209
|
+
limit: number | undefined;
|
|
210
|
+
showActions: boolean;
|
|
211
|
+
clearText: string;
|
|
212
|
+
pasteText: string;
|
|
213
|
+
fieldId: string;
|
|
214
|
+
counterId: string;
|
|
215
|
+
/** 把已提交值和高度投影到平台。组合期间不写值。 */
|
|
216
|
+
project(): void;
|
|
217
|
+
/** 平台 sink。同一 service 返回同一对象。 */
|
|
218
|
+
getPlatformSink(): TextAreaPlatformSink;
|
|
93
219
|
clear(): void;
|
|
94
|
-
/**
|
|
220
|
+
/** 传入字符串则直接按识别提交;不传则读剪贴板。 */
|
|
95
221
|
pasteRecognize(value?: string): void;
|
|
96
|
-
/** 根容器 prop-getter。 */
|
|
97
222
|
getRootProps(): T["element"];
|
|
98
|
-
/** textarea 元素 prop-getter。 */
|
|
99
223
|
getTextareaProps(): T["textarea"];
|
|
100
|
-
/** 底部栏 prop-getter。 */
|
|
101
224
|
getBottomBarProps(): T["element"];
|
|
102
|
-
/** 字数统计 prop-getter。 */
|
|
103
225
|
getCounterProps(): T["element"];
|
|
104
|
-
/** 清除按钮 prop-getter。 */
|
|
105
226
|
getClearButtonProps(): T["button"];
|
|
106
|
-
/** 粘贴按钮 prop-getter。 */
|
|
107
227
|
getPasteButtonProps(): T["button"];
|
|
108
228
|
}
|
|
109
229
|
/**
|
|
110
|
-
* connect:把 service
|
|
111
|
-
* 适配层只需调用 connect(service, normalizeProps)。
|
|
230
|
+
* connect:把 service 接成 prop-getter。适配层不在这里之外做接受与否的判断。
|
|
112
231
|
*/
|
|
113
232
|
export declare function connect<T extends PropTypes>(service: Service<TextAreaSchema>, normalizeProps: NormalizeProps<T>): TextAreaApi<T>;
|
|
114
233
|
/**
|
|
115
|
-
* 把 QwTextAreaProps 转成 machine
|
|
234
|
+
* 把 QwTextAreaProps 转成 machine props(默认值收口)。
|
|
235
|
+
* 缺省文案是 zh-CN;适配层传入的 locale 优先。
|
|
116
236
|
*/
|
|
117
237
|
export declare function createTextAreaProps(props?: QwTextAreaProps): Partial<QwTextAreaProps>;
|
|
118
|
-
export {};
|