@nocobase/client-v2 2.4.0-alpha.5 → 2.4.0-alpha.6
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/components/form/ScanInput/useCodeScanner.d.ts +12 -2
- package/es/components/form/ScanInput/zxingWasmDecoder.d.ts +9 -0
- package/es/flow/components/FieldAssignValueInput.d.ts +2 -0
- package/es/flow/components/field-value-variable/FieldValueVariableInput.d.ts +1 -0
- package/es/flow/components/filter/VariableFilterItem.d.ts +7 -0
- package/es/index.mjs +16 -16
- package/lib/index.js +111 -111
- package/package.json +9 -8
- package/src/components/form/ScanInput/CodeScanner.tsx +3 -1
- package/src/components/form/ScanInput/__tests__/CodeScanner.test.tsx +7 -1
- package/src/components/form/ScanInput/__tests__/useCodeScanner.test.tsx +182 -8
- package/src/components/form/ScanInput/__tests__/zxingWasmDecoder.test.ts +78 -0
- package/src/components/form/ScanInput/useCodeScanner.ts +135 -20
- package/src/components/form/ScanInput/zxingWasmDecoder.ts +64 -0
- package/src/flow/admin-shell/admin-layout/__tests__/TopbarActionsBar.test.tsx +39 -0
- package/src/flow/components/FieldAssignValueInput.tsx +4 -0
- package/src/flow/components/field-value-variable/FieldValueVariableInput.tsx +21 -12
- package/src/flow/components/field-value-variable/__tests__/FieldValueVariableInput.test.tsx +9 -0
- package/src/flow/components/filter/VariableFilterItem.tsx +11 -3
- package/src/flow/components/filter/__tests__/VariableFilterItem.rightMetaTree.test.tsx +158 -0
- package/src/flow/models/base/GridModel.tsx +0 -1
- package/src/flow/models/blocks/assign-form/AssignFormGridModel.tsx +22 -1
- package/src/flow/models/blocks/assign-form/AssignFormItemModel.tsx +14 -3
- package/src/flow/models/blocks/assign-form/__tests__/assignFieldValuesFlow.editor.test.tsx +140 -0
- package/src/flow/models/blocks/filter-form/__tests__/FilterFormGridModel.toggleFormFieldsCollapse.test.ts +29 -0
- package/src/flow/models/blocks/filter-form/fields/FieldComponentProps.tsx +1 -1
- package/src/flow/models/blocks/filter-form/fields/__tests__/FieldComponentProps.options.test.tsx +61 -0
- package/src/flow/models/blocks/form/__tests__/popupLinkage.test.tsx +175 -0
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
|
+
import type { RefObject } from 'react';
|
|
9
10
|
import type { CodeFormatsToSupport } from './types';
|
|
10
11
|
type ScannerSize = {
|
|
11
12
|
width: number;
|
|
@@ -16,17 +17,26 @@ type UseCodeScannerOptions = {
|
|
|
16
17
|
elementId: string;
|
|
17
18
|
formatsToSupport?: CodeFormatsToSupport;
|
|
18
19
|
onScannerSizeChanged?: (size: ScannerSize) => void;
|
|
20
|
+
scanViewportRef?: RefObject<HTMLElement | null>;
|
|
19
21
|
onScanSuccess: (text: string) => void;
|
|
20
22
|
onScanFailure?: () => void;
|
|
21
23
|
onCameraStartFailure?: (error: unknown) => void;
|
|
22
24
|
};
|
|
25
|
+
type QrFrameCaptureLimits = {
|
|
26
|
+
maxHeight: number;
|
|
27
|
+
maxPixels: number;
|
|
28
|
+
maxWidth: number;
|
|
29
|
+
};
|
|
23
30
|
export declare const DEFAULT_CODE_FORMATS: CodeFormatsToSupport;
|
|
24
31
|
export declare function getCodeScanBoxSize(width: number, height: number): {
|
|
25
32
|
width: number;
|
|
26
33
|
height: number;
|
|
27
34
|
};
|
|
28
|
-
export declare function
|
|
29
|
-
export declare function
|
|
35
|
+
export declare function isIOSBrowser(): boolean;
|
|
36
|
+
export declare function getQrVideoFrameImageData(video: HTMLVideoElement, canvas: HTMLCanvasElement, scanViewport?: Element, limits?: QrFrameCaptureLimits): ImageData;
|
|
37
|
+
export declare function scanQrVideoFrame(video: HTMLVideoElement, canvas: HTMLCanvasElement, scanViewport?: Element): string;
|
|
38
|
+
export declare function scanQrVideoFrameWithZxingWasm(video: HTMLVideoElement, canvas: HTMLCanvasElement, scanViewport: Element): Promise<string>;
|
|
39
|
+
export declare function useCodeScanner({ enabled, elementId, formatsToSupport, onScannerSizeChanged, scanViewportRef, onScanSuccess, onScanFailure, onCameraStartFailure, }: UseCodeScannerOptions): {
|
|
30
40
|
startScanFile: (file: File) => Promise<void>;
|
|
31
41
|
};
|
|
32
42
|
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
export declare function decodeQrCodeWithZxingWasm(imageData: ImageData): Promise<string>;
|
|
@@ -34,6 +34,8 @@ interface Props {
|
|
|
34
34
|
enableDateVariableAsConstant?: boolean;
|
|
35
35
|
/** 是否允许在变量选择器中使用 RunJS。默认 true,保持历史行为。 */
|
|
36
36
|
allowRunJS?: boolean;
|
|
37
|
+
/** 是否允许在变量选择器中使用内置日期变量。默认 true。 */
|
|
38
|
+
allowDateVariables?: boolean;
|
|
37
39
|
maxAssociationFieldDepth?: number;
|
|
38
40
|
disabled?: boolean;
|
|
39
41
|
variableConverters?: VariableInputProps['converters'];
|
|
@@ -25,6 +25,7 @@ export type FieldValueVariableInputProps = Omit<VariableInputProps, 'value' | 'o
|
|
|
25
25
|
isDateLikeField: boolean;
|
|
26
26
|
dateComponentProps: DateVariableComponentProps;
|
|
27
27
|
allowRunJS?: boolean;
|
|
28
|
+
allowDateVariables?: boolean;
|
|
28
29
|
converters?: VariableInputProps['converters'];
|
|
29
30
|
};
|
|
30
31
|
export declare const FieldValueVariableInput: React.FC<FieldValueVariableInputProps>;
|
|
@@ -36,6 +36,13 @@ export interface VariableFilterItemProps {
|
|
|
36
36
|
rightVariableConverters?: Pick<Converters, 'resolvePathFromValue' | 'resolveValueFromPath'>;
|
|
37
37
|
ignoreFieldNames?: string[];
|
|
38
38
|
maxAssociationFieldDepth?: number;
|
|
39
|
+
/**
|
|
40
|
+
* 右侧变量树的关联层级上限,默认与 `maxAssociationFieldDepth` 一致。
|
|
41
|
+
* 传 `null` 表示不限制:右侧是变量树而非集合字段树,其深度可能已由调用方约束
|
|
42
|
+
* (例如工作流的变量树由触发器的「预加载关系数据」决定),此时再按左侧的层级上限裁剪
|
|
43
|
+
* 会让已配置好的深层变量选不到。
|
|
44
|
+
*/
|
|
45
|
+
rightMaxAssociationFieldDepth?: number | null;
|
|
39
46
|
}
|
|
40
47
|
/**
|
|
41
48
|
* 上下文筛选项组件
|