@pisell/materials 1.0.565 → 1.0.566
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/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/preview.js +4 -4
- package/build/lowcode/render/default/view.js +17 -17
- package/build/lowcode/view.js +17 -17
- package/es/components/dataSourceComponents/dataSourceForm/utils.js +2 -2
- package/es/components/dataSourceComponents/fields/Input.Phone/ReadPretty.js +1 -1
- package/es/components/dataSourceComponents/fields/Input.Phone/WithMode.js +1 -1
- package/lib/components/dataSourceComponents/dataSourceForm/utils.js +3 -3
- package/lib/components/dataSourceComponents/fields/Input.Phone/ReadPretty.js +2 -2
- package/lib/components/dataSourceComponents/fields/Input.Phone/WithMode.js +2 -2
- package/package.json +3 -3
|
@@ -19,7 +19,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
19
19
|
import React, { useEffect, useMemo } from 'react';
|
|
20
20
|
import { isArr, isNumber, isString } from '@pisell/utils';
|
|
21
21
|
import classNames from 'classnames';
|
|
22
|
-
import { parsePhoneNumberFromString, isValidPhoneNumber } from 'libphonenumber-js
|
|
22
|
+
import { parsePhoneNumberFromString, isValidPhoneNumber } from 'libphonenumber-js';
|
|
23
23
|
import { getText } from "../../../locales";
|
|
24
24
|
import Form from "../../form";
|
|
25
25
|
import useDataSource from "../hooks/useDataSource";
|
|
@@ -76,7 +76,7 @@ export var formItemNameReverse = function formItemNameReverse(name) {
|
|
|
76
76
|
|
|
77
77
|
// 验证域名
|
|
78
78
|
export var isValidDomain = function isValidDomain(value) {
|
|
79
|
-
return /^(
|
|
79
|
+
return /^(?!.*--)[A-Za-z0-9][A-Za-z0-9-]{0,61}[A-Za-z0-9](\.[A-Za-z]{2,})+$/.test(value);
|
|
80
80
|
};
|
|
81
81
|
|
|
82
82
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { parsePhoneNumberFromString as parsePhoneNumber } from 'libphonenumber-js
|
|
2
|
+
import { parsePhoneNumberFromString as parsePhoneNumber } from 'libphonenumber-js';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import "./ReadPretty.less";
|
|
5
5
|
var ReadPretty = function ReadPretty(_ref) {
|
|
@@ -10,7 +10,7 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
10
10
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
11
11
|
import React, { useState, useEffect, useMemo } from 'react';
|
|
12
12
|
import { Input, Space } from 'antd';
|
|
13
|
-
import { isValidPhoneNumber, parsePhoneNumberFromString } from 'libphonenumber-js
|
|
13
|
+
import { isValidPhoneNumber, parsePhoneNumberFromString } from 'libphonenumber-js';
|
|
14
14
|
import { isNumber } from '@pisell/utils';
|
|
15
15
|
import Select from "../../../select";
|
|
16
16
|
import { useCountries } from "./serve";
|
|
@@ -45,7 +45,7 @@ module.exports = __toCommonJS(utils_exports);
|
|
|
45
45
|
var import_react = __toESM(require("react"));
|
|
46
46
|
var import_utils = require("@pisell/utils");
|
|
47
47
|
var import_classnames = __toESM(require("classnames"));
|
|
48
|
-
var
|
|
48
|
+
var import_libphonenumber_js = require("libphonenumber-js");
|
|
49
49
|
var import_locales = require("../../../locales");
|
|
50
50
|
var import_form = __toESM(require("../../form"));
|
|
51
51
|
var import_useDataSource = __toESM(require("../hooks/useDataSource"));
|
|
@@ -88,7 +88,7 @@ var formItemNameReverse = (name) => {
|
|
|
88
88
|
return name.replace(new RegExp(FORM_ITEM_SPLIT_CHAR, "g"), ".");
|
|
89
89
|
};
|
|
90
90
|
var isValidDomain = (value) => {
|
|
91
|
-
return /^(
|
|
91
|
+
return /^(?!.*--)[A-Za-z0-9][A-Za-z0-9-]{0,61}[A-Za-z0-9](\.[A-Za-z]{2,})+$/.test(value);
|
|
92
92
|
};
|
|
93
93
|
var withFormItem = (WrappedComponent, overlayProps) => {
|
|
94
94
|
return ({
|
|
@@ -188,7 +188,7 @@ var withFormItem = (WrappedComponent, overlayProps) => {
|
|
|
188
188
|
rules.push({
|
|
189
189
|
validator: (_, value) => {
|
|
190
190
|
var _a2;
|
|
191
|
-
return !otherProps.disabled || (0,
|
|
191
|
+
return !otherProps.disabled || (0, import_libphonenumber_js.isValidPhoneNumber)(value) && ((_a2 = (0, import_libphonenumber_js.parsePhoneNumberFromString)(value)) == null ? void 0 : _a2.isValid()) ? Promise.resolve() : Promise.reject(
|
|
192
192
|
new Error(
|
|
193
193
|
typeobj.message || (0, import_locales.getText)("pisell-data-source-form-phone-message")
|
|
194
194
|
)
|
|
@@ -33,7 +33,7 @@ __export(ReadPretty_exports, {
|
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(ReadPretty_exports);
|
|
35
35
|
var import_react = __toESM(require("react"));
|
|
36
|
-
var
|
|
36
|
+
var import_libphonenumber_js = require("libphonenumber-js");
|
|
37
37
|
var import_classnames = __toESM(require("classnames"));
|
|
38
38
|
var import_ReadPretty = require("./ReadPretty.less");
|
|
39
39
|
var ReadPretty = ({
|
|
@@ -46,7 +46,7 @@ var ReadPretty = ({
|
|
|
46
46
|
"pisell-phone-read-pretty-table-view": renderMode === "tableView"
|
|
47
47
|
});
|
|
48
48
|
try {
|
|
49
|
-
const phoneNumber = (0,
|
|
49
|
+
const phoneNumber = (0, import_libphonenumber_js.parsePhoneNumberFromString)(value);
|
|
50
50
|
if (!phoneNumber)
|
|
51
51
|
return /* @__PURE__ */ import_react.default.createElement("span", { className }, value);
|
|
52
52
|
const formattedValue = `(${phoneNumber.formatInternational().split(" ")[0]}) ${phoneNumber.formatNational()}`;
|
|
@@ -34,7 +34,7 @@ __export(WithMode_exports, {
|
|
|
34
34
|
module.exports = __toCommonJS(WithMode_exports);
|
|
35
35
|
var import_react = __toESM(require("react"));
|
|
36
36
|
var import_antd = require("antd");
|
|
37
|
-
var
|
|
37
|
+
var import_libphonenumber_js = require("libphonenumber-js");
|
|
38
38
|
var import_utils = require("@pisell/utils");
|
|
39
39
|
var import_select = __toESM(require("../../../select"));
|
|
40
40
|
var import_serve = require("./serve");
|
|
@@ -104,7 +104,7 @@ var PhoneInput = ({ value: propsValue, onChange, isVerification, disabled, ...pr
|
|
|
104
104
|
if (!phoneNumber || !isVerification) {
|
|
105
105
|
return void 0;
|
|
106
106
|
}
|
|
107
|
-
return (0,
|
|
107
|
+
return (0, import_libphonenumber_js.isValidPhoneNumber)(concatenatedNumber) && ((_a = (0, import_libphonenumber_js.parsePhoneNumberFromString)(concatenatedNumber)) == null ? void 0 : _a.isValid()) ? void 0 : "error";
|
|
108
108
|
}, [concatenatedNumber, phoneNumber, isVerification]);
|
|
109
109
|
return /* @__PURE__ */ import_react.default.createElement(import_antd.Space.Compact, { block: true }, /* @__PURE__ */ import_react.default.createElement(
|
|
110
110
|
import_select.default,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pisell/materials",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.566",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"module": "./es/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -70,8 +70,8 @@
|
|
|
70
70
|
"swiper": "^8.4.7",
|
|
71
71
|
"react-barcode": "^1.5.3",
|
|
72
72
|
"@pisell/date-picker": "1.0.115",
|
|
73
|
-
"@pisell/
|
|
74
|
-
"@pisell/
|
|
73
|
+
"@pisell/icon": "0.0.10",
|
|
74
|
+
"@pisell/utils": "1.0.43"
|
|
75
75
|
},
|
|
76
76
|
"peerDependencies": {
|
|
77
77
|
"react": "^18.0.0",
|