@true-engineering/true-react-common-ui-kit 1.3.1 → 1.4.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/components/Input/Input.d.ts +3 -3
- package/dist/components/ScrollIntoViewIfNeeded/ScrollIntoViewIfNeeded.d.ts +1 -1
- package/dist/components/Select/Select.d.ts +8 -3
- package/dist/components/Select/Select.styles.d.ts +10 -0
- package/dist/components/Select/SelectList/SelectList.d.ts +4 -3
- package/dist/components/Select/SelectList/SelectList.styles.d.ts +9 -0
- package/dist/helpers/snippets.d.ts +3 -0
- package/dist/helpers/utils.d.ts +1 -0
- package/dist/hooks/use-dropdown.d.ts +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/true-react-common-ui-kit.js +341 -291
- package/dist/true-react-common-ui-kit.js.map +1 -1
- package/dist/true-react-common-ui-kit.umd.cjs +341 -291
- package/dist/true-react-common-ui-kit.umd.cjs.map +1 -1
- package/package.json +1 -1
- package/src/components/FiltersPane/FiltersPane.stories.tsx +1 -0
- package/src/components/Input/Input.tsx +5 -3
- package/src/components/Select/Select.stories.tsx +16 -0
- package/src/components/Select/Select.styles.ts +11 -0
- package/src/components/Select/Select.tsx +86 -37
- package/src/components/Select/SelectList/SelectList.styles.ts +11 -0
- package/src/components/Select/SelectList/SelectList.tsx +14 -5
- package/src/helpers/snippets.tsx +5 -0
- package/src/helpers/utils.ts +14 -0
- package/src/hooks/use-dropdown.ts +1 -1
- package/src/index.ts +1 -0
|
@@ -1110,6 +1110,16 @@
|
|
|
1110
1110
|
});
|
|
1111
1111
|
return result;
|
|
1112
1112
|
};
|
|
1113
|
+
var hasExactParent = function(element, parent) {
|
|
1114
|
+
if (element === parent) {
|
|
1115
|
+
return true;
|
|
1116
|
+
}
|
|
1117
|
+
var parentNode = getParentNode$1(element);
|
|
1118
|
+
if (parentNode === element) {
|
|
1119
|
+
return false;
|
|
1120
|
+
}
|
|
1121
|
+
return hasExactParent(parentNode, parent);
|
|
1122
|
+
};
|
|
1113
1123
|
var _element_parentNode;
|
|
1114
1124
|
var getParentNode$1 = function(element) {
|
|
1115
1125
|
return element.nodeName === "HTML" ? element : (_element_parentNode = element.parentNode) !== null && _element_parentNode !== void 0 ? _element_parentNode : element.host;
|
|
@@ -6102,6 +6112,11 @@
|
|
|
6102
6112
|
loading: {},
|
|
6103
6113
|
tweakPreloader: {}
|
|
6104
6114
|
};
|
|
6115
|
+
var renderIcon = function(icon) {
|
|
6116
|
+
return typeof icon === "string" ? /* @__PURE__ */ jsx(Icon, {
|
|
6117
|
+
type: icon
|
|
6118
|
+
}) : icon;
|
|
6119
|
+
};
|
|
6105
6120
|
function _array_like_to_array$k(arr, len) {
|
|
6106
6121
|
if (len == null || len > arr.length)
|
|
6107
6122
|
len = arr.length;
|
|
@@ -6467,9 +6482,7 @@
|
|
|
6467
6482
|
iconType !== void 0 && /* @__PURE__ */ jsx("div", {
|
|
6468
6483
|
className: clsx(classes.inputIcon, _define_property$B({}, classes.activeIcon, !isDisabled && onIconClick !== void 0)),
|
|
6469
6484
|
onClick: !isDisabled ? onIconClick : void 0,
|
|
6470
|
-
children:
|
|
6471
|
-
type: iconType
|
|
6472
|
-
})
|
|
6485
|
+
children: renderIcon(iconType)
|
|
6473
6486
|
})
|
|
6474
6487
|
]
|
|
6475
6488
|
})
|
|
@@ -6908,7 +6921,20 @@
|
|
|
6908
6921
|
CONTAINER_PADDING,
|
|
6909
6922
|
0
|
|
6910
6923
|
],
|
|
6911
|
-
fontSize: 16
|
|
6924
|
+
fontSize: 16,
|
|
6925
|
+
overflow: "hidden"
|
|
6926
|
+
},
|
|
6927
|
+
withListHeader: {
|
|
6928
|
+
paddingTop: 0
|
|
6929
|
+
},
|
|
6930
|
+
listHeader: {
|
|
6931
|
+
"& + $list": {
|
|
6932
|
+
borderTop: [
|
|
6933
|
+
1,
|
|
6934
|
+
"solid",
|
|
6935
|
+
colors.BORDER_LIGHT
|
|
6936
|
+
]
|
|
6937
|
+
}
|
|
6912
6938
|
},
|
|
6913
6939
|
list: _object_spread$x({
|
|
6914
6940
|
height: "100%",
|
|
@@ -6994,7 +7020,7 @@
|
|
|
6994
7020
|
}
|
|
6995
7021
|
var DEFAULT_OPTION_INDEX = -1;
|
|
6996
7022
|
function SelectList(param) {
|
|
6997
|
-
var options = param.options, focusedIndex = param.focusedIndex, activeValue = param.activeValue, defaultOptionLabel = param.defaultOptionLabel, _param_noMatchesLabel = param.noMatchesLabel, noMatchesLabel = _param_noMatchesLabel === void 0 ? "Совпадений не найдено" : _param_noMatchesLabel, isLoading = param.isLoading, _param_loadingLabel = param.loadingLabel, loadingLabel = _param_loadingLabel === void 0 ? "Загрузка..." : _param_loadingLabel, tweakStyles = param.tweakStyles, testId = param.testId, _param_shouldScrollToList = param.shouldScrollToList, shouldScrollToList = _param_shouldScrollToList === void 0 ? true : _param_shouldScrollToList, isOptionDisabled = param.isOptionDisabled, onOptionClick = param.onOptionClick, convertValueToString = param.convertValueToString, convertValueToReactNode = param.convertValueToReactNode, _param_convertValueToId = param.convertValueToId, convertValueToId = _param_convertValueToId === void 0 ? convertValueToString : _param_convertValueToId;
|
|
7023
|
+
var options = param.options, focusedIndex = param.focusedIndex, activeValue = param.activeValue, defaultOptionLabel = param.defaultOptionLabel, _param_noMatchesLabel = param.noMatchesLabel, noMatchesLabel = _param_noMatchesLabel === void 0 ? "Совпадений не найдено" : _param_noMatchesLabel, isLoading = param.isLoading, _param_loadingLabel = param.loadingLabel, loadingLabel = _param_loadingLabel === void 0 ? "Загрузка..." : _param_loadingLabel, tweakStyles = param.tweakStyles, testId = param.testId, _param_shouldScrollToList = param.shouldScrollToList, shouldScrollToList = _param_shouldScrollToList === void 0 ? true : _param_shouldScrollToList, customListHeader = param.customListHeader, isOptionDisabled = param.isOptionDisabled, onOptionClick = param.onOptionClick, convertValueToString = param.convertValueToString, convertValueToReactNode = param.convertValueToReactNode, _param_convertValueToId = param.convertValueToId, convertValueToId = _param_convertValueToId === void 0 ? convertValueToString : _param_convertValueToId;
|
|
6998
7024
|
var classes = useTheme("SelectList", styles$v, tweakStyles).classes;
|
|
6999
7025
|
var activeValueId = isNotEmpty(activeValue) ? convertValueToId(activeValue) : void 0;
|
|
7000
7026
|
var isActiveOption = function(item) {
|
|
@@ -7018,58 +7044,64 @@
|
|
|
7018
7044
|
convertFunction,
|
|
7019
7045
|
optionsDisableMap
|
|
7020
7046
|
]);
|
|
7021
|
-
return /* @__PURE__ */
|
|
7047
|
+
return /* @__PURE__ */ jsxs(ScrollIntoViewIfNeeded, {
|
|
7022
7048
|
active: shouldScrollToList,
|
|
7023
|
-
className: classes.root,
|
|
7024
|
-
children:
|
|
7025
|
-
|
|
7026
|
-
|
|
7027
|
-
|
|
7028
|
-
|
|
7029
|
-
|
|
7030
|
-
|
|
7031
|
-
|
|
7032
|
-
|
|
7033
|
-
|
|
7034
|
-
|
|
7035
|
-
|
|
7036
|
-
|
|
7037
|
-
|
|
7038
|
-
|
|
7039
|
-
return onOptionClick(DEFAULT_OPTION_INDEX);
|
|
7040
|
-
},
|
|
7041
|
-
children: defaultOptionLabel
|
|
7042
|
-
}),
|
|
7043
|
-
listOptions.map(function(opt, i) {
|
|
7044
|
-
var optionValue = options[i];
|
|
7045
|
-
var isFocused = i === focusedIndex;
|
|
7046
|
-
var isActive = isActiveOption(optionValue);
|
|
7047
|
-
var isDisabled = optionsDisableMap[i];
|
|
7048
|
-
var _obj;
|
|
7049
|
-
return /* @__PURE__ */ jsx(ScrollIntoViewIfNeeded, _object_spread_props$q(_object_spread$w({
|
|
7050
|
-
active: isFocused,
|
|
7049
|
+
className: clsx(classes.root, _define_property$x({}, classes.withListHeader, isNotEmpty(customListHeader))),
|
|
7050
|
+
children: [
|
|
7051
|
+
isNotEmpty(customListHeader) && /* @__PURE__ */ jsx("div", {
|
|
7052
|
+
className: classes.listHeader,
|
|
7053
|
+
children: customListHeader
|
|
7054
|
+
}),
|
|
7055
|
+
/* @__PURE__ */ jsx("div", {
|
|
7056
|
+
className: classes.list,
|
|
7057
|
+
"data-testid": testId,
|
|
7058
|
+
children: isLoading ? /* @__PURE__ */ jsx("div", {
|
|
7059
|
+
className: clsx(classes.cell, classes.loading),
|
|
7060
|
+
children: loadingLabel
|
|
7061
|
+
}) : /* @__PURE__ */ jsxs(Fragment, {
|
|
7062
|
+
children: [
|
|
7063
|
+
defaultOptionLabel !== void 0 && /* @__PURE__ */ jsx(ScrollIntoViewIfNeeded, {
|
|
7064
|
+
active: focusedIndex === DEFAULT_OPTION_INDEX,
|
|
7051
7065
|
options: {
|
|
7052
7066
|
block: "nearest"
|
|
7053
7067
|
},
|
|
7054
|
-
className: clsx(classes.cell,
|
|
7055
|
-
|
|
7056
|
-
|
|
7057
|
-
|
|
7058
|
-
|
|
7059
|
-
})
|
|
7060
|
-
|
|
7061
|
-
|
|
7062
|
-
|
|
7063
|
-
|
|
7064
|
-
|
|
7065
|
-
|
|
7066
|
-
|
|
7067
|
-
|
|
7068
|
-
|
|
7069
|
-
|
|
7070
|
-
|
|
7068
|
+
className: clsx(classes.cell, classes.defaultCell, focusedIndex === DEFAULT_OPTION_INDEX && classes.focused),
|
|
7069
|
+
onClick: function(event) {
|
|
7070
|
+
return onOptionClick(DEFAULT_OPTION_INDEX, event);
|
|
7071
|
+
},
|
|
7072
|
+
children: defaultOptionLabel
|
|
7073
|
+
}),
|
|
7074
|
+
listOptions.map(function(opt, i) {
|
|
7075
|
+
var optionValue = options[i];
|
|
7076
|
+
var isFocused = i === focusedIndex;
|
|
7077
|
+
var isActive = isActiveOption(optionValue);
|
|
7078
|
+
var isDisabled = optionsDisableMap[i];
|
|
7079
|
+
var _obj;
|
|
7080
|
+
return /* @__PURE__ */ jsx(ScrollIntoViewIfNeeded, _object_spread_props$q(_object_spread$w({
|
|
7081
|
+
active: isFocused,
|
|
7082
|
+
options: {
|
|
7083
|
+
block: "nearest"
|
|
7084
|
+
},
|
|
7085
|
+
className: clsx(classes.cell, (_obj = {}, _define_property$x(_obj, classes.focused, isFocused), _define_property$x(_obj, classes.active, isActive), _define_property$x(_obj, classes.disabled, isDisabled), _obj))
|
|
7086
|
+
}, addDataAttributes({
|
|
7087
|
+
disabled: isDisabled,
|
|
7088
|
+
active: isActive,
|
|
7089
|
+
focused: isFocused
|
|
7090
|
+
})), {
|
|
7091
|
+
onClick: !isDisabled ? function(event) {
|
|
7092
|
+
return onOptionClick(i, event);
|
|
7093
|
+
} : void 0,
|
|
7094
|
+
children: opt
|
|
7095
|
+
}), i);
|
|
7096
|
+
}),
|
|
7097
|
+
listOptions.length === 0 && /* @__PURE__ */ jsx("div", {
|
|
7098
|
+
className: clsx(classes.cell, classes.noMatchesLabel),
|
|
7099
|
+
children: noMatchesLabel
|
|
7100
|
+
})
|
|
7101
|
+
]
|
|
7102
|
+
})
|
|
7071
7103
|
})
|
|
7072
|
-
|
|
7104
|
+
]
|
|
7073
7105
|
});
|
|
7074
7106
|
}
|
|
7075
7107
|
var _option_isDisabled;
|
|
@@ -7144,7 +7176,169 @@
|
|
|
7144
7176
|
paddingRight: 32
|
|
7145
7177
|
}
|
|
7146
7178
|
},
|
|
7147
|
-
tweakSelectList: {}
|
|
7179
|
+
tweakSelectList: {},
|
|
7180
|
+
tweakSearchInput: {
|
|
7181
|
+
tweakInput: {
|
|
7182
|
+
inputWrapper: {
|
|
7183
|
+
height: 48,
|
|
7184
|
+
borderRadius: 0,
|
|
7185
|
+
border: "none",
|
|
7186
|
+
backgroundColor: "transparent"
|
|
7187
|
+
}
|
|
7188
|
+
}
|
|
7189
|
+
}
|
|
7190
|
+
};
|
|
7191
|
+
var LEFT_PADDING = 44;
|
|
7192
|
+
var styles$t = {
|
|
7193
|
+
root: {
|
|
7194
|
+
position: "relative"
|
|
7195
|
+
},
|
|
7196
|
+
icon: {
|
|
7197
|
+
display: "flex",
|
|
7198
|
+
alignItems: "center",
|
|
7199
|
+
position: "absolute",
|
|
7200
|
+
left: 12,
|
|
7201
|
+
height: "100%",
|
|
7202
|
+
width: 20,
|
|
7203
|
+
zIndex: 2,
|
|
7204
|
+
color: colors.GREY_ACTIVE
|
|
7205
|
+
},
|
|
7206
|
+
tweakInput: {
|
|
7207
|
+
inputWrapper: {
|
|
7208
|
+
height: 35,
|
|
7209
|
+
borderColor: "transparent",
|
|
7210
|
+
backgroundColor: rgba(colors.BORDER_MAIN, 0.3),
|
|
7211
|
+
borderRadius: 18,
|
|
7212
|
+
paddingLeft: LEFT_PADDING,
|
|
7213
|
+
transitionProperty: "background-color, border-color"
|
|
7214
|
+
},
|
|
7215
|
+
focused: {
|
|
7216
|
+
backgroundColor: colors.CLASSIC_WHITE,
|
|
7217
|
+
borderColor: colors.BORDER_MAIN
|
|
7218
|
+
},
|
|
7219
|
+
input: {
|
|
7220
|
+
fontSize: 14,
|
|
7221
|
+
paddingLeft: 0
|
|
7222
|
+
},
|
|
7223
|
+
label: {
|
|
7224
|
+
left: LEFT_PADDING,
|
|
7225
|
+
fontSize: 14
|
|
7226
|
+
}
|
|
7227
|
+
}
|
|
7228
|
+
};
|
|
7229
|
+
function _define_property$w(obj, key, value) {
|
|
7230
|
+
if (key in obj) {
|
|
7231
|
+
Object.defineProperty(obj, key, {
|
|
7232
|
+
value,
|
|
7233
|
+
enumerable: true,
|
|
7234
|
+
configurable: true,
|
|
7235
|
+
writable: true
|
|
7236
|
+
});
|
|
7237
|
+
} else {
|
|
7238
|
+
obj[key] = value;
|
|
7239
|
+
}
|
|
7240
|
+
return obj;
|
|
7241
|
+
}
|
|
7242
|
+
function _object_spread$v(target) {
|
|
7243
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
7244
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
7245
|
+
var ownKeys2 = Object.keys(source);
|
|
7246
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
7247
|
+
ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
7248
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
7249
|
+
}));
|
|
7250
|
+
}
|
|
7251
|
+
ownKeys2.forEach(function(key) {
|
|
7252
|
+
_define_property$w(target, key, source[key]);
|
|
7253
|
+
});
|
|
7254
|
+
}
|
|
7255
|
+
return target;
|
|
7256
|
+
}
|
|
7257
|
+
function ownKeys$p(object, enumerableOnly) {
|
|
7258
|
+
var keys = Object.keys(object);
|
|
7259
|
+
if (Object.getOwnPropertySymbols) {
|
|
7260
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
7261
|
+
if (enumerableOnly) {
|
|
7262
|
+
symbols = symbols.filter(function(sym) {
|
|
7263
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
7264
|
+
});
|
|
7265
|
+
}
|
|
7266
|
+
keys.push.apply(keys, symbols);
|
|
7267
|
+
}
|
|
7268
|
+
return keys;
|
|
7269
|
+
}
|
|
7270
|
+
function _object_spread_props$p(target, source) {
|
|
7271
|
+
source = source != null ? source : {};
|
|
7272
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
7273
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
7274
|
+
} else {
|
|
7275
|
+
ownKeys$p(Object(source)).forEach(function(key) {
|
|
7276
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
7277
|
+
});
|
|
7278
|
+
}
|
|
7279
|
+
return target;
|
|
7280
|
+
}
|
|
7281
|
+
function _object_without_properties$6(source, excluded) {
|
|
7282
|
+
if (source == null)
|
|
7283
|
+
return {};
|
|
7284
|
+
var target = _object_without_properties_loose$6(source, excluded);
|
|
7285
|
+
var key, i;
|
|
7286
|
+
if (Object.getOwnPropertySymbols) {
|
|
7287
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
7288
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
7289
|
+
key = sourceSymbolKeys[i];
|
|
7290
|
+
if (excluded.indexOf(key) >= 0)
|
|
7291
|
+
continue;
|
|
7292
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key))
|
|
7293
|
+
continue;
|
|
7294
|
+
target[key] = source[key];
|
|
7295
|
+
}
|
|
7296
|
+
}
|
|
7297
|
+
return target;
|
|
7298
|
+
}
|
|
7299
|
+
function _object_without_properties_loose$6(source, excluded) {
|
|
7300
|
+
if (source == null)
|
|
7301
|
+
return {};
|
|
7302
|
+
var target = {};
|
|
7303
|
+
var sourceKeys = Object.keys(source);
|
|
7304
|
+
var key, i;
|
|
7305
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
7306
|
+
key = sourceKeys[i];
|
|
7307
|
+
if (excluded.indexOf(key) >= 0)
|
|
7308
|
+
continue;
|
|
7309
|
+
target[key] = source[key];
|
|
7310
|
+
}
|
|
7311
|
+
return target;
|
|
7312
|
+
}
|
|
7313
|
+
var SearchInput = function(_param) {
|
|
7314
|
+
var _param_isClearable = _param.isClearable, isClearable = _param_isClearable === void 0 ? true : _param_isClearable, tweakStyles = _param.tweakStyles, testId = _param.testId, data = _param.data, props = _object_without_properties$6(_param, [
|
|
7315
|
+
"isClearable",
|
|
7316
|
+
"tweakStyles",
|
|
7317
|
+
"testId",
|
|
7318
|
+
"data"
|
|
7319
|
+
]);
|
|
7320
|
+
var _useTheme = useTheme("SearchInput", styles$t, tweakStyles), classes = _useTheme.classes, componentStyles = _useTheme.componentStyles;
|
|
7321
|
+
var tweakInputStyles = useTweakStyles(componentStyles, tweakStyles, "tweakInput");
|
|
7322
|
+
return /* @__PURE__ */ jsxs("div", _object_spread_props$p(_object_spread$v({
|
|
7323
|
+
className: classes.root
|
|
7324
|
+
}, addDataTestId(testId), addDataAttributes(data)), {
|
|
7325
|
+
children: [
|
|
7326
|
+
/* @__PURE__ */ jsx("div", {
|
|
7327
|
+
className: classes.icon,
|
|
7328
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
7329
|
+
type: "search"
|
|
7330
|
+
})
|
|
7331
|
+
}),
|
|
7332
|
+
/* @__PURE__ */ jsx(Input, _object_spread$v({
|
|
7333
|
+
isClearable,
|
|
7334
|
+
isActive: props.value !== "" && props.value !== void 0,
|
|
7335
|
+
testId: getTestId(testId, "input"),
|
|
7336
|
+
tweakStyles: tweakInputStyles,
|
|
7337
|
+
hasFloatingLabel: false,
|
|
7338
|
+
label: props.placeholder
|
|
7339
|
+
}, props))
|
|
7340
|
+
]
|
|
7341
|
+
}));
|
|
7148
7342
|
};
|
|
7149
7343
|
function _array_like_to_array$j(arr, len) {
|
|
7150
7344
|
if (len == null || len > arr.length)
|
|
@@ -7186,7 +7380,7 @@
|
|
|
7186
7380
|
});
|
|
7187
7381
|
};
|
|
7188
7382
|
}
|
|
7189
|
-
function _define_property$
|
|
7383
|
+
function _define_property$v(obj, key, value) {
|
|
7190
7384
|
if (key in obj) {
|
|
7191
7385
|
Object.defineProperty(obj, key, {
|
|
7192
7386
|
value,
|
|
@@ -7230,7 +7424,7 @@
|
|
|
7230
7424
|
function _non_iterable_rest$j() {
|
|
7231
7425
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
7232
7426
|
}
|
|
7233
|
-
function _object_spread$
|
|
7427
|
+
function _object_spread$u(target) {
|
|
7234
7428
|
for (var i = 1; i < arguments.length; i++) {
|
|
7235
7429
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
7236
7430
|
var ownKeys2 = Object.keys(source);
|
|
@@ -7240,12 +7434,12 @@
|
|
|
7240
7434
|
}));
|
|
7241
7435
|
}
|
|
7242
7436
|
ownKeys2.forEach(function(key) {
|
|
7243
|
-
_define_property$
|
|
7437
|
+
_define_property$v(target, key, source[key]);
|
|
7244
7438
|
});
|
|
7245
7439
|
}
|
|
7246
7440
|
return target;
|
|
7247
7441
|
}
|
|
7248
|
-
function ownKeys$
|
|
7442
|
+
function ownKeys$o(object, enumerableOnly) {
|
|
7249
7443
|
var keys = Object.keys(object);
|
|
7250
7444
|
if (Object.getOwnPropertySymbols) {
|
|
7251
7445
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
@@ -7258,21 +7452,21 @@
|
|
|
7258
7452
|
}
|
|
7259
7453
|
return keys;
|
|
7260
7454
|
}
|
|
7261
|
-
function _object_spread_props$
|
|
7455
|
+
function _object_spread_props$o(target, source) {
|
|
7262
7456
|
source = source != null ? source : {};
|
|
7263
7457
|
if (Object.getOwnPropertyDescriptors) {
|
|
7264
7458
|
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
7265
7459
|
} else {
|
|
7266
|
-
ownKeys$
|
|
7460
|
+
ownKeys$o(Object(source)).forEach(function(key) {
|
|
7267
7461
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
7268
7462
|
});
|
|
7269
7463
|
}
|
|
7270
7464
|
return target;
|
|
7271
7465
|
}
|
|
7272
|
-
function _object_without_properties$
|
|
7466
|
+
function _object_without_properties$5(source, excluded) {
|
|
7273
7467
|
if (source == null)
|
|
7274
7468
|
return {};
|
|
7275
|
-
var target = _object_without_properties_loose$
|
|
7469
|
+
var target = _object_without_properties_loose$5(source, excluded);
|
|
7276
7470
|
var key, i;
|
|
7277
7471
|
if (Object.getOwnPropertySymbols) {
|
|
7278
7472
|
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
@@ -7287,7 +7481,7 @@
|
|
|
7287
7481
|
}
|
|
7288
7482
|
return target;
|
|
7289
7483
|
}
|
|
7290
|
-
function _object_without_properties_loose$
|
|
7484
|
+
function _object_without_properties_loose$5(source, excluded) {
|
|
7291
7485
|
if (source == null)
|
|
7292
7486
|
return {};
|
|
7293
7487
|
var target = {};
|
|
@@ -7420,7 +7614,7 @@
|
|
|
7420
7614
|
}
|
|
7421
7615
|
};
|
|
7422
7616
|
function Select(_param) {
|
|
7423
|
-
var options = _param.options, value = _param.value, defaultOptionLabel = _param.defaultOptionLabel, _param_debounceTime = _param.debounceTime, debounceTime = _param_debounceTime === void 0 ? 400 : _param_debounceTime, _param_optionsMode = _param.optionsMode, optionsMode = _param_optionsMode === void 0 ? "normal" : _param_optionsMode, noMatchesLabel = _param.noMatchesLabel, loadingLabel = _param.loadingLabel, tweakStyles = _param.tweakStyles, testId = _param.testId, isDisabled = _param.isDisabled, dropdownOptions = _param.dropdownOptions, _param_minSymbolsCountToOpenList = _param.minSymbolsCountToOpenList, minSymbolsCountToOpenList = _param_minSymbolsCountToOpenList === void 0 ? 0 : _param_minSymbolsCountToOpenList, _param_dropdownIcon = _param.dropdownIcon, dropdownIcon = _param_dropdownIcon === void 0 ? "chevron-down" : _param_dropdownIcon, _param_shouldScrollToList = _param.shouldScrollToList, shouldScrollToList = _param_shouldScrollToList === void 0 ? true : _param_shouldScrollToList, onChange = _param.onChange, onFocus = _param.onFocus, onBlur = _param.onBlur, onType = _param.onType, onOpen = _param.onOpen, _param_isOptionDisabled = _param.isOptionDisabled, isOptionDisabled = _param_isOptionDisabled === void 0 ? defaultIsOptionDisabled : _param_isOptionDisabled, _param_compareValuesOnChange = _param.compareValuesOnChange, compareValuesOnChange = _param_compareValuesOnChange === void 0 ? defaultCompareFunction : _param_compareValuesOnChange, _param_convertValueToString = _param.convertValueToString, convertValueToString = _param_convertValueToString === void 0 ? defaultConvertFunction$2 : _param_convertValueToString, convertValueToId = _param.convertValueToId, convertValueToReactNode = _param.convertValueToReactNode, optionsFilter = _param.optionsFilter, inputProps = _object_without_properties$
|
|
7617
|
+
var options = _param.options, value = _param.value, defaultOptionLabel = _param.defaultOptionLabel, _param_debounceTime = _param.debounceTime, debounceTime = _param_debounceTime === void 0 ? 400 : _param_debounceTime, _param_optionsMode = _param.optionsMode, optionsMode = _param_optionsMode === void 0 ? "normal" : _param_optionsMode, noMatchesLabel = _param.noMatchesLabel, loadingLabel = _param.loadingLabel, tweakStyles = _param.tweakStyles, testId = _param.testId, isDisabled = _param.isDisabled, dropdownOptions = _param.dropdownOptions, _param_minSymbolsCountToOpenList = _param.minSymbolsCountToOpenList, minSymbolsCountToOpenList = _param_minSymbolsCountToOpenList === void 0 ? 0 : _param_minSymbolsCountToOpenList, _param_dropdownIcon = _param.dropdownIcon, dropdownIcon = _param_dropdownIcon === void 0 ? "chevron-down" : _param_dropdownIcon, _param_shouldScrollToList = _param.shouldScrollToList, shouldScrollToList = _param_shouldScrollToList === void 0 ? true : _param_shouldScrollToList, searchInput = _param.searchInput, onChange = _param.onChange, onFocus = _param.onFocus, onBlur = _param.onBlur, onType = _param.onType, onOpen = _param.onOpen, _param_isOptionDisabled = _param.isOptionDisabled, isOptionDisabled = _param_isOptionDisabled === void 0 ? defaultIsOptionDisabled : _param_isOptionDisabled, _param_compareValuesOnChange = _param.compareValuesOnChange, compareValuesOnChange = _param_compareValuesOnChange === void 0 ? defaultCompareFunction : _param_compareValuesOnChange, _param_convertValueToString = _param.convertValueToString, convertValueToString = _param_convertValueToString === void 0 ? defaultConvertFunction$2 : _param_convertValueToString, convertValueToId = _param.convertValueToId, convertValueToReactNode = _param.convertValueToReactNode, optionsFilter = _param.optionsFilter, inputProps = _object_without_properties$5(_param, [
|
|
7424
7618
|
"options",
|
|
7425
7619
|
"value",
|
|
7426
7620
|
"defaultOptionLabel",
|
|
@@ -7435,6 +7629,7 @@
|
|
|
7435
7629
|
"minSymbolsCountToOpenList",
|
|
7436
7630
|
"dropdownIcon",
|
|
7437
7631
|
"shouldScrollToList",
|
|
7632
|
+
"searchInput",
|
|
7438
7633
|
"onChange",
|
|
7439
7634
|
"onFocus",
|
|
7440
7635
|
"onBlur",
|
|
@@ -7458,6 +7653,8 @@
|
|
|
7458
7653
|
var inputWrapper = React.useRef(null);
|
|
7459
7654
|
var list = React.useRef(null);
|
|
7460
7655
|
var input = React.useRef(null);
|
|
7656
|
+
var shouldRenderSearchInputInList = (searchInput === null || searchInput === void 0 ? void 0 : searchInput.shouldRenderInList) === true;
|
|
7657
|
+
var hasSearchInputInList = optionsMode !== "normal" && shouldRenderSearchInputInList;
|
|
7461
7658
|
var stringValue = isNotEmpty(value) ? convertValueToString(value) : void 0;
|
|
7462
7659
|
var filteredOptions = React.useMemo(function() {
|
|
7463
7660
|
if (optionsMode !== "search") {
|
|
@@ -7485,43 +7682,32 @@
|
|
|
7485
7682
|
value,
|
|
7486
7683
|
convertValueToString
|
|
7487
7684
|
]);
|
|
7488
|
-
var handleListClose = function() {
|
|
7685
|
+
var handleListClose = function(event) {
|
|
7489
7686
|
setIsListOpen(false);
|
|
7490
7687
|
setSearchValue("");
|
|
7491
7688
|
setShouldShowDefaultOption(true);
|
|
7689
|
+
onBlur === null || onBlur === void 0 ? void 0 : onBlur(event);
|
|
7492
7690
|
};
|
|
7493
7691
|
var handleListOpen = function() {
|
|
7494
|
-
|
|
7495
|
-
|
|
7496
|
-
if (isListOpen) {
|
|
7497
|
-
return [
|
|
7498
|
-
2
|
|
7499
|
-
];
|
|
7500
|
-
}
|
|
7501
|
-
setIsListOpen(true);
|
|
7502
|
-
return [
|
|
7503
|
-
2
|
|
7504
|
-
];
|
|
7505
|
-
});
|
|
7506
|
-
});
|
|
7507
|
-
return function handleListOpen2() {
|
|
7508
|
-
return _ref2.apply(this, arguments);
|
|
7509
|
-
};
|
|
7510
|
-
}();
|
|
7511
|
-
var handleFocus = function(event) {
|
|
7512
|
-
if (onFocus !== void 0) {
|
|
7513
|
-
onFocus(event);
|
|
7692
|
+
if (!isListOpen) {
|
|
7693
|
+
setIsListOpen(true);
|
|
7514
7694
|
}
|
|
7695
|
+
};
|
|
7696
|
+
var handleFocus = function(event) {
|
|
7697
|
+
onFocus === null || onFocus === void 0 ? void 0 : onFocus(event);
|
|
7515
7698
|
handleListOpen();
|
|
7516
7699
|
};
|
|
7517
7700
|
var handleOnClick = function() {
|
|
7518
7701
|
handleListOpen();
|
|
7519
7702
|
};
|
|
7520
7703
|
var handleBlur = function(event) {
|
|
7521
|
-
if (
|
|
7522
|
-
|
|
7704
|
+
if (!isNotEmpty(event.relatedTarget) || !isNotEmpty(list.current)) {
|
|
7705
|
+
return;
|
|
7706
|
+
}
|
|
7707
|
+
var isActionInsideList = hasExactParent(event.relatedTarget, list.current);
|
|
7708
|
+
if (!isActionInsideList) {
|
|
7709
|
+
handleListClose(event);
|
|
7523
7710
|
}
|
|
7524
|
-
handleListClose();
|
|
7525
7711
|
};
|
|
7526
7712
|
var handleOnChange = React.useCallback(function(newValue) {
|
|
7527
7713
|
var areValuesEqual = compareValuesOnChange(value, newValue);
|
|
@@ -7533,10 +7719,10 @@
|
|
|
7533
7719
|
value,
|
|
7534
7720
|
onChange
|
|
7535
7721
|
]);
|
|
7536
|
-
var
|
|
7722
|
+
var handleOptionSelect = React.useCallback(function(index, event) {
|
|
7537
7723
|
var _input_current;
|
|
7538
7724
|
handleOnChange(index === -1 ? void 0 : filteredOptions[index]);
|
|
7539
|
-
handleListClose();
|
|
7725
|
+
handleListClose(event);
|
|
7540
7726
|
(_input_current = input.current) === null || _input_current === void 0 ? void 0 : _input_current.blur();
|
|
7541
7727
|
}, [
|
|
7542
7728
|
handleOnChange,
|
|
@@ -7591,7 +7777,7 @@
|
|
|
7591
7777
|
if (optionsMode !== "dynamic") {
|
|
7592
7778
|
setShouldShowDefaultOption(v === "");
|
|
7593
7779
|
}
|
|
7594
|
-
if (v === "") {
|
|
7780
|
+
if (v === "" && !hasSearchInputInList) {
|
|
7595
7781
|
handleOnChange(void 0);
|
|
7596
7782
|
}
|
|
7597
7783
|
setSearchValue(v);
|
|
@@ -7608,7 +7794,7 @@
|
|
|
7608
7794
|
if (indexToClick === -1 && filteredOptions.length === 1) {
|
|
7609
7795
|
indexToClick = 0;
|
|
7610
7796
|
}
|
|
7611
|
-
|
|
7797
|
+
handleOptionSelect(indexToClick, event);
|
|
7612
7798
|
break;
|
|
7613
7799
|
}
|
|
7614
7800
|
case "ArrowDown": {
|
|
@@ -7655,14 +7841,23 @@
|
|
|
7655
7841
|
(_input_current1 = input.current) === null || _input_current1 === void 0 ? void 0 : _input_current1.focus();
|
|
7656
7842
|
}
|
|
7657
7843
|
};
|
|
7658
|
-
useOnClickOutsideWithRef(list,
|
|
7659
|
-
|
|
7660
|
-
|
|
7661
|
-
|
|
7844
|
+
useOnClickOutsideWithRef(list, handleListClose, inputWrapper);
|
|
7845
|
+
var hasEnoughSymbolsToSearch = searchValue.trim().length >= minSymbolsCountToOpenList;
|
|
7846
|
+
var isOpen = (
|
|
7847
|
+
// Пользователь пытается открыть лист
|
|
7848
|
+
isListOpen && // Нам есть что показать:
|
|
7849
|
+
// Есть опции
|
|
7850
|
+
(filteredOptions.length > 0 || // Дефолтная опция
|
|
7851
|
+
defaultOptionLabel !== void 0 && !hasEnoughSymbolsToSearch || // Текст "Загрузка..."
|
|
7852
|
+
inputProps.isLoading || // Текст "Совпадений не найдено"
|
|
7853
|
+
noMatchesLabel !== void 0 || // У нас есть инпут с поиском внутри листа
|
|
7854
|
+
hasSearchInputInList) && // Последняя проверка на случай, если мы че то ищем в опциях
|
|
7855
|
+
(optionsMode === "normal" || hasEnoughSymbolsToSearch)
|
|
7856
|
+
);
|
|
7662
7857
|
var _inputProps_isReadonly = inputProps.isReadonly, isReadonly = _inputProps_isReadonly === void 0 ? true : _inputProps_isReadonly;
|
|
7663
|
-
var shouldUsePointerCursor = optionsMode === "normal" && isReadonly;
|
|
7858
|
+
var shouldUsePointerCursor = (optionsMode === "normal" || shouldRenderSearchInputInList) && isReadonly;
|
|
7664
7859
|
var tweakInputStyles = React.useMemo(function() {
|
|
7665
|
-
return lodash.merge({}, componentStyles.tweakInput, _object_spread$
|
|
7860
|
+
return lodash.merge({}, componentStyles.tweakInput, _object_spread$u({}, shouldUsePointerCursor ? {
|
|
7666
7861
|
input: {
|
|
7667
7862
|
cursor: "pointer"
|
|
7668
7863
|
}
|
|
@@ -7671,6 +7866,7 @@
|
|
|
7671
7866
|
tweakStyles === null || tweakStyles === void 0 ? void 0 : tweakStyles.tweakInput,
|
|
7672
7867
|
shouldUsePointerCursor
|
|
7673
7868
|
]);
|
|
7869
|
+
var tweakSearchInputStyles = useTweakStyles(componentStyles, tweakStyles, "tweakSearchInput");
|
|
7674
7870
|
var _ref = dropdownOptions !== null && dropdownOptions !== void 0 ? dropdownOptions : {}, _ref_shouldUsePopper = _ref.shouldUsePopper, shouldUsePopper = _ref_shouldUsePopper === void 0 ? false : _ref_shouldUsePopper, _ref_shouldRenderInBody = _ref.shouldRenderInBody, shouldRenderInBody = _ref_shouldRenderInBody === void 0 ? false : _ref_shouldRenderInBody, _ref_shouldHideOnScroll = _ref.shouldHideOnScroll, shouldHideOnScroll = _ref_shouldHideOnScroll === void 0 ? false : _ref_shouldHideOnScroll;
|
|
7675
7871
|
var popperData = useDropdown({
|
|
7676
7872
|
isOpen,
|
|
@@ -7692,30 +7888,34 @@
|
|
|
7692
7888
|
onOpen
|
|
7693
7889
|
]);
|
|
7694
7890
|
var _obj;
|
|
7695
|
-
var listEl = /* @__PURE__ */ jsx("div", _object_spread_props$
|
|
7696
|
-
className: clsx(classes.listWrapper, (_obj = {}, _define_property$
|
|
7891
|
+
var listEl = /* @__PURE__ */ jsx("div", _object_spread_props$o(_object_spread$u({
|
|
7892
|
+
className: clsx(classes.listWrapper, (_obj = {}, _define_property$v(_obj, classes.withoutPopper, !shouldUsePopper), _define_property$v(_obj, classes.listWrapperInBody, shouldRenderInBody), _obj)),
|
|
7697
7893
|
ref: list,
|
|
7698
|
-
|
|
7699
|
-
|
|
7700
|
-
},
|
|
7701
|
-
style: popperData === null || popperData === void 0 ? void 0 : popperData.styles.popper
|
|
7894
|
+
style: popperData === null || popperData === void 0 ? void 0 : popperData.styles.popper,
|
|
7895
|
+
onBlur: handleBlur
|
|
7702
7896
|
}, popperData === null || popperData === void 0 ? void 0 : popperData.attributes.popper), {
|
|
7703
7897
|
children: isOpen && /* @__PURE__ */ jsx(SelectList, {
|
|
7704
7898
|
options: filteredOptions,
|
|
7705
7899
|
defaultOptionLabel: hasDefaultOption && shouldShowDefaultOption ? defaultOptionLabel : void 0,
|
|
7900
|
+
customListHeader: hasSearchInputInList ? /* @__PURE__ */ jsx(SearchInput, _object_spread$u({
|
|
7901
|
+
value: searchValue,
|
|
7902
|
+
onChange: handleInputChange,
|
|
7903
|
+
tweakStyles: tweakSearchInputStyles,
|
|
7904
|
+
placeholder: "Поиск"
|
|
7905
|
+
}, searchInput)) : void 0,
|
|
7706
7906
|
noMatchesLabel,
|
|
7707
7907
|
focusedIndex: focusedListCellIndex,
|
|
7708
7908
|
activeValue: value,
|
|
7709
7909
|
isLoading: inputProps.isLoading,
|
|
7710
7910
|
loadingLabel,
|
|
7711
7911
|
tweakStyles: tweakStyles === null || tweakStyles === void 0 ? void 0 : tweakStyles.tweakSelectList,
|
|
7712
|
-
testId:
|
|
7912
|
+
testId: getTestId(testId, "list"),
|
|
7713
7913
|
shouldScrollToList: shouldScrollToList && !shouldUsePopper && !shouldHideOnScroll,
|
|
7714
7914
|
isOptionDisabled,
|
|
7715
7915
|
convertValueToString,
|
|
7716
7916
|
convertValueToReactNode,
|
|
7717
7917
|
convertValueToId,
|
|
7718
|
-
onOptionClick:
|
|
7918
|
+
onOptionClick: handleOptionSelect
|
|
7719
7919
|
})
|
|
7720
7920
|
}));
|
|
7721
7921
|
return /* @__PURE__ */ jsxs("div", {
|
|
@@ -7727,11 +7927,11 @@
|
|
|
7727
7927
|
onClick: isDisabled ? void 0 : handleOnClick,
|
|
7728
7928
|
ref: inputWrapper,
|
|
7729
7929
|
children: [
|
|
7730
|
-
/* @__PURE__ */ jsx(Input, _object_spread$
|
|
7731
|
-
value: searchValue !== "" ? searchValue : stringValue,
|
|
7930
|
+
/* @__PURE__ */ jsx(Input, _object_spread$u({
|
|
7931
|
+
value: searchValue !== "" && !shouldRenderSearchInputInList ? searchValue : stringValue,
|
|
7732
7932
|
onChange: handleInputChange,
|
|
7733
7933
|
isActive: isListOpen,
|
|
7734
|
-
isReadonly: optionsMode === "normal",
|
|
7934
|
+
isReadonly: optionsMode === "normal" || shouldRenderSearchInputInList,
|
|
7735
7935
|
onFocus: handleFocus,
|
|
7736
7936
|
onBlur: handleBlur,
|
|
7737
7937
|
isDisabled,
|
|
@@ -7765,7 +7965,7 @@
|
|
|
7765
7965
|
}
|
|
7766
7966
|
var SELECT_PADDING_LEFT = 12;
|
|
7767
7967
|
var SELECT_PADDING_RIGHT = 24;
|
|
7768
|
-
var styles$
|
|
7968
|
+
var styles$s = {
|
|
7769
7969
|
btn: {
|
|
7770
7970
|
width: 36,
|
|
7771
7971
|
height: 36,
|
|
@@ -7834,7 +8034,7 @@
|
|
|
7834
8034
|
};
|
|
7835
8035
|
var DatePickerHeader = function(param) {
|
|
7836
8036
|
var date = param.date, changeYear = param.changeYear, changeMonth = param.changeMonth, decreaseMonth = param.decreaseMonth, increaseMonth = param.increaseMonth, isPrevMonthButtonDisabled = param.isPrevMonthButtonDisabled, isNextMonthButtonDisabled = param.isNextMonthButtonDisabled, months = param.months;
|
|
7837
|
-
var _useTheme = useTheme("DatePickerHeader", styles$
|
|
8037
|
+
var _useTheme = useTheme("DatePickerHeader", styles$s), classes = _useTheme.classes, componentStyles = _useTheme.componentStyles;
|
|
7838
8038
|
var years = React.useMemo(function() {
|
|
7839
8039
|
return Array.from(Array(41)).map(function(_, i) {
|
|
7840
8040
|
return dateFns.getYear(new Date()) - 30 + i;
|
|
@@ -7918,7 +8118,7 @@
|
|
|
7918
8118
|
]
|
|
7919
8119
|
});
|
|
7920
8120
|
};
|
|
7921
|
-
var styles$
|
|
8121
|
+
var styles$r = {
|
|
7922
8122
|
root: {
|
|
7923
8123
|
width: "100%",
|
|
7924
8124
|
height: "100%"
|
|
@@ -7980,7 +8180,7 @@
|
|
|
7980
8180
|
if (Array.isArray(arr))
|
|
7981
8181
|
return arr;
|
|
7982
8182
|
}
|
|
7983
|
-
function _define_property$
|
|
8183
|
+
function _define_property$u(obj, key, value) {
|
|
7984
8184
|
if (key in obj) {
|
|
7985
8185
|
Object.defineProperty(obj, key, {
|
|
7986
8186
|
value,
|
|
@@ -8024,7 +8224,7 @@
|
|
|
8024
8224
|
function _non_iterable_rest$i() {
|
|
8025
8225
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
8026
8226
|
}
|
|
8027
|
-
function _object_spread$
|
|
8227
|
+
function _object_spread$t(target) {
|
|
8028
8228
|
for (var i = 1; i < arguments.length; i++) {
|
|
8029
8229
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
8030
8230
|
var ownKeys2 = Object.keys(source);
|
|
@@ -8034,12 +8234,12 @@
|
|
|
8034
8234
|
}));
|
|
8035
8235
|
}
|
|
8036
8236
|
ownKeys2.forEach(function(key) {
|
|
8037
|
-
_define_property$
|
|
8237
|
+
_define_property$u(target, key, source[key]);
|
|
8038
8238
|
});
|
|
8039
8239
|
}
|
|
8040
8240
|
return target;
|
|
8041
8241
|
}
|
|
8042
|
-
function ownKeys$
|
|
8242
|
+
function ownKeys$n(object, enumerableOnly) {
|
|
8043
8243
|
var keys = Object.keys(object);
|
|
8044
8244
|
if (Object.getOwnPropertySymbols) {
|
|
8045
8245
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
@@ -8052,21 +8252,21 @@
|
|
|
8052
8252
|
}
|
|
8053
8253
|
return keys;
|
|
8054
8254
|
}
|
|
8055
|
-
function _object_spread_props$
|
|
8255
|
+
function _object_spread_props$n(target, source) {
|
|
8056
8256
|
source = source != null ? source : {};
|
|
8057
8257
|
if (Object.getOwnPropertyDescriptors) {
|
|
8058
8258
|
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
8059
8259
|
} else {
|
|
8060
|
-
ownKeys$
|
|
8260
|
+
ownKeys$n(Object(source)).forEach(function(key) {
|
|
8061
8261
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
8062
8262
|
});
|
|
8063
8263
|
}
|
|
8064
8264
|
return target;
|
|
8065
8265
|
}
|
|
8066
|
-
function _object_without_properties$
|
|
8266
|
+
function _object_without_properties$4(source, excluded) {
|
|
8067
8267
|
if (source == null)
|
|
8068
8268
|
return {};
|
|
8069
|
-
var target = _object_without_properties_loose$
|
|
8269
|
+
var target = _object_without_properties_loose$4(source, excluded);
|
|
8070
8270
|
var key, i;
|
|
8071
8271
|
if (Object.getOwnPropertySymbols) {
|
|
8072
8272
|
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
@@ -8081,7 +8281,7 @@
|
|
|
8081
8281
|
}
|
|
8082
8282
|
return target;
|
|
8083
8283
|
}
|
|
8084
|
-
function _object_without_properties_loose$
|
|
8284
|
+
function _object_without_properties_loose$4(source, excluded) {
|
|
8085
8285
|
if (source == null)
|
|
8086
8286
|
return {};
|
|
8087
8287
|
var target = {};
|
|
@@ -8122,7 +8322,7 @@
|
|
|
8122
8322
|
};
|
|
8123
8323
|
var DEFAULT_DATE_FORMAT$2 = "dd.MM.yyyy";
|
|
8124
8324
|
var DatePicker = function(_param) {
|
|
8125
|
-
var data = _param.data, tweakStyles = _param.tweakStyles, selectedDate = _param.selectedDate, minDate = _param.minDate, maxDate = _param.maxDate, endDate = _param.endDate, startDate = _param.startDate, size = _param.size, isRange = _param.isRange, locale2 = _param.locale, months = _param.months, _param_calendarStartDay = _param.calendarStartDay, calendarStartDay = _param_calendarStartDay === void 0 ? 1 : _param_calendarStartDay, _param_leftPosition = _param.leftPosition, leftPosition = _param_leftPosition === void 0 ? 0 : _param_leftPosition, _param_topPosition = _param.topPosition, topPosition = _param_topPosition === void 0 ? 0 : _param_topPosition, isInline = _param.isInline, isNeedClearSelectedDate = _param.isNeedClearSelectedDate, _param_dateFormat = _param.dateFormat, dateFormat = _param_dateFormat === void 0 ? DEFAULT_DATE_FORMAT$2 : _param_dateFormat, monthsShown = _param.monthsShown, _param_placeholder = _param.placeholder, placeholder = _param_placeholder === void 0 ? "__.__.____" : _param_placeholder, shouldGiveValueOnType = _param.shouldGiveValueOnType, disabledKeyboardNavigation = _param.disabledKeyboardNavigation, shouldRenderPopperInBody = _param.shouldRenderPopperInBody, popperModifiers = _param.popperModifiers, showPreviousMonths = _param.showPreviousMonths, popperPlacement = _param.popperPlacement, onChangeDate = _param.onChangeDate, onChangeRange = _param.onChangeRange, customHeader = _param.customHeader, filterDate = _param.filterDate, inputProps = _object_without_properties$
|
|
8325
|
+
var data = _param.data, tweakStyles = _param.tweakStyles, selectedDate = _param.selectedDate, minDate = _param.minDate, maxDate = _param.maxDate, endDate = _param.endDate, startDate = _param.startDate, size = _param.size, isRange = _param.isRange, locale2 = _param.locale, months = _param.months, _param_calendarStartDay = _param.calendarStartDay, calendarStartDay = _param_calendarStartDay === void 0 ? 1 : _param_calendarStartDay, _param_leftPosition = _param.leftPosition, leftPosition = _param_leftPosition === void 0 ? 0 : _param_leftPosition, _param_topPosition = _param.topPosition, topPosition = _param_topPosition === void 0 ? 0 : _param_topPosition, isInline = _param.isInline, isNeedClearSelectedDate = _param.isNeedClearSelectedDate, _param_dateFormat = _param.dateFormat, dateFormat = _param_dateFormat === void 0 ? DEFAULT_DATE_FORMAT$2 : _param_dateFormat, monthsShown = _param.monthsShown, _param_placeholder = _param.placeholder, placeholder = _param_placeholder === void 0 ? "__.__.____" : _param_placeholder, shouldGiveValueOnType = _param.shouldGiveValueOnType, disabledKeyboardNavigation = _param.disabledKeyboardNavigation, shouldRenderPopperInBody = _param.shouldRenderPopperInBody, popperModifiers = _param.popperModifiers, showPreviousMonths = _param.showPreviousMonths, popperPlacement = _param.popperPlacement, onChangeDate = _param.onChangeDate, onChangeRange = _param.onChangeRange, customHeader = _param.customHeader, filterDate = _param.filterDate, inputProps = _object_without_properties$4(_param, [
|
|
8126
8326
|
"data",
|
|
8127
8327
|
"tweakStyles",
|
|
8128
8328
|
"selectedDate",
|
|
@@ -8153,7 +8353,7 @@
|
|
|
8153
8353
|
"customHeader",
|
|
8154
8354
|
"filterDate"
|
|
8155
8355
|
]);
|
|
8156
|
-
var classes = useTheme("DatePicker", styles$
|
|
8356
|
+
var classes = useTheme("DatePicker", styles$r, tweakStyles, {
|
|
8157
8357
|
leftPosition,
|
|
8158
8358
|
topPosition
|
|
8159
8359
|
}).classes;
|
|
@@ -8302,7 +8502,7 @@
|
|
|
8302
8502
|
},
|
|
8303
8503
|
filterDate
|
|
8304
8504
|
};
|
|
8305
|
-
var dateInputProps = _object_spread_props$
|
|
8505
|
+
var dateInputProps = _object_spread_props$n(_object_spread$t({}, inputProps), {
|
|
8306
8506
|
tweakStyles,
|
|
8307
8507
|
iconType: inputProps.isClearable && dateValue !== "" ? void 0 : "calendar",
|
|
8308
8508
|
isRange,
|
|
@@ -8311,14 +8511,14 @@
|
|
|
8311
8511
|
}
|
|
8312
8512
|
});
|
|
8313
8513
|
if (onChangeRange) {
|
|
8314
|
-
datePickerProps = _object_spread_props$
|
|
8514
|
+
datePickerProps = _object_spread_props$n(_object_spread$t({}, datePickerProps), {
|
|
8315
8515
|
startDate: start2,
|
|
8316
8516
|
endDate: end2,
|
|
8317
8517
|
selectsRange: true,
|
|
8318
8518
|
selected: startDate,
|
|
8319
8519
|
onChange: onChangeRange
|
|
8320
8520
|
});
|
|
8321
|
-
dateInputProps = _object_spread_props$
|
|
8521
|
+
dateInputProps = _object_spread_props$n(_object_spread$t({}, dateInputProps), {
|
|
8322
8522
|
startDate: startDateValue,
|
|
8323
8523
|
endDate: endDateValue,
|
|
8324
8524
|
onBlur: handleRangeBlur,
|
|
@@ -8326,7 +8526,7 @@
|
|
|
8326
8526
|
});
|
|
8327
8527
|
}
|
|
8328
8528
|
if (onChangeDate) {
|
|
8329
|
-
datePickerProps = _object_spread_props$
|
|
8529
|
+
datePickerProps = _object_spread_props$n(_object_spread$t({}, datePickerProps), {
|
|
8330
8530
|
selected: date,
|
|
8331
8531
|
onChange: function(newDate) {
|
|
8332
8532
|
return onChangeDate(newDate);
|
|
@@ -8340,20 +8540,20 @@
|
|
|
8340
8540
|
minDate,
|
|
8341
8541
|
maxDate
|
|
8342
8542
|
});
|
|
8343
|
-
dateInputProps = _object_spread_props$
|
|
8543
|
+
dateInputProps = _object_spread_props$n(_object_spread$t({}, dateInputProps), {
|
|
8344
8544
|
date: dateValue,
|
|
8345
8545
|
isActive: isOpen,
|
|
8346
8546
|
onBlur: handleBlur,
|
|
8347
8547
|
onChange: handleDateChange
|
|
8348
8548
|
});
|
|
8349
8549
|
}
|
|
8350
|
-
return /* @__PURE__ */ jsx("div", _object_spread_props$
|
|
8550
|
+
return /* @__PURE__ */ jsx("div", _object_spread_props$n(_object_spread$t({
|
|
8351
8551
|
className: classes.root
|
|
8352
8552
|
}, addDataAttributes(data)), {
|
|
8353
|
-
children: /* @__PURE__ */ jsx(Datepicker, _object_spread_props$
|
|
8553
|
+
children: /* @__PURE__ */ jsx(Datepicker, _object_spread_props$n(_object_spread$t({}, datePickerProps), {
|
|
8354
8554
|
customInput: /* @__PURE__ */ jsx(DatePickerInput, {
|
|
8355
8555
|
size,
|
|
8356
|
-
children: /* @__PURE__ */ jsx(DateInput, _object_spread$
|
|
8556
|
+
children: /* @__PURE__ */ jsx(DateInput, _object_spread$t({}, dateInputProps))
|
|
8357
8557
|
}),
|
|
8358
8558
|
renderCustomHeader: customHeader !== void 0 ? customHeader : function(param) {
|
|
8359
8559
|
var renderDate = param.date, changeYear = param.changeYear, changeMonth = param.changeMonth, decreaseMonth = param.decreaseMonth, increaseMonth = param.increaseMonth, prevMonthButtonDisabled = param.prevMonthButtonDisabled, nextMonthButtonDisabled = param.nextMonthButtonDisabled;
|
|
@@ -8371,7 +8571,7 @@
|
|
|
8371
8571
|
}))
|
|
8372
8572
|
}));
|
|
8373
8573
|
};
|
|
8374
|
-
var styles$
|
|
8574
|
+
var styles$q = {
|
|
8375
8575
|
root: {},
|
|
8376
8576
|
button: {
|
|
8377
8577
|
cursor: "pointer",
|
|
@@ -8412,7 +8612,7 @@
|
|
|
8412
8612
|
if (Array.isArray(arr))
|
|
8413
8613
|
return arr;
|
|
8414
8614
|
}
|
|
8415
|
-
function _define_property$
|
|
8615
|
+
function _define_property$t(obj, key, value) {
|
|
8416
8616
|
if (key in obj) {
|
|
8417
8617
|
Object.defineProperty(obj, key, {
|
|
8418
8618
|
value,
|
|
@@ -8456,7 +8656,7 @@
|
|
|
8456
8656
|
function _non_iterable_rest$h() {
|
|
8457
8657
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
8458
8658
|
}
|
|
8459
|
-
function _object_spread$
|
|
8659
|
+
function _object_spread$s(target) {
|
|
8460
8660
|
for (var i = 1; i < arguments.length; i++) {
|
|
8461
8661
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
8462
8662
|
var ownKeys2 = Object.keys(source);
|
|
@@ -8466,12 +8666,12 @@
|
|
|
8466
8666
|
}));
|
|
8467
8667
|
}
|
|
8468
8668
|
ownKeys2.forEach(function(key) {
|
|
8469
|
-
_define_property$
|
|
8669
|
+
_define_property$t(target, key, source[key]);
|
|
8470
8670
|
});
|
|
8471
8671
|
}
|
|
8472
8672
|
return target;
|
|
8473
8673
|
}
|
|
8474
|
-
function ownKeys$
|
|
8674
|
+
function ownKeys$m(object, enumerableOnly) {
|
|
8475
8675
|
var keys = Object.keys(object);
|
|
8476
8676
|
if (Object.getOwnPropertySymbols) {
|
|
8477
8677
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
@@ -8484,12 +8684,12 @@
|
|
|
8484
8684
|
}
|
|
8485
8685
|
return keys;
|
|
8486
8686
|
}
|
|
8487
|
-
function _object_spread_props$
|
|
8687
|
+
function _object_spread_props$m(target, source) {
|
|
8488
8688
|
source = source != null ? source : {};
|
|
8489
8689
|
if (Object.getOwnPropertyDescriptors) {
|
|
8490
8690
|
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
8491
8691
|
} else {
|
|
8492
|
-
ownKeys$
|
|
8692
|
+
ownKeys$m(Object(source)).forEach(function(key) {
|
|
8493
8693
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
8494
8694
|
});
|
|
8495
8695
|
}
|
|
@@ -8514,14 +8714,14 @@
|
|
|
8514
8714
|
var LINK_REGEXP = /(http(s?):\/\/(.*))(\s?)/;
|
|
8515
8715
|
var Description = function(param) {
|
|
8516
8716
|
var text = param.text, moreTitle = param.moreTitle, lessTitle = param.lessTitle, _param_truncateIndex = param.truncateIndex, truncateIndex = _param_truncateIndex === void 0 ? 150 : _param_truncateIndex, _param_isAlwaysOpen = param.isAlwaysOpen, isAlwaysOpen = _param_isAlwaysOpen === void 0 ? true : _param_isAlwaysOpen, data = param.data, tweakStyles = param.tweakStyles;
|
|
8517
|
-
var classes = useTheme("Description", styles$
|
|
8717
|
+
var classes = useTheme("Description", styles$q, tweakStyles).classes;
|
|
8518
8718
|
var isTooShort = text.length < truncateIndex;
|
|
8519
8719
|
var _useState = _sliced_to_array$h(React.useState(isAlwaysOpen), 2), isOpen = _useState[0], setIsOpen = _useState[1];
|
|
8520
8720
|
var link = text.match(LINK_REGEXP);
|
|
8521
8721
|
var linkText = link && link[0];
|
|
8522
8722
|
var textWithNoLink = text.replace(LINK_REGEXP, "");
|
|
8523
8723
|
var shortText = text.slice(0, text.slice(0, truncateIndex).lastIndexOf(" "));
|
|
8524
|
-
return /* @__PURE__ */ jsxs("div", _object_spread_props$
|
|
8724
|
+
return /* @__PURE__ */ jsxs("div", _object_spread_props$m(_object_spread$s({
|
|
8525
8725
|
className: classes.root
|
|
8526
8726
|
}, addDataAttributes(data)), {
|
|
8527
8727
|
children: [
|
|
@@ -8556,158 +8756,6 @@
|
|
|
8556
8756
|
]
|
|
8557
8757
|
}));
|
|
8558
8758
|
};
|
|
8559
|
-
var LEFT_PADDING = 44;
|
|
8560
|
-
var styles$q = {
|
|
8561
|
-
root: {
|
|
8562
|
-
position: "relative"
|
|
8563
|
-
},
|
|
8564
|
-
icon: {
|
|
8565
|
-
display: "flex",
|
|
8566
|
-
alignItems: "center",
|
|
8567
|
-
position: "absolute",
|
|
8568
|
-
left: 12,
|
|
8569
|
-
height: "100%",
|
|
8570
|
-
width: 20,
|
|
8571
|
-
zIndex: 2,
|
|
8572
|
-
color: colors.GREY_ACTIVE
|
|
8573
|
-
},
|
|
8574
|
-
tweakInput: {
|
|
8575
|
-
inputWrapper: {
|
|
8576
|
-
height: 35,
|
|
8577
|
-
borderColor: "transparent",
|
|
8578
|
-
backgroundColor: rgba(colors.BORDER_MAIN, 0.3),
|
|
8579
|
-
borderRadius: 18,
|
|
8580
|
-
paddingLeft: LEFT_PADDING,
|
|
8581
|
-
transitionProperty: "background-color, border-color"
|
|
8582
|
-
},
|
|
8583
|
-
focused: {
|
|
8584
|
-
backgroundColor: colors.CLASSIC_WHITE,
|
|
8585
|
-
borderColor: colors.BORDER_MAIN
|
|
8586
|
-
},
|
|
8587
|
-
input: {
|
|
8588
|
-
fontSize: 14,
|
|
8589
|
-
paddingLeft: 0
|
|
8590
|
-
},
|
|
8591
|
-
label: {
|
|
8592
|
-
left: LEFT_PADDING,
|
|
8593
|
-
fontSize: 14
|
|
8594
|
-
}
|
|
8595
|
-
}
|
|
8596
|
-
};
|
|
8597
|
-
function _define_property$t(obj, key, value) {
|
|
8598
|
-
if (key in obj) {
|
|
8599
|
-
Object.defineProperty(obj, key, {
|
|
8600
|
-
value,
|
|
8601
|
-
enumerable: true,
|
|
8602
|
-
configurable: true,
|
|
8603
|
-
writable: true
|
|
8604
|
-
});
|
|
8605
|
-
} else {
|
|
8606
|
-
obj[key] = value;
|
|
8607
|
-
}
|
|
8608
|
-
return obj;
|
|
8609
|
-
}
|
|
8610
|
-
function _object_spread$s(target) {
|
|
8611
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
8612
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
|
8613
|
-
var ownKeys2 = Object.keys(source);
|
|
8614
|
-
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
8615
|
-
ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
8616
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
8617
|
-
}));
|
|
8618
|
-
}
|
|
8619
|
-
ownKeys2.forEach(function(key) {
|
|
8620
|
-
_define_property$t(target, key, source[key]);
|
|
8621
|
-
});
|
|
8622
|
-
}
|
|
8623
|
-
return target;
|
|
8624
|
-
}
|
|
8625
|
-
function ownKeys$m(object, enumerableOnly) {
|
|
8626
|
-
var keys = Object.keys(object);
|
|
8627
|
-
if (Object.getOwnPropertySymbols) {
|
|
8628
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
8629
|
-
if (enumerableOnly) {
|
|
8630
|
-
symbols = symbols.filter(function(sym) {
|
|
8631
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
8632
|
-
});
|
|
8633
|
-
}
|
|
8634
|
-
keys.push.apply(keys, symbols);
|
|
8635
|
-
}
|
|
8636
|
-
return keys;
|
|
8637
|
-
}
|
|
8638
|
-
function _object_spread_props$m(target, source) {
|
|
8639
|
-
source = source != null ? source : {};
|
|
8640
|
-
if (Object.getOwnPropertyDescriptors) {
|
|
8641
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
8642
|
-
} else {
|
|
8643
|
-
ownKeys$m(Object(source)).forEach(function(key) {
|
|
8644
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
8645
|
-
});
|
|
8646
|
-
}
|
|
8647
|
-
return target;
|
|
8648
|
-
}
|
|
8649
|
-
function _object_without_properties$4(source, excluded) {
|
|
8650
|
-
if (source == null)
|
|
8651
|
-
return {};
|
|
8652
|
-
var target = _object_without_properties_loose$4(source, excluded);
|
|
8653
|
-
var key, i;
|
|
8654
|
-
if (Object.getOwnPropertySymbols) {
|
|
8655
|
-
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
8656
|
-
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
8657
|
-
key = sourceSymbolKeys[i];
|
|
8658
|
-
if (excluded.indexOf(key) >= 0)
|
|
8659
|
-
continue;
|
|
8660
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key))
|
|
8661
|
-
continue;
|
|
8662
|
-
target[key] = source[key];
|
|
8663
|
-
}
|
|
8664
|
-
}
|
|
8665
|
-
return target;
|
|
8666
|
-
}
|
|
8667
|
-
function _object_without_properties_loose$4(source, excluded) {
|
|
8668
|
-
if (source == null)
|
|
8669
|
-
return {};
|
|
8670
|
-
var target = {};
|
|
8671
|
-
var sourceKeys = Object.keys(source);
|
|
8672
|
-
var key, i;
|
|
8673
|
-
for (i = 0; i < sourceKeys.length; i++) {
|
|
8674
|
-
key = sourceKeys[i];
|
|
8675
|
-
if (excluded.indexOf(key) >= 0)
|
|
8676
|
-
continue;
|
|
8677
|
-
target[key] = source[key];
|
|
8678
|
-
}
|
|
8679
|
-
return target;
|
|
8680
|
-
}
|
|
8681
|
-
var SearchInput = function(_param) {
|
|
8682
|
-
var _param_isClearable = _param.isClearable, isClearable = _param_isClearable === void 0 ? true : _param_isClearable, tweakStyles = _param.tweakStyles, testId = _param.testId, data = _param.data, props = _object_without_properties$4(_param, [
|
|
8683
|
-
"isClearable",
|
|
8684
|
-
"tweakStyles",
|
|
8685
|
-
"testId",
|
|
8686
|
-
"data"
|
|
8687
|
-
]);
|
|
8688
|
-
var _useTheme = useTheme("SearchInput", styles$q, tweakStyles), classes = _useTheme.classes, componentStyles = _useTheme.componentStyles;
|
|
8689
|
-
var tweakInputStyles = useTweakStyles(componentStyles, tweakStyles, "tweakInput");
|
|
8690
|
-
return /* @__PURE__ */ jsxs("div", _object_spread_props$m(_object_spread$s({
|
|
8691
|
-
className: classes.root
|
|
8692
|
-
}, addDataTestId(testId), addDataAttributes(data)), {
|
|
8693
|
-
children: [
|
|
8694
|
-
/* @__PURE__ */ jsx("div", {
|
|
8695
|
-
className: classes.icon,
|
|
8696
|
-
children: /* @__PURE__ */ jsx(Icon, {
|
|
8697
|
-
type: "search"
|
|
8698
|
-
})
|
|
8699
|
-
}),
|
|
8700
|
-
/* @__PURE__ */ jsx(Input, _object_spread$s({
|
|
8701
|
-
isClearable,
|
|
8702
|
-
isActive: props.value !== "" && props.value !== void 0,
|
|
8703
|
-
testId: getTestId(testId, "input"),
|
|
8704
|
-
tweakStyles: tweakInputStyles,
|
|
8705
|
-
hasFloatingLabel: false,
|
|
8706
|
-
label: props.placeholder
|
|
8707
|
-
}, props))
|
|
8708
|
-
]
|
|
8709
|
-
}));
|
|
8710
|
-
};
|
|
8711
8759
|
var SelectLocales = {
|
|
8712
8760
|
ru: {
|
|
8713
8761
|
clear: "Очистить",
|
|
@@ -27073,6 +27121,7 @@
|
|
|
27073
27121
|
exports2.getScrollParent = getScrollParent$1;
|
|
27074
27122
|
exports2.getStyleComputedProperty = getStyleComputedProperty;
|
|
27075
27123
|
exports2.getTestId = getTestId;
|
|
27124
|
+
exports2.hasExactParent = hasExactParent;
|
|
27076
27125
|
exports2.isElementOffScreen = isElementOffScreen;
|
|
27077
27126
|
exports2.isElementOneOfParents = isElementOneOfParents;
|
|
27078
27127
|
exports2.isInt = isInt;
|
|
@@ -27081,6 +27130,7 @@
|
|
|
27081
27130
|
exports2.minWidthModifier = minWidthModifier;
|
|
27082
27131
|
exports2.phoneInfo = phoneInfo;
|
|
27083
27132
|
exports2.removeStringFormat = removeStringFormat;
|
|
27133
|
+
exports2.renderIcon = renderIcon;
|
|
27084
27134
|
exports2.rgba = rgba;
|
|
27085
27135
|
exports2.setCaretPosition = setCaretPosition;
|
|
27086
27136
|
exports2.sortCountriesByLocale = sortCountriesByLocale;
|