@tachybase/client 0.23.58 → 1.0.18

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 (147) hide show
  1. package/es/api-client/APIClient.d.ts +5 -2
  2. package/es/api-client/APIClient.mjs +93 -49
  3. package/es/api-client/hooks/useRequest.d.ts +2 -0
  4. package/es/application/Application.d.ts +3 -0
  5. package/es/application/Application.mjs +11 -0
  6. package/es/application/CustomRouterContextProvider.d.ts +54 -0
  7. package/es/application/CustomRouterContextProvider.mjs +209 -0
  8. package/es/application/NoticesManager.d.ts +12 -3
  9. package/es/application/NoticesManager.mjs +27 -3
  10. package/es/application/RouterManager.d.ts +8 -3
  11. package/es/application/RouterManager.mjs +48 -15
  12. package/es/application/schema-initializer/context/index.d.ts +1 -1
  13. package/es/block-provider/hooks/index.d.ts +2 -0
  14. package/es/block-provider/hooks/index.mjs +25 -21
  15. package/es/built-in/context-menu/ContextMenu.provider.mjs +6 -6
  16. package/es/built-in/context-menu/ContextMenuItemsProps.d.ts +4 -4
  17. package/es/built-in/context-menu/ContextMenuItemsProps.mjs +6 -6
  18. package/es/built-in/context-menu/index.mjs +1 -1
  19. package/es/built-in/context-menu/useContextMenu.d.ts +2 -2
  20. package/es/built-in/index.mjs +5 -0
  21. package/es/built-in/page-style/PageStyle.provider.mjs +2 -2
  22. package/es/built-in/pm/PluginManager.mjs +45 -45
  23. package/es/collection-manager/interfaces/email.d.ts +0 -1
  24. package/es/collection-manager/interfaces/input.d.ts +0 -2
  25. package/es/collection-manager/interfaces/integer.d.ts +0 -2
  26. package/es/collection-manager/interfaces/number.d.ts +0 -1
  27. package/es/collection-manager/interfaces/password.d.ts +0 -1
  28. package/es/collection-manager/interfaces/percent.d.ts +0 -1
  29. package/es/collection-manager/interfaces/phone.d.ts +0 -1
  30. package/es/collection-manager/interfaces/properties/index.d.ts +0 -2
  31. package/es/collection-manager/interfaces/properties/index.mjs +0 -2
  32. package/es/collection-manager/templates/sql.d.ts +1 -1
  33. package/es/collection-manager/templates/view.d.ts +1 -1
  34. package/es/data-source/collection-field-interface/CollectionFieldInterface.d.ts +1 -0
  35. package/es/data-source/collection-field-interface/CollectionFieldInterface.mjs +18 -0
  36. package/es/data-source/collection-field-interface/CollectionFieldInterfaceManager.d.ts +8 -1
  37. package/es/data-source/collection-field-interface/CollectionFieldInterfaceManager.mjs +20 -0
  38. package/es/data-source/commonsSettingsItem/fieldComponent.mjs +3 -1
  39. package/es/data-source/data-source/DataSource.d.ts +1 -1
  40. package/es/filter-provider/utils.mjs +6 -0
  41. package/es/i18n/i18n.mjs +7 -12
  42. package/es/modules/actions/delete/deleteActionSettings.mjs +10 -0
  43. package/es/modules/blocks/data-blocks/form/FilterItemCustomSettings.mjs +1 -1
  44. package/es/modules/blocks/data-blocks/form/fieldSettingsFormItem.mjs +9 -4
  45. package/es/modules/blocks/data-blocks/table/hooks/useTableBlockProps.mjs +2 -2
  46. package/es/modules/blocks/data-blocks/table/tableBlockSettings.mjs +4 -0
  47. package/es/modules/blocks/data-blocks/table/tableColumnSettings.mjs +44 -0
  48. package/es/modules/blocks/filter-blocks/collapse/filterCollapseItemFieldSettings.mjs +4 -0
  49. package/es/modules/blocks/filter-blocks/form/filterFormItemFieldSettings.mjs +9 -0
  50. package/es/modules/fields/component/SubTable/secondLevelSelect.d.ts +11 -0
  51. package/es/modules/fields/component/SubTable/secondLevelSelect.mjs +102 -0
  52. package/es/modules/fields/component/SubTable/subTablePopoverComponentFieldSettings.d.ts +79 -41
  53. package/es/modules/fields/component/SubTable/subTablePopoverComponentFieldSettings.mjs +103 -100
  54. package/es/powered-by/index.mjs +4 -7
  55. package/es/schema-component/antd/action/Action.Designer.mjs +38 -3
  56. package/es/schema-component/antd/action/Action.Modal.mjs +0 -1
  57. package/es/schema-component/antd/action/Action.mjs +1 -3
  58. package/es/schema-component/antd/association-field/SubTabs/InternalCollapse.mjs +2 -1
  59. package/es/schema-component/antd/checkbox/Checkbox.mjs +6 -4
  60. package/es/schema-component/antd/index.d.ts +1 -0
  61. package/es/schema-component/antd/index.mjs +1 -0
  62. package/es/schema-component/antd/media-card/MediaCard.d.ts +11 -0
  63. package/es/schema-component/antd/media-card/MediaCard.mjs +35 -0
  64. package/es/schema-component/antd/media-card/index.d.ts +1 -0
  65. package/es/schema-component/antd/media-card/index.mjs +1 -0
  66. package/es/schema-component/antd/media-card/style.d.ts +3 -0
  67. package/es/schema-component/antd/media-card/style.mjs +25 -0
  68. package/es/schema-component/antd/page/Page.mjs +34 -24
  69. package/es/schema-component/antd/password/utils.d.ts +1 -1
  70. package/es/schema-component/common/dnd-context/index.mjs +1 -7
  71. package/es/schema-component/common/sortable-item/DragHandlePageTab.d.ts +1 -0
  72. package/es/schema-component/common/sortable-item/DragHandlePageTab.mjs +71 -0
  73. package/es/schema-component/common/sortable-item/DragHandlePageTab.style.d.ts +3 -0
  74. package/es/schema-component/common/sortable-item/DragHandlePageTab.style.mjs +25 -0
  75. package/es/schema-items/GeneralSettings.mjs +5 -0
  76. package/es/schema-settings/EditCustomDefaultValue.mjs +1 -1
  77. package/es/schema-settings/SchemaSettings.mjs +1 -1
  78. package/es/schema-settings/SchemaSettingsDefaultValue.mjs +2 -0
  79. package/es/schema-settings/utils/createModalSettingsItem.d.ts +26 -0
  80. package/es/schema-settings/utils/createModalSettingsItem.mjs +46 -0
  81. package/es/schema-settings/utils/createSelectSettingsItem.d.ts +25 -0
  82. package/es/schema-settings/utils/createSelectSettingsItem.mjs +40 -0
  83. package/es/schema-settings/utils/createSwitchSettingsItem.d.ts +21 -0
  84. package/es/schema-settings/utils/createSwitchSettingsItem.mjs +38 -0
  85. package/es/schema-settings/utils/createTextSettingsItem.d.ts +9 -0
  86. package/es/schema-settings/utils/createTextSettingsItem.mjs +21 -0
  87. package/es/schema-settings/utils/index.d.ts +4 -0
  88. package/es/schema-settings/utils/index.mjs +4 -0
  89. package/es/schema-settings/utils/util.d.ts +12 -0
  90. package/es/schema-settings/utils/util.mjs +24 -0
  91. package/es/user/CurrentUserProvider.mjs +6 -3
  92. package/lib/api-client/APIClient.js +93 -49
  93. package/lib/application/Application.js +11 -0
  94. package/lib/application/CustomRouterContextProvider.js +276 -0
  95. package/lib/application/NoticesManager.js +27 -3
  96. package/lib/application/RouterManager.js +49 -15
  97. package/lib/block-provider/hooks/index.js +76 -58
  98. package/lib/built-in/context-menu/ContextMenu.provider.js +6 -6
  99. package/lib/built-in/context-menu/ContextMenuItemsProps.js +6 -6
  100. package/lib/built-in/context-menu/index.js +1 -1
  101. package/lib/built-in/index.js +5 -0
  102. package/lib/built-in/page-style/PageStyle.provider.js +2 -2
  103. package/lib/built-in/pm/PluginManager.js +45 -45
  104. package/lib/collection-manager/interfaces/properties/index.js +0 -2
  105. package/lib/data-source/collection-field-interface/CollectionFieldInterface.js +18 -0
  106. package/lib/data-source/collection-field-interface/CollectionFieldInterfaceManager.js +20 -0
  107. package/lib/data-source/commonsSettingsItem/fieldComponent.js +3 -1
  108. package/lib/filter-provider/utils.js +6 -0
  109. package/lib/i18n/i18n.js +7 -12
  110. package/lib/locale/en_US.js +4 -0
  111. package/lib/locale/zh-CN.js +13 -1
  112. package/lib/modules/actions/delete/deleteActionSettings.js +10 -0
  113. package/lib/modules/blocks/data-blocks/form/FilterItemCustomSettings.js +1 -1
  114. package/lib/modules/blocks/data-blocks/form/fieldSettingsFormItem.js +9 -4
  115. package/lib/modules/blocks/data-blocks/table/hooks/useTableBlockProps.js +2 -2
  116. package/lib/modules/blocks/data-blocks/table/tableBlockSettings.js +4 -0
  117. package/lib/modules/blocks/data-blocks/table/tableColumnSettings.js +44 -0
  118. package/lib/modules/blocks/filter-blocks/collapse/filterCollapseItemFieldSettings.js +4 -0
  119. package/lib/modules/blocks/filter-blocks/form/filterFormItemFieldSettings.js +9 -0
  120. package/lib/modules/fields/component/SubTable/secondLevelSelect.js +136 -0
  121. package/lib/modules/fields/component/SubTable/subTablePopoverComponentFieldSettings.js +104 -103
  122. package/lib/powered-by/index.js +4 -7
  123. package/lib/schema-component/antd/action/Action.Designer.js +38 -3
  124. package/lib/schema-component/antd/action/Action.Modal.js +0 -1
  125. package/lib/schema-component/antd/action/Action.js +1 -3
  126. package/lib/schema-component/antd/association-field/SubTabs/InternalCollapse.js +2 -1
  127. package/lib/schema-component/antd/checkbox/Checkbox.js +6 -4
  128. package/lib/schema-component/antd/index.js +18 -4
  129. package/lib/schema-component/antd/media-card/MediaCard.js +69 -0
  130. package/lib/schema-component/antd/media-card/index.js +65 -0
  131. package/lib/schema-component/antd/media-card/style.js +59 -0
  132. package/lib/schema-component/antd/page/Page.js +34 -24
  133. package/lib/schema-component/common/dnd-context/index.js +1 -7
  134. package/lib/schema-component/common/sortable-item/DragHandlePageTab.js +105 -0
  135. package/lib/schema-component/common/sortable-item/DragHandlePageTab.style.js +59 -0
  136. package/lib/schema-items/GeneralSettings.js +5 -0
  137. package/lib/schema-settings/EditCustomDefaultValue.js +1 -1
  138. package/lib/schema-settings/SchemaSettings.js +1 -1
  139. package/lib/schema-settings/SchemaSettingsDefaultValue.js +2 -0
  140. package/lib/schema-settings/utils/createModalSettingsItem.js +94 -0
  141. package/lib/schema-settings/utils/createSelectSettingsItem.js +88 -0
  142. package/lib/schema-settings/utils/createSwitchSettingsItem.js +86 -0
  143. package/lib/schema-settings/utils/createTextSettingsItem.js +55 -0
  144. package/lib/schema-settings/utils/index.js +92 -0
  145. package/lib/schema-settings/utils/util.js +74 -0
  146. package/lib/user/CurrentUserProvider.js +6 -3
  147. package/package.json +7 -7
