@uniai-fe/uds-primitives 0.12.12 → 0.12.14
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniai-fe/uds-primitives",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.14",
|
|
4
4
|
"description": "UNIAI Design System; Primitives Components Package",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"private": false,
|
|
@@ -88,10 +88,10 @@
|
|
|
88
88
|
"sass": "^1.102.0",
|
|
89
89
|
"typescript": "6.0.3",
|
|
90
90
|
"@uniai-fe/eslint-config": "0.4.4",
|
|
91
|
-
"@uniai-fe/util-functions": "0.4.3",
|
|
92
|
-
"@uniai-fe/tsconfig": "0.2.0",
|
|
93
91
|
"@uniai-fe/next-devkit": "0.4.1",
|
|
94
|
-
"@uniai-fe/
|
|
92
|
+
"@uniai-fe/tsconfig": "0.2.0",
|
|
93
|
+
"@uniai-fe/uds-foundation": "0.6.0",
|
|
94
|
+
"@uniai-fe/util-functions": "0.4.3"
|
|
95
95
|
},
|
|
96
96
|
"scripts": {
|
|
97
97
|
"check:pre-commit": "pnpm --dir ../../.. run check:pre-commit",
|
|
@@ -187,6 +187,13 @@ export function SelectDefault<OptionData = unknown>({
|
|
|
187
187
|
const shouldForceCustomFromInput = Boolean(
|
|
188
188
|
customOptions && !selectedOption && forcedCustomLabelValue,
|
|
189
189
|
);
|
|
190
|
+
// 명시된 외부 선택을 우선하고, 복원된 직접입력은 값을 비워도 입력창과 포커스를 유지한다.
|
|
191
|
+
if (shouldForceCustomFromInput && selectedValueFromItems === undefined) {
|
|
192
|
+
setSelectionState(previousState => ({
|
|
193
|
+
...previousState,
|
|
194
|
+
selectedValue: SELECT_CUSTOM_OPTION_VALUE,
|
|
195
|
+
}));
|
|
196
|
+
}
|
|
190
197
|
const resolvedSelectedOption = useMemo(
|
|
191
198
|
() =>
|
|
192
199
|
shouldForceCustomFromInput
|
|
@@ -319,11 +326,10 @@ export function SelectDefault<OptionData = unknown>({
|
|
|
319
326
|
setOpen(false);
|
|
320
327
|
};
|
|
321
328
|
|
|
322
|
-
// 16)
|
|
329
|
+
// 16) 명시된 native value는 빈 문자열과 0도 controlled 값으로 사용하고, undefined일 때만 내부 입력값을 유지한다.
|
|
323
330
|
const labelInputValue = isCustomInputActive
|
|
324
|
-
?
|
|
325
|
-
|
|
326
|
-
? String(inputProps.value) || customInputState.value
|
|
331
|
+
? inputProps?.value !== undefined
|
|
332
|
+
? String(inputProps.value)
|
|
327
333
|
: customInputState.value
|
|
328
334
|
: toSelectInputText(resolvedDisplayLabel);
|
|
329
335
|
|
|
@@ -144,9 +144,18 @@ export interface SelectCustomOptions {
|
|
|
144
144
|
|
|
145
145
|
/**
|
|
146
146
|
* Select custom input props
|
|
147
|
-
* @property {
|
|
147
|
+
* @property {string | number | readonly string[]} [value] 빈 문자열과 0을 포함한 controlled 표시값; undefined면 내부 입력값 유지
|
|
148
|
+
* @property {never} [placeholder] customOptions.placeholder를 사용하므로 전달 불가
|
|
149
|
+
* @desc label input native 속성에서 placeholder를 제외한 직접입력 계약
|
|
148
150
|
*/
|
|
149
151
|
export interface SelectCustomInputProps extends ComponentPropsWithoutRef<"input"> {
|
|
152
|
+
/**
|
|
153
|
+
* 빈 문자열과 0을 포함한 controlled 표시값; undefined면 내부 입력값 유지
|
|
154
|
+
*/
|
|
155
|
+
value?: string | number | readonly string[];
|
|
156
|
+
/**
|
|
157
|
+
* customOptions.placeholder를 사용하므로 전달 불가
|
|
158
|
+
*/
|
|
150
159
|
placeholder?: never;
|
|
151
160
|
}
|
|
152
161
|
|