@pisell/materials 1.0.857 → 1.0.859

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 (31) 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 +144 -160
  7. package/build/lowcode/render/default/view.js +24 -34
  8. package/build/lowcode/view.js +29 -39
  9. package/es/components/dataSourceComponents/dataSourceTable/hooks/useDataSourceKey.d.ts +2 -2
  10. package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +2 -2
  11. package/es/components/dataSourceComponents/fields/Upload/utils.d.ts +1 -1
  12. package/es/components/productCard/cartSkuCard/index.js +10 -5
  13. package/es/components/table/Gallery/components/VirtualGrid/useGapSize.d.ts +2 -2
  14. package/es/components/table/Table/fields/index.d.ts +2 -2
  15. package/es/components/table/Table/fields/select/filterUtil/index.d.ts +1 -1
  16. package/es/components/table/Table/fields/treeSelect/filterUtil/index.d.ts +1 -1
  17. package/es/components/table/Table/utils.d.ts +1 -1
  18. package/es/components/virtual-keyboard/VirtualKeyInput/index.js +2 -4
  19. package/es/utils/index.d.ts +1 -1
  20. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useDataSourceKey.d.ts +2 -2
  21. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +2 -2
  22. package/lib/components/dataSourceComponents/fields/Upload/utils.d.ts +1 -1
  23. package/lib/components/productCard/cartSkuCard/index.js +22 -19
  24. package/lib/components/table/Gallery/components/VirtualGrid/useGapSize.d.ts +2 -2
  25. package/lib/components/table/Table/fields/index.d.ts +2 -2
  26. package/lib/components/table/Table/fields/select/filterUtil/index.d.ts +1 -1
  27. package/lib/components/table/Table/fields/treeSelect/filterUtil/index.d.ts +1 -1
  28. package/lib/components/table/Table/utils.d.ts +1 -1
  29. package/lib/components/virtual-keyboard/VirtualKeyInput/index.js +2 -4
  30. package/lib/utils/index.d.ts +1 -1
  31. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  declare const useDataSourceKey: () => {
2
- dataSourceKey: string | undefined;
3
- dataSourceKeyRef: import("react").MutableRefObject<string | undefined>;
2
+ dataSourceKey: string | import("../../provider/dataSource/DataSourceContext").DataSourceType | undefined;
3
+ dataSourceKeyRef: import("react").MutableRefObject<string | import("../../provider/dataSource/DataSourceContext").DataSourceType | undefined>;
4
4
  };
5
5
  export default useDataSourceKey;
