@tachybase/client 1.3.10 → 1.3.12

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.
@@ -117,14 +117,14 @@ function useCollectValuesToSubmit() {
117
117
  await Promise.all(waitList);
118
118
  const addChild = null == fieldSchema ? void 0 : null == (_fieldSchema_xcomponentprops = fieldSchema['x-component-props']) ? void 0 : _fieldSchema_xcomponentprops.addChild;
119
119
  if (addChild) {
120
- var _currentRecord___parent;
120
+ var _treeParentField_collection_model_rawAttributes_treeParentField_foreignKey, _currentRecord___parent;
121
121
  const treeParentField = getTreeParentField();
122
122
  var _treeParentField_name;
123
123
  values[null != (_treeParentField_name = null == treeParentField ? void 0 : treeParentField.name) ? _treeParentField_name : 'parent'] = omit(null == currentRecord ? void 0 : currentRecord.__parent, [
124
124
  'children'
125
125
  ]);
126
- var _treeParentField_foreignKey;
127
- values[null != (_treeParentField_foreignKey = null == treeParentField ? void 0 : treeParentField.foreignKey) ? _treeParentField_foreignKey : 'parentId'] = null == currentRecord ? void 0 : null == (_currentRecord___parent = currentRecord.__parent) ? void 0 : _currentRecord___parent.id;
126
+ var _treeParentField_collection_model_rawAttributes_treeParentField_foreignKey_field;
127
+ values[null != (_treeParentField_collection_model_rawAttributes_treeParentField_foreignKey_field = null == treeParentField ? void 0 : null == (_treeParentField_collection_model_rawAttributes_treeParentField_foreignKey = treeParentField.collection.model.rawAttributes[null == treeParentField ? void 0 : treeParentField.foreignKey]) ? void 0 : _treeParentField_collection_model_rawAttributes_treeParentField_foreignKey.field) ? _treeParentField_collection_model_rawAttributes_treeParentField_foreignKey_field : 'parentId'] = null == currentRecord ? void 0 : null == (_currentRecord___parent = currentRecord.__parent) ? void 0 : _currentRecord___parent.id;
128
128
  }
129
129
  return {
130
130
  ...values,
@@ -349,11 +349,12 @@ const useAssociationCreateActionProps = ()=>{
349
349
  actionFields: (null == getActiveFieldsName ? void 0 : getActiveFieldsName('form')) || []
350
350
  });
351
351
  if (addChild) {
352
+ var _treeParentField_collection_model_rawAttributes_treeParentField_foreignKey;
352
353
  const treeParentField = getTreeParentField();
353
354
  var _treeParentField_name;
354
355
  values[null != (_treeParentField_name = null == treeParentField ? void 0 : treeParentField.name) ? _treeParentField_name : 'parent'] = currentRecord;
355
- var _treeParentField_foreignKey;
356
- values[null != (_treeParentField_foreignKey = null == treeParentField ? void 0 : treeParentField.foreignKey) ? _treeParentField_foreignKey : 'parentId'] = currentRecord.id;
356
+ var _treeParentField_collection_model_rawAttributes_treeParentField_foreignKey_field;
357
+ values[null != (_treeParentField_collection_model_rawAttributes_treeParentField_foreignKey_field = null == treeParentField ? void 0 : null == (_treeParentField_collection_model_rawAttributes_treeParentField_foreignKey = treeParentField.collection.model.rawAttributes[null == treeParentField ? void 0 : treeParentField.foreignKey]) ? void 0 : _treeParentField_collection_model_rawAttributes_treeParentField_foreignKey.field) ? _treeParentField_collection_model_rawAttributes_treeParentField_foreignKey_field : 'parentId'] = currentRecord.id;
357
358
  }
358
359
  actionField.data = field.data || {};
359
360
  actionField.data.loading = true;
@@ -205,6 +205,14 @@ const TableIndex = (props)=>{
205
205
  children: index
206
206
  });
