@tachybase/client 1.6.0 → 1.6.2
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.
- package/es/application/PluginManager.mjs +9 -1
- package/es/application/WebSocketClient.d.ts +19 -0
- package/es/application/WebSocketClient.mjs +26 -6
- package/es/application/utils/globalDeps.mjs +1 -1
- package/es/application/utils/remotePlugins.mjs +8 -2
- package/es/built-in/attachment-preview/previewers/file-sheet.mjs +1 -1
- package/es/built-in/pm/PluginDetail.mjs +1 -1
- package/es/collection-manager/Configuration/components/index.mjs +3 -3
- package/es/collection-manager/interfaces/components/index.mjs +2 -2
- package/es/collection-manager/interfaces/properties/operators.mjs +3 -3
- package/es/locale/index.mjs +47 -47
- package/es/modules/blocks/data-blocks/table/hooks/useTableBlockProps.mjs +4 -1
- package/es/schema-component/antd/AntdSchemaComponentProvider.mjs +3 -1
- package/es/schema-component/antd/__builtins__/hooks/usePrefixCls.mjs +1 -1
- package/es/schema-component/antd/action/Action.Area.style.mjs +1 -1
- package/es/schema-component/antd/action/Action.Designer.mjs +1 -1
- package/es/schema-component/antd/association-field/AssociationSelect.mjs +1 -1
- package/es/schema-component/antd/association-field/InternalDrawerSubTable.mjs +1 -1
- package/es/schema-component/antd/association-field/SubTabs/styles.mjs +1 -1
- package/es/schema-component/antd/block-item/BlockToolbar.mjs +16 -16
- package/es/schema-component/antd/grid-card/options.mjs +3 -3
- package/es/schema-component/antd/input/ReadPretty.mjs +1 -3
- package/es/schema-component/antd/menu/Menu.styles.mjs +1 -1
- package/es/schema-component/antd/menu/MenuSearchAdd.style.mjs +1 -1
- package/es/schema-component/antd/page/Page.mjs +3 -0
- package/es/schema-component/antd/page/Page.style.mjs +1 -1
- package/es/schema-component/antd/rich-text/style.mjs +5 -5
- package/es/schema-component/antd/rich-text/style.mjs.LICENSE.txt +5 -5
- package/es/schema-component/antd/table/Table.Column.Designer.mjs +5 -5
- package/es/schema-component/antd/table/Table.Void.Designer.mjs +4 -4
- package/es/schema-component/antd/table-v2/EnabledToggle.d.ts +9 -0
- package/es/schema-component/antd/table-v2/EnabledToggle.mjs +72 -0
- package/es/schema-component/antd/table-v2/Table.styles.mjs +1 -1
- package/es/schema-component/antd/table-v2/index.d.ts +1 -0
- package/es/schema-component/antd/table-v2/index.mjs +1 -0
- package/es/schema-component/antd/variable/CodeMirror.mjs +1 -1
- package/es/schema-component/common/sortable-item/DragHandleMenu.style.mjs +1 -1
- package/es/schema-component/common/sortable-item/DragHandlePageTab.style.mjs +1 -1
- package/es/schema-templates/BlockTemplateDetails.mjs +1 -1
- package/es/user/ChangePassword.mjs +1 -1
- package/lib/application/PluginManager.js +9 -1
- package/lib/application/WebSocketClient.js +26 -6
- package/lib/application/utils/remotePlugins.js +8 -2
- package/lib/built-in/attachment-preview/previewers/file-sheet.js +1 -1
- package/lib/built-in/pm/PluginDetail.js +1 -1
- package/lib/collection-manager/Configuration/components/index.js +3 -3
- package/lib/collection-manager/interfaces/components/index.js +2 -2
- package/lib/collection-manager/interfaces/properties/operators.js +3 -3
- package/lib/locale/en_US.js +1 -0
- package/lib/locale/es_ES.js +1 -0
- package/lib/locale/fr_FR.js +1 -0
- package/lib/locale/ko_KR.js +1 -0
- package/lib/locale/pt_BR.js +1 -0
- package/lib/locale/uk_UA.js +1 -0
- package/lib/locale/zh-CN.js +1 -0
- package/lib/locale/zh-TW.js +1 -0
- package/lib/modules/blocks/data-blocks/table/hooks/useTableBlockProps.js +4 -1
- package/lib/schema-component/antd/AntdSchemaComponentProvider.js +3 -1
- package/lib/schema-component/antd/__builtins__/hooks/usePrefixCls.js +1 -1
- package/lib/schema-component/antd/action/Action.Area.style.js +1 -1
- package/lib/schema-component/antd/action/Action.Designer.js +1 -1
- package/lib/schema-component/antd/association-field/AssociationSelect.js +1 -1
- package/lib/schema-component/antd/association-field/InternalDrawerSubTable.js +1 -1
- package/lib/schema-component/antd/association-field/SubTabs/styles.js +1 -1
- package/lib/schema-component/antd/block-item/BlockToolbar.js +16 -16
- package/lib/schema-component/antd/grid-card/options.js +3 -3
- package/lib/schema-component/antd/input/ReadPretty.js +1 -3
- package/lib/schema-component/antd/menu/Menu.styles.js +1 -1
- package/lib/schema-component/antd/menu/MenuSearchAdd.style.js +1 -1
- package/lib/schema-component/antd/page/Page.js +3 -0
- package/lib/schema-component/antd/page/Page.style.js +1 -1
- package/lib/schema-component/antd/rich-text/style.js +5 -5
- package/lib/schema-component/antd/rich-text/style.js.LICENSE.txt +5 -5
- package/lib/schema-component/antd/table/Table.Column.Designer.js +5 -5
- package/lib/schema-component/antd/table/Table.Void.Designer.js +4 -4
- package/lib/schema-component/antd/table-v2/EnabledToggle.js +106 -0
- package/lib/schema-component/antd/table-v2/Table.styles.js +1 -1
- package/lib/schema-component/antd/table-v2/index.js +13 -0
- package/lib/schema-component/antd/variable/CodeMirror.js +1 -1
- package/lib/schema-component/common/sortable-item/DragHandleMenu.style.js +1 -1
- package/lib/schema-component/common/sortable-item/DragHandlePageTab.style.js +1 -1
- package/lib/schema-templates/BlockTemplateDetails.js +1 -1
- package/lib/user/ChangePassword.js +1 -1
- package/package.json +4 -4
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
3
|
import { useFieldSchema } from "@tachybase/schema";
|
|
4
|
-
import { css } from "@emotion/css";
|
|
5
4
|
import { usePrefixCls } from "@tego/client";
|
|
5
|
+
import { css } from "@emotion/css";
|
|
6
6
|
import { Image, Typography } from "antd";
|
|
7
7
|
import classnames from "classnames";
|
|
8
8
|
import { useCompile } from "../../index.mjs";
|
|
@@ -32,8 +32,6 @@ const _Input = (props)=>{
|
|
|
32
32
|
return /*#__PURE__*/ jsxs("div", {
|
|
33
33
|
className: classnames(prefixCls, props.className),
|
|
34
34
|
style: {
|
|
35
|
-
display: 'flex',
|
|
36
|
-
alignItems: 'center',
|
|
37
35
|
overflowWrap: 'break-word',
|
|
38
36
|
whiteSpace: 'normal',
|
|
39
37
|
...props.style
|
|
@@ -28,7 +28,7 @@ function _templateObject1() {
|
|
|
28
28
|
function _templateObject2() {
|
|
29
29
|
const data = _tagged_template_literal([
|
|
30
30
|
"\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: ",
|
|
31
|
-
";\n\n /*
|
|
31
|
+
";\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: ",
|
|
32
32
|
";\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 "
|
|
33
33
|
]);
|
|
34
34
|
_templateObject2 = function() {
|
|
@@ -9,7 +9,7 @@ function _tagged_template_literal(strings, raw) {
|
|
|
9
9
|
}
|
|
10
10
|
function _templateObject() {
|
|
11
11
|
const data = _tagged_template_literal([
|
|
12
|
-
"\n /* NOTE:
|
|
12
|
+
"\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 "
|
|
13
13
|
]);
|
|
14
14
|
_templateObject = function() {
|
|
15
15
|
return data;
|
|
@@ -9,7 +9,7 @@ function _tagged_template_literal(strings, raw) {
|
|
|
9
9
|
}
|
|
10
10
|
function _templateObject() {
|
|
11
11
|
const data = _tagged_template_literal([
|
|
12
|
-
"\n .ant-tabs-nav-wrap.ant-tabs-nav-wrap {\n flex: none;\n }\n .ant-tabs-tab.ant-tabs-tab.ant-tabs-tab {\n
|
|
12
|
+
"\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 "
|
|
13
13
|
]);
|
|
14
14
|
_templateObject = function() {
|
|
15
15
|
return data;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/*! For license information please see style.mjs.LICENSE.txt */
|
|
2
2
|
import { genStyleHook } from "../__builtins__/index.mjs";
|
|
3
|
-
/*!
|
|
4
|
-
* Quill Editor v1.3.7
|
|
5
|
-
* https://quilljs.com/
|
|
6
|
-
* Copyright (c) 2014, Jason Chen
|
|
7
|
-
* Copyright (c) 2013, salesforce.com
|
|
3
|
+
/*!
|
|
4
|
+
* Quill Editor v1.3.7
|
|
5
|
+
* https://quilljs.com/
|
|
6
|
+
* Copyright (c) 2014, Jason Chen
|
|
7
|
+
* Copyright (c) 2013, salesforce.com
|
|
8
8
|
*/ const useStyles = genStyleHook('tb-rich-text', (token)=>{
|
|
9
9
|
const { componentCls } = token;
|
|
10
10
|
return {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Quill Editor v1.3.7
|
|
3
|
-
* https://quilljs.com/
|
|
4
|
-
* Copyright (c) 2014, Jason Chen
|
|
5
|
-
* Copyright (c) 2013, salesforce.com
|
|
1
|
+
/*!
|
|
2
|
+
* Quill Editor v1.3.7
|
|
3
|
+
* https://quilljs.com/
|
|
4
|
+
* Copyright (c) 2014, Jason Chen
|
|
5
|
+
* Copyright (c) 2013, salesforce.com
|
|
6
6
|
*/
|
|
@@ -33,9 +33,9 @@ const TableColumnDesigner = (props)=>{
|
|
|
33
33
|
return /*#__PURE__*/ jsxs(GeneralSchemaDesigner, {
|
|
34
34
|
children: [
|
|
35
35
|
/*#__PURE__*/ jsx(SchemaSettingsPopupItem, {
|
|
36
|
-
title:
|
|
36
|
+
title: '编辑',
|
|
37
37
|
schema: {
|
|
38
|
-
title:
|
|
38
|
+
title: '编辑字段',
|
|
39
39
|
'x-component': 'Action.Modal',
|
|
40
40
|
'x-component-props': {
|
|
41
41
|
width: 520
|
|
@@ -49,9 +49,9 @@ const TableColumnDesigner = (props)=>{
|
|
|
49
49
|
title: {
|
|
50
50
|
'x-decorator': 'FormItem',
|
|
51
51
|
'x-component': 'Input',
|
|
52
|
-
title:
|
|
52
|
+
title: '字段标题',
|
|
53
53
|
'x-component-props': {},
|
|
54
|
-
description: "
|
|
54
|
+
description: "原字段标题:".concat(null == collectionField ? void 0 : null == (_collectionField_uiSchema = collectionField.uiSchema) ? void 0 : _collectionField_uiSchema.title)
|
|
55
55
|
},
|
|
56
56
|
footer: {
|
|
57
57
|
type: 'void',
|
|
@@ -107,7 +107,7 @@ const TableColumnDesigner = (props)=>{
|
|
|
107
107
|
}
|
|
108
108
|
}),
|
|
109
109
|
(null == collectionField ? void 0 : collectionField.target) && /*#__PURE__*/ jsx(SchemaSettingsSelectItem, {
|
|
110
|
-
title:
|
|
110
|
+
title: '标题字段',
|
|
111
111
|
options: options,
|
|
112
112
|
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'],
|
|
113
113
|
onChange: (label)=>{
|
|
@@ -52,14 +52,14 @@ const TableVoidDesigner = ()=>{
|
|
|
52
52
|
}
|
|
53
53
|
}),
|
|
54
54
|
/*#__PURE__*/ jsx(SchemaSettingsModalItem, {
|
|
55
|
-
title:
|
|
55
|
+
title: '设置数据范围',
|
|
56
56
|
schema: {
|
|
57
57
|
type: 'object',
|
|
58
|
-
title:
|
|
58
|
+
title: '设置数据范围',
|
|
59
59
|
properties: {
|
|
60
60
|
filter: {
|
|
61
61
|
default: defaultFilter,
|
|
62
|
-
title:
|
|
62
|
+
title: '数据范围',
|
|
63
63
|
enum: dataSource,
|
|
64
64
|
'x-component': 'Filter',
|
|
65
65
|
'x-component-props': {}
|
|
@@ -182,7 +182,7 @@ const TableVoidDesigner = ()=>{
|
|
|
182
182
|
}
|
|
183
183
|
}),
|
|
184
184
|
/*#__PURE__*/ jsx(SchemaSettingsSelectItem, {
|
|
185
|
-
title:
|
|
185
|
+
title: '每页显示',
|
|
186
186
|
value: (null == (_field_decoratorProps_request_params = field.decoratorProps.request.params) ? void 0 : _field_decoratorProps_request_params.pageSize) || 20,
|
|
187
187
|
options: [
|
|
188
188
|
{
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface EnabledToggleProps {
|
|
3
|
+
resource?: string;
|
|
4
|
+
checkedChildren?: string;
|
|
5
|
+
unCheckedChildren?: string;
|
|
6
|
+
fieldName?: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare const EnabledToggle: React.MemoExoticComponent<import("@tachybase/schema").ReactFC<EnabledToggleProps>>;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import { observer } from "@tachybase/schema";
|
|
4
|
+
import { Switch, message } from "antd";
|
|
5
|
+
import { createStyles } from "antd-style";
|
|
6
|
+
import { useTranslation } from "react-i18next";
|
|
7
|
+
import { useAPIClient } from "../../../api-client/index.mjs";
|
|
8
|
+
import { useCollectionRecordData } from "../../../data-source/collection-record/CollectionRecordProvider.mjs";
|
|
9
|
+
import { useDataBlockRequest } from "../../../data-source/data-block/DataBlockRequestProvider.mjs";
|
|
10
|
+
function _tagged_template_literal(strings, raw) {
|
|
11
|
+
if (!raw) raw = strings.slice(0);
|
|
12
|
+
return Object.freeze(Object.defineProperties(strings, {
|
|
13
|
+
raw: {
|
|
14
|
+
value: Object.freeze(raw)
|
|
15
|
+
}
|
|
16
|
+
}));
|
|
17
|
+
}
|
|
18
|
+
function _templateObject() {
|
|
19
|
+
const data = _tagged_template_literal([
|
|
20
|
+
"\n &.ant-switch-checked {\n background-color: #52c41a !important;\n }\n min-height: 16px;\n height: 16px;\n line-height: 16px;\n "
|
|
21
|
+
]);
|
|
22
|
+
_templateObject = function() {
|
|
23
|
+
return data;
|
|
24
|
+
};
|
|
25
|
+
return data;
|
|
26
|
+
}
|
|
27
|
+
const useStyles = createStyles((param)=>{
|
|
28
|
+
let { css } = param;
|
|
29
|
+
return {
|
|
30
|
+
switchClass: css(_templateObject())
|
|
31
|
+
};
|
|
32
|
+
});
|
|
33
|
+
const EnabledToggle = observer(function() {
|
|
34
|
+
let props = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
|
|
35
|
+
const { styles } = useStyles();
|
|
36
|
+
const record = useCollectionRecordData();
|
|
37
|
+
const api = useAPIClient();
|
|
38
|
+
const { refresh } = useDataBlockRequest();
|
|
39
|
+
const { t } = useTranslation();
|
|
40
|
+
const fieldName = props.fieldName || 'enabled';
|
|
41
|
+
var _record_fieldName;
|
|
42
|
+
const enabled = null != (_record_fieldName = null == record ? void 0 : record[fieldName]) ? _record_fieldName : false;
|
|
43
|
+
const resourceName = props.resource || 'workflows';
|
|
44
|
+
const checkedChildren = props.checkedChildren || t('On');
|
|
45
|
+
const unCheckedChildren = props.unCheckedChildren || t('Off');
|
|
46
|
+
const handleChange = async (checked)=>{
|
|
47
|
+
if (props.disabled) return;
|
|
48
|
+
try {
|
|
49
|
+
await api.resource(resourceName).update({
|
|
50
|
+
filterByTk: record.id,
|
|
51
|
+
values: {
|
|
52
|
+
[fieldName]: checked
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
message.success(t('Operation succeeded'));
|
|
56
|
+
refresh();
|
|
57
|
+
} catch (error) {
|
|
58
|
+
message.error(t('Operation failed'));
|
|
59
|
+
console.error(error);
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
return /*#__PURE__*/ jsx(Switch, {
|
|
63
|
+
checked: enabled,
|
|
64
|
+
onChange: handleChange,
|
|
65
|
+
checkedChildren: checkedChildren,
|
|
66
|
+
unCheckedChildren: unCheckedChildren,
|
|
67
|
+
size: "small",
|
|
68
|
+
className: styles.switchClass,
|
|
69
|
+
disabled: props.disabled
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
export { EnabledToggle };
|
|
@@ -19,7 +19,7 @@ function _templateObject() {
|
|
|
19
19
|
}
|
|
20
20
|
function _templateObject1() {
|
|
21
21
|
const data = _tagged_template_literal([
|
|
22
|
-
"\n //
|
|
22
|
+
"\n // 扩大 SchemaToolbar 的面积\n .tb-action-link {\n margin: -",
|
|
23
23
|
"px -",
|
|
24
24
|
"px;\n padding: ",
|
|
25
25
|
"px ",
|
|
@@ -10,6 +10,7 @@ export * from "./TableBlockDesigner.mjs";
|
|
|
10
10
|
export * from "./TableField.mjs";
|
|
11
11
|
export * from "./TableSelectorDesigner.mjs";
|
|
12
12
|
export * from "./Table.Column.Designer.mjs";
|
|
13
|
+
export * from "./EnabledToggle.mjs";
|
|
13
14
|
const TableV2 = Table;
|
|
14
15
|
TableV2.Column = TableColumn;
|
|
15
16
|
TableV2.Column.ActionBar = TableColumnActionBar;
|
|
@@ -74,7 +74,7 @@ const CodeMirror_CodeMirror = (props)=>{
|
|
|
74
74
|
children: [
|
|
75
75
|
/*#__PURE__*/ jsx("div", {
|
|
76
76
|
className: css(_templateObject1()),
|
|
77
|
-
children: t(
|
|
77
|
+
children: t('Click on the right to select variables →')
|
|
78
78
|
}),
|
|
79
79
|
disabled ? null : /*#__PURE__*/ jsx(VariableSelect, {
|
|
80
80
|
className: css(_templateObject2()),
|
|
@@ -9,7 +9,7 @@ function _tagged_template_literal(strings, raw) {
|
|
|
9
9
|
}
|
|
10
10
|
function _templateObject() {
|
|
11
11
|
const data = _tagged_template_literal([
|
|
12
|
-
"\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 /*
|
|
12
|
+
"\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 "
|
|
13
13
|
]);
|
|
14
14
|
_templateObject = function() {
|
|
15
15
|
return data;
|
|
@@ -9,7 +9,7 @@ function _tagged_template_literal(strings, raw) {
|
|
|
9
9
|
}
|
|
10
10
|
function _templateObject() {
|
|
11
11
|
const data = _tagged_template_literal([
|
|
12
|
-
"\n position: relative;\n width: 100%;\n height: 100%;\n
|
|
12
|
+
"\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 "
|
|
13
13
|
]);
|
|
14
14
|
_templateObject = function() {
|
|
15
15
|
return data;
|
|
@@ -115,7 +115,7 @@ const schema = {
|
|
|
115
115
|
],
|
|
116
116
|
fulfill: {
|
|
117
117
|
state: {
|
|
118
|
-
hidden: "{{\n !$deps[1] ||\n !smsVerifyEnabled ||\n ($deps[0] !== 'code' && $deps[0] !== undefined) //
|
|
118
|
+
hidden: "{{\n !$deps[1] ||\n !smsVerifyEnabled ||\n ($deps[0] !== 'code' && $deps[0] !== undefined) // 有 verifyMethod 但未选 code\n }}"
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
121
|
}
|
|
@@ -62,9 +62,17 @@ class PluginManager {
|
|
|
62
62
|
pluginData: pluginList,
|
|
63
63
|
devDynamicImport: this.app.devDynamicImport
|
|
64
64
|
});
|
|
65
|
-
for await (const [name, pluginClass] of plugins){
|
|
65
|
+
for await (const [name, pluginClass] of plugins)try {
|
|
66
66
|
const info = pluginList.find((item)=>item.name === name);
|
|
67
67
|
await this.add(pluginClass, info);
|
|
68
|
+
} catch (error) {
|
|
69
|
+
console.error("[PluginManager.initRemotePlugins] ✗ Error adding plugin ".concat(name, ":"), {
|
|
70
|
+
error,
|
|
71
|
+
errorMessage: null == error ? void 0 : error.message,
|
|
72
|
+
errorStack: null == error ? void 0 : error.stack,
|
|
73
|
+
pluginClass
|
|
74
|
+
});
|
|
75
|
+
throw error;
|
|
68
76
|
}
|
|
69
77
|
}
|
|
70
78
|
async add(plugin) {
|
|
@@ -45,22 +45,42 @@ class WebSocketClient {
|
|
|
45
45
|
const options = this.app.getOptions();
|
|
46
46
|
const apiBaseURL = null == options ? void 0 : null == (_options_apiClient = options.apiClient) ? void 0 : _options_apiClient['baseURL'];
|
|
47
47
|
if (!apiBaseURL) return;
|
|
48
|
+
const locationHostname = window.__tachybase_location_hostname__;
|
|
49
|
+
const windowHostname = window.location.hostname;
|
|
50
|
+
let hostname = locationHostname || windowHostname;
|
|
51
|
+
const hostnameFixer = window.__tachybase_fix_websocket_hostname__;
|
|
52
|
+
if ('function' == typeof hostnameFixer) {
|
|
53
|
+
const fixedHostname = hostnameFixer(hostname);
|
|
54
|
+
if (fixedHostname && 'string' == typeof fixedHostname) hostname = fixedHostname;
|
|
55
|
+
}
|
|
48
56
|
const subApp = (0, client_namespaceObject.getSubAppName)(this.app.getPublicPath());
|
|
49
|
-
const queryString = subApp ? "?__appName=".concat(subApp) : "?__hostname=".concat(
|
|
57
|
+
const queryString = subApp ? "?__appName=".concat(subApp) : "?__hostname=".concat(hostname);
|
|
50
58
|
const wsPath = this.options.basename || '/ws';
|
|
59
|
+
const hostnameWasFixed = hostname !== window.location.hostname;
|
|
51
60
|
if (this.options.url) {
|
|
52
61
|
const url = new URL(this.options.url);
|
|
53
|
-
if (
|
|
54
|
-
const protocol = '
|
|
55
|
-
|
|
62
|
+
if (hostnameWasFixed) {
|
|
63
|
+
const protocol = 'wss:' === url.protocol ? 'wss' : 'ws';
|
|
64
|
+
const port = url.port || '';
|
|
65
|
+
const host = port ? "".concat(hostname, ":").concat(port) : hostname;
|
|
66
|
+
return "".concat(protocol, "://").concat(host).concat(wsPath).concat(queryString);
|
|
56
67
|
}
|
|
57
68
|
return "".concat(this.options.url).concat(queryString);
|
|
58
69
|
}
|
|
59
70
|
try {
|
|
60
71
|
const url = new URL(apiBaseURL);
|
|
61
|
-
|
|
72
|
+
const finalHostname = hostnameWasFixed ? hostname : url.hostname;
|
|
73
|
+
const port = url.port || '';
|
|
74
|
+
const host = port ? "".concat(finalHostname, ":").concat(port) : finalHostname;
|
|
75
|
+
return "".concat('https:' === url.protocol ? 'wss' : 'ws', "://").concat(host).concat(wsPath).concat(queryString);
|
|
62
76
|
} catch (error) {
|
|
63
|
-
|
|
77
|
+
let port = location.port;
|
|
78
|
+
if (!port && apiBaseURL) try {
|
|
79
|
+
const apiUrl = new URL(apiBaseURL);
|
|
80
|
+
port = apiUrl.port;
|
|
81
|
+
} catch (e) {}
|
|
82
|
+
const host = port ? "".concat(hostname, ":").concat(port) : hostname;
|
|
83
|
+
return "".concat('https:' === location.protocol ? 'wss' : 'ws', "://").concat(host).concat(wsPath).concat(queryString);
|
|
64
84
|
}
|
|
65
85
|
}
|
|
66
86
|
get reconnectAttempts() {
|
|
@@ -105,12 +105,18 @@ function getRemotePlugins(requirejs) {
|
|
|
105
105
|
definePluginClient(packageName);
|
|
106
106
|
});
|
|
107
107
|
return new Promise((resolve, reject)=>{
|
|
108
|
-
requirejs.requirejs(packageNames, processRemotePlugins(pluginData, resolve),
|
|
108
|
+
requirejs.requirejs(packageNames, processRemotePlugins(pluginData, resolve), (error)=>{
|
|
109
|
+
console.error('[getRemotePlugins] requirejs error:', error);
|
|
110
|
+
reject(error);
|
|
111
|
+
});
|
|
109
112
|
});
|
|
110
113
|
}
|
|
111
114
|
async function getPlugins(options) {
|
|
112
115
|
const { requirejs, pluginData, devDynamicImport } = options;
|
|
113
|
-
if (0 === pluginData.length)
|
|
116
|
+
if (0 === pluginData.length) {
|
|
117
|
+
console.warn('[getPlugins] ⚠ Early return: pluginData.length === 0');
|
|
118
|
+
return [];
|
|
119
|
+
}
|
|
114
120
|
const res = [];
|
|
115
121
|
const resolveDevPlugins = {};
|
|
116
122
|
if (devDynamicImport) {
|
|
@@ -327,7 +327,7 @@ const PluginDetail = (param)=>{
|
|
|
327
327
|
}),
|
|
328
328
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_antd_namespaceObject.Space, {
|
|
329
329
|
split: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
330
|
-
children: "\xa0
|
|
330
|
+
children: "\xa0•\xa0"
|
|
331
331
|
}),
|
|
332
332
|
children: [
|
|
333
333
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
@@ -57,7 +57,7 @@ const SourceForeignKey = (0, schema_namespaceObject.observer)(()=>{
|
|
|
57
57
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
58
58
|
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Select, {
|
|
59
59
|
allowClear: true,
|
|
60
|
-
placeholder:
|
|
60
|
+
placeholder: '留空时,自动生成 FK 字段',
|
|
61
61
|
disabled: field.disabled,
|
|
62
62
|
value: field.value,
|
|
63
63
|
options: getCollectionFields(collection.name).filter((field)=>field.type).map((field)=>{
|
|
@@ -80,7 +80,7 @@ const ThroughForeignKey = (0, schema_namespaceObject.observer)(()=>{
|
|
|
80
80
|
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Select, {
|
|
81
81
|
allowClear: true,
|
|
82
82
|
popupMatchSelectWidth: false,
|
|
83
|
-
placeholder:
|
|
83
|
+
placeholder: '留空时,自动生成 FK 字段',
|
|
84
84
|
disabled: field.disabled,
|
|
85
85
|
value: field.value,
|
|
86
86
|
options: getCollectionFields(form.values.through).filter((field)=>field.type).map((field)=>{
|
|
@@ -103,7 +103,7 @@ const TargetForeignKey = (0, schema_namespaceObject.observer)(()=>{
|
|
|
103
103
|
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Select, {
|
|
104
104
|
allowClear: true,
|
|
105
105
|
popupMatchSelectWidth: false,
|
|
106
|
-
placeholder:
|
|
106
|
+
placeholder: '留空时,自动生成 FK 字段',
|
|
107
107
|
disabled: field.disabled,
|
|
108
108
|
value: field.value,
|
|
109
109
|
options: getCollectionFields(form.values.target).filter((field)=>field.type).map((field)=>{
|
|
@@ -67,7 +67,7 @@ const ForeignKey1 = ()=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div
|
|
|
67
67
|
children: [
|
|
68
68
|
"Foreign key 1 ",
|
|
69
69
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("a", {
|
|
70
|
-
children: "
|
|
70
|
+
children: "新建"
|
|
71
71
|
})
|
|
72
72
|
]
|
|
73
73
|
});
|
|
@@ -75,7 +75,7 @@ const ForeignKey2 = ()=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div
|
|
|
75
75
|
children: [
|
|
76
76
|
"Foreign key 2 ",
|
|
77
77
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("a", {
|
|
78
|
-
children: "
|
|
78
|
+
children: "新建"
|
|
79
79
|
})
|
|
80
80
|
]
|
|
81
81
|
});
|
|
@@ -181,7 +181,7 @@ const number = [
|
|
|
181
181
|
selected: true
|
|
182
182
|
},
|
|
183
183
|
{
|
|
184
|
-
label: '{{t("
|
|
184
|
+
label: '{{t("≠")}}',
|
|
185
185
|
value: '$ne'
|
|
186
186
|
},
|
|
187
187
|
{
|
|
@@ -189,7 +189,7 @@ const number = [
|
|
|
189
189
|
value: '$gt'
|
|
190
190
|
},
|
|
191
191
|
{
|
|
192
|
-
label: '{{t("
|
|
192
|
+
label: '{{t("≥")}}',
|
|
193
193
|
value: '$gte'
|
|
194
194
|
},
|
|
195
195
|
{
|
|
@@ -197,7 +197,7 @@ const number = [
|
|
|
197
197
|
value: '$lt'
|
|
198
198
|
},
|
|
199
199
|
{
|
|
200
|
-
label: '{{t("
|
|
200
|
+
label: '{{t("≤")}}',
|
|
201
201
|
value: '$lte'
|
|
202
202
|
},
|
|
203
203
|
{
|
package/lib/locale/en_US.js
CHANGED
package/lib/locale/es_ES.js
CHANGED
|
@@ -67,6 +67,7 @@ module.exports = {
|
|
|
67
67
|
"All events": "Todos los eventos",
|
|
68
68
|
"All plugin settings": "Configuraci\xF3n de todos los plugins",
|
|
69
69
|
"All records": "Todos los registros",
|
|
70
|
+
"All statuses": "Todos",
|
|
70
71
|
Allow: "Permitir",
|
|
71
72
|
"Allow access": "Permitir acceso",
|
|
72
73
|
"Allow action": "Permitir acci\xF3n",
|
package/lib/locale/fr_FR.js
CHANGED
|
@@ -65,6 +65,7 @@ module.exports = {
|
|
|
65
65
|
"All events": "Tous les \xE9v\xE9nements",
|
|
66
66
|
"All plugin settings": "Tous les param\xE8tres de plugin",
|
|
67
67
|
"All records": "Tous les enregistrements",
|
|
68
|
+
"All statuses": "Tous",
|
|
68
69
|
Allow: "Autoriser",
|
|
69
70
|
"Allow access": "Autoriser l'acc\xE8s",
|
|
70
71
|
"Allow action": "Autoriser l'action",
|
package/lib/locale/ko_KR.js
CHANGED
|
@@ -67,6 +67,7 @@ module.exports = {
|
|
|
67
67
|
"All events": "\uBAA8\uB4E0 \uC774\uBCA4\uD2B8",
|
|
68
68
|
"All plugin settings": "\uBAA8\uB4E0 \uD50C\uB7EC\uADF8\uC778 \uC124\uC815",
|
|
69
69
|
"All records": "\uBAA8\uB4E0 \uB370\uC774\uD130",
|
|
70
|
+
"All statuses": "\uC804\uCCB4",
|
|
70
71
|
Allow: "\uD5C8\uC6A9",
|
|
71
72
|
"Allow access": "\uC811\uADFC \uD5C8\uC6A9",
|
|
72
73
|
"Allow action": "\uC870\uC791 \uD5C8\uC6A9",
|
package/lib/locale/pt_BR.js
CHANGED
|
@@ -63,6 +63,7 @@ module.exports = {
|
|
|
63
63
|
"All events": "Todos os eventos",
|
|
64
64
|
"All plugin settings": "Configura\xE7\xF5es de todos os plugins",
|
|
65
65
|
"All records": "Todos os registros",
|
|
66
|
+
"All statuses": "Todos",
|
|
66
67
|
Allow: "Permitir",
|
|
67
68
|
"Allow access": "Permitir acesso",
|
|
68
69
|
"Allow action": "Permitir a\xE7\xE3o",
|
package/lib/locale/uk_UA.js
CHANGED
|
@@ -66,6 +66,7 @@ module.exports = {
|
|
|
66
66
|
"All events": "\u0423\u0441\u0456 \u043F\u043E\u0434\u0456\u0457",
|
|
67
67
|
"All plugin settings": "\u0412\u0441\u0456 \u043D\u0430\u043B\u0430\u0448\u0442\u0443\u0432\u0430\u043D\u043D\u044F \u043F\u043B\u0430\u0433\u0456\u043D\u0456\u0432",
|
|
68
68
|
"All records": "\u0412\u0441\u0456 \u0437\u0430\u043F\u0438\u0441\u0438",
|
|
69
|
+
"All statuses": "\u0412\u0441\u0456",
|
|
69
70
|
Allow: "\u0414\u043E\u0437\u0432\u043E\u043B\u0438\u0442\u0438",
|
|
70
71
|
"Allow access": "\u0414\u043E\u0437\u0432\u043E\u043B\u0438\u0442\u0438 \u0434\u043E\u0441\u0442\u0443\u043F",
|
|
71
72
|
"Allow action": "\u0414\u043E\u0437\u0432\u043E\u043B\u0438\u0442\u0438 \u0434\u0456\u044E",
|
package/lib/locale/zh-CN.js
CHANGED
|
@@ -76,6 +76,7 @@ module.exports = {
|
|
|
76
76
|
"All events": "\u6240\u6709\u65E5\u7A0B",
|
|
77
77
|
"All plugin settings": "\u6240\u6709\u63D2\u4EF6\u914D\u7F6E",
|
|
78
78
|
"All records": "\u6240\u6709\u6570\u636E",
|
|
79
|
+
"All statuses": "\u5168\u90E8",
|
|
79
80
|
AllProducts: "\u5168\u90E8\u5546\u54C1",
|
|
80
81
|
Allow: "\u5141\u8BB8",
|
|
81
82
|
"Allow access": "\u5141\u8BB8\u8BBF\u95EE",
|
package/lib/locale/zh-TW.js
CHANGED
|
@@ -67,6 +67,7 @@ module.exports = {
|
|
|
67
67
|
"All events": "\u6240\u6709\u4E8B\u4EF6",
|
|
68
68
|
"All plugin settings": "\u6240\u6709\u63D2\u4EF6\u8A2D\u5B9A",
|
|
69
69
|
"All records": "\u6240\u6709\u8CC7\u6599",
|
|
70
|
+
"All statuses": "\u5168\u90E8",
|
|
70
71
|
Allow: "\u5141\u8A31",
|
|
71
72
|
"Allow access": "\u5141\u8A31\u8A2A\u554F",
|
|
72
73
|
"Allow action": "\u5141\u8A31\u52D5\u4F5C",
|
|
@@ -168,7 +168,10 @@ const useTableBlockProps = ()=>{
|
|
|
168
168
|
prevMergedFilter = currFilter;
|
|
169
169
|
dataBlocks.forEach((item)=>{
|
|
170
170
|
const targetsUidList = targets.map((targetItem)=>targetItem.uid);
|
|
171
|
-
if (targetsUidList.includes(item.uid) && !item.associatedFields.find((assItem)=>
|
|
171
|
+
if (targetsUidList.includes(item.uid) && !item.associatedFields.find((assItem)=>{
|
|
172
|
+
var _target_field;
|
|
173
|
+
return assItem.name === target.field || (null == (_target_field = target.field) ? void 0 : _target_field.includes(assItem.name));
|
|
174
|
+
})) {
|
|
172
175
|
const prevFlatItems = external_flat_default()(prevMergedFilter);
|
|
173
176
|
Object.entries(prevFlatItems).forEach((param)=>{
|
|
174
177
|
let [key, prevItem] = param;
|