@rockshin/tao-ui 0.0.42 → 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 +7 -1
- package/component-manifest.json +34 -17
- package/dist/components/alert/alert.css +1 -0
- package/dist/components/avatar/avatar.js +1 -1
- package/dist/components/calendar/calendar.css +10 -60
- package/dist/components/calendar/calendar.js +46 -43
- package/dist/components/card/card.css +1 -1
- package/dist/components/carousel/carousel.css +1 -0
- package/dist/components/carousel/carousel.js +62 -7
- 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.css +8 -42
- package/dist/components/color-picker/color-picker.js +220 -145
- package/dist/components/date-picker/date-picker.css +18 -56
- package/dist/components/date-picker/date-picker.d.ts +2 -0
- package/dist/components/date-picker/date-picker.js +11 -6
- 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 +3 -1
- package/dist/components/form/form-item.js +1 -0
- package/dist/components/form/form.css +15 -0
- package/dist/components/form/form.js +1 -0
- 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/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 +99 -4
- 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 +5 -5
- package/dist/components/list/list-pagination.js +1 -0
- package/dist/components/mentions/mentions.css +7 -0
- package/dist/components/modal/modal.css +1 -0
- package/dist/components/radio/radio.d.ts +1 -1
- package/dist/components/radio/radio.js +78 -73
- package/dist/components/select/mobile-select.css +1 -16
- package/dist/components/select/mobile-select.d.ts +2 -1
- package/dist/components/select/mobile-select.js +68 -63
- package/dist/components/select/select-types.d.ts +2 -0
- package/dist/components/select/select.css +19 -0
- package/dist/components/select/select.js +31 -17
- package/dist/components/spinner/spinner.css +1 -1
- package/dist/components/steps/steps.css +53 -3
- package/dist/components/table/table.css +0 -5
- package/dist/components/table/table.js +21 -22
- package/dist/components/textarea/textarea.css +20 -0
- 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 +7 -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 +13 -18
- package/dist/components/tree/tree.js +2 -3
- package/dist/components/tree-select/select-engine.css +7 -0
- package/dist/components/tree-select/tree-select.js +2 -3
- package/dist/components/upload/upload.css +0 -11
- package/dist/components/upload/upload.js +13 -3
- package/dist/docs/component-docs.js +2 -2
- package/dist/docs/components/{collapsible.doc.d.ts → collapse.doc.d.ts} +1 -1
- package/dist/docs/components/collapse.doc.js +47 -0
- package/dist/docs/components/input.doc.js +11 -4
- package/dist/docs/components/textarea.doc.js +4 -2
- package/dist/entries/collapse.d.ts +3 -0
- package/dist/entries/{collapsible.js → collapse.js} +1 -1
- package/dist/entries/input.d.ts +1 -1
- package/dist/entries/textarea.d.ts +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1 -1
- package/dist/provider/locale.d.ts +6 -0
- package/dist/provider/locale.js +10 -0
- package/dist/provider/tao-provider.js +1 -0
- package/dist/theme/control.css +2 -2
- package/dist/theme/theme.css +3 -1
- package/dist/theme/tokens.d.ts +2 -2
- package/dist/theme/tokens.js +1 -0
- package/dist/utils/field-label.d.ts +4 -0
- package/dist/utils/field-label.js +7 -0
- package/llms.txt +18 -15
- package/package.json +7 -4
- 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
|
@@ -4,7 +4,9 @@ import { c } from "react-compiler-runtime";
|
|
|
4
4
|
import { useTaoConfig } from "../../provider/tao-provider.js";
|
|
5
5
|
import { useBreakpoint } from "../../utils/breakpoint.js";
|
|
6
6
|
import { cx } from "../../utils/semantic.js";
|
|
7
|
+
import { Checkbox } from "../checkbox/checkbox.js";
|
|
7
8
|
import { Pagination } from "../pagination/pagination.js";
|
|
9
|
+
import { Radio } from "../radio/radio.js";
|
|
8
10
|
import { TableFilterDropdown } from "./table-filter.js";
|
|
9
11
|
import { ExpandIcon, SortIcon, TableLoadingSpinner } from "./table-icons.js";
|
|
10
12
|
import { getCellValue, getColKey, getRowKey, resolveRowClassName, resolveRowStyle, resolveSemanticClassNames, resolveSemanticStyles } from "./table-model.js";
|
|
@@ -402,10 +404,12 @@ function Table(t0) {
|
|
|
402
404
|
...rowProps,
|
|
403
405
|
"data-tao-table-row": "",
|
|
404
406
|
"data-tao-selected": isSelected || void 0,
|
|
405
|
-
onClick:
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
407
|
+
onClick: (event)=>{
|
|
408
|
+
const selectionCell = event.target.closest("[data-tao-table-selection-cell]");
|
|
409
|
+
if (selectionCell && event.target !== selectionCell) return void event.stopPropagation();
|
|
410
|
+
rowProps.onClick?.(event);
|
|
411
|
+
if (rowExpandable && expandable?.expandRowByClick) toggleExpand(record_3, key_3);
|
|
412
|
+
},
|
|
409
413
|
className: cx(resolvedClassNames["body.row"], resolveRowClassName(rowClassName, record_3, rowIdx), rowProps.className),
|
|
410
414
|
style: {
|
|
411
415
|
...resolvedStyles["body.row"],
|
|
@@ -420,8 +424,8 @@ function Table(t0) {
|
|
|
420
424
|
style: stickyStyle(stickyPositions.__expand__, 1),
|
|
421
425
|
children: rowExpandable && /*#__PURE__*/ jsx(ExpandIcon, {
|
|
422
426
|
expanded: isExpanded,
|
|
423
|
-
onClick: (
|
|
424
|
-
|
|
427
|
+
onClick: (e_0)=>{
|
|
428
|
+
e_0.stopPropagation();
|
|
425
429
|
toggleExpand(record_3, key_3);
|
|
426
430
|
}
|
|
427
431
|
})
|
|
@@ -435,14 +439,16 @@ function Table(t0) {
|
|
|
435
439
|
...stickyStyle(stickyPositions.__selection__, 1),
|
|
436
440
|
...resolvedStyles["selection.cell"]
|
|
437
441
|
},
|
|
438
|
-
children: /*#__PURE__*/ jsx(
|
|
439
|
-
|
|
442
|
+
children: "radio" === selectionType ? /*#__PURE__*/ jsx(Radio, {
|
|
443
|
+
checked: isSelected,
|
|
444
|
+
"aria-label": `Select row ${String(key_3)}`,
|
|
445
|
+
disabled: checkboxProps?.disabled ?? false,
|
|
446
|
+
onChange: ()=>handleSelectRow(key_3)
|
|
447
|
+
}) : /*#__PURE__*/ jsx(Checkbox, {
|
|
440
448
|
checked: isSelected,
|
|
441
449
|
"aria-label": `Select row ${String(key_3)}`,
|
|
442
|
-
disabled: checkboxProps?.disabled,
|
|
443
|
-
onChange: ()=>handleSelectRow(key_3)
|
|
444
|
-
onClick: _temp2,
|
|
445
|
-
"data-tao-table-checkbox": ""
|
|
450
|
+
disabled: checkboxProps?.disabled ?? false,
|
|
451
|
+
onChange: ()=>handleSelectRow(key_3)
|
|
446
452
|
})
|
|
447
453
|
}),
|
|
448
454
|
columns.map((col_6, colIdx)=>{
|
|
@@ -587,16 +593,12 @@ function Table(t0) {
|
|
|
587
593
|
...stickyStyle(stickyPositions.__selection__, 3),
|
|
588
594
|
...resolvedStyles["selection.cell"]
|
|
589
595
|
},
|
|
590
|
-
children: "checkbox" === selectionType && /*#__PURE__*/ jsx(
|
|
591
|
-
type: "checkbox",
|
|
596
|
+
children: "checkbox" === selectionType && /*#__PURE__*/ jsx(Checkbox, {
|
|
592
597
|
"aria-label": "Select all rows",
|
|
593
598
|
checked: isAllSelected,
|
|
594
599
|
disabled: 0 === selectablePageKeys.length,
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
},
|
|
598
|
-
onChange: (e)=>handleSelectAll(e.target.checked),
|
|
599
|
-
"data-tao-table-checkbox": ""
|
|
600
|
+
indeterminate: isIndeterminate,
|
|
601
|
+
onChange: (e)=>handleSelectAll(e.target.checked)
|
|
600
602
|
})
|
|
601
603
|
}),
|
|
602
604
|
columns.map((col_5, i_1)=>{
|
|
@@ -666,9 +668,6 @@ function Table(t0) {
|
|
|
666
668
|
]
|
|
667
669
|
});
|
|
668
670
|
}
|
|
669
|
-
function _temp2(e_2) {
|
|
670
|
-
return e_2.stopPropagation();
|
|
671
|
-
}
|
|
672
671
|
function _temp(col_0) {
|
|
673
672
|
return col_0.responsive;
|
|
674
673
|
}
|
|
@@ -92,3 +92,23 @@
|
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
+
[data-tao-textarea] {
|
|
96
|
+
position: relative;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
[data-tao-textarea] > [data-tao-input-clear] {
|
|
100
|
+
position: absolute;
|
|
101
|
+
inset-block-start: var(--tao-padding-xxs);
|
|
102
|
+
inset-inline-end: var(--tao-padding-xxs);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
:where([data-tao-textarea]:has([data-tao-input-clear]) textarea) {
|
|
106
|
+
padding-inline-end: var(--tao-control-height);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
[data-tao-textarea] > [data-tao-input-count] {
|
|
110
|
+
text-align: end;
|
|
111
|
+
padding: 0 var(--tao-padding-xs) var(--tao-padding-xxs);
|
|
112
|
+
display: block;
|
|
113
|
+
}
|
|
114
|
+
|
|
@@ -1,21 +1,27 @@
|
|
|
1
1
|
import { type Ref, type TextareaHTMLAttributes } from 'react';
|
|
2
|
-
import { type TaoSize, type TaoStatus
|
|
2
|
+
import { type TaoSize, type TaoStatus } from '../../provider/tao-provider.js';
|
|
3
3
|
import { type SemanticClassNames, type SemanticStyles } from '../../utils/semantic.js';
|
|
4
|
+
import { type InputFocusOptions, type InputSemanticValue, type InputVariant, type TextControlProps } from '../input/input-shared.js';
|
|
4
5
|
import './textarea.css';
|
|
5
|
-
export type TextareaSemanticPart = 'root' | 'textarea';
|
|
6
|
+
export type TextareaSemanticPart = 'root' | 'textarea' | 'clear' | 'count';
|
|
7
|
+
export type TextareaRef = HTMLTextAreaElement & {
|
|
8
|
+
textArea: HTMLTextAreaElement;
|
|
9
|
+
nativeElement: HTMLDivElement;
|
|
10
|
+
focus: (options?: InputFocusOptions) => void;
|
|
11
|
+
};
|
|
6
12
|
export interface AutoSizeOptions {
|
|
7
13
|
minRows?: number;
|
|
8
14
|
maxRows?: number;
|
|
9
15
|
}
|
|
10
|
-
export interface TextareaProps extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, 'size'> {
|
|
16
|
+
export interface TextareaProps extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, 'size'>, TextControlProps<HTMLTextAreaElement> {
|
|
11
17
|
size?: TaoSize;
|
|
12
|
-
variant?:
|
|
18
|
+
variant?: InputVariant;
|
|
13
19
|
error?: boolean;
|
|
14
20
|
status?: TaoStatus;
|
|
15
21
|
ref?: Ref<HTMLTextAreaElement>;
|
|
16
22
|
/** Auto-grow height to fit content. `true` grows freely; pass min/max rows to clamp. */
|
|
17
23
|
autoSize?: boolean | AutoSizeOptions;
|
|
18
|
-
classNames?: SemanticClassNames<TextareaSemanticPart>;
|
|
19
|
-
styles?: SemanticStyles<TextareaSemanticPart>;
|
|
24
|
+
classNames?: InputSemanticValue<SemanticClassNames<TextareaSemanticPart>, TextareaProps>;
|
|
25
|
+
styles?: InputSemanticValue<SemanticStyles<TextareaSemanticPart>, TextareaProps>;
|
|
20
26
|
}
|
|
21
27
|
export declare const Textarea: import("react").ForwardRefExoticComponent<Omit<TextareaProps, "ref"> & import("react").RefAttributes<HTMLTextAreaElement>>;
|
|
@@ -1,232 +1,133 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import { forwardRef, useLayoutEffect, useRef } from "react";
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, useCallback, useLayoutEffect, useRef } from "react";
|
|
4
3
|
import { useTaoConfig } from "../../provider/tao-provider.js";
|
|
5
|
-
import { mergeRefs } from "../../utils/refs.js";
|
|
6
4
|
import { cx } from "../../utils/semantic.js";
|
|
5
|
+
import { InputClear, useTextControl, useTextControlRef } from "../input/input-shared.js";
|
|
7
6
|
import "./textarea.css";
|
|
8
|
-
const textarea_Textarea = /*#__PURE__*/ forwardRef(function(
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
let rest;
|
|
17
|
-
let size;
|
|
18
|
-
let status;
|
|
19
|
-
let style;
|
|
20
|
-
let styles;
|
|
21
|
-
let variant;
|
|
22
|
-
if ($[0] !== t0) {
|
|
23
|
-
({ size, variant, error, status, disabled, autoSize, className, style, classNames, styles, onChange, ...rest } = t0);
|
|
24
|
-
$[0] = t0;
|
|
25
|
-
$[1] = autoSize;
|
|
26
|
-
$[2] = className;
|
|
27
|
-
$[3] = classNames;
|
|
28
|
-
$[4] = disabled;
|
|
29
|
-
$[5] = error;
|
|
30
|
-
$[6] = onChange;
|
|
31
|
-
$[7] = rest;
|
|
32
|
-
$[8] = size;
|
|
33
|
-
$[9] = status;
|
|
34
|
-
$[10] = style;
|
|
35
|
-
$[11] = styles;
|
|
36
|
-
$[12] = variant;
|
|
37
|
-
} else {
|
|
38
|
-
autoSize = $[1];
|
|
39
|
-
className = $[2];
|
|
40
|
-
classNames = $[3];
|
|
41
|
-
disabled = $[4];
|
|
42
|
-
error = $[5];
|
|
43
|
-
onChange = $[6];
|
|
44
|
-
rest = $[7];
|
|
45
|
-
size = $[8];
|
|
46
|
-
status = $[9];
|
|
47
|
-
style = $[10];
|
|
48
|
-
styles = $[11];
|
|
49
|
-
variant = $[12];
|
|
50
|
-
}
|
|
7
|
+
const textarea_Textarea = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
8
|
+
const { size, variant, error, status, disabled, autoSize, className, style, classNames: customClassNames, styles: customStyles, allowClear, onClear, count, showCount, onPressEnter, onKeyDown, onCompositionStart, onCompositionEnd, value, defaultValue, onChange, ...rest } = props;
|
|
9
|
+
const classNames = 'function' == typeof customClassNames ? customClassNames({
|
|
10
|
+
props
|
|
11
|
+
}) : customClassNames;
|
|
12
|
+
const styles = 'function' == typeof customStyles ? customStyles({
|
|
13
|
+
props
|
|
14
|
+
}) : customStyles;
|
|
51
15
|
const ctx = useTaoConfig();
|
|
52
16
|
const resolvedSize = size ?? ctx.size;
|
|
53
17
|
const resolvedVariant = variant ?? ctx.variant;
|
|
54
18
|
const resolvedDisabled = disabled ?? ctx.disabled;
|
|
55
19
|
const innerRef = useRef(null);
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
20
|
+
const rootRef = useRef(null);
|
|
21
|
+
const field = useTextControl(props, innerRef);
|
|
22
|
+
useTextControlRef(ref, innerRef, rootRef);
|
|
23
|
+
const resize = useCallback(()=>{
|
|
24
|
+
const el = innerRef.current;
|
|
25
|
+
if (!el || !autoSize) return;
|
|
26
|
+
el.style.height = 'auto';
|
|
27
|
+
const cs = getComputedStyle(el);
|
|
28
|
+
const lineHeight = Number.parseFloat(cs.lineHeight) || 0;
|
|
29
|
+
const padV = Number.parseFloat(cs.paddingTop) + Number.parseFloat(cs.paddingBottom);
|
|
30
|
+
const opts = 'object' == typeof autoSize ? autoSize : {};
|
|
31
|
+
let height = el.scrollHeight;
|
|
32
|
+
if (opts.minRows) height = Math.max(height, opts.minRows * lineHeight + padV);
|
|
33
|
+
let overflowY = 'hidden';
|
|
34
|
+
if (opts.maxRows) {
|
|
35
|
+
const max = opts.maxRows * lineHeight + padV;
|
|
36
|
+
if (height > max) {
|
|
37
|
+
height = max;
|
|
38
|
+
overflowY = 'auto';
|
|
75
39
|
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
useLayoutEffect(t2, t3);
|
|
104
|
-
let t4;
|
|
105
|
-
let t5;
|
|
106
|
-
if ($[21] !== autoSize || $[22] !== resize) {
|
|
107
|
-
t4 = ()=>{
|
|
108
|
-
const el_0 = innerRef.current;
|
|
109
|
-
if (!el_0 || !autoSize) return;
|
|
110
|
-
let width;
|
|
111
|
-
let frame = 0;
|
|
112
|
-
const observer = new ResizeObserver((t6)=>{
|
|
113
|
-
const [entry] = t6;
|
|
114
|
-
if (entry.contentRect.width === width) return;
|
|
115
|
-
width = entry.contentRect.width;
|
|
116
|
-
cancelAnimationFrame(frame);
|
|
117
|
-
frame = requestAnimationFrame(resize);
|
|
118
|
-
});
|
|
119
|
-
observer.observe(el_0);
|
|
120
|
-
return ()=>{
|
|
121
|
-
observer.disconnect();
|
|
122
|
-
cancelAnimationFrame(frame);
|
|
123
|
-
};
|
|
40
|
+
}
|
|
41
|
+
el.style.height = `${height}px`;
|
|
42
|
+
el.style.overflowY = overflowY;
|
|
43
|
+
}, [
|
|
44
|
+
autoSize
|
|
45
|
+
]);
|
|
46
|
+
useLayoutEffect(()=>{
|
|
47
|
+
resize();
|
|
48
|
+
}, [
|
|
49
|
+
resize,
|
|
50
|
+
field.value
|
|
51
|
+
]);
|
|
52
|
+
useLayoutEffect(()=>{
|
|
53
|
+
const el_0 = innerRef.current;
|
|
54
|
+
if (!el_0 || !autoSize) return;
|
|
55
|
+
let width;
|
|
56
|
+
let frame = 0;
|
|
57
|
+
const observer = new ResizeObserver(([entry])=>{
|
|
58
|
+
if (entry.contentRect.width === width) return;
|
|
59
|
+
width = entry.contentRect.width;
|
|
60
|
+
cancelAnimationFrame(frame);
|
|
61
|
+
frame = requestAnimationFrame(resize);
|
|
62
|
+
});
|
|
63
|
+
observer.observe(el_0);
|
|
64
|
+
return ()=>{
|
|
65
|
+
observer.disconnect();
|
|
66
|
+
cancelAnimationFrame(frame);
|
|
124
67
|
};
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
t4 = $[23];
|
|
135
|
-
t5 = $[24];
|
|
136
|
-
}
|
|
137
|
-
useLayoutEffect(t4, t5);
|
|
138
|
-
const t6 = classNames?.root;
|
|
139
|
-
let t7;
|
|
140
|
-
if ($[25] !== className || $[26] !== t6) {
|
|
141
|
-
t7 = cx(t6, className);
|
|
142
|
-
$[25] = className;
|
|
143
|
-
$[26] = t6;
|
|
144
|
-
$[27] = t7;
|
|
145
|
-
} else t7 = $[27];
|
|
146
|
-
const t8 = styles?.root;
|
|
147
|
-
let t9;
|
|
148
|
-
if ($[28] !== style || $[29] !== t8) {
|
|
149
|
-
t9 = {
|
|
150
|
-
...t8,
|
|
68
|
+
}, [
|
|
69
|
+
autoSize,
|
|
70
|
+
resize
|
|
71
|
+
]);
|
|
72
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
73
|
+
ref: rootRef,
|
|
74
|
+
className: cx(classNames?.root, className),
|
|
75
|
+
style: {
|
|
76
|
+
...styles?.root,
|
|
151
77
|
...style
|
|
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
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
}
|
|
206
|
-
let t21;
|
|
207
|
-
if ($[47] !== resolvedSize || $[48] !== resolvedVariant || $[49] !== t10 || $[50] !== t11 || $[51] !== t12 || $[52] !== t20 || $[53] !== t7 || $[54] !== t9) {
|
|
208
|
-
t21 = /*#__PURE__*/ jsx("div", {
|
|
209
|
-
className: t7,
|
|
210
|
-
style: t9,
|
|
211
|
-
"data-tao-control": "",
|
|
212
|
-
"data-tao-textarea": "",
|
|
213
|
-
"data-tao-size": resolvedSize,
|
|
214
|
-
"data-tao-variant": resolvedVariant,
|
|
215
|
-
"data-tao-error": t10,
|
|
216
|
-
"data-tao-warning": t11,
|
|
217
|
-
"data-disabled": t12,
|
|
218
|
-
children: t20
|
|
219
|
-
});
|
|
220
|
-
$[47] = resolvedSize;
|
|
221
|
-
$[48] = resolvedVariant;
|
|
222
|
-
$[49] = t10;
|
|
223
|
-
$[50] = t11;
|
|
224
|
-
$[51] = t12;
|
|
225
|
-
$[52] = t20;
|
|
226
|
-
$[53] = t7;
|
|
227
|
-
$[54] = t9;
|
|
228
|
-
$[55] = t21;
|
|
229
|
-
} else t21 = $[55];
|
|
230
|
-
return t21;
|
|
78
|
+
},
|
|
79
|
+
"data-tao-control": "",
|
|
80
|
+
"data-tao-textarea": "",
|
|
81
|
+
"data-tao-size": resolvedSize,
|
|
82
|
+
"data-tao-variant": resolvedVariant,
|
|
83
|
+
"data-tao-error": 'error' === status || error || void 0,
|
|
84
|
+
"data-tao-warning": 'warning' === status || void 0,
|
|
85
|
+
"data-disabled": resolvedDisabled || void 0,
|
|
86
|
+
children: [
|
|
87
|
+
/*#__PURE__*/ jsx("textarea", {
|
|
88
|
+
...rest,
|
|
89
|
+
value: field.value,
|
|
90
|
+
ref: innerRef,
|
|
91
|
+
className: classNames?.textarea,
|
|
92
|
+
style: styles?.textarea,
|
|
93
|
+
disabled: resolvedDisabled,
|
|
94
|
+
"aria-invalid": 'error' === status || error ? true : rest['aria-invalid'],
|
|
95
|
+
"data-tao-autosize": autoSize ? '' : void 0,
|
|
96
|
+
onChange: (e)=>{
|
|
97
|
+
if (autoSize) resize();
|
|
98
|
+
field.change(e);
|
|
99
|
+
},
|
|
100
|
+
onKeyDown: (event)=>{
|
|
101
|
+
onKeyDown?.(event);
|
|
102
|
+
if ('Enter' === event.key && !event.defaultPrevented && !field.composing.current && !event.nativeEvent.isComposing && 229 !== event.keyCode) onPressEnter?.(event);
|
|
103
|
+
},
|
|
104
|
+
onCompositionStart: (event_0)=>{
|
|
105
|
+
field.composing.current = true;
|
|
106
|
+
onCompositionStart?.(event_0);
|
|
107
|
+
},
|
|
108
|
+
onCompositionEnd: (event_1)=>{
|
|
109
|
+
field.composing.current = false;
|
|
110
|
+
if (field.normalize(event_1.currentTarget.value) !== event_1.currentTarget.value) field.change({
|
|
111
|
+
...event_1,
|
|
112
|
+
target: event_1.currentTarget
|
|
113
|
+
});
|
|
114
|
+
onCompositionEnd?.(event_1);
|
|
115
|
+
}
|
|
116
|
+
}),
|
|
117
|
+
allowClear && field.value && !resolvedDisabled && !rest.readOnly && /*#__PURE__*/ jsx(InputClear, {
|
|
118
|
+
config: allowClear,
|
|
119
|
+
onClick: field.clear,
|
|
120
|
+
className: classNames?.clear,
|
|
121
|
+
style: styles?.clear
|
|
122
|
+
}),
|
|
123
|
+
null != field.counter && /*#__PURE__*/ jsx("span", {
|
|
124
|
+
"data-tao-input-count": "",
|
|
125
|
+
"data-tao-exceeded": field.exceeded || void 0,
|
|
126
|
+
className: classNames?.count,
|
|
127
|
+
style: styles?.count,
|
|
128
|
+
children: field.counter
|
|
129
|
+
})
|
|
130
|
+
]
|
|
131
|
+
});
|
|
231
132
|
});
|
|
232
133
|
export { textarea_Textarea as Textarea };
|
|
@@ -83,6 +83,13 @@
|
|
|
83
83
|
border-radius: var(--tao-radius-sm);
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
+
@media (hover: hover) and (pointer: fine) {
|
|
87
|
+
[data-tao-time-picker]:not(:hover) [class*="-clear"]:not(:focus-visible) {
|
|
88
|
+
opacity: 0;
|
|
89
|
+
pointer-events: none;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
86
93
|
[data-tao-time-picker] [class*="-range-separator"] {
|
|
87
94
|
padding-inline: var(--tao-padding-xxs);
|
|
88
95
|
color: var(--tao-color-text-secondary);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function TreeCheck(): import("react").JSX.Element;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { c } from "react-compiler-runtime";
|
|
3
|
+
function TreeCheck() {
|
|
4
|
+
const $ = c(1);
|
|
5
|
+
let t0;
|
|
6
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
7
|
+
t0 = /*#__PURE__*/ jsx("span", {
|
|
8
|
+
"data-tao-tree-check": "",
|
|
9
|
+
children: /*#__PURE__*/ jsxs("svg", {
|
|
10
|
+
"aria-hidden": "true",
|
|
11
|
+
focusable: "false",
|
|
12
|
+
width: "12",
|
|
13
|
+
height: "12",
|
|
14
|
+
viewBox: "0 0 24 24",
|
|
15
|
+
fill: "none",
|
|
16
|
+
stroke: "currentColor",
|
|
17
|
+
strokeWidth: "3",
|
|
18
|
+
strokeLinecap: "round",
|
|
19
|
+
strokeLinejoin: "round",
|
|
20
|
+
children: [
|
|
21
|
+
/*#__PURE__*/ jsx("path", {
|
|
22
|
+
"data-tao-tree-check-mark": "",
|
|
23
|
+
d: "m4 12 5 5 11-11"
|
|
24
|
+
}),
|
|
25
|
+
/*#__PURE__*/ jsx("path", {
|
|
26
|
+
"data-tao-tree-check-mixed": "",
|
|
27
|
+
d: "M5 12h14"
|
|
28
|
+
})
|
|
29
|
+
]
|
|
30
|
+
})
|
|
31
|
+
});
|
|
32
|
+
$[0] = t0;
|
|
33
|
+
} else t0 = $[0];
|
|
34
|
+
return t0;
|
|
35
|
+
}
|
|
36
|
+
export { TreeCheck };
|
|
@@ -139,6 +139,7 @@
|
|
|
139
139
|
}
|
|
140
140
|
|
|
141
141
|
[data-tao-tree-check] {
|
|
142
|
+
color: var(--tao-primary-fg);
|
|
142
143
|
box-sizing: border-box;
|
|
143
144
|
border: var(--tao-line-width) solid var(--tao-color-border);
|
|
144
145
|
border-radius: var(--tao-radius-sm);
|
|
@@ -147,36 +148,30 @@
|
|
|
147
148
|
height: 16px;
|
|
148
149
|
transition: background-color var(--tao-motion-duration-fast) var(--tao-motion-ease-out),
|
|
149
150
|
border-color var(--tao-motion-duration-fast) var(--tao-motion-ease-out);
|
|
150
|
-
|
|
151
|
+
justify-content: center;
|
|
152
|
+
align-items: center;
|
|
153
|
+
display: inline-flex;
|
|
151
154
|
}
|
|
152
155
|
|
|
153
156
|
[data-tao-tree] [role="checkbox"]:hover [data-tao-tree-check] {
|
|
154
157
|
border-color: var(--tao-primary);
|
|
155
158
|
}
|
|
156
159
|
|
|
157
|
-
[data-tao-tree] [role="checkbox"][aria-checked="true"] [data-tao-tree-check] {
|
|
160
|
+
[data-tao-tree] [role="checkbox"][aria-checked="true"] [data-tao-tree-check], [data-tao-tree] [role="checkbox"][aria-checked="mixed"] [data-tao-tree-check] {
|
|
158
161
|
background: var(--tao-primary);
|
|
159
162
|
border-color: var(--tao-primary);
|
|
160
163
|
}
|
|
161
164
|
|
|
162
|
-
[data-tao-tree] [role="checkbox"][aria-checked="true"] [data-tao-tree-check]
|
|
163
|
-
|
|
164
|
-
inset-inline-start: 4px;
|
|
165
|
-
border: solid var(--tao-primary-fg);
|
|
166
|
-
border-width: 0 2px 2px 0;
|
|
167
|
-
width: 4px;
|
|
168
|
-
height: 8px;
|
|
169
|
-
position: absolute;
|
|
170
|
-
top: 1px;
|
|
171
|
-
transform: rotate(45deg);
|
|
165
|
+
[data-tao-tree] [role="checkbox"][aria-checked="true"] [data-tao-tree-check-mark], [data-tao-tree] [role="checkbox"][aria-checked="mixed"] [data-tao-tree-check-mixed] {
|
|
166
|
+
display: block;
|
|
172
167
|
}
|
|
173
168
|
|
|
174
|
-
[data-tao-tree
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
169
|
+
[data-tao-tree-check] > svg {
|
|
170
|
+
flex: none;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
[data-tao-tree-check] path {
|
|
174
|
+
display: none;
|
|
180
175
|
}
|
|
181
176
|
|
|
182
177
|
[data-tao-tree] [role="checkbox"][aria-disabled="true"] {
|
|
@@ -5,6 +5,7 @@ import { forwardRef, useRef, useState } from "react";
|
|
|
5
5
|
import { useTaoConfig } from "../../provider/tao-provider.js";
|
|
6
6
|
import { cx } from "../../utils/semantic.js";
|
|
7
7
|
import { Spinner } from "../spinner/spinner.js";
|
|
8
|
+
import { TreeCheck } from "./tree-check.js";
|
|
8
9
|
import "./tree.css";
|
|
9
10
|
import { interopDefault } from "../../utils/interop-default.js";
|
|
10
11
|
const RcTreeComponent = /*#__PURE__*/ interopDefault(tree);
|
|
@@ -195,9 +196,7 @@ const TreeBase = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
|
195
196
|
selectable: selectable,
|
|
196
197
|
itemHeight: itemHeight,
|
|
197
198
|
filterTreeNode: filterTreeNode,
|
|
198
|
-
checkable: checkable && /*#__PURE__*/ jsx(
|
|
199
|
-
"data-tao-tree-check": ""
|
|
200
|
-
}),
|
|
199
|
+
checkable: checkable && /*#__PURE__*/ jsx(TreeCheck, {}),
|
|
201
200
|
switcherIcon: renderSwitcher,
|
|
202
201
|
draggable: dragConfig,
|
|
203
202
|
classNames: classes,
|
|
@@ -121,6 +121,13 @@
|
|
|
121
121
|
color: var(--tao-color-text);
|
|
122
122
|
}
|
|
123
123
|
|
|
124
|
+
@media (hover: hover) and (pointer: fine) {
|
|
125
|
+
[data-tao-select-engine]:not(:hover) [class$="-clear"]:not(:focus-visible) {
|
|
126
|
+
opacity: 0;
|
|
127
|
+
pointer-events: none;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
124
131
|
[data-tao-select-engine] [class$="-clear"]:focus-visible {
|
|
125
132
|
outline: 2px solid var(--tao-primary);
|
|
126
133
|
outline-offset: 2px;
|