@pisell/materials 2.2.86 → 2.2.88

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.
Files changed (94) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/index.js +1 -1
  5. package/build/lowcode/meta.js +7 -7
  6. package/build/lowcode/preview.js +144 -160
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +25 -35
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +30 -40
  11. package/es/components/dataSourceComponents/fields/Input.Subdomain/index.d.ts +1 -1
  12. package/es/components/dataSourceComponents/fields/index.d.ts +18 -18
  13. package/es/components/pisellAdjustPrice/PisellAdjustPriceInputNumber.d.ts +1 -0
  14. package/es/components/pisellAdjustPrice/index.d.ts +2 -6
  15. package/es/components/pisellAdjustPrice/index.js +63 -8
  16. package/es/components/pisellAdjustPrice/index.less +35 -6
  17. package/es/components/pisellAdjustPrice/status.d.ts +32 -0
  18. package/es/components/pisellAdjustPrice/status.js +32 -0
  19. package/es/components/pisellAdjustPrice/type.d.ts +20 -0
  20. package/es/components/pisellAdjustPrice/type.js +1 -0
  21. package/es/components/productCard/cartSkuCard/components/packages/utils.d.ts +1 -1
  22. package/es/components/productCard/components/Packages/utils.d.ts +1 -1
  23. package/es/components/select-time/index.d.ts +0 -1
  24. package/es/components/table/Actions/component/ColumnsSetting/index.d.ts +0 -1
  25. package/es/components/table/Table/fields/image/index.d.ts +0 -1
  26. package/es/components/table/Table/fields/pSwitch/index.d.ts +0 -1
  27. package/es/components/virtual-keyboard/Amount/index.d.ts +4 -20
  28. package/es/components/virtual-keyboard/Amount/index.js +79 -7
  29. package/es/components/virtual-keyboard/Amount/index.less +39 -0
  30. package/es/components/virtual-keyboard/Amount/themeConfig.d.ts +32 -0
  31. package/es/components/virtual-keyboard/Amount/themeConfig.js +32 -0
  32. package/es/components/virtual-keyboard/Amount/types.d.ts +44 -0
  33. package/es/components/virtual-keyboard/Amount/types.js +1 -0
  34. package/es/components/virtual-keyboard/BaseNumberKeyboard/index.d.ts +3 -1
  35. package/es/components/virtual-keyboard/BaseNumberKeyboard/index.js +38 -10
  36. package/es/components/virtual-keyboard/Keyboard/index.js +2 -2
  37. package/es/components/virtual-keyboard/Number/index.d.ts +3 -11
  38. package/es/components/virtual-keyboard/Number/index.js +77 -7
  39. package/es/components/virtual-keyboard/Number/index.less +39 -0
  40. package/es/components/virtual-keyboard/Number/themeConfig.d.ts +32 -0
  41. package/es/components/virtual-keyboard/Number/themeConfig.js +32 -0
  42. package/es/components/virtual-keyboard/Number/types.d.ts +25 -0
  43. package/es/components/virtual-keyboard/Number/types.js +1 -0
  44. package/es/components/virtual-keyboard/VirtualKeyInput/index.d.ts +2 -0
  45. package/es/components/virtual-keyboard/VirtualKeyInput/index.js +10 -3
  46. package/es/components/virtual-keyboard/index.d.ts +11 -0
  47. package/es/components/virtual-keyboard/index.js +88 -3
  48. package/es/components/virtual-keyboard/index.less +33 -1
  49. package/es/utils/platform.d.ts +1 -1
  50. package/lib/components/dataSourceComponents/fields/Input.Subdomain/index.d.ts +1 -1
  51. package/lib/components/dataSourceComponents/fields/index.d.ts +18 -18
  52. package/lib/components/pisellAdjustPrice/PisellAdjustPriceInputNumber.d.ts +1 -0
  53. package/lib/components/pisellAdjustPrice/index.d.ts +2 -6
  54. package/lib/components/pisellAdjustPrice/index.js +118 -57
  55. package/lib/components/pisellAdjustPrice/index.less +35 -6
  56. package/lib/components/pisellAdjustPrice/status.d.ts +32 -0
  57. package/lib/components/pisellAdjustPrice/status.js +60 -0
  58. package/lib/components/pisellAdjustPrice/type.d.ts +20 -0
  59. package/lib/components/pisellAdjustPrice/type.js +17 -0
  60. package/lib/components/productCard/cartSkuCard/components/packages/utils.d.ts +1 -1
  61. package/lib/components/productCard/components/Packages/utils.d.ts +1 -1
  62. package/lib/components/select-time/index.d.ts +0 -1
  63. package/lib/components/table/Actions/component/ColumnsSetting/index.d.ts +0 -1
  64. package/lib/components/table/Table/fields/image/index.d.ts +0 -1
  65. package/lib/components/table/Table/fields/pSwitch/index.d.ts +0 -1
  66. package/lib/components/virtual-keyboard/Amount/index.d.ts +4 -20
  67. package/lib/components/virtual-keyboard/Amount/index.js +72 -16
  68. package/lib/components/virtual-keyboard/Amount/index.less +39 -0
  69. package/lib/components/virtual-keyboard/Amount/themeConfig.d.ts +32 -0
  70. package/lib/components/virtual-keyboard/Amount/themeConfig.js +60 -0
  71. package/lib/components/virtual-keyboard/Amount/types.d.ts +44 -0
  72. package/lib/components/virtual-keyboard/Amount/types.js +17 -0
  73. package/lib/components/virtual-keyboard/BaseNumberKeyboard/index.d.ts +3 -1
  74. package/lib/components/virtual-keyboard/BaseNumberKeyboard/index.js +31 -8
  75. package/lib/components/virtual-keyboard/Keyboard/index.js +2 -1
  76. package/lib/components/virtual-keyboard/Number/index.d.ts +3 -11
  77. package/lib/components/virtual-keyboard/Number/index.js +65 -11
  78. package/lib/components/virtual-keyboard/Number/index.less +39 -0
  79. package/lib/components/virtual-keyboard/Number/themeConfig.d.ts +32 -0
  80. package/lib/components/virtual-keyboard/Number/themeConfig.js +60 -0
  81. package/lib/components/virtual-keyboard/Number/types.d.ts +25 -0
  82. package/lib/components/virtual-keyboard/Number/types.js +17 -0
  83. package/lib/components/virtual-keyboard/VirtualKeyInput/index.d.ts +2 -0
  84. package/lib/components/virtual-keyboard/VirtualKeyInput/index.js +34 -27
  85. package/lib/components/virtual-keyboard/index.d.ts +11 -0
  86. package/lib/components/virtual-keyboard/index.js +60 -2
  87. package/lib/components/virtual-keyboard/index.less +33 -1
  88. package/lib/utils/platform.d.ts +1 -1
  89. package/lowcode/pisell-adjust-price/meta.ts +168 -0
  90. package/lowcode/pisell-adjust-price/snippets.ts +1 -0
  91. package/lowcode/pisell-number-keyboard/meta.ts +167 -0
  92. package/lowcode/pisell-price-keyboard/meta.ts +167 -0
  93. package/lowcode/virtual-keyboard/meta.ts +131 -0
  94. package/package.json +3 -3
