@arcblock/ux 3.4.15 → 3.5.1
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/lib/package.json.js +1 -1
- package/package.json +10 -7
- package/src/ActionButton/ActionButton.stories.jsx +0 -61
- package/src/ActionButton/index.jsx +0 -106
- package/src/ActivityIndicator/ActivityIndicator.stories.jsx +0 -9
- package/src/ActivityIndicator/index.jsx +0 -140
- package/src/Address/Address.stories.jsx +0 -38
- package/src/Address/compact-text.jsx +0 -76
- package/src/Address/did-address.tsx +0 -223
- package/src/Address/index.tsx +0 -21
- package/src/Address/responsive-did-address.tsx +0 -154
- package/src/Alert/Alert.stories.jsx +0 -100
- package/src/Alert/index.jsx +0 -130
- package/src/AnimationWaiter/AnimationWaiter.stories.jsx +0 -35
- package/src/AnimationWaiter/dark-animation.json +0 -1
- package/src/AnimationWaiter/default-animation.json +0 -1
- package/src/AnimationWaiter/index.jsx +0 -296
- package/src/Async/index.tsx +0 -44
- package/src/Avatar/Avatar.stories.jsx +0 -11
- package/src/Avatar/did-motif.jsx +0 -38
- package/src/Avatar/etherscan-blockies.js +0 -81
- package/src/Avatar/index.jsx +0 -195
- package/src/Badge/Badge.stories.jsx +0 -41
- package/src/Badge/index.jsx +0 -101
- package/src/Blocklet/Blocklet.stories.jsx +0 -21
- package/src/Blocklet/blocklet.jsx +0 -276
- package/src/Blocklet/index.js +0 -5
- package/src/Blocklet/utils.jsx +0 -58
- package/src/BlockletContext/index.tsx +0 -72
- package/src/BlockletNFT/BlockletNFT.stories.jsx +0 -21
- package/src/BlockletNFT/index.jsx +0 -378
- package/src/BlockletV2/Blocklet.stories.jsx +0 -34
- package/src/BlockletV2/blocklet.tsx +0 -247
- package/src/BlockletV2/components/icon-text.tsx +0 -47
- package/src/BlockletV2/components/tooltip-icon.tsx +0 -52
- package/src/BlockletV2/index.ts +0 -6
- package/src/BlockletV2/utils.js +0 -75
- package/src/Button/Button.stories.jsx +0 -24
- package/src/Button/index.js +0 -9
- package/src/Button/wrap.jsx +0 -126
- package/src/ButtonGroup/index.js +0 -16
- package/src/CardSelector/index.tsx +0 -136
- package/src/Center/Center.stories.jsx +0 -20
- package/src/Center/index.tsx +0 -33
- package/src/ClickToCopy/ClickToCopy.stories.jsx +0 -24
- package/src/ClickToCopy/copy-button.tsx +0 -43
- package/src/ClickToCopy/hook.ts +0 -42
- package/src/ClickToCopy/index.tsx +0 -96
- package/src/CloseButton/index.tsx +0 -37
- package/src/CodeBlock/CodeBlock.stories.jsx +0 -22
- package/src/CodeBlock/LightBox.tsx +0 -87
- package/src/CodeBlock/index.tsx +0 -217
- package/src/Colors/Colors.stories.jsx +0 -211
- package/src/Colors/index.ts +0 -4
- package/src/Colors/themes/default.ts +0 -8
- package/src/Colors/themes/did-connect.ts +0 -64
- package/src/Colors/themes/temp.ts +0 -52
- package/src/Config/Config.stories.jsx +0 -16
- package/src/Config/config-provider.tsx +0 -62
- package/src/Config/index.ts +0 -2
- package/src/Config/theme-mode-toggle.tsx +0 -38
- package/src/ContactForm/ContactForm.stories.jsx +0 -32
- package/src/ContactForm/index.tsx +0 -264
- package/src/CookieConsent/CookieConsent.stories.jsx +0 -33
- package/src/CookieConsent/index.tsx +0 -104
- package/src/CountDown/CountDown.stories.jsx +0 -15
- package/src/CountDown/index.tsx +0 -170
- package/src/DID/DID.stories.jsx +0 -37
- package/src/DID/index.tsx +0 -393
- package/src/DIDConnect/app-icon.tsx +0 -37
- package/src/DIDConnect/app-info-item.tsx +0 -93
- package/src/DIDConnect/auth-apps/auth-apps-info.tsx +0 -77
- package/src/DIDConnect/auth-apps/index.tsx +0 -278
- package/src/DIDConnect/auth-apps/switch-role.tsx +0 -47
- package/src/DIDConnect/did-connect-container.tsx +0 -326
- package/src/DIDConnect/did-connect-footer.tsx +0 -76
- package/src/DIDConnect/did-connect-logo.tsx +0 -8
- package/src/DIDConnect/icons/did-wallet-logo.tsx +0 -18
- package/src/DIDConnect/icons/github-logo.tsx +0 -17
- package/src/DIDConnect/index.ts +0 -11
- package/src/DIDConnect/landing-page.tsx +0 -218
- package/src/DIDConnect/powered-by.tsx +0 -48
- package/src/DIDConnect/provider-icon.tsx +0 -62
- package/src/DIDConnect/request-storage-access-api-dialog.tsx +0 -304
- package/src/DIDConnect/with-container.tsx +0 -323
- package/src/DIDConnect/with-ux-theme.tsx +0 -22
- package/src/DIDLogo/Logo.stories.jsx +0 -11
- package/src/DIDLogo/index.tsx +0 -168
- package/src/Datatable/CustomToolbar.jsx +0 -415
- package/src/Datatable/Datatable.stories.jsx +0 -92
- package/src/Datatable/DatatableContext.jsx +0 -35
- package/src/Datatable/TableSearch.jsx +0 -166
- package/src/Datatable/index.jsx +0 -652
- package/src/Datatable/utils.js +0 -161
- package/src/Dialog/Dialog.stories.jsx +0 -21
- package/src/Dialog/confirm.jsx +0 -143
- package/src/Dialog/dialog.jsx +0 -199
- package/src/Dialog/index.js +0 -4
- package/src/Dialog/types.d.ts +0 -20
- package/src/Dialog/use-confirm.jsx +0 -188
- package/src/DriftBot/index.tsx +0 -81
- package/src/Earth/Earth.stories.jsx +0 -39
- package/src/Earth/countries.json +0 -8057
- package/src/Earth/index.tsx +0 -515
- package/src/Earth/util.ts +0 -72
- package/src/Empty/Empty.stories.jsx +0 -23
- package/src/Empty/index.jsx +0 -48
- package/src/ErrorBoundary/ErrorBoundary.stories.jsx +0 -13
- package/src/ErrorBoundary/fallback.tsx +0 -85
- package/src/ErrorBoundary/index.ts +0 -1
- package/src/Footer/Footer.stories.jsx +0 -13
- package/src/Footer/index.tsx +0 -130
- package/src/Header/Header.stories.jsx +0 -30
- package/src/Header/addon-button.tsx +0 -41
- package/src/Header/auto-hidden.tsx +0 -31
- package/src/Header/header-addons.tsx +0 -37
- package/src/Header/header.tsx +0 -214
- package/src/Header/index.ts +0 -3
- package/src/Header/responsive-header.tsx +0 -145
- package/src/Icon/Icon.stories.jsx +0 -45
- package/src/Icon/image.tsx +0 -53
- package/src/Icon/index.tsx +0 -63
- package/src/Img/Img.stories.jsx +0 -17
- package/src/Img/index.jsx +0 -258
- package/src/InfoRow/InfoRow.stories.jsx +0 -14
- package/src/InfoRow/index.tsx +0 -91
- package/src/Layout/Layout.stories.jsx +0 -24
- package/src/Layout/dashboard/external-link.tsx +0 -59
- package/src/Layout/dashboard/full-page.tsx +0 -58
- package/src/Layout/dashboard/index.tsx +0 -260
- package/src/Layout/dashboard/sidebar.tsx +0 -198
- package/src/Layout/dashboard-legacy/header.tsx +0 -156
- package/src/Layout/dashboard-legacy/index.tsx +0 -127
- package/src/Layout/dashboard-legacy/sidebar.tsx +0 -129
- package/src/Layout/index.tsx +0 -310
- package/src/LoadingMask/index.tsx +0 -108
- package/src/Locale/LocaleSelector.stories.jsx +0 -44
- package/src/Locale/browser-lang.ts +0 -65
- package/src/Locale/context.tsx +0 -162
- package/src/Locale/languages.ts +0 -58
- package/src/Locale/selector.tsx +0 -174
- package/src/Locale/util.ts +0 -38
- package/src/Logo/Logo.stories.jsx +0 -23
- package/src/Logo/images/logo-dark-text.svg +0 -3
- package/src/Logo/images/logo-dark-top.svg +0 -6
- package/src/Logo/images/logo-light-text.svg +0 -3
- package/src/Logo/images/logo-light-top.svg +0 -6
- package/src/Logo/index.tsx +0 -58
- package/src/Metric/Metric.stories.jsx +0 -29
- package/src/Metric/index.tsx +0 -130
- package/src/MuiWrap/index.tsx +0 -10
- package/src/NFTDisplay/NFTBroken.svg +0 -34
- package/src/NFTDisplay/NFTDisplay.stories.jsx +0 -30
- package/src/NFTDisplay/README.md +0 -59
- package/src/NFTDisplay/aspect-ratio-container.tsx +0 -36
- package/src/NFTDisplay/broken.tsx +0 -51
- package/src/NFTDisplay/displayApi.ts +0 -43
- package/src/NFTDisplay/index.tsx +0 -393
- package/src/NFTDisplay/loading.tsx +0 -16
- package/src/NFTDisplay/preview.tsx +0 -84
- package/src/NFTDisplay/render-svg.tsx +0 -21
- package/src/NFTDisplay/svg-embedder/img.tsx +0 -27
- package/src/NFTDisplay/svg-embedder/inline-svg.tsx +0 -36
- package/src/NavMenu/NavMenu.stories.jsx +0 -17
- package/src/NavMenu/images/OCAP.svg +0 -1
- package/src/NavMenu/images/abt-network.svg +0 -1
- package/src/NavMenu/images/ai-kit.svg +0 -1
- package/src/NavMenu/images/aigne-image-smith.svg +0 -1
- package/src/NavMenu/images/aigne.svg +0 -1
- package/src/NavMenu/images/aistro.png +0 -0
- package/src/NavMenu/images/arcsphere.svg +0 -1
- package/src/NavMenu/images/blocklet-framework.svg +0 -1
- package/src/NavMenu/images/blocklet-launcher.svg +0 -1
- package/src/NavMenu/images/blocklet-server.svg +0 -1
- package/src/NavMenu/images/blocklet-store.svg +0 -1
- package/src/NavMenu/images/creator-studio.svg +0 -1
- package/src/NavMenu/images/did-wallet.svg +0 -1
- package/src/NavMenu/images/did.svg +0 -1
- package/src/NavMenu/images/nft-studio.svg +0 -1
- package/src/NavMenu/images/payment-kit.png +0 -0
- package/src/NavMenu/images/vc.svg +0 -1
- package/src/NavMenu/images/web3-kit.svg +0 -1
- package/src/NavMenu/index.ts +0 -3
- package/src/NavMenu/nav-menu-context.tsx +0 -30
- package/src/NavMenu/nav-menu.tsx +0 -441
- package/src/NavMenu/products.tsx +0 -830
- package/src/NavMenu/style.ts +0 -258
- package/src/NavMenu/sub-container.tsx +0 -125
- package/src/NavMenu/sub-item-group.tsx +0 -42
- package/src/OrgTransfer/index.tsx +0 -53
- package/src/OrgTransfer/locales.ts +0 -25
- package/src/OrgTransfer/selector.tsx +0 -252
- package/src/OrgTransfer/type.ts +0 -31
- package/src/PageScroller/index.tsx +0 -316
- package/src/PageScroller/story/FifthComponent.jsx +0 -7
- package/src/PageScroller/story/FirstComponent.jsx +0 -7
- package/src/PageScroller/story/FourthComponent.jsx +0 -7
- package/src/PageScroller/story/FullPage.jsx +0 -55
- package/src/PageScroller/story/PageContain.jsx +0 -59
- package/src/PageScroller/story/PageScroller.stories.jsx +0 -18
- package/src/PageScroller/story/SecondComponent.jsx +0 -7
- package/src/PageScroller/story/ThirdComponent.jsx +0 -7
- package/src/PageScroller/story/index.css +0 -115
- package/src/PageScroller/usePrevValue.ts +0 -11
- package/src/Passport/index.ts +0 -3
- package/src/Passport/passport.tsx +0 -118
- package/src/PhoneInput/PhoneInput.stories.jsx +0 -12
- package/src/PhoneInput/country-select.tsx +0 -148
- package/src/PhoneInput/index.tsx +0 -269
- package/src/PoweredByArcBlock/index.tsx +0 -27
- package/src/PricingTable/PricingPlan.tsx +0 -120
- package/src/PricingTable/PricingTable.stories.jsx +0 -38
- package/src/PricingTable/index.tsx +0 -59
- package/src/QRCode/QRCode.stories.jsx +0 -13
- package/src/QRCode/index.tsx +0 -66
- package/src/RelativeTime/RelativeTime.stories.jsx +0 -20
- package/src/RelativeTime/index.tsx +0 -334
- package/src/Result/Result.stories.jsx +0 -61
- package/src/Result/common.tsx +0 -119
- package/src/Result/index.tsx +0 -30
- package/src/Result/result.tsx +0 -65
- package/src/Result/translations.ts +0 -57
- package/src/Screenshot/BaseScreenshot/index.tsx +0 -73
- package/src/Screenshot/BaseScreenshot/shells/Macbook.tsx +0 -38
- package/src/Screenshot/BaseScreenshot/shells/Phone.tsx +0 -35
- package/src/Screenshot/Screenshot.stories.jsx +0 -44
- package/src/Screenshot/devices.css +0 -1366
- package/src/Screenshot/index.tsx +0 -300
- package/src/SessionBlocklet/index.tsx +0 -178
- package/src/SessionManager/SessionManager.stories.jsx +0 -9
- package/src/SessionManager/index.tsx +0 -3
- package/src/SessionPermission/index.tsx +0 -26
- package/src/SessionUser/components/did-space.tsx +0 -68
- package/src/SessionUser/components/logged-in.tsx +0 -338
- package/src/SessionUser/components/quick-login-item.tsx +0 -132
- package/src/SessionUser/components/session-user-item.tsx +0 -93
- package/src/SessionUser/components/session-user-switch.tsx +0 -240
- package/src/SessionUser/components/un-login.tsx +0 -257
- package/src/SessionUser/components/user-info.tsx +0 -201
- package/src/SessionUser/index.tsx +0 -68
- package/src/SessionUser/libs/translation.ts +0 -30
- package/src/SessionUser/libs/utils.ts +0 -39
- package/src/SharedBridge/index.tsx +0 -126
- package/src/SocialShare/index.tsx +0 -194
- package/src/Sparkline/Sparkline.stories.jsx +0 -13
- package/src/Sparkline/index.tsx +0 -231
- package/src/Spinner/Spinner.stories.jsx +0 -98
- package/src/Spinner/index.tsx +0 -20
- package/src/SplitButton/SplitButton.stories.jsx +0 -32
- package/src/SplitButton/index.tsx +0 -116
- package/src/SplitButton/useClickAway.tsx +0 -24
- package/src/Success/index.tsx +0 -175
- package/src/Switch/Switch.stories.jsx +0 -16
- package/src/Switch/index.jsx +0 -79
- package/src/Tabs/Tabs.stories.jsx +0 -18
- package/src/Tabs/index.tsx +0 -255
- package/src/Tag/Tag.stories.jsx +0 -15
- package/src/Tag/index.jsx +0 -106
- package/src/TextCollapse/TextCollapse.stories.jsx +0 -73
- package/src/TextCollapse/index.tsx +0 -85
- package/src/Theme/Theme.stories.jsx +0 -11
- package/src/Theme/index.ts +0 -21
- package/src/Theme/theme-provider.tsx +0 -374
- package/src/Theme/theme.ts +0 -229
- package/src/Toast/Toast.stories.jsx +0 -28
- package/src/Toast/index.tsx +0 -80
- package/src/Typography/index.tsx +0 -124
- package/src/UserCard/Cards/avatar-only.tsx +0 -27
- package/src/UserCard/Cards/basic-info.tsx +0 -43
- package/src/UserCard/Cards/index.tsx +0 -16
- package/src/UserCard/Cards/social-actions.tsx +0 -196
- package/src/UserCard/Container/card.tsx +0 -63
- package/src/UserCard/Container/dialog.tsx +0 -37
- package/src/UserCard/Content/basic.tsx +0 -330
- package/src/UserCard/Content/clock.tsx +0 -82
- package/src/UserCard/Content/minimal.tsx +0 -113
- package/src/UserCard/Content/shorten-label.tsx +0 -32
- package/src/UserCard/Content/tooltip-avatar.tsx +0 -80
- package/src/UserCard/UserCard.stories.jsx +0 -19
- package/src/UserCard/components.tsx +0 -81
- package/src/UserCard/index.tsx +0 -132
- package/src/UserCard/types.ts +0 -165
- package/src/UserCard/use-follow.tsx +0 -111
- package/src/UserCard/utils.ts +0 -155
- package/src/Util/WebWalletOpener.stories.jsx +0 -5
- package/src/Util/client.ts +0 -4
- package/src/Util/constant.ts +0 -70
- package/src/Util/deprecate.tsx +0 -29
- package/src/Util/federated.ts +0 -125
- package/src/Util/iframe.ts +0 -19
- package/src/Util/index.ts +0 -760
- package/src/Util/logger.ts +0 -44
- package/src/Util/passport.ts +0 -127
- package/src/Util/security.ts +0 -72
- package/src/Util/style.ts +0 -17
- package/src/Util/wallet.ts +0 -35
- package/src/VerificationCode/index.tsx +0 -83
- package/src/Video/Video.stories.jsx +0 -6
- package/src/Video/index.tsx +0 -70
- package/src/Wallet/Action.stories.jsx +0 -8
- package/src/Wallet/Action.tsx +0 -118
- package/src/Wallet/Download.stories.jsx +0 -9
- package/src/Wallet/Download.tsx +0 -157
- package/src/Wallet/Open.tsx +0 -47
- package/src/Wallet/OpenInWallet.stories.jsx +0 -5
- package/src/Wallet/images/abtwallet.png +0 -0
- package/src/Wallet/images/android_download.svg +0 -22
- package/src/Wallet/images/app-store.svg +0 -30
- package/src/Wallet/images/google-play.svg +0 -69
- package/src/WalletOSIcon/index.tsx +0 -47
- package/src/WebWalletSWKeeper/index.tsx +0 -117
- package/src/WechatPrompt/images/android.png +0 -0
- package/src/WechatPrompt/images/ios.png +0 -0
- package/src/WechatPrompt/index.tsx +0 -75
- package/src/global.d.ts +0 -28
- package/src/hooks/use-blocklet-logo.tsx +0 -32
- package/src/hooks/use-clock.tsx +0 -62
- package/src/hooks/use-location-state.tsx +0 -117
- package/src/hooks/use-mobile.tsx +0 -6
- package/src/index.ts +0 -79
- package/src/type.d.ts +0 -44
- package/src/withTheme/index.tsx +0 -72
- package/src/withTracker/README.md +0 -37
- package/src/withTracker/action/bind-wallet.tsx +0 -17
- package/src/withTracker/action/login.tsx +0 -18
- package/src/withTracker/action/pay.tsx +0 -14
- package/src/withTracker/action/switch-passport.tsx +0 -20
- package/src/withTracker/constant/index.tsx +0 -3
- package/src/withTracker/env.tsx +0 -1
- package/src/withTracker/error_boundary.jsx +0 -34
- package/src/withTracker/index.tsx +0 -50
- package/src/withTracker/libs/utm.ts +0 -46
- package/vite.config.mjs +0 -37
package/src/Datatable/index.jsx
DELETED
|
@@ -1,652 +0,0 @@
|
|
|
1
|
-
/* eslint-disable react-hooks/exhaustive-deps */
|
|
2
|
-
import { useRef, isValidElement } from 'react';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
|
-
import MUIDataTable, { TableFilterList, TableFooter } from 'mui-datatables';
|
|
5
|
-
import { css } from '@emotion/react';
|
|
6
|
-
import isObject from 'lodash/isObject';
|
|
7
|
-
import cloneDeep from 'lodash/cloneDeep';
|
|
8
|
-
import get from 'lodash/get';
|
|
9
|
-
import clsx from 'clsx';
|
|
10
|
-
import { useCreation, useDeepCompareEffect } from 'ahooks';
|
|
11
|
-
import { CircularProgress } from '@mui/material';
|
|
12
|
-
|
|
13
|
-
import Empty from '../Empty';
|
|
14
|
-
import CustomToolbar from './CustomToolbar';
|
|
15
|
-
import { DatatableProvider as DataTableProvider, useDatatableContext } from './DatatableContext';
|
|
16
|
-
import { styled } from '../Theme';
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* @typedef {{
|
|
20
|
-
* icon: import('react').ReactElement,
|
|
21
|
-
* title: import('react').ReactElement | string,
|
|
22
|
-
* onClick?: () => void
|
|
23
|
-
* }} DataTableCustomButton
|
|
24
|
-
*/
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* @typedef {{
|
|
28
|
-
* name: string,
|
|
29
|
-
* width?: number,
|
|
30
|
-
* align?: 'left' | 'center' | 'right',
|
|
31
|
-
* } & import('mui-datatables').MUIDataTableColumnDef} DataTableColumn
|
|
32
|
-
*/
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* @typedef {Pick<import('mui-datatables').MUIDataTableState, 'count' | 'page' | 'rowsPerPage' | 'searchText' | 'sortOrder' | 'filterList'>} DataTableState
|
|
36
|
-
*/
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* @typedef {{
|
|
40
|
-
* title?: import('react').ReactElement | string, // The title of the table (optional)
|
|
41
|
-
* } & Omit<import('mui-datatables').MUIDataTableProps, 'title'>} ModifiedMUIDataTableProps
|
|
42
|
-
*/
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* @typedef {{
|
|
46
|
-
* data: Array<object | number[] | string[]>,
|
|
47
|
-
* columns: Array<DataTableColumn>,
|
|
48
|
-
* locale?: import('../type').Locale,
|
|
49
|
-
* options?: { searchDebounceTime?: number } & import('mui-datatables').MUIDataTableOptions,
|
|
50
|
-
* style?: import('react').CSSProperties,
|
|
51
|
-
* customButtons?: Array<DataTableCustomButton>,
|
|
52
|
-
* customPreButtons?: Array<DataTableCustomButton>,
|
|
53
|
-
* onChange?: (state: DataTableState, action: string) => void | Promise<void>,
|
|
54
|
-
* loading?: false | true,
|
|
55
|
-
* disabled?: false | true,
|
|
56
|
-
* stripped?: false | true,
|
|
57
|
-
* verticalKeyWidth?: number | string,
|
|
58
|
-
* hideTableHeader?: false | true,
|
|
59
|
-
* components?: ModifiedMUIDataTableProps['components'],
|
|
60
|
-
* emptyNode?: import('react').ReactNode,
|
|
61
|
-
* durable?: string,
|
|
62
|
-
* durableKeys?: 'page' | 'rowsPerPage' | 'searchText' | 'sortOrder',
|
|
63
|
-
* bgColor?: string,
|
|
64
|
-
* hoverColor?: string,
|
|
65
|
-
* stripColor?: string
|
|
66
|
-
* } & ModifiedMUIDataTableProps} DataTableProps
|
|
67
|
-
*/
|
|
68
|
-
|
|
69
|
-
const FilterLine = styled('div')`
|
|
70
|
-
display: flex;
|
|
71
|
-
align-items: center;
|
|
72
|
-
.toolbar-filter-content {
|
|
73
|
-
margin-bottom: 8px;
|
|
74
|
-
}
|
|
75
|
-
.toolbar-filter-title {
|
|
76
|
-
font-weight: 700;
|
|
77
|
-
font-size: 14px;
|
|
78
|
-
}
|
|
79
|
-
`;
|
|
80
|
-
|
|
81
|
-
function WrapFilterList({ ...props }) {
|
|
82
|
-
const { filterLabel } = useDatatableContext();
|
|
83
|
-
const hasFilter = !!(props.filterList ?? []).filter((e) => e.length).length;
|
|
84
|
-
if (hasFilter) {
|
|
85
|
-
return (
|
|
86
|
-
<FilterLine>
|
|
87
|
-
{hasFilter && <div className="toolbar-filter-title">{filterLabel}</div>}
|
|
88
|
-
<div className="toolbar-filter-content">
|
|
89
|
-
<TableFilterList {...props} />
|
|
90
|
-
</div>
|
|
91
|
-
</FilterLine>
|
|
92
|
-
);
|
|
93
|
-
}
|
|
94
|
-
return '';
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
WrapFilterList.propTypes = {
|
|
98
|
-
filterList: PropTypes.array,
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
function WrapTableFooter(props) {
|
|
102
|
-
const { loading, disabled } = useDatatableContext();
|
|
103
|
-
|
|
104
|
-
return (
|
|
105
|
-
<FooterContainer>
|
|
106
|
-
<div className={`datatable-footer ${loading || disabled ? 'datatable-footer-disabled' : ''}`}>
|
|
107
|
-
<TableFooter {...props} />
|
|
108
|
-
</div>
|
|
109
|
-
</FooterContainer>
|
|
110
|
-
);
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
export const getDurableData = (key) => {
|
|
114
|
-
const durableKey = `datatable-durable-${key}`;
|
|
115
|
-
let localData = localStorage[durableKey];
|
|
116
|
-
if (localData) {
|
|
117
|
-
try {
|
|
118
|
-
localData = JSON.parse(localData);
|
|
119
|
-
} catch (err) {
|
|
120
|
-
console.error(`parse durable data error (key:${key}) => `, err);
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
return localData || {};
|
|
124
|
-
};
|
|
125
|
-
|
|
126
|
-
/**
|
|
127
|
-
* @description
|
|
128
|
-
* @export
|
|
129
|
-
* @param {DataTableProps} props
|
|
130
|
-
* @return {import('react').ReactComponentElement}
|
|
131
|
-
*/
|
|
132
|
-
export default function DataTable(props) {
|
|
133
|
-
return (
|
|
134
|
-
<DataTableProvider>
|
|
135
|
-
<ReDataTable {...props} />
|
|
136
|
-
</DataTableProvider>
|
|
137
|
-
);
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
const fixCellProp = (tempObj, cellProps) => {
|
|
141
|
-
const cellStyle = {};
|
|
142
|
-
|
|
143
|
-
if (tempObj.align) {
|
|
144
|
-
cellProps.className = clsx(cellProps.className, `pc-align-${tempObj.align}`);
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
if (tempObj.verticalKeyAlign) {
|
|
148
|
-
cellProps.className = clsx(cellProps.className, `vertical-align-${tempObj.verticalKeyAlign}`);
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
if (tempObj.minWidth) {
|
|
152
|
-
cellStyle.minWidth = tempObj.minWidth;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
cellProps.style = Object.assign({}, cellProps.style, cellStyle);
|
|
156
|
-
};
|
|
157
|
-
|
|
158
|
-
/**
|
|
159
|
-
* @param {Object} props.options The options of mui-datatable,detail see https://github.com/gregnb/mui-datatables/tree/b8d2eee6af4589d254b40918e5d7e70b1ee4baca
|
|
160
|
-
* @param {Array} props.customButtons Custom buttons for toolbar
|
|
161
|
-
* @param {Function} props.onChange When onChange is present, serverSide mode is activated by default https://github.com/gregnb/mui-datatables/tree/b8d2eee6af4589d254b40918e5d7e70b1ee4baca#remote-data
|
|
162
|
-
* @param {Boolean} props.loading For dynamic data, usually used with onChange
|
|
163
|
-
* @returns
|
|
164
|
-
*/
|
|
165
|
-
function ReDataTable({
|
|
166
|
-
data: originData,
|
|
167
|
-
columns: originColumns,
|
|
168
|
-
locale = 'en',
|
|
169
|
-
options = {}, // The options object is usually a property supported by mui-datatable
|
|
170
|
-
style = {},
|
|
171
|
-
customPreButtons = [],
|
|
172
|
-
customButtons = [],
|
|
173
|
-
onChange = '',
|
|
174
|
-
loading = false,
|
|
175
|
-
disabled = false,
|
|
176
|
-
stripped = false,
|
|
177
|
-
verticalKeyWidth = '',
|
|
178
|
-
hideTableHeader = false,
|
|
179
|
-
components = {},
|
|
180
|
-
emptyNode = '',
|
|
181
|
-
durable = '',
|
|
182
|
-
durableKeys = ['page', 'rowsPerPage', 'searchText', 'sortOrder'],
|
|
183
|
-
bgColor = 'transparent',
|
|
184
|
-
hoverColor = '',
|
|
185
|
-
stripColor = '',
|
|
186
|
-
...rest
|
|
187
|
-
}) {
|
|
188
|
-
const oldState = useRef(null);
|
|
189
|
-
const { setCustomPreButtons, setCustomButtons, setFilterLabel, setLoading, setDisabled } = useDatatableContext();
|
|
190
|
-
|
|
191
|
-
const disabledCellStyle = {
|
|
192
|
-
cursor: 'not-allowed',
|
|
193
|
-
pointerEvents: 'none',
|
|
194
|
-
};
|
|
195
|
-
|
|
196
|
-
const keys = [];
|
|
197
|
-
|
|
198
|
-
// Convert Columns fields to object sets to support the width function
|
|
199
|
-
const columns = originColumns.map((e) => {
|
|
200
|
-
let tempObj;
|
|
201
|
-
|
|
202
|
-
if (!isObject(e)) {
|
|
203
|
-
tempObj = {
|
|
204
|
-
label: e,
|
|
205
|
-
name: e,
|
|
206
|
-
};
|
|
207
|
-
} else {
|
|
208
|
-
tempObj = cloneDeep(e);
|
|
209
|
-
}
|
|
210
|
-
keys.push(tempObj.name);
|
|
211
|
-
|
|
212
|
-
if (!tempObj.align) {
|
|
213
|
-
// There must be an align default for setCellRender to take effect, this is a bug in mui-datatable
|
|
214
|
-
tempObj.align = 'left';
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
if (!tempObj.options) {
|
|
218
|
-
tempObj.options = {};
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
const { setCellHeaderProps, setCellProps } = tempObj.options;
|
|
222
|
-
|
|
223
|
-
tempObj.options.setCellHeaderProps = (...args) => {
|
|
224
|
-
let cellProps = {
|
|
225
|
-
className: '',
|
|
226
|
-
};
|
|
227
|
-
|
|
228
|
-
// Complementing width while inheriting old setCellHeaderProps
|
|
229
|
-
if (setCellHeaderProps && !setCellHeaderProps.__innerFunc) {
|
|
230
|
-
cellProps = {
|
|
231
|
-
...cellProps,
|
|
232
|
-
...(setCellHeaderProps(...args) || {}),
|
|
233
|
-
};
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
if (loading || disabled) {
|
|
237
|
-
cellProps = { ...cellProps, style: disabledCellStyle };
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
if (tempObj.width) {
|
|
241
|
-
cellProps.width = tempObj.width;
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
fixCellProp(tempObj, cellProps);
|
|
245
|
-
|
|
246
|
-
return cellProps;
|
|
247
|
-
};
|
|
248
|
-
|
|
249
|
-
// Prevent memory xie caused by recursive forwarding of setCellHeaderProps functions
|
|
250
|
-
tempObj.options.setCellHeaderProps.__innerFunc = 1;
|
|
251
|
-
|
|
252
|
-
if (tempObj.align || tempObj.style) {
|
|
253
|
-
tempObj.options.setCellProps = (...args) => {
|
|
254
|
-
let cellProps = {
|
|
255
|
-
className: '',
|
|
256
|
-
};
|
|
257
|
-
|
|
258
|
-
// Complementing width while inheriting old setCellHeaderProps
|
|
259
|
-
if (setCellProps && !setCellProps.__innerFunc) {
|
|
260
|
-
cellProps = {
|
|
261
|
-
...cellProps,
|
|
262
|
-
...(setCellProps(...args) || {}),
|
|
263
|
-
};
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
fixCellProp(tempObj, cellProps);
|
|
267
|
-
|
|
268
|
-
return cellProps;
|
|
269
|
-
};
|
|
270
|
-
tempObj.options.setCellProps.__innerFunc = 1;
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
return tempObj;
|
|
274
|
-
});
|
|
275
|
-
|
|
276
|
-
const data = useCreation(() => {
|
|
277
|
-
return originData.map((e) => {
|
|
278
|
-
if (!Array.isArray(e) && isObject(e)) {
|
|
279
|
-
return keys.map((key) => get(e, key));
|
|
280
|
-
}
|
|
281
|
-
return e;
|
|
282
|
-
});
|
|
283
|
-
}, [originData, keys]);
|
|
284
|
-
|
|
285
|
-
useDeepCompareEffect(() => setCustomButtons(customButtons || []), [customButtons]);
|
|
286
|
-
useDeepCompareEffect(() => setCustomPreButtons(customPreButtons || []), [customPreButtons]);
|
|
287
|
-
useDeepCompareEffect(() => setLoading(loading), [loading]);
|
|
288
|
-
useDeepCompareEffect(() => setDisabled(disabled), [disabled]);
|
|
289
|
-
|
|
290
|
-
let emptyEl;
|
|
291
|
-
if (loading) {
|
|
292
|
-
emptyEl = <CircularProgress color="primary" />;
|
|
293
|
-
} else if (isValidElement(emptyNode)) {
|
|
294
|
-
emptyEl = emptyNode;
|
|
295
|
-
} else if (locale === 'zh') {
|
|
296
|
-
emptyEl = <Empty>{emptyNode || '没有找到匹配的记录'}</Empty>;
|
|
297
|
-
} else {
|
|
298
|
-
emptyEl = <Empty>{emptyNode || 'No matching records found'}</Empty>;
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
let textLabels = {
|
|
302
|
-
body: {
|
|
303
|
-
noMatch: emptyEl,
|
|
304
|
-
toolTip: 'Sort',
|
|
305
|
-
},
|
|
306
|
-
pagination: {
|
|
307
|
-
next: 'Next Page',
|
|
308
|
-
previous: 'Previous Page',
|
|
309
|
-
rowsPerPage: 'Per page:',
|
|
310
|
-
displayRows: 'of',
|
|
311
|
-
jumpToPage: 'Jump to Page:',
|
|
312
|
-
},
|
|
313
|
-
toolbar: {
|
|
314
|
-
search: 'Search',
|
|
315
|
-
downloadCsv: 'Download CSV',
|
|
316
|
-
print: 'Print',
|
|
317
|
-
viewColumns: 'View Columns',
|
|
318
|
-
filterTable: 'Filter Table',
|
|
319
|
-
},
|
|
320
|
-
filter: { all: 'All', title: 'FILTERS', reset: 'RESET' },
|
|
321
|
-
viewColumns: { title: 'Show Columns', titleAria: 'Show/Hide Table Columns' },
|
|
322
|
-
selectedRows: { text: 'row(s) selected', delete: 'Delete', deleteAria: 'Delete Selected Rows' },
|
|
323
|
-
};
|
|
324
|
-
|
|
325
|
-
if (locale === 'zh') {
|
|
326
|
-
textLabels = {
|
|
327
|
-
body: { noMatch: emptyEl, toolTip: '排序' },
|
|
328
|
-
pagination: {
|
|
329
|
-
next: '下一页',
|
|
330
|
-
previous: '上一页',
|
|
331
|
-
rowsPerPage: '每页行数',
|
|
332
|
-
displayRows: '/',
|
|
333
|
-
jumpToPage: '跳转到页面:',
|
|
334
|
-
},
|
|
335
|
-
toolbar: {
|
|
336
|
-
search: '搜索',
|
|
337
|
-
downloadCsv: '下载CSV',
|
|
338
|
-
print: '打印',
|
|
339
|
-
viewColumns: '查看列',
|
|
340
|
-
filterTable: '筛选表格',
|
|
341
|
-
},
|
|
342
|
-
filter: { all: '全部', title: '筛选器', reset: '重置' },
|
|
343
|
-
viewColumns: { title: '显示的列', titleAria: '显示/隐藏 表格的列' },
|
|
344
|
-
selectedRows: { text: '个已选项目', delete: '删除', deleteAria: '删除所选项目' },
|
|
345
|
-
};
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
useDeepCompareEffect(() => setFilterLabel(textLabels.filter.title), [textLabels.filter.title]);
|
|
349
|
-
|
|
350
|
-
const durableData = getDurableData(durable);
|
|
351
|
-
|
|
352
|
-
const opts = {
|
|
353
|
-
selectableRows: 'none',
|
|
354
|
-
textLabels,
|
|
355
|
-
rowsPerPage: 10,
|
|
356
|
-
rowsPerPageOptions: [10, 20, 50],
|
|
357
|
-
...durableData,
|
|
358
|
-
...options,
|
|
359
|
-
// Wrap the more friendly onChange callback by listening to onTableChange,
|
|
360
|
-
// which will only be triggered when the table key state changes
|
|
361
|
-
onTableChange: (action, tableState) => {
|
|
362
|
-
if (action === 'propsUpdate') {
|
|
363
|
-
return;
|
|
364
|
-
}
|
|
365
|
-
const state = {
|
|
366
|
-
count: tableState.count,
|
|
367
|
-
page: tableState.page,
|
|
368
|
-
rowsPerPage: tableState.rowsPerPage,
|
|
369
|
-
searchText: tableState.searchText,
|
|
370
|
-
sortOrder: tableState.sortOrder, //
|
|
371
|
-
filterList: tableState.filterList,
|
|
372
|
-
};
|
|
373
|
-
|
|
374
|
-
if (durable) {
|
|
375
|
-
const needSaveState = {};
|
|
376
|
-
|
|
377
|
-
durableKeys.forEach((key) => {
|
|
378
|
-
needSaveState[key] = state[key];
|
|
379
|
-
});
|
|
380
|
-
|
|
381
|
-
localStorage.setItem(`datatable-durable-${durable}`, JSON.stringify(needSaveState));
|
|
382
|
-
}
|
|
383
|
-
|
|
384
|
-
const stateStr = JSON.stringify(state);
|
|
385
|
-
if (stateStr === oldState.current) {
|
|
386
|
-
return;
|
|
387
|
-
}
|
|
388
|
-
oldState.current = stateStr;
|
|
389
|
-
if (onChange) {
|
|
390
|
-
onChange(state, action);
|
|
391
|
-
}
|
|
392
|
-
},
|
|
393
|
-
};
|
|
394
|
-
|
|
395
|
-
if (onChange) {
|
|
396
|
-
opts.serverSide = true;
|
|
397
|
-
}
|
|
398
|
-
|
|
399
|
-
const props = {
|
|
400
|
-
options: opts,
|
|
401
|
-
...rest,
|
|
402
|
-
components: {
|
|
403
|
-
TableToolbar: CustomToolbar,
|
|
404
|
-
TableFooter: WrapTableFooter,
|
|
405
|
-
TableFilterList: WrapFilterList,
|
|
406
|
-
...components,
|
|
407
|
-
},
|
|
408
|
-
};
|
|
409
|
-
|
|
410
|
-
return (
|
|
411
|
-
<TableContainer
|
|
412
|
-
verticalKeyWidth={verticalKeyWidth}
|
|
413
|
-
bgColor={bgColor}
|
|
414
|
-
hoverColor={hoverColor}
|
|
415
|
-
stripColor={stripColor}
|
|
416
|
-
className={clsx({
|
|
417
|
-
'datatable-stripped': stripped,
|
|
418
|
-
'datatable-hide-header': hideTableHeader,
|
|
419
|
-
})}
|
|
420
|
-
style={style}>
|
|
421
|
-
<MUIDataTable data={data} columns={columns} {...props} />
|
|
422
|
-
</TableContainer>
|
|
423
|
-
);
|
|
424
|
-
}
|
|
425
|
-
|
|
426
|
-
ReDataTable.propTypes = {
|
|
427
|
-
data: PropTypes.array.isRequired,
|
|
428
|
-
columns: PropTypes.array.isRequired,
|
|
429
|
-
options: PropTypes.object,
|
|
430
|
-
style: PropTypes.object,
|
|
431
|
-
locale: PropTypes.string,
|
|
432
|
-
loading: PropTypes.bool,
|
|
433
|
-
disabled: PropTypes.bool,
|
|
434
|
-
customPreButtons: PropTypes.array,
|
|
435
|
-
customButtons: PropTypes.array,
|
|
436
|
-
onChange: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
|
|
437
|
-
stripped: PropTypes.bool,
|
|
438
|
-
verticalKeyWidth: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
439
|
-
hideTableHeader: PropTypes.bool,
|
|
440
|
-
components: PropTypes.object,
|
|
441
|
-
emptyNode: PropTypes.node,
|
|
442
|
-
durable: PropTypes.string,
|
|
443
|
-
durableKeys: PropTypes.array,
|
|
444
|
-
bgColor: PropTypes.string,
|
|
445
|
-
hoverColor: PropTypes.string,
|
|
446
|
-
stripColor: PropTypes.string,
|
|
447
|
-
};
|
|
448
|
-
|
|
449
|
-
const alignCss = css`
|
|
450
|
-
.MuiTableCell-head {
|
|
451
|
-
[class*='MUIDataTableHeadCell-toolButton'] {
|
|
452
|
-
width: 100%;
|
|
453
|
-
> [class*='MUIDataTableHeadCell-sortAction'] {
|
|
454
|
-
width: 100%;
|
|
455
|
-
}
|
|
456
|
-
}
|
|
457
|
-
&.pc-align-center {
|
|
458
|
-
text-align: center;
|
|
459
|
-
[class*='MUIDataTableHeadCell-toolButton'] > [class*='MUIDataTableHeadCell-sortAction'] {
|
|
460
|
-
justify-content: center;
|
|
461
|
-
}
|
|
462
|
-
}
|
|
463
|
-
&.pc-align-right {
|
|
464
|
-
text-align: right;
|
|
465
|
-
[class*='MUIDataTableHeadCell-toolButton'] {
|
|
466
|
-
margin-right: 0;
|
|
467
|
-
padding-right: 0;
|
|
468
|
-
& > [class*='MUIDataTableHeadCell-sortAction'] {
|
|
469
|
-
justify-content: flex-end;
|
|
470
|
-
}
|
|
471
|
-
}
|
|
472
|
-
}
|
|
473
|
-
}
|
|
474
|
-
.MuiTableCell-body {
|
|
475
|
-
&.pc-align-center {
|
|
476
|
-
text-align: center;
|
|
477
|
-
}
|
|
478
|
-
&.pc-align-right {
|
|
479
|
-
text-align: right;
|
|
480
|
-
}
|
|
481
|
-
}
|
|
482
|
-
`;
|
|
483
|
-
|
|
484
|
-
const TableContainer = styled('div', {
|
|
485
|
-
shouldForwardProp: (prop) => !['verticalKeyWidth', 'bgColor', 'hoverColor', 'stripColor'].includes(prop),
|
|
486
|
-
})(({ theme, verticalKeyWidth, bgColor, hoverColor, stripColor }) => {
|
|
487
|
-
const primaryTextColor = theme.palette.text.primary;
|
|
488
|
-
const defaultHoverColor = theme.palette.action.hover;
|
|
489
|
-
const defaultStripColor = theme.palette.grey[50];
|
|
490
|
-
|
|
491
|
-
const verticalKeyWidthStyle = verticalKeyWidth
|
|
492
|
-
? `
|
|
493
|
-
${theme.breakpoints.down('md')} {
|
|
494
|
-
[class*='MUIDataTable-responsiveBase'] {
|
|
495
|
-
tr:not([class*='responsiveSimple']) {
|
|
496
|
-
td.MuiTableCell-body {
|
|
497
|
-
> div {
|
|
498
|
-
&:first-of-type {
|
|
499
|
-
width: ${verticalKeyWidth + (!/\D/.test(verticalKeyWidth) ? 'px' : '')};
|
|
500
|
-
}
|
|
501
|
-
}
|
|
502
|
-
}
|
|
503
|
-
}
|
|
504
|
-
}
|
|
505
|
-
}
|
|
506
|
-
`
|
|
507
|
-
: '';
|
|
508
|
-
|
|
509
|
-
return css`
|
|
510
|
-
&.datatable-hide-header {
|
|
511
|
-
thead.MuiTableHead-root {
|
|
512
|
-
display: none;
|
|
513
|
-
}
|
|
514
|
-
}
|
|
515
|
-
|
|
516
|
-
td {
|
|
517
|
-
&.vertical-align-top {
|
|
518
|
-
align-items: flex-start;
|
|
519
|
-
}
|
|
520
|
-
&.vertical-align-center {
|
|
521
|
-
align-items: center;
|
|
522
|
-
}
|
|
523
|
-
&.vertical-align-bottom {
|
|
524
|
-
align-items: flex-end;
|
|
525
|
-
}
|
|
526
|
-
}
|
|
527
|
-
|
|
528
|
-
height: 100%;
|
|
529
|
-
> .MuiPaper-root {
|
|
530
|
-
display: flex;
|
|
531
|
-
flex-direction: column;
|
|
532
|
-
height: 100%;
|
|
533
|
-
box-shadow: none;
|
|
534
|
-
background: none;
|
|
535
|
-
background-color: ${bgColor};
|
|
536
|
-
}
|
|
537
|
-
${theme.breakpoints.down('md')} {
|
|
538
|
-
td.MuiTableCell-body {
|
|
539
|
-
padding-right: 0;
|
|
540
|
-
}
|
|
541
|
-
[class*='MUIDataTable-responsiveBase'] {
|
|
542
|
-
tr:not([class*='responsiveSimple']) {
|
|
543
|
-
td.MuiTableCell-body {
|
|
544
|
-
display: flex;
|
|
545
|
-
> div {
|
|
546
|
-
width: auto;
|
|
547
|
-
flex: 1;
|
|
548
|
-
&:first-of-type {
|
|
549
|
-
font-weight: bold;
|
|
550
|
-
font-size: 14px;
|
|
551
|
-
width: auto;
|
|
552
|
-
flex: 0 0 auto;
|
|
553
|
-
padding-right: 16px;
|
|
554
|
-
&:empty {
|
|
555
|
-
padding-right: 0;
|
|
556
|
-
}
|
|
557
|
-
}
|
|
558
|
-
}
|
|
559
|
-
}
|
|
560
|
-
}
|
|
561
|
-
}
|
|
562
|
-
}
|
|
563
|
-
${theme.breakpoints.up('md')} {
|
|
564
|
-
${alignCss}
|
|
565
|
-
}
|
|
566
|
-
${theme.breakpoints.up('sm')} {
|
|
567
|
-
[class*='responsiveSimple'] {
|
|
568
|
-
${alignCss}
|
|
569
|
-
}
|
|
570
|
-
}
|
|
571
|
-
|
|
572
|
-
${verticalKeyWidthStyle}
|
|
573
|
-
|
|
574
|
-
.MuiTableCell-head {
|
|
575
|
-
color: ${primaryTextColor};
|
|
576
|
-
background-color: ${bgColor};
|
|
577
|
-
}
|
|
578
|
-
|
|
579
|
-
.MuiTableCell-root {
|
|
580
|
-
color: ${primaryTextColor};
|
|
581
|
-
}
|
|
582
|
-
|
|
583
|
-
.MuiTableRow-root {
|
|
584
|
-
background-color: ${bgColor};
|
|
585
|
-
&:hover {
|
|
586
|
-
background-color: ${hoverColor || defaultHoverColor};
|
|
587
|
-
}
|
|
588
|
-
&.MuiTableRow-footer {
|
|
589
|
-
background-color: ${bgColor};
|
|
590
|
-
}
|
|
591
|
-
}
|
|
592
|
-
|
|
593
|
-
&.datatable-stripped {
|
|
594
|
-
.MuiTableRow-root:nth-of-type(odd) {
|
|
595
|
-
background-color: ${stripColor || defaultStripColor};
|
|
596
|
-
&:hover {
|
|
597
|
-
background-color: ${hoverColor || defaultHoverColor};
|
|
598
|
-
}
|
|
599
|
-
&.MuiTableRow-head {
|
|
600
|
-
background-color: ${bgColor};
|
|
601
|
-
}
|
|
602
|
-
&.MuiTableRow-footer {
|
|
603
|
-
background-color: ${bgColor};
|
|
604
|
-
}
|
|
605
|
-
}
|
|
606
|
-
}
|
|
607
|
-
`;
|
|
608
|
-
});
|
|
609
|
-
|
|
610
|
-
const FooterContainer = styled('div')`
|
|
611
|
-
display: flex;
|
|
612
|
-
align-items: center;
|
|
613
|
-
.datatable-footer {
|
|
614
|
-
position: relative;
|
|
615
|
-
margin-left: auto;
|
|
616
|
-
&.datatable-footer-disabled {
|
|
617
|
-
position: relative;
|
|
618
|
-
.MuiTablePagination-root {
|
|
619
|
-
opacity: 0.6;
|
|
620
|
-
}
|
|
621
|
-
&:after {
|
|
622
|
-
position: absolute;
|
|
623
|
-
display: block;
|
|
624
|
-
z-index: 2;
|
|
625
|
-
width: 100%;
|
|
626
|
-
height: 100%;
|
|
627
|
-
left: 0;
|
|
628
|
-
top: 0;
|
|
629
|
-
content: '';
|
|
630
|
-
cursor: not-allowed;
|
|
631
|
-
}
|
|
632
|
-
}
|
|
633
|
-
}
|
|
634
|
-
|
|
635
|
-
${(props) => props.theme.breakpoints.down('sm')} {
|
|
636
|
-
.MuiTableCell-footer,
|
|
637
|
-
.MuiToolbar-gutters {
|
|
638
|
-
padding: 0;
|
|
639
|
-
}
|
|
640
|
-
|
|
641
|
-
div[variant='standard'] {
|
|
642
|
-
margin-left: 4px;
|
|
643
|
-
margin-right: 16px;
|
|
644
|
-
}
|
|
645
|
-
|
|
646
|
-
.MuiTablePagination-actions {
|
|
647
|
-
margin-left: 10px;
|
|
648
|
-
}
|
|
649
|
-
}
|
|
650
|
-
`;
|
|
651
|
-
|
|
652
|
-
export { TableFilterList, TableFooter };
|