@alfalab/core-components-input-autocomplete 14.0.6 → 14.0.7
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/autocomplete-field/Component.js +9 -19
- package/autocomplete-field/Component.js.map +1 -1
- package/autocomplete-field/index.css +1 -1
- package/autocomplete-field/index.module.css.js +1 -1
- package/autocomplete-mobile-field/Component.js +10 -35
- package/autocomplete-mobile-field/Component.js.map +1 -1
- package/autocomplete-mobile-field/index.css +10 -10
- package/autocomplete-mobile-field/index.module.css.js +1 -1
- package/cssm/autocomplete-field/Component.js +9 -19
- package/cssm/autocomplete-field/Component.js.map +1 -1
- package/cssm/autocomplete-mobile-field/Component.js +13 -38
- package/cssm/autocomplete-mobile-field/Component.js.map +1 -1
- package/esm/autocomplete-field/Component.js +10 -20
- package/esm/autocomplete-field/Component.js.map +1 -1
- package/esm/autocomplete-field/index.css +1 -1
- package/esm/autocomplete-field/index.module.css.js +1 -1
- package/esm/autocomplete-mobile-field/Component.js +12 -37
- package/esm/autocomplete-mobile-field/Component.js.map +1 -1
- package/esm/autocomplete-mobile-field/index.css +10 -10
- package/esm/autocomplete-mobile-field/index.module.css.js +1 -1
- package/esm/mobile/mobile.css +1 -1
- package/esm/mobile/mobile.module.css.js +1 -1
- package/mobile/mobile.css +1 -1
- package/mobile/mobile.module.css.js +1 -1
- package/modern/autocomplete-field/Component.js +7 -17
- package/modern/autocomplete-field/Component.js.map +1 -1
- package/modern/autocomplete-field/index.css +1 -1
- package/modern/autocomplete-field/index.module.css.js +1 -1
- package/modern/autocomplete-mobile-field/Component.js +12 -37
- package/modern/autocomplete-mobile-field/Component.js.map +1 -1
- package/modern/autocomplete-mobile-field/index.css +10 -10
- package/modern/autocomplete-mobile-field/index.module.css.js +1 -1
- package/modern/mobile/mobile.css +1 -1
- package/modern/mobile/mobile.module.css.js +1 -1
- package/moderncssm/autocomplete-field/Component.js +7 -17
- package/moderncssm/autocomplete-field/Component.js.map +1 -1
- package/moderncssm/autocomplete-mobile-field/Component.js +12 -37
- package/moderncssm/autocomplete-mobile-field/Component.js.map +1 -1
- package/package.json +5 -5
- package/src/autocomplete-field/Component.tsx +9 -16
- package/src/autocomplete-mobile-field/Component.tsx +17 -37
|
@@ -7,7 +7,6 @@ var React = require('react');
|
|
|
7
7
|
var mergeRefs = require('react-merge-refs');
|
|
8
8
|
var cn = require('classnames');
|
|
9
9
|
var desktop = require('@alfalab/core-components-input/desktop');
|
|
10
|
-
var getAddonsByPriority = require('@alfalab/core-components-input/helpers/get-addons-by-priority');
|
|
11
10
|
var enums = require('../enums.js');
|
|
12
11
|
var index_module = require('./index.module.css.js');
|
|
13
12
|
|
|
@@ -40,27 +39,18 @@ var AutocompleteField = function (_a) {
|
|
|
40
39
|
* [1] - Indicators (eye, calendar, chevron, stepper e.g.)
|
|
41
40
|
* [0] - Lock
|
|
42
41
|
*/
|
|
43
|
-
var
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
predicate: Boolean(Arrow) && !inputDisabled,
|
|
52
|
-
render: function () {
|
|
53
|
-
var _a;
|
|
54
|
-
return (React__default.default.createElement("span", { className: cn__default.default(index_module.arrow, (_a = {},
|
|
55
|
-
_a[index_module.error] = error,
|
|
56
|
-
_a)) }, Arrow));
|
|
57
|
-
},
|
|
58
|
-
},
|
|
59
|
-
]);
|
|
42
|
+
var renderRightAddons = function () {
|
|
43
|
+
var _a;
|
|
44
|
+
return (React__default.default.createElement(React.Fragment, null,
|
|
45
|
+
inputProps.rightAddons,
|
|
46
|
+
Arrow && !inputDisabled && (React__default.default.createElement("span", { className: cn__default.default(index_module.arrow, (_a = {},
|
|
47
|
+
_a[index_module.error] = error,
|
|
48
|
+
_a)) }, Arrow))));
|
|
49
|
+
};
|
|
60
50
|
return (React__default.default.createElement(Input, tslib.__assign({ dataTestId: dataTestId }, inputProps, innerProps, { wrapperRef: mergeRefs__default.default([
|
|
61
51
|
innerProps.ref,
|
|
62
52
|
inputProps.wrapperRef,
|
|
63
|
-
]), ref: mergeRefs__default.default([inputRef, inputProps.ref]), disabled: disabled, readOnly: readOnly, block: true, label: label, labelView: labelView, placeholder: placeholder, size: size, error: error, success: success, hint: hint, onChange: handleInput, onClick: inputDisabled ? undefined : handleClick, onFocus: inputDisabled ? undefined : onFocus, autoComplete: 'off', value: value, rightAddons:
|
|
53
|
+
]), ref: mergeRefs__default.default([inputRef, inputProps.ref]), disabled: disabled, readOnly: readOnly, block: true, label: label, labelView: labelView, placeholder: placeholder, size: size, error: error, success: success, hint: hint, onChange: handleInput, onClick: inputDisabled ? undefined : handleClick, onFocus: inputDisabled ? undefined : onFocus, autoComplete: 'off', value: value, rightAddons: renderRightAddons() })));
|
|
64
54
|
};
|
|
65
55
|
|
|
66
56
|
exports.AutocompleteField = AutocompleteField;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Component.js","sources":["../src/autocomplete-field/Component.tsx"],"sourcesContent":["import React, { useCallback, useRef } from 'react';\nimport mergeRefs from 'react-merge-refs';\nimport cn from 'classnames';\n\nimport { type InputProps } from '@alfalab/core-components-input';\nimport { InputDesktop as DefaultInput } from '@alfalab/core-components-input/desktop';\nimport {
|
|
1
|
+
{"version":3,"file":"Component.js","sources":["../src/autocomplete-field/Component.tsx"],"sourcesContent":["import React, { Fragment, useCallback, useRef } from 'react';\nimport mergeRefs from 'react-merge-refs';\nimport cn from 'classnames';\n\nimport { type InputProps } from '@alfalab/core-components-input';\nimport { InputDesktop as DefaultInput } from '@alfalab/core-components-input/desktop';\nimport { type FieldProps } from '@alfalab/core-components-select/shared';\n\nimport { OnInputReason } from '../enums';\nimport { type InputAutocompleteCommonProps } from '../types';\n\nimport styles from './index.module.css';\n\nexport type AutocompleteFieldProps = FieldProps &\n Pick<InputAutocompleteCommonProps, 'Input' | 'inputProps' | 'value' | 'onInput' | 'readOnly'>;\n\nexport const AutocompleteField = ({\n label,\n labelView = 'inner',\n placeholder,\n size,\n Arrow,\n Input = DefaultInput,\n value,\n error,\n success,\n hint,\n disabled,\n readOnly,\n onInput,\n inputProps = {},\n innerProps,\n dataTestId,\n}: AutocompleteFieldProps) => {\n const inputRef = useRef<HTMLInputElement>(null);\n\n const { onClick, onFocus } = innerProps;\n\n const inputDisabled = disabled || readOnly;\n\n const handleClick = useCallback(\n (event: React.MouseEvent<HTMLDivElement>) => {\n if (onClick) onClick(event);\n\n if (inputRef.current) {\n inputRef.current.focus();\n }\n },\n [onClick],\n );\n\n const handleInput: InputProps['onChange'] = (_, payload) =>\n onInput?.(payload.value, OnInputReason.Change);\n\n /**\n * Right addons priority [4] <= [3] <= [2] <= [1] or [0]\n * [4] - Clear\n * [3] - Status (error, success)\n * [2] - Common (info, e.g.)\n * [1] - Indicators (eye, calendar, chevron, stepper e.g.)\n * [0] - Lock\n */\n const renderRightAddons = () => (\n <Fragment>\n {inputProps.rightAddons}\n {Arrow && !inputDisabled && (\n <span\n className={cn(styles.arrow, {\n [styles.error]: error,\n })}\n >\n {Arrow}\n </span>\n )}\n </Fragment>\n );\n\n return (\n <Input\n dataTestId={dataTestId}\n {...inputProps}\n {...innerProps}\n wrapperRef={mergeRefs([\n innerProps.ref as React.Ref<HTMLElement>,\n inputProps.wrapperRef as React.Ref<HTMLElement>,\n ])}\n ref={mergeRefs([inputRef, inputProps.ref as React.Ref<HTMLElement>])}\n disabled={disabled}\n readOnly={readOnly}\n block={true}\n label={label}\n labelView={labelView}\n placeholder={placeholder}\n size={size}\n error={error}\n success={success}\n hint={hint}\n onChange={handleInput}\n onClick={inputDisabled ? undefined : handleClick}\n onFocus={inputDisabled ? undefined : onFocus}\n autoComplete='off'\n value={value}\n rightAddons={renderRightAddons()}\n />\n );\n};\n"],"names":["DefaultInput","useRef","useCallback","OnInputReason","React","Fragment","cn","styles","__assign","mergeRefs"],"mappings":";;;;;;;;;;;;;;;;;;AAgBO,IAAM,iBAAiB,GAAG,UAAC,EAiB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E,aAAa,GAAG,SAAS,GAAG,OAAO,EAC5C,YAAY,EAAC,KAAK,EAClB,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,iBAAiB,EAAE,EAClC,CAAA,CAAA;AAEV;;;;"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
require('./index.css');
|
|
4
4
|
|
|
5
|
-
var styles = {"arrow":"input-
|
|
5
|
+
var styles = {"arrow":"input-autocomplete__arrow_1vetf","error":"input-autocomplete__error_1vetf"};
|
|
6
6
|
|
|
7
7
|
module.exports = styles;
|
|
8
8
|
//# sourceMappingURL=index.module.css.js.map
|
|
@@ -36,47 +36,22 @@ var AutocompleteMobileField = function (_a) {
|
|
|
36
36
|
* [1] - Indicators (eye, calendar, chevron, stepper e.g.)
|
|
37
37
|
* [0] - Lock
|
|
38
38
|
*/
|
|
39
|
-
var
|
|
40
|
-
{
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
render: function () { return (React__default.default.createElement("div", { className: index_module.errorIcon, "data-addon": 'error-icon' },
|
|
49
|
-
React__default.default.createElement(coreComponentsStatusBadge.StatusBadge, { view: 'negative-alert', size: statusBadgeSize, dataTestId: coreComponentsShared.getDataTestId(dataTestId, 'error-icon') }))); },
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
priority: 3,
|
|
53
|
-
predicate: Boolean(success && !error),
|
|
54
|
-
render: function () { return (React__default.default.createElement("div", { className: index_module.successIcon },
|
|
55
|
-
React__default.default.createElement(coreComponentsStatusBadge.StatusBadge, { view: 'positive-checkmark', size: statusBadgeSize, dataTestId: coreComponentsShared.getDataTestId(dataTestId, 'success-icon') }))); },
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
priority: 2,
|
|
59
|
-
predicate: Boolean(rightAddons),
|
|
60
|
-
render: function () { return rightAddons; },
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
priority: 1,
|
|
64
|
-
predicate: Boolean(Arrow) && !disabled && !readOnly,
|
|
65
|
-
render: function () { return Arrow; },
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
priority: 0,
|
|
69
|
-
predicate: Boolean(disabled || readOnly),
|
|
70
|
-
render: function () { return React__default.default.createElement(shared.LockIcon, { colors: colors, size: size }); },
|
|
71
|
-
},
|
|
72
|
-
]);
|
|
39
|
+
var renderRightAddons = function () { return (React__default.default.createElement(React.Fragment, null,
|
|
40
|
+
clear && filled && !disabled && !readOnly && (React__default.default.createElement(shared.ClearButton, { onClick: onClear, disabled: disabled, colors: colors })),
|
|
41
|
+
error && (React__default.default.createElement("div", { className: index_module.errorIcon, "data-addon": 'error-icon' },
|
|
42
|
+
React__default.default.createElement(coreComponentsStatusBadge.StatusBadge, { view: 'negative-alert', size: statusBadgeSize, dataTestId: coreComponentsShared.getDataTestId(dataTestId, 'error-icon') }))),
|
|
43
|
+
success && !error && (React__default.default.createElement("div", { className: index_module.successIcon },
|
|
44
|
+
React__default.default.createElement(coreComponentsStatusBadge.StatusBadge, { view: 'positive-checkmark', size: statusBadgeSize, dataTestId: coreComponentsShared.getDataTestId(dataTestId, 'success-icon') }))),
|
|
45
|
+
rightAddons,
|
|
46
|
+
!disabled && !readOnly && Arrow,
|
|
47
|
+
(disabled || readOnly) && React__default.default.createElement(shared.LockIcon, { colors: colors, size: size }))); };
|
|
73
48
|
return (React__default.default.createElement("div", { className: index_module.component, ref: wrapperRef, onFocus: function () { return setFocused(true); }, onBlur: function () { return setFocused(false); } },
|
|
74
49
|
React__default.default.createElement(mobile.FormControlMobile, tslib.__assign({ fieldClassName: cn__default.default(index_module.field, fieldClassName, (_b = {},
|
|
75
50
|
_b[index_module.disabled] = disabled,
|
|
76
51
|
_b[index_module.focusVisible] = focusVisible,
|
|
77
52
|
_b)), block: true, size: size, focused: focused, disabled: disabled, filled: filled, labelView: labelView, dataTestId: coreComponentsShared.getDataTestId(dataTestId, 'form-control'),
|
|
78
53
|
// downshift устанавливает фокус на таргет поле после выбора опции, не даем ему это сделать пока открыт список, иначе поле поиска будет терять фокус
|
|
79
|
-
tabIndex: open ? undefined : tabIndex }, restProps, restInnerProps, { readOnly: readOnly, colors: colors, error: error, rightAddons:
|
|
54
|
+
tabIndex: open ? undefined : tabIndex }, restProps, restInnerProps, { readOnly: readOnly, colors: colors, error: error, rightAddons: renderRightAddons() }),
|
|
80
55
|
React__default.default.createElement("div", { className: index_module.contentWrapper },
|
|
81
56
|
showPlaceholder && React__default.default.createElement("span", { className: index_module.placeholder }, placeholder),
|
|
82
57
|
filled && React__default.default.createElement("div", { className: index_module.value }, value)))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Component.js","sources":["../src/autocomplete-mobile-field/Component.tsx"],"sourcesContent":["import React, { type ElementType, useRef, useState } from 'react';\nimport cn from 'classnames';\n\nimport {\n FormControlMobile,\n type FormControlMobileProps,\n} from '@alfalab/core-components-form-control/mobile';\nimport { ClearButton,
|
|
1
|
+
{"version":3,"file":"Component.js","sources":["../src/autocomplete-mobile-field/Component.tsx"],"sourcesContent":["import React, { type ElementType, Fragment, useRef, useState } from 'react';\nimport cn from 'classnames';\n\nimport {\n FormControlMobile,\n type FormControlMobileProps,\n} from '@alfalab/core-components-form-control/mobile';\nimport { ClearButton, LockIcon } from '@alfalab/core-components-input/shared';\nimport { type FieldProps as BaseFieldProps } from '@alfalab/core-components-select/shared';\nimport { getDataTestId } from '@alfalab/core-components-shared';\nimport { StatusBadge } from '@alfalab/core-components-status-badge';\nimport { useFocus } from '@alfalab/hooks';\n\nimport styles from './index.module.css';\n\ntype FieldProps = {\n /**\n * Компонент FormControl\n */\n FormControlComponent?: ElementType;\n};\n\nexport type AutocompleteMobileFieldProps = FormControlMobileProps &\n Omit<BaseFieldProps, 'selected' | 'multiple' | 'success'> & {\n /**\n * Значение поля ввода\n */\n value?: string;\n };\n\n// eslint-disable-next-line complexity\nexport const AutocompleteMobileField = ({\n size = 56,\n open,\n disabled,\n value,\n innerProps,\n dataTestId,\n fieldClassName,\n labelView = 'inner',\n placeholder,\n Arrow,\n valueRenderer,\n toggleMenu,\n setSelectedItems,\n selectedMultiple,\n FormControlComponent,\n rightAddons,\n error,\n readOnly,\n clear,\n success,\n onClear,\n onInput,\n colors = 'default',\n ...restProps\n}: AutocompleteMobileFieldProps & FieldProps) => {\n const [focused, setFocused] = useState(false);\n\n const wrapperRef = useRef<HTMLDivElement>(null);\n\n const [focusVisible] = useFocus(wrapperRef, 'keyboard');\n\n const filled = Boolean(value);\n const showPlaceholder = placeholder && !filled && labelView === 'outer';\n\n const statusBadgeSize = size === 40 ? 16 : 20;\n\n const { tabIndex, ...restInnerProps } = innerProps;\n\n /**\n * Right addons priority [4] <= [3] <= [2] <= [1] or [0]\n * [4] - Clear\n * [3] - Status (error, success)\n * [2] - Common (info, e.g.)\n * [1] - Indicators (eye, calendar, chevron, stepper e.g.)\n * [0] - Lock\n */\n const renderRightAddons = () => (\n <Fragment>\n {clear && filled && !disabled && !readOnly && (\n <ClearButton onClick={onClear} disabled={disabled} colors={colors} />\n )}\n {error && (\n <div className={styles.errorIcon} data-addon='error-icon'>\n <StatusBadge\n view='negative-alert'\n size={statusBadgeSize}\n dataTestId={getDataTestId(dataTestId, 'error-icon')}\n />\n </div>\n )}\n {success && !error && (\n <div className={styles.successIcon}>\n <StatusBadge\n view='positive-checkmark'\n size={statusBadgeSize}\n dataTestId={getDataTestId(dataTestId, 'success-icon')}\n />\n </div>\n )}\n {rightAddons}\n {!disabled && !readOnly && Arrow}\n {(disabled || readOnly) && <LockIcon colors={colors} size={size} />}\n </Fragment>\n );\n\n return (\n <div\n className={styles.component}\n ref={wrapperRef}\n onFocus={() => setFocused(true)}\n onBlur={() => setFocused(false)}\n >\n <FormControlMobile\n fieldClassName={cn(styles.field, fieldClassName, {\n [styles.disabled]: disabled,\n [styles.focusVisible]: focusVisible,\n })}\n block={true}\n size={size}\n focused={focused}\n disabled={disabled}\n filled={filled}\n labelView={labelView}\n dataTestId={getDataTestId(dataTestId, 'form-control')}\n // downshift устанавливает фокус на таргет поле после выбора опции, не даем ему это сделать пока открыт список, иначе поле поиска будет терять фокус\n tabIndex={open ? undefined : tabIndex}\n {...restProps}\n {...restInnerProps}\n readOnly={readOnly}\n colors={colors}\n error={error}\n rightAddons={renderRightAddons()}\n >\n <div className={styles.contentWrapper}>\n {showPlaceholder && <span className={styles.placeholder}>{placeholder}</span>}\n {filled && <div className={styles.value}>{value}</div>}\n </div>\n </FormControlMobile>\n </div>\n );\n};\n"],"names":["__rest","useState","useRef","useFocus","React","Fragment","ClearButton","styles","StatusBadge","getDataTestId","LockIcon","FormControlMobile","__assign","cn"],"mappings":";;;;;;;;;;;;;;;;;;;AA8BA;AACO,IAAM,uBAAuB,GAAG,UAAC,EAyBI,EAAA;;AAxBxC,IAAA,IAAA,YAAS,CAAT,CAAA,IAAI,mBAAG,EAAE,GAAA,EAAA,EACT,IAAI,GAAA,EAAA,CAAA,IAAA,CACJ,CAAA,QAAQ,cAAA,CACR,CAAA,KAAK,WAAA,CACL,CAAA,UAAU,gBAAA,CACV,CAAA,UAAU,GAAA,EAAA,CAAA,UAAA,CAAA,CACV,cAAc,GAAA,EAAA,CAAA,cAAA,CAAA,CACd,iBAAmB,CAAnB,CAAA,SAAS,mBAAG,OAAO,GAAA,EAAA,CACnB,CAAA,WAAW,iBAAA,CACX,CAAA,KAAK,WAAA,CACL,iBAAa,CACb,CAAU,EAAA,CAAA,UAAA,CAAA,CACM,EAAA,CAAA,gBAAA,CAAA,CACA,EAAA,CAAA,gBAAA,CAAA,CACI,EAAA,CAAA,oBAAA,CAAA,KACpB,WAAW,GAAA,EAAA,CAAA,WAAA,EACX,KAAK,GAAA,EAAA,CAAA,KAAA,EACL,QAAQ,GAAA,EAAA,CAAA,QAAA,EACR,KAAK,GAAA,EAAA,CAAA,KAAA,CACL,CAAA,OAAO,aAAA,CACP,CAAA,OAAO,aAAA,CACP,WAAO,CACP,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EACd,SAAS,EAAE,SAAS,EACpB,UAAU,EAAEE,kCAAa,CAAC,UAAU,EAAE,cAAc,CAAC;;AAErD,YAAA,QAAQ,EAAE,IAAI,GAAG,SAAS,GAAG,QAAQ,EACjC,EAAA,SAAS,EACT,cAAc,EAAA,EAClB,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,iBAAiB,EAAE,EAAA,CAAA;AAEhC,YAAAL,sBAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAEG,YAAM,CAAC,cAAc,EAAA;gBAChC,eAAe,IAAIH,+CAAM,SAAS,EAAEG,YAAM,CAAC,WAAW,EAAG,EAAA,WAAW,CAAQ;AAC5E,gBAAA,MAAM,IAAIH,sBAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAEG,YAAM,CAAC,KAAK,EAAG,EAAA,KAAK,CAAO,CACpD,CACU,CAClB;AAEd;;;;"}
|
|
@@ -15,29 +15,29 @@
|
|
|
15
15
|
--input-success-icon-display: flex;
|
|
16
16
|
--input-error-icon-not-alone-display: none;
|
|
17
17
|
}
|
|
18
|
-
.input-
|
|
18
|
+
.input-autocomplete__component_1s96h {
|
|
19
19
|
width: 100%;
|
|
20
20
|
outline: none;
|
|
21
21
|
}
|
|
22
|
-
.input-
|
|
22
|
+
.input-autocomplete__field_1s96h:not(.input-autocomplete__disabled_1s96h) {
|
|
23
23
|
cursor: pointer;
|
|
24
24
|
}
|
|
25
|
-
.input-
|
|
25
|
+
.input-autocomplete__errorIcon_1s96h {
|
|
26
26
|
display: var(--input-error-icon-display);
|
|
27
27
|
}
|
|
28
|
-
* + .input-
|
|
28
|
+
* + .input-autocomplete__errorIcon_1s96h {
|
|
29
29
|
display: var(--input-error-icon-not-alone-display);
|
|
30
30
|
}
|
|
31
|
-
.input-
|
|
31
|
+
.input-autocomplete__successIcon_1s96h {
|
|
32
32
|
display: var(--input-success-icon-display);
|
|
33
33
|
}
|
|
34
|
-
.input-
|
|
34
|
+
.input-autocomplete__disabled_1s96h {
|
|
35
35
|
cursor: var(--disabled-cursor);
|
|
36
36
|
}
|
|
37
|
-
.input-
|
|
37
|
+
.input-autocomplete__placeholder_1s96h {
|
|
38
38
|
color: var(--color-light-text-secondary);
|
|
39
39
|
}
|
|
40
|
-
.input-
|
|
40
|
+
.input-autocomplete__contentWrapper_1s96h {
|
|
41
41
|
font-size: 16px;
|
|
42
42
|
line-height: 20px;
|
|
43
43
|
font-weight: 400;
|
|
@@ -48,12 +48,12 @@
|
|
|
48
48
|
overflow: hidden;
|
|
49
49
|
width: 100%;
|
|
50
50
|
}
|
|
51
|
-
.input-
|
|
51
|
+
.input-autocomplete__value_1s96h {
|
|
52
52
|
overflow: hidden;
|
|
53
53
|
text-overflow: ellipsis;
|
|
54
54
|
text-align: left;
|
|
55
55
|
}
|
|
56
|
-
.input-
|
|
56
|
+
.input-autocomplete__focusVisible_1s96h {
|
|
57
57
|
outline: 2px solid var(--focus-color);
|
|
58
58
|
outline-offset: 2px;
|
|
59
59
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
require('./index.css');
|
|
4
4
|
|
|
5
|
-
var styles = {"component":"input-
|
|
5
|
+
var styles = {"component":"input-autocomplete__component_1s96h","field":"input-autocomplete__field_1s96h","disabled":"input-autocomplete__disabled_1s96h","errorIcon":"input-autocomplete__errorIcon_1s96h","successIcon":"input-autocomplete__successIcon_1s96h","placeholder":"input-autocomplete__placeholder_1s96h","contentWrapper":"input-autocomplete__contentWrapper_1s96h","value":"input-autocomplete__value_1s96h","focusVisible":"input-autocomplete__focusVisible_1s96h"};
|
|
6
6
|
|
|
7
7
|
module.exports = styles;
|
|
8
8
|
//# sourceMappingURL=index.module.css.js.map
|
|
@@ -7,7 +7,6 @@ var React = require('react');
|
|
|
7
7
|
var mergeRefs = require('react-merge-refs');
|
|
8
8
|
var cn = require('classnames');
|
|
9
9
|
var desktop = require('@alfalab/core-components-input/cssm/desktop');
|
|
10
|
-
var getAddonsByPriority = require('@alfalab/core-components-input/cssm/helpers/get-addons-by-priority');
|
|
11
10
|
var enums = require('../enums.js');
|
|
12
11
|
var styles = require('./index.module.css');
|
|
13
12
|
|
|
@@ -41,27 +40,18 @@ var AutocompleteField = function (_a) {
|
|
|
41
40
|
* [1] - Indicators (eye, calendar, chevron, stepper e.g.)
|
|
42
41
|
* [0] - Lock
|
|
43
42
|
*/
|
|
44
|
-
var
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
predicate: Boolean(Arrow) && !inputDisabled,
|
|
53
|
-
render: function () {
|
|
54
|
-
var _a;
|
|
55
|
-
return (React__default.default.createElement("span", { className: cn__default.default(styles__default.default.arrow, (_a = {},
|
|
56
|
-
_a[styles__default.default.error] = error,
|
|
57
|
-
_a)) }, Arrow));
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
|
-
]);
|
|
43
|
+
var renderRightAddons = function () {
|
|
44
|
+
var _a;
|
|
45
|
+
return (React__default.default.createElement(React.Fragment, null,
|
|
46
|
+
inputProps.rightAddons,
|
|
47
|
+
Arrow && !inputDisabled && (React__default.default.createElement("span", { className: cn__default.default(styles__default.default.arrow, (_a = {},
|
|
48
|
+
_a[styles__default.default.error] = error,
|
|
49
|
+
_a)) }, Arrow))));
|
|
50
|
+
};
|
|
61
51
|
return (React__default.default.createElement(Input, tslib.__assign({ dataTestId: dataTestId }, inputProps, innerProps, { wrapperRef: mergeRefs__default.default([
|
|
62
52
|
innerProps.ref,
|
|
63
53
|
inputProps.wrapperRef,
|
|
64
|
-
]), ref: mergeRefs__default.default([inputRef, inputProps.ref]), disabled: disabled, readOnly: readOnly, block: true, label: label, labelView: labelView, placeholder: placeholder, size: size, error: error, success: success, hint: hint, onChange: handleInput, onClick: inputDisabled ? undefined : handleClick, onFocus: inputDisabled ? undefined : onFocus, autoComplete: 'off', value: value, rightAddons:
|
|
54
|
+
]), ref: mergeRefs__default.default([inputRef, inputProps.ref]), disabled: disabled, readOnly: readOnly, block: true, label: label, labelView: labelView, placeholder: placeholder, size: size, error: error, success: success, hint: hint, onChange: handleInput, onClick: inputDisabled ? undefined : handleClick, onFocus: inputDisabled ? undefined : onFocus, autoComplete: 'off', value: value, rightAddons: renderRightAddons() })));
|
|
65
55
|
};
|
|
66
56
|
|
|
67
57
|
exports.AutocompleteField = AutocompleteField;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Component.js","sources":["../../src/autocomplete-field/Component.tsx"],"sourcesContent":["import React, { useCallback, useRef } from 'react';\nimport mergeRefs from 'react-merge-refs';\nimport cn from 'classnames';\n\nimport { type InputProps } from '@alfalab/core-components-input';\nimport { InputDesktop as DefaultInput } from '@alfalab/core-components-input/desktop';\nimport {
|
|
1
|
+
{"version":3,"file":"Component.js","sources":["../../src/autocomplete-field/Component.tsx"],"sourcesContent":["import React, { Fragment, useCallback, useRef } from 'react';\nimport mergeRefs from 'react-merge-refs';\nimport cn from 'classnames';\n\nimport { type InputProps } from '@alfalab/core-components-input';\nimport { InputDesktop as DefaultInput } from '@alfalab/core-components-input/desktop';\nimport { type FieldProps } from '@alfalab/core-components-select/shared';\n\nimport { OnInputReason } from '../enums';\nimport { type InputAutocompleteCommonProps } from '../types';\n\nimport styles from './index.module.css';\n\nexport type AutocompleteFieldProps = FieldProps &\n Pick<InputAutocompleteCommonProps, 'Input' | 'inputProps' | 'value' | 'onInput' | 'readOnly'>;\n\nexport const AutocompleteField = ({\n label,\n labelView = 'inner',\n placeholder,\n size,\n Arrow,\n Input = DefaultInput,\n value,\n error,\n success,\n hint,\n disabled,\n readOnly,\n onInput,\n inputProps = {},\n innerProps,\n dataTestId,\n}: AutocompleteFieldProps) => {\n const inputRef = useRef<HTMLInputElement>(null);\n\n const { onClick, onFocus } = innerProps;\n\n const inputDisabled = disabled || readOnly;\n\n const handleClick = useCallback(\n (event: React.MouseEvent<HTMLDivElement>) => {\n if (onClick) onClick(event);\n\n if (inputRef.current) {\n inputRef.current.focus();\n }\n },\n [onClick],\n );\n\n const handleInput: InputProps['onChange'] = (_, payload) =>\n onInput?.(payload.value, OnInputReason.Change);\n\n /**\n * Right addons priority [4] <= [3] <= [2] <= [1] or [0]\n * [4] - Clear\n * [3] - Status (error, success)\n * [2] - Common (info, e.g.)\n * [1] - Indicators (eye, calendar, chevron, stepper e.g.)\n * [0] - Lock\n */\n const renderRightAddons = () => (\n <Fragment>\n {inputProps.rightAddons}\n {Arrow && !inputDisabled && (\n <span\n className={cn(styles.arrow, {\n [styles.error]: error,\n })}\n >\n {Arrow}\n </span>\n )}\n </Fragment>\n );\n\n return (\n <Input\n dataTestId={dataTestId}\n {...inputProps}\n {...innerProps}\n wrapperRef={mergeRefs([\n innerProps.ref as React.Ref<HTMLElement>,\n inputProps.wrapperRef as React.Ref<HTMLElement>,\n ])}\n ref={mergeRefs([inputRef, inputProps.ref as React.Ref<HTMLElement>])}\n disabled={disabled}\n readOnly={readOnly}\n block={true}\n label={label}\n labelView={labelView}\n placeholder={placeholder}\n size={size}\n error={error}\n success={success}\n hint={hint}\n onChange={handleInput}\n onClick={inputDisabled ? undefined : handleClick}\n onFocus={inputDisabled ? undefined : onFocus}\n autoComplete='off'\n value={value}\n rightAddons={renderRightAddons()}\n />\n );\n};\n"],"names":["DefaultInput","useRef","useCallback","OnInputReason","React","Fragment","cn","styles","__assign","mergeRefs"],"mappings":";;;;;;;;;;;;;;;;;;;AAgBO,IAAM,iBAAiB,GAAG,UAAC,EAiBT,EAAA;QAhBrB,KAAK,GAAA,EAAA,CAAA,KAAA,EACL,EAAA,GAAA,EAAA,CAAA,SAAmB,EAAnB,SAAS,GAAG,EAAA,KAAA,MAAA,GAAA,OAAO,GAAA,EAAA,EACnB,WAAW,GAAA,EAAA,CAAA,WAAA,EACX,IAAI,UAAA,EACJ,KAAK,GAAA,EAAA,CAAA,KAAA,EACL,EAA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form-control/cssm/mobile');
|
|
9
9
|
var shared = require('@alfalab/core-components-input/cssm/shared');
|
|
10
|
-
var cssm
|
|
11
|
-
var cssm = require('@alfalab/core-components-status-badge/cssm');
|
|
10
|
+
var cssm = require('@alfalab/core-components-shared/cssm');
|
|
11
|
+
var cssm$1 = require('@alfalab/core-components-status-badge/cssm');
|
|
12
12
|
var hooks = require('@alfalab/hooks');
|
|
13
13
|
var styles = require('./index.module.css');
|
|
14
14
|
|
|
@@ -37,47 +37,22 @@ var AutocompleteMobileField = function (_a) {
|
|
|
37
37
|
* [1] - Indicators (eye, calendar, chevron, stepper e.g.)
|
|
38
38
|
* [0] - Lock
|
|
39
39
|
*/
|
|
40
|
-
var
|
|
41
|
-
{
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
render: function () { return (React__default.default.createElement("div", { className: styles__default.default.errorIcon, "data-addon": 'error-icon' },
|
|
50
|
-
React__default.default.createElement(cssm.StatusBadge, { view: 'negative-alert', size: statusBadgeSize, dataTestId: cssm$1.getDataTestId(dataTestId, 'error-icon') }))); },
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
priority: 3,
|
|
54
|
-
predicate: Boolean(success && !error),
|
|
55
|
-
render: function () { return (React__default.default.createElement("div", { className: styles__default.default.successIcon },
|
|
56
|
-
React__default.default.createElement(cssm.StatusBadge, { view: 'positive-checkmark', size: statusBadgeSize, dataTestId: cssm$1.getDataTestId(dataTestId, 'success-icon') }))); },
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
priority: 2,
|
|
60
|
-
predicate: Boolean(rightAddons),
|
|
61
|
-
render: function () { return rightAddons; },
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
priority: 1,
|
|
65
|
-
predicate: Boolean(Arrow) && !disabled && !readOnly,
|
|
66
|
-
render: function () { return Arrow; },
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
priority: 0,
|
|
70
|
-
predicate: Boolean(disabled || readOnly),
|
|
71
|
-
render: function () { return React__default.default.createElement(shared.LockIcon, { colors: colors, size: size }); },
|
|
72
|
-
},
|
|
73
|
-
]);
|
|
40
|
+
var renderRightAddons = function () { return (React__default.default.createElement(React.Fragment, null,
|
|
41
|
+
clear && filled && !disabled && !readOnly && (React__default.default.createElement(shared.ClearButton, { onClick: onClear, disabled: disabled, colors: colors })),
|
|
42
|
+
error && (React__default.default.createElement("div", { className: styles__default.default.errorIcon, "data-addon": 'error-icon' },
|
|
43
|
+
React__default.default.createElement(cssm$1.StatusBadge, { view: 'negative-alert', size: statusBadgeSize, dataTestId: cssm.getDataTestId(dataTestId, 'error-icon') }))),
|
|
44
|
+
success && !error && (React__default.default.createElement("div", { className: styles__default.default.successIcon },
|
|
45
|
+
React__default.default.createElement(cssm$1.StatusBadge, { view: 'positive-checkmark', size: statusBadgeSize, dataTestId: cssm.getDataTestId(dataTestId, 'success-icon') }))),
|
|
46
|
+
rightAddons,
|
|
47
|
+
!disabled && !readOnly && Arrow,
|
|
48
|
+
(disabled || readOnly) && React__default.default.createElement(shared.LockIcon, { colors: colors, size: size }))); };
|
|
74
49
|
return (React__default.default.createElement("div", { className: styles__default.default.component, ref: wrapperRef, onFocus: function () { return setFocused(true); }, onBlur: function () { return setFocused(false); } },
|
|
75
50
|
React__default.default.createElement(mobile.FormControlMobile, tslib.__assign({ fieldClassName: cn__default.default(styles__default.default.field, fieldClassName, (_b = {},
|
|
76
51
|
_b[styles__default.default.disabled] = disabled,
|
|
77
52
|
_b[styles__default.default.focusVisible] = focusVisible,
|
|
78
|
-
_b)), block: true, size: size, focused: focused, disabled: disabled, filled: filled, labelView: labelView, dataTestId: cssm
|
|
53
|
+
_b)), block: true, size: size, focused: focused, disabled: disabled, filled: filled, labelView: labelView, dataTestId: cssm.getDataTestId(dataTestId, 'form-control'),
|
|
79
54
|
// downshift устанавливает фокус на таргет поле после выбора опции, не даем ему это сделать пока открыт список, иначе поле поиска будет терять фокус
|
|
80
|
-
tabIndex: open ? undefined : tabIndex }, restProps, restInnerProps, { readOnly: readOnly, colors: colors, error: error, rightAddons:
|
|
55
|
+
tabIndex: open ? undefined : tabIndex }, restProps, restInnerProps, { readOnly: readOnly, colors: colors, error: error, rightAddons: renderRightAddons() }),
|
|
81
56
|
React__default.default.createElement("div", { className: styles__default.default.contentWrapper },
|
|
82
57
|
showPlaceholder && React__default.default.createElement("span", { className: styles__default.default.placeholder }, placeholder),
|
|
83
58
|
filled && React__default.default.createElement("div", { className: styles__default.default.value }, value)))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Component.js","sources":["../../src/autocomplete-mobile-field/Component.tsx"],"sourcesContent":["import React, { type ElementType, useRef, useState } from 'react';\nimport cn from 'classnames';\n\nimport {\n FormControlMobile,\n type FormControlMobileProps,\n} from '@alfalab/core-components-form-control/mobile';\nimport { ClearButton,
|
|
1
|
+
{"version":3,"file":"Component.js","sources":["../../src/autocomplete-mobile-field/Component.tsx"],"sourcesContent":["import React, { type ElementType, Fragment, useRef, useState } from 'react';\nimport cn from 'classnames';\n\nimport {\n FormControlMobile,\n type FormControlMobileProps,\n} from '@alfalab/core-components-form-control/mobile';\nimport { ClearButton, LockIcon } from '@alfalab/core-components-input/shared';\nimport { type FieldProps as BaseFieldProps } from '@alfalab/core-components-select/shared';\nimport { getDataTestId } from '@alfalab/core-components-shared';\nimport { StatusBadge } from '@alfalab/core-components-status-badge';\nimport { useFocus } from '@alfalab/hooks';\n\nimport styles from './index.module.css';\n\ntype FieldProps = {\n /**\n * Компонент FormControl\n */\n FormControlComponent?: ElementType;\n};\n\nexport type AutocompleteMobileFieldProps = FormControlMobileProps &\n Omit<BaseFieldProps, 'selected' | 'multiple' | 'success'> & {\n /**\n * Значение поля ввода\n */\n value?: string;\n };\n\n// eslint-disable-next-line complexity\nexport const AutocompleteMobileField = ({\n size = 56,\n open,\n disabled,\n value,\n innerProps,\n dataTestId,\n fieldClassName,\n labelView = 'inner',\n placeholder,\n Arrow,\n valueRenderer,\n toggleMenu,\n setSelectedItems,\n selectedMultiple,\n FormControlComponent,\n rightAddons,\n error,\n readOnly,\n clear,\n success,\n onClear,\n onInput,\n colors = 'default',\n ...restProps\n}: AutocompleteMobileFieldProps & FieldProps) => {\n const [focused, setFocused] = useState(false);\n\n const wrapperRef = useRef<HTMLDivElement>(null);\n\n const [focusVisible] = useFocus(wrapperRef, 'keyboard');\n\n const filled = Boolean(value);\n const showPlaceholder = placeholder && !filled && labelView === 'outer';\n\n const statusBadgeSize = size === 40 ? 16 : 20;\n\n const { tabIndex, ...restInnerProps } = innerProps;\n\n /**\n * Right addons priority [4] <= [3] <= [2] <= [1] or [0]\n * [4] - Clear\n * [3] - Status (error, success)\n * [2] - Common (info, e.g.)\n * [1] - Indicators (eye, calendar, chevron, stepper e.g.)\n * [0] - Lock\n */\n const renderRightAddons = () => (\n <Fragment>\n {clear && filled && !disabled && !readOnly && (\n <ClearButton onClick={onClear} disabled={disabled} colors={colors} />\n )}\n {error && (\n <div className={styles.errorIcon} data-addon='error-icon'>\n <StatusBadge\n view='negative-alert'\n size={statusBadgeSize}\n dataTestId={getDataTestId(dataTestId, 'error-icon')}\n />\n </div>\n )}\n {success && !error && (\n <div className={styles.successIcon}>\n <StatusBadge\n view='positive-checkmark'\n size={statusBadgeSize}\n dataTestId={getDataTestId(dataTestId, 'success-icon')}\n />\n </div>\n )}\n {rightAddons}\n {!disabled && !readOnly && Arrow}\n {(disabled || readOnly) && <LockIcon colors={colors} size={size} />}\n </Fragment>\n );\n\n return (\n <div\n className={styles.component}\n ref={wrapperRef}\n onFocus={() => setFocused(true)}\n onBlur={() => setFocused(false)}\n >\n <FormControlMobile\n fieldClassName={cn(styles.field, fieldClassName, {\n [styles.disabled]: disabled,\n [styles.focusVisible]: focusVisible,\n })}\n block={true}\n size={size}\n focused={focused}\n disabled={disabled}\n filled={filled}\n labelView={labelView}\n dataTestId={getDataTestId(dataTestId, 'form-control')}\n // downshift устанавливает фокус на таргет поле после выбора опции, не даем ему это сделать пока открыт список, иначе поле поиска будет терять фокус\n tabIndex={open ? undefined : tabIndex}\n {...restProps}\n {...restInnerProps}\n readOnly={readOnly}\n colors={colors}\n error={error}\n rightAddons={renderRightAddons()}\n >\n <div className={styles.contentWrapper}>\n {showPlaceholder && <span className={styles.placeholder}>{placeholder}</span>}\n {filled && <div className={styles.value}>{value}</div>}\n </div>\n </FormControlMobile>\n </div>\n );\n};\n"],"names":["__rest","useState","useRef","useFocus","React","Fragment","ClearButton","styles","StatusBadge","getDataTestId","LockIcon","FormControlMobile","__assign","cn"],"mappings":";;;;;;;;;;;;;;;;;;;;AA8BA;AACO,IAAM,uBAAuB,GAAG,UAAC,EAyBI,EAAA;;AAxBxC,IAAA,IAAA,YAAS,CAAT,CAAA,IAAI,mBAAG,EAAE,GAAA,EAAA,EACT,IAAI,GAAA,EAAA,CAAA,IAAA,CACJ,CAAA,QAAQ,cAAA,CACR,CAAA,KAAK,WAAA,CACL,CAAA,UAAU,gBAAA,CACV,CAAA,UAAU,GAAA,EAAA,CAAA,UAAA,CAAA,CACV,cAAc,GAAA,EAAA,CAAA,cAAA,CAAA,CACd,iBAAmB,CAAnB,CAAA,SAAS,mBAAG,OAAO,GAAA,EAAA,CACnB,CAAA,WAAW,iBAAA,CACX,CAAA,KAAK,WAAA,CACL,iBAAa,CACb,CAAU,EAAA,CAAA,UAAA,CAAA,CACM,EAAA,CAAA,gBAAA,CAAA,CACA,EAAA,CAAA,gBAAA,CAAA,CACI,EAAA,CAAA,oBAAA,CAAA,KACpB,WAAW,GAAA,EAAA,CAAA,WAAA,EACX,KAAK,GAAA,EAAA,CAAA,KAAA,EACL,QAAQ,GAAA,EAAA,CAAA,QAAA,EACR,KAAK,GAAA,EAAA,CAAA,KAAA,CACL,CAAA,OAAO,aAAA,CACP,CAAA,OAAO,aAAA,CACP,WAAO,CACP,KAAA,EAAA,GAAA,EAAA,CAAA,MAAkB,CAAlB,CAAA,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BAAa,CAAC,UAAU,EAAE,cAAc,CAAC;;AAErD,YAAA,QAAQ,EAAE,IAAI,GAAG,SAAS,GAAG,QAAQ,EACjC,EAAA,SAAS,EACT,cAAc,EAAA,EAClB,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,iBAAiB,EAAE,EAAA,CAAA;AAEhC,YAAAL,sBAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAEG,uBAAM,CAAC,cAAc,EAAA;gBAChC,eAAe,IAAIH,+CAAM,SAAS,EAAEG,uBAAM,CAAC,WAAW,EAAG,EAAA,WAAW,CAAQ;AAC5E,gBAAA,MAAM,IAAIH,sBAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAEG,uBAAM,CAAC,KAAK,EAAG,EAAA,KAAK,CAAO,CACpD,CACU,CAClB;AAEd;;;;"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { __assign } from 'tslib';
|
|
2
|
-
import React, { useRef, useCallback } from 'react';
|
|
2
|
+
import React, { useRef, useCallback, Fragment } from 'react';
|
|
3
3
|
import mergeRefs from 'react-merge-refs';
|
|
4
4
|
import cn from 'classnames';
|
|
5
5
|
import { InputDesktop } from '@alfalab/core-components-input/esm/desktop';
|
|
6
|
-
import { getAddonsByPriority } from '@alfalab/core-components-input/esm/helpers/get-addons-by-priority';
|
|
7
6
|
import { OnInputReason } from '../enums.js';
|
|
8
7
|
import styles from './index.module.css.js';
|
|
9
8
|
|
|
@@ -30,27 +29,18 @@ var AutocompleteField = function (_a) {
|
|
|
30
29
|
* [1] - Indicators (eye, calendar, chevron, stepper e.g.)
|
|
31
30
|
* [0] - Lock
|
|
32
31
|
*/
|
|
33
|
-
var
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
predicate: Boolean(Arrow) && !inputDisabled,
|
|
42
|
-
render: function () {
|
|
43
|
-
var _a;
|
|
44
|
-
return (React.createElement("span", { className: cn(styles.arrow, (_a = {},
|
|
45
|
-
_a[styles.error] = error,
|
|
46
|
-
_a)) }, Arrow));
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
]);
|
|
32
|
+
var renderRightAddons = function () {
|
|
33
|
+
var _a;
|
|
34
|
+
return (React.createElement(Fragment, null,
|
|
35
|
+
inputProps.rightAddons,
|
|
36
|
+
Arrow && !inputDisabled && (React.createElement("span", { className: cn(styles.arrow, (_a = {},
|
|
37
|
+
_a[styles.error] = error,
|
|
38
|
+
_a)) }, Arrow))));
|
|
39
|
+
};
|
|
50
40
|
return (React.createElement(Input, __assign({ dataTestId: dataTestId }, inputProps, innerProps, { wrapperRef: mergeRefs([
|
|
51
41
|
innerProps.ref,
|
|
52
42
|
inputProps.wrapperRef,
|
|
53
|
-
]), ref: mergeRefs([inputRef, inputProps.ref]), disabled: disabled, readOnly: readOnly, block: true, label: label, labelView: labelView, placeholder: placeholder, size: size, error: error, success: success, hint: hint, onChange: handleInput, onClick: inputDisabled ? undefined : handleClick, onFocus: inputDisabled ? undefined : onFocus, autoComplete: 'off', value: value, rightAddons:
|
|
43
|
+
]), ref: mergeRefs([inputRef, inputProps.ref]), disabled: disabled, readOnly: readOnly, block: true, label: label, labelView: labelView, placeholder: placeholder, size: size, error: error, success: success, hint: hint, onChange: handleInput, onClick: inputDisabled ? undefined : handleClick, onFocus: inputDisabled ? undefined : onFocus, autoComplete: 'off', value: value, rightAddons: renderRightAddons() })));
|
|
54
44
|
};
|
|
55
45
|
|
|
56
46
|
export { AutocompleteField };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Component.js","sources":["../../src/autocomplete-field/Component.tsx"],"sourcesContent":["import React, { useCallback, useRef } from 'react';\nimport mergeRefs from 'react-merge-refs';\nimport cn from 'classnames';\n\nimport { type InputProps } from '@alfalab/core-components-input';\nimport { InputDesktop as DefaultInput } from '@alfalab/core-components-input/desktop';\nimport {
|
|
1
|
+
{"version":3,"file":"Component.js","sources":["../../src/autocomplete-field/Component.tsx"],"sourcesContent":["import React, { Fragment, useCallback, useRef } from 'react';\nimport mergeRefs from 'react-merge-refs';\nimport cn from 'classnames';\n\nimport { type InputProps } from '@alfalab/core-components-input';\nimport { InputDesktop as DefaultInput } from '@alfalab/core-components-input/desktop';\nimport { type FieldProps } from '@alfalab/core-components-select/shared';\n\nimport { OnInputReason } from '../enums';\nimport { type InputAutocompleteCommonProps } from '../types';\n\nimport styles from './index.module.css';\n\nexport type AutocompleteFieldProps = FieldProps &\n Pick<InputAutocompleteCommonProps, 'Input' | 'inputProps' | 'value' | 'onInput' | 'readOnly'>;\n\nexport const AutocompleteField = ({\n label,\n labelView = 'inner',\n placeholder,\n size,\n Arrow,\n Input = DefaultInput,\n value,\n error,\n success,\n hint,\n disabled,\n readOnly,\n onInput,\n inputProps = {},\n innerProps,\n dataTestId,\n}: AutocompleteFieldProps) => {\n const inputRef = useRef<HTMLInputElement>(null);\n\n const { onClick, onFocus } = innerProps;\n\n const inputDisabled = disabled || readOnly;\n\n const handleClick = useCallback(\n (event: React.MouseEvent<HTMLDivElement>) => {\n if (onClick) onClick(event);\n\n if (inputRef.current) {\n inputRef.current.focus();\n }\n },\n [onClick],\n );\n\n const handleInput: InputProps['onChange'] = (_, payload) =>\n onInput?.(payload.value, OnInputReason.Change);\n\n /**\n * Right addons priority [4] <= [3] <= [2] <= [1] or [0]\n * [4] - Clear\n * [3] - Status (error, success)\n * [2] - Common (info, e.g.)\n * [1] - Indicators (eye, calendar, chevron, stepper e.g.)\n * [0] - Lock\n */\n const renderRightAddons = () => (\n <Fragment>\n {inputProps.rightAddons}\n {Arrow && !inputDisabled && (\n <span\n className={cn(styles.arrow, {\n [styles.error]: error,\n })}\n >\n {Arrow}\n </span>\n )}\n </Fragment>\n );\n\n return (\n <Input\n dataTestId={dataTestId}\n {...inputProps}\n {...innerProps}\n wrapperRef={mergeRefs([\n innerProps.ref as React.Ref<HTMLElement>,\n inputProps.wrapperRef as React.Ref<HTMLElement>,\n ])}\n ref={mergeRefs([inputRef, inputProps.ref as React.Ref<HTMLElement>])}\n disabled={disabled}\n readOnly={readOnly}\n block={true}\n label={label}\n labelView={labelView}\n placeholder={placeholder}\n size={size}\n error={error}\n success={success}\n hint={hint}\n onChange={handleInput}\n onClick={inputDisabled ? undefined : handleClick}\n onFocus={inputDisabled ? undefined : onFocus}\n autoComplete='off'\n value={value}\n rightAddons={renderRightAddons()}\n />\n );\n};\n"],"names":["DefaultInput"],"mappings":";;;;;;;;AAgBO,IAAM,iBAAiB,GAAG,UAAC,EAiBT,EAAA;QAhBrB,KAAK,GAAA,EAAA,CAAA,KAAA,EACL,EAAA,GAAA,EAAA,CAAA,SAAmB,EAAnB,SAAS,GAAG,EAAA,KAAA,MAAA,GAAA,OAAO,GAAA,EAAA,EACnB,WAAW,GAAA,EAAA,CAAA,WAAA,EACX,IAAI,UAAA,EACJ,KAAK,GAAA,EAAA,CAAA,KAAA,EACL,EAAoB,GAAA,EAAA,CAAA,KAAA,EAApB,KAAK,GAAA,EAAA,KAAA,MAAA,GAAGA,YAAY,GAAA,EAAA,EACpB,KAAK,GAAA,EAAA,CAAA,KAAA,EACL,KAAK,GAAA,EAAA,CAAA,KAAA,EACL,OAAO,GAAA,EAAA,CAAA,OAAA,EACP,IAAI,GAAA,EAAA,CAAA,IAAA,EACJ,QAAQ,GAAA,EAAA,CAAA,QAAA,EACR,QAAQ,GAAA,EAAA,CAAA,QAAA,EACR,OAAO,GAAA,EAAA,CAAA,OAAA,EACP,EAAA,GAAA,EAAA,CAAA,UAAe,EAAf,UAAU,GAAG,EAAA,KAAA,MAAA,GAAA,EAAE,GAAA,EAAA,EACf,UAAU,GAAA,EAAA,CAAA,UAAA,EACV,UAAU,GAAA,EAAA,CAAA,UAAA;AAEV,IAAA,IAAM,QAAQ,GAAG,MAAM,CAAmB,IAAI,CAAC;IAEvC,IAAA,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E,SAAS,CAAC,CAAC,QAAQ,EAAE,UAAU,CAAC,GAA6B,CAAC,CAAC,EACpE,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,IAAI,EACX,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE,WAAW,EACxB,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,WAAW,EACrB,OAAO,EAAE,aAAa,GAAG,SAAS,GAAG,WAAW,EAChD,OAAO,EAAE,aAAa,GAAG,SAAS,GAAG,OAAO,EAC5C,YAAY,EAAC,KAAK,EAClB,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,iBAAiB,EAAE,EAClC,CAAA,CAAA;AAEV;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './index.css';
|
|
2
2
|
|
|
3
|
-
var styles = {"arrow":"input-
|
|
3
|
+
var styles = {"arrow":"input-autocomplete__arrow_1vetf","error":"input-autocomplete__error_1vetf"};
|
|
4
4
|
|
|
5
5
|
export { styles as default };
|
|
6
6
|
//# sourceMappingURL=index.module.css.js.map
|