@@ -1,9 +1,26 @@
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
+ var _excluded = ["virtualKeyInputProps", "style", "className", "keyboardProps", "onChange", "value", "rightPanel", "selectType"];
1
3
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
- import React, { useEffect } from "react";
4
+ 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; }
5
+ 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; }
6
+ 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; }
7
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
8
+ 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); }
9
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
10
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
11
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
12
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
13
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
14
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
15
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
16
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
17
+ import React, { useEffect, useMemo } from "react";
3
18
  import Keyboard from "./Keyboard";
4
19
  import VirtualKeyInput from "./VirtualKeyInput";
5
20
  import "./index.less";
6
21
  import classNames from "classnames";
22
+ import { setTheme } from '@pisell/utils';
23
+ import usePisellConfig from "../pisell-config-provider/hooks/usePisellConfig";
7
24
  var items = [{
8
25
  value: 1,
9
26
  label: "1",
@@ -60,6 +77,33 @@ var items = [{
60
77
  disabled: false,
61
78
  type: "primary"
62
79
  }];
80
+ // 默认主题配置
81
+ var virtualKeyboardThemeConfig = {
82
+ dark: {
83
+ backgroundColor: 'rgba(0, 0, 0, 0.70)',
84
+ containerBackgroundColor: 'rgba(0, 0, 0, 0.40)',
85
+ buttonBackgroundColor: '#ffffff',
86
+ textColor: '#000000',
87
+ keyboardBackgroundColor: 'rgba(0, 0, 0, 0.40)',
88
+ keyboardButtonBackgroundColor: '#ffffff',
89
+ keyboardButtonTextColor: '#000000',
90
+ keyboardButtonHoverColor: '#f5f5f5',
91
+ primaryButtonBackgroundColor: '#4ca30d',
92
+ primaryButtonTextColor: '#ffffff'
93
+ },
94
+ light: {
95
+ backgroundColor: '#ffffff',
96
+ containerBackgroundColor: '#d0d5dd',
97
+ buttonBackgroundColor: '#ffffff',
98
+ textColor: '#000000',
99
+ keyboardBackgroundColor: '#f9f9f9',
100
+ keyboardButtonBackgroundColor: '#ffffff',
101
+ keyboardButtonTextColor: '#000000',
102
+ keyboardButtonHoverColor: '#f5f5f5',
103
+ primaryButtonBackgroundColor: '#4ca30d',
104
+ primaryButtonTextColor: '#ffffff'
105
+ }
106
+ };
63
107
  var VirtualKeyboard = function VirtualKeyboard(props) {
64
108
  var virtualKeyInputProps = props.virtualKeyInputProps,
65
109
  style = props.style,
@@ -67,12 +111,53 @@ var VirtualKeyboard = function VirtualKeyboard(props) {
67
111
  keyboardProps = props.keyboardProps,
68
112
  onChange = props.onChange,
69
113
  value = props.value,
70
- rightPanel = props.rightPanel;
114
+ rightPanel = props.rightPanel,
115
+ _props$selectType = props.selectType,
116
+ selectType = _props$selectType === void 0 ? 'light' : _props$selectType,
117
+ others = _objectWithoutProperties(props, _excluded);
118
+ var config = usePisellConfig();
71
119
  useEffect(function () {
72
120
  document.body.id = "body";
73
121
  }, []);
122
+
123
+ /**
124
+ * 配置颜色
125
+ * 根据 props 和 selectType 生成最终的配置颜色
126
+ */
127
+ var configColor = useMemo(function () {
128
+ var currentConfig = virtualKeyboardThemeConfig[selectType];
129
+
130
+ // 过滤出有效的 props 并合并到默认配置中
131
+ var validProps = Object.entries(props).reduce(function (acc, _ref) {
132
+ var _ref2 = _slicedToArray(_ref, 2),
133
+ key = _ref2[0],
134
+ value = _ref2[1];
135
+ if (value !== undefined && key in currentConfig) {
136
+ acc[key] = value;
137
+ }
138
+ return acc;
139
+ }, {});
140
+ return _objectSpread(_objectSpread({}, currentConfig), validProps);
141
+ }, [selectType, props]);
142
+ useEffect(function () {
143
+ setTheme({
144
+ '--virtual-keyboard-background-color': configColor.backgroundColor,
145
+ '--virtual-keyboard-container-background-color': configColor.containerBackgroundColor,
146
+ '--virtual-keyboard-button-background-color': configColor.buttonBackgroundColor,
147
+ '--virtual-keyboard-text-color': configColor.textColor,
148
+ '--virtual-keyboard-keyboard-background-color': configColor.keyboardBackgroundColor,
149
+ '--virtual-keyboard-keyboard-button-background-color': configColor.keyboardButtonBackgroundColor,
150
+ '--virtual-keyboard-keyboard-button-text-color': configColor.keyboardButtonTextColor,
151
+ '--virtual-keyboard-keyboard-button-hover-color': configColor.keyboardButtonHoverColor,
152
+ '--virtual-keyboard-primary-button-background-color': configColor.primaryButtonBackgroundColor,
153
+ '--virtual-keyboard-primary-button-text-color': configColor.primaryButtonTextColor
154
+ });
155
+ }, [configColor]);
74
156
  return /*#__PURE__*/React.createElement("div", {
75
- className: classNames("virtual-keyboard-component", className),
157
+ className: classNames("virtual-keyboard-component", className, {
158
+ 'virtual-keyboard-component-dark': selectType === 'dark',
159
+ 'virtual-keyboard-component-light': selectType === 'light'
160
+ }),
76
161
  style: style
77
162
  }, /*#__PURE__*/React.createElement("div", {
78
163
  className: classNames("virtual-keyboard-component-left")
@@ -2,14 +2,46 @@
2
2
  display: flex;
3
3
  align-items: center;
4
4
  gap: 20px;
5
+ background-color: var(--virtual-keyboard-background-color, #ffffff);
6
+
7
+ &.virtual-keyboard-component-dark {
8
+ background-color: var(--virtual-keyboard-background-color, rgba(0, 0, 0, 0.70));
9
+ }
10
+
11
+ &.virtual-keyboard-component-light {
12
+ background-color: var(--virtual-keyboard-background-color, #ffffff);
13
+ }
5
14
  }
6
15
 
7
16
  .virtual-keyboard-component-left {
8
17
  padding: 10px;
9
18
  width: 380px;
10
19
  border-radius: 10px;
11
- background: var(--Gray-300, #D0D5DD);
20
+ background: var(--virtual-keyboard-container-background-color, #D0D5DD);
12
21
  backdrop-filter: blur(50px);
22
+
23
+ .pisell-virtual-keyboard-input {
24
+ background-color: var(--virtual-keyboard-button-background-color, #ffffff);
25
+ color: var(--virtual-keyboard-text-color, #000000);
26
+ }
27
+
28
+ .pisell-keyboard {
29
+ background-color: var(--virtual-keyboard-keyboard-background-color, #f9f9f9);
30
+
31
+ .pisell-keyboard-item {
32
+ background-color: var(--virtual-keyboard-keyboard-button-background-color, #ffffff);
33
+ color: var(--virtual-keyboard-keyboard-button-text-color, #000000);
34
+
35
+ &:hover {
36
+ background-color: var(--virtual-keyboard-keyboard-button-hover-color, #f5f5f5);
37
+ }
38
+
39
+ &.pisell-keyboard-item-primary {
40
+ background-color: var(--virtual-keyboard-primary-button-background-color, #4ca30d);
41
+ color: var(--virtual-keyboard-primary-button-text-color, #ffffff);
42
+ }
43
+ }
44
+ }
13
45
  }
14
46
 
15
47
  .virtual-keyboard-component-right {
@@ -1 +1 @@
1
- export declare const isMobile: () => any;
1
+ export declare const isMobile: () => boolean;
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  declare const Subdomain: React.FC<import("antd").InputProps & {
3
3
  onChange: (value: string) => void;
4
4
  onBlur?: ((e: React.FocusEvent<HTMLInputElement, Element>) => void) | undefined;
5
- rootDomain: "custom" | "saas" | "xzero";
5
+ rootDomain: "custom" | "xzero" | "saas";
6
6
  customDomain?: string | undefined;
7
7
  value?: string | undefined;
8
8
  tenantId: string;
@@ -20,7 +20,7 @@ declare const formFieldMap: {
20
20
  Subdomain: import("react").FC<import("antd").InputProps & {
21
21
  onChange: (value: string) => void;
22
22
  onBlur?: ((e: import("react").FocusEvent<HTMLInputElement, Element>) => void) | undefined;
23
- rootDomain: "custom" | "saas" | "xzero";
23
+ rootDomain: "custom" | "xzero" | "saas";
24
24
  customDomain?: string | undefined;
25
25
  value?: string | undefined;
26
26
  tenantId: string;
@@ -60,11 +60,19 @@ declare const formFieldMap: {
60
60
  FormItemTranslation: import("react").FC<import("./Translation/type").TranslationProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
61
61
  FormItemIconSelect: import("react").FC<import("./IconSelect/type").IconSelectProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
62
62
  };
63
- declare const getFieldComponent: (fieldComponent: string) => import("react").FC<any> | import("react").FC<import("./Input.Phone/WithMode").PhoneInputProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./Input.Mobile/WithMode").PhoneInputProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./Checkbox/type").CheckboxGroupProps & import("../dataSourceForm/utils").WithModeProps> | (import("react").FC<{}> & {
64
- Group: import("react").FC<import("./Checkbox/type").CheckboxGroupProps & import("../dataSourceForm/utils").WithModeProps>;
63
+ declare const getFieldComponent: (fieldComponent: string) => import("react").FC<any> | import("react").FC<import("./Input.Phone/WithMode").PhoneInputProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./Input.Mobile/WithMode").PhoneInputProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./IconSelect/type").IconSelectProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./Translation/type").TranslationProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./Upload/type").UploadProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./DateRangePicker/type").DateRangePickerProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./TimePicker/type").TimePickerProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | ((props: import("antd").SelectProps<any, import("antd/es/select").DefaultOptionType> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps & {
64
+ options?: any;
65
+ optionSourceType?: "custom" | "default" | "api" | undefined;
66
+ labelField: string;
67
+ valueField: string;
68
+ extraParams?: Record<string, any> | undefined;
65
69
  } & {
66
- Group: import("react").FC<import("./Checkbox/type").CheckboxGroupProps & import("../dataSourceForm/utils").WithModeProps>;
67
- }) | import("react").FC<import("./ColorPicker/type").ColorPickerProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<(import("antd").DatePickerProps & import("../dataSourceForm/utils").WithModeProps) & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("antd/es/input").PasswordProps & import("react").RefAttributes<import("antd").InputRef> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("antd").InputProps & import("react").RefAttributes<import("antd").InputRef> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("antd").InputProps & {
70
+ dataSource?: any;
71
+ }) => JSX.Element) | import("react").FC<import("./Radio/type").RadioGroupProps & import("../dataSourceForm/utils").WithModeProps> | (import("react").FC<{}> & {
72
+ Group: import("react").FC<import("./Radio/type").RadioGroupProps & import("../dataSourceForm/utils").WithModeProps>;
73
+ } & {
74
+ Group: import("react").FC<import("./Radio/type").RadioGroupProps & import("../dataSourceForm/utils").WithModeProps>;
75
+ }) | import("react").FC<import("antd/es/input").PasswordProps & import("react").RefAttributes<import("antd").InputRef> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("antd").InputProps & import("react").RefAttributes<import("antd").InputRef> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("antd").InputProps & {
68
76
  onChange: (value: string) => void;
69
77
  } & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | (import("react").FC<import("./Input/type").InputProps> & {
70
78
  JSON: import("react").FC<any>;
@@ -79,24 +87,16 @@ declare const getFieldComponent: (fieldComponent: string) => import("react").FC<
79
87
  Subdomain: import("react").FC<import("antd").InputProps & {
80
88
  onChange: (value: string) => void;
81
89
  onBlur?: ((e: import("react").FocusEvent<HTMLInputElement, Element>) => void) | undefined;
82
- rootDomain: "custom" | "saas" | "xzero";
90
+ rootDomain: "custom" | "xzero" | "saas";
83
91
  customDomain?: string | undefined;
84
92
  value?: string | undefined;
85
93
  tenantId: string;
86
94
  name?: string | undefined;
87
95
  fieldKey?: string | undefined;
88
96
  } & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
89
- }) | import("react").FC<import("./Radio/type").RadioGroupProps & import("../dataSourceForm/utils").WithModeProps> | (import("react").FC<{}> & {
90
- Group: import("react").FC<import("./Radio/type").RadioGroupProps & import("../dataSourceForm/utils").WithModeProps>;
91
- } & {
92
- Group: import("react").FC<import("./Radio/type").RadioGroupProps & import("../dataSourceForm/utils").WithModeProps>;
93
- }) | ((props: import("antd").SelectProps<any, import("antd/es/select").DefaultOptionType> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps & {
94
- options?: any;
95
- optionSourceType?: "custom" | "default" | "api" | undefined;
96
- labelField: string;
97
- valueField: string;
98
- extraParams?: Record<string, any> | undefined;
97
+ }) | import("react").FC<(import("antd").DatePickerProps & import("../dataSourceForm/utils").WithModeProps) & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./ColorPicker/type").ColorPickerProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./Checkbox/type").CheckboxGroupProps & import("../dataSourceForm/utils").WithModeProps> | (import("react").FC<{}> & {
98
+ Group: import("react").FC<import("./Checkbox/type").CheckboxGroupProps & import("../dataSourceForm/utils").WithModeProps>;
99
99
  } & {
100
- dataSource?: any;
101
- }) => JSX.Element) | import("react").FC<import("./TimePicker/type").TimePickerProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./DateRangePicker/type").DateRangePickerProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./Upload/type").UploadProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./Translation/type").TranslationProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./IconSelect/type").IconSelectProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
100
+ Group: import("react").FC<import("./Checkbox/type").CheckboxGroupProps & import("../dataSourceForm/utils").WithModeProps>;
101
+ });
102
102
  export { getFieldComponent, formFieldMap };
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { InputNumberProps } from 'antd/es/input-number';
2
3
  export interface PisellAdjustPriceInputNumberProps extends Omit<InputNumberProps, 'onChange'> {
3
4
  value?: number;
@@ -1,9 +1,5 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
- export interface PisellAdjustPriceProps {
3
- value?: number;
4
- originValue: number;
5
- defaultValue?: number;
6
- onChange?: (val: number) => void;
7
- }
3
+ import { PisellAdjustPriceProps } from './type';
8
4
  declare const PisellAdjustPrice: (props: PisellAdjustPriceProps) => JSX.Element;
9
5
  export default PisellAdjustPrice;
@@ -35,13 +35,22 @@ module.exports = __toCommonJS(pisellAdjustPrice_exports);
35
35
  var import_react = __toESM(require("react"));
36
36
  var import_antd = require("antd");
37
37
  var import_classnames = __toESM(require("classnames"));
38
+ var import_utils = require("@pisell/utils");
38
39
  var import_pisellText = __toESM(require("../pisellText"));
39
40
  var import_Amount = __toESM(require("../virtual-keyboard/Amount"));
40
41
  var import_locales = require("../../locales");
41
42
  var import_index = require("./index.less");
42
43
  var import_usePisellConfig = __toESM(require("../pisell-config-provider/hooks/usePisellConfig"));
44
+ var import_status = require("./status");
43
45
  var PisellAdjustPrice = (props) => {
44
- const { value, onChange, defaultValue, originValue, ...others } = props;
46
+ const {
47
+ value,
48
+ onChange,
49
+ defaultValue,
50
+ originValue,
51
+ selectType = "light",
52
+ ...others
53
+ } = props;
45
54
  const config = (0, import_usePisellConfig.default)();
46
55
  const [newValue, setNewValue] = (0, import_react.useState)(value || 0);
47
56
  const [updateMode, setUpdateMode] = (0, import_react.useState)(
@@ -53,6 +62,16 @@ var PisellAdjustPrice = (props) => {
53
62
  (0, import_react.useEffect)(() => {
54
63
  document.body.id = "body";
55
64
  }, []);
65
+ const configColor = (0, import_react.useMemo)(() => {
66
+ const currentConfig = import_status.defaultConfig[selectType];
67
+ const validProps = Object.entries(props).reduce((acc, [key, value2]) => {
68
+ if (value2 !== void 0 && key in currentConfig) {
69
+ acc[key] = value2;
70
+ }
71
+ return acc;
72
+ }, {});
73
+ return { ...currentConfig, ...validProps };
74
+ }, [selectType, props]);
56
75
  const handleEnter = () => {
57
76
  if (isDiscountError) {
58
77
  return;
@@ -92,65 +111,107 @@ var PisellAdjustPrice = (props) => {
92
111
  return `${v}%`;
93
112
  }
94
113
  };
95
- return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode-adjust-price-wrap" }, /* @__PURE__ */ import_react.default.createElement(
96
- import_antd.Segmented,
97
- {
98
- size: "large",
99
- options: [
100
- {
101
- label: (0, import_locales.getText)("pisell-adjust-price-price-override"),
102
- value: "priceOverride"
103
- },
104
- { label: (0, import_locales.getText)("pisell-adjust-price-discount"), value: "discount" }
105
- ],
106
- value: updateMode,
107
- onChange: handleUpdateMode,
108
- block: true
109
- }
110
- ), updateMode === "discount" && /* @__PURE__ */ import_react.default.createElement(
111
- import_antd.Segmented,
112
- {
113
- size: "large",
114
- options: [
115
- {
116
- label: `${(0, import_locales.getText)("pisell-adjust-price-discount-amount")}(${(config == null ? void 0 : config.symbol) || "$"})`,
117
- value: "amount"
118
- },
119
- {
120
- label: `${(0, import_locales.getText)("pisell-adjust-price-discount-percentage")}(%)`,
121
- value: "percentage"
122
- }
123
- ],
124
- value: discountMode,
125
- onChange: (val) => {
126
- setNewValue("");
127
- setDiscountMode(val);
128
- },
129
- block: true
130
- }
131
- ), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode-adjust-price-amount-wrap" }, /* @__PURE__ */ import_react.default.createElement(
132
- import_Amount.default,
133
- {
134
- ...others,
135
- inputFormat,
136
- defaultValue: updateMode === "priceOverride" ? defaultValue : "",
137
- key: updateMode,
138
- value: newValue,
139
- defaultSelect: updateMode === "priceOverride",
140
- onChange: handleChange,
141
- onEnter: handleEnter,
142
- placeholder: discountMode === "amount" ? "0" : "%"
143
- }
144
- )), updateMode === "discount" && /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-low-code-adjust-price-total" }, isDiscountError ? /* @__PURE__ */ import_react.default.createElement(import_pisellText.default.Amount, { value: originValue }) : /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, newValue && (0, import_locales.getText)("pisell-adjust-price-total-after-discount"), /* @__PURE__ */ import_react.default.createElement(import_pisellText.default.Amount, { value: totalAfterDiscount }))), /* @__PURE__ */ import_react.default.createElement(
114
+ (0, import_react.useEffect)(() => {
115
+ (0, import_utils.setTheme)({
116
+ "--pisell-adjust-price-text-color": configColor.textColor,
117
+ "--pisell-adjust-price-background-color": configColor.backgroundColor,
118
+ "--pisell-adjust-price-container-background-color": configColor.containerBackgroundColor,
119
+ "--pisell-adjust-price-button-background-color": configColor.buttonBackgroundColor,
120
+ "--pisell-adjust-price-main-text-color": configColor.mainTextColor,
121
+ "--pisell-adjust-price-sub-text-color": configColor.subTextColor
122
+ });
123
+ }, [configColor]);
124
+ return /* @__PURE__ */ import_react.default.createElement(
145
125
  "div",
146
126
  {
147
- className: (0, import_classnames.default)("pisell-low-code-adjust-price-amount-desc", {
148
- ["pisell-low-code-adjust-price-amount-desc-error"]: isDiscountError
127
+ className: (0, import_classnames.default)("pisell-lowcode-adjust-price-wrap", {
128
+ "pisell-lowcode-adjust-price-dark": selectType === "dark",
129
+ "pisell-lowcode-adjust-price-light": selectType === "light"
149
130
  })
150
131
  },
151
- (0, import_locales.getText)("pisell-adjust-price-discount-can-be-maximum"),
152
- " ",
153
- discountMode === "amount" ? /* @__PURE__ */ import_react.default.createElement(import_pisellText.default.Amount, { value: originValue }) : "100%"
154
- )));
132
+ /* @__PURE__ */ import_react.default.createElement(
133
+ import_antd.Segmented,
134
+ {
135
+ size: "large",
136
+ options: [
137
+ {
138
+ label: (0, import_locales.getText)("pisell-adjust-price-price-override"),
139
+ value: "priceOverride"
140
+ },
141
+ { label: (0, import_locales.getText)("pisell-adjust-price-discount"), value: "discount" }
142
+ ],
143
+ value: updateMode,
144
+ onChange: handleUpdateMode,
145
+ block: true
146
+ }
147
+ ),
148
+ updateMode === "discount" && /* @__PURE__ */ import_react.default.createElement(
149
+ import_antd.Segmented,
150
+ {
151
+ size: "large",
152
+ options: [
153
+ {
154
+ label: `${(0, import_locales.getText)("pisell-adjust-price-discount-amount")}(${(config == null ? void 0 : config.symbol) || "$"})`,
155
+ value: "amount"
156
+ },
157
+ {
158
+ label: `${(0, import_locales.getText)("pisell-adjust-price-discount-percentage")}(%)`,
159
+ value: "percentage"
160
+ }
161
+ ],
162
+ value: discountMode,
163
+ onChange: (val) => {
164
+ setNewValue("");
165
+ setDiscountMode(val);
166
+ },
167
+ block: true
168
+ }
169
+ ),
170
+ /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode-adjust-price-amount-wrap" }, /* @__PURE__ */ import_react.default.createElement(
171
+ import_Amount.default,
172
+ {
173
+ ...others,
174
+ inputFormat,
175
+ defaultValue: updateMode === "priceOverride" ? defaultValue : "",
176
+ key: updateMode,
177
+ value: newValue,
178
+ defaultSelect: updateMode === "priceOverride",
179
+ onChange: handleChange,
180
+ onEnter: handleEnter,
181
+ placeholder: discountMode === "amount" ? "0" : "%",
182
+ rightItemsStyle: {
183
+ buttonBackgroundColor: configColor.buttonBackgroundColor,
184
+ textColor: configColor.textColor,
185
+ resetButtonBackgroundColor: configColor.resetButtonBackgroundColor,
186
+ resetButtonTextColor: configColor.resetButtonTextColor,
187
+ isDoneButtonFollowTheme: configColor.isDoneButtonFollowTheme,
188
+ doneButtonBackgroundColor: configColor.doneButtonBackgroundColor,
189
+ doneButtonTextColor: configColor.doneButtonTextColor
190
+ }
191
+ }
192
+ )),
193
+ updateMode === "discount" && /* @__PURE__ */ import_react.default.createElement("div", null, configColor.isShowMainText ? /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-low-code-adjust-price-total" }, isDiscountError ? /* @__PURE__ */ import_react.default.createElement(import_pisellText.default.Amount, { value: originValue }) : /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, newValue && (0, import_locales.getText)("pisell-adjust-price-total-after-discount"), /* @__PURE__ */ import_react.default.createElement(import_pisellText.default.Amount, { value: totalAfterDiscount }))) : null, configColor.isShowSubText ? /* @__PURE__ */ import_react.default.createElement(
194
+ "div",
195
+ {
196
+ className: (0, import_classnames.default)(
197
+ "pisell-low-code-adjust-price-amount-desc",
198
+ {
199
+ ["pisell-low-code-adjust-price-amount-desc-error"]: isDiscountError
200
+ }
201
+ )
202
+ },
203
+ (0, import_locales.getText)("pisell-adjust-price-discount-can-be-maximum"),
204
+ " ",
205
+ discountMode === "amount" ? /* @__PURE__ */ import_react.default.createElement(
206
+ import_pisellText.default.Amount,
207
+ {
208
+ value: originValue,
209
+ style: {
210
+ color: configColor.subTextColor
211
+ }
212
+ }
213
+ ) : "100%"
214
+ ) : null)
215
+ );
155
216
  };
156
217
  var pisellAdjustPrice_default = PisellAdjustPrice;
@@ -1,30 +1,59 @@
1
1
  .pisell-lowcode-adjust-price-wrap {
2
2
  width: 380px;
3
3
  border-radius: 10px;
4
- background-color: #fff;
4
+ background-color: var(--pisell-adjust-price-background-color);
5
5
  padding: 10px;
6
6
  display: flex;
7
7
  flex-direction: column;
8
8
  gap: 10px;
9
+ transition: all 0.3s ease;
10
+
11
+ // 浅色模式样式
12
+ &.pisell-lowcode-adjust-price-light {
13
+ .pisell-lowcode-segmented-item-label {
14
+ color: #667085;
15
+ }
16
+ }
17
+
18
+ // 深色模式样式
19
+ &.pisell-lowcode-adjust-price-dark {
20
+ .pisell-lowcode-segmented-item-label {
21
+ color: #d0d5dd;
22
+ }
23
+ }
24
+
25
+ .pisell-lowcode-segmented {
26
+ background: var(--pisell-adjust-price-container-background-color);
27
+ :hover {
28
+ color: var(--pisell-adjust-price-text-color);
29
+ }
30
+ .pisell-lowcode-segmented-item-selected {
31
+ background: var(--pisell-adjust-price-button-background-color);
32
+ .pisell-lowcode-segmented-item-label {
33
+ color: var(--pisell-adjust-price-text-color) !important;
34
+ }
35
+ }
36
+ }
37
+
9
38
  .pisell-lowcode-adjust-price-amount-wrap {
10
39
  padding: 10px;
11
40
  border-radius: 10px;
12
- background: var(--Gray-300, #D0D5DD);
41
+ background: var(--pisell-adjust-price-container-background-color);
13
42
  }
14
43
  .pisell-low-code-adjust-price-total {
15
- color: var(--Gray-900, #101828);
44
+ color: var(--pisell-adjust-price-main-text-color);
16
45
  font-size: 20px;
17
46
  font-weight: 600;
18
47
  line-height: 30px; /* 150% */
19
48
  }
20
49
  .pisell-low-code-adjust-price-amount-desc {
21
- color: var(--Gray-500, #667085);
50
+ color: var(--pisell-adjust-price-sub-text-color);
22
51
  font-size: 16px;
23
52
  font-style: normal;
24
53
  font-weight: 400;
25
54
  line-height: 24px; /* 150% */
26
55
  }
27
56
  .pisell-low-code-adjust-price-amount-desc-error {
28
- color: var(--Error-600, #D92D20);
57
+ color: var(--Error-600, #d92d20);
29
58
  }
30
- }
59
+ }
@@ -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,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/pisellAdjustPrice/status.ts
20
+ var status_exports = {};
21
+ __export(status_exports, {
22
+ defaultConfig: () => defaultConfig
23
+ });
24
+ module.exports = __toCommonJS(status_exports);
25
+ var defaultConfig = {
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
+ isShowMainText: true,
37
+ mainTextColor: "#ffffff",
38
+ isShowSubText: true,
39
+ subTextColor: "#d0d5dd"
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
+ isShowMainText: true,
52
+ mainTextColor: "#101828",
53
+ isShowSubText: true,
54
+ subTextColor: "#667085"
55
+ }
56
+ };
57
+ // Annotate the CommonJS export names for ESM import in node:
58
+ 0 && (module.exports = {
59
+ defaultConfig
60
+ });