@tachybase/client 1.6.0 → 1.6.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 (79) hide show
  1. package/es/application/PluginManager.mjs +9 -1
  2. package/es/application/WebSocketClient.d.ts +19 -0
  3. package/es/application/WebSocketClient.mjs +26 -6
  4. package/es/application/utils/remotePlugins.mjs +8 -2
  5. package/es/built-in/attachment-preview/previewers/file-sheet.mjs +1 -1
  6. package/es/built-in/pm/PluginDetail.mjs +1 -1
  7. package/es/collection-manager/Configuration/components/index.mjs +3 -3
  8. package/es/collection-manager/interfaces/components/index.mjs +2 -2
  9. package/es/collection-manager/interfaces/properties/operators.mjs +3 -3
  10. package/es/locale/index.mjs +47 -47
  11. package/es/modules/blocks/data-blocks/table/hooks/useTableBlockProps.mjs +4 -1
  12. package/es/schema-component/antd/AntdSchemaComponentProvider.mjs +3 -1
  13. package/es/schema-component/antd/__builtins__/hooks/usePrefixCls.mjs +1 -1
  14. package/es/schema-component/antd/action/Action.Area.style.mjs +1 -1
  15. package/es/schema-component/antd/action/Action.Designer.mjs +1 -1
  16. package/es/schema-component/antd/association-field/AssociationSelect.mjs +1 -1
  17. package/es/schema-component/antd/association-field/InternalDrawerSubTable.mjs +1 -1
  18. package/es/schema-component/antd/association-field/SubTabs/styles.mjs +1 -1
  19. package/es/schema-component/antd/block-item/BlockToolbar.mjs +16 -16
  20. package/es/schema-component/antd/grid-card/options.mjs +3 -3
  21. package/es/schema-component/antd/input/ReadPretty.mjs +1 -3
  22. package/es/schema-component/antd/menu/Menu.styles.mjs +1 -1
  23. package/es/schema-component/antd/menu/MenuSearchAdd.style.mjs +1 -1
  24. package/es/schema-component/antd/page/Page.mjs +3 -0
  25. package/es/schema-component/antd/page/Page.style.mjs +1 -1
  26. package/es/schema-component/antd/table/Table.Column.Designer.mjs +5 -5
  27. package/es/schema-component/antd/table/Table.Void.Designer.mjs +4 -4
  28. package/es/schema-component/antd/table-v2/EnabledToggle.d.ts +9 -0
  29. package/es/schema-component/antd/table-v2/EnabledToggle.mjs +72 -0
  30. package/es/schema-component/antd/table-v2/Table.styles.mjs +1 -1
  31. package/es/schema-component/antd/table-v2/index.d.ts +1 -0
  32. package/es/schema-component/antd/table-v2/index.mjs +1 -0
  33. package/es/schema-component/antd/variable/CodeMirror.mjs +1 -1
  34. package/es/schema-component/common/sortable-item/DragHandleMenu.style.mjs +1 -1
  35. package/es/schema-component/common/sortable-item/DragHandlePageTab.style.mjs +1 -1
  36. package/es/schema-templates/BlockTemplateDetails.mjs +1 -1
  37. package/es/user/ChangePassword.mjs +1 -1
  38. package/lib/application/PluginManager.js +9 -1
  39. package/lib/application/WebSocketClient.js +26 -6
  40. package/lib/application/utils/remotePlugins.js +8 -2
  41. package/lib/built-in/attachment-preview/previewers/file-sheet.js +1 -1
  42. package/lib/built-in/pm/PluginDetail.js +1 -1
  43. package/lib/collection-manager/Configuration/components/index.js +3 -3
  44. package/lib/collection-manager/interfaces/components/index.js +2 -2
  45. package/lib/collection-manager/interfaces/properties/operators.js +3 -3
  46. package/lib/locale/en_US.js +1 -0
  47. package/lib/locale/es_ES.js +1 -0
  48. package/lib/locale/fr_FR.js +1 -0
  49. package/lib/locale/ko_KR.js +1 -0
  50. package/lib/locale/pt_BR.js +1 -0
  51. package/lib/locale/uk_UA.js +1 -0
  52. package/lib/locale/zh-CN.js +1 -0
  53. package/lib/locale/zh-TW.js +1 -0
  54. package/lib/modules/blocks/data-blocks/table/hooks/useTableBlockProps.js +4 -1
  55. package/lib/schema-component/antd/AntdSchemaComponentProvider.js +3 -1
  56. package/lib/schema-component/antd/__builtins__/hooks/usePrefixCls.js +1 -1
  57. package/lib/schema-component/antd/action/Action.Area.style.js +1 -1
  58. package/lib/schema-component/antd/action/Action.Designer.js +1 -1
  59. package/lib/schema-component/antd/association-field/AssociationSelect.js +1 -1
  60. package/lib/schema-component/antd/association-field/InternalDrawerSubTable.js +1 -1
  61. package/lib/schema-component/antd/association-field/SubTabs/styles.js +1 -1
  62. package/lib/schema-component/antd/block-item/BlockToolbar.js +16 -16
  63. package/lib/schema-component/antd/grid-card/options.js +3 -3
  64. package/lib/schema-component/antd/input/ReadPretty.js +1 -3
  65. package/lib/schema-component/antd/menu/Menu.styles.js +1 -1
  66. package/lib/schema-component/antd/menu/MenuSearchAdd.style.js +1 -1
  67. package/lib/schema-component/antd/page/Page.js +3 -0
  68. package/lib/schema-component/antd/page/Page.style.js +1 -1
  69. package/lib/schema-component/antd/table/Table.Column.Designer.js +5 -5
  70. package/lib/schema-component/antd/table/Table.Void.Designer.js +4 -4
  71. package/lib/schema-component/antd/table-v2/EnabledToggle.js +106 -0
  72. package/lib/schema-component/antd/table-v2/Table.styles.js +1 -1
  73. package/lib/schema-component/antd/table-v2/index.js +13 -0
  74. package/lib/schema-component/antd/variable/CodeMirror.js +1 -1
  75. package/lib/schema-component/common/sortable-item/DragHandleMenu.style.js +1 -1
  76. package/lib/schema-component/common/sortable-item/DragHandlePageTab.style.js +1 -1
  77. package/lib/schema-templates/BlockTemplateDetails.js +1 -1
  78. package/lib/user/ChangePassword.js +1 -1
  79. package/package.json +4 -4
