@invoicebox/ui 0.1.0-alpha.187 → 0.1.0-alpha.188
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.
|
@@ -20,7 +20,8 @@ export type TProps<TValue> = Pick<TInputProps, 'label' | 'hasError' | 'placehold
|
|
|
20
20
|
renderOption?: (entity?: any) => ReactNode;
|
|
21
21
|
renderGroup?: (entity?: any) => ReactNode;
|
|
22
22
|
dropdownHeader?: ReactNode;
|
|
23
|
+
scrollbarHeader?: ReactNode;
|
|
23
24
|
isDrawerOptions?: boolean;
|
|
24
25
|
scrollbarMaxHeight?: number;
|
|
25
26
|
};
|
|
26
|
-
export declare const Select: <TValue extends string | number>({ label, hasError, placeholder, name, value, onChange, options, groups, isResetButtonEnabled, size, renderOption, dropdownHeader, isDrawerOptions, renderGroup, scrollbarMaxHeight, }: TProps<TValue>) => import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export declare const Select: <TValue extends string | number>({ label, hasError, placeholder, name, value, onChange, options, groups, isResetButtonEnabled, size, renderOption, dropdownHeader, isDrawerOptions, renderGroup, scrollbarMaxHeight, scrollbarHeader, }: TProps<TValue>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -44,7 +44,8 @@ var Select = exports.Select = function Select(_ref) {
|
|
|
44
44
|
isDrawerOptions = _ref$isDrawerOptions === void 0 ? false : _ref$isDrawerOptions,
|
|
45
45
|
renderGroup = _ref.renderGroup,
|
|
46
46
|
_ref$scrollbarMaxHeig = _ref.scrollbarMaxHeight,
|
|
47
|
-
scrollbarMaxHeight = _ref$scrollbarMaxHeig === void 0 ? MAX_LIST_HEIGHT : _ref$scrollbarMaxHeig
|
|
47
|
+
scrollbarMaxHeight = _ref$scrollbarMaxHeig === void 0 ? MAX_LIST_HEIGHT : _ref$scrollbarMaxHeig,
|
|
48
|
+
scrollbarHeader = _ref.scrollbarHeader;
|
|
48
49
|
var palette = (0, _palette.useComponentPalette)('select');
|
|
49
50
|
var _useInputFocus = (0, _useInputFocus2.useInputFocus)(),
|
|
50
51
|
inFocus = _useInputFocus.inFocus,
|
|
@@ -140,7 +141,7 @@ var Select = exports.Select = function Select(_ref) {
|
|
|
140
141
|
}
|
|
141
142
|
return null;
|
|
142
143
|
};
|
|
143
|
-
var
|
|
144
|
+
var scrollbarContent = /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, scrollbarHeader, optionGroups.map(function (_ref2) {
|
|
144
145
|
var group = _ref2.group,
|
|
145
146
|
groupOptions = _ref2.options;
|
|
146
147
|
return /*#__PURE__*/_react["default"].createElement(_react.Fragment, {
|
|
@@ -177,13 +178,13 @@ var Select = exports.Select = function Select(_ref) {
|
|
|
177
178
|
onClose: handleHide,
|
|
178
179
|
isOpen: isOpen,
|
|
179
180
|
isPadding: false
|
|
180
|
-
}, /*#__PURE__*/_react["default"].createElement(S.DrawerContent, null, /*#__PURE__*/_react["default"].createElement(_Scrollbar.Scrollbar, {
|
|
181
|
+
}, /*#__PURE__*/_react["default"].createElement(S.DrawerContent, null, dropdownHeader, /*#__PURE__*/_react["default"].createElement(_Scrollbar.Scrollbar, {
|
|
181
182
|
maxHeight: scrollbarMaxHeight
|
|
182
|
-
},
|
|
183
|
+
}, scrollbarContent, /*#__PURE__*/_react["default"].createElement(S.DrawerBottom, null)))) : /*#__PURE__*/_react["default"].createElement(_Dropdown.Dropdown, {
|
|
183
184
|
isOpen: isOpen,
|
|
184
185
|
isAutoPosition: true,
|
|
185
186
|
width: "100%"
|
|
186
|
-
}, /*#__PURE__*/_react["default"].createElement(_Scrollbar.Scrollbar, {
|
|
187
|
+
}, dropdownHeader, /*#__PURE__*/_react["default"].createElement(_Scrollbar.Scrollbar, {
|
|
187
188
|
maxHeight: scrollbarMaxHeight
|
|
188
|
-
},
|
|
189
|
+
}, scrollbarContent)));
|
|
189
190
|
};
|
package/dist/validate/index.js
CHANGED
|
@@ -36,7 +36,7 @@ var Validate = exports.Validate = /*#__PURE__*/function () {
|
|
|
36
36
|
if (value === '') {
|
|
37
37
|
return true;
|
|
38
38
|
}
|
|
39
|
-
if (value.match(/^(
|
|
39
|
+
if (value.match(/^(http[s\u017F]?:\/\/)?(www\.)?([\x2D0-9A-Za-z\u017F\u0401\u0410-\u044F\u0451\u1C80-\u1C83\u1C85\u1C86\u212A]+\.[A-Za-z\u017F\u0401\u0410-\u044F\u0451\u1C80-\u1C83\u1C85\u1C86\u212A]{2,})(\/(?:(?![\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uD800-\uDFFF\uFEFF])[^]|[\uD800-\uDBFF][\uDC00-\uDFFF])*)?$/i)) {
|
|
40
40
|
return true;
|
|
41
41
|
}
|
|
42
42
|
return createError('Некорректный адрес');
|