@wallarm-org/design-system 4.16.1-rc-fix-escape-outside-layer-stack.1 → 4.16.1
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/Dialog/DialogContent.js +68 -35
- package/dist/components/Drawer/DrawerContent.d.ts +6 -2
- package/dist/components/Drawer/DrawerContent.js +80 -67
- package/dist/components/Drawer/DrawerRoot.d.ts +4 -0
- package/dist/components/Drawer/DrawerRoot.js +28 -1
- package/dist/components/Drawer/index.d.ts +1 -0
- package/dist/components/Drawer/index.js +1 -0
- package/dist/components/Field/FieldDescription.js +27 -13
- package/dist/components/Field/FieldError.js +46 -26
- package/dist/components/Input/Input.js +59 -34
- package/dist/components/NumberInput/NumberInput.js +20 -18
- package/dist/components/PasswordInput/PasswordInput.js +72 -71
- package/dist/components/Select/useSelectSearch.d.ts +4 -0
- package/dist/components/Table/TableBody/TableBodyRowDndContext.js +84 -77
- package/dist/components/Table/TableContext/TableProvider.js +62 -59
- package/dist/components/Table/TableContext/types.d.ts +1 -0
- package/dist/components/Table/lib/createSelectionColumn.js +4 -6
- package/dist/components/Textarea/Textarea.js +74 -77
- package/dist/guidelines/patterns/filtering.md +2 -2
- package/dist/hooks/useControlled.js +24 -9
- package/dist/metadata/components.json +79 -16
- package/dist/metadata/guidelines.json +4 -4
- package/package.json +1 -1
|
@@ -4,7 +4,7 @@ import { useEffect, useRef } from "react";
|
|
|
4
4
|
import { DndContext, KeyboardSensor, PointerSensor, closestCenter, useSensor, useSensors } from "@dnd-kit/core";
|
|
5
5
|
import { SortableContext, arrayMove, horizontalListSortingStrategy, sortableKeyboardCoordinates } from "@dnd-kit/sortable";
|
|
6
6
|
import { useTable } from "@tanstack/react-table";
|
|
7
|
-
import { useControlled } from "../../../hooks/index.js";
|
|
7
|
+
import { useControlled, useIsKeyPressed } from "../../../hooks/index.js";
|
|
8
8
|
import { useTableState } from "../hooks/index.js";
|
|
9
9
|
import { TABLE_DRAG_HANDLE_COLUMN_ID, TABLE_EXPAND_COLUMN_ID, TABLE_MIN_COLUMN_WIDTH, TABLE_SELECT_COLUMN_ID, TABLE_SKELETON_ROWS, TABLE_VIRTUALIZATION_OVERSCAN, createDragHandleColumn, createExpandColumn, createSelectionColumn, dsTableFeatures } from "../lib/index.js";
|
|
10
10
|
import { TableContext } from "./TableContext.js";
|
|
@@ -16,7 +16,7 @@ const toTanStackPinning = (p, pinnedLeft)=>({
|
|
|
16
16
|
end: p?.right ?? []
|
|
17
17
|
});
|
|
18
18
|
const TableProvider = (props)=>{
|
|
19
|
-
const $ = compiler_runtime_c(
|
|
19
|
+
const $ = compiler_runtime_c(170);
|
|
20
20
|
const { data, columns, isLoading: t0, isLoadingPrevious: t1, skeletonCount: t2, children, getRowId, sorting: sortingProp, onSortingChange, manualSorting: t3, rowSelection: rowSelectionProp, onRowSelectionChange, enableSelectAllRows: t4, onSelectAllRows, columnSizing: columnSizingProp, onColumnSizingChange, columnPinning: columnPinningProp, onColumnPinningChange, columnOrder: columnOrderProp, onColumnOrderChange, grouping: groupingProp, onGroupingChange, expanded: expandedProp, onExpandedChange, renderGroupRow, groupRowSpan: t5, groupExpandColumn: t6, getSubRows, showEmptyGroups: t7, renderExpandedRow, columnVisibility: columnVisibilityProp, onColumnVisibilityChange, defaultColumnVisibility, defaultColumnOrder, columnGroups, virtualized, stretch: t8, estimateRowHeight, overscan: t9, onEndReached, onEndReachedThreshold, onStartReached, onStartReachedThreshold, initialScrollToRowId, onRowReorder, getRowCanDrag, renderFullWidthRow, onMasterCellClick, activeRowId: activeRowIdProp, onSettingsOpenChange, deferColumnVisibility: t10 } = props;
|
|
21
21
|
const isLoading = void 0 === t0 ? false : t0;
|
|
22
22
|
const isLoadingPrevious = void 0 === t1 ? false : t1;
|
|
@@ -427,6 +427,7 @@ const TableProvider = (props)=>{
|
|
|
427
427
|
} else t45 = $[100];
|
|
428
428
|
const allLeafColumns = t45;
|
|
429
429
|
const lastSelectedRowIndexRef = useRef(null);
|
|
430
|
+
const shiftKeyRef = useIsKeyPressed("Shift");
|
|
430
431
|
const containerRef = useRef(null);
|
|
431
432
|
const headerScrollRef = useRef(null);
|
|
432
433
|
const tbodyRef = useRef(null);
|
|
@@ -437,7 +438,7 @@ const TableProvider = (props)=>{
|
|
|
437
438
|
const t49 = "full" === groupRowSpan ? renderGroupRow : void 0;
|
|
438
439
|
const t50 = renderFullWidthRow;
|
|
439
440
|
let t51;
|
|
440
|
-
if ($[101] !== allLeafColumns || $[102] !== alwaysPinnedLeft || $[103] !== columnDndEnabled || $[104] !== columnGroups || $[105] !== defaultColumnOrder || $[106] !== defaultColumnVisibility || $[107] !== deferColumnVisibility || $[108] !== enableSelectAllRows || $[109] !== estimateRowHeight || $[110] !== expandingEnabled || $[111] !== groupingEnabled || $[112] !== initialScrollToRowId || $[113] !== isLoading || $[114] !== isLoadingPrevious || $[115] !== masterCellActiveRowId || $[116] !== masterColumnId || $[117] !== onEndReached || $[118] !== onEndReachedThreshold || $[119] !== onMasterCellClick || $[120] !== onRowReorder || $[121] !== onSelectAllRows || $[122] !== onSettingsOpenChange || $[123] !== onStartReached || $[124] !== onStartReachedThreshold || $[125] !== overscan || $[126] !== pinningEnabled || $[127] !== resizingEnabled || $[128] !== rowDndEnabled || $[129] !== selectionEnabled || $[130] !== setColumnOrder || $[131] !==
|
|
441
|
+
if ($[101] !== allLeafColumns || $[102] !== alwaysPinnedLeft || $[103] !== columnDndEnabled || $[104] !== columnGroups || $[105] !== defaultColumnOrder || $[106] !== defaultColumnVisibility || $[107] !== deferColumnVisibility || $[108] !== enableSelectAllRows || $[109] !== estimateRowHeight || $[110] !== expandingEnabled || $[111] !== groupingEnabled || $[112] !== initialScrollToRowId || $[113] !== isLoading || $[114] !== isLoadingPrevious || $[115] !== masterCellActiveRowId || $[116] !== masterColumnId || $[117] !== onEndReached || $[118] !== onEndReachedThreshold || $[119] !== onMasterCellClick || $[120] !== onRowReorder || $[121] !== onSelectAllRows || $[122] !== onSettingsOpenChange || $[123] !== onStartReached || $[124] !== onStartReachedThreshold || $[125] !== overscan || $[126] !== pinningEnabled || $[127] !== resizingEnabled || $[128] !== rowDndEnabled || $[129] !== selectionEnabled || $[130] !== setColumnOrder || $[131] !== shiftKeyRef || $[132] !== showEmptyGroups || $[133] !== skeletonCount || $[134] !== sortingEnabled || $[135] !== stretch || $[136] !== t46 || $[137] !== t47 || $[138] !== t48 || $[139] !== t49 || $[140] !== t50 || $[141] !== table || $[142] !== virtualized || $[143] !== visibilityEnabled) {
|
|
441
442
|
t51 = {
|
|
442
443
|
table,
|
|
443
444
|
isLoading,
|
|
@@ -467,6 +468,7 @@ const TableProvider = (props)=>{
|
|
|
467
468
|
alwaysPinnedLeft,
|
|
468
469
|
masterColumnId,
|
|
469
470
|
lastSelectedRowIndexRef,
|
|
471
|
+
shiftKeyRef,
|
|
470
472
|
selectAllRowsEnabled: enableSelectAllRows,
|
|
471
473
|
onSelectAllRows,
|
|
472
474
|
containerRef,
|
|
@@ -517,24 +519,25 @@ const TableProvider = (props)=>{
|
|
|
517
519
|
$[128] = rowDndEnabled;
|
|
518
520
|
$[129] = selectionEnabled;
|
|
519
521
|
$[130] = setColumnOrder;
|
|
520
|
-
$[131] =
|
|
521
|
-
$[132] =
|
|
522
|
-
$[133] =
|
|
523
|
-
$[134] =
|
|
524
|
-
$[135] =
|
|
525
|
-
$[136] =
|
|
526
|
-
$[137] =
|
|
527
|
-
$[138] =
|
|
528
|
-
$[139] =
|
|
529
|
-
$[140] =
|
|
530
|
-
$[141] =
|
|
531
|
-
$[142] =
|
|
532
|
-
$[143] =
|
|
533
|
-
|
|
522
|
+
$[131] = shiftKeyRef;
|
|
523
|
+
$[132] = showEmptyGroups;
|
|
524
|
+
$[133] = skeletonCount;
|
|
525
|
+
$[134] = sortingEnabled;
|
|
526
|
+
$[135] = stretch;
|
|
527
|
+
$[136] = t46;
|
|
528
|
+
$[137] = t47;
|
|
529
|
+
$[138] = t48;
|
|
530
|
+
$[139] = t49;
|
|
531
|
+
$[140] = t50;
|
|
532
|
+
$[141] = table;
|
|
533
|
+
$[142] = virtualized;
|
|
534
|
+
$[143] = visibilityEnabled;
|
|
535
|
+
$[144] = t51;
|
|
536
|
+
} else t51 = $[144];
|
|
534
537
|
const contextValue = t51;
|
|
535
538
|
let t52;
|
|
536
539
|
let t53;
|
|
537
|
-
if ($[
|
|
540
|
+
if ($[145] !== selectionEnabled || $[146] !== table) {
|
|
538
541
|
t52 = ()=>{
|
|
539
542
|
if (!selectionEnabled) return;
|
|
540
543
|
const container = containerRef.current;
|
|
@@ -549,34 +552,34 @@ const TableProvider = (props)=>{
|
|
|
549
552
|
selectionEnabled,
|
|
550
553
|
table
|
|
551
554
|
];
|
|
552
|
-
$[
|
|
553
|
-
$[
|
|
554
|
-
$[
|
|
555
|
-
$[
|
|
555
|
+
$[145] = selectionEnabled;
|
|
556
|
+
$[146] = table;
|
|
557
|
+
$[147] = t52;
|
|
558
|
+
$[148] = t53;
|
|
556
559
|
} else {
|
|
557
|
-
t52 = $[
|
|
558
|
-
t53 = $[
|
|
560
|
+
t52 = $[147];
|
|
561
|
+
t53 = $[148];
|
|
559
562
|
}
|
|
560
563
|
useEffect(t52, t53);
|
|
561
564
|
let t54;
|
|
562
|
-
if ($[
|
|
565
|
+
if ($[149] === Symbol.for("react.memo_cache_sentinel")) {
|
|
563
566
|
t54 = {
|
|
564
567
|
activationConstraint: {
|
|
565
568
|
distance: 5
|
|
566
569
|
}
|
|
567
570
|
};
|
|
568
|
-
$[
|
|
569
|
-
} else t54 = $[
|
|
571
|
+
$[149] = t54;
|
|
572
|
+
} else t54 = $[149];
|
|
570
573
|
let t55;
|
|
571
|
-
if ($[
|
|
574
|
+
if ($[150] === Symbol.for("react.memo_cache_sentinel")) {
|
|
572
575
|
t55 = {
|
|
573
576
|
coordinateGetter: sortableKeyboardCoordinates
|
|
574
577
|
};
|
|
575
|
-
$[
|
|
576
|
-
} else t55 = $[
|
|
578
|
+
$[150] = t55;
|
|
579
|
+
} else t55 = $[150];
|
|
577
580
|
const sensors = useSensors(useSensor(PointerSensor, t54), useSensor(KeyboardSensor, t55));
|
|
578
581
|
let t56;
|
|
579
|
-
if ($[
|
|
582
|
+
if ($[151] !== allLeafColumns || $[152] !== setColumnOrder || $[153] !== table.atoms) {
|
|
580
583
|
t56 = (event)=>{
|
|
581
584
|
const { active, over } = event;
|
|
582
585
|
if (!over || active.id === over.id) return;
|
|
@@ -587,59 +590,59 @@ const TableProvider = (props)=>{
|
|
|
587
590
|
const newOrder_0 = arrayMove(currentOrder, oldIndex, newIndex);
|
|
588
591
|
setColumnOrder(newOrder_0);
|
|
589
592
|
};
|
|
590
|
-
$[
|
|
591
|
-
$[
|
|
592
|
-
$[
|
|
593
|
-
$[
|
|
594
|
-
} else t56 = $[
|
|
593
|
+
$[151] = allLeafColumns;
|
|
594
|
+
$[152] = setColumnOrder;
|
|
595
|
+
$[153] = table.atoms;
|
|
596
|
+
$[154] = t56;
|
|
597
|
+
} else t56 = $[154];
|
|
595
598
|
const handleDragEnd = t56;
|
|
596
599
|
let t57;
|
|
597
|
-
if ($[
|
|
600
|
+
if ($[155] !== allLeafColumns || $[156] !== alwaysPinnedLeft || $[157] !== columnDndEnabled) {
|
|
598
601
|
t57 = columnDndEnabled ? allLeafColumns.filter((c_0)=>!alwaysPinnedLeft.includes(c_0.id)).map(_temp3) : [];
|
|
599
|
-
$[
|
|
600
|
-
$[
|
|
601
|
-
$[
|
|
602
|
-
$[
|
|
603
|
-
} else t57 = $[
|
|
602
|
+
$[155] = allLeafColumns;
|
|
603
|
+
$[156] = alwaysPinnedLeft;
|
|
604
|
+
$[157] = columnDndEnabled;
|
|
605
|
+
$[158] = t57;
|
|
606
|
+
} else t57 = $[158];
|
|
604
607
|
const columnIds = t57;
|
|
605
608
|
const t58 = columnDndEnabled ? sensors : void 0;
|
|
606
609
|
const t59 = columnDndEnabled ? closestCenter : void 0;
|
|
607
610
|
const t60 = columnDndEnabled ? handleDragEnd : void 0;
|
|
608
611
|
let t61;
|
|
609
|
-
if ($[
|
|
612
|
+
if ($[159] !== children || $[160] !== columnIds) {
|
|
610
613
|
t61 = /*#__PURE__*/ jsx(SortableContext, {
|
|
611
614
|
items: columnIds,
|
|
612
615
|
strategy: horizontalListSortingStrategy,
|
|
613
616
|
children: children
|
|
614
617
|
});
|
|
615
|
-
$[
|
|
616
|
-
$[
|
|
617
|
-
$[
|
|
618
|
-
} else t61 = $[
|
|
618
|
+
$[159] = children;
|
|
619
|
+
$[160] = columnIds;
|
|
620
|
+
$[161] = t61;
|
|
621
|
+
} else t61 = $[161];
|
|
619
622
|
let t62;
|
|
620
|
-
if ($[
|
|
623
|
+
if ($[162] !== t58 || $[163] !== t59 || $[164] !== t60 || $[165] !== t61) {
|
|
621
624
|
t62 = /*#__PURE__*/ jsx(DndContext, {
|
|
622
625
|
sensors: t58,
|
|
623
626
|
collisionDetection: t59,
|
|
624
627
|
onDragEnd: t60,
|
|
625
628
|
children: t61
|
|
626
629
|
});
|
|
627
|
-
$[
|
|
628
|
-
$[
|
|
629
|
-
$[
|
|
630
|
-
$[
|
|
631
|
-
$[
|
|
632
|
-
} else t62 = $[
|
|
630
|
+
$[162] = t58;
|
|
631
|
+
$[163] = t59;
|
|
632
|
+
$[164] = t60;
|
|
633
|
+
$[165] = t61;
|
|
634
|
+
$[166] = t62;
|
|
635
|
+
} else t62 = $[166];
|
|
633
636
|
let t63;
|
|
634
|
-
if ($[
|
|
637
|
+
if ($[167] !== contextValue || $[168] !== t62) {
|
|
635
638
|
t63 = /*#__PURE__*/ jsx(TableContext.Provider, {
|
|
636
639
|
value: contextValue,
|
|
637
640
|
children: t62
|
|
638
641
|
});
|
|
639
|
-
$[
|
|
640
|
-
$[
|
|
641
|
-
$[
|
|
642
|
-
} else t63 = $[
|
|
642
|
+
$[167] = contextValue;
|
|
643
|
+
$[168] = t62;
|
|
644
|
+
$[169] = t63;
|
|
645
|
+
} else t63 = $[169];
|
|
643
646
|
return t63;
|
|
644
647
|
};
|
|
645
648
|
function _temp() {
|
|
@@ -36,6 +36,7 @@ export interface TableContextValue<T extends RowData> {
|
|
|
36
36
|
columnGroups?: TableColumnGroup[];
|
|
37
37
|
setColumnOrder: (order: string[]) => void;
|
|
38
38
|
lastSelectedRowIndexRef: RefObject<number | null>;
|
|
39
|
+
shiftKeyRef: RefObject<boolean>;
|
|
39
40
|
selectAllRowsEnabled: boolean;
|
|
40
41
|
onSelectAllRows?: (selected: boolean) => void;
|
|
41
42
|
alwaysPinnedLeft: string[];
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { c } from "react/compiler-runtime";
|
|
3
|
-
import { useIsKeyPressed } from "../../../hooks/index.js";
|
|
4
3
|
import { Checkbox, CheckboxIndicator } from "../../Checkbox/index.js";
|
|
5
4
|
import { useTableContext } from "../TableContext/index.js";
|
|
6
5
|
import { TABLE_SELECT_COLUMN_ID, TABLE_SELECT_COLUMN_WIDTH } from "./constants.js";
|
|
@@ -22,8 +21,7 @@ const applyRangeSelection = (rows, fromIndex, toIndex, table, clickedRow)=>{
|
|
|
22
21
|
const SelectionCell = (t0)=>{
|
|
23
22
|
const $ = c(17);
|
|
24
23
|
const { row, table } = t0;
|
|
25
|
-
const { lastSelectedRowIndexRef } = useTableContext();
|
|
26
|
-
const shiftRef = useIsKeyPressed("Shift");
|
|
24
|
+
const { lastSelectedRowIndexRef, shiftKeyRef } = useTableContext();
|
|
27
25
|
let t1;
|
|
28
26
|
if ($[0] !== row.subRows.length) {
|
|
29
27
|
t1 = ()=>row.subRows.length > 0;
|
|
@@ -32,7 +30,7 @@ const SelectionCell = (t0)=>{
|
|
|
32
30
|
} else t1 = $[1];
|
|
33
31
|
const hasSubRows = useTableValue(t1);
|
|
34
32
|
let t2;
|
|
35
|
-
if ($[2] !== hasSubRows || $[3] !== lastSelectedRowIndexRef || $[4] !== row || $[5] !==
|
|
33
|
+
if ($[2] !== hasSubRows || $[3] !== lastSelectedRowIndexRef || $[4] !== row || $[5] !== shiftKeyRef || $[6] !== table) {
|
|
36
34
|
t2 = ()=>{
|
|
37
35
|
if (hasSubRows) {
|
|
38
36
|
const allSelected = row.getIsAllSubRowsSelected();
|
|
@@ -41,14 +39,14 @@ const SelectionCell = (t0)=>{
|
|
|
41
39
|
}
|
|
42
40
|
const rows = table.getRowModel().rows;
|
|
43
41
|
const currentIndex = rows.findIndex((r)=>r.id === row.id);
|
|
44
|
-
if (
|
|
42
|
+
if (shiftKeyRef.current && null !== lastSelectedRowIndexRef.current) applyRangeSelection(rows, lastSelectedRowIndexRef.current, currentIndex, table, row);
|
|
45
43
|
else row.toggleSelected(!row.getIsSelected());
|
|
46
44
|
lastSelectedRowIndexRef.current = currentIndex;
|
|
47
45
|
};
|
|
48
46
|
$[2] = hasSubRows;
|
|
49
47
|
$[3] = lastSelectedRowIndexRef;
|
|
50
48
|
$[4] = row;
|
|
51
|
-
$[5] =
|
|
49
|
+
$[5] = shiftKeyRef;
|
|
52
50
|
$[6] = table;
|
|
53
51
|
$[7] = t2;
|
|
54
52
|
} else t2 = $[7];
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { c } from "react/compiler-runtime";
|
|
3
3
|
import { useFieldContext } from "@ark-ui/react/field";
|
|
4
|
-
import { mergeProps } from "@ark-ui/react/utils";
|
|
5
4
|
import { composeRefs } from "@radix-ui/react-compose-refs";
|
|
6
5
|
import { SvgIcon } from "../../icons/SvgIcon.js";
|
|
7
6
|
import { cn } from "../../utils/cn.js";
|
|
@@ -10,57 +9,55 @@ import { textareaHeightVariants, textareaPaddingVariants } from "./classes.js";
|
|
|
10
9
|
import { useAutoResize } from "./useAutoResize.js";
|
|
11
10
|
const Textarea = (t0)=>{
|
|
12
11
|
const $ = c(35);
|
|
12
|
+
let disabled;
|
|
13
|
+
let error;
|
|
13
14
|
let maxRows;
|
|
14
15
|
let minRows;
|
|
15
16
|
let props;
|
|
16
17
|
let ref;
|
|
17
18
|
let t1;
|
|
18
|
-
let t2;
|
|
19
|
-
let t3;
|
|
20
19
|
if ($[0] !== t0) {
|
|
21
|
-
({ error
|
|
20
|
+
({ error, disabled, size: t1, minRows, maxRows, ref, ...props } = t0);
|
|
22
21
|
$[0] = t0;
|
|
23
|
-
$[1] =
|
|
24
|
-
$[2] =
|
|
25
|
-
$[3] =
|
|
26
|
-
$[4] =
|
|
27
|
-
$[5] =
|
|
28
|
-
$[6] =
|
|
29
|
-
$[7] =
|
|
22
|
+
$[1] = disabled;
|
|
23
|
+
$[2] = error;
|
|
24
|
+
$[3] = maxRows;
|
|
25
|
+
$[4] = minRows;
|
|
26
|
+
$[5] = props;
|
|
27
|
+
$[6] = ref;
|
|
28
|
+
$[7] = t1;
|
|
30
29
|
} else {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
30
|
+
disabled = $[1];
|
|
31
|
+
error = $[2];
|
|
32
|
+
maxRows = $[3];
|
|
33
|
+
minRows = $[4];
|
|
34
|
+
props = $[5];
|
|
35
|
+
ref = $[6];
|
|
36
|
+
t1 = $[7];
|
|
38
37
|
}
|
|
39
|
-
const
|
|
40
|
-
const disabled = void 0 === t2 ? false : t2;
|
|
41
|
-
const size = void 0 === t3 ? "default" : t3;
|
|
38
|
+
const size = void 0 === t1 ? "default" : t1;
|
|
42
39
|
const field = useFieldContext();
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
t4 = mergeProps(field?.getTextareaProps());
|
|
46
|
-
$[8] = field;
|
|
47
|
-
$[9] = t4;
|
|
48
|
-
} else t4 = $[9];
|
|
49
|
-
const mergedProps = t4;
|
|
40
|
+
const invalid = error ?? field?.invalid ?? false;
|
|
41
|
+
const isDisabled = disabled ?? field?.disabled ?? false;
|
|
50
42
|
const autoResize = null != maxRows;
|
|
51
43
|
const effectiveMinRows = minRows ?? (autoResize ? 1 : void 0);
|
|
52
44
|
const { ref: autoResizeRef, adjustHeight } = useAutoResize(autoResize, effectiveMinRows ?? 1, maxRows ?? 1, props.value);
|
|
53
|
-
let
|
|
45
|
+
let t2;
|
|
46
|
+
if ($[8] !== field) {
|
|
47
|
+
t2 = field?.getTextareaProps();
|
|
48
|
+
$[8] = field;
|
|
49
|
+
$[9] = t2;
|
|
50
|
+
} else t2 = $[9];
|
|
51
|
+
let t3;
|
|
54
52
|
if ($[10] !== autoResizeRef || $[11] !== ref) {
|
|
55
|
-
|
|
53
|
+
t3 = composeRefs(autoResizeRef, ref);
|
|
56
54
|
$[10] = autoResizeRef;
|
|
57
55
|
$[11] = ref;
|
|
58
|
-
$[12] =
|
|
59
|
-
} else
|
|
60
|
-
|
|
61
|
-
let t7;
|
|
56
|
+
$[12] = t3;
|
|
57
|
+
} else t3 = $[12];
|
|
58
|
+
let t4;
|
|
62
59
|
if ($[13] !== adjustHeight || $[14] !== autoResize || $[15] !== props) {
|
|
63
|
-
|
|
60
|
+
t4 = autoResize && {
|
|
64
61
|
onInput: (e)=>{
|
|
65
62
|
adjustHeight();
|
|
66
63
|
props.onInput?.(e);
|
|
@@ -69,48 +66,48 @@ const Textarea = (t0)=>{
|
|
|
69
66
|
$[13] = adjustHeight;
|
|
70
67
|
$[14] = autoResize;
|
|
71
68
|
$[15] = props;
|
|
72
|
-
$[16] =
|
|
73
|
-
} else
|
|
74
|
-
let
|
|
75
|
-
if ($[17] !== autoResize || $[18] !==
|
|
76
|
-
|
|
77
|
-
error
|
|
69
|
+
$[16] = t4;
|
|
70
|
+
} else t4 = $[16];
|
|
71
|
+
let t5;
|
|
72
|
+
if ($[17] !== autoResize || $[18] !== invalid || $[19] !== size) {
|
|
73
|
+
t5 = cn(inputVariants({
|
|
74
|
+
error: invalid
|
|
78
75
|
}), textareaPaddingVariants({
|
|
79
76
|
size
|
|
80
77
|
}), "[scrollbar-width:thin]", !autoResize && textareaHeightVariants({
|
|
81
78
|
size
|
|
82
79
|
}), autoResize && "resize-none");
|
|
83
80
|
$[17] = autoResize;
|
|
84
|
-
$[18] =
|
|
81
|
+
$[18] = invalid;
|
|
85
82
|
$[19] = size;
|
|
86
|
-
$[20] =
|
|
87
|
-
} else
|
|
88
|
-
let
|
|
89
|
-
if ($[21] !==
|
|
90
|
-
|
|
91
|
-
...
|
|
83
|
+
$[20] = t5;
|
|
84
|
+
} else t5 = $[20];
|
|
85
|
+
let t6;
|
|
86
|
+
if ($[21] !== effectiveMinRows || $[22] !== invalid || $[23] !== isDisabled || $[24] !== props || $[25] !== t2 || $[26] !== t3 || $[27] !== t4 || $[28] !== t5) {
|
|
87
|
+
t6 = /*#__PURE__*/ jsx("textarea", {
|
|
88
|
+
...t2,
|
|
92
89
|
...props,
|
|
93
|
-
ref:
|
|
94
|
-
disabled:
|
|
95
|
-
"aria-invalid":
|
|
96
|
-
"aria-disabled":
|
|
90
|
+
ref: t3,
|
|
91
|
+
disabled: isDisabled,
|
|
92
|
+
"aria-invalid": invalid,
|
|
93
|
+
"aria-disabled": isDisabled,
|
|
97
94
|
rows: effectiveMinRows,
|
|
98
|
-
...
|
|
99
|
-
className:
|
|
95
|
+
...t4,
|
|
96
|
+
className: t5
|
|
100
97
|
});
|
|
101
|
-
$[21] =
|
|
102
|
-
$[22] =
|
|
103
|
-
$[23] =
|
|
98
|
+
$[21] = effectiveMinRows;
|
|
99
|
+
$[22] = invalid;
|
|
100
|
+
$[23] = isDisabled;
|
|
104
101
|
$[24] = props;
|
|
105
|
-
$[25] =
|
|
106
|
-
$[26] =
|
|
107
|
-
$[27] =
|
|
108
|
-
$[28] =
|
|
109
|
-
$[29] =
|
|
110
|
-
} else
|
|
111
|
-
let
|
|
102
|
+
$[25] = t2;
|
|
103
|
+
$[26] = t3;
|
|
104
|
+
$[27] = t4;
|
|
105
|
+
$[28] = t5;
|
|
106
|
+
$[29] = t6;
|
|
107
|
+
} else t6 = $[29];
|
|
108
|
+
let t7;
|
|
112
109
|
if ($[30] !== autoResize) {
|
|
113
|
-
|
|
110
|
+
t7 = !autoResize && /*#__PURE__*/ jsx(SvgIcon, {
|
|
114
111
|
className: "w-12 h-12 absolute bottom-0 right-0 text-icon-secondary pointer-events-none",
|
|
115
112
|
viewBox: "0 0 12 12",
|
|
116
113
|
children: /*#__PURE__*/ jsx("path", {
|
|
@@ -120,23 +117,23 @@ const Textarea = (t0)=>{
|
|
|
120
117
|
})
|
|
121
118
|
});
|
|
122
119
|
$[30] = autoResize;
|
|
123
|
-
$[31] =
|
|
124
|
-
} else
|
|
125
|
-
let
|
|
126
|
-
if ($[32] !==
|
|
127
|
-
|
|
120
|
+
$[31] = t7;
|
|
121
|
+
} else t7 = $[31];
|
|
122
|
+
let t8;
|
|
123
|
+
if ($[32] !== t6 || $[33] !== t7) {
|
|
124
|
+
t8 = /*#__PURE__*/ jsxs("div", {
|
|
128
125
|
className: "relative",
|
|
129
126
|
"data-slot": "textarea",
|
|
130
127
|
children: [
|
|
131
|
-
|
|
132
|
-
|
|
128
|
+
t6,
|
|
129
|
+
t7
|
|
133
130
|
]
|
|
134
131
|
});
|
|
135
|
-
$[32] =
|
|
136
|
-
$[33] =
|
|
137
|
-
$[34] =
|
|
138
|
-
} else
|
|
139
|
-
return
|
|
132
|
+
$[32] = t6;
|
|
133
|
+
$[33] = t7;
|
|
134
|
+
$[34] = t8;
|
|
135
|
+
} else t8 = $[34];
|
|
136
|
+
return t8;
|
|
140
137
|
};
|
|
141
138
|
Textarea.displayName = "Textarea";
|
|
142
139
|
export { Textarea };
|
|
@@ -60,7 +60,7 @@ There is no `FilterBar`, `PageFilters` or `Combobox` (use `Select` + `useSelectS
|
|
|
60
60
|
|
|
61
61
|
**Searchable select**
|
|
62
62
|
|
|
63
|
-
- Put `SelectSearchInput` in `SelectHeader`, wired to `useSelectSearch`. Pass
|
|
63
|
+
- Put `SelectSearchInput` in `SelectHeader`, wired to `useSelectSearch`. Pass `filteredCollection` to `Select` and render it, so arrow keys skip hidden options.
|
|
64
64
|
- If the menu must match the trigger, pass `positioning={{ sameWidth: true }}` and `SelectPositioner className='min-w-full max-w-full'`; otherwise it is 240–320px.
|
|
65
65
|
- Option icons: set `icon` on each item.
|
|
66
66
|
- For several values use `SelectInput multiple`. `SelectButtonTag` is a trigger, not a chip list.
|
|
@@ -410,7 +410,7 @@ export const SearchableSelect = () => {
|
|
|
410
410
|
<Field>
|
|
411
411
|
<FieldLabel>Time zone</FieldLabel>
|
|
412
412
|
<Select
|
|
413
|
-
collection={
|
|
413
|
+
collection={filteredCollection}
|
|
414
414
|
value={[timeZone]}
|
|
415
415
|
positioning={{ sameWidth: true }}
|
|
416
416
|
onValueChange={handleTimeZoneChange}
|
|
@@ -1,15 +1,30 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c } from "react/compiler-runtime";
|
|
2
|
+
import { useState } from "react";
|
|
2
3
|
const useControlled = (props)=>{
|
|
4
|
+
const $ = c(5);
|
|
3
5
|
const { controlled, default: defaultProp } = props;
|
|
4
|
-
const
|
|
6
|
+
const [isControlled] = useState(void 0 !== controlled);
|
|
5
7
|
const [valueState, setValue] = useState(defaultProp);
|
|
6
8
|
const value = isControlled ? controlled : valueState;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
let t0;
|
|
10
|
+
if ($[0] !== isControlled) {
|
|
11
|
+
t0 = (newValue)=>{
|
|
12
|
+
if (!isControlled) setValue(newValue);
|
|
13
|
+
};
|
|
14
|
+
$[0] = isControlled;
|
|
15
|
+
$[1] = t0;
|
|
16
|
+
} else t0 = $[1];
|
|
17
|
+
const setValueIfUncontrolled = t0;
|
|
18
|
+
let t1;
|
|
19
|
+
if ($[2] !== setValueIfUncontrolled || $[3] !== value) {
|
|
20
|
+
t1 = [
|
|
21
|
+
value,
|
|
22
|
+
setValueIfUncontrolled
|
|
23
|
+
];
|
|
24
|
+
$[2] = setValueIfUncontrolled;
|
|
25
|
+
$[3] = value;
|
|
26
|
+
$[4] = t1;
|
|
27
|
+
} else t1 = $[4];
|
|
28
|
+
return t1;
|
|
14
29
|
};
|
|
15
30
|
export { useControlled };
|