@salutejs/plasma-new-hope 0.336.0-canary.2231.17732581275.0 → 0.336.0-canary.2234.17756611449.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/Combobox/ComboboxNew/Combobox.js +10 -11
- package/cjs/components/Combobox/ComboboxNew/Combobox.js.map +1 -1
- package/cjs/components/Select/Select.js +10 -12
- package/cjs/components/Select/Select.js.map +1 -1
- package/cjs/components/TextField/TextField.js +1 -1
- package/cjs/components/TextField/TextField.js.map +1 -1
- package/cjs/components/TextField/TextField.tokens.js +0 -1
- package/cjs/components/TextField/TextField.tokens.js.map +1 -1
- package/emotion/cjs/components/Combobox/ComboboxNew/Combobox.js +10 -10
- package/emotion/cjs/components/Select/Select.js +10 -10
- package/emotion/cjs/components/TextField/TextField.js +2 -2
- package/emotion/cjs/components/TextField/TextField.tokens.js +0 -1
- package/emotion/cjs/examples/components/Combobox/Combobox.js +15 -0
- package/emotion/es/components/Combobox/ComboboxNew/Combobox.js +10 -10
- package/emotion/es/components/Select/Select.js +10 -10
- package/emotion/es/components/TextField/TextField.js +2 -2
- package/emotion/es/components/TextField/TextField.tokens.js +0 -1
- package/es/components/Combobox/ComboboxNew/Combobox.js +10 -11
- package/es/components/Combobox/ComboboxNew/Combobox.js.map +1 -1
- package/es/components/Select/Select.js +10 -12
- package/es/components/Select/Select.js.map +1 -1
- package/es/components/TextField/TextField.js +1 -1
- package/es/components/TextField/TextField.js.map +1 -1
- package/es/components/TextField/TextField.tokens.js +0 -1
- package/es/components/TextField/TextField.tokens.js.map +1 -1
- package/package.json +4 -4
- package/styled-components/cjs/components/Combobox/ComboboxNew/Combobox.js +10 -10
- package/styled-components/cjs/components/Select/Select.js +10 -10
- package/styled-components/cjs/components/TextField/TextField.js +1 -1
- package/styled-components/cjs/components/TextField/TextField.tokens.js +0 -1
- package/styled-components/cjs/examples/components/Combobox/Combobox.js +0 -15
- package/styled-components/es/components/Combobox/ComboboxNew/Combobox.js +10 -10
- package/styled-components/es/components/Select/Select.js +10 -10
- package/styled-components/es/components/TextField/TextField.js +1 -1
- package/styled-components/es/components/TextField/TextField.tokens.js +0 -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/Select/Select.d.ts.map +1 -1
- package/types/components/TextField/TextField.tokens.d.ts +0 -1
- package/types/components/TextField/TextField.tokens.d.ts.map +1 -1
|
@@ -210,7 +210,6 @@ import { Context } from "./Combobox.context";
|
|
|
210
210
|
var _useState = _sliced_to_array(useState(getTextValue(multiple, outerValue, valueToItemMap, renderValue)), 2), textValue = _useState[0], setTextValue = _useState[1];
|
|
211
211
|
var _useState1 = _sliced_to_array(useState(multiple ? [] : ''), 2), internalValue = _useState1[0], setInternalValue = _useState1[1];
|
|
212
212
|
var value = outerValue !== null && outerValue !== undefined ? outerValue : internalValue;
|
|
213
|
-
var rootRef = useRef(null);
|
|
214
213
|
var inputRef = useRef(null);
|
|
215
214
|
var floatingPopoverRef = useRef(null);
|
|
216
215
|
var inputForkRef = useForkRef(inputRef, ref);
|
|
@@ -245,7 +244,15 @@ import { Context } from "./Combobox.context";
|
|
|
245
244
|
if (!isCurrentListOpen || alwaysOpened) {
|
|
246
245
|
return;
|
|
247
246
|
}
|
|
248
|
-
|
|
247
|
+
dispatchPath({
|
|
248
|
+
type: 'reset'
|
|
249
|
+
});
|
|
250
|
+
dispatchFocusedPath({
|
|
251
|
+
type: 'reset'
|
|
252
|
+
});
|
|
253
|
+
if (onToggle) {
|
|
254
|
+
onToggle(false);
|
|
255
|
+
}
|
|
249
256
|
// Возвращаем актуальное значение поля ввода после закрытия выпадающего списка.
|
|
250
257
|
setTextValue(getTextValue(multiple, value, valueToItemMap, renderValue));
|
|
251
258
|
}, floatingPopoverRef);
|
|
@@ -311,18 +318,12 @@ import { Context } from "./Combobox.context";
|
|
|
311
318
|
type: 'opened_first_level'
|
|
312
319
|
});
|
|
313
320
|
} else {
|
|
314
|
-
var _rootRef_current;
|
|
315
321
|
dispatchFocusedPath({
|
|
316
322
|
type: 'reset'
|
|
317
323
|
});
|
|
318
324
|
dispatchPath({
|
|
319
325
|
type: 'reset'
|
|
320
326
|
});
|
|
321
|
-
// Скроллим чипы к левому краю при закрытии компонента
|
|
322
|
-
var el = rootRef === null || rootRef === void 0 ? void 0 : (_rootRef_current = rootRef.current) === null || _rootRef_current === void 0 ? void 0 : _rootRef_current.querySelector('.input-scrollable-wrapper');
|
|
323
|
-
if (multiple && value.length > 0 && el) {
|
|
324
|
-
el.scrollLeft = 0;
|
|
325
|
-
}
|
|
326
327
|
}
|
|
327
328
|
if (onToggle) {
|
|
328
329
|
onToggle(opened);
|
|
@@ -533,8 +534,7 @@ import { Context } from "./Combobox.context";
|
|
|
533
534
|
readOnly: readOnly,
|
|
534
535
|
name: name,
|
|
535
536
|
hintView: hintView,
|
|
536
|
-
hintSize: hintSize
|
|
537
|
-
ref: rootRef
|
|
537
|
+
hintSize: hintSize
|
|
538
538
|
}, name && /*#__PURE__*/ React.createElement(SelectNative, {
|
|
539
539
|
items: valueToItemMap,
|
|
540
540
|
name: name,
|
|
@@ -213,7 +213,6 @@ import { Context } from "./Select.context";
|
|
|
213
213
|
var treeId = safeUseId();
|
|
214
214
|
var listWrapperRef = useRef(null);
|
|
215
215
|
var view = target === 'textfield-like' && (disabled || readOnly) ? 'default' : getView(status, outerView);
|
|
216
|
-
var rootRef = useRef(null);
|
|
217
216
|
// Собираем объект с пропсами для required и прокидываем их напрямую в компонент Textfield.
|
|
218
217
|
var requiredProps = props.target === 'button-like' ? undefined : {
|
|
219
218
|
required: required,
|
|
@@ -236,7 +235,15 @@ import { Context } from "./Select.context";
|
|
|
236
235
|
if (!isCurrentListOpen) {
|
|
237
236
|
return;
|
|
238
237
|
}
|
|
239
|
-
|
|
238
|
+
dispatchPath({
|
|
239
|
+
type: 'reset'
|
|
240
|
+
});
|
|
241
|
+
dispatchFocusedPath({
|
|
242
|
+
type: 'reset'
|
|
243
|
+
});
|
|
244
|
+
if (onToggle) {
|
|
245
|
+
onToggle(false);
|
|
246
|
+
}
|
|
240
247
|
}, floatingPopoverRef);
|
|
241
248
|
var onChange = function(newValue, item) {
|
|
242
249
|
if (props.onChange) {
|
|
@@ -264,18 +271,12 @@ import { Context } from "./Select.context";
|
|
|
264
271
|
type: 'opened_first_level'
|
|
265
272
|
});
|
|
266
273
|
} else {
|
|
267
|
-
var _rootRef_current;
|
|
268
274
|
dispatchFocusedPath({
|
|
269
275
|
type: 'reset'
|
|
270
276
|
});
|
|
271
277
|
dispatchPath({
|
|
272
278
|
type: 'reset'
|
|
273
279
|
});
|
|
274
|
-
// Скроллим чипы к левому краю при закрытии компонента
|
|
275
|
-
var el = rootRef === null || rootRef === void 0 ? void 0 : (_rootRef_current = rootRef.current) === null || _rootRef_current === void 0 ? void 0 : _rootRef_current.querySelector('.input-scrollable-wrapper');
|
|
276
|
-
if (multiselect && value.length > 0 && el) {
|
|
277
|
-
el.scrollLeft = 0;
|
|
278
|
-
}
|
|
279
280
|
}
|
|
280
281
|
if (onToggle) {
|
|
281
282
|
onToggle(opened);
|
|
@@ -445,8 +446,7 @@ import { Context } from "./Select.context";
|
|
|
445
446
|
chipView: chipView,
|
|
446
447
|
disabled: disabled,
|
|
447
448
|
readOnly: readOnly,
|
|
448
|
-
id: id
|
|
449
|
-
ref: rootRef
|
|
449
|
+
id: id
|
|
450
450
|
}, rest), name && /*#__PURE__*/ React.createElement(SelectNative, {
|
|
451
451
|
items: valueToItemMap,
|
|
452
452
|
name: name,
|
|
@@ -467,7 +467,7 @@ export var textFieldRoot = function(Root) {
|
|
|
467
467
|
tabIndex: -1,
|
|
468
468
|
ref: contentRef,
|
|
469
469
|
onKeyDown: handleContentKeyDown,
|
|
470
|
-
className:
|
|
470
|
+
className: withHasChips
|
|
471
471
|
}, Boolean(textBefore && isChipEnumeration) && /*#__PURE__*/ React.createElement(StyledTextBefore, null, textBefore), Boolean(_chips === null || _chips === void 0 ? void 0 : _chips.length) && /*#__PURE__*/ React.createElement(TextFieldChipNew, {
|
|
472
472
|
chips: _chips,
|
|
473
473
|
onChipClick: _onChipClick,
|
|
@@ -15,7 +15,6 @@ export var classes = {
|
|
|
15
15
|
textFieldGroupItem: 'text-field-group-item',
|
|
16
16
|
requiredAlignRight: 'required-align-right',
|
|
17
17
|
inputWrapper: 'input-wrapper',
|
|
18
|
-
inputScrollableWrapper: 'input-scrollable-wrapper',
|
|
19
18
|
inputTextEllipsis: 'textfield-input-text-ellipsis',
|
|
20
19
|
contentRightCompensationMargin: 'textfield-content-right-compensation-margin',
|
|
21
20
|
readOnlyInput: 'textfield-readonly-input'
|
|
@@ -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;AA6BxC,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,
|
|
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;AA6BxC,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,2FAsjBtF,CAAC;AAEP,eAAO,MAAM,cAAc;;;mBAxjBQ,SAAS,CAAC,gBAAgB,EAAE,IAAI,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;;;;;;;;;;;;;;;;;;CA6kB3F,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../src/components/Select/Select.tsx"],"names":[],"mappings":"AAAA,OAAO,KASN,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAYxC,OAAO,KAAK,EAAE,iBAAiB,EAAiB,MAAM,gBAAgB,CAAC;AAMvE;;GAEG;AACH,eAAO,MAAM,UAAU,SAAU,SAAS,CAAC,iBAAiB,EAAE,IAAI,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../src/components/Select/Select.tsx"],"names":[],"mappings":"AAAA,OAAO,KASN,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAYxC,OAAO,KAAK,EAAE,iBAAiB,EAAiB,MAAM,gBAAgB,CAAC;AAMvE;;GAEG;AACH,eAAO,MAAM,UAAU,SAAU,SAAS,CAAC,iBAAiB,EAAE,IAAI,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC,gGAqezF,CAAC;AAEP,eAAO,MAAM,YAAY;;;mBAveQ,SAAS,CAAC,iBAAiB,EAAE,IAAI,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC;;;;;;;;;CAmf9F,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextField.tokens.d.ts","sourceRoot":"","sources":["../../../src/components/TextField/TextField.tokens.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,OAAO
|
|
1
|
+
{"version":3,"file":"TextField.tokens.d.ts","sourceRoot":"","sources":["../../../src/components/TextField/TextField.tokens.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;CAmBnB,CAAC;AAEF,eAAO,MAAM,MAAM;;;;;;;;;;;;;IAiBf,oCAAoC;;;;;;IAOpC,mBAAmB;;;;;;;;;;IAYnB,kCAAkC;;;;;;;;;;;;;;;;;;;;IA4BlC,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA8CpB,qCAAqC;;;;;IAMrC,6DAA6D;;;IAI7D,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAgCzB,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8CrB,CAAC"}
|