@@ -145,7 +145,7 @@ const InternalAssociationSelect = (0, schema_namespaceObject.observer)((props)=>
145
145
  style: {
146
146
  paddingLeft: 5
147
147
  },
148
- children: t('Add') + " \u201C".concat(props.search, "\u201D ")
148
+ children: t('Add') + " ".concat(props.search, " ")
149
149
  })
150
150
  ]
151
151
  });
@@ -103,7 +103,7 @@ const InternaDrawerSubTable = (0, schema_namespaceObject.observer)((props)=>{
103
103
  extra: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Button, {
104
104
  type: "primary",
105
105
  onClick: ()=>setVisible(false),
106
- children: "\u786E\u8BA4"
106
+ children: "确认"
107
107
  }),
108
108
  children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_flag_provider_index_js_namespaceObject.FlagProvider, {
109
109
  isInSubForm: true,
@@ -37,7 +37,7 @@ function _tagged_template_literal(strings, raw) {
37
37
  }
38
38
  function _templateObject() {
39
39
  const data = _tagged_template_literal([
40
- "\n display: flex;\n flex-direction: row;\n max-height: 30vh;\n .left-pane {\n padding: 2px;\n display: flex;\n font-weight: 500;\n flex-direction: column;\n width: 100px;\n overflow-y: auto;\n /* \u9690\u85CF\u6EDA\u52A8\u6761 \u5FAE\u8F6F/\u706B\u72D0 */\n -ms-overflow-style: none;\n scrollbar-width: none;\n border-right: 2px solid #d4d4d4;\n padding: 2px;\n margin-right: 5px;\n div {\n background-color: #ffffff;\n white-space: normal;\n cursor: pointer;\n margin: 5px 0 5px;\n }\n div:last-of-type {\n margin-bottom: 0;\n }\n }\n /* \u9690\u85CF\u6EDA\u52A8\u6761 \u8C37\u6B4C\u6D4F\u89C8\u5668 */\n .left-pane::-webkit-scrollbar {\n display: none;\n }\n\n .right-pane {\n padding: 2px;\n display: flex;\n flex-direction: column;\n overflow-y: auto;\n flex: 1;\n div {\n margin-bottom: 1em;\n .ant-btn {\n margin-right: 2px;\n }\n }\n div:last-of-type {\n margin-bottom: 0;\n }\n }\n "
40
+ "\n display: flex;\n flex-direction: row;\n max-height: 30vh;\n .left-pane {\n padding: 2px;\n display: flex;\n font-weight: 500;\n flex-direction: column;\n width: 100px;\n overflow-y: auto;\n /* 隐藏滚动条 微软/火狐 */\n -ms-overflow-style: none;\n scrollbar-width: none;\n border-right: 2px solid #d4d4d4;\n padding: 2px;\n margin-right: 5px;\n div {\n background-color: #ffffff;\n white-space: normal;\n cursor: pointer;\n margin: 5px 0 5px;\n }\n div:last-of-type {\n margin-bottom: 0;\n }\n }\n /* 隐藏滚动条 谷歌浏览器 */\n .left-pane::-webkit-scrollbar {\n display: none;\n }\n\n .right-pane {\n padding: 2px;\n display: flex;\n flex-direction: column;\n overflow-y: auto;\n flex: 1;\n div {\n margin-bottom: 1em;\n .ant-btn {\n margin-right: 2px;\n }\n }\n div:last-of-type {\n margin-bottom: 0;\n }\n }\n "
41
41
  ]);
42
42
  _templateObject = function() {
43
43
  return data;
@@ -36,60 +36,60 @@ const external_antd_namespaceObject = require("antd");
36
36
  const defaultItems = [
37
37
  {
38
38
  icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icons_namespaceObject.FullscreenOutlined, {}),
39
- title: "\u5168\u5C4F"
39
+ title: '全屏'
40
40
  },
41
41
  {
42
42
  icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icons_namespaceObject.UndoOutlined, {}),
43
- title: "\u64A4\u9500"
43
+ title: '撤销'
44
44
  },
45
45
  {
46
46
  icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icons_namespaceObject.RedoOutlined, {}),
47
- title: "\u91CD\u505A"
47
+ title: '重做'
48
48
  },
49
49
  {
50
50
  icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icons_namespaceObject.DeleteOutlined, {}),
51
- title: "\u5220\u9664"
51
+ title: '删除'
52
52
  }
53
53
  ];
