@t3q-ui/design-system 1.68.0 → 1.68.2
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/CHANGELOG.md +19 -0
- package/cli/doctor.mjs +7 -2
- package/cli/lib.mjs +23 -2
- package/cli/setup.mjs +9 -14
- package/cli/t3q-design.mjs +41 -15
- package/dist/components/_internal/floatingLabelOutline.cjs +68 -1
- package/dist/components/_internal/floatingLabelOutline.cjs.map +1 -1
- package/dist/components/_internal/floatingLabelOutline.js +52 -2
- package/dist/components/_internal/floatingLabelOutline.js.map +1 -1
- package/dist/components/_internal/textInput.cjs +217 -0
- package/dist/components/_internal/textInput.cjs.map +1 -0
- package/dist/components/_internal/textInput.js +200 -0
- package/dist/components/_internal/textInput.js.map +1 -0
- package/dist/components/agGridTable/index.cjs +18 -0
- package/dist/components/agGridTable/index.cjs.map +1 -1
- package/dist/components/agGridTable/index.js +18 -0
- package/dist/components/agGridTable/index.js.map +1 -1
- package/dist/components/alert.cjs +1 -1
- package/dist/components/alert.cjs.map +1 -1
- package/dist/components/alert.js +1 -1
- package/dist/components/alert.js.map +1 -1
- package/dist/components/checkbox.cjs +21 -6
- package/dist/components/checkbox.cjs.map +1 -1
- package/dist/components/checkbox.js +21 -6
- package/dist/components/checkbox.js.map +1 -1
- package/dist/components/columnFilter/ColumnFilterTag.cjs +20 -14
- package/dist/components/columnFilter/ColumnFilterTag.cjs.map +1 -1
- package/dist/components/columnFilter/ColumnFilterTag.js +20 -14
- package/dist/components/columnFilter/ColumnFilterTag.js.map +1 -1
- package/dist/components/columnVisibilityFilter.cjs +71 -36
- package/dist/components/columnVisibilityFilter.cjs.map +1 -1
- package/dist/components/columnVisibilityFilter.js +73 -38
- package/dist/components/columnVisibilityFilter.js.map +1 -1
- package/dist/components/command.cjs +2 -2
- package/dist/components/command.cjs.map +1 -1
- package/dist/components/command.js +2 -2
- package/dist/components/command.js.map +1 -1
- package/dist/components/datePicker.cjs +11 -47
- package/dist/components/datePicker.cjs.map +1 -1
- package/dist/components/datePicker.js +12 -48
- package/dist/components/datePicker.js.map +1 -1
- package/dist/components/form.cjs +20 -2
- package/dist/components/form.cjs.map +1 -1
- package/dist/components/form.js +20 -2
- package/dist/components/form.js.map +1 -1
- package/dist/components/iconSelect/index.cjs +2 -2
- package/dist/components/iconSelect/index.cjs.map +1 -1
- package/dist/components/iconSelect/index.js +2 -2
- package/dist/components/iconSelect/index.js.map +1 -1
- package/dist/components/multiSelect/multiSelectTrigger.cjs +19 -39
- package/dist/components/multiSelect/multiSelectTrigger.cjs.map +1 -1
- package/dist/components/multiSelect/multiSelectTrigger.js +20 -40
- package/dist/components/multiSelect/multiSelectTrigger.js.map +1 -1
- package/dist/components/parameterTable/ParameterTable.cjs +148 -90
- package/dist/components/parameterTable/ParameterTable.cjs.map +1 -1
- package/dist/components/parameterTable/ParameterTable.js +148 -90
- package/dist/components/parameterTable/ParameterTable.js.map +1 -1
- package/dist/components/parameterTable/ParameterTableRow.cjs +6 -1
- package/dist/components/parameterTable/ParameterTableRow.cjs.map +1 -1
- package/dist/components/parameterTable/ParameterTableRow.js +6 -1
- package/dist/components/parameterTable/ParameterTableRow.js.map +1 -1
- package/dist/components/select/selectEmpty.cjs +2 -2
- package/dist/components/select/selectEmpty.cjs.map +1 -1
- package/dist/components/select/selectEmpty.js +2 -2
- package/dist/components/select/selectEmpty.js.map +1 -1
- package/dist/components/select/selectTrigger.cjs +11 -47
- package/dist/components/select/selectTrigger.cjs.map +1 -1
- package/dist/components/select/selectTrigger.js +12 -48
- package/dist/components/select/selectTrigger.js.map +1 -1
- package/dist/components/tableFilterParts.cjs +24 -3
- package/dist/components/tableFilterParts.cjs.map +1 -1
- package/dist/components/tableFilterParts.js +24 -3
- package/dist/components/tableFilterParts.js.map +1 -1
- package/dist/components/tag.cjs +2 -1
- package/dist/components/tag.cjs.map +1 -1
- package/dist/components/tag.js +2 -1
- package/dist/components/tag.js.map +1 -1
- package/dist/components/textArea.cjs +15 -172
- package/dist/components/textArea.cjs.map +1 -1
- package/dist/components/textArea.js +15 -172
- package/dist/components/textArea.js.map +1 -1
- package/dist/components/textField.cjs +48 -222
- package/dist/components/textField.cjs.map +1 -1
- package/dist/components/textField.js +48 -222
- package/dist/components/textField.js.map +1 -1
- package/dist/components/timePicker.cjs +11 -47
- package/dist/components/timePicker.cjs.map +1 -1
- package/dist/components/timePicker.js +12 -48
- package/dist/components/timePicker.js.map +1 -1
- package/dist/design-system.css +16 -0
- package/dist/index.d.cts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/styles.css +18 -1
- package/mcp/manifests/components.json +12 -6
- package/package.json +1 -1
- package/skills/tds/reference/components.md +5 -1
|
@@ -140,6 +140,10 @@ const ParameterTable = React.forwardRef(
|
|
|
140
140
|
const pendingCursorRef = React.useRef(null);
|
|
141
141
|
const reclickRef = React.useRef(null);
|
|
142
142
|
const reclickEnteredRef = React.useRef(false);
|
|
143
|
+
const lastFocusRef = React.useRef(null);
|
|
144
|
+
React.useEffect(() => {
|
|
145
|
+
if (selection) lastFocusRef.current = selection.focus;
|
|
146
|
+
}, [selection]);
|
|
143
147
|
const lastActiveKeyRef = React.useRef(null);
|
|
144
148
|
React.useEffect(() => {
|
|
145
149
|
let cell = null;
|
|
@@ -278,6 +282,20 @@ const ParameterTable = React.forwardRef(
|
|
|
278
282
|
}),
|
|
279
283
|
[maxRowIdx, totalCols]
|
|
280
284
|
);
|
|
285
|
+
const selectEntryCell = React.useCallback(() => {
|
|
286
|
+
const rowCount = withAddRow ? rows.length : realRows.length;
|
|
287
|
+
if (rowCount === 0 || totalCols === 0) return;
|
|
288
|
+
const last = lastFocusRef.current;
|
|
289
|
+
let cell = last && last.rowIdx < rowCount && last.colIdx < totalCols ? last : null;
|
|
290
|
+
for (let rowIdx = 0; !cell && rowIdx < rowCount; rowIdx++) {
|
|
291
|
+
for (let colIdx = 0; !cell && colIdx < totalCols; colIdx++) {
|
|
292
|
+
if (isCellEditable({ rowIdx, colIdx })) cell = { rowIdx, colIdx };
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
const entry = cell ?? { rowIdx: 0, colIdx: 0 };
|
|
296
|
+
setSelection((prev) => prev ?? { anchor: entry, focus: entry });
|
|
297
|
+
setKeyboardMode(true);
|
|
298
|
+
}, [isCellEditable, realRows.length, rows.length, totalCols, withAddRow]);
|
|
281
299
|
const setCellValue = React.useCallback(
|
|
282
300
|
(rowIdx, colId, val) => {
|
|
283
301
|
const target = rows[rowIdx];
|
|
@@ -402,9 +420,9 @@ const ParameterTable = React.forwardRef(
|
|
|
402
420
|
reclickRef.current = selection && coordEquals(selection.anchor, coord) && coordEquals(selection.focus, coord) ? coord : null;
|
|
403
421
|
reclickEnteredRef.current = false;
|
|
404
422
|
event.preventDefault();
|
|
423
|
+
draggingRef.current = true;
|
|
405
424
|
focusFloating();
|
|
406
425
|
setSelection({ anchor: coord, focus: coord });
|
|
407
|
-
draggingRef.current = true;
|
|
408
426
|
},
|
|
409
427
|
[
|
|
410
428
|
columns,
|
|
@@ -640,7 +658,13 @@ const ParameterTable = React.forwardRef(
|
|
|
640
658
|
return;
|
|
641
659
|
}
|
|
642
660
|
}
|
|
643
|
-
if (!selection)
|
|
661
|
+
if (!selection) {
|
|
662
|
+
if (/^(Arrow|Home$|End$|Enter$|F2$)/.test(key) || isPrintableKey(event)) {
|
|
663
|
+
event.preventDefault();
|
|
664
|
+
selectEntryCell();
|
|
665
|
+
}
|
|
666
|
+
return;
|
|
667
|
+
}
|
|
644
668
|
const focus = selection.focus;
|
|
645
669
|
if ((key === "Backspace" || key === "Delete") && !isMod && !event.altKey) {
|
|
646
670
|
event.preventDefault();
|
|
@@ -715,17 +739,21 @@ const ParameterTable = React.forwardRef(
|
|
|
715
739
|
return;
|
|
716
740
|
}
|
|
717
741
|
if (key === "Tab") {
|
|
718
|
-
event.preventDefault();
|
|
719
742
|
const dc = event.shiftKey ? -1 : 1;
|
|
720
743
|
let nextCol = focus.colIdx + dc;
|
|
721
744
|
let nextRow = focus.rowIdx;
|
|
722
745
|
if (nextCol >= totalCols) {
|
|
723
746
|
nextCol = 0;
|
|
724
|
-
nextRow
|
|
747
|
+
nextRow += 1;
|
|
725
748
|
} else if (nextCol < 0) {
|
|
726
749
|
nextCol = totalCols - 1;
|
|
727
|
-
nextRow
|
|
750
|
+
nextRow -= 1;
|
|
728
751
|
}
|
|
752
|
+
if (nextRow < 0 || nextRow > maxRowIdx) {
|
|
753
|
+
setSelection(null);
|
|
754
|
+
return;
|
|
755
|
+
}
|
|
756
|
+
event.preventDefault();
|
|
729
757
|
const next = { rowIdx: nextRow, colIdx: nextCol };
|
|
730
758
|
setSelection({ anchor: next, focus: next });
|
|
731
759
|
return;
|
|
@@ -756,6 +784,7 @@ const ParameterTable = React.forwardRef(
|
|
|
756
784
|
redoLastRowOperation,
|
|
757
785
|
rows,
|
|
758
786
|
selection,
|
|
787
|
+
selectEntryCell,
|
|
759
788
|
totalCols,
|
|
760
789
|
undoLastRowOperation
|
|
761
790
|
]
|
|
@@ -764,6 +793,22 @@ const ParameterTable = React.forwardRef(
|
|
|
764
793
|
useSensor(PointerSensor, { activationConstraint: { distance: 4 } }),
|
|
765
794
|
useSensor(KeyboardSensor, { coordinateGetter: sortableKeyboardCoordinates })
|
|
766
795
|
);
|
|
796
|
+
const dndAccessibility = React.useMemo(() => {
|
|
797
|
+
const rowNo = (id) => realRows.findIndex((r) => r.id === id) + 1;
|
|
798
|
+
const announcements = {
|
|
799
|
+
onDragStart: ({ active }) => `${rowNo(active.id)}행을 들었습니다.`,
|
|
800
|
+
// 들자마자 제자리 위에 있다는 알림은 건너뛴다(undefined) — "들었습니다" 를 덮어쓰지 않게
|
|
801
|
+
onDragOver: ({ active, over }) => !over ? `${rowNo(active.id)}행이 놓을 자리를 벗어났습니다.` : over.id === active.id ? void 0 : `${rowNo(active.id)}행을 ${rowNo(over.id)}행 자리로 옮기는 중입니다.`,
|
|
802
|
+
onDragEnd: ({ active, over }) => !over ? `${rowNo(active.id)}행을 놓았습니다.` : over.id === active.id ? `${rowNo(active.id)}행을 제자리에 놓았습니다.` : `${rowNo(active.id)}행을 ${rowNo(over.id)}행 자리에 놓았습니다.`,
|
|
803
|
+
onDragCancel: ({ active }) => `옮기기를 취소했습니다. ${rowNo(active.id)}행은 제자리에 있습니다.`
|
|
804
|
+
};
|
|
805
|
+
return {
|
|
806
|
+
announcements,
|
|
807
|
+
screenReaderInstructions: {
|
|
808
|
+
draggable: "행 순서를 바꾸려면 스페이스바를 누르세요. 위아래 화살표로 옮기고, 스페이스바로 놓거나 Esc 로 취소합니다."
|
|
809
|
+
}
|
|
810
|
+
};
|
|
811
|
+
}, [realRows]);
|
|
767
812
|
const handleDragEnd = React.useCallback(
|
|
768
813
|
(event) => {
|
|
769
814
|
const { active, over } = event;
|
|
@@ -799,6 +844,7 @@ const ParameterTable = React.forwardRef(
|
|
|
799
844
|
const focusRow = focusCoord ? rows[focusCoord.rowIdx] : void 0;
|
|
800
845
|
const focusCol = focusCoord ? columns[focusCoord.colIdx] : void 0;
|
|
801
846
|
const activeHint = focusCoord && focusRow && focusCol ? cellHint?.(focusRow, focusCoord.rowIdx, focusCol, focusCoord.colIdx) : void 0;
|
|
847
|
+
const editorName = focusCoord && focusCol ? `${focusCoord.rowIdx === rows.length - 1 ? "새 행" : `${focusCoord.rowIdx + 1}행`} ${focusCol.header}` : "파라미터 표 칸 편집";
|
|
802
848
|
const activeReadonly = focusCoord ? isReadonlyCell(focusCoord) : false;
|
|
803
849
|
const activeInvalid = Boolean(
|
|
804
850
|
focusCoord && focusRow && focusCol && focusCoord.rowIdx !== rows.length - 1 && cellErrors?.[focusRow.id]?.[focusCol.id]
|
|
@@ -817,94 +863,106 @@ const ParameterTable = React.forwardRef(
|
|
|
817
863
|
"aria-disabled": disabled || void 0,
|
|
818
864
|
children: [
|
|
819
865
|
caption && /* @__PURE__ */ jsx("div", { className: "mb-[8px] text-base-medium text-sys-text-main", children: caption }),
|
|
820
|
-
/* @__PURE__ */ jsxs(
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
866
|
+
/* @__PURE__ */ jsxs(
|
|
867
|
+
DndContext,
|
|
868
|
+
{
|
|
869
|
+
sensors,
|
|
870
|
+
collisionDetection: closestCenter,
|
|
871
|
+
onDragEnd: handleDragEnd,
|
|
872
|
+
accessibility: dndAccessibility,
|
|
873
|
+
children: [
|
|
874
|
+
/* @__PURE__ */ jsx(TooltipProvider, { children: /* @__PURE__ */ jsxs(Table, { className: "table-fixed !border-separate !border-spacing-0", children: [
|
|
875
|
+
/* @__PURE__ */ jsx(TableHeader, { spacing, children: /* @__PURE__ */ jsxs(TableRow, { children: [
|
|
876
|
+
withHandle && /* @__PURE__ */ jsx(TableHead, { align: "center", style: { width: `${colWidths.handle}px` }, children: /* @__PURE__ */ jsx("span", { className: "sr-only", children: "순서 변경" }) }),
|
|
877
|
+
columns.map((col) => /* @__PURE__ */ jsxs(
|
|
878
|
+
TableHead,
|
|
879
|
+
{
|
|
880
|
+
align: "left",
|
|
881
|
+
style: col.width ? { width: typeof col.width === "number" ? `${col.width}px` : col.width } : void 0,
|
|
882
|
+
children: [
|
|
883
|
+
col.header,
|
|
884
|
+
col.required && /* @__PURE__ */ jsx("span", { className: "ml-[2px] text-small-medium text-danger30", children: "*" })
|
|
885
|
+
]
|
|
886
|
+
},
|
|
887
|
+
col.id
|
|
888
|
+
)),
|
|
889
|
+
extraColumns?.map((col) => /* @__PURE__ */ jsx(
|
|
890
|
+
TableHead,
|
|
891
|
+
{
|
|
892
|
+
align: "left",
|
|
893
|
+
style: col.width ? { width: typeof col.width === "number" ? `${col.width}px` : col.width } : void 0,
|
|
894
|
+
children: col.header
|
|
895
|
+
},
|
|
896
|
+
col.id
|
|
897
|
+
)),
|
|
898
|
+
/* @__PURE__ */ jsx(TableHead, { align: "center", style: { width: `${colWidths.delete}px` }, children: /* @__PURE__ */ jsx("span", { className: "sr-only", children: "삭제" }) })
|
|
899
|
+
] }) }),
|
|
900
|
+
/* @__PURE__ */ jsx(TableBody, { spacing, children: /* @__PURE__ */ jsx(SortableContext, { items: realRowIds, strategy: verticalListSortingStrategy, children: (disabled || !withAddRow ? realRows : rows).map((row, rowIdx) => {
|
|
901
|
+
const isPlaceholder = rowIdx === rows.length - 1;
|
|
902
|
+
return /* @__PURE__ */ jsx(
|
|
903
|
+
ParameterTableRow,
|
|
904
|
+
{
|
|
905
|
+
row,
|
|
906
|
+
rowIdx,
|
|
907
|
+
columns,
|
|
908
|
+
spacing,
|
|
909
|
+
withHandle,
|
|
910
|
+
disabled,
|
|
911
|
+
isPlaceholder,
|
|
912
|
+
isDeleteDisabled: !isRowDeletable(row, rowIdx),
|
|
913
|
+
isReadonlyCell,
|
|
914
|
+
extraColumns,
|
|
915
|
+
cellHint,
|
|
916
|
+
activeCell: keyboardMode ? focusCoord : null,
|
|
917
|
+
selectionRect,
|
|
918
|
+
editingCell: editing,
|
|
919
|
+
cellErrors,
|
|
920
|
+
onCellMouseDown: handleCellMouseDown,
|
|
921
|
+
onCellMouseEnter: handleCellMouseEnter,
|
|
922
|
+
onCellClick: handleCellClick,
|
|
923
|
+
onCellDoubleClick: handleCellDoubleClick,
|
|
924
|
+
onDelete: () => handleDelete(row.id)
|
|
925
|
+
},
|
|
926
|
+
row.id
|
|
927
|
+
);
|
|
928
|
+
}) }) })
|
|
929
|
+
] }) }),
|
|
930
|
+
/* @__PURE__ */ jsx(
|
|
931
|
+
"input",
|
|
838
932
|
{
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
933
|
+
ref: floatingInputRef,
|
|
934
|
+
type: "text",
|
|
935
|
+
className: cn(
|
|
936
|
+
"t3q-pt-floating-input text-base-medium",
|
|
937
|
+
editing && "t3q-pt-floating-input--editing"
|
|
938
|
+
),
|
|
939
|
+
style: floatingInputStyle,
|
|
940
|
+
value: inputValue,
|
|
941
|
+
onChange: (e) => setInputValue(e.target.value),
|
|
942
|
+
onMouseDown: (event) => {
|
|
943
|
+
if (reclickEnteredRef.current && event.detail > 1) event.preventDefault();
|
|
944
|
+
reclickEnteredRef.current = false;
|
|
945
|
+
},
|
|
946
|
+
onFocus: () => {
|
|
947
|
+
if (!selection && !draggingRef.current) selectEntryCell();
|
|
948
|
+
},
|
|
949
|
+
onKeyDown: handleKeyDown,
|
|
950
|
+
onCompositionStart: handleCompositionStart,
|
|
951
|
+
onCompositionEnd: handleCompositionEnd,
|
|
952
|
+
"aria-label": editorName,
|
|
953
|
+
"aria-invalid": activeInvalid || void 0,
|
|
954
|
+
"aria-readonly": activeReadonly || void 0,
|
|
955
|
+
"aria-describedby": activeHint ? hintId : void 0,
|
|
956
|
+
tabIndex: disabled ? -1 : 0,
|
|
857
957
|
disabled,
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
extraColumns,
|
|
862
|
-
cellHint,
|
|
863
|
-
activeCell: keyboardMode ? focusCoord : null,
|
|
864
|
-
selectionRect,
|
|
865
|
-
editingCell: editing,
|
|
866
|
-
cellErrors,
|
|
867
|
-
onCellMouseDown: handleCellMouseDown,
|
|
868
|
-
onCellMouseEnter: handleCellMouseEnter,
|
|
869
|
-
onCellClick: handleCellClick,
|
|
870
|
-
onCellDoubleClick: handleCellDoubleClick,
|
|
871
|
-
onDelete: () => handleDelete(row.id)
|
|
872
|
-
},
|
|
873
|
-
row.id
|
|
874
|
-
);
|
|
875
|
-
}) }) })
|
|
876
|
-
] }) }),
|
|
877
|
-
/* @__PURE__ */ jsx(
|
|
878
|
-
"input",
|
|
879
|
-
{
|
|
880
|
-
ref: floatingInputRef,
|
|
881
|
-
type: "text",
|
|
882
|
-
className: cn(
|
|
883
|
-
"t3q-pt-floating-input text-base-medium",
|
|
884
|
-
editing && "t3q-pt-floating-input--editing"
|
|
958
|
+
autoComplete: "off",
|
|
959
|
+
spellCheck: false
|
|
960
|
+
}
|
|
885
961
|
),
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
if (reclickEnteredRef.current && event.detail > 1) event.preventDefault();
|
|
891
|
-
reclickEnteredRef.current = false;
|
|
892
|
-
},
|
|
893
|
-
onKeyDown: handleKeyDown,
|
|
894
|
-
onCompositionStart: handleCompositionStart,
|
|
895
|
-
onCompositionEnd: handleCompositionEnd,
|
|
896
|
-
"aria-label": editing && columns[editing.colIdx] ? columns[editing.colIdx].header : "Parameter table cell editor",
|
|
897
|
-
"aria-invalid": activeInvalid || void 0,
|
|
898
|
-
"aria-readonly": activeReadonly || void 0,
|
|
899
|
-
"aria-describedby": activeHint ? hintId : void 0,
|
|
900
|
-
tabIndex: disabled ? -1 : 0,
|
|
901
|
-
disabled,
|
|
902
|
-
autoComplete: "off",
|
|
903
|
-
spellCheck: false
|
|
904
|
-
}
|
|
905
|
-
),
|
|
906
|
-
activeHint && /* @__PURE__ */ jsx("span", { id: hintId, className: "sr-only", children: activeHint })
|
|
907
|
-
] })
|
|
962
|
+
activeHint && /* @__PURE__ */ jsx("span", { id: hintId, className: "sr-only", children: activeHint })
|
|
963
|
+
]
|
|
964
|
+
}
|
|
965
|
+
)
|
|
908
966
|
]
|
|
909
967
|
}
|
|
910
968
|
);
|