@salutejs/plasma-new-hope 0.336.0-canary.2220.17591054284.0 → 0.336.0-canary.2224.17630468274.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/cjs/components/Autocomplete/Autocomplete.css +0 -2
- package/cjs/components/Combobox/ComboboxNew/Combobox.css +0 -2
- package/cjs/components/Combobox/ComboboxNew/Combobox.js +50 -27
- package/cjs/components/Combobox/ComboboxNew/Combobox.js.map +1 -1
- package/cjs/components/Combobox/ComboboxNew/hooks/getPathMaps.js +4 -1
- package/cjs/components/Combobox/ComboboxNew/hooks/getPathMaps.js.map +1 -1
- package/cjs/components/Combobox/ComboboxNew/utils/getRemovedElement.js +17 -0
- package/cjs/components/Combobox/ComboboxNew/utils/getRemovedElement.js.map +1 -0
- package/cjs/components/DatePicker/RangeDate/RangeDate.css +0 -2
- package/cjs/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.css +0 -2
- package/cjs/components/DatePicker/SingleDate/SingleDate.css +0 -2
- package/cjs/components/Pagination/Pagination.css +0 -2
- package/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.css +0 -2
- package/cjs/components/Range/Range.css +0 -2
- package/cjs/components/Select/Select.css +0 -2
- package/cjs/components/Select/ui/Target/Target.css +0 -2
- package/cjs/components/Select/ui/Target/ui/Textfield/Textfield.css +0 -2
- package/cjs/components/Slider/Slider.css +0 -2
- package/cjs/components/Slider/components/DoubleUncontrolled/DoubleUncontrolled.css +0 -2
- package/cjs/components/Switch/Switch.css +6 -6
- package/cjs/components/Switch/Switch.js +5 -2
- package/cjs/components/Switch/Switch.js.map +1 -1
- package/cjs/components/Switch/Switch.styles.js +1 -1
- package/cjs/components/Switch/Switch.styles.js.map +1 -1
- package/cjs/components/Switch/{Switch.styles_qjefea.css → Switch.styles_1pe5u24.css} +1 -1
- package/cjs/components/Switch/Switch.tokens.js +2 -1
- package/cjs/components/Switch/Switch.tokens.js.map +1 -1
- package/cjs/components/Table/Table.css +0 -2
- package/cjs/components/Table/ui/Cell/Cell.css +0 -2
- package/cjs/components/Table/ui/EditableCell/EditableCell.css +0 -2
- package/cjs/components/Table/ui/HeadCell/HeadCell.css +0 -2
- package/cjs/components/Table/ui/HeadCell/ui/Filter/Filter.css +0 -2
- package/cjs/components/TextField/TextField.js +3 -14
- package/cjs/components/TextField/TextField.js.map +1 -1
- package/cjs/engines/common.js +11 -1
- package/cjs/engines/common.js.map +1 -1
- package/cjs/index.css +6 -8
- package/emotion/cjs/components/Combobox/ComboboxNew/Combobox.js +58 -26
- package/emotion/cjs/components/Combobox/ComboboxNew/hooks/getPathMaps.js +5 -2
- package/emotion/cjs/components/Combobox/ComboboxNew/utils/getRemovedElement.js +20 -0
- package/emotion/cjs/components/Combobox/ComboboxNew/utils/index.js +4 -0
- package/emotion/cjs/components/Switch/Switch.js +4 -2
- package/emotion/cjs/components/Switch/Switch.styles.js +11 -11
- package/emotion/cjs/components/Switch/Switch.tokens.js +2 -1
- package/emotion/cjs/components/TextField/TextField.js +4 -16
- package/emotion/cjs/components/TextField/ui/index.js +3 -12
- package/emotion/cjs/engines/common.js +14 -1
- package/emotion/cjs/examples/components/Combobox/Combobox.js +0 -15
- package/emotion/es/components/Combobox/ComboboxNew/Combobox.js +59 -27
- package/emotion/es/components/Combobox/ComboboxNew/hooks/getPathMaps.js +5 -2
- package/emotion/es/components/Combobox/ComboboxNew/utils/getRemovedElement.js +10 -0
- package/emotion/es/components/Combobox/ComboboxNew/utils/index.js +1 -0
- package/emotion/es/components/Switch/Switch.js +4 -2
- package/emotion/es/components/Switch/Switch.styles.js +11 -11
- package/emotion/es/components/Switch/Switch.tokens.js +2 -1
- package/emotion/es/components/TextField/TextField.js +5 -17
- package/emotion/es/components/TextField/ui/index.js +0 -1
- package/emotion/es/engines/common.js +14 -1
- package/es/components/Autocomplete/Autocomplete.css +0 -2
- package/es/components/Combobox/ComboboxNew/Combobox.css +0 -2
- package/es/components/Combobox/ComboboxNew/Combobox.js +51 -28
- package/es/components/Combobox/ComboboxNew/Combobox.js.map +1 -1
- package/es/components/Combobox/ComboboxNew/hooks/getPathMaps.js +4 -1
- package/es/components/Combobox/ComboboxNew/hooks/getPathMaps.js.map +1 -1
- package/es/components/Combobox/ComboboxNew/utils/getRemovedElement.js +13 -0
- package/es/components/Combobox/ComboboxNew/utils/getRemovedElement.js.map +1 -0
- package/es/components/DatePicker/RangeDate/RangeDate.css +0 -2
- package/es/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.css +0 -2
- package/es/components/DatePicker/SingleDate/SingleDate.css +0 -2
- package/es/components/Pagination/Pagination.css +0 -2
- package/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.css +0 -2
- package/es/components/Range/Range.css +0 -2
- package/es/components/Select/Select.css +0 -2
- package/es/components/Select/ui/Target/Target.css +0 -2
- package/es/components/Select/ui/Target/ui/Textfield/Textfield.css +0 -2
- package/es/components/Slider/Slider.css +0 -2
- package/es/components/Slider/components/DoubleUncontrolled/DoubleUncontrolled.css +0 -2
- package/es/components/Switch/Switch.css +6 -6
- package/es/components/Switch/Switch.js +5 -2
- package/es/components/Switch/Switch.js.map +1 -1
- package/es/components/Switch/Switch.styles.js +1 -1
- package/es/components/Switch/Switch.styles.js.map +1 -1
- package/es/components/Switch/{Switch.styles_qjefea.css → Switch.styles_1pe5u24.css} +1 -1
- package/es/components/Switch/Switch.tokens.js +2 -1
- package/es/components/Switch/Switch.tokens.js.map +1 -1
- package/es/components/Table/Table.css +0 -2
- package/es/components/Table/ui/Cell/Cell.css +0 -2
- package/es/components/Table/ui/EditableCell/EditableCell.css +0 -2
- package/es/components/Table/ui/HeadCell/HeadCell.css +0 -2
- package/es/components/Table/ui/HeadCell/ui/Filter/Filter.css +0 -2
- package/es/components/TextField/TextField.js +3 -14
- package/es/components/TextField/TextField.js.map +1 -1
- package/es/engines/common.js +12 -2
- package/es/engines/common.js.map +1 -1
- package/es/index.css +6 -8
- package/package.json +2 -2
- package/styled-components/cjs/components/Combobox/ComboboxNew/Combobox.js +58 -26
- package/styled-components/cjs/components/Combobox/ComboboxNew/hooks/getPathMaps.js +5 -2
- package/styled-components/cjs/components/Combobox/ComboboxNew/utils/getRemovedElement.js +20 -0
- package/styled-components/cjs/components/Combobox/ComboboxNew/utils/index.js +4 -0
- package/styled-components/cjs/components/Switch/Switch.js +4 -2
- package/styled-components/cjs/components/Switch/Switch.styles.js +9 -8
- package/styled-components/cjs/components/Switch/Switch.tokens.js +2 -1
- package/styled-components/cjs/components/TextField/TextField.js +3 -15
- package/styled-components/cjs/components/TextField/ui/index.js +3 -12
- package/styled-components/cjs/engines/common.js +14 -1
- package/styled-components/es/components/Combobox/ComboboxNew/Combobox.js +59 -27
- package/styled-components/es/components/Combobox/ComboboxNew/hooks/getPathMaps.js +5 -2
- package/styled-components/es/components/Combobox/ComboboxNew/utils/getRemovedElement.js +10 -0
- package/styled-components/es/components/Combobox/ComboboxNew/utils/index.js +1 -0
- package/styled-components/es/components/Switch/Switch.js +4 -2
- package/styled-components/es/components/Switch/Switch.styles.js +9 -8
- package/styled-components/es/components/Switch/Switch.tokens.js +2 -1
- package/styled-components/es/components/TextField/TextField.js +4 -16
- package/styled-components/es/components/TextField/ui/index.js +0 -1
- package/styled-components/es/engines/common.js +14 -1
- package/styled-components/es/examples/components/Combobox/Combobox.js +7 -0
- package/types/components/Combobox/ComboboxNew/Combobox.d.ts.map +1 -1
- package/types/components/Combobox/ComboboxNew/hooks/getPathMaps.d.ts +2 -1
- package/types/components/Combobox/ComboboxNew/hooks/getPathMaps.d.ts.map +1 -1
- package/types/components/Combobox/ComboboxNew/utils/getRemovedElement.d.ts +2 -0
- package/types/components/Combobox/ComboboxNew/utils/getRemovedElement.d.ts.map +1 -0
- package/types/components/Combobox/ComboboxNew/utils/index.d.ts +1 -0
- package/types/components/Combobox/ComboboxNew/utils/index.d.ts.map +1 -1
- package/types/components/NumberFormat/NumberFormat.d.ts.map +1 -1
- package/types/components/NumberFormat/NumberFormat.types.d.ts +1 -1
- package/types/components/Switch/Switch.d.ts.map +1 -1
- package/types/components/Switch/Switch.styles.d.ts.map +1 -1
- package/types/components/Switch/Switch.tokens.d.ts +1 -0
- package/types/components/Switch/Switch.tokens.d.ts.map +1 -1
- package/types/components/Switch/Switch.types.d.ts +5 -0
- package/types/components/Switch/Switch.types.d.ts.map +1 -1
- package/types/components/TextField/TextField.d.ts.map +1 -1
- package/types/components/TextField/TextField.types.d.ts +2 -2
- package/types/components/TextField/ui/index.d.ts +0 -1
- package/types/components/TextField/ui/index.d.ts.map +1 -1
- package/types/engines/common.d.ts.map +1 -1
- package/types/examples/components/NumberFormat/NumberFormat.d.ts.map +1 -1
- package/cjs/components/TextField/ui/TextFieldChipNew/TextFieldChipNew.css +0 -54
- package/cjs/components/TextField/ui/TextFieldChipNew/TextFieldChipNew.js +0 -74
- package/cjs/components/TextField/ui/TextFieldChipNew/TextFieldChipNew.js.map +0 -1
- package/cjs/components/TextField/ui/TextFieldChipNew/TextFieldChipNew.styles.js +0 -25
- package/cjs/components/TextField/ui/TextFieldChipNew/TextFieldChipNew.styles.js.map +0 -1
- package/cjs/components/TextField/ui/TextFieldChipNew/TextFieldChipNew.styles_119gtz1.css +0 -1
- package/emotion/cjs/components/TextField/ui/TextFieldChipNew/TextFieldChipNew.js +0 -69
- package/emotion/cjs/components/TextField/ui/TextFieldChipNew/TextFieldChipNew.styles.js +0 -32
- package/emotion/es/components/TextField/ui/TextFieldChipNew/TextFieldChipNew.js +0 -54
- package/emotion/es/components/TextField/ui/TextFieldChipNew/TextFieldChipNew.styles.js +0 -18
- package/es/components/TextField/ui/TextFieldChipNew/TextFieldChipNew.css +0 -54
- package/es/components/TextField/ui/TextFieldChipNew/TextFieldChipNew.js +0 -66
- package/es/components/TextField/ui/TextFieldChipNew/TextFieldChipNew.js.map +0 -1
- package/es/components/TextField/ui/TextFieldChipNew/TextFieldChipNew.styles.js +0 -21
- package/es/components/TextField/ui/TextFieldChipNew/TextFieldChipNew.styles.js.map +0 -1
- package/es/components/TextField/ui/TextFieldChipNew/TextFieldChipNew.styles_119gtz1.css +0 -1
- package/styled-components/cjs/components/TextField/ui/TextFieldChipNew/TextFieldChipNew.js +0 -69
- package/styled-components/cjs/components/TextField/ui/TextFieldChipNew/TextFieldChipNew.styles.js +0 -87
- package/styled-components/es/components/TextField/ui/TextFieldChipNew/TextFieldChipNew.js +0 -54
- package/styled-components/es/components/TextField/ui/TextFieldChipNew/TextFieldChipNew.styles.js +0 -73
- package/types/components/TextField/ui/TextFieldChipNew/TextFieldChipNew.d.ts +0 -19
- package/types/components/TextField/ui/TextFieldChipNew/TextFieldChipNew.d.ts.map +0 -1
- package/types/components/TextField/ui/TextFieldChipNew/TextFieldChipNew.styles.d.ts +0 -2
- package/types/components/TextField/ui/TextFieldChipNew/TextFieldChipNew.styles.d.ts.map +0 -1
@@ -15,6 +15,9 @@ _export(exports, {
|
|
15
15
|
get getItemId () {
|
16
16
|
return _getItemId.getItemId;
|
17
17
|
},
|
18
|
+
get getRemovedElement () {
|
19
|
+
return _getRemovedElement.getRemovedElement;
|
20
|
+
},
|
18
21
|
get getTextValue () {
|
19
22
|
return _getTextValue.getTextValue;
|
20
23
|
},
|
@@ -41,4 +44,5 @@ var _updateSingleAncestors = require("./updateSingleAncestors");
|
|
41
44
|
var _sizeToIconSize = require("./sizeToIconSize");
|
42
45
|
var _filterItems = require("./filterItems");
|
43
46
|
var _getItemId = require("./getItemId");
|
47
|
+
var _getRemovedElement = require("./getRemovedElement");
|
44
48
|
var _getTextValue = require("./getTextValue");
|
@@ -147,7 +147,7 @@ function _object_without_properties_loose(source, excluded) {
|
|
147
147
|
}
|
148
148
|
var switchRoot = function(Root) {
|
149
149
|
return /*#__PURE__*/ (0, _react.forwardRef)(function(props, ref) {
|
150
|
-
var size = props.size, toggleSize = props.toggleSize, view = props.view, focused = props.focused, outlined = props.outlined, disabled = props.disabled, labelPosition = props.labelPosition, label = props.label, description = props.description, id = props.id, style = props.style, className = props.className, // singleLine,
|
150
|
+
var size = props.size, toggleSize = props.toggleSize, view = props.view, focused = props.focused, outlined = props.outlined, disabled = props.disabled, labelPosition = props.labelPosition, label = props.label, description = props.description, _props_labelEllipses = props.labelEllipses, labelEllipses = _props_labelEllipses === void 0 ? true : _props_labelEllipses, id = props.id, style = props.style, className = props.className, // singleLine,
|
151
151
|
checked = props.checked, pressed = props.pressed, defaultChecked = props.defaultChecked, rest = _object_without_properties(props, [
|
152
152
|
"size",
|
153
153
|
"toggleSize",
|
@@ -158,6 +158,7 @@ var switchRoot = function(Root) {
|
|
158
158
|
"labelPosition",
|
159
159
|
"label",
|
160
160
|
"description",
|
161
|
+
"labelEllipses",
|
161
162
|
"id",
|
162
163
|
"style",
|
163
164
|
"className",
|
@@ -187,7 +188,8 @@ var switchRoot = function(Root) {
|
|
187
188
|
defaultChecked: defaultChecked,
|
188
189
|
disabled: disabled
|
189
190
|
})), /*#__PURE__*/ _react.default.createElement(_Switchstyles.StyledLabel, {
|
190
|
-
tabIndex: -1
|
191
|
+
tabIndex: -1,
|
192
|
+
className: labelEllipses ? _Switchtokens.classes.labelEllipsis : ''
|
191
193
|
}, label), /*#__PURE__*/ _react.default.createElement(_Switchstyles.StyledTrigger, {
|
192
194
|
"aria-hidden": true
|
193
195
|
})), description && /*#__PURE__*/ _react.default.createElement(_Switchstyles.StyledDescription, null, description));
|
@@ -78,7 +78,7 @@ var base = (0, _styledcomponents.css)([
|
|
78
78
|
], _Switchtokens.tokens.verticalGap);
|
79
79
|
var StyledContent = _styledcomponents.default.div.withConfig({
|
80
80
|
displayName: "Switch.styles__StyledContent",
|
81
|
-
componentId: "sc-
|
81
|
+
componentId: "sc-66f1aa77-0"
|
82
82
|
})([
|
83
83
|
"width:100%;position:relative;display:flex;align-items:center;&.",
|
84
84
|
"{justify-content:space-between;",
|
@@ -90,7 +90,7 @@ var StyledContent = _styledcomponents.default.div.withConfig({
|
|
90
90
|
], _Switchtokens.classes.beforeSwitchLabelPosition, _Switchtokens.tokens.labelOffsetPrivate, _Switchtokens.tokens.labelOffset, _Switchtokens.classes.afterSwitchLabelPosition, _Switchtokens.tokens.labelOffsetPrivate, _Switchtokens.tokens.labelOffset);
|
91
91
|
var StyledDescription = _styledcomponents.default.div.withConfig({
|
92
92
|
displayName: "Switch.styles__StyledDescription",
|
93
|
-
componentId: "sc-
|
93
|
+
componentId: "sc-66f1aa77-1"
|
94
94
|
})([
|
95
95
|
"position:relative;",
|
96
96
|
" display:-webkit-box;line-clamp:var(",
|
@@ -99,20 +99,21 @@ var StyledDescription = _styledcomponents.default.div.withConfig({
|
|
99
99
|
], (0, _mixins.applyEllipsis)(), _Switchtokens.tokens.descriptionMaxLines, _Switchtokens.tokens.descriptionMaxLines);
|
100
100
|
var StyledInput = _styledcomponents.default.input.withConfig({
|
101
101
|
displayName: "Switch.styles__StyledInput",
|
102
|
-
componentId: "sc-
|
102
|
+
componentId: "sc-66f1aa77-2"
|
103
103
|
})([
|
104
104
|
"position:absolute;right:0;margin:0;opacity:0;&:focus{outline:0 none;}"
|
105
105
|
]);
|
106
106
|
var StyledLabel = _styledcomponents.default.span.withConfig({
|
107
107
|
displayName: "Switch.styles__StyledLabel",
|
108
|
-
componentId: "sc-
|
108
|
+
componentId: "sc-66f1aa77-3"
|
109
109
|
})([
|
110
|
-
"user-select:none
|
111
|
-
""
|
112
|
-
|
110
|
+
"user-select:none;&.",
|
111
|
+
"{",
|
112
|
+
"}"
|
113
|
+
], _Switchtokens.classes.labelEllipsis, (0, _mixins.applyEllipsis)());
|
113
114
|
var StyledTrigger = _styledcomponents.default.div.withConfig({
|
114
115
|
displayName: "Switch.styles__StyledTrigger",
|
115
|
-
componentId: "sc-
|
116
|
+
componentId: "sc-66f1aa77-4"
|
116
117
|
})([
|
117
118
|
"position:relative;display:flex;align-items:center;transition:background-color 0.15s ease-in-out 0.1s;::after{content:'';position:absolute;right:auto;left:0;transition:width 0.15s ease-in-out 0s,left 0.3s ease-in-out 0s,right 0.3s ease-in-out 0s;}",
|
118
119
|
":checked ~ &::after{right:0;left:auto;}"
|
@@ -64,5 +64,6 @@ var tokens = {
|
|
64
64
|
};
|
65
65
|
var classes = {
|
66
66
|
beforeSwitchLabelPosition: 'switch-label-position-before',
|
67
|
-
afterSwitchLabelPosition: 'switch-label-position-after'
|
67
|
+
afterSwitchLabelPosition: 'switch-label-position-after',
|
68
|
+
labelEllipsis: 'switch-label-ellipsis'
|
68
69
|
};
|
@@ -195,9 +195,7 @@ var textFieldRoot = function(Root) {
|
|
195
195
|
contentLeft = _param.contentLeft, contentRight = _param.contentRight, label = _param.label, labelPlacement = _param.labelPlacement, keepPlaceholder = _param.keepPlaceholder, textBefore = _param.textBefore, textAfter = _param.textAfter, placeholder = _param.placeholder, leftHelper = _param.leftHelper, _param_enumerationType = _param.enumerationType, enumerationType = _param_enumerationType === void 0 ? 'plain' : _param_enumerationType, _param_requiredPlacement = _param.requiredPlacement, requiredPlacement = _param_requiredPlacement === void 0 ? 'right' : _param_requiredPlacement, _param_hasRequiredIndicator = _param.hasRequiredIndicator, hasRequiredIndicator = _param_hasRequiredIndicator === void 0 ? true : _param_hasRequiredIndicator, titleCaption = _param.titleCaption, _param_chipView = _param.chipView, chipView = _param_chipView === void 0 ? 'default' : _param_chipView, chipValidator = _param.chipValidator, _param_hintTrigger = _param.// hint
|
196
196
|
hintTrigger, hintTrigger = _param_hintTrigger === void 0 ? 'hover' : _param_hintTrigger, hintText = _param.hintText, _param_hintView = _param.hintView, hintView = _param_hintView === void 0 ? 'default' : _param_hintView, _param_hintSize = _param.hintSize, hintSize = _param_hintSize === void 0 ? 'm' : _param_hintSize, hintTargetIcon = _param.hintTargetIcon, _param_hintTargetPlacement = _param.hintTargetPlacement, hintTargetPlacement = _param_hintTargetPlacement === void 0 ? 'outer' : _param_hintTargetPlacement, _param_hintPlacement = _param.hintPlacement, hintPlacement = _param_hintPlacement === void 0 ? 'auto' : _param_hintPlacement, hintHasArrow = _param.hintHasArrow, _param_hintOffset = _param.hintOffset, hintOffset = _param_hintOffset === void 0 ? HINT_DEFAULT_OFFSET : _param_hintOffset, hintWidth = _param.hintWidth, hintContentLeft = _param.hintContentLeft, // variations
|
197
197
|
view = _param.view, size = _param.size, _param_readOnly = _param.readOnly, readOnly = _param_readOnly === void 0 ? false : _param_readOnly, _param_disabled = _param.disabled, disabled = _param_disabled === void 0 ? false : _param_disabled, _param_required = _param.required, required = _param_required === void 0 ? false : _param_required, _param_clear = _param.clear, clear = _param_clear === void 0 ? false : _param_clear, optional = _param.optional, hasDivider = _param.hasDivider, // controlled
|
198
|
-
outerValue = _param.value, values = _param.chips, _param_chipType = _param.chipType, chipType = _param_chipType === void 0 ? 'default' : _param_chipType, //
|
199
|
-
_chips = _param._chips, // @ts-ignore
|
200
|
-
_onChipClick = _param._onChipClick, // events
|
198
|
+
outerValue = _param.value, values = _param.chips, _param_chipType = _param.chipType, chipType = _param_chipType === void 0 ? 'default' : _param_chipType, // events
|
201
199
|
onChange = _param.onChange, onChangeChips = _param.onChangeChips, onSearch = _param.onSearch, onKeyDown = _param.onKeyDown, onFocus = _param.onFocus, onBlur = _param.onBlur, onPaste = _param.onPaste, // Пропсы для внутреннего использования, не отдается наружу.
|
202
200
|
// @ts-ignore
|
203
201
|
_onEnterDisabled = _param._onEnterDisabled, // @ts-ignore
|
@@ -242,8 +240,6 @@ var textFieldRoot = function(Root) {
|
|
242
240
|
"value",
|
243
241
|
"chips",
|
244
242
|
"chipType",
|
245
|
-
"_chips",
|
246
|
-
"_onChipClick",
|
247
243
|
"onChange",
|
248
244
|
"onChangeChips",
|
249
245
|
"onSearch",
|
@@ -275,7 +271,7 @@ var textFieldRoot = function(Root) {
|
|
275
271
|
var helperTextId = (0, _utils.safeUseId)();
|
276
272
|
var isDefaultView = view === 'default' || readOnly || disabled;
|
277
273
|
var isChipEnumeration = enumerationType === 'chip';
|
278
|
-
var isChipsVisible = isChipEnumeration && Boolean(
|
274
|
+
var isChipsVisible = isChipEnumeration && Boolean(chips === null || chips === void 0 ? void 0 : chips.length);
|
279
275
|
var withHasChips = isChipsVisible ? _TextFieldtokens.classes.hasChips : undefined;
|
280
276
|
var hasLabelValue = Boolean(label);
|
281
277
|
var hasInnerLabel = size !== 'xs' && labelPlacement === 'inner' && !isChipsVisible && hasLabelValue;
|
@@ -530,15 +526,7 @@ var textFieldRoot = function(Root) {
|
|
530
526
|
ref: contentRef,
|
531
527
|
onKeyDown: handleContentKeyDown,
|
532
528
|
className: withHasChips
|
533
|
-
}, Boolean(textBefore && isChipEnumeration) && /*#__PURE__*/ _react.default.createElement(_TextFieldstyles.StyledTextBefore, null, textBefore), Boolean(
|
534
|
-
chips: _chips,
|
535
|
-
onChipClick: _onChipClick,
|
536
|
-
getRef: getRef,
|
537
|
-
handleChipKeyDown: handleChipKeyDown,
|
538
|
-
onChipClear: onChipClear,
|
539
|
-
view: view,
|
540
|
-
readOnly: readOnly
|
541
|
-
}), isChipEnumeration && Boolean(chips === null || chips === void 0 ? void 0 : chips.length) && /*#__PURE__*/ _react.default.createElement(_TextFieldstyles.StyledChips, {
|
529
|
+
}, Boolean(textBefore && isChipEnumeration) && /*#__PURE__*/ _react.default.createElement(_TextFieldstyles.StyledTextBefore, null, textBefore), isChipEnumeration && Boolean(chips === null || chips === void 0 ? void 0 : chips.length) && /*#__PURE__*/ _react.default.createElement(_TextFieldstyles.StyledChips, {
|
542
530
|
className: _TextFieldtokens.classes.chipsWrapper
|
543
531
|
}, chips === null || chips === void 0 ? void 0 : chips.map(function(param, index) {
|
544
532
|
var chipId = param.id, text = param.text;
|
@@ -2,19 +2,10 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
3
3
|
value: true
|
4
4
|
});
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
get: Object.getOwnPropertyDescriptor(all, name).get
|
9
|
-
});
|
10
|
-
}
|
11
|
-
_export(exports, {
|
12
|
-
get TextFieldChip () {
|
5
|
+
Object.defineProperty(exports, "TextFieldChip", {
|
6
|
+
enumerable: true,
|
7
|
+
get: function() {
|
13
8
|
return _TextFieldChip.TextFieldChip;
|
14
|
-
},
|
15
|
-
get TextFieldChipNew () {
|
16
|
-
return _TextFieldChipNew.TextFieldChipNew;
|
17
9
|
}
|
18
10
|
});
|
19
11
|
var _TextFieldChip = require("./TextFieldChip/TextFieldChip");
|
20
|
-
var _TextFieldChipNew = require("./TextFieldChipNew/TextFieldChipNew");
|
@@ -99,10 +99,23 @@ var mergeConfig = function(baseConfig, userConfig) {
|
|
99
99
|
}
|
100
100
|
return res;
|
101
101
|
};
|
102
|
+
// INFO: Метод, который проводит слияние двух объектов
|
103
|
+
// INFO: если значение явно указанно как undefined/null/пустая строка, то будет взято значение указанное в default
|
104
|
+
function mergeWithoutNullable(defaults, componentProps) {
|
105
|
+
var props = Object.keys(defaults).reduce(function(acc, key) {
|
106
|
+
return _object_spread_props(_object_spread({}, acc), _define_property({}, key, [
|
107
|
+
null,
|
108
|
+
undefined,
|
109
|
+
''
|
110
|
+
].includes(componentProps[key]) ? defaults[key] : componentProps[key]));
|
111
|
+
}, {});
|
112
|
+
return _object_spread({}, componentProps, props);
|
113
|
+
}
|
102
114
|
function component(config) {
|
103
115
|
var Comp = config.layout((0, _styledcomponents._component)(config));
|
104
116
|
return /*#__PURE__*/ _react.default.forwardRef(function(props, ref) {
|
105
|
-
|
117
|
+
var mergedProps = mergeWithoutNullable(config === null || config === void 0 ? void 0 : config.defaults, props);
|
118
|
+
return /*#__PURE__*/ _react.default.createElement(Comp, _object_spread_props(_object_spread({}, mergedProps), {
|
106
119
|
ref: ref
|
107
120
|
}));
|
108
121
|
});
|
@@ -6,6 +6,9 @@ function _array_like_to_array(arr, len) {
|
|
6
6
|
function _array_with_holes(arr) {
|
7
7
|
if (Array.isArray(arr)) return arr;
|
8
8
|
}
|
9
|
+
function _array_without_holes(arr) {
|
10
|
+
if (Array.isArray(arr)) return _array_like_to_array(arr);
|
11
|
+
}
|
9
12
|
function _define_property(obj, key, value) {
|
10
13
|
if (key in obj) {
|
11
14
|
Object.defineProperty(obj, key, {
|
@@ -19,6 +22,9 @@ function _define_property(obj, key, value) {
|
|
19
22
|
}
|
20
23
|
return obj;
|
21
24
|
}
|
25
|
+
function _iterable_to_array(iter) {
|
26
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
27
|
+
}
|
22
28
|
function _iterable_to_array_limit(arr, i) {
|
23
29
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
24
30
|
if (_i == null) return;
|
@@ -46,6 +52,9 @@ function _iterable_to_array_limit(arr, i) {
|
|
46
52
|
function _non_iterable_rest() {
|
47
53
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
48
54
|
}
|
55
|
+
function _non_iterable_spread() {
|
56
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
57
|
+
}
|
49
58
|
function _object_spread(target) {
|
50
59
|
for(var i = 1; i < arguments.length; i++){
|
51
60
|
var source = arguments[i] != null ? arguments[i] : {};
|
@@ -115,6 +124,9 @@ function _object_without_properties_loose(source, excluded) {
|
|
115
124
|
function _sliced_to_array(arr, i) {
|
116
125
|
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
117
126
|
}
|
127
|
+
function _to_consumable_array(arr) {
|
128
|
+
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
|
129
|
+
}
|
118
130
|
function _type_of(obj) {
|
119
131
|
"@swc/helpers - typeof";
|
120
132
|
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
@@ -135,7 +147,7 @@ import { sizeToIconSize } from "../../Select/utils";
|
|
135
147
|
import { classes } from "./Combobox.tokens";
|
136
148
|
import { FloatingPopover } from "./FloatingPopover";
|
137
149
|
import { useKeyNavigation, getItemByFocused } from "./hooks/useKeyboardNavigation";
|
138
|
-
import { initialItemsTransform, updateAncestors, updateDescendants, updateSingleAncestors, filterItems, getItemId, getTextValue } from "./utils";
|
150
|
+
import { initialItemsTransform, updateAncestors, updateDescendants, updateSingleAncestors, filterItems, getItemId, getRemovedElement, getTextValue } from "./utils";
|
139
151
|
import { Inner, StyledTextField, VirtualList, SelectAll } from "./ui";
|
140
152
|
import { pathReducer, focusedPathReducer } from "./reducers";
|
141
153
|
import { getPathMap, getTreeMaps } from "./hooks/getPathMaps";
|
@@ -206,7 +218,7 @@ import { Context } from "./Combobox.context";
|
|
206
218
|
return getTreeMaps(transformedItems);
|
207
219
|
}, [
|
208
220
|
items
|
209
|
-
]),
|
221
|
+
]), 3), valueToCheckedMap = _useMemo[0], valueToItemMap = _useMemo[1], labelToItemMap = _useMemo[2];
|
210
222
|
var _useState = _sliced_to_array(useState(getTextValue(multiple, outerValue, valueToItemMap, renderValue)), 2), textValue = _useState[0], setTextValue = _useState[1];
|
211
223
|
var _useState1 = _sliced_to_array(useState(multiple ? [] : ''), 2), internalValue = _useState1[0], setInternalValue = _useState1[1];
|
212
224
|
var value = outerValue !== null && outerValue !== undefined ? outerValue : internalValue;
|
@@ -294,14 +306,39 @@ import { Context } from "./Combobox.context";
|
|
294
306
|
}
|
295
307
|
};
|
296
308
|
// Обработчик чипов
|
297
|
-
var
|
309
|
+
var handleChipsChange = function(chipLabels) {
|
298
310
|
if (!Array.isArray(value)) return;
|
299
|
-
|
300
|
-
|
311
|
+
// TODO: #1564
|
312
|
+
// Из лейблов чипов получаем value у item и далее прокидываем его в onChange.
|
313
|
+
if (renderValue && !isTargetAmount) {
|
314
|
+
var resultValues = _to_consumable_array(value);
|
315
|
+
value.forEach(function(_, index) {
|
316
|
+
var _valueToItemMap_get;
|
317
|
+
var stringValue = value[index];
|
318
|
+
var label = (_valueToItemMap_get = valueToItemMap.get(stringValue)) === null || _valueToItemMap_get === void 0 ? void 0 : _valueToItemMap_get.label;
|
319
|
+
var labelAfterRenderValue = renderValue(label ? labelToItemMap.get(label) : {
|
320
|
+
value: stringValue,
|
321
|
+
label: stringValue.toString()
|
322
|
+
});
|
323
|
+
if (!chipLabels.includes(labelAfterRenderValue)) {
|
324
|
+
resultValues.splice(index, 1);
|
325
|
+
}
|
326
|
+
});
|
327
|
+
var removedItemValue = getRemovedElement(value, resultValues, isTargetAmount);
|
328
|
+
onChange(resultValues, removedItemValue ? valueToItemMap.get(removedItemValue) || {
|
329
|
+
value: removedItemValue,
|
330
|
+
label: removedItemValue.toString()
|
331
|
+
} : null);
|
301
332
|
} else {
|
302
|
-
|
303
|
-
|
304
|
-
|
333
|
+
var newValues = chipLabels.map(function(chipLabel) {
|
334
|
+
var _labelToItemMap_get;
|
335
|
+
return ((_labelToItemMap_get = labelToItemMap.get(chipLabel)) === null || _labelToItemMap_get === void 0 ? void 0 : _labelToItemMap_get.value) || chipLabel;
|
336
|
+
});
|
337
|
+
var removedItemValue1 = getRemovedElement(value, newValues, isTargetAmount);
|
338
|
+
onChange(newValues, removedItemValue1 ? valueToItemMap.get(removedItemValue1) || {
|
339
|
+
value: removedItemValue1,
|
340
|
+
label: removedItemValue1.toString()
|
341
|
+
} : null);
|
305
342
|
}
|
306
343
|
};
|
307
344
|
// Обработчик открытия/закрытия выпадающего списка
|
@@ -405,25 +442,20 @@ import { Context } from "./Combobox.context";
|
|
405
442
|
if (value.length === 0) return [];
|
406
443
|
if (isTargetAmount) {
|
407
444
|
return [
|
408
|
-
|
409
|
-
value: '_removeAll',
|
410
|
-
label: "Выбрано ".concat(targetAmount || value.length),
|
411
|
-
disabled: false
|
412
|
-
}
|
445
|
+
"Выбрано ".concat(targetAmount || value.length)
|
413
446
|
];
|
414
447
|
}
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
});
|
448
|
+
var renderValueMapper = renderValue && function(stringValue) {
|
449
|
+
return renderValue(valueToItemMap.get(stringValue) || {
|
450
|
+
value: stringValue,
|
451
|
+
label: stringValue.toString()
|
452
|
+
});
|
453
|
+
};
|
454
|
+
var valueToItemMapper = function(stringValue) {
|
455
|
+
var _valueToItemMap_get;
|
456
|
+
return ((_valueToItemMap_get = valueToItemMap.get(stringValue)) === null || _valueToItemMap_get === void 0 ? void 0 : _valueToItemMap_get.label) || stringValue.toString();
|
457
|
+
};
|
458
|
+
return value.map(renderValueMapper || valueToItemMapper);
|
427
459
|
}
|
428
460
|
return [];
|
429
461
|
};
|
@@ -580,8 +612,8 @@ import { Context } from "./Combobox.context";
|
|
580
612
|
keepPlaceholder: keepPlaceholder
|
581
613
|
}, multiple ? {
|
582
614
|
enumerationType: 'chip',
|
583
|
-
|
584
|
-
|
615
|
+
chips: getChips(),
|
616
|
+
onChangeChips: handleChipsChange
|
585
617
|
} : {
|
586
618
|
enumerationType: 'plain'
|
587
619
|
}, rest), {
|
@@ -24,14 +24,16 @@ export var getPathMap = function(items) {
|
|
24
24
|
export var getTreeMaps = function(items) {
|
25
25
|
var valueToCheckedMap = new Map();
|
26
26
|
var valueToItemMap = new Map();
|
27
|
+
var labelToItemMap = new Map();
|
27
28
|
var rec = function(items) {
|
28
29
|
var prevIndex = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : '';
|
29
30
|
items === null || items === void 0 ? void 0 : items.forEach(function(item, index) {
|
30
|
-
var value = item.value, innerItems = item.items;
|
31
|
+
var value = item.value, label = item.label, innerItems = item.items;
|
31
32
|
var currIndex = "".concat(prevIndex, "/").concat(index).replace(/^(\/)/, '');
|
32
33
|
valueToCheckedMap.set(value, false);
|
33
34
|
if (isEmpty(innerItems) || !innerItems) {
|
34
35
|
valueToItemMap.set(value, item);
|
36
|
+
labelToItemMap.set(label, item);
|
35
37
|
} else {
|
36
38
|
rec(innerItems, currIndex);
|
37
39
|
}
|
@@ -40,6 +42,7 @@ export var getTreeMaps = function(items) {
|
|
40
42
|
rec(items);
|
41
43
|
return [
|
42
44
|
valueToCheckedMap,
|
43
|
-
valueToItemMap
|
45
|
+
valueToItemMap,
|
46
|
+
labelToItemMap
|
44
47
|
];
|
45
48
|
};
|
@@ -0,0 +1,10 @@
|
|
1
|
+
// Утилита для определения какой чип был удален
|
2
|
+
export var getRemovedElement = function(prevValues, newValues) {
|
3
|
+
var isTargetAmount = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
|
4
|
+
if (isTargetAmount) {
|
5
|
+
return null;
|
6
|
+
}
|
7
|
+
return prevValues.filter(function(item) {
|
8
|
+
return !newValues.includes(item);
|
9
|
+
})[0] || null;
|
10
|
+
};
|
@@ -5,4 +5,5 @@ export { updateSingleAncestors } from "./updateSingleAncestors";
|
|
5
5
|
export { sizeToIconSize } from "./sizeToIconSize";
|
6
6
|
export { filterItems } from "./filterItems";
|
7
7
|
export { getItemId } from "./getItemId";
|
8
|
+
export { getRemovedElement } from "./getRemovedElement";
|
8
9
|
export { getTextValue } from "./getTextValue";
|
@@ -88,7 +88,7 @@ import { StyledContent, StyledDescription, StyledInput, StyledLabel, StyledTrigg
|
|
88
88
|
import { classes } from "./Switch.tokens";
|
89
89
|
export var switchRoot = function(Root) {
|
90
90
|
return /*#__PURE__*/ forwardRef(function(props, ref) {
|
91
|
-
var size = props.size, toggleSize = props.toggleSize, view = props.view, focused = props.focused, outlined = props.outlined, disabled = props.disabled, labelPosition = props.labelPosition, label = props.label, description = props.description, id = props.id, style = props.style, className = props.className, // singleLine,
|
91
|
+
var size = props.size, toggleSize = props.toggleSize, view = props.view, focused = props.focused, outlined = props.outlined, disabled = props.disabled, labelPosition = props.labelPosition, label = props.label, description = props.description, _props_labelEllipses = props.labelEllipses, labelEllipses = _props_labelEllipses === void 0 ? true : _props_labelEllipses, id = props.id, style = props.style, className = props.className, // singleLine,
|
92
92
|
checked = props.checked, pressed = props.pressed, defaultChecked = props.defaultChecked, rest = _object_without_properties(props, [
|
93
93
|
"size",
|
94
94
|
"toggleSize",
|
@@ -99,6 +99,7 @@ export var switchRoot = function(Root) {
|
|
99
99
|
"labelPosition",
|
100
100
|
"label",
|
101
101
|
"description",
|
102
|
+
"labelEllipses",
|
102
103
|
"id",
|
103
104
|
"style",
|
104
105
|
"className",
|
@@ -128,7 +129,8 @@ export var switchRoot = function(Root) {
|
|
128
129
|
defaultChecked: defaultChecked,
|
129
130
|
disabled: disabled
|
130
131
|
})), /*#__PURE__*/ React.createElement(StyledLabel, {
|
131
|
-
tabIndex: -1
|
132
|
+
tabIndex: -1,
|
133
|
+
className: labelEllipses ? classes.labelEllipsis : ''
|
132
134
|
}, label), /*#__PURE__*/ React.createElement(StyledTrigger, {
|
133
135
|
"aria-hidden": true
|
134
136
|
})), description && /*#__PURE__*/ React.createElement(StyledDescription, null, description));
|
@@ -8,7 +8,7 @@ export var base = css([
|
|
8
8
|
], tokens.verticalGap);
|
9
9
|
export var StyledContent = styled.div.withConfig({
|
10
10
|
displayName: "Switch.styles__StyledContent",
|
11
|
-
componentId: "sc-
|
11
|
+
componentId: "sc-66f1aa77-0"
|
12
12
|
})([
|
13
13
|
"width:100%;position:relative;display:flex;align-items:center;&.",
|
14
14
|
"{justify-content:space-between;",
|
@@ -20,7 +20,7 @@ export var StyledContent = styled.div.withConfig({
|
|
20
20
|
], classes.beforeSwitchLabelPosition, tokens.labelOffsetPrivate, tokens.labelOffset, classes.afterSwitchLabelPosition, tokens.labelOffsetPrivate, tokens.labelOffset);
|
21
21
|
export var StyledDescription = styled.div.withConfig({
|
22
22
|
displayName: "Switch.styles__StyledDescription",
|
23
|
-
componentId: "sc-
|
23
|
+
componentId: "sc-66f1aa77-1"
|
24
24
|
})([
|
25
25
|
"position:relative;",
|
26
26
|
" display:-webkit-box;line-clamp:var(",
|
@@ -29,20 +29,21 @@ export var StyledDescription = styled.div.withConfig({
|
|
29
29
|
], applyEllipsis(), tokens.descriptionMaxLines, tokens.descriptionMaxLines);
|
30
30
|
export var StyledInput = styled.input.withConfig({
|
31
31
|
displayName: "Switch.styles__StyledInput",
|
32
|
-
componentId: "sc-
|
32
|
+
componentId: "sc-66f1aa77-2"
|
33
33
|
})([
|
34
34
|
"position:absolute;right:0;margin:0;opacity:0;&:focus{outline:0 none;}"
|
35
35
|
]);
|
36
36
|
export var StyledLabel = styled.span.withConfig({
|
37
37
|
displayName: "Switch.styles__StyledLabel",
|
38
|
-
componentId: "sc-
|
38
|
+
componentId: "sc-66f1aa77-3"
|
39
39
|
})([
|
40
|
-
"user-select:none
|
41
|
-
""
|
42
|
-
|
40
|
+
"user-select:none;&.",
|
41
|
+
"{",
|
42
|
+
"}"
|
43
|
+
], classes.labelEllipsis, applyEllipsis());
|
43
44
|
export var StyledTrigger = styled.div.withConfig({
|
44
45
|
displayName: "Switch.styles__StyledTrigger",
|
45
|
-
componentId: "sc-
|
46
|
+
componentId: "sc-66f1aa77-4"
|
46
47
|
})([
|
47
48
|
"position:relative;display:flex;align-items:center;transition:background-color 0.15s ease-in-out 0.1s;::after{content:'';position:absolute;right:auto;left:0;transition:width 0.15s ease-in-out 0s,left 0.3s ease-in-out 0s,right 0.3s ease-in-out 0s;}",
|
48
49
|
":checked ~ &::after{right:0;left:auto;}"
|
@@ -46,5 +46,6 @@ export var tokens = {
|
|
46
46
|
};
|
47
47
|
export var classes = {
|
48
48
|
beforeSwitchLabelPosition: 'switch-label-position-before',
|
49
|
-
afterSwitchLabelPosition: 'switch-label-position-after'
|
49
|
+
afterSwitchLabelPosition: 'switch-label-position-after',
|
50
|
+
labelEllipsis: 'switch-label-ellipsis'
|
50
51
|
};
|
@@ -115,7 +115,7 @@ import { base as hintSizeCSS } from "./variations/_hint-size/base";
|
|
115
115
|
import { base as chipViewCSS } from "./variations/_chip-view/base";
|
116
116
|
import { Input, InputContainer, LeftHelper, Label, InputWrapper, InputLabelWrapper, StyledContentLeft, StyledContentRight, StyledChips, StyledTextBefore, StyledTextAfter, StyledIndicator, StyledOptionalText, InputPlaceholder, OuterLabelWrapper, TitleCaption, StyledHintWrapper, StyledIndicatorWrapper, StyledContentRightWrapper } from "./TextField.styles";
|
117
117
|
import { classes } from "./TextField.tokens";
|
118
|
-
import { TextFieldChip
|
118
|
+
import { TextFieldChip } from "./ui";
|
119
119
|
import { useKeyNavigation } from "./hooks";
|
120
120
|
import { HintComponent } from "./ui/Hint/Hint";
|
121
121
|
import { getInputWidth } from "./getInputWidth";
|
@@ -133,9 +133,7 @@ export var textFieldRoot = function(Root) {
|
|
133
133
|
contentLeft = _param.contentLeft, contentRight = _param.contentRight, label = _param.label, labelPlacement = _param.labelPlacement, keepPlaceholder = _param.keepPlaceholder, textBefore = _param.textBefore, textAfter = _param.textAfter, placeholder = _param.placeholder, leftHelper = _param.leftHelper, _param_enumerationType = _param.enumerationType, enumerationType = _param_enumerationType === void 0 ? 'plain' : _param_enumerationType, _param_requiredPlacement = _param.requiredPlacement, requiredPlacement = _param_requiredPlacement === void 0 ? 'right' : _param_requiredPlacement, _param_hasRequiredIndicator = _param.hasRequiredIndicator, hasRequiredIndicator = _param_hasRequiredIndicator === void 0 ? true : _param_hasRequiredIndicator, titleCaption = _param.titleCaption, _param_chipView = _param.chipView, chipView = _param_chipView === void 0 ? 'default' : _param_chipView, chipValidator = _param.chipValidator, _param_hintTrigger = _param.// hint
|
134
134
|
hintTrigger, hintTrigger = _param_hintTrigger === void 0 ? 'hover' : _param_hintTrigger, hintText = _param.hintText, _param_hintView = _param.hintView, hintView = _param_hintView === void 0 ? 'default' : _param_hintView, _param_hintSize = _param.hintSize, hintSize = _param_hintSize === void 0 ? 'm' : _param_hintSize, hintTargetIcon = _param.hintTargetIcon, _param_hintTargetPlacement = _param.hintTargetPlacement, hintTargetPlacement = _param_hintTargetPlacement === void 0 ? 'outer' : _param_hintTargetPlacement, _param_hintPlacement = _param.hintPlacement, hintPlacement = _param_hintPlacement === void 0 ? 'auto' : _param_hintPlacement, hintHasArrow = _param.hintHasArrow, _param_hintOffset = _param.hintOffset, hintOffset = _param_hintOffset === void 0 ? HINT_DEFAULT_OFFSET : _param_hintOffset, hintWidth = _param.hintWidth, hintContentLeft = _param.hintContentLeft, // variations
|
135
135
|
view = _param.view, size = _param.size, _param_readOnly = _param.readOnly, readOnly = _param_readOnly === void 0 ? false : _param_readOnly, _param_disabled = _param.disabled, disabled = _param_disabled === void 0 ? false : _param_disabled, _param_required = _param.required, required = _param_required === void 0 ? false : _param_required, _param_clear = _param.clear, clear = _param_clear === void 0 ? false : _param_clear, optional = _param.optional, hasDivider = _param.hasDivider, // controlled
|
136
|
-
outerValue = _param.value, values = _param.chips, _param_chipType = _param.chipType, chipType = _param_chipType === void 0 ? 'default' : _param_chipType, //
|
137
|
-
_chips = _param._chips, // @ts-ignore
|
138
|
-
_onChipClick = _param._onChipClick, // events
|
136
|
+
outerValue = _param.value, values = _param.chips, _param_chipType = _param.chipType, chipType = _param_chipType === void 0 ? 'default' : _param_chipType, // events
|
139
137
|
onChange = _param.onChange, onChangeChips = _param.onChangeChips, onSearch = _param.onSearch, onKeyDown = _param.onKeyDown, onFocus = _param.onFocus, onBlur = _param.onBlur, onPaste = _param.onPaste, // Пропсы для внутреннего использования, не отдается наружу.
|
140
138
|
// @ts-ignore
|
141
139
|
_onEnterDisabled = _param._onEnterDisabled, // @ts-ignore
|
@@ -180,8 +178,6 @@ export var textFieldRoot = function(Root) {
|
|
180
178
|
"value",
|
181
179
|
"chips",
|
182
180
|
"chipType",
|
183
|
-
"_chips",
|
184
|
-
"_onChipClick",
|
185
181
|
"onChange",
|
186
182
|
"onChangeChips",
|
187
183
|
"onSearch",
|
@@ -213,7 +209,7 @@ export var textFieldRoot = function(Root) {
|
|
213
209
|
var helperTextId = safeUseId();
|
214
210
|
var isDefaultView = view === 'default' || readOnly || disabled;
|
215
211
|
var isChipEnumeration = enumerationType === 'chip';
|
216
|
-
var isChipsVisible = isChipEnumeration && Boolean(
|
212
|
+
var isChipsVisible = isChipEnumeration && Boolean(chips === null || chips === void 0 ? void 0 : chips.length);
|
217
213
|
var withHasChips = isChipsVisible ? classes.hasChips : undefined;
|
218
214
|
var hasLabelValue = Boolean(label);
|
219
215
|
var hasInnerLabel = size !== 'xs' && labelPlacement === 'inner' && !isChipsVisible && hasLabelValue;
|
@@ -468,15 +464,7 @@ export var textFieldRoot = function(Root) {
|
|
468
464
|
ref: contentRef,
|
469
465
|
onKeyDown: handleContentKeyDown,
|
470
466
|
className: withHasChips
|
471
|
-
}, Boolean(textBefore && isChipEnumeration) && /*#__PURE__*/ React.createElement(StyledTextBefore, null, textBefore), Boolean(
|
472
|
-
chips: _chips,
|
473
|
-
onChipClick: _onChipClick,
|
474
|
-
getRef: getRef,
|
475
|
-
handleChipKeyDown: handleChipKeyDown,
|
476
|
-
onChipClear: onChipClear,
|
477
|
-
view: view,
|
478
|
-
readOnly: readOnly
|
479
|
-
}), isChipEnumeration && Boolean(chips === null || chips === void 0 ? void 0 : chips.length) && /*#__PURE__*/ React.createElement(StyledChips, {
|
467
|
+
}, Boolean(textBefore && isChipEnumeration) && /*#__PURE__*/ React.createElement(StyledTextBefore, null, textBefore), isChipEnumeration && Boolean(chips === null || chips === void 0 ? void 0 : chips.length) && /*#__PURE__*/ React.createElement(StyledChips, {
|
480
468
|
className: classes.chipsWrapper
|
481
469
|
}, chips === null || chips === void 0 ? void 0 : chips.map(function(param, index) {
|
482
470
|
var chipId = param.id, text = param.text;
|
@@ -76,10 +76,23 @@ export var mergeConfig = function(baseConfig, userConfig) {
|
|
76
76
|
}
|
77
77
|
return res;
|
78
78
|
};
|
79
|
+
// INFO: Метод, который проводит слияние двух объектов
|
80
|
+
// INFO: если значение явно указанно как undefined/null/пустая строка, то будет взято значение указанное в default
|
81
|
+
function mergeWithoutNullable(defaults, componentProps) {
|
82
|
+
var props = Object.keys(defaults).reduce(function(acc, key) {
|
83
|
+
return _object_spread_props(_object_spread({}, acc), _define_property({}, key, [
|
84
|
+
null,
|
85
|
+
undefined,
|
86
|
+
''
|
87
|
+
].includes(componentProps[key]) ? defaults[key] : componentProps[key]));
|
88
|
+
}, {});
|
89
|
+
return _object_spread({}, componentProps, props);
|
90
|
+
}
|
79
91
|
export function component(config) {
|
80
92
|
var Comp = config.layout(_component(config));
|
81
93
|
return /*#__PURE__*/ React.forwardRef(function(props, ref) {
|
82
|
-
|
94
|
+
var mergedProps = mergeWithoutNullable(config === null || config === void 0 ? void 0 : config.defaults, props);
|
95
|
+
return /*#__PURE__*/ React.createElement(Comp, _object_spread_props(_object_spread({}, mergedProps), {
|
83
96
|
ref: ref
|
84
97
|
}));
|
85
98
|
});
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import { component, mergeConfig } from "../../../engines";
|
2
|
+
import { comboboxNewConfig } from "../../..";
|
3
|
+
import { config } from "./Combobox.config";
|
4
|
+
var mergedConfig = mergeConfig(comboboxNewConfig, config);
|
5
|
+
var ComboboxComponent = component(mergedConfig);
|
6
|
+
var Combobox = ComboboxComponent;
|
7
|
+
export { Combobox };
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Combobox.d.ts","sourceRoot":"","sources":["../../../../src/components/Combobox/ComboboxNew/Combobox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6E,MAAM,OAAO,CAAC;AAIlG,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;
|
1
|
+
{"version":3,"file":"Combobox.d.ts","sourceRoot":"","sources":["../../../../src/components/Combobox/ComboboxNew/Combobox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6E,MAAM,OAAO,CAAC;AAIlG,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AA8BxC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAOtD;;GAEG;AAEH,eAAO,MAAM,YAAY,SAAU,SAAS,CAAC,gBAAgB,EAAE,IAAI,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC,2FA2kBtF,CAAC;AAEP,eAAO,MAAM,cAAc;;;mBA7kBQ,SAAS,CAAC,gBAAgB,EAAE,IAAI,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;;;;;;;;;;;;;;;;;;CAkmB3F,CAAC"}
|
@@ -4,6 +4,7 @@ export type PathMapType = Map<string, number>;
|
|
4
4
|
export type FocusedToValueMapType = Map<string, ItemOptionTransformed>;
|
5
5
|
export type ValueToCheckedMapType = Map<ItemOptionTransformed['value'], boolean | 'done' | 'dot' | 'indeterminate'>;
|
6
6
|
export type ValueToItemMapType = Map<ItemOptionTransformed['value'], ItemOptionTransformed>;
|
7
|
+
export type LabelToItemMapType = Map<ItemOptionTransformed['label'], ItemOptionTransformed>;
|
7
8
|
export declare const getPathMap: (items: ComboboxProps["items"]) => [PathMapType, FocusedToValueMapType];
|
8
|
-
export declare const getTreeMaps: (items: ComboboxProps["items"]) => [ValueToCheckedMapType, ValueToItemMapType];
|
9
|
+
export declare const getTreeMaps: (items: ComboboxProps["items"]) => [ValueToCheckedMapType, ValueToItemMapType, LabelToItemMapType];
|
9
10
|
//# sourceMappingURL=getPathMaps.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getPathMaps.d.ts","sourceRoot":"","sources":["../../../../../src/components/Combobox/ComboboxNew/hooks/getPathMaps.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"getPathMaps.d.ts","sourceRoot":"","sources":["../../../../../src/components/Combobox/ComboboxNew/hooks/getPathMaps.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAEvE,MAAM,MAAM,WAAW,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC9C,MAAM,MAAM,qBAAqB,GAAG,GAAG,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC;AACvE,MAAM,MAAM,qBAAqB,GAAG,GAAG,CAAC,qBAAqB,CAAC,OAAO,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,KAAK,GAAG,eAAe,CAAC,CAAC;AACpH,MAAM,MAAM,kBAAkB,GAAG,GAAG,CAAC,qBAAqB,CAAC,OAAO,CAAC,EAAE,qBAAqB,CAAC,CAAC;AAC5F,MAAM,MAAM,kBAAkB,GAAG,GAAG,CAAC,qBAAqB,CAAC,OAAO,CAAC,EAAE,qBAAqB,CAAC,CAAC;AAE5F,eAAO,MAAM,UAAU,UAAW,aAAa,CAAC,OAAO,CAAC,KAqBb,CAAC,WAAW,EAAE,qBAAqB,CAC7E,CAAC;AAEF,eAAO,MAAM,WAAW,UAAW,aAAa,CAAC,OAAO,CAAC,KAuBS,CAC1D,qBAAqB,EACrB,kBAAkB,EAClB,kBAAkB,CAEzB,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"getRemovedElement.d.ts","sourceRoot":"","sources":["../../../../../src/components/Combobox/ComboboxNew/utils/getRemovedElement.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,iBAAiB,EAAE,CAC5B,UAAU,EAAE,MAAM,EAAE,EACpB,SAAS,EAAE,MAAM,EAAE,EACnB,cAAc,CAAC,EAAE,OAAO,KACvB,MAAM,GAAG,IAMb,CAAC"}
|
@@ -5,5 +5,6 @@ export { updateSingleAncestors } from './updateSingleAncestors';
|
|
5
5
|
export { sizeToIconSize } from './sizeToIconSize';
|
6
6
|
export { filterItems } from './filterItems';
|
7
7
|
export { getItemId } from './getItemId';
|
8
|
+
export { getRemovedElement } from './getRemovedElement';
|
8
9
|
export { getTextValue } from './getTextValue';
|
9
10
|
//# sourceMappingURL=index.d.ts.map
|