@pisell/materials 6.4.8 → 6.4.9
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/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/preview.js +146 -146
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +24 -23
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +25 -24
- package/es/components/auto-resize-text/auto-text-size-standalone.d.ts +20 -0
- package/es/components/auto-resize-text/auto-text-size-standalone.js +258 -0
- package/es/components/auto-resize-text/index.d.ts +6 -0
- package/es/components/auto-resize-text/index.js +40 -0
- package/es/components/batch-editor/index.d.ts +0 -1
- package/es/components/dataSourceComponents/dataSourceForm/BaseForm.d.ts +3 -0
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useDataSourceKey.d.ts +2 -2
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useDrawerState.d.ts +2 -2
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +3 -3
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.js +1 -1
- package/es/components/dataSourceComponents/fields/Upload/type.d.ts +37 -0
- package/es/components/dataSourceComponents/fields/Upload/utils.d.ts +1 -1
- package/es/components/dataSourceComponents/fields/index.d.ts +11 -12
- package/es/components/date-picker/index.d.ts +0 -1
- package/es/components/drag-sort-tree/TreeItem/index.d.ts +18 -0
- package/es/components/filter/types.d.ts +1 -0
- package/es/components/iconfont/index.d.ts +8 -0
- package/es/components/keyboard/index.d.ts +22 -0
- package/es/components/keyboard/index.js +159 -0
- package/es/components/keyboard/index.less +44 -0
- package/es/components/page/index.d.ts +0 -1
- package/es/components/pisell-config-provider/context.d.ts +22 -0
- package/es/components/pisell-config-provider/index.d.ts +13 -0
- package/es/components/pisellAdjustPrice/status.d.ts +32 -0
- package/es/components/pisellAdjustPrice/type.d.ts +22 -0
- package/es/components/pisellQRScanner/index.d.ts +0 -13
- package/es/components/pisellQRScanner/index.js +0 -8
- package/es/components/pisellToast/squareToast/index.d.ts +15 -0
- package/es/components/pisellToast/squareToast/methods.d.ts +13 -0
- package/es/components/pisellToast/squareToast/renderImperatively.d.ts +29 -0
- package/es/components/pisellToast/squareToast/toast.d.ts +25 -0
- package/es/components/pisellWalletPassCard/index.d.ts +1 -1
- package/es/components/pisellWalletPassCard/index.js +2 -1
- package/es/components/productCard/cartSkuCard/components/MultiDay/index.d.ts +3 -0
- package/es/components/productCard/cartSkuCard/components/MultiDay/utils.d.ts +14 -0
- package/es/components/productCard/cartSkuCard/components/holders/index.d.ts +3 -0
- package/es/components/productCard/cartSkuCard/components/packages/utils.d.ts +1 -1
- package/es/components/productCard/cartSkuCard/components/resources/index.d.ts +3 -0
- package/es/components/productCard/cartSkuCard/components/timeRange/index.d.ts +6 -0
- package/es/components/productCard/cartSkuCard/locales.d.ts +96 -0
- package/es/components/productCard/components/Action/index.d.ts +3 -0
- package/es/components/productCard/components/Packages/utils.d.ts +1 -1
- package/es/components/productCard/locales.d.ts +84 -0
- package/es/components/productCard/status.d.ts +32 -0
- package/es/components/productCard/types.d.ts +84 -0
- package/es/components/table/Gallery/components/VirtualGrid/useGapSize.d.ts +2 -2
- package/es/components/table/Table/SelectField/index.d.ts +0 -1
- package/es/components/table/Table/fields/index.d.ts +0 -1
- package/es/components/table/Table/fields/select/filterUtil/index.d.ts +1 -1
- package/es/components/table/Table/fields/text/Show/index.d.ts +0 -1
- package/es/components/table/Table/fields/text/index.d.ts +0 -1
- package/es/components/table/Table/fields/treeSelect/filterUtil/index.d.ts +1 -1
- package/es/components/table/Table/utils.d.ts +1 -1
- package/es/components/table/hooks/useTableSetting.js +1 -1
- package/es/components/virtual-keyboard/Amount/themeConfig.d.ts +32 -0
- package/es/components/virtual-keyboard/Amount/types.d.ts +44 -0
- package/es/components/virtual-keyboard/BaseNumberKeyboard/Presets.d.ts +5 -1
- package/es/components/virtual-keyboard/BaseNumberKeyboard/Presets.js +21 -7
- package/es/components/virtual-keyboard/BaseNumberKeyboard/Presets.less +9 -5
- package/es/components/virtual-keyboard/BaseNumberKeyboard/index.d.ts +4 -0
- package/es/components/virtual-keyboard/BaseNumberKeyboard/index.js +44 -25
- package/es/components/virtual-keyboard/Keyboard/index.d.ts +21 -0
- package/es/components/virtual-keyboard/Number/themeConfig.d.ts +32 -0
- package/es/components/virtual-keyboard/Number/types.d.ts +26 -0
- package/es/components/virtual-keyboard/VirtualKeyInput/index.d.ts +13 -0
- package/es/components/virtualInput/BaseVirtualInput/index.d.ts +40 -0
- package/es/components/virtualInput/BaseVirtualInput/index.js +163 -0
- package/es/components/virtualInput/BaseVirtualInput/index.less +78 -0
- package/es/components/virtualInput/index.d.ts +24 -0
- package/es/components/virtualInput/index.js +60 -0
- package/es/components/virtualInput/index.less +42 -0
- package/es/components/walletCard/Guide/index.d.ts +3 -0
- package/es/components/walletCard/index.d.ts +67 -0
- package/es/index.d.ts +2 -0
- package/es/index.js +3 -1
- package/es/locales/en-US.d.ts +286 -0
- package/es/locales/en-US.js +1 -0
- package/es/locales/zh-CN.d.ts +281 -0
- package/es/locales/zh-CN.js +1 -0
- package/es/locales/zh-TW.d.ts +281 -0
- package/es/locales/zh-TW.js +1 -0
- package/es/utils/index.d.ts +1 -1
- package/es/utils/platform.d.ts +1 -1
- package/lib/components/auto-resize-text/auto-text-size-standalone.d.ts +20 -0
- package/lib/components/auto-resize-text/auto-text-size-standalone.js +273 -0
- package/lib/components/auto-resize-text/index.d.ts +6 -0
- package/lib/components/auto-resize-text/index.js +71 -0
- package/lib/components/batch-editor/index.d.ts +0 -1
- package/lib/components/dataSourceComponents/dataSourceForm/BaseForm.d.ts +3 -0
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useDataSourceKey.d.ts +2 -2
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useDrawerState.d.ts +2 -2
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +3 -3
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.js +1 -1
- package/lib/components/dataSourceComponents/fields/Upload/type.d.ts +37 -0
- package/lib/components/dataSourceComponents/fields/Upload/utils.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/index.d.ts +11 -12
- package/lib/components/date-picker/index.d.ts +0 -1
- package/lib/components/drag-sort-tree/TreeItem/index.d.ts +18 -0
- package/lib/components/filter/types.d.ts +1 -0
- package/lib/components/iconfont/index.d.ts +8 -0
- package/lib/components/keyboard/index.d.ts +22 -0
- package/lib/components/keyboard/index.js +223 -0
- package/lib/components/keyboard/index.less +44 -0
- package/lib/components/page/index.d.ts +0 -1
- package/lib/components/pisell-config-provider/context.d.ts +22 -0
- package/lib/components/pisell-config-provider/index.d.ts +13 -0
- package/lib/components/pisellAdjustPrice/status.d.ts +32 -0
- package/lib/components/pisellAdjustPrice/type.d.ts +22 -0
- package/lib/components/pisellQRScanner/index.d.ts +0 -13
- package/lib/components/pisellToast/squareToast/index.d.ts +15 -0
- package/lib/components/pisellToast/squareToast/methods.d.ts +13 -0
- package/lib/components/pisellToast/squareToast/renderImperatively.d.ts +29 -0
- package/lib/components/pisellToast/squareToast/toast.d.ts +25 -0
- package/lib/components/pisellWalletPassCard/index.d.ts +1 -1
- package/lib/components/pisellWalletPassCard/index.js +2 -1
- package/lib/components/productCard/cartSkuCard/components/MultiDay/index.d.ts +3 -0
- package/lib/components/productCard/cartSkuCard/components/MultiDay/utils.d.ts +14 -0
- package/lib/components/productCard/cartSkuCard/components/holders/index.d.ts +3 -0
- package/lib/components/productCard/cartSkuCard/components/packages/utils.d.ts +1 -1
- package/lib/components/productCard/cartSkuCard/components/resources/index.d.ts +3 -0
- package/lib/components/productCard/cartSkuCard/components/timeRange/index.d.ts +6 -0
- package/lib/components/productCard/cartSkuCard/locales.d.ts +96 -0
- package/lib/components/productCard/components/Action/index.d.ts +3 -0
- package/lib/components/productCard/components/Packages/utils.d.ts +1 -1
- package/lib/components/productCard/locales.d.ts +84 -0
- package/lib/components/productCard/status.d.ts +32 -0
- package/lib/components/productCard/types.d.ts +84 -0
- package/lib/components/table/Gallery/components/VirtualGrid/useGapSize.d.ts +2 -2
- package/lib/components/table/Table/SelectField/index.d.ts +0 -1
- package/lib/components/table/Table/fields/index.d.ts +0 -1
- package/lib/components/table/Table/fields/select/filterUtil/index.d.ts +1 -1
- package/lib/components/table/Table/fields/text/Show/index.d.ts +0 -1
- package/lib/components/table/Table/fields/text/index.d.ts +0 -1
- package/lib/components/table/Table/fields/treeSelect/filterUtil/index.d.ts +1 -1
- package/lib/components/table/Table/utils.d.ts +1 -1
- package/lib/components/table/hooks/useTableSetting.js +1 -1
- package/lib/components/virtual-keyboard/Amount/themeConfig.d.ts +32 -0
- package/lib/components/virtual-keyboard/Amount/types.d.ts +44 -0
- package/lib/components/virtual-keyboard/BaseNumberKeyboard/Presets.d.ts +5 -1
- package/lib/components/virtual-keyboard/BaseNumberKeyboard/Presets.js +19 -2
- package/lib/components/virtual-keyboard/BaseNumberKeyboard/Presets.less +9 -5
- package/lib/components/virtual-keyboard/BaseNumberKeyboard/index.d.ts +4 -0
- package/lib/components/virtual-keyboard/BaseNumberKeyboard/index.js +45 -27
- package/lib/components/virtual-keyboard/Keyboard/index.d.ts +21 -0
- package/lib/components/virtual-keyboard/Number/themeConfig.d.ts +32 -0
- package/lib/components/virtual-keyboard/Number/types.d.ts +26 -0
- package/lib/components/virtual-keyboard/VirtualKeyInput/index.d.ts +13 -0
- package/lib/components/virtualInput/BaseVirtualInput/index.d.ts +40 -0
- package/lib/components/virtualInput/BaseVirtualInput/index.js +179 -0
- package/lib/components/virtualInput/BaseVirtualInput/index.less +78 -0
- package/lib/components/virtualInput/index.d.ts +24 -0
- package/lib/components/virtualInput/index.js +102 -0
- package/lib/components/virtualInput/index.less +42 -0
- package/lib/components/walletCard/Guide/index.d.ts +3 -0
- package/lib/components/walletCard/index.d.ts +67 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +6 -0
- package/lib/locales/en-US.d.ts +286 -0
- package/lib/locales/en-US.js +1 -0
- package/lib/locales/zh-CN.d.ts +281 -0
- package/lib/locales/zh-CN.js +1 -0
- package/lib/locales/zh-TW.d.ts +281 -0
- package/lib/locales/zh-TW.js +1 -0
- package/lib/utils/index.d.ts +1 -1
- package/lib/utils/platform.d.ts +1 -1
- package/package.json +3 -3
- package/dist/umd/materials.min.css +0 -1
- package/dist/umd/materials.min.js +0 -1
- package/dist/umd/static/DotsSix.57d66266.svg +0 -1
- package/dist/umd/static/arrow-left.e542294f.svg +0 -1
- package/dist/umd/static/arrow-right.763f03e0.svg +0 -1
- package/dist/umd/static/filter-lines.04a54ae9.svg +0 -1
- package/dist/umd/static/help-circle.31c9be40.svg +0 -1
- package/dist/umd/static/switch-vertical-01.7ebe3ba8.svg +0 -1
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
import React, { useRef } from 'react';
|
|
8
|
+
import { Button } from 'antd';
|
|
9
|
+
import "./index.less";
|
|
10
|
+
import classNames from 'classnames';
|
|
11
|
+
import { useEventListener, useMemoizedFn, useSize } from 'ahooks';
|
|
12
|
+
var list = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '+', 'ok'];
|
|
13
|
+
var defaultArr = [{
|
|
14
|
+
value: 1,
|
|
15
|
+
label: '1',
|
|
16
|
+
disabled: false,
|
|
17
|
+
type: 'text'
|
|
18
|
+
}, {
|
|
19
|
+
value: 2,
|
|
20
|
+
label: '2',
|
|
21
|
+
disabled: false,
|
|
22
|
+
type: 'text'
|
|
23
|
+
}, {
|
|
24
|
+
value: 3,
|
|
25
|
+
label: '3',
|
|
26
|
+
disabled: false,
|
|
27
|
+
type: 'text'
|
|
28
|
+
}, {
|
|
29
|
+
value: 4,
|
|
30
|
+
label: '4',
|
|
31
|
+
disabled: false,
|
|
32
|
+
type: 'text'
|
|
33
|
+
}, {
|
|
34
|
+
value: 5,
|
|
35
|
+
label: '5',
|
|
36
|
+
disabled: false,
|
|
37
|
+
type: 'text'
|
|
38
|
+
}, {
|
|
39
|
+
value: 6,
|
|
40
|
+
label: '6',
|
|
41
|
+
disabled: false,
|
|
42
|
+
type: 'text'
|
|
43
|
+
}, {
|
|
44
|
+
value: 7,
|
|
45
|
+
label: '7',
|
|
46
|
+
disabled: false,
|
|
47
|
+
type: 'text'
|
|
48
|
+
}, {
|
|
49
|
+
value: 8,
|
|
50
|
+
label: '8',
|
|
51
|
+
disabled: false,
|
|
52
|
+
type: 'text'
|
|
53
|
+
}, {
|
|
54
|
+
value: 9,
|
|
55
|
+
label: '9',
|
|
56
|
+
disabled: false,
|
|
57
|
+
type: 'text'
|
|
58
|
+
}, {
|
|
59
|
+
value: '0',
|
|
60
|
+
label: '0',
|
|
61
|
+
disabled: false,
|
|
62
|
+
type: 'text'
|
|
63
|
+
}, {
|
|
64
|
+
value: '00',
|
|
65
|
+
label: '00',
|
|
66
|
+
disabled: false,
|
|
67
|
+
type: 'text'
|
|
68
|
+
}, {
|
|
69
|
+
value: '.',
|
|
70
|
+
label: '.',
|
|
71
|
+
disabled: false,
|
|
72
|
+
type: 'text'
|
|
73
|
+
}];
|
|
74
|
+
var Keyboard = function Keyboard(props) {
|
|
75
|
+
var _props$items = props.items,
|
|
76
|
+
items = _props$items === void 0 ? defaultArr : _props$items,
|
|
77
|
+
className = props.className,
|
|
78
|
+
style = props.style,
|
|
79
|
+
onChange = props.onChange,
|
|
80
|
+
rightItems = props.rightItems,
|
|
81
|
+
_props$keydown = props.keydown,
|
|
82
|
+
keydown = _props$keydown === void 0 ? true : _props$keydown;
|
|
83
|
+
var contentRef = useRef(null);
|
|
84
|
+
var size = useSize(contentRef);
|
|
85
|
+
useEventListener('keydown', function (ev) {
|
|
86
|
+
console.log('ev', ev);
|
|
87
|
+
if (!keydown) {
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
var key = ev.key;
|
|
91
|
+
if (key === 'Enter') {
|
|
92
|
+
key = 'ok';
|
|
93
|
+
}
|
|
94
|
+
if (key === 'keydown') {
|
|
95
|
+
key = '+';
|
|
96
|
+
}
|
|
97
|
+
if (list.includes(key)) {
|
|
98
|
+
onChange === null || onChange === void 0 || onChange(key);
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
var getHeight = useMemoizedFn(function () {
|
|
102
|
+
var itemSize = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
|
|
103
|
+
// 默认高度为25% 的容器宽度 * size大小 + 间距
|
|
104
|
+
return ((size === null || size === void 0 ? void 0 : size.width) || 0) / 4 * itemSize + (itemSize - 1) * 7;
|
|
105
|
+
});
|
|
106
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
107
|
+
id: props.id || '',
|
|
108
|
+
className: classNames('pisell-virtual-keyboard-wrap', className),
|
|
109
|
+
style: style
|
|
110
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
111
|
+
className: classNames('pisell-virtual-keyboard-content'),
|
|
112
|
+
ref: contentRef
|
|
113
|
+
}, items.map(function (item) {
|
|
114
|
+
var _item$style;
|
|
115
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
116
|
+
className: "pisell-virtual-keyboard-item",
|
|
117
|
+
style: item.style
|
|
118
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
119
|
+
id: "pisell-virtual-keyboard-".concat(item.value),
|
|
120
|
+
key: item.value,
|
|
121
|
+
type: item.type,
|
|
122
|
+
className: "pisell-virtual-keyboard-item-button",
|
|
123
|
+
style: {
|
|
124
|
+
color: item.type === 'primary' ? '#fff' : ((_item$style = item.style) === null || _item$style === void 0 ? void 0 : _item$style.color) || undefined
|
|
125
|
+
},
|
|
126
|
+
disabled: item.disabled,
|
|
127
|
+
onClick: function onClick(e) {
|
|
128
|
+
onChange === null || onChange === void 0 || onChange(item.value);
|
|
129
|
+
}
|
|
130
|
+
}, item.label));
|
|
131
|
+
})), rightItems && /*#__PURE__*/React.createElement("div", {
|
|
132
|
+
className: classNames('pisell-virtual-keyboard-content', 'pisell-virtual-keyboard-right'),
|
|
133
|
+
style: {
|
|
134
|
+
flex: "0 0 calc((100% - 21px) / 4 * 1)"
|
|
135
|
+
}
|
|
136
|
+
}, rightItems === null || rightItems === void 0 ? void 0 : rightItems.map(function (item) {
|
|
137
|
+
var _item$style2, _item$style3;
|
|
138
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
139
|
+
className: "pisell-virtual-keyboard-item",
|
|
140
|
+
style: _objectSpread(_objectSpread({}, item.style || {}), {}, {
|
|
141
|
+
height: getHeight(item.size)
|
|
142
|
+
})
|
|
143
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
144
|
+
id: "pisell-virtual-keyboard-".concat(item.value),
|
|
145
|
+
key: item.value,
|
|
146
|
+
type: item.type,
|
|
147
|
+
className: "pisell-virtual-keyboard-item-button",
|
|
148
|
+
style: _objectSpread({
|
|
149
|
+
fontSize: ((_item$style2 = item.style) === null || _item$style2 === void 0 ? void 0 : _item$style2.fontSize) || 25,
|
|
150
|
+
color: item.type === 'primary' ? '#fff' : ((_item$style3 = item.style) === null || _item$style3 === void 0 ? void 0 : _item$style3.color) || undefined
|
|
151
|
+
}, item.type === 'primary' ? item.style || {} : {}),
|
|
152
|
+
disabled: item.disabled,
|
|
153
|
+
onClick: function onClick(e) {
|
|
154
|
+
onChange === null || onChange === void 0 || onChange(item.value);
|
|
155
|
+
}
|
|
156
|
+
}, item.label));
|
|
157
|
+
})));
|
|
158
|
+
};
|
|
159
|
+
export default /*#__PURE__*/React.memo(Keyboard);
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
.pisell-virtual-keyboard-wrap {
|
|
2
|
+
display: flex;
|
|
3
|
+
gap: 7px;
|
|
4
|
+
.pisell-virtual-keyboard-content {
|
|
5
|
+
width: 100%;
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-wrap: wrap;
|
|
8
|
+
align-items: center;
|
|
9
|
+
justify-content: flex-end;
|
|
10
|
+
gap: 7px;
|
|
11
|
+
|
|
12
|
+
.pisell-virtual-keyboard-item {
|
|
13
|
+
border-radius: 5px;
|
|
14
|
+
background: var(--Base-White, #fff);
|
|
15
|
+
box-shadow: 0px 1px 2px rgba(16, 24, 40, 0.06);;
|
|
16
|
+
overflow: hidden;
|
|
17
|
+
width: calc((100% - 14px) / 3 * 1);
|
|
18
|
+
padding-top: 25%;
|
|
19
|
+
position: relative;
|
|
20
|
+
|
|
21
|
+
.pisell-virtual-keyboard-item-button {
|
|
22
|
+
position: absolute;
|
|
23
|
+
left: 0;
|
|
24
|
+
top: 0;
|
|
25
|
+
width: 100%;
|
|
26
|
+
height: 100%;
|
|
27
|
+
border-radius: 5px;
|
|
28
|
+
color: var(--Base-Black, #000);
|
|
29
|
+
font-size: 25px;
|
|
30
|
+
font-style: normal;
|
|
31
|
+
font-weight: 400;
|
|
32
|
+
box-shadow: none;
|
|
33
|
+
padding: 0 !important;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
.pisell-virtual-keyboard-right {
|
|
38
|
+
flex-direction: column;
|
|
39
|
+
justify-content: start;
|
|
40
|
+
.pisell-virtual-keyboard-item{
|
|
41
|
+
width: 100%;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface PisellContextType {
|
|
3
|
+
platform: 'h5' | 'pc' | 'ipad';
|
|
4
|
+
/** 货币符号 */
|
|
5
|
+
symbol?: string;
|
|
6
|
+
/** 当前语言环境 */
|
|
7
|
+
locale?: string;
|
|
8
|
+
/** 获取货币符号 */
|
|
9
|
+
getSymbolic?: () => string;
|
|
10
|
+
}
|
|
11
|
+
export declare const PisellContext: import("react").Context<PisellContextType>;
|
|
12
|
+
/**
|
|
13
|
+
* provider外获取当前全局配置
|
|
14
|
+
*/
|
|
15
|
+
declare class GlobalConfig {
|
|
16
|
+
private config;
|
|
17
|
+
constructor();
|
|
18
|
+
setConfig(config: PisellContextType): void;
|
|
19
|
+
getConfig(): PisellContextType;
|
|
20
|
+
}
|
|
21
|
+
export declare const globalConfig: GlobalConfig;
|
|
22
|
+
export default PisellContext;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PisellContextType } from './context';
|
|
3
|
+
interface PisellConfigProviderType {
|
|
4
|
+
platform?: PisellContextType['platform'];
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
/** 货币符号 */
|
|
7
|
+
symbol?: string;
|
|
8
|
+
/** 当前语言环境 */
|
|
9
|
+
locale?: string;
|
|
10
|
+
getSymbolic?: () => string;
|
|
11
|
+
}
|
|
12
|
+
declare const PisellConfigProvider: React.FC<PisellConfigProviderType>;
|
|
13
|
+
export default PisellConfigProvider;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export declare const defaultConfig: {
|
|
2
|
+
dark: {
|
|
3
|
+
backgroundColor: string;
|
|
4
|
+
containerBackgroundColor: string;
|
|
5
|
+
buttonBackgroundColor: string;
|
|
6
|
+
textColor: string;
|
|
7
|
+
resetButtonBackgroundColor: string;
|
|
8
|
+
resetButtonTextColor: string;
|
|
9
|
+
isDoneButtonFollowTheme: boolean;
|
|
10
|
+
doneButtonBackgroundColor: string;
|
|
11
|
+
doneButtonTextColor: string;
|
|
12
|
+
isShowMainText: boolean;
|
|
13
|
+
mainTextColor: string;
|
|
14
|
+
isShowSubText: boolean;
|
|
15
|
+
subTextColor: string;
|
|
16
|
+
};
|
|
17
|
+
light: {
|
|
18
|
+
backgroundColor: string;
|
|
19
|
+
containerBackgroundColor: string;
|
|
20
|
+
buttonBackgroundColor: string;
|
|
21
|
+
textColor: string;
|
|
22
|
+
resetButtonBackgroundColor: string;
|
|
23
|
+
resetButtonTextColor: string;
|
|
24
|
+
isDoneButtonFollowTheme: boolean;
|
|
25
|
+
doneButtonBackgroundColor: string;
|
|
26
|
+
doneButtonTextColor: string;
|
|
27
|
+
isShowMainText: boolean;
|
|
28
|
+
mainTextColor: string;
|
|
29
|
+
isShowSubText: boolean;
|
|
30
|
+
subTextColor: string;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface PisellAdjustPriceProps {
|
|
2
|
+
value?: number;
|
|
3
|
+
originValue: number;
|
|
4
|
+
defaultValue?: number;
|
|
5
|
+
onChange?: (val: number) => void;
|
|
6
|
+
selectType?: 'light' | 'dark';
|
|
7
|
+
backgroundColor?: string;
|
|
8
|
+
containerBackgroundColor?: string;
|
|
9
|
+
buttonBackgroundColor?: string;
|
|
10
|
+
textColor?: string;
|
|
11
|
+
resetButtonBackgroundColor?: string;
|
|
12
|
+
resetButtonTextColor?: string;
|
|
13
|
+
isDoneButtonFollowTheme?: boolean;
|
|
14
|
+
doneButtonBackgroundColor?: string;
|
|
15
|
+
doneButtonTextColor?: string;
|
|
16
|
+
isShowMainText?: boolean;
|
|
17
|
+
mainTextColor?: string;
|
|
18
|
+
isShowSubText?: boolean;
|
|
19
|
+
subTextColor?: string;
|
|
20
|
+
resetText?: string;
|
|
21
|
+
doneText?: string;
|
|
22
|
+
}
|
|
@@ -1,18 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import './index.less';
|
|
3
|
-
import type { DetailedHTMLProps, HTMLAttributes, VideoHTMLAttributes, InputHTMLAttributes } from 'react';
|
|
4
|
-
declare type ExtendedDetailedHTMLProps<T extends HTMLAttributes<E>, E extends HTMLElement> = DetailedHTMLProps<T, E> & {
|
|
5
|
-
children?: React.ReactNode;
|
|
6
|
-
};
|
|
7
|
-
declare global {
|
|
8
|
-
namespace JSX {
|
|
9
|
-
interface IntrinsicElements {
|
|
10
|
-
div: ExtendedDetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>;
|
|
11
|
-
video: DetailedHTMLProps<VideoHTMLAttributes<HTMLVideoElement>, HTMLVideoElement>;
|
|
12
|
-
input: DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
3
|
export interface PisellQRScannerProps {
|
|
17
4
|
/** 是否可见 */
|
|
18
5
|
visible: boolean;
|
|
@@ -18,14 +18,6 @@ import "./index.less";
|
|
|
18
18
|
import { createPortal } from 'react-dom';
|
|
19
19
|
import { getText } from "../../locales";
|
|
20
20
|
|
|
21
|
-
// 不使用全局声明,改用本地引入React类型
|
|
22
|
-
|
|
23
|
-
// 扩展HTMLAttributes接口以包含children属性
|
|
24
|
-
|
|
25
|
-
// 扩展DetailedHTMLProps类型以使用扩展的HTMLAttributes
|
|
26
|
-
|
|
27
|
-
// 声明JSX命名空间,解决JSX.IntrinsicElements错误
|
|
28
|
-
|
|
29
21
|
// 精确定义组件属性,只接收需要的属性
|
|
30
22
|
|
|
31
23
|
/**
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { clear, show, success, info, loading, fail, hide } from './methods';
|
|
2
|
+
import './index.less';
|
|
3
|
+
interface ToastInstance {
|
|
4
|
+
show: typeof show;
|
|
5
|
+
clear: typeof clear;
|
|
6
|
+
success: typeof success;
|
|
7
|
+
info: typeof info;
|
|
8
|
+
loading: typeof loading;
|
|
9
|
+
fail: typeof fail;
|
|
10
|
+
error: typeof fail;
|
|
11
|
+
hide: typeof hide;
|
|
12
|
+
}
|
|
13
|
+
declare const Toast: ToastInstance;
|
|
14
|
+
export declare const useToast: () => ToastInstance;
|
|
15
|
+
export default Toast;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ToastProps } from './toast';
|
|
3
|
+
interface ToastInstance {
|
|
4
|
+
close: () => void;
|
|
5
|
+
}
|
|
6
|
+
declare const show: (configOrContent: Partial<ToastProps> | React.ReactNode, duration?: number, afterClose?: () => void) => ToastInstance;
|
|
7
|
+
declare const clear: () => void;
|
|
8
|
+
declare const success: (content: React.ReactNode, duration?: number, afterClose?: () => void) => ToastInstance;
|
|
9
|
+
declare const info: (content: React.ReactNode, duration?: number, afterClose?: () => void) => ToastInstance;
|
|
10
|
+
declare const loading: (content: React.ReactNode, duration?: number, afterClose?: () => void) => ToastInstance;
|
|
11
|
+
declare const fail: (content: React.ReactNode, duration?: number, afterClose?: () => void) => ToastInstance;
|
|
12
|
+
declare const hide: () => void;
|
|
13
|
+
export { show, clear, success, info, loading, fail, hide };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import type { Root } from 'react-dom/client';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
declare type ImperativeProps = {
|
|
5
|
+
open?: boolean;
|
|
6
|
+
onCancel?: () => void;
|
|
7
|
+
afterClose?: () => void;
|
|
8
|
+
};
|
|
9
|
+
declare type TargetElement = ReactElement<ImperativeProps>;
|
|
10
|
+
export declare type ImperativeHandler = {
|
|
11
|
+
close: () => void;
|
|
12
|
+
replace: (element: TargetElement) => void;
|
|
13
|
+
isRendered?: () => boolean;
|
|
14
|
+
};
|
|
15
|
+
export declare type UnmountType = () => Promise<void>;
|
|
16
|
+
export declare type RenderType = (node: React.ReactElement, container: Element | DocumentFragment) => UnmountType;
|
|
17
|
+
declare const MARK = "__pisell_react_root__";
|
|
18
|
+
declare type ContainerType = (Element | DocumentFragment) & {
|
|
19
|
+
[MARK]?: Root;
|
|
20
|
+
};
|
|
21
|
+
export declare function render(node: React.ReactElement, container: ContainerType): void;
|
|
22
|
+
export declare function unmount(container: ContainerType): Promise<void>;
|
|
23
|
+
/**
|
|
24
|
+
* @deprecated 设置 React 渲染函数以兼容使用。
|
|
25
|
+
*/
|
|
26
|
+
export declare function unstableSetRender(render?: RenderType): RenderType;
|
|
27
|
+
export declare function renderToBody(element: ReactElement): UnmountType;
|
|
28
|
+
export declare function renderImperatively(element: TargetElement): ImperativeHandler;
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './index.less';
|
|
3
|
+
export declare type ToastType = 'success' | 'error' | 'warning' | 'info' | 'loading';
|
|
4
|
+
export interface ToastProps {
|
|
5
|
+
/** Toast 类型 */
|
|
6
|
+
icon?: ToastType | React.ReactNode;
|
|
7
|
+
/** 显示的内容,支持文本或 React 节点 */
|
|
8
|
+
content: React.ReactNode;
|
|
9
|
+
/** 是否显示 */
|
|
10
|
+
open?: boolean;
|
|
11
|
+
/** 自动关闭时间,单位毫秒,0 表示不自动关闭 */
|
|
12
|
+
duration?: number;
|
|
13
|
+
/** 关闭 */
|
|
14
|
+
onCancel?: () => void;
|
|
15
|
+
/** 关闭后回调 */
|
|
16
|
+
afterClose?: () => void;
|
|
17
|
+
/** 自定义样式类名 */
|
|
18
|
+
className?: string;
|
|
19
|
+
/** 自定义样式 */
|
|
20
|
+
style?: React.CSSProperties;
|
|
21
|
+
/** 是否显示遮罩 */
|
|
22
|
+
mask?: boolean;
|
|
23
|
+
}
|
|
24
|
+
declare const Toast: React.FC<ToastProps>;
|
|
25
|
+
export default Toast;
|
|
@@ -117,7 +117,7 @@ export interface PisellWalletPassCardProps {
|
|
|
117
117
|
color: string;
|
|
118
118
|
};
|
|
119
119
|
/** 卡片状态 */
|
|
120
|
-
cardStatus?: 'used' | 'expired' | 'disabled' | 'conflict';
|
|
120
|
+
cardStatus?: 'used' | 'expired' | 'disabled' | 'conflict' | 'lastPayment';
|
|
121
121
|
/** 自定义余额格式化函数,如果提供则优先使用 */
|
|
122
122
|
formatBalance?: (balance?: number, option?: FormatOption) => React.ReactNode;
|
|
123
123
|
/** 自定义余额标题格式化函数,如果提供则优先使用 */
|
|
@@ -34,7 +34,8 @@ var cardStatusMap = {
|
|
|
34
34
|
used: 'warning',
|
|
35
35
|
expired: 'error',
|
|
36
36
|
conflict: 'error',
|
|
37
|
-
disabled: 'gray'
|
|
37
|
+
disabled: 'gray',
|
|
38
|
+
lastPayment: 'gray'
|
|
38
39
|
};
|
|
39
40
|
var PisellWalletPassCard = function PisellWalletPassCard(props) {
|
|
40
41
|
var _React$useState = React.useState(false),
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
interface InputItem {
|
|
2
|
+
start_date: string;
|
|
3
|
+
end_date: string;
|
|
4
|
+
total: number;
|
|
5
|
+
num: number;
|
|
6
|
+
}
|
|
7
|
+
interface OutputItem {
|
|
8
|
+
start_date: string;
|
|
9
|
+
end_date: string;
|
|
10
|
+
total: number;
|
|
11
|
+
num: number;
|
|
12
|
+
}
|
|
13
|
+
export declare function formatDateRanges(list: InputItem[]): OutputItem[];
|
|
14
|
+
export {};
|
|
@@ -17,4 +17,4 @@ export declare const minusSign: (item: any, type?: string) => "" | "-";
|
|
|
17
17
|
* @Author: WangHan
|
|
18
18
|
* @Date: 2024-11-22 10:58
|
|
19
19
|
*/
|
|
20
|
-
export declare const _formatAmount: (price?: number, amountSymbol?: string, digit?: number) =>
|
|
20
|
+
export declare const _formatAmount: (price?: number, amountSymbol?: string, digit?: number) => string | number;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
en: {
|
|
3
|
+
'pisell2.product.card.discount.reason': string;
|
|
4
|
+
'pisell2.cart.sku-card.more': string;
|
|
5
|
+
'pisell2.cart.sku-card.packages.title': string;
|
|
6
|
+
'pisell2.cart.sku-card.sales.title': string;
|
|
7
|
+
'pisell2.cart.sku-card.actions.delete': string;
|
|
8
|
+
'pisell2.product.card.day': (val: number) => string;
|
|
9
|
+
'pisell2.product.card.day.event': (val: number) => string;
|
|
10
|
+
'pisell2.product.card.minute': (val: number) => string;
|
|
11
|
+
'pisell2.product.card.discount.note': string;
|
|
12
|
+
'pisell2.product.card.edit': string;
|
|
13
|
+
'pisell2.product.card.discount.add.note': string;
|
|
14
|
+
'pisell2.product.card.discount.edit.note': string;
|
|
15
|
+
'pisell2.product.card.confirm': string;
|
|
16
|
+
'pisell2.product.card.cancel': string;
|
|
17
|
+
'pisell2.product.card.note.pla': string;
|
|
18
|
+
'pisell2.product.card.items.package': string;
|
|
19
|
+
'pisell2.product.card.view-all': string;
|
|
20
|
+
'pisell2.product.card.view-less': string;
|
|
21
|
+
'pisell2.product.card.add.holder.button.text': (val: string) => string;
|
|
22
|
+
'pisell2.product.card.add.holder.placeholder': (val: string) => string;
|
|
23
|
+
'pisell2.product.card.add.holder.placeholder.multiple': (num: number, val: string) => string;
|
|
24
|
+
'pisell2.product.card.add.holder.modal.title.1': string;
|
|
25
|
+
'pisell2.product.card.hour.minute': (hour: number, minute: number) => string;
|
|
26
|
+
'pisell2.product.card.sales': string;
|
|
27
|
+
'pisell2.product.card.add.holder.modal.cancel': string;
|
|
28
|
+
'pisell2.product.card.add.holder.modal.clear': string;
|
|
29
|
+
'pisell2.product.card.add.holder.modal.apply': string;
|
|
30
|
+
'pisell2.product.card.add.holder.modal.add': string;
|
|
31
|
+
'pisell2.product.card.closing-soon.warning': string;
|
|
32
|
+
};
|
|
33
|
+
'zh-CN': {
|
|
34
|
+
'pisell2.product.card.discount.reason': string;
|
|
35
|
+
'pisell2.cart.sku-card.more': string;
|
|
36
|
+
'pisell2.cart.sku-card.packages.title': string;
|
|
37
|
+
'pisell2.cart.sku-card.sales.title': string;
|
|
38
|
+
'pisell2.cart.sku-card.actions.delete': string;
|
|
39
|
+
'pisell2.product.card.edit': string;
|
|
40
|
+
'pisell2.product.card.day': (val: number) => string;
|
|
41
|
+
'pisell2.product.card.day.event': (val: number) => string;
|
|
42
|
+
'pisell2.product.card.minute': (val: number) => string;
|
|
43
|
+
'pisell2.product.card.discount.note': string;
|
|
44
|
+
'pisell2.product.card.discount.add.note': string;
|
|
45
|
+
'pisell2.product.card.discount.edit.note': string;
|
|
46
|
+
'pisell2.product.card.confirm': string;
|
|
47
|
+
'pisell2.product.card.cancel': string;
|
|
48
|
+
'pisell2.product.card.note.pla': string;
|
|
49
|
+
'pisell2.product.card.items.package': string;
|
|
50
|
+
'pisell2.product.card.view-all': string;
|
|
51
|
+
'pisell2.product.card.view-less': string;
|
|
52
|
+
'pisell2.product.card.add.holder.button.text': (val: string) => string;
|
|
53
|
+
'pisell2.product.card.add.holder.placeholder': (val: string) => string;
|
|
54
|
+
'pisell2.product.card.add.holder.placeholder.multiple': (num: number, val: string) => string;
|
|
55
|
+
'pisell2.product.card.add.holder.modal.title.1': string;
|
|
56
|
+
'pisell2.product.card.hour.minute': (hour: number, minute: number) => string;
|
|
57
|
+
'pisell2.product.card.sales': string;
|
|
58
|
+
'pisell2.product.card.add.holder.modal.cancel': string;
|
|
59
|
+
'pisell2.product.card.add.holder.modal.clear': string;
|
|
60
|
+
'pisell2.product.card.add.holder.modal.apply': string;
|
|
61
|
+
'pisell2.product.card.add.holder.modal.add': string;
|
|
62
|
+
'pisell2.product.card.closing-soon.warning': string;
|
|
63
|
+
};
|
|
64
|
+
'zh-HK': {
|
|
65
|
+
'pisell2.product.card.discount.reason': string;
|
|
66
|
+
'pisell2.cart.sku-card.more': string;
|
|
67
|
+
'pisell2.cart.sku-card.packages.title': string;
|
|
68
|
+
'pisell2.cart.sku-card.sales.title': string;
|
|
69
|
+
'pisell2.cart.sku-card.actions.delete': string;
|
|
70
|
+
'pisell2.product.card.edit': string;
|
|
71
|
+
'pisell2.product.card.day': (val: number) => string;
|
|
72
|
+
'pisell2.product.card.day.event': (val: number) => string;
|
|
73
|
+
'pisell2.product.card.minute': (val: number) => string;
|
|
74
|
+
'pisell2.product.card.discount.note': string;
|
|
75
|
+
'pisell2.product.card.discount.add.note': string;
|
|
76
|
+
'pisell2.product.card.discount.edit.note': string;
|
|
77
|
+
'pisell2.product.card.confirm': string;
|
|
78
|
+
'pisell2.product.card.cancel': string;
|
|
79
|
+
'pisell2.product.card.note.pla': string;
|
|
80
|
+
'pisell2.product.card.items.package': string;
|
|
81
|
+
'pisell2.product.card.view-all': string;
|
|
82
|
+
'pisell2.product.card.view-less': string;
|
|
83
|
+
'pisell2.product.card.add.holder.button.text': (val: string) => string;
|
|
84
|
+
'pisell2.product.card.add.holder.placeholder': (val: string) => string;
|
|
85
|
+
'pisell2.product.card.add.holder.placeholder.multiple': (num: number, val: string) => string;
|
|
86
|
+
'pisell2.product.card.add.holder.modal.title.1': string;
|
|
87
|
+
'pisell2.product.card.hour.minute': (hour: number, minute: number) => string;
|
|
88
|
+
'pisell2.product.card.sales': string;
|
|
89
|
+
'pisell2.product.card.add.holder.modal.cancel': string;
|
|
90
|
+
'pisell2.product.card.add.holder.modal.clear': string;
|
|
91
|
+
'pisell2.product.card.add.holder.modal.apply': string;
|
|
92
|
+
'pisell2.product.card.add.holder.modal.add': string;
|
|
93
|
+
'pisell2.product.card.closing-soon.warning': string;
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
export default _default;
|
|
@@ -17,4 +17,4 @@ export declare const minusSign: (item: any, type?: string) => "" | "-";
|
|
|
17
17
|
* @Author: WangHan
|
|
18
18
|
* @Date: 2024-11-22 10:58
|
|
19
19
|
*/
|
|
20
|
-
export declare const _formatAmount: (price?: number, amountSymbol?: string, digit?: number) =>
|
|
20
|
+
export declare const _formatAmount: (price?: number, amountSymbol?: string, digit?: number) => string | number;
|