@nocobase/client 0.7.2-alpha.6 → 0.7.4-alpha.1

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 (149) hide show
  1. package/es/application/Application.d.ts +1 -0
  2. package/es/application/Application.js +7 -1
  3. package/es/block-provider/FormBlockProvider.js +8 -3
  4. package/es/block-provider/TableFieldProvider.d.ts +1 -0
  5. package/es/block-provider/TableFieldProvider.js +5 -2
  6. package/es/block-provider/TableSelectorProvider.js +41 -13
  7. package/es/block-provider/hooks/index.d.ts +6 -0
  8. package/es/block-provider/hooks/index.js +159 -65
  9. package/es/collection-manager/CollectionField.js +4 -2
  10. package/es/collection-manager/Configuration/index.js +5 -1
  11. package/es/collection-manager/Configuration/schemas/collections.js +2 -1
  12. package/es/collection-manager/interfaces/input.js +103 -0
  13. package/es/collection-manager/interfaces/integer.js +63 -0
  14. package/es/collection-manager/interfaces/m2m.js +2 -0
  15. package/es/collection-manager/interfaces/m2o.js +1 -0
  16. package/es/collection-manager/interfaces/markdown.js +34 -0
  17. package/es/collection-manager/interfaces/number.js +55 -0
  18. package/es/collection-manager/interfaces/o2m.js +1 -0
  19. package/es/collection-manager/interfaces/o2o.js +3 -0
  20. package/es/collection-manager/interfaces/password.js +36 -1
  21. package/es/collection-manager/interfaces/percent.js +97 -0
  22. package/es/collection-manager/interfaces/properties/index.d.ts +1 -0
  23. package/es/collection-manager/interfaces/properties/index.js +1 -0
  24. package/es/collection-manager/interfaces/properties/operators.js +4 -4
  25. package/es/collection-manager/interfaces/richText.js +34 -0
  26. package/es/collection-manager/interfaces/textarea.js +34 -0
  27. package/es/file-manager/FileStorageShortcut.js +2 -2
  28. package/es/locale/en_US.d.ts +8 -2
  29. package/es/locale/en_US.js +9 -3
  30. package/es/locale/zh_CN.d.ts +26 -2
  31. package/es/locale/zh_CN.js +27 -3
  32. package/es/plugin-manager/PluginManager.d.ts +1 -0
  33. package/es/plugin-manager/PluginManager.js +20 -6
  34. package/es/schema-component/antd/action/Action.Modal.js +1 -1
  35. package/es/schema-component/antd/calendar/Calendar.Designer.js +16 -10
  36. package/es/schema-component/antd/date-picker/DatePicker.d.ts +1 -1
  37. package/es/schema-component/antd/date-picker/DatePicker.js +1 -1
  38. package/es/schema-component/antd/date-picker/ReadPretty.js +1 -1
  39. package/es/schema-component/antd/date-picker/util.d.ts +0 -10
  40. package/es/schema-component/antd/date-picker/util.js +1 -79
  41. package/es/schema-component/antd/form-item/FormItem.js +161 -10
  42. package/es/schema-component/antd/grid/Grid.js +72 -6
  43. package/es/schema-component/antd/input-number/InputNumber.d.ts +1 -5
  44. package/es/schema-component/antd/input-number/InputNumber.js +25 -1
  45. package/es/schema-component/antd/input-number/ReadPretty.js +2 -4
  46. package/es/schema-component/antd/kanban/Kanban.Card.Designer.js +20 -14
  47. package/es/schema-component/antd/menu/Menu.js +6 -3
  48. package/es/schema-component/antd/percent/Percent.js +2 -2
  49. package/es/schema-component/antd/record-picker/InputRecordPicker.js +27 -13
  50. package/es/schema-component/antd/record-picker/ReadPrettyRecordPicker.js +5 -3
  51. package/es/schema-component/antd/table/Table.Array.js +2 -2
  52. package/es/schema-component/antd/table/Table.Void.js +11 -1
  53. package/es/schema-component/antd/table-v2/Table.Column.Designer.js +3 -1
  54. package/es/schema-component/antd/table-v2/Table.d.ts +0 -11
  55. package/es/schema-component/antd/table-v2/Table.js +163 -92
  56. package/es/schema-component/antd/table-v2/TableField.js +3 -0
  57. package/es/schema-component/antd/tabs/Tabs.Designer.js +23 -12
  58. package/es/schema-component/antd/tabs/Tabs.js +7 -1
  59. package/es/schema-component/antd/time-picker/ReadPretty.js +11 -5
  60. package/es/schema-component/core/DesignableSwitch.js +7 -1
  61. package/es/schema-component/hooks/useDesignable.js +21 -21
  62. package/es/schema-component/hooks/useProps.js +1 -1
  63. package/es/schema-initializer/buttons/FormItemInitializers.js +14 -3
  64. package/es/schema-initializer/buttons/ReadPrettyFormActionInitializers.js +8 -0
  65. package/es/schema-initializer/buttons/ReadPrettyFormItemInitializers.js +14 -3
  66. package/es/schema-initializer/buttons/RecordBlockInitializers.js +32 -3
  67. package/es/schema-initializer/buttons/TabPaneInitializers.js +11 -3
  68. package/es/schema-initializer/buttons/TableActionInitializers.js +11 -0
  69. package/es/schema-initializer/components/assigned-field/AssignedField.d.ts +4 -0
  70. package/es/schema-initializer/components/assigned-field/AssignedField.js +255 -69
  71. package/es/schema-initializer/items/index.d.ts +2 -0
  72. package/es/schema-initializer/items/index.js +48 -2
  73. package/es/schema-initializer/utils.js +22 -2
  74. package/es/system-settings/SystemSettingsShortcut.js +35 -12
  75. package/lib/application/Application.d.ts +1 -0
  76. package/lib/application/Application.js +11 -2
  77. package/lib/block-provider/FormBlockProvider.js +7 -2
  78. package/lib/block-provider/TableFieldProvider.d.ts +1 -0
  79. package/lib/block-provider/TableFieldProvider.js +4 -1
  80. package/lib/block-provider/TableSelectorProvider.js +41 -13
  81. package/lib/block-provider/hooks/index.d.ts +6 -0
  82. package/lib/block-provider/hooks/index.js +168 -67
  83. package/lib/collection-manager/CollectionField.js +5 -2
  84. package/lib/collection-manager/Configuration/index.js +5 -0
  85. package/lib/collection-manager/Configuration/schemas/collections.js +2 -1
  86. package/lib/collection-manager/interfaces/input.js +104 -0
  87. package/lib/collection-manager/interfaces/integer.js +65 -0
  88. package/lib/collection-manager/interfaces/m2m.js +2 -0
  89. package/lib/collection-manager/interfaces/m2o.js +1 -0
  90. package/lib/collection-manager/interfaces/markdown.js +35 -0
  91. package/lib/collection-manager/interfaces/number.js +56 -0
  92. package/lib/collection-manager/interfaces/o2m.js +1 -0
  93. package/lib/collection-manager/interfaces/o2o.js +3 -0
  94. package/lib/collection-manager/interfaces/password.js +37 -1
  95. package/lib/collection-manager/interfaces/percent.js +99 -0
  96. package/lib/collection-manager/interfaces/properties/index.d.ts +1 -0
  97. package/lib/collection-manager/interfaces/properties/index.js +1 -0
  98. package/lib/collection-manager/interfaces/properties/operators.js +4 -4
  99. package/lib/collection-manager/interfaces/richText.js +35 -0
  100. package/lib/collection-manager/interfaces/textarea.js +35 -0
  101. package/lib/file-manager/FileStorageShortcut.js +1 -1
  102. package/lib/locale/en_US.d.ts +8 -2
  103. package/lib/locale/en_US.js +9 -3
  104. package/lib/locale/zh_CN.d.ts +26 -2
  105. package/lib/locale/zh_CN.js +27 -3
  106. package/lib/plugin-manager/PluginManager.d.ts +1 -0
  107. package/lib/plugin-manager/PluginManager.js +23 -5
  108. package/lib/schema-component/antd/action/Action.Modal.js +1 -1
  109. package/lib/schema-component/antd/calendar/Calendar.Designer.js +16 -10
  110. package/lib/schema-component/antd/date-picker/DatePicker.d.ts +1 -1
  111. package/lib/schema-component/antd/date-picker/DatePicker.js +2 -2
  112. package/lib/schema-component/antd/date-picker/ReadPretty.js +6 -6
  113. package/lib/schema-component/antd/date-picker/util.d.ts +0 -10
  114. package/lib/schema-component/antd/date-picker/util.js +6 -89
  115. package/lib/schema-component/antd/form-item/FormItem.js +164 -12
  116. package/lib/schema-component/antd/grid/Grid.js +69 -3
  117. package/lib/schema-component/antd/input-number/InputNumber.d.ts +1 -5
  118. package/lib/schema-component/antd/input-number/InputNumber.js +28 -1
  119. package/lib/schema-component/antd/input-number/ReadPretty.js +2 -5
  120. package/lib/schema-component/antd/kanban/Kanban.Card.Designer.js +20 -14
  121. package/lib/schema-component/antd/menu/Menu.js +6 -3
  122. package/lib/schema-component/antd/percent/Percent.js +2 -2
  123. package/lib/schema-component/antd/record-picker/InputRecordPicker.js +27 -12
  124. package/lib/schema-component/antd/record-picker/ReadPrettyRecordPicker.js +4 -2
  125. package/lib/schema-component/antd/table/Table.Array.js +2 -2
  126. package/lib/schema-component/antd/table/Table.Void.js +11 -1
  127. package/lib/schema-component/antd/table-v2/Table.Column.Designer.js +3 -1
  128. package/lib/schema-component/antd/table-v2/Table.d.ts +0 -11
  129. package/lib/schema-component/antd/table-v2/Table.js +172 -94
  130. package/lib/schema-component/antd/table-v2/TableField.js +3 -0
  131. package/lib/schema-component/antd/tabs/Tabs.Designer.js +23 -12
  132. package/lib/schema-component/antd/tabs/Tabs.js +8 -1
  133. package/lib/schema-component/antd/time-picker/ReadPretty.js +10 -3
  134. package/lib/schema-component/core/DesignableSwitch.js +8 -1
  135. package/lib/schema-component/hooks/useDesignable.js +21 -21
  136. package/lib/schema-component/hooks/useProps.js +1 -1
  137. package/lib/schema-initializer/buttons/FormItemInitializers.js +14 -2
  138. package/lib/schema-initializer/buttons/ReadPrettyFormActionInitializers.js +8 -0
  139. package/lib/schema-initializer/buttons/ReadPrettyFormItemInitializers.js +14 -2
  140. package/lib/schema-initializer/buttons/RecordBlockInitializers.js +34 -4
  141. package/lib/schema-initializer/buttons/TabPaneInitializers.js +11 -3
  142. package/lib/schema-initializer/buttons/TableActionInitializers.js +11 -0
  143. package/lib/schema-initializer/components/assigned-field/AssignedField.d.ts +4 -0
  144. package/lib/schema-initializer/components/assigned-field/AssignedField.js +257 -66
  145. package/lib/schema-initializer/items/index.d.ts +2 -0
  146. package/lib/schema-initializer/items/index.js +54 -2
  147. package/lib/schema-initializer/utils.js +22 -2
  148. package/lib/system-settings/SystemSettingsShortcut.js +37 -13
  149. package/package.json +7 -4