@@ -1,3 +1,4 @@
1
+ import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react";
1
2
  import * as __WEBPACK_EXTERNAL_MODULE__tachybase_components__ from "@tachybase/components";
2
3
  import * as __WEBPACK_EXTERNAL_MODULE__tachybase_schema__ from "@tachybase/schema";
3
4
  import * as __WEBPACK_EXTERNAL_MODULE_react_i18next__ from "react-i18next";
@@ -8,6 +9,7 @@ import * as __WEBPACK_EXTERNAL_MODULE__data_source_index_mjs__ from "../../../..
8
9
  import * as __WEBPACK_EXTERNAL_MODULE__schema_component_index_mjs__ from "../../../../schema-component/index.mjs";
9
10
  import * as __WEBPACK_EXTERNAL_MODULE__schema_component_antd_association_field_util_mjs__ from "../../../../schema-component/antd/association-field/util.mjs";
10
11
  import * as __WEBPACK_EXTERNAL_MODULE__schema_component_antd_form_item_index_mjs__ from "../../../../schema-component/antd/form-item/index.mjs";
12
+ import * as __WEBPACK_EXTERNAL_MODULE__secondLevelSelect_mjs__ from "./secondLevelSelect.mjs";
11
13
  const fieldComponent = {
12
14
  name: 'fieldComponent',
13
15
  type: 'select',
@@ -233,51 +235,24 @@ const allowAddNewData = {
233
235
  };
234
236
  }