54
54
  const customItems = [
55
55
  {
56
56
  icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icons_namespaceObject.CopyOutlined, {}),
57
57
  placement: 'bottom',
58
- title: "\u590D\u5236"
58
+ title: '复制'
59
59
  },
60
60
  {
61
61
  icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icons_namespaceObject.ZoomInOutlined, {}),
62
- title: "\u653E\u5927\uFF01"
62
+ title: '放大!'
63
63
  },
64
64
  {
65
65
  icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icons_namespaceObject.ZoomOutOutlined, {}),
66
66
  style: {
67
67
  color: '#1890ff'
68
68
  },
69
- title: "\u7F29\u5C0F\uFF01"
69
+ title: '缩小!'
70
70
  },
71
71
  {
72
72
  type: 'divider'
73
73
  },
74
74
  {
75
75
  icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icons_namespaceObject.DragOutlined, {}),
76
- title: "\u5FEB\u901F\u5B9A\u4F4D"
76
+ title: '快速定位'
77
77
  }
78
78
  ];
79
79
  const dropdownMenuItems = [
80
80
  {
81
81
  icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icons_namespaceObject.CopyOutlined, {}),
82
82
  onClick: ()=>{
83
- external_antd_namespaceObject.message.info("\u590D\u5236\uFF01");
83
+ external_antd_namespaceObject.message.info('复制!');
84
84
  },
85
- label: "\u590D\u5236"
85
+ label: '复制'
86
86
  },
87
87
  {
88
88
  icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icons_namespaceObject.ZoomInOutlined, {}),
89
89
  onClick: ()=>{
90
- external_antd_namespaceObject.message.success("\u653E\u5927\uFF01");
90
+ external_antd_namespaceObject.message.success('放大!');
91
91
  },
92
- label: "\u653E\u5927\uFF01"
92
+ label: '放大!'
93
93
  },
94
94
  {
95
95
  icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icons_namespaceObject.ZoomOutOutlined, {}),
@@ -97,9 +97,9 @@ const dropdownMenuItems = [
97
97
  color: '#1890ff'
98
98
  },
99
99
  onClick: ()=>{
100
- external_antd_namespaceObject.message.success("\u7F29\u5C0F\uFF01");
100
+ external_antd_namespaceObject.message.success('缩小!');
101
101
  },
102
- label: "\u7F29\u5C0F\uFF01"
102
+ label: '缩小!'
103
103
  },
104
104
  {
105
105
  type: 'divider'
@@ -107,9 +107,9 @@ const dropdownMenuItems = [
107
107
  {
108
108
  icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icons_namespaceObject.DragOutlined, {}),
109
109
  onClick: ()=>{
110
- external_antd_namespaceObject.message.loading("\u5FEB\u901F\u5B9A\u4F4Ding");
110
+ external_antd_namespaceObject.message.loading('快速定位ing');
111
111
  },
112
- label: "\u5FEB\u901F\u5B9A\u4F4D"
112
+ label: '快速定位'
113
113
  }
114
114
  ];