@@ -12,7 +12,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
12
12
 
13
13
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
14
14
 
15
- import { SettingOutlined } from '@ant-design/icons';
15
+ import { FileOutlined } from '@ant-design/icons';
16
16
  import { uid } from '@formily/shared';
17
17
  import React, { useState } from 'react';
18
18
  import { useTranslation } from 'react-i18next';
@@ -50,7 +50,7 @@ export var FileStorageShortcut = function FileStorageShortcut() {
50
50
  onClick: function onClick() {
51
51
  setVisible(true);
52
52
  },
53
- icon: /*#__PURE__*/React.createElement(SettingOutlined, null),
53
+ icon: /*#__PURE__*/React.createElement(FileOutlined, null),
54
54
  title: t('File storages')
55
55
  }), /*#__PURE__*/React.createElement(SchemaComponent, {
56
56
  components: {
@@ -54,7 +54,7 @@ declare const _default: {
54
54
  "Select data source": string;
55
55
  Calendar: string;
56
56
  Kanban: string;
57
- "Select group field": string;
57
+ "Select grouping field": string;
58
58
  Media: string;
59
59
  Markdown: string;
60
60
  Wysiwyg: string;
@@ -98,6 +98,7 @@ declare const _default: {
98
98
  Update: string;
99
99
  View: string;
100
100
  "View record": string;
101
+ Refresh: string;
101
102
  "Data changes": string;
102
103
  "Field name": string;
103
104
  "Before change": string;
@@ -372,7 +373,7 @@ declare const _default: {
372
373
  "Reference template": string;
373
374
  "Create calendar block": string;
374
375
  "Create kanban block": string;
375
- "Group field": string;
376
+ "Grouping field": string;
376
377
  "Tab name": string;
377
378
  "Current record blocks": string;
378
379
  "Popup message": string;
@@ -549,5 +550,10 @@ declare const _default: {
549
550
  "Field component": string;
550
551
  Subtable: string;
551
552
  Subform: string;
553
+ "Regular expression": string;
554
+ "Enabled languages": string;
555
+ "View all plugins": string;
556
+ Print: string;
557
+ 'Single select and radio fields can be used as the grouping field': string;
552
558
  };
553
559
  export default _default;
@@ -54,7 +54,7 @@ export default {
54
54
  "Select data source": "Select data source",
55
55
  "Calendar": "Calendar",
56
56
  "Kanban": "Kanban",
57
- "Select group field": "Select group field",
57
+ "Select grouping field": "Select grouping field",
58
58
  "Media": "Media",
59
59
  "Markdown": "Markdown",
60
60
  "Wysiwyg": "Wysiwyg",
@@ -98,6 +98,7 @@ export default {
98
98
  "Update": "Update",
99
99
  "View": "View",
100
100
  "View record": "View record",
101
+ "Refresh": "Refresh",
101
102
  "Data changes": "Data changes",
102
103
  "Field name": "Field name",
103
104
  "Before change": "Before change",
@@ -372,7 +373,7 @@ export default {
372
373
  "Reference template": "Reference template",
373
374
  "Create calendar block": "Create calendar block",
374
375
  "Create kanban block": "Create kanban block",
375
- "Group field": "Group field",
376
+ "Grouping field": "Grouping field",
376
377
  "Tab name": "Tab name",
377
378
  "Current record blocks": "Current record blocks",
378
379
  "Popup message": "Popup message",
@@ -548,5 +549,10 @@ export default {
548
549
  "Province/city/area name": "Province/city/area name",
549
550
  "Field component": "Field component",
550
551
  "Subtable": "Subtable",
551
- "Subform": "Subform"
552
+ "Subform": "Subform",
553
+ "Regular expression": "Pattern",
554
+ "Enabled languages": "Enabled languages",
555
+ "View all plugins": "View all plugins",
556
+ "Print": "Print",
557
+ 'Single select and radio fields can be used as the grouping field': 'Single select and radio fields can be used as the grouping field'
552
558
  };
@@ -54,7 +54,7 @@ declare const _default: {
54
54
  "Select data source": string;
55
55
  Calendar: string;
56
56
  Kanban: string;
57
- "Select group field": string;
57
+ "Select grouping field": string;
58
58
  Media: string;
59
59
  Markdown: string;
60
60
  Wysiwyg: string;
@@ -98,6 +98,7 @@ declare const _default: {
98
98
  Update: string;
99
99
  View: string;
100
100
  "View record": string;
101
+ Refresh: string;
101
102
  "Data changes": string;
102
103
  "Field name": string;
103
104
  "Before change": string;
@@ -232,6 +233,24 @@ declare const _default: {
232
233
  "Label field": string;
233
234
  "Default is the ID field": string;
234
235
  "Set default sorting rules": string;
236
+ "Set validation rules": string;
237
+ "Max length": string;
238
+ "Min length": string;
239
+ Maximum: string;
240
+ Minimum: string;
241
+ "Max length must greater than min length": string;
242
+ "Min length must less than max length": string;
243
+ "Maximum must greater than minimum": string;
244
+ "Minimum must less than maximum": string;
245
+ "Validation rule": string;
246
+ "Add validation rule": string;
247
+ Format: string;
248
+ "Regular expression": string;
249
+ "Error message": string;
250
+ Length: string;
251
+ "The field value cannot be greater than ": string;
252
+ "The field value cannot be less than ": string;
253
+ "The field value is not an integer number": string;
235
254
  "is before": string;
236
255
  "is after": string;
237
256
  "is on or after": string;
@@ -389,7 +408,8 @@ declare const _default: {
389
408
  'Reference template': string;
390
409
  'Create calendar block': string;
391
410
  'Create kanban block': string;
392
- 'Group field': string;
411
+ 'Grouping field': string;
412
+ 'Single select and radio fields can be used as the grouping field': string;
393
413
  'Tab name': string;
394
414
  'Current record blocks': string;
395
415
  'Popup message': string;
@@ -539,6 +559,7 @@ declare const _default: {
539
559
  'Dynamic value': string;
540
560
  'Current user': string;
541
561
  'Current record': string;
562
+ 'Current time': string;
542
563
  'Popup close method': string;
543
564
  'Automatic close': string;
544
565
  'Manually close': string;
@@ -573,5 +594,8 @@ declare const _default: {
573
594
  "One to one (belongs to)": string;
574
595
  "Use the same time zone (GMT) for all users": string;
575
596
  "Province/city/area name": string;
597
+ "Enabled languages": string;
598
+ "View all plugins": string;
599
+ Print: string;
576
600
  };
577
601
  export default _default;
@@ -54,7 +54,7 @@ export default {
54
54
  "Select data source": "选择数据源",
55
55
  "Calendar": "日历",
56
56
  "Kanban": "看板",
57
- "Select group field": "选择分组字段",
57
+ "Select grouping field": "选择分组字段",
58
58
  "Media": "多媒体",
59
59
  "Markdown": "Markdown",
60
60
  "Wysiwyg": "富文本",
@@ -98,6 +98,7 @@ export default {
98
98
  "Update": "更新",
99
99
  "View": "查看",
100
100
  "View record": "查看数据",
101
+ "Refresh": "刷新",
101
102
  "Data changes": "数据变更",
102
103
  "Field name": "字段标识",
103
104
  "Before change": "变更前",
@@ -232,6 +233,24 @@ export default {
232
233
  "Label field": "标签字段",
233
234
  "Default is the ID field": "默认为 ID 字段",
234
235
  "Set default sorting rules": "设置排序规则",
236
+ "Set validation rules": "设置验证规则",
237
+ "Max length": "最大长度",
238
+ "Min length": "最小长度",
239
+ "Maximum": "最大值",
240
+ "Minimum": "最小值",
241
+ "Max length must greater than min length": "最大长度必须大于最小长度",
242
+ "Min length must less than max length": "最小长度必须小于最大长度",
243
+ "Maximum must greater than minimum": "最大值必须大于最小值",
244
+ "Minimum must less than maximum": "最小值必须小于最大值",
245
+ "Validation rule": "验证规则",
246
+ "Add validation rule": "新增验证规则",
247
+ "Format": "格式",
248
+ "Regular expression": "正则表达式",
249
+ "Error message": "错误消息",
250
+ "Length": "长度",
251
+ "The field value cannot be greater than ": "数值不能大于",
252
+ "The field value cannot be less than ": "数值不能小于",
253
+ "The field value is not an integer number": "数字不是整数",
235
254
  "is before": "早于",
236
255
  "is after": "晚于",
237
256
  "is on or after": "不早于",
@@ -389,7 +408,8 @@ export default {
389
408
  'Reference template': '引用模板',
390
409
  'Create calendar block': '创建日历区块',
391
410
  'Create kanban block': '创建看板区块',
392
- 'Group field': '分组字段',
411
+ 'Grouping field': '分组字段',
412
+ 'Single select and radio fields can be used as the grouping field': '数据表的单选字段可以作为分组字段',
393
413
  'Tab name': '标签名称',
394
414
  'Current record blocks': '当前数据区块',
395
415
  'Popup message': '弹窗提示消息',
@@ -540,6 +560,7 @@ export default {
540
560
  'Dynamic value': '动态值',
541
561
  'Current user': '当前用户',
542
562
  'Current record': '当前记录',
563
+ 'Current time': '当前时间',
543
564
  'Popup close method': '弹窗关闭方式',
544
565
  'Automatic close': '自动关闭',
545
566
  'Manually close': '手动关闭',
@@ -574,5 +595,8 @@ export default {
574
595
  "One to one (has one)": "一对一(has one)",
575
596
  "One to one (belongs to)": "一对一(belongs to)",
576
597
  "Use the same time zone (GMT) for all users": "所有用户使用同一时区 (格林尼治标准时间)",
577
- "Province/city/area name": "省市区名称"
598
+ "Province/city/area name": "省市区名称",
599
+ "Enabled languages": "启用的语言",
600
+ "View all plugins": "查看所有插件",
601
+ "Print": "打印"
578
602
  };
@@ -7,6 +7,7 @@ declare type PluginManagerType = {
7
7
  Toolbar?: React.FC<ToolbarProps> & {
8
8
  Item?: React.FC<MenuItemProps & {
9
9
  selected?: boolean;
10
+ subtitle?: string;
10
11
  }>;
11
12
  };
12
13
  };
@@ -1,9 +1,13 @@
1
- var _excluded = ["selected", "icon", "title"];
1
+ var _templateObject;
2
+
3
+ var _excluded = ["selected", "icon", "title", "subtitle"];
2
4
 
3
5
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
4
6
 
5
7
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
6
8
 
9
+ function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
10
+
7
11
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
8
12
 
9
13
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
@@ -24,11 +28,13 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
24
28
 
25
29
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
26
30
 
27
- import { MoreOutlined, SettingOutlined } from '@ant-design/icons';
31
+ import { AppstoreOutlined, EllipsisOutlined } from '@ant-design/icons';
32
+ import { css } from '@emotion/css';
28
33
  import { ConfigProvider, Menu, Spin, Tooltip } from 'antd';
29
34
  import cls from 'classnames';
30
35
  import { get } from 'lodash';
31
36
  import React, { createContext, useContext } from 'react';
37
+ import { useTranslation } from 'react-i18next';
32
38
  import { useAPIClient, useRequest } from '../api-client';
33
39
  import { PluginManagerContext } from './context';
34
40
  export var usePrefixCls = function usePrefixCls(tag, props) {
@@ -80,6 +86,9 @@ PluginManager.Toolbar = function (props) {
80
86
  pinned = _splitItems2[0],
81
87
  unpinned = _splitItems2[1];
82
88
 
89
+ var _useTranslation = useTranslation(),
90
+ t = _useTranslation.t;
91
+
83
92
  return /*#__PURE__*/React.createElement("div", {
84
93
  style: {
85
94
  display: 'inline-block'
@@ -100,7 +109,7 @@ PluginManager.Toolbar = function (props) {
100
109
  }), unpinned.length > 0 && /*#__PURE__*/React.createElement(Menu.SubMenu, {
101
110
  popupClassName: 'pm-sub-menu',
102
111
  key: 'more',
103
- title: /*#__PURE__*/React.createElement(MoreOutlined, null)
112
+ title: /*#__PURE__*/React.createElement(EllipsisOutlined, null)
104
113
  }, unpinned.map(function (item, index) {
105
114
  var Action = get(components, item.component);
106
115
  return Action && /*#__PURE__*/React.createElement(ToolbarItemContext.Provider, {
@@ -112,8 +121,8 @@ PluginManager.Toolbar = function (props) {
112
121
  }), /*#__PURE__*/React.createElement(Menu.Item, {
113
122
  key: 'plugins',
114
123
  disabled: true,
115
- icon: /*#__PURE__*/React.createElement(SettingOutlined, null)
116
- }, "\u7BA1\u7406\u63D2\u4EF6"))));
124
+ icon: /*#__PURE__*/React.createElement(AppstoreOutlined, null)
125
+ }, t('View all plugins')))));
117
126
  };
118
127
 
119
128
  PluginManager.Toolbar.Item = function (props) {
@@ -122,14 +131,19 @@ PluginManager.Toolbar.Item = function (props) {
122
131
  var selected = props.selected,
123
132
  icon = props.icon,
124
133
  title = props.title,
134
+ subtitle = props.subtitle,
125
135
  others = _objectWithoutProperties(props, _excluded);
126
136
 
127
137
  var prefix = usePrefixCls();
128
138
  var className = cls(_defineProperty({}, "".concat(prefix, "-menu-item-selected"), selected));
129
139
 
130
140
  if (item.pin) {
141
+ var subtitleComponent = subtitle && /*#__PURE__*/React.createElement("div", {
142
+ className: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n font-size: 12px;\n color: #999;\n "])))
143
+ }, subtitle);
144
+ var titleComponent = /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", null, title), subtitleComponent);
131
145
  return /*#__PURE__*/React.createElement(Tooltip, {
132
- title: title
146
+ title: titleComponent
133
147
  }, /*#__PURE__*/React.createElement(Menu.Item, _objectSpread(_objectSpread({}, others), {}, {
134
148
  className: className,
135
149
  eventKey: item.component
@@ -52,7 +52,7 @@ export var ActionModal = observer(function (props) {
52
52
  onCancel: function onCancel() {
53
53
  return setVisible(false, true);
54
54
  },
55
- className: classNames(others.className, css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n &.nb-action-popup {\n .ant-modal-body {\n background: #f0f2f5;\n }\n }\n "])))),
55
+ className: classNames(others.className, css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n &.nb-action-popup {\n .ant-modal-header {\n display: none;\n }\n .ant-modal-body {\n padding-top: 16px;\n }\n .ant-modal-body {\n background: #f0f2f5;\n }\n .ant-modal-close-x {\n width: 32px;\n height: 32px;\n line-height: 32px;\n }\n }\n "])))),
56
56
  footer: footerSchema ? /*#__PURE__*/React.createElement("div", {
57
57
  className: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n justify-content: flex-end;\n width: 100%;\n .ant-btn {\n margin-right: 8px;\n }\n "])))
58
58
  }, /*#__PURE__*/React.createElement(RecursionField, {
@@ -15,12 +15,17 @@ import { GeneralSchemaDesigner, SchemaSettings } from '../../../schema-settings'
15
15
  import { useSchemaTemplate } from '../../../schema-templates';
16
16
 
17
17
  var useOptions = function useOptions() {
18
+ var _fields$filter;
19
+
20
+ var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'string';
18
21
  var compile = useCompile();
19
22
 
20
23
  var _useCollection = useCollection(),
21
24
  fields = _useCollection.fields;
22
25
 
23
- var options = fields === null || fields === void 0 ? void 0 : fields.map(function (field) {
26
+ var options = fields === null || fields === void 0 ? void 0 : (_fields$filter = fields.filter(function (field) {
27
+ return field.type === type;
28
+ })) === null || _fields$filter === void 0 ? void 0 : _fields$filter.map(function (field) {
24
29
  var _field$uiSchema;
25
30
 
26
31
  return {
@@ -57,7 +62,6 @@ export var CalendarDesigner = function CalendarDesigner() {
57
62
 
58
63
  var template = useSchemaTemplate();
59
64
  var defaultFilter = (fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xDecora = fieldSchema['x-decorator-props']) === null || _fieldSchema$xDecora === void 0 ? void 0 : (_fieldSchema$xDecora$ = _fieldSchema$xDecora.params) === null || _fieldSchema$xDecora$ === void 0 ? void 0 : _fieldSchema$xDecora$.filter) || {};
60
- var options = useOptions();
61
65
  var fieldNames = (fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xDecora2 = fieldSchema['x-decorator-props']) === null || _fieldSchema$xDecora2 === void 0 ? void 0 : _fieldSchema$xDecora2['fieldNames']) || {};
62
66
  var defaultResource = fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xDecora3 = fieldSchema['x-decorator-props']) === null || _fieldSchema$xDecora3 === void 0 ? void 0 : _fieldSchema$xDecora3.resource;
63
67
  return /*#__PURE__*/React.createElement(GeneralSchemaDesigner, {
@@ -66,14 +70,16 @@ export var CalendarDesigner = function CalendarDesigner() {
66
70
  }, /*#__PURE__*/React.createElement(SchemaSettings.BlockTitleItem, null), /*#__PURE__*/React.createElement(SchemaSettings.SelectItem, {
67
71
  title: t('Title field'),
68
72
  value: fieldNames.title,
69
- options: options,
73
+ options: useOptions('string'),
70
74
  onChange: function onChange(title) {
71
75
  var _schema;
72
76
 
73
77
  var fieldNames = field.decoratorProps.fieldNames || {};
74
78
  fieldNames['title'] = title;
75
79
  field.decoratorProps.params = fieldNames;
76
- fieldSchema['x-decorator-props']['params'] = fieldNames;
80
+ fieldSchema['x-decorator-props']['params'] = fieldNames; // Select切换option后value未按照预期切换,固增加以下代码
81
+
82
+ fieldSchema['x-decorator-props']['fieldNames'] = fieldNames;
77
83
  service.refresh();
78
84
  dn.emit('patch', {
79
85
  schema: (_schema = {}, _defineProperty(_schema, 'x-uid', fieldSchema['x-uid']), _defineProperty(_schema, 'x-decorator-props', field.decoratorProps), _schema)
@@ -83,14 +89,14 @@ export var CalendarDesigner = function CalendarDesigner() {
83
89
  }), /*#__PURE__*/React.createElement(SchemaSettings.SelectItem, {
84
90
  title: t('Start date field'),
85
91
  value: fieldNames.start,
86
- options: options,
92
+ options: useOptions('date'),
87
93
  onChange: function onChange(start) {
88
94
  var _schema2;
89
95
 
90
96
  var fieldNames = field.decoratorProps.fieldNames || {};
91
97
  fieldNames['start'] = start;
92
- field.decoratorProps.params = fieldNames;
93
- fieldSchema['x-decorator-props']['params'] = fieldNames;
98
+ field.decoratorProps.fieldNames = fieldNames;
99
+ fieldSchema['x-decorator-props']['fieldNames'] = fieldNames;
94
100
  service.refresh();
95
101
  dn.emit('patch', {
96
102
  schema: (_schema2 = {}, _defineProperty(_schema2, 'x-uid', fieldSchema['x-uid']), _defineProperty(_schema2, 'x-decorator-props', field.decoratorProps), _schema2)
@@ -100,14 +106,14 @@ export var CalendarDesigner = function CalendarDesigner() {
100
106
  }), /*#__PURE__*/React.createElement(SchemaSettings.SelectItem, {
101
107
  title: t('End date field'),
102
108
  value: fieldNames.end,
103
- options: options,
109
+ options: useOptions('date'),
104
110
  onChange: function onChange(end) {
105
111
  var _schema3;
106
112
 
107
113
  var fieldNames = field.decoratorProps.fieldNames || {};
108
114
  fieldNames['end'] = end;
109
- field.decoratorProps.params = fieldNames;
110
- fieldSchema['x-decorator-props']['params'] = fieldNames;
115
+ field.decoratorProps.fieldNames = fieldNames;
116
+ fieldSchema['x-decorator-props']['fieldNames'] = fieldNames;
111
117
  service.refresh();
112
118
  dn.emit('patch', {
113
119
  schema: (_schema3 = {}, _defineProperty(_schema3, 'x-uid', fieldSchema['x-uid']), _defineProperty(_schema3, 'x-decorator-props', field.decoratorProps), _schema3)
@@ -1,5 +1,5 @@
1
- import React from 'react';
2
1
  import type { DatePickerProps as AntdDatePickerProps, RangePickerProps as AntdRangePickerProps } from 'antd/lib/date-picker';
2
+ import React from 'react';
3
3
  declare type ComposedDatePicker = React.FC<AntdDatePickerProps> & {
4
4
  RangePicker?: React.FC<AntdRangePickerProps>;
5
5
  };
@@ -1,5 +1,5 @@
1
- import { DatePicker as AntdDatePicker } from 'antd';
2
1
  import { connect, mapProps, mapReadPretty } from '@formily/react';
2
+ import { DatePicker as AntdDatePicker } from 'antd';
3
3
  import { ReadPretty } from './ReadPretty';
4
4
  import { mapDateFormat } from './util';
5
5
  export var DatePicker = connect(AntdDatePicker, mapProps(mapDateFormat()), mapReadPretty(ReadPretty.DatePicker));
@@ -1,9 +1,9 @@
1
1
  import { usePrefixCls } from '@formily/antd/lib/__builtins__';
2
2
  import { isArr } from '@formily/shared';
3
+ import { getDefaultFormat, str2moment } from '@nocobase/utils/client';
3
4
  import cls from 'classnames';
4
5
  import moment from 'moment';
5
6
  import React from 'react';
6
- import { getDefaultFormat, str2moment } from './util';
7
7
  export var ReadPretty = function ReadPretty() {
8
8
  return null;
9
9
  };
@@ -1,18 +1,8 @@
1
- import type { DatePickerProps } from 'antd/lib/date-picker';
2
1
  import moment from 'moment';
3
- export interface Str2momentOptions {
4
- gmt?: boolean;
5
- picker?: 'year' | 'month' | 'week' | 'quarter';
6
- }
7
- export declare const str2moment: (value?: string | string[], options?: Str2momentOptions) => any;
8
2
  export interface Moment2strOptions {
9
3
  showTime?: boolean;
10
4
  gmt?: boolean;
11
5
  picker?: 'year' | 'month' | 'week' | 'quarter';
12
6
  }
13
7
  export declare const moment2str: (value?: moment.Moment | moment.Moment[], options?: Moment2strOptions) => string | string[] | moment.Moment | moment.Moment[];
14
- export declare const getDefaultFormat: (props: DatePickerProps & {
15
- dateFormat: string;
16
- timeFormat: string;
17
- }) => string | import("rc-picker/lib/interface").CustomFormat<moment.Moment> | (string | import("rc-picker/lib/interface").CustomFormat<moment.Moment>)[];
18
8
  export declare const mapDateFormat: () => (props: any) => any;
@@ -4,24 +4,9 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
4
4
 
5
5
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
6
 
7
+ import { getDefaultFormat, str2moment, toGmt, toLocal } from '@nocobase/utils/client';
7
8
  import moment from 'moment';
8
9
 
9
- var toGmt = function toGmt(value) {
10
- if (!value) {
11
- return value;
12
- }
13
-
14
- if (Array.isArray(value)) {
15
- return value.map(function (val) {
16
- return "".concat(val.format('YYYY-MM-DD'), "T").concat(val.format('HH:mm:ss.SSS'), "Z");
17
- });
18
- }
19
-
20
- if (moment.isMoment(value)) {
21
- return "".concat(value.format('YYYY-MM-DD'), "T").concat(value.format('HH:mm:ss.SSS'), "Z");
22
- }
23
- };
24
-
25
10
  var toStringByPicker = function toStringByPicker(value, picker) {
26
11
  if (picker === 'year') {
27
12
  return value.format('YYYY') + '-01-01T00:00:00.000Z';
@@ -58,44 +43,6 @@ var toGmtByPicker = function toGmtByPicker(value, picker) {
58
43
  }
59
44
  };
60
45
 
61
- var toLocal = function toLocal(value) {
62
- if (!value) {
63
- return value;
64
- }
65
-
66
- if (Array.isArray(value)) {
67
- return value.map(function (val) {
68
- return val.toISOString();
69
- });
70
- }
71
-
72
- if (moment.isMoment(value)) {
73
- return value.toISOString();
74
- }
75
- };
76
-
77
- var toMoment = function toMoment(val, options) {
78
- if (moment.isMoment(val)) {
79
- return val;
80
- }
81
-
82
- var gmt = options.gmt,
83
- picker = options.picker;
84
-
85
- if (gmt || picker) {
86
- val = val.replace('T', ' ').replace('Z', '');
87
- return moment(val);
88
- }
89
-
90
- return moment(val);
91
- };
92
-
93
- export var str2moment = function str2moment(value) {
94
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
95
- return Array.isArray(value) ? value.map(function (val) {
96
- return toMoment(val, options);
97
- }) : value ? toMoment(value, options) : value;
98
- };
99
46
  export var moment2str = function moment2str(value) {
100
47
  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
101
48
  var showTime = options.showTime,
@@ -112,31 +59,6 @@ export var moment2str = function moment2str(value) {
112
59
 
113
60
  return toGmtByPicker(value, picker);
114
61
  };
115
- export var getDefaultFormat = function getDefaultFormat(props) {
116
- if (props.format) {
117
- return props.format;
118
- }
119
-
120
- if (props.dateFormat) {
121
- if (props['showTime']) {
122
- return "".concat(props.dateFormat, " ").concat(props.timeFormat || 'HH:mm:ss');
123
- }
124
-
125
- return props.dateFormat;
126
- }
127
-
128
- if (props['picker'] === 'month') {
129
- return 'YYYY-MM';
130
- } else if (props['picker'] === 'quarter') {
131
- return 'YYYY-\\QQ';
132
- } else if (props['picker'] === 'year') {
133
- return 'YYYY';
134
- } else if (props['picker'] === 'week') {
135
- return 'YYYY-wo';
136
- }
137
-
138
- return props['showTime'] ? 'YYYY-MM-DD HH:mm:ss' : 'YYYY-MM-DD';
139
- };
140
62
  export var mapDateFormat = function mapDateFormat() {
141
63
  return function (props) {
142
64
  var format = getDefaultFormat(props);