@pisell/private-materials 3.0.55 → 3.0.57

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 (74) 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 +1 -1
  6. package/build/lowcode/preview.js +8 -8
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +7 -7
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +6 -6
  11. package/es/components/booking/addons/index.d.ts +1 -1
  12. package/es/components/booking/addons/model.d.ts +1 -2
  13. package/es/components/booking/forms/forms.d.ts +1 -1
  14. package/es/components/booking/forms/index.d.ts +1 -1
  15. package/es/components/booking/forms/model.d.ts +1 -2
  16. package/es/components/booking/index.d.ts +1 -1
  17. package/es/components/booking/info/index.d.ts +1 -1
  18. package/es/components/booking/info/model.d.ts +1 -2
  19. package/es/components/booking/model.d.ts +1 -2
  20. package/es/components/booking/notes/index.d.ts +1 -1
  21. package/es/components/booking/notes/model.d.ts +1 -2
  22. package/es/components/booking/payments/index.d.ts +1 -1
  23. package/es/components/booking/payments/model.d.ts +1 -2
  24. package/es/components/index.d.ts +2 -1
  25. package/es/components/index.js +2 -1
  26. package/es/components/listComponent/index.d.ts +15 -0
  27. package/es/components/listComponent/index.js +75 -0
  28. package/es/components/ruleSetting/index.d.ts +10 -0
  29. package/es/components/ruleSetting/index.js +335 -0
  30. package/es/components/ruleSetting/index.less +81 -0
  31. package/es/components/ruleSetting/locales.d.ts +48 -0
  32. package/es/components/ruleSetting/locales.js +47 -0
  33. package/es/components/ruleSetting/ruleBorder/index.d.ts +10 -0
  34. package/es/components/ruleSetting/ruleBorder/index.js +66 -0
  35. package/es/components/ruleSetting/ruleBorder/index.less +30 -0
  36. package/es/components/ruleSetting/server.d.ts +4 -0
  37. package/es/components/ruleSetting/server.js +149 -0
  38. package/es/components/schedules/index.d.ts +1 -1
  39. package/es/components/schedules/model.d.ts +1 -2
  40. package/es/index.d.ts +1 -0
  41. package/es/index.js +2 -1
  42. package/lib/components/booking/addons/index.d.ts +1 -1
  43. package/lib/components/booking/addons/model.d.ts +1 -2
  44. package/lib/components/booking/forms/forms.d.ts +1 -1
  45. package/lib/components/booking/forms/index.d.ts +1 -1
  46. package/lib/components/booking/forms/model.d.ts +1 -2
  47. package/lib/components/booking/index.d.ts +1 -1
  48. package/lib/components/booking/info/index.d.ts +1 -1
  49. package/lib/components/booking/info/model.d.ts +1 -2
  50. package/lib/components/booking/model.d.ts +1 -2
  51. package/lib/components/booking/notes/index.d.ts +1 -1
  52. package/lib/components/booking/notes/model.d.ts +1 -2
  53. package/lib/components/booking/payments/index.d.ts +1 -1
  54. package/lib/components/booking/payments/model.d.ts +1 -2
  55. package/lib/components/index.d.ts +2 -1
  56. package/lib/components/index.js +3 -0
  57. package/lib/components/listComponent/index.d.ts +15 -0
  58. package/lib/components/listComponent/index.js +85 -0
  59. package/lib/components/ruleSetting/index.d.ts +10 -0
  60. package/lib/components/ruleSetting/index.js +379 -0
  61. package/lib/components/ruleSetting/index.less +81 -0
  62. package/lib/components/ruleSetting/locales.d.ts +48 -0
  63. package/lib/components/ruleSetting/locales.js +71 -0
  64. package/lib/components/ruleSetting/ruleBorder/index.d.ts +10 -0
  65. package/lib/components/ruleSetting/ruleBorder/index.js +89 -0
  66. package/lib/components/ruleSetting/ruleBorder/index.less +30 -0
  67. package/lib/components/ruleSetting/server.d.ts +4 -0
  68. package/lib/components/ruleSetting/server.js +107 -0
  69. package/lib/components/schedules/index.d.ts +1 -1
  70. package/lib/components/schedules/model.d.ts +1 -2
  71. package/lib/index.d.ts +1 -0
  72. package/lib/index.js +3 -0
  73. package/lowcode/rule-setting/meta.ts +74 -0
  74. package/package.json +2 -2
