@tensor_1/react 2.49.1 → 2.50.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/DataWorkspace.d.ts +178 -7
- package/dist/components/DataWorkspace.js +769 -89
- package/dist/components/SearchBar.d.ts +3 -1
- package/dist/components/SearchBar.js +2 -0
- package/dist/components/Table.d.ts +6 -1
- package/dist/components/Table.js +10 -2
- package/dist/index.cjs +793 -104
- package/dist/index.d.cts +192 -12
- package/dist/index.d.ts +1 -1
- package/dist/table-engine.d.ts +4 -2
- package/dist/table-engine.js +3 -2
- package/package.json +1 -1
|
@@ -46,6 +46,8 @@ interface SearchBarProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onSubmit'
|
|
|
46
46
|
labels?: Partial<SearchBarLabels>;
|
|
47
47
|
/** The field's `name`. */
|
|
48
48
|
name?: string;
|
|
49
|
+
/** The longest text the field takes (HAR-2622). */
|
|
50
|
+
maxLength?: number;
|
|
49
51
|
/** The field's `id`, e.g. for a "/" shortcut that focuses it. Default: generated. */
|
|
50
52
|
inputId?: string;
|
|
51
53
|
inputRef?: Ref<HTMLInputElement>;
|
|
@@ -63,6 +65,6 @@ interface SearchBarProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onSubmit'
|
|
|
63
65
|
* takes Escape itself before the field (a ConfirmPopover, the table's view menu), Escape closes
|
|
64
66
|
* the overlay rather than clearing the text.
|
|
65
67
|
*/
|
|
66
|
-
declare function SearchBar({ label, value: valueProp, defaultValue, onValueChange, onSubmit, onClear, placeholder, size, submitButton, submitVariant, landmark, inputDescribedBy, labels: labelsProp, name, inputId, inputRef, autoFocus, disabled, className, ...props }: SearchBarProps): react.JSX.Element;
|
|
68
|
+
declare function SearchBar({ label, value: valueProp, defaultValue, onValueChange, onSubmit, onClear, placeholder, size, submitButton, submitVariant, landmark, inputDescribedBy, labels: labelsProp, name, maxLength, inputId, inputRef, autoFocus, disabled, className, ...props }: SearchBarProps): react.JSX.Element;
|
|
67
69
|
|
|
68
70
|
export { SearchBar, type SearchBarLabels, type SearchBarProps };
|
|
@@ -25,6 +25,7 @@ function SearchBar({
|
|
|
25
25
|
inputDescribedBy,
|
|
26
26
|
labels: labelsProp,
|
|
27
27
|
name,
|
|
28
|
+
maxLength,
|
|
28
29
|
inputId,
|
|
29
30
|
inputRef,
|
|
30
31
|
autoFocus,
|
|
@@ -83,6 +84,7 @@ function SearchBar({
|
|
|
83
84
|
id: fieldId,
|
|
84
85
|
type: "search",
|
|
85
86
|
name,
|
|
87
|
+
maxLength,
|
|
86
88
|
className: "uix-input",
|
|
87
89
|
value,
|
|
88
90
|
placeholder,
|
|
@@ -40,9 +40,14 @@ interface ThProps extends ThHTMLAttributes<HTMLTableCellElement> {
|
|
|
40
40
|
sortDirection?: SortDirection;
|
|
41
41
|
/** 1-based ordinal shown when this column is a secondary key in a multi-sort */
|
|
42
42
|
sortOrder?: number;
|
|
43
|
+
/**
|
|
44
|
+
* The ordinal in words for assistive tech, e.g. "Sort priority 2" (2.50, HAR-2623). The visible
|
|
45
|
+
* ordinal is CSS content with empty alt text, so without this it is not announced at all.
|
|
46
|
+
*/
|
|
47
|
+
sortOrderLabel?: string;
|
|
43
48
|
onSort?: () => void;
|
|
44
49
|
}
|
|
45
|
-
declare function Th({ sortable, sortDirection, sortOrder, onSort, className, children, onClick, ...props }: ThProps): react.JSX.Element;
|
|
50
|
+
declare function Th({ sortable, sortDirection, sortOrder, sortOrderLabel, onSort, className, children, onClick, ...props }: ThProps): react.JSX.Element;
|
|
46
51
|
interface TdProps extends TdHTMLAttributes<HTMLTableCellElement> {
|
|
47
52
|
pinned?: boolean;
|
|
48
53
|
}
|
package/dist/components/Table.js
CHANGED
|
@@ -43,17 +43,25 @@ function Table({
|
|
|
43
43
|
}
|
|
44
44
|
);
|
|
45
45
|
}
|
|
46
|
-
function Th({ sortable, sortDirection, sortOrder, onSort, className, children, onClick, ...props }) {
|
|
46
|
+
function Th({ sortable, sortDirection, sortOrder, sortOrderLabel, onSort, className, children, onClick, ...props }) {
|
|
47
|
+
const ordinal = sortOrder != null && sortOrder > 0 && sortOrderLabel ? /* @__PURE__ */ jsx("span", { className: "uix-visually-hidden", children: `, ${sortOrderLabel}` }) : null;
|
|
47
48
|
return /* @__PURE__ */ jsx(
|
|
48
49
|
"th",
|
|
49
50
|
{
|
|
50
51
|
className,
|
|
51
52
|
"data-sort": sortable || void 0,
|
|
52
53
|
"data-sort-order": sortOrder != null && sortOrder > 0 ? sortOrder : void 0,
|
|
54
|
+
"data-sort-labelled": ordinal != null || void 0,
|
|
53
55
|
"aria-sort": sortDirection && sortDirection !== "none" ? sortDirection : void 0,
|
|
54
56
|
onClick: sortable && onSort ? void 0 : onClick,
|
|
55
57
|
...props,
|
|
56
|
-
children: sortable ? /* @__PURE__ */
|
|
58
|
+
children: sortable ? /* @__PURE__ */ jsxs("button", { type: "button", className: "uix-th__sortbtn", onClick: onSort, children: [
|
|
59
|
+
children,
|
|
60
|
+
ordinal
|
|
61
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
62
|
+
children,
|
|
63
|
+
ordinal
|
|
64
|
+
] })
|
|
57
65
|
}
|
|
58
66
|
);
|
|
59
67
|
}
|