@snack-uikit/fields 0.54.1-preview-1078c3b3.0 → 0.55.1-preview-ff470bb3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/README.md +3 -2
- package/dist/cjs/components/FieldSelect/FieldSelectSingle.js +2 -2
- package/dist/cjs/components/FieldTime/FieldTime.d.ts +22 -2
- package/dist/cjs/components/FieldTime/FieldTime.js +5 -3
- package/dist/esm/components/FieldSelect/FieldSelectSingle.js +2 -2
- package/dist/esm/components/FieldTime/FieldTime.d.ts +22 -2
- package/dist/esm/components/FieldTime/FieldTime.js +2 -2
- package/package.json +4 -4
- package/src/components/FieldSelect/FieldSelectSingle.tsx +2 -2
- package/src/components/FieldTime/FieldTime.tsx +3 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# 0.55.0 (2026-04-21)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **IAM-6423:** re-export custom option hooks ([067fd9b](https://github.com/cloud-ru-tech/snack-uikit/commit/067fd9b98a0be675d3d9fe8fe3d1b1f13a6813db))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
# 0.54.0 (2026-04-21)
|
|
7
18
|
|
|
8
19
|
|
package/README.md
CHANGED
|
@@ -938,6 +938,7 @@ FieldStepper в основном предназначен для работы с
|
|
|
938
938
|
| onCopyButtonClick | `() => void` | - | Колбек клика по кнопке Копировать для поля |
|
|
939
939
|
| showSeconds | `boolean` | true | Показывать ли секунды |
|
|
940
940
|
| showClearButton | `boolean` | true | Отображение кнопки Очистки поля |
|
|
941
|
+
| footerMode | enum TimePickerFooterMode: `"current-and-apply"`, `"apply-only"` | current-and-apply | Режим футера: кнопка «Текущее время» и компактная «Применить», либо одна широкая «Применить» с подписью. |
|
|
941
942
|
| id | `string` | - | Значение html-атрибута id |
|
|
942
943
|
| name | `string` | - | Значение html-атрибута name |
|
|
943
944
|
| disabled | `boolean` | - | Является ли поле деактивированным |
|
|
@@ -962,8 +963,8 @@ FieldStepper в основном предназначен для работы с
|
|
|
962
963
|
### Props
|
|
963
964
|
| name | type | default value | description |
|
|
964
965
|
|------|------|---------------|-------------|
|
|
965
|
-
| __@metadata@
|
|
966
|
-
| __@hasInstance@
|
|
966
|
+
| __@metadata@2033* | `DecoratorMetadataObject` | - | |
|
|
967
|
+
| __@hasInstance@2031* | `(value: any) => boolean` | - | Determines whether the given value inherits from this function if this function was used as a constructor function. A constructor function can control which objects are recognized as its instances by 'instanceof' by overriding this method. |
|
|
967
968
|
| name* | `string` | - | Returns the name of the function. Function names are read-only and can not be changed. |
|
|
968
969
|
| caller* | `Function` | - | |
|
|
969
970
|
| arguments* | `any` | - | |
|
|
@@ -60,7 +60,7 @@ exports.FieldSelectSingle = (0, react_1.forwardRef)((props, ref) => {
|
|
|
60
60
|
prefix,
|
|
61
61
|
postfix,
|
|
62
62
|
addOptionByEnter = false,
|
|
63
|
-
addCustomOptionTriggers
|
|
63
|
+
addCustomOptionTriggers,
|
|
64
64
|
untouchableScrollbars = false,
|
|
65
65
|
open: openProp,
|
|
66
66
|
onOpenChange,
|
|
@@ -178,7 +178,7 @@ exports.FieldSelectSingle = (0, react_1.forwardRef)((props, ref) => {
|
|
|
178
178
|
resolvedAddCustomOptionTriggers,
|
|
179
179
|
tryCommitCustomOptionFromInput
|
|
180
180
|
} = (0, hooks_2.useFieldSelectSingleCustomOption)({
|
|
181
|
-
addCustomOptionTriggers
|
|
181
|
+
addCustomOptionTriggers,
|
|
182
182
|
addOptionByEnter,
|
|
183
183
|
inputValue,
|
|
184
184
|
handleSelectionChange
|
|
@@ -24,9 +24,29 @@ type FieldTimeOwnProps = {
|
|
|
24
24
|
* @default true
|
|
25
25
|
*/
|
|
26
26
|
showClearButton?: boolean;
|
|
27
|
-
}
|
|
27
|
+
} & Pick<TimePickerProps, 'footerMode'>;
|
|
28
28
|
export type FieldTimeProps = WithSupportProps<FieldTimeOwnProps & InputProps & WrapperProps>;
|
|
29
29
|
export declare const FieldTime: import("react").ForwardRefExoticComponent<{
|
|
30
30
|
'data-test-id'?: string;
|
|
31
|
-
} & import("react").AriaAttributes &
|
|
31
|
+
} & import("react").AriaAttributes & {
|
|
32
|
+
/** Открыт time-picker */
|
|
33
|
+
open?: boolean;
|
|
34
|
+
/** Колбек открытия пикера */
|
|
35
|
+
onOpenChange?(value: boolean): void;
|
|
36
|
+
/** Значение поля */
|
|
37
|
+
value?: TimePickerProps["value"];
|
|
38
|
+
/** Колбек смены значения */
|
|
39
|
+
onChange?: TimePickerProps["onChangeValue"];
|
|
40
|
+
/** Отображение кнопки копирования */
|
|
41
|
+
showCopyButton?: boolean;
|
|
42
|
+
/** Колбек клика по кнопке Копировать для поля */
|
|
43
|
+
onCopyButtonClick?(): void;
|
|
44
|
+
/** Показывать ли секунды */
|
|
45
|
+
showSeconds?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Отображение кнопки Очистки поля
|
|
48
|
+
* @default true
|
|
49
|
+
*/
|
|
50
|
+
showClearButton?: boolean;
|
|
51
|
+
} & Pick<TimePickerProps, "footerMode"> & InputProps & WrapperProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
32
52
|
export {};
|
|
@@ -78,9 +78,10 @@ exports.FieldTime = (0, react_1.forwardRef)((_a, ref) => {
|
|
|
78
78
|
validationState = constants_1.VALIDATION_STATE.Default,
|
|
79
79
|
error,
|
|
80
80
|
onCopyButtonClick,
|
|
81
|
-
autoFocus
|
|
81
|
+
autoFocus,
|
|
82
|
+
footerMode
|
|
82
83
|
} = _a,
|
|
83
|
-
rest = __rest(_a, ["id", "name", "value", "disabled", "readonly", "showCopyButton", "showClearButton", "open", "onOpenChange", "onChange", "onFocus", "onBlur", "className", "label", "labelTooltip", "labelTooltipPlacement", "required", "caption", "hint", "showHintIcon", "showSeconds", "size", "validationState", "error", "onCopyButtonClick", "autoFocus"]);
|
|
84
|
+
rest = __rest(_a, ["id", "name", "value", "disabled", "readonly", "showCopyButton", "showClearButton", "open", "onOpenChange", "onChange", "onFocus", "onBlur", "className", "label", "labelTooltip", "labelTooltipPlacement", "required", "caption", "hint", "showHintIcon", "showSeconds", "size", "validationState", "error", "onCopyButtonClick", "autoFocus", "footerMode"]);
|
|
84
85
|
const [isOpen, setIsOpen] = (0, uncontrollable_1.useUncontrolledProp)(open, false, onOpenChange);
|
|
85
86
|
const localRef = (0, react_1.useRef)(null);
|
|
86
87
|
const clearButtonRef = (0, react_1.useRef)(null);
|
|
@@ -264,7 +265,8 @@ exports.FieldTime = (0, react_1.forwardRef)((_a, ref) => {
|
|
|
264
265
|
onFocusLeave: handleCalendarFocusLeave,
|
|
265
266
|
"data-test-id": 'field-time__timepicker',
|
|
266
267
|
fitToContainer: false,
|
|
267
|
-
showSeconds: showSeconds
|
|
268
|
+
showSeconds: showSeconds,
|
|
269
|
+
footerMode: footerMode
|
|
268
270
|
}),
|
|
269
271
|
children: (0, jsx_runtime_1.jsx)(helperComponents_1.FieldContainerPrivate, {
|
|
270
272
|
className: styles_module_scss_1.default.container,
|
|
@@ -29,7 +29,7 @@ const defaultSelectedOptionFormatter = item =>
|
|
|
29
29
|
// @ts-expect-error
|
|
30
30
|
(item === null || item === void 0 ? void 0 : item.content.option) || '';
|
|
31
31
|
export const FieldSelectSingle = forwardRef((props, ref) => {
|
|
32
|
-
const { id, name, placeholder, size = 's', options, value: valueProp, defaultValue, onChange: onChangeProp, disabled = false, readonly = false, searchable = true, showCopyButton = true, showClearButton = true, onKeyDown: onInputKeyDownProp, required = false, validationState = 'default', search, autocomplete = false, prefixIcon, prefix, postfix, addOptionByEnter = false, addCustomOptionTriggers
|
|
32
|
+
const { id, name, placeholder, size = 's', options, value: valueProp, defaultValue, onChange: onChangeProp, disabled = false, readonly = false, searchable = true, showCopyButton = true, showClearButton = true, onKeyDown: onInputKeyDownProp, required = false, validationState = 'default', search, autocomplete = false, prefixIcon, prefix, postfix, addOptionByEnter = false, addCustomOptionTriggers, untouchableScrollbars = false, open: openProp, onOpenChange, selectedOptionFormatter = defaultSelectedOptionFormatter, enableFuzzySearch = true, resetSearchOnOptionSelection = true, onCopyButtonClick, autoFocus } = props, rest = __rest(props, ["id", "name", "placeholder", "size", "options", "value", "defaultValue", "onChange", "disabled", "readonly", "searchable", "showCopyButton", "showClearButton", "onKeyDown", "required", "validationState", "search", "autocomplete", "prefixIcon", "prefix", "postfix", "addOptionByEnter", "addCustomOptionTriggers", "untouchableScrollbars", "open", "onOpenChange", "selectedOptionFormatter", "enableFuzzySearch", "resetSearchOnOptionSelection", "onCopyButtonClick", "autoFocus"]);
|
|
33
33
|
const localRef = useRef(null);
|
|
34
34
|
const [open = false, setOpen] = useValueControl({ value: openProp, onChange: onOpenChange });
|
|
35
35
|
const [value, setValue] = useValueControl({
|
|
@@ -91,7 +91,7 @@ export const FieldSelectSingle = forwardRef((props, ref) => {
|
|
|
91
91
|
}
|
|
92
92
|
}, [setOpen, setValue]);
|
|
93
93
|
const { resolvedAddCustomOptionTriggers, tryCommitCustomOptionFromInput } = useFieldSelectSingleCustomOption({
|
|
94
|
-
addCustomOptionTriggers
|
|
94
|
+
addCustomOptionTriggers,
|
|
95
95
|
addOptionByEnter,
|
|
96
96
|
inputValue,
|
|
97
97
|
handleSelectionChange,
|
|
@@ -24,9 +24,29 @@ type FieldTimeOwnProps = {
|
|
|
24
24
|
* @default true
|
|
25
25
|
*/
|
|
26
26
|
showClearButton?: boolean;
|
|
27
|
-
}
|
|
27
|
+
} & Pick<TimePickerProps, 'footerMode'>;
|
|
28
28
|
export type FieldTimeProps = WithSupportProps<FieldTimeOwnProps & InputProps & WrapperProps>;
|
|
29
29
|
export declare const FieldTime: import("react").ForwardRefExoticComponent<{
|
|
30
30
|
'data-test-id'?: string;
|
|
31
|
-
} & import("react").AriaAttributes &
|
|
31
|
+
} & import("react").AriaAttributes & {
|
|
32
|
+
/** Открыт time-picker */
|
|
33
|
+
open?: boolean;
|
|
34
|
+
/** Колбек открытия пикера */
|
|
35
|
+
onOpenChange?(value: boolean): void;
|
|
36
|
+
/** Значение поля */
|
|
37
|
+
value?: TimePickerProps["value"];
|
|
38
|
+
/** Колбек смены значения */
|
|
39
|
+
onChange?: TimePickerProps["onChangeValue"];
|
|
40
|
+
/** Отображение кнопки копирования */
|
|
41
|
+
showCopyButton?: boolean;
|
|
42
|
+
/** Колбек клика по кнопке Копировать для поля */
|
|
43
|
+
onCopyButtonClick?(): void;
|
|
44
|
+
/** Показывать ли секунды */
|
|
45
|
+
showSeconds?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Отображение кнопки Очистки поля
|
|
48
|
+
* @default true
|
|
49
|
+
*/
|
|
50
|
+
showClearButton?: boolean;
|
|
51
|
+
} & Pick<TimePickerProps, "footerMode"> & InputProps & WrapperProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
32
52
|
export {};
|
|
@@ -40,7 +40,7 @@ const getStringTimeValue = (time, { showSeconds, locale }) => {
|
|
|
40
40
|
});
|
|
41
41
|
};
|
|
42
42
|
export const FieldTime = forwardRef((_a, ref) => {
|
|
43
|
-
var { id, name, value: valueProp, disabled = false, readonly = false, showCopyButton: showCopyButtonProp = true, showClearButton: showClearButtonProp = true, open, onOpenChange, onChange, onFocus, onBlur: onBlurProp, className, label, labelTooltip, labelTooltipPlacement, required = false, caption, hint, showHintIcon, showSeconds = true, size = SIZE.S, validationState = VALIDATION_STATE.Default, error, onCopyButtonClick, autoFocus } = _a, rest = __rest(_a, ["id", "name", "value", "disabled", "readonly", "showCopyButton", "showClearButton", "open", "onOpenChange", "onChange", "onFocus", "onBlur", "className", "label", "labelTooltip", "labelTooltipPlacement", "required", "caption", "hint", "showHintIcon", "showSeconds", "size", "validationState", "error", "onCopyButtonClick", "autoFocus"]);
|
|
43
|
+
var { id, name, value: valueProp, disabled = false, readonly = false, showCopyButton: showCopyButtonProp = true, showClearButton: showClearButtonProp = true, open, onOpenChange, onChange, onFocus, onBlur: onBlurProp, className, label, labelTooltip, labelTooltipPlacement, required = false, caption, hint, showHintIcon, showSeconds = true, size = SIZE.S, validationState = VALIDATION_STATE.Default, error, onCopyButtonClick, autoFocus, footerMode } = _a, rest = __rest(_a, ["id", "name", "value", "disabled", "readonly", "showCopyButton", "showClearButton", "open", "onOpenChange", "onChange", "onFocus", "onBlur", "className", "label", "labelTooltip", "labelTooltipPlacement", "required", "caption", "hint", "showHintIcon", "showSeconds", "size", "validationState", "error", "onCopyButtonClick", "autoFocus", "footerMode"]);
|
|
44
44
|
const [isOpen, setIsOpen] = useUncontrolledProp(open, false, onOpenChange);
|
|
45
45
|
const localRef = useRef(null);
|
|
46
46
|
const clearButtonRef = useRef(null);
|
|
@@ -157,5 +157,5 @@ export const FieldTime = forwardRef((_a, ref) => {
|
|
|
157
157
|
: {
|
|
158
158
|
open: showDropList,
|
|
159
159
|
onOpenChange: setIsOpen,
|
|
160
|
-
}), { content: _jsx(TimePicker, { size: size, value: valueProp, onChangeValue: handleSelectTime, navigationStartRef: navigationStartRef, onFocusLeave: handleCalendarFocusLeave, "data-test-id": 'field-time__timepicker', fitToContainer: false, showSeconds: showSeconds }), children: _jsx(FieldContainerPrivate, { className: styles.container, size: size, validationState: fieldValidationState, disabled: disabled, readonly: readonly, variant: CONTAINER_VARIANT.SingleLine, focused: showDropList, inputRef: localRef, postfix: postfixButtons, children: _jsx(InputPrivate, { ref: mergeRefs(ref, localRef), "data-size": size, value: value || '', placeholder: mask, onChange: handleChange, onFocus: inputHandlers.onFocus, onMouseDown: inputHandlers.onMouseDown, onBlur: onBlur, onKeyDown: handleInputKeyDown, onClick: onClick, disabled: disabled, readonly: readonly, tabIndex: inputTabIndex, type: 'text', inputMode: 'numeric', id: id, name: name, autoFocus: autoFocus, "data-test-id": 'field-time__input' }) }) })) })));
|
|
160
|
+
}), { content: _jsx(TimePicker, { size: size, value: valueProp, onChangeValue: handleSelectTime, navigationStartRef: navigationStartRef, onFocusLeave: handleCalendarFocusLeave, "data-test-id": 'field-time__timepicker', fitToContainer: false, showSeconds: showSeconds, footerMode: footerMode }), children: _jsx(FieldContainerPrivate, { className: styles.container, size: size, validationState: fieldValidationState, disabled: disabled, readonly: readonly, variant: CONTAINER_VARIANT.SingleLine, focused: showDropList, inputRef: localRef, postfix: postfixButtons, children: _jsx(InputPrivate, { ref: mergeRefs(ref, localRef), "data-size": size, value: value || '', placeholder: mask, onChange: handleChange, onFocus: inputHandlers.onFocus, onMouseDown: inputHandlers.onMouseDown, onBlur: onBlur, onKeyDown: handleInputKeyDown, onClick: onClick, disabled: disabled, readonly: readonly, tabIndex: inputTabIndex, type: 'text', inputMode: 'numeric', id: id, name: name, autoFocus: autoFocus, "data-test-id": 'field-time__input' }) }) })) })));
|
|
161
161
|
});
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
6
|
"title": "Fields",
|
|
7
|
-
"version": "0.
|
|
7
|
+
"version": "0.55.1-preview-ff470bb3.0",
|
|
8
8
|
"sideEffects": [
|
|
9
9
|
"*.css",
|
|
10
10
|
"*.woff",
|
|
@@ -37,13 +37,13 @@
|
|
|
37
37
|
"scripts": {},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@snack-uikit/button": "0.19.17",
|
|
40
|
-
"@snack-uikit/calendar": "0.13.
|
|
40
|
+
"@snack-uikit/calendar": "0.13.20-preview-ff470bb3.0",
|
|
41
41
|
"@snack-uikit/color-picker": "0.3.55",
|
|
42
42
|
"@snack-uikit/divider": "3.2.11",
|
|
43
43
|
"@snack-uikit/dropdown": "0.5.5",
|
|
44
44
|
"@snack-uikit/icons": "0.27.7",
|
|
45
45
|
"@snack-uikit/input-private": "4.8.8",
|
|
46
|
-
"@snack-uikit/list": "0.
|
|
46
|
+
"@snack-uikit/list": "0.33.0",
|
|
47
47
|
"@snack-uikit/scroll": "0.10.8",
|
|
48
48
|
"@snack-uikit/skeleton": "0.6.10",
|
|
49
49
|
"@snack-uikit/slider": "0.3.36",
|
|
@@ -66,5 +66,5 @@
|
|
|
66
66
|
"peerDependencies": {
|
|
67
67
|
"@snack-uikit/locale": "*"
|
|
68
68
|
},
|
|
69
|
-
"gitHead": "
|
|
69
|
+
"gitHead": "9cb3640f627845ea5054cf3a16998c30419f1691"
|
|
70
70
|
}
|
|
@@ -60,7 +60,7 @@ export const FieldSelectSingle = forwardRef<HTMLInputElement, FieldSelectSingleP
|
|
|
60
60
|
prefix,
|
|
61
61
|
postfix,
|
|
62
62
|
addOptionByEnter = false,
|
|
63
|
-
addCustomOptionTriggers
|
|
63
|
+
addCustomOptionTriggers,
|
|
64
64
|
untouchableScrollbars = false,
|
|
65
65
|
open: openProp,
|
|
66
66
|
onOpenChange,
|
|
@@ -157,7 +157,7 @@ export const FieldSelectSingle = forwardRef<HTMLInputElement, FieldSelectSingleP
|
|
|
157
157
|
);
|
|
158
158
|
|
|
159
159
|
const { resolvedAddCustomOptionTriggers, tryCommitCustomOptionFromInput } = useFieldSelectSingleCustomOption({
|
|
160
|
-
addCustomOptionTriggers
|
|
160
|
+
addCustomOptionTriggers,
|
|
161
161
|
addOptionByEnter,
|
|
162
162
|
inputValue,
|
|
163
163
|
handleSelectionChange,
|
|
@@ -61,7 +61,7 @@ type FieldTimeOwnProps = {
|
|
|
61
61
|
* @default true
|
|
62
62
|
*/
|
|
63
63
|
showClearButton?: boolean;
|
|
64
|
-
}
|
|
64
|
+
} & Pick<TimePickerProps, 'footerMode'>;
|
|
65
65
|
|
|
66
66
|
export type FieldTimeProps = WithSupportProps<FieldTimeOwnProps & InputProps & WrapperProps>;
|
|
67
67
|
|
|
@@ -114,6 +114,7 @@ export const FieldTime = forwardRef<HTMLInputElement, FieldTimeProps>(
|
|
|
114
114
|
error,
|
|
115
115
|
onCopyButtonClick,
|
|
116
116
|
autoFocus,
|
|
117
|
+
footerMode,
|
|
117
118
|
...rest
|
|
118
119
|
},
|
|
119
120
|
ref,
|
|
@@ -313,6 +314,7 @@ export const FieldTime = forwardRef<HTMLInputElement, FieldTimeProps>(
|
|
|
313
314
|
data-test-id='field-time__timepicker'
|
|
314
315
|
fitToContainer={false}
|
|
315
316
|
showSeconds={showSeconds}
|
|
317
|
+
footerMode={footerMode}
|
|
316
318
|
/>
|
|
317
319
|
}
|
|
318
320
|
>
|