prom-pal-ui 1.2.8 → 1.3.3
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/build/components/cjs/index.js +9036 -8668
- package/build/components/esm/index.js +8996 -8653
- package/build/function/cjs/index.js +64 -5
- package/build/function/esm/index.js +60 -1
- package/build/types/components/form/fields/input.d.ts +2 -0
- package/build/types/components/form/index.d.ts +2 -1
- package/build/types/components/form/rules/allowed-pattern.d.ts +7 -0
- package/build/types/components/form/rules/index.d.ts +2 -2
- package/build/types/components/form/rules/mask.d.ts +6 -0
- package/build/types/components/form/schema/index.d.ts +2 -0
- package/build/types/components/form/schema/schema-msg.d.ts +5 -0
- package/build/types/components/form/schema/schema.d.ts +3 -0
- package/build/types/components/index.d.ts +1 -1
- package/build/types/components/ui/index.d.ts +5 -0
- package/build/types/components/ui/switch.d.ts +2 -2
- package/package.json +5 -6
|
@@ -1,16 +1,75 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var tslib = require('tslib');
|
|
4
3
|
var react = require('react');
|
|
5
4
|
|
|
5
|
+
/******************************************************************************
|
|
6
|
+
Copyright (c) Microsoft Corporation.
|
|
7
|
+
|
|
8
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
9
|
+
purpose with or without fee is hereby granted.
|
|
10
|
+
|
|
11
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
12
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
13
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
14
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
15
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
16
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
17
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
18
|
+
***************************************************************************** */
|
|
19
|
+
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
23
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
24
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
25
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
26
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
27
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
28
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function __generator(thisArg, body) {
|
|
33
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
34
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
35
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
36
|
+
function step(op) {
|
|
37
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
38
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
39
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
40
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
41
|
+
switch (op[0]) {
|
|
42
|
+
case 0: case 1: t = op; break;
|
|
43
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
44
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
45
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
46
|
+
default:
|
|
47
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
48
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
49
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
50
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
51
|
+
if (t[2]) _.ops.pop();
|
|
52
|
+
_.trys.pop(); continue;
|
|
53
|
+
}
|
|
54
|
+
op = body.call(thisArg, _);
|
|
55
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
56
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
61
|
+
var e = new Error(message);
|
|
62
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
63
|
+
};
|
|
64
|
+
|
|
6
65
|
var usePromPromiseQuery = function (fetchFn) {
|
|
7
66
|
var _a = react.useState(null), data = _a[0], setData = _a[1];
|
|
8
67
|
var _b = react.useState(true), loading = _b[0], setLoading = _b[1];
|
|
9
68
|
var _c = react.useState(null), error = _c[0], setError = _c[1];
|
|
10
69
|
var lastFnRef = react.useRef(undefined);
|
|
11
|
-
var execute = react.useCallback(function (fn) { return
|
|
70
|
+
var execute = react.useCallback(function (fn) { return __awaiter(void 0, void 0, void 0, function () {
|
|
12
71
|
var functionToExecute, result, err_1;
|
|
13
|
-
return
|
|
72
|
+
return __generator(this, function (_a) {
|
|
14
73
|
switch (_a.label) {
|
|
15
74
|
case 0:
|
|
16
75
|
setLoading(true);
|
|
@@ -46,8 +105,8 @@ var usePromPromiseQuery = function (fetchFn) {
|
|
|
46
105
|
execute(fetchFn);
|
|
47
106
|
}
|
|
48
107
|
}, []);
|
|
49
|
-
var onRefetch = react.useCallback(function () { return
|
|
50
|
-
return
|
|
108
|
+
var onRefetch = react.useCallback(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
109
|
+
return __generator(this, function (_a) {
|
|
51
110
|
switch (_a.label) {
|
|
52
111
|
case 0:
|
|
53
112
|
if (!lastFnRef.current) {
|
|
@@ -1,6 +1,65 @@
|
|
|
1
|
-
import { __awaiter, __generator } from 'tslib';
|
|
2
1
|
import { useState, useRef, useCallback, useEffect } from 'react';
|
|
3
2
|
|
|
3
|
+
/******************************************************************************
|
|
4
|
+
Copyright (c) Microsoft Corporation.
|
|
5
|
+
|
|
6
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
7
|
+
purpose with or without fee is hereby granted.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
10
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
11
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
12
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
13
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
14
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
15
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
16
|
+
***************************************************************************** */
|
|
17
|
+
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
21
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
22
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
23
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
24
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
25
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
26
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function __generator(thisArg, body) {
|
|
31
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
32
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
33
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
34
|
+
function step(op) {
|
|
35
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
36
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
37
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
38
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
39
|
+
switch (op[0]) {
|
|
40
|
+
case 0: case 1: t = op; break;
|
|
41
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
42
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
43
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
44
|
+
default:
|
|
45
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
46
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
47
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
48
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
49
|
+
if (t[2]) _.ops.pop();
|
|
50
|
+
_.trys.pop(); continue;
|
|
51
|
+
}
|
|
52
|
+
op = body.call(thisArg, _);
|
|
53
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
54
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
59
|
+
var e = new Error(message);
|
|
60
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
61
|
+
};
|
|
62
|
+
|
|
4
63
|
var usePromPromiseQuery = function (fetchFn) {
|
|
5
64
|
var _a = useState(null), data = _a[0], setData = _a[1];
|
|
6
65
|
var _b = useState(true), loading = _b[0], setLoading = _b[1];
|
|
@@ -3,6 +3,8 @@ import { PromComponentProps, PromStyle } from "../../types";
|
|
|
3
3
|
interface PromInputProps extends PromComponentProps, PromStyle, Omit<React.ComponentProps<"input">, "name"> {
|
|
4
4
|
name: string;
|
|
5
5
|
label?: string;
|
|
6
|
+
allowedPattern?: RegExp;
|
|
7
|
+
mask?: (e: string) => string;
|
|
6
8
|
}
|
|
7
9
|
declare const PromInput: FC<PromInputProps>;
|
|
8
10
|
export { PromInput };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
declare const promAllowedPatternUrlSocial: RegExp;
|
|
2
|
+
declare const promAllowedPatternOnlyRu: RegExp;
|
|
3
|
+
declare const promAllowedPatternPhone: RegExp;
|
|
4
|
+
declare const promAllowedPatternPhoneWithoutPlus: RegExp;
|
|
5
|
+
declare const promAllowedPatternEmail: RegExp;
|
|
6
|
+
declare const promAllowedPatternNaturalNumbers: RegExp;
|
|
7
|
+
export { promAllowedPatternEmail, promAllowedPatternPhone, promAllowedPatternOnlyRu, promAllowedPatternUrlSocial, promAllowedPatternNaturalNumbers, promAllowedPatternPhoneWithoutPlus, };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "./
|
|
2
|
-
export * from "./
|
|
1
|
+
export * from "./allowed-pattern";
|
|
2
|
+
export * from "./mask";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
declare const promMaskTelegram: (val: string) => string;
|
|
2
|
+
declare const promMaskWhatsapp: (val: string) => string;
|
|
3
|
+
declare const promMaskPhone: (val: string) => string;
|
|
4
|
+
declare const promMaskPhoneWithoutPlus: (val: string) => string;
|
|
5
|
+
declare const promMaskEmail: (val: string) => string;
|
|
6
|
+
export { promMaskEmail, promMaskPhone, promMaskTelegram, promMaskWhatsapp, promMaskPhoneWithoutPlus, };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from "./form";
|
|
2
|
-
export
|
|
2
|
+
export * from "./ui";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as Switch from "@radix-ui/react-switch";
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
declare const PromSwitch: React.ForwardRefExoticComponent<Omit<
|
|
3
|
+
declare const PromSwitch: React.ForwardRefExoticComponent<Omit<Switch.SwitchProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
4
4
|
export { PromSwitch };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "prom-pal-ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "build/cjs/index.js",
|
|
6
6
|
"module": "build/esm/index.js",
|
|
@@ -10,14 +10,14 @@
|
|
|
10
10
|
],
|
|
11
11
|
"exports": {
|
|
12
12
|
".": {
|
|
13
|
-
"import": "./build/
|
|
14
|
-
"require": "./build/
|
|
15
|
-
"types": "./build/types/index.d.ts"
|
|
13
|
+
"import": "./build/components/esm/index.js",
|
|
14
|
+
"require": "./build/components/cjs/index.js",
|
|
15
|
+
"types": "./build/types/components/index.d.ts"
|
|
16
16
|
},
|
|
17
17
|
"./function": {
|
|
18
18
|
"import": "./build/function/esm/index.js",
|
|
19
19
|
"require": "./build/function/cjs/index.js",
|
|
20
|
-
"types": "./build/types/index.d.ts"
|
|
20
|
+
"types": "./build/types/function/index.d.ts"
|
|
21
21
|
}
|
|
22
22
|
},
|
|
23
23
|
"publishConfig": {
|
|
@@ -36,7 +36,6 @@
|
|
|
36
36
|
"@radix-ui/react-label": "^2.1.8",
|
|
37
37
|
"@radix-ui/react-select": "^2.2.6",
|
|
38
38
|
"@radix-ui/react-slot": "^1.2.4",
|
|
39
|
-
"@radix-ui/react-switch": "^1.2.6",
|
|
40
39
|
"@rollup/plugin-commonjs": "^29.0.0",
|
|
41
40
|
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
42
41
|
"@rollup/plugin-typescript": "^12.3.0",
|