pds-dev-kit-web-test 2.5.199 → 2.5.200
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/src/common/assets/icons/fill/BringForward.d.ts +4 -0
- package/dist/src/common/assets/icons/fill/BringForward.js +30 -0
- package/dist/src/common/assets/icons/fill/BringToFront.d.ts +4 -0
- package/dist/src/common/assets/icons/fill/BringToFront.js +30 -0
- package/dist/src/common/assets/icons/fill/CheckboxIndeterminate.js +1 -1
- package/dist/src/common/assets/icons/fill/CheckboxOn.js +1 -1
- package/dist/src/common/assets/icons/fill/CloudDownload.js +1 -1
- package/dist/src/common/assets/icons/fill/Cut.d.ts +4 -0
- package/dist/src/common/assets/icons/fill/Cut.js +30 -0
- package/dist/src/common/assets/icons/fill/Developer.d.ts +4 -0
- package/dist/src/common/assets/icons/fill/Developer.js +30 -0
- package/dist/src/common/assets/icons/fill/Downloaded.js +1 -1
- package/dist/src/common/assets/icons/fill/Group.d.ts +4 -0
- package/dist/src/common/assets/icons/fill/Group.js +30 -0
- package/dist/src/common/assets/icons/fill/MenuHome.d.ts +4 -0
- package/dist/src/common/assets/icons/fill/MenuHome.js +30 -0
- package/dist/src/common/assets/icons/fill/MoveBackward.d.ts +4 -0
- package/dist/src/common/assets/icons/fill/MoveBackward.js +30 -0
- package/dist/src/common/assets/icons/fill/MoveForward.d.ts +4 -0
- package/dist/src/common/assets/icons/fill/MoveForward.js +30 -0
- package/dist/src/common/assets/icons/fill/Paste.d.ts +4 -0
- package/dist/src/common/assets/icons/fill/Paste.js +30 -0
- package/dist/src/common/assets/icons/fill/PostPost.d.ts +4 -0
- package/dist/src/common/assets/icons/fill/PostPost.js +30 -0
- package/dist/src/common/assets/icons/fill/PostSeries.d.ts +4 -0
- package/dist/src/common/assets/icons/fill/PostSeries.js +30 -0
- package/dist/src/common/assets/icons/fill/SendBackward.d.ts +4 -0
- package/dist/src/common/assets/icons/fill/SendBackward.js +30 -0
- package/dist/src/common/assets/icons/fill/SendToBack.d.ts +4 -0
- package/dist/src/common/assets/icons/fill/SendToBack.js +30 -0
- package/dist/src/common/assets/icons/fill/ToggleDown.js +1 -1
- package/dist/src/common/assets/icons/fill/ToggleUp.js +1 -1
- package/dist/src/common/assets/icons/fill/Ungroup.d.ts +4 -0
- package/dist/src/common/assets/icons/fill/Ungroup.js +30 -0
- package/dist/src/common/assets/icons/fill/VideoEpisode.d.ts +4 -0
- package/dist/src/common/assets/icons/fill/VideoEpisode.js +30 -0
- package/dist/src/common/assets/icons/fill/VideoSeries.d.ts +4 -0
- package/dist/src/common/assets/icons/fill/VideoSeries.js +30 -0
- package/dist/src/common/assets/icons/fill/index.d.ts +16 -0
- package/dist/src/common/assets/icons/fill/index.js +33 -1
- package/dist/src/common/assets/icons/line/BookingCompleted.js +1 -1
- package/dist/src/common/assets/icons/line/BringForward.d.ts +4 -0
- package/dist/src/common/assets/icons/line/BringForward.js +30 -0
- package/dist/src/common/assets/icons/line/BringToFront.d.ts +4 -0
- package/dist/src/common/assets/icons/line/BringToFront.js +30 -0
- package/dist/src/common/assets/icons/line/Cut.d.ts +4 -0
- package/dist/src/common/assets/icons/line/Cut.js +30 -0
- package/dist/src/common/assets/icons/line/Group.d.ts +4 -0
- package/dist/src/common/assets/icons/line/Group.js +30 -0
- package/dist/src/common/assets/icons/line/Heart.d.ts +4 -0
- package/dist/src/common/assets/icons/line/Heart.js +30 -0
- package/dist/src/common/assets/icons/line/MenuHome.d.ts +4 -0
- package/dist/src/common/assets/icons/line/MenuHome.js +30 -0
- package/dist/src/common/assets/icons/line/MoveBackward.d.ts +4 -0
- package/dist/src/common/assets/icons/line/MoveBackward.js +30 -0
- package/dist/src/common/assets/icons/line/MoveForward.d.ts +4 -0
- package/dist/src/common/assets/icons/line/MoveForward.js +30 -0
- package/dist/src/common/assets/icons/line/PageCollapse.d.ts +4 -0
- package/dist/src/common/assets/icons/line/PageCollapse.js +30 -0
- package/dist/src/common/assets/icons/line/Paste.d.ts +4 -0
- package/dist/src/common/assets/icons/line/Paste.js +30 -0
- package/dist/src/common/assets/icons/line/PostPost.d.ts +4 -0
- package/dist/src/common/assets/icons/line/PostPost.js +30 -0
- package/dist/src/common/assets/icons/line/PostSeries.d.ts +4 -0
- package/dist/src/common/assets/icons/line/PostSeries.js +31 -0
- package/dist/src/common/assets/icons/line/SendBackward.d.ts +4 -0
- package/dist/src/common/assets/icons/line/SendBackward.js +30 -0
- package/dist/src/common/assets/icons/line/SendToBack.d.ts +4 -0
- package/dist/src/common/assets/icons/line/SendToBack.js +30 -0
- package/dist/src/common/assets/icons/line/Ungroup.d.ts +4 -0
- package/dist/src/common/assets/icons/line/Ungroup.js +30 -0
- package/dist/src/common/assets/icons/line/VideoEpisode.d.ts +4 -0
- package/dist/src/common/assets/icons/line/VideoEpisode.js +30 -0
- package/dist/src/common/assets/icons/line/VideoSeries.d.ts +4 -0
- package/dist/src/common/assets/icons/line/VideoSeries.js +30 -0
- package/dist/src/common/assets/icons/line/index.d.ts +17 -0
- package/dist/src/common/assets/icons/line/index.js +35 -1
- package/dist/src/common/styles/colorSet/PaletteColor_Dark.json +6 -1
- package/dist/src/common/styles/colorSet/PaletteColor_light.json +6 -1
- package/dist/src/common/styles/colorSet/SemanticColor.json +4 -2
- package/dist/src/common/styles/colorSet/UIColor.json +13 -2
- package/dist/src/common/styles/colorSet/index.d.ts +25 -2
- package/dist/src/common/styles/colorSet/index.js +2 -2
- package/dist/src/common/styles/colorSet/ui-type.d.ts +11 -0
- package/dist/src/common/types/components.d.ts +5 -0
- package/dist/src/common/types/form.d.ts +6 -0
- package/dist/src/common/types/form.js +8 -0
- package/dist/src/desktop/common/components/TextFieldBase/TextFieldBase.d.ts +3 -2
- package/dist/src/desktop/common/components/TextFieldBase/TextFieldBase.js +33 -4
- package/dist/src/desktop/components/BasicButtonGroup/BasicButtonGroup.js +7 -7
- package/dist/src/desktop/components/DesktopAlertDialog/DesktopAlertDialog.js +9 -10
- package/dist/src/desktop/components/DesktopTabBar/DesktopTabBar.js +14 -8
- package/dist/src/desktop/components/Dropdown/Dropdown.js +14 -6
- package/dist/src/desktop/components/DynamicDesktopNavBar/DynamicDesktopNavBar.d.ts +1 -0
- package/dist/src/desktop/components/DynamicDesktopNavBar/DynamicDesktopNavBar.js +1 -1
- package/dist/src/desktop/components/DynamicDesktopNavBar/blocks/UserProfile.d.ts +1 -0
- package/dist/src/desktop/components/DynamicDesktopNavBar/blocks/UserProfile.js +2 -2
- package/dist/src/desktop/components/SegmentedButtonGroup/SegmentedButtonGroup.js +8 -6
- package/dist/src/desktop/components/Select/Select.d.ts +7 -2
- package/dist/src/desktop/components/Select/Select.js +90 -27
- package/dist/src/desktop/components/TextButton/TextButton.js +5 -5
- package/dist/src/desktop/components/TextField/TextField.d.ts +3 -28
- package/dist/src/desktop/components/TextField/TextField.js +5 -7
- package/dist/src/desktop/components/TextLabel/TextLabel.d.ts +1 -0
- package/dist/src/desktop/components/TextLabel/TextLabel.js +6 -3
- package/dist/src/desktop/layout/LayoutWS/Containers/ContentsContainer/variation/WSJ.js +2 -2
- package/dist/src/hybrid/components/Switch/Switch.d.ts +3 -1
- package/dist/src/hybrid/components/Switch/Switch.js +11 -5
- package/dist/src/mobile/common/components/TextFieldBase/TextFieldBase.d.ts +3 -2
- package/dist/src/mobile/common/components/TextFieldBase/TextFieldBase.js +33 -4
- package/dist/src/mobile/components/BasicButtonGroup/BasicButtonGroup.js +6 -4
- package/dist/src/mobile/components/Dropdown/Dropdown.js +14 -6
- package/dist/src/mobile/components/SegmentedButtonGroup/SegmentedButtonGroup.js +8 -6
- package/dist/src/mobile/components/Select/Select.d.ts +7 -2
- package/dist/src/mobile/components/Select/Select.js +87 -20
- package/dist/src/mobile/components/TextField/TextField.d.ts +3 -28
- package/dist/src/mobile/components/TextField/TextField.js +5 -7
- package/dist/src/sub/AdminList/ToolBar/SearchField.js +2 -2
- package/dist/src/sub/DynamicLayout/CompositionRenderer/ComponentBlockMatcher.d.ts +1 -1
- package/dist/src/sub/DynamicLayout/CompositionRenderer/ComponentBlockMatcher.js +1 -1
- package/dist/src/sub/DynamicLayout/DynamicLayout.d.ts +1 -1
- package/dist/src/sub/DynamicLayout/DynamicLayout.js +3 -2
- package/dist/src/sub/DynamicLayout/components/pdsOriginal/common/assets/icons/fill/CheckboxIndeterminate.js +1 -1
- package/dist/src/sub/DynamicLayout/components/pdsOriginal/common/assets/icons/fill/CheckboxOn.js +1 -1
- package/dist/src/sub/DynamicLayout/components/pdsOriginal/common/assets/icons/fill/CloudDownload.js +1 -1
- package/dist/src/sub/DynamicLayout/components/pdsOriginal/common/assets/icons/fill/Downloaded.js +1 -1
- package/dist/src/sub/DynamicLayout/components/pdsOriginal/common/assets/icons/line/BookingCompleted.js +1 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/CustomSection.js +4 -10
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/ComponentBlockMatcher.d.ts +1 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/ComponentBlockMatcher.js +1 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Embed/IframeDenied.js +1 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/newUtils/clsx.js +3 -2
- package/dist/src/sub/DynamicLayout/types.d.ts +1 -0
- package/package.json +6 -7
- package/release-note.md +2 -2
@@ -61,7 +61,7 @@ var common_1 = require("../../../../common");
|
|
61
61
|
var IconButton_1 = require("../../../components/IconButton");
|
62
62
|
var constants_1 = require("./constants");
|
63
63
|
function TextFieldBase(_a) {
|
64
|
-
var name = _a.name, hintText = _a.hintText, defaultText = _a.defaultText, _b = _a.textAlign, textAlign = _b === void 0 ? 'left' : _b, validation = _a.validation, _c = _a.preventBlankMode, preventBlankMode = _c === void 0 ? 'none' : _c, _d = _a.enterSubmitMode, enterSubmitMode = _d === void 0 ? 'none' : _d, _e = _a.textLineType, textLineType = _e === void 0 ? 'single' : _e, multiRows = _a.multiRows, autoMinRows = _a.autoMinRows, autoMaxRows = _a.autoMaxRows, _f = _a.inputType, inputType = _f === void 0 ? 'text' : _f, _g = _a.state, state = _g === void 0 ? 'normal' : _g, _h = _a.colorTheme, colorTheme = _h === void 0 ? 'none' : _h, min = _a.min, max = _a.max, _j = _a.maxLength, maxLength = _j === void 0 ? Infinity : _j, _k = _a.textSize, textSize = _k === void 0 ? 'form2' : _k, _l = _a.textWeight, textWeight = _l === void 0 ? 'normal' : _l, fieldPaddingRight = _a.fieldPaddingRight, fieldPaddingLeft = _a.fieldPaddingLeft, textPadding = _a.textPadding, _m = _a.fieldHeight, fieldHeight = _m === void 0 ? 48 : _m, _o = _a.deleteIconMode, deleteIconMode = _o === void 0 ? 'use' : _o, _p = _a.deleteIconSize, deleteIconSize = _p === void 0 ? 20 : _p, _q = _a.deleteIconColor, deleteIconColor = _q === void 0 ? 'ui_cpnt_button_icon_disabled' : _q, suffixText = _a.suffixText, _r = _a.suffixTextRightSpacingMode, suffixTextRightSpacingMode = _r === void 0 ? 'none' : _r, isFocused = _a.isFocused, _s = _a.autoComplete, autoComplete = _s === void 0 ? 'on' : _s, _t = _a.stepperMode, stepperMode = _t === void 0 ? 'none' : _t, _u = _a.stepperRightSpacing, stepperRightSpacing = _u === void 0 ? 1 : _u, _v = _a.innerSpinButtonSize, innerSpinButtonSize = _v === void 0 ? 16 : _v, step = _a.step, onBlur = _a.onBlur, onChange = _a.onChange, onFocus = _a.onFocus, onKeyDown = _a.onKeyDown, onKeyUp = _a.onKeyUp, onTarget = _a.onTarget, rest = __rest(_a, ["name", "hintText", "defaultText", "textAlign", "validation", "preventBlankMode", "enterSubmitMode", "textLineType", "multiRows", "autoMinRows", "autoMaxRows", "inputType", "state", "colorTheme", "min", "max", "maxLength", "textSize", "textWeight", "fieldPaddingRight", "fieldPaddingLeft", "textPadding", "fieldHeight", "deleteIconMode", "deleteIconSize", "deleteIconColor", "suffixText", "suffixTextRightSpacingMode", "isFocused", "autoComplete", "stepperMode", "stepperRightSpacing", "innerSpinButtonSize", "step", "onBlur", "onChange", "onFocus", "onKeyDown", "onKeyUp", "onTarget"]);
|
64
|
+
var name = _a.name, hintText = _a.hintText, defaultText = _a.defaultText, _b = _a.textAlign, textAlign = _b === void 0 ? 'left' : _b, validation = _a.validation, _c = _a.preventBlankMode, preventBlankMode = _c === void 0 ? 'none' : _c, _d = _a.enterSubmitMode, enterSubmitMode = _d === void 0 ? 'none' : _d, _e = _a.textLineType, textLineType = _e === void 0 ? 'single' : _e, multiRows = _a.multiRows, autoMinRows = _a.autoMinRows, autoMaxRows = _a.autoMaxRows, _f = _a.inputType, inputType = _f === void 0 ? 'text' : _f, inputMode = _a.inputMode, _g = _a.state, state = _g === void 0 ? 'normal' : _g, _h = _a.colorTheme, colorTheme = _h === void 0 ? 'none' : _h, min = _a.min, max = _a.max, _j = _a.maxLength, maxLength = _j === void 0 ? Infinity : _j, _k = _a.textSize, textSize = _k === void 0 ? 'form2' : _k, _l = _a.textWeight, textWeight = _l === void 0 ? 'normal' : _l, fieldPaddingRight = _a.fieldPaddingRight, fieldPaddingLeft = _a.fieldPaddingLeft, textPadding = _a.textPadding, _m = _a.fieldHeight, fieldHeight = _m === void 0 ? 48 : _m, _o = _a.deleteIconMode, deleteIconMode = _o === void 0 ? 'use' : _o, _p = _a.deleteIconSize, deleteIconSize = _p === void 0 ? 20 : _p, _q = _a.deleteIconColor, deleteIconColor = _q === void 0 ? 'ui_cpnt_button_icon_disabled' : _q, suffixText = _a.suffixText, _r = _a.suffixTextRightSpacingMode, suffixTextRightSpacingMode = _r === void 0 ? 'none' : _r, isFocused = _a.isFocused, _s = _a.autoComplete, autoComplete = _s === void 0 ? 'on' : _s, _t = _a.stepperMode, stepperMode = _t === void 0 ? 'none' : _t, _u = _a.stepperRightSpacing, stepperRightSpacing = _u === void 0 ? 1 : _u, _v = _a.innerSpinButtonSize, innerSpinButtonSize = _v === void 0 ? 16 : _v, step = _a.step, onBlur = _a.onBlur, onChange = _a.onChange, onFocus = _a.onFocus, onKeyDown = _a.onKeyDown, onKeyUp = _a.onKeyUp, onTarget = _a.onTarget, rest = __rest(_a, ["name", "hintText", "defaultText", "textAlign", "validation", "preventBlankMode", "enterSubmitMode", "textLineType", "multiRows", "autoMinRows", "autoMaxRows", "inputType", "inputMode", "state", "colorTheme", "min", "max", "maxLength", "textSize", "textWeight", "fieldPaddingRight", "fieldPaddingLeft", "textPadding", "fieldHeight", "deleteIconMode", "deleteIconSize", "deleteIconColor", "suffixText", "suffixTextRightSpacingMode", "isFocused", "autoComplete", "stepperMode", "stepperRightSpacing", "innerSpinButtonSize", "step", "onBlur", "onChange", "onFocus", "onKeyDown", "onKeyUp", "onTarget"]);
|
65
65
|
var _w = (0, react_hook_form_1.useFormContext)(), register = _w.register, setValue = _w.setValue, getValues = _w.getValues, clearErrors = _w.clearErrors;
|
66
66
|
var timeout;
|
67
67
|
var suffixTextRef = (0, react_1.useRef)(null);
|
@@ -104,6 +104,28 @@ function TextFieldBase(_a) {
|
|
104
104
|
checkMaxLength(e);
|
105
105
|
}
|
106
106
|
}
|
107
|
+
function handleKeyPress(e) {
|
108
|
+
if (textLineType === 'single' && inputType === 'number' && inputMode === 'numeric') {
|
109
|
+
handleNumericKeypress(e);
|
110
|
+
}
|
111
|
+
}
|
112
|
+
/**
|
113
|
+
* 제어키(31 이하) 또는 숫자(0-9)만 입력 허용하는 키보드 이벤트 핸들러
|
114
|
+
* 제어키 예시: Backspace(8), Tab(9), Enter(13)
|
115
|
+
*/
|
116
|
+
var handleNumericKeypress = function (e) {
|
117
|
+
// 제어키(31 이하)는 허용
|
118
|
+
var CONTROL_KEY_CODE = 31;
|
119
|
+
var code = e.which || e.keyCode;
|
120
|
+
if (code <= CONTROL_KEY_CODE) {
|
121
|
+
return;
|
122
|
+
}
|
123
|
+
// 숫자가 아니면 이벤트 중단
|
124
|
+
var char = String.fromCharCode(code);
|
125
|
+
if (!/^\d*$/.test(char)) {
|
126
|
+
e.preventDefault();
|
127
|
+
}
|
128
|
+
};
|
107
129
|
function handleChange(e) {
|
108
130
|
// NOTE: preventBlankMode는 input에만 적용 가능
|
109
131
|
// NOTE: preventBlankMode === 'all'일 경우에는 무조건 onChange 시점에 적용
|
@@ -113,6 +135,13 @@ function TextFieldBase(_a) {
|
|
113
135
|
e.target.value = value.replace(/ /g, '');
|
114
136
|
}
|
115
137
|
}
|
138
|
+
// 숫자만 필터링
|
139
|
+
if (textLineType === 'single' && inputType === 'number' && inputMode === 'numeric') {
|
140
|
+
var value = e.target.value;
|
141
|
+
if (!/^\d*$/.test(value)) {
|
142
|
+
e.target.value = value.replace(/\D/g, '');
|
143
|
+
}
|
144
|
+
}
|
116
145
|
if (onChange) {
|
117
146
|
onChange(e);
|
118
147
|
}
|
@@ -197,13 +226,13 @@ function TextFieldBase(_a) {
|
|
197
226
|
}
|
198
227
|
var S_TextFieldBase = function () {
|
199
228
|
if (textLineType === 'single') {
|
200
|
-
return ((0, jsx_runtime_1.jsxs)(S_InputWrapper, { children: [stepperMode === 'use' && ((0, jsx_runtime_1.jsxs)(S_IconBox, __assign({ innerSpinButtonSize: innerSpinButtonSize, isFocused: isFocused, stepperRightSpacing: stepperRightSpacing }, { children: [(0, jsx_runtime_1.jsx)(components_2.Icon, { iconName: "ic_arrow_up_stepper", fillType: "fill", size: innerSpinButtonSize }), (0, jsx_runtime_1.jsx)(components_2.Icon, { iconName: "ic_arrow_down_stepper", fillType: "fill", size: innerSpinButtonSize })] }))), (0, jsx_runtime_1.jsx)(S_Input, __assign({}, register(name, validation), rest, { name: name, defaultValue: defaultText, placeholder: hintText, textAlign: textAlign, type: inputType, state: state, readOnly: state === 'read_only', disabled: state === 'disabled', maxLength: maxLength, textSize: textSize, textWeight: textWeight, fieldPaddingRight: fieldPaddingRight, fieldPaddingLeft: fieldPaddingLeft, colorTheme: colorTheme, min: min, max: max, autoComplete: autoComplete, stepperMode: stepperMode, innerSpinButtonSize: innerSpinButtonSize, step: step, deleteIconMode: deleteIconMode, suffixText: suffixText, suffixTextWidth: suffixTextWidth, stepperRightSpacing: stepperRightSpacing, isFocused: isFocused, onFocus: handleFocus, onChange: handleChange, onBlur: handleBlur, onKeyDown: handleKeyDown, onKeyUp: handleKeyUp, ref: ref })), (deleteIconMode === 'use' || suffixText) && ((0, jsx_runtime_1.jsxs)(S_RightBox, __assign({ deleteIconMode: deleteIconMode, stepperMode: stepperMode, suffixText: suffixText, innerSpinButtonSize: innerSpinButtonSize }, { children: [deleteIconMode === 'use' && ((0, jsx_runtime_1.jsx)(S_IconButtonWrapper, __assign({ innerSpinButtonSize: innerSpinButtonSize, deleteIconMode: deleteIconMode, stepperMode: stepperMode, suffixText: suffixText, isFocused: isFocused, suffixTextWidth: suffixTextWidth, stepperRightSpacing: stepperRightSpacing }, { children: isFocused && ((0, jsx_runtime_1.jsx)(IconButton_1.IconButton, { iconName: "ic_delete", baseSize: "small", shapeType: "rectangle", baseColorKey: "ui_cpnt_button_fill_base_transparent", iconSize: deleteIconSize, iconColorKey: deleteIconColor, iconFillType: "fill", state: state === 'disabled' ? 'disabled' : 'normal', tabIndex: -1, onMouseDown: deleteValue })) }))), suffixText && ((0, jsx_runtime_1.jsxs)(S_SuffixTextBox, __assign({ ref: suffixTextRef }, { children: [(0, jsx_runtime_1.jsx)(components_2.Spacing, { size: "spacing_b", spacingType: "width" }), (0, jsx_runtime_1.jsx)(components_1.TextLabel, { text: suffixText, styleTheme: "caption1Bold", colorTheme: "sysTextTertiary", colorOverride: stepperMode === 'use' && isFocused ? 'ui_106' : undefined, textAlign: "right", singleLineMode: "use" }), suffixTextRightSpacingMode === 'use' && ((0, jsx_runtime_1.jsx)(components_2.Spacing, { size: "spacing_b", spacingType: "width" }))] })))] })))] }));
|
229
|
+
return ((0, jsx_runtime_1.jsxs)(S_InputWrapper, { children: [stepperMode === 'use' && ((0, jsx_runtime_1.jsxs)(S_IconBox, __assign({ innerSpinButtonSize: innerSpinButtonSize, isFocused: isFocused, stepperRightSpacing: stepperRightSpacing }, { children: [(0, jsx_runtime_1.jsx)(components_2.Icon, { iconName: "ic_arrow_up_stepper", fillType: "fill", size: innerSpinButtonSize }), (0, jsx_runtime_1.jsx)(components_2.Icon, { iconName: "ic_arrow_down_stepper", fillType: "fill", size: innerSpinButtonSize })] }))), (0, jsx_runtime_1.jsx)(S_Input, __assign({}, register(name, validation), rest, { name: name, defaultValue: defaultText, placeholder: hintText, textAlign: textAlign, type: inputType, inputMode: inputMode, state: state, readOnly: state === 'read_only', disabled: state === 'disabled', maxLength: maxLength, textSize: textSize, textWeight: textWeight, fieldPaddingRight: fieldPaddingRight, fieldPaddingLeft: fieldPaddingLeft, colorTheme: colorTheme, min: min, max: max, autoComplete: autoComplete, stepperMode: stepperMode, innerSpinButtonSize: innerSpinButtonSize, step: step, deleteIconMode: deleteIconMode, suffixText: suffixText, suffixTextWidth: suffixTextWidth, stepperRightSpacing: stepperRightSpacing, isFocused: isFocused, onFocus: handleFocus, onChange: handleChange, onBlur: handleBlur, onKeyDown: handleKeyDown, onKeyUp: handleKeyUp, onKeyPress: handleKeyPress, ref: ref })), (deleteIconMode === 'use' || suffixText) && ((0, jsx_runtime_1.jsxs)(S_RightBox, __assign({ deleteIconMode: deleteIconMode, stepperMode: stepperMode, suffixText: suffixText, innerSpinButtonSize: innerSpinButtonSize }, { children: [deleteIconMode === 'use' && ((0, jsx_runtime_1.jsx)(S_IconButtonWrapper, __assign({ innerSpinButtonSize: innerSpinButtonSize, deleteIconMode: deleteIconMode, stepperMode: stepperMode, suffixText: suffixText, isFocused: isFocused, suffixTextWidth: suffixTextWidth, stepperRightSpacing: stepperRightSpacing }, { children: isFocused && ((0, jsx_runtime_1.jsx)(IconButton_1.IconButton, { iconName: "ic_delete", baseSize: "small", shapeType: "rectangle", baseColorKey: "ui_cpnt_button_fill_base_transparent", iconSize: deleteIconSize, iconColorKey: deleteIconColor, iconFillType: "fill", state: state === 'disabled' ? 'disabled' : 'normal', tabIndex: -1, onMouseDown: deleteValue })) }))), suffixText && ((0, jsx_runtime_1.jsxs)(S_SuffixTextBox, __assign({ ref: suffixTextRef }, { children: [(0, jsx_runtime_1.jsx)(components_2.Spacing, { size: "spacing_b", spacingType: "width" }), (0, jsx_runtime_1.jsx)(components_1.TextLabel, { text: suffixText, styleTheme: "caption1Bold", colorTheme: "sysTextTertiary", colorOverride: stepperMode === 'use' && isFocused ? 'ui_106' : undefined, textAlign: "right", singleLineMode: "use" }), suffixTextRightSpacingMode === 'use' && ((0, jsx_runtime_1.jsx)(components_2.Spacing, { size: "spacing_b", spacingType: "width" }))] })))] })))] }));
|
201
230
|
}
|
202
231
|
if (textLineType === 'multi') {
|
203
|
-
return ((0, jsx_runtime_1.jsx)(S_Multi, __assign({}, register(name, validation), rest, { name: name, defaultValue: defaultText, placeholder: hintText, textAlign: textAlign, state: state, readOnly: state === 'read_only' && true, disabled: state === 'disabled' && true, maxLength: maxLength, rows: multiRows, textSize: textSize, textWeight: textWeight, fieldPaddingRight: fieldPaddingRight, fieldPaddingLeft: fieldPaddingLeft, textPadding: textPadding, colorTheme: colorTheme, autoComplete: autoComplete, onFocus: handleFocus, onChange: handleChange, onBlur: handleBlur, onKeyDown: handleKeyDown, onKeyUp: handleKeyUp, ref: ref })));
|
232
|
+
return ((0, jsx_runtime_1.jsx)(S_Multi, __assign({}, register(name, validation), rest, { name: name, defaultValue: defaultText, placeholder: hintText, textAlign: textAlign, state: state, readOnly: state === 'read_only' && true, disabled: state === 'disabled' && true, maxLength: maxLength, rows: multiRows, textSize: textSize, textWeight: textWeight, fieldPaddingRight: fieldPaddingRight, fieldPaddingLeft: fieldPaddingLeft, textPadding: textPadding, colorTheme: colorTheme, autoComplete: autoComplete, onFocus: handleFocus, onChange: handleChange, onBlur: handleBlur, onKeyDown: handleKeyDown, onKeyUp: handleKeyUp, onKeyPress: handleKeyPress, ref: ref })));
|
204
233
|
}
|
205
234
|
if (textLineType === 'auto') {
|
206
|
-
return ((0, jsx_runtime_1.jsx)(S_Auto, __assign({}, refRest, rest, { name: name, defaultValue: defaultText, placeholder: hintText, textAlign: textAlign, autoMinRows: autoMinRows, autoMaxRows: autoMaxRows, state: state, readOnly: state === 'read_only' && true, disabled: state === 'disabled' && true, maxLength: maxLength, textSize: textSize, textWeight: textWeight, fieldPaddingRight: fieldPaddingRight, fieldPaddingLeft: fieldPaddingLeft, textPadding: textPadding, fieldHeight: fieldHeight, colorTheme: colorTheme, autoComplete: autoComplete, onFocus: handleFocus, onChange: handleChange, onBlur: handleBlur, onKeyDown: handleKeyDown, onKeyUp: handleKeyUp, ref: function (e) {
|
235
|
+
return ((0, jsx_runtime_1.jsx)(S_Auto, __assign({}, refRest, rest, { name: name, defaultValue: defaultText, placeholder: hintText, textAlign: textAlign, autoMinRows: autoMinRows, autoMaxRows: autoMaxRows, state: state, readOnly: state === 'read_only' && true, disabled: state === 'disabled' && true, maxLength: maxLength, textSize: textSize, textWeight: textWeight, fieldPaddingRight: fieldPaddingRight, fieldPaddingLeft: fieldPaddingLeft, textPadding: textPadding, fieldHeight: fieldHeight, colorTheme: colorTheme, autoComplete: autoComplete, onFocus: handleFocus, onChange: handleChange, onBlur: handleBlur, onKeyDown: handleKeyDown, onKeyUp: handleKeyUp, onKeyPress: handleKeyPress, ref: function (e) {
|
207
236
|
ref(e);
|
208
237
|
textAreaRef.current = e;
|
209
238
|
}, onInput: handleResizeHeight })));
|
@@ -53,8 +53,8 @@ function BasicButtonGroup(_a) {
|
|
53
53
|
return 'ui_cpnt_button_icon_enabled';
|
54
54
|
};
|
55
55
|
return ((0, jsx_runtime_1.jsx)(S_BasicButtonGroup, __assign({ "x-pds-name": "BasicButtonGroup", "x-pds-element-type": "component", "x-pds-device-type": "mobile" }, { children: valueArray.map(function (_a, index) {
|
56
|
-
var iconName = _a.iconName, _b = _a.iconFillType, iconFillType = _b === void 0 ? 'line' : _b, _c = _a.state, buttonState = _c === void 0 ? 'normal' : _c, _d = _a.iconColorTheme, iconColorTheme = _d === void 0 ? 'none' : _d, onClick = _a.onClick, onMouseDown = _a.onMouseDown;
|
57
|
-
return ((0, jsx_runtime_1.jsx)(S_BasicButton, __assign({ size: size, onClick: function (e) { return onClick && onClick(e); }, onMouseDown: function (e) { return onMouseDown && onMouseDown(e); }, disabled: state === 'disabled' || buttonState === 'disabled' }, { children: (0, jsx_runtime_1.jsx)(components_1.Icon, { iconName: iconName, size: size === 'small' ? 20 : 24, fillType: iconFillType, colorKey: getColorKey(buttonState, iconColorTheme) }) }), iconName + index));
|
56
|
+
var iconName = _a.iconName, _b = _a.iconFillType, iconFillType = _b === void 0 ? 'line' : _b, _c = _a.state, buttonState = _c === void 0 ? 'normal' : _c, _d = _a.iconColorTheme, iconColorTheme = _d === void 0 ? 'none' : _d, _e = _a.backgroundColorTheme, backgroundColorTheme = _e === void 0 ? 'ui_cpnt_basicbuttongroup_base_default' : _e, onClick = _a.onClick, onMouseDown = _a.onMouseDown;
|
57
|
+
return ((0, jsx_runtime_1.jsx)(S_BasicButton, __assign({ size: size, onClick: function (e) { return onClick && onClick(e); }, onMouseDown: function (e) { return onMouseDown && onMouseDown(e); }, disabled: state === 'disabled' || buttonState === 'disabled', backgroundColorTheme: backgroundColorTheme }, { children: (0, jsx_runtime_1.jsx)(components_1.Icon, { iconName: iconName, size: size === 'small' ? 20 : 24, fillType: iconFillType, colorKey: getColorKey(buttonState, iconColorTheme) }) }), iconName + index));
|
58
58
|
}) })));
|
59
59
|
}
|
60
60
|
var S_BasicButtonGroup = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n width: max-content;\n\n & > button:not(:last-child) {\n margin-right: ", ";\n }\n"], ["\n width: max-content;\n\n & > button:not(:last-child) {\n margin-right: ", ";\n }\n"])), function (_a) {
|
@@ -65,8 +65,10 @@ var large = (0, styled_components_1.css)(templateObject_2 || (templateObject_2 =
|
|
65
65
|
var medium = (0, styled_components_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n border-radius: 12px;\n height: 40px;\n width: 40px;\n"], ["\n border-radius: 12px;\n height: 40px;\n width: 40px;\n"])));
|
66
66
|
var small = (0, styled_components_1.css)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n border-radius: 10px;\n height: 32px;\n width: 32px;\n"], ["\n border-radius: 10px;\n height: 32px;\n width: 32px;\n"])));
|
67
67
|
var S_BasicButton = styled_components_1.default.button(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n align-items: center;\n background-color: ", ";\n border: none;\n display: inline-flex;\n justify-content: center;\n\n position: relative;\n\n ", ";\n\n &::before {\n background-color: transparent;\n border-radius: inherit;\n content: '';\n height: 100%;\n left: 0;\n position: absolute;\n top: 0;\n width: 100%;\n }\n\n &:hover:enabled:before {\n background-color: ", ";\n }\n\n &:active:enabled:before {\n background-color: ", ";\n }\n\n &:disabled {\n background-color: ", ";\n cursor: default;\n }\n"], ["\n align-items: center;\n background-color: ", ";\n border: none;\n display: inline-flex;\n justify-content: center;\n\n position: relative;\n\n ", ";\n\n &::before {\n background-color: transparent;\n border-radius: inherit;\n content: '';\n height: 100%;\n left: 0;\n position: absolute;\n top: 0;\n width: 100%;\n }\n\n &:hover:enabled:before {\n background-color: ", ";\n }\n\n &:active:enabled:before {\n background-color: ", ";\n }\n\n &:disabled {\n background-color: ", ";\n cursor: default;\n }\n"])), function (_a) {
|
68
|
-
var theme = _a.theme;
|
69
|
-
return
|
68
|
+
var theme = _a.theme, backgroundColorTheme = _a.backgroundColorTheme;
|
69
|
+
return backgroundColorTheme
|
70
|
+
? theme[backgroundColorTheme]
|
71
|
+
: theme.ui_cpnt_basicbuttongroup_base_default;
|
70
72
|
}, function (_a) {
|
71
73
|
var size = _a.size;
|
72
74
|
return size && { large: large, medium: medium, small: small }[size];
|
@@ -178,10 +178,14 @@ function Dropdown(_a) {
|
|
178
178
|
};
|
179
179
|
var getTextColorTheme = function () {
|
180
180
|
if (colorTheme === 'none') {
|
181
|
-
if (isFocused) {
|
182
|
-
return 'sysTextPrimary';
|
183
|
-
}
|
184
181
|
if (state === 'normal') {
|
182
|
+
var isHintTextShow = !(selectedValue === null || selectedValue === void 0 ? void 0 : selectedValue.text) && !(value === null || value === void 0 ? void 0 : value.text) && !(defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.text) && !!hintText;
|
183
|
+
if (isHintTextShow) {
|
184
|
+
return 'sysTextSecondary';
|
185
|
+
}
|
186
|
+
if (isFocused) {
|
187
|
+
return 'sysTextPrimary';
|
188
|
+
}
|
185
189
|
return 'sysTextPrimary';
|
186
190
|
}
|
187
191
|
if (state === 'read_only') {
|
@@ -200,10 +204,14 @@ function Dropdown(_a) {
|
|
200
204
|
};
|
201
205
|
var getTextColorOverride = function () {
|
202
206
|
if (colorTheme === 'dark') {
|
203
|
-
if (isFocused) {
|
204
|
-
return 'ui_cpnt_dropdown_text_darktheme_enabled';
|
205
|
-
}
|
206
207
|
if (state === 'normal') {
|
208
|
+
var isHintTextShow = !(selectedValue === null || selectedValue === void 0 ? void 0 : selectedValue.text) && !(value === null || value === void 0 ? void 0 : value.text) && !(defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.text) && !!hintText;
|
209
|
+
if (isHintTextShow) {
|
210
|
+
return 'ui_cpnt_dropdown_text_darktheme_hinttext';
|
211
|
+
}
|
212
|
+
if (isFocused) {
|
213
|
+
return 'ui_cpnt_dropdown_text_darktheme_enabled';
|
214
|
+
}
|
207
215
|
return 'ui_cpnt_dropdown_text_darktheme_hint';
|
208
216
|
}
|
209
217
|
if (state === 'read_only') {
|
@@ -72,8 +72,8 @@ function SegmentedButtonGroup(_a) {
|
|
72
72
|
return 'ui_cpnt_button_icon_enabled';
|
73
73
|
};
|
74
74
|
return ((0, jsx_runtime_1.jsx)(S_SegmentedButtonGroupGroups, __assign({ "x-pds-name": "SegmentedButtonGroup", "x-pds-element-type": "component", "x-pds-device-type": "mobile", selectionType: selectionType }, { children: valueArray.map(function (_a) {
|
75
|
-
var currentButtonValue = _a.value, iconName = _a.iconName, _b = _a.iconFillType, iconFillType = _b === void 0 ? 'line' : _b, _c = _a.iconColorTheme, iconColorTheme = _c === void 0 ? 'none' : _c, _d = _a.state, buttonState = _d === void 0 ? 'normal' : _d;
|
76
|
-
return ((0, jsx_runtime_1.jsx)(S_BasicButton, __assign({ size: size, onClick: function () { return handleClick(currentButtonValue); }, onMouseDown: function () { return handleMouseDown(currentButtonValue); }, disabled: state === 'disabled' || buttonState === 'disabled', selectionType: selectionType, isSelected: checkSelection(currentButtonValue) }, { children: (0, jsx_runtime_1.jsx)(components_1.Icon, { iconName: iconName, size: size === 'small' ? 20 : 24, fillType: iconFillType, colorKey: getIconColorKey(checkSelection(currentButtonValue), state === 'disabled' || buttonState === 'disabled', iconColorTheme) }) }), String(currentButtonValue)));
|
75
|
+
var currentButtonValue = _a.value, iconName = _a.iconName, _b = _a.iconFillType, iconFillType = _b === void 0 ? 'line' : _b, _c = _a.iconColorTheme, iconColorTheme = _c === void 0 ? 'none' : _c, _d = _a.state, buttonState = _d === void 0 ? 'normal' : _d, _e = _a.backgroundColorTheme, backgroundColorTheme = _e === void 0 ? 'ui_cpnt_segmentedbuttongroup_base_default' : _e;
|
76
|
+
return ((0, jsx_runtime_1.jsx)(S_BasicButton, __assign({ size: size, onClick: function () { return handleClick(currentButtonValue); }, onMouseDown: function () { return handleMouseDown(currentButtonValue); }, disabled: state === 'disabled' || buttonState === 'disabled', selectionType: selectionType, isSelected: checkSelection(currentButtonValue), backgroundColorTheme: backgroundColorTheme }, { children: (0, jsx_runtime_1.jsx)(components_1.Icon, { iconName: iconName, size: size === 'small' ? 20 : 24, fillType: iconFillType, colorKey: getIconColorKey(checkSelection(currentButtonValue), state === 'disabled' || buttonState === 'disabled', iconColorTheme) }) }), String(currentButtonValue)));
|
77
77
|
}) })));
|
78
78
|
}
|
79
79
|
var S_SegmentedButtonGroupGroups = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n width: max-content;\n\n & > button:not(:last-child) {\n margin-right: ", ";\n }\n"], ["\n width: max-content;\n\n & > button:not(:last-child) {\n margin-right: ", ";\n }\n"])), function (_a) {
|
@@ -129,10 +129,12 @@ var small = (0, styled_components_1.css)(templateObject_4 || (templateObject_4 =
|
|
129
129
|
return selectionType === 'single' && '10px';
|
130
130
|
});
|
131
131
|
var S_BasicButton = styled_components_1.default.button(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n align-items: center;\n background-color: ", ";\n border: none;\n display: inline-flex;\n justify-content: center;\n position: relative;\n\n ", ";\n\n &::before {\n background-color: transparent;\n border-radius: inherit;\n content: '';\n height: 100%;\n left: 0;\n position: absolute;\n top: 0;\n width: 100%;\n }\n\n &:hover:enabled:before {\n background-color: ", ";\n }\n\n &:active:enabled:before {\n background-color: ", ";\n }\n\n &:disabled {\n background-color: ", ";\n cursor: default;\n }\n"], ["\n align-items: center;\n background-color: ", ";\n border: none;\n display: inline-flex;\n justify-content: center;\n position: relative;\n\n ", ";\n\n &::before {\n background-color: transparent;\n border-radius: inherit;\n content: '';\n height: 100%;\n left: 0;\n position: absolute;\n top: 0;\n width: 100%;\n }\n\n &:hover:enabled:before {\n background-color: ", ";\n }\n\n &:active:enabled:before {\n background-color: ", ";\n }\n\n &:disabled {\n background-color: ", ";\n cursor: default;\n }\n"])), function (_a) {
|
132
|
-
var isSelected = _a.isSelected, theme = _a.theme;
|
133
|
-
|
134
|
-
|
135
|
-
|
132
|
+
var isSelected = _a.isSelected, backgroundColorTheme = _a.backgroundColorTheme, theme = _a.theme;
|
133
|
+
if (isSelected)
|
134
|
+
return theme.ui_cpnt_segmentedbuttongroup_base_selected;
|
135
|
+
if (backgroundColorTheme)
|
136
|
+
return theme[backgroundColorTheme];
|
137
|
+
return theme.ui_cpnt_segmentedbuttongroup_base_default;
|
136
138
|
}, function (_a) {
|
137
139
|
var size = _a.size;
|
138
140
|
return size && { large: large, medium: medium, small: small }[size];
|
@@ -1,10 +1,12 @@
|
|
1
|
-
import
|
1
|
+
import { Path } from 'react-hook-form';
|
2
|
+
import type { IFormValues, PDSTextType } from '../../../common';
|
2
3
|
import type { SelectHTMLAttributes } from 'react';
|
3
4
|
type SelectOption = {
|
4
5
|
text: string;
|
5
6
|
value: SelectHTMLAttributes<HTMLSelectElement>['value'];
|
6
7
|
};
|
7
8
|
type SelectProps = {
|
9
|
+
name?: Path<IFormValues>;
|
8
10
|
hintText?: PDSTextType;
|
9
11
|
defaultValue?: SelectOption;
|
10
12
|
value?: SelectOption['value'];
|
@@ -14,7 +16,10 @@ type SelectProps = {
|
|
14
16
|
state?: 'normal' | 'read_only' | 'disabled';
|
15
17
|
colorTheme?: 'none' | 'dark';
|
16
18
|
customWidth?: string;
|
19
|
+
validation?: {
|
20
|
+
[key: string]: any;
|
21
|
+
};
|
17
22
|
onChange?: (e: React.ChangeEvent<HTMLSelectElement>) => void;
|
18
23
|
};
|
19
|
-
declare function Select({ hintText, defaultValue, value, valueArray, size, responsiveMode, state, colorTheme, customWidth, onChange }: SelectProps): JSX.Element;
|
24
|
+
declare function Select({ name, hintText, defaultValue, value, valueArray, size, responsiveMode, state, colorTheme, customWidth, validation, onChange }: SelectProps): JSX.Element;
|
20
25
|
export default Select;
|
@@ -39,16 +39,40 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
39
39
|
};
|
40
40
|
Object.defineProperty(exports, "__esModule", { value: true });
|
41
41
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
42
|
+
var react_hook_form_1 = require("react-hook-form");
|
43
|
+
var types_1 = require("../../../common/types");
|
42
44
|
var styled_components_1 = __importStar(require("styled-components"));
|
43
45
|
var transitionStyle_1 = require("../../../common/styles/movement/transitionStyle");
|
44
46
|
var hybrid_1 = require("../../../hybrid");
|
45
|
-
var HINT = 'HINT_VALUE';
|
46
47
|
function Select(_a) {
|
47
|
-
var _b;
|
48
|
-
var hintText = _a.hintText, defaultValue = _a.defaultValue, value = _a.value, valueArray = _a.valueArray,
|
48
|
+
var _b, _c;
|
49
|
+
var name = _a.name, hintText = _a.hintText, defaultValue = _a.defaultValue, value = _a.value, valueArray = _a.valueArray, _d = _a.size, size = _d === void 0 ? 'large' : _d, _e = _a.responsiveMode, responsiveMode = _e === void 0 ? 'none' : _e, _f = _a.state, state = _f === void 0 ? 'normal' : _f, _g = _a.colorTheme, colorTheme = _g === void 0 ? 'none' : _g, customWidth = _a.customWidth, validation = _a.validation, onChange = _a.onChange;
|
50
|
+
// validation을 확장하여 힌트 체크 추가
|
51
|
+
var extendedValidation = __assign(__assign({}, validation), { validate: function (value) {
|
52
|
+
var _a;
|
53
|
+
// 값이 없으면 required.message 노출
|
54
|
+
if (!value || value.length === 0) {
|
55
|
+
if (validation === null || validation === void 0 ? void 0 : validation.required) {
|
56
|
+
return ((_a = validation === null || validation === void 0 ? void 0 : validation.required) === null || _a === void 0 ? void 0 : _a.message) || false;
|
57
|
+
}
|
58
|
+
}
|
59
|
+
// 기존 validate 함수가 있다면 실행
|
60
|
+
if (validation === null || validation === void 0 ? void 0 : validation.validate) {
|
61
|
+
return validation.validate(value);
|
62
|
+
}
|
63
|
+
return true;
|
64
|
+
} });
|
65
|
+
var formContext = (0, react_hook_form_1.useFormContext)();
|
66
|
+
var register = name && formContext ? formContext.register(name, extendedValidation) : null;
|
67
|
+
var isError = name && formContext ? Boolean((0, types_1.getErrorByName)(formContext.formState.errors, name)) : false;
|
49
68
|
var handleChange = function (e) {
|
50
|
-
|
51
|
-
|
69
|
+
register === null || register === void 0 ? void 0 : register.onChange(e);
|
70
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(e);
|
71
|
+
};
|
72
|
+
var handleBlur = function (e) {
|
73
|
+
if (register) {
|
74
|
+
register.onBlur(e);
|
75
|
+
formContext.trigger(name);
|
52
76
|
}
|
53
77
|
};
|
54
78
|
var getIconColorKey = function () {
|
@@ -63,17 +87,21 @@ function Select(_a) {
|
|
63
87
|
}
|
64
88
|
return 'ui_cpnt_select_icon_01';
|
65
89
|
};
|
66
|
-
return ((0, jsx_runtime_1.jsxs)(S_Box, __assign({ "x-pds-name": "Select", "x-pds-element-type": "component", "x-pds-device-type": "mobile", "$size": size, responsiveMode: responsiveMode, tabIndex: 0, customWidth: customWidth }, { children: [(0, jsx_runtime_1.jsx)(S_Icon_Wrapper, __assign({ state: state }, { children: (0, jsx_runtime_1.jsx)(hybrid_1.Icon, { size: 16, fillType: "line", iconName: "ic_arrow_down", colorKey: getIconColorKey() }) })), (0, jsx_runtime_1.jsxs)(S_Select, __assign({ disabled: state === 'disabled' || state === 'read_only', state: state, "$size": size, colorTheme: colorTheme, onChange: handleChange, defaultValue: (_b = defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.value) !== null && _b !== void 0 ? _b :
|
90
|
+
return ((0, jsx_runtime_1.jsxs)(S_Box, __assign({ "x-pds-name": "Select", "x-pds-element-type": "component", "x-pds-device-type": "mobile", "$size": size, responsiveMode: responsiveMode, tabIndex: 0, customWidth: customWidth }, { children: [(0, jsx_runtime_1.jsxs)(S_SelectWrapper, { children: [(0, jsx_runtime_1.jsx)(S_Icon_Wrapper, __assign({ state: state }, { children: (0, jsx_runtime_1.jsx)(hybrid_1.Icon, { size: 16, fillType: "line", iconName: "ic_arrow_down", colorKey: getIconColorKey() }) })), (0, jsx_runtime_1.jsxs)(S_Select, __assign({}, register, { disabled: state === 'disabled' || state === 'read_only', state: state, isError: isError, "$size": size, colorTheme: colorTheme, onChange: handleChange, onBlur: handleBlur, defaultValue: (_b = defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.value) !== null && _b !== void 0 ? _b : '', value: value || undefined }, { children: [hintText && ((0, jsx_runtime_1.jsx)("option", __assign({ disabled: true, value: "" }, { children: hintText }))), valueArray.map(function (el) { return ((0, jsx_runtime_1.jsx)("option", __assign({ value: el.value }, { children: el.text }), el.value)); })] }))] }), name &&
|
91
|
+
((_c = (0, types_1.getErrorByName)(formContext.formState.errors, name)) === null || _c === void 0 ? void 0 : _c.message) &&
|
92
|
+
state === 'normal' && ((0, jsx_runtime_1.jsx)(S_Error, __assign({ colorTheme: colorTheme }, { children: (0, types_1.getErrorByName)(formContext.formState.errors, name).message })))] })));
|
67
93
|
}
|
68
94
|
var large = (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n height: 48px;\n width: 432px;\n"], ["\n height: 48px;\n width: 432px;\n"])));
|
69
95
|
var medium = (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n height: 40px;\n width: 188px;\n"], ["\n height: 40px;\n width: 188px;\n"])));
|
70
96
|
var small = (0, styled_components_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n height: 32px;\n width: 188px;\n"], ["\n height: 32px;\n width: 188px;\n"])));
|
71
97
|
var rlarge = (0, styled_components_1.css)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n height: 48px;\n width: 100%;\n"], ["\n height: 48px;\n width: 100%;\n"])));
|
72
|
-
var dark = (0, styled_components_1.css)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n background-color: ", ";\n border: 2px solid
|
98
|
+
var dark = (0, styled_components_1.css)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n background-color: ", ";\n border: 2px solid\n ", ";\n color: ", ";\n\n :disabled {\n background-color: ", ";\n border: 2px solid ", ";\n color: ", ";\n }\n\n :focus {\n border: 2px solid\n ", " !important;\n color: ", ";\n }\n"], ["\n background-color: ", ";\n border: 2px solid\n ", ";\n color: ", ";\n\n :disabled {\n background-color: ", ";\n border: 2px solid ", ";\n color: ", ";\n }\n\n :focus {\n border: 2px solid\n ", " !important;\n color: ", ";\n }\n"])), function (_a) {
|
73
99
|
var theme = _a.theme;
|
74
100
|
return theme.ui_cpnt_select_base_darktheme_normal;
|
75
101
|
}, function (_a) {
|
76
|
-
var theme = _a.theme;
|
102
|
+
var theme = _a.theme, isError = _a.isError;
|
103
|
+
if (isError)
|
104
|
+
return theme.ui_cpnt_select_dropdown_border_darktheme_error;
|
77
105
|
return theme.ui_cpnt_select_border_darktheme_normal;
|
78
106
|
}, function (_a) {
|
79
107
|
var theme = _a.theme;
|
@@ -90,7 +118,9 @@ var dark = (0, styled_components_1.css)(templateObject_5 || (templateObject_5 =
|
|
90
118
|
? theme.ui_cpnt_select_text_darktheme_readonly
|
91
119
|
: theme.ui_cpnt_select_text_darktheme_disabled;
|
92
120
|
}, function (_a) {
|
93
|
-
var theme = _a.theme;
|
121
|
+
var theme = _a.theme, isError = _a.isError;
|
122
|
+
if (isError)
|
123
|
+
return theme.ui_cpnt_select_dropdown_border_darktheme_error;
|
94
124
|
return theme.ui_cpnt_select_border_darktheme_focus;
|
95
125
|
}, function (_a) {
|
96
126
|
var theme = _a.theme;
|
@@ -100,10 +130,10 @@ var S_Box = styled_components_1.default.div(templateObject_6 || (templateObject_
|
|
100
130
|
var $size = _a.$size;
|
101
131
|
return $size &&
|
102
132
|
{
|
103
|
-
|
104
|
-
medium:
|
105
|
-
|
106
|
-
rlarge:
|
133
|
+
small: 'width: 188px;',
|
134
|
+
medium: 'width: 188px;',
|
135
|
+
large: 'width: 432px;',
|
136
|
+
rlarge: 'width: 100%'
|
107
137
|
}[$size];
|
108
138
|
}, function (_a) {
|
109
139
|
var responsiveMode = _a.responsiveMode;
|
@@ -112,11 +142,12 @@ var S_Box = styled_components_1.default.div(templateObject_6 || (templateObject_
|
|
112
142
|
var customWidth = _a.customWidth;
|
113
143
|
return customWidth && "width: ".concat(customWidth, ";");
|
114
144
|
});
|
115
|
-
var
|
145
|
+
var S_SelectWrapper = styled_components_1.default.div(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n position: relative;\n width: 100%;\n"], ["\n position: relative;\n width: 100%;\n"])));
|
146
|
+
var S_Icon_Wrapper = styled_components_1.default.div(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n align-items: center;\n display: flex;\n height: 16px;\n position: absolute;\n right: ", ";\n top: 50%;\n transform: translateY(-50%);\n width: 16px;\n"], ["\n align-items: center;\n display: flex;\n height: 16px;\n position: absolute;\n right: ", ";\n top: 50%;\n transform: translateY(-50%);\n width: 16px;\n"])), function (_a) {
|
116
147
|
var theme = _a.theme;
|
117
148
|
return theme.spacing.spacingD;
|
118
149
|
});
|
119
|
-
var backgroundActiveColor = (0, styled_components_1.css)(
|
150
|
+
var backgroundActiveColor = (0, styled_components_1.css)(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n ", ";\n"], ["\n ", ";\n"])), function (_a) {
|
120
151
|
var colorTheme = _a.colorTheme, theme = _a.theme;
|
121
152
|
switch (colorTheme) {
|
122
153
|
case 'none':
|
@@ -127,12 +158,23 @@ var backgroundActiveColor = (0, styled_components_1.css)(templateObject_8 || (te
|
|
127
158
|
return theme.ui_cpnt_textfield_base_pressed;
|
128
159
|
}
|
129
160
|
});
|
130
|
-
var normalActionColor = (0, styled_components_1.css)(
|
131
|
-
var S_Select = styled_components_1.default.select(
|
161
|
+
var normalActionColor = (0, styled_components_1.css)(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n &:active {\n background-color: ", ";\n }\n"], ["\n &:active {\n background-color: ", ";\n }\n"])), backgroundActiveColor);
|
162
|
+
var S_Select = styled_components_1.default.select(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 1;\n appearance: none;\n background-color: ", ";\n ", ";\n border: 2px solid\n ", ";\n border-radius: ", ";\n box-sizing: border-box;\n color: ", ";\n display: -webkit-box;\n font-family: inherit;\n font-size: ", ";\n overflow: hidden;\n padding-left: ", ";\n padding-right: ", ";\n text-overflow: ellipsis;\n width: 100%;\n word-break: break-all;\n\n :disabled {\n background-color: ", ";\n border: 2px solid ", ";\n color: ", ";\n opacity: 1;\n }\n\n :focus {\n border: 2px solid\n ", " !important;\n color: ", ";\n outline: 0 !important;\n outline-offset: 0 !important;\n }\n\n ", "\n\n ", "\n\n ", "\n"], ["\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 1;\n appearance: none;\n background-color: ", ";\n ", ";\n border: 2px solid\n ", ";\n border-radius: ", ";\n box-sizing: border-box;\n color: ", ";\n display: -webkit-box;\n font-family: inherit;\n font-size: ", ";\n overflow: hidden;\n padding-left: ", ";\n padding-right: ", ";\n text-overflow: ellipsis;\n width: 100%;\n word-break: break-all;\n\n :disabled {\n background-color: ", ";\n border: 2px solid ", ";\n color: ", ";\n opacity: 1;\n }\n\n :focus {\n border: 2px solid\n ", " !important;\n color: ", ";\n outline: 0 !important;\n outline-offset: 0 !important;\n }\n\n ", "\n\n ", "\n\n ", "\n"])), function (_a) {
|
132
163
|
var theme = _a.theme;
|
133
164
|
return theme.ui_cpnt_select_base_normal;
|
134
165
|
}, function (_a) {
|
135
|
-
var
|
166
|
+
var $size = _a.$size;
|
167
|
+
return $size &&
|
168
|
+
{
|
169
|
+
large: large,
|
170
|
+
medium: medium,
|
171
|
+
small: small,
|
172
|
+
rlarge: rlarge
|
173
|
+
}[$size];
|
174
|
+
}, function (_a) {
|
175
|
+
var theme = _a.theme, isError = _a.isError;
|
176
|
+
if (isError)
|
177
|
+
return theme.ui_cpnt_select_dropdown_border_error;
|
136
178
|
return theme.ui_cpnt_select_border_normal;
|
137
179
|
}, function (_a) {
|
138
180
|
var $size = _a.$size;
|
@@ -167,7 +209,9 @@ var S_Select = styled_components_1.default.select(templateObject_10 || (template
|
|
167
209
|
? theme.ui_cpnt_select_text_readonly
|
168
210
|
: theme.ui_cpnt_select_text_disabled;
|
169
211
|
}, function (_a) {
|
170
|
-
var theme = _a.theme;
|
212
|
+
var theme = _a.theme, isError = _a.isError;
|
213
|
+
if (isError)
|
214
|
+
return theme.ui_cpnt_select_dropdown_border_error;
|
171
215
|
return theme.ui_cpnt_select_border_focus;
|
172
216
|
}, function (_a) {
|
173
217
|
var theme = _a.theme;
|
@@ -179,5 +223,28 @@ var S_Select = styled_components_1.default.select(templateObject_10 || (template
|
|
179
223
|
var state = _a.state;
|
180
224
|
return state === 'normal' && normalActionColor;
|
181
225
|
});
|
226
|
+
var S_Error = styled_components_1.default.div(templateObject_12 || (templateObject_12 = __makeTemplateObject(["\n color: ", ";\n font-size: ", ";\n font-weight: ", ";\n line-height: ", ";\n margin-top: ", ";\n text-align: left;\n white-space: pre-wrap;\n"], ["\n color: ", ";\n font-size: ", ";\n font-weight: ", ";\n line-height: ", ";\n margin-top: ", ";\n text-align: left;\n white-space: pre-wrap;\n"])), function (_a) {
|
227
|
+
var theme = _a.theme, colorTheme = _a.colorTheme;
|
228
|
+
switch (colorTheme) {
|
229
|
+
case 'none': {
|
230
|
+
return theme.ui_cpnt_select_dropdown_text_error;
|
231
|
+
}
|
232
|
+
case 'dark': {
|
233
|
+
return theme.ui_cpnt_select_dropdown_text_darktheme_error;
|
234
|
+
}
|
235
|
+
}
|
236
|
+
}, function (_a) {
|
237
|
+
var theme = _a.theme;
|
238
|
+
return theme.desktopFontSize.caption2;
|
239
|
+
}, function (_a) {
|
240
|
+
var theme = _a.theme;
|
241
|
+
return theme.fontWeight.normal;
|
242
|
+
}, function (_a) {
|
243
|
+
var theme = _a.theme;
|
244
|
+
return theme.desktopLineHeight.caption2;
|
245
|
+
}, function (_a) {
|
246
|
+
var theme = _a.theme;
|
247
|
+
return theme.spacing.spacingA;
|
248
|
+
});
|
182
249
|
exports.default = Select;
|
183
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10;
|
250
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12;
|
@@ -1,51 +1,26 @@
|
|
1
1
|
/// <reference types="react" />
|
2
2
|
import { Path } from 'react-hook-form';
|
3
3
|
import type { IFormValues, PDSIconType, PDSTextType, UiColors } from '../../../common';
|
4
|
+
import type { TextFieldBaseProps } from '../../common/components/TextFieldBase/TextFieldBase';
|
4
5
|
export type TextFieldProps = {
|
5
6
|
name: Path<IFormValues>;
|
6
|
-
hintText?: PDSTextType;
|
7
|
-
defaultText?: PDSTextType;
|
8
|
-
textAlign?: 'left' | 'center' | 'right';
|
9
7
|
prefixText?: PDSTextType;
|
10
|
-
suffixText?: PDSTextType;
|
11
|
-
validation?: {
|
12
|
-
[key: string]: any;
|
13
|
-
};
|
14
8
|
validationPoint?: 'onChange' | 'onBlur';
|
15
|
-
preventBlankMode?: 'none' | 'trim' | 'all';
|
16
|
-
enterSubmitMode?: 'none' | 'use';
|
17
9
|
size?: 'small' | 'medium' | 'large' | 'rlarge';
|
18
10
|
responsiveMode?: 'none' | 'use';
|
19
|
-
textLineType?: 'single' | 'multi' | 'auto';
|
20
|
-
multiRows?: number;
|
21
|
-
autoMinRows?: number;
|
22
|
-
autoMaxRows?: number;
|
23
|
-
inputType?: string;
|
24
|
-
state?: 'normal' | 'read_only' | 'disabled';
|
25
11
|
iBtn1IconName?: PDSIconType;
|
26
12
|
iBtn2IconName?: PDSIconType;
|
27
13
|
iBtn1IconFillType?: 'line' | 'fill';
|
28
14
|
iBtn2IconFillType?: 'line' | 'fill';
|
29
15
|
overrideIBtn1IconColorKey?: UiColors;
|
30
16
|
overrideIBtn2IconColorKey?: UiColors;
|
31
|
-
colorTheme?: 'none' | 'dark' | 'transparent';
|
32
|
-
max?: number;
|
33
|
-
maxLength?: number;
|
34
|
-
min?: number;
|
35
17
|
customWidth?: string;
|
36
|
-
autoComplete?: string;
|
37
18
|
numberStepperMode?: 'none' | 'use';
|
38
19
|
numberStep?: number;
|
39
20
|
fontWeight?: 'bold' | 'regular';
|
40
21
|
deleteBtnMode?: 'none' | 'use';
|
41
|
-
onBlur?: (e: React.FocusEvent<HTMLInputElement> | React.FocusEvent<HTMLTextAreaElement>) => void;
|
42
|
-
onChange?: (e: React.ChangeEvent<HTMLInputElement> | React.ChangeEvent<HTMLTextAreaElement>) => void;
|
43
22
|
onClickIBtn1?: () => void;
|
44
23
|
onClickIBtn2?: () => void;
|
45
|
-
|
46
|
-
|
47
|
-
onKeyDown?: (e: React.KeyboardEvent<HTMLInputElement> | React.KeyboardEvent<HTMLTextAreaElement>) => void;
|
48
|
-
onTarget?: () => void;
|
49
|
-
};
|
50
|
-
declare function TextField({ name, hintText, defaultText, textAlign, prefixText, suffixText, validation, validationPoint, preventBlankMode, enterSubmitMode, size, responsiveMode, textLineType, multiRows, autoMinRows, autoMaxRows, inputType, state, iBtn1IconName, iBtn1IconFillType, iBtn2IconName, iBtn2IconFillType, overrideIBtn1IconColorKey, overrideIBtn2IconColorKey, colorTheme, max, maxLength, min, customWidth, autoComplete, numberStepperMode, numberStep, fontWeight, deleteBtnMode, onBlur, onChange, onClickIBtn1, onClickIBtn2, onFocus, onKeyUp, onKeyDown, onTarget }: TextFieldProps): JSX.Element;
|
24
|
+
} & Partial<TextFieldBaseProps>;
|
25
|
+
declare function TextField({ name, hintText, defaultText, textAlign, prefixText, suffixText, validation, validationPoint, preventBlankMode, enterSubmitMode, size, responsiveMode, textLineType, multiRows, autoMinRows, autoMaxRows, inputType, inputMode, state, iBtn1IconName, iBtn1IconFillType, iBtn2IconName, iBtn2IconFillType, overrideIBtn1IconColorKey, overrideIBtn2IconColorKey, colorTheme, max, maxLength, min, customWidth, autoComplete, numberStepperMode, numberStep, fontWeight, deleteBtnMode, onBlur, onChange, onClickIBtn1, onClickIBtn2, onFocus, onKeyUp, onKeyDown, onTarget }: TextFieldProps): JSX.Element;
|
51
26
|
export default TextField;
|
@@ -42,6 +42,7 @@ var jsx_runtime_1 = require("react/jsx-runtime");
|
|
42
42
|
/* eslint-disable react/jsx-no-bind */
|
43
43
|
var react_1 = require("react");
|
44
44
|
var react_hook_form_1 = require("react-hook-form");
|
45
|
+
var types_1 = require("../../../common/types");
|
45
46
|
var styled_components_1 = __importStar(require("styled-components"));
|
46
47
|
var transitionStyle_1 = require("../../../common/styles/movement/transitionStyle");
|
47
48
|
var hybrid_1 = require("../../../hybrid");
|
@@ -50,7 +51,7 @@ var IconButton_1 = require("../IconButton");
|
|
50
51
|
var TextLabel_1 = require("../TextLabel");
|
51
52
|
function TextField(_a) {
|
52
53
|
var _b;
|
53
|
-
var name = _a.name, hintText = _a.hintText, defaultText = _a.defaultText, _c = _a.textAlign, textAlign = _c === void 0 ? 'left' : _c, prefixText = _a.prefixText, suffixText = _a.suffixText, validation = _a.validation, _d = _a.validationPoint, validationPoint = _d === void 0 ? 'onBlur' : _d, _e = _a.preventBlankMode, preventBlankMode = _e === void 0 ? 'none' : _e, _f = _a.enterSubmitMode, enterSubmitMode = _f === void 0 ? 'none' : _f, _g = _a.size, size = _g === void 0 ? 'large' : _g, _h = _a.responsiveMode, responsiveMode = _h === void 0 ? 'none' : _h, _j = _a.textLineType, textLineType = _j === void 0 ? 'single' : _j, _k = _a.multiRows, multiRows = _k === void 0 ? 8 : _k, _l = _a.autoMinRows, autoMinRows = _l === void 0 ? 8 : _l, autoMaxRows = _a.autoMaxRows, _m = _a.inputType, inputType = _m === void 0 ? 'text' : _m, _o = _a.state, state = _o === void 0 ? 'normal' : _o, iBtn1IconName = _a.iBtn1IconName, _p = _a.iBtn1IconFillType, iBtn1IconFillType = _p === void 0 ? 'line' : _p, iBtn2IconName = _a.iBtn2IconName, _q = _a.iBtn2IconFillType, iBtn2IconFillType = _q === void 0 ? 'line' : _q, overrideIBtn1IconColorKey = _a.overrideIBtn1IconColorKey, overrideIBtn2IconColorKey = _a.overrideIBtn2IconColorKey, _r = _a.colorTheme, colorTheme = _r === void 0 ? 'none' : _r, max = _a.max, maxLength = _a.maxLength, min = _a.min, customWidth = _a.customWidth, _s = _a.autoComplete, autoComplete = _s === void 0 ? 'on' : _s, _t = _a.numberStepperMode, numberStepperMode = _t === void 0 ? 'none' : _t, numberStep = _a.numberStep, _u = _a.fontWeight, fontWeight = _u === void 0 ? 'regular' : _u, _v = _a.deleteBtnMode, deleteBtnMode = _v === void 0 ? 'use' : _v, onBlur = _a.onBlur, onChange = _a.onChange, onClickIBtn1 = _a.onClickIBtn1, onClickIBtn2 = _a.onClickIBtn2, onFocus = _a.onFocus, onKeyUp = _a.onKeyUp, onKeyDown = _a.onKeyDown, onTarget = _a.onTarget;
|
54
|
+
var name = _a.name, hintText = _a.hintText, defaultText = _a.defaultText, _c = _a.textAlign, textAlign = _c === void 0 ? 'left' : _c, prefixText = _a.prefixText, suffixText = _a.suffixText, validation = _a.validation, _d = _a.validationPoint, validationPoint = _d === void 0 ? 'onBlur' : _d, _e = _a.preventBlankMode, preventBlankMode = _e === void 0 ? 'none' : _e, _f = _a.enterSubmitMode, enterSubmitMode = _f === void 0 ? 'none' : _f, _g = _a.size, size = _g === void 0 ? 'large' : _g, _h = _a.responsiveMode, responsiveMode = _h === void 0 ? 'none' : _h, _j = _a.textLineType, textLineType = _j === void 0 ? 'single' : _j, _k = _a.multiRows, multiRows = _k === void 0 ? 8 : _k, _l = _a.autoMinRows, autoMinRows = _l === void 0 ? 8 : _l, autoMaxRows = _a.autoMaxRows, _m = _a.inputType, inputType = _m === void 0 ? 'text' : _m, inputMode = _a.inputMode, _o = _a.state, state = _o === void 0 ? 'normal' : _o, iBtn1IconName = _a.iBtn1IconName, _p = _a.iBtn1IconFillType, iBtn1IconFillType = _p === void 0 ? 'line' : _p, iBtn2IconName = _a.iBtn2IconName, _q = _a.iBtn2IconFillType, iBtn2IconFillType = _q === void 0 ? 'line' : _q, overrideIBtn1IconColorKey = _a.overrideIBtn1IconColorKey, overrideIBtn2IconColorKey = _a.overrideIBtn2IconColorKey, _r = _a.colorTheme, colorTheme = _r === void 0 ? 'none' : _r, max = _a.max, maxLength = _a.maxLength, min = _a.min, customWidth = _a.customWidth, _s = _a.autoComplete, autoComplete = _s === void 0 ? 'on' : _s, _t = _a.numberStepperMode, numberStepperMode = _t === void 0 ? 'none' : _t, numberStep = _a.numberStep, _u = _a.fontWeight, fontWeight = _u === void 0 ? 'regular' : _u, _v = _a.deleteBtnMode, deleteBtnMode = _v === void 0 ? 'use' : _v, onBlur = _a.onBlur, onChange = _a.onChange, onClickIBtn1 = _a.onClickIBtn1, onClickIBtn2 = _a.onClickIBtn2, onFocus = _a.onFocus, onKeyUp = _a.onKeyUp, onKeyDown = _a.onKeyDown, onTarget = _a.onTarget;
|
54
55
|
var basicThemeIconColors = {
|
55
56
|
normal: 'ui_cpnt_button_icon_default',
|
56
57
|
read_only: 'ui_cpnt_button_icon_default',
|
@@ -69,10 +70,7 @@ function TextField(_a) {
|
|
69
70
|
var _w = (0, react_1.useState)(false), isFocused = _w[0], setIsFocused = _w[1];
|
70
71
|
var _x = (0, react_hook_form_1.useFormContext)(), register = _x.register, trigger = _x.trigger, errors = _x.formState.errors;
|
71
72
|
var _y = register(name, validation), validateOnChange = _y.onChange, validateOnBlur = _y.onBlur;
|
72
|
-
var
|
73
|
-
return name.split('.').reduce(function (errors, property) { return errors && errors[property]; }, errors);
|
74
|
-
};
|
75
|
-
var isError = getErrorByName(errors, name);
|
73
|
+
var isError = (0, types_1.getErrorByName)(errors, name);
|
76
74
|
var handleClickIBtn1 = function () {
|
77
75
|
if (onClickIBtn1) {
|
78
76
|
onClickIBtn1();
|
@@ -143,7 +141,7 @@ function TextField(_a) {
|
|
143
141
|
break;
|
144
142
|
}
|
145
143
|
}
|
146
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [prefixText && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(TextLabel_1.TextLabel, { text: prefixText, styleTheme: "caption1Bold", colorTheme: "sysTextTertiary", singleLineMode: "use" }), (0, jsx_runtime_1.jsx)(hybrid_1.Spacing, { size: "spacing_b", spacingType: "width" })] })), (0, jsx_runtime_1.jsx)(components_1.TextFieldBase, { name: name, hintText: hintText, defaultText: defaultText, textAlign: textAlign, validation: validation, preventBlankMode: preventBlankMode, enterSubmitMode: enterSubmitMode, textLineType: "single", inputType: inputType, state: state, colorTheme: colorTheme, min: min, max: max, maxLength: maxLength, textSize: "form2", textWeight: fontWeight === 'bold' ? 'bold' : 'normal', fieldPaddingRight: size === 'large' || size === 'rlarge' ? 8 : undefined, deleteIconMode: deleteBtnMode, deleteIconSize: size === 'large' || size === 'rlarge' ? 20 : 16, deleteIconColor: deleteIconColor, isFocused: isFocused, autoComplete: autoComplete, stepperMode: inputType === 'number' && numberStepperMode === 'use' ? 'use' : 'none', stepperRightSpacing: size === 'large' || size === 'rlarge' ? 1 : -4, innerSpinButtonSize: size === 'small' ? 12 : 16, step: numberStep, suffixText: suffixText, suffixTextRightSpacingMode: size === 'large' || size === 'rlarge' ? 'use' : 'none', onFocus: handleFocus, onTarget: handleTarget, onChange: handleChange, onBlur: handleBlur, onKeyUp: handleKeyUp, onKeyDown: handleKeyDown }), (0, jsx_runtime_1.jsxs)(S_RightBox, { children: [iBtn2IconName && ((0, jsx_runtime_1.jsx)(IconButton_1.IconButton, { iconName: iBtn2IconName, baseSize: "small", shapeType: "rectangle", baseColorKey: "ui_cpnt_button_fill_base_transparent", iconSize: size === 'large' || size === 'rlarge' ? 20 : 16, iconColorKey: overrideIBtn2IconColorKey ||
|
144
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [prefixText && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(TextLabel_1.TextLabel, { text: prefixText, styleTheme: "caption1Bold", colorTheme: "sysTextTertiary", singleLineMode: "use" }), (0, jsx_runtime_1.jsx)(hybrid_1.Spacing, { size: "spacing_b", spacingType: "width" })] })), (0, jsx_runtime_1.jsx)(components_1.TextFieldBase, { name: name, hintText: hintText, defaultText: defaultText, textAlign: textAlign, validation: validation, preventBlankMode: preventBlankMode, enterSubmitMode: enterSubmitMode, textLineType: "single", inputType: inputType, inputMode: inputMode, state: state, colorTheme: colorTheme, min: min, max: max, maxLength: maxLength, textSize: "form2", textWeight: fontWeight === 'bold' ? 'bold' : 'normal', fieldPaddingRight: size === 'large' || size === 'rlarge' ? 8 : undefined, deleteIconMode: deleteBtnMode, deleteIconSize: size === 'large' || size === 'rlarge' ? 20 : 16, deleteIconColor: deleteIconColor, isFocused: isFocused, autoComplete: autoComplete, stepperMode: inputType === 'number' && numberStepperMode === 'use' ? 'use' : 'none', stepperRightSpacing: size === 'large' || size === 'rlarge' ? 1 : -4, innerSpinButtonSize: size === 'small' ? 12 : 16, step: numberStep, suffixText: suffixText, suffixTextRightSpacingMode: size === 'large' || size === 'rlarge' ? 'use' : 'none', onFocus: handleFocus, onTarget: handleTarget, onChange: handleChange, onBlur: handleBlur, onKeyUp: handleKeyUp, onKeyDown: handleKeyDown }), (0, jsx_runtime_1.jsxs)(S_RightBox, { children: [iBtn2IconName && ((0, jsx_runtime_1.jsx)(IconButton_1.IconButton, { iconName: iBtn2IconName, baseSize: "small", shapeType: "rectangle", baseColorKey: "ui_cpnt_button_fill_base_transparent", iconSize: size === 'large' || size === 'rlarge' ? 20 : 16, iconColorKey: overrideIBtn2IconColorKey ||
|
147
145
|
(colorTheme &&
|
148
146
|
{
|
149
147
|
none: basicThemeIconColors[state],
|
@@ -158,7 +156,7 @@ function TextField(_a) {
|
|
158
156
|
}[colorTheme]), iconFillType: iBtn1IconFillType === 'fill' ? 'fill' : 'line', state: state === 'disabled' ? 'disabled' : 'normal', onClick: handleClickIBtn1 }))] })] }));
|
159
157
|
}
|
160
158
|
};
|
161
|
-
return ((0, jsx_runtime_1.jsxs)(S_TextFieldBox, __assign({ "x-pds-name": "TextField", "x-pds-element-type": "component", "x-pds-device-type": "mobile", size: size, responsiveMode: responsiveMode, customWidth: customWidth }, { children: [(0, jsx_runtime_1.jsx)(S_TextFieldWrapper, __assign({ size: size, responsiveMode: responsiveMode, textLineType: textLineType, isFocused: isFocused, isError: Boolean(isError), state: state, colorTheme: colorTheme, customWidth: customWidth }, { children: S_TextField() })), ((_b = errors
|
159
|
+
return ((0, jsx_runtime_1.jsxs)(S_TextFieldBox, __assign({ "x-pds-name": "TextField", "x-pds-element-type": "component", "x-pds-device-type": "mobile", size: size, responsiveMode: responsiveMode, customWidth: customWidth }, { children: [(0, jsx_runtime_1.jsx)(S_TextFieldWrapper, __assign({ size: size, responsiveMode: responsiveMode, textLineType: textLineType, isFocused: isFocused, isError: Boolean(isError), state: state, colorTheme: colorTheme, customWidth: customWidth }, { children: S_TextField() })), ((_b = (0, types_1.getErrorByName)(errors, name)) === null || _b === void 0 ? void 0 : _b.message) && state === 'normal' && ((0, jsx_runtime_1.jsx)(S_Error, __assign({ colorTheme: colorTheme }, { children: (0, types_1.getErrorByName)(errors, name).message })))] })));
|
162
160
|
}
|
163
161
|
var S_TextFieldBox = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", ";\n ", ";\n ", "\n"], ["\n ", ";\n ", ";\n ", "\n"])), function (_a) {
|
164
162
|
var size = _a.size;
|
@@ -113,7 +113,7 @@ var medium = (0, styled_components_1.css)(templateObject_5 || (templateObject_5
|
|
113
113
|
var theme = _a.theme;
|
114
114
|
return theme.spacing.spacingB;
|
115
115
|
});
|
116
|
-
var large = (0, styled_components_1.css)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n height: 48px;\n padding-right: ", ";\n width: 432px;\n ", "\n ", "\n"], ["\n height: 48px;\n padding-right: ", ";\n width: 432px;\n ", "\n ", "\n"])), function (_a) {
|
116
|
+
var large = (0, styled_components_1.css)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n height: 48px;\n padding-right: ", ";\n width: 432px;\n\n ", "\n\n ", "\n"], ["\n height: 48px;\n padding-right: ", ";\n width: 432px;\n\n ", "\n\n ", "\n"])), function (_a) {
|
117
117
|
var theme = _a.theme;
|
118
118
|
return theme.spacing.spacingB;
|
119
119
|
}, function (_a) {
|
@@ -225,7 +225,7 @@ var backgroundActiveColor = (0, styled_components_1.css)(templateObject_17 || (t
|
|
225
225
|
}
|
226
226
|
});
|
227
227
|
var normalActionColor = (0, styled_components_1.css)(templateObject_18 || (templateObject_18 = __makeTemplateObject(["\n &:hover {\n background-color: ", ";\n }\n\n &:active {\n background-color: ", ";\n }\n"], ["\n &:hover {\n background-color: ", ";\n }\n\n &:active {\n background-color: ", ";\n }\n"])), backgroundHoverColor, backgroundActiveColor);
|
228
|
-
var S_SearchFieldWrapper = styled_components_1.default.div(templateObject_19 || (templateObject_19 = __makeTemplateObject(["\n align-items: center;\n border-radius: 14px;\n box-sizing: border-box;\n cursor: ", ";\n display: flex;\n ", ";\n ", ";\n\n ", "\n\n ", "\n\n ", ";\n ", "\n"], ["\n align-items: center;\n border-radius: 14px;\n box-sizing: border-box;\n cursor: ", ";\n display: flex;\n ", ";\n ", ";\n\n ", "\n\n ", "\n\n ", ";\n ", "\n"])), function (_a) {
|
228
|
+
var S_SearchFieldWrapper = styled_components_1.default.div(templateObject_19 || (templateObject_19 = __makeTemplateObject(["\n align-items: center;\n border-radius: 14px;\n box-sizing: border-box;\n cursor: ", ";\n display: flex;\n\n ", ";\n\n ", ";\n\n ", "\n\n ", "\n\n ", ";\n\n ", "\n"], ["\n align-items: center;\n border-radius: 14px;\n box-sizing: border-box;\n cursor: ", ";\n display: flex;\n\n ", ";\n\n ", ";\n\n ", "\n\n ", "\n\n ", ";\n\n ", "\n"])), function (_a) {
|
229
229
|
var state = _a.state;
|
230
230
|
return (state === 'disabled' ? 'not-allowed' : 'text');
|
231
231
|
}, function (_a) {
|
@@ -7,5 +7,5 @@ type Props = {
|
|
7
7
|
index: number;
|
8
8
|
rowHeight: number;
|
9
9
|
};
|
10
|
-
export default function ComponentBlockMatcher({ cbProps, device, index
|
10
|
+
export default function ComponentBlockMatcher({ cbProps, device, index }: Props): JSX.Element;
|
11
11
|
export {};
|
@@ -26,7 +26,7 @@ var Youtube_1 = require("../sections/CustomSection/components/ComponentBlock/com
|
|
26
26
|
var newUtils_1 = require("../sections/CustomSection/newUtils");
|
27
27
|
var types_1 = require("../sections/CustomSection/types");
|
28
28
|
function ComponentBlockMatcher(_a) {
|
29
|
-
var cbProps = _a.cbProps, device = _a.device, index = _a.index
|
29
|
+
var cbProps = _a.cbProps, device = _a.device, index = _a.index;
|
30
30
|
var componentBlockCode = cbProps.componentBlockCode, data = cbProps.jsonProperties.data;
|
31
31
|
var propsWithValue = device === 'MOBILE' ? (0, newUtils_1.replaceUndefinedValues)(data) : data;
|
32
32
|
switch (componentBlockCode) {
|
@@ -1,4 +1,4 @@
|
|
1
1
|
/// <reference types="react" />
|
2
2
|
import type { DynamicLayoutProps } from './types';
|
3
|
-
declare function DynamicLayout({ device, mode, isPreview, sections, scrollDownTargetSectionId, editingSectionId, navigationHandler, sectionActionHandler, onClickEditSection, programmedSectionComponents, shortcutKeyMode, dynamicLayoutRef }: DynamicLayoutProps): JSX.Element;
|
3
|
+
declare function DynamicLayout({ device, mode, isPreview, sections, scrollDownTargetSectionId, editingSectionId, navigationHandler, sectionActionHandler, onClickEditSection, programmedSectionComponents, shortcutKeyMode, dynamicLayoutRef, zoomScale }: DynamicLayoutProps): JSX.Element;
|
4
4
|
export default DynamicLayout;
|
@@ -25,7 +25,7 @@ var EditModeSectionMatcher_1 = require("./components/EditModeSectionMatcher");
|
|
25
25
|
var SectionMatcher_1 = require("./components/SectionMatcher");
|
26
26
|
var dynamicLayoutContext_1 = require("./dynamicLayoutContext");
|
27
27
|
function DynamicLayout(_a) {
|
28
|
-
var device = _a.device, _b = _a.mode, mode = _b === void 0 ? 'NORMAL' : _b, isPreview = _a.isPreview, sections = _a.sections, scrollDownTargetSectionId = _a.scrollDownTargetSectionId, editingSectionId = _a.editingSectionId, navigationHandler = _a.navigationHandler, sectionActionHandler = _a.sectionActionHandler, onClickEditSection = _a.onClickEditSection, programmedSectionComponents = _a.programmedSectionComponents, shortcutKeyMode = _a.shortcutKeyMode, dynamicLayoutRef = _a.dynamicLayoutRef;
|
28
|
+
var device = _a.device, _b = _a.mode, mode = _b === void 0 ? 'NORMAL' : _b, isPreview = _a.isPreview, sections = _a.sections, scrollDownTargetSectionId = _a.scrollDownTargetSectionId, editingSectionId = _a.editingSectionId, navigationHandler = _a.navigationHandler, sectionActionHandler = _a.sectionActionHandler, onClickEditSection = _a.onClickEditSection, programmedSectionComponents = _a.programmedSectionComponents, shortcutKeyMode = _a.shortcutKeyMode, dynamicLayoutRef = _a.dynamicLayoutRef, zoomScale = _a.zoomScale;
|
29
29
|
var filteredSortedSection = __spreadArray([], sections, true).filter(function (section) {
|
30
30
|
var _a;
|
31
31
|
if (!section.display) {
|
@@ -50,7 +50,8 @@ function DynamicLayout(_a) {
|
|
50
50
|
sectionActionHandler: sectionActionHandler,
|
51
51
|
editingSectionId: editingSectionId,
|
52
52
|
programmedSectionComponents: programmedSectionComponents,
|
53
|
-
shortcutKeyMode: shortcutKeyMode
|
53
|
+
shortcutKeyMode: shortcutKeyMode,
|
54
|
+
zoomScale: zoomScale
|
54
55
|
} }, { children: [mode === 'EDIT' && onClickEditSection && ((0, jsx_runtime_1.jsx)(EditModeSectionMatcher_1.EditModeSectionMatcher, { dynamicLayoutRef: dynamicLayoutRef, editingSectionId: editingSectionId, scrollDownTargetSectionId: scrollDownTargetSectionId, filteredSortedSection: filteredSortedSection, onClickEditSection: onClickEditSection })), mode !== 'EDIT' &&
|
55
56
|
(iframeSection ? ((0, jsx_runtime_1.jsx)(SectionMatcher_1.SectionMatcher, __assign({}, iframeSection), iframeSection.id)) : (filteredSortedSection.map(function (section) { return (0, jsx_runtime_1.jsx)(SectionMatcher_1.SectionMatcher, __assign({}, section), section.id); })))] })));
|
56
57
|
}
|