@arcblock/ux 2.10.23 → 2.10.25
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/babel.config.es.js +1 -0
- package/lib/ActionButton/index.js +1 -1
- package/lib/ActivityIndicator/index.d.ts +34 -0
- package/lib/ActivityIndicator/index.js +1 -1
- package/lib/Address/compact-text.js +1 -1
- package/lib/Address/did-address.js +1 -1
- package/lib/Address/index.js +1 -1
- package/lib/Address/responsive-did-address.js +1 -1
- package/lib/Alert/index.d.ts +12 -0
- package/lib/Alert/index.js +1 -1
- package/lib/AnimationWaiter/index.js +1 -1
- package/lib/Async/index.js +1 -1
- package/lib/Avatar/did-motif.d.ts +29 -0
- package/lib/Avatar/did-motif.js +1 -1
- package/lib/Avatar/etherscan-blockies.d.ts +5 -0
- package/lib/Avatar/index.d.ts +64 -0
- package/lib/Avatar/index.js +1 -1
- package/lib/Badge/index.d.ts +12 -0
- package/lib/Badge/index.js +1 -1
- package/lib/Blocklet/blocklet.d.ts +84 -0
- package/lib/Blocklet/blocklet.js +1 -1
- package/lib/Blocklet/index.d.ts +5 -0
- package/lib/Blocklet/utils.d.ts +3 -0
- package/lib/BlockletContext/index.js +1 -1
- package/lib/BlockletNFT/index.js +1 -1
- package/lib/Button/index.d.ts +3 -0
- package/lib/Button/wrap.d.ts +27 -0
- package/lib/Button/wrap.js +4 -3
- package/lib/CardSelector/index.js +1 -1
- package/lib/Center/index.js +1 -1
- package/lib/ClickToCopy/copy-button.js +1 -1
- package/lib/ClickToCopy/index.js +1 -1
- package/lib/CodeBlock/index.js +1 -1
- package/lib/Colors/index.d.ts +2 -0
- package/lib/Colors/themes/default.d.ts +76 -0
- package/lib/Colors/themes/temp.d.ts +36 -0
- package/lib/ContactForm/index.js +1 -1
- package/lib/CookieConsent/index.js +1 -1
- package/lib/CountDown/index.js +1 -1
- package/lib/DID/index.js +1 -1
- package/lib/Datatable/CustomToolbar.d.ts +37 -0
- package/lib/Datatable/CustomToolbar.js +1 -1
- package/lib/Datatable/DatatableContext.d.ts +4 -0
- package/lib/Datatable/DatatableContext.js +1 -1
- package/lib/Datatable/TableSearch.d.ts +28 -0
- package/lib/Datatable/TableSearch.js +1 -1
- package/lib/Datatable/index.d.ts +53 -0
- package/lib/Datatable/index.js +11 -3
- package/lib/Datatable/utils.d.ts +5 -0
- package/lib/Dialog/confirm.d.ts +86 -0
- package/lib/Dialog/confirm.js +23 -13
- package/lib/Dialog/dialog.d.ts +115 -0
- package/lib/Dialog/dialog.js +12 -7
- package/lib/Dialog/index.d.ts +3 -0
- package/lib/Dialog/use-confirm.d.ts +8 -0
- package/lib/Dialog/use-confirm.js +1 -1
- package/lib/DidLogo/index.js +1 -1
- package/lib/Earth/index.js +1 -1
- package/lib/Empty/index.d.ts +39 -0
- package/lib/Empty/index.js +1 -1
- package/lib/ErrorBoundary/fallback.js +1 -1
- package/lib/Footer/index.js +1 -1
- package/lib/Header/auto-hidden.js +1 -1
- package/lib/Header/header.js +1 -1
- package/lib/Header/responsive-header.js +1 -1
- package/lib/Icon/image.js +1 -1
- package/lib/Icon/index.d.ts +2 -0
- package/lib/Icon/index.js +1 -1
- package/lib/Img/index.d.ts +77 -0
- package/lib/Img/index.js +2 -1
- package/lib/InfoRow/index.js +1 -1
- package/lib/Layout/dashboard/external-link.js +1 -1
- package/lib/Layout/dashboard/full-page.js +1 -1
- package/lib/Layout/dashboard/index.js +1 -1
- package/lib/Layout/dashboard/sidebar.js +1 -1
- package/lib/Layout/dashboard-legacy/header.js +1 -1
- package/lib/Layout/dashboard-legacy/index.js +1 -1
- package/lib/Layout/dashboard-legacy/sidebar.js +1 -1
- package/lib/Layout/index.js +1 -1
- package/lib/LoadingMask/index.js +1 -1
- package/lib/Locale/context.js +1 -1
- package/lib/Locale/selector.js +1 -1
- package/lib/Logo/index.d.ts +42 -0
- package/lib/Logo/index.js +1 -1
- package/lib/Metric/index.js +1 -1
- package/lib/NFTDisplay/aspect-ratio-container.js +1 -1
- package/lib/NFTDisplay/broken.js +1 -1
- package/lib/NFTDisplay/index.js +1 -1
- package/lib/NFTDisplay/loading.js +1 -1
- package/lib/NFTDisplay/svg-embedder/img.js +1 -1
- package/lib/NFTDisplay/svg-embedder/inline-svg.js +1 -1
- package/lib/NavMenu/nav-menu.js +1 -1
- package/lib/PageScroller/index.js +1 -1
- package/lib/PageScroller/story/FullPage.js +1 -1
- package/lib/PageScroller/story/PageContain.js +1 -1
- package/lib/Passport/passport.js +1 -1
- package/lib/PoweredByArcBlock/index.js +1 -1
- package/lib/PricingTable/PricingPlan.js +1 -1
- package/lib/PricingTable/index.js +1 -1
- package/lib/QRCode/index.js +1 -1
- package/lib/RelativeTime/index.js +1 -1
- package/lib/Result/common.js +1 -1
- package/lib/Result/index.js +1 -1
- package/lib/Result/result.js +1 -1
- package/lib/Screenshot/BaseScreenshot/index.js +1 -1
- package/lib/Screenshot/index.js +1 -1
- package/lib/SessionBlocklet/index.js +1 -1
- package/lib/SessionUser/components/logged-in.js +1 -1
- package/lib/SessionUser/components/session-user-item.js +1 -1
- package/lib/SessionUser/components/session-user-switch.js +1 -1
- package/lib/SessionUser/components/un-login.js +1 -1
- package/lib/SessionUser/components/user-info.js +1 -1
- package/lib/SessionUser/index.js +1 -1
- package/lib/Spinner/index.js +1 -1
- package/lib/SplitButton/index.js +8 -8
- package/lib/Success/index.js +1 -1
- package/lib/Switch/index.d.ts +31 -0
- package/lib/Switch/index.js +1 -1
- package/lib/Tabs/index.js +1 -1
- package/lib/Tag/index.d.ts +14 -0
- package/lib/Tag/index.js +11 -7
- package/lib/TextCollapse/index.js +1 -1
- package/lib/Theme/index.d.ts +14 -0
- package/lib/Theme/index.js +9 -0
- package/lib/Theme/theme-provider.d.ts +25 -0
- package/lib/Theme/theme-provider.js +1 -1
- package/lib/Theme/theme.d.ts +17 -0
- package/lib/Theme/theme.js +21 -3
- package/lib/Toast/index.d.ts +11 -0
- package/lib/Toast/index.js +2 -1
- package/lib/Typography/index.js +1 -1
- package/lib/Util/constant.d.ts +33 -0
- package/lib/Util/deprecate.d.ts +5 -0
- package/lib/Util/deprecate.js +1 -1
- package/lib/Util/index.d.ts +81 -0
- package/lib/Util/index.js +3 -1
- package/lib/Video/index.js +1 -1
- package/lib/Wallet/Action.js +1 -1
- package/lib/Wallet/Download.js +1 -1
- package/lib/Wallet/Open.js +1 -1
- package/lib/WalletOSIcon/index.js +1 -1
- package/lib/WebWalletSWKeeper/index.js +1 -1
- package/lib/WechatPrompt/index.js +1 -1
- package/lib/withTheme/index.js +1 -1
- package/lib/withTracker/error_boundary.js +1 -1
- package/lib/withTracker/index.js +1 -1
- package/package.json +13 -7
- package/src/Button/wrap.js +3 -2
- package/src/Datatable/index.jsx +9 -2
- package/src/Dialog/confirm.jsx +22 -12
- package/src/Dialog/dialog.jsx +11 -6
- package/src/SplitButton/index.js +7 -7
- package/src/Tag/index.js +10 -6
- package/src/Theme/index.js +8 -0
- package/src/Theme/theme.js +20 -3
- package/src/Util/index.js +3 -1
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
export default colors;
|
|
2
|
+
declare namespace colors {
|
|
3
|
+
namespace common {
|
|
4
|
+
let black: string;
|
|
5
|
+
let white: string;
|
|
6
|
+
}
|
|
7
|
+
namespace primary {
|
|
8
|
+
let main: string;
|
|
9
|
+
let contrastText: string;
|
|
10
|
+
}
|
|
11
|
+
namespace secondary {
|
|
12
|
+
let main_1: string;
|
|
13
|
+
export { main_1 as main };
|
|
14
|
+
let contrastText_1: string;
|
|
15
|
+
export { contrastText_1 as contrastText };
|
|
16
|
+
}
|
|
17
|
+
namespace error {
|
|
18
|
+
let main_2: string;
|
|
19
|
+
export { main_2 as main };
|
|
20
|
+
let contrastText_2: string;
|
|
21
|
+
export { contrastText_2 as contrastText };
|
|
22
|
+
}
|
|
23
|
+
namespace warning {
|
|
24
|
+
let main_3: string;
|
|
25
|
+
export { main_3 as main };
|
|
26
|
+
let contrastText_3: string;
|
|
27
|
+
export { contrastText_3 as contrastText };
|
|
28
|
+
}
|
|
29
|
+
namespace info {
|
|
30
|
+
let main_4: string;
|
|
31
|
+
export { main_4 as main };
|
|
32
|
+
let contrastText_4: string;
|
|
33
|
+
export { contrastText_4 as contrastText };
|
|
34
|
+
}
|
|
35
|
+
namespace success {
|
|
36
|
+
let main_5: string;
|
|
37
|
+
export { main_5 as main };
|
|
38
|
+
let contrastText_5: string;
|
|
39
|
+
export { contrastText_5 as contrastText };
|
|
40
|
+
}
|
|
41
|
+
let grey: {
|
|
42
|
+
50: string;
|
|
43
|
+
100: string;
|
|
44
|
+
200: string;
|
|
45
|
+
300: string;
|
|
46
|
+
400: string;
|
|
47
|
+
500: string;
|
|
48
|
+
600: string;
|
|
49
|
+
700: string;
|
|
50
|
+
800: string;
|
|
51
|
+
900: string;
|
|
52
|
+
A100: string;
|
|
53
|
+
A200: string;
|
|
54
|
+
A400: string;
|
|
55
|
+
A700: string;
|
|
56
|
+
};
|
|
57
|
+
namespace text {
|
|
58
|
+
let primary_1: string;
|
|
59
|
+
export { primary_1 as primary };
|
|
60
|
+
let secondary_1: string;
|
|
61
|
+
export { secondary_1 as secondary };
|
|
62
|
+
export let disabled: string;
|
|
63
|
+
export let hint: string;
|
|
64
|
+
}
|
|
65
|
+
let divider: string;
|
|
66
|
+
namespace background {
|
|
67
|
+
let _default: string;
|
|
68
|
+
export { _default as default };
|
|
69
|
+
}
|
|
70
|
+
namespace did {
|
|
71
|
+
let primary_2: string;
|
|
72
|
+
export { primary_2 as primary };
|
|
73
|
+
let secondary_2: string;
|
|
74
|
+
export { secondary_2 as secondary };
|
|
75
|
+
}
|
|
76
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export default colors;
|
|
2
|
+
declare namespace colors {
|
|
3
|
+
let textMuted: string;
|
|
4
|
+
let textSubtitle: string;
|
|
5
|
+
let textBase: string;
|
|
6
|
+
let textPrimaryBase: string;
|
|
7
|
+
let primaryBase: string;
|
|
8
|
+
let primary100: string;
|
|
9
|
+
let gray6: string;
|
|
10
|
+
let surfaceBgSubtitle: string;
|
|
11
|
+
let surfacePrimarySubtitle: string;
|
|
12
|
+
let surfaceSuccess: string;
|
|
13
|
+
let backgroundsBgSubtitle: string;
|
|
14
|
+
let backgroundsBgComponent: string;
|
|
15
|
+
let backgroundsBgField: string;
|
|
16
|
+
let backgroundsBgSubtile: string;
|
|
17
|
+
let backgroundsBgSubtileHover: string;
|
|
18
|
+
let foregroundsFgBase: string;
|
|
19
|
+
let foregroundsFgSubtile: string;
|
|
20
|
+
let foregroundsFgMuted: string;
|
|
21
|
+
let foregroundsFgInteractiveTransparent: string;
|
|
22
|
+
let foregroundsFgInteractive: string;
|
|
23
|
+
let strokeBorderBase: string;
|
|
24
|
+
let strokeBorderStrong: string;
|
|
25
|
+
let strokeSep: string;
|
|
26
|
+
let lineStep: string;
|
|
27
|
+
let lineBorderStrong: string;
|
|
28
|
+
let lineBorderBase: string;
|
|
29
|
+
let borderBase: string;
|
|
30
|
+
let buttonsButtonNeutral: string;
|
|
31
|
+
let buttonsButtonNeutralHover: string;
|
|
32
|
+
let buttonsButtonInverted: string;
|
|
33
|
+
let buttonsButtonInvertedHover: string;
|
|
34
|
+
let buttonsButtonDanger: string;
|
|
35
|
+
let red: string;
|
|
36
|
+
}
|
package/lib/ContactForm/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
2
3
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
3
4
|
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); }
|
|
@@ -12,7 +13,6 @@ import { mergeProps } from '../Util';
|
|
|
12
13
|
import { warn as deprecatedWarn } from '../Util/deprecate';
|
|
13
14
|
import Button from '../Button';
|
|
14
15
|
import { styled } from '../Theme';
|
|
15
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
16
|
export function submitContactForm({
|
|
17
17
|
formId,
|
|
18
18
|
portalId
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import PropTypes from 'prop-types';
|
|
2
3
|
import Button from '@mui/material/Button';
|
|
3
4
|
import CookieConsent, { resetCookieConsentValue } from 'react-cookie-consent';
|
|
4
5
|
import { styled } from '../Theme';
|
|
5
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
6
|
export { resetCookieConsentValue };
|
|
7
7
|
const translations = {
|
|
8
8
|
en: {
|
package/lib/CountDown/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import { Component } from 'react';
|
|
2
3
|
import PropTypes from 'prop-types';
|
|
3
4
|
import { getColor, mergeProps } from '../Util';
|
|
4
5
|
import { styled } from '../Theme';
|
|
5
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
6
|
const SECONDS_OF_MINUTE = 60;
|
|
7
7
|
const SECONDS_OF_HOUR = 60 * SECONDS_OF_MINUTE;
|
|
8
8
|
const SECONDS_OF_DAY = 24 * SECONDS_OF_HOUR;
|
package/lib/DID/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import { forwardRef, useState } from 'react';
|
|
2
3
|
import PropTypes from 'prop-types';
|
|
3
4
|
import { getDIDMotifInfo } from '@arcblock/did-motif';
|
|
@@ -12,7 +13,6 @@ import Address from '../Address';
|
|
|
12
13
|
import Avatar from '../Avatar';
|
|
13
14
|
import { isEthereumDid, getFontSize, getDIDColor } from '../Util';
|
|
14
15
|
import { translate } from '../Locale/util';
|
|
15
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
16
|
const translations = {
|
|
17
17
|
en: {
|
|
18
18
|
scanQrcode: 'Scan with DID Wallet to transfer token to here',
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
declare function CustomToolbar(props: any): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
2
|
+
declare namespace CustomToolbar {
|
|
3
|
+
namespace propTypes {
|
|
4
|
+
let data: PropTypes.Requireable<any[]>;
|
|
5
|
+
let options: PropTypes.Validator<object>;
|
|
6
|
+
let components: PropTypes.Requireable<object>;
|
|
7
|
+
let columns: PropTypes.Validator<any[]>;
|
|
8
|
+
let filterList: PropTypes.Requireable<any[]>;
|
|
9
|
+
let filterData: PropTypes.Requireable<any[]>;
|
|
10
|
+
let filterUpdate: PropTypes.Validator<(...args: any[]) => any>;
|
|
11
|
+
let resetFilters: PropTypes.Validator<(...args: any[]) => any>;
|
|
12
|
+
let updateFilterByType: PropTypes.Validator<(...args: any[]) => any>;
|
|
13
|
+
let toggleViewColumn: PropTypes.Validator<(...args: any[]) => any>;
|
|
14
|
+
let updateColumns: PropTypes.Validator<(...args: any[]) => any>;
|
|
15
|
+
let title: PropTypes.Requireable<any>;
|
|
16
|
+
let searchText: PropTypes.Requireable<any>;
|
|
17
|
+
let searchTextUpdate: PropTypes.Validator<(...args: any[]) => any>;
|
|
18
|
+
let searchClose: PropTypes.Validator<(...args: any[]) => any>;
|
|
19
|
+
let tableRef: PropTypes.Validator<(...args: any[]) => any>;
|
|
20
|
+
}
|
|
21
|
+
namespace defaultProps {
|
|
22
|
+
let data_1: any[];
|
|
23
|
+
export { data_1 as data };
|
|
24
|
+
let components_1: {};
|
|
25
|
+
export { components_1 as components };
|
|
26
|
+
let filterList_1: any[];
|
|
27
|
+
export { filterList_1 as filterList };
|
|
28
|
+
let filterData_1: any[];
|
|
29
|
+
export { filterData_1 as filterData };
|
|
30
|
+
let title_1: string;
|
|
31
|
+
export { title_1 as title };
|
|
32
|
+
let searchText_1: any;
|
|
33
|
+
export { searchText_1 as searchText };
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
export default CustomToolbar;
|
|
37
|
+
import PropTypes from 'prop-types';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import { useState, useRef, useEffect, isValidElement } from 'react';
|
|
2
3
|
import PropTypes from 'prop-types';
|
|
3
4
|
import { TableFilter, TableViewCol } from 'mui-datatables';
|
|
@@ -20,7 +21,6 @@ import { handleCSVDownload } from './utils';
|
|
|
20
21
|
import TableSearch from './TableSearch';
|
|
21
22
|
import { useDatatableContext } from './DatatableContext';
|
|
22
23
|
import { styled, useTheme } from '../Theme';
|
|
23
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
24
|
function useMobile() {
|
|
25
25
|
const theme = useTheme();
|
|
26
26
|
return useMediaQuery(theme.breakpoints.down('sm'));
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
declare function TableSearch({ search, options, searchText, searchTextUpdate, searchClose, onSearchOpen }: {
|
|
2
|
+
search: any;
|
|
3
|
+
options: any;
|
|
4
|
+
searchText: any;
|
|
5
|
+
searchTextUpdate: any;
|
|
6
|
+
searchClose: any;
|
|
7
|
+
onSearchOpen: any;
|
|
8
|
+
}): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
9
|
+
declare namespace TableSearch {
|
|
10
|
+
namespace propTypes {
|
|
11
|
+
let search: PropTypes.Requireable<string>;
|
|
12
|
+
let searchText: PropTypes.Requireable<string>;
|
|
13
|
+
let onSearchOpen: PropTypes.Requireable<(...args: any[]) => any>;
|
|
14
|
+
let options: PropTypes.Validator<object>;
|
|
15
|
+
let searchTextUpdate: PropTypes.Validator<(...args: any[]) => any>;
|
|
16
|
+
let searchClose: PropTypes.Validator<(...args: any[]) => any>;
|
|
17
|
+
}
|
|
18
|
+
namespace defaultProps {
|
|
19
|
+
let search_1: string;
|
|
20
|
+
export { search_1 as search };
|
|
21
|
+
let searchText_1: string;
|
|
22
|
+
export { searchText_1 as searchText };
|
|
23
|
+
export { noop as onSearchOpen };
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
export default TableSearch;
|
|
27
|
+
import PropTypes from 'prop-types';
|
|
28
|
+
import noop from 'lodash/noop';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import { useState, useRef } from 'react';
|
|
2
3
|
import PropTypes from 'prop-types';
|
|
3
4
|
import IconButton from '@mui/material/IconButton';
|
|
@@ -9,7 +10,6 @@ import clsx from 'clsx';
|
|
|
9
10
|
import noop from 'lodash/noop';
|
|
10
11
|
import { useDatatableContext } from './DatatableContext';
|
|
11
12
|
import { styled } from '../Theme';
|
|
12
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
export default function TableSearch({
|
|
14
14
|
search,
|
|
15
15
|
options,
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description
|
|
3
|
+
* @export
|
|
4
|
+
* @param {DataTableProps} props
|
|
5
|
+
* @return {import('react').ReactComponentElement}
|
|
6
|
+
*/
|
|
7
|
+
export default function DataTable(props: DataTableProps): import("react").ReactComponentElement<any, Pick<any, string | number | symbol>>;
|
|
8
|
+
export function getDurableData(key: any): any;
|
|
9
|
+
export type DataTableCustomButton = {
|
|
10
|
+
icon: import("react").ReactElement;
|
|
11
|
+
title: string;
|
|
12
|
+
onClick?: () => void;
|
|
13
|
+
};
|
|
14
|
+
export type DataTableColumn = {
|
|
15
|
+
name: string;
|
|
16
|
+
label: string;
|
|
17
|
+
width?: number;
|
|
18
|
+
options?: {
|
|
19
|
+
filter?: boolean;
|
|
20
|
+
sort?: boolean;
|
|
21
|
+
customBodyRender?: (value: any) => import("react").ReactElement;
|
|
22
|
+
customBodyRenderLite?: (index: number) => import("react").ReactElement;
|
|
23
|
+
} & import("mui-datatables").MUIDataTableColumnOptions;
|
|
24
|
+
} & import("mui-datatables").MUIDataTableColumnDef;
|
|
25
|
+
export type DataTableState = Pick<import("mui-datatables").MUIDataTableState, "count" | "page" | "rowsPerPage" | "searchText" | "sortOrder" | "filterList">;
|
|
26
|
+
export type ModifiedMUIDataTableProps = {
|
|
27
|
+
/**
|
|
28
|
+
* - The title of the table (optional).
|
|
29
|
+
*/
|
|
30
|
+
title?: string;
|
|
31
|
+
/**
|
|
32
|
+
* - Other props from MUIDataTableProps.
|
|
33
|
+
*/
|
|
34
|
+
rest?: import("mui-datatables").MUIDataTableProps[];
|
|
35
|
+
};
|
|
36
|
+
export type DataTableProps = {
|
|
37
|
+
data: Array<object | number[] | string[]>;
|
|
38
|
+
columns: Array<DataTableColumn>;
|
|
39
|
+
locale?: string;
|
|
40
|
+
options?: import("mui-datatables").MUIDataTableOptions;
|
|
41
|
+
style?: import("react").CSSProperties;
|
|
42
|
+
customButtons?: Array<DataTableCustomButton>;
|
|
43
|
+
onChange?: (state: DataTableState, action: string) => void | Promise<void>;
|
|
44
|
+
loading?: boolean;
|
|
45
|
+
disabled?: boolean;
|
|
46
|
+
stripped?: boolean;
|
|
47
|
+
verticalKeyWidth?: number | string;
|
|
48
|
+
hideTableHeader?: boolean;
|
|
49
|
+
components?: import("react").ReactElement;
|
|
50
|
+
emptyNode?: import("react").ReactNode;
|
|
51
|
+
durable?: string;
|
|
52
|
+
durableKeys?: "page" | "rowsPerPage" | "searchText" | "sortOrder";
|
|
53
|
+
} & ModifiedMUIDataTableProps;
|
package/lib/Datatable/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
/* eslint-disable react-hooks/exhaustive-deps */
|
|
2
3
|
import { useEffect, useRef, isValidElement } from 'react';
|
|
3
4
|
import PropTypes from 'prop-types';
|
|
@@ -17,6 +18,7 @@ import { styled } from '../Theme';
|
|
|
17
18
|
* @typedef {{
|
|
18
19
|
* icon: import('react').ReactElement,
|
|
19
20
|
* title: string,
|
|
21
|
+
* onClick?: () => void
|
|
20
22
|
* }} DataTableCustomButton
|
|
21
23
|
*/
|
|
22
24
|
|
|
@@ -38,6 +40,12 @@ import { styled } from '../Theme';
|
|
|
38
40
|
* @typedef {Pick<import('mui-datatables').MUIDataTableState, 'count' | 'page' | 'rowsPerPage' | 'searchText' | 'sortOrder' | 'filterList'>} DataTableState
|
|
39
41
|
*/
|
|
40
42
|
|
|
43
|
+
/**
|
|
44
|
+
* @typedef {Object} ModifiedMUIDataTableProps
|
|
45
|
+
* @property {string} [title] - The title of the table (optional).
|
|
46
|
+
* @property {...import('mui-datatables').MUIDataTableProps} [rest] - Other props from MUIDataTableProps.
|
|
47
|
+
*/
|
|
48
|
+
|
|
41
49
|
/**
|
|
42
50
|
* @typedef {{
|
|
43
51
|
* data: Array<object | number[] | string[]>,
|
|
@@ -53,12 +61,12 @@ import { styled } from '../Theme';
|
|
|
53
61
|
* verticalKeyWidth?: number | string,
|
|
54
62
|
* hideTableHeader?: boolean,
|
|
55
63
|
* components?: import('react').ReactElement,
|
|
56
|
-
* emptyNode?: import('react').
|
|
64
|
+
* emptyNode?: import('react').ReactNode,
|
|
57
65
|
* durable?: string,
|
|
58
66
|
* durableKeys?: 'page' | 'rowsPerPage' | 'searchText' | 'sortOrder'
|
|
59
|
-
* } &
|
|
67
|
+
* } & ModifiedMUIDataTableProps} DataTableProps
|
|
60
68
|
*/
|
|
61
|
-
|
|
69
|
+
|
|
62
70
|
const FilterLine = styled('div')`
|
|
63
71
|
display: flex;
|
|
64
72
|
align-items: center;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {import('../Button/wrap').ButtonProps} ButtonProps
|
|
3
|
+
* @typedef {import('@mui/material').PaperProps} PaperProps
|
|
4
|
+
* @typedef {{
|
|
5
|
+
* title: React.ReactNode,
|
|
6
|
+
* open: boolean,
|
|
7
|
+
* children: React.ReactNode,
|
|
8
|
+
* onConfirm: () => void | Promise<void>,
|
|
9
|
+
* onCancel: () => void | Promise<void>,
|
|
10
|
+
* showCancelButton?: boolean,
|
|
11
|
+
* showCloseButton?: boolean,
|
|
12
|
+
* fullScreen?: boolean,
|
|
13
|
+
* confirmButton?: {text: string, props?: ButtonProps}
|
|
14
|
+
* cancelButton?: {text: string, props?: ButtonProps}
|
|
15
|
+
* PaperProps?: PaperProps
|
|
16
|
+
* }} ConfirmProps
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
19
|
+
*
|
|
20
|
+
* @param {ConfirmProps} props
|
|
21
|
+
* @returns {import('react').ReactComponentElement}
|
|
22
|
+
*/
|
|
23
|
+
declare function Confirm({ title, children, onConfirm, onCancel, showCloseButton, showCancelButton, fullScreen, confirmButton, cancelButton, PaperProps, ...rest }: ConfirmProps): import("react").ReactComponentElement<any, Pick<any, string | number | symbol>>;
|
|
24
|
+
declare namespace Confirm {
|
|
25
|
+
namespace propTypes {
|
|
26
|
+
let title: PropTypes.Validator<NonNullable<PropTypes.ReactNodeLike>>;
|
|
27
|
+
let open: PropTypes.Validator<boolean>;
|
|
28
|
+
let children: PropTypes.Validator<NonNullable<PropTypes.ReactNodeLike>>;
|
|
29
|
+
let onConfirm: PropTypes.Validator<(...args: any[]) => any>;
|
|
30
|
+
let onCancel: PropTypes.Validator<(...args: any[]) => any>;
|
|
31
|
+
let showCancelButton: PropTypes.Requireable<boolean>;
|
|
32
|
+
let showCloseButton: PropTypes.Requireable<boolean>;
|
|
33
|
+
let fullScreen: PropTypes.Requireable<boolean>;
|
|
34
|
+
let confirmButton: PropTypes.Requireable<PropTypes.InferProps<{
|
|
35
|
+
text: PropTypes.Validator<string>;
|
|
36
|
+
props: PropTypes.Requireable<object>;
|
|
37
|
+
}>>;
|
|
38
|
+
let cancelButton: PropTypes.Requireable<PropTypes.InferProps<{
|
|
39
|
+
text: PropTypes.Validator<string>;
|
|
40
|
+
props: PropTypes.Requireable<object>;
|
|
41
|
+
}>>;
|
|
42
|
+
let PaperProps: PropTypes.Requireable<object>;
|
|
43
|
+
}
|
|
44
|
+
namespace defaultProps {
|
|
45
|
+
let showCancelButton_1: boolean;
|
|
46
|
+
export { showCancelButton_1 as showCancelButton };
|
|
47
|
+
let showCloseButton_1: boolean;
|
|
48
|
+
export { showCloseButton_1 as showCloseButton };
|
|
49
|
+
let fullScreen_1: boolean;
|
|
50
|
+
export { fullScreen_1 as fullScreen };
|
|
51
|
+
export namespace confirmButton_1 {
|
|
52
|
+
let text: string;
|
|
53
|
+
}
|
|
54
|
+
export { confirmButton_1 as confirmButton };
|
|
55
|
+
export namespace cancelButton_1 {
|
|
56
|
+
let text_1: string;
|
|
57
|
+
export { text_1 as text };
|
|
58
|
+
}
|
|
59
|
+
export { cancelButton_1 as cancelButton };
|
|
60
|
+
let PaperProps_1: {};
|
|
61
|
+
export { PaperProps_1 as PaperProps };
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
export default Confirm;
|
|
65
|
+
export type ButtonProps = import("../Button/wrap").ButtonProps;
|
|
66
|
+
export type PaperProps = import("@mui/material").PaperProps;
|
|
67
|
+
export type ConfirmProps = {
|
|
68
|
+
title: React.ReactNode;
|
|
69
|
+
open: boolean;
|
|
70
|
+
children: React.ReactNode;
|
|
71
|
+
onConfirm: () => void | Promise<void>;
|
|
72
|
+
onCancel: () => void | Promise<void>;
|
|
73
|
+
showCancelButton?: boolean;
|
|
74
|
+
showCloseButton?: boolean;
|
|
75
|
+
fullScreen?: boolean;
|
|
76
|
+
confirmButton?: {
|
|
77
|
+
text: string;
|
|
78
|
+
props?: ButtonProps;
|
|
79
|
+
};
|
|
80
|
+
cancelButton?: {
|
|
81
|
+
text: string;
|
|
82
|
+
props?: ButtonProps;
|
|
83
|
+
};
|
|
84
|
+
PaperProps?: PaperProps;
|
|
85
|
+
};
|
|
86
|
+
import PropTypes from 'prop-types';
|
package/lib/Dialog/confirm.js
CHANGED
|
@@ -1,20 +1,26 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import PropTypes from 'prop-types';
|
|
2
3
|
import { useMemoizedFn } from 'ahooks';
|
|
3
4
|
import Button from '../Button';
|
|
4
5
|
import Dialog from './dialog';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
8
|
+
* @typedef {import('../Button/wrap').ButtonProps} ButtonProps
|
|
9
|
+
* @typedef {import('@mui/material').PaperProps} PaperProps
|
|
10
|
+
* @typedef {{
|
|
11
|
+
* title: React.ReactNode,
|
|
12
|
+
* open: boolean,
|
|
13
|
+
* children: React.ReactNode,
|
|
14
|
+
* onConfirm: () => void | Promise<void>,
|
|
15
|
+
* onCancel: () => void | Promise<void>,
|
|
16
|
+
* showCancelButton?: boolean,
|
|
17
|
+
* showCloseButton?: boolean,
|
|
18
|
+
* fullScreen?: boolean,
|
|
19
|
+
* confirmButton?: {text: string, props?: ButtonProps}
|
|
20
|
+
* cancelButton?: {text: string, props?: ButtonProps}
|
|
21
|
+
* PaperProps?: PaperProps
|
|
22
|
+
* }} ConfirmProps
|
|
23
|
+
*/
|
|
18
24
|
|
|
19
25
|
// 注意排在 {...rest} 之后的 props 优先级更高
|
|
20
26
|
/**
|
|
@@ -22,7 +28,6 @@ import Dialog from './dialog';
|
|
|
22
28
|
* @param {ConfirmProps} props
|
|
23
29
|
* @returns {import('react').ReactComponentElement}
|
|
24
30
|
*/
|
|
25
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
26
31
|
export default function Confirm({
|
|
27
32
|
title,
|
|
28
33
|
children,
|
|
@@ -30,6 +35,7 @@ export default function Confirm({
|
|
|
30
35
|
onCancel,
|
|
31
36
|
showCloseButton,
|
|
32
37
|
showCancelButton,
|
|
38
|
+
fullScreen,
|
|
33
39
|
confirmButton,
|
|
34
40
|
cancelButton,
|
|
35
41
|
PaperProps,
|
|
@@ -52,6 +58,7 @@ export default function Confirm({
|
|
|
52
58
|
...rest,
|
|
53
59
|
onClose: handleClose,
|
|
54
60
|
showCloseButton: showCloseButton,
|
|
61
|
+
fullScreen: fullScreen,
|
|
55
62
|
slotProps: {
|
|
56
63
|
header: {
|
|
57
64
|
sx: {
|
|
@@ -92,11 +99,13 @@ export default function Confirm({
|
|
|
92
99
|
}
|
|
93
100
|
Confirm.propTypes = {
|
|
94
101
|
title: PropTypes.node.isRequired,
|
|
102
|
+
open: PropTypes.bool.isRequired,
|
|
95
103
|
children: PropTypes.node.isRequired,
|
|
96
104
|
onConfirm: PropTypes.func.isRequired,
|
|
97
105
|
onCancel: PropTypes.func.isRequired,
|
|
98
106
|
showCancelButton: PropTypes.bool,
|
|
99
107
|
showCloseButton: PropTypes.bool,
|
|
108
|
+
fullScreen: PropTypes.bool,
|
|
100
109
|
// 可以传入 {text: ..., props: ...}
|
|
101
110
|
confirmButton: PropTypes.shape({
|
|
102
111
|
text: PropTypes.string.isRequired,
|
|
@@ -109,8 +118,9 @@ Confirm.propTypes = {
|
|
|
109
118
|
PaperProps: PropTypes.object
|
|
110
119
|
};
|
|
111
120
|
Confirm.defaultProps = {
|
|
112
|
-
showCloseButton: true,
|
|
113
121
|
showCancelButton: true,
|
|
122
|
+
showCloseButton: true,
|
|
123
|
+
fullScreen: false,
|
|
114
124
|
confirmButton: {
|
|
115
125
|
text: 'Confirm'
|
|
116
126
|
},
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
export default Dialog;
|
|
2
|
+
export type MuiDialogProps = import("@mui/material").DialogProps;
|
|
3
|
+
export type PaperStyle = import("@mui/material").PaperProps & {
|
|
4
|
+
minWidth?: number | string;
|
|
5
|
+
minHeight?: number | string;
|
|
6
|
+
};
|
|
7
|
+
export type UxDialogProps = {
|
|
8
|
+
/**
|
|
9
|
+
* - The content of the dialog.
|
|
10
|
+
*/
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* - The title of the dialog.
|
|
14
|
+
*/
|
|
15
|
+
title?: React.ReactNode;
|
|
16
|
+
/**
|
|
17
|
+
* - Content to be displayed before the dialog title.
|
|
18
|
+
*/
|
|
19
|
+
prepend?: React.ReactNode;
|
|
20
|
+
/**
|
|
21
|
+
* - Content to be displayed in the top toolbar of the dialog.
|
|
22
|
+
*/
|
|
23
|
+
toolbar?: React.ReactNode;
|
|
24
|
+
/**
|
|
25
|
+
* - Content to be displayed in the bottom actions toolbar of the dialog.
|
|
26
|
+
*/
|
|
27
|
+
actions?: React.ReactNode;
|
|
28
|
+
/**
|
|
29
|
+
* - Whether or not to show the close button.
|
|
30
|
+
*/
|
|
31
|
+
showCloseButton?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* - The position of the actions toolbar.
|
|
34
|
+
*/
|
|
35
|
+
actionsPosition?: "left" | "center" | "right";
|
|
36
|
+
/**
|
|
37
|
+
* - Props to be passed down to the dialog paper.
|
|
38
|
+
*/
|
|
39
|
+
PaperProps?: PaperStyle;
|
|
40
|
+
/**
|
|
41
|
+
* - Callback function fired when the dialog is closed.
|
|
42
|
+
*/
|
|
43
|
+
onClose?: (event: React.SyntheticEvent, reason: string) => void;
|
|
44
|
+
};
|
|
45
|
+
export type DialogProps = MuiDialogProps & UxDialogProps;
|
|
46
|
+
/**
|
|
47
|
+
* @typedef {import('@mui/material').DialogProps} MuiDialogProps
|
|
48
|
+
* @typedef {import('@mui/material').PaperProps & {
|
|
49
|
+
* minWidth?: number | string,
|
|
50
|
+
* minHeight?: number | string,
|
|
51
|
+
* }} PaperStyle
|
|
52
|
+
*/
|
|
53
|
+
/**
|
|
54
|
+
@typedef {Object} UxDialogProps
|
|
55
|
+
@property {React.ReactNode} children - The content of the dialog.
|
|
56
|
+
@property {React.ReactNode} [title] - The title of the dialog.
|
|
57
|
+
@property {React.ReactNode} [prepend] - Content to be displayed before the dialog title.
|
|
58
|
+
@property {React.ReactNode} [toolbar] - Content to be displayed in the top toolbar of the dialog.
|
|
59
|
+
@property {React.ReactNode} [actions] - Content to be displayed in the bottom actions toolbar of the dialog.
|
|
60
|
+
@property {boolean} [showCloseButton=true] - Whether or not to show the close button.
|
|
61
|
+
@property {'left'|'center'|'right'} [actionsPosition='right'] - The position of the actions toolbar.
|
|
62
|
+
@property {PaperStyle} [PaperProps] - Props to be passed down to the dialog paper.
|
|
63
|
+
@property {(event: React.SyntheticEvent, reason: string) => void} [onClose] - Callback function fired when the dialog is closed.
|
|
64
|
+
*/
|
|
65
|
+
/**
|
|
66
|
+
* @typedef {MuiDialogProps & UxDialogProps} DialogProps
|
|
67
|
+
*/
|
|
68
|
+
/**
|
|
69
|
+
* Dialog
|
|
70
|
+
*
|
|
71
|
+
* - 固定尺寸或特殊的尺寸控制需求, 可使用 PaperProps.style (不再提供 width/height 等 props)
|
|
72
|
+
* 注意: 当设置明确的 width 时, 可能需要同时设置 maxWidth=false (mui dialog 默认 maxWidth=sm, 设置的 width 可能受限)
|
|
73
|
+
* - 添加默认最小尺寸 (300x300), 在需要 先展示 loading 再展示异步数据 的时候避免 loading 阶段窗口过小
|
|
74
|
+
*/
|
|
75
|
+
/**
|
|
76
|
+
* @description
|
|
77
|
+
* @param {DialogProps} props
|
|
78
|
+
* @return {React.ReactComponentElement<any, DialogProps>}
|
|
79
|
+
*/
|
|
80
|
+
declare function Dialog({ children, title, prepend, toolbar, actions, showCloseButton, actionsPosition, PaperProps, slotProps, ...rest }: DialogProps): React.ReactComponentElement<any, DialogProps>;
|
|
81
|
+
declare namespace Dialog {
|
|
82
|
+
namespace propTypes {
|
|
83
|
+
let children: PropTypes.Validator<NonNullable<PropTypes.ReactNodeLike>>;
|
|
84
|
+
let title: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
85
|
+
let prepend: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
86
|
+
let toolbar: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
87
|
+
let actions: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
88
|
+
let showCloseButton: PropTypes.Requireable<boolean>;
|
|
89
|
+
let actionsPosition: PropTypes.Requireable<string>;
|
|
90
|
+
let PaperProps: PropTypes.Requireable<object>;
|
|
91
|
+
let slotProps: PropTypes.Requireable<PropTypes.InferProps<{
|
|
92
|
+
content: PropTypes.Requireable<object>;
|
|
93
|
+
header: PropTypes.Requireable<object>;
|
|
94
|
+
}>>;
|
|
95
|
+
}
|
|
96
|
+
namespace defaultProps {
|
|
97
|
+
let showCloseButton_1: boolean;
|
|
98
|
+
export { showCloseButton_1 as showCloseButton };
|
|
99
|
+
let title_1: string;
|
|
100
|
+
export { title_1 as title };
|
|
101
|
+
let prepend_1: any;
|
|
102
|
+
export { prepend_1 as prepend };
|
|
103
|
+
let toolbar_1: any;
|
|
104
|
+
export { toolbar_1 as toolbar };
|
|
105
|
+
let actions_1: any;
|
|
106
|
+
export { actions_1 as actions };
|
|
107
|
+
let actionsPosition_1: string;
|
|
108
|
+
export { actionsPosition_1 as actionsPosition };
|
|
109
|
+
let PaperProps_1: {};
|
|
110
|
+
export { PaperProps_1 as PaperProps };
|
|
111
|
+
let slotProps_1: {};
|
|
112
|
+
export { slotProps_1 as slotProps };
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
import PropTypes from 'prop-types';
|