sellmate-design-system-react 9.0.0-beta.2 → 9.0.0-beta.20
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/AGENTS.md +463 -89
- package/README.md +101 -0
- package/dist/components/SBadge/README.md +24 -0
- package/dist/components/SBadge/SBadge.d.ts +1 -1
- package/dist/components/SBarcodeInput/README.md +9 -1
- package/dist/components/SBarcodeInput/SBarcodeInput.d.ts +7 -1
- package/dist/components/SButton/README.md +36 -0
- package/dist/components/SCalendar/README.md +13 -0
- package/dist/components/SCallout/README.md +15 -0
- package/dist/components/SCard/SCard.d.ts +1 -1
- package/dist/components/SCheckbox/README.md +8 -0
- package/dist/components/SChipFilter/README.md +288 -5
- package/dist/components/SChipFilter/SChipFilter.d.ts +95 -40
- package/dist/components/SChipFilter/index.d.ts +1 -1
- package/dist/components/SChipInput/README.md +15 -1
- package/dist/components/SChipInput/SChipInput.d.ts +7 -1
- package/dist/components/SCircleProgress/README.md +8 -0
- package/dist/components/SConfirmModal/README.md +16 -0
- package/dist/components/SDatePicker/README.md +60 -4
- package/dist/components/SDatePicker/SDatePicker.d.ts +61 -5
- package/dist/components/SDatePicker/index.d.ts +1 -1
- package/dist/components/SDateRangePicker/README.md +17 -2
- package/dist/components/SDateRangePicker/SDateRangePicker.d.ts +16 -3
- package/dist/components/SDivider/README.md +4 -0
- package/dist/components/SDraggableItem/README.md +37 -0
- package/dist/components/SDraggableItem/SDraggableItem.d.ts +2 -0
- package/dist/components/SDraggableList/README.md +29 -0
- package/dist/components/SDraggableList/SDraggableList.d.ts +10 -0
- package/dist/components/SDraggableList/index.d.ts +1 -1
- package/dist/components/SDrawer/README.md +8 -0
- package/dist/components/SDropdownButton/README.md +19 -0
- package/dist/components/SEditor/EditorBody.d.ts +40 -0
- package/dist/components/SEditor/EditorToolbar.d.ts +87 -0
- package/dist/components/SEditor/README.md +230 -0
- package/dist/components/SEditor/SEditor.d.ts +124 -0
- package/dist/components/SEditor/editor-icons.d.ts +59 -0
- package/dist/components/SEditor/editor.config.d.ts +85 -0
- package/dist/components/SEditor/index.d.ts +2 -0
- package/dist/components/SEditor/tiptap-api.d.ts +29 -0
- package/dist/components/SEditor/use-is-mobile.d.ts +14 -0
- package/dist/components/SExpansionItem/README.md +36 -0
- package/dist/components/SField/README.md +27 -2
- package/dist/components/SField/SField.d.ts +22 -4
- package/dist/components/SFilePicker/README.md +15 -1
- package/dist/components/SFilePicker/SFilePicker.d.ts +7 -1
- package/dist/components/SFooter/README.md +21 -0
- package/dist/components/SForm/README.md +11 -0
- package/dist/components/SGhostButton/README.md +20 -2
- package/dist/components/SGnb/README.md +45 -0
- package/dist/components/SGnb/gnb.config.d.ts +7 -0
- package/dist/components/SGuide/README.md +15 -0
- package/dist/components/SIcon/README.md +4 -0
- package/dist/components/SIcon/SIcon.d.ts +1 -1
- package/dist/components/SIcon/icons.gen.d.ts +2 -0
- package/dist/components/SImage/README.md +14 -0
- package/dist/components/SInput/README.md +3 -1
- package/dist/components/SInput/SInput.d.ts +7 -1
- package/dist/components/SKeyValueTable/README.md +87 -0
- package/dist/components/SKeyValueTable/SKeyValueTable.d.ts +14 -3
- package/dist/components/SLayout/README.md +16 -0
- package/dist/components/SLinearProgress/README.md +8 -0
- package/dist/components/SList/README.md +5 -1
- package/dist/components/SList/SList.d.ts +0 -2
- package/dist/components/SListItem/README.md +41 -0
- package/dist/components/SLoadingModal/README.md +8 -0
- package/dist/components/SNumberInput/README.md +9 -1
- package/dist/components/SNumberInput/SNumberInput.d.ts +7 -1
- package/dist/components/SPage/README.md +41 -1
- package/dist/components/SPage/SPage.d.ts +24 -2
- package/dist/components/SPage/index.d.ts +1 -1
- package/dist/components/SPage/page.config.d.ts +8 -0
- package/dist/components/SPopover/README.md +15 -0
- package/dist/components/SPopup/README.md +19 -0
- package/dist/components/SPortal/README.md +14 -0
- package/dist/components/SRadio/README.md +20 -0
- package/dist/components/SRadioButton/README.md +18 -0
- package/dist/components/SScrollArea/README.md +14 -0
- package/dist/components/SSearchInput/README.md +61 -0
- package/dist/components/SSearchInput/SSearchInput.d.ts +52 -0
- package/dist/components/SSearchInput/index.d.ts +1 -0
- package/dist/components/SSectionHeaderCard/README.md +39 -20
- package/dist/components/SSectionHeaderCard/SSectionHeaderCard.d.ts +21 -14
- package/dist/components/SSectionHeaderCard/index.d.ts +1 -1
- package/dist/components/SSelect/README.md +25 -3
- package/dist/components/SSelect/SSelect.d.ts +13 -1
- package/dist/components/SSplitter/README.md +15 -0
- package/dist/components/SStepper/README.md +26 -0
- package/dist/components/SSwitch/README.md +13 -0
- package/dist/components/STable/README.md +72 -1
- package/dist/components/STable/STable.d.ts +129 -11
- package/dist/components/STable/index.d.ts +1 -1
- package/dist/components/STabs/README.md +12 -1
- package/dist/components/STabs/STabs.d.ts +2 -4
- package/dist/components/STabs/index.d.ts +1 -1
- package/dist/components/STabs/tabs.config.d.ts +3 -4
- package/dist/components/STag/README.md +47 -0
- package/dist/components/STextLink/README.md +17 -0
- package/dist/components/STextLink/STextLink.d.ts +2 -0
- package/dist/components/STextarea/README.md +1 -1
- package/dist/components/STextarea/STextarea.d.ts +7 -1
- package/dist/components/STimePicker/README.md +15 -1
- package/dist/components/STimePicker/STimePicker.d.ts +7 -1
- package/dist/components/STimePicker/timepicker.config.d.ts +7 -0
- package/dist/components/STimeRangePicker/README.md +27 -1
- package/dist/components/STimeRangePicker/STimeRangePicker.d.ts +7 -1
- package/dist/components/SToast/README.md +24 -0
- package/dist/components/SToggle/README.md +8 -0
- package/dist/components/STooltip/README.md +22 -0
- package/dist/components/STree/README.md +41 -0
- package/dist/components/STree/STree.d.ts +8 -0
- package/dist/components/STree/index.d.ts +1 -1
- package/dist/index.cjs +3987 -496
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3970 -496
- package/dist/index.js.map +1 -1
- package/dist/lib/field-width.d.ts +31 -0
- package/dist/lib/story-docs.d.ts +19 -3
- package/dist/lib/truncated-value-tooltip.d.ts +18 -0
- package/dist/llms-full.txt +2312 -198
- package/dist/llms.txt +465 -91
- package/dist/styles.css +672 -41
- package/dist/theme.css +22 -6
- package/eslint/index.mjs +10 -0
- package/eslint/lib/table-column.mjs +26 -0
- package/eslint/rules/field-width-grade.d.mts +41 -0
- package/eslint/rules/field-width-grade.mjs +311 -0
- package/eslint/rules/table-column-width.mjs +110 -0
- package/eslint/scale.gen.mjs +3 -0
- package/package.json +13 -1
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import { type CSSProperties, type ReactNode } from 'react';
|
|
2
2
|
import { type SDateRangeValue } from '../SDateRangePicker';
|
|
3
|
-
|
|
3
|
+
/** 필터가 값을 받는 방식. 각 값에 대응하는 필드 인터페이스가 따로 있다 —
|
|
4
|
+
* SChipFilterSingleField·SChipFilterMultiField·SChipFilterKeywordField·
|
|
5
|
+
* SChipFilterDateField·SChipFilterPeriodField·SChipFilterCustomField */
|
|
6
|
+
export type SChipFilterType = SChipFilterField['type'];
|
|
4
7
|
export type SChipFilterOptionValue = string | number;
|
|
5
8
|
export type SChipFilterMatchMode = 'contains' | 'exact' | 'excludes';
|
|
9
|
+
export type SChipFilterPeriodUnit = 'day' | 'month' | 'quarter' | 'half' | 'year' | 'custom';
|
|
6
10
|
export interface SChipFilterOption {
|
|
7
11
|
value: SChipFilterOptionValue;
|
|
8
12
|
label: string;
|
|
9
13
|
disabled?: boolean;
|
|
10
14
|
}
|
|
11
|
-
/** date 필드의 프리셋 라디오 항목 (오늘/지난 7
|
|
15
|
+
/** date/period 필드의 프리셋 라디오 항목 (오늘/지난 7일/일별/월별/사용자 지정 등) */
|
|
12
16
|
export interface SChipFilterDatePreset {
|
|
13
17
|
/** 프리셋 식별자 */
|
|
14
18
|
value: string;
|
|
@@ -24,59 +28,107 @@ export interface SChipFilterKeywordValue {
|
|
|
24
28
|
keywords: string[];
|
|
25
29
|
mode: SChipFilterMatchMode;
|
|
26
30
|
}
|
|
31
|
+
/** period 필드 값 — 선택 단위(unit)와 그 단위의 입력값(value)을 함께 보관한다 */
|
|
32
|
+
export interface SChipFilterPeriodValue {
|
|
33
|
+
unit: SChipFilterPeriodUnit;
|
|
34
|
+
value?: string | number | SDateRangeValue | null;
|
|
35
|
+
}
|
|
27
36
|
/** custom 필드가 자유롭게 담는 값. 형태를 강제하지 않는다 — render에서 직접 정의한 그대로 읽고 쓴다 */
|
|
28
37
|
export type SChipFilterCustomValue = Record<string, unknown>;
|
|
29
|
-
export type SChipFilterValue = SChipFilterOptionValue | SChipFilterOptionValue[] | SDateRangeValue | SChipFilterKeywordValue | SChipFilterCustomValue | null | undefined;
|
|
38
|
+
export type SChipFilterValue = SChipFilterOptionValue | SChipFilterOptionValue[] | SDateRangeValue | SChipFilterKeywordValue | SChipFilterPeriodValue | SChipFilterCustomValue | null | undefined;
|
|
30
39
|
export type SChipFilterValueMap = Record<string, SChipFilterValue>;
|
|
31
|
-
|
|
40
|
+
/** 타입과 무관하게 모든 필터가 갖는 속성 */
|
|
41
|
+
export interface SChipFilterFieldBase {
|
|
32
42
|
/** 필터 식별자 */
|
|
33
43
|
key: string;
|
|
34
44
|
/** 칩에 표시할 레이블 */
|
|
35
45
|
label: string;
|
|
36
|
-
/** 필터 타입 */
|
|
37
|
-
type: SChipFilterType;
|
|
38
|
-
/** single/multi/keyword 후보 목록 */
|
|
39
|
-
options?: SChipFilterOption[];
|
|
40
46
|
/** 필수 필터 표시. true면 값이 비어 있을 때 기본값(defaultValue 또는 타입별 내장 기본값)이
|
|
41
47
|
* 자동으로 채워지고, clearable은 현재 값이 기본값과 같을 땐 숨겨지며 클릭 시 기본값으로 되돌아간다 */
|
|
42
48
|
required?: boolean;
|
|
49
|
+
/** 고정 필터. true면 activeKeys와 무관하게 항상 노출되고 "필터 추가" 목록에는 나타나지 않는다.
|
|
50
|
+
* required도 같은 효과를 낸다 — 처음부터 바에 보이는 것은 fixed이거나 required인 필드뿐이고,
|
|
51
|
+
* 나머지는 전부 "필터 추가"에서 골라야 나타난다 */
|
|
52
|
+
fixed?: boolean;
|
|
43
53
|
/** 초기값 및 clearable 클릭 시 되돌아갈 값. required 여부와 무관하게 적용된다 — 값이 비어 있으면
|
|
44
54
|
* 마운트(또는 "필터 추가"로 활성화) 시 이 값이 자동으로 채워진다. required인데 지정하지 않으면
|
|
45
55
|
* 타입별 내장 기본값(single: 첫 번째 옵션, date: 오늘 날짜)을 대신 쓴다 */
|
|
46
56
|
defaultValue?: SChipFilterValue;
|
|
47
|
-
/**
|
|
48
|
-
|
|
49
|
-
/** 비활성 상태 */
|
|
57
|
+
/** 이 필터만 비활성. 바에 남아 있되 팝오버가 열리지 않고 clearable도 눌리지 않는다.
|
|
58
|
+
* 바 전체를 잠그려면 SChipFilterProps.disabled를 쓴다 — 둘은 OR로 합쳐진다 */
|
|
50
59
|
disabled?: boolean;
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
60
|
+
}
|
|
61
|
+
/** 후보 목록에서 고르는 필터 — single·multi·keyword */
|
|
62
|
+
export interface SChipFilterOptionsField extends SChipFilterFieldBase {
|
|
63
|
+
/** 고를 수 있는 후보 목록 */
|
|
64
|
+
options?: SChipFilterOption[];
|
|
65
|
+
}
|
|
66
|
+
/** 프리셋으로 기간을 고르는 필터 — date·period */
|
|
67
|
+
export interface SChipFilterPresetsField extends SChipFilterFieldBase {
|
|
68
|
+
/** 프리셋 라디오 목록. date에서 지정하지 않으면 단일 캘린더 트리거로 동작하고,
|
|
69
|
+
* period에서 지정하지 않으면 일별·월별·분기별·반기별·연도별·사용자 지정 기본 목록을 쓴다 */
|
|
70
|
+
presets?: SChipFilterDatePreset[];
|
|
71
|
+
/** 선택 가능 범위 */
|
|
72
|
+
selectable?: [string, string];
|
|
73
|
+
/** "사용자 지정" 프리셋으로 기간을 고를 때의 최대 선택 일수 */
|
|
74
|
+
maxRange?: number;
|
|
75
|
+
}
|
|
76
|
+
/** 후보 하나를 고른다 */
|
|
77
|
+
export interface SChipFilterSingleField extends SChipFilterOptionsField {
|
|
78
|
+
type: 'single';
|
|
79
|
+
}
|
|
80
|
+
/** 후보 여럿을 고른다 */
|
|
81
|
+
export interface SChipFilterMultiField extends SChipFilterOptionsField {
|
|
82
|
+
type: 'multi';
|
|
83
|
+
}
|
|
84
|
+
/** keyword 필드의 입력 방식 — 무엇을 키워드 하나의 끝으로 볼지 */
|
|
85
|
+
export type SChipFilterKeywordInput = 'tag' | 'csv';
|
|
86
|
+
/** 키워드를 입력해 누적한다. options는 입력 중 후보로만 뜬다 */
|
|
87
|
+
export interface SChipFilterKeywordField extends SChipFilterOptionsField {
|
|
88
|
+
type: 'keyword';
|
|
89
|
+
/** 입력 placeholder */
|
|
56
90
|
placeholder?: string;
|
|
57
|
-
/**
|
|
91
|
+
/** 입력 방식. 기본 'tag' — Enter 로 하나씩 추가한다.
|
|
92
|
+
* 'csv' 는 쉼표도 구분자로 인정해, 쉼표를 치거나 쉼표가 섞인 텍스트를 붙여넣으면 그 자리에서
|
|
93
|
+
* 여러 개로 쪼개져 목록에 쌓인다(엑셀에서 복사한 코드 목록을 한 번에 넣는 용도).
|
|
94
|
+
* 쌓이는 목록도 값 형태도 'tag' 와 같다 — 구분자만 늘어난다. */
|
|
95
|
+
input?: SChipFilterKeywordInput;
|
|
96
|
+
/** 검색조건(포함/일치) 토글 표시 여부 */
|
|
58
97
|
matchModes?: boolean;
|
|
59
|
-
/** matchModes 활성 시 "미포함"까지 포함해 3개(포함/일치/미포함)로 노출할지.
|
|
98
|
+
/** matchModes 활성 시 "미포함"까지 포함해 3개(포함/일치/미포함)로 노출할지.
|
|
99
|
+
* 기본 false — 2개(포함/일치)만 */
|
|
60
100
|
excludeMode?: boolean;
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
|
|
67
|
-
/** presets
|
|
68
|
-
*
|
|
101
|
+
}
|
|
102
|
+
/** 날짜 하나 또는 기간을 고른다 */
|
|
103
|
+
export interface SChipFilterDateField extends SChipFilterPresetsField {
|
|
104
|
+
type: 'date';
|
|
105
|
+
/** presets 없이 단일 캘린더 트리거로 동작할 때의 placeholder */
|
|
106
|
+
placeholder?: string;
|
|
107
|
+
/** presets를 필터 바에 세그먼트 라디오로 펼쳐 놓는다(팝오버 없음).
|
|
108
|
+
* 기본 false — 칩 클릭 시 팝오버 안에 세로 라디오 목록(+사용자 지정 선택 시 기간 피커) */
|
|
69
109
|
radioButton?: boolean;
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
110
|
+
}
|
|
111
|
+
/** 집계 단위(일·월·분기·반기·연)와 그 단위의 값을 함께 고른다 */
|
|
112
|
+
export interface SChipFilterPeriodField extends SChipFilterPresetsField {
|
|
113
|
+
type: 'period';
|
|
114
|
+
}
|
|
115
|
+
/** 칩+팝오버를 거치지 않고 바에 놓을 노드를 앱이 직접 그린다 */
|
|
116
|
+
export interface SChipFilterCustomField extends SChipFilterFieldBase {
|
|
117
|
+
type: 'custom';
|
|
118
|
+
/** 필터 바의 이 필드 자리에 놓일 노드를 직접 그린다. 반환한 노드가 그대로 바에 노출된다 —
|
|
119
|
+
* SSelect를 그대로 놓거나 SInput을 바로 노출하는 식으로 렌더 방식을 자유롭게 구성한다. */
|
|
73
120
|
render?: (ctx: {
|
|
74
121
|
value: SChipFilterValue;
|
|
75
122
|
disabled?: boolean;
|
|
123
|
+
/** 속한 그룹이 rule을 위반하는 동안 true — 직접 그린 노드에도 경고 표시를 맞추라는 신호다 */
|
|
76
124
|
warning?: boolean;
|
|
77
125
|
onValueChange: (value: SChipFilterValue) => void;
|
|
78
126
|
}) => ReactNode;
|
|
79
127
|
}
|
|
128
|
+
/** 필터 하나의 정의. type에 따라 쓸 수 있는 속성이 달라진다 —
|
|
129
|
+
* options는 single·multi·keyword, presets·selectable·maxRange는 date·period,
|
|
130
|
+
* render는 custom 에만 있다 */
|
|
131
|
+
export type SChipFilterField = SChipFilterSingleField | SChipFilterMultiField | SChipFilterKeywordField | SChipFilterDateField | SChipFilterPeriodField | SChipFilterCustomField;
|
|
80
132
|
export interface SChipFilterChangeDetail {
|
|
81
133
|
key: string;
|
|
82
134
|
value: SChipFilterValue;
|
|
@@ -92,7 +144,7 @@ export type SChipFilterGroupRule = {
|
|
|
92
144
|
type: 'requireAny';
|
|
93
145
|
dataGroupName?: string;
|
|
94
146
|
};
|
|
95
|
-
/**
|
|
147
|
+
/** fields를 이루는 단위. 묶을 것이 없어도 한 그룹으로 감싸 넘긴다 — `[{ fields: [...] }]` */
|
|
96
148
|
export interface SChipFilterGroup {
|
|
97
149
|
fields: SChipFilterField[];
|
|
98
150
|
/** 지정하면 이 규칙으로 그룹을 검증한다. values가 바뀔 때마다 즉시 재평가되는 실시간 검증이라 —
|
|
@@ -101,21 +153,24 @@ export interface SChipFilterGroup {
|
|
|
101
153
|
rule?: SChipFilterGroupRule;
|
|
102
154
|
/** rule을 만족하지 않을 때 그룹 중앙에 띄울 툴팁 메시지. 지정 안 하면 rule 종류에 따른 기본 문구를 쓴다 */
|
|
103
155
|
tooltipMessage?: string;
|
|
156
|
+
/** 이 그룹 앞에 구분선을 넣을지. 검증(rule)과 구분선은 별개라 — 묶어서 검증만 하고 싶으면
|
|
157
|
+
* 주지 않는다. 첫 그룹에는 앞에 가를 것이 없으므로 무시된다(showLabel의 구분선이 이미 있다) */
|
|
158
|
+
divider?: boolean;
|
|
104
159
|
}
|
|
105
160
|
export interface SChipFilterHandle {
|
|
106
161
|
/** 특정 필터 편집 팝오버를 엽니다. */
|
|
107
162
|
open: (key: string) => void;
|
|
108
163
|
/** 모든 필터 값을 초기화합니다. */
|
|
109
164
|
reset: () => void;
|
|
110
|
-
/**
|
|
111
|
-
*
|
|
165
|
+
/** 현재 값 기준으로 각 그룹의 rule을 만족하는지 반환합니다. rule을 준 그룹이 없으면 항상 true.
|
|
166
|
+
* 경고 툴팁은 이 호출과 무관하게 rule 위반 상태인 동안 항상 실시간으로 떠 있으므로,
|
|
112
167
|
* 이 메서드는 그 상태를 그대로 읽어오는 용도다(예: 검색 버튼을 눌러도 되는지 사전 확인) */
|
|
113
168
|
validate: () => boolean;
|
|
114
169
|
}
|
|
115
170
|
export interface SChipFilterProps {
|
|
116
|
-
/** 필터 정의 목록. 그룹으로
|
|
117
|
-
*
|
|
118
|
-
fields?:
|
|
171
|
+
/** 필터 정의 목록. 묶을 것이 없어도 한 그룹으로 감싸 넘긴다 — `[{ fields: [...] }]`.
|
|
172
|
+
* 그룹은 rule로 함께 검증하거나 divider로 갈라 놓을 때 나눈다. */
|
|
173
|
+
fields?: SChipFilterGroup[];
|
|
119
174
|
/** 필터 값 맵 */
|
|
120
175
|
value?: SChipFilterValueMap;
|
|
121
176
|
/** 전체 값 변경 — 편집 중인 값이 바뀔 때마다(선택할 때마다) 호출된다. 실제 검색 실행은 onSearch를 쓴다 */
|
|
@@ -124,15 +179,17 @@ export interface SChipFilterProps {
|
|
|
124
179
|
onFilterChange?: (detail: SChipFilterChangeDetail) => void;
|
|
125
180
|
/** 실제 검색을 실행할 시점 — 편집 팝오버의 "검색" 버튼을 누르거나 팝오버가 닫힐 때(바깥 클릭·Esc·다른
|
|
126
181
|
* 칩으로 전환 포함) 그 시점의 전체 값 맵과 함께 호출된다. 팝오버가 없는 필드(인라인 date 프리셋·custom,
|
|
127
|
-
* clearable ×, 검색 초기화)는 값이 바뀌는 즉시 호출된다.
|
|
182
|
+
* clearable ×, 검색 초기화)는 값이 바뀌는 즉시 호출된다. keyword 필터에서 Enter 로 키워드를 추가할 때도
|
|
183
|
+
* 그 즉시 호출된다 — 팝오버는 열린 채라 키워드를 이어서 더 넣을 수 있고, 넣을 때마다 조회가 갱신된다. dirty 체크가 기본 적용되어 있어 — 마지막으로
|
|
128
184
|
* 실제 검색이 실행된 값 맵과 비교해 하나라도 달라진 게 없으면(예: 팝오버를 열었다 아무것도 안 바꾸고
|
|
129
185
|
* 닫는 경우) 호출되지 않는다. fields를 그룹으로 넘겼다면 rule을 만족하지 못한 그룹이 있는 동안엔
|
|
130
186
|
* onSearch가 호출되지 않는다 — 해당 그룹의 경고 툴팁은 이 시점과 무관하게 값이 비어 있는 동안 항상
|
|
131
187
|
* 실시간으로 떠 있다(별도로 validate()를 호출할 필요 없음) */
|
|
132
188
|
onSearch?: (value: SChipFilterValueMap) => void;
|
|
133
189
|
/** 노출 필터 key 목록. 지정하면 제어 컴포넌트로 동작 — "필터 추가"로 고른 필드를 이 배열에 직접
|
|
134
|
-
* 넣어줘야 칩이 나타난다(onActiveKeysChange에서 받은 keys로 갱신). 지정하지 않으면
|
|
135
|
-
*
|
|
190
|
+
* 넣어줘야 칩이 나타난다(onActiveKeysChange에서 받은 keys로 갱신). 지정하지 않으면
|
|
191
|
+
* fixed·required 필드만 노출된 상태로 시작해 컴포넌트가 내부 상태로 관리하는 비제어 방식으로
|
|
192
|
+
* 동작한다. fixed·required 필드는 이 배열에 없어도 항상 노출된다 */
|
|
136
193
|
activeKeys?: string[];
|
|
137
194
|
/** 노출 필터 key 변경(칩 추가·제거) — 비제어 방식에서도 참고용으로 호출된다.
|
|
138
195
|
* activeKeys를 직접 제어할 때는 이 값을 그대로 activeKeys에 반영해야 한다 */
|
|
@@ -147,8 +204,6 @@ export interface SChipFilterProps {
|
|
|
147
204
|
label?: string;
|
|
148
205
|
/** 좌측 태그(label)·구분선 표시 여부 */
|
|
149
206
|
showLabel?: boolean;
|
|
150
|
-
/** 필터 추가 버튼 표시 여부 */
|
|
151
|
-
showAddButton?: boolean;
|
|
152
207
|
/** 검색 초기화 링크 표시 여부 */
|
|
153
208
|
showReset?: boolean;
|
|
154
209
|
/** 바 비활성 상태 */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { SChipFilter, type SChipFilterChangeDetail, type SChipFilterDatePreset, type SChipFilterField, type SChipFilterGroup, type SChipFilterGroupRule, type SChipFilterHandle, type SChipFilterKeywordValue, type SChipFilterMatchMode, type SChipFilterOption, type SChipFilterOptionValue, type SChipFilterProps, type SChipFilterType, type SChipFilterValue, type SChipFilterValueMap, } from './SChipFilter';
|
|
1
|
+
export { SChipFilter, type SChipFilterChangeDetail, type SChipFilterCustomField, type SChipFilterDateField, type SChipFilterDatePreset, type SChipFilterField, type SChipFilterFieldBase, type SChipFilterGroup, type SChipFilterGroupRule, type SChipFilterHandle, type SChipFilterKeywordField, type SChipFilterKeywordInput, type SChipFilterKeywordValue, type SChipFilterMatchMode, type SChipFilterMultiField, type SChipFilterOption, type SChipFilterOptionValue, type SChipFilterOptionsField, type SChipFilterPeriodField, type SChipFilterPresetsField, type SChipFilterProps, type SChipFilterSingleField, type SChipFilterType, type SChipFilterValue, type SChipFilterValueMap, } from './SChipFilter';
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
| `labelWidth?` | `number \| string` | — | |
|
|
31
31
|
| `hint?` | `string` | — | |
|
|
32
32
|
| `errorMessage?` | `string` | — | |
|
|
33
|
-
| `width?` | `
|
|
33
|
+
| `width?` | `SFieldWidth` | — | 컨트롤 너비 — 폭 등급(`'xs' | 'sm' | 'md' | 'lg' | 'xl'`) · 숫자=px · CSS 길이. 등급은 `--cmp-field-width-*` 토큰으로 풀리므로 토큰이 바뀌면 화면이 따라간다. 값 길이에 상한이 없으면 `"100%"` 로 두어 행 전체를 쓴다. |
|
|
34
34
|
| `status?` | `SFieldStatus` | — | |
|
|
35
35
|
| `icon?` | `SIconName` | — | |
|
|
36
36
|
| `iconColor?` | `SColor` | — | |
|
|
@@ -54,6 +54,20 @@
|
|
|
54
54
|
|--------|------|-------------|
|
|
55
55
|
| `focus` | `() => void` | 입력 필드에 포커스를 이동합니다. |
|
|
56
56
|
|
|
57
|
+
## Types
|
|
58
|
+
|
|
59
|
+
### SChipInputSize
|
|
60
|
+
|
|
61
|
+
```ts
|
|
62
|
+
export type SChipInputSize = SFieldSize;
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### SChipInputMetaPlacement
|
|
66
|
+
|
|
67
|
+
```ts
|
|
68
|
+
export type SChipInputMetaPlacement = 'end' | 'inline';
|
|
69
|
+
```
|
|
70
|
+
|
|
57
71
|
## Dependencies
|
|
58
72
|
|
|
59
73
|
### Depends on
|
|
@@ -4,6 +4,7 @@ import { type SIconName } from '../SIcon';
|
|
|
4
4
|
import { type SColor } from '../../lib/color';
|
|
5
5
|
import { type Rule } from '../../lib/form';
|
|
6
6
|
import { type STooltipProps } from '../STooltip';
|
|
7
|
+
import { type SFieldWidth } from '../../lib/field-width';
|
|
7
8
|
export type SChipInputSize = SFieldSize;
|
|
8
9
|
export type SChipInputMetaPlacement = 'end' | 'inline';
|
|
9
10
|
/** ref로 노출되는 UX 메서드 (sd-chip-input @Method sdFocus 대응) */
|
|
@@ -50,7 +51,12 @@ export interface SChipInputProps {
|
|
|
50
51
|
labelWidth?: number | string;
|
|
51
52
|
hint?: string;
|
|
52
53
|
errorMessage?: string;
|
|
53
|
-
|
|
54
|
+
/**
|
|
55
|
+
* 컨트롤 너비 — 폭 등급(`'xs' | 'sm' | 'md' | 'lg' | 'xl'`) · 숫자=px · CSS 길이.
|
|
56
|
+
* 등급은 `--cmp-field-width-*` 토큰으로 풀리므로 토큰이 바뀌면 화면이 따라간다.
|
|
57
|
+
* 값 길이에 상한이 없으면 `"100%"` 로 두어 행 전체를 쓴다.
|
|
58
|
+
*/
|
|
59
|
+
width?: SFieldWidth;
|
|
54
60
|
status?: SFieldStatus;
|
|
55
61
|
icon?: SIconName;
|
|
56
62
|
iconColor?: SColor;
|
|
@@ -17,6 +17,14 @@
|
|
|
17
17
|
| `className?` | `string` | — | |
|
|
18
18
|
| `style?` | `CSSProperties` | — | |
|
|
19
19
|
|
|
20
|
+
## Types
|
|
21
|
+
|
|
22
|
+
### SCircleProgressType
|
|
23
|
+
|
|
24
|
+
```ts
|
|
25
|
+
export type SCircleProgressType = 'primary' | 'inverse' | 'error' | 'complete' | 'neutral';
|
|
26
|
+
```
|
|
27
|
+
|
|
20
28
|
## Dependencies
|
|
21
29
|
|
|
22
30
|
### Used by
|
|
@@ -36,6 +36,22 @@
|
|
|
36
36
|
| `onCancel` | `() => void` | |
|
|
37
37
|
| `onClose` | `() => void` | 닫기(X) 버튼 클릭 (sdClose) |
|
|
38
38
|
|
|
39
|
+
## Types
|
|
40
|
+
|
|
41
|
+
### SConfirmModalType
|
|
42
|
+
|
|
43
|
+
```ts
|
|
44
|
+
export type SConfirmModalType = 'positive' | 'negative' | 'default';
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### ConfirmModalMainButton
|
|
48
|
+
|
|
49
|
+
```ts
|
|
50
|
+
/** 확인 버튼 프리셋 (sd-confirm-modal ConfirmModalMainButton) */
|
|
51
|
+
export type ConfirmModalMainButton =
|
|
52
|
+
'primary_md' | 'primary_outline_md' | 'danger_md' | 'danger_outline_md' | 'neutral_outline_md';
|
|
53
|
+
```
|
|
54
|
+
|
|
39
55
|
## Dependencies
|
|
40
56
|
|
|
41
57
|
### Used by
|
|
@@ -2,18 +2,40 @@
|
|
|
2
2
|
|
|
3
3
|
> 자동 생성 문서 — `npm run docs:gen`. 소스: 각 컴포넌트의 Props/Handle 인터페이스 + import 의존성.
|
|
4
4
|
|
|
5
|
+
### SDatePickerMonthListbox
|
|
6
|
+
|
|
7
|
+
#### Props
|
|
8
|
+
|
|
9
|
+
| Prop | Type | Default | Description |
|
|
10
|
+
|------|------|---------|-------------|
|
|
11
|
+
| `value?` | `string \| null` | — | 선택 월 (YYYY-MM) |
|
|
12
|
+
| `anchorYear?` | `number` | — | 연도 리스트가 처음 열릴 때 중앙에 둘 연도. 기본값은 올해 |
|
|
13
|
+
| `selectable?` | `[string, string]` | — | 선택 가능 범위 [시작, 종료] |
|
|
14
|
+
| `className?` | `string` | — | |
|
|
15
|
+
| `style?` | `CSSProperties` | — | |
|
|
16
|
+
|
|
17
|
+
#### Events
|
|
18
|
+
|
|
19
|
+
| Event | Type | Description |
|
|
20
|
+
|-------|------|-------------|
|
|
21
|
+
| `onValueChange` | `(value: string) => void` | |
|
|
22
|
+
| `onMonthSelect` | `(value: string) => void` | 월 컬럼에서 월을 선택했을 때 호출 |
|
|
23
|
+
|
|
5
24
|
### SDatePicker
|
|
6
25
|
|
|
7
26
|
#### Props
|
|
8
27
|
|
|
9
28
|
| Prop | Type | Default | Description |
|
|
10
29
|
|------|------|---------|-------------|
|
|
11
|
-
| `value?` | `string \| null` | — | 선택
|
|
30
|
+
| `value?` | `string \| null` | — | 선택 값 (date: YYYY-MM-DD, month: YYYY-MM, year: YYYY) |
|
|
31
|
+
| `mode?` | `SDatePickerMode` | `'date'` | 선택 모드 |
|
|
12
32
|
| `size?` | `SDatePickerSize` | `'sm'` | |
|
|
13
|
-
| `placeholder?` | `string` |
|
|
33
|
+
| `placeholder?` | `string` | — | |
|
|
14
34
|
| `selectable?` | `[string, string]` | — | 선택 가능 범위 [시작, 종료] |
|
|
15
35
|
| `disabled?` | `boolean` | `false` | |
|
|
16
|
-
| `
|
|
36
|
+
| `clearable?` | `boolean` | `false` | 선택값 지우기 버튼. 값이 있을 때만 나타나고, 누르면 `onValueChange` 로 `null` 이 온다. **필수 입력 필드에는 켜지 않는다** — 지우면 다시 고르기 전까지 폼이 통과하지 못한다. `STimePicker` · `STimeRangePicker` · `SSelect` 의 `clearable` 과 같은 규칙이다. |
|
|
37
|
+
| `width?` | `SFieldWidth` | — | 컨트롤 너비 — 폭 등급(`'xs' | 'sm' | 'md' | 'lg' | 'xl'`) · 숫자=px · CSS 길이. 등급은 `--cmp-field-width-*` 토큰으로 풀리므로 토큰이 바뀌면 화면이 따라간다. 값 길이에 상한이 없으면 `"100%"` 로 두어 행 전체를 쓴다. |
|
|
38
|
+
| `maxWidth?` | `SFieldWidth` | — | 컨트롤 최대 너비 — 폭 등급 · 숫자=px · CSS 길이. 지정하지 않으면 값 길이(`YYYY-MM-DD`)에 맞춘 내장 상한(`size='md'` → `lg`, `'sm'` → `md`)이 걸려, `width="100%"` 를 받아도 행 전체로 늘어나지 않는다. 팝오버처럼 폭이 이미 좁게 정해진 자리에서 그 폭을 그대로 채워야 하면 `width="100%"` 와 함께 `maxWidth="100%"` 를 준다. `0` 은 상한을 아예 걸지 않는다 — 부모보다 넓어지는 것까지 허용해야 할 때만 쓴다. |
|
|
17
39
|
| `name?` | `string` | — | |
|
|
18
40
|
| `rules?` | `Rule[]` | — | |
|
|
19
41
|
| `status?` | `SFieldStatus` | — | |
|
|
@@ -35,9 +57,41 @@
|
|
|
35
57
|
|
|
36
58
|
| Event | Type | Description |
|
|
37
59
|
|-------|------|-------------|
|
|
38
|
-
| `onValueChange` | `(
|
|
60
|
+
| `onValueChange` | `(value: string \| null) => void` | 선택 변경 (sdUpdate). `clearable` 로 지우면 `null` 이 온다 |
|
|
39
61
|
| `onViewChange` | `(view: { year: number; month: number }) => void` | 보이는 연·월 변경 (sdViewChange) |
|
|
40
62
|
|
|
63
|
+
### SDatePickerYearListbox
|
|
64
|
+
|
|
65
|
+
#### Props
|
|
66
|
+
|
|
67
|
+
| Prop | Type | Default | Description |
|
|
68
|
+
|------|------|---------|-------------|
|
|
69
|
+
| `value?` | `string \| null` | — | 선택 연도 (YYYY) |
|
|
70
|
+
| `anchorYear?` | `number` | — | 리스트가 처음 열릴 때 중앙에 둘 연도. 기본값은 올해 |
|
|
71
|
+
| `selectable?` | `[string, string]` | — | 선택 가능 범위 [시작, 종료] |
|
|
72
|
+
| `className?` | `string` | — | |
|
|
73
|
+
| `style?` | `CSSProperties` | — | |
|
|
74
|
+
|
|
75
|
+
#### Events
|
|
76
|
+
|
|
77
|
+
| Event | Type | Description |
|
|
78
|
+
|-------|------|-------------|
|
|
79
|
+
| `onValueChange` | `(year: string) => void` | |
|
|
80
|
+
|
|
81
|
+
## Types
|
|
82
|
+
|
|
83
|
+
### SDatePickerMode
|
|
84
|
+
|
|
85
|
+
```ts
|
|
86
|
+
export type SDatePickerMode = 'date' | 'month' | 'year';
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### SDatePickerSize
|
|
90
|
+
|
|
91
|
+
```ts
|
|
92
|
+
export type SDatePickerSize = SFieldSize;
|
|
93
|
+
```
|
|
94
|
+
|
|
41
95
|
## Dependencies
|
|
42
96
|
|
|
43
97
|
### Used by
|
|
@@ -49,6 +103,7 @@
|
|
|
49
103
|
|
|
50
104
|
- [SCalendar](../SCalendar)
|
|
51
105
|
- [SField](../SField)
|
|
106
|
+
- [SGhostButton](../SGhostButton)
|
|
52
107
|
- [SIcon](../SIcon)
|
|
53
108
|
|
|
54
109
|
### Graph
|
|
@@ -57,6 +112,7 @@
|
|
|
57
112
|
graph TD;
|
|
58
113
|
SDatePicker --> SCalendar
|
|
59
114
|
SDatePicker --> SField
|
|
115
|
+
SDatePicker --> SGhostButton
|
|
60
116
|
SDatePicker --> SIcon
|
|
61
117
|
SChipFilter --> SDatePicker
|
|
62
118
|
SKeyValueTable --> SDatePicker
|
|
@@ -4,23 +4,49 @@ import { type SIconName } from '../SIcon';
|
|
|
4
4
|
import { type SColor } from '../../lib/color';
|
|
5
5
|
import { type Rule } from '../../lib/form';
|
|
6
6
|
import { type STooltipProps } from '../STooltip';
|
|
7
|
+
import { type SFieldWidth } from '../../lib/field-width';
|
|
7
8
|
export type SDatePickerSize = SFieldSize;
|
|
9
|
+
export type SDatePickerMode = 'date' | 'month' | 'year';
|
|
8
10
|
export interface SDatePickerProps {
|
|
9
|
-
/** 선택
|
|
11
|
+
/** 선택 값 (date: YYYY-MM-DD, month: YYYY-MM, year: YYYY) */
|
|
10
12
|
value?: string | null;
|
|
11
|
-
/** 선택 변경 (sdUpdate) */
|
|
12
|
-
onValueChange?: (
|
|
13
|
+
/** 선택 변경 (sdUpdate). `clearable` 로 지우면 `null` 이 온다 */
|
|
14
|
+
onValueChange?: (value: string | null) => void;
|
|
13
15
|
/** 보이는 연·월 변경 (sdViewChange) */
|
|
14
16
|
onViewChange?: (view: {
|
|
15
17
|
year: number;
|
|
16
18
|
month: number;
|
|
17
19
|
}) => void;
|
|
20
|
+
/** 선택 모드 */
|
|
21
|
+
mode?: SDatePickerMode;
|
|
18
22
|
size?: SDatePickerSize;
|
|
19
23
|
placeholder?: string;
|
|
20
24
|
/** 선택 가능 범위 [시작, 종료] */
|
|
21
25
|
selectable?: [string, string];
|
|
22
26
|
disabled?: boolean;
|
|
23
|
-
|
|
27
|
+
/**
|
|
28
|
+
* 선택값 지우기 버튼. 값이 있을 때만 나타나고, 누르면 `onValueChange` 로 `null` 이 온다.
|
|
29
|
+
*
|
|
30
|
+
* **필수 입력 필드에는 켜지 않는다** — 지우면 다시 고르기 전까지 폼이 통과하지 못한다.
|
|
31
|
+
* `STimePicker` · `STimeRangePicker` · `SSelect` 의 `clearable` 과 같은 규칙이다.
|
|
32
|
+
*/
|
|
33
|
+
clearable?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* 컨트롤 너비 — 폭 등급(`'xs' | 'sm' | 'md' | 'lg' | 'xl'`) · 숫자=px · CSS 길이.
|
|
36
|
+
* 등급은 `--cmp-field-width-*` 토큰으로 풀리므로 토큰이 바뀌면 화면이 따라간다.
|
|
37
|
+
* 값 길이에 상한이 없으면 `"100%"` 로 두어 행 전체를 쓴다.
|
|
38
|
+
*/
|
|
39
|
+
width?: SFieldWidth;
|
|
40
|
+
/**
|
|
41
|
+
* 컨트롤 최대 너비 — 폭 등급 · 숫자=px · CSS 길이. 지정하지 않으면 값 길이(`YYYY-MM-DD`)에 맞춘
|
|
42
|
+
* 내장 상한(`size='md'` → `lg`, `'sm'` → `md`)이 걸려, `width="100%"` 를 받아도 행 전체로
|
|
43
|
+
* 늘어나지 않는다.
|
|
44
|
+
*
|
|
45
|
+
* 팝오버처럼 폭이 이미 좁게 정해진 자리에서 그 폭을 그대로 채워야 하면 `width="100%"` 와 함께
|
|
46
|
+
* `maxWidth="100%"` 를 준다. `0` 은 상한을 아예 걸지 않는다 — 부모보다 넓어지는 것까지 허용해야
|
|
47
|
+
* 할 때만 쓴다.
|
|
48
|
+
*/
|
|
49
|
+
maxWidth?: SFieldWidth;
|
|
24
50
|
name?: string;
|
|
25
51
|
rules?: Rule[];
|
|
26
52
|
status?: SFieldStatus;
|
|
@@ -38,5 +64,35 @@ export interface SDatePickerProps {
|
|
|
38
64
|
className?: string;
|
|
39
65
|
style?: CSSProperties;
|
|
40
66
|
}
|
|
67
|
+
export interface SDatePickerYearListboxProps {
|
|
68
|
+
/** 선택 연도 (YYYY) */
|
|
69
|
+
value?: string | null;
|
|
70
|
+
/** 리스트가 처음 열릴 때 중앙에 둘 연도. 기본값은 올해 */
|
|
71
|
+
anchorYear?: number;
|
|
72
|
+
/** 선택 가능 범위 [시작, 종료] */
|
|
73
|
+
selectable?: [string, string];
|
|
74
|
+
onValueChange?: (year: string) => void;
|
|
75
|
+
className?: string;
|
|
76
|
+
style?: CSSProperties;
|
|
77
|
+
}
|
|
78
|
+
/** SDatePickerYearListbox — SDatePicker의 연도 선택 listbox 조각.
|
|
79
|
+
* 자체 트리거/팝오버 없이 연도 리스트만 필요한 커스텀 조합에 재사용한다. */
|
|
80
|
+
export declare function SDatePickerYearListbox({ value, anchorYear, selectable, onValueChange, className, style, }: SDatePickerYearListboxProps): import("react").JSX.Element;
|
|
81
|
+
export interface SDatePickerMonthListboxProps {
|
|
82
|
+
/** 선택 월 (YYYY-MM) */
|
|
83
|
+
value?: string | null;
|
|
84
|
+
/** 연도 리스트가 처음 열릴 때 중앙에 둘 연도. 기본값은 올해 */
|
|
85
|
+
anchorYear?: number;
|
|
86
|
+
/** 선택 가능 범위 [시작, 종료] */
|
|
87
|
+
selectable?: [string, string];
|
|
88
|
+
onValueChange?: (value: string) => void;
|
|
89
|
+
/** 월 컬럼에서 월을 선택했을 때 호출 */
|
|
90
|
+
onMonthSelect?: (value: string) => void;
|
|
91
|
+
className?: string;
|
|
92
|
+
style?: CSSProperties;
|
|
93
|
+
}
|
|
94
|
+
/** SDatePickerMonthListbox — SDatePicker의 월 선택 listbox 조각.
|
|
95
|
+
* 자체 트리거/팝오버 없이 연도+월 리스트만 필요한 커스텀 조합에 재사용한다. */
|
|
96
|
+
export declare function SDatePickerMonthListbox({ value, anchorYear, selectable, onValueChange, onMonthSelect, className, style, }: SDatePickerMonthListboxProps): import("react").JSX.Element;
|
|
41
97
|
/** SDatePicker — sd-date-picker 포팅. SField + SPopover(SCalendar). */
|
|
42
|
-
export declare function SDatePicker({ value, onValueChange, onViewChange, size, placeholder, selectable, disabled, width, name, rules, status, label, labelWidth, icon, iconColor, labelTooltip, labelTooltipProps, addonLabel, addonAlign, hint, error, errorMessage, className, style, }: SDatePickerProps): import("react").JSX.Element;
|
|
98
|
+
export declare function SDatePicker({ value, onValueChange, onViewChange, mode, size, placeholder, selectable, disabled, clearable, width, maxWidth, name, rules, status, label, labelWidth, icon, iconColor, labelTooltip, labelTooltipProps, addonLabel, addonAlign, hint, error, errorMessage, className, style, }: SDatePickerProps): import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { SDatePicker, type SDatePickerProps, type SDatePickerSize } from './SDatePicker';
|
|
1
|
+
export { SDatePicker, SDatePickerMonthListbox, SDatePickerYearListbox, type SDatePickerMode, type SDatePickerMonthListboxProps, type SDatePickerProps, type SDatePickerSize, type SDatePickerYearListboxProps, } from './SDatePicker';
|
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
| `maxRange?` | `number` | — | 최대 선택 일수 |
|
|
16
16
|
| `useTimePicker?` | `boolean` | `false` | 시간(시:분) 선택 푸터 사용 여부. true이면 value는 "YYYY-MM-DD HH:mm" 형식이 되고, 캘린더 하단에 시작·종료 시간 입력이 표시된다. |
|
|
17
17
|
| `disabled?` | `boolean` | `false` | |
|
|
18
|
-
| `
|
|
18
|
+
| `clearable?` | `boolean` | `false` | 선택값 지우기 버튼. 값이 있을 때만 나타나고, 누르면 `onValueChange` 로 `null` 이 온다. **필수 입력 필드에는 켜지 않는다** — 지우면 다시 고르기 전까지 폼이 통과하지 못한다. `SDatePicker` · `STimePicker` · `SSelect` 의 `clearable` 과 같은 규칙이다. |
|
|
19
|
+
| `width?` | `SFieldWidth` | — | 컨트롤 너비 — 폭 등급(`'xs' | 'sm' | 'md' | 'lg' | 'xl'`) · 숫자=px · CSS 길이. 등급은 `--cmp-field-width-*` 토큰으로 풀리므로 토큰이 바뀌면 화면이 따라간다. 값 길이에 상한이 없으면 `"100%"` 로 두어 행 전체를 쓴다. |
|
|
19
20
|
| `name?` | `string` | — | |
|
|
20
21
|
| `rules?` | `Rule[]` | — | |
|
|
21
22
|
| `status?` | `SFieldStatus` | — | |
|
|
@@ -37,7 +38,7 @@
|
|
|
37
38
|
|
|
38
39
|
| Event | Type | Description |
|
|
39
40
|
|-------|------|-------------|
|
|
40
|
-
| `onValueChange` | `(range: SDateRangeValue) => void` | 선택 변경 (sdUpdate) — [start, end] |
|
|
41
|
+
| `onValueChange` | `(range: SDateRangeValue) => void` | 선택 변경 (sdUpdate) — [start, end]. `clearable` 로 지우면 `null` 이 온다 |
|
|
41
42
|
| `onViewChange` | `(view: { year: number; month: number }) => void` | 보이는 연·월 변경 (sdViewChange) |
|
|
42
43
|
|
|
43
44
|
### SRangeCalendar
|
|
@@ -59,6 +60,20 @@
|
|
|
59
60
|
| `onPendingStartChange` | `(start: string \| null) => void` | 시작일만 선택된(종료일 대기) 상태를 상위로 전달 — 트리거에 `start ~` 프리뷰 표시용 |
|
|
60
61
|
| `onViewChange` | `(view: { year: number; month: number }) => void` | |
|
|
61
62
|
|
|
63
|
+
## Types
|
|
64
|
+
|
|
65
|
+
### SDateRangeValue
|
|
66
|
+
|
|
67
|
+
```ts
|
|
68
|
+
export type SDateRangeValue = [string, string] | null;
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### SDateRangePickerSize
|
|
72
|
+
|
|
73
|
+
```ts
|
|
74
|
+
export type SDateRangePickerSize = SFieldSize;
|
|
75
|
+
```
|
|
76
|
+
|
|
62
77
|
## Dependencies
|
|
63
78
|
|
|
64
79
|
### Used by
|
|
@@ -4,11 +4,12 @@ import { type SIconName } from '../SIcon';
|
|
|
4
4
|
import { type SColor } from '../../lib/color';
|
|
5
5
|
import { type Rule } from '../../lib/form';
|
|
6
6
|
import { type STooltipProps } from '../STooltip';
|
|
7
|
+
import { type SFieldWidth } from '../../lib/field-width';
|
|
7
8
|
export type SDateRangeValue = [string, string] | null;
|
|
8
9
|
export type SDateRangePickerSize = SFieldSize;
|
|
9
10
|
export interface SDateRangePickerProps {
|
|
10
11
|
value?: SDateRangeValue;
|
|
11
|
-
/** 선택 변경 (sdUpdate) — [start, end] */
|
|
12
|
+
/** 선택 변경 (sdUpdate) — [start, end]. `clearable` 로 지우면 `null` 이 온다 */
|
|
12
13
|
onValueChange?: (range: SDateRangeValue) => void;
|
|
13
14
|
/** 보이는 연·월 변경 (sdViewChange) */
|
|
14
15
|
onViewChange?: (view: {
|
|
@@ -26,7 +27,19 @@ export interface SDateRangePickerProps {
|
|
|
26
27
|
*/
|
|
27
28
|
useTimePicker?: boolean;
|
|
28
29
|
disabled?: boolean;
|
|
29
|
-
|
|
30
|
+
/**
|
|
31
|
+
* 선택값 지우기 버튼. 값이 있을 때만 나타나고, 누르면 `onValueChange` 로 `null` 이 온다.
|
|
32
|
+
*
|
|
33
|
+
* **필수 입력 필드에는 켜지 않는다** — 지우면 다시 고르기 전까지 폼이 통과하지 못한다.
|
|
34
|
+
* `SDatePicker` · `STimePicker` · `SSelect` 의 `clearable` 과 같은 규칙이다.
|
|
35
|
+
*/
|
|
36
|
+
clearable?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* 컨트롤 너비 — 폭 등급(`'xs' | 'sm' | 'md' | 'lg' | 'xl'`) · 숫자=px · CSS 길이.
|
|
39
|
+
* 등급은 `--cmp-field-width-*` 토큰으로 풀리므로 토큰이 바뀌면 화면이 따라간다.
|
|
40
|
+
* 값 길이에 상한이 없으면 `"100%"` 로 두어 행 전체를 쓴다.
|
|
41
|
+
*/
|
|
42
|
+
width?: SFieldWidth;
|
|
30
43
|
name?: string;
|
|
31
44
|
rules?: Rule[];
|
|
32
45
|
status?: SFieldStatus;
|
|
@@ -61,4 +74,4 @@ export interface SRangeCalendarProps {
|
|
|
61
74
|
* 캘린더 그리드만 필요한 커스텀 조합(예: 다른 트리거에 팝오버로 얹는 경우)에 재사용한다. */
|
|
62
75
|
export declare function RangeCalendar({ value, selectable, maxRange, useTimePicker, onSelect, onPendingStartChange, onViewChange, }: SRangeCalendarProps): import("react").JSX.Element;
|
|
63
76
|
/** SDateRangePicker — sd-date-range-picker 포팅. SField + SPopover(범위 캘린더). */
|
|
64
|
-
export declare function SDateRangePicker({ value, onValueChange, onViewChange, size, placeholder, selectable, maxRange, useTimePicker, disabled, width, name, rules, status, label, labelWidth, icon, iconColor, labelTooltip, labelTooltipProps, addonLabel, addonAlign, hint, error, errorMessage, className, style, }: SDateRangePickerProps): import("react").JSX.Element;
|
|
77
|
+
export declare function SDateRangePicker({ value, onValueChange, onViewChange, size, placeholder, selectable, maxRange, useTimePicker, disabled, clearable, width, name, rules, status, label, labelWidth, icon, iconColor, labelTooltip, labelTooltipProps, addonLabel, addonAlign, hint, error, errorMessage, className, style, }: SDateRangePickerProps): import("react").JSX.Element;
|
|
@@ -16,6 +16,8 @@
|
|
|
16
16
|
|
|
17
17
|
- [SCalendar](../SCalendar)
|
|
18
18
|
- [SDateRangePicker](../SDateRangePicker)
|
|
19
|
+
- [SList](../SList)
|
|
20
|
+
- [STable](../STable)
|
|
19
21
|
- [STableBar](../STableBar)
|
|
20
22
|
|
|
21
23
|
### Graph
|
|
@@ -24,6 +26,8 @@
|
|
|
24
26
|
graph TD;
|
|
25
27
|
SCalendar --> SDivider
|
|
26
28
|
SDateRangePicker --> SDivider
|
|
29
|
+
SList --> SDivider
|
|
30
|
+
STable --> SDivider
|
|
27
31
|
STableBar --> SDivider
|
|
28
32
|
style SDivider fill:#f9f,stroke:#333,stroke-width:4px
|
|
29
33
|
```
|