207
207
  };
208
+ const pageSizeOptions = [
209
+ 5,
210
+ 10,
211
+ 20,
212
+ 50,
213
+ 100,
214
+ 200
215
+ ];
208
216
  const usePaginationProps = (pagination1, pagination2)=>{
209
217
  const { t } = useTranslation();
210
218
  const showTotal = useCallback((total)=>t('Total {{count}} items', {
@@ -217,10 +225,11 @@ const usePaginationProps = (pagination1, pagination2)=>{
217
225
  const result = {
218
226
  showTotal,
219
227
  showSizeChanger: true,
228
+ pageSizeOptions,
220
229
  ...pagination1,
221
230
  ...pagination2
222
231
  };
223
- return result.total <= result.pageSize ? false : result;
232
+ return result.total ? result : false;
224
233
  };
225
234
  const Table_Table = withDynamicSchemaProps(observer((props)=>{
226
235
  var _schema_parent, _field_data, _field_value_slice_filter, _field_value_slice, _field_value_slice1, _field_value, _fieldSchema_parent_xdecoratorprops, _fieldSchema_parent;
@@ -430,14 +430,14 @@ var __webpack_exports__ = {};
430
430
  await Promise.all(waitList);
431
431
  const addChild = null == fieldSchema ? void 0 : null == (_fieldSchema_xcomponentprops = fieldSchema['x-component-props']) ? void 0 : _fieldSchema_xcomponentprops.addChild;
432
432
  if (addChild) {
433
- var _currentRecord___parent;
433
+ var _treeParentField_collection_model_rawAttributes_treeParentField_foreignKey, _currentRecord___parent;
434
434
  const treeParentField = getTreeParentField();
435
435
  var _treeParentField_name;
436
436
  values[null != (_treeParentField_name = null == treeParentField ? void 0 : treeParentField.name) ? _treeParentField_name : 'parent'] = lodash_omit__WEBPACK_IMPORTED_MODULE_7___default()(null == currentRecord ? void 0 : currentRecord.__parent, [
437
437
  'children'
438
438
  ]);
439
- var _treeParentField_foreignKey;
440
- values[null != (_treeParentField_foreignKey = null == treeParentField ? void 0 : treeParentField.foreignKey) ? _treeParentField_foreignKey : 'parentId'] = null == currentRecord ? void 0 : null == (_currentRecord___parent = currentRecord.__parent) ? void 0 : _currentRecord___parent.id;
439
+ var _treeParentField_collection_model_rawAttributes_treeParentField_foreignKey_field;
440
+ values[null != (_treeParentField_collection_model_rawAttributes_treeParentField_foreignKey_field = null == treeParentField ? void 0 : null == (_treeParentField_collection_model_rawAttributes_treeParentField_foreignKey = treeParentField.collection.model.rawAttributes[null == treeParentField ? void 0 : treeParentField.foreignKey]) ? void 0 : _treeParentField_collection_model_rawAttributes_treeParentField_foreignKey.field) ? _treeParentField_collection_model_rawAttributes_treeParentField_foreignKey_field : 'parentId'] = null == currentRecord ? void 0 : null == (_currentRecord___parent = currentRecord.__parent) ? void 0 : _currentRecord___parent.id;
441
441
  }
442
442
  return {
443
443
  ...values,
@@ -662,11 +662,12 @@ var __webpack_exports__ = {};
662
662
  actionFields: (null == getActiveFieldsName ? void 0 : getActiveFieldsName('form')) || []
663
663
  });
664
664
  if (addChild) {
665
+ var _treeParentField_collection_model_rawAttributes_treeParentField_foreignKey;
665
666
  const treeParentField = getTreeParentField();
666
667
  var _treeParentField_name;
667
668
  values[null != (_treeParentField_name = null == treeParentField ? void 0 : treeParentField.name) ? _treeParentField_name : 'parent'] = currentRecord;
668
- var _treeParentField_foreignKey;
669
- values[null != (_treeParentField_foreignKey = null == treeParentField ? void 0 : treeParentField.foreignKey) ? _treeParentField_foreignKey : 'parentId'] = currentRecord.id;
669
+ var _treeParentField_collection_model_rawAttributes_treeParentField_foreignKey_field;
670
+ values[null != (_treeParentField_collection_model_rawAttributes_treeParentField_foreignKey_field = null == treeParentField ? void 0 : null == (_treeParentField_collection_model_rawAttributes_treeParentField_foreignKey = treeParentField.collection.model.rawAttributes[null == treeParentField ? void 0 : treeParentField.foreignKey]) ? void 0 : _treeParentField_collection_model_rawAttributes_treeParentField_foreignKey.field) ? _treeParentField_collection_model_rawAttributes_treeParentField_foreignKey_field : 'parentId'] = currentRecord.id;
670
671
  }
671
672
  actionField.data = field.data || {};
672
673
  actionField.data.loading = true;
@@ -27,6 +27,7 @@ module.exports = {
27
27
  "Add condition": "Add condition",
28
28
  "Add condition group": "Add condition group",
29
29
  "Add exportable field": "Add exportable field",
30
+ "Add failed": "Add failed",
30
31
  "Add field": "Add field",
31
32
  "Add filter": "Add filter",
32
33
  "Add filter group": "Add filter group",
@@ -43,6 +44,7 @@ module.exports = {
43
44
  "Add record": "Add record",
44
45
  "Add role": "Add role",
45
46
  "Add sort field": "Add sort field",
47
+ "Add success": "Add success",
46
48
  "Add tab": "Add tab",
47
49
  "Add text": "Add text",
48
50
  "Add type": "Add type",
@@ -592,6 +594,7 @@ module.exports = {
592
594
  "Please enter search content": "Please enter search content",
593
595
  "Please fill in the iframe URL": "Please fill in the iframe URL",
594
596
  "Please select": "Please select",
597
+ "Please select content": "Please select content",
595
598
  "Please select the records to be updated": "Please select the records to be updated",
596
599
  "Please use a valid SELECT or WITH AS statement": "Please use a valid SELECT or WITH AS statement",
597
600
  "Plugin Zip File": "Plugin Zip File",
@@ -31,6 +31,7 @@ module.exports = {
31
31
  "Add condition group": "\u6DFB\u52A0\u6761\u4EF6\u5206\u7EC4",
32
32
  "Add custom field": "\u6DFB\u52A0\u81EA\u5B9A\u4E49\u5B57\u6BB5",
33
33
  "Add exportable field": "\u6DFB\u52A0\u53EF\u5BFC\u51FA\u5B57\u6BB5",
34
+ "Add failed": "\u6DFB\u52A0\u5931\u8D25",
34
35
  "Add field": "\u6DFB\u52A0\u5B57\u6BB5",
35
36
  "Add filter": "\u6DFB\u52A0\u7B5B\u9009\u6761\u4EF6",
36
37
  "Add filter group": "\u6DFB\u52A0\u7B5B\u9009\u5206\u7EC4",
@@ -48,6 +49,7 @@ module.exports = {
48
49
  "Add role": "\u6DFB\u52A0\u89D2\u8272",
49
50
  "Add sort field": "\u6DFB\u52A0\u6392\u5E8F\u5B57\u6BB5",
50
51
  "Add submenu": "\u6DFB\u52A0\u5B50\u83DC\u5355",
52
+ "Add success": "\u6DFB\u52A0\u6210\u529F",
51
53
  "Add tab": "\u6DFB\u52A0\u6807\u7B7E\u9875",
52
54
  "Add template": "\u6DFB\u52A0\u6A21\u677F",
53
55
  "Add text": "\u6DFB\u52A0\u6587\u672C",
@@ -700,6 +702,7 @@ module.exports = {
700
702
  "Please enter search content": "\u8BF7\u8F93\u5165\u67E5\u8BE2\u5185\u5BB9",
701
703
  "Please fill in the iframe URL": "\u8BF7\u586B\u5199\u5D4C\u5165\u7684\u5730\u5740",
702
704
  "Please select": "\u8BF7\u9009\u62E9",
705
+ "Please select content": "\u8BF7\u9009\u62E9\u5185\u5BB9",
703
706
  "Please select the records to be updated": "\u8BF7\u9009\u62E9\u8981\u66F4\u65B0\u7684\u8BB0\u5F55",
704
707
  "Please use a valid SELECT or WITH AS statement": "\u8BF7\u4F7F\u7528\u6709\u6548\u7684 SELECT \u6216 WITH AS \u8BED\u53E5",
705
708
  "Plugin Management": "\u63D2\u4EF6\u7BA1\u7406\u5668",
@@ -245,6 +245,14 @@ const TableIndex = (props)=>{
245
245
  children: index
246
246
  });
247
247
  };
248
+ const pageSizeOptions = [
249
+ 5,
250
+ 10,
251
+ 20,
252
+ 50,
253
+ 100,
254
+ 200
255
+ ];
248
256
  const usePaginationProps = (pagination1, pagination2)=>{
249
257
  const { t } = (0, external_react_i18next_namespaceObject.useTranslation)();
250
258
  const showTotal = (0, external_react_namespaceObject.useCallback)((total)=>t('Total {{count}} items', {
@@ -257,10 +265,11 @@ const usePaginationProps = (pagination1, pagination2)=>{
257
265
  const result = {
258
266
  showTotal,
259
267
  showSizeChanger: true,
268
+ pageSizeOptions,
260
269
  ...pagination1,
261
270
  ...pagination2
262
271
  };
263
- return result.total <= result.pageSize ? false : result;
272
+ return result.total ? result : false;
264
273
  };
265
274
  const Table = (0, withDynamicSchemaProps_js_namespaceObject.withDynamicSchemaProps)((0, schema_namespaceObject.observer)((props)=>{
266
275
  var _schema_parent, _field_data, _field_value_slice_filter, _field_value_slice, _field_value_slice1, _field_value, _fieldSchema_parent_xdecoratorprops, _fieldSchema_parent;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tachybase/client",
3
- "version": "1.3.10",
3
+ "version": "1.3.12",
4
4
  "license": "Apache-2.0",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.mjs",
@@ -50,7 +50,7 @@
50
50
  "react-drag-listview": "^0.1.9",
51
51
  "react-error-boundary": "^4.1.2",
52
52
  "react-helmet": "^6.1.0",
53
- "react-hotkeys-hook": "^3.4.7",
53
+ "react-hotkeys-hook": "^5.1.0",
54
54
  "react-i18next": "^15.2.0",
55
55
  "react-iframe": "~1.8.5",
56
56
  "react-intersection-observer": "^9.14.0",
@@ -66,12 +66,12 @@
66
66
  "sanitize-html": "2.14.0",
67
67
  "use-deep-compare-effect": "^1.8.1",
68
68
  "xlsx": "0.18.5",
69
- "@tachybase/components": "1.3.10",
70
- "@tachybase/requirejs": "1.3.10",
71
- "@tachybase/evaluators": "1.3.10",
72
- "@tachybase/schema": "1.3.10",
73
- "@tachybase/sdk": "1.3.10",
74
- "@tachybase/utils": "1.3.10"
69
+ "@tachybase/components": "1.3.12",
70
+ "@tachybase/schema": "1.3.12",
71
+ "@tachybase/sdk": "1.3.12",
72
+ "@tachybase/evaluators": "1.3.12",
73
+ "@tachybase/requirejs": "1.3.12",
74
+ "@tachybase/utils": "1.3.12"
75
75
  },
76
76
  "devDependencies": {
77
77
  "@testing-library/react": "^16.2.0",