235
237
  };
236
- const isQuickAddTabs = {
237
- name: 'isquickaddtabs',
238
- type: 'switch',
238
+ const clickToSelect = {
239
+ name: 'clicktoselect',
240
+ type: 'modal',
239
241
  useVisible () {
240
242
  const readPretty = (0, __WEBPACK_EXTERNAL_MODULE__schema_component_antd_form_item_index_mjs__.useIsFieldReadPretty)();
241
243
  const isAssociationField = (0, __WEBPACK_EXTERNAL_MODULE__schema_component_antd_form_item_index_mjs__.useIsAssociationField)();
242
244
  return !readPretty && isAssociationField;
243
245
  },
244
246
  useComponentProps () {
245
- var _fieldSchema_xcomponentprops;
247
+ var _fieldSchema_xcomponentprops_quickAddField, _fieldSchema_xcomponentprops_quickAddParentCollection, _fieldSchema_xcomponentprops, _fieldSchema_xcomponentprops1;
246
248
  const { t } = (0, __WEBPACK_EXTERNAL_MODULE_react_i18next__.useTranslation)();
247
249
  const field = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.useField)();
248
250
  const fieldSchema = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.useFieldSchema)();
249
251
  const { dn, refresh } = (0, __WEBPACK_EXTERNAL_MODULE__schema_component_index_mjs__.useDesignable)();
250
- return {
251
- title: t('Is Quick Add Tabs'),
252
- checked: (null === (_fieldSchema_xcomponentprops = fieldSchema['x-component-props']) || void 0 === _fieldSchema_xcomponentprops ? void 0 : _fieldSchema_xcomponentprops.isQuickAdd) || false,
253
- onChange (value) {
254
- const schema = {
255
- ['x-uid']: fieldSchema['x-uid']
256
- };
257
- field.componentProps['isQuickAdd'] = value;
258
- fieldSchema['x-component-props'] = fieldSchema['x-component-props'] || {};
259
- fieldSchema['x-component-props']['isQuickAdd'] = value;
260
- schema['x-component-props'] = fieldSchema['x-component-props'];
261
- dn.emit('patch', {
262
- schema
263
- });
264
- refresh();
265
- }
266
- };
267
- }
268
- };
269
- const setQuickAddTabs = {
270
- name: 'setquickaddtabs',
271
- type: 'select',
272
- useComponentProps () {
273
- const { t } = (0, __WEBPACK_EXTERNAL_MODULE_react_i18next__.useTranslation)();
274
- const field = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.useField)();
275
252
  const compile = (0, __WEBPACK_EXTERNAL_MODULE__schema_component_index_mjs__.useCompile)();
276
- const fieldSchema = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.useFieldSchema)();
277
253
  const cm = (0, __WEBPACK_EXTERNAL_MODULE__data_source_index_mjs__.useCollectionManager)();
