@pisell/materials 2.2.2 → 2.2.4

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 (133) 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 +2 -2
  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 +13 -13
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +12 -12
  11. package/es/components/MultipleContainersSortList/index.d.ts +5 -5
  12. package/es/components/MultipleContainersSortList/index.js +10 -10
  13. package/es/components/Pagination/index.d.ts +1 -1
  14. package/es/components/filter/components/FilterItem/index.js +5 -2
  15. package/es/components/filter/components/QuickFilter/index.js +2 -1
  16. package/es/components/filter/types.d.ts +1 -0
  17. package/es/components/sort/index.js +3 -1
  18. package/es/components/sort/index.less +3 -0
  19. package/es/components/sort/types.d.ts +1 -0
  20. package/es/components/table/Actions/component/ExportImport/components/ExportFile/index.d.ts +7 -0
  21. package/es/components/table/Actions/component/ExportImport/components/ExportFile/index.js +143 -0
  22. package/es/components/table/Actions/component/ExportImport/components/ExportFile/index.less +29 -0
  23. package/es/components/table/Actions/component/ExportImport/components/ExportTable/function.d.ts +7 -0
  24. package/es/components/table/Actions/component/ExportImport/components/ExportTable/function.js +87 -0
  25. package/es/components/table/Actions/component/ExportImport/components/ExportTable/index.d.ts +8 -0
  26. package/es/components/table/Actions/component/ExportImport/components/ExportTable/index.js +41 -0
  27. package/es/components/table/Actions/component/ExportImport/components/ExportTable/index.less +5 -0
  28. package/es/components/table/Actions/component/ExportImport/components/ImportLog/Detail.d.ts +4 -0
  29. package/es/components/table/Actions/component/ExportImport/components/ImportLog/Detail.js +97 -0
  30. package/es/components/table/Actions/component/ExportImport/components/ImportLog/index.d.ts +7 -0
  31. package/es/components/table/Actions/component/ExportImport/components/ImportLog/index.js +137 -0
  32. package/es/components/table/Actions/component/ExportImport/components/ImportLog/index.less +48 -0
  33. package/es/components/table/Actions/component/ExportImport/components/ImportTable/index.d.ts +10 -0
  34. package/es/components/table/Actions/component/ExportImport/components/ImportTable/index.js +149 -0
  35. package/es/components/table/Actions/component/ExportImport/components/ImportTable/index.less +97 -0
  36. package/es/components/table/Actions/component/ExportImport/index.d.ts +8 -0
  37. package/es/components/table/Actions/component/ExportImport/index.js +236 -0
  38. package/es/components/table/Actions/component/ExportImport/index.less +194 -0
  39. package/es/components/table/Actions/component/ExportImport/utils/date.d.ts +8 -0
  40. package/es/components/table/Actions/component/ExportImport/utils/date.js +19 -0
  41. package/es/components/table/Actions/component/ExportImport/utils/download.d.ts +3 -0
  42. package/es/components/table/Actions/component/ExportImport/utils/download.js +39 -0
  43. package/es/components/table/Actions/component/ExportImport/utils/file.d.ts +7 -0
  44. package/es/components/table/Actions/component/ExportImport/utils/file.js +21 -0
  45. package/es/components/table/Actions/component/Group/PopoverContent.d.ts +2 -2
  46. package/es/components/table/Actions/component/Group/PopoverContent.js +11 -7
  47. package/es/components/table/Actions/index.d.ts +3 -2
  48. package/es/components/table/Actions/index.js +12 -8
  49. package/es/components/table/BasicTable/index.js +11 -1
  50. package/es/components/table/Table/index.js +6 -0
  51. package/es/components/table/Table/utils.d.ts +1 -1
  52. package/es/components/table/hooks/useTableSetting.d.ts +2 -1
  53. package/es/components/table/hooks/useTableSetting.js +2 -1
  54. package/es/components/table/index.js +15 -13
  55. package/es/components/table/model.d.ts +2 -0
  56. package/es/components/table/model.js +15 -1
  57. package/es/components/table/serve.d.ts +11 -0
  58. package/es/components/table/serve.js +38 -0
  59. package/es/components/table/status.d.ts +19 -0
  60. package/es/components/table/status.js +26 -0
  61. package/es/components/table/types.d.ts +21 -0
  62. package/es/components/table/utils.d.ts +15 -0
  63. package/es/components/table/utils.js +26 -0
  64. package/es/components/virtual-keyboard/Time/index.js +1 -1
  65. package/es/locales/en-US.d.ts +46 -0
  66. package/es/locales/en-US.js +59 -1
  67. package/es/locales/zh-CN.d.ts +46 -0
  68. package/es/locales/zh-CN.js +59 -1
  69. package/es/locales/zh-TW.d.ts +46 -0
  70. package/es/locales/zh-TW.js +59 -1
  71. package/lib/components/MultipleContainersSortList/index.d.ts +5 -5
  72. package/lib/components/MultipleContainersSortList/index.js +16 -11
  73. package/lib/components/Pagination/index.d.ts +1 -1
  74. package/lib/components/filter/components/FilterItem/index.js +11 -2
  75. package/lib/components/filter/components/QuickFilter/index.js +2 -1
  76. package/lib/components/filter/types.d.ts +1 -0
  77. package/lib/components/sort/index.js +4 -9
  78. package/lib/components/sort/index.less +3 -0
  79. package/lib/components/sort/types.d.ts +1 -0
  80. package/lib/components/table/Actions/component/ExportImport/components/ExportFile/index.d.ts +7 -0
  81. package/lib/components/table/Actions/component/ExportImport/components/ExportFile/index.js +150 -0
  82. package/lib/components/table/Actions/component/ExportImport/components/ExportFile/index.less +29 -0
  83. package/lib/components/table/Actions/component/ExportImport/components/ExportTable/function.d.ts +7 -0
  84. package/lib/components/table/Actions/component/ExportImport/components/ExportTable/function.js +78 -0
  85. package/lib/components/table/Actions/component/ExportImport/components/ExportTable/index.d.ts +8 -0
  86. package/lib/components/table/Actions/component/ExportImport/components/ExportTable/index.js +60 -0
  87. package/lib/components/table/Actions/component/ExportImport/components/ExportTable/index.less +5 -0
  88. package/lib/components/table/Actions/component/ExportImport/components/ImportLog/Detail.d.ts +4 -0
  89. package/lib/components/table/Actions/component/ExportImport/components/ImportLog/Detail.js +117 -0
  90. package/lib/components/table/Actions/component/ExportImport/components/ImportLog/index.d.ts +7 -0
  91. package/lib/components/table/Actions/component/ExportImport/components/ImportLog/index.js +141 -0
  92. package/lib/components/table/Actions/component/ExportImport/components/ImportLog/index.less +48 -0
  93. package/lib/components/table/Actions/component/ExportImport/components/ImportTable/index.d.ts +10 -0
  94. package/lib/components/table/Actions/component/ExportImport/components/ImportTable/index.js +124 -0
  95. package/lib/components/table/Actions/component/ExportImport/components/ImportTable/index.less +97 -0
  96. package/lib/components/table/Actions/component/ExportImport/index.d.ts +8 -0
  97. package/lib/components/table/Actions/component/ExportImport/index.js +213 -0
  98. package/lib/components/table/Actions/component/ExportImport/index.less +194 -0
  99. package/lib/components/table/Actions/component/ExportImport/utils/date.d.ts +8 -0
  100. package/lib/components/table/Actions/component/ExportImport/utils/date.js +49 -0
  101. package/lib/components/table/Actions/component/ExportImport/utils/download.d.ts +3 -0
  102. package/lib/components/table/Actions/component/ExportImport/utils/download.js +62 -0
  103. package/lib/components/table/Actions/component/ExportImport/utils/file.d.ts +7 -0
  104. package/lib/components/table/Actions/component/ExportImport/utils/file.js +55 -0
  105. package/lib/components/table/Actions/component/Group/PopoverContent.d.ts +2 -2
  106. package/lib/components/table/Actions/component/Group/PopoverContent.js +2 -1
  107. package/lib/components/table/Actions/index.d.ts +3 -2
  108. package/lib/components/table/Actions/index.js +11 -7
  109. package/lib/components/table/BasicTable/index.js +9 -0
  110. package/lib/components/table/Table/index.js +6 -0
  111. package/lib/components/table/Table/utils.d.ts +1 -1
  112. package/lib/components/table/hooks/useTableSetting.d.ts +2 -1
  113. package/lib/components/table/hooks/useTableSetting.js +2 -1
  114. package/lib/components/table/index.js +14 -12
  115. package/lib/components/table/model.d.ts +2 -0
  116. package/lib/components/table/model.js +11 -1
  117. package/lib/components/table/serve.d.ts +11 -0
  118. package/lib/components/table/serve.js +41 -0
  119. package/lib/components/table/status.d.ts +19 -0
  120. package/lib/components/table/status.js +55 -0
  121. package/lib/components/table/types.d.ts +21 -0
  122. package/lib/components/table/utils.d.ts +15 -0
  123. package/lib/components/table/utils.js +40 -0
  124. package/lib/components/virtual-keyboard/Time/index.js +1 -1
  125. package/lib/locales/en-US.d.ts +46 -0
  126. package/lib/locales/en-US.js +51 -1
  127. package/lib/locales/zh-CN.d.ts +46 -0
  128. package/lib/locales/zh-CN.js +51 -1
  129. package/lib/locales/zh-TW.d.ts +46 -0
  130. package/lib/locales/zh-TW.js +51 -1
  131. package/lowcode/table/meta.ts +117 -1
  132. package/lowcode/table/snippets.ts +14 -0
  133. package/package.json +3 -3
