@pisell/materials 6.11.250 → 6.11.252
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/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +3 -3
- package/build/lowcode/preview.js +1 -1
- package/build/lowcode/render/default/view.js +48 -48
- package/build/lowcode/view.js +48 -48
- package/es/components/dataSourceComponents/fields/Input.Subdomain/index.d.ts +1 -1
- package/es/components/dataSourceComponents/fields/RecordListWrapper/index.d.ts +1 -1
- package/es/components/dataSourceComponents/fields/Select/index.d.ts +1 -1
- package/es/components/dataSourceComponents/fields/Tabs/index.d.ts +1 -1
- package/es/components/pisellFind/index.js +1 -1
- package/es/components/pisellLookup/PisellLookup.js +4 -4
- package/es/components/pisellLookup/index.d.ts +1 -1
- package/es/components/pisellLookup/types.d.ts +11 -2
- package/lib/components/dataSourceComponents/fields/Input.Subdomain/index.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/RecordListWrapper/index.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/Select/index.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/Tabs/index.d.ts +1 -1
- package/lib/components/pisellFind/index.js +1 -1
- package/lib/components/pisellLookup/PisellLookup.js +4 -4
- package/lib/components/pisellLookup/index.d.ts +1 -1
- package/lib/components/pisellLookup/types.d.ts +11 -2
- package/package.json +3 -3
|
@@ -6,7 +6,7 @@ import * as _$antd from "antd";
|
|
|
6
6
|
declare const Subdomain: React.FC<_$antd.InputProps & {
|
|
7
7
|
onChange: (value: string) => void;
|
|
8
8
|
onBlur?: ((e: React.FocusEvent<HTMLInputElement, Element>) => void) | undefined;
|
|
9
|
-
rootDomain: "
|
|
9
|
+
rootDomain: "custom" | "saas" | "xzero";
|
|
10
10
|
customDomain?: string | undefined;
|
|
11
11
|
value?: string | undefined;
|
|
12
12
|
tenantId: string;
|
|
@@ -5,7 +5,7 @@ import React from "react";
|
|
|
5
5
|
//#region src/components/dataSourceComponents/fields/RecordListWrapper/index.d.ts
|
|
6
6
|
declare const RecordListWrapperWithDataSource: (props: RecordListWrapperProps & WithModeProps & WithFormItemProps & {
|
|
7
7
|
options?: any;
|
|
8
|
-
optionSourceType?: "default" | "
|
|
8
|
+
optionSourceType?: "default" | "custom" | "api" | undefined;
|
|
9
9
|
labelField: string;
|
|
10
10
|
valueField: string;
|
|
11
11
|
extraParams?: Record<string, any> | undefined;
|
|
@@ -6,7 +6,7 @@ import * as _$antd_es_select0 from "antd/es/select";
|
|
|
6
6
|
//#region src/components/dataSourceComponents/fields/Select/index.d.ts
|
|
7
7
|
declare const SelectWithDataSource: (props: _$antd.SelectProps<any, _$antd_es_select0.DefaultOptionType> & WithModeProps & WithFormItemProps & {
|
|
8
8
|
options?: any;
|
|
9
|
-
optionSourceType?: "default" | "
|
|
9
|
+
optionSourceType?: "default" | "custom" | "api" | undefined;
|
|
10
10
|
labelField: string;
|
|
11
11
|
valueField: string;
|
|
12
12
|
extraParams?: Record<string, any> | undefined;
|
|
@@ -7,7 +7,7 @@ import * as _$react from "react";
|
|
|
7
7
|
/** 包装 DataSource 层(提供数据源上下文) */
|
|
8
8
|
declare const FormItemTabs: (props: TabsProps & WithModeProps & WithFormItemProps & {
|
|
9
9
|
options?: any;
|
|
10
|
-
optionSourceType?: "default" | "
|
|
10
|
+
optionSourceType?: "default" | "custom" | "api" | undefined;
|
|
11
11
|
labelField: string;
|
|
12
12
|
valueField: string;
|
|
13
13
|
extraParams?: Record<string, any> | undefined;
|
|
@@ -135,7 +135,7 @@ const PisellFind = forwardRef((props, ref) => {
|
|
|
135
135
|
const data = payload === null || payload === void 0 ? void 0 : payload.data;
|
|
136
136
|
if (typeof data !== "string" || data.length === 0) return;
|
|
137
137
|
(_lookupRef$current5 = lookupRef.current) === null || _lookupRef$current5 === void 0 || _lookupRef$current5.setKeyword(data, "scan");
|
|
138
|
-
(_onSearchRef$current = onSearchRef.current) === null || _onSearchRef$current === void 0 || _onSearchRef$current.call(onSearchRef, data);
|
|
138
|
+
(_onSearchRef$current = onSearchRef.current) === null || _onSearchRef$current === void 0 || _onSearchRef$current.call(onSearchRef, data, { source: "scan" });
|
|
139
139
|
(_onScannerDataRef$cur = onScannerDataRef.current) === null || _onScannerDataRef$cur === void 0 || _onScannerDataRef$cur.call(onScannerDataRef, payload);
|
|
140
140
|
};
|
|
141
141
|
const acquireScanFocus = acquireScanFocusRef.current;
|
|
@@ -200,11 +200,11 @@ const PisellLookupComponent = forwardRef((props, ref) => {
|
|
|
200
200
|
/**
|
|
201
201
|
* 处理确认搜索(保存历史)
|
|
202
202
|
*/
|
|
203
|
-
const handleConfirmSearch = useCallback((searchKeyword) => {
|
|
204
|
-
if (!allowRepeatSearch && lastSearchKeywordRef.current === searchKeyword) return;
|
|
203
|
+
const handleConfirmSearch = useCallback((searchKeyword, options) => {
|
|
204
|
+
if (!allowRepeatSearch && (options === null || options === void 0 ? void 0 : options.source) !== "scan" && lastSearchKeywordRef.current === searchKeyword) return;
|
|
205
205
|
lastSearchKeywordRef.current = searchKeyword;
|
|
206
206
|
if (showHistory && searchKeyword.trim()) addHistory(searchKeyword);
|
|
207
|
-
onSearch === null || onSearch === void 0 || onSearch(searchKeyword);
|
|
207
|
+
onSearch === null || onSearch === void 0 || onSearch(searchKeyword, options);
|
|
208
208
|
}, [
|
|
209
209
|
allowRepeatSearch,
|
|
210
210
|
showHistory,
|
|
@@ -280,7 +280,7 @@ const PisellLookupComponent = forwardRef((props, ref) => {
|
|
|
280
280
|
isManualSelectRef.current = true;
|
|
281
281
|
setSearchSource("scan");
|
|
282
282
|
setKeyword(code);
|
|
283
|
-
handleConfirmSearch(code);
|
|
283
|
+
handleConfirmSearch(code, { source: "scan" });
|
|
284
284
|
onScan === null || onScan === void 0 || onScan(code);
|
|
285
285
|
setTimeout(() => {
|
|
286
286
|
isManualSelectRef.current = false;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { DisplayType, DrawerPlacement, LookupInputRenderContext, LookupSearchSource, PisellLookupProps, PisellLookupRef, SearchMode, SizeType, TriggerType } from "./types.js";
|
|
1
|
+
import { DisplayType, DrawerPlacement, LookupInputRenderContext, LookupSearchOptions, LookupSearchSource, PisellLookupProps, PisellLookupRef, SearchMode, SizeType, TriggerType } from "./types.js";
|
|
2
2
|
import { PisellLookup } from "./PisellLookup.js";
|
|
@@ -17,6 +17,15 @@ type SearchMode = 'realtime' | 'confirm';
|
|
|
17
17
|
* 搜索来源
|
|
18
18
|
*/
|
|
19
19
|
type LookupSearchSource = 'keyboard' | 'scan';
|
|
20
|
+
/**
|
|
21
|
+
* 搜索触发的附加上下文。
|
|
22
|
+
*
|
|
23
|
+
* `source: 'scan'` 只表示该次搜索由扫码产生;业务侧可据此附加自己的
|
|
24
|
+
* 精确检索参数,而不影响键盘输入等普通关键词搜索。
|
|
25
|
+
*/
|
|
26
|
+
interface LookupSearchOptions {
|
|
27
|
+
source?: LookupSearchSource;
|
|
28
|
+
}
|
|
20
29
|
/**
|
|
21
30
|
* 输入框尺寸
|
|
22
31
|
*/
|
|
@@ -200,7 +209,7 @@ interface PisellLookupProps {
|
|
|
200
209
|
* 搜索触发回调
|
|
201
210
|
* @param keyword 搜索关键词
|
|
202
211
|
*/
|
|
203
|
-
onSearch?: (keyword: string) => void;
|
|
212
|
+
onSearch?: (keyword: string, options?: LookupSearchOptions) => void;
|
|
204
213
|
/**
|
|
205
214
|
* 是否允许重复确认同一个关键词。
|
|
206
215
|
* 适用于提交失败后需要原值重试的场景;默认保持去重行为。
|
|
@@ -441,4 +450,4 @@ interface PisellLookupProps {
|
|
|
441
450
|
zIndex?: number;
|
|
442
451
|
}
|
|
443
452
|
//#endregion
|
|
444
|
-
export { DisplayType, DrawerPlacement, LookupInputRenderContext, LookupSearchSource, PisellLookupProps, PisellLookupRef, SearchMode, SizeType, TriggerType };
|
|
453
|
+
export { DisplayType, DrawerPlacement, LookupInputRenderContext, LookupSearchOptions, LookupSearchSource, PisellLookupProps, PisellLookupRef, SearchMode, SizeType, TriggerType };
|
|
@@ -6,7 +6,7 @@ import * as _$antd from "antd";
|
|
|
6
6
|
declare const Subdomain: React.FC<_$antd.InputProps & {
|
|
7
7
|
onChange: (value: string) => void;
|
|
8
8
|
onBlur?: ((e: React.FocusEvent<HTMLInputElement, Element>) => void) | undefined;
|
|
9
|
-
rootDomain: "
|
|
9
|
+
rootDomain: "custom" | "saas" | "xzero";
|
|
10
10
|
customDomain?: string | undefined;
|
|
11
11
|
value?: string | undefined;
|
|
12
12
|
tenantId: string;
|
|
@@ -5,7 +5,7 @@ import React from "react";
|
|
|
5
5
|
//#region src/components/dataSourceComponents/fields/RecordListWrapper/index.d.ts
|
|
6
6
|
declare const RecordListWrapperWithDataSource: (props: RecordListWrapperProps & WithModeProps & WithFormItemProps & {
|
|
7
7
|
options?: any;
|
|
8
|
-
optionSourceType?: "default" | "
|
|
8
|
+
optionSourceType?: "default" | "custom" | "api" | undefined;
|
|
9
9
|
labelField: string;
|
|
10
10
|
valueField: string;
|
|
11
11
|
extraParams?: Record<string, any> | undefined;
|
|
@@ -6,7 +6,7 @@ import * as _$antd_es_select0 from "antd/es/select";
|
|
|
6
6
|
//#region src/components/dataSourceComponents/fields/Select/index.d.ts
|
|
7
7
|
declare const SelectWithDataSource: (props: _$antd.SelectProps<any, _$antd_es_select0.DefaultOptionType> & WithModeProps & WithFormItemProps & {
|
|
8
8
|
options?: any;
|
|
9
|
-
optionSourceType?: "default" | "
|
|
9
|
+
optionSourceType?: "default" | "custom" | "api" | undefined;
|
|
10
10
|
labelField: string;
|
|
11
11
|
valueField: string;
|
|
12
12
|
extraParams?: Record<string, any> | undefined;
|
|
@@ -7,7 +7,7 @@ import * as _$react from "react";
|
|
|
7
7
|
/** 包装 DataSource 层(提供数据源上下文) */
|
|
8
8
|
declare const FormItemTabs: (props: TabsProps & WithModeProps & WithFormItemProps & {
|
|
9
9
|
options?: any;
|
|
10
|
-
optionSourceType?: "default" | "
|
|
10
|
+
optionSourceType?: "default" | "custom" | "api" | undefined;
|
|
11
11
|
labelField: string;
|
|
12
12
|
valueField: string;
|
|
13
13
|
extraParams?: Record<string, any> | undefined;
|
|
@@ -137,7 +137,7 @@ const PisellFind = (0, react.forwardRef)((props, ref) => {
|
|
|
137
137
|
const data = payload === null || payload === void 0 ? void 0 : payload.data;
|
|
138
138
|
if (typeof data !== "string" || data.length === 0) return;
|
|
139
139
|
(_lookupRef$current5 = lookupRef.current) === null || _lookupRef$current5 === void 0 || _lookupRef$current5.setKeyword(data, "scan");
|
|
140
|
-
(_onSearchRef$current = onSearchRef.current) === null || _onSearchRef$current === void 0 || _onSearchRef$current.call(onSearchRef, data);
|
|
140
|
+
(_onSearchRef$current = onSearchRef.current) === null || _onSearchRef$current === void 0 || _onSearchRef$current.call(onSearchRef, data, { source: "scan" });
|
|
141
141
|
(_onScannerDataRef$cur = onScannerDataRef.current) === null || _onScannerDataRef$cur === void 0 || _onScannerDataRef$cur.call(onScannerDataRef, payload);
|
|
142
142
|
};
|
|
143
143
|
const acquireScanFocus = acquireScanFocusRef.current;
|
|
@@ -202,11 +202,11 @@ const PisellLookupComponent = (0, react.forwardRef)((props, ref) => {
|
|
|
202
202
|
/**
|
|
203
203
|
* 处理确认搜索(保存历史)
|
|
204
204
|
*/
|
|
205
|
-
const handleConfirmSearch = (0, react.useCallback)((searchKeyword) => {
|
|
206
|
-
if (!allowRepeatSearch && lastSearchKeywordRef.current === searchKeyword) return;
|
|
205
|
+
const handleConfirmSearch = (0, react.useCallback)((searchKeyword, options) => {
|
|
206
|
+
if (!allowRepeatSearch && (options === null || options === void 0 ? void 0 : options.source) !== "scan" && lastSearchKeywordRef.current === searchKeyword) return;
|
|
207
207
|
lastSearchKeywordRef.current = searchKeyword;
|
|
208
208
|
if (showHistory && searchKeyword.trim()) addHistory(searchKeyword);
|
|
209
|
-
onSearch === null || onSearch === void 0 || onSearch(searchKeyword);
|
|
209
|
+
onSearch === null || onSearch === void 0 || onSearch(searchKeyword, options);
|
|
210
210
|
}, [
|
|
211
211
|
allowRepeatSearch,
|
|
212
212
|
showHistory,
|
|
@@ -282,7 +282,7 @@ const PisellLookupComponent = (0, react.forwardRef)((props, ref) => {
|
|
|
282
282
|
isManualSelectRef.current = true;
|
|
283
283
|
setSearchSource("scan");
|
|
284
284
|
setKeyword(code);
|
|
285
|
-
handleConfirmSearch(code);
|
|
285
|
+
handleConfirmSearch(code, { source: "scan" });
|
|
286
286
|
onScan === null || onScan === void 0 || onScan(code);
|
|
287
287
|
setTimeout(() => {
|
|
288
288
|
isManualSelectRef.current = false;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { DisplayType, DrawerPlacement, LookupInputRenderContext, LookupSearchSource, PisellLookupProps, PisellLookupRef, SearchMode, SizeType, TriggerType } from "./types.js";
|
|
1
|
+
import { DisplayType, DrawerPlacement, LookupInputRenderContext, LookupSearchOptions, LookupSearchSource, PisellLookupProps, PisellLookupRef, SearchMode, SizeType, TriggerType } from "./types.js";
|
|
2
2
|
import { PisellLookup } from "./PisellLookup.js";
|
|
@@ -17,6 +17,15 @@ type SearchMode = 'realtime' | 'confirm';
|
|
|
17
17
|
* 搜索来源
|
|
18
18
|
*/
|
|
19
19
|
type LookupSearchSource = 'keyboard' | 'scan';
|
|
20
|
+
/**
|
|
21
|
+
* 搜索触发的附加上下文。
|
|
22
|
+
*
|
|
23
|
+
* `source: 'scan'` 只表示该次搜索由扫码产生;业务侧可据此附加自己的
|
|
24
|
+
* 精确检索参数,而不影响键盘输入等普通关键词搜索。
|
|
25
|
+
*/
|
|
26
|
+
interface LookupSearchOptions {
|
|
27
|
+
source?: LookupSearchSource;
|
|
28
|
+
}
|
|
20
29
|
/**
|
|
21
30
|
* 输入框尺寸
|
|
22
31
|
*/
|
|
@@ -200,7 +209,7 @@ interface PisellLookupProps {
|
|
|
200
209
|
* 搜索触发回调
|
|
201
210
|
* @param keyword 搜索关键词
|
|
202
211
|
*/
|
|
203
|
-
onSearch?: (keyword: string) => void;
|
|
212
|
+
onSearch?: (keyword: string, options?: LookupSearchOptions) => void;
|
|
204
213
|
/**
|
|
205
214
|
* 是否允许重复确认同一个关键词。
|
|
206
215
|
* 适用于提交失败后需要原值重试的场景;默认保持去重行为。
|
|
@@ -441,4 +450,4 @@ interface PisellLookupProps {
|
|
|
441
450
|
zIndex?: number;
|
|
442
451
|
}
|
|
443
452
|
//#endregion
|
|
444
|
-
export { DisplayType, DrawerPlacement, LookupInputRenderContext, LookupSearchSource, PisellLookupProps, PisellLookupRef, SearchMode, SizeType, TriggerType };
|
|
453
|
+
export { DisplayType, DrawerPlacement, LookupInputRenderContext, LookupSearchOptions, LookupSearchSource, PisellLookupProps, PisellLookupRef, SearchMode, SizeType, TriggerType };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pisell/materials",
|
|
3
|
-
"version": "6.11.
|
|
3
|
+
"version": "6.11.252",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"module": "./es/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -95,9 +95,9 @@
|
|
|
95
95
|
"swiper": "^8.4.7",
|
|
96
96
|
"antd-mobile": "^5.38.1",
|
|
97
97
|
"vod-js-sdk-v6": "^1.4.11",
|
|
98
|
-
"@pisell/icon": "0.0.11",
|
|
99
98
|
"@pisell/date-picker": "3.0.10",
|
|
100
|
-
"@pisell/utils": "3.0.4"
|
|
99
|
+
"@pisell/utils": "3.0.4",
|
|
100
|
+
"@pisell/icon": "0.0.11"
|
|
101
101
|
},
|
|
102
102
|
"peerDependencies": {
|
|
103
103
|
"react": "^18.0.0",
|