254
+ const [firstLevelValue, setFirstLevelValue] = (0, __WEBPACK_EXTERNAL_MODULE_react__.useState)((null === (_fieldSchema_xcomponentprops_quickAddField = fieldSchema['x-component-props']['quickAddField']) || void 0 === _fieldSchema_xcomponentprops_quickAddField ? void 0 : _fieldSchema_xcomponentprops_quickAddField.value) || 'none');
278
255
  const options = cm.getCollection(fieldSchema['x-collection-field']);
279
- const defVal = fieldSchema['x-component-props']['quickAddField'] || 'none';
280
- const { dn } = (0, __WEBPACK_EXTERNAL_MODULE__schema_component_index_mjs__.useDesignable)();
281
256
  const isAddNewForm = (0, __WEBPACK_EXTERNAL_MODULE__schema_component_index_mjs__.useIsAddNewForm)();
282
257
  const fieldTabsOptions = options.fields.map((item)=>{
283
258
  if ('m2o' === item.interface || 'select' === item.interface) {
@@ -293,84 +268,117 @@ const setQuickAddTabs = {
293
268
  label: 'none',
294
269
  value: 'none'
295
270
  });
296
- return {
297
- title: t('Set Quick Add Tabs'),
298
- options: fieldTabsOptions,
299
- value: defVal,
300
- onChange (mode) {
301
- const schema = {
302
- ['x-uid']: fieldSchema['x-uid']
303
- };
304
- fieldSchema['x-component-props'] = fieldSchema['x-component-props'] || {};
305
- fieldSchema['x-component-props']['quickAddField'] = {
306
- fieldInterface: fieldTabsOptions.find((item)=>item.value === mode)['interface'] || 'none',
307
- value: mode
308
- };
309
- schema['x-component-props'] = fieldSchema['x-component-props'];
310
- field.componentProps = field.componentProps || {};
311
- field.componentProps['quickAddField'] = fieldSchema['x-component-props']['quickAddField'];
312
- if ((0, __WEBPACK_EXTERNAL_MODULE__schema_component_antd_association_field_util_mjs__.isSubMode)(fieldSchema) && isAddNewForm) {
313
- schema.default = null;
314
- fieldSchema.default = null;
315
- field.setInitialValue(null);
316
- field.setValue(null);
317
- }
318
- dn.emit('patch', {
319
- schema
320
- });
321
- dn.refresh();
322
- }
323
- };
324
- },
325
- useVisible () {
326
- const fieldSchema = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.useFieldSchema)();
327
- return fieldSchema['x-component-props']['isQuickAdd'];
328
- }
329
- };
330
- const setQuickAddParentTabs = {
331
- name: 'setquickaddparenttabs',
332
- type: 'select',
333
- useComponentProps () {
334
- var _fieldSchema_xcomponentprops, _fieldSchema_xcomponentprops_quickAddParentCollection, _fieldSchema_xcomponentprops1;
335
- const { t } = (0, __WEBPACK_EXTERNAL_MODULE_react_i18next__.useTranslation)();
336
- const field = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.useField)();
337
- const compile = (0, __WEBPACK_EXTERNAL_MODULE__schema_component_index_mjs__.useCompile)();
338
- const fieldSchema = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.useFieldSchema)();
339
- const cm = (0, __WEBPACK_EXTERNAL_MODULE__data_source_index_mjs__.useCollectionManager)();
340
- const { value: quickField } = (null === (_fieldSchema_xcomponentprops = fieldSchema['x-component-props']) || void 0 === _fieldSchema_xcomponentprops ? void 0 : _fieldSchema_xcomponentprops['quickAddField']) || {};
341
- const options = cm.getCollectionFields("".concat(fieldSchema['x-collection-field'], ".").concat(quickField));
342
- const { dn } = (0, __WEBPACK_EXTERNAL_MODULE__schema_component_index_mjs__.useDesignable)();
343
- const isAddNewForm = (0, __WEBPACK_EXTERNAL_MODULE__schema_component_index_mjs__.useIsAddNewForm)();
344
- const fieldTabsOptions = options.map((item)=>{
271
+ const Parentoptions = cm.getCollectionFields("".concat(fieldSchema['x-collection-field'], ".").concat(firstLevelValue));
272
+ const fieldParentTabsOptions = Parentoptions.map((item)=>{
345
273
  if ('m2o' === item.interface) return {
346
274
  ...item,
347
275
  label: compile(item.uiSchema.title),
348
276
  value: item.name
349
277
  };
350
278
  }).filter(Boolean);
351
- fieldTabsOptions.unshift({
279
+ fieldParentTabsOptions.unshift({
352
280
  label: t('none'),
353
281
  value: 'none'
354
282
  });
355
- const defValue = (null === (_fieldSchema_xcomponentprops1 = fieldSchema['x-component-props']) || void 0 === _fieldSchema_xcomponentprops1 ? void 0 : null === (_fieldSchema_xcomponentprops_quickAddParentCollection = _fieldSchema_xcomponentprops1['quickAddParentCollection']) || void 0 === _fieldSchema_xcomponentprops_quickAddParentCollection ? void 0 : _fieldSchema_xcomponentprops_quickAddParentCollection.value) || 'none';
283
+ const defParentVal = (null === (_fieldSchema_xcomponentprops = fieldSchema['x-component-props']) || void 0 === _fieldSchema_xcomponentprops ? void 0 : null === (_fieldSchema_xcomponentprops_quickAddParentCollection = _fieldSchema_xcomponentprops['quickAddParentCollection']) || void 0 === _fieldSchema_xcomponentprops_quickAddParentCollection ? void 0 : _fieldSchema_xcomponentprops_quickAddParentCollection.value) || 'none';
284
+ const schema = {
285
+ type: 'object',
286
+ title: t('Click to select'),
287
+ properties: {
288
+ isquickaddtabs: {
289
+ title: t('Enable quick create'),
290
+ type: 'boolean',
291
+ default: (null === (_fieldSchema_xcomponentprops1 = fieldSchema['x-component-props']) || void 0 === _fieldSchema_xcomponentprops1 ? void 0 : _fieldSchema_xcomponentprops1.isQuickAdd) || false,
292
+ 'x-decorator': 'FormItem',
293
+ 'x-component': 'Switch',
294
+ 'x-component-props': {}
295
+ },
296
+ firstLevelselection: {
297
+ title: t('Set Quick Add Tabs'),
298
+ default: firstLevelValue,
299
+ 'x-decorator': 'FormItem',
300
+ 'x-component': 'Select',
301
+ enum: fieldTabsOptions,
302
+ 'x-reactions': [
303
+ {
304
+ dependencies: [
305
+ 'isquickaddtabs'
306
+ ],
307
+ fulfill: {
308
+ state: {
309
+ visible: '{{$deps[0] === true}}'
310
+ }
311
+ }
312
+ }
313
+ ],
314
+ 'x-component-props': {
315
+ onChange (value) {
316
+ setFirstLevelValue(value);
317
+ }
318
+ }
319
+ },
320
+ secondLevelselection: {
321
+ title: t('Set Quick Add Parent Tabs'),
322
+ default: defParentVal,
323
+ 'x-decorator': 'FormItem',
324
+ 'x-component': 'SecondLevelSelect',
325
+ 'x-reactions': [
326
+ {
327
+ dependencies: [
328
+ 'firstLevelselection',
329
+ 'isquickaddtabs'
330
+ ],
331
+ fulfill: {
332
+ state: {
333
+ visible: '{{$deps[0] !== "none" && $deps[1] === true}}'
334
+ },
335
+ schema: {
336
+ 'x-component-props': {
337
+ firstLevelValue: '{{$deps[0]}}',
338
+ collectionField: fieldSchema['x-collection-field']
339
+ }
340
+ }
341
+ }
342
+ }
343
+ ]
344
+ }
345
+ }
346
+ };
356
347
  return {
357
- title: t('Set Quick Add Parent Tabs'),
358
- options: fieldTabsOptions,
359
- value: defValue,
360
- onChange (mode) {
348
+ components: {
349
+ Switch: __WEBPACK_EXTERNAL_MODULE__tachybase_components__.Switch,
350
+ SecondLevelSelect: __WEBPACK_EXTERNAL_MODULE__secondLevelSelect_mjs__.SecondLevelSelect
351
+ },
352
+ title: t('Quick create'),
353
+ schema,
354
+ onSubmit: async (param)=>{
355
+ let { isquickaddtabs, firstLevelselection, secondLevelselection } = param;
356
+ var _fieldTabsOptions_find;
361
357
  const schema = {
362
358
  ['x-uid']: fieldSchema['x-uid']
363
359
  };
360
+ field.componentProps['isQuickAdd'] = isquickaddtabs;
361
+ fieldSchema['x-component-props'] = fieldSchema['x-component-props'] || {};
362
+ fieldSchema['x-component-props']['isQuickAdd'] = isquickaddtabs;
363
+ schema['x-component-props'] = fieldSchema['x-component-props'];
364
+ fieldSchema['x-component-props'] = fieldSchema['x-component-props'] || {};
365
+ fieldSchema['x-component-props']['quickAddField'] = {
366
+ fieldInterface: (null === (_fieldTabsOptions_find = fieldTabsOptions.find((item)=>item.value === firstLevelselection)) || void 0 === _fieldTabsOptions_find ? void 0 : _fieldTabsOptions_find['interface']) || 'none',
367
+ value: firstLevelselection
368
+ };
369
+ schema['x-component-props'] = fieldSchema['x-component-props'];
370
+ field.componentProps = field.componentProps || {};
371
+ field.componentProps['quickAddField'] = fieldSchema['x-component-props']['quickAddField'];
364
372
  fieldSchema['x-component-props'] = fieldSchema['x-component-props'] || {};
365
373
  fieldSchema['x-component-props']['quickAddParentCollection'] = {
366
- collectionField: "".concat(fieldSchema['x-collection-field'], ".").concat(quickField, ".").concat(mode),
367
- value: mode
374
+ collectionField: "".concat(fieldSchema['x-collection-field'], ".").concat(firstLevelselection, ".").concat(secondLevelselection),
375
+ value: secondLevelselection
368
376
  };
369
377
  schema['x-component-props'] = fieldSchema['x-component-props'];
370
378
  field.componentProps = field.componentProps || {};
371
379
  field.componentProps['quickAddParentCollection'] = {
372
- collectionField: "".concat(fieldSchema['x-collection-field'], ".").concat(quickField, ".").concat(mode),
373
- value: mode
380
+ collectionField: "".concat(fieldSchema['x-collection-field'], ".").concat(firstLevelselection, ".").concat(secondLevelselection),
381
+ value: secondLevelselection
374
382
  };
375
383
  if ((0, __WEBPACK_EXTERNAL_MODULE__schema_component_antd_association_field_util_mjs__.isSubMode)(fieldSchema) && isAddNewForm) {
376
384
  schema.default = null;
@@ -379,15 +387,12 @@ const setQuickAddParentTabs = {
379
387
  field.setValue(null);
380
388
  }
381
389
  dn.emit('patch', {
382
- schema
390
+ schema: schema
383
391
  });
392
+ refresh();
384
393
  dn.refresh();
385
394
  }
386
395
  };
387
- },
388
- useVisible () {
389
- const fieldSchema = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.useFieldSchema)();
390
- return fieldSchema['x-component-props']['isQuickAdd'] && fieldSchema['x-component-props']['quickAddField'] && 'none' !== fieldSchema['x-component-props']['quickAddField'];
391
396
  }
392
397
  };
393
398
  const subTablePopoverComponentFieldSettings = new __WEBPACK_EXTERNAL_MODULE__application_schema_settings_SchemaSettings_mjs__.SchemaSettings({
@@ -397,9 +402,7 @@ const subTablePopoverComponentFieldSettings = new __WEBPACK_EXTERNAL_MODULE__app
397
402
  allowAddNewData,
398
403
  allowSelectExistingRecord,
399
404
  setDefaultSortingRules,
400
- isQuickAddTabs,
401
- setQuickAddTabs,
402
- setQuickAddParentTabs
405
+ clickToSelect
403
406
  ]
404
407
  });
405
- export { allowAddNewData, isQuickAddTabs, setDefaultSortingRules, setQuickAddParentTabs, setQuickAddTabs, subTablePopoverComponentFieldSettings };
408
+ export { allowAddNewData, clickToSelect, setDefaultSortingRules, subTablePopoverComponentFieldSettings };
@@ -1,5 +1,5 @@
1
1
  import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__ from "react/jsx-runtime";
2
- import "react";
2
+ import * as __WEBPACK_EXTERNAL_MODULE_react_i18next__ from "react-i18next";
3
3
  import * as __WEBPACK_EXTERNAL_MODULE__style_index_mjs__ from "../style/index.mjs";
4
4
  function _tagged_template_literal(strings, raw) {
5
5
  if (!raw) raw = strings.slice(0);
@@ -31,13 +31,10 @@ const PoweredBy = ()=>{
31
31
  const { styles } = useStyles();
32
32
  const date = new Date();
33
33
  const year = date.getFullYear();
34
- return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsxs)("div", {
34
+ const { t } = (0, __WEBPACK_EXTERNAL_MODULE_react_i18next__.useTranslation)();
35
+ return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("div", {
35
36
  className: styles.powerBy,
36
- children: [
37
- "\xa92023-",
38
- year,
39
- " TachyBase Team"
40
- ]
37
+ children: "\xa92023-".concat(year, " ").concat(t('TachyBase Team'))
41
38
  });
42
39
  };
43
40
  export { PoweredBy };
@@ -351,19 +351,53 @@ function WorkflowConfig() {
351
351
  const formAction = null == formBlock ? void 0 : formBlock.type;
352
352
  const buttonAction = fieldSchema['x-action'];
353
353
  const description = {
354
- submit: t('Workflow will be triggered before or after submitting succeeded based on workflow type.', {
354
+ submit: t('Workflow will be triggered before or after submitting succeeded.', {
355
355
  ns: 'workflow'
356
356
  }),
357
- 'customize:save': t('Workflow will be triggered before or after submitting succeeded based on workflow type.', {
357
+ 'customize:save': t('Workflow will be triggered before or after submitting succeeded.', {
358
358
  ns: 'workflow'
359
359
  }),
360
360
  'customize:triggerWorkflows': t('Workflow will be triggered directly once the button clicked, without data saving.', {
361
361
  ns: 'workflow'
362
362
  }),
363
- destroy: t('Workflow will be triggered before deleting succeeded.', {
363
+ destroy: t('Workflow will be triggered before or after submitting succeeded.', {
364
364
  ns: 'workflow'
365
365
  })
366
366
  }[null == fieldSchema ? void 0 : fieldSchema['x-action']];
367
+ let orderColumn = {};
368
+ if ([
369
+ 'submit',
370
+ 'customize:save',
371
+ 'destroy'
372
+ ].includes(null == fieldSchema ? void 0 : fieldSchema['x-action'])) orderColumn = {
373
+ order: {
374
+ type: 'void',
375
+ 'x-component': 'ArrayTable.Column',
376
+ 'x-component-props': {
377
+ title: t('Sequentially', {
378
+ ns: 'workflow'
379
+ })
380
+ },
381
+ properties: {
382
+ order: {
383
+ type: 'string',
384
+ 'x-decorator': 'FormItem',
385
+ 'x-component': 'Select',
386
+ default: 'after',
387
+ enum: [
388
+ {
389
+ label: t('After'),
390
+ value: 'after'
391
+ },
392
+ {
393
+ label: t('Before'),
394
+ value: 'before'
395
+ }
396
+ ]
397
+ }
398
+ }
399
+ }
400
+ };
367
401
  return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__schema_settings_SchemaSettings_mjs__.SchemaSettingsActionModalItem, {
368
402
  title: t('Bind workflows', {
369
403
  ns: 'workflow'
@@ -464,6 +498,7 @@ function WorkflowConfig() {
464
498
  }
465
499
  }
466
500
  },
501
+ ...orderColumn,
467
502
  operations: {
468
503
  type: 'void',
469
504
  'x-component': 'ArrayTable.Column',
@@ -59,7 +59,6 @@ const ActionModal = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.observer)(
59
59
  if (s['x-component'] === footerNodeName) return s;
60
60
  return buf;
61
61
  });
62
- console.log('%c Line:41 🍧 styles.container', 'font-size:18px;color:#e41a6a;background:#7f2b82', styles.container);
63
62
  return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE_antd__.Modal, {
64
63
  className: (0, __WEBPACK_EXTERNAL_MODULE_classnames__["default"])(others.className, null == modalProps ? void 0 : modalProps.className, styles.container, 'amplifier-block'),
65
64
  style: {
@@ -54,9 +54,7 @@ const Action = (0, __WEBPACK_EXTERNAL_MODULE__application_hoc_withDynamicSchemaP
54
54
  const openMode = null == fieldSchema ? void 0 : null === (_fieldSchema_xcomponentprops = fieldSchema['x-component-props']) || void 0 === _fieldSchema_xcomponentprops ? void 0 : _fieldSchema_xcomponentprops['openMode'];
55
55
  const openSize = null == fieldSchema ? void 0 : null === (_fieldSchema_xcomponentprops1 = fieldSchema['x-component-props']) || void 0 === _fieldSchema_xcomponentprops1 ? void 0 : _fieldSchema_xcomponentprops1['openSize'];
56
56
  const disabled = form.disabled || field.disabled || (null === (_field_data = field.data) || void 0 === _field_data ? void 0 : _field_data.disabled) || propsDisabled;
57
- const linkageRules = (0, __WEBPACK_EXTERNAL_MODULE_react__.useMemo)(()=>(null == fieldSchema ? void 0 : fieldSchema['x-linkage-rules']) || [], [
58
- fieldSchema
59
- ]);
57
+ const linkageRules = (null == fieldSchema ? void 0 : fieldSchema['x-linkage-rules']) || [];
60
58
  const { designable } = (0, __WEBPACK_EXTERNAL_MODULE__index_mjs__.useDesignable)();
61
59
  const tarComponent = (0, __WEBPACK_EXTERNAL_MODULE__hooks_index_mjs__.useComponent)(component) || component;
62
60
  const { modal } = __WEBPACK_EXTERNAL_MODULE_antd__.App.useApp();
@@ -158,6 +158,7 @@ const InternalTabs = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.observer)
158
158
  (0, __WEBPACK_EXTERNAL_MODULE_ahooks__.useDeepCompareEffect)(()=>{
159
159
  if (!defOptions.length) return;
160
160
  const fieldTabs = field.value;
161
+ if (!fieldTabs) return;
161
162
  if (quickAddParentField && (null == quickAddParentField ? void 0 : quickAddParentField.value) !== 'none') {
162
163
  const filterParantOptions = tabsParantFilterOptions(defOptions, fieldTabs, quickAddField);
163
164
  setDefOptions(filterParantOptions);
@@ -235,7 +236,7 @@ const InternalTabs = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.observer)
235
236
  element.style.color = '#1e1e1e';
236
237
  });
237
238
  },
238
- children: item.label
239
+ children: item.label || null
239
240
  }, item.id))
240
241
  }),
241
242
  /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("div", {
@@ -1,5 +1,5 @@
1
1
  import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__ from "react/jsx-runtime";
2
- import "react";
2
+ import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react";
3
3
  import * as __WEBPACK_EXTERNAL_MODULE__tachybase_schema__ from "@tachybase/schema";
4
4
  import * as __WEBPACK_EXTERNAL_MODULE__ant_design_icons__ from "@ant-design/icons";
5
5
  import * as __WEBPACK_EXTERNAL_MODULE_antd__ from "antd";
@@ -33,13 +33,15 @@ const InternalCheckbox = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.conne
33
33
  }), (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.mapReadPretty)(ReadPretty));
34
34
  const InternalRadioGroup = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.connect)((props)=>{
35
35
  const { t } = (0, __WEBPACK_EXTERNAL_MODULE_react_i18next__.useTranslation)();
36
- const field = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.useField)();
36
+ const [value, setValue] = (0, __WEBPACK_EXTERNAL_MODULE_react__.useState)();
37
37
  return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE_antd__.Radio.Group, {
38
38
  ...props,
39
39
  onChange: (value)=>{
40
- if ('null' !== value.target.value) props.onChange(value);
41
- else field['value'] = void 0;
40
+ if ('null' !== value.target.value) props.onChange(value.target.value);
41
+ else props.onChange(null);
42
+ setValue(value.target.value);
42
43
  },
44
+ value: props.value || value,
43
45
  options: [
44
46
  {
45
47
  label: t('?'),
@@ -57,5 +57,6 @@ export * from './tree';
57
57
  export * from './unixTimestamp';
58
58
  export * from './upload';
59
59
  export * from './variable';
60
+ export * from './media-card';
60
61
  export { PageHeader } from '@ant-design/pro-layout';
61
62
  export { CodeMirror } from '@tachybase/components';
@@ -59,6 +59,7 @@ export * from "./tree/index.mjs";
59
59
  export * from "./unixTimestamp/index.mjs";
60
60
  export * from "./upload/index.mjs";
61
61
  export * from "./variable/index.mjs";
62
+ export * from "./media-card/index.mjs";
62
63
  var __webpack_exports__CodeMirror = __WEBPACK_EXTERNAL_MODULE__tachybase_components__.CodeMirror;
63
64
  var __webpack_exports__PageHeader = __WEBPACK_EXTERNAL_MODULE__ant_design_pro_layout__.PageHeader;
64
65
  var __webpack_exports__genStyleHook = __WEBPACK_EXTERNAL_MODULE__builtins_index_mjs__.genStyleHook;
@@ -0,0 +1,11 @@
1
+ interface MediaCardProps {
2
+ color: string;
3
+ icon: string;
4
+ title: string;
5
+ layout?: 'horizontal' | 'vertical';
6
+ needHover?: boolean;
7
+ className?: string;
8
+ onClick?: () => void;
9
+ }
10
+ export declare const MediaCard: (props: MediaCardProps) => import("react/jsx-runtime").JSX.Element;
11
+ export {};
@@ -0,0 +1,35 @@
1
+ import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__ from "react/jsx-runtime";
2
+ import * as __WEBPACK_EXTERNAL_MODULE_antd_style__ from "antd-style";
3
+ import * as __WEBPACK_EXTERNAL_MODULE__icon_index_mjs__ from "../../../icon/index.mjs";
4
+ import * as __WEBPACK_EXTERNAL_MODULE__style_mjs__ from "./style.mjs";
5
+ const MediaCard = (props)=>{
6
+ const { icon, color, title, layout = 'horizontal', onClick = ()=>{}, className, needHover = true } = props;
7
+ const { styles } = (0, __WEBPACK_EXTERNAL_MODULE__style_mjs__.useStyles)();
8
+ return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsxs)("div", {
9
+ className: (0, __WEBPACK_EXTERNAL_MODULE_antd_style__.cx)(styles.mediaCardStyle, {
10
+ layout: 'vertical' === layout,
11
+ 'need-hover': needHover
12
+ }, className),
13
+ onClick: onClick,
14
+ children: [
15
+ /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("div", {
16
+ className: "icon-wrapper",
17
+ style: {
18
+ backgroundColor: null != color ? color : '#e5e5e5'
19
+ },
20
+ children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__icon_index_mjs__.Icon, {
21
+ className: "icon",
22
+ type: null != icon ? icon : 'AppstoreOutlined',
23
+ style: {
24
+ color: null != color ? color : '#e5e5e5'
25
+ }
26
+ })
27
+ }),
28
+ /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("div", {
29
+ className: "title",
30
+ children: title
31
+ })
32
+ ]
33
+ });
34
+ };
35
+ export { MediaCard };
@@ -0,0 +1 @@
1
+ export * from './MediaCard';
@@ -0,0 +1 @@
1
+ export * from "./MediaCard.mjs";
@@ -0,0 +1,3 @@
1
+ export declare const useStyles: (props?: unknown) => import("antd-style").ReturnStyles<{
2
+ mediaCardStyle: import("antd-style").SerializedStyles;
3
+ }>;
@@ -0,0 +1,25 @@
1
+ import * as __WEBPACK_EXTERNAL_MODULE_antd_style__ from "antd-style";
2
+ function _tagged_template_literal(strings, raw) {
3
+ if (!raw) raw = strings.slice(0);
4
+ return Object.freeze(Object.defineProperties(strings, {
5
+ raw: {
6
+ value: Object.freeze(raw)
7
+ }
8
+ }));
9
+ }
10
+ function _templateObject() {
11
+ const data = _tagged_template_literal([
12
+ "\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n gap: 10px;\n width: fit-content;\n padding: 10px;\n cursor: pointer;\n\n &.layout {\n flex-direction: column;\n }\n :hover {\n border-radius: 10px;\n transform: scale(1.05);\n transition: all 0.3s;\n }\n\n &.need-hover:hover {\n background-color: var(--colorPrimaryText);\n }\n\n .icon-wrapper {\n padding: 20px;\n border-radius: 40%;\n .icon {\n padding: 10px;\n border-radius: 50%;\n background-color: #ffffff;\n font-size: 20px;\n }\n }\n\n .title {\n flex: 1;\n display: inline-block;\n font-size: 16px;\n color: #2f2f2f;\n overflow: hidden;\n }\n "
13
+ ]);
14
+ _templateObject = function() {
15
+ return data;
16
+ };
17
+ return data;
18
+ }
19
+ const useStyles = (0, __WEBPACK_EXTERNAL_MODULE_antd_style__.createStyles)((param)=>{
20
+ let { css, token } = param;
21
+ return {
22
+ mediaCardStyle: css(_templateObject())
23
+ };
24
+ });
25
+ export { useStyles };