@pisell/materials 6.2.24 → 6.2.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +7 -7
- package/build/lowcode/preview.js +146 -146
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +36 -27
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +41 -32
- package/es/components/DragSortList/index.js +6 -6
- package/es/components/classicLayout/index.js +4 -5
- package/es/components/dataSourceComponents/fields/Input.Subdomain/index.d.ts +1 -1
- package/es/components/dataSourceComponents/fields/Upload/utils.d.ts +1 -1
- package/es/components/dataSourceComponents/fields/index.d.ts +8 -8
- package/es/components/icon/index.js +5 -5
- package/es/components/iconfont/index.js +1 -1
- package/es/components/list/index.js +6 -6
- package/es/components/pisellAdjustPrice/index.d.ts +1 -6
- package/es/components/pisellAdjustPrice/index.js +64 -8
- package/es/components/pisellAdjustPrice/index.less +35 -6
- package/es/components/pisellAdjustPrice/status.js +32 -0
- package/es/components/pisellAdjustPrice/type.js +1 -0
- package/es/components/pisellToast/index.js +3 -0
- package/es/components/productCard/cartSkuCard/components/basicInfo/index.d.ts +21 -0
- package/es/components/productCard/cartSkuCard/components/basicInfo/index.js +61 -0
- package/es/components/productCard/cartSkuCard/components/basicInfo/index.less +98 -0
- package/es/components/productCard/cartSkuCard/components/discountReason/index.d.ts +2 -0
- package/es/components/productCard/cartSkuCard/components/discountReason/index.js +51 -0
- package/es/components/productCard/cartSkuCard/components/holders/index.d.ts +3 -0
- package/es/components/productCard/cartSkuCard/components/holders/index.js +32 -0
- package/es/components/productCard/cartSkuCard/components/holders/index.less +32 -0
- package/es/components/productCard/cartSkuCard/components/packages/index.d.ts +10 -0
- package/es/components/productCard/cartSkuCard/components/packages/index.js +52 -0
- package/es/components/productCard/cartSkuCard/components/packages/index.less +22 -0
- package/es/components/productCard/cartSkuCard/components/packages/utils.d.ts +20 -0
- package/es/components/productCard/cartSkuCard/components/packages/utils.js +40 -0
- package/es/components/productCard/cartSkuCard/components/resources/index.d.ts +3 -0
- package/es/components/productCard/cartSkuCard/components/resources/index.js +44 -0
- package/es/components/productCard/cartSkuCard/components/resources/index.less +20 -0
- package/es/components/productCard/cartSkuCard/components/sales/index.d.ts +11 -0
- package/es/components/productCard/cartSkuCard/components/sales/index.js +55 -0
- package/es/components/productCard/cartSkuCard/components/sales/index.less +22 -0
- package/es/components/productCard/cartSkuCard/components/specs/index.d.ts +3 -0
- package/es/components/productCard/cartSkuCard/components/specs/index.js +43 -0
- package/es/components/productCard/cartSkuCard/components/specs/index.less +28 -0
- package/es/components/productCard/cartSkuCard/components/timeRange/index.d.ts +6 -0
- package/es/components/productCard/cartSkuCard/components/timeRange/index.js +53 -0
- package/es/components/productCard/cartSkuCard/components/timeRange/index.less +37 -0
- package/es/components/productCard/cartSkuCard/index.d.ts +8 -0
- package/es/components/productCard/cartSkuCard/index.js +195 -0
- package/es/components/productCard/cartSkuCard/index.less +69 -0
- package/es/components/productCard/cartSkuCard/locales.js +30 -0
- package/es/components/productCard/components/Header/index.js +4 -3
- package/es/components/productCard/components/Sales/index.js +2 -2
- package/es/components/productCard/index.d.ts +3 -1
- package/es/components/productCard/index.js +2 -0
- package/es/components/qrcode/index.js +1 -1
- package/es/components/sort/components/InlineMenu/index.js +1 -1
- package/es/components/table/Actions/component/ButtonIcon/index.js +5 -5
- package/es/components/table/Actions/component/ViewMode/index.js +1 -1
- package/es/components/table/Gallery/components/GalleryItem/components/RenderFields/index.js +4 -5
- package/es/components/table/Header/Buttons/index.js +5 -5
- package/es/components/table/Table/AddFieldModal/index.js +6 -6
- package/es/components/table/Table/SelectField/index.js +4 -4
- package/es/components/table/Table/fields/date/Edit/index.js +1 -1
- package/es/components/table/Table/fields/link/Edit/index.js +5 -5
- package/es/components/table/Table/fields/rangePicker/filterUtil/index.js +1 -1
- package/es/components/table/Table/fields/search/filterUtil/index.js +0 -1
- package/es/components/table/Table/fields/text/Show/index.js +4 -4
- package/es/components/table/Table/fields/text/filterUtil/index.js +0 -1
- package/es/components/table/Table/tableConfig/SortRow/index.js +2 -2
- package/es/components/table/Table/tableConfig/body/CellContent/index.js +3 -3
- package/es/components/table/Table/tableConfig/body/CellProvider/index.js +8 -8
- package/es/components/table/Table/utils.d.ts +1 -1
- package/es/components/table/hooks/useMergeColumnSetting.js +1 -2
- package/es/components/table/hooks/useTransDataSourceGroupSetting.js +5 -5
- package/es/components/table/hooks/useTransFilterSetting.js +5 -5
- package/es/components/translation/utils.js +5 -5
- package/es/components/virtual-keyboard/Amount/index.d.ts +3 -20
- package/es/components/virtual-keyboard/Amount/index.js +79 -7
- package/es/components/virtual-keyboard/Amount/index.less +39 -0
- package/es/components/virtual-keyboard/Amount/themeConfig.js +32 -0
- package/es/components/virtual-keyboard/Amount/types.d.ts +44 -0
- package/es/components/virtual-keyboard/Amount/types.js +1 -0
- package/es/components/virtual-keyboard/BaseNumberKeyboard/index.d.ts +3 -1
- package/es/components/virtual-keyboard/BaseNumberKeyboard/index.js +38 -10
- package/es/components/virtual-keyboard/Keyboard/index.js +2 -2
- package/es/components/virtual-keyboard/Number/index.d.ts +3 -11
- package/es/components/virtual-keyboard/Number/index.js +77 -7
- package/es/components/virtual-keyboard/Number/index.less +39 -0
- package/es/components/virtual-keyboard/Number/themeConfig.js +32 -0
- package/es/components/virtual-keyboard/Number/types.js +1 -0
- package/es/components/virtual-keyboard/VirtualKeyInput/index.js +10 -3
- package/es/components/virtual-keyboard/index.d.ts +11 -0
- package/es/components/virtual-keyboard/index.js +88 -3
- package/es/components/virtual-keyboard/index.less +33 -1
- package/es/hooks/useResponsive.js +2 -2
- package/es/utils/hoc.js +1 -1
- package/es/utils/miniRedux.js +8 -9
- package/lib/components/dataSourceComponents/fields/Input.Subdomain/index.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/Upload/utils.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/index.d.ts +8 -8
- package/lib/components/iconfont/index.js +1 -1
- package/lib/components/lowCodePage/index.js +1 -2
- package/lib/components/pisellAdjustPrice/index.d.ts +1 -6
- package/lib/components/pisellAdjustPrice/index.js +119 -57
- package/lib/components/pisellAdjustPrice/index.less +35 -6
- package/lib/components/pisellAdjustPrice/status.js +60 -0
- package/lib/components/pisellAdjustPrice/type.js +17 -0
- package/lib/components/pisellToast/index.js +3 -0
- package/lib/components/productCard/cartSkuCard/components/basicInfo/index.d.ts +21 -0
- package/lib/components/productCard/cartSkuCard/components/basicInfo/index.js +71 -0
- package/lib/components/productCard/cartSkuCard/components/basicInfo/index.less +98 -0
- package/lib/components/productCard/cartSkuCard/components/discountReason/index.d.ts +2 -0
- package/lib/components/productCard/cartSkuCard/components/discountReason/index.js +70 -0
- package/lib/components/productCard/cartSkuCard/components/holders/index.d.ts +3 -0
- package/lib/components/productCard/cartSkuCard/components/holders/index.js +52 -0
- package/lib/components/productCard/cartSkuCard/components/holders/index.less +32 -0
- package/lib/components/productCard/cartSkuCard/components/packages/index.d.ts +10 -0
- package/lib/components/productCard/cartSkuCard/components/packages/index.js +73 -0
- package/lib/components/productCard/cartSkuCard/components/packages/index.less +22 -0
- package/lib/components/productCard/cartSkuCard/components/packages/utils.d.ts +20 -0
- package/lib/components/productCard/cartSkuCard/components/packages/utils.js +44 -0
- package/lib/components/productCard/cartSkuCard/components/resources/index.d.ts +3 -0
- package/lib/components/productCard/cartSkuCard/components/resources/index.js +73 -0
- package/lib/components/productCard/cartSkuCard/components/resources/index.less +20 -0
- package/lib/components/productCard/cartSkuCard/components/sales/index.d.ts +11 -0
- package/lib/components/productCard/cartSkuCard/components/sales/index.js +76 -0
- package/lib/components/productCard/cartSkuCard/components/sales/index.less +22 -0
- package/lib/components/productCard/cartSkuCard/components/specs/index.d.ts +3 -0
- package/lib/components/productCard/cartSkuCard/components/specs/index.js +65 -0
- package/lib/components/productCard/cartSkuCard/components/specs/index.less +28 -0
- package/lib/components/productCard/cartSkuCard/components/timeRange/index.d.ts +6 -0
- package/lib/components/productCard/cartSkuCard/components/timeRange/index.js +67 -0
- package/lib/components/productCard/cartSkuCard/components/timeRange/index.less +37 -0
- package/lib/components/productCard/cartSkuCard/index.d.ts +8 -0
- package/lib/components/productCard/cartSkuCard/index.js +216 -0
- package/lib/components/productCard/cartSkuCard/index.less +69 -0
- package/lib/components/productCard/cartSkuCard/locales.js +61 -0
- package/lib/components/productCard/components/Header/index.js +4 -3
- package/lib/components/productCard/components/Sales/index.js +2 -2
- package/lib/components/productCard/index.d.ts +3 -1
- package/lib/components/productCard/index.js +2 -0
- package/lib/components/table/Table/fields/date/filterUtil/index.js +3 -6
- package/lib/components/table/Table/fields/rangePicker/filterUtil/index.js +4 -8
- package/lib/components/table/Table/fields/utils/index.js +1 -2
- package/lib/components/table/Table/utils.d.ts +1 -1
- package/lib/components/virtual-keyboard/Amount/index.d.ts +3 -20
- package/lib/components/virtual-keyboard/Amount/index.js +72 -16
- package/lib/components/virtual-keyboard/Amount/index.less +39 -0
- package/lib/components/virtual-keyboard/Amount/themeConfig.js +60 -0
- package/lib/components/virtual-keyboard/Amount/types.d.ts +44 -0
- package/lib/components/virtual-keyboard/Amount/types.js +17 -0
- package/lib/components/virtual-keyboard/BaseNumberKeyboard/index.d.ts +3 -1
- package/lib/components/virtual-keyboard/BaseNumberKeyboard/index.js +31 -8
- package/lib/components/virtual-keyboard/Keyboard/index.js +2 -1
- package/lib/components/virtual-keyboard/Number/index.d.ts +3 -11
- package/lib/components/virtual-keyboard/Number/index.js +65 -11
- package/lib/components/virtual-keyboard/Number/index.less +39 -0
- package/lib/components/virtual-keyboard/Number/themeConfig.js +60 -0
- package/lib/components/virtual-keyboard/Number/types.js +17 -0
- package/lib/components/virtual-keyboard/VirtualKeyInput/index.js +34 -20
- package/lib/components/virtual-keyboard/index.d.ts +11 -0
- package/lib/components/virtual-keyboard/index.js +60 -2
- package/lib/components/virtual-keyboard/index.less +33 -1
- package/lib/hooks/useResponsive.js +3 -6
- package/lowcode/_setters/antd-icon-setter/index.tsx +3 -2
- package/lowcode/pisell-adjust-price/meta.ts +168 -0
- package/lowcode/pisell-adjust-price/snippets.ts +1 -0
- package/lowcode/pisell-number-keyboard/meta.ts +167 -0
- package/lowcode/pisell-price-keyboard/meta.ts +167 -0
- package/lowcode/virtual-keyboard/meta.ts +131 -0
- package/package.json +1 -1
- 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
- package/es/components/iconfont/index.d.ts +0 -8
- package/es/components/productCard/locales.d.ts +0 -84
- package/es/components/productCard/status.d.ts +0 -32
- package/es/components/productCard/types.d.ts +0 -84
- package/es/components/virtual-keyboard/Keyboard/index.d.ts +0 -21
- package/es/components/virtual-keyboard/VirtualKeyInput/index.d.ts +0 -11
- package/lib/components/iconfont/index.d.ts +0 -8
- package/lib/components/productCard/locales.d.ts +0 -84
- package/lib/components/productCard/status.d.ts +0 -32
- package/lib/components/productCard/types.d.ts +0 -84
- package/lib/components/virtual-keyboard/Keyboard/index.d.ts +0 -21
- package/lib/components/virtual-keyboard/VirtualKeyInput/index.d.ts +0 -11
|
@@ -59,11 +59,12 @@ var Header = (props) => {
|
|
|
59
59
|
name,
|
|
60
60
|
price,
|
|
61
61
|
symbol,
|
|
62
|
-
disabled
|
|
62
|
+
disabled,
|
|
63
|
+
relation_products
|
|
63
64
|
} = item;
|
|
64
65
|
const showPrice = (0, import_react.useMemo)(() => {
|
|
65
|
-
return (bundle == null ? void 0 : bundle.length) > 0 || (options == null ? void 0 : options.length) > 0;
|
|
66
|
-
}, [bundle, options]);
|
|
66
|
+
return (bundle == null ? void 0 : bundle.length) > 0 || (options == null ? void 0 : options.length) > 0 || ((relation_products == null ? void 0 : relation_products.length) || 0) > 0;
|
|
67
|
+
}, [bundle, options, relation_products]);
|
|
67
68
|
const headerCenterStyle = (0, import_react.useMemo)(() => {
|
|
68
69
|
return (options == null ? void 0 : options.length) > 0 || product_option_string;
|
|
69
70
|
}, [options, product_option_string]);
|
|
@@ -44,10 +44,10 @@ var Sales = ({ item, isShowNote }) => {
|
|
|
44
44
|
return {
|
|
45
45
|
...p,
|
|
46
46
|
title: p == null ? void 0 : p.product_title,
|
|
47
|
-
price: p == null ? void 0 : p.
|
|
47
|
+
price: p == null ? void 0 : p.selling_price,
|
|
48
48
|
symbol: item.symbol,
|
|
49
49
|
num: p == null ? void 0 : p.product_quantity,
|
|
50
|
-
total: p == null ? void 0 : p.
|
|
50
|
+
total: p == null ? void 0 : p.selling_price
|
|
51
51
|
};
|
|
52
52
|
});
|
|
53
53
|
return (other_products == null ? void 0 : other_products.length) > 0 ? /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefix}product-sales-wrap` }, /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefix}product-sales-title` }, import_utils2.locales.getText("pisell2.product.card.sales")), /* @__PURE__ */ import_react.default.createElement(
|
|
@@ -51,6 +51,7 @@ var import_status = require("./status");
|
|
|
51
51
|
var import_useEngineContext = __toESM(require("../../hooks/useEngineContext"));
|
|
52
52
|
var import_Warning = __toESM(require("./components/Warning"));
|
|
53
53
|
var import_index = require("./index.less");
|
|
54
|
+
var import_cartSkuCard = __toESM(require("./cartSkuCard"));
|
|
54
55
|
var ProductCard = (props) => {
|
|
55
56
|
var _a, _b;
|
|
56
57
|
const context = (0, import_useEngineContext.default)();
|
|
@@ -197,4 +198,5 @@ var ProductCard = (props) => {
|
|
|
197
198
|
)
|
|
198
199
|
);
|
|
199
200
|
};
|
|
201
|
+
ProductCard.V2 = import_cartSkuCard.default;
|
|
200
202
|
var productCard_default = ProductCard;
|
|
@@ -40,17 +40,14 @@ function filterUtil_default({
|
|
|
40
40
|
key,
|
|
41
41
|
item
|
|
42
42
|
}) {
|
|
43
|
-
if (!value)
|
|
44
|
-
return true;
|
|
43
|
+
if (!value) return true;
|
|
45
44
|
const valueDayjsObj = (0, import_dayjs.default)(value);
|
|
46
45
|
if (!valueDayjsObj.isValid()) {
|
|
47
46
|
return true;
|
|
48
47
|
}
|
|
49
48
|
const dataValue = (0, import_utils2.getValueByKeys)(item, key);
|
|
50
|
-
if ((0, import_utils.isUndefined)(dataValue))
|
|
51
|
-
return false;
|
|
49
|
+
if ((0, import_utils.isUndefined)(dataValue)) return false;
|
|
52
50
|
const dataDayjsObj = (0, import_dayjs.default)(dataValue);
|
|
53
|
-
if (!dataDayjsObj.isValid())
|
|
54
|
-
return false;
|
|
51
|
+
if (!dataDayjsObj.isValid()) return false;
|
|
55
52
|
return dataDayjsObj.isSame(valueDayjsObj, "day");
|
|
56
53
|
}
|
|
@@ -43,19 +43,15 @@ function filterUtil_default({
|
|
|
43
43
|
key,
|
|
44
44
|
item
|
|
45
45
|
}) {
|
|
46
|
-
if (!value)
|
|
47
|
-
|
|
48
|
-
if ((value == null ? void 0 : value.length) !== 2)
|
|
49
|
-
return true;
|
|
46
|
+
if (!value) return true;
|
|
47
|
+
if ((value == null ? void 0 : value.length) !== 2) return true;
|
|
50
48
|
const valueDayjsObj = value.map((item2) => (0, import_dayjs.default)(item2 || ""));
|
|
51
49
|
if (valueDayjsObj.some((item2) => !item2.isValid())) {
|
|
52
50
|
return true;
|
|
53
51
|
}
|
|
54
52
|
const dataValue = (0, import_utils2.getValueByKeys)(item, key);
|
|
55
|
-
if ((0, import_utils.isUndefined)(dataValue))
|
|
56
|
-
return false;
|
|
53
|
+
if ((0, import_utils.isUndefined)(dataValue)) return false;
|
|
57
54
|
const dataDayjsObj = (0, import_dayjs.default)(dataValue);
|
|
58
|
-
if (!dataDayjsObj.isValid())
|
|
59
|
-
return false;
|
|
55
|
+
if (!dataDayjsObj.isValid()) return false;
|
|
60
56
|
return isDateInRange(dataDayjsObj, valueDayjsObj);
|
|
61
57
|
}
|
|
@@ -25,8 +25,7 @@ module.exports = __toCommonJS(utils_exports);
|
|
|
25
25
|
var import_utils = require("@pisell/utils");
|
|
26
26
|
var getValueByKeys = (obj, keys) => {
|
|
27
27
|
var _a;
|
|
28
|
-
if (!keys)
|
|
29
|
-
return keys;
|
|
28
|
+
if (!keys) return keys;
|
|
30
29
|
if ((0, import_utils.isString)(keys)) {
|
|
31
30
|
keys = [keys];
|
|
32
31
|
}
|
|
@@ -155,7 +155,7 @@ export declare const getSettingKeyArrByMode: ({ filter, columnSetting, dataSourc
|
|
|
155
155
|
sort?: SortType | undefined;
|
|
156
156
|
mode: "" | "localStorage" | "remote";
|
|
157
157
|
currentViewMode: ModeType;
|
|
158
|
-
}) => ("
|
|
158
|
+
}) => ("view_mode" | "filter_setting" | "group_by" | "order_by" | "column_setting" | "gallery_setting")[];
|
|
159
159
|
export declare const omit: (obj: Record<string, any>, keys: string[]) => Record<string, any>;
|
|
160
160
|
export declare const stringify: (obj: Record<string, any>) => string;
|
|
161
161
|
export {};
|
|
@@ -1,22 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
export
|
|
4
|
-
max?: number;
|
|
5
|
-
min?: number;
|
|
6
|
-
doneText?: string;
|
|
7
|
-
resetText?: string;
|
|
8
|
-
defaultValue?: string | number;
|
|
9
|
-
placeholder?: string;
|
|
10
|
-
amountProps?: {
|
|
11
|
-
showCurrencySymbol: boolean;
|
|
12
|
-
useThousandsSeparator: boolean;
|
|
13
|
-
};
|
|
14
|
-
presets?: BaseNumberKeyboardProps['presets'];
|
|
15
|
-
value?: string | number;
|
|
16
|
-
onChange?: (val: string | number) => void;
|
|
17
|
-
onEnter?: (val: string | number) => void;
|
|
18
|
-
defaultSelect?: boolean;
|
|
19
|
-
inputFormat?: (_v: string) => React.ReactNode | null;
|
|
20
|
-
}
|
|
1
|
+
import { AmountProps, RightItemsStyleProps } from './types';
|
|
2
|
+
import './index.less';
|
|
3
|
+
export type { AmountProps, RightItemsStyleProps };
|
|
21
4
|
declare const Amount: (props: AmountProps) => JSX.Element;
|
|
22
5
|
export default Amount;
|
|
@@ -34,8 +34,13 @@ __export(Amount_exports, {
|
|
|
34
34
|
module.exports = __toCommonJS(Amount_exports);
|
|
35
35
|
var import_react = __toESM(require("react"));
|
|
36
36
|
var import_ahooks = require("ahooks");
|
|
37
|
+
var import_classnames = __toESM(require("classnames"));
|
|
38
|
+
var import_utils = require("@pisell/utils");
|
|
37
39
|
var import_BaseNumberKeyboard = __toESM(require("../BaseNumberKeyboard"));
|
|
38
40
|
var import_pisellText = __toESM(require("../../pisellText"));
|
|
41
|
+
var import_usePisellConfig = __toESM(require("../../pisell-config-provider/hooks/usePisellConfig"));
|
|
42
|
+
var import_themeConfig = require("./themeConfig");
|
|
43
|
+
var import_index = require("./index.less");
|
|
39
44
|
var Amount = (props) => {
|
|
40
45
|
const {
|
|
41
46
|
min,
|
|
@@ -48,14 +53,43 @@ var Amount = (props) => {
|
|
|
48
53
|
onEnter,
|
|
49
54
|
presets,
|
|
50
55
|
defaultSelect,
|
|
51
|
-
inputFormat
|
|
56
|
+
inputFormat,
|
|
57
|
+
rightItemsStyle,
|
|
58
|
+
selectType = "light",
|
|
59
|
+
...others
|
|
52
60
|
} = props;
|
|
61
|
+
const config = (0, import_usePisellConfig.default)();
|
|
53
62
|
const [value, setValue] = (0, import_ahooks.useControllableValue)(props, {
|
|
54
63
|
defaultValue: defaultValue || ""
|
|
55
64
|
});
|
|
56
65
|
(0, import_react.useEffect)(() => {
|
|
57
66
|
document.body.id = "body";
|
|
58
67
|
}, []);
|
|
68
|
+
const configColor = (0, import_react.useMemo)(() => {
|
|
69
|
+
const currentConfig = import_themeConfig.amountThemeConfig[selectType];
|
|
70
|
+
const validProps = Object.entries(props).reduce((acc, [key, value2]) => {
|
|
71
|
+
if (value2 !== void 0 && key in currentConfig) {
|
|
72
|
+
acc[key] = value2;
|
|
73
|
+
}
|
|
74
|
+
return acc;
|
|
75
|
+
}, {});
|
|
76
|
+
return { ...currentConfig, ...validProps };
|
|
77
|
+
}, [selectType, props]);
|
|
78
|
+
(0, import_react.useEffect)(() => {
|
|
79
|
+
(0, import_utils.setTheme)({
|
|
80
|
+
"--pisell-amount-background-color": configColor.backgroundColor,
|
|
81
|
+
"--pisell-amount-container-background-color": configColor.containerBackgroundColor,
|
|
82
|
+
"--pisell-amount-text-color": configColor.textColor,
|
|
83
|
+
"--pisell-amount-keyboard-background-color": configColor.keyboardBackgroundColor,
|
|
84
|
+
"--pisell-amount-keyboard-button-background-color": configColor.keyboardButtonBackgroundColor,
|
|
85
|
+
"--pisell-amount-keyboard-button-text-color": configColor.keyboardButtonTextColor,
|
|
86
|
+
"--pisell-amount-keyboard-button-hover-color": configColor.keyboardButtonHoverColor,
|
|
87
|
+
"--pisell-amount-reset-button-background-color": configColor.resetButtonBackgroundColor,
|
|
88
|
+
"--pisell-amount-reset-button-text-color": configColor.resetButtonTextColor,
|
|
89
|
+
"--pisell-amount-done-button-background-color": configColor.doneButtonBackgroundColor,
|
|
90
|
+
"--pisell-amount-done-button-text-color": configColor.doneButtonTextColor
|
|
91
|
+
});
|
|
92
|
+
}, [configColor]);
|
|
59
93
|
const format = (_v) => {
|
|
60
94
|
const v = `${_v}`;
|
|
61
95
|
if (inputFormat == null ? void 0 : inputFormat(v)) {
|
|
@@ -71,26 +105,48 @@ var Amount = (props) => {
|
|
|
71
105
|
precision,
|
|
72
106
|
hideDecimalForWholeNumbers: false,
|
|
73
107
|
showCurrencySymbol: amountProps == null ? void 0 : amountProps.showCurrencySymbol,
|
|
74
|
-
useThousandsSeparator: amountProps == null ? void 0 : amountProps.useThousandsSeparator
|
|
108
|
+
useThousandsSeparator: amountProps == null ? void 0 : amountProps.useThousandsSeparator,
|
|
109
|
+
style: {
|
|
110
|
+
color: (rightItemsStyle == null ? void 0 : rightItemsStyle.textColor) || configColor.textColor
|
|
111
|
+
}
|
|
75
112
|
}
|
|
76
113
|
), endWith && ".");
|
|
77
114
|
};
|
|
78
115
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
79
|
-
|
|
116
|
+
"div",
|
|
80
117
|
{
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
118
|
+
className: (0, import_classnames.default)("pisell-amount-keyboard-wrap", {
|
|
119
|
+
"pisell-amount-keyboard-dark": selectType === "dark",
|
|
120
|
+
"pisell-amount-keyboard-light": selectType === "light"
|
|
121
|
+
})
|
|
122
|
+
},
|
|
123
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
124
|
+
import_BaseNumberKeyboard.default,
|
|
125
|
+
{
|
|
126
|
+
defaultSelect,
|
|
127
|
+
max,
|
|
128
|
+
min,
|
|
129
|
+
value,
|
|
130
|
+
onChange: setValue,
|
|
131
|
+
placeholder,
|
|
132
|
+
defaultValue,
|
|
133
|
+
format,
|
|
134
|
+
doneText,
|
|
135
|
+
resetText,
|
|
136
|
+
onEnter,
|
|
137
|
+
presets,
|
|
138
|
+
rightItemsStyle: {
|
|
139
|
+
...rightItemsStyle,
|
|
140
|
+
buttonBackgroundColor: (rightItemsStyle == null ? void 0 : rightItemsStyle.buttonBackgroundColor) || configColor.buttonBackgroundColor,
|
|
141
|
+
textColor: (rightItemsStyle == null ? void 0 : rightItemsStyle.textColor) || configColor.textColor,
|
|
142
|
+
resetButtonBackgroundColor: (rightItemsStyle == null ? void 0 : rightItemsStyle.resetButtonBackgroundColor) || configColor.resetButtonBackgroundColor,
|
|
143
|
+
resetButtonTextColor: (rightItemsStyle == null ? void 0 : rightItemsStyle.resetButtonTextColor) || configColor.resetButtonTextColor,
|
|
144
|
+
isDoneButtonFollowTheme: (rightItemsStyle == null ? void 0 : rightItemsStyle.isDoneButtonFollowTheme) ?? configColor.isDoneButtonFollowTheme,
|
|
145
|
+
doneButtonBackgroundColor: (rightItemsStyle == null ? void 0 : rightItemsStyle.doneButtonBackgroundColor) || configColor.doneButtonBackgroundColor,
|
|
146
|
+
doneButtonTextColor: (rightItemsStyle == null ? void 0 : rightItemsStyle.doneButtonTextColor) || configColor.doneButtonTextColor
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
)
|
|
94
150
|
);
|
|
95
151
|
};
|
|
96
152
|
var Amount_default = Amount;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
.pisell-amount-keyboard-wrap {
|
|
2
|
+
background-color: var(--pisell-amount-background-color, #ffffff);
|
|
3
|
+
|
|
4
|
+
&.pisell-amount-keyboard-dark {
|
|
5
|
+
background-color: var(--pisell-amount-background-color, rgba(0, 0, 0, 0.70));
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
&.pisell-amount-keyboard-light {
|
|
9
|
+
background-color: var(--pisell-amount-background-color, #ffffff);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.pisell-virtual-keyboard-input {
|
|
13
|
+
background-color: var(--pisell-amount-container-background-color, #d0d5dd);
|
|
14
|
+
color: var(--pisell-amount-text-color, #000000);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.pisell-keyboard {
|
|
18
|
+
background-color: var(--pisell-amount-keyboard-background-color, #f9f9f9);
|
|
19
|
+
|
|
20
|
+
.pisell-keyboard-item {
|
|
21
|
+
background-color: var(--pisell-amount-keyboard-button-background-color, #ffffff);
|
|
22
|
+
color: var(--pisell-amount-keyboard-button-text-color, #000000);
|
|
23
|
+
|
|
24
|
+
&:hover {
|
|
25
|
+
background-color: var(--pisell-amount-keyboard-button-hover-color, #f5f5f5);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.pisell-keyboard-reset-button {
|
|
30
|
+
background-color: var(--pisell-amount-reset-button-background-color, #ffffff);
|
|
31
|
+
color: var(--pisell-amount-reset-button-text-color, #d92d20);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.pisell-keyboard-done-button {
|
|
35
|
+
background-color: var(--pisell-amount-done-button-background-color, #4ca30d);
|
|
36
|
+
color: var(--pisell-amount-done-button-text-color, #ffffff);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/components/virtual-keyboard/Amount/themeConfig.ts
|
|
20
|
+
var themeConfig_exports = {};
|
|
21
|
+
__export(themeConfig_exports, {
|
|
22
|
+
amountThemeConfig: () => amountThemeConfig
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(themeConfig_exports);
|
|
25
|
+
var amountThemeConfig = {
|
|
26
|
+
dark: {
|
|
27
|
+
backgroundColor: "rgba(0, 0, 0, 0.70)",
|
|
28
|
+
containerBackgroundColor: "rgba(0, 0, 0, 0.40)",
|
|
29
|
+
buttonBackgroundColor: "#ffffff",
|
|
30
|
+
textColor: "#000000",
|
|
31
|
+
resetButtonBackgroundColor: "#ffffff",
|
|
32
|
+
resetButtonTextColor: "#d92d20",
|
|
33
|
+
isDoneButtonFollowTheme: true,
|
|
34
|
+
doneButtonBackgroundColor: "#4ca30d",
|
|
35
|
+
doneButtonTextColor: "#ffffff",
|
|
36
|
+
keyboardBackgroundColor: "rgba(0, 0, 0, 0.40)",
|
|
37
|
+
keyboardButtonBackgroundColor: "#ffffff",
|
|
38
|
+
keyboardButtonTextColor: "#000000",
|
|
39
|
+
keyboardButtonHoverColor: "#f5f5f5"
|
|
40
|
+
},
|
|
41
|
+
light: {
|
|
42
|
+
backgroundColor: "#ffffff",
|
|
43
|
+
containerBackgroundColor: "#d0d5dd",
|
|
44
|
+
buttonBackgroundColor: "#ffffff",
|
|
45
|
+
textColor: "#000000",
|
|
46
|
+
resetButtonBackgroundColor: "#ffffff",
|
|
47
|
+
resetButtonTextColor: "#d92d20",
|
|
48
|
+
isDoneButtonFollowTheme: true,
|
|
49
|
+
doneButtonBackgroundColor: "#4ca30d",
|
|
50
|
+
doneButtonTextColor: "#ffffff",
|
|
51
|
+
keyboardBackgroundColor: "#f9f9f9",
|
|
52
|
+
keyboardButtonBackgroundColor: "#ffffff",
|
|
53
|
+
keyboardButtonTextColor: "#000000",
|
|
54
|
+
keyboardButtonHoverColor: "#f5f5f5"
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
58
|
+
0 && (module.exports = {
|
|
59
|
+
amountThemeConfig
|
|
60
|
+
});
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { BaseNumberKeyboardProps } from '../BaseNumberKeyboard';
|
|
3
|
+
export interface RightItemsStyleProps {
|
|
4
|
+
buttonBackgroundColor?: string;
|
|
5
|
+
textColor?: string;
|
|
6
|
+
resetButtonBackgroundColor?: string;
|
|
7
|
+
resetButtonTextColor?: string;
|
|
8
|
+
isDoneButtonFollowTheme?: boolean;
|
|
9
|
+
doneButtonBackgroundColor?: string;
|
|
10
|
+
doneButtonTextColor?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface AmountProps {
|
|
13
|
+
max?: number;
|
|
14
|
+
min?: number;
|
|
15
|
+
doneText?: string;
|
|
16
|
+
resetText?: string;
|
|
17
|
+
defaultValue?: string | number;
|
|
18
|
+
placeholder?: string;
|
|
19
|
+
amountProps?: {
|
|
20
|
+
showCurrencySymbol: boolean;
|
|
21
|
+
useThousandsSeparator: boolean;
|
|
22
|
+
};
|
|
23
|
+
presets?: BaseNumberKeyboardProps['presets'];
|
|
24
|
+
value?: string | number;
|
|
25
|
+
onChange?: (val: string | number) => void;
|
|
26
|
+
onEnter?: (val: string | number) => void;
|
|
27
|
+
defaultSelect?: boolean;
|
|
28
|
+
inputFormat?: (_v: string) => React.ReactNode | null;
|
|
29
|
+
rightItemsStyle?: RightItemsStyleProps;
|
|
30
|
+
selectType?: 'light' | 'dark';
|
|
31
|
+
backgroundColor?: string;
|
|
32
|
+
containerBackgroundColor?: string;
|
|
33
|
+
buttonBackgroundColor?: string;
|
|
34
|
+
textColor?: string;
|
|
35
|
+
resetButtonBackgroundColor?: string;
|
|
36
|
+
resetButtonTextColor?: string;
|
|
37
|
+
isDoneButtonFollowTheme?: boolean;
|
|
38
|
+
doneButtonBackgroundColor?: string;
|
|
39
|
+
doneButtonTextColor?: string;
|
|
40
|
+
keyboardBackgroundColor?: string;
|
|
41
|
+
keyboardButtonBackgroundColor?: string;
|
|
42
|
+
keyboardButtonTextColor?: string;
|
|
43
|
+
keyboardButtonHoverColor?: string;
|
|
44
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
for (let key of __getOwnPropNames(from))
|
|
8
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
+
}
|
|
11
|
+
return to;
|
|
12
|
+
};
|
|
13
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
14
|
+
|
|
15
|
+
// src/components/virtual-keyboard/Amount/types.ts
|
|
16
|
+
var types_exports = {};
|
|
17
|
+
module.exports = __toCommonJS(types_exports);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { PresetsProps } from
|
|
2
|
+
import { PresetsProps } from './Presets';
|
|
3
|
+
import { RightItemsStyleProps } from '../Amount';
|
|
3
4
|
import './index.less';
|
|
4
5
|
export interface BaseNumberKeyboardProps {
|
|
5
6
|
placeholder?: string;
|
|
@@ -14,6 +15,7 @@ export interface BaseNumberKeyboardProps {
|
|
|
14
15
|
min?: number;
|
|
15
16
|
presets?: PresetsProps['presets'];
|
|
16
17
|
defaultSelect?: boolean;
|
|
18
|
+
rightItemsStyle?: RightItemsStyleProps;
|
|
17
19
|
}
|
|
18
20
|
declare const BaseNumberKeyboard: (props: BaseNumberKeyboardProps) => JSX.Element;
|
|
19
21
|
export default BaseNumberKeyboard;
|
|
@@ -127,7 +127,8 @@ var BaseNumberKeyboard = (props) => {
|
|
|
127
127
|
min,
|
|
128
128
|
onEnter,
|
|
129
129
|
presets,
|
|
130
|
-
defaultSelect
|
|
130
|
+
defaultSelect,
|
|
131
|
+
rightItemsStyle
|
|
131
132
|
} = props;
|
|
132
133
|
const [value, setValue] = (0, import_ahooks.useControllableValue)(props, {
|
|
133
134
|
defaultValue
|
|
@@ -142,7 +143,11 @@ var BaseNumberKeyboard = (props) => {
|
|
|
142
143
|
value: "delete",
|
|
143
144
|
label: /* @__PURE__ */ import_react.default.createElement(import_Delete.default, { className: "virtual-keyboard-input-delete-icon" }),
|
|
144
145
|
disabled: false,
|
|
145
|
-
type: "text"
|
|
146
|
+
type: "text",
|
|
147
|
+
style: {
|
|
148
|
+
color: (rightItemsStyle == null ? void 0 : rightItemsStyle.textColor) || "#000000",
|
|
149
|
+
backgroundColor: (rightItemsStyle == null ? void 0 : rightItemsStyle.buttonBackgroundColor) || "#ffffff"
|
|
150
|
+
}
|
|
146
151
|
},
|
|
147
152
|
{
|
|
148
153
|
value: "reset",
|
|
@@ -151,7 +156,8 @@ var BaseNumberKeyboard = (props) => {
|
|
|
151
156
|
type: "text",
|
|
152
157
|
style: {
|
|
153
158
|
fontSize: "18px",
|
|
154
|
-
color: "#D92D20"
|
|
159
|
+
color: (rightItemsStyle == null ? void 0 : rightItemsStyle.resetButtonTextColor) || "#D92D20",
|
|
160
|
+
backgroundColor: (rightItemsStyle == null ? void 0 : rightItemsStyle.resetButtonBackgroundColor) || "#ffffff"
|
|
155
161
|
}
|
|
156
162
|
},
|
|
157
163
|
{
|
|
@@ -162,12 +168,25 @@ var BaseNumberKeyboard = (props) => {
|
|
|
162
168
|
size: 2,
|
|
163
169
|
style: {
|
|
164
170
|
fontSize: "18px",
|
|
165
|
-
background: "var(--
|
|
166
|
-
color: "#
|
|
171
|
+
background: (rightItemsStyle == null ? void 0 : rightItemsStyle.isDoneButtonFollowTheme) ? "var(--theme-color)" : (rightItemsStyle == null ? void 0 : rightItemsStyle.doneButtonBackgroundColor) || "#5d3f9f",
|
|
172
|
+
color: (rightItemsStyle == null ? void 0 : rightItemsStyle.isDoneButtonFollowTheme) ? "#ffffff" : (rightItemsStyle == null ? void 0 : rightItemsStyle.doneButtonTextColor) || "#ffffff"
|
|
167
173
|
}
|
|
168
174
|
}
|
|
169
175
|
];
|
|
170
|
-
}, [doneText, resetText]);
|
|
176
|
+
}, [doneText, resetText, rightItemsStyle]);
|
|
177
|
+
const itemsWithStyle = (0, import_react.useMemo)(() => {
|
|
178
|
+
return items.map((item) => ({
|
|
179
|
+
...item,
|
|
180
|
+
style: {
|
|
181
|
+
backgroundColor: (rightItemsStyle == null ? void 0 : rightItemsStyle.buttonBackgroundColor) || "#fff",
|
|
182
|
+
color: (rightItemsStyle == null ? void 0 : rightItemsStyle.textColor) || "#000000"
|
|
183
|
+
}
|
|
184
|
+
}));
|
|
185
|
+
}, [
|
|
186
|
+
items,
|
|
187
|
+
rightItemsStyle == null ? void 0 : rightItemsStyle.buttonBackgroundColor,
|
|
188
|
+
rightItemsStyle == null ? void 0 : rightItemsStyle.textColor
|
|
189
|
+
]);
|
|
171
190
|
const checkValue = (val) => {
|
|
172
191
|
if ((0, import_utils.isNumber)(max) && Number(val) > max) {
|
|
173
192
|
const newValue = Math.min(Number(val), Number(max));
|
|
@@ -229,12 +248,16 @@ var BaseNumberKeyboard = (props) => {
|
|
|
229
248
|
},
|
|
230
249
|
showDelete: false,
|
|
231
250
|
onValueSelect: setSelect,
|
|
232
|
-
defaultSelect
|
|
251
|
+
defaultSelect,
|
|
252
|
+
style: {
|
|
253
|
+
backgroundColor: (rightItemsStyle == null ? void 0 : rightItemsStyle.buttonBackgroundColor) || "#fff",
|
|
254
|
+
color: (rightItemsStyle == null ? void 0 : rightItemsStyle.textColor) || "#000000"
|
|
255
|
+
}
|
|
233
256
|
}
|
|
234
257
|
), /* @__PURE__ */ import_react.default.createElement(import_Presets.default, { presets, onChange: handleChangeValue }), /* @__PURE__ */ import_react.default.createElement(
|
|
235
258
|
import_Keyboard.default,
|
|
236
259
|
{
|
|
237
|
-
items,
|
|
260
|
+
items: itemsWithStyle,
|
|
238
261
|
rightItems,
|
|
239
262
|
onChange: handleKeyboardChange
|
|
240
263
|
}
|
|
@@ -124,7 +124,8 @@ var Keyboard = (props) => {
|
|
|
124
124
|
className: "virtual-keyboard-item-button",
|
|
125
125
|
style: {
|
|
126
126
|
fontSize: ((_a = item.style) == null ? void 0 : _a.fontSize) || 25,
|
|
127
|
-
color: item.type === "primary" ? "#fff" : ((_b = item.style) == null ? void 0 : _b.color) || void 0
|
|
127
|
+
color: item.type === "primary" ? "#fff" : ((_b = item.style) == null ? void 0 : _b.color) || void 0,
|
|
128
|
+
...item.type === "primary" ? item.style || {} : {}
|
|
128
129
|
},
|
|
129
130
|
disabled: item.disabled,
|
|
130
131
|
onClick: (e) => {
|
|
@@ -1,13 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
doneText?: string;
|
|
5
|
-
resetText: string;
|
|
6
|
-
defaultValue?: string | number;
|
|
7
|
-
placeholder?: string;
|
|
8
|
-
value?: string | number;
|
|
9
|
-
onChange?: (val: string | number) => void;
|
|
10
|
-
onEnter?: (val: string | number) => void;
|
|
11
|
-
}
|
|
1
|
+
import { NumberProps } from './types';
|
|
2
|
+
import './index.less';
|
|
3
|
+
export type { NumberProps };
|
|
12
4
|
declare const Number: (props: NumberProps) => JSX.Element;
|
|
13
5
|
export default Number;
|
|
@@ -34,7 +34,12 @@ __export(Number_exports, {
|
|
|
34
34
|
module.exports = __toCommonJS(Number_exports);
|
|
35
35
|
var import_react = __toESM(require("react"));
|
|
36
36
|
var import_ahooks = require("ahooks");
|
|
37
|
+
var import_classnames = __toESM(require("classnames"));
|
|
38
|
+
var import_utils = require("@pisell/utils");
|
|
37
39
|
var import_BaseNumberKeyboard = __toESM(require("../BaseNumberKeyboard"));
|
|
40
|
+
var import_usePisellConfig = __toESM(require("../../pisell-config-provider/hooks/usePisellConfig"));
|
|
41
|
+
var import_themeConfig = require("./themeConfig");
|
|
42
|
+
var import_index = require("./index.less");
|
|
38
43
|
var Number = (props) => {
|
|
39
44
|
const {
|
|
40
45
|
min,
|
|
@@ -43,23 +48,72 @@ var Number = (props) => {
|
|
|
43
48
|
resetText,
|
|
44
49
|
defaultValue,
|
|
45
50
|
placeholder,
|
|
46
|
-
onEnter
|
|
51
|
+
onEnter,
|
|
52
|
+
selectType = "light",
|
|
53
|
+
...others
|
|
47
54
|
} = props;
|
|
55
|
+
const config = (0, import_usePisellConfig.default)();
|
|
48
56
|
const [value, setValue] = (0, import_ahooks.useControllableValue)(props, {
|
|
49
57
|
defaultValue: defaultValue || ""
|
|
50
58
|
});
|
|
59
|
+
(0, import_react.useEffect)(() => {
|
|
60
|
+
document.body.id = "body";
|
|
61
|
+
}, []);
|
|
62
|
+
const configColor = (0, import_react.useMemo)(() => {
|
|
63
|
+
const currentConfig = import_themeConfig.numberThemeConfig[selectType];
|
|
64
|
+
const validProps = Object.entries(props).reduce((acc, [key, value2]) => {
|
|
65
|
+
if (value2 !== void 0 && key in currentConfig) {
|
|
66
|
+
acc[key] = value2;
|
|
67
|
+
}
|
|
68
|
+
return acc;
|
|
69
|
+
}, {});
|
|
70
|
+
return { ...currentConfig, ...validProps };
|
|
71
|
+
}, [selectType, props]);
|
|
72
|
+
(0, import_react.useEffect)(() => {
|
|
73
|
+
(0, import_utils.setTheme)({
|
|
74
|
+
"--pisell-number-background-color": configColor.backgroundColor,
|
|
75
|
+
"--pisell-number-container-background-color": configColor.containerBackgroundColor,
|
|
76
|
+
"--pisell-number-text-color": configColor.textColor,
|
|
77
|
+
"--pisell-number-keyboard-background-color": configColor.keyboardBackgroundColor,
|
|
78
|
+
"--pisell-number-keyboard-button-background-color": configColor.keyboardButtonBackgroundColor,
|
|
79
|
+
"--pisell-number-keyboard-button-text-color": configColor.keyboardButtonTextColor,
|
|
80
|
+
"--pisell-number-keyboard-button-hover-color": configColor.keyboardButtonHoverColor,
|
|
81
|
+
"--pisell-number-reset-button-background-color": configColor.resetButtonBackgroundColor,
|
|
82
|
+
"--pisell-number-reset-button-text-color": configColor.resetButtonTextColor,
|
|
83
|
+
"--pisell-number-done-button-background-color": configColor.doneButtonBackgroundColor,
|
|
84
|
+
"--pisell-number-done-button-text-color": configColor.doneButtonTextColor
|
|
85
|
+
});
|
|
86
|
+
}, [configColor]);
|
|
51
87
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
52
|
-
|
|
88
|
+
"div",
|
|
53
89
|
{
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
90
|
+
className: (0, import_classnames.default)("pisell-number-keyboard-wrap", {
|
|
91
|
+
"pisell-number-keyboard-dark": selectType === "dark",
|
|
92
|
+
"pisell-number-keyboard-light": selectType === "light"
|
|
93
|
+
})
|
|
94
|
+
},
|
|
95
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
96
|
+
import_BaseNumberKeyboard.default,
|
|
97
|
+
{
|
|
98
|
+
max,
|
|
99
|
+
min,
|
|
100
|
+
value,
|
|
101
|
+
onChange: setValue,
|
|
102
|
+
placeholder,
|
|
103
|
+
doneText,
|
|
104
|
+
resetText,
|
|
105
|
+
onEnter,
|
|
106
|
+
rightItemsStyle: {
|
|
107
|
+
buttonBackgroundColor: configColor.buttonBackgroundColor,
|
|
108
|
+
textColor: configColor.textColor,
|
|
109
|
+
resetButtonBackgroundColor: configColor.resetButtonBackgroundColor,
|
|
110
|
+
resetButtonTextColor: configColor.resetButtonTextColor,
|
|
111
|
+
isDoneButtonFollowTheme: configColor.isDoneButtonFollowTheme,
|
|
112
|
+
doneButtonBackgroundColor: configColor.doneButtonBackgroundColor,
|
|
113
|
+
doneButtonTextColor: configColor.doneButtonTextColor
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
)
|
|
63
117
|
);
|
|
64
118
|
};
|
|
65
119
|
var Number_default = Number;
|