@snack-uikit/fields 0.52.0 → 0.52.1-preview-0aba136f.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/README.md +3 -2
- package/dist/cjs/components/FieldTime/FieldTime.d.ts +2 -0
- package/dist/cjs/components/FieldTime/FieldTime.js +5 -3
- package/dist/esm/components/FieldTime/FieldTime.d.ts +2 -0
- package/dist/esm/components/FieldTime/FieldTime.js +2 -2
- package/package.json +7 -7
- package/src/components/FieldTime/FieldTime.tsx +4 -0
package/README.md
CHANGED
|
@@ -907,6 +907,7 @@ FieldStepper в основном предназначен для работы с
|
|
|
907
907
|
| onCopyButtonClick | `() => void` | - | Колбек клика по кнопке Копировать для поля |
|
|
908
908
|
| showSeconds | `boolean` | true | Показывать ли секунды |
|
|
909
909
|
| showClearButton | `boolean` | true | Отображение кнопки Очистки поля |
|
|
910
|
+
| showCurrentButton | `boolean` | - | Показывать ли кнопку выбора текущего времени в таймпикере |
|
|
910
911
|
| id | `string` | - | Значение html-атрибута id |
|
|
911
912
|
| name | `string` | - | Значение html-атрибута name |
|
|
912
913
|
| disabled | `boolean` | - | Является ли поле деактивированным |
|
|
@@ -931,8 +932,8 @@ FieldStepper в основном предназначен для работы с
|
|
|
931
932
|
### Props
|
|
932
933
|
| name | type | default value | description |
|
|
933
934
|
|------|------|---------------|-------------|
|
|
934
|
-
| __@metadata@
|
|
935
|
-
| __@hasInstance@
|
|
935
|
+
| __@metadata@1888* | `DecoratorMetadataObject` | - | |
|
|
936
|
+
| __@hasInstance@1886* | `(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. |
|
|
936
937
|
| name* | `string` | - | Returns the name of the function. Function names are read-only and can not be changed. |
|
|
937
938
|
| caller* | `Function` | - | |
|
|
938
939
|
| arguments* | `any` | - | |
|
|
@@ -24,6 +24,8 @@ type FieldTimeOwnProps = {
|
|
|
24
24
|
* @default true
|
|
25
25
|
*/
|
|
26
26
|
showClearButton?: boolean;
|
|
27
|
+
/** Показывать ли кнопку выбора текущего времени в таймпикере */
|
|
28
|
+
showCurrentButton?: boolean;
|
|
27
29
|
};
|
|
28
30
|
export type FieldTimeProps = WithSupportProps<FieldTimeOwnProps & InputProps & WrapperProps>;
|
|
29
31
|
export declare const FieldTime: import("react").ForwardRefExoticComponent<{
|
|
@@ -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
|
+
showCurrentButton
|
|
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", "showCurrentButton"]);
|
|
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
|
+
showCurrentButton: showCurrentButton
|
|
268
270
|
}),
|
|
269
271
|
children: (0, jsx_runtime_1.jsx)(helperComponents_1.FieldContainerPrivate, {
|
|
270
272
|
className: styles_module_scss_1.default.container,
|
|
@@ -24,6 +24,8 @@ type FieldTimeOwnProps = {
|
|
|
24
24
|
* @default true
|
|
25
25
|
*/
|
|
26
26
|
showClearButton?: boolean;
|
|
27
|
+
/** Показывать ли кнопку выбора текущего времени в таймпикере */
|
|
28
|
+
showCurrentButton?: boolean;
|
|
27
29
|
};
|
|
28
30
|
export type FieldTimeProps = WithSupportProps<FieldTimeOwnProps & InputProps & WrapperProps>;
|
|
29
31
|
export declare const FieldTime: import("react").ForwardRefExoticComponent<{
|
|
@@ -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, showCurrentButton } = _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", "showCurrentButton"]);
|
|
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, showCurrentButton: showCurrentButton }), 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.52.0",
|
|
7
|
+
"version": "0.52.1-preview-0aba136f.0",
|
|
8
8
|
"sideEffects": [
|
|
9
9
|
"*.css",
|
|
10
10
|
"*.woff",
|
|
@@ -37,17 +37,17 @@
|
|
|
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.16-preview-0aba136f.0",
|
|
41
41
|
"@snack-uikit/color-picker": "0.3.53",
|
|
42
42
|
"@snack-uikit/divider": "3.2.11",
|
|
43
43
|
"@snack-uikit/dropdown": "0.5.4",
|
|
44
44
|
"@snack-uikit/icons": "0.27.7",
|
|
45
45
|
"@snack-uikit/input-private": "4.8.8",
|
|
46
|
-
"@snack-uikit/list": "0.32.
|
|
47
|
-
"@snack-uikit/scroll": "0.10.
|
|
46
|
+
"@snack-uikit/list": "0.32.15-preview-0aba136f.0",
|
|
47
|
+
"@snack-uikit/scroll": "0.10.8-preview-0aba136f.0",
|
|
48
48
|
"@snack-uikit/skeleton": "0.6.10",
|
|
49
|
-
"@snack-uikit/slider": "0.3.
|
|
50
|
-
"@snack-uikit/tag": "0.15.
|
|
49
|
+
"@snack-uikit/slider": "0.3.34-preview-0aba136f.0",
|
|
50
|
+
"@snack-uikit/tag": "0.15.16-preview-0aba136f.0",
|
|
51
51
|
"@snack-uikit/tooltip": "0.18.10",
|
|
52
52
|
"@snack-uikit/truncate-string": "0.7.9",
|
|
53
53
|
"@snack-uikit/utils": "4.0.1",
|
|
@@ -66,5 +66,5 @@
|
|
|
66
66
|
"peerDependencies": {
|
|
67
67
|
"@snack-uikit/locale": "*"
|
|
68
68
|
},
|
|
69
|
-
"gitHead": "
|
|
69
|
+
"gitHead": "a2db41da4366417b6ff322f3a1ba73da8ba96222"
|
|
70
70
|
}
|
|
@@ -61,6 +61,8 @@ type FieldTimeOwnProps = {
|
|
|
61
61
|
* @default true
|
|
62
62
|
*/
|
|
63
63
|
showClearButton?: boolean;
|
|
64
|
+
/** Показывать ли кнопку выбора текущего времени в таймпикере */
|
|
65
|
+
showCurrentButton?: boolean;
|
|
64
66
|
};
|
|
65
67
|
|
|
66
68
|
export type FieldTimeProps = WithSupportProps<FieldTimeOwnProps & InputProps & WrapperProps>;
|
|
@@ -114,6 +116,7 @@ export const FieldTime = forwardRef<HTMLInputElement, FieldTimeProps>(
|
|
|
114
116
|
error,
|
|
115
117
|
onCopyButtonClick,
|
|
116
118
|
autoFocus,
|
|
119
|
+
showCurrentButton,
|
|
117
120
|
...rest
|
|
118
121
|
},
|
|
119
122
|
ref,
|
|
@@ -313,6 +316,7 @@ export const FieldTime = forwardRef<HTMLInputElement, FieldTimeProps>(
|
|
|
313
316
|
data-test-id='field-time__timepicker'
|
|
314
317
|
fitToContainer={false}
|
|
315
318
|
showSeconds={showSeconds}
|
|
319
|
+
showCurrentButton={showCurrentButton}
|
|
316
320
|
/>
|
|
317
321
|
}
|
|
318
322
|
>
|