@pisell/materials 1.0.948 → 1.0.950

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 (95) 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/meta.js +1 -1
  5. package/build/lowcode/render/default/view.js +2 -2
  6. package/build/lowcode/view.js +2 -2
  7. package/es/components/dataSourceComponents/dataSourceForm/formItem.d.ts +0 -1
  8. package/es/components/dataSourceComponents/dataSourceTable/hooks/useDataSourceKey.d.ts +0 -1
  9. package/es/components/dataSourceComponents/fields/Input.Json/ReadPretty.d.ts +0 -1
  10. package/es/components/dataSourceComponents/fields/Input.Password/ReadPretty.d.ts +0 -1
  11. package/es/components/dataSourceComponents/fields/Input.Subdomain/index.d.ts +1 -1
  12. package/es/components/dataSourceComponents/fields/Upload/ReadPretty.d.ts +0 -1
  13. package/es/components/dataSourceComponents/fields/index.d.ts +8 -9
  14. package/es/components/date-picker/datePickerCpt.d.ts +0 -1
  15. package/es/components/list/index.d.ts +0 -1
  16. package/es/components/lowCodePage/index.d.ts +0 -1
  17. package/es/components/pisellDatePicker/datePickerCpt.d.ts +0 -1
  18. package/es/components/pisellInput/components/BankCard/index.d.ts +0 -1
  19. package/es/components/pisellInput/components/Copy/index.d.ts +0 -1
  20. package/es/components/pisellInput/components/SecurityCode/index.d.ts +0 -1
  21. package/es/components/pisellInput/index.d.ts +0 -1
  22. package/es/components/pisellLoading/index.d.ts +0 -1
  23. package/es/components/pisellTooltip/index.d.ts +0 -1
  24. package/es/components/productCard/components/AmountFooter/index.d.ts +0 -1
  25. package/es/components/productCard/components/Header/EditButton/index.d.ts +0 -1
  26. package/es/components/productCard/components/Note/index.d.ts +0 -1
  27. package/es/components/productCard/components/Packages/index.d.ts +0 -1
  28. package/es/components/productCard/components/Time/components/SelectHolderMultiple/index.d.ts +0 -1
  29. package/es/components/qrcode/index.d.ts +0 -1
  30. package/es/components/table/Actions/component/ExportImport/components/ExportFile/index.d.ts +0 -1
  31. package/es/components/table/Actions/component/ExportImport/components/ExportTable/function.js +7 -0
  32. package/es/components/table/Actions/component/ExportImport/components/ExportTable/index.d.ts +0 -1
  33. package/es/components/table/Actions/component/ExportImport/components/ImportLog/index.d.ts +0 -1
  34. package/es/components/table/Actions/component/ExportImport/components/ImportTable/index.d.ts +0 -1
  35. package/es/components/table/Actions/component/ExportImport/index.d.ts +7 -0
  36. package/es/components/table/Actions/component/ExportImport/index.js +55 -27
  37. package/es/components/table/Actions/component/GallerySetting/index.d.ts +0 -1
  38. package/es/components/table/Actions/component/Group/index.d.ts +0 -1
  39. package/es/components/table/Actions/component/ViewMode/index.d.ts +0 -1
  40. package/es/components/table/Gallery/components/GalleryItem/components/RenderFields/index.d.ts +0 -1
  41. package/es/components/table/Table/SelectField/index.d.ts +0 -1
  42. package/es/components/table/Table/fields/date/Show/index.d.ts +0 -1
  43. package/es/components/table/Table/fields/index.d.ts +2 -3
  44. package/es/components/table/Table/fields/link/Show/index.d.ts +0 -1
  45. package/es/components/table/Table/fields/select/index.d.ts +0 -1
  46. package/es/components/table/Table/fields/text/Show/index.d.ts +0 -1
  47. package/es/components/table/Table/fields/text/index.d.ts +0 -1
  48. package/es/components/table/Table/fields/treeSelect/index.d.ts +0 -1
  49. package/es/components/table/serve.js +8 -0
  50. package/lib/components/dataSourceComponents/dataSourceForm/formItem.d.ts +0 -1
  51. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useDataSourceKey.d.ts +0 -1
  52. package/lib/components/dataSourceComponents/fields/Input.Json/ReadPretty.d.ts +0 -1
  53. package/lib/components/dataSourceComponents/fields/Input.Password/ReadPretty.d.ts +0 -1
  54. package/lib/components/dataSourceComponents/fields/Input.Subdomain/index.d.ts +1 -1
  55. package/lib/components/dataSourceComponents/fields/Upload/ReadPretty.d.ts +0 -1
  56. package/lib/components/dataSourceComponents/fields/index.d.ts +8 -9
  57. package/lib/components/date-picker/datePickerCpt.d.ts +0 -1
  58. package/lib/components/list/index.d.ts +0 -1
  59. package/lib/components/lowCodePage/index.d.ts +0 -1
  60. package/lib/components/pisellDatePicker/datePickerCpt.d.ts +0 -1
  61. package/lib/components/pisellInput/components/BankCard/index.d.ts +0 -1
  62. package/lib/components/pisellInput/components/Copy/index.d.ts +0 -1
  63. package/lib/components/pisellInput/components/SecurityCode/index.d.ts +0 -1
  64. package/lib/components/pisellInput/index.d.ts +0 -1
  65. package/lib/components/pisellLoading/index.d.ts +0 -1
  66. package/lib/components/pisellTooltip/index.d.ts +0 -1
  67. package/lib/components/productCard/components/AmountFooter/index.d.ts +0 -1
  68. package/lib/components/productCard/components/Header/EditButton/index.d.ts +0 -1
  69. package/lib/components/productCard/components/Note/index.d.ts +0 -1
  70. package/lib/components/productCard/components/Packages/index.d.ts +0 -1
  71. package/lib/components/productCard/components/Time/components/SelectHolderMultiple/index.d.ts +0 -1
  72. package/lib/components/qrcode/index.d.ts +0 -1
  73. package/lib/components/table/Actions/component/ExportImport/components/ExportFile/index.d.ts +0 -1
  74. package/lib/components/table/Actions/component/ExportImport/components/ExportTable/function.js +6 -0
  75. package/lib/components/table/Actions/component/ExportImport/components/ExportTable/index.d.ts +0 -1
  76. package/lib/components/table/Actions/component/ExportImport/components/ImportLog/index.d.ts +0 -1
  77. package/lib/components/table/Actions/component/ExportImport/components/ImportTable/index.d.ts +0 -1
  78. package/lib/components/table/Actions/component/ExportImport/index.d.ts +7 -0
  79. package/lib/components/table/Actions/component/ExportImport/index.js +37 -25
  80. package/lib/components/table/Actions/component/GallerySetting/index.d.ts +0 -1
  81. package/lib/components/table/Actions/component/Group/index.d.ts +0 -1
  82. package/lib/components/table/Actions/component/ViewMode/index.d.ts +0 -1
  83. package/lib/components/table/Gallery/components/GalleryItem/components/RenderFields/index.d.ts +0 -1
  84. package/lib/components/table/Table/SelectField/index.d.ts +0 -1
  85. package/lib/components/table/Table/fields/date/Show/index.d.ts +0 -1
  86. package/lib/components/table/Table/fields/index.d.ts +2 -3
  87. package/lib/components/table/Table/fields/link/Show/index.d.ts +0 -1
  88. package/lib/components/table/Table/fields/select/index.d.ts +0 -1
  89. package/lib/components/table/Table/fields/text/Show/index.d.ts +0 -1
  90. package/lib/components/table/Table/fields/text/index.d.ts +0 -1
  91. package/lib/components/table/Table/fields/treeSelect/index.d.ts +0 -1
  92. package/lib/components/table/serve.js +8 -0
  93. package/package.json +3 -3
  94. package/es/locales/en-US.d.ts +0 -342
  95. package/lib/locales/en-US.d.ts +0 -342
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  declare type LowCodePageProps = {
3
2
  id: number;
4
3
  };
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { PickerDateProps } from 'antd/es/date-picker/generatePicker';
3
2
  import { Dayjs } from 'dayjs';
