@nocobase/client-v2 2.1.0-alpha.30 → 2.1.0-alpha.31
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/flow/actions/linkageRulesFormValueRefresh.d.ts +10 -0
- package/es/flow/index.d.ts +1 -0
- package/es/flow/models/actions/AssociateActionModel.d.ts +19 -0
- package/es/flow/models/actions/AssociationActionUtils.d.ts +17 -0
- package/es/flow/models/actions/DisassociateActionModel.d.ts +16 -0
- package/es/flow/models/actions/index.d.ts +3 -0
- package/es/flow/models/base/GridModel.d.ts +3 -1
- package/es/flow/models/blocks/filter-form/FilterFormGridModel.d.ts +15 -6
- package/es/flow/models/blocks/shared/filterOperators.d.ts +9 -0
- package/es/flow/models/fields/AssociationFieldModel/SubTableFieldModel/SubTableColumnModel.d.ts +1 -0
- package/es/flow/models/fields/AssociationFieldModel/recordSelectSettingsUtils.d.ts +9 -0
- package/es/flow-compat/data.d.ts +9 -2
- package/es/flow-compat/index.d.ts +1 -1
- package/es/index.d.ts +1 -0
- package/es/index.mjs +90 -90
- package/lib/index.js +87 -87
- package/package.json +5 -5
- package/src/BaseApplication.tsx +1 -1
- package/src/__tests__/app.test.tsx +23 -6
- package/src/__tests__/globalDeps.test.ts +5 -0
- package/src/flow/actions/__tests__/linkageRules.formValueDrivenRefresh.test.ts +438 -0
- package/src/flow/actions/__tests__/linkageRulesRefresh.test.ts +42 -0
- package/src/flow/actions/linkageRules.tsx +8 -1
- package/src/flow/actions/linkageRulesFormValueRefresh.ts +492 -0
- package/src/flow/actions/linkageRulesRefresh.tsx +4 -2
- package/src/flow/actions/titleField.tsx +8 -3
- package/src/flow/components/FieldAssignValueInput.tsx +1 -0
- package/src/flow/components/filter/LinkageFilterItem.tsx +6 -5
- package/src/flow/components/filter/VariableFilterItem.tsx +14 -13
- package/src/flow/components/filter/__tests__/LinkageFilterItem.test.tsx +33 -0
- package/src/flow/components/filter/__tests__/VariableFilterItem.test.tsx +48 -5
- package/src/flow/index.ts +1 -0
- package/src/flow/internal/utils/__tests__/titleFieldQuickSync.test.ts +1 -0
- package/src/flow/internal/utils/titleFieldQuickSync.ts +2 -2
- package/src/flow/models/actions/AssociateActionModel.tsx +196 -0
- package/src/flow/models/actions/AssociationActionUtils.ts +90 -0
- package/src/flow/models/actions/DisassociateActionModel.tsx +57 -0
- package/src/flow/models/actions/FilterActionModel.tsx +17 -9
- package/src/flow/models/actions/__tests__/AssociationActionModel.test.ts +250 -0
- package/src/flow/models/actions/index.ts +3 -0
- package/src/flow/models/base/GridModel.tsx +21 -1
- package/src/flow/models/base/__tests__/GridModel.dragSnapshotContainer.test.ts +98 -0
- package/src/flow/models/blocks/details/DetailsItemModel.tsx +3 -0
- package/src/flow/models/blocks/filter-form/FilterFormGridModel.tsx +200 -36
- package/src/flow/models/blocks/filter-form/__tests__/FilterFormGridModel.toggleFormFieldsCollapse.test.ts +270 -1
- package/src/flow/models/blocks/filter-form/__tests__/customFieldOperators.test.tsx +23 -0
- package/src/flow/models/blocks/filter-form/customFieldOperators.ts +12 -1
- package/src/flow/models/blocks/filter-form/fields/FieldComponentProps.tsx +22 -8
- package/src/flow/models/blocks/filter-form/fields/__tests__/FilterFormCustomFieldModel.recordSelect.test.tsx +18 -0
- package/src/flow/models/blocks/filter-manager/FilterManager.ts +51 -1
- package/src/flow/models/blocks/filter-manager/__tests__/FilterManager.test.ts +75 -0
- package/src/flow/models/blocks/form/FormItemModel.tsx +48 -28
- package/src/flow/models/blocks/shared/filterOperators.ts +14 -0
- package/src/flow/models/blocks/table/TableBlockModel.tsx +19 -3
- package/src/flow/models/fields/AssociationFieldModel/RecordSelectFieldModel.tsx +5 -1
- package/src/flow/models/fields/AssociationFieldModel/SubTableFieldModel/SubTableColumnModel.tsx +21 -5
- package/src/flow/models/fields/AssociationFieldModel/recordSelectSettingsUtils.ts +20 -0
- package/src/flow/models/fields/DividerItemModel.tsx +30 -15
- package/src/flow/models/fields/mobile-components/MobileSelect.tsx +11 -3
- package/src/flow/models/fields/mobile-components/__tests__/MobileSelect.test.tsx +235 -0
- package/src/flow-compat/data.ts +25 -3
- package/src/flow-compat/index.ts +7 -1
- package/src/index.ts +1 -0
- package/src/utils/globalDeps.ts +6 -0
package/src/flow-compat/data.ts
CHANGED
|
@@ -7,15 +7,37 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import {
|
|
10
|
+
import { getCollectionFieldInterface } from '@nocobase/flow-engine';
|
|
11
|
+
import type { CollectionFieldInterfaceDataSourceManager } from '@nocobase/flow-engine';
|
|
11
12
|
|
|
12
13
|
export interface CollectionFieldOptions {
|
|
13
14
|
interface?: string;
|
|
14
15
|
[key: string]: any;
|
|
15
16
|
}
|
|
16
17
|
|
|
18
|
+
type FieldInterfaceOptions = { titleUsable?: boolean } | null | undefined;
|
|
19
|
+
|
|
17
20
|
export const DEFAULT_DATA_SOURCE_KEY = 'main';
|
|
18
21
|
|
|
19
|
-
export const
|
|
20
|
-
|
|
22
|
+
export const getFlowFieldInterfaceOptions = (
|
|
23
|
+
interfaceName: string | undefined,
|
|
24
|
+
...dataSourceManagers: Array<CollectionFieldInterfaceDataSourceManager | null | undefined>
|
|
25
|
+
) => getCollectionFieldInterface(interfaceName, ...dataSourceManagers);
|
|
26
|
+
|
|
27
|
+
export const hasFlowFieldInterfaceLookup = (
|
|
28
|
+
...dataSourceManagers: Array<CollectionFieldInterfaceDataSourceManager | null | undefined>
|
|
29
|
+
) =>
|
|
30
|
+
dataSourceManagers.some(
|
|
31
|
+
(dataSourceManager) => typeof dataSourceManager?.collectionFieldInterfaceManager?.getFieldInterface === 'function',
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
export const isTitleFieldInterface = (fieldInterfaceOptions: FieldInterfaceOptions) => {
|
|
35
|
+
return fieldInterfaceOptions?.titleUsable;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export const isTitleField = (
|
|
39
|
+
dataSourceManager: CollectionFieldInterfaceDataSourceManager | null | undefined,
|
|
40
|
+
field: CollectionFieldOptions | null | undefined,
|
|
41
|
+
) => {
|
|
42
|
+
return isTitleFieldInterface(getFlowFieldInterfaceOptions(field?.interface, dataSourceManager));
|
|
21
43
|
};
|
package/src/flow-compat/index.ts
CHANGED
|
@@ -11,7 +11,13 @@ export { Plugin } from '../Plugin';
|
|
|
11
11
|
export { useApp } from '../hooks/useApp';
|
|
12
12
|
export { usePlugin } from '../hooks/usePlugin';
|
|
13
13
|
export { ColorPicker } from './ColorPicker';
|
|
14
|
-
export {
|
|
14
|
+
export {
|
|
15
|
+
DEFAULT_DATA_SOURCE_KEY,
|
|
16
|
+
getFlowFieldInterfaceOptions,
|
|
17
|
+
hasFlowFieldInterfaceLookup,
|
|
18
|
+
isTitleField,
|
|
19
|
+
isTitleFieldInterface,
|
|
20
|
+
} from './data';
|
|
15
21
|
export { FieldValidation } from './FieldValidation';
|
|
16
22
|
export { HighPerformanceSpin } from './HighPerformanceSpin';
|
|
17
23
|
export { Icon, hasIcon, icons, registerIcon, registerIcons } from './Icon';
|
package/src/index.ts
CHANGED
|
@@ -32,4 +32,5 @@ export * from './collection-field-interface/CollectionFieldInterface';
|
|
|
32
32
|
export * from './collection-field-interface/CollectionFieldInterfaceManager';
|
|
33
33
|
export * from './collection-manager/interfaces';
|
|
34
34
|
export * from './flow';
|
|
35
|
+
export { DEFAULT_DATA_SOURCE_KEY, isTitleField, isTitleFieldInterface } from './flow-compat';
|
|
35
36
|
export { default as AntdAppProvider } from './theme/AntdAppProvider';
|
package/src/utils/globalDeps.ts
CHANGED
|
@@ -9,15 +9,18 @@
|
|
|
9
9
|
|
|
10
10
|
import * as antdCssinjs from '@ant-design/cssinjs';
|
|
11
11
|
import * as antdIcons from '@ant-design/icons';
|
|
12
|
+
import * as emotionCss from '@emotion/css';
|
|
12
13
|
import * as formilyCore from '@formily/core';
|
|
13
14
|
import * as formilyReact from '@formily/react';
|
|
14
15
|
import * as formilyReactive from '@formily/reactive';
|
|
15
16
|
import * as formilyShared from '@formily/shared';
|
|
16
17
|
import * as nocobaseClientUtils from '@nocobase/utils/client';
|
|
18
|
+
import { dayjs } from '@nocobase/utils/client';
|
|
17
19
|
import * as nocobaseFlowEngine from '@nocobase/flow-engine';
|
|
18
20
|
import * as ahooks from 'ahooks';
|
|
19
21
|
import * as antd from 'antd';
|
|
20
22
|
import * as i18next from 'i18next';
|
|
23
|
+
import lodash from 'lodash';
|
|
21
24
|
import React from 'react';
|
|
22
25
|
import ReactDOM from 'react-dom';
|
|
23
26
|
import * as reactI18next from 'react-i18next';
|
|
@@ -65,4 +68,7 @@ export function defineGlobalDeps(requirejs: RequireJS) {
|
|
|
65
68
|
|
|
66
69
|
// utils
|
|
67
70
|
requirejs.define('ahooks', () => ahooks);
|
|
71
|
+
requirejs.define('dayjs', () => dayjs);
|
|
72
|
+
requirejs.define('lodash', () => lodash);
|
|
73
|
+
requirejs.define('@emotion/css', () => emotionCss);
|
|
68
74
|
}
|