@nocobase/client-v2 2.3.0-beta.8 → 2.3.0-beta.9
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/index.mjs +19 -19
- package/lib/index.js +38 -38
- package/package.json +9 -8
- package/src/collection-manager/__tests__/field-configure.test.ts +52 -0
- package/src/collection-manager/field-configure.ts +2 -2
- 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 +42 -23
- 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/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/FormBlockModel.tsx +26 -5
- package/src/flow/models/blocks/form/__tests__/FormBlockModel.test.tsx +145 -0
- package/src/flow/models/blocks/form/__tests__/popupLinkage.test.tsx +175 -0
- package/src/flow/models/fields/DisplayAssociationField/DisplaySubTableFieldModel.tsx +42 -7
- package/src/flow/models/fields/DisplayAssociationField/__tests__/DisplaySubTableFieldModel.test.tsx +351 -0
- package/src/flow/models/topbar/TopbarActionModel.tsx +5 -5
|
@@ -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>;
|