@pisell/private-materials 3.0.57 → 3.0.59
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/preview.js +8 -8
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +8 -8
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +7 -7
- package/es/components/index.d.ts +2 -1
- package/es/components/index.js +2 -1
- package/es/components/ruleSetting/index.js +3 -1
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/AddSchedules/index.js +33 -11
- package/es/components/schedules/schedules/index.js +3 -2
- package/es/components/taxSelect/index.d.ts +12 -0
- package/es/components/taxSelect/index.js +141 -0
- package/es/components/taxSelect/index.less +12 -0
- package/es/components/taxSelect/locales.d.ts +24 -0
- package/es/components/taxSelect/locales.js +23 -0
- package/es/index.d.ts +1 -0
- package/es/index.js +2 -1
- package/lib/components/index.d.ts +2 -1
- package/lib/components/index.js +5 -2
- package/lib/components/ruleSetting/index.js +3 -1
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/AddSchedules/index.js +39 -14
- package/lib/components/schedules/schedules/index.js +2 -2
- package/lib/components/taxSelect/index.d.ts +12 -0
- package/lib/components/taxSelect/index.js +161 -0
- package/lib/components/taxSelect/index.less +12 -0
- package/lib/components/taxSelect/locales.d.ts +24 -0
- package/lib/components/taxSelect/locales.js +47 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +5 -2
- package/lowcode/tax-select/meta.ts +107 -0
- package/package.json +1 -1
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/taxSelect/index.tsx
|
|
30
|
+
var taxSelect_exports = {};
|
|
31
|
+
__export(taxSelect_exports, {
|
|
32
|
+
default: () => taxSelect_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(taxSelect_exports);
|
|
35
|
+
var import_antd = require("antd");
|
|
36
|
+
var import_react = __toESM(require("react"));
|
|
37
|
+
var import_useEngineContext = __toESM(require("../../hooks/useEngineContext"));
|
|
38
|
+
var import_utils = require("@pisell/utils");
|
|
39
|
+
var import_locales = __toESM(require("./locales"));
|
|
40
|
+
var import_index = require("./index.less");
|
|
41
|
+
var TaxSelect = (props) => {
|
|
42
|
+
const {
|
|
43
|
+
value,
|
|
44
|
+
onChange,
|
|
45
|
+
selectProps,
|
|
46
|
+
tax_rate = 10,
|
|
47
|
+
tax_title = "Tax"
|
|
48
|
+
} = props;
|
|
49
|
+
const inputNumberRef = (0, import_react.useRef)();
|
|
50
|
+
const [form] = import_antd.Form.useForm();
|
|
51
|
+
const [open, setOpen] = (0, import_react.useState)(false);
|
|
52
|
+
const context = (0, import_useEngineContext.default)();
|
|
53
|
+
const useTax = import_antd.Form.useWatch("tax", form);
|
|
54
|
+
import_utils.locales.init(import_locales.default, localStorage.getItem("umi_locale") || "en");
|
|
55
|
+
(0, import_react.useEffect)(() => {
|
|
56
|
+
document.body.id = "body";
|
|
57
|
+
}, []);
|
|
58
|
+
const options = (0, import_react.useMemo)(() => {
|
|
59
|
+
const isEn = localStorage.getItem("umi_locale") === "en-US";
|
|
60
|
+
const taxOptions = [
|
|
61
|
+
{
|
|
62
|
+
value: 0,
|
|
63
|
+
label: (isEn ? tax_title : "") + import_utils.locales.getText("pisell2.text.tax-free")
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
value: tax_rate,
|
|
67
|
+
label: tax_rate + "%"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
value: "custom",
|
|
71
|
+
label: import_utils.locales.getText("pisell2.text.custom")
|
|
72
|
+
}
|
|
73
|
+
];
|
|
74
|
+
return taxOptions;
|
|
75
|
+
}, []);
|
|
76
|
+
const _onChange = (val) => {
|
|
77
|
+
if (val === "custom") {
|
|
78
|
+
setOpen(true);
|
|
79
|
+
setTimeout(() => {
|
|
80
|
+
var _a, _b;
|
|
81
|
+
form.setFieldsValue({
|
|
82
|
+
tax: value || tax_rate
|
|
83
|
+
});
|
|
84
|
+
(_b = (_a = inputNumberRef.current).focus) == null ? void 0 : _b.call(_a);
|
|
85
|
+
}, 10);
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
onChange == null ? void 0 : onChange(val);
|
|
89
|
+
};
|
|
90
|
+
const _value = (0, import_react.useMemo)(() => {
|
|
91
|
+
if (value === void 0 || value === null) {
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
if (options.some((d) => d.value === value)) {
|
|
95
|
+
return value;
|
|
96
|
+
}
|
|
97
|
+
return `${import_utils.locales.getText("pisell2.text.custom")} (${value}%)`;
|
|
98
|
+
}, [value]);
|
|
99
|
+
const onCancel = () => {
|
|
100
|
+
form.resetFields();
|
|
101
|
+
setOpen(false);
|
|
102
|
+
};
|
|
103
|
+
const onFinish = (values) => {
|
|
104
|
+
onChange == null ? void 0 : onChange(values.tax);
|
|
105
|
+
onCancel();
|
|
106
|
+
};
|
|
107
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
|
|
108
|
+
import_antd.Select,
|
|
109
|
+
{
|
|
110
|
+
options,
|
|
111
|
+
size: "large",
|
|
112
|
+
value: _value,
|
|
113
|
+
onChange: _onChange,
|
|
114
|
+
style: { width: "100%" },
|
|
115
|
+
placeholder: import_utils.locales.getText("pisell2.text.please-enter"),
|
|
116
|
+
...selectProps
|
|
117
|
+
}
|
|
118
|
+
), /* @__PURE__ */ import_react.default.createElement(
|
|
119
|
+
import_antd.Modal,
|
|
120
|
+
{
|
|
121
|
+
open,
|
|
122
|
+
title: `${import_utils.locales.getText("pisell2.text.custom")} ${tax_title}`,
|
|
123
|
+
footer: null,
|
|
124
|
+
onCancel
|
|
125
|
+
},
|
|
126
|
+
/* @__PURE__ */ import_react.default.createElement(import_antd.Form, { form, layout: "vertical", onFinish }, /* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, { label: tax_title, name: "tax", required: true }, /* @__PURE__ */ import_react.default.createElement(
|
|
127
|
+
import_antd.InputNumber,
|
|
128
|
+
{
|
|
129
|
+
ref: inputNumberRef,
|
|
130
|
+
size: "large",
|
|
131
|
+
min: 0,
|
|
132
|
+
max: 100,
|
|
133
|
+
type: "number",
|
|
134
|
+
addonAfter: "%",
|
|
135
|
+
style: { width: "100%" }
|
|
136
|
+
}
|
|
137
|
+
))),
|
|
138
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: "tax-select-footer" }, /* @__PURE__ */ import_react.default.createElement(
|
|
139
|
+
import_antd.Button,
|
|
140
|
+
{
|
|
141
|
+
onClick: onCancel,
|
|
142
|
+
className: "tax-select-footer-item",
|
|
143
|
+
size: "large"
|
|
144
|
+
},
|
|
145
|
+
import_utils.locales.getText("pisell2.text.cancel")
|
|
146
|
+
), /* @__PURE__ */ import_react.default.createElement(
|
|
147
|
+
import_antd.Button,
|
|
148
|
+
{
|
|
149
|
+
type: "primary",
|
|
150
|
+
className: "tax-select-footer-item",
|
|
151
|
+
size: "large",
|
|
152
|
+
disabled: !useTax,
|
|
153
|
+
onClick: () => {
|
|
154
|
+
form.submit();
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
import_utils.locales.getText("pisell2.text.confirm")
|
|
158
|
+
))
|
|
159
|
+
));
|
|
160
|
+
};
|
|
161
|
+
var taxSelect_default = TaxSelect;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
en: {
|
|
3
|
+
'pisell2.text.tax-free': string;
|
|
4
|
+
'pisell2.text.custom': string;
|
|
5
|
+
'pisell2.text.cancel': string;
|
|
6
|
+
'pisell2.text.confirm': string;
|
|
7
|
+
'pisell2.text.please-enter': string;
|
|
8
|
+
};
|
|
9
|
+
'zh-CN': {
|
|
10
|
+
'pisell2.text.tax-free': string;
|
|
11
|
+
'pisell2.text.custom': string;
|
|
12
|
+
'pisell2.text.cancel': string;
|
|
13
|
+
'pisell2.text.confirm': string;
|
|
14
|
+
'pisell2.text.please-enter': string;
|
|
15
|
+
};
|
|
16
|
+
'zh-HK': {
|
|
17
|
+
'pisell2.text.tax-free': string;
|
|
18
|
+
'pisell2.text.custom': string;
|
|
19
|
+
'pisell2.text.cancel': string;
|
|
20
|
+
'pisell2.text.confirm': string;
|
|
21
|
+
'pisell2.text.please-enter': string;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
export default _default;
|
|
@@ -0,0 +1,47 @@
|
|
|
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/taxSelect/locales.ts
|
|
20
|
+
var locales_exports = {};
|
|
21
|
+
__export(locales_exports, {
|
|
22
|
+
default: () => locales_default
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(locales_exports);
|
|
25
|
+
var locales_default = {
|
|
26
|
+
"en": {
|
|
27
|
+
"pisell2.text.tax-free": " free",
|
|
28
|
+
"pisell2.text.custom": "Custom",
|
|
29
|
+
"pisell2.text.cancel": "Cancel",
|
|
30
|
+
"pisell2.text.confirm": "Confirm",
|
|
31
|
+
"pisell2.text.please-enter": "Please enter"
|
|
32
|
+
},
|
|
33
|
+
"zh-CN": {
|
|
34
|
+
"pisell2.text.tax-free": "免税",
|
|
35
|
+
"pisell2.text.custom": "自定义",
|
|
36
|
+
"pisell2.text.cancel": "取消",
|
|
37
|
+
"pisell2.text.confirm": "确认",
|
|
38
|
+
"pisell2.text.please-enter": "请输入"
|
|
39
|
+
},
|
|
40
|
+
"zh-HK": {
|
|
41
|
+
"pisell2.text.tax-free": "免稅",
|
|
42
|
+
"pisell2.text.custom": "自定義",
|
|
43
|
+
"pisell2.text.cancel": "取消",
|
|
44
|
+
"pisell2.text.confirm": "確認",
|
|
45
|
+
"pisell2.text.please-enter": "請輸入"
|
|
46
|
+
}
|
|
47
|
+
};
|
package/lib/index.d.ts
CHANGED
|
@@ -14,3 +14,4 @@ export { default as BookingContacts } from './components/booking/materiels/conta
|
|
|
14
14
|
export { default as ProductExtension } from './components/productExtension';
|
|
15
15
|
export { default as BookingDeposit } from './components/booking/deposit';
|
|
16
16
|
export { default as RuleSetting } from './components/ruleSetting';
|
|
17
|
+
export { default as TaxSelect } from './components/taxSelect';
|
package/lib/index.js
CHANGED
|
@@ -43,7 +43,8 @@ __export(src_exports, {
|
|
|
43
43
|
Login: () => import_login.default,
|
|
44
44
|
ProductExtension: () => import_productExtension.default,
|
|
45
45
|
RuleSetting: () => import_ruleSetting.default,
|
|
46
|
-
Schedules: () => import_schedules.default
|
|
46
|
+
Schedules: () => import_schedules.default,
|
|
47
|
+
TaxSelect: () => import_taxSelect.default
|
|
47
48
|
});
|
|
48
49
|
module.exports = __toCommonJS(src_exports);
|
|
49
50
|
var import_weekday = __toESM(require("dayjs/plugin/weekday"));
|
|
@@ -64,6 +65,7 @@ var import_contacts = __toESM(require("./components/booking/materiels/contacts")
|
|
|
64
65
|
var import_productExtension = __toESM(require("./components/productExtension"));
|
|
65
66
|
var import_deposit = __toESM(require("./components/booking/deposit"));
|
|
66
67
|
var import_ruleSetting = __toESM(require("./components/ruleSetting"));
|
|
68
|
+
var import_taxSelect = __toESM(require("./components/taxSelect"));
|
|
67
69
|
import_dayjs.default.extend(import_weekday.default);
|
|
68
70
|
import_dayjs.default.extend(import_localeData.default);
|
|
69
71
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -82,5 +84,6 @@ import_dayjs.default.extend(import_localeData.default);
|
|
|
82
84
|
Login,
|
|
83
85
|
ProductExtension,
|
|
84
86
|
RuleSetting,
|
|
85
|
-
Schedules
|
|
87
|
+
Schedules,
|
|
88
|
+
TaxSelect
|
|
86
89
|
});
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
|
|
2
|
+
import { ComponentMetadata, Snippet } from '@alilc/lowcode-types';
|
|
3
|
+
|
|
4
|
+
const TaxSelectMeta: ComponentMetadata = {
|
|
5
|
+
"componentName": "TaxSelect",
|
|
6
|
+
"title": "TaxSelect",
|
|
7
|
+
"docUrl": "",
|
|
8
|
+
"screenshot": "",
|
|
9
|
+
"devMode": "proCode",
|
|
10
|
+
"npm": {
|
|
11
|
+
"package": "@pisell/private-materials",
|
|
12
|
+
"version": "1.0.4",
|
|
13
|
+
"exportName": "TaxSelect",
|
|
14
|
+
"main": "src/index.ts",
|
|
15
|
+
"destructuring": true,
|
|
16
|
+
"subName": ""
|
|
17
|
+
},
|
|
18
|
+
"configure": {
|
|
19
|
+
"props": [
|
|
20
|
+
{
|
|
21
|
+
"title": {
|
|
22
|
+
"label": {
|
|
23
|
+
"type": "i18n",
|
|
24
|
+
"en-US": "value",
|
|
25
|
+
"zh-CN": "value"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"name": "value",
|
|
29
|
+
"setter": ["JsonSetter", "VariableSetter"],
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"title": {
|
|
33
|
+
"label": {
|
|
34
|
+
"type": "i18n",
|
|
35
|
+
"en-US": "onChange",
|
|
36
|
+
"zh-CN": "onChange"
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"name": "onChange",
|
|
40
|
+
"setter": ["JsonSetter", "VariableSetter"],
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"title": {
|
|
44
|
+
"label": {
|
|
45
|
+
"type": "i18n",
|
|
46
|
+
"en-US": "className",
|
|
47
|
+
"zh-CN": "className"
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"name": "className",
|
|
51
|
+
"setter": ["StringSetter", "VariableSetter"],
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"title": {
|
|
55
|
+
"label": {
|
|
56
|
+
"type": "i18n",
|
|
57
|
+
"en-US": "selectProps",
|
|
58
|
+
"zh-CN": "selectProps"
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"name": "selectProps",
|
|
62
|
+
"setter": ["JsonSetter", "VariableSetter"],
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"title": {
|
|
66
|
+
"label": {
|
|
67
|
+
"type": "i18n",
|
|
68
|
+
"en-US": "tax_title",
|
|
69
|
+
"zh-CN": "tax_title"
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
"name": "tax_title",
|
|
73
|
+
"setter": ["StringSetter", "VariableSetter"],
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"title": {
|
|
77
|
+
"label": {
|
|
78
|
+
"type": "i18n",
|
|
79
|
+
"en-US": "tax_rate",
|
|
80
|
+
"zh-CN": "tax_rate"
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
"name": "tax_rate",
|
|
84
|
+
"setter": ["StringSetter", "VariableSetter"],
|
|
85
|
+
}
|
|
86
|
+
],
|
|
87
|
+
"supports": {
|
|
88
|
+
"style": true,
|
|
89
|
+
},
|
|
90
|
+
"component": {}
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
const snippets: Snippet[] = [
|
|
94
|
+
{
|
|
95
|
+
"title": "TaxSelect",
|
|
96
|
+
"screenshot": "",
|
|
97
|
+
"schema": {
|
|
98
|
+
"componentName": "TaxSelect",
|
|
99
|
+
"props": {}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
];
|
|
103
|
+
|
|
104
|
+
export default {
|
|
105
|
+
...TaxSelectMeta,
|
|
106
|
+
snippets
|
|
107
|
+
};
|