@@ -0,0 +1,71 @@
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/ruleSetting/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.satisfy_any_condition": "Satisfy any condition",
28
+ "pisell2.text.add": "Add",
29
+ "pisell2.text.and": "And",
30
+ "pisell2.text.or": "Or",
31
+ "pisell2.text.all": "All",
32
+ "pisell2.text.rule-setting.Contain": "Contain",
33
+ "pisell2.text.rule-setting.Exclude": "Exclude",
34
+ "pisell2.text.rule-setting.order_type": "Order type",
35
+ "pisell2.text.rule-setting.sales_channel": "Operation platform",
36
+ "pisell2.text.rule-setting.staff": "Staff",
37
+ "pisell2.text.rule-setting.payment_method": "Payment method",
38
+ "pisell2.text.rule-setting.pisell_terminal_device": "Pisell terminal device",
39
+ "pisell2.text.rule-setting.current_device": "Current device"
40
+ },
41
+ "zh-CN": {
42
+ "pisell2.text.satisfy_any_condition": "满足任何条件",
43
+ "pisell2.text.and": "并且",
44
+ "pisell2.text.or": "或者",
45
+ "pisell2.text.all": "全部",
46
+ "pisell2.text.add": "添加",
47
+ "pisell2.text.rule-setting.Contain": "包含",
48
+ "pisell2.text.rule-setting.Exclude": "不包含",
49
+ "pisell2.text.rule-setting.order_type": "订单类型",
50
+ "pisell2.text.rule-setting.sales_channel": "操作平台",
51
+ "pisell2.text.rule-setting.staff": "员工",
52
+ "pisell2.text.rule-setting.payment_method": "支付方式",
53
+ "pisell2.text.rule-setting.pisell_terminal_device": "Pisell终端",
54
+ "pisell2.text.rule-setting.current_device": "当前设备"
55
+ },
56
+ "zh-HK": {
57
+ "pisell2.text.satisfy_any_condition": "滿足任何條件",
58
+ "pisell2.text.and": "並且",
59
+ "pisell2.text.or": "或者",
60
+ "pisell2.text.all": "全部",
61
+ "pisell2.text.add": "添加",
62
+ "pisell2.text.rule-setting.Contain": "包含",
63
+ "pisell2.text.rule-setting.Exclude": "不包含",
64
+ "pisell2.text.rule-setting.order_type": "訂單類型",
65
+ "pisell2.text.rule-setting.sales_channel": "操作平台",
66
+ "pisell2.text.rule-setting.staff": "員工",
67
+ "pisell2.text.rule-setting.payment_method": "支付方式",
68
+ "pisell2.text.rule-setting.pisell_terminal_device": "Pisell終端",
69
+ "pisell2.text.rule-setting.current_device": "當前設備"
70
+ }
71
+ };
@@ -0,0 +1,10 @@
1
+ import React from "react";
2
+ import "./index.less";
3
+ interface RuleSettingProps {
4
+ value: any;
5
+ onChange: (type: string) => void;
6
+ startDomClassName: string;
7
+ endDomClassName: string;
8
+ }
9
+ declare const RuleBorder: (props: RuleSettingProps) => React.JSX.Element;
10
+ export default RuleBorder;
@@ -0,0 +1,89 @@
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/ruleSetting/ruleBorder/index.tsx
30
+ var ruleBorder_exports = {};
31
+ __export(ruleBorder_exports, {
32
+ default: () => ruleBorder_default
33
+ });
34
+ module.exports = __toCommonJS(ruleBorder_exports);
35
+ var import_react = __toESM(require("react"));
36
+ var import_antd = require("antd");
37
+ var import_utils = require("@pisell/utils");
38
+ var import_index = require("./index.less");
39
+ var RuleBorder = (props) => {
40
+ const { startDomClassName, endDomClassName, value, onChange } = props;
41
+ const [typePosition, setTypePosition] = (0, import_react.useState)({
42
+ top: "0px",
43
+ bottom: "0px"
44
+ });
45
+ const includeOption = [
46
+ {
47
+ label: import_utils.locales.getText("pisell2.text.and"),
48
+ value: "and"
49
+ },
50
+ {
51
+ label: import_utils.locales.getText("pisell2.text.or"),
52
+ value: "or"
53
+ }
54
+ ];
55
+ const getTypePosition = (startDomClassName2, endDomClassName2) => {
56
+ let startDom = document.querySelector(`.${startDomClassName2}`);
57
+ let endDom = document.querySelector(`.${endDomClassName2}`);
58
+ let startDomRect = startDom == null ? void 0 : startDom.getBoundingClientRect();
59
+ let endDomRect = endDom == null ? void 0 : endDom.getBoundingClientRect();
60
+ if (startDomRect && endDomRect) {
61
+ let startDomHeight = startDomRect.height;
62
+ let endDomHeight = endDomRect.height;
63
+ return {
64
+ top: startDomHeight / 2 + "px",
65
+ bottom: endDomHeight / 2 + "px"
66
+ };
67
+ }
68
+ return {
69
+ top: "0px",
70
+ bottom: "0px"
71
+ };
72
+ };
73
+ (0, import_react.useEffect)(() => {
74
+ setTypePosition(getTypePosition(startDomClassName, endDomClassName));
75
+ }, [startDomClassName, endDomClassName]);
76
+ return /* @__PURE__ */ import_react.default.createElement("div", { className: "rule-setting-type" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "border", style: typePosition }, /* @__PURE__ */ import_react.default.createElement(
77
+ import_antd.Select,
78
+ {
79
+ className: "rule-setting-type-select",
80
+ options: includeOption,
81
+ size: "large",
82
+ value,
83
+ onChange: (type) => {
84
+ onChange(type);
85
+ }
86
+ }
87
+ )));
88
+ };
89
+ var ruleBorder_default = RuleBorder;
@@ -0,0 +1,30 @@
1
+ .rule-setting-type {
2
+ width: 200px;
3
+ display: flex;
4
+ align-items: center;
5
+ justify-content: center;
6
+ align-self: stretch;
7
+ position: relative;
8
+
9
+
10
+
11
+ .border {
12
+ position: absolute;
13
+ top: 0;
14
+ left: 50%;
15
+ width: 50%;
16
+ bottom: 0;
17
+ border: 1px solid #ddd;
18
+ border-right: none;
19
+ transition: all 0.2s ease;
20
+ display: flex;
21
+ align-items: center;
22
+ justify-content: flex-start;
23
+
24
+ .rule-setting-type-select {
25
+ z-index: 1;
26
+ width: 100px;
27
+ transform: translateX(-50%);
28
+ }
29
+ }
30
+ }
@@ -0,0 +1,4 @@
1
+ export declare const getStaffList: () => Promise<any>;
2
+ export declare const getProductChannel: () => Promise<any>;
3
+ export declare const getOrderTypes: () => Promise<any>;
4
+ export declare const getPaymentTypes: () => Promise<any>;
@@ -0,0 +1,107 @@
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/ruleSetting/server.ts
20
+ var server_exports = {};
21
+ __export(server_exports, {
22
+ getOrderTypes: () => getOrderTypes,
23
+ getPaymentTypes: () => getPaymentTypes,
24
+ getProductChannel: () => getProductChannel,
25
+ getStaffList: () => getStaffList
26
+ });
27
+ module.exports = __toCommonJS(server_exports);
28
+ var import_utils = require("@pisell/utils");
29
+ var import_utils2 = require("../../utils/index");
30
+ var getStaffList = async () => {
31
+ let { data } = await import_utils2.request.getRequest().get(
32
+ "/shop/shop/setting/staff",
33
+ {},
34
+ {
35
+ useCache: true
36
+ }
37
+ );
38
+ let _list = ((data == null ? void 0 : data.staff) || []).map((d) => {
39
+ let label = `${d.first_name} ${d.last_name}`;
40
+ if (label.trim() === "") {
41
+ label = d.email;
42
+ }
43
+ return {
44
+ ...d,
45
+ label,
46
+ value: d.account_id
47
+ };
48
+ });
49
+ _list.unshift({
50
+ label: import_utils.locales.getText("pisell2.text.all"),
51
+ value: "all"
52
+ });
53
+ return _list;
54
+ };
55
+ var getProductChannel = async () => {
56
+ const { data } = await import_utils2.request.getRequest().get("/shop/order/platform-list");
57
+ let _list = (data || []).map((d) => {
58
+ return {
59
+ label: d.name,
60
+ value: d.platform
61
+ };
62
+ });
63
+ _list.unshift({
64
+ label: import_utils.locales.getText("pisell2.text.all"),
65
+ value: "all"
66
+ });
67
+ return _list;
68
+ };
69
+ var getOrderTypes = async () => {
70
+ var _a;
71
+ let { data } = await import_utils2.request.getRequest().get("/shop/order/aggregation-type");
72
+ let _list = (_a = data || []) == null ? void 0 : _a.map((d) => {
73
+ return {
74
+ ...d,
75
+ label: d.name,
76
+ value: d.type
77
+ };
78
+ });
79
+ _list.unshift({
80
+ label: import_utils.locales.getText("pisell2.text.all"),
81
+ value: "all"
82
+ });
83
+ return _list;
84
+ };
85
+ var getPaymentTypes = async () => {
86
+ var _a;
87
+ let { data } = await import_utils2.request.getRequest().get("/shop/till/opened-payment-method");
88
+ let _list = (_a = data || []) == null ? void 0 : _a.map((d) => {
89
+ return {
90
+ ...d,
91
+ label: d.name,
92
+ value: d.code
93
+ };
94
+ });
95
+ _list.unshift({
96
+ label: import_utils.locales.getText("pisell2.text.all"),
97
+ value: "all"
98
+ });
99
+ return _list;
100
+ };
101
+ // Annotate the CommonJS export names for ESM import in node:
102
+ 0 && (module.exports = {
103
+ getOrderTypes,
104
+ getPaymentTypes,
105
+ getProductChannel,
106
+ getStaffList
107
+ });
@@ -1,3 +1,3 @@
1
1
  import "./index.less";