@@ -0,0 +1,213 @@
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/table/Actions/component/ExportImport/index.tsx
30
+ var ExportImport_exports = {};
31
+ __export(ExportImport_exports, {
32
+ default: () => ExportImport_default
33
+ });
34
+ module.exports = __toCommonJS(ExportImport_exports);
35
+ var import_ImportExport = __toESM(require("@pisell/icon/es/ImportExport"));
36
+ var import_ahooks = require("ahooks");
37
+ var import_antd = require("antd");
38
+ var import_react = __toESM(require("react"));
39
+ var import_useEngineContext = __toESM(require("../../../../../hooks/useEngineContext"));
40
+ var import_locales = require("../../../../../locales/index");
41
+ var import_serve = require("../../../serve");
42
+ var import_status = require("../../../status");
43
+ var import_utils = require("../../../utils");
44
+ var import_ButtonIcon = __toESM(require("../ButtonIcon"));
45
+ var import_ExportFile = __toESM(require("./components/ExportFile"));
46
+ var import_ExportTable = __toESM(require("./components/ExportTable"));
47
+ var import_function = require("./components/ExportTable/function");
48
+ var import_ImportLog = __toESM(require("./components/ImportLog"));
49
+ var import_ImportTable = __toESM(require("./components/ImportTable"));
50
+ var import_hooks = require("../../../../../hooks");
51
+ var import_locale = require("../../../../../utils/locale");
52
+ var import_model = require("../../../model");
53
+ var import_index = require("./index.less");
54
+ var Com = {
55
+ import: import_ImportTable.default,
56
+ export: import_ExportTable.default,
57
+ export_file: import_ExportFile.default,
58
+ import_log: import_ImportLog.default
59
+ };
60
+ var ExportImport = ({ exportImport }) => {
61
+ var _a, _b;
62
+ const [open, setOpen] = (0, import_react.useState)(false);
63
+ const [file, setFile] = (0, import_react.useState)(null);
64
+ const [type, setType] = (0, import_react.useState)(import_status.defaultOptions.exportType);
65
+ const [value, setValue] = (0, import_react.useState)("");
66
+ const [errorStatus, setErrorStatus] = (0, import_react.useState)();
67
+ const { state } = (0, import_hooks.useSharedState)(import_model.Context);
68
+ const { originResultDataSource, currentDataSource } = state;
69
+ const context = (0, import_useEngineContext.default)();
70
+ import_utils.request.setRequest((_b = (_a = context.appHelper) == null ? void 0 : _a.utils) == null ? void 0 : _b.request);
71
+ const _items = (0, import_react.useMemo)(() => {
72
+ const result = Object.entries(import_status.exportImportOptions).map(([key, value2]) => {
73
+ return {
74
+ key,
75
+ label: value2
76
+ };
77
+ });
78
+ return result;
79
+ }, []);
80
+ const Content = (0, import_react.useMemo)(() => {
81
+ const _value = value || import_status.defaultOptions.importValue;
82
+ return Com[_value];
83
+ }, [value, import_status.defaultOptions.importValue]);
84
+ const _footer = (0, import_react.useMemo)(() => {
85
+ const types = import_status.defaultOptions.footerHintTypes;
86
+ if (types.includes(value)) {
87
+ return null;
88
+ }
89
+ }, [value]);
90
+ const _width = (0, import_react.useMemo)(() => {
91
+ const types = import_status.defaultOptions.footerHintTypes;
92
+ return types.includes(value) ? 900 : import_status.defaultOptions.importValue ? 600 : 400;
93
+ }, [value]);
94
+ const _title = (0, import_react.useMemo)(() => {
95
+ if (!value)
96
+ return null;
97
+ const types = import_status.defaultOptions.okShowButtonTypes;
98
+ const lang = (0, import_locale.getCurrentLocale)();
99
+ const isEn = lang === "en-US" || lang === "en";
100
+ if (types.includes(value) && (exportImport == null ? void 0 : exportImport.title)) {
101
+ return `${import_status.exportImportOptions[value]}${isEn ? " " : ""}${exportImport.title}`;
102
+ }
103
+ return import_status.exportImportOptions[value];
104
+ }, [value, exportImport == null ? void 0 : exportImport.title]);
105
+ const _okText = (0, import_react.useMemo)(() => {
106
+ const types = import_status.defaultOptions.okShowButtonTypes;
107
+ if (types.includes(value)) {
108
+ return value === import_status.defaultOptions.exportValue ? (0, import_locales.getText)("table-action-export-import-button") : (0, import_locales.getText)("table-action-export-import-button-import");
109
+ }
110
+ }, [value]);
111
+ const handleClick = (e) => {
112
+ const value2 = e.key;
113
+ setValue(value2);
114
+ setOpen(true);
115
+ };
116
+ const onCancel = () => {
117
+ setOpen(false);
118
+ setValue("");
119
+ setFile(null);
120
+ setErrorStatus(null);
121
+ setType(import_status.defaultOptions.exportType);
122
+ };
123
+ const _batchImport = (0, import_ahooks.useRequest)(import_serve.batchImport, {
124
+ manual: true,
125
+ debounceWait: 200,
126
+ onSuccess: () => {
127
+ setErrorStatus(null);
128
+ import_antd.message.destroy();
129
+ import_antd.message.success({
130
+ content: (0, import_locales.getText)("table-action-export-import-import-success"),
131
+ key: value
132
+ });
133
+ onCancel();
134
+ },
135
+ onError: (err) => {
136
+ import_antd.message.destroy();
137
+ setErrorStatus((err == null ? void 0 : err.message) || null);
138
+ }
139
+ });
140
+ const onOk = async () => {
141
+ const { formId, formCode } = exportImport;
142
+ if (value === import_status.defaultOptions.exportValue) {
143
+ const _params = {
144
+ type,
145
+ originDataSource: originResultDataSource,
146
+ currentDataSource
147
+ };
148
+ const result = await (0, import_function.batchExport)(_params, exportImport);
149
+ if (result) {
150
+ onCancel();
151
+ }
152
+ } else if (value === import_status.defaultOptions.importValue) {
153
+ const formData = new FormData();
154
+ formData.append("file", file);
155
+ if (formId) {
156
+ formData.append("form_id", formId);
157
+ }
158
+ if (formCode) {
159
+ formData.append("code", formCode);
160
+ }
161
+ if (formData) {
162
+ import_antd.message.loading({ content: "Loading...", key: value });
163
+ _batchImport.run(formData);
164
+ }
165
+ }
166
+ };
167
+ return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
168
+ import_antd.Dropdown,
169
+ {
170
+ menu: {
171
+ items: _items,
172
+ selectable: true,
173
+ onClick: handleClick
174
+ },
175
+ placement: "bottomRight"
176
+ },
177
+ /* @__PURE__ */ import_react.default.createElement(import_ButtonIcon.default, { isActive: false }, /* @__PURE__ */ import_react.default.createElement(import_ImportExport.default, { style: { cursor: "pointer", fontSize: 20 } }))
178
+ ), /* @__PURE__ */ import_react.default.createElement(
179
+ import_antd.Modal,
180
+ {
181
+ title: _title,
182
+ footer: _footer,
183
+ width: _width,
184
+ okText: _okText,
185
+ open,
186
+ className: "export-import-modal",
187
+ onCancel,
188
+ bodyStyle: { padding: "0px" },
189
+ destroyOnClose: true,
190
+ onOk,
191
+ cancelText: (0, import_locales.getText)("table-action-export-import-cancel"),
192
+ okButtonProps: {
193
+ disabled: value === import_status.defaultOptions.importValue && (!file || !!errorStatus)
194
+ }
195
+ },
196
+ /* @__PURE__ */ import_react.default.createElement(
197
+ Content,
198
+ {
199
+ exportImport,
200
+ errorStatus,
201
+ onChange: (e) => {
202
+ if (value === import_status.defaultOptions.importValue) {
203
+ setFile(e);
204
+ setErrorStatus(null);
205
+ } else if (value === import_status.defaultOptions.exportValue) {
206
+ setType(e);
207
+ }
208
+ }
209
+ }
210
+ )
211
+ ));
212
+ };
213
+ var ExportImport_default = ExportImport;
@@ -0,0 +1,194 @@
1
+ .export-import-modal{
2
+ .pisell-lowcode-modal-header{
3
+ padding: 0 0 6px 0!important;
4
+ }
5
+
6
+ .pisell-lowcode-table-content{
7
+ .pisell-lowcode-table-cell{
8
+ padding: 16px!important;
9
+ }
10
+ }
11
+ }
12
+
13
+ .goods-list-page {
14
+ padding: 0 30px;
15
+
16
+ .header {
17
+ display: flex;
18
+ align-items: center;
19
+ justify-content: space-between;
20
+ padding: 22px 0;
21
+ font-size: 20px;
22
+ font-weight: 650;
23
+ line-height: 28px;
24
+ color: #252a2d;
25
+
26
+ .action-list {
27
+ display: flex;
28
+ align-items: center;
29
+ min-height: 40px;
30
+
31
+ .import-btn,
32
+ .export-btn {
33
+ height: 28px;
34
+ font-size: 14px;
35
+ font-weight: 650;
36
+ line-height: 28px;
37
+ color: #252a2d;
38
+ cursor: pointer;
39
+ }
40
+ }
41
+ }
42
+
43
+ .content {
44
+ padding: 20px 0;
45
+ background: #ffffff;
46
+ border-radius: var(--small-border-radius);
47
+
48
+ .search-wrap {
49
+ width: 100%;
50
+ box-sizing: border-box;
51
+ padding: 10px 32px 0 32px;
52
+ display: flex;
53
+ align-items: center;
54
+
55
+ .search-input {
56
+ flex: 1;
57
+ margin-right: 20px;
58
+ }
59
+
60
+ &.phone-wrap {
61
+ flex-direction: column;
62
+ align-items: flex-end;
63
+
64
+ .search-input {
65
+ width: 100%;
66
+ margin-bottom: 16px;
67
+ margin-right: 0;
68
+ }
69
+ }
70
+ }
71
+
72
+ .cover-wrap {
73
+ display: flex;
74
+ align-items: center;
75
+ justify-content: center;
76
+ overflow: hidden;
77
+ width: 64px;
78
+ height: 64px;
79
+ opacity: 1;
80
+ border-radius: 2px;
81
+ margin: 0 auto;
82
+
83
+ img {
84
+ width: 100%;
85
+ }
86
+ }
87
+
88
+ .goods-status {
89
+ display: inline-block;
90
+ min-width: 58px;
91
+ border-radius: 16px;
92
+ font-size: 13px;
93
+
94
+ text-align: center;
95
+ padding: 2px 8px;
96
+
97
+ &.release {
98
+ background: #6fa629;
99
+ color: #ffffff;
100
+ }
101
+
102
+ &.pending {
103
+ background: #ec808d;
104
+ color: #fff;
105
+ }
106
+
107
+ &.archived {
108
+ background: #e4e5e7;
109
+ color: #252a2d;
110
+ }
111
+
112
+ &.draft {
113
+ background: #a4e8f2;
114
+ color: #202223;
115
+ }
116
+ }
117
+ }
118
+ }
119
+
120
+ .spin {
121
+ :global {
122
+ .ant-spin {
123
+ max-height: 10000px !important;
124
+ }
125
+ }
126
+ }
127
+
128
+ .empty-wrap {
129
+ min-height: 550px;
130
+
131
+ .empty-content {
132
+ display: flex;
133
+ align-items: center;
134
+ flex-direction: column;
135
+ height: 550px;
136
+ background: #ffffff;
137
+ border-radius: 4px;
138
+
139
+ .icon {
140
+ font-size: 170px;
141
+ margin-top: 70px;
142
+ }
143
+
144
+ .title {
145
+ margin-top: 40px;
146
+ height: 22px;
147
+ font-size: 16px;
148
+ font-weight: 650;
149
+ line-height: 28px;
150
+ color: #252a2d;
151
+ }
152
+
153
+ .describe {
154
+ margin-top: 22px;
155
+ margin-bottom: 9px;
156
+ max-width: 390px;
157
+ height: 86px;
158
+ font-size: 14px;
159
+
160
+ font-weight: 400;
161
+ line-height: 22px;
162
+ color: #707070;
163
+ }
164
+ }
165
+ }
166
+
167
+ .footer {
168
+ margin-top: 30px;
169
+ height: 17px;
170
+ font-size: 12px;
171
+
172
+ font-weight: 400;
173
+ line-height: 17px;
174
+ color: #8c8c8c;
175
+ text-align: center;
176
+ }
177
+
178
+ .phone-wrap {
179
+ padding: 0 16px;
180
+
181
+ .content {
182
+ .search-wrap {
183
+ padding: 10px 16px 0 16px;
184
+ }
185
+
186
+ .list-wrap {
187
+ padding: 16px;
188
+ }
189
+ }
190
+ }
191
+
192
+ .list-wrap {
193
+ padding: 20px 32px;
194
+ }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @Title: 格式化日期
3
+ * @Describe:
4
+ * @Author: Wzw
5
+ * @param {string} date
6
+ * @param {string} format
7
+ */
8
+ export declare const formatDate: (date: any, format?: string[]) => any;
@@ -0,0 +1,49 @@
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/table/Actions/component/ExportImport/utils/date.ts
30
+ var date_exports = {};
31
+ __export(date_exports, {
32
+ formatDate: () => formatDate
33
+ });
34
+ module.exports = __toCommonJS(date_exports);
35
+ var import_dayjs = __toESM(require("dayjs"));
36
+ var import_locale = require("../../../../../../utils/locale");
37
+ var formatDate = (date, format) => {
38
+ if (!date) {
39
+ return date;
40
+ }
41
+ const lang = (0, import_locale.getCurrentLocale)();
42
+ let _format = format || ["HH:mm:ss DD/MM/YYYY", "YYYY-MM-DD HH:mm:ss"];
43
+ let type = lang === "en-US" || lang === "en" ? _format[0] : _format[1];
44
+ return (0, import_dayjs.default)(date).format(type);
45
+ };
46
+ // Annotate the CommonJS export names for ESM import in node:
47
+ 0 && (module.exports = {
48
+ formatDate
49
+ });
@@ -0,0 +1,3 @@
1
+ export declare const windowOpen: (url: string, target?: string) => void;
2
+ declare const _default: (sUrl: string, fileName?: string) => boolean;
3
+ export default _default;
@@ -0,0 +1,62 @@
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/table/Actions/component/ExportImport/utils/download.ts
20
+ var download_exports = {};
21
+ __export(download_exports, {
22
+ default: () => download_default,
23
+ windowOpen: () => windowOpen
24
+ });
25
+ module.exports = __toCommonJS(download_exports);
26
+ var windowOpen = (url, target) => {
27
+ let oWindow = window.open("", target || "_blank");
28
+ oWindow.location = url;
29
+ };
30
+ var download_default = (sUrl, fileName) => {
31
+ let isChrome = navigator.userAgent.toLowerCase().indexOf("chrome") > -1;
32
+ let isSafari = navigator.userAgent.toLowerCase().indexOf("safari") > -1;
33
+ if (/(iP)/g.test(navigator.userAgent)) {
34
+ alert(
35
+ "Your device does not support files downloading. Please try again in desktop browser."
36
+ );
37
+ return false;
38
+ }
39
+ if (isChrome || isSafari) {
40
+ let link = document.createElement("a");
41
+ link.href = sUrl;
42
+ if (link.download !== void 0) {
43
+ let _fileName = fileName || sUrl.substring(sUrl.lastIndexOf("/") + 1, sUrl.length);
44
+ link.download = _fileName;
45
+ }
46
+ if (document.createEvent) {
47
+ let e = document.createEvent("MouseEvents");
48
+ e.initEvent("click", true, true);
49
+ link.dispatchEvent(e);
50
+ return true;
51
+ }
52
+ }
53
+ if (sUrl.indexOf("?") === -1) {
54
+ sUrl += "?download";
55
+ }
56
+ windowOpen(sUrl, "_self");
57
+ return true;
58
+ };
59
+ // Annotate the CommonJS export names for ESM import in node:
60
+ 0 && (module.exports = {
61
+ windowOpen
62
+ });
@@ -0,0 +1,7 @@
1
+ export declare const getFileDateName: () => string;
2
+ /**
3
+ * @Title: 复制内容
4
+ * @Describe:
5
+ * @Author: Wzw
6
+ */
7
+ export declare const copyText: (text: string) => void;
@@ -0,0 +1,55 @@
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/table/Actions/component/ExportImport/utils/file.ts
30
+ var file_exports = {};
31
+ __export(file_exports, {
32
+ copyText: () => copyText,
33
+ getFileDateName: () => getFileDateName
34
+ });
35
+ module.exports = __toCommonJS(file_exports);
36
+ var import_dayjs = __toESM(require("dayjs"));
37
+ var import_antd = require("antd");
38
+ var import_locales = require("../../../../../../locales/index");
39
+ var getFileDateName = () => {
40
+ return "-" + (0, import_dayjs.default)().format("YYYY-MM-DD-HH-mm-ss");
41
+ };
42
+ var copyText = (text) => {
43
+ let input = document.createElement("input");
44
+ input.setAttribute("value", text);
45
+ document.body.appendChild(input);
46
+ input.select();
47
+ document.execCommand("copy");
48
+ document.body.removeChild(input);
49
+ import_antd.message.success((0, import_locales.getText)("table-action-export-import-table-success-copy"));
50
+ };
51
+ // Annotate the CommonJS export names for ESM import in node:
52
+ 0 && (module.exports = {
53
+ copyText,
54
+ getFileDateName
55
+ });
@@ -1,5 +1,5 @@
1
- import React from "react";
2
- import "./PopoverContent.less";
1
+ import React from 'react';
2
+ import './PopoverContent.less';
3
3
  declare type FieldType = string | number;
