@invoicebox/ui 0.1.0-alpha.207 → 0.1.0-alpha.209
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.
|
@@ -11,7 +11,7 @@ export type TGroup = {
|
|
|
11
11
|
id: string;
|
|
12
12
|
entity?: unknown;
|
|
13
13
|
};
|
|
14
|
-
export type TProps<TValue> = Pick<TInputProps, 'label' | 'hasError' | 'placeholder' | 'name' | 'size'> & {
|
|
14
|
+
export type TProps<TValue> = Pick<TInputProps, 'label' | 'hasError' | 'placeholder' | 'name' | 'size' | 'onBlur'> & {
|
|
15
15
|
value: TValue | null;
|
|
16
16
|
onChange: (value: TValue | null) => void;
|
|
17
17
|
options: TOption<TValue>[];
|
|
@@ -26,4 +26,4 @@ export type TProps<TValue> = Pick<TInputProps, 'label' | 'hasError' | 'placehold
|
|
|
26
26
|
emptyOptionsLabel?: string;
|
|
27
27
|
isLoading?: boolean;
|
|
28
28
|
};
|
|
29
|
-
export declare const Select: <TValue extends string | number>({ label, hasError, placeholder, name, value, onChange, options, groups, isResetButtonEnabled, size, renderOption, dropdownHeader, isDrawerOptions, renderGroup, scrollbarMaxHeight, scrollbarHeader, emptyOptionsLabel, isLoading, }: TProps<TValue>) => import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
export declare const Select: <TValue extends string | number>({ label, hasError, placeholder, name, value, onChange, options, groups, isResetButtonEnabled, size, renderOption, dropdownHeader, isDrawerOptions, renderGroup, scrollbarMaxHeight, scrollbarHeader, emptyOptionsLabel, isLoading, onBlur, }: TProps<TValue>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -49,9 +49,12 @@ var Select = exports.Select = function Select(_ref) {
|
|
|
49
49
|
scrollbarMaxHeight = _ref$scrollbarMaxHeig === void 0 ? MAX_LIST_HEIGHT : _ref$scrollbarMaxHeig,
|
|
50
50
|
scrollbarHeader = _ref.scrollbarHeader,
|
|
51
51
|
emptyOptionsLabel = _ref.emptyOptionsLabel,
|
|
52
|
-
isLoading = _ref.isLoading
|
|
52
|
+
isLoading = _ref.isLoading,
|
|
53
|
+
onBlur = _ref.onBlur;
|
|
53
54
|
var palette = (0, _palette.useComponentPalette)('select');
|
|
54
|
-
var _useInputFocus = (0, _useInputFocus2.useInputFocus)(
|
|
55
|
+
var _useInputFocus = (0, _useInputFocus2.useInputFocus)({
|
|
56
|
+
onBlur: onBlur
|
|
57
|
+
}),
|
|
55
58
|
inFocus = _useInputFocus.inFocus,
|
|
56
59
|
focusHandler = _useInputFocus.handleFocus,
|
|
57
60
|
blurHandler = _useInputFocus.handleBlur;
|
package/dist/validate/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TCreateErrorFunc } from './types';
|
|
2
2
|
export declare class Validate {
|
|
3
3
|
static bic(value: string, createError: TCreateErrorFunc): any;
|
|
4
|
-
static website(value: string, createError: TCreateErrorFunc): any;
|
|
4
|
+
static website(value: string, createError: TCreateErrorFunc, isOnlyHttpsFormat?: boolean): any;
|
|
5
5
|
static vatNumber(value: string, countryId: string, createError: TCreateErrorFunc): any;
|
|
6
6
|
static taxRegistrationReasonCode(value: string, createError: TCreateErrorFunc): any;
|
|
7
7
|
static settlementAccount(value: string, bic: string, createError: TCreateErrorFunc): any;
|
package/dist/validate/index.js
CHANGED
|
@@ -32,11 +32,15 @@ var Validate = exports.Validate = /*#__PURE__*/function () {
|
|
|
32
32
|
}
|
|
33
33
|
}, {
|
|
34
34
|
key: "website",
|
|
35
|
-
value: function website(value, createError) {
|
|
35
|
+
value: function website(value, createError, isOnlyHttpsFormat) {
|
|
36
36
|
if (value === '') {
|
|
37
37
|
return true;
|
|
38
38
|
}
|
|
39
|
-
|
|
39
|
+
var basePattern = "(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\\.)*[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9](?::\\d{1,5})?(?:/[\\w\\-.~!$&'()*+,;=:@%/?#]*)?";
|
|
40
|
+
var prefix = isOnlyHttpsFormat ? '^https://' : '^(https://)?';
|
|
41
|
+
var pattern = "".concat(prefix).concat(basePattern, "$");
|
|
42
|
+
var regex = new RegExp(pattern, 'iu');
|
|
43
|
+
if (value.match(regex)) {
|
|
40
44
|
return true;
|
|
41
45
|
}
|
|
42
46
|
return createError('Некорректный адрес');
|