@megafon/ui-core 8.14.2 → 8.15.1
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/dist/es/components/Select/Select.css +1 -1
- package/dist/es/components/Select/Select.js +6 -2
- package/dist/es/components/TextField/TextField.d.ts +2 -2
- package/dist/es/components/TextField/TextField.js +3 -2
- package/dist/lib/components/Select/Select.css +1 -1
- package/dist/lib/components/Select/Select.js +6 -2
- package/dist/lib/components/TextField/TextField.d.ts +2 -2
- package/dist/lib/components/TextField/TextField.js +3 -2
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
h1,h2,h3,h4,h5{margin:0}@-webkit-keyframes listAppear{0%{opacity:0;-webkit-transform:translateY(-25px);transform:translateY(-25px)}to{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes listAppear{0%{opacity:0;-webkit-transform:translateY(-25px);transform:translateY(-25px)}to{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}.mfui-select{-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--content);font-family:inherit;font-size:15px;font-weight:400;line-height:24px;min-height:40px;z-index:1}.mfui-select,.mfui-select__inner{position:relative}.mfui-select__control{background-color:var(--base);border:1px solid var(--spbSky2);border-radius:12px;cursor:pointer;height:60px;overflow:hidden;-webkit-transition:border-color .3s;transition:border-color .3s}.mfui-select__combobox,.mfui-select__control{-webkit-box-sizing:border-box;box-sizing:border-box;outline:none;width:100%}.mfui-select__combobox{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:transparent;border:none;border-radius:0;-webkit-box-shadow:none;box-shadow:none;color:var(--content);cursor:text;font-size:15px;font-weight:400;height:100%;line-height:24px;opacity:1;overflow:auto;padding:0 45px 0 16px;position:relative;z-index:1}.mfui-select_no-touch .mfui-select__control:focus-within,.mfui-select_no-touch .mfui-select__control:hover{border-color:var(--content)}.mfui-select__title{display:-webkit-box;display:-ms-flexbox;display:flex;position:relative;z-index:1;-webkit-box-align:center;-ms-flex-align:center;align-items:center;height:100%;outline:none;width:100%}.mfui-select__title:after{border:5px solid transparent;border-bottom:none;border-top:6px solid;color:var(--brandGreen);content:"";cursor:pointer;display:block;position:absolute;right:27px;top:50%;-webkit-transition:-webkit-transform .6s;transition:-webkit-transform .6s;transition:transform .6s;transition:transform .6s,-webkit-transform .6s;z-index:1}.mfui-select__title-value{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;overflow:hidden}.mfui-select__title-inner_hide-value .mfui-select__title-value{color:var(--spbSky3)}.mfui-select__title-inner{display:-webkit-box;display:-ms-flexbox;display:flex;position:relative;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;height:100%;overflow:hidden;padding:0 45px 0 16px;white-space:nowrap}.mfui-select__title-inner:after{background:-webkit-gradient(linear,left top,right top,from(hsla(0,0%,100%,0)),to(var(--base)));background:linear-gradient(to right,hsla(0,0%,100%,0),var(--base));bottom:0;content:"";position:absolute;right:40px;top:0;width:40px}.mfui-select__require-mark{color:var(--fury);font-size:20px;line-height:0;margin-left:1px}.mfui-select__list{background-color:var(--base);border-radius:12px;-webkit-box-shadow:0 1px 16px rgba(0,0,0,.2);box-shadow:0 1px 16px rgba(0,0,0,.2);display:none;left:0;position:absolute;right:0;top:100%;z-index:11}.mfui-select__list-inner{-webkit-box-sizing:border-box;box-sizing:border-box;max-height:368px;overflow-y:auto;padding:16px;scrollbar-color:var(--spbSky2) transparent;scrollbar-width:thin}.mfui-select__list-inner_short{max-height:235px}.mfui-select__list-inner::-webkit-scrollbar{width:16px}.mfui-select__list-inner::-webkit-scrollbar-thumb{background-clip:padding-box;background-color:#d8d8d8;border:6px solid transparent;border-radius:16px}.mfui-select__list-inner::-webkit-scrollbar-thumb:hover{background-color:#999}.mfui-select__list-item{background-color:var(--base);border-radius:16px;cursor:pointer;font-family:inherit;padding-bottom:12px;padding-top:12px}.mfui-select__list-item_hovered{background-color:var(--spbSky0)}.mfui-select__list-item_paddings_large{padding-left:32px;padding-right:32px}.mfui-select__list-item_paddings_small{padding-left:12px;padding-right:12px}.mfui-select__item-title{display:-webkit-box;display:-ms-flexbox;display:flex
|
|
1
|
+
h1,h2,h3,h4,h5{margin:0}@-webkit-keyframes listAppear{0%{opacity:0;-webkit-transform:translateY(-25px);transform:translateY(-25px)}to{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes listAppear{0%{opacity:0;-webkit-transform:translateY(-25px);transform:translateY(-25px)}to{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}.mfui-select{-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--content);font-family:inherit;font-size:15px;font-weight:400;line-height:24px;min-height:40px;z-index:1}.mfui-select,.mfui-select__inner{position:relative}.mfui-select__control{background-color:var(--base);border:1px solid var(--spbSky2);border-radius:12px;cursor:pointer;height:60px;overflow:hidden;-webkit-transition:border-color .3s;transition:border-color .3s}.mfui-select__combobox,.mfui-select__control{-webkit-box-sizing:border-box;box-sizing:border-box;outline:none;width:100%}.mfui-select__combobox{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:transparent;border:none;border-radius:0;-webkit-box-shadow:none;box-shadow:none;color:var(--content);cursor:text;font-size:15px;font-weight:400;height:100%;line-height:24px;opacity:1;overflow:auto;padding:0 45px 0 16px;position:relative;z-index:1}.mfui-select_no-touch .mfui-select__control:focus-within,.mfui-select_no-touch .mfui-select__control:hover{border-color:var(--content)}.mfui-select__title{display:-webkit-box;display:-ms-flexbox;display:flex;position:relative;z-index:1;-webkit-box-align:center;-ms-flex-align:center;align-items:center;height:100%;outline:none;width:100%}.mfui-select__title:after{border:5px solid transparent;border-bottom:none;border-top:6px solid;color:var(--brandGreen);content:"";cursor:pointer;display:block;position:absolute;right:27px;top:50%;-webkit-transition:-webkit-transform .6s;transition:-webkit-transform .6s;transition:transform .6s;transition:transform .6s,-webkit-transform .6s;z-index:1}.mfui-select__title-value{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;overflow:hidden}.mfui-select__title-inner_hide-value .mfui-select__title-value{color:var(--spbSky3)}.mfui-select__title-inner{display:-webkit-box;display:-ms-flexbox;display:flex;position:relative;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;height:100%;overflow:hidden;padding:0 45px 0 16px;white-space:nowrap}.mfui-select__title-inner:after{background:-webkit-gradient(linear,left top,right top,from(hsla(0,0%,100%,0)),to(var(--base)));background:linear-gradient(to right,hsla(0,0%,100%,0),var(--base));bottom:0;content:"";position:absolute;right:40px;top:0;width:40px}.mfui-select__require-mark{color:var(--fury);font-size:20px;line-height:0;margin-left:1px}.mfui-select__list{background-color:var(--base);border-radius:12px;-webkit-box-shadow:0 1px 16px rgba(0,0,0,.2);box-shadow:0 1px 16px rgba(0,0,0,.2);display:none;left:0;position:absolute;right:0;top:100%;z-index:11}.mfui-select__list-inner{-webkit-box-sizing:border-box;box-sizing:border-box;max-height:368px;overflow-y:auto;padding:16px;scrollbar-color:var(--spbSky2) transparent;scrollbar-width:thin}.mfui-select__list-inner_short{max-height:235px}.mfui-select__list-inner::-webkit-scrollbar{width:16px}.mfui-select__list-inner::-webkit-scrollbar-thumb{background-clip:padding-box;background-color:#d8d8d8;border:6px solid transparent;border-radius:16px}.mfui-select__list-inner::-webkit-scrollbar-thumb:hover{background-color:#999}.mfui-select__list-item{background-color:var(--base);border-radius:16px;cursor:pointer;font-family:inherit;padding-bottom:12px;padding-top:12px}.mfui-select__list-item_hovered{background-color:var(--spbSky0)}.mfui-select__list-item_paddings_large{padding-left:32px;padding-right:32px}.mfui-select__list-item_paddings_small{padding-left:12px;padding-right:12px}.mfui-select__item-title-part:not(:last-child){margin-right:2px}.mfui-select__item-title{position:relative}.mfui-select__item-title_custom{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.mfui-select__item-title_active{font-weight:600}.mfui-select__list-item_hovered .mfui-select__item-title:after{background:-webkit-gradient(linear,left top,right top,from(hsla(0,0%,100%,0)),to(var(--spbSky0)));background:linear-gradient(to right,hsla(0,0%,100%,0),var(--spbSky0))}.mfui-select__not-found{opacity:.5;padding:8px 32px}.mfui-select__text{color:var(--spbSky3);font-size:12px;line-height:18px;margin-top:8px}.mfui-select__highlighted-fragment{font-weight:700}.mfui-select__label{color:var(--spbSky3);display:block;font-family:inherit;font-size:15px;line-height:24px;overflow:auto;pointer-events:none;position:absolute;top:17px;-webkit-transition:top .5s,-webkit-transform .5s;transition:top .5s,-webkit-transform .5s;transition:transform .5s,top .5s;transition:transform .5s,top .5s,-webkit-transform .5s;z-index:1}.mfui-select__combobox+.mfui-select__label{left:16px}.mfui-select__combobox::-webkit-input-placeholder{color:var(--spbSky3);opacity:0;-webkit-transition:opacity .2s;transition:opacity .2s}.mfui-select__combobox:-ms-input-placeholder{color:var(--spbSky3);opacity:0;-ms-transition:opacity .2s;transition:opacity .2s}.mfui-select__combobox::-moz-placeholder{color:var(--spbSky3);opacity:0;-moz-transition:opacity .2s;transition:opacity .2s}.mfui-select__combobox::-ms-input-placeholder{color:var(--spbSky3);opacity:0;-ms-transition:opacity .2s;transition:opacity .2s}.mfui-select__combobox::placeholder{color:var(--spbSky3);opacity:0;-webkit-transition:opacity .2s;transition:opacity .2s}.mfui-select__title-inner:not(.mfui-select__title-inner_hide-value) .mfui-select__label,.mfui-select_open .mfui-select__label{-webkit-transform:scale(.8) translate(-12%,-75%);transform:scale(.8) translate(-12%,-75%);-webkit-transition-duration:.2s,.01s;transition-duration:.2s,.01s}.mfui-select__combobox:not(.mfui-select__combobox_hide-value)+.mfui-select__label{-webkit-transform:scale(.8) translate(-12.5%,-75%);transform:scale(.8) translate(-12.5%,-75%);-webkit-transition-duration:.2s,.01s;transition-duration:.2s,.01s}.mfui-select__control_labeled .mfui-select__title-inner_hide-value .mfui-select__title-value{color:var(--spbSky3);opacity:0;-webkit-transition:opacity .2s;transition:opacity .2s}.mfui-select__control_labeled .mfui-select__combobox,.mfui-select__control_labeled .mfui-select__title-inner{padding-top:22px}.mfui-select__control_labeled .mfui-select__combobox:focus::-webkit-input-placeholder{opacity:1}.mfui-select__control_labeled .mfui-select__combobox:focus:-ms-input-placeholder{opacity:1}.mfui-select__control_labeled .mfui-select__combobox:focus::-moz-placeholder{opacity:1}.mfui-select__control_labeled .mfui-select__combobox:focus::-ms-input-placeholder{opacity:1}.mfui-select__control_labeled .mfui-select__combobox:focus::placeholder{opacity:1}.mfui-select_open{z-index:12}.mfui-select_open .mfui-select__title:after{-webkit-transform:rotate(-180deg);transform:rotate(-180deg)}.mfui-select_open .mfui-select__list{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-name:listAppear;animation-name:listAppear;-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out;display:block}.mfui-select_open .mfui-select__control{border-color:var(--content)}.mfui-select_open .mfui-select__title-inner_hide-value .mfui-select__title-value{opacity:1}.mfui-select_valid .mfui-select__control{border-color:var(--brandGreen)!important}.mfui-select_error .mfui-select__control{border-color:var(--fury)!important}.mfui-select_error .mfui-select__text{color:var(--fury)}.mfui-select_disabled .mfui-select__control{background-color:var(--spbSky1);border-color:var(--spbSky1);pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.mfui-select_disabled .mfui-select__title-inner:after{display:none}.mfui-select_disabled .mfui-select__title:after{color:var(--content);opacity:.5}
|
|
@@ -274,6 +274,9 @@ var Select = function Select(_ref) {
|
|
|
274
274
|
}
|
|
275
275
|
return true;
|
|
276
276
|
};
|
|
277
|
+
var isMatch = function isMatch(fragment, find) {
|
|
278
|
+
return fragment.toLowerCase() === find.toLowerCase() && fragment !== '';
|
|
279
|
+
};
|
|
277
280
|
var highlightString = function highlightString(title, isItemActive, view) {
|
|
278
281
|
if (type === SelectTypes.CLASSIC) {
|
|
279
282
|
if (typeof view === 'function' && ! /*#__PURE__*/React.isValidElement(view)) {
|
|
@@ -297,7 +300,7 @@ var Select = function Select(_ref) {
|
|
|
297
300
|
return /*#__PURE__*/React.createElement(React.Fragment, null, stringFragments.map(function (fragment, i) {
|
|
298
301
|
return /*#__PURE__*/React.createElement(Fragment, {
|
|
299
302
|
key: i
|
|
300
|
-
}, fragment
|
|
303
|
+
}, isMatch(fragment, filterValue) ? /*#__PURE__*/React.createElement("span", {
|
|
301
304
|
className: cn('highlighted-fragment')
|
|
302
305
|
}, fragment) : fragment);
|
|
303
306
|
}));
|
|
@@ -377,7 +380,8 @@ var Select = function Select(_ref) {
|
|
|
377
380
|
ref: getNodeList
|
|
378
381
|
}), /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.listItemTitle, i + 1), {
|
|
379
382
|
className: cn('item-title', {
|
|
380
|
-
active: isItemActive && !view
|
|
383
|
+
active: isItemActive && !view,
|
|
384
|
+
custom: !!view
|
|
381
385
|
}, [classes.listItemTitle])
|
|
382
386
|
}), highlightString(title, isItemActive, view)));
|
|
383
387
|
}), type === SelectTypes.COMBOBOX && !currentItems.length && /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.notFound), {
|
|
@@ -68,7 +68,7 @@ export type TextFieldProps = {
|
|
|
68
68
|
customIcon?: JSX.Element;
|
|
69
69
|
/** Маска для поля. Не работает с textarea=true. */
|
|
70
70
|
/** Дополнительную информацию можно найти на https://github.com/sanniassin/react-input-mask */
|
|
71
|
-
mask?: string
|
|
71
|
+
mask?: string | Array<string | RegExp>;
|
|
72
72
|
/** Разделение символов для маски. Не работает textarea=true */
|
|
73
73
|
maskChar?: string;
|
|
74
74
|
/** Дополнительный класс корневого элемента */
|
|
@@ -104,7 +104,7 @@ export type TextFieldProps = {
|
|
|
104
104
|
/** Обработчик изменения значения */
|
|
105
105
|
onChange?: (e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
|
|
106
106
|
/** Обработчик изменения значения маскированного инпута до обработки маской */
|
|
107
|
-
onBeforeMaskChange?: (value: string, newState: IMaskState, oldState: IMaskState) => void;
|
|
107
|
+
onBeforeMaskChange?: (value: string, newState: IMaskState, oldState: IMaskState, currentState: IMaskState) => void;
|
|
108
108
|
/** Обработчик выхода из фокуса */
|
|
109
109
|
onBlur?: (e: React.FocusEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
|
|
110
110
|
/** Обработчик входа в фокус */
|
|
@@ -307,8 +307,9 @@ var TextField = function TextField(_ref) {
|
|
|
307
307
|
}, [onBlur, clickedElement]);
|
|
308
308
|
var handleBeforeMaskChange = useCallback(function (_ref2) {
|
|
309
309
|
var previousState = _ref2.previousState,
|
|
310
|
-
nextState = _ref2.nextState
|
|
311
|
-
|
|
310
|
+
nextState = _ref2.nextState,
|
|
311
|
+
currentState = _ref2.currentState;
|
|
312
|
+
return onBeforeMaskChange === null || onBeforeMaskChange === void 0 ? void 0 : onBeforeMaskChange(nextState.enteredString, nextState, previousState, currentState);
|
|
312
313
|
}, [onBeforeMaskChange]);
|
|
313
314
|
var textareaType = textarea === TextareaTypes.FLEXIBLE ? TextareaTypes.FLEXIBLE : TextareaTypes.FIXED;
|
|
314
315
|
var commonParams = _extends(_extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.input)), {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
h1,h2,h3,h4,h5{margin:0}@-webkit-keyframes listAppear{0%{opacity:0;-webkit-transform:translateY(-25px);transform:translateY(-25px)}to{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes listAppear{0%{opacity:0;-webkit-transform:translateY(-25px);transform:translateY(-25px)}to{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}.mfui-select{-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--content);font-family:inherit;font-size:15px;font-weight:400;line-height:24px;min-height:40px;z-index:1}.mfui-select,.mfui-select__inner{position:relative}.mfui-select__control{background-color:var(--base);border:1px solid var(--spbSky2);border-radius:12px;cursor:pointer;height:60px;overflow:hidden;-webkit-transition:border-color .3s;transition:border-color .3s}.mfui-select__combobox,.mfui-select__control{-webkit-box-sizing:border-box;box-sizing:border-box;outline:none;width:100%}.mfui-select__combobox{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:transparent;border:none;border-radius:0;-webkit-box-shadow:none;box-shadow:none;color:var(--content);cursor:text;font-size:15px;font-weight:400;height:100%;line-height:24px;opacity:1;overflow:auto;padding:0 45px 0 16px;position:relative;z-index:1}.mfui-select_no-touch .mfui-select__control:focus-within,.mfui-select_no-touch .mfui-select__control:hover{border-color:var(--content)}.mfui-select__title{display:-webkit-box;display:-ms-flexbox;display:flex;position:relative;z-index:1;-webkit-box-align:center;-ms-flex-align:center;align-items:center;height:100%;outline:none;width:100%}.mfui-select__title:after{border:5px solid transparent;border-bottom:none;border-top:6px solid;color:var(--brandGreen);content:"";cursor:pointer;display:block;position:absolute;right:27px;top:50%;-webkit-transition:-webkit-transform .6s;transition:-webkit-transform .6s;transition:transform .6s;transition:transform .6s,-webkit-transform .6s;z-index:1}.mfui-select__title-value{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;overflow:hidden}.mfui-select__title-inner_hide-value .mfui-select__title-value{color:var(--spbSky3)}.mfui-select__title-inner{display:-webkit-box;display:-ms-flexbox;display:flex;position:relative;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;height:100%;overflow:hidden;padding:0 45px 0 16px;white-space:nowrap}.mfui-select__title-inner:after{background:-webkit-gradient(linear,left top,right top,from(hsla(0,0%,100%,0)),to(var(--base)));background:linear-gradient(to right,hsla(0,0%,100%,0),var(--base));bottom:0;content:"";position:absolute;right:40px;top:0;width:40px}.mfui-select__require-mark{color:var(--fury);font-size:20px;line-height:0;margin-left:1px}.mfui-select__list{background-color:var(--base);border-radius:12px;-webkit-box-shadow:0 1px 16px rgba(0,0,0,.2);box-shadow:0 1px 16px rgba(0,0,0,.2);display:none;left:0;position:absolute;right:0;top:100%;z-index:11}.mfui-select__list-inner{-webkit-box-sizing:border-box;box-sizing:border-box;max-height:368px;overflow-y:auto;padding:16px;scrollbar-color:var(--spbSky2) transparent;scrollbar-width:thin}.mfui-select__list-inner_short{max-height:235px}.mfui-select__list-inner::-webkit-scrollbar{width:16px}.mfui-select__list-inner::-webkit-scrollbar-thumb{background-clip:padding-box;background-color:#d8d8d8;border:6px solid transparent;border-radius:16px}.mfui-select__list-inner::-webkit-scrollbar-thumb:hover{background-color:#999}.mfui-select__list-item{background-color:var(--base);border-radius:16px;cursor:pointer;font-family:inherit;padding-bottom:12px;padding-top:12px}.mfui-select__list-item_hovered{background-color:var(--spbSky0)}.mfui-select__list-item_paddings_large{padding-left:32px;padding-right:32px}.mfui-select__list-item_paddings_small{padding-left:12px;padding-right:12px}.mfui-select__item-title{display:-webkit-box;display:-ms-flexbox;display:flex
|
|
1
|
+
h1,h2,h3,h4,h5{margin:0}@-webkit-keyframes listAppear{0%{opacity:0;-webkit-transform:translateY(-25px);transform:translateY(-25px)}to{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes listAppear{0%{opacity:0;-webkit-transform:translateY(-25px);transform:translateY(-25px)}to{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}.mfui-select{-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--content);font-family:inherit;font-size:15px;font-weight:400;line-height:24px;min-height:40px;z-index:1}.mfui-select,.mfui-select__inner{position:relative}.mfui-select__control{background-color:var(--base);border:1px solid var(--spbSky2);border-radius:12px;cursor:pointer;height:60px;overflow:hidden;-webkit-transition:border-color .3s;transition:border-color .3s}.mfui-select__combobox,.mfui-select__control{-webkit-box-sizing:border-box;box-sizing:border-box;outline:none;width:100%}.mfui-select__combobox{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:transparent;border:none;border-radius:0;-webkit-box-shadow:none;box-shadow:none;color:var(--content);cursor:text;font-size:15px;font-weight:400;height:100%;line-height:24px;opacity:1;overflow:auto;padding:0 45px 0 16px;position:relative;z-index:1}.mfui-select_no-touch .mfui-select__control:focus-within,.mfui-select_no-touch .mfui-select__control:hover{border-color:var(--content)}.mfui-select__title{display:-webkit-box;display:-ms-flexbox;display:flex;position:relative;z-index:1;-webkit-box-align:center;-ms-flex-align:center;align-items:center;height:100%;outline:none;width:100%}.mfui-select__title:after{border:5px solid transparent;border-bottom:none;border-top:6px solid;color:var(--brandGreen);content:"";cursor:pointer;display:block;position:absolute;right:27px;top:50%;-webkit-transition:-webkit-transform .6s;transition:-webkit-transform .6s;transition:transform .6s;transition:transform .6s,-webkit-transform .6s;z-index:1}.mfui-select__title-value{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;overflow:hidden}.mfui-select__title-inner_hide-value .mfui-select__title-value{color:var(--spbSky3)}.mfui-select__title-inner{display:-webkit-box;display:-ms-flexbox;display:flex;position:relative;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;height:100%;overflow:hidden;padding:0 45px 0 16px;white-space:nowrap}.mfui-select__title-inner:after{background:-webkit-gradient(linear,left top,right top,from(hsla(0,0%,100%,0)),to(var(--base)));background:linear-gradient(to right,hsla(0,0%,100%,0),var(--base));bottom:0;content:"";position:absolute;right:40px;top:0;width:40px}.mfui-select__require-mark{color:var(--fury);font-size:20px;line-height:0;margin-left:1px}.mfui-select__list{background-color:var(--base);border-radius:12px;-webkit-box-shadow:0 1px 16px rgba(0,0,0,.2);box-shadow:0 1px 16px rgba(0,0,0,.2);display:none;left:0;position:absolute;right:0;top:100%;z-index:11}.mfui-select__list-inner{-webkit-box-sizing:border-box;box-sizing:border-box;max-height:368px;overflow-y:auto;padding:16px;scrollbar-color:var(--spbSky2) transparent;scrollbar-width:thin}.mfui-select__list-inner_short{max-height:235px}.mfui-select__list-inner::-webkit-scrollbar{width:16px}.mfui-select__list-inner::-webkit-scrollbar-thumb{background-clip:padding-box;background-color:#d8d8d8;border:6px solid transparent;border-radius:16px}.mfui-select__list-inner::-webkit-scrollbar-thumb:hover{background-color:#999}.mfui-select__list-item{background-color:var(--base);border-radius:16px;cursor:pointer;font-family:inherit;padding-bottom:12px;padding-top:12px}.mfui-select__list-item_hovered{background-color:var(--spbSky0)}.mfui-select__list-item_paddings_large{padding-left:32px;padding-right:32px}.mfui-select__list-item_paddings_small{padding-left:12px;padding-right:12px}.mfui-select__item-title-part:not(:last-child){margin-right:2px}.mfui-select__item-title{position:relative}.mfui-select__item-title_custom{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.mfui-select__item-title_active{font-weight:600}.mfui-select__list-item_hovered .mfui-select__item-title:after{background:-webkit-gradient(linear,left top,right top,from(hsla(0,0%,100%,0)),to(var(--spbSky0)));background:linear-gradient(to right,hsla(0,0%,100%,0),var(--spbSky0))}.mfui-select__not-found{opacity:.5;padding:8px 32px}.mfui-select__text{color:var(--spbSky3);font-size:12px;line-height:18px;margin-top:8px}.mfui-select__highlighted-fragment{font-weight:700}.mfui-select__label{color:var(--spbSky3);display:block;font-family:inherit;font-size:15px;line-height:24px;overflow:auto;pointer-events:none;position:absolute;top:17px;-webkit-transition:top .5s,-webkit-transform .5s;transition:top .5s,-webkit-transform .5s;transition:transform .5s,top .5s;transition:transform .5s,top .5s,-webkit-transform .5s;z-index:1}.mfui-select__combobox+.mfui-select__label{left:16px}.mfui-select__combobox::-webkit-input-placeholder{color:var(--spbSky3);opacity:0;-webkit-transition:opacity .2s;transition:opacity .2s}.mfui-select__combobox:-ms-input-placeholder{color:var(--spbSky3);opacity:0;-ms-transition:opacity .2s;transition:opacity .2s}.mfui-select__combobox::-moz-placeholder{color:var(--spbSky3);opacity:0;-moz-transition:opacity .2s;transition:opacity .2s}.mfui-select__combobox::-ms-input-placeholder{color:var(--spbSky3);opacity:0;-ms-transition:opacity .2s;transition:opacity .2s}.mfui-select__combobox::placeholder{color:var(--spbSky3);opacity:0;-webkit-transition:opacity .2s;transition:opacity .2s}.mfui-select__title-inner:not(.mfui-select__title-inner_hide-value) .mfui-select__label,.mfui-select_open .mfui-select__label{-webkit-transform:scale(.8) translate(-12%,-75%);transform:scale(.8) translate(-12%,-75%);-webkit-transition-duration:.2s,.01s;transition-duration:.2s,.01s}.mfui-select__combobox:not(.mfui-select__combobox_hide-value)+.mfui-select__label{-webkit-transform:scale(.8) translate(-12.5%,-75%);transform:scale(.8) translate(-12.5%,-75%);-webkit-transition-duration:.2s,.01s;transition-duration:.2s,.01s}.mfui-select__control_labeled .mfui-select__title-inner_hide-value .mfui-select__title-value{color:var(--spbSky3);opacity:0;-webkit-transition:opacity .2s;transition:opacity .2s}.mfui-select__control_labeled .mfui-select__combobox,.mfui-select__control_labeled .mfui-select__title-inner{padding-top:22px}.mfui-select__control_labeled .mfui-select__combobox:focus::-webkit-input-placeholder{opacity:1}.mfui-select__control_labeled .mfui-select__combobox:focus:-ms-input-placeholder{opacity:1}.mfui-select__control_labeled .mfui-select__combobox:focus::-moz-placeholder{opacity:1}.mfui-select__control_labeled .mfui-select__combobox:focus::-ms-input-placeholder{opacity:1}.mfui-select__control_labeled .mfui-select__combobox:focus::placeholder{opacity:1}.mfui-select_open{z-index:12}.mfui-select_open .mfui-select__title:after{-webkit-transform:rotate(-180deg);transform:rotate(-180deg)}.mfui-select_open .mfui-select__list{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-name:listAppear;animation-name:listAppear;-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out;display:block}.mfui-select_open .mfui-select__control{border-color:var(--content)}.mfui-select_open .mfui-select__title-inner_hide-value .mfui-select__title-value{opacity:1}.mfui-select_valid .mfui-select__control{border-color:var(--brandGreen)!important}.mfui-select_error .mfui-select__control{border-color:var(--fury)!important}.mfui-select_error .mfui-select__text{color:var(--fury)}.mfui-select_disabled .mfui-select__control{background-color:var(--spbSky1);border-color:var(--spbSky1);pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.mfui-select_disabled .mfui-select__title-inner:after{display:none}.mfui-select_disabled .mfui-select__title:after{color:var(--content);opacity:.5}
|
|
@@ -283,6 +283,9 @@ var Select = function Select(_ref) {
|
|
|
283
283
|
}
|
|
284
284
|
return true;
|
|
285
285
|
};
|
|
286
|
+
var isMatch = function isMatch(fragment, find) {
|
|
287
|
+
return fragment.toLowerCase() === find.toLowerCase() && fragment !== '';
|
|
288
|
+
};
|
|
286
289
|
var highlightString = function highlightString(title, isItemActive, view) {
|
|
287
290
|
if (type === SelectTypes.CLASSIC) {
|
|
288
291
|
if (typeof view === 'function' && ! /*#__PURE__*/React.isValidElement(view)) {
|
|
@@ -306,7 +309,7 @@ var Select = function Select(_ref) {
|
|
|
306
309
|
return /*#__PURE__*/React.createElement(React.Fragment, null, stringFragments.map(function (fragment, i) {
|
|
307
310
|
return /*#__PURE__*/React.createElement(_react.Fragment, {
|
|
308
311
|
key: i
|
|
309
|
-
}, fragment
|
|
312
|
+
}, isMatch(fragment, filterValue) ? /*#__PURE__*/React.createElement("span", {
|
|
310
313
|
className: cn('highlighted-fragment')
|
|
311
314
|
}, fragment) : fragment);
|
|
312
315
|
}));
|
|
@@ -386,7 +389,8 @@ var Select = function Select(_ref) {
|
|
|
386
389
|
ref: getNodeList
|
|
387
390
|
}), /*#__PURE__*/React.createElement("div", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.listItemTitle, i + 1), {
|
|
388
391
|
className: cn('item-title', {
|
|
389
|
-
active: isItemActive && !view
|
|
392
|
+
active: isItemActive && !view,
|
|
393
|
+
custom: !!view
|
|
390
394
|
}, [classes.listItemTitle])
|
|
391
395
|
}), highlightString(title, isItemActive, view)));
|
|
392
396
|
}), type === SelectTypes.COMBOBOX && !currentItems.length && /*#__PURE__*/React.createElement("div", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.notFound), {
|
|
@@ -68,7 +68,7 @@ export type TextFieldProps = {
|
|
|
68
68
|
customIcon?: JSX.Element;
|
|
69
69
|
/** Маска для поля. Не работает с textarea=true. */
|
|
70
70
|
/** Дополнительную информацию можно найти на https://github.com/sanniassin/react-input-mask */
|
|
71
|
-
mask?: string
|
|
71
|
+
mask?: string | Array<string | RegExp>;
|
|
72
72
|
/** Разделение символов для маски. Не работает textarea=true */
|
|
73
73
|
maskChar?: string;
|
|
74
74
|
/** Дополнительный класс корневого элемента */
|
|
@@ -104,7 +104,7 @@ export type TextFieldProps = {
|
|
|
104
104
|
/** Обработчик изменения значения */
|
|
105
105
|
onChange?: (e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
|
|
106
106
|
/** Обработчик изменения значения маскированного инпута до обработки маской */
|
|
107
|
-
onBeforeMaskChange?: (value: string, newState: IMaskState, oldState: IMaskState) => void;
|
|
107
|
+
onBeforeMaskChange?: (value: string, newState: IMaskState, oldState: IMaskState, currentState: IMaskState) => void;
|
|
108
108
|
/** Обработчик выхода из фокуса */
|
|
109
109
|
onBlur?: (e: React.FocusEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
|
|
110
110
|
/** Обработчик входа в фокус */
|
|
@@ -317,8 +317,9 @@ var TextField = function TextField(_ref) {
|
|
|
317
317
|
}, [onBlur, clickedElement]);
|
|
318
318
|
var handleBeforeMaskChange = (0, _react.useCallback)(function (_ref2) {
|
|
319
319
|
var previousState = _ref2.previousState,
|
|
320
|
-
nextState = _ref2.nextState
|
|
321
|
-
|
|
320
|
+
nextState = _ref2.nextState,
|
|
321
|
+
currentState = _ref2.currentState;
|
|
322
|
+
return onBeforeMaskChange === null || onBeforeMaskChange === void 0 ? void 0 : onBeforeMaskChange(nextState.enteredString, nextState, previousState, currentState);
|
|
322
323
|
}, [onBeforeMaskChange]);
|
|
323
324
|
var textareaType = textarea === TextareaTypes.FLEXIBLE ? TextareaTypes.FLEXIBLE : TextareaTypes.FIXED;
|
|
324
325
|
var commonParams = (0, _extends2["default"])((0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.input)), {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@megafon/ui-core",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.15.1",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist",
|
|
6
6
|
"styles"
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"@babel/preset-env": "^7.8.6",
|
|
51
51
|
"@babel/preset-react": "^7.8.3",
|
|
52
52
|
"@babel/preset-typescript": "^7.8.3",
|
|
53
|
-
"@megafon/ui-icons": "^3.
|
|
53
|
+
"@megafon/ui-icons": "^3.14.0",
|
|
54
54
|
"@svgr/core": "^2.4.1",
|
|
55
55
|
"@testing-library/jest-dom": "^6.5.0",
|
|
56
56
|
"@testing-library/react": "^16.0.1",
|
|
@@ -104,5 +104,5 @@
|
|
|
104
104
|
"simplebar-react": "^3.2.5",
|
|
105
105
|
"swiper": "^11.1.1"
|
|
106
106
|
},
|
|
107
|
-
"gitHead": "
|
|
107
|
+
"gitHead": "57dac406345ee9185f33f981578177c1ab777257"
|
|
108
108
|
}
|