@blocklet/payment-react 1.14.21 → 1.14.23
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/README.md +77 -0
- package/es/checkout/donate.d.ts +4 -2
- package/es/checkout/donate.js +13 -10
- package/es/checkout/form.d.ts +1 -1
- package/es/checkout/form.js +50 -4
- package/es/checkout/table.d.ts +1 -1
- package/es/checkout/table.js +11 -1
- package/es/components/blockchain/tx.js +2 -1
- package/es/components/country-select.d.ts +16 -0
- package/es/components/country-select.js +82 -0
- package/es/components/input.d.ts +21 -21
- package/es/components/input.js +43 -42
- package/es/components/livemode.js +1 -0
- package/es/components/pricing-table.js +0 -2
- package/es/components/status.js +2 -3
- package/es/components/table.d.ts +2 -0
- package/es/components/table.js +186 -0
- package/es/contexts/payment.d.ts +2 -0
- package/es/contexts/payment.js +5 -2
- package/es/history/invoice/list.d.ts +3 -1
- package/es/history/invoice/list.js +215 -48
- package/es/hooks/mobile.d.ts +4 -0
- package/es/hooks/mobile.js +10 -0
- package/es/index.d.ts +5 -1
- package/es/index.js +7 -1
- package/es/libs/util.d.ts +21 -8
- package/es/libs/util.js +92 -28
- package/es/locales/en.js +22 -7
- package/es/locales/index.d.ts +0 -1
- package/es/locales/index.js +10 -1
- package/es/locales/zh.js +21 -6
- package/es/payment/error.js +2 -2
- package/es/payment/footer.js +1 -1
- package/es/payment/form/address.d.ts +9 -2
- package/es/payment/form/address.js +69 -69
- package/es/payment/form/currency.js +39 -25
- package/es/payment/form/index.d.ts +1 -1
- package/es/payment/form/index.js +83 -81
- package/es/payment/form/phone.js +15 -51
- package/es/payment/index.d.ts +3 -10
- package/es/payment/index.js +295 -224
- package/es/payment/product-card.js +4 -4
- package/es/payment/product-donation.js +9 -3
- package/es/payment/product-item.d.ts +2 -2
- package/es/payment/product-item.js +120 -81
- package/es/payment/summary.js +188 -118
- package/es/theme/index.css +240 -0
- package/es/theme/index.d.ts +14 -0
- package/es/theme/index.js +256 -0
- package/es/theme/typography.d.ts +2 -0
- package/es/theme/typography.js +53 -0
- package/es/types/index.d.ts +16 -0
- package/lib/checkout/donate.d.ts +4 -2
- package/lib/checkout/donate.js +23 -2
- package/lib/checkout/form.d.ts +1 -1
- package/lib/checkout/form.js +60 -15
- package/lib/checkout/table.d.ts +1 -1
- package/lib/checkout/table.js +22 -1
- package/lib/components/blockchain/tx.js +4 -1
- package/lib/components/country-select.d.ts +16 -0
- package/lib/components/country-select.js +115 -0
- package/lib/components/input.d.ts +21 -21
- package/lib/components/input.js +21 -12
- package/lib/components/livemode.js +1 -0
- package/lib/components/pricing-table.js +0 -2
- package/lib/components/status.js +2 -3
- package/lib/components/table.d.ts +2 -0
- package/lib/components/table.js +220 -0
- package/lib/contexts/payment.d.ts +2 -0
- package/lib/contexts/payment.js +4 -1
- package/lib/history/invoice/list.d.ts +3 -1
- package/lib/history/invoice/list.js +290 -62
- package/lib/hooks/mobile.d.ts +4 -0
- package/lib/hooks/mobile.js +17 -0
- package/lib/index.d.ts +5 -1
- package/lib/index.js +36 -0
- package/lib/libs/util.d.ts +21 -8
- package/lib/libs/util.js +115 -37
- package/lib/locales/en.js +22 -7
- package/lib/locales/index.d.ts +0 -1
- package/lib/locales/index.js +14 -3
- package/lib/locales/zh.js +21 -6
- package/lib/payment/error.js +5 -1
- package/lib/payment/footer.js +1 -1
- package/lib/payment/form/address.d.ts +9 -2
- package/lib/payment/form/address.js +67 -59
- package/lib/payment/form/currency.js +31 -24
- package/lib/payment/form/index.d.ts +1 -1
- package/lib/payment/form/index.js +92 -93
- package/lib/payment/form/phone.js +11 -59
- package/lib/payment/index.d.ts +3 -10
- package/lib/payment/index.js +302 -225
- package/lib/payment/product-card.js +5 -4
- package/lib/payment/product-donation.js +11 -7
- package/lib/payment/product-item.d.ts +2 -2
- package/lib/payment/product-item.js +38 -19
- package/lib/payment/summary.js +219 -127
- package/lib/theme/index.css +240 -0
- package/lib/theme/index.d.ts +14 -0
- package/lib/theme/index.js +273 -0
- package/lib/theme/typography.d.ts +2 -0
- package/lib/theme/typography.js +59 -0
- package/lib/types/index.d.ts +16 -0
- package/package.json +14 -11
- package/src/checkout/donate.tsx +25 -11
- package/src/checkout/form.tsx +63 -15
- package/src/checkout/table.tsx +20 -1
- package/src/components/blockchain/tx.tsx +2 -1
- package/src/components/country-select.tsx +93 -0
- package/src/components/input.tsx +49 -46
- package/src/components/livemode.tsx +1 -0
- package/src/components/pricing-table.tsx +0 -2
- package/src/components/status.tsx +1 -2
- package/src/components/table.tsx +200 -0
- package/src/contexts/payment.tsx +6 -1
- package/src/history/invoice/list.tsx +254 -49
- package/src/hooks/mobile.ts +13 -0
- package/src/index.ts +7 -0
- package/src/libs/util.ts +120 -31
- package/src/locales/en.tsx +18 -4
- package/src/locales/index.tsx +10 -3
- package/src/locales/zh.tsx +17 -3
- package/src/payment/error.tsx +2 -2
- package/src/payment/footer.tsx +1 -1
- package/src/payment/form/address.tsx +56 -47
- package/src/payment/form/currency.tsx +29 -23
- package/src/payment/form/index.tsx +89 -76
- package/src/payment/form/phone.tsx +14 -51
- package/src/payment/index.tsx +298 -231
- package/src/payment/product-card.tsx +4 -4
- package/src/payment/product-donation.tsx +9 -4
- package/src/payment/product-item.tsx +49 -20
- package/src/payment/summary.tsx +191 -108
- package/src/theme/index.css +240 -0
- package/src/theme/index.tsx +271 -0
- package/src/theme/typography.ts +56 -0
- package/src/types/index.ts +17 -0
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
module.exports = CountrySelect;
|
|
7
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
8
|
+
var _react = require("react");
|
|
9
|
+
var _material = require("@mui/material");
|
|
10
|
+
var _reactHookForm = require("react-hook-form");
|
|
11
|
+
var _reactInternationalPhone = require("react-international-phone");
|
|
12
|
+
CountrySelect.defaultProps = {
|
|
13
|
+
sx: {}
|
|
14
|
+
};
|
|
15
|
+
function CountrySelect({
|
|
16
|
+
value,
|
|
17
|
+
onChange,
|
|
18
|
+
name,
|
|
19
|
+
sx
|
|
20
|
+
}) {
|
|
21
|
+
const {
|
|
22
|
+
setValue
|
|
23
|
+
} = (0, _reactHookForm.useFormContext)();
|
|
24
|
+
const countryDetail = (0, _react.useMemo)(() => {
|
|
25
|
+
const item = _reactInternationalPhone.defaultCountries.find(v => v[1] === value);
|
|
26
|
+
return value && item ? (0, _reactInternationalPhone.parseCountry)(item) : {
|
|
27
|
+
name: ""
|
|
28
|
+
};
|
|
29
|
+
}, [value]);
|
|
30
|
+
const onCountryChange = e => {
|
|
31
|
+
onChange(e.target.value);
|
|
32
|
+
setValue(name, e.target.value);
|
|
33
|
+
};
|
|
34
|
+
return /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Select, {
|
|
35
|
+
MenuProps: {
|
|
36
|
+
style: {
|
|
37
|
+
height: "300px",
|
|
38
|
+
top: "10px"
|
|
39
|
+
},
|
|
40
|
+
anchorOrigin: {
|
|
41
|
+
vertical: "bottom",
|
|
42
|
+
horizontal: "left"
|
|
43
|
+
},
|
|
44
|
+
transformOrigin: {
|
|
45
|
+
vertical: "top",
|
|
46
|
+
horizontal: "left"
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
sx: {
|
|
50
|
+
width: "100%",
|
|
51
|
+
// Remove default outline (display only on focus)
|
|
52
|
+
fieldset: {
|
|
53
|
+
display: "none"
|
|
54
|
+
},
|
|
55
|
+
'&.Mui-focused:has(div[aria-expanded="false"])': {
|
|
56
|
+
fieldset: {
|
|
57
|
+
display: "block"
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
// Update default spacing
|
|
61
|
+
".MuiSelect-select": {
|
|
62
|
+
padding: "8px",
|
|
63
|
+
paddingRight: "24px !important"
|
|
64
|
+
},
|
|
65
|
+
svg: {
|
|
66
|
+
right: 0
|
|
67
|
+
},
|
|
68
|
+
".MuiMenuItem-root": {
|
|
69
|
+
justifyContent: "flex-start"
|
|
70
|
+
// 确保内容左对齐
|
|
71
|
+
},
|
|
72
|
+
|
|
73
|
+
...sx
|
|
74
|
+
},
|
|
75
|
+
value,
|
|
76
|
+
onChange: onCountryChange,
|
|
77
|
+
renderValue: code => {
|
|
78
|
+
return /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Box, {
|
|
79
|
+
display: "flex",
|
|
80
|
+
alignItems: "center",
|
|
81
|
+
flexWrap: "nowrap",
|
|
82
|
+
gap: 0.5,
|
|
83
|
+
sx: {
|
|
84
|
+
cursor: "pointer"
|
|
85
|
+
},
|
|
86
|
+
children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_reactInternationalPhone.FlagEmoji, {
|
|
87
|
+
iso2: code,
|
|
88
|
+
style: {
|
|
89
|
+
display: "flex"
|
|
90
|
+
}
|
|
91
|
+
}), /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
92
|
+
children: countryDetail?.name
|
|
93
|
+
})]
|
|
94
|
+
});
|
|
95
|
+
},
|
|
96
|
+
children: _reactInternationalPhone.defaultCountries.map(c => {
|
|
97
|
+
const parsed = (0, _reactInternationalPhone.parseCountry)(c);
|
|
98
|
+
return /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.MenuItem, {
|
|
99
|
+
value: parsed.iso2,
|
|
100
|
+
children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_reactInternationalPhone.FlagEmoji, {
|
|
101
|
+
iso2: parsed.iso2,
|
|
102
|
+
style: {
|
|
103
|
+
marginRight: "8px"
|
|
104
|
+
}
|
|
105
|
+
}), /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
106
|
+
marginRight: "8px",
|
|
107
|
+
children: parsed.name
|
|
108
|
+
}), /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Typography, {
|
|
109
|
+
color: "gray",
|
|
110
|
+
children: ["+", parsed.dialCode]
|
|
111
|
+
})]
|
|
112
|
+
}, parsed.iso2);
|
|
113
|
+
})
|
|
114
|
+
});
|
|
115
|
+
}
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { TextFieldProps } from '@mui/material';
|
|
3
2
|
import { RegisterOptions } from 'react-hook-form';
|
|
4
|
-
|
|
3
|
+
declare const FormInput: import("react").ForwardRefExoticComponent<(Omit<import("@mui/material").OutlinedTextFieldProps & {
|
|
5
4
|
name: string;
|
|
6
|
-
label?: string;
|
|
7
|
-
placeholder?: string;
|
|
8
|
-
errorPosition?:
|
|
9
|
-
rules?: RegisterOptions;
|
|
10
|
-
wrapperStyle?:
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
5
|
+
label?: string | undefined;
|
|
6
|
+
placeholder?: string | undefined;
|
|
7
|
+
errorPosition?: "bottom" | "right" | undefined;
|
|
8
|
+
rules?: RegisterOptions<import("react-hook-form").FieldValues, string> | undefined;
|
|
9
|
+
wrapperStyle?: any;
|
|
10
|
+
}, "ref"> | Omit<import("@mui/material").FilledTextFieldProps & {
|
|
11
|
+
name: string;
|
|
12
|
+
label?: string | undefined;
|
|
13
|
+
placeholder?: string | undefined;
|
|
14
|
+
errorPosition?: "bottom" | "right" | undefined;
|
|
15
|
+
rules?: RegisterOptions<import("react-hook-form").FieldValues, string> | undefined;
|
|
16
|
+
wrapperStyle?: any;
|
|
17
|
+
}, "ref"> | Omit<import("@mui/material").StandardTextFieldProps & {
|
|
18
|
+
name: string;
|
|
19
|
+
label?: string | undefined;
|
|
20
|
+
placeholder?: string | undefined;
|
|
21
|
+
errorPosition?: "bottom" | "right" | undefined;
|
|
22
|
+
rules?: RegisterOptions<import("react-hook-form").FieldValues, string> | undefined;
|
|
23
|
+
wrapperStyle?: any;
|
|
24
|
+
}, "ref">) & import("react").RefAttributes<HTMLInputElement>>;
|
|
25
25
|
export default FormInput;
|
package/lib/components/input.js
CHANGED
|
@@ -3,20 +3,13 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
|
|
7
|
-
module.exports = FormInput;
|
|
6
|
+
|
|
8
7
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
8
|
+
var _react = require("react");
|
|
9
9
|
var _material = require("@mui/material");
|
|
10
10
|
var _get = _interopRequireDefault(require("lodash/get"));
|
|
11
11
|
var _reactHookForm = require("react-hook-form");
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
-
FormInput.defaultProps = {
|
|
14
|
-
label: "",
|
|
15
|
-
placeholder: "",
|
|
16
|
-
errorPosition: "bottom",
|
|
17
|
-
rules: {},
|
|
18
|
-
wrapperStyle: {}
|
|
19
|
-
};
|
|
20
13
|
function FormInputError({
|
|
21
14
|
error
|
|
22
15
|
}) {
|
|
@@ -29,7 +22,7 @@ function FormInputError({
|
|
|
29
22
|
})
|
|
30
23
|
});
|
|
31
24
|
}
|
|
32
|
-
|
|
25
|
+
const FormInput = (0, _react.forwardRef)(({
|
|
33
26
|
name,
|
|
34
27
|
label,
|
|
35
28
|
placeholder,
|
|
@@ -37,11 +30,15 @@ function FormInput({
|
|
|
37
30
|
errorPosition,
|
|
38
31
|
wrapperStyle,
|
|
39
32
|
...rest
|
|
40
|
-
}) {
|
|
33
|
+
}, ref) => {
|
|
41
34
|
const {
|
|
42
35
|
control,
|
|
43
36
|
formState
|
|
44
37
|
} = (0, _reactHookForm.useFormContext)();
|
|
38
|
+
const inputRef = (0, _react.useRef)(null);
|
|
39
|
+
(0, _react.useImperativeHandle)(ref, () => {
|
|
40
|
+
return inputRef.current;
|
|
41
|
+
});
|
|
45
42
|
const error = (0, _get.default)(formState.errors, name)?.message;
|
|
46
43
|
return /* @__PURE__ */(0, _jsxRuntime.jsx)(_reactHookForm.Controller, {
|
|
47
44
|
name,
|
|
@@ -55,6 +52,9 @@ function FormInput({
|
|
|
55
52
|
...wrapperStyle
|
|
56
53
|
},
|
|
57
54
|
children: [!!label && /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.FormLabel, {
|
|
55
|
+
sx: {
|
|
56
|
+
color: "text.primary"
|
|
57
|
+
},
|
|
58
58
|
children: label
|
|
59
59
|
}), /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.TextField, {
|
|
60
60
|
fullWidth: true,
|
|
@@ -64,6 +64,7 @@ function FormInput({
|
|
|
64
64
|
size: "small",
|
|
65
65
|
...field,
|
|
66
66
|
...rest,
|
|
67
|
+
inputRef,
|
|
67
68
|
InputProps: Object.assign(rest.InputProps || {}, errorPosition === "right" && error ? {
|
|
68
69
|
endAdornment: /* @__PURE__ */(0, _jsxRuntime.jsx)(FormInputError, {
|
|
69
70
|
error
|
|
@@ -72,4 +73,12 @@ function FormInput({
|
|
|
72
73
|
})]
|
|
73
74
|
})
|
|
74
75
|
});
|
|
75
|
-
}
|
|
76
|
+
});
|
|
77
|
+
FormInput.defaultProps = {
|
|
78
|
+
label: "",
|
|
79
|
+
placeholder: "",
|
|
80
|
+
errorPosition: "bottom",
|
|
81
|
+
rules: {},
|
|
82
|
+
wrapperStyle: {}
|
|
83
|
+
};
|
|
84
|
+
module.exports = FormInput;
|
|
@@ -266,7 +266,6 @@ function PricingTable({
|
|
|
266
266
|
color: "text.primary",
|
|
267
267
|
fontWeight: 600,
|
|
268
268
|
sx: {
|
|
269
|
-
color: "#4B5563",
|
|
270
269
|
fontSize: "18px !important",
|
|
271
270
|
fontWeight: "600"
|
|
272
271
|
},
|
|
@@ -293,7 +292,6 @@ function PricingTable({
|
|
|
293
292
|
color: "text.secondary",
|
|
294
293
|
sx: {
|
|
295
294
|
marginTop: "0px !important",
|
|
296
|
-
color: "#4b5563",
|
|
297
295
|
fontWeight: "400",
|
|
298
296
|
fontSize: "16px",
|
|
299
297
|
textAlign: "left"
|
package/lib/components/status.js
CHANGED
|
@@ -9,14 +9,13 @@ var _material = require("@mui/material");
|
|
|
9
9
|
function Status(props) {
|
|
10
10
|
return /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Chip, {
|
|
11
11
|
size: "small",
|
|
12
|
-
variant: "
|
|
12
|
+
variant: "filled",
|
|
13
13
|
...props,
|
|
14
14
|
sx: {
|
|
15
15
|
...(props.sx || {}),
|
|
16
16
|
borderRadius: "4px",
|
|
17
17
|
height: 20,
|
|
18
|
-
textTransform: "capitalize"
|
|
19
|
-
marginRight: "10px"
|
|
18
|
+
textTransform: "capitalize"
|
|
20
19
|
}
|
|
21
20
|
});
|
|
22
21
|
}
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _Empty = _interopRequireDefault(require("@arcblock/ux/lib/Empty"));
|
|
10
|
+
var _Datatable = _interopRequireDefault(require("@arcblock/ux/lib/Datatable"));
|
|
11
|
+
var _context = require("@arcblock/ux/lib/Locale/context");
|
|
12
|
+
var _system = require("@mui/system");
|
|
13
|
+
var _mobile = require("../hooks/mobile");
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
+
function EmptyStub() {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
const Table = _react.default.memo(({
|
|
19
|
+
options,
|
|
20
|
+
columns,
|
|
21
|
+
toolbar = true,
|
|
22
|
+
footer = true,
|
|
23
|
+
hasRowLink = false,
|
|
24
|
+
emptyNodeText = "",
|
|
25
|
+
...rest
|
|
26
|
+
}) => {
|
|
27
|
+
const {
|
|
28
|
+
locale,
|
|
29
|
+
t
|
|
30
|
+
} = (0, _context.useLocaleContext)();
|
|
31
|
+
const {
|
|
32
|
+
isMobile
|
|
33
|
+
} = (0, _mobile.useMobile)();
|
|
34
|
+
const defaultOptions = {
|
|
35
|
+
print: false,
|
|
36
|
+
download: false,
|
|
37
|
+
filter: false,
|
|
38
|
+
selectableRows: "none",
|
|
39
|
+
rowsPerPage: 10,
|
|
40
|
+
rowsPerPageOptions: [10, 20, 50, 100],
|
|
41
|
+
searchDebounceTime: 300,
|
|
42
|
+
tableBodyHeight: "100%",
|
|
43
|
+
loading: true
|
|
44
|
+
};
|
|
45
|
+
const components = {};
|
|
46
|
+
if (!toolbar) {
|
|
47
|
+
components.TableToolbar = EmptyStub;
|
|
48
|
+
}
|
|
49
|
+
if (!footer) {
|
|
50
|
+
components.TableFooter = EmptyStub;
|
|
51
|
+
}
|
|
52
|
+
return /* @__PURE__ */(0, _jsxRuntime.jsx)(Wrapped, {
|
|
53
|
+
locale,
|
|
54
|
+
options: {
|
|
55
|
+
...defaultOptions,
|
|
56
|
+
...options
|
|
57
|
+
},
|
|
58
|
+
columns: columns.map(x => {
|
|
59
|
+
x.options = x.options || {};
|
|
60
|
+
x.options.filter = x.options.filter || false;
|
|
61
|
+
x.options.sort = x.options.sort || false;
|
|
62
|
+
return x;
|
|
63
|
+
}),
|
|
64
|
+
emptyNode: /* @__PURE__ */(0, _jsxRuntime.jsx)(_Empty.default, {
|
|
65
|
+
children: emptyNodeText || t("empty.records")
|
|
66
|
+
}),
|
|
67
|
+
...rest,
|
|
68
|
+
components,
|
|
69
|
+
hasRowLink,
|
|
70
|
+
isMobile
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
const Wrapped = (0, _system.styled)(_Datatable.default)`
|
|
74
|
+
${props => props.hasRowLink ? `.MuiTableCell-root {
|
|
75
|
+
font-size: 1rem !important;
|
|
76
|
+
}` : ""}
|
|
77
|
+
.MuiPaper-root {
|
|
78
|
+
border-radius: 8px;
|
|
79
|
+
overflow: hidden;
|
|
80
|
+
}
|
|
81
|
+
table.MuiTable-root {
|
|
82
|
+
outline: 1px solid var(--stroke-border-base, #eff1f5);
|
|
83
|
+
border-radius: var(--radius-m, 8px);
|
|
84
|
+
overflow: hidden;
|
|
85
|
+
}
|
|
86
|
+
[class*='MUIDataTable-responsiveBase'] {
|
|
87
|
+
outline: 1px solid var(--stroke-border-base, #eff1f5);
|
|
88
|
+
border-radius: var(--radius-m, 8px);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
th.MuiTableCell-head {
|
|
92
|
+
padding: 8px 16px 8px 16px;
|
|
93
|
+
text-transform: inherit;
|
|
94
|
+
background: var(--backgrounds-bg-subtle, #f9fafb);
|
|
95
|
+
border-bottom: none;
|
|
96
|
+
&:first-of-type {
|
|
97
|
+
border-top-left-radius: 8px;
|
|
98
|
+
padding-left: 20px;
|
|
99
|
+
}
|
|
100
|
+
&:last-of-type {
|
|
101
|
+
border-top-right-radius: 8px;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
tr.MuiTableRow-root:not(.MuiTableRow-footer):hover {
|
|
106
|
+
background: #f5f5f5;
|
|
107
|
+
}
|
|
108
|
+
tr.MuiTableRow-root:last-of-type td:first-of-type {
|
|
109
|
+
border-bottom-left-radius: 8px;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
tr.MuiTableRow-root:last-of-type td:last-of-type {
|
|
113
|
+
border-bottom-right-radius: 8px;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
tr.MuiTableRow-root:nth-of-type(even) {
|
|
117
|
+
background: var(--backgrounds-bg-subtle, #f9fafb);
|
|
118
|
+
}
|
|
119
|
+
td.MuiTableCell-root {
|
|
120
|
+
border-bottom: none;
|
|
121
|
+
&:first-of-type {
|
|
122
|
+
padding-left: 20px;
|
|
123
|
+
}
|
|
124
|
+
&.MuiTableCell-footer {
|
|
125
|
+
border: none;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.datatable-footer {
|
|
130
|
+
.MuiTableRow-root.MuiTableRow-footer {
|
|
131
|
+
border: none;
|
|
132
|
+
}
|
|
133
|
+
table.MuiTable-root {
|
|
134
|
+
outline: none;
|
|
135
|
+
overflow: hidden;
|
|
136
|
+
}
|
|
137
|
+
.MuiTablePagination-input {
|
|
138
|
+
background: none;
|
|
139
|
+
}
|
|
140
|
+
div.MuiSelect-select {
|
|
141
|
+
padding: 0 24px 0 0;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
th a,
|
|
146
|
+
td a {
|
|
147
|
+
text-decoration: none;
|
|
148
|
+
display: block;
|
|
149
|
+
color: inherit;
|
|
150
|
+
&:first-of-type {
|
|
151
|
+
padding-left: 0;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
> div {
|
|
156
|
+
overflow: auto;
|
|
157
|
+
}
|
|
158
|
+
@media (max-width: ${({
|
|
159
|
+
theme
|
|
160
|
+
}) => theme.breakpoints.values.md}px) {
|
|
161
|
+
th a,
|
|
162
|
+
td a {
|
|
163
|
+
text-decoration: none;
|
|
164
|
+
display: block;
|
|
165
|
+
color: inherit;
|
|
166
|
+
padding-top: 0;
|
|
167
|
+
padding-bottom: 0;
|
|
168
|
+
padding-right: 0;
|
|
169
|
+
}
|
|
170
|
+
tr.MuiTableRow-root {
|
|
171
|
+
border: none;
|
|
172
|
+
padding: 20px;
|
|
173
|
+
display: block;
|
|
174
|
+
}
|
|
175
|
+
td.MuiTableCell-root:first-of-type {
|
|
176
|
+
padding-left: 0;
|
|
177
|
+
margin-top: 0;
|
|
178
|
+
}
|
|
179
|
+
td.MuiTableCell-root {
|
|
180
|
+
margin: 0;
|
|
181
|
+
margin-top: 8px;
|
|
182
|
+
align-items: center;
|
|
183
|
+
padding: 0;
|
|
184
|
+
flex-wrap: wrap;
|
|
185
|
+
flex-direction: ${({
|
|
186
|
+
mobileTDFlexDirection = "column"
|
|
187
|
+
}) => mobileTDFlexDirection || "row"};
|
|
188
|
+
align-items: ${({
|
|
189
|
+
mobileTDFlexDirection = "column"
|
|
190
|
+
}) => mobileTDFlexDirection === "column" ? "flex-start" : "center"};
|
|
191
|
+
justify-content: ${({
|
|
192
|
+
mobileTDFlexDirection = "column"
|
|
193
|
+
}) => mobileTDFlexDirection === "column" ? "flex-start" : "space-between"};
|
|
194
|
+
}
|
|
195
|
+
td.MuiTableCell-root > div {
|
|
196
|
+
margin-bottom: 4px;
|
|
197
|
+
}
|
|
198
|
+
.MuiTable-root > .MuiTableBody-root > .MuiTableRow-root > td.MuiTableCell-root {
|
|
199
|
+
display: flex;
|
|
200
|
+
flex-direction: ${({
|
|
201
|
+
mobileTDFlexDirection = "column"
|
|
202
|
+
}) => mobileTDFlexDirection || "row"};
|
|
203
|
+
align-items: flex-start;
|
|
204
|
+
justify-content: ${({
|
|
205
|
+
mobileTDFlexDirection = "column"
|
|
206
|
+
}) => mobileTDFlexDirection === "row" ? "space-between" : "flex-start"};
|
|
207
|
+
flex-wrap: ${({
|
|
208
|
+
mobileTDFlexDirection = "column"
|
|
209
|
+
}) => mobileTDFlexDirection === "row" ? "nowrap" : "wrap"};
|
|
210
|
+
word-break: break-all;
|
|
211
|
+
&.datatables-noprint {
|
|
212
|
+
justify-content: center;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
[class*='MUIDataTable-responsiveBase'] tr:not([class*='responsiveSimple']) td.MuiTableCell-body > div {
|
|
216
|
+
width: inherit;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
`;
|
|
220
|
+
module.exports = Table;
|
|
@@ -18,6 +18,8 @@ export type PaymentContextType = {
|
|
|
18
18
|
getMethod: (methodId: string) => TPaymentMethodExpanded | undefined;
|
|
19
19
|
setLivemode: (livemode: boolean) => void;
|
|
20
20
|
api: Axios;
|
|
21
|
+
payable: boolean;
|
|
22
|
+
setPayable: (status: boolean) => void;
|
|
21
23
|
};
|
|
22
24
|
export type PaymentContextProps = {
|
|
23
25
|
session: import('@arcblock/did-connect/lib/types').SessionContext['session'];
|
package/lib/contexts/payment.js
CHANGED
|
@@ -54,6 +54,7 @@ function PaymentProvider({
|
|
|
54
54
|
defaultValue: true
|
|
55
55
|
});
|
|
56
56
|
const prefix = (0, _util.getPrefix)();
|
|
57
|
+
const [payable, setPayable] = (0, _react.useState)(true);
|
|
57
58
|
if (error) {
|
|
58
59
|
return /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Alert, {
|
|
59
60
|
severity: "error",
|
|
@@ -74,7 +75,9 @@ function PaymentProvider({
|
|
|
74
75
|
getMethod: methodId => getMethod(methodId, data.paymentMethods),
|
|
75
76
|
refresh: run,
|
|
76
77
|
setLivemode,
|
|
77
|
-
api: _api.default
|
|
78
|
+
api: _api.default,
|
|
79
|
+
payable,
|
|
80
|
+
setPayable
|
|
78
81
|
},
|
|
79
82
|
children
|
|
80
83
|
});
|
|
@@ -9,8 +9,9 @@ type Props = {
|
|
|
9
9
|
pageSize?: number;
|
|
10
10
|
target?: string;
|
|
11
11
|
action?: string;
|
|
12
|
+
type?: 'list' | 'table';
|
|
12
13
|
};
|
|
13
|
-
declare function CustomerInvoiceList(
|
|
14
|
+
declare function CustomerInvoiceList(props: Props): JSX.Element;
|
|
14
15
|
declare namespace CustomerInvoiceList {
|
|
15
16
|
var defaultProps: {
|
|
16
17
|
customer_id: string;
|
|
@@ -22,6 +23,7 @@ declare namespace CustomerInvoiceList {
|
|
|
22
23
|
pageSize: number;
|
|
23
24
|
target: string;
|
|
24
25
|
action: string;
|
|
26
|
+
type: string;
|
|
25
27
|
};
|
|
26
28
|
}
|
|
27
29
|
export default CustomerInvoiceList;
|