4
3
  import './detePickerCpt.less';
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { InputProps } from 'antd';
3
2
  import { PisellContextType } from "../../../pisell-config-provider/context";
4
3
  import './index.less';
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { InputProps, ButtonProps } from 'antd';
3
2
  import { PisellContextType } from "../../../pisell-config-provider/context";
4
3
  export interface CopyProps extends InputProps {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { InputProps } from 'antd';
3
2
  import './index.less';
4
3
  import { PisellContextType } from "../../../pisell-config-provider/context";
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { InputProps } from 'antd';
3
2
  import { PisellContextType } from '../pisell-config-provider/context';
4
3
  declare const PisellInput: {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { SpinProps } from 'antd';
3
2
  import './index.less';
4
3
  declare type MaskType = {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { TooltipPropsWithTitle } from 'antd/es/tooltip';
3
2
  import { PisellContextType } from "../pisell-config-provider/context";
4
3
  import './index.less';
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const Footer: ({ item, hideDivider, type, isOnlyTotal }: any) => JSX.Element;
4
3
  export default Footer;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const EditButton: ({ onEdit }: any) => JSX.Element;
4
3
  export default EditButton;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const Note: (props: any) => JSX.Element | null;
4
3
  export default Note;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const Packages: ({ item, isShowPackageNote }: any) => JSX.Element | null;
4
3
  export default Packages;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  declare const SelectHolderMultiple: ({ lists, value, onChange, holderMode, isShowAddHolderButton, onAddHolder, addHolderButtonText, onClearHolder, isErrorHolder, allowClear, holderMaxCount, }: any) => JSX.Element;
3
2
  export default SelectHolderMultiple;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  declare const QRCode: (props: any) => JSX.Element;
3
2
  export default QRCode;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { ExportImportType } from '../../../../../types';
3
2
  import './index.less';
4
3
  declare const ExportFile: (props: {
@@ -27,6 +27,11 @@ var import_locales = require("../../../../../../../locales/index");
27
27
  var import_serve = require("../../../../../serve");
28
28
  var import_status = require("../../../../../status");
29
29
  var import_file = require("../../utils/file");
30
+ var exportImportTypeMap = {
31
+ "current-page": "page",
32
+ "all-records": "all",
33
+ "selected-records": "select"
34
+ };
30
35
  var _batchExport = async (params) => {
31
36
  let { status } = await (0, import_serve.exportData)(params);
32
37
  if (status) {
@@ -72,6 +77,7 @@ var batchExport = (exportParams, exportImport) => {
72
77
  params == null ? true : delete params.payment_status;
73
78
  params == null ? true : delete params.status;
74
79
  }
80
+ params.export_select = exportImportTypeMap[type];
75
81
  return _batchExport(params);
76
82
  };
77
83
  // Annotate the CommonJS export names for ESM import in node:
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { ExportImportType } from "../../../../../types";
3
2
  import "./index.less";
4
3
  declare const ExportTable: (props: {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { ExportImportType } from '../../../../../types';
3
2
  import './index.less';
4
3
  declare const ImportLog: (props: {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { ExportImportType } from '../../../../../types';
3
2
  import './index.less';
4
3
  declare type ImportTableProps = {
@@ -0,0 +1,7 @@
1
+ import { ExportImportType } from '../../../types';
2
+ import './index.less';
3
+ declare type ExportImportProps = {
4
+ exportImport: ExportImportType;
5
+ };
6
+ declare const ExportImport: ({ exportImport }: ExportImportProps) => JSX.Element;
7
+ export default ExportImport;
@@ -63,6 +63,7 @@ var ExportImport = ({ exportImport }) => {
63
63
  const [type, setType] = (0, import_react.useState)(import_status.defaultOptions.exportType);
64
64
  const [value, setValue] = (0, import_react.useState)("");
65
65
  const [errorStatus, setErrorStatus] = (0, import_react.useState)();
66
+ const [loading, setLoading] = (0, import_react.useState)(false);
66
67
  const { state } = (0, import_hooks.useSharedState)(import_model.Context);
67
68
  const { originResultDataSource, currentDataSource } = state;
68
69
  const context = (0, import_useEngineContext.default)();
@@ -142,33 +143,43 @@ var ExportImport = ({ exportImport }) => {
142
143
  });
143
144
  const onOk = async () => {
144
145
  const { apiUrl, otherParams } = exportImport;
145
- if (value === import_status.defaultOptions.exportValue) {
146
- const _params = {
147
- type,
148
- originDataSource: originResultDataSource,
149
- currentDataSource
150
- };
151
- const result = await (0, import_function.batchExport)(_params, exportImport);
152
- if (result) {
153
- onCancel();
154
- }
155
- } else if (value === import_status.defaultOptions.importValue) {
156
- const formData = new FormData();
157
- formData.append("file", file);
158
- const formId = otherParams == null ? void 0 : otherParams.form_id;
159
- const formCode = otherParams == null ? void 0 : otherParams.code;
160
- if (formId) {
161
- formData.append("form_id", formId);
162
- }
163
- if (formCode) {
164
- formData.append("code", formCode);
165
- }
166
- formData.append("url", (apiUrl == null ? void 0 : apiUrl.export) || "");
167
- if (formData) {
168
- import_antd.message.loading({ content: "Loading...", key: value });
169
- _batchImport.run(formData);
146
+ setLoading(true);
147
+ try {
148
+ if (value === import_status.defaultOptions.exportValue) {
149
+ const _params = {
150
+ type,
151
+ originDataSource: originResultDataSource,
152
+ currentDataSource
153
+ };
154
+ const result = await (0, import_function.batchExport)(_params, exportImport);
155
+ if (result) {
156
+ onCancel();
157
+ }
158
+ } else if (value === import_status.defaultOptions.importValue) {
159
+ const formData = new FormData();
160
+ formData.append("file", file);
161
+ const formId = otherParams == null ? void 0 : otherParams.form_id;
162
+ const formCode = otherParams == null ? void 0 : otherParams.code;
163
+ if (formId) {
164
+ formData.append("form_id", formId);
165
+ }
166
+ if (formCode) {
167
+ formData.append("code", formCode);
168
+ }
169
+ formData.append("url", (apiUrl == null ? void 0 : apiUrl.import) || "");
170
+ if (otherParams.import) {
171
+ Object.entries(otherParams.import).forEach(([key, value2]) => {
172
+ formData.append(key, value2);
173
+ });
174
+ }
175
+ if (formData) {
176
+ import_antd.message.loading({ content: "Loading...", key: value });
177
+ await _batchImport.run(formData);
178
+ }
170
179
  }
180
+ } catch (error) {
171
181
  }
182
+ setLoading(false);
172
183
  };
173
184
  return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
174
185
  import_antd.Dropdown,
@@ -196,6 +207,7 @@ var ExportImport = ({ exportImport }) => {
196
207
  onOk,
197
208
  cancelText: (0, import_locales.getText)("table-action-export-import-cancel"),
198
209
  okButtonProps: {
210
+ loading,
199
211
  disabled: value === import_status.defaultOptions.importValue && (!file || !!errorStatus)
200
212
  }
201
213
  },
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { GallerySettingType, ModeType } from "../../../types";
3
2
  import "./index.less";
4
3
  declare type GallerySettingProps = {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { DataSourceGroupType } from "../../../types";
3
2
  declare type GroupProps = {
4
3
  setting: DataSourceGroupType;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { GridViewType, ModeType } from "../../../types";
3
2
  declare type ViewModeProps = {
4
3
  view: GridViewType;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import "./index.less";
3
2
  declare type RenderFieldsProps = {
4
3
  fields: string[];
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  declare const SelectField: () => JSX.Element;
3
2
  export default SelectField;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { FieldPropsType } from "../../types";
3
2
  declare const Show: (props: FieldPropsType) => JSX.Element;
4
3
  export default Show;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const fieldMaps: {
3
2
  text: {
4
3
  field: {
@@ -198,12 +197,12 @@ export declare const fieldList: ({
198
197
  field_icon: string;
199
198
  field_name: string;
200
199
  field_type: string;
201
- default_value: string;
200
+ default_value: boolean;
202
201
  } | {
203
202
  field_icon: string;
204
203
  field_name: string;
205
204
  field_type: string;
206
- default_value: boolean;
205
+ default_value: string;
207
206
  } | {
208
207
  field_icon: string;
209
208
  field_name: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { FieldPropsType } from "../../types";
3
2
  declare const Show: (props: FieldPropsType) => JSX.Element;
4
3
  export default Show;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import filter from "./filterUtil";
3
2
  declare const _default: {
4
3
  field: {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { FieldPropsType } from "../../types";
3
2
  import "./index.less";
4
3
  declare const Show: (props: FieldPropsType) => JSX.Element;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import filter from "./filterUtil";
3
2
  declare const _default: {
4
3
  field: {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import filter from "./filterUtil";
3
2
  declare const _default: {
4
3
  field: {
@@ -35,6 +35,14 @@ var defaultUrl = {
35
35
  template: "/shop/form/data/download-template"
36
36
  };
37
37
  var formatApiParams = (params, type) => {
38
+ if (params instanceof FormData) {
39
+ let url = params.get("url");
40
+ params.delete("url");
41
+ return {
42
+ url: url || (defaultUrl == null ? void 0 : defaultUrl[type]),
43
+ params
44
+ };
45
+ }
38
46
  const _url = (params == null ? void 0 : params.url) || (defaultUrl == null ? void 0 : defaultUrl[type]);
39
47
  let _params = { ...params };
40
48
  delete _params.url;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/materials",
3
- "version": "1.0.948",
3
+ "version": "1.0.950",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -76,8 +76,8 @@
76
76
  "vod-js-sdk-v6": "^1.4.11",
77
77
  "react-camera-pro": "1.4.0",
78
78
  "@pisell/date-picker": "1.0.127",
79
- "@pisell/utils": "1.0.55",
80
- "@pisell/icon": "0.0.10"
79
+ "@pisell/icon": "0.0.10",
80
+ "@pisell/utils": "1.0.55"
81
81
  },
82
82
  "peerDependencies": {
83
83
  "react": "^18.0.0",