@rockshin/tao-ui 0.0.43 → 0.0.45
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 +7 -1
- package/component-manifest.json +10 -3
- package/dist/components/auto-complete/auto-complete.js +12 -3
- package/dist/components/breadcrumb/breadcrumb.css +4 -0
- package/dist/components/breadcrumb/breadcrumb.js +1 -0
- package/dist/components/calendar/calendar.d.ts +1 -0
- package/dist/components/calendar/calendar.js +10 -3
- package/dist/components/card/card-tabs.js +204 -182
- package/dist/components/card/card.js +1 -1
- package/dist/components/carousel/carousel.js +11 -5
- package/dist/components/cascader/cascader.js +16 -4
- package/dist/components/collapse/collapse.css +8 -0
- package/dist/components/context-menu/context-menu.d.ts +2 -1
- package/dist/components/context-menu/context-menu.js +57 -44
- package/dist/components/date-picker/calendar/calendar-grid.js +3 -2
- package/dist/components/date-picker/date-picker.css +4 -0
- package/dist/components/date-picker/date-picker.d.ts +1 -0
- package/dist/components/date-picker/date-picker.js +13 -3
- package/dist/components/date-picker/range-picker.d.ts +1 -0
- package/dist/components/date-picker/range-picker.js +13 -3
- package/dist/components/drawer/drawer.d.ts +2 -1
- package/dist/components/drawer/drawer.js +32 -20
- package/dist/components/dropdown/dropdown.d.ts +1 -0
- package/dist/components/dropdown/dropdown.js +139 -123
- package/dist/components/form/field-control.d.ts +6 -0
- package/dist/components/form/field-control.js +42 -0
- package/dist/components/form/form-context.d.ts +3 -0
- package/dist/components/form/form-item.d.ts +2 -1
- package/dist/components/form/form-item.js +55 -42
- package/dist/components/form/form.d.ts +5 -5
- package/dist/components/form/form.js +86 -68
- package/dist/components/form/index.d.ts +1 -0
- package/dist/components/form/use-form.d.ts +16 -0
- package/dist/components/form/use-form.js +69 -0
- package/dist/components/form-field/form-field-view.d.ts +4 -2
- package/dist/components/form-field/form-field-view.js +42 -35
- package/dist/components/mentions/mentions.js +6 -2
- package/dist/components/modal/modal.d.ts +2 -1
- package/dist/components/modal/modal.js +14 -4
- package/dist/components/pagination/pagination.css +4 -0
- package/dist/components/popover/popover.d.ts +2 -1
- package/dist/components/popover/popover.js +185 -176
- package/dist/components/rate/rate.js +114 -88
- package/dist/components/scroll-area/scroll-area.js +127 -118
- package/dist/components/segmented/segmented.js +52 -29
- package/dist/components/select/mobile-select.d.ts +2 -1
- package/dist/components/select/mobile-select.js +52 -47
- package/dist/components/select/select-types.d.ts +1 -0
- package/dist/components/select/select.js +19 -6
- package/dist/components/slider/slider.js +136 -133
- package/dist/components/splitter/splitter.css +4 -0
- package/dist/components/splitter/splitter.js +5 -3
- package/dist/components/table/table.css +29 -11
- package/dist/components/table/table.js +383 -547
- package/dist/components/tabs/tabs.js +3 -2
- package/dist/components/time-picker/time-picker.js +21 -7
- package/dist/components/tooltip/tooltip.d.ts +2 -1
- package/dist/components/tooltip/tooltip.js +82 -71
- package/dist/components/transfer/transfer-parts.js +12 -2
- package/dist/components/transfer/transfer.js +10 -4
- package/dist/components/tree/tree-keyboard.d.ts +6 -0
- package/dist/components/tree/tree-keyboard.js +27 -0
- package/dist/components/tree/tree.js +14 -3
- package/dist/components/tree-select/select-engine.d.ts +2 -1
- package/dist/components/tree-select/select-engine.js +23 -15
- package/dist/components/tree-select/tree-select.js +20 -10
- package/dist/docs/components/form.doc.js +3 -1
- package/dist/docs/components/tao-provider.doc.js +6 -1
- package/dist/entries/form.d.ts +2 -2
- package/dist/entries/provider.d.ts +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/provider/tao-provider.d.ts +10 -3
- package/dist/provider/tao-provider.js +198 -88
- package/dist/utils/scroll-left.d.ts +3 -0
- package/dist/utils/scroll-left.js +7 -0
- package/llms.txt +3 -3
- package/package.json +4 -2
package/README.md
CHANGED
|
@@ -43,7 +43,7 @@ export default function App() {
|
|
|
43
43
|
|
|
44
44
|
### Accessibility
|
|
45
45
|
|
|
46
|
-
Use `FormField` or `Form.Item` to label controls and associate help/validation messages. Input, Textarea, InputNumber, Select, Checkbox, Radio, Switch and the date pickers forward field ARIA attributes to their interactive elements; CheckboxGroup and RadioGroup expose group labels and validation messages. Placeholders are not a substitute for a label.
|
|
46
|
+
Use `FormField` or `Form.Item` to label controls and associate help/validation messages. Input, Textarea, InputNumber, Select, Checkbox, Radio, Switch and the date pickers forward field ARIA attributes to their interactive elements; CheckboxGroup and RadioGroup expose group labels and validation messages. Placeholders are not a substitute for a label. For long forms, call `form.scrollToField(name, { focus: true })` using `Form.useForm()`, the Form ref or `Form.useFormInstance()`; nested and full `Form.List` paths are supported. Custom controls must forward `ref` or `id`, and the target field must be mounted.
|
|
47
47
|
|
|
48
48
|
Radio maps `aria-required` to native `required`; an explicit `required` prop takes precedence. Group options retain their native disabled state, including explicit `disabled={false}` overrides.
|
|
49
49
|
|
|
@@ -67,6 +67,12 @@ import { TaoProvider, zhCN } from '@rockshin/tao-ui/provider';
|
|
|
67
67
|
|
|
68
68
|
Select and calendar text defaults to English (`enUS`). Override individual keys with `locale={{ ...zhCN, done: '确认' }}`. Nested providers inherit omitted keys, including in portals. This does not change date value formats or Day.js global locale. See [responsive behavior and customization](./RESPONSIVE.md) for scope and verification boundaries.
|
|
69
69
|
|
|
70
|
+
### Right-to-left layouts
|
|
71
|
+
|
|
72
|
+
Set `<TaoProvider direction="rtl">` for an application or section. Components also inherit HTML `dir="rtl"` from their surrounding DOM. Explicit component `direction` props override inheritance; Carousel uses its existing `rtl` prop. Popups retain the direction of their trigger, including mobile Select and date-picker drawers. Nested `direction="ltr"` scopes can display Latin content inside an RTL application.
|
|
73
|
+
|
|
74
|
+
Directional keys, horizontal scrolling, splitters, ratings and fixed table columns follow the rendered direction. Explicit popup placements such as `bottomLeft` remain physical left/right positions. Locale and text direction are independent settings.
|
|
75
|
+
|
|
70
76
|
### Component imports
|
|
71
77
|
|
|
72
78
|
Use component entries to include only their styles and shared theme styles. No separate CSS import is needed. The root entry remains available and includes all component styles.
|
package/component-manifest.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"packageName": "@rockshin/tao-ui",
|
|
4
|
-
"generatedAt": "2026-11-
|
|
4
|
+
"generatedAt": "2026-11-05T17:49:34.954Z",
|
|
5
5
|
"components": [
|
|
6
6
|
{
|
|
7
7
|
"name": "affix",
|
|
@@ -1020,7 +1020,8 @@
|
|
|
1020
1020
|
"source": "src/components/form/form.tsx",
|
|
1021
1021
|
"story": "stories/form.stories.tsx",
|
|
1022
1022
|
"tests": [
|
|
1023
|
-
"tests/form/form.test.tsx"
|
|
1023
|
+
"tests/form/form.test.tsx",
|
|
1024
|
+
"tests/form/form-scroll.test.tsx"
|
|
1024
1025
|
],
|
|
1025
1026
|
"semanticParts": [
|
|
1026
1027
|
"root"
|
|
@@ -1043,6 +1044,7 @@
|
|
|
1043
1044
|
"Declare validation as rules on Form.Item; the required mark is inferred from rules.",
|
|
1044
1045
|
"Use dependencies for cross-field rules such as password confirmation.",
|
|
1045
1046
|
"Use Form.useForm() for imperative control (setFieldsValue, resetFields, submit).",
|
|
1047
|
+
"Call form.scrollToField(name, { focus: true }) to reveal a mounted field, including full Form.List paths; custom controls must forward ref or id.",
|
|
1046
1048
|
"Set size or disabled on Form to cascade them to every control inside."
|
|
1047
1049
|
],
|
|
1048
1050
|
"avoid": [
|
|
@@ -2730,7 +2732,7 @@
|
|
|
2730
2732
|
"tokenVar"
|
|
2731
2733
|
],
|
|
2732
2734
|
"usage": {
|
|
2733
|
-
"description": "Wrap an app or subtree with TaoProvider to set size, disabled, variant, and theme defaults.",
|
|
2735
|
+
"description": "Wrap an app or subtree with TaoProvider to set size, disabled, variant, direction, and theme defaults.",
|
|
2734
2736
|
"bestPractices": [
|
|
2735
2737
|
"Prefer provider-level defaults for app-wide decisions.",
|
|
2736
2738
|
"Use nested providers for scoped theme overrides."
|
|
@@ -2740,6 +2742,11 @@
|
|
|
2740
2742
|
]
|
|
2741
2743
|
},
|
|
2742
2744
|
"props": [
|
|
2745
|
+
{
|
|
2746
|
+
"name": "direction",
|
|
2747
|
+
"type": "'ltr' | 'rtl'",
|
|
2748
|
+
"description": "Text and interaction direction. Inherits the surrounding DOM when omitted; nested providers and component props can override it. Portals retain their source direction."
|
|
2749
|
+
},
|
|
2743
2750
|
{
|
|
2744
2751
|
"name": "size",
|
|
2745
2752
|
"type": "TaoSize",
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import _rc_component_select from "@rc-component/select";
|
|
3
|
-
import { Children, forwardRef, isValidElement } from "react";
|
|
4
|
-
import { useTaoInternalConfig } from "../../provider/tao-provider.js";
|
|
3
|
+
import { Children, forwardRef, isValidElement, useMemo } from "react";
|
|
4
|
+
import { useTaoDirection, useTaoInternalConfig } from "../../provider/tao-provider.js";
|
|
5
|
+
import { mergeRefs } from "../../utils/refs.js";
|
|
5
6
|
import { cx } from "../../utils/semantic.js";
|
|
6
7
|
import { SelectEnginePopup, selectAllowClear } from "../tree-select/select-engine.js";
|
|
7
8
|
import "../tree-select/select-engine.css";
|
|
@@ -40,9 +41,16 @@ function InternalAutoComplete(props, ref) {
|
|
|
40
41
|
props: resolvedProps
|
|
41
42
|
}) : styles;
|
|
42
43
|
const renderPopup = popupRender ?? dropdownRender;
|
|
44
|
+
const [direction, directionRef] = useTaoDirection(props.direction);
|
|
45
|
+
const mergedRef = useMemo(()=>mergeRefs(ref, (node)=>directionRef(node?.nativeElement ?? null)), [
|
|
46
|
+
ref,
|
|
47
|
+
directionRef
|
|
48
|
+
]);
|
|
43
49
|
return /*#__PURE__*/ jsx(RcSelectComponent, {
|
|
44
50
|
...rest,
|
|
45
|
-
ref:
|
|
51
|
+
ref: mergedRef,
|
|
52
|
+
direction: direction,
|
|
53
|
+
dir: direction,
|
|
46
54
|
prefixCls: prefixCls,
|
|
47
55
|
mode: "combobox",
|
|
48
56
|
"data-tao-auto-complete": "",
|
|
@@ -92,6 +100,7 @@ function InternalAutoComplete(props, ref) {
|
|
|
92
100
|
...semanticStyles?.popup?.root
|
|
93
101
|
},
|
|
94
102
|
popupRender: (menu)=>/*#__PURE__*/ jsx(SelectEnginePopup, {
|
|
103
|
+
direction: direction,
|
|
95
104
|
size: size,
|
|
96
105
|
children: renderPopup ? renderPopup(menu) : menu
|
|
97
106
|
}),
|
|
@@ -5,15 +5,20 @@ import en_US from "@rc-component/picker/locale/en_US";
|
|
|
5
5
|
import zh_CN from "@rc-component/picker/locale/zh_CN";
|
|
6
6
|
import dayjs_0 from "dayjs";
|
|
7
7
|
import "dayjs/locale/zh-cn";
|
|
8
|
-
import { forwardRef, useImperativeHandle, useRef, useState } from "react";
|
|
9
|
-
import { useTaoConfig } from "../../provider/tao-provider.js";
|
|
8
|
+
import { forwardRef, useImperativeHandle, useMemo, useRef, useState } from "react";
|
|
9
|
+
import { useTaoConfig, useTaoDirection } from "../../provider/tao-provider.js";
|
|
10
10
|
import { Segmented } from "../segmented/segmented.js";
|
|
11
11
|
import { Select } from "../select/select.js";
|
|
12
12
|
import { cx } from "../../utils/semantic.js";
|
|
13
|
+
import { mergeRefs } from "../../utils/refs.js";
|
|
13
14
|
import "./calendar.css";
|
|
14
15
|
const Calendar = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
15
16
|
const config = useTaoConfig();
|
|
16
17
|
const root = useRef(null);
|
|
18
|
+
const [direction, directionRef] = useTaoDirection(props.direction);
|
|
19
|
+
const mergedRootRef = useMemo(()=>mergeRefs(root, directionRef), [
|
|
20
|
+
directionRef
|
|
21
|
+
]);
|
|
17
22
|
useImperativeHandle(ref, ()=>({
|
|
18
23
|
get nativeElement () {
|
|
19
24
|
return root.current;
|
|
@@ -79,7 +84,8 @@ const Calendar = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
|
79
84
|
});
|
|
80
85
|
};
|
|
81
86
|
return /*#__PURE__*/ jsxs("div", {
|
|
82
|
-
ref:
|
|
87
|
+
ref: mergedRootRef,
|
|
88
|
+
dir: direction,
|
|
83
89
|
"data-tao-calendar": "",
|
|
84
90
|
"data-fullscreen": fullscreen,
|
|
85
91
|
className: cx(names?.root, props.className, props.rootClassName),
|
|
@@ -149,6 +155,7 @@ const Calendar = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
|
149
155
|
]
|
|
150
156
|
}),
|
|
151
157
|
/*#__PURE__*/ jsx(PickerPanel, {
|
|
158
|
+
direction: direction,
|
|
152
159
|
prefixCls: props.prefixCls ?? 'tao-calendar-panel',
|
|
153
160
|
generateConfig: dayjs,
|
|
154
161
|
locale: locale,
|