@ccs-ui/rc-pro 1.2.0-beta-2 → 1.2.0-beta-4
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/es/cascader/index.js +1 -1
- package/es/date-picker/index.js +1 -1
- package/es/dialog/DialogRequestButton.d.ts +1 -1
- package/es/dialog/DialogRequestButton.js +2 -1
- package/es/dialog/DialogSelfOkButton.d.ts +1 -1
- package/es/dialog/DialogSelfOkButton.js +2 -1
- package/es/dialog/button.js +2 -1
- package/es/dialog/hook.js +2 -3
- package/es/hooks/use-event.js +3 -3
- package/es/index.d.ts +0 -1
- package/es/index.js +0 -1
- package/es/interval-button/index.js +1 -1
- package/es/layout-keep-alive/index.js +1 -1
- package/es/pro-table/_utils.js +1 -1
- package/es/pro-table/head.js +18 -15
- package/es/pro-table/table.js +2 -1
- package/es/pro-table/tree.js +2 -1
- package/es/select/index.js +1 -1
- package/es/theme-dialog.d.ts +2 -2
- package/es/theme-dialog.js +26 -22
- package/es/time-picker/index.js +1 -1
- package/es/trigger/index.d.ts +1 -1
- package/es/trigger/index.js +4 -5
- package/package.json +13 -5
- package/es/utils/index.d.ts +0 -105
- package/es/utils/index.js +0 -241
package/es/cascader/index.js
CHANGED
|
@@ -12,7 +12,7 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
12
12
|
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; }
|
|
13
13
|
import { useRequest } from 'ahooks';
|
|
14
14
|
import { Cascader } from 'antd';
|
|
15
|
-
import _isArray from 'lodash
|
|
15
|
+
import _isArray from 'lodash.isarray';
|
|
16
16
|
import { useEffect } from 'react';
|
|
17
17
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
18
18
|
/**
|
package/es/date-picker/index.js
CHANGED
|
@@ -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 { DatePicker } from 'antd';
|
|
12
12
|
import dayjs from 'dayjs';
|
|
13
|
-
import _isArray from 'lodash
|
|
13
|
+
import _isArray from 'lodash.isarray';
|
|
14
14
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
15
|
function CcsDatePicker(_ref) {
|
|
16
16
|
var value = _ref.value,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FormProps } from 'antd';
|
|
2
2
|
import { DialogFormRef } from './form';
|
|
3
3
|
import { CcsDialogModalProps } from './hook';
|
|
4
|
-
declare const DialogRequestButton: ({ auth, formRef, extraBtn, formInitialValues, request, onCancel, onRequestBefore, }: Pick<CcsDialogModalProps, "auth" | "
|
|
4
|
+
declare const DialogRequestButton: ({ auth, formRef, extraBtn, formInitialValues, request, onCancel, onRequestBefore, }: Pick<CcsDialogModalProps, "auth" | "onCancel" | "extraBtn" | "request" | "onRequestBefore"> & {
|
|
5
5
|
formRef: React.RefObject<DialogFormRef>;
|
|
6
6
|
formInitialValues: FormProps['initialValues'];
|
|
7
7
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -10,9 +10,10 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
10
10
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
11
11
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
12
12
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
|
+
import CcsUtils from '@ccs-ui/utils';
|
|
13
14
|
import { Button } from 'antd';
|
|
14
15
|
import { useState } from 'react';
|
|
15
|
-
import { CcsAuth, CcsDialog
|
|
16
|
+
import { CcsAuth, CcsDialog } from '..';
|
|
16
17
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
18
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
18
19
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FormProps } from 'antd';
|
|
2
2
|
import { DialogFormRef } from './form';
|
|
3
3
|
import { CcsDialogModalProps } from './hook';
|
|
4
|
-
declare const DialogSelfOkButton: ({ auth, formRef, extraBtn, formInitialValues, onCancel, onOk, }: Pick<CcsDialogModalProps, "auth" | "
|
|
4
|
+
declare const DialogSelfOkButton: ({ auth, formRef, extraBtn, formInitialValues, onCancel, onOk, }: Pick<CcsDialogModalProps, "auth" | "onOk" | "onCancel" | "extraBtn"> & {
|
|
5
5
|
formRef: React.RefObject<DialogFormRef>;
|
|
6
6
|
formInitialValues: FormProps['initialValues'];
|
|
7
7
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -4,8 +4,9 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
4
4
|
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; }
|
|
5
5
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
6
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
import CcsUtils from '@ccs-ui/utils';
|
|
7
8
|
import { Button } from 'antd';
|
|
8
|
-
import { CcsAuth
|
|
9
|
+
import { CcsAuth } from '..';
|
|
9
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
11
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
11
12
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
package/es/dialog/button.js
CHANGED
|
@@ -10,7 +10,8 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
10
10
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
11
11
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
12
12
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
|
-
import { CcsAuth
|
|
13
|
+
import { CcsAuth } from "./..";
|
|
14
|
+
import CcsUtils from '@ccs-ui/utils';
|
|
14
15
|
import { Button, Form } from 'antd';
|
|
15
16
|
import React, { useEffect, useImperativeHandle, useRef, useState } from 'react';
|
|
16
17
|
import CcsDialog from '.';
|
package/es/dialog/hook.js
CHANGED
|
@@ -9,11 +9,10 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
9
9
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
10
10
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
11
11
|
/* eslint-disable @typescript-eslint/ban-types */
|
|
12
|
-
|
|
13
|
-
import _debounce from 'lodash
|
|
12
|
+
import CcsUtils from '@ccs-ui/utils';
|
|
13
|
+
import _debounce from 'lodash.debounce';
|
|
14
14
|
import React from 'react';
|
|
15
15
|
import { createRoot } from 'react-dom/client';
|
|
16
|
-
import { CcsUtils } from '..';
|
|
17
16
|
import HookDrawer from "./HookDrawer";
|
|
18
17
|
import HookModal from "./HookModal";
|
|
19
18
|
import usePatchElement from "./usePatchElement";
|
package/es/hooks/use-event.js
CHANGED
|
@@ -5,9 +5,9 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
|
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; }
|
|
6
6
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
7
7
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
8
|
+
import _cloneDeep from 'lodash.clonedeep';
|
|
9
|
+
import _uniqueId from 'lodash.uniqueid';
|
|
10
|
+
import { useEffect, useRef } from 'react';
|
|
11
11
|
export var EventInstance = /*#__PURE__*/_createClass(function EventInstance() {
|
|
12
12
|
var _this = this;
|
|
13
13
|
_classCallCheck(this, EventInstance);
|
package/es/index.d.ts
CHANGED
|
@@ -29,7 +29,6 @@ export { default as CcsAppTheme } from './theme';
|
|
|
29
29
|
export { default as CcsTimePicker } from './time-picker';
|
|
30
30
|
export { default as CcsTrigger } from './trigger';
|
|
31
31
|
export { default as CcsUpload } from './upload';
|
|
32
|
-
export { default as CcsUtils } from './utils';
|
|
33
32
|
export { default as CcsVirtualList } from './virtual-list';
|
|
34
33
|
export { default as CcsWaterMark } from './water-mark';
|
|
35
34
|
import * as CCS from './ccs';
|
package/es/index.js
CHANGED
|
@@ -29,7 +29,6 @@ export { default as CcsAppTheme } from "./theme";
|
|
|
29
29
|
export { default as CcsTimePicker } from "./time-picker";
|
|
30
30
|
export { default as CcsTrigger } from "./trigger";
|
|
31
31
|
export { default as CcsUpload } from "./upload";
|
|
32
|
-
export { default as CcsUtils } from "./utils";
|
|
33
32
|
export { default as CcsVirtualList } from "./virtual-list";
|
|
34
33
|
export { default as CcsWaterMark } from "./water-mark";
|
|
35
34
|
import * as CCS from "./ccs";
|
|
@@ -16,10 +16,10 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
|
16
16
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
17
17
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
18
18
|
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; }
|
|
19
|
+
import CcsUtils from '@ccs-ui/utils';
|
|
19
20
|
import { useInterval } from 'ahooks';
|
|
20
21
|
import { Button } from 'antd';
|
|
21
22
|
import { forwardRef, useImperativeHandle, useLayoutEffect, useMemo, useState } from 'react';
|
|
22
|
-
import { CcsUtils } from "../";
|
|
23
23
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
24
|
/**
|
|
25
25
|
* 倒计时按钮组件
|
|
@@ -12,13 +12,13 @@ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyri
|
|
|
12
12
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
13
13
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
14
14
|
import { MoreOutlined } from '@ant-design/icons';
|
|
15
|
+
import CcsUtils from '@ccs-ui/utils';
|
|
15
16
|
import { useUpdate, useUpdateEffect } from 'ahooks';
|
|
16
17
|
import { Button, Dropdown, Empty, Tabs, theme } from 'antd';
|
|
17
18
|
import classnames from 'classnames';
|
|
18
19
|
import { useMemo, useRef } from 'react';
|
|
19
20
|
import { useLocation } from 'react-router';
|
|
20
21
|
import { useOutlet } from 'react-router-dom';
|
|
21
|
-
import { CcsUtils } from '..';
|
|
22
22
|
import "./index.less";
|
|
23
23
|
import Page from "./page";
|
|
24
24
|
import { jsx as _jsx } from "react/jsx-runtime";
|
package/es/pro-table/_utils.js
CHANGED
package/es/pro-table/head.js
CHANGED
|
@@ -7,7 +7,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
7
7
|
import { DownOutlined, UpOutlined } from '@ant-design/icons';
|
|
8
8
|
import { useUpdateEffect } from 'ahooks';
|
|
9
9
|
import { Button, Card, Form } from 'antd';
|
|
10
|
-
import _debounce from 'lodash
|
|
10
|
+
import _debounce from 'lodash.debounce';
|
|
11
11
|
import React, { useMemo, useRef, useState } from 'react';
|
|
12
12
|
import { CcsResizeObserver } from '..';
|
|
13
13
|
import { getShowDpends } from "./_utils";
|
|
@@ -17,7 +17,6 @@ import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
17
17
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
18
18
|
/** 操作按钮、查询,重置、列筛选、 */
|
|
19
19
|
function HeadComponent(_ref) {
|
|
20
|
-
var _formItemsRef$current;
|
|
21
20
|
var form = _ref.form,
|
|
22
21
|
title = _ref.title,
|
|
23
22
|
toolbar = _ref.toolbar,
|
|
@@ -37,9 +36,10 @@ function HeadComponent(_ref) {
|
|
|
37
36
|
_useState2 = _slicedToArray(_useState, 2),
|
|
38
37
|
isExpand = _useState2[0],
|
|
39
38
|
setIsExpand = _useState2[1];
|
|
40
|
-
var _useState3 = useState(
|
|
39
|
+
var _useState3 = useState(false),
|
|
41
40
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
42
|
-
|
|
41
|
+
hasMore = _useState4[0],
|
|
42
|
+
setHasMore = _useState4[1];
|
|
43
43
|
useUpdateEffect(function () {
|
|
44
44
|
setIsExpand(expandForm);
|
|
45
45
|
}, [expandForm]);
|
|
@@ -58,7 +58,20 @@ function HeadComponent(_ref) {
|
|
|
58
58
|
// 查询条件记录数
|
|
59
59
|
var itemLen = allFormItems.length;
|
|
60
60
|
var hasItem = itemLen > 0;
|
|
61
|
-
|
|
61
|
+
|
|
62
|
+
// 尺寸变化重设尺寸
|
|
63
|
+
var resizeFn = _debounce(function (hm) {
|
|
64
|
+
setHasMore(hm);
|
|
65
|
+
}, 500);
|
|
66
|
+
|
|
67
|
+
// 监听dom尺寸变化
|
|
68
|
+
var onResize = function onResize() {
|
|
69
|
+
var _formItemsRef$current;
|
|
70
|
+
var scrollHeight = ((_formItemsRef$current = formItemsRef.current) === null || _formItemsRef$current === void 0 ? void 0 : _formItemsRef$current.scrollHeight) || 0;
|
|
71
|
+
if (scrollHeight === 0) return;
|
|
72
|
+
var hm = scrollHeight > 40;
|
|
73
|
+
if (hm !== hasMore) resizeFn(hm);
|
|
74
|
+
};
|
|
62
75
|
|
|
63
76
|
// 操作按钮
|
|
64
77
|
var renderSearchBtn = /*#__PURE__*/_jsxs("div", {
|
|
@@ -140,16 +153,6 @@ function HeadComponent(_ref) {
|
|
|
140
153
|
}, item.name);
|
|
141
154
|
});
|
|
142
155
|
};
|
|
143
|
-
|
|
144
|
-
// 尺寸变化重设尺寸
|
|
145
|
-
var resizeFn = _debounce(function () {
|
|
146
|
-
update({});
|
|
147
|
-
}, 500);
|
|
148
|
-
|
|
149
|
-
// 监听dom尺寸变化
|
|
150
|
-
var onResize = function onResize() {
|
|
151
|
-
resizeFn();
|
|
152
|
-
};
|
|
153
156
|
var formStyles = {
|
|
154
157
|
flexWrap: isExpand ? 'wrap' : 'nowrap'
|
|
155
158
|
};
|
package/es/pro-table/table.js
CHANGED
|
@@ -13,11 +13,12 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
13
13
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
14
14
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
15
15
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
16
|
+
import CcsUtils from '@ccs-ui/utils';
|
|
16
17
|
import { useUpdateEffect } from 'ahooks';
|
|
17
18
|
import { Empty, Form, theme } from 'antd';
|
|
18
19
|
import classNames from 'classnames';
|
|
19
20
|
import React, { useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';
|
|
20
|
-
import {
|
|
21
|
+
import { CcsWaterMark } from '..';
|
|
21
22
|
import { useCcsPage } from "../";
|
|
22
23
|
import CcsTable from "../table";
|
|
23
24
|
import { getAllChildrenId, getDataById, onTableInModalOrDrawer, onTableInTabItem } from "./_utils";
|
package/es/pro-table/tree.js
CHANGED
|
@@ -17,8 +17,9 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
17
17
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
18
18
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
19
19
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
20
|
+
import CcsUtils from '@ccs-ui/utils';
|
|
20
21
|
import { useImperativeHandle, useState } from 'react';
|
|
21
|
-
import { CcsTable
|
|
22
|
+
import { CcsTable } from '..';
|
|
22
23
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
23
24
|
var TableTree = function TableTree(_ref) {
|
|
24
25
|
var data = _ref.data,
|
package/es/select/index.js
CHANGED
|
@@ -12,7 +12,7 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
12
12
|
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; }
|
|
13
13
|
import { useRequest } from 'ahooks';
|
|
14
14
|
import { Select } from 'antd';
|
|
15
|
-
import _isArray from 'lodash
|
|
15
|
+
import _isArray from 'lodash.isarray';
|
|
16
16
|
import { useEffect } from 'react';
|
|
17
17
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
18
18
|
/**
|
package/es/theme-dialog.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="lodash" />
|
|
2
1
|
import { MessageInstance } from 'antd/es/message/interface';
|
|
3
2
|
import { HookAPI } from 'antd/es/modal/useModal';
|
|
4
3
|
import { NotificationInstance } from 'antd/es/notification/interface';
|
|
@@ -15,10 +14,11 @@ export default class ThemeDialog {
|
|
|
15
14
|
* @param failText // 失败提示
|
|
16
15
|
*/
|
|
17
16
|
static easyMessage(result: CCS.HttpResult, successText?: string, failText?: string): void;
|
|
17
|
+
static confirm(content?: string): Promise<boolean>;
|
|
18
18
|
/**
|
|
19
19
|
* 确认提示框
|
|
20
20
|
* @param content
|
|
21
21
|
* @returns
|
|
22
22
|
*/
|
|
23
|
-
static easyConfirm:
|
|
23
|
+
static easyConfirm: typeof this.confirm;
|
|
24
24
|
}
|
package/es/theme-dialog.js
CHANGED
|
@@ -7,7 +7,7 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
|
|
|
7
7
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
8
8
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
9
9
|
import { message, Modal } from 'antd';
|
|
10
|
-
import _debounce from 'lodash
|
|
10
|
+
import _debounce from 'lodash.debounce';
|
|
11
11
|
var ThemeDialog = /*#__PURE__*/function () {
|
|
12
12
|
function ThemeDialog() {
|
|
13
13
|
_classCallCheck(this, ThemeDialog);
|
|
@@ -37,6 +37,30 @@ var ThemeDialog = /*#__PURE__*/function () {
|
|
|
37
37
|
msg.error(failText || (result === null || result === void 0 ? void 0 : result.msg) || '操作失败');
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
+
}, {
|
|
41
|
+
key: "confirm",
|
|
42
|
+
value: function confirm() {
|
|
43
|
+
var _this = this;
|
|
44
|
+
var content = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
45
|
+
return new Promise(function (resolve) {
|
|
46
|
+
var _this$modal;
|
|
47
|
+
var mod = (_this$modal = _this.modal) !== null && _this$modal !== void 0 ? _this$modal : Modal;
|
|
48
|
+
mod.confirm({
|
|
49
|
+
title: '操作确认',
|
|
50
|
+
content: content,
|
|
51
|
+
okText: '确定',
|
|
52
|
+
okType: 'danger',
|
|
53
|
+
cancelText: '取消',
|
|
54
|
+
centered: true,
|
|
55
|
+
onOk: function onOk() {
|
|
56
|
+
resolve(true);
|
|
57
|
+
},
|
|
58
|
+
onCancel: function onCancel() {
|
|
59
|
+
resolve(false);
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
}
|
|
40
64
|
|
|
41
65
|
/**
|
|
42
66
|
* 确认提示框
|
|
@@ -50,27 +74,7 @@ _class = ThemeDialog;
|
|
|
50
74
|
_defineProperty(ThemeDialog, "message", void 0);
|
|
51
75
|
_defineProperty(ThemeDialog, "notice", void 0);
|
|
52
76
|
_defineProperty(ThemeDialog, "modal", void 0);
|
|
53
|
-
_defineProperty(ThemeDialog, "easyConfirm", _debounce(
|
|
54
|
-
var content = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
55
|
-
return new Promise(function (resolve) {
|
|
56
|
-
var _class$modal;
|
|
57
|
-
var mod = (_class$modal = _class.modal) !== null && _class$modal !== void 0 ? _class$modal : Modal;
|
|
58
|
-
mod.confirm({
|
|
59
|
-
title: '操作确认',
|
|
60
|
-
content: content,
|
|
61
|
-
okText: '确定',
|
|
62
|
-
okType: 'danger',
|
|
63
|
-
cancelText: '取消',
|
|
64
|
-
centered: true,
|
|
65
|
-
onOk: function onOk() {
|
|
66
|
-
resolve(true);
|
|
67
|
-
},
|
|
68
|
-
onCancel: function onCancel() {
|
|
69
|
-
resolve(false);
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
});
|
|
73
|
-
}, 500, {
|
|
77
|
+
_defineProperty(ThemeDialog, "easyConfirm", _debounce(_class.confirm, 500, {
|
|
74
78
|
leading: true,
|
|
75
79
|
trailing: false
|
|
76
80
|
}));
|
package/es/time-picker/index.js
CHANGED
|
@@ -11,7 +11,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
11
11
|
import { TimePicker } from 'antd';
|
|
12
12
|
import dayjs from 'dayjs';
|
|
13
13
|
import customParseFormat from 'dayjs/plugin/customParseFormat';
|
|
14
|
-
import _isArray from 'lodash
|
|
14
|
+
import _isArray from 'lodash.isarray';
|
|
15
15
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
16
|
dayjs.extend(customParseFormat);
|
|
17
17
|
function CcsDatePicker(_ref) {
|
package/es/trigger/index.d.ts
CHANGED
package/es/trigger/index.js
CHANGED
|
@@ -13,14 +13,13 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
|
13
13
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
14
14
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
15
15
|
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; }
|
|
16
|
-
import { ConfigProvider, Input, Spin } from 'antd';
|
|
17
|
-
import Trigger from 'rc-trigger';
|
|
18
|
-
import { cloneElement, useEffect, useMemo, useRef, useState } from 'react';
|
|
19
|
-
// import _isPlainObject from 'lodash/isPlainObject';
|
|
20
16
|
import { CloseCircleFilled, DownOutlined } from '@ant-design/icons';
|
|
21
17
|
import { useDebounceFn, useEventListener, useUpdate } from 'ahooks';
|
|
18
|
+
import { ConfigProvider, Input, Spin } from 'antd';
|
|
22
19
|
import zhCN from 'antd/locale/zh_CN';
|
|
23
|
-
import _isNil from 'lodash
|
|
20
|
+
import _isNil from 'lodash.isnil';
|
|
21
|
+
import Trigger from 'rc-trigger';
|
|
22
|
+
import { cloneElement, useEffect, useMemo, useRef, useState } from 'react';
|
|
24
23
|
import "./index.less";
|
|
25
24
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
26
25
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ccs-ui/rc-pro",
|
|
3
|
-
"version": "1.2.0-beta-
|
|
4
|
-
"description": "验证码组件兼容暗黑模式;proTable封装rowselection代码;proTable添加自适应布局模式;CcsDialog不适应contextHolder
|
|
3
|
+
"version": "1.2.0-beta-4",
|
|
4
|
+
"description": "验证码组件兼容暗黑模式;proTable封装rowselection代码;proTable添加自适应布局模式;CcsDialog不适应contextHolder也能打开;移除utils,独立存在@ccs-ui/utils。",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Hong",
|
|
@@ -53,6 +53,7 @@
|
|
|
53
53
|
"dependencies": {
|
|
54
54
|
"@ant-design/compatible": "^5.1.2",
|
|
55
55
|
"@ant-design/icons": "^5.1.4",
|
|
56
|
+
"@ccs-ui/utils": "^0.0.2",
|
|
56
57
|
"@codemirror/lang-javascript": "^6.2.2",
|
|
57
58
|
"@codemirror/lang-json": "^6.0.1",
|
|
58
59
|
"@codemirror/lang-sql": "^6.7.0",
|
|
@@ -67,7 +68,11 @@
|
|
|
67
68
|
"immutability-helper": "^3.1.1",
|
|
68
69
|
"js-base64": "^3.7.5",
|
|
69
70
|
"localforage": "^1.10.0",
|
|
70
|
-
"lodash": "^4.
|
|
71
|
+
"lodash.clonedeep": "^4.5.0",
|
|
72
|
+
"lodash.debounce": "^4.0.8",
|
|
73
|
+
"lodash.isarray": "^4.0.0",
|
|
74
|
+
"lodash.isnil": "^4.0.0",
|
|
75
|
+
"lodash.uniqueid": "^4.0.1",
|
|
71
76
|
"rc-menu": "^9.15.1",
|
|
72
77
|
"rc-trigger": "^5.3.4",
|
|
73
78
|
"rc-util": "^5.32.4",
|
|
@@ -84,7 +89,11 @@
|
|
|
84
89
|
"devDependencies": {
|
|
85
90
|
"@commitlint/cli": "^17.1.2",
|
|
86
91
|
"@commitlint/config-conventional": "^17.1.0",
|
|
87
|
-
"@types/lodash": "^4.
|
|
92
|
+
"@types/lodash.clonedeep": "^4.5.9",
|
|
93
|
+
"@types/lodash.debounce": "^4.0.9",
|
|
94
|
+
"@types/lodash.isarray": "^4.0.9",
|
|
95
|
+
"@types/lodash.isnil": "^4.0.9",
|
|
96
|
+
"@types/lodash.uniqueid": "^4.0.9",
|
|
88
97
|
"@types/react": "^18.0.0",
|
|
89
98
|
"@types/react-color": "^3.0.6",
|
|
90
99
|
"@types/react-custom-scrollbars": "^4.0.10",
|
|
@@ -92,7 +101,6 @@
|
|
|
92
101
|
"@types/react-lines-ellipsis": "^0.15.6",
|
|
93
102
|
"@types/react-resizable": "^3.0.7",
|
|
94
103
|
"@types/shortid": "^0.0.29",
|
|
95
|
-
"@types/throttle-debounce": "^5.0.2",
|
|
96
104
|
"@umijs/lint": "^4.0.0",
|
|
97
105
|
"cross-env": "^7.0.3",
|
|
98
106
|
"dumi": "^2.2.0",
|
package/es/utils/index.d.ts
DELETED
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import dayjs from 'dayjs';
|
|
2
|
-
type DayjsType = dayjs.Dayjs & {
|
|
3
|
-
fromNow(withoutSuffix?: boolean): string;
|
|
4
|
-
from(compared: dayjs.ConfigType, withoutSuffix?: boolean): string;
|
|
5
|
-
toNow(withoutSuffix?: boolean): string;
|
|
6
|
-
to(compared: dayjs.ConfigType, withoutSuffix?: boolean): string;
|
|
7
|
-
};
|
|
8
|
-
export default class utils {
|
|
9
|
-
/**
|
|
10
|
-
* 是函数?
|
|
11
|
-
* @param obj
|
|
12
|
-
* @returns
|
|
13
|
-
*/
|
|
14
|
-
static isFunction(obj: any): obj is Function;
|
|
15
|
-
/**
|
|
16
|
-
* 获取stroage
|
|
17
|
-
* @param key
|
|
18
|
-
* @returns
|
|
19
|
-
*/
|
|
20
|
-
static getStroage(key: string): Promise<unknown>;
|
|
21
|
-
/**
|
|
22
|
-
* 设置stroage
|
|
23
|
-
* @param key
|
|
24
|
-
* @param value
|
|
25
|
-
* @returns
|
|
26
|
-
*/
|
|
27
|
-
static setStroage(key: string, value: any): Promise<any>;
|
|
28
|
-
/** 删除stroage */
|
|
29
|
-
static removeStroage(key: string): Promise<void>;
|
|
30
|
-
static showLogWarning(message: string): void;
|
|
31
|
-
/**
|
|
32
|
-
* 开发环境抛警告
|
|
33
|
-
* @param valid
|
|
34
|
-
* @param message
|
|
35
|
-
*/
|
|
36
|
-
static showWarning(valid: boolean, message: string): void;
|
|
37
|
-
/** nodejs 环境 */
|
|
38
|
-
static isNode: boolean;
|
|
39
|
-
/**
|
|
40
|
-
* 浏览器环境
|
|
41
|
-
* @returns
|
|
42
|
-
*/
|
|
43
|
-
static isBrowser(): boolean;
|
|
44
|
-
/**
|
|
45
|
-
* 格式化成dayjs
|
|
46
|
-
* @param date
|
|
47
|
-
* @returns
|
|
48
|
-
*/
|
|
49
|
-
static dayjs(date?: string | number | Date | dayjs.Dayjs | null | undefined): DayjsType;
|
|
50
|
-
/**
|
|
51
|
-
* 空判断
|
|
52
|
-
* @param val
|
|
53
|
-
* @returns
|
|
54
|
-
*/
|
|
55
|
-
static isEmpty: (val: unknown) => boolean;
|
|
56
|
-
/**
|
|
57
|
-
* 非空
|
|
58
|
-
* @param val
|
|
59
|
-
* @returns
|
|
60
|
-
*/
|
|
61
|
-
static isNotEmpty: (val: unknown) => boolean;
|
|
62
|
-
/**
|
|
63
|
-
* json转base64
|
|
64
|
-
* @param value
|
|
65
|
-
* @returns
|
|
66
|
-
*/
|
|
67
|
-
static jsonToBase64(value: any): string;
|
|
68
|
-
/**
|
|
69
|
-
* base64转json
|
|
70
|
-
* @param value
|
|
71
|
-
* @returns
|
|
72
|
-
*/
|
|
73
|
-
static base64ToJson<T = any>(value: string): T | null;
|
|
74
|
-
/**
|
|
75
|
-
* JSON.parse
|
|
76
|
-
* @param value
|
|
77
|
-
* @returns
|
|
78
|
-
*/
|
|
79
|
-
static jsonParse<T = any>(value: string): T;
|
|
80
|
-
/**
|
|
81
|
-
* string to HEX
|
|
82
|
-
* @param {*} str
|
|
83
|
-
*/
|
|
84
|
-
static stringToHex(str: string): string;
|
|
85
|
-
/**
|
|
86
|
-
* string to dayjs
|
|
87
|
-
* @param val
|
|
88
|
-
* @param formartType // YYYY-MM-DD HH:mm:ss https://dayjs.fenxianglu.cn/category/display.html#%E6%A0%BC%E5%BC%8F%E5%8C%96
|
|
89
|
-
* @returns
|
|
90
|
-
*/
|
|
91
|
-
static dayjsFmt(val: string | undefined, formartType?: string): dayjs.Dayjs | undefined;
|
|
92
|
-
/**
|
|
93
|
-
* 空对象?
|
|
94
|
-
* @param obj
|
|
95
|
-
* @returns
|
|
96
|
-
*/
|
|
97
|
-
static objIsEmpty(obj: any): boolean;
|
|
98
|
-
/**
|
|
99
|
-
* 判断值不为空
|
|
100
|
-
* @param str string,object,array
|
|
101
|
-
* @returns
|
|
102
|
-
*/
|
|
103
|
-
static isNil(str: any): boolean;
|
|
104
|
-
}
|
|
105
|
-
export {};
|
package/es/utils/index.js
DELETED
|
@@ -1,241 +0,0 @@
|
|
|
1
|
-
var _class;
|
|
2
|
-
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); }
|
|
3
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
4
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
5
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
6
|
-
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; }
|
|
7
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
8
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
9
|
-
import _dayjs from 'dayjs';
|
|
10
|
-
import zhCn from 'dayjs/locale/zh-cn';
|
|
11
|
-
import relativeTime from 'dayjs/plugin/relativeTime';
|
|
12
|
-
import { Base64 } from 'js-base64';
|
|
13
|
-
import localForage from 'localforage';
|
|
14
|
-
import _isArray from 'lodash/isArray';
|
|
15
|
-
import _empty from 'lodash/isEmpty';
|
|
16
|
-
import _isObject from 'lodash/isObject';
|
|
17
|
-
import devWarning from 'rc-util/lib/warning';
|
|
18
|
-
_dayjs.locale(zhCn);
|
|
19
|
-
_dayjs.extend(relativeTime);
|
|
20
|
-
var utils = /*#__PURE__*/function () {
|
|
21
|
-
function utils() {
|
|
22
|
-
_classCallCheck(this, utils);
|
|
23
|
-
}
|
|
24
|
-
_createClass(utils, null, [{
|
|
25
|
-
key: "isFunction",
|
|
26
|
-
value:
|
|
27
|
-
/**
|
|
28
|
-
* 是函数?
|
|
29
|
-
* @param obj
|
|
30
|
-
* @returns
|
|
31
|
-
*/
|
|
32
|
-
function isFunction(obj) {
|
|
33
|
-
return typeof obj === 'function';
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* 获取stroage
|
|
38
|
-
* @param key
|
|
39
|
-
* @returns
|
|
40
|
-
*/
|
|
41
|
-
}, {
|
|
42
|
-
key: "getStroage",
|
|
43
|
-
value: function getStroage(key) {
|
|
44
|
-
return localForage.getItem(key);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* 设置stroage
|
|
49
|
-
* @param key
|
|
50
|
-
* @param value
|
|
51
|
-
* @returns
|
|
52
|
-
*/
|
|
53
|
-
}, {
|
|
54
|
-
key: "setStroage",
|
|
55
|
-
value: function setStroage(key, value) {
|
|
56
|
-
return localForage.setItem(key, value);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
/** 删除stroage */
|
|
60
|
-
}, {
|
|
61
|
-
key: "removeStroage",
|
|
62
|
-
value: function removeStroage(key) {
|
|
63
|
-
return localForage.removeItem(key);
|
|
64
|
-
}
|
|
65
|
-
}, {
|
|
66
|
-
key: "showLogWarning",
|
|
67
|
-
value: function showLogWarning(message) {
|
|
68
|
-
if (process.env.NODE_ENV === 'development') {
|
|
69
|
-
console.log("%c ".concat(message), 'color:#ff5722');
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* 开发环境抛警告
|
|
75
|
-
* @param valid
|
|
76
|
-
* @param message
|
|
77
|
-
*/
|
|
78
|
-
}, {
|
|
79
|
-
key: "showWarning",
|
|
80
|
-
value: function showWarning(valid, message) {
|
|
81
|
-
devWarning(valid, message);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
/** nodejs 环境 */
|
|
85
|
-
}, {
|
|
86
|
-
key: "isBrowser",
|
|
87
|
-
value:
|
|
88
|
-
/**
|
|
89
|
-
* 浏览器环境
|
|
90
|
-
* @returns
|
|
91
|
-
*/
|
|
92
|
-
function isBrowser() {
|
|
93
|
-
if (process.env.NODE_ENV === 'TEST') {
|
|
94
|
-
return true;
|
|
95
|
-
}
|
|
96
|
-
return typeof window !== 'undefined' && typeof window.document !== 'undefined' && !this.isNode;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
* 格式化成dayjs
|
|
101
|
-
* @param date
|
|
102
|
-
* @returns
|
|
103
|
-
*/
|
|
104
|
-
}, {
|
|
105
|
-
key: "dayjs",
|
|
106
|
-
value: function dayjs(date) {
|
|
107
|
-
return _dayjs(date);
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
* 空判断
|
|
112
|
-
* @param val
|
|
113
|
-
* @returns
|
|
114
|
-
*/
|
|
115
|
-
}, {
|
|
116
|
-
key: "jsonToBase64",
|
|
117
|
-
value:
|
|
118
|
-
/**
|
|
119
|
-
* json转base64
|
|
120
|
-
* @param value
|
|
121
|
-
* @returns
|
|
122
|
-
*/
|
|
123
|
-
function jsonToBase64(value) {
|
|
124
|
-
try {
|
|
125
|
-
var str = JSON.stringify(value);
|
|
126
|
-
return Base64.encode(str);
|
|
127
|
-
} catch (error) {
|
|
128
|
-
return '';
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
/**
|
|
133
|
-
* base64转json
|
|
134
|
-
* @param value
|
|
135
|
-
* @returns
|
|
136
|
-
*/
|
|
137
|
-
}, {
|
|
138
|
-
key: "base64ToJson",
|
|
139
|
-
value: function base64ToJson(value) {
|
|
140
|
-
try {
|
|
141
|
-
var str = Base64.decode(value);
|
|
142
|
-
return JSON.parse(str);
|
|
143
|
-
} catch (error) {
|
|
144
|
-
return null;
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
/**
|
|
149
|
-
* JSON.parse
|
|
150
|
-
* @param value
|
|
151
|
-
* @returns
|
|
152
|
-
*/
|
|
153
|
-
}, {
|
|
154
|
-
key: "jsonParse",
|
|
155
|
-
value: function jsonParse(value) {
|
|
156
|
-
try {
|
|
157
|
-
return JSON.parse(value);
|
|
158
|
-
} catch (error) {
|
|
159
|
-
return value;
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
/**
|
|
164
|
-
* string to HEX
|
|
165
|
-
* @param {*} str
|
|
166
|
-
*/
|
|
167
|
-
}, {
|
|
168
|
-
key: "stringToHex",
|
|
169
|
-
value: function stringToHex(str) {
|
|
170
|
-
if (str === '') return '';
|
|
171
|
-
var hexCharCode = [];
|
|
172
|
-
for (var i = 0; i < str.length; i += 1) {
|
|
173
|
-
hexCharCode.push(str.charCodeAt(i).toString(16));
|
|
174
|
-
}
|
|
175
|
-
return hexCharCode.join('').toUpperCase();
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
/**
|
|
179
|
-
* string to dayjs
|
|
180
|
-
* @param val
|
|
181
|
-
* @param formartType // YYYY-MM-DD HH:mm:ss https://dayjs.fenxianglu.cn/category/display.html#%E6%A0%BC%E5%BC%8F%E5%8C%96
|
|
182
|
-
* @returns
|
|
183
|
-
*/
|
|
184
|
-
}, {
|
|
185
|
-
key: "dayjsFmt",
|
|
186
|
-
value: function dayjsFmt(val, formartType) {
|
|
187
|
-
if (!val) return undefined;
|
|
188
|
-
if (formartType) {
|
|
189
|
-
_dayjs(val).format(formartType);
|
|
190
|
-
}
|
|
191
|
-
return _dayjs(val);
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
/**
|
|
195
|
-
* 空对象?
|
|
196
|
-
* @param obj
|
|
197
|
-
* @returns
|
|
198
|
-
*/
|
|
199
|
-
}, {
|
|
200
|
-
key: "objIsEmpty",
|
|
201
|
-
value: function objIsEmpty(obj) {
|
|
202
|
-
if (!obj) return true;
|
|
203
|
-
return Object.keys(obj).length === 0;
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
/**
|
|
207
|
-
* 判断值不为空
|
|
208
|
-
* @param str string,object,array
|
|
209
|
-
* @returns
|
|
210
|
-
*/
|
|
211
|
-
}, {
|
|
212
|
-
key: "isNil",
|
|
213
|
-
value: function isNil(str) {
|
|
214
|
-
if (typeof str === 'string') {
|
|
215
|
-
return str.trim() === '';
|
|
216
|
-
}
|
|
217
|
-
if (_isArray(str)) {
|
|
218
|
-
return str.length === 0;
|
|
219
|
-
}
|
|
220
|
-
if (_isObject(str)) {
|
|
221
|
-
return Object.keys(str).length === 0;
|
|
222
|
-
}
|
|
223
|
-
return str === undefined || str === null;
|
|
224
|
-
}
|
|
225
|
-
}]);
|
|
226
|
-
return utils;
|
|
227
|
-
}();
|
|
228
|
-
_class = utils;
|
|
229
|
-
_defineProperty(utils, "isNode", typeof process !== 'undefined' && process.versions !== null && process.versions.node !== null);
|
|
230
|
-
_defineProperty(utils, "isEmpty", function (val) {
|
|
231
|
-
return _empty(val);
|
|
232
|
-
});
|
|
233
|
-
/**
|
|
234
|
-
* 非空
|
|
235
|
-
* @param val
|
|
236
|
-
* @returns
|
|
237
|
-
*/
|
|
238
|
-
_defineProperty(utils, "isNotEmpty", function (val) {
|
|
239
|
-
return !_class.isEmpty(val);
|
|
240
|
-
});
|
|
241
|
-
export { utils as default };
|