115
115
  const BlockToolbar = /*#__PURE__*/ (0, external_react_namespaceObject.forwardRef)((props, ref)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
@@ -54,9 +54,9 @@ const screenSizeTitleMaps = {
54
54
  };
55
55
  const screenSizeMaps = {
56
56
  xs: '< 768',
57
- md: "\u2265 768",
58
- lg: "\u2265 992",
59
- xxl: "\u2265 1600"
57
+ md: '≥ 768',
58
+ lg: '≥ 992',
59
+ xxl: '≥ 1600'
60
60
  };
61
61
  const defaultColumnCount = {
62
62
  xs: 1,
@@ -38,8 +38,8 @@ __webpack_require__.d(__webpack_exports__, {
38
38
  const jsx_runtime_namespaceObject = require("react/jsx-runtime");
39
39
  require("react");
40
40
  const schema_namespaceObject = require("@tachybase/schema");
41
- const css_namespaceObject = require("@emotion/css");
42
41
  const client_namespaceObject = require("@tego/client");
42
+ const css_namespaceObject = require("@emotion/css");
43
43
  const external_antd_namespaceObject = require("antd");
44
44
  const external_classnames_namespaceObject = require("classnames");
45
45
  var external_classnames_default = /*#__PURE__*/ __webpack_require__.n(external_classnames_namespaceObject);
@@ -70,8 +70,6 @@ const _Input = (props)=>{
70
70
  return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
71
71
  className: external_classnames_default()(prefixCls, props.className),
72
72
  style: {
73
- display: 'flex',
74
- alignItems: 'center',
75
73
  overflowWrap: 'break-word',
76
74
  whiteSpace: 'normal',
77
75
  ...props.style
@@ -56,7 +56,7 @@ function _templateObject1() {
56
56
  function _templateObject2() {
57
57
  const data = _tagged_template_literal([
58
58
  "\n height: 100%;\n overflow-y: auto;\n overflow-x: hidden;\n\n .ant-menu-submenu.ant-menu-submenu-inline .ant-menu-submenu-title {\n position: relative;\n ::before {\n content: '';\n position: absolute;\n left: 0;\n top: 50%;\n transform: translateY(-50%);\n width: 3px;\n height: 50%;\n background-color: ",
59
- ";\n\n /* \u4F7F\u7528 clip-path \u88C1\u526A\u4E3A\u68AF\u5F62 */\n clip-path: polygon(0 0, 100% 15%, 100% 85%, 0 100%);\n }\n }\n\n .ant-menu-submenu.ant-menu-submenu-inline.ant-menu-submenu-open > .ant-menu-submenu-title {\n ::before {\n background-color: ",
59
+ ";\n\n /* 使用 clip-path 裁剪为梯形 */\n clip-path: polygon(0 0, 100% 15%, 100% 85%, 0 100%);\n }\n }\n\n .ant-menu-submenu.ant-menu-submenu-inline.ant-menu-submenu-open > .ant-menu-submenu-title {\n ::before {\n background-color: ",
60
60
  ";\n }\n }\n\n .ant-menu-item,\n .ant-menu-submenu-title {\n padding-inline-end: 10px;\n }\n\n .ant-menu-submenu-title {\n .ant-menu-title-content {\n > div {\n > .general-schema-designer {\n right: 6px !important;\n }\n > span.anticon {\n margin-right: 10px;\n }\n }\n }\n }\n "
61
61
  ]);
62
62
  _templateObject2 = function() {
@@ -37,7 +37,7 @@ function _tagged_template_literal(strings, raw) {
37
37
  }
38
38
  function _templateObject() {
39
39
  const data = _tagged_template_literal([
40
- "\n /* NOTE: \u8FD9\u91CC\u7684\u6837\u5F0F\u662F\u4E3A\u4E86\u8BA9\u641C\u7D22\u6846\u7684\u6837\u5F0F, \u907F\u514D\u4E0A\u5C42 antd \u5199\u6B7B\u7684 padding-left: 24px \u7684\u5F71\u54CD */\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n display: flex;\n flex-direction: row;\n align-items: flex-start;\n\n /* NOTE: \u653E\u8FD9\u4E09\u4E2A\u6837\u5F0F\u662F\u4E3A\u4E86\u63D0\u5347\u9009\u62E9\u5668\u4F18\u5148\u7EA7, \u8986\u76D6\u6389 antd \u7684\u9ED8\u8BA4\u6837\u5F0F */\n .ant-input-outlined.ant-input-outlined.ant-input-outlined {\n background-color: #f9f9f9;\n border-radius: 5px;\n border: none;\n box-shadow: none;\n }\n\n /* \u79FB\u9664 antd \u9ED8\u8BA4\u7684\u540E\u7F6E\u641C\u7D22\u56FE\u6807 */\n .ant-input-group-addon {\n display: none;\n }\n\n .menu-add-wrapper {\n .ant-dropdown-trigger {\n display: grid;\n place-items: center;\n\n width: 30px;\n /* \u8FD9\u91CC\u662F\u4E3A\u4E86\u548C\u524D\u8FB9\u5143\u7D20\u4FDD\u6301\u5BF9\u9F50, antd \u7EC4\u4EF6\u5199\u6B7B\u4E86\u9AD8\u5EA6 */\n height: 28px;\n\n cursor: pointer;\n\n :hover,\n :active {\n border-radius: 5px;\n color: #ffffff;\n background-color: #f4f4f4;\n }\n }\n }\n "
40
+ "\n /* NOTE: 这里的样式是为了让搜索框的样式, 避免上层 antd 写死的 padding-left: 24px 的影响 */\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n display: flex;\n flex-direction: row;\n align-items: flex-start;\n\n /* NOTE: 放这三个样式是为了提升选择器优先级, 覆盖掉 antd 的默认样式 */\n .ant-input-outlined.ant-input-outlined.ant-input-outlined {\n background-color: #f9f9f9;\n border-radius: 5px;\n border: none;\n box-shadow: none;\n }\n\n /* 移除 antd 默认的后置搜索图标 */\n .ant-input-group-addon {\n display: none;\n }\n\n .menu-add-wrapper {\n .ant-dropdown-trigger {\n display: grid;\n place-items: center;\n\n width: 30px;\n /* 这里是为了和前边元素保持对齐, antd 组件写死了高度 */\n height: 28px;\n\n cursor: pointer;\n\n :hover,\n :active {\n border-radius: 5px;\n color: #ffffff;\n background-color: #f4f4f4;\n }\n }\n }\n "
41
41
  ]);
42
42
  _templateObject = function() {
43
43
  return data;
@@ -269,6 +269,9 @@ const TabItem = (props)=>{
269
269
  type: schema['x-icon']
270
270
  }),
271
271
  /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
272
+ style: {
273
+ padding: '6px 16px'
274
+ },
272
275
  children: schema.title || t('Unnamed')
273
276
  }),
274
277
  /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
@@ -37,7 +37,7 @@ function _tagged_template_literal(strings, raw) {
37
37
  }
38
38
  function _templateObject() {
39
39
  const data = _tagged_template_literal([
40
- "\n .ant-tabs-nav-wrap.ant-tabs-nav-wrap {\n flex: none;\n }\n .ant-tabs-tab.ant-tabs-tab.ant-tabs-tab {\n padding: 0;\n border: none;\n background-color: #ffffff;\n }\n\n .ant-tabs-tab-active.ant-tabs-tab-active.ant-tabs-tab-active.ant-tabs-tab-active {\n border-radius: 8px 8px 0 0;\n box-shadow: none;\n text-shadow: none;\n background-color: var(--tb-box-bg);\n }\n .ant-tabs-extra-content {\n flex: 1;\n }\n "
40
+ "\n .ant-tabs-nav-wrap.ant-tabs-nav-wrap {\n flex: none;\n }\n .ant-tabs-tab.ant-tabs-tab.ant-tabs-tab {\n border: none;\n background-color: #ffffff;\n }\n\n .ant-tabs-tab-active.ant-tabs-tab-active.ant-tabs-tab-active.ant-tabs-tab-active {\n border-radius: 8px 8px 0 0;\n box-shadow: none;\n text-shadow: none;\n background-color: var(--tb-box-bg);\n }\n .ant-tabs-extra-content {\n flex: 1;\n }\n "
41
41
  ]);
42
42
  _templateObject = function() {
43
43
  return data;
@@ -71,9 +71,9 @@ const TableColumnDesigner = (props)=>{
71
71
  return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_schema_settings_index_js_namespaceObject.GeneralSchemaDesigner, {
72
72
  children: [
73
73
  /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_schema_settings_index_js_namespaceObject.SchemaSettingsPopupItem, {
74
- title: "\u7F16\u8F91",
74
+ title: '编辑',
75
75
  schema: {
76
- title: "\u7F16\u8F91\u5B57\u6BB5",
76
+ title: '编辑字段',
77
77
  'x-component': 'Action.Modal',
78
78
  'x-component-props': {
79
79
  width: 520
@@ -87,9 +87,9 @@ const TableColumnDesigner = (props)=>{
87
87
  title: {
88
88
  'x-decorator': 'FormItem',
89
89
  'x-component': 'Input',
90
- title: "\u5B57\u6BB5\u6807\u9898",
90
+ title: '字段标题',
91
91
  'x-component-props': {},
92
- description: "\u539F\u5B57\u6BB5\u6807\u9898\uFF1A".concat(null == collectionField ? void 0 : null == (_collectionField_uiSchema = collectionField.uiSchema) ? void 0 : _collectionField_uiSchema.title)
92
+ description: "原字段标题:".concat(null == collectionField ? void 0 : null == (_collectionField_uiSchema = collectionField.uiSchema) ? void 0 : _collectionField_uiSchema.title)
93
93
  },
94
94
  footer: {
95
95
  type: 'void',
@@ -145,7 +145,7 @@ const TableColumnDesigner = (props)=>{
145
145
  }
146
146
  }),
147
147
  (null == collectionField ? void 0 : collectionField.target) && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_schema_settings_index_js_namespaceObject.SchemaSettingsSelectItem, {
148
- title: "\u6807\u9898\u5B57\u6BB5",
148
+ title: '标题字段',
149
149
  options: options,
150
150
  value: null == fieldSchema ? void 0 : null == (_fieldSchema_xcomponentprops = fieldSchema['x-component-props']) ? void 0 : null == (_fieldSchema_xcomponentprops_fieldNames = _fieldSchema_xcomponentprops['fieldNames']) ? void 0 : _fieldSchema_xcomponentprops_fieldNames['label'],
151
151
  onChange: (label)=>{
@@ -80,14 +80,14 @@ const TableVoidDesigner = ()=>{
80
80
  }
81
81
  }),
82
82
  /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_schema_settings_index_js_namespaceObject.SchemaSettingsModalItem, {
83
- title: "\u8BBE\u7F6E\u6570\u636E\u8303\u56F4",
83
+ title: '设置数据范围',
84
84
  schema: {
85
85
  type: 'object',
86
- title: "\u8BBE\u7F6E\u6570\u636E\u8303\u56F4",
86
+ title: '设置数据范围',
87
87
  properties: {
88
88
  filter: {
89
89
  default: defaultFilter,
90
- title: "\u6570\u636E\u8303\u56F4",
90
+ title: '数据范围',
91
91
  enum: dataSource,
92
92
  'x-component': 'Filter',
93
93
  'x-component-props': {}
@@ -210,7 +210,7 @@ const TableVoidDesigner = ()=>{
210
210
  }
211
211
  }),
212
212
  /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_schema_settings_index_js_namespaceObject.SchemaSettingsSelectItem, {
213
- title: "\u6BCF\u9875\u663E\u793A",
213
+ title: '每页显示',
214
214
  value: (null == (_field_decoratorProps_request_params = field.decoratorProps.request.params) ? void 0 : _field_decoratorProps_request_params.pageSize) || 20,
215
215
  options: [
216
216
  {
@@ -0,0 +1,106 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.d = (exports1, definition)=>{
5
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
6
+ enumerable: true,
7
+ get: definition[key]
8
+ });
9
+ };
10
+ })();
11
+ (()=>{
12
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
13
+ })();
14
+ (()=>{
15
+ __webpack_require__.r = (exports1)=>{
16
+ if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
17
+ value: 'Module'
18
+ });
19
+ Object.defineProperty(exports1, '__esModule', {
20
+ value: true
21
+ });
22
+ };
23
+ })();
24
+ var __webpack_exports__ = {};
25
+ __webpack_require__.r(__webpack_exports__);
26
+ __webpack_require__.d(__webpack_exports__, {
27
+ EnabledToggle: ()=>EnabledToggle
28
+ });
29
+ const jsx_runtime_namespaceObject = require("react/jsx-runtime");
30
+ require("react");
31
+ const schema_namespaceObject = require("@tachybase/schema");
32
+ const external_antd_namespaceObject = require("antd");
33
+ const external_antd_style_namespaceObject = require("antd-style");
34
+ const external_react_i18next_namespaceObject = require("react-i18next");
35
+ const index_js_namespaceObject = require("../../../api-client/index.js");
36
+ const CollectionRecordProvider_js_namespaceObject = require("../../../data-source/collection-record/CollectionRecordProvider.js");
37
+ const DataBlockRequestProvider_js_namespaceObject = require("../../../data-source/data-block/DataBlockRequestProvider.js");
38
+ function _tagged_template_literal(strings, raw) {
39
+ if (!raw) raw = strings.slice(0);
40
+ return Object.freeze(Object.defineProperties(strings, {
41
+ raw: {
42
+ value: Object.freeze(raw)
43
+ }
44
+ }));
45
+ }
46
+ function _templateObject() {
47
+ const data = _tagged_template_literal([
48
+ "\n &.ant-switch-checked {\n background-color: #52c41a !important;\n }\n min-height: 16px;\n height: 16px;\n line-height: 16px;\n "
49
+ ]);
50
+ _templateObject = function() {
51
+ return data;
52
+ };
53
+ return data;
54
+ }
55
+ const useStyles = (0, external_antd_style_namespaceObject.createStyles)((param)=>{
56
+ let { css } = param;
57
+ return {
58
+ switchClass: css(_templateObject())
59
+ };
60
+ });
61
+ const EnabledToggle = (0, schema_namespaceObject.observer)(function() {
62
+ let props = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
63
+ const { styles } = useStyles();
64
+ const record = (0, CollectionRecordProvider_js_namespaceObject.useCollectionRecordData)();
65
+ const api = (0, index_js_namespaceObject.useAPIClient)();
66
+ const { refresh } = (0, DataBlockRequestProvider_js_namespaceObject.useDataBlockRequest)();
67
+ const { t } = (0, external_react_i18next_namespaceObject.useTranslation)();
68
+ const fieldName = props.fieldName || 'enabled';
69
+ var _record_fieldName;
70
+ const enabled = null != (_record_fieldName = null == record ? void 0 : record[fieldName]) ? _record_fieldName : false;
71
+ const resourceName = props.resource || 'workflows';
72
+ const checkedChildren = props.checkedChildren || t('On');
73
+ const unCheckedChildren = props.unCheckedChildren || t('Off');
74
+ const handleChange = async (checked)=>{
75
+ if (props.disabled) return;
76
+ try {
77
+ await api.resource(resourceName).update({
78
+ filterByTk: record.id,
79
+ values: {
80
+ [fieldName]: checked
81
+ }
82
+ });
83
+ external_antd_namespaceObject.message.success(t('Operation succeeded'));
84
+ refresh();
85
+ } catch (error) {
86
+ external_antd_namespaceObject.message.error(t('Operation failed'));
87
+ console.error(error);
88
+ }
89
+ };
90
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Switch, {
91
+ checked: enabled,
92
+ onChange: handleChange,
93
+ checkedChildren: checkedChildren,
94
+ unCheckedChildren: unCheckedChildren,
95
+ size: "small",
96
+ className: styles.switchClass,
97
+ disabled: props.disabled
98
+ });
99
+ });
100
+ exports.EnabledToggle = __webpack_exports__.EnabledToggle;
101
+ for(var __webpack_i__ in __webpack_exports__)if (-1 === [
102
+ "EnabledToggle"
103
+ ].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
104
+ Object.defineProperty(exports, '__esModule', {
105
+ value: true
106
+ });
@@ -47,7 +47,7 @@ function _templateObject() {
47
47
  }
48
48
  function _templateObject1() {
49
49
  const data = _tagged_template_literal([
50
- "\n // \u6269\u5927 SchemaToolbar \u7684\u9762\u79EF\n .tb-action-link {\n margin: -",
50
+ "\n // 扩大 SchemaToolbar 的面积\n .tb-action-link {\n margin: -",
51
51
  "px -",
52
52
  "px;\n padding: ",
53
53
  "px ",
@@ -1,5 +1,8 @@
1
1
  "use strict";
2
2
  var __webpack_modules__ = {
3
+ "./EnabledToggle": function(module) {
4
+ module.exports = require("./EnabledToggle.js");
5
+ },
3
6
  "./Table.ActionColumnDesigner": function(module) {
4
7
  module.exports = require("./Table.ActionColumnDesigner.js");
5
8
  },
@@ -128,6 +131,16 @@ var __webpack_exports__ = {};
128
131
  return _Table_Column_Designer__WEBPACK_IMPORTED_MODULE_5__[key];
129
132
  }).bind(0, __WEBPACK_IMPORT_KEY__);
130
133
  __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
134
+ var _EnabledToggle__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__("./EnabledToggle");
135
+ var __WEBPACK_REEXPORT_OBJECT__ = {};
136
+ for(var __WEBPACK_IMPORT_KEY__ in _EnabledToggle__WEBPACK_IMPORTED_MODULE_11__)if ([
137
+ "TableV2",
138
+ "useColumnSchema",
139
+ "default"
140
+ ].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
141
+ return _EnabledToggle__WEBPACK_IMPORTED_MODULE_11__[key];
142
+ }).bind(0, __WEBPACK_IMPORT_KEY__);
143
+ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
131
144
  const TableV2 = _Table__WEBPACK_IMPORTED_MODULE_0__.Table;
132
145
  TableV2.Column = _Table_Column__WEBPACK_IMPORTED_MODULE_2__.TableColumn;
133
146
  TableV2.Column.ActionBar = _Table_Column_ActionBar__WEBPACK_IMPORTED_MODULE_3__.TableColumnActionBar;
@@ -102,7 +102,7 @@ const CodeMirror = (props)=>{
102
102
  children: [
103
103
  /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
104
104
  className: (0, external_index_js_namespaceObject.css)(_templateObject1()),
105
- children: t("Click on the right to select variables \u2192")
105
+ children: t('Click on the right to select variables →')
106
106
  }),
107
107
  disabled ? null : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_VariableSelect_js_namespaceObject.VariableSelect, {
108
108
  className: (0, external_index_js_namespaceObject.css)(_templateObject2()),
@@ -37,7 +37,7 @@ function _tagged_template_literal(strings, raw) {
37
37
  }
38
38
  function _templateObject() {
39
39
  const data = _tagged_template_literal([
40
- "\n position: relative;\n width: 100%;\n height: 100%;\n\n &.draggable {\n cursor: move;\n padding: 0 10px;\n border-radius: 5px;\n background: #f0f0f0;\n }\n &.leftBorder {\n ::before {\n content: '';\n position: absolute;\n left: 0;\n top: 50%;\n transform: translateY(-50%);\n width: 3px;\n height: 50%;\n background-color: var(--colorPrimaryText);\n\n /* \u4F7F\u7528 clip-path \u88C1\u526A\u4E3A\u68AF\u5F62 */\n clip-path: polygon(0 0, 100% 15%, 100% 85%, 0 100%);\n }\n }\n\n &.adminMenu {\n .general-schema-designer {\n display: none;\n }\n }\n\n .wrapper {\n display: flex;\n flex-direction: row;\n justify-content: space-around;\n }\n "
40
+ "\n position: relative;\n width: 100%;\n height: 100%;\n\n &.draggable {\n cursor: move;\n padding: 0 10px;\n border-radius: 5px;\n background: #f0f0f0;\n }\n &.leftBorder {\n ::before {\n content: '';\n position: absolute;\n left: 0;\n top: 50%;\n transform: translateY(-50%);\n width: 3px;\n height: 50%;\n background-color: var(--colorPrimaryText);\n\n /* 使用 clip-path 裁剪为梯形 */\n clip-path: polygon(0 0, 100% 15%, 100% 85%, 0 100%);\n }\n }\n\n &.adminMenu {\n .general-schema-designer {\n display: none;\n }\n }\n\n .wrapper {\n display: flex;\n flex-direction: row;\n justify-content: space-around;\n }\n "
41
41
  ]);
42
42
  _templateObject = function() {
43
43
  return data;
@@ -37,7 +37,7 @@ function _tagged_template_literal(strings, raw) {
37
37
  }
38
38
  function _templateObject() {
39
39
  const data = _tagged_template_literal([
40
- "\n position: relative;\n width: 100%;\n height: 100%;\n padding: 6px 16px;\n border-radius: 8px 8px 0 0;\n &.draggable {\n cursor: move;\n padding: 0 10px;\n border-radius: 5px;\n background: #f0f0f0;\n }\n "
40
+ "\n position: relative;\n width: 100%;\n height: 100%;\n border-radius: 8px 8px 0 0;\n &.draggable {\n cursor: move;\n padding: 0 10px;\n border-radius: 5px;\n background: #f0f0f0;\n }\n "
41
41
  ]);
42
42
  _templateObject = function() {
43
43
  return data;
@@ -74,7 +74,7 @@ const EditableTitle = (props)=>{
74
74
  style: {
75
75
  color: '#bbb'
76
76
  },
77
- children: "\u672A\u547D\u540D"
77
+ children: "未命名"
78
78
  })
79
79
  })
80
80
  });
@@ -153,7 +153,7 @@ const schema = {
153
153
  ],
154
154
  fulfill: {
155
155
  state: {
156
- hidden: "{{\n !$deps[1] ||\n !smsVerifyEnabled ||\n ($deps[0] !== 'code' && $deps[0] !== undefined) // \u6709 verifyMethod \u4F46\u672A\u9009 code\n }}"
156
+ hidden: "{{\n !$deps[1] ||\n !smsVerifyEnabled ||\n ($deps[0] !== 'code' && $deps[0] !== undefined) // verifyMethod 但未选 code\n }}"
157
157
  }
158
158
  }
159
159
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tachybase/client",
3
- "version": "1.6.0",
3
+ "version": "1.6.1",
4
4
  "license": "Apache-2.0",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.mjs",
@@ -8,7 +8,7 @@
8
8
  "dependencies": {
9
9
  "@ahooksjs/use-url-state": "3.5.1",
10
10
  "@ant-design/cssinjs": "^1.24.0",
11
- "@ant-design/icons": "^5.6.1",
11
+ "@ant-design/icons": "^6.1.0",
12
12
  "@ant-design/pro-components": "2.8.9",
13
13
  "@ant-design/pro-layout": "^7.21.2",
14
14
  "@ctrl/tinycolor": "^4.2.0",
@@ -21,8 +21,8 @@
21
21
  "@floating-ui/react": "0.26.28",
22
22
  "@js-preview/excel": "^1.7.14",
23
23
  "@lottiefiles/dotlottie-react": "^0.9.3",
24
- "@tachybase/schema": "1.3.52",
25
- "@tego/client": "1.3.52",
24
+ "@tachybase/schema": "1.6.0-alpha.9",
25
+ "@tego/client": "1.6.0-alpha.9",
26
26
  "ahooks": "^3.9.0",
27
27
  "antd": "5.22.5",
28
28
  "antd-style": "3.7.1",