@pisell/materials 6.11.212 → 6.11.214
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/meta.js +1 -1
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +6 -6
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +5 -5
- package/es/components/PisellTabbar/PisellTabbar.js +35 -8
- package/es/components/PisellTabbar/template/Template1/PisellTabbar.js +35 -8
- package/es/components/PisellTabbar/types.d.ts +2 -0
- package/es/components/pisellFind/index.d.ts +9 -4
- package/es/components/pisellFind/index.js +46 -13
- package/es/components/pisellLookup/PisellLookup.js +7 -2
- package/es/components/pisellLookup/components/LookupTrigger.js +36 -9
- package/es/components/pisellLookup/types.d.ts +63 -0
- package/es/components/pisellRecordBoard/shellFrame/ToolBar/ToolBarFilter.less +9 -2
- package/es/components/pisellRecordBoard/shellFrame/ToolBar/index.js +33 -9
- package/es/components/pisellRecordBoard/shellFrame/ToolBar/recordBoardToolbar.less +86 -11
- package/es/components/pisellRecordBoard/shellFrame/index.js +1 -0
- package/es/components/pisellRecordBoard/types.d.ts +7 -0
- package/es/components/pisellShellFrame/PisellShellFrame.less +5 -0
- package/es/components/pisellTimeRangeDisplay/PisellTimeRangeDisplay.js +6 -1
- package/es/components/pisellTimeRangeDisplay/components/TimeRangeBlock.js +53 -20
- package/es/components/productCard/lineItem/BookingLineItem.js +95 -32
- package/es/components/productCard/lineItem/index.js +9 -1
- package/es/components/productCard/lineItem/index.less +33 -0
- package/es/components/productCard/lineItem/locales.js +20 -5
- package/es/index.d.ts +1 -1
- package/lib/components/PisellTabbar/PisellTabbar.js +16 -4
- package/lib/components/PisellTabbar/template/Template1/PisellTabbar.js +16 -4
- package/lib/components/PisellTabbar/types.d.ts +2 -0
- package/lib/components/pisellFind/index.d.ts +9 -4
- package/lib/components/pisellFind/index.js +29 -10
- package/lib/components/pisellLookup/PisellLookup.js +9 -1
- package/lib/components/pisellLookup/components/LookupTrigger.js +17 -0
- package/lib/components/pisellLookup/types.d.ts +63 -0
- package/lib/components/pisellRecordBoard/shellFrame/ToolBar/ToolBarFilter.less +9 -2
- package/lib/components/pisellRecordBoard/shellFrame/ToolBar/index.js +21 -6
- package/lib/components/pisellRecordBoard/shellFrame/ToolBar/recordBoardToolbar.less +86 -11
- package/lib/components/pisellRecordBoard/shellFrame/index.js +1 -0
- package/lib/components/pisellRecordBoard/types.d.ts +7 -0
- package/lib/components/pisellShellFrame/PisellShellFrame.less +5 -0
- package/lib/components/pisellTimeRangeDisplay/PisellTimeRangeDisplay.js +6 -1
- package/lib/components/pisellTimeRangeDisplay/components/TimeRangeBlock.js +37 -20
- package/lib/components/productCard/lineItem/BookingLineItem.js +93 -43
- package/lib/components/productCard/lineItem/index.js +9 -1
- package/lib/components/productCard/lineItem/index.less +33 -0
- package/lib/components/productCard/lineItem/locales.js +20 -5
- package/lib/index.d.ts +1 -1
- package/package.json +2 -2
- package/es/components/pisellTimeRangeDisplay/PisellTimeRangeDisplay.d.ts +0 -32
- package/es/components/pisellTimeRangeDisplay/components/TimeRangeBlock.d.ts +0 -30
- package/es/components/pisellTimeRangeDisplay/types.d.ts +0 -137
- package/es/components/productCard/lineItem/BookingLineItem.d.ts +0 -19
- package/es/components/productCard/lineItem/index.d.ts +0 -69
- package/es/components/productCard/lineItem/locales.d.ts +0 -23
- package/lib/components/pisellTimeRangeDisplay/PisellTimeRangeDisplay.d.ts +0 -32
- package/lib/components/pisellTimeRangeDisplay/components/TimeRangeBlock.d.ts +0 -30
- package/lib/components/pisellTimeRangeDisplay/types.d.ts +0 -137
- package/lib/components/productCard/lineItem/BookingLineItem.d.ts +0 -19
- package/lib/components/productCard/lineItem/index.d.ts +0 -69
- package/lib/components/productCard/lineItem/locales.d.ts +0 -23
|
@@ -171,7 +171,7 @@ export var convertProductToLineItemProduct = function convertProductToLineItemPr
|
|
|
171
171
|
return mapped;
|
|
172
172
|
};
|
|
173
173
|
var LineItem = function LineItem(props) {
|
|
174
|
-
var _context$appHelper$ut, _context$appHelper$ut2, _context$appHelper$ut3, _context$appHelper$ut4, _dataSource$_extend2;
|
|
174
|
+
var _context$appHelper$ut, _context$appHelper$ut2, _context$appHelper$ut3, _context$appHelper$ut4, _dataSource$_extend2, _dataSource$_extend4;
|
|
175
175
|
var _props$dataSource = props.dataSource,
|
|
176
176
|
dataSource = _props$dataSource === void 0 ? defaultValue.dataSource : _props$dataSource,
|
|
177
177
|
itemType = props.itemType,
|
|
@@ -226,6 +226,13 @@ var LineItem = function LineItem(props) {
|
|
|
226
226
|
if (!relatedProduct) return null;
|
|
227
227
|
return convertProductToLineItemProduct(relatedProduct, translationOriginal, symbol);
|
|
228
228
|
}, [relatedProduct, symbol, translationOriginal]);
|
|
229
|
+
var addTimeProductDataSources = useMemo(function () {
|
|
230
|
+
var _dataSource$_extend3;
|
|
231
|
+
var addTimeProducts = Array.isArray(dataSource === null || dataSource === void 0 || (_dataSource$_extend3 = dataSource._extend) === null || _dataSource$_extend3 === void 0 ? void 0 : _dataSource$_extend3.addTimeProduct) ? dataSource._extend.addTimeProduct : [];
|
|
232
|
+
return addTimeProducts.map(function (item) {
|
|
233
|
+
return convertProductToLineItemProduct(item, translationOriginal, symbol);
|
|
234
|
+
});
|
|
235
|
+
}, [dataSource === null || dataSource === void 0 || (_dataSource$_extend4 = dataSource._extend) === null || _dataSource$_extend4 === void 0 ? void 0 : _dataSource$_extend4.addTimeProduct, symbol, translationOriginal]);
|
|
229
236
|
if (itemKind === 'product') {
|
|
230
237
|
return /*#__PURE__*/React.createElement(CartSkuCard, _extends({}, other, {
|
|
231
238
|
dataSource: productDataSource,
|
|
@@ -252,6 +259,7 @@ var LineItem = function LineItem(props) {
|
|
|
252
259
|
cartSkuType: type,
|
|
253
260
|
isShowBookingHeader: isShowBookingHeader,
|
|
254
261
|
relatedProductDataSource: relatedProductDataSource,
|
|
262
|
+
addTimeProductDataSources: addTimeProductDataSources,
|
|
255
263
|
rightActions: rightActions,
|
|
256
264
|
escapeDom: escapeDom,
|
|
257
265
|
isShowImage: isShowImage,
|
|
@@ -223,6 +223,13 @@
|
|
|
223
223
|
gap: 6px;
|
|
224
224
|
}
|
|
225
225
|
|
|
226
|
+
&__add-time-products {
|
|
227
|
+
display: flex;
|
|
228
|
+
flex-direction: column;
|
|
229
|
+
gap: 6px;
|
|
230
|
+
padding: 6px 8px 8px;
|
|
231
|
+
}
|
|
232
|
+
|
|
226
233
|
&__section-title {
|
|
227
234
|
color: #101828;
|
|
228
235
|
font-size: 12px;
|
|
@@ -240,4 +247,30 @@
|
|
|
240
247
|
padding: 0;
|
|
241
248
|
}
|
|
242
249
|
}
|
|
250
|
+
|
|
251
|
+
&__add-time-product-card {
|
|
252
|
+
padding: 4px;
|
|
253
|
+
border: 1px solid var(--Gray-300, #d0d5dd);
|
|
254
|
+
border-radius: 8px;
|
|
255
|
+
background: var(--Base-White, #fff);
|
|
256
|
+
display: flex;
|
|
257
|
+
flex-direction: column;
|
|
258
|
+
gap: 4px;
|
|
259
|
+
|
|
260
|
+
.pisell-cart-sku-card__packages-wrap {
|
|
261
|
+
padding: 0;
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
&__add-time-products-toggle {
|
|
266
|
+
align-self: flex-start;
|
|
267
|
+
padding: 2px 0;
|
|
268
|
+
border: none;
|
|
269
|
+
background: transparent;
|
|
270
|
+
color: #1570ef;
|
|
271
|
+
font-size: 12px;
|
|
272
|
+
font-weight: 600;
|
|
273
|
+
line-height: 18px;
|
|
274
|
+
cursor: pointer;
|
|
275
|
+
}
|
|
243
276
|
}
|
|
@@ -1,22 +1,37 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
en: {
|
|
3
3
|
'pisell2.line-item.resource': 'Resource',
|
|
4
|
-
'pisell2.line-item.time': 'Time'
|
|
4
|
+
'pisell2.line-item.time': 'Time',
|
|
5
|
+
'pisell2.line-item.add-time-products': 'Add time products',
|
|
6
|
+
'pisell2.line-item.show-all': 'Show all',
|
|
7
|
+
'pisell2.line-item.collapse': 'Collapse'
|
|
5
8
|
},
|
|
6
9
|
'zh-CN': {
|
|
7
10
|
'pisell2.line-item.resource': '资源',
|
|
8
|
-
'pisell2.line-item.time': '时间'
|
|
11
|
+
'pisell2.line-item.time': '时间',
|
|
12
|
+
'pisell2.line-item.add-time-products': '加时商品',
|
|
13
|
+
'pisell2.line-item.show-all': '展示全部',
|
|
14
|
+
'pisell2.line-item.collapse': '收起'
|
|
9
15
|
},
|
|
10
16
|
'zh-HK': {
|
|
11
17
|
'pisell2.line-item.resource': '資源',
|
|
12
|
-
'pisell2.line-item.time': '時間'
|
|
18
|
+
'pisell2.line-item.time': '時間',
|
|
19
|
+
'pisell2.line-item.add-time-products': '加時商品',
|
|
20
|
+
'pisell2.line-item.show-all': '展示全部',
|
|
21
|
+
'pisell2.line-item.collapse': '收起'
|
|
13
22
|
},
|
|
14
23
|
ja: {
|
|
15
24
|
'pisell2.line-item.resource': 'リソース',
|
|
16
|
-
'pisell2.line-item.time': '時間'
|
|
25
|
+
'pisell2.line-item.time': '時間',
|
|
26
|
+
'pisell2.line-item.add-time-products': '追加時間の商品',
|
|
27
|
+
'pisell2.line-item.show-all': 'すべて表示',
|
|
28
|
+
'pisell2.line-item.collapse': '折りたたむ'
|
|
17
29
|
},
|
|
18
30
|
pt: {
|
|
19
31
|
'pisell2.line-item.resource': 'Recurso',
|
|
20
|
-
'pisell2.line-item.time': 'Tempo'
|
|
32
|
+
'pisell2.line-item.time': 'Tempo',
|
|
33
|
+
'pisell2.line-item.add-time-products': 'Produtos de horário adicional',
|
|
34
|
+
'pisell2.line-item.show-all': 'Ver tudo',
|
|
35
|
+
'pisell2.line-item.collapse': 'Recolher'
|
|
21
36
|
}
|
|
22
37
|
};
|
package/es/index.d.ts
CHANGED
|
@@ -122,7 +122,7 @@ export { default as CustomSelect } from './components/customSelect';
|
|
|
122
122
|
export { default as PisellUpload } from './components/pisellUpload';
|
|
123
123
|
export { default as Translation } from './components/translation';
|
|
124
124
|
export { PisellLookup } from './components/pisellLookup';
|
|
125
|
-
export type { PisellLookupProps, PisellLookupRef, } from './components/pisellLookup';
|
|
125
|
+
export type { PisellLookupProps, PisellLookupRef, LookupInputRenderContext, } from './components/pisellLookup';
|
|
126
126
|
export { PisellFind } from './components/pisellFind';
|
|
127
127
|
export type { PisellFindProps, PisellFindRef } from './components/pisellFind';
|
|
128
128
|
export { default as DataSourceForm } from './components/dataSourceComponents/dataSourceForm';
|
|
@@ -70,7 +70,8 @@ var PisellTabbar = (0, import_react.forwardRef)(
|
|
|
70
70
|
levelConfig: customLevelConfig,
|
|
71
71
|
expandConfig: customExpandConfig,
|
|
72
72
|
maxLevel = 3,
|
|
73
|
-
onSearch
|
|
73
|
+
onSearch,
|
|
74
|
+
searchProps
|
|
74
75
|
} = props;
|
|
75
76
|
const containerRef = (0, import_react.useRef)(null);
|
|
76
77
|
const tabbarIdRef = (0, import_react.useRef)(createTabbarId());
|
|
@@ -98,14 +99,17 @@ var PisellTabbar = (0, import_react.forwardRef)(
|
|
|
98
99
|
}, [activeKey]);
|
|
99
100
|
const { expand, toggleExpand, getExpand } = (0, import_hooks.useExpand)();
|
|
100
101
|
const expandConfigData = customExpandConfig || (0, import_constants.getExpandConfig)();
|
|
102
|
+
const [isSearchOpen, setIsSearchOpen] = (0, import_react.useState)(false);
|
|
101
103
|
const openSearchMode = (0, import_ahooks.useMemoizedFn)(() => {
|
|
102
104
|
setCacheActiveKey(activeKey);
|
|
103
105
|
_setActiveKey([]);
|
|
104
106
|
onChange == null ? void 0 : onChange([]);
|
|
107
|
+
setIsSearchOpen(true);
|
|
105
108
|
});
|
|
106
109
|
const closeSearchMode = (0, import_ahooks.useMemoizedFn)(() => {
|
|
107
110
|
onSearch == null ? void 0 : onSearch("");
|
|
108
111
|
resetActiveKey();
|
|
112
|
+
setIsSearchOpen(false);
|
|
109
113
|
});
|
|
110
114
|
(0, import_react.useImperativeHandle)(ref, () => {
|
|
111
115
|
var _a;
|
|
@@ -227,8 +231,14 @@ var PisellTabbar = (0, import_react.forwardRef)(
|
|
|
227
231
|
[activeKey, getLevelConfig]
|
|
228
232
|
);
|
|
229
233
|
const level1DataSource = (0, import_react.useMemo)(
|
|
230
|
-
() =>
|
|
231
|
-
|
|
234
|
+
() => {
|
|
235
|
+
const full = (0, import_utils.addDataSourceItemsByKey)(dataSource, import_constants.LEVEL_ADD_ITEMS.level1);
|
|
236
|
+
if (isSearchOpen) {
|
|
237
|
+
return full.filter((item) => (item == null ? void 0 : item.key) === "search");
|
|
238
|
+
}
|
|
239
|
+
return full;
|
|
240
|
+
},
|
|
241
|
+
[dataSource, isSearchOpen]
|
|
232
242
|
);
|
|
233
243
|
const level2Expand = getExpand("level2");
|
|
234
244
|
const level3Expand = getExpand("level3");
|
|
@@ -432,6 +442,8 @@ var PisellTabbar = (0, import_react.forwardRef)(
|
|
|
432
442
|
{
|
|
433
443
|
showHistory: false,
|
|
434
444
|
modalWidth: "100%",
|
|
445
|
+
...searchProps,
|
|
446
|
+
enableScanner: Boolean(searchProps == null ? void 0 : searchProps.enableScanner) && isSearchOpen,
|
|
435
447
|
ref: searchRef,
|
|
436
448
|
onSearch: (e) => {
|
|
437
449
|
onSearch == null ? void 0 : onSearch(e);
|
|
@@ -484,7 +496,7 @@ var PisellTabbar = (0, import_react.forwardRef)(
|
|
|
484
496
|
}
|
|
485
497
|
);
|
|
486
498
|
},
|
|
487
|
-
[activeKey]
|
|
499
|
+
[activeKey, isSearchOpen]
|
|
488
500
|
);
|
|
489
501
|
const renderLevel1Item = (0, import_ahooks.useMemoizedFn)(
|
|
490
502
|
(itemProps) => {
|
|
@@ -54,7 +54,8 @@ var PisellTabbar = (props, ref) => {
|
|
|
54
54
|
levelConfig: customLevelConfig,
|
|
55
55
|
expandConfig: customExpandConfig,
|
|
56
56
|
maxLevel = 3,
|
|
57
|
-
onSearch
|
|
57
|
+
onSearch,
|
|
58
|
+
searchProps
|
|
58
59
|
} = props;
|
|
59
60
|
const containerRef = (0, import_react.useRef)(null);
|
|
60
61
|
const searchRef = (0, import_react.useRef)(null);
|
|
@@ -85,14 +86,17 @@ var PisellTabbar = (props, ref) => {
|
|
|
85
86
|
const level3Value = (0, import_react.useMemo)(() => {
|
|
86
87
|
return getActiveKey(2);
|
|
87
88
|
}, [activeKey]);
|
|
89
|
+
const [isSearchOpen, setIsSearchOpen] = (0, import_react.useState)(false);
|
|
88
90
|
const openSearchMode = () => {
|
|
89
91
|
setCacheActiveKey(activeKey);
|
|
90
92
|
_setActiveKey([]);
|
|
91
93
|
onChange == null ? void 0 : onChange([]);
|
|
94
|
+
setIsSearchOpen(true);
|
|
92
95
|
};
|
|
93
96
|
const closeSearchMode = () => {
|
|
94
97
|
onSearch == null ? void 0 : onSearch("");
|
|
95
98
|
resetActiveKey();
|
|
99
|
+
setIsSearchOpen(false);
|
|
96
100
|
};
|
|
97
101
|
(0, import_react.useImperativeHandle)(ref, () => {
|
|
98
102
|
var _a;
|
|
@@ -191,6 +195,8 @@ var PisellTabbar = (props, ref) => {
|
|
|
191
195
|
{
|
|
192
196
|
showHistory: false,
|
|
193
197
|
modalWidth: "100%",
|
|
198
|
+
...searchProps,
|
|
199
|
+
enableScanner: Boolean(searchProps == null ? void 0 : searchProps.enableScanner) && isSearchOpen,
|
|
194
200
|
ref: searchRef,
|
|
195
201
|
onSearch: (e) => {
|
|
196
202
|
onSearch == null ? void 0 : onSearch(e);
|
|
@@ -243,7 +249,7 @@ var PisellTabbar = (props, ref) => {
|
|
|
243
249
|
}
|
|
244
250
|
);
|
|
245
251
|
},
|
|
246
|
-
[activeKey, tabbarId]
|
|
252
|
+
[activeKey, tabbarId, isSearchOpen]
|
|
247
253
|
);
|
|
248
254
|
const renderNormalCard = (0, import_react.useCallback)(
|
|
249
255
|
(cardProps, level) => {
|
|
@@ -284,8 +290,14 @@ var PisellTabbar = (props, ref) => {
|
|
|
284
290
|
[getLevelConfig]
|
|
285
291
|
);
|
|
286
292
|
const level1DataSource = (0, import_react.useMemo)(
|
|
287
|
-
() =>
|
|
288
|
-
|
|
293
|
+
() => {
|
|
294
|
+
const full = (0, import_utils.addDataSourceItemsByKey)(dataSource, import_constants.LEVEL_ADD_ITEMS.level1);
|
|
295
|
+
if (isSearchOpen) {
|
|
296
|
+
return full.filter((item) => (item == null ? void 0 : item.key) === "search");
|
|
297
|
+
}
|
|
298
|
+
return full;
|
|
299
|
+
},
|
|
300
|
+
[dataSource, isSearchOpen]
|
|
289
301
|
);
|
|
290
302
|
const renderLevel1Item = (0, import_react.useCallback)(
|
|
291
303
|
(itemProps) => {
|
|
@@ -83,6 +83,8 @@ export interface PisellTabbarProps {
|
|
|
83
83
|
/** 最大层级数 */
|
|
84
84
|
maxLevel?: 1 | 2 | 3;
|
|
85
85
|
onSearch?: (value: string) => void;
|
|
86
|
+
/** 透传给内部 PisellFind 的搜索配置(如 inputRender 插槽)。 */
|
|
87
|
+
searchProps?: Record<string, any>;
|
|
86
88
|
__designMode?: boolean;
|
|
87
89
|
}
|
|
88
90
|
export interface PisellTabbarRef {
|
|
@@ -20,8 +20,11 @@ export interface PisellFindScannerData {
|
|
|
20
20
|
export interface PisellFindProps extends PisellLookupProps {
|
|
21
21
|
/**
|
|
22
22
|
* 是否开启扫码枪监听
|
|
23
|
-
*
|
|
24
|
-
*
|
|
23
|
+
* - 优先:通过宿主 `appHelper.utils.acquireScanFocus` 接入「扫码焦点栈」,
|
|
24
|
+
* 保证同一页面存在多个 PisellFind 时,只有「栈顶」(最后开启监听的那个,
|
|
25
|
+
* 如列表上方拉起的弹窗)响应扫码,底层组件不响应;关闭/卸载时自动释放,焦点回退。
|
|
26
|
+
* - 回退:宿主未注册焦点栈时,退回到直连 `app.pubsub.subscribe('nativeScanResult', ...)`。
|
|
27
|
+
* 切换 false 时会释放焦点 / unsubscribe,停止接收事件。
|
|
25
28
|
* @default false
|
|
26
29
|
*/
|
|
27
30
|
enableScanner?: boolean;
|
|
@@ -46,8 +49,10 @@ export declare type PisellFindRef = PisellLookupRef;
|
|
|
46
49
|
* - 默认不显示确认按钮(输入即搜索)
|
|
47
50
|
* - 默认开启搜索历史
|
|
48
51
|
* - 默认不展示结果区(结果在页面其他位置展示)
|
|
49
|
-
* - 通过 `enableScanner`
|
|
50
|
-
*
|
|
52
|
+
* - 通过 `enableScanner` 接入扫码枪:优先走宿主注入的「扫码焦点栈」
|
|
53
|
+
* (`appHelper.utils.acquireScanFocus`),保证同页多个 PisellFind 只有栈顶响应;
|
|
54
|
+
* 宿主未注册时回退到直连 `app.pubsub.subscribe(SCAN_RESULT_EVENT, ...)`。
|
|
55
|
+
* 每次扫码直接覆盖输入框内容并触发 onSearch / onScannerData;切回 false 时自动释放 / unsubscribe。
|
|
51
56
|
*
|
|
52
57
|
* @example
|
|
53
58
|
* ```tsx
|
|
@@ -40,7 +40,7 @@ var import_useEngineContext = __toESM(require("../../hooks/useEngineContext"));
|
|
|
40
40
|
var import_locales = require("../../locales");
|
|
41
41
|
var SCAN_RESULT_EVENT = "nativeScanResult";
|
|
42
42
|
var PisellFind = (0, import_react.forwardRef)((props, ref) => {
|
|
43
|
-
var _a, _b;
|
|
43
|
+
var _a, _b, _c, _d;
|
|
44
44
|
const {
|
|
45
45
|
triggerType = "button",
|
|
46
46
|
buttonText = (() => {
|
|
@@ -95,25 +95,44 @@ var PisellFind = (0, import_react.forwardRef)((props, ref) => {
|
|
|
95
95
|
const engineContext = (0, import_useEngineContext.default)();
|
|
96
96
|
const getAppRef = (0, import_react.useRef)(void 0);
|
|
97
97
|
getAppRef.current = typeof ((_b = (_a = engineContext == null ? void 0 : engineContext.appHelper) == null ? void 0 : _a.utils) == null ? void 0 : _b.getApp) === "function" ? engineContext.appHelper.utils.getApp : void 0;
|
|
98
|
+
const acquireScanFocusRef = (0, import_react.useRef)(void 0);
|
|
99
|
+
const appHelperUtils = (_c = engineContext == null ? void 0 : engineContext.appHelper) == null ? void 0 : _c.utils;
|
|
100
|
+
acquireScanFocusRef.current = typeof (appHelperUtils == null ? void 0 : appHelperUtils.acquireScanFocus) === "function" ? appHelperUtils.acquireScanFocus : typeof ((_d = appHelperUtils == null ? void 0 : appHelperUtils.businessUtils) == null ? void 0 : _d.acquireScanFocus) === "function" ? appHelperUtils.businessUtils.acquireScanFocus : void 0;
|
|
98
101
|
(0, import_react.useEffect)(() => {
|
|
99
102
|
if (!enableScanner) return void 0;
|
|
100
|
-
const getApp = getAppRef.current;
|
|
101
|
-
if (typeof getApp !== "function") return void 0;
|
|
102
|
-
const app = getApp();
|
|
103
|
-
const pubsub = app == null ? void 0 : app.pubsub;
|
|
104
|
-
if (!pubsub || typeof pubsub.subscribe !== "function") {
|
|
105
|
-
return void 0;
|
|
106
|
-
}
|
|
107
103
|
const onScan = (payload) => {
|
|
108
|
-
var _a2, _b2,
|
|
104
|
+
var _a2, _b2, _c2;
|
|
109
105
|
const data = payload == null ? void 0 : payload.data;
|
|
110
106
|
if (typeof data !== "string" || data.length === 0) {
|
|
111
107
|
return;
|
|
112
108
|
}
|
|
113
109
|
(_a2 = lookupRef.current) == null ? void 0 : _a2.setKeyword(data);
|
|
114
110
|
(_b2 = onSearchRef.current) == null ? void 0 : _b2.call(onSearchRef, data);
|
|
115
|
-
(
|
|
111
|
+
(_c2 = onScannerDataRef.current) == null ? void 0 : _c2.call(onScannerDataRef, payload);
|
|
116
112
|
};
|
|
113
|
+
const acquireScanFocus = acquireScanFocusRef.current;
|
|
114
|
+
if (typeof acquireScanFocus === "function") {
|
|
115
|
+
try {
|
|
116
|
+
const token = acquireScanFocus(onScan);
|
|
117
|
+
return () => {
|
|
118
|
+
var _a2;
|
|
119
|
+
try {
|
|
120
|
+
(_a2 = token == null ? void 0 : token.release) == null ? void 0 : _a2.call(token);
|
|
121
|
+
} catch (e) {
|
|
122
|
+
console.warn("[PisellFind] release scan focus failed:", e);
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
} catch (e) {
|
|
126
|
+
console.warn("[PisellFind] acquire scan focus failed, fallback to pubsub:", e);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
const getApp = getAppRef.current;
|
|
130
|
+
if (typeof getApp !== "function") return void 0;
|
|
131
|
+
const app = getApp();
|
|
132
|
+
const pubsub = app == null ? void 0 : app.pubsub;
|
|
133
|
+
if (!pubsub || typeof pubsub.subscribe !== "function") {
|
|
134
|
+
return void 0;
|
|
135
|
+
}
|
|
117
136
|
try {
|
|
118
137
|
pubsub.subscribe(SCAN_RESULT_EVENT, onScan);
|
|
119
138
|
} catch (e) {
|
|
@@ -106,6 +106,8 @@ var PisellLookupComponent = (0, import_react.forwardRef)((props, ref) => {
|
|
|
106
106
|
maskClosable,
|
|
107
107
|
clearOnClose = false,
|
|
108
108
|
autoFocusOnOpen = true,
|
|
109
|
+
// 输入栏插槽
|
|
110
|
+
inputRender,
|
|
109
111
|
// 样式配置
|
|
110
112
|
className,
|
|
111
113
|
style,
|
|
@@ -319,6 +321,8 @@ var PisellLookupComponent = (0, import_react.forwardRef)((props, ref) => {
|
|
|
319
321
|
confirmButtonText,
|
|
320
322
|
showScan,
|
|
321
323
|
value: keyword,
|
|
324
|
+
loading,
|
|
325
|
+
inputRender,
|
|
322
326
|
onChange: handleInputChange,
|
|
323
327
|
onClick: handleTriggerClick,
|
|
324
328
|
onFocus: handleInputFocus,
|
|
@@ -365,7 +369,9 @@ var PisellLookupComponent = (0, import_react.forwardRef)((props, ref) => {
|
|
|
365
369
|
return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lookup-result" }, resultRender(keyword, close));
|
|
366
370
|
};
|
|
367
371
|
const hasAuxiliaryContent = showHistory && history.length > 0 || showSuggestions && suggestions.length > 0 && !!keyword || showHotWords && hotWords.length > 0 && !keyword;
|
|
368
|
-
const hasResultsContent = Boolean(
|
|
372
|
+
const hasResultsContent = Boolean(
|
|
373
|
+
resultRender && (loading || keyword)
|
|
374
|
+
);
|
|
369
375
|
const renderContent = () => {
|
|
370
376
|
if (!hasAuxiliaryContent && !hasResultsContent) {
|
|
371
377
|
return null;
|
|
@@ -423,6 +429,8 @@ var PisellLookupComponent = (0, import_react.forwardRef)((props, ref) => {
|
|
|
423
429
|
confirmButtonText,
|
|
424
430
|
showScan,
|
|
425
431
|
value: keyword,
|
|
432
|
+
loading,
|
|
433
|
+
inputRender,
|
|
426
434
|
onChange: handleInputChange,
|
|
427
435
|
onConfirm: handleConfirm,
|
|
428
436
|
onScan: handleScan,
|
|
@@ -59,6 +59,8 @@ var LookupTriggerComponent = (0, import_react.forwardRef)(
|
|
|
59
59
|
confirmButtonText = (0, import_locales.getText)("pisell-lookup-confirm-button-text"),
|
|
60
60
|
showScan = true,
|
|
61
61
|
value,
|
|
62
|
+
loading,
|
|
63
|
+
inputRender,
|
|
62
64
|
onChange,
|
|
63
65
|
onClick,
|
|
64
66
|
onFocus,
|
|
@@ -150,6 +152,21 @@ var LookupTriggerComponent = (0, import_react.forwardRef)(
|
|
|
150
152
|
}
|
|
151
153
|
};
|
|
152
154
|
const renderInputTrigger = () => {
|
|
155
|
+
if (inputRender) {
|
|
156
|
+
return inputRender({
|
|
157
|
+
value: value ?? "",
|
|
158
|
+
placeholder,
|
|
159
|
+
disabled,
|
|
160
|
+
size,
|
|
161
|
+
loading,
|
|
162
|
+
onChange: (v) => onChange == null ? void 0 : onChange(v),
|
|
163
|
+
onConfirm: (v) => onConfirm == null ? void 0 : onConfirm(v ?? value ?? ""),
|
|
164
|
+
onClear: handleClear,
|
|
165
|
+
onScan: (code) => onScan == null ? void 0 : onScan(code),
|
|
166
|
+
onFocus,
|
|
167
|
+
onBlur
|
|
168
|
+
});
|
|
169
|
+
}
|
|
153
170
|
const prefix = showPrefixIcon ? prefixIcon || /* @__PURE__ */ import_react.default.createElement(import_icons.SearchOutlined, null) : void 0;
|
|
154
171
|
const suffix = /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lookup-input-suffix" }, showClear && value && /* @__PURE__ */ import_react.default.createElement("span", { className: "pisell-lookup-input-clear", onClick: handleClear }, /* @__PURE__ */ import_react.default.createElement(import_icons.CloseOutlined, null), /* @__PURE__ */ import_react.default.createElement("span", { className: "pisell-lookup-input-clear-text" }, (0, import_locales.getText)("pisell-lookup-clear"))), showScan && /* @__PURE__ */ import_react.default.createElement(
|
|
155
172
|
import_iconfont.default,
|
|
@@ -40,6 +40,40 @@ export interface PisellLookupRef {
|
|
|
40
40
|
* Drawer 位置
|
|
41
41
|
*/
|
|
42
42
|
export declare type DrawerPlacement = 'left' | 'right' | 'top' | 'bottom';
|
|
43
|
+
/**
|
|
44
|
+
* 输入栏插槽上下文
|
|
45
|
+
*
|
|
46
|
+
* 通过 `inputRender` 自定义「输入框」形态触发器时,组件会把内部已经接好的受控状态与回调
|
|
47
|
+
* 透传给插槽。插槽只需把这些值绑定到自定义输入控件上,即可完全复用 PisellLookup 的
|
|
48
|
+
* 搜索状态机(受控值 / 防抖实时搜索 / 确认搜索 / 历史 / inline·popup 聚焦展开等)。
|
|
49
|
+
*
|
|
50
|
+
* 仅在 `triggerType='input'`(或 modal/drawer 内置输入框)形态下生效;button/icon/text
|
|
51
|
+
* 触发器不会调用 `inputRender`。
|
|
52
|
+
*/
|
|
53
|
+
export interface LookupInputRenderContext {
|
|
54
|
+
/** 当前关键词(受控值) */
|
|
55
|
+
value: string;
|
|
56
|
+
/** 占位符 */
|
|
57
|
+
placeholder?: string;
|
|
58
|
+
/** 是否禁用 */
|
|
59
|
+
disabled?: boolean;
|
|
60
|
+
/** 尺寸 */
|
|
61
|
+
size?: SizeType;
|
|
62
|
+
/** 是否处于加载态(透传自 PisellLookup 的 loading) */
|
|
63
|
+
loading?: boolean;
|
|
64
|
+
/** 输入变化:写回关键词(受控) */
|
|
65
|
+
onChange: (value: string) => void;
|
|
66
|
+
/** 确认搜索:回车 / 点击搜索按钮时调用,可显式传入当前值 */
|
|
67
|
+
onConfirm: (value?: string) => void;
|
|
68
|
+
/** 清除:清空关键词并恢复结果 */
|
|
69
|
+
onClear: () => void;
|
|
70
|
+
/** 扫码结果回填 */
|
|
71
|
+
onScan?: (code: string) => void;
|
|
72
|
+
/** 聚焦:inline/popup 形态用于展开结果容器 */
|
|
73
|
+
onFocus?: () => void;
|
|
74
|
+
/** 失焦:inline/popup 形态用于延迟关闭结果容器 */
|
|
75
|
+
onBlur?: () => void;
|
|
76
|
+
}
|
|
43
77
|
/**
|
|
44
78
|
* PisellLookup 组件 Props
|
|
45
79
|
*/
|
|
@@ -328,6 +362,27 @@ export interface PisellLookupProps {
|
|
|
328
362
|
* @default true
|
|
329
363
|
*/
|
|
330
364
|
autoFocusOnOpen?: boolean;
|
|
365
|
+
/**
|
|
366
|
+
* 输入栏插槽
|
|
367
|
+
*
|
|
368
|
+
* 自定义「输入框」形态的触发器渲染。传入后会**替换内置 antd Input**,但完整复用
|
|
369
|
+
* PisellLookup 的搜索状态机(受控值 / 实时·确认搜索 / 历史 / 容器形态)。
|
|
370
|
+
* 仅 input 形态生效(含 modal/drawer 内置输入框),button/icon/text 触发器不受影响。
|
|
371
|
+
*
|
|
372
|
+
* @example
|
|
373
|
+
* ```tsx
|
|
374
|
+
* <PisellLookup
|
|
375
|
+
* inputRender={(ctx) => (
|
|
376
|
+
* <MyInput
|
|
377
|
+
* value={ctx.value}
|
|
378
|
+
* onChange={ctx.onChange}
|
|
379
|
+
* onSearch={ctx.onConfirm}
|
|
380
|
+
* />
|
|
381
|
+
* )}
|
|
382
|
+
* />
|
|
383
|
+
* ```
|
|
384
|
+
*/
|
|
385
|
+
inputRender?: (ctx: LookupInputRenderContext) => React.ReactNode;
|
|
331
386
|
/**
|
|
332
387
|
* 自定义类名
|
|
333
388
|
*/
|
|
@@ -455,6 +510,14 @@ export interface LookupTriggerProps {
|
|
|
455
510
|
* 是否自动聚焦
|
|
456
511
|
*/
|
|
457
512
|
autoFocus?: boolean;
|
|
513
|
+
/**
|
|
514
|
+
* 加载态(透传给输入栏插槽 ctx.loading)
|
|
515
|
+
*/
|
|
516
|
+
loading?: boolean;
|
|
517
|
+
/**
|
|
518
|
+
* 输入栏插槽:自定义 input 形态触发器渲染(仅 type='input' 生效)
|
|
519
|
+
*/
|
|
520
|
+
inputRender?: (ctx: LookupInputRenderContext) => React.ReactNode;
|
|
458
521
|
/**
|
|
459
522
|
* 自定义类名
|
|
460
523
|
*/
|
|
@@ -30,7 +30,6 @@
|
|
|
30
30
|
flex: 1;
|
|
31
31
|
font-size: 16px !important;
|
|
32
32
|
font-weight: 500 !important;
|
|
33
|
-
padding: 0 16px !important;
|
|
34
33
|
box-sizing: border-box !important;
|
|
35
34
|
}
|
|
36
35
|
|
|
@@ -42,6 +41,9 @@
|
|
|
42
41
|
align-items: center !important;
|
|
43
42
|
justify-content: center !important;
|
|
44
43
|
line-height: normal !important;
|
|
44
|
+
/** 仅约束左右 6px,不覆盖 antd / lowcode 默认的上下 padding */
|
|
45
|
+
padding-left: 6px !important;
|
|
46
|
+
padding-right: 6px !important;
|
|
45
47
|
}
|
|
46
48
|
|
|
47
49
|
/** 低代码:选中背景与 antd Button primary / 编辑平面图同源 */
|
|
@@ -65,7 +67,7 @@
|
|
|
65
67
|
flex-wrap: nowrap;
|
|
66
68
|
align-items: center;
|
|
67
69
|
width: 100%;
|
|
68
|
-
gap:
|
|
70
|
+
gap: 4px;
|
|
69
71
|
|
|
70
72
|
.record-board-toolbar-find-wrap {
|
|
71
73
|
flex: 1;
|
|
@@ -73,6 +75,11 @@
|
|
|
73
75
|
display: flex;
|
|
74
76
|
align-items: center;
|
|
75
77
|
|
|
78
|
+
/** RecordBoard 顶栏 SearchSection:仅此处 wrapper padding 5px,不改动组件默认 4px */
|
|
79
|
+
.comprehensive-search__search-input-wrapper {
|
|
80
|
+
padding: 5px;
|
|
81
|
+
}
|
|
82
|
+
|
|
76
83
|
.ant-input,
|
|
77
84
|
.ant-input-affix-wrapper {
|
|
78
85
|
width: 100%;
|
|
@@ -131,6 +131,10 @@ var RecordBoardToolBar = (props) => {
|
|
|
131
131
|
} = searchConfigRest;
|
|
132
132
|
return rest;
|
|
133
133
|
})() : {};
|
|
134
|
+
const searchEnableScannerConfigured = searchConfigRest && typeof searchConfigRest === "object" && searchConfigRest.enableScanner === true;
|
|
135
|
+
const [isFindSearchOpen, setIsFindSearchOpen] = (0, import_react.useState)(false);
|
|
136
|
+
const searchConfigOnOpen = searchConfigRest == null ? void 0 : searchConfigRest.onOpen;
|
|
137
|
+
const searchConfigOnClose = searchConfigRest == null ? void 0 : searchConfigRest.onClose;
|
|
134
138
|
const searchNode = hideSearch ? null : isCompactNarrow ? /* @__PURE__ */ import_react.default.createElement(
|
|
135
139
|
import_pisellFind.PisellFind,
|
|
136
140
|
{
|
|
@@ -142,7 +146,16 @@ var RecordBoardToolBar = (props) => {
|
|
|
142
146
|
size: barSize,
|
|
143
147
|
triggerType: "icon",
|
|
144
148
|
className: "record-board-toolbar-find-icon",
|
|
145
|
-
triggerIcon: /* @__PURE__ */ import_react.default.createElement(import_icons.SearchOutlined, { "aria-label": searchButtonText })
|
|
149
|
+
triggerIcon: /* @__PURE__ */ import_react.default.createElement(import_icons.SearchOutlined, { "aria-label": searchButtonText }),
|
|
150
|
+
enableScanner: searchEnableScannerConfigured && isFindSearchOpen,
|
|
151
|
+
onOpen: () => {
|
|
152
|
+
searchConfigOnOpen == null ? void 0 : searchConfigOnOpen();
|
|
153
|
+
setIsFindSearchOpen(true);
|
|
154
|
+
},
|
|
155
|
+
onClose: () => {
|
|
156
|
+
searchConfigOnClose == null ? void 0 : searchConfigOnClose();
|
|
157
|
+
setIsFindSearchOpen(false);
|
|
158
|
+
}
|
|
146
159
|
}
|
|
147
160
|
) : /* @__PURE__ */ import_react.default.createElement(
|
|
148
161
|
import_pisellFind.PisellFind,
|
|
@@ -215,8 +228,7 @@ var RecordBoardToolBar = (props) => {
|
|
|
215
228
|
size: barSize,
|
|
216
229
|
value: bodyView,
|
|
217
230
|
onChange: (v) => setBodyView(v),
|
|
218
|
-
options: bodyViewSegmentedOptions
|
|
219
|
-
style: { marginRight: 8 }
|
|
231
|
+
options: bodyViewSegmentedOptions
|
|
220
232
|
}
|
|
221
233
|
) : null;
|
|
222
234
|
const compactFloorMapToolbar = (bodyView === "floorMap" || bodyView === "calendar") && showTableFloorToggle;
|
|
@@ -371,7 +383,9 @@ var RecordBoardToolBar = (props) => {
|
|
|
371
383
|
}
|
|
372
384
|
);
|
|
373
385
|
const showColumnSetting = slots.columnSetting !== false && bodyView !== "resourceWall" && Array.isArray(gridColumns) && gridColumns.length > 0;
|
|
374
|
-
const
|
|
386
|
+
const collapseActionsToGear = slots.collapseActions === "gear";
|
|
387
|
+
const shouldCollapseToGear = isCompactNarrow || collapseActionsToGear;
|
|
388
|
+
const settingsGearPopoverContent = shouldCollapseToGear ? /* @__PURE__ */ import_react.default.createElement("div", { className: "record-board-toolbar-settings-gear-popover" }, showColumnSetting ? /* @__PURE__ */ import_react.default.createElement("div", { className: "record-board-toolbar-settings-gear-row" }, /* @__PURE__ */ import_react.default.createElement(import_ColumnSetting.default, null)) : null, sortNode ? /* @__PURE__ */ import_react.default.createElement("div", { className: "record-board-toolbar-settings-gear-row" }, sortNode) : null, filterNode ? /* @__PURE__ */ import_react.default.createElement("div", { className: "record-board-toolbar-settings-gear-row" }, filterNode) : null, bodyView !== "resourceWall" ? /* @__PURE__ */ import_react.default.createElement("div", { className: "record-board-toolbar-settings-gear-row" }, /* @__PURE__ */ import_react.default.createElement(import_ToolBarReset.default, { size: barSize })) : null) : null;
|
|
375
389
|
const settingsGearTrigger = settingsGearPopoverContent != null ? /* @__PURE__ */ import_react.default.createElement(
|
|
376
390
|
import_antd.Popover,
|
|
377
391
|
{
|
|
@@ -381,7 +395,8 @@ var RecordBoardToolBar = (props) => {
|
|
|
381
395
|
arrow: false,
|
|
382
396
|
overlayClassName: (0, import_classnames.default)(
|
|
383
397
|
"record-board-toolbar-settings-gear-overlay",
|
|
384
|
-
isCompactNarrow && "record-board-toolbar-settings-gear-overlay--compact-narrow"
|
|
398
|
+
isCompactNarrow && "record-board-toolbar-settings-gear-overlay--compact-narrow",
|
|
399
|
+
!isCompactNarrow && collapseActionsToGear && "record-board-toolbar-settings-gear-overlay--collapsed-actions"
|
|
385
400
|
)
|
|
386
401
|
},
|
|
387
402
|
/* @__PURE__ */ import_react.default.createElement(
|
|
@@ -409,7 +424,7 @@ var RecordBoardToolBar = (props) => {
|
|
|
409
424
|
settingsGearTrigger
|
|
410
425
|
) : null;
|
|
411
426
|
const topLeft = compactFloorMapToolbar ? null : /* @__PURE__ */ import_react.default.createElement("div", { className: "record-board-toolbar-top-left" }, !hideBodyViewToggleInToolbarRow ? bodyViewToggle : null, mergeQuickFilterWithCompactTrailing && quickFilterNode ? /* @__PURE__ */ import_react.default.createElement("div", { className: "record-board-toolbar-hud-unified-quick-filter-row" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "record-board-toolbar-quick-filter-slot" }, quickFilterNode), compactNarrowTrailingCluster) : quickFilterNode ? /* @__PURE__ */ import_react.default.createElement("div", { className: "record-board-toolbar-quick-filter-slot" }, quickFilterNode) : null, searchNode && bodyView !== "resourceWall" && !isCompactNarrow ? /* @__PURE__ */ import_react.default.createElement("div", { className: "record-board-toolbar-find-wrap" }, searchNode) : null, slots.topLeft ? /* @__PURE__ */ import_react.default.createElement("div", { className: "record-board-toolbar-extra-top-left" }, slots.topLeft) : null);
|
|
412
|
-
const topRight = compactFloorMapToolbar ? null : isCompactNarrow ? mergeQuickFilterWithCompactTrailing ? slots.topRight ?? null : /* @__PURE__ */ import_react.default.createElement(import_antd.Space, { className: "record-board-toolbar-right-actions", size: 4 }, bodyView !== "resourceWall" && searchNode ? searchNode : null, settingsGearTrigger, slots.topRight) : /* @__PURE__ */ import_react.default.createElement(import_antd.Space, { className: "record-board-toolbar-right-actions" }, showColumnSetting ? /* @__PURE__ */ import_react.default.createElement(import_ColumnSetting.default, null) : null, sortNode, filterNode, bodyView !== "resourceWall" ? /* @__PURE__ */ import_react.default.createElement(import_ToolBarReset.default, { size: barSize }) : null, slots.topRight);
|
|
427
|
+
const topRight = compactFloorMapToolbar ? null : isCompactNarrow ? mergeQuickFilterWithCompactTrailing ? slots.topRight ?? null : /* @__PURE__ */ import_react.default.createElement(import_antd.Space, { className: "record-board-toolbar-right-actions", size: 4 }, bodyView !== "resourceWall" && searchNode ? searchNode : null, settingsGearTrigger, slots.topRight) : collapseActionsToGear && settingsGearTrigger ? /* @__PURE__ */ import_react.default.createElement(import_antd.Space, { className: "record-board-toolbar-right-actions", size: 8 }, settingsGearTrigger, slots.topRight) : /* @__PURE__ */ import_react.default.createElement(import_antd.Space, { className: "record-board-toolbar-right-actions" }, showColumnSetting ? /* @__PURE__ */ import_react.default.createElement(import_ColumnSetting.default, null) : null, sortNode, filterNode, bodyView !== "resourceWall" ? /* @__PURE__ */ import_react.default.createElement(import_ToolBarReset.default, { size: barSize }) : null, slots.topRight);
|
|
413
428
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
414
429
|
import_ToolBar.default,
|
|
415
430
|
{
|