@pisell/materials 1.0.846 → 1.0.847
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/meta.js +7 -7
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +22 -22
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +1 -1
- package/es/components/dataSourceComponents/dataSourceMenu/Basic.d.ts +8 -0
- package/es/components/dataSourceComponents/fields/Input.Subdomain/index.d.ts +1 -1
- package/es/components/dataSourceComponents/fields/Translation/BaseTranslation.d.ts +5 -0
- package/es/components/dataSourceComponents/fields/Translation/index.d.ts +3 -0
- package/es/components/dataSourceComponents/fields/index.d.ts +8 -8
- package/es/components/pisellAdjustPrice/index.js +61 -7
- package/es/components/pisellAdjustPrice/index.less +35 -6
- package/es/components/pisellAdjustPrice/type.js +1 -0
- package/es/components/pisellDraggable/components/TreeItem/SortableTreeItem.d.ts +9 -0
- package/es/components/pisellDraggable/components/TreeItem/TreeItem.d.ts +24 -0
- package/es/components/pisellDraggable/components/TreeItem/index.d.ts +2 -0
- package/es/components/pisellDraggable/index.d.ts +35 -0
- package/es/components/pisellDropSort/PisellDropSort.d.ts +5 -0
- package/es/components/pisellDropSort/components/SortableItem/index.d.ts +26 -0
- package/es/components/pisellDropSort/types.d.ts +58 -0
- package/es/components/pisellMenu/PisellMenu.d.ts +11 -0
- package/es/components/pisellMenu/types.d.ts +27 -0
- package/es/components/pisellNavigationMenu/PisellNavigationMenu.d.ts +5 -0
- package/es/components/pisellNavigationMenu/types.d.ts +85 -0
- package/es/components/productCard/index.d.ts +5 -0
- package/es/components/virtual-keyboard/Amount/index.js +9 -4
- package/es/components/virtual-keyboard/BaseNumberKeyboard/index.js +36 -9
- package/es/components/virtual-keyboard/VirtualKeyInput/index.js +5 -3
- package/lib/components/dataSourceComponents/dataSourceMenu/Basic.d.ts +8 -0
- package/lib/components/dataSourceComponents/fields/Input.Subdomain/index.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/Translation/BaseTranslation.d.ts +5 -0
- package/lib/components/dataSourceComponents/fields/Translation/index.d.ts +3 -0
- package/lib/components/dataSourceComponents/fields/index.d.ts +8 -8
- package/lib/components/pisellAdjustPrice/index.js +127 -57
- package/lib/components/pisellAdjustPrice/index.less +35 -6
- package/lib/components/pisellAdjustPrice/type.js +17 -0
- package/lib/components/pisellDraggable/components/TreeItem/SortableTreeItem.d.ts +9 -0
- package/lib/components/pisellDraggable/components/TreeItem/TreeItem.d.ts +24 -0
- package/lib/components/pisellDraggable/components/TreeItem/index.d.ts +2 -0
- package/lib/components/pisellDraggable/index.d.ts +35 -0
- package/lib/components/pisellDropSort/PisellDropSort.d.ts +5 -0
- package/lib/components/pisellDropSort/components/SortableItem/index.d.ts +26 -0
- package/lib/components/pisellDropSort/types.d.ts +58 -0
- package/lib/components/pisellMenu/PisellMenu.d.ts +11 -0
- package/lib/components/pisellMenu/types.d.ts +27 -0
- package/lib/components/pisellNavigationMenu/PisellNavigationMenu.d.ts +5 -0
- package/lib/components/pisellNavigationMenu/types.d.ts +85 -0
- package/lib/components/productCard/index.d.ts +5 -0
- package/lib/components/virtual-keyboard/Amount/index.js +8 -3
- package/lib/components/virtual-keyboard/BaseNumberKeyboard/index.js +29 -7
- package/lib/components/virtual-keyboard/VirtualKeyInput/index.js +3 -2
- package/lowcode/pisell-adjust-price/meta.ts +168 -0
- package/lowcode/pisell-adjust-price/snippets.ts +1 -0
- package/package.json +3 -3
- package/es/components/pisellAdjustPrice/index.d.ts +0 -10
- package/es/components/virtual-keyboard/Amount/index.d.ts +0 -22
- package/es/components/virtual-keyboard/BaseNumberKeyboard/index.d.ts +0 -19
- package/es/components/virtual-keyboard/VirtualKeyInput/index.d.ts +0 -12
- package/lib/components/pisellAdjustPrice/index.d.ts +0 -10
- package/lib/components/virtual-keyboard/Amount/index.d.ts +0 -22
- package/lib/components/virtual-keyboard/BaseNumberKeyboard/index.d.ts +0 -19
- package/lib/components/virtual-keyboard/VirtualKeyInput/index.d.ts +0 -12
|
@@ -1,3 +1,9 @@
|
|
|
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); }
|
|
1
7
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
8
|
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."); }
|
|
3
9
|
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); }
|
|
@@ -86,7 +92,8 @@ var BaseNumberKeyboard = function BaseNumberKeyboard(props) {
|
|
|
86
92
|
min = props.min,
|
|
87
93
|
onEnter = props.onEnter,
|
|
88
94
|
presets = props.presets,
|
|
89
|
-
defaultSelect = props.defaultSelect
|
|
95
|
+
defaultSelect = props.defaultSelect,
|
|
96
|
+
rightItemsStyle = props.rightItemsStyle;
|
|
90
97
|
var _useControllableValue = useControllableValue(props, {
|
|
91
98
|
defaultValue: defaultValue
|
|
92
99
|
}),
|
|
@@ -107,7 +114,11 @@ var BaseNumberKeyboard = function BaseNumberKeyboard(props) {
|
|
|
107
114
|
className: "virtual-keyboard-input-delete-icon"
|
|
108
115
|
}),
|
|
109
116
|
disabled: false,
|
|
110
|
-
type: 'text'
|
|
117
|
+
type: 'text',
|
|
118
|
+
style: {
|
|
119
|
+
color: (rightItemsStyle === null || rightItemsStyle === void 0 ? void 0 : rightItemsStyle.textColor) || '#000000',
|
|
120
|
+
backgroundColor: (rightItemsStyle === null || rightItemsStyle === void 0 ? void 0 : rightItemsStyle.buttonBackgroundColor) || '#ffffff'
|
|
121
|
+
}
|
|
111
122
|
}, {
|
|
112
123
|
value: 'reset',
|
|
113
124
|
label: resetText || 'Reset',
|
|
@@ -115,7 +126,8 @@ var BaseNumberKeyboard = function BaseNumberKeyboard(props) {
|
|
|
115
126
|
type: 'text',
|
|
116
127
|
style: {
|
|
117
128
|
fontSize: '18px',
|
|
118
|
-
color: '#D92D20'
|
|
129
|
+
color: (rightItemsStyle === null || rightItemsStyle === void 0 ? void 0 : rightItemsStyle.resetButtonTextColor) || '#D92D20',
|
|
130
|
+
backgroundColor: (rightItemsStyle === null || rightItemsStyle === void 0 ? void 0 : rightItemsStyle.resetButtonBackgroundColor) || '#ffffff'
|
|
119
131
|
}
|
|
120
132
|
}, {
|
|
121
133
|
value: 'done',
|
|
@@ -125,11 +137,23 @@ var BaseNumberKeyboard = function BaseNumberKeyboard(props) {
|
|
|
125
137
|
size: 2,
|
|
126
138
|
style: {
|
|
127
139
|
fontSize: '18px',
|
|
128
|
-
background: 'var(--
|
|
129
|
-
color: '#
|
|
140
|
+
background: rightItemsStyle !== null && rightItemsStyle !== void 0 && rightItemsStyle.isDoneButtonFollowTheme ? 'var(--theme-color)' : (rightItemsStyle === null || rightItemsStyle === void 0 ? void 0 : rightItemsStyle.doneButtonBackgroundColor) || '#5d3f9f',
|
|
141
|
+
color: (rightItemsStyle === null || rightItemsStyle === void 0 ? void 0 : rightItemsStyle.doneButtonTextColor) || '#ffffff'
|
|
130
142
|
}
|
|
131
143
|
}];
|
|
132
144
|
}, [doneText, resetText]);
|
|
145
|
+
|
|
146
|
+
// 给每个item增加背景色
|
|
147
|
+
var itemsWithStyle = useMemo(function () {
|
|
148
|
+
return items.map(function (item) {
|
|
149
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
150
|
+
style: {
|
|
151
|
+
backgroundColor: (rightItemsStyle === null || rightItemsStyle === void 0 ? void 0 : rightItemsStyle.buttonBackgroundColor) || '#fff',
|
|
152
|
+
color: (rightItemsStyle === null || rightItemsStyle === void 0 ? void 0 : rightItemsStyle.textColor) || '#000000'
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
});
|
|
156
|
+
}, [items, rightItemsStyle === null || rightItemsStyle === void 0 ? void 0 : rightItemsStyle.buttonBackgroundColor, rightItemsStyle === null || rightItemsStyle === void 0 ? void 0 : rightItemsStyle.textColor]);
|
|
133
157
|
var checkValue = function checkValue(val) {
|
|
134
158
|
// 超过最大值时使用最大值
|
|
135
159
|
if (isNumber(max) && Number(val) > max) {
|
|
@@ -161,11 +185,11 @@ var BaseNumberKeyboard = function BaseNumberKeyboard(props) {
|
|
|
161
185
|
},
|
|
162
186
|
delete: function _delete() {
|
|
163
187
|
// 选中时删除全部 否则删除最后一位
|
|
164
|
-
handleChangeValue(select ? '' : "".concat(value ||
|
|
188
|
+
handleChangeValue(select ? '' : "".concat(value || '').slice(0, -1));
|
|
165
189
|
},
|
|
166
190
|
reset: function reset() {
|
|
167
191
|
// 重置到默认值
|
|
168
|
-
handleChangeValue("".concat(defaultValue ||
|
|
192
|
+
handleChangeValue("".concat(defaultValue || '') || '');
|
|
169
193
|
},
|
|
170
194
|
done: function done() {
|
|
171
195
|
onEnter === null || onEnter === void 0 || onEnter(value);
|
|
@@ -200,12 +224,15 @@ var BaseNumberKeyboard = function BaseNumberKeyboard(props) {
|
|
|
200
224
|
},
|
|
201
225
|
showDelete: false,
|
|
202
226
|
onValueSelect: setSelect,
|
|
203
|
-
defaultSelect: defaultSelect
|
|
227
|
+
defaultSelect: defaultSelect,
|
|
228
|
+
style: {
|
|
229
|
+
backgroundColor: (rightItemsStyle === null || rightItemsStyle === void 0 ? void 0 : rightItemsStyle.buttonBackgroundColor) || '#fff'
|
|
230
|
+
}
|
|
204
231
|
}), /*#__PURE__*/React.createElement(Presets, {
|
|
205
232
|
presets: presets,
|
|
206
233
|
onChange: handleChangeValue
|
|
207
234
|
}), /*#__PURE__*/React.createElement(Keyboard, {
|
|
208
|
-
items:
|
|
235
|
+
items: itemsWithStyle,
|
|
209
236
|
rightItems: rightItems,
|
|
210
237
|
onChange: handleKeyboardChange
|
|
211
238
|
}));
|
|
@@ -20,7 +20,8 @@ var VirtualKeyInput = function VirtualKeyInput(props) {
|
|
|
20
20
|
_props$showDelete = props.showDelete,
|
|
21
21
|
showDelete = _props$showDelete === void 0 ? true : _props$showDelete,
|
|
22
22
|
onValueSelect = props.onValueSelect,
|
|
23
|
-
defaultSelect = props.defaultSelect
|
|
23
|
+
defaultSelect = props.defaultSelect,
|
|
24
|
+
style = props.style;
|
|
24
25
|
var _useState = useState(defaultSelect !== null && defaultSelect !== void 0 ? defaultSelect : false),
|
|
25
26
|
_useState2 = _slicedToArray(_useState, 2),
|
|
26
27
|
select = _useState2[0],
|
|
@@ -57,7 +58,8 @@ var VirtualKeyInput = function VirtualKeyInput(props) {
|
|
|
57
58
|
});
|
|
58
59
|
};
|
|
59
60
|
return /*#__PURE__*/React.createElement("div", {
|
|
60
|
-
className: "virtual-keyboard-input-wrap"
|
|
61
|
+
className: "virtual-keyboard-input-wrap",
|
|
62
|
+
style: style
|
|
61
63
|
}, props.renderInput ? /*#__PURE__*/React.createElement("div", {
|
|
62
64
|
className: classNames('virtual-keyboard-input', {
|
|
63
65
|
'virtual-keyboard-input-select': select
|
|
@@ -73,7 +75,7 @@ var VirtualKeyInput = function VirtualKeyInput(props) {
|
|
|
73
75
|
}, props, {
|
|
74
76
|
readOnly: true,
|
|
75
77
|
value: previewValue
|
|
76
|
-
})), (_ref = "".concat(value !== null && value !== void 0 ? value :
|
|
78
|
+
})), (_ref = "".concat(value !== null && value !== void 0 ? value : '')) !== null && _ref !== void 0 && _ref.length && showDelete ? /*#__PURE__*/React.createElement("div", {
|
|
77
79
|
className: "virtual-keyboard-input-delete",
|
|
78
80
|
onClick: _onDelete
|
|
79
81
|
}, /*#__PURE__*/React.createElement(Delete, {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PisellMenuProps } from '../../pisellMenu/types';
|
|
3
|
+
/**
|
|
4
|
+
* @title: 数据源表单组件
|
|
5
|
+
* @description: 基于数据源动态生成表单,支持编辑、查看、禁用三种模式
|
|
6
|
+
*/
|
|
7
|
+
declare const DataSourceMenu: React.ForwardRefExoticComponent<PisellMenuProps & React.RefAttributes<any>>;
|
|
8
|
+
export default DataSourceMenu;
|
|
@@ -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" | "
|
|
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" | "
|
|
23
|
+
rootDomain: "custom" | "xzero" | "saas";
|
|
24
24
|
customDomain?: string | undefined;
|
|
25
25
|
value?: string | undefined;
|
|
26
26
|
tenantId: string;
|
|
@@ -60,13 +60,11 @@ 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("./
|
|
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("./Upload/type").UploadProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | (import("react").FC<{}> & {
|
|
64
64
|
Group: import("react").FC<import("./Checkbox/type").CheckboxGroupProps & import("../dataSourceForm/utils").WithModeProps>;
|
|
65
65
|
} & {
|
|
66
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("
|
|
68
|
-
onChange: (value: string) => void;
|
|
69
|
-
} & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | (import("react").FC<import("./Input/type").InputProps> & {
|
|
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("./Input/type").InputProps> & {
|
|
70
68
|
JSON: import("react").FC<any>;
|
|
71
69
|
Password: import("react").FC<import("antd/es/input").PasswordProps & import("react").RefAttributes<import("antd").InputRef> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
|
|
72
70
|
TextArea: import("react").FC<import("antd/es/input").TextAreaProps & import("react").RefAttributes<import("antd/es/input/TextArea").TextAreaRef> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
|
|
@@ -79,14 +77,14 @@ declare const getFieldComponent: (fieldComponent: string) => import("react").FC<
|
|
|
79
77
|
Subdomain: import("react").FC<import("antd").InputProps & {
|
|
80
78
|
onChange: (value: string) => void;
|
|
81
79
|
onBlur?: ((e: import("react").FocusEvent<HTMLInputElement, Element>) => void) | undefined;
|
|
82
|
-
rootDomain: "custom" | "
|
|
80
|
+
rootDomain: "custom" | "xzero" | "saas";
|
|
83
81
|
customDomain?: string | undefined;
|
|
84
82
|
value?: string | undefined;
|
|
85
83
|
tenantId: string;
|
|
86
84
|
name?: string | undefined;
|
|
87
85
|
fieldKey?: string | undefined;
|
|
88
86
|
} & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
|
|
89
|
-
}) |
|
|
87
|
+
}) | (import("react").FC<{}> & {
|
|
90
88
|
Group: import("react").FC<import("./Radio/type").RadioGroupProps & import("../dataSourceForm/utils").WithModeProps>;
|
|
91
89
|
} & {
|
|
92
90
|
Group: import("react").FC<import("./Radio/type").RadioGroupProps & import("../dataSourceForm/utils").WithModeProps>;
|
|
@@ -98,5 +96,7 @@ declare const getFieldComponent: (fieldComponent: string) => import("react").FC<
|
|
|
98
96
|
extraParams?: Record<string, any> | undefined;
|
|
99
97
|
} & {
|
|
100
98
|
dataSource?: any;
|
|
101
|
-
}) => JSX.Element) | import("react").FC<import("./TimePicker/type").TimePickerProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("
|
|
99
|
+
}) => JSX.Element) | import("react").FC<import("./TimePicker/type").TimePickerProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("antd").InputProps & {
|
|
100
|
+
onChange: (value: string) => void;
|
|
101
|
+
} & 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/es/input").PasswordProps & import("react").RefAttributes<import("antd").InputRef> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./Radio/type").RadioGroupProps & import("../dataSourceForm/utils").WithModeProps> | import("react").FC<import("./Checkbox/type").CheckboxGroupProps & import("../dataSourceForm/utils").WithModeProps> | import("react").FC<import("./DateRangePicker/type").DateRangePickerProps & 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>;
|
|
102
102
|
export { getFieldComponent, formFieldMap };
|
|
@@ -35,13 +35,34 @@ 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"));
|
|
43
44
|
var PisellAdjustPrice = (props) => {
|
|
44
|
-
const {
|
|
45
|
+
const {
|
|
46
|
+
value,
|
|
47
|
+
onChange,
|
|
48
|
+
defaultValue,
|
|
49
|
+
originValue,
|
|
50
|
+
selectType = "light",
|
|
51
|
+
backgroundColor = "#ffffff",
|
|
52
|
+
containerBackgroundColor = "#d0d5dd",
|
|
53
|
+
buttonBackgroundColor = "#ffffff",
|
|
54
|
+
textColor = "#000000",
|
|
55
|
+
resetButtonBackgroundColor = "#ffffff",
|
|
56
|
+
resetButtonTextColor = "#d92d20",
|
|
57
|
+
isDoneButtonFollowTheme = true,
|
|
58
|
+
doneButtonBackgroundColor = "#4ca30d",
|
|
59
|
+
doneButtonTextColor = "#ffffff",
|
|
60
|
+
isShowMainText = true,
|
|
61
|
+
mainTextColor = "#101828",
|
|
62
|
+
isShowSubText = true,
|
|
63
|
+
subTextColor = "#667085",
|
|
64
|
+
...others
|
|
65
|
+
} = props;
|
|
45
66
|
const config = (0, import_usePisellConfig.default)();
|
|
46
67
|
const [newValue, setNewValue] = (0, import_react.useState)(value || 0);
|
|
47
68
|
const [updateMode, setUpdateMode] = (0, import_react.useState)(
|
|
@@ -92,65 +113,114 @@ var PisellAdjustPrice = (props) => {
|
|
|
92
113
|
return `${v}%`;
|
|
93
114
|
}
|
|
94
115
|
};
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
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(
|
|
116
|
+
(0, import_react.useEffect)(() => {
|
|
117
|
+
(0, import_utils.setTheme)({
|
|
118
|
+
"--pisell-adjust-price-text-color": textColor,
|
|
119
|
+
"--pisell-adjust-price-background-color": backgroundColor,
|
|
120
|
+
"--pisell-adjust-price-container-background-color": containerBackgroundColor,
|
|
121
|
+
"--pisell-adjust-price-button-background-color": buttonBackgroundColor,
|
|
122
|
+
"--pisell-adjust-price-main-text-color": mainTextColor,
|
|
123
|
+
"--pisell-adjust-price-sub-text-color": subTextColor
|
|
124
|
+
});
|
|
125
|
+
}, [
|
|
126
|
+
textColor,
|
|
127
|
+
backgroundColor,
|
|
128
|
+
containerBackgroundColor,
|
|
129
|
+
buttonBackgroundColor,
|
|
130
|
+
mainTextColor,
|
|
131
|
+
subTextColor
|
|
132
|
+
]);
|
|
133
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
145
134
|
"div",
|
|
146
135
|
{
|
|
147
|
-
className: (0, import_classnames.default)("pisell-
|
|
148
|
-
|
|
136
|
+
className: (0, import_classnames.default)("pisell-lowcode-adjust-price-wrap", {
|
|
137
|
+
"pisell-lowcode-adjust-price-dark": selectType === "dark",
|
|
138
|
+
"pisell-lowcode-adjust-price-light": selectType === "light"
|
|
149
139
|
})
|
|
150
140
|
},
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
141
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
142
|
+
import_antd.Segmented,
|
|
143
|
+
{
|
|
144
|
+
size: "large",
|
|
145
|
+
options: [
|
|
146
|
+
{
|
|
147
|
+
label: (0, import_locales.getText)("pisell-adjust-price-price-override"),
|
|
148
|
+
value: "priceOverride"
|
|
149
|
+
},
|
|
150
|
+
{ label: (0, import_locales.getText)("pisell-adjust-price-discount"), value: "discount" }
|
|
151
|
+
],
|
|
152
|
+
value: updateMode,
|
|
153
|
+
onChange: handleUpdateMode,
|
|
154
|
+
block: true
|
|
155
|
+
}
|
|
156
|
+
),
|
|
157
|
+
updateMode === "discount" && /* @__PURE__ */ import_react.default.createElement(
|
|
158
|
+
import_antd.Segmented,
|
|
159
|
+
{
|
|
160
|
+
size: "large",
|
|
161
|
+
options: [
|
|
162
|
+
{
|
|
163
|
+
label: `${(0, import_locales.getText)("pisell-adjust-price-discount-amount")}(${(config == null ? void 0 : config.symbol) || "$"})`,
|
|
164
|
+
value: "amount"
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
label: `${(0, import_locales.getText)("pisell-adjust-price-discount-percentage")}(%)`,
|
|
168
|
+
value: "percentage"
|
|
169
|
+
}
|
|
170
|
+
],
|
|
171
|
+
value: discountMode,
|
|
172
|
+
onChange: (val) => {
|
|
173
|
+
setNewValue("");
|
|
174
|
+
setDiscountMode(val);
|
|
175
|
+
},
|
|
176
|
+
block: true
|
|
177
|
+
}
|
|
178
|
+
),
|
|
179
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode-adjust-price-amount-wrap" }, /* @__PURE__ */ import_react.default.createElement(
|
|
180
|
+
import_Amount.default,
|
|
181
|
+
{
|
|
182
|
+
...others,
|
|
183
|
+
inputFormat,
|
|
184
|
+
defaultValue: updateMode === "priceOverride" ? defaultValue : "",
|
|
185
|
+
key: updateMode,
|
|
186
|
+
value: newValue,
|
|
187
|
+
defaultSelect: updateMode === "priceOverride",
|
|
188
|
+
onChange: handleChange,
|
|
189
|
+
onEnter: handleEnter,
|
|
190
|
+
placeholder: discountMode === "amount" ? "0" : "%",
|
|
191
|
+
rightItemsStyle: {
|
|
192
|
+
buttonBackgroundColor,
|
|
193
|
+
textColor,
|
|
194
|
+
resetButtonBackgroundColor,
|
|
195
|
+
resetButtonTextColor,
|
|
196
|
+
isDoneButtonFollowTheme,
|
|
197
|
+
doneButtonBackgroundColor,
|
|
198
|
+
doneButtonTextColor
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
)),
|
|
202
|
+
updateMode === "discount" && /* @__PURE__ */ import_react.default.createElement("div", null, 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, isShowSubText ? /* @__PURE__ */ import_react.default.createElement(
|
|
203
|
+
"div",
|
|
204
|
+
{
|
|
205
|
+
className: (0, import_classnames.default)(
|
|
206
|
+
"pisell-low-code-adjust-price-amount-desc",
|
|
207
|
+
{
|
|
208
|
+
["pisell-low-code-adjust-price-amount-desc-error"]: isDiscountError
|
|
209
|
+
}
|
|
210
|
+
)
|
|
211
|
+
},
|
|
212
|
+
(0, import_locales.getText)("pisell-adjust-price-discount-can-be-maximum"),
|
|
213
|
+
" ",
|
|
214
|
+
discountMode === "amount" ? /* @__PURE__ */ import_react.default.createElement(
|
|
215
|
+
import_pisellText.default.Amount,
|
|
216
|
+
{
|
|
217
|
+
value: originValue,
|
|
218
|
+
style: {
|
|
219
|
+
color: subTextColor
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
) : "100%"
|
|
223
|
+
) : null)
|
|
224
|
+
);
|
|
155
225
|
};
|
|
156
226
|
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:
|
|
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(--
|
|
41
|
+
background: var(--pisell-adjust-price-container-background-color);
|
|
13
42
|
}
|
|
14
43
|
.pisell-low-code-adjust-price-total {
|
|
15
|
-
color: var(--
|
|
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(--
|
|
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, #
|
|
57
|
+
color: var(--Error-600, #d92d20);
|
|
29
58
|
}
|
|
30
|
-
}
|
|
59
|
+
}
|
|
@@ -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/pisellAdjustPrice/type.ts
|
|
16
|
+
var type_exports = {};
|
|
17
|
+
module.exports = __toCommonJS(type_exports);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { UniqueIdentifier } from '@dnd-kit/core';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Props as TreeItemProps } from './TreeItem';
|
|
4
|
+
interface Props extends TreeItemProps {
|
|
5
|
+
id: UniqueIdentifier;
|
|
6
|
+
__designMode?: string;
|
|
7
|
+
}
|
|
8
|
+
declare const _default: React.MemoExoticComponent<({ id, depth, ...props }: Props) => JSX.Element>;
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React, { HTMLAttributes } from 'react';
|
|
2
|
+
import type { TreeItem as TreeItemType } from '../../types';
|
|
3
|
+
import './TreeItem.less';
|
|
4
|
+
export interface Props extends Omit<HTMLAttributes<HTMLLIElement>, 'id'> {
|
|
5
|
+
childCount?: number;
|
|
6
|
+
clone?: boolean;
|
|
7
|
+
collapsed?: boolean;
|
|
8
|
+
depth: number;
|
|
9
|
+
disableInteraction?: boolean;
|
|
10
|
+
disableSelection?: boolean;
|
|
11
|
+
ghost?: boolean;
|
|
12
|
+
handleProps?: any;
|
|
13
|
+
indicator?: boolean;
|
|
14
|
+
indentationWidth: number;
|
|
15
|
+
onCollapse?(): void;
|
|
16
|
+
onRemove?(): void;
|
|
17
|
+
wrapperRef?(node: HTMLLIElement): void;
|
|
18
|
+
item: TreeItemType;
|
|
19
|
+
renderItem?(item: Props, ref: React.ForwardedRef<HTMLDivElement>): React.ReactNode;
|
|
20
|
+
__designMode?: string;
|
|
21
|
+
isBlocked?: boolean;
|
|
22
|
+
isError?: boolean;
|
|
23
|
+
}
|
|
24
|
+
export declare const TreeItem: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 可拖拽树形组件
|
|
3
|
+
* 基于@dnd-kit库实现,支持拖拽排序、展开折叠、删除等功能
|
|
4
|
+
*/
|
|
5
|
+
import { UniqueIdentifier } from '@dnd-kit/core';
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import type { FlattenedItem, TreeItem, TreeItems } from './types';
|
|
8
|
+
import type { Props as TreeItemProps } from './components/TreeItem/TreeItem';
|
|
9
|
+
interface Props {
|
|
10
|
+
/** 是否支持折叠功能 */
|
|
11
|
+
collapsible?: boolean;
|
|
12
|
+
/** 初始树形数据,默认使用 initialItems */
|
|
13
|
+
value?: TreeItems;
|
|
14
|
+
/** 缩进宽度,控制子节点的缩进距离 */
|
|
15
|
+
indentationWidth?: number;
|
|
16
|
+
/** 是否显示拖拽指示器 */
|
|
17
|
+
indicator?: boolean;
|
|
18
|
+
/** 是否支持删除节点功能 */
|
|
19
|
+
removable?: boolean;
|
|
20
|
+
/** 自定义渲染树节点 */
|
|
21
|
+
renderItem?: (item: TreeItemProps, ref: React.RefObject<HTMLDivElement>) => React.ReactNode;
|
|
22
|
+
/** 树形数据变化回调 */
|
|
23
|
+
onChange?: (items: TreeItems) => void;
|
|
24
|
+
/** 删除节点前 */
|
|
25
|
+
onRemoveBefore?: (item: TreeItem) => Promise<boolean>;
|
|
26
|
+
/** 设计模式 */
|
|
27
|
+
__designMode?: string;
|
|
28
|
+
/** 最大层级 */
|
|
29
|
+
maxLevel?: number;
|
|
30
|
+
/** 自定义拖拽判断函数,返回false时阻止拖拽 */
|
|
31
|
+
canDrop?: (dragItem: FlattenedItem, dropTarget: FlattenedItem, parentId: UniqueIdentifier | null, parentNode: any) => boolean;
|
|
32
|
+
}
|
|
33
|
+
export declare function SortableTree({ collapsible, value, indicator, indentationWidth, removable, renderItem, onChange, onRemoveBefore, __designMode, maxLevel, canDrop, }: Props): JSX.Element;
|
|
34
|
+
declare const Demo: (props: Props) => JSX.Element;
|
|
35
|
+
export default Demo;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { Props as TreeItem } from '../../../pisellDraggable/components/TreeItem/TreeItem';
|
|
3
|
+
import './index.less';
|
|
4
|
+
interface SortableItemProps {
|
|
5
|
+
itemProps: TreeItem;
|
|
6
|
+
render?: (itemProps: TreeItem) => React.ReactNode;
|
|
7
|
+
domRef: React.RefObject<HTMLDivElement>;
|
|
8
|
+
allowAddChild?: boolean;
|
|
9
|
+
allowDelete?: boolean;
|
|
10
|
+
allowIsShow?: boolean;
|
|
11
|
+
allowDrag?: boolean;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
onAdd?: (itemProps: TreeItem) => void;
|
|
14
|
+
onDelete?: (itemProps: TreeItem) => void;
|
|
15
|
+
showBorder?: boolean;
|
|
16
|
+
spacing?: number;
|
|
17
|
+
maxLevel?: number;
|
|
18
|
+
/** 设计模式 */
|
|
19
|
+
__designMode?: string;
|
|
20
|
+
/** 是否自定义操作 */
|
|
21
|
+
isCustomAction?: boolean;
|
|
22
|
+
/** 获取item样式 */
|
|
23
|
+
getItemStyle?: (itemProps: TreeItem) => React.CSSProperties;
|
|
24
|
+
}
|
|
25
|
+
declare const SortableItem: (props: SortableItemProps) => JSX.Element;
|
|
26
|
+
export default SortableItem;
|