2
- declare const Schedules: (props: any) => any;
2
+ declare const Schedules: (props: any) => JSX.Element;
3
3
  export default Schedules;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { CalendarDataItem, ScheduleItem } from "./type";
3
2
  import dayjs from "dayjs";
4
3
  export interface FormState {
@@ -69,7 +68,7 @@ export interface FormState {
69
68
  };
70
69
  setGlobalState: Function | null;
71
70
  }
72
- export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
71
+ export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
73
72
  state: FormState;
74
73
  } & {
75
74
  dispatch: (params: {
package/lib/index.d.ts CHANGED
@@ -13,3 +13,4 @@ export { default as BookingDuration } from './components/booking/materiels/durat
13
13
  export { default as BookingContacts } from './components/booking/materiels/contacts';
14
14
  export { default as ProductExtension } from './components/productExtension';
15
15
  export { default as BookingDeposit } from './components/booking/deposit';
16
+ export { default as RuleSetting } from './components/ruleSetting';
package/lib/index.js CHANGED
@@ -42,6 +42,7 @@ __export(src_exports, {
42
42
  BookingStartTime: () => import_startTime.default,
43
43
  Login: () => import_login.default,
44
44
  ProductExtension: () => import_productExtension.default,
45
+ RuleSetting: () => import_ruleSetting.default,
45
46
  Schedules: () => import_schedules.default
46
47
  });
47
48
  module.exports = __toCommonJS(src_exports);
@@ -62,6 +63,7 @@ var import_duration = __toESM(require("./components/booking/materiels/duration")
62
63
  var import_contacts = __toESM(require("./components/booking/materiels/contacts"));
63
64
  var import_productExtension = __toESM(require("./components/productExtension"));
64
65
  var import_deposit = __toESM(require("./components/booking/deposit"));
66
+ var import_ruleSetting = __toESM(require("./components/ruleSetting"));
65
67
  import_dayjs.default.extend(import_weekday.default);
66
68
  import_dayjs.default.extend(import_localeData.default);
67
69
  // Annotate the CommonJS export names for ESM import in node:
@@ -79,5 +81,6 @@ import_dayjs.default.extend(import_localeData.default);
79
81
  BookingStartTime,
80
82
  Login,
81
83
  ProductExtension,
84
+ RuleSetting,
82
85
  Schedules
83
86
  });
@@ -0,0 +1,74 @@
1
+
2
+ import { ComponentMetadata, Snippet } from '@alilc/lowcode-types';
3
+
4
+ const RuleSettingMeta: ComponentMetadata = {
5
+ "componentName": "RuleSetting",
6
+ "title": "RuleSetting",
7
+ "docUrl": "",
8
+ "screenshot": "",
9
+ "devMode": "proCode",
10
+ "npm": {
11
+ "package": "@pisell/private-materials",
12
+ "version": "1.0.4",
13
+ "exportName": "RuleSetting",
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
+ "supports": {
55
+ "style": true,
56
+ },
57
+ "component": {}
58
+ }
59
+ };
60
+ const snippets: Snippet[] = [
61
+ {
62
+ "title": "RuleSetting",
63
+ "screenshot": "",
64
+ "schema": {
65
+ "componentName": "RuleSetting",
66
+ "props": {}
67
+ }
68
+ }
69
+ ];
70
+
71
+ export default {
72
+ ...RuleSettingMeta,
73
+ snippets
74
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/private-materials",
3
- "version": "3.0.55",
3
+ "version": "3.0.57",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -58,8 +58,8 @@
58
58
  "ahooks": "^3.7.6",
59
59
  "react-infinite-scroll-component": "^6.1.0",
60
60
  "rc-virtual-list": "^3.11.3",
61
- "@pisell/icon": "0.0.8",
62
61
  "@pisell/utils": "1.0.24",
62
+ "@pisell/icon": "0.0.8",
63
63
  "@pisell/date-picker": "1.0.69"
64
64
  },
65
65
  "peerDependencies": {