@@ -17,7 +17,7 @@ interface UseTablePropsProps {
17
17
  * @returns
18
18
  */
19
19
  declare const useTableProps: (props: UseTablePropsProps) => {
20
- title: number | boolean | React.ReactFragment | JSX.Element | (() => React.ReactNode) | null | undefined;
20
+ title: string | number | boolean | React.ReactFragment | JSX.Element | (() => React.ReactNode) | null | undefined;
21
21
  pagination: {
22
22
  total: number;
23
23
  current: number;
@@ -26,7 +26,7 @@ declare const useTableProps: (props: UseTablePropsProps) => {
26
26
  showSizeChanger: boolean;
27
27
  };
28
28
  columns: import("./useColumns").Column[];
29
- subTitle: number | boolean | React.ReactFragment | JSX.Element | (() => React.ReactNode) | null | undefined;
29
+ subTitle: string | number | boolean | React.ReactFragment | JSX.Element | (() => React.ReactNode) | null | undefined;
30
30
  buttons: any[] | null;
31
31
  filter: JSX.Element | null;
32
32
  onRow: (record: any) => any;
@@ -15,4 +15,4 @@ export declare const getFileMetadataParams: (file: RcFile & {
15
15
  metadata?: MediaMetadata;
16
16
  }) => Record<string, any>;
17
17
  export declare const isValueEqual: (value: any, fileListValue: any) => boolean;
18
- export declare const getBaseTime: (size: number) => 2000 | 1000 | 4000 | 8000;
18
+ export declare const getBaseTime: (size: number) => 1000 | 2000 | 4000 | 8000;
@@ -63,7 +63,7 @@ var CartSkuCard = function CartSkuCard(props) {
63
63
  var isShowAction = dataSource.isShowAction,
64
64
  actionText = dataSource.actionText;
65
65
  var rightActions = useMemo(function () {
66
- return [{
66
+ var deleteAction = {
67
67
  key: 'delete',
68
68
  text: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Iconfont, {
69
69
  type: "pisell2-trash-01",
@@ -82,8 +82,13 @@ var CartSkuCard = function CartSkuCard(props) {
82
82
  e.stopPropagation();
83
83
  onDelete === null || onDelete === void 0 || onDelete(dataSource);
84
84
  }
85
- }];
86
- }, [dataSource, onDelete]);
85
+ };
86
+ var actions = [];
87
+ if (isShowDelete) {
88
+ actions.push(deleteAction);
89
+ }
90
+ return actions;
91
+ }, [dataSource, onDelete, isShowDelete]);
87
92
  var hideDivider = useMemo(function () {
88
93
  var bundle = dataSource.bundle,
89
94
  relation_products = dataSource.relation_products;
@@ -108,7 +113,7 @@ var CartSkuCard = function CartSkuCard(props) {
108
113
  var _dataSource$bundle, _dataSource$items;
109
114
  var image = dataSource.image,
110
115
  name = dataSource.name;
111
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
116
+ return /*#__PURE__*/React.createElement(React.Fragment, null, isShowDelete ? /*#__PURE__*/React.createElement("div", {
112
117
  className: "".concat(PREFIX, "__delete-btn"),
113
118
  onClick: function onClick(e) {
114
119
  e.preventDefault();
@@ -117,7 +122,7 @@ var CartSkuCard = function CartSkuCard(props) {
117
122
  }
118
123
  }, /*#__PURE__*/React.createElement(Iconfont, {
119
124
  type: "pisell2-trash-01"
120
- })), /*#__PURE__*/React.createElement("div", {
125
+ })) : null, /*#__PURE__*/React.createElement("div", {
121
126
  className: "".concat(PREFIX, "__content")
122
127
  }, isShowImage && image && /*#__PURE__*/React.createElement("img", {
123
128
  src: imageAli.ali(image, 64),
@@ -1,5 +1,5 @@
1
1
  declare const useGapSize: (gap: number | number[]) => {
2
- horizontal: number;
3
- vertical: number;
2
+ horizontal: any;
3
+ vertical: any;
4
4
  };
5
5
  export default useGapSize;
@@ -197,12 +197,12 @@ export declare const fieldList: ({
197
197
  field_icon: string;
198
198
  field_name: string;
199
199
  field_type: string;
200
- default_value: string;
200
+ default_value: boolean;
201
201
  } | {
202
202
  field_icon: string;
203
203
  field_name: string;
204
204
  field_type: string;
205
- default_value: boolean;
205
+ default_value: string;
206
206
  } | {
207
207
  field_icon: string;
208
208
  field_name: string;
@@ -2,4 +2,4 @@ export default function ({ value, key, item, }: {
2
2
  value: string | string[];
3
3
  key: string | string[];
4
4
  item: Record<string, any>;
5
- }): boolean;
5
+ }): any;
@@ -2,4 +2,4 @@ export default function ({ value, key, item, }: {
2
2
  value: string | string[] | Record<string, any>[];
3
3
  key: string | string[];
4
4
  item: Record<string, any>;
5
- }): boolean;
5
+ }): any;
@@ -167,7 +167,7 @@ export declare const getSettingKeyArrByMode: ({ filter, columnSetting, dataSourc
167
167
  sort?: SortType | undefined;
168
168
  mode: "" | "localStorage" | "remote";
169
169
  currentViewMode: ModeType;
170
- }) => ("filter_setting" | "column_setting" | "gallery_setting" | "view_mode" | "group_by" | "order_by")[];
170
+ }) => ("filter_setting" | "order_by" | "group_by" | "view_mode" | "column_setting" | "gallery_setting")[];
171
171
  export declare const omit: (obj: Record<string, any>, keys: string[]) => Record<string, any>;
172
172
  export declare const stringify: (obj: Record<string, any>) => string;
173
173
  export {};
@@ -62,8 +62,7 @@ var VirtualKeyInput = function VirtualKeyInput(props) {
62
62
  style: {
63
63
  backgroundColor: (style === null || style === void 0 ? void 0 : style.backgroundColor) || '#ffffff'
64
64
  }
65
- }, props.renderInput ? /*#__PURE__*/React.createElement("button", {
66
- type: "button",
65
+ }, props.renderInput ? /*#__PURE__*/React.createElement("div", {
67
66
  className: classNames('virtual-keyboard-input', {
68
67
  'virtual-keyboard-input-select': select
69
68
  }),
@@ -81,8 +80,7 @@ var VirtualKeyInput = function VirtualKeyInput(props) {
81
80
  }, props, {
82
81
  readOnly: true,
83
82
  value: previewValue
84
- })), (_ref = "".concat(value !== null && value !== void 0 ? value : "")) !== null && _ref !== void 0 && _ref.length && showDelete ? /*#__PURE__*/React.createElement("button", {
85
- type: "button",
83
+ })), (_ref = "".concat(value !== null && value !== void 0 ? value : "")) !== null && _ref !== void 0 && _ref.length && showDelete ? /*#__PURE__*/React.createElement("div", {
86
84
  className: "virtual-keyboard-input-delete",
87
85
  onClick: _onDelete
88
86
  }, /*#__PURE__*/React.createElement(Delete, {
@@ -1,4 +1,4 @@
1
1
  export declare const isBrowser: boolean;
2
- export declare const getCssNumber: (val: string | number) => string;
2
+ export declare const getCssNumber: (val: string | number) => string | number;
3
3
  export declare function uuid(): string;
4
4
  export * from './mergeWith';
@@ -1,5 +1,5 @@
1
1
  declare const useDataSourceKey: () => {
2
- dataSourceKey: string | undefined;
3
- dataSourceKeyRef: import("react").MutableRefObject<string | undefined>;
2
+ dataSourceKey: string | import("../../provider/dataSource/DataSourceContext").DataSourceType | undefined;
3
+ dataSourceKeyRef: import("react").MutableRefObject<string | import("../../provider/dataSource/DataSourceContext").DataSourceType | undefined>;
4
4
  };
5
5
  export default useDataSourceKey;
@@ -17,7 +17,7 @@ interface UseTablePropsProps {
17
17
  * @returns
18
18
  */
19
19
  declare const useTableProps: (props: UseTablePropsProps) => {
20
- title: number | boolean | React.ReactFragment | JSX.Element | (() => React.ReactNode) | null | undefined;
20
+ title: string | number | boolean | React.ReactFragment | JSX.Element | (() => React.ReactNode) | null | undefined;
21
21
  pagination: {
22
22
  total: number;
23
23
  current: number;
@@ -26,7 +26,7 @@ declare const useTableProps: (props: UseTablePropsProps) => {
26
26
  showSizeChanger: boolean;
27
27
  };
28
28
  columns: import("./useColumns").Column[];
29
- subTitle: number | boolean | React.ReactFragment | JSX.Element | (() => React.ReactNode) | null | undefined;
29
+ subTitle: string | number | boolean | React.ReactFragment | JSX.Element | (() => React.ReactNode) | null | undefined;
30
30
  buttons: any[] | null;
31
31
  filter: JSX.Element | null;
32
32
  onRow: (record: any) => any;
@@ -15,4 +15,4 @@ export declare const getFileMetadataParams: (file: RcFile & {
15
15
  metadata?: MediaMetadata;
16
16
  }) => Record<string, any>;
17
17
  export declare const isValueEqual: (value: any, fileListValue: any) => boolean;
18
- export declare const getBaseTime: (size: number) => 2000 | 1000 | 4000 | 8000;
18
+ export declare const getBaseTime: (size: number) => 1000 | 2000 | 4000 | 8000;
@@ -85,25 +85,28 @@ var CartSkuCard = (props) => {
85
85
  console.log("prodcut props", props);
86
86
  const { isShowAction, actionText } = dataSource;
87
87
  const rightActions = (0, import_react.useMemo)(() => {
88
- return [
89
- {
90
- key: "delete",
91
- text: /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
92
- import_iconfont.default,
93
- {
94
- type: "pisell2-trash-01",
95
- style: { fontSize: 20, marginRight: 4 }
96
- }
97
- ), /* @__PURE__ */ import_react.default.createElement("span", { style: { fontSize: 12 } }, "删除")),
98
- color: "danger",
99
- onClick: (e) => {
100
- e.preventDefault();
101
- e.stopPropagation();
102
- onDelete == null ? void 0 : onDelete(dataSource);
88
+ const deleteAction = {
89
+ key: "delete",
90
+ text: /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
91
+ import_iconfont.default,
92
+ {
93
+ type: "pisell2-trash-01",
94
+ style: { fontSize: 20, marginRight: 4 }
103
95
  }
96
+ ), /* @__PURE__ */ import_react.default.createElement("span", { style: { fontSize: 12 } }, "删除")),
97
+ color: "danger",
98
+ onClick: (e) => {
99
+ e.preventDefault();
100
+ e.stopPropagation();
101
+ onDelete == null ? void 0 : onDelete(dataSource);
104
102
  }
105
- ];
106
- }, [dataSource, onDelete]);
103
+ };
104
+ const actions = [];
105
+ if (isShowDelete) {
106
+ actions.push(deleteAction);
107
+ }
108
+ return actions;
109
+ }, [dataSource, onDelete, isShowDelete]);
107
110
  const hideDivider = (0, import_react.useMemo)(() => {
108
111
  const { bundle, relation_products } = dataSource;
109
112
  return (bundle == null ? void 0 : bundle.length) || (relation_products == null ? void 0 : relation_products.length);
@@ -125,7 +128,7 @@ var CartSkuCard = (props) => {
125
128
  const renderA5 = () => {
126
129
  var _a2, _b2;
127
130
  const { image, name } = dataSource;
128
- return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
131
+ return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, isShowDelete ? /* @__PURE__ */ import_react.default.createElement(
129
132
  "div",
130
133
  {
131
134
  className: `${PREFIX}__delete-btn`,
@@ -136,7 +139,7 @@ var CartSkuCard = (props) => {
136
139
  }
137
140
  },
138
141
  /* @__PURE__ */ import_react.default.createElement(import_iconfont.default, { type: "pisell2-trash-01" })
139
- ), /* @__PURE__ */ import_react.default.createElement("div", { className: `${PREFIX}__content` }, isShowImage && image && /* @__PURE__ */ import_react.default.createElement("img", { src: import_utils.image.ali(image, 64), className: `product-cover` }), /* @__PURE__ */ import_react.default.createElement("div", { className: `product-info` }, /* @__PURE__ */ import_react.default.createElement("div", { className: `product-name` }, name), /* @__PURE__ */ import_react.default.createElement(import_holders.default, { dataSource }))), /* @__PURE__ */ import_react.default.createElement(import_timeRange.default, { dataSource }), /* @__PURE__ */ import_react.default.createElement(import_resources.default, { dataSource }), /* @__PURE__ */ import_react.default.createElement(import_packages.default, { dataSource, isShowImage }), /* @__PURE__ */ import_react.default.createElement(
142
+ ) : null, /* @__PURE__ */ import_react.default.createElement("div", { className: `${PREFIX}__content` }, isShowImage && image && /* @__PURE__ */ import_react.default.createElement("img", { src: import_utils.image.ali(image, 64), className: `product-cover` }), /* @__PURE__ */ import_react.default.createElement("div", { className: `product-info` }, /* @__PURE__ */ import_react.default.createElement("div", { className: `product-name` }, name), /* @__PURE__ */ import_react.default.createElement(import_holders.default, { dataSource }))), /* @__PURE__ */ import_react.default.createElement(import_timeRange.default, { dataSource }), /* @__PURE__ */ import_react.default.createElement(import_resources.default, { dataSource }), /* @__PURE__ */ import_react.default.createElement(import_packages.default, { dataSource, isShowImage }), /* @__PURE__ */ import_react.default.createElement(
140
143
  import_sales.default,
141
144
  {
142
145
  dataSource,
@@ -1,5 +1,5 @@
1
1
  declare const useGapSize: (gap: number | number[]) => {
2
- horizontal: number;
3
- vertical: number;
2
+ horizontal: any;
3
+ vertical: any;
4
4
  };
5
5
  export default useGapSize;
@@ -197,12 +197,12 @@ export declare const fieldList: ({
197
197
  field_icon: string;
198
198
  field_name: string;
199
199
  field_type: string;
200
- default_value: string;
200
+ default_value: boolean;
201
201
  } | {
202
202
  field_icon: string;
203
203
  field_name: string;
204
204
  field_type: string;
205
- default_value: boolean;
205
+ default_value: string;
206
206
  } | {
207
207
  field_icon: string;
208
208
  field_name: string;
@@ -2,4 +2,4 @@ export default function ({ value, key, item, }: {
2
2
  value: string | string[];
3
3
  key: string | string[];
4
4
  item: Record<string, any>;
5
- }): boolean;
5
+ }): any;
@@ -2,4 +2,4 @@ export default function ({ value, key, item, }: {
2
2
  value: string | string[] | Record<string, any>[];
3
3
  key: string | string[];
4
4
  item: Record<string, any>;
5
- }): boolean;
5
+ }): any;
@@ -167,7 +167,7 @@ export declare const getSettingKeyArrByMode: ({ filter, columnSetting, dataSourc
167
167
  sort?: SortType | undefined;
168
168
  mode: "" | "localStorage" | "remote";
169
169
  currentViewMode: ModeType;
170
- }) => ("filter_setting" | "column_setting" | "gallery_setting" | "view_mode" | "group_by" | "order_by")[];
170
+ }) => ("filter_setting" | "order_by" | "group_by" | "view_mode" | "column_setting" | "gallery_setting")[];
171
171
  export declare const omit: (obj: Record<string, any>, keys: string[]) => Record<string, any>;
172
172
  export declare const stringify: (obj: Record<string, any>) => string;
173
173
  export {};
@@ -82,9 +82,8 @@ var VirtualKeyInput = (props) => {
82
82
  }
83
83
  },
84
84
  props.renderInput ? /* @__PURE__ */ import_react.default.createElement(
85
- "button",
85
+ "div",
86
86
  {
87
- type: "button",
88
87
  className: (0, import_classnames.default)("virtual-keyboard-input", {
89
88
  "virtual-keyboard-input-select": select
90
89
  }),
@@ -109,9 +108,8 @@ var VirtualKeyInput = (props) => {
109
108
  }
110
109
  ),
111
110
  ((_a = `${value ?? ""}`) == null ? void 0 : _a.length) && showDelete ? /* @__PURE__ */ import_react.default.createElement(
112
- "button",
111
+ "div",
113
112
  {
114
- type: "button",
115
113
  className: "virtual-keyboard-input-delete",
116
114
  onClick: _onDelete
117
115
  },
@@ -1,4 +1,4 @@
1
1
  export declare const isBrowser: boolean;
2
- export declare const getCssNumber: (val: string | number) => string;
2
+ export declare const getCssNumber: (val: string | number) => string | number;
3
3
  export declare function uuid(): string;
4
4
  export * from './mergeWith';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/materials",
3
- "version": "1.0.857",
3
+ "version": "1.0.859",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",