4
4
  export declare type GroupValue = {
5
5
  field: FieldType;
@@ -53,7 +53,8 @@ var PopoverContent = (props) => {
53
53
  ]);
54
54
  };
55
55
  const options = (0, import_react.useMemo)(() => {
56
- return (columns || []).map((item) => ({
56
+ const _lists = (columns || []).filter((item) => !(item == null ? void 0 : item.isHidden));
57
+ return _lists.map((item) => ({
57
58
  label: item.label,
58
59
  value: `${item.name}`
59
60
  }));
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  import { FilterType } from "../../filter/types";
3
- import { ColumnSettingType, DataSourceGroupType, GallerySettingType, GridViewType, SortType } from "../types";
3
+ import { ColumnSettingType, DataSourceGroupType, ExportImportType, GallerySettingType, GridViewType, SortType } from "../types";
4
4
  import "./index.less";
5
5
  declare type ActionsProps = {
6
6
  filter: FilterType;
@@ -12,6 +12,7 @@ declare type ActionsProps = {
12
12
  buttons: any[];
13
13
  view: GridViewType;
14
14
  gallery: GallerySettingType;
15
+ exportImport?: ExportImportType;
15
16
  };
16
- declare const Actions: ({ filter, sort, columnSetting, dataSourceGroup, tableId, localPagination, buttons, view, gallery, }: ActionsProps) => React.JSX.Element | null;
17
+ declare const Actions: ({ filter, sort, columnSetting, dataSourceGroup, tableId, localPagination, buttons, view, gallery, exportImport, }: ActionsProps) => React.JSX.Element | null;
17
18
  export default Actions;