ebaoferc 0.1.5 → 0.1.6
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/FlexRowCol/index.d.ts +1 -0
- package/dist/components/FlexRowCol/index.js +6 -3
- package/dist/components/StyledQueryFilter/index.less +34 -26
- package/dist/components/StyledTable/index.less +17 -17
- package/dist/utils/file/download.d.ts +2 -0
- package/dist/utils/file/download.js +35 -0
- package/dist/utils/file/index.d.ts +1 -0
- package/dist/utils/file/index.js +1 -0
- package/dist/utils/form/index.d.ts +8 -0
- package/dist/utils/form/index.js +15 -1
- package/dist/utils/format/index.d.ts +4 -0
- package/dist/utils/format/index.js +22 -10
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +1 -0
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
var _excluded = ["colProps", "width", "gutter", "collapsedLineCount", "collapsed", "lineCountChange"];
|
|
2
|
+
var _excluded = ["colProps", "width", "maxColCount", "gutter", "collapsedLineCount", "collapsed", "lineCountChange"];
|
|
3
3
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
4
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
5
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
@@ -20,6 +20,7 @@ export default function (props) {
|
|
|
20
20
|
} : _props$colProps,
|
|
21
21
|
_props$width = props.width,
|
|
22
22
|
width = _props$width === void 0 ? 250 : _props$width,
|
|
23
|
+
maxColCount = props.maxColCount,
|
|
23
24
|
_props$gutter = props.gutter,
|
|
24
25
|
gutter = _props$gutter === void 0 ? Gutter : _props$gutter,
|
|
25
26
|
_props$collapsedLineC = props.collapsedLineCount,
|
|
@@ -37,8 +38,10 @@ export default function (props) {
|
|
|
37
38
|
// 包含间隔的宽度
|
|
38
39
|
var itemWidth = width + gapX;
|
|
39
40
|
|
|
40
|
-
//
|
|
41
|
-
var
|
|
41
|
+
// 预估一行能放下的列数
|
|
42
|
+
var preColCount = Math.floor(((size === null || size === void 0 ? void 0 : size.width) || 0) / itemWidth);
|
|
43
|
+
// 实际一行放的列数
|
|
44
|
+
var colCount = maxColCount && preColCount > maxColCount ? maxColCount : preColCount;
|
|
42
45
|
|
|
43
46
|
// 展示的个数
|
|
44
47
|
var renderItemCount = ((_Children$map = Children.map(props.children, function (child) {
|
|
@@ -1,26 +1,34 @@
|
|
|
1
|
-
.custom-styled-query-filter {
|
|
2
|
-
display: flex;
|
|
3
|
-
justify-content: space-between;
|
|
4
|
-
column-gap: 16px;
|
|
5
|
-
|
|
6
|
-
&__form {
|
|
7
|
-
flex: 1;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
&__right {
|
|
11
|
-
display: flex;
|
|
12
|
-
flex-direction: column;
|
|
13
|
-
justify-content: space-between;
|
|
14
|
-
align-items: flex-end;
|
|
15
|
-
|
|
16
|
-
.ant-btn-link {
|
|
17
|
-
padding-right: 0;
|
|
18
|
-
margin-bottom: 28px;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
&__submitter {
|
|
23
|
-
display: flex;
|
|
24
|
-
column-gap: 8px;
|
|
25
|
-
}
|
|
26
|
-
|
|
1
|
+
.custom-styled-query-filter {
|
|
2
|
+
display: flex;
|
|
3
|
+
justify-content: space-between;
|
|
4
|
+
column-gap: 16px;
|
|
5
|
+
|
|
6
|
+
&__form {
|
|
7
|
+
flex: 1;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
&__right {
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
justify-content: space-between;
|
|
14
|
+
align-items: flex-end;
|
|
15
|
+
|
|
16
|
+
.ant-btn-link {
|
|
17
|
+
padding-right: 0;
|
|
18
|
+
margin-bottom: 28px;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&__submitter {
|
|
23
|
+
display: flex;
|
|
24
|
+
column-gap: 8px;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.ant-form-item-no-colon {
|
|
28
|
+
margin-right: 4px;
|
|
29
|
+
|
|
30
|
+
&::after {
|
|
31
|
+
display: none;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
.styled-table-row {
|
|
2
|
-
td {
|
|
3
|
-
padding:
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
&:hover {
|
|
7
|
-
td {
|
|
8
|
-
background-color: #f0f0f0 !important;
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.styled-table-zebra-stripe {
|
|
14
|
-
td {
|
|
15
|
-
background: #f9f9f9 !important;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
1
|
+
.styled-table-row {
|
|
2
|
+
td {
|
|
3
|
+
padding: 12.67px 16px !important;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
&:hover {
|
|
7
|
+
td {
|
|
8
|
+
background-color: #f0f0f0 !important;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.styled-table-zebra-stripe {
|
|
14
|
+
td {
|
|
15
|
+
background: #f9f9f9 !important;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export function downloadFileByBlob(data, fileFullname) {
|
|
2
|
+
if (!window.Blob || !window.URL || !window.URL.createObjectURL) {
|
|
3
|
+
console.error('浏览器不支持 Blob 或 URL.createObjectURL');
|
|
4
|
+
return;
|
|
5
|
+
}
|
|
6
|
+
try {
|
|
7
|
+
var blob = new Blob([data], {
|
|
8
|
+
type: 'application/octet-stream'
|
|
9
|
+
});
|
|
10
|
+
var blobURL = window.URL.createObjectURL(blob);
|
|
11
|
+
var tempLink = document.createElement('a');
|
|
12
|
+
tempLink.style.display = 'none';
|
|
13
|
+
tempLink.href = blobURL;
|
|
14
|
+
tempLink.download = fileFullname;
|
|
15
|
+
document.body.appendChild(tempLink);
|
|
16
|
+
tempLink.click();
|
|
17
|
+
document.body.removeChild(tempLink);
|
|
18
|
+
window.URL.revokeObjectURL(blobURL);
|
|
19
|
+
} catch (error) {
|
|
20
|
+
console.error('下载文件时出错:', error);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
export var downloadFileByLink = function downloadFileByLink(href) {
|
|
24
|
+
try {
|
|
25
|
+
var a = document.createElement('a');
|
|
26
|
+
a.href = href;
|
|
27
|
+
a.download = '';
|
|
28
|
+
a.target = '_blank';
|
|
29
|
+
document.body.appendChild(a);
|
|
30
|
+
a.click();
|
|
31
|
+
document.body.removeChild(a);
|
|
32
|
+
} catch (error) {
|
|
33
|
+
console.error('下载文件时出错:', error);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './download';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./download";
|
|
@@ -4,10 +4,18 @@ export declare const RequiredRules: {
|
|
|
4
4
|
}[];
|
|
5
5
|
required: boolean;
|
|
6
6
|
};
|
|
7
|
+
export declare const LandlineRule: {
|
|
8
|
+
pattern: RegExp;
|
|
9
|
+
message: string;
|
|
10
|
+
};
|
|
7
11
|
export declare const PhoneRule: {
|
|
8
12
|
pattern: RegExp;
|
|
9
13
|
message: string;
|
|
10
14
|
};
|
|
15
|
+
export declare const PhoneAndLandlineRule: {
|
|
16
|
+
pattern: RegExp;
|
|
17
|
+
message: string;
|
|
18
|
+
};
|
|
11
19
|
export declare const IdRule: {
|
|
12
20
|
pattern: RegExp;
|
|
13
21
|
message: string;
|
package/dist/utils/form/index.js
CHANGED
|
@@ -4,10 +4,24 @@ export var RequiredRules = {
|
|
|
4
4
|
}],
|
|
5
5
|
required: true
|
|
6
6
|
};
|
|
7
|
+
var genTelephonePattern = function genTelephonePattern(patterns) {
|
|
8
|
+
return new RegExp("^(".concat(patterns.join('|'), ")$"));
|
|
9
|
+
};
|
|
10
|
+
var LandlinePatternStr = '\\(\\d{3,4}\\)\\s?\\d{7,8}|\\d{3,4}-\\d{7,8}'; // 适应多种座机格式
|
|
11
|
+
var PhonePatternStr = '1[3-9]\\d{9}'; // 手机号的标准格式
|
|
12
|
+
|
|
13
|
+
export var LandlineRule = {
|
|
14
|
+
pattern: genTelephonePattern([LandlinePatternStr]),
|
|
15
|
+
message: '请输入正确的座机号'
|
|
16
|
+
};
|
|
7
17
|
export var PhoneRule = {
|
|
8
|
-
pattern:
|
|
18
|
+
pattern: genTelephonePattern([PhonePatternStr]),
|
|
9
19
|
message: '请输入正确的手机号'
|
|
10
20
|
};
|
|
21
|
+
export var PhoneAndLandlineRule = {
|
|
22
|
+
pattern: genTelephonePattern([PhonePatternStr, LandlinePatternStr]),
|
|
23
|
+
message: '请输入正确的手机号或座机号'
|
|
24
|
+
};
|
|
11
25
|
export var IdRule = {
|
|
12
26
|
pattern: /^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/,
|
|
13
27
|
message: '请输入正确的身份证号码'
|
|
@@ -3,6 +3,10 @@ type AliasMap<T> = {
|
|
|
3
3
|
};
|
|
4
4
|
export declare function resolveAlias<T>(obj: T, aliasMap: AliasMap<T>): Partial<T>;
|
|
5
5
|
export declare function isNullOrUndefined(target: any): boolean;
|
|
6
|
+
type TSingleValueToArrayRes<T> = T extends (infer _U)[] ? T : T extends null | undefined ? [] : T[];
|
|
7
|
+
export declare function singleValueToArray<T>(value: T): TSingleValueToArrayRes<T>;
|
|
8
|
+
type TArrayToSingleValueRes<T> = T extends (infer U)[] ? U : T;
|
|
9
|
+
export declare function arrayToSingleValue<T>(value: T): TArrayToSingleValueRes<T>;
|
|
6
10
|
/**
|
|
7
11
|
* 给对象第一层的字符串属性值做 trim
|
|
8
12
|
*/
|
|
@@ -13,9 +13,21 @@ export function resolveAlias(obj, aliasMap) {
|
|
|
13
13
|
export function isNullOrUndefined(target) {
|
|
14
14
|
return target === null || target === undefined;
|
|
15
15
|
}
|
|
16
|
+
export function singleValueToArray(value) {
|
|
17
|
+
if (Array.isArray(value)) {
|
|
18
|
+
return value;
|
|
19
|
+
}
|
|
20
|
+
return isNullOrUndefined(value) ? [] : [value];
|
|
21
|
+
}
|
|
22
|
+
export function arrayToSingleValue(value) {
|
|
23
|
+
if (Array.isArray(value)) {
|
|
24
|
+
return value === null || value === void 0 ? void 0 : value[0];
|
|
25
|
+
}
|
|
26
|
+
return value;
|
|
27
|
+
}
|
|
16
28
|
|
|
17
|
-
/**
|
|
18
|
-
* 给对象第一层的字符串属性值做 trim
|
|
29
|
+
/**
|
|
30
|
+
* 给对象第一层的字符串属性值做 trim
|
|
19
31
|
*/
|
|
20
32
|
export function trimObjectValuesFirstLayer(obj) {
|
|
21
33
|
var result = {};
|
|
@@ -26,10 +38,10 @@ export function trimObjectValuesFirstLayer(obj) {
|
|
|
26
38
|
}
|
|
27
39
|
return result;
|
|
28
40
|
}
|
|
29
|
-
/**
|
|
30
|
-
* 表格序号
|
|
31
|
-
* @param TableRiwNoType
|
|
32
|
-
* @returns
|
|
41
|
+
/**
|
|
42
|
+
* 表格序号
|
|
43
|
+
* @param TableRiwNoType
|
|
44
|
+
* @returns
|
|
33
45
|
*/
|
|
34
46
|
export function computedTableRowSerialNo(_ref) {
|
|
35
47
|
var pagination = _ref.pagination,
|
|
@@ -43,10 +55,10 @@ export function computedTableRowSerialNo(_ref) {
|
|
|
43
55
|
}
|
|
44
56
|
}
|
|
45
57
|
|
|
46
|
-
/**
|
|
47
|
-
* 对中国手机号进行加密中间四位。
|
|
48
|
-
* @param phoneNumber - 需要加密的手机号
|
|
49
|
-
* @returns 加密后的手机号
|
|
58
|
+
/**
|
|
59
|
+
* 对中国手机号进行加密中间四位。
|
|
60
|
+
* @param phoneNumber - 需要加密的手机号
|
|
61
|
+
* @returns 加密后的手机号
|
|
50
62
|
*/
|
|
51
63
|
export function encryptPhoneNumber(phoneNumber) {
|
|
52
64
|
// 将中间四位替换为星号
|
package/dist/utils/index.d.ts
CHANGED
package/dist/utils/index.js
CHANGED