@pisell/materials 6.11.239 → 6.11.241
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/preview.js +4 -4
- package/build/lowcode/render/default/view.js +16 -16
- package/build/lowcode/view.js +15 -15
- package/es/components/PisellTabbar/template/Template1/PisellTabbar.d.ts +2 -0
- package/es/components/PisellTabbar/template/Template1/PisellTabbar.js +47 -22
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +1 -1
- package/es/components/dataSourceComponents/fields/index.d.ts +8 -8
- package/es/components/pisellFind/index.d.ts +2 -0
- package/es/components/pisellFind/index.js +11 -0
- package/es/components/pisellLookup/PisellLookup.js +22 -6
- package/es/components/pisellLookup/components/LookupResultHost.js +56 -38
- package/es/components/pisellLookup/components/LookupTrigger.js +2 -0
- package/es/components/pisellLookup/types.d.ts +36 -0
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/lib/components/PisellTabbar/template/Template1/PisellTabbar.d.ts +2 -0
- package/lib/components/PisellTabbar/template/Template1/PisellTabbar.js +71 -35
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/index.d.ts +8 -8
- package/lib/components/pisellFind/index.d.ts +2 -0
- package/lib/components/pisellFind/index.js +19 -0
- package/lib/components/pisellLookup/PisellLookup.js +18 -4
- package/lib/components/pisellLookup/components/LookupResultHost.js +50 -35
- package/lib/components/pisellLookup/components/LookupTrigger.js +2 -0
- package/lib/components/pisellLookup/types.d.ts +36 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.js +2 -0
- package/package.json +3 -3
- package/es/components/PisellGroupView/PisellGroupView.d.ts +0 -9
- package/es/components/PisellGroupView/PisellGroupView.stories.d.ts +0 -27
- package/es/components/PisellGroupView/index.d.ts +0 -6
- package/es/components/PisellGroupView/types.d.ts +0 -124
- package/es/components/PisellGroupView/utils/index.d.ts +0 -20
- package/es/components/PisellProcedure/PisellProcedure.stories.d.ts +0 -163
- package/es/components/PisellScrollView/PisellScrollView.d.ts +0 -5
- package/es/components/PisellScrollView/PisellScrollView.stories.d.ts +0 -87
- package/es/components/PisellScrollView/hooks/useScrollState.d.ts +0 -13
- package/es/components/PisellSteps/PisellSteps.stories.d.ts +0 -155
- package/es/components/PisellSuperTabs/PisellSuperTabs.d.ts +0 -8
- package/es/components/PisellTabbar/constants.d.ts +0 -47
- package/es/components/PisellTabbar/types.d.ts +0 -119
- package/es/components/buttonGroupPreview/index.d.ts +0 -19
- package/es/components/dataSourceComponents/fields/Translation/BaseTranslation.d.ts +0 -5
- package/es/components/dataSourceComponents/fields/Translation/type.d.ts +0 -22
- package/es/components/pisellFloorMapLayout/PisellFloorMapLayout.d.ts +0 -13
- package/es/components/pisellFloorMapLayout/components/CanvasTabs.d.ts +0 -27
- package/es/components/pisellFloorMapLayout/components/EditableItemLayer.d.ts +0 -89
- package/es/components/pisellFloorMapLayout/components/FloorMapEditPanel.d.ts +0 -14
- package/es/components/pisellFloorMapLayout/components/FloorMapEditTopBar.d.ts +0 -64
- package/es/components/pisellFloorMapLayout/components/FloorMapOverview.d.ts +0 -49
- package/es/components/pisellFloorMapLayout/components/FloorMapSelectionZoneElement.d.ts +0 -13
- package/es/components/pisellFloorMapLayout/components/FloorMapToolbar.d.ts +0 -84
- package/es/components/pisellFloorMapLayout/components/FloorMapToolbarViewAllModal.d.ts +0 -20
- package/es/components/pisellFloorMapLayout/hooks/useFloorMapEditState.d.ts +0 -94
- package/es/components/pisellFloorMapLayout/index.d.ts +0 -39
- package/es/components/pisellFloorMapLayout/locales-ja.d.ts +0 -184
- package/es/components/pisellFloorMapLayout/locales-pt.d.ts +0 -184
- package/es/components/pisellFloorMapLayout/locales.d.ts +0 -969
- package/es/components/pisellFloorMapLayout/shopFloorPlan/shopFloorPlanClient.d.ts +0 -10
- package/es/components/pisellFloorMapLayout/shopFloorPlan/shopFloorPlanPure.d.ts +0 -22
- package/es/components/pisellFloorMapLayout/shopFloorPlan/shopFloorPlanTypes.d.ts +0 -80
- package/es/components/pisellFloorMapLayout/types.d.ts +0 -769
- package/es/components/pisellFloorMapLayout/utils/floorMapCanvasDisplay.d.ts +0 -27
- package/es/components/pisellFloorMapLayout/utils/floorMapConfigMerge.d.ts +0 -8
- package/es/components/pisellFloorMapLayout/utils/floorMapFallbackRender.d.ts +0 -11
- package/es/components/pisellFloorMapLayout/utils/floorMapResourcePickerDisplay.d.ts +0 -27
- package/es/components/pisellFloorMapLayout/utils/floorMapResourcePickerTypes.d.ts +0 -109
- package/es/components/pisellFloorMapLayout/utils/floorMapSelectionZone.d.ts +0 -24
- package/es/components/pisellRecordBoard/PisellRecordBoard.d.ts +0 -9
- package/es/components/pisellRecordBoard/layouts/GridLayout/Grid.d.ts +0 -14
- package/es/components/pisellRecordBoard/shellFrame/Calendar/BookingCalendar.d.ts +0 -9
- package/es/components/pisellRecordBoard/shellFrame/Calendar/bookingCalendarInternalTypes.d.ts +0 -43
- package/es/components/pisellRecordBoard/shellFrame/Calendar/bookingCalendarViewShared.d.ts +0 -34
- package/es/components/pisellRecordBoard/shellFrame/Calendar/const/bookingCalendarConstants.d.ts +0 -102
- package/es/components/pisellRecordBoard/shellFrame/Calendar/modal/BookingCalendarOverflowListLayer.d.ts +0 -18
- package/es/components/pisellRecordBoard/shellFrame/Calendar/modal/OverflowListModal.d.ts +0 -30
- package/es/components/pisellRecordBoard/shellFrame/Calendar/modal/OverflowPopover.d.ts +0 -9
- package/es/components/pisellRecordBoard/shellFrame/Calendar/utils/bookingCalendarAxis.d.ts +0 -32
- package/es/components/pisellRecordBoard/shellFrame/Calendar/utils/bookingCalendarDateUtils.d.ts +0 -330
- package/es/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarDayView.d.ts +0 -52
- package/es/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarMonthView.d.ts +0 -22
- package/es/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarResourceView.d.ts +0 -57
- package/es/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarWeekView.d.ts +0 -26
- package/es/components/pisellRecordBoard/shellFrame/Pagination/index.d.ts +0 -14
- package/es/components/pisellRecordBoard/types.d.ts +0 -899
- package/es/components/pisellTimeRangeDisplay/PisellTimeRangeDisplay.d.ts +0 -32
- package/es/components/pisellTimeRangeDisplay/components/TimeRangeBlock.d.ts +0 -36
- package/es/components/pisellTimeRangeDisplay/types.d.ts +0 -145
- package/es/components/productCard/cartSkuCard/components/AmountFooter/index.d.ts +0 -4
- package/es/components/productCard/cartSkuCard/components/basicInfo/index.d.ts +0 -36
- package/es/components/productCard/cartSkuCard/components/inlineActions/index.d.ts +0 -15
- package/es/components/productCard/cartSkuCard/components/specs/index.d.ts +0 -22
- package/es/components/productCard/cartSkuCard/components/weighing/index.d.ts +0 -23
- package/es/components/productCard/cartSkuCard/index.d.ts +0 -15
- package/es/components/productCard/lineItem/BookingLineItem.d.ts +0 -23
- package/es/components/productCard/lineItem/components/Holders/index.d.ts +0 -10
- package/es/components/productCard/lineItem/components/Resources/index.d.ts +0 -7
- package/es/components/productCard/lineItem/index.d.ts +0 -72
- package/es/components/productCard/lineItem/locales.d.ts +0 -38
- package/es/components/productCard/types.d.ts +0 -98
- package/es/components/select-time/RightPanel/index.d.ts +0 -10
- package/es/components/select-time/index.d.ts +0 -16
- package/es/components/table/hooks/useTableSetting.d.ts +0 -21
- package/es/components/virtual-keyboard/Time/index.d.ts +0 -14
- package/es/components/virtual-keyboard/index.d.ts +0 -25
- package/es/hooks/useTranslationOriginal.d.ts +0 -4
- package/es/locales/en-US.d.ts +0 -566
- package/es/locales/ja.d.ts +0 -534
- package/es/locales/pt.d.ts +0 -534
- package/es/locales/zh-CN.d.ts +0 -561
- package/es/locales/zh-TW.d.ts +0 -561
- package/lib/components/PisellGroupView/PisellGroupView.d.ts +0 -9
- package/lib/components/PisellGroupView/PisellGroupView.stories.d.ts +0 -27
- package/lib/components/PisellGroupView/index.d.ts +0 -6
- package/lib/components/PisellGroupView/types.d.ts +0 -124
- package/lib/components/PisellGroupView/utils/index.d.ts +0 -20
- package/lib/components/PisellProcedure/PisellProcedure.stories.d.ts +0 -163
- package/lib/components/PisellScrollView/PisellScrollView.d.ts +0 -5
- package/lib/components/PisellScrollView/PisellScrollView.stories.d.ts +0 -87
- package/lib/components/PisellScrollView/hooks/useScrollState.d.ts +0 -13
- package/lib/components/PisellSteps/PisellSteps.stories.d.ts +0 -155
- package/lib/components/PisellSuperTabs/PisellSuperTabs.d.ts +0 -8
- package/lib/components/PisellTabbar/constants.d.ts +0 -47
- package/lib/components/PisellTabbar/types.d.ts +0 -119
- package/lib/components/buttonGroupPreview/index.d.ts +0 -19
- package/lib/components/dataSourceComponents/fields/Translation/BaseTranslation.d.ts +0 -5
- package/lib/components/dataSourceComponents/fields/Translation/type.d.ts +0 -22
- package/lib/components/pisellFloorMapLayout/PisellFloorMapLayout.d.ts +0 -13
- package/lib/components/pisellFloorMapLayout/components/CanvasTabs.d.ts +0 -27
- package/lib/components/pisellFloorMapLayout/components/EditableItemLayer.d.ts +0 -89
- package/lib/components/pisellFloorMapLayout/components/FloorMapEditPanel.d.ts +0 -14
- package/lib/components/pisellFloorMapLayout/components/FloorMapEditTopBar.d.ts +0 -64
- package/lib/components/pisellFloorMapLayout/components/FloorMapOverview.d.ts +0 -49
- package/lib/components/pisellFloorMapLayout/components/FloorMapSelectionZoneElement.d.ts +0 -13
- package/lib/components/pisellFloorMapLayout/components/FloorMapToolbar.d.ts +0 -84
- package/lib/components/pisellFloorMapLayout/components/FloorMapToolbarViewAllModal.d.ts +0 -20
- package/lib/components/pisellFloorMapLayout/hooks/useFloorMapEditState.d.ts +0 -94
- package/lib/components/pisellFloorMapLayout/index.d.ts +0 -39
- package/lib/components/pisellFloorMapLayout/locales-ja.d.ts +0 -184
- package/lib/components/pisellFloorMapLayout/locales-pt.d.ts +0 -184
- package/lib/components/pisellFloorMapLayout/locales.d.ts +0 -969
- package/lib/components/pisellFloorMapLayout/shopFloorPlan/shopFloorPlanClient.d.ts +0 -10
- package/lib/components/pisellFloorMapLayout/shopFloorPlan/shopFloorPlanPure.d.ts +0 -22
- package/lib/components/pisellFloorMapLayout/shopFloorPlan/shopFloorPlanTypes.d.ts +0 -80
- package/lib/components/pisellFloorMapLayout/types.d.ts +0 -769
- package/lib/components/pisellFloorMapLayout/utils/floorMapCanvasDisplay.d.ts +0 -27
- package/lib/components/pisellFloorMapLayout/utils/floorMapConfigMerge.d.ts +0 -8
- package/lib/components/pisellFloorMapLayout/utils/floorMapFallbackRender.d.ts +0 -11
- package/lib/components/pisellFloorMapLayout/utils/floorMapResourcePickerDisplay.d.ts +0 -27
- package/lib/components/pisellFloorMapLayout/utils/floorMapResourcePickerTypes.d.ts +0 -109
- package/lib/components/pisellFloorMapLayout/utils/floorMapSelectionZone.d.ts +0 -24
- package/lib/components/pisellRecordBoard/PisellRecordBoard.d.ts +0 -9
- package/lib/components/pisellRecordBoard/layouts/GridLayout/Grid.d.ts +0 -14
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/BookingCalendar.d.ts +0 -9
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/bookingCalendarInternalTypes.d.ts +0 -43
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/bookingCalendarViewShared.d.ts +0 -34
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/const/bookingCalendarConstants.d.ts +0 -102
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/modal/BookingCalendarOverflowListLayer.d.ts +0 -18
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/modal/OverflowListModal.d.ts +0 -30
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/modal/OverflowPopover.d.ts +0 -9
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/utils/bookingCalendarAxis.d.ts +0 -32
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/utils/bookingCalendarDateUtils.d.ts +0 -330
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarDayView.d.ts +0 -52
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarMonthView.d.ts +0 -22
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarResourceView.d.ts +0 -57
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarWeekView.d.ts +0 -26
- package/lib/components/pisellRecordBoard/shellFrame/Pagination/index.d.ts +0 -14
- package/lib/components/pisellRecordBoard/types.d.ts +0 -899
- package/lib/components/pisellTimeRangeDisplay/PisellTimeRangeDisplay.d.ts +0 -32
- package/lib/components/pisellTimeRangeDisplay/components/TimeRangeBlock.d.ts +0 -36
- package/lib/components/pisellTimeRangeDisplay/types.d.ts +0 -145
- package/lib/components/productCard/cartSkuCard/components/AmountFooter/index.d.ts +0 -4
- package/lib/components/productCard/cartSkuCard/components/basicInfo/index.d.ts +0 -36
- package/lib/components/productCard/cartSkuCard/components/inlineActions/index.d.ts +0 -15
- package/lib/components/productCard/cartSkuCard/components/specs/index.d.ts +0 -22
- package/lib/components/productCard/cartSkuCard/components/weighing/index.d.ts +0 -23
- package/lib/components/productCard/cartSkuCard/index.d.ts +0 -15
- package/lib/components/productCard/lineItem/BookingLineItem.d.ts +0 -23
- package/lib/components/productCard/lineItem/components/Holders/index.d.ts +0 -10
- package/lib/components/productCard/lineItem/components/Resources/index.d.ts +0 -7
- package/lib/components/productCard/lineItem/index.d.ts +0 -72
- package/lib/components/productCard/lineItem/locales.d.ts +0 -38
- package/lib/components/productCard/types.d.ts +0 -98
- package/lib/components/select-time/RightPanel/index.d.ts +0 -10
- package/lib/components/select-time/index.d.ts +0 -16
- package/lib/components/table/hooks/useTableSetting.d.ts +0 -21
- package/lib/components/virtual-keyboard/Time/index.d.ts +0 -14
- package/lib/components/virtual-keyboard/index.d.ts +0 -25
- package/lib/hooks/useTranslationOriginal.d.ts +0 -4
- package/lib/locales/en-US.d.ts +0 -566
- package/lib/locales/ja.d.ts +0 -534
- package/lib/locales/pt.d.ts +0 -534
- package/lib/locales/zh-CN.d.ts +0 -561
- package/lib/locales/zh-TW.d.ts +0 -561
|
@@ -84,6 +84,11 @@ export interface LookupInputRenderContext {
|
|
|
84
84
|
* PisellLookup 组件 Props
|
|
85
85
|
*/
|
|
86
86
|
export interface PisellLookupProps {
|
|
87
|
+
/**
|
|
88
|
+
* 是否渲染外部触发器;受控打开浮层时可关闭。
|
|
89
|
+
* @default true
|
|
90
|
+
*/
|
|
91
|
+
showTrigger?: boolean;
|
|
87
92
|
/**
|
|
88
93
|
* 预设触发器类型(与 trigger 互斥)
|
|
89
94
|
* @default 'input'
|
|
@@ -189,6 +194,12 @@ export interface PisellLookupProps {
|
|
|
189
194
|
* @param keyword 搜索关键词
|
|
190
195
|
*/
|
|
191
196
|
onSearch?: (keyword: string) => void;
|
|
197
|
+
/**
|
|
198
|
+
* 是否允许重复确认同一个关键词。
|
|
199
|
+
* 适用于提交失败后需要原值重试的场景;默认保持去重行为。
|
|
200
|
+
* @default false
|
|
201
|
+
*/
|
|
202
|
+
allowRepeatSearch?: boolean;
|
|
192
203
|
/**
|
|
193
204
|
* 是否显示扫码按钮
|
|
194
205
|
* @default true
|
|
@@ -299,6 +310,13 @@ export interface PisellLookupProps {
|
|
|
299
310
|
* Modal 自定义样式
|
|
300
311
|
*/
|
|
301
312
|
modalStyle?: React.CSSProperties;
|
|
313
|
+
/**
|
|
314
|
+
* Modal 是否使用容器原生的垂直居中布局。
|
|
315
|
+
* @default false
|
|
316
|
+
*/
|
|
317
|
+
modalCentered?: boolean;
|
|
318
|
+
/** Modal 进出场动画名称。 */
|
|
319
|
+
modalTransitionName?: string;
|
|
302
320
|
/**
|
|
303
321
|
* Modal 挂载节点
|
|
304
322
|
* - HTMLElement: 挂载到指定的 DOM 节点
|
|
@@ -313,11 +331,17 @@ export interface PisellLookupProps {
|
|
|
313
331
|
* @default 378
|
|
314
332
|
*/
|
|
315
333
|
drawerWidth?: number | string;
|
|
334
|
+
/** Drawer 高度;placement 为 top / bottom 时生效。 */
|
|
335
|
+
drawerHeight?: number | string;
|
|
316
336
|
/**
|
|
317
337
|
* Drawer 位置
|
|
318
338
|
* @default 'right'
|
|
319
339
|
*/
|
|
320
340
|
drawerPlacement?: DrawerPlacement;
|
|
341
|
+
/** Drawer 标题;传 null 可隐藏默认标题。 */
|
|
342
|
+
drawerTitle?: React.ReactNode | null;
|
|
343
|
+
/** 是否展示 Drawer 自带关闭按钮。 */
|
|
344
|
+
drawerClosable?: boolean;
|
|
321
345
|
/**
|
|
322
346
|
* Popup 宽度
|
|
323
347
|
*/
|
|
@@ -394,6 +418,8 @@ export interface PisellLookupProps {
|
|
|
394
418
|
* ```
|
|
395
419
|
*/
|
|
396
420
|
inputRender?: (ctx: LookupInputRenderContext) => React.ReactNode;
|
|
421
|
+
/** Modal / Drawer 内置搜索栏上方的自定义内容。 */
|
|
422
|
+
headerRender?: React.ReactNode | (() => React.ReactNode);
|
|
397
423
|
/**
|
|
398
424
|
* 自定义类名
|
|
399
425
|
*/
|
|
@@ -631,6 +657,10 @@ export interface LookupResultHostProps {
|
|
|
631
657
|
* Modal 宽度
|
|
632
658
|
*/
|
|
633
659
|
modalWidth?: number | string;
|
|
660
|
+
/** Modal 是否垂直居中 */
|
|
661
|
+
modalCentered?: boolean;
|
|
662
|
+
/** Modal 进出场动画名称 */
|
|
663
|
+
modalTransitionName?: string;
|
|
634
664
|
/**
|
|
635
665
|
* Modal 样式
|
|
636
666
|
*/
|
|
@@ -643,10 +673,16 @@ export interface LookupResultHostProps {
|
|
|
643
673
|
* Drawer 宽度
|
|
644
674
|
*/
|
|
645
675
|
drawerWidth?: number | string;
|
|
676
|
+
/** Drawer 高度 */
|
|
677
|
+
drawerHeight?: number | string;
|
|
646
678
|
/**
|
|
647
679
|
* Drawer 位置
|
|
648
680
|
*/
|
|
649
681
|
drawerPlacement?: DrawerPlacement;
|
|
682
|
+
/** Drawer 标题 */
|
|
683
|
+
drawerTitle?: React.ReactNode | null;
|
|
684
|
+
/** 是否展示 Drawer 自带关闭按钮 */
|
|
685
|
+
drawerClosable?: boolean;
|
|
650
686
|
/**
|
|
651
687
|
* Popup 宽度
|
|
652
688
|
*/
|
package/es/index.d.ts
CHANGED
|
@@ -128,7 +128,7 @@ export { default as PisellUpload } from './components/pisellUpload';
|
|
|
128
128
|
export { default as Translation } from './components/translation';
|
|
129
129
|
export { PisellLookup } from './components/pisellLookup';
|
|
130
130
|
export type { PisellLookupProps, PisellLookupRef, LookupInputRenderContext, } from './components/pisellLookup';
|
|
131
|
-
export { PisellFind } from './components/pisellFind';
|
|
131
|
+
export { FIND_FALLBACK_SCANNER_COUNT_KEY, PisellFind, } from './components/pisellFind';
|
|
132
132
|
export type { PisellFindProps, PisellFindRef } from './components/pisellFind';
|
|
133
133
|
export { default as DataSourceForm } from './components/dataSourceComponents/dataSourceForm';
|
|
134
134
|
export { default as FormGroup } from './components/dataSourceComponents/dataSourceForm/group';
|
package/es/index.js
CHANGED
|
@@ -130,7 +130,7 @@ export { default as CustomSelect } from "./components/customSelect";
|
|
|
130
130
|
export { default as PisellUpload } from "./components/pisellUpload";
|
|
131
131
|
export { default as Translation } from "./components/translation";
|
|
132
132
|
export { PisellLookup } from "./components/pisellLookup";
|
|
133
|
-
export { PisellFind } from "./components/pisellFind";
|
|
133
|
+
export { FIND_FALLBACK_SCANNER_COUNT_KEY, PisellFind } from "./components/pisellFind";
|
|
134
134
|
// ==================== 数据源组件 (DataSource) ====================
|
|
135
135
|
// 数据源绑定相关组件,用于低代码场景
|
|
136
136
|
export { default as DataSourceForm } from "./components/dataSourceComponents/dataSourceForm";
|
|
@@ -5,6 +5,8 @@ export declare type PisellTabbarTemplate1Direction = 'horizontal' | 'vertical';
|
|
|
5
5
|
export interface PisellTabbarTemplate1Props extends PisellTabbarProps {
|
|
6
6
|
/** Tab 排列方向;默认保持现有横向布局。 */
|
|
7
7
|
direction?: PisellTabbarTemplate1Direction;
|
|
8
|
+
/** 是否在每个层级展示自动生成的 All 分类;默认保持展示。 */
|
|
9
|
+
showAllItem?: boolean;
|
|
8
10
|
}
|
|
9
11
|
declare const _default: React.ForwardRefExoticComponent<PisellTabbarTemplate1Props & React.RefAttributes<unknown>>;
|
|
10
12
|
export default _default;
|
|
@@ -43,6 +43,11 @@ var import_hooks = require("../../hooks");
|
|
|
43
43
|
var import_mock = __toESM(require("../../mock"));
|
|
44
44
|
var import_constants = require("./constants");
|
|
45
45
|
var import_utils = require("./utils");
|
|
46
|
+
var tabbarInstanceSequence = 0;
|
|
47
|
+
function createTabbarInstanceId() {
|
|
48
|
+
tabbarInstanceSequence += 1;
|
|
49
|
+
return `sku-list-tabbar-temp1-${tabbarInstanceSequence}`;
|
|
50
|
+
}
|
|
46
51
|
function renderCategoryIcon(icon, size) {
|
|
47
52
|
if (/^(?:https?:\/\/|data:|blob:|\/)/i.test(icon)) {
|
|
48
53
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
@@ -62,6 +67,7 @@ function renderCategoryIcon(icon, size) {
|
|
|
62
67
|
return /* @__PURE__ */ import_react.default.createElement(import_iconfont.default, { type: icon, style: { fontSize: size } });
|
|
63
68
|
}
|
|
64
69
|
var PisellTabbar = (props, ref) => {
|
|
70
|
+
var _a, _b;
|
|
65
71
|
const {
|
|
66
72
|
dataSource = (props == null ? void 0 : props.__designMode) ? import_mock.default : import_mock.default,
|
|
67
73
|
value,
|
|
@@ -74,16 +80,19 @@ var PisellTabbar = (props, ref) => {
|
|
|
74
80
|
onSearch,
|
|
75
81
|
searchProps,
|
|
76
82
|
level1Actions,
|
|
77
|
-
direction = "horizontal"
|
|
83
|
+
direction = "horizontal",
|
|
84
|
+
showAllItem = true
|
|
78
85
|
} = props;
|
|
79
86
|
const isVertical = direction === "vertical";
|
|
80
87
|
const containerRef = (0, import_react.useRef)(null);
|
|
81
88
|
const searchRef = (0, import_react.useRef)(null);
|
|
82
|
-
const
|
|
83
|
-
const
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
89
|
+
const firstCategoryKey = ((_a = dataSource[0]) == null ? void 0 : _a.id) ?? ((_b = dataSource[0]) == null ? void 0 : _b.key);
|
|
90
|
+
const initialActiveKey = value ?? (showAllItem ? (0, import_utils.getDefaultActiveKey)(dataSource, "id") : firstCategoryKey !== void 0 ? [firstCategoryKey] : []);
|
|
91
|
+
const tabbarIdRef = (0, import_react.useRef)();
|
|
92
|
+
if (!tabbarIdRef.current) {
|
|
93
|
+
tabbarIdRef.current = createTabbarInstanceId();
|
|
94
|
+
}
|
|
95
|
+
const tabbarId = tabbarIdRef.current;
|
|
87
96
|
const {
|
|
88
97
|
setActiveKey,
|
|
89
98
|
getActiveKey,
|
|
@@ -92,7 +101,7 @@ var PisellTabbar = (props, ref) => {
|
|
|
92
101
|
setCacheActiveKey,
|
|
93
102
|
resetActiveKey
|
|
94
103
|
} = (0, import_hooks.useActiveKey)({
|
|
95
|
-
initialActiveKey
|
|
104
|
+
initialActiveKey,
|
|
96
105
|
onChange
|
|
97
106
|
});
|
|
98
107
|
const { expand, toggleExpand, getExpand } = (0, import_hooks.useExpand)();
|
|
@@ -124,8 +133,8 @@ var PisellTabbar = (props, ref) => {
|
|
|
124
133
|
}
|
|
125
134
|
return {
|
|
126
135
|
closeSearchMode: () => {
|
|
127
|
-
var
|
|
128
|
-
return (
|
|
136
|
+
var _a2;
|
|
137
|
+
return (_a2 = searchRef.current) == null ? void 0 : _a2.close();
|
|
129
138
|
}
|
|
130
139
|
};
|
|
131
140
|
});
|
|
@@ -145,17 +154,25 @@ var PisellTabbar = (props, ref) => {
|
|
|
145
154
|
);
|
|
146
155
|
const handleLevel1Change = (0, import_react.useCallback)(
|
|
147
156
|
(key, item) => {
|
|
148
|
-
var
|
|
149
|
-
setActiveKey(
|
|
157
|
+
var _a2;
|
|
158
|
+
setActiveKey(
|
|
159
|
+
0,
|
|
160
|
+
key,
|
|
161
|
+
showAllItem && ((_a2 = item == null ? void 0 : item.children) == null ? void 0 : _a2.length) ? 0 : void 0
|
|
162
|
+
);
|
|
150
163
|
},
|
|
151
|
-
[setActiveKey, activeKey]
|
|
164
|
+
[setActiveKey, activeKey, showAllItem]
|
|
152
165
|
);
|
|
153
166
|
const handleLevel2Change = (0, import_react.useCallback)(
|
|
154
167
|
(key, item) => {
|
|
155
|
-
var
|
|
156
|
-
setActiveKey(
|
|
168
|
+
var _a2;
|
|
169
|
+
setActiveKey(
|
|
170
|
+
1,
|
|
171
|
+
key,
|
|
172
|
+
showAllItem && ((_a2 = item == null ? void 0 : item.children) == null ? void 0 : _a2.length) ? 0 : void 0
|
|
173
|
+
);
|
|
157
174
|
},
|
|
158
|
-
[setActiveKey, activeKey]
|
|
175
|
+
[setActiveKey, activeKey, showAllItem]
|
|
159
176
|
);
|
|
160
177
|
const handleLevel3Change = (0, import_react.useCallback)(
|
|
161
178
|
(key) => {
|
|
@@ -165,7 +182,7 @@ var PisellTabbar = (props, ref) => {
|
|
|
165
182
|
);
|
|
166
183
|
const renderExpandCard = (0, import_react.useCallback)(
|
|
167
184
|
(cardProps, level, isExpanded) => {
|
|
168
|
-
var
|
|
185
|
+
var _a2;
|
|
169
186
|
const config = expandConfig[isExpanded ? "active" : "inactive"];
|
|
170
187
|
const levelCfg = getLevelConfig(level);
|
|
171
188
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
@@ -200,7 +217,7 @@ var PisellTabbar = (props, ref) => {
|
|
|
200
217
|
active: {
|
|
201
218
|
...cardProps.active,
|
|
202
219
|
style: {
|
|
203
|
-
...(
|
|
220
|
+
...(_a2 = cardProps.active) == null ? void 0 : _a2.style,
|
|
204
221
|
color: "#ffffff",
|
|
205
222
|
background: "#7f56d9"
|
|
206
223
|
}
|
|
@@ -225,22 +242,22 @@ var PisellTabbar = (props, ref) => {
|
|
|
225
242
|
onSearch == null ? void 0 : onSearch(e);
|
|
226
243
|
},
|
|
227
244
|
getContainer: () => {
|
|
228
|
-
var
|
|
229
|
-
const customContainer = (
|
|
245
|
+
var _a2;
|
|
246
|
+
const customContainer = (_a2 = searchProps == null ? void 0 : searchProps.getContainer) == null ? void 0 : _a2.call(searchProps);
|
|
230
247
|
return customContainer || document.querySelector(`#${tabbarId}`) || document.body;
|
|
231
248
|
},
|
|
232
249
|
modalStyle: {
|
|
233
250
|
width: "100%"
|
|
234
251
|
},
|
|
235
252
|
onOpen: () => {
|
|
236
|
-
var
|
|
253
|
+
var _a2;
|
|
237
254
|
openSearchMode();
|
|
238
|
-
(
|
|
255
|
+
(_a2 = searchProps == null ? void 0 : searchProps.onOpen) == null ? void 0 : _a2.call(searchProps);
|
|
239
256
|
},
|
|
240
257
|
onClose: () => {
|
|
241
|
-
var
|
|
258
|
+
var _a2;
|
|
242
259
|
closeSearchMode();
|
|
243
|
-
(
|
|
260
|
+
(_a2 = searchProps == null ? void 0 : searchProps.onClose) == null ? void 0 : _a2.call(searchProps);
|
|
244
261
|
},
|
|
245
262
|
trigger: /* @__PURE__ */ import_react.default.createElement(
|
|
246
263
|
import_PisellCards.default.MultilevelCard,
|
|
@@ -278,7 +295,7 @@ var PisellTabbar = (props, ref) => {
|
|
|
278
295
|
);
|
|
279
296
|
const renderNormalCard = (0, import_react.useCallback)(
|
|
280
297
|
(cardProps, level) => {
|
|
281
|
-
var
|
|
298
|
+
var _a2;
|
|
282
299
|
const { dataSource: itemData } = cardProps;
|
|
283
300
|
const levelCfg = getLevelConfig(level);
|
|
284
301
|
const textAlign = isVertical ? levelCfg.textAlign ?? "center" : "center";
|
|
@@ -300,7 +317,7 @@ var PisellTabbar = (props, ref) => {
|
|
|
300
317
|
style: {
|
|
301
318
|
...isVertical ? { minHeight: levelCfg.cardHeight } : { height: levelCfg.cardHeight },
|
|
302
319
|
borderRadius: isVertical ? levelCfg.borderRadius ?? "999px" : "20px",
|
|
303
|
-
background: "#ffffff",
|
|
320
|
+
background: levelCfg.cardBackground ?? "#ffffff",
|
|
304
321
|
minWidth: isVertical ? 0 : 100,
|
|
305
322
|
justifyContent: isVertical && textAlign === "left" ? "flex-start" : "center"
|
|
306
323
|
},
|
|
@@ -308,9 +325,9 @@ var PisellTabbar = (props, ref) => {
|
|
|
308
325
|
active: {
|
|
309
326
|
...cardProps.active,
|
|
310
327
|
style: {
|
|
311
|
-
...(
|
|
328
|
+
...(_a2 = cardProps.active) == null ? void 0 : _a2.style,
|
|
312
329
|
color: "#fff",
|
|
313
|
-
background: "#7f56d9"
|
|
330
|
+
background: levelCfg.activeBackground ?? "#7f56d9"
|
|
314
331
|
}
|
|
315
332
|
}
|
|
316
333
|
}
|
|
@@ -320,7 +337,12 @@ var PisellTabbar = (props, ref) => {
|
|
|
320
337
|
);
|
|
321
338
|
const level1DataSource = (0, import_react.useMemo)(
|
|
322
339
|
() => {
|
|
323
|
-
const categoryItems = dataSource.length ? (0, import_utils.addDataSourceItemsByKey)(
|
|
340
|
+
const categoryItems = dataSource.length ? (0, import_utils.addDataSourceItemsByKey)(
|
|
341
|
+
dataSource,
|
|
342
|
+
import_constants.LEVEL_ADD_ITEMS.level1.filter(
|
|
343
|
+
(itemKey) => showAllItem || itemKey !== "all"
|
|
344
|
+
)
|
|
345
|
+
) : [];
|
|
324
346
|
const actionItems = (level1Actions || []).map((action, index) => ({
|
|
325
347
|
id: `__level1-action-${String(action.key)}-${index}`,
|
|
326
348
|
key: `__level1-action-${String(action.key)}-${index}`,
|
|
@@ -334,10 +356,11 @@ var PisellTabbar = (props, ref) => {
|
|
|
334
356
|
}
|
|
335
357
|
return isVertical ? full.filter((item) => (item == null ? void 0 : item.key) !== "expand") : full;
|
|
336
358
|
},
|
|
337
|
-
[dataSource, isSearchOpen, isVertical, level1Actions]
|
|
359
|
+
[dataSource, isSearchOpen, isVertical, level1Actions, showAllItem]
|
|
338
360
|
);
|
|
339
361
|
const renderLevel1Item = (0, import_react.useCallback)(
|
|
340
362
|
(itemProps) => {
|
|
363
|
+
var _a2;
|
|
341
364
|
const { dataSource: itemData } = itemProps;
|
|
342
365
|
const isExpanded = getExpand("level1");
|
|
343
366
|
const action = itemData == null ? void 0 : itemData.__action;
|
|
@@ -378,10 +401,13 @@ var PisellTabbar = (props, ref) => {
|
|
|
378
401
|
import_PisellCards.default.MultilevelCard,
|
|
379
402
|
{
|
|
380
403
|
...itemProps,
|
|
404
|
+
className: (0, import_classnames.default)(itemProps.className, {
|
|
405
|
+
"pisell-tabbar__category-group--level1": isVertical && ((_a2 = itemData == null ? void 0 : itemData.children) == null ? void 0 : _a2.length)
|
|
406
|
+
}),
|
|
381
407
|
card: (cardProps) => renderNormalCard(cardProps, "level1"),
|
|
382
408
|
panel: (panelProps) => {
|
|
383
|
-
var
|
|
384
|
-
if (((
|
|
409
|
+
var _a3, _b2;
|
|
410
|
+
if (((_b2 = (_a3 = panelProps == null ? void 0 : panelProps.dataSource) == null ? void 0 : _a3.children) == null ? void 0 : _b2.length) && maxLevel >= 2) {
|
|
385
411
|
return renderLevel2Panel(panelProps);
|
|
386
412
|
}
|
|
387
413
|
return null;
|
|
@@ -410,7 +436,9 @@ var PisellTabbar = (props, ref) => {
|
|
|
410
436
|
if (_dataSource.length) {
|
|
411
437
|
_dataSource = (0, import_utils.addDataSourceItemsByKey)(
|
|
412
438
|
_dataSource,
|
|
413
|
-
import_constants.LEVEL_ADD_ITEMS.level2
|
|
439
|
+
import_constants.LEVEL_ADD_ITEMS.level2.filter(
|
|
440
|
+
(itemKey) => showAllItem || itemKey !== "all"
|
|
441
|
+
)
|
|
414
442
|
);
|
|
415
443
|
if (isVertical) {
|
|
416
444
|
_dataSource = _dataSource.filter((item) => item.key !== "expand");
|
|
@@ -463,6 +491,7 @@ var PisellTabbar = (props, ref) => {
|
|
|
463
491
|
}
|
|
464
492
|
},
|
|
465
493
|
renderItem: (itemProps) => {
|
|
494
|
+
var _a2;
|
|
466
495
|
const { dataSource: itemData } = itemProps;
|
|
467
496
|
if (itemData == null ? void 0 : itemData.customClick) {
|
|
468
497
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
@@ -478,10 +507,13 @@ var PisellTabbar = (props, ref) => {
|
|
|
478
507
|
import_PisellCards.default.MultilevelCard,
|
|
479
508
|
{
|
|
480
509
|
...itemProps,
|
|
510
|
+
className: (0, import_classnames.default)(itemProps.className, {
|
|
511
|
+
"pisell-tabbar__category-group--level2": isVertical && ((_a2 = itemData == null ? void 0 : itemData.children) == null ? void 0 : _a2.length)
|
|
512
|
+
}),
|
|
481
513
|
card: (cardProps) => renderNormalCard(cardProps, "level2"),
|
|
482
514
|
panel: (panelProps2) => {
|
|
483
|
-
var
|
|
484
|
-
if (((
|
|
515
|
+
var _a3, _b2;
|
|
516
|
+
if (((_b2 = (_a3 = panelProps2 == null ? void 0 : panelProps2.dataSource) == null ? void 0 : _a3.children) == null ? void 0 : _b2.length) && maxLevel >= 3) {
|
|
485
517
|
return renderLevel3Panel(panelProps2);
|
|
486
518
|
}
|
|
487
519
|
return null;
|
|
@@ -507,6 +539,7 @@ var PisellTabbar = (props, ref) => {
|
|
|
507
539
|
getLevelConfig,
|
|
508
540
|
renderExpandCard,
|
|
509
541
|
renderNormalCard,
|
|
542
|
+
showAllItem,
|
|
510
543
|
direction,
|
|
511
544
|
isVertical
|
|
512
545
|
]
|
|
@@ -518,7 +551,9 @@ var PisellTabbar = (props, ref) => {
|
|
|
518
551
|
if (_dataSource2.length) {
|
|
519
552
|
_dataSource2 = (0, import_utils.addDataSourceItemsByKey)(
|
|
520
553
|
_dataSource2,
|
|
521
|
-
import_constants.LEVEL_ADD_ITEMS.level3
|
|
554
|
+
import_constants.LEVEL_ADD_ITEMS.level3.filter(
|
|
555
|
+
(itemKey) => showAllItem || itemKey !== "all"
|
|
556
|
+
)
|
|
522
557
|
);
|
|
523
558
|
if (isVertical) {
|
|
524
559
|
_dataSource2 = _dataSource2.filter((item) => item.key !== "expand");
|
|
@@ -604,6 +639,7 @@ var PisellTabbar = (props, ref) => {
|
|
|
604
639
|
getLevelConfig,
|
|
605
640
|
renderExpandCard,
|
|
606
641
|
renderNormalCard,
|
|
642
|
+
showAllItem,
|
|
607
643
|
direction,
|
|
608
644
|
isVertical
|
|
609
645
|
]
|
|
@@ -54,7 +54,7 @@ declare const useTableProps: (props: UseTablePropsProps) => {
|
|
|
54
54
|
width: number;
|
|
55
55
|
align: "center" | "left" | "right";
|
|
56
56
|
fixed: false | "left" | "right";
|
|
57
|
-
type: "
|
|
57
|
+
type: "link" | "button";
|
|
58
58
|
items: OperationItem[];
|
|
59
59
|
} | undefined;
|
|
60
60
|
operationContent?: {
|
|
@@ -19,7 +19,7 @@ declare const formFieldMap: {
|
|
|
19
19
|
Subdomain: import("react").FC<import("antd").InputProps & {
|
|
20
20
|
onChange: (value: string) => void;
|
|
21
21
|
onBlur?: ((e: import("react").FocusEvent<HTMLInputElement, Element>) => void) | undefined;
|
|
22
|
-
rootDomain: "custom" | "
|
|
22
|
+
rootDomain: "custom" | "xzero" | "saas";
|
|
23
23
|
customDomain?: string | undefined;
|
|
24
24
|
value?: string | undefined;
|
|
25
25
|
tenantId: string;
|
|
@@ -80,13 +80,11 @@ declare const formFieldMap: {
|
|
|
80
80
|
extraParams?: Record<string, any> | undefined;
|
|
81
81
|
}) => import("react").JSX.Element;
|
|
82
82
|
};
|
|
83
|
-
declare const getFieldComponent: (fieldComponent: string) => import("react").FC<
|
|
83
|
+
declare const getFieldComponent: (fieldComponent: string) => import("react").FC<(import("antd").DatePickerProps & import("../dataSourceForm/utils").WithModeProps) & import("../dataSourceForm/utils").WithFormItemProps> | (import("react").FC<{}> & {
|
|
84
84
|
Group: import("react").FC<import("./Checkbox/type").CheckboxGroupProps & import("../dataSourceForm/utils").WithModeProps>;
|
|
85
85
|
} & {
|
|
86
86
|
Group: import("react").FC<import("./Checkbox/type").CheckboxGroupProps & import("../dataSourceForm/utils").WithModeProps>;
|
|
87
|
-
}) | import("react").FC<import("./ColorPicker/type").ColorPickerProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> |
|
|
88
|
-
onChange: (value: string) => void;
|
|
89
|
-
} & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./Input.Phone/WithMode").PhoneInputProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./Input.Mobile/WithMode").PhoneInputProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | (import("react").FC<import("./Input/type").InputProps> & {
|
|
87
|
+
}) | import("react").FC<import("./ColorPicker/type").ColorPickerProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | (import("react").FC<import("./Input/type").InputProps> & {
|
|
90
88
|
JSON: import("react").FC<any>;
|
|
91
89
|
Password: import("react").FC<import("antd/es/input").PasswordProps & import("react").RefAttributes<import("antd").InputRef> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
|
|
92
90
|
TextArea: import("react").FC<import("antd/es/input").TextAreaProps & import("react").RefAttributes<import("antd/es/input/TextArea").TextAreaRef> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
|
|
@@ -99,14 +97,14 @@ declare const getFieldComponent: (fieldComponent: string) => import("react").FC<
|
|
|
99
97
|
Subdomain: import("react").FC<import("antd").InputProps & {
|
|
100
98
|
onChange: (value: string) => void;
|
|
101
99
|
onBlur?: ((e: import("react").FocusEvent<HTMLInputElement, Element>) => void) | undefined;
|
|
102
|
-
rootDomain: "custom" | "
|
|
100
|
+
rootDomain: "custom" | "xzero" | "saas";
|
|
103
101
|
customDomain?: string | undefined;
|
|
104
102
|
value?: string | undefined;
|
|
105
103
|
tenantId: string;
|
|
106
104
|
name?: string | undefined;
|
|
107
105
|
fieldKey?: string | undefined;
|
|
108
106
|
} & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
|
|
109
|
-
}) |
|
|
107
|
+
}) | (import("react").FC<{}> & {
|
|
110
108
|
Group: import("react").FC<import("./Radio/type").RadioGroupProps & import("../dataSourceForm/utils").WithModeProps>;
|
|
111
109
|
} & {
|
|
112
110
|
Group: import("react").FC<import("./Radio/type").RadioGroupProps & import("../dataSourceForm/utils").WithModeProps>;
|
|
@@ -119,7 +117,9 @@ declare const getFieldComponent: (fieldComponent: string) => import("react").FC<
|
|
|
119
117
|
} & {
|
|
120
118
|
dataSource?: any;
|
|
121
119
|
extraParams?: Record<string, any> | undefined;
|
|
122
|
-
}) => import("react").JSX.Element) | import("react").FC<
|
|
120
|
+
}) => import("react").JSX.Element) | import("react").FC<any> | import("react").FC<import("./TimePicker/type").TimePickerProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./Input.Phone/WithMode").PhoneInputProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./Input.Mobile/WithMode").PhoneInputProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("antd").InputProps & {
|
|
121
|
+
onChange: (value: string) => void;
|
|
122
|
+
} & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("antd").InputProps & import("react").RefAttributes<import("antd").InputRef> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("antd/es/input").PasswordProps & import("react").RefAttributes<import("antd").InputRef> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./Radio/type").RadioGroupProps & import("../dataSourceForm/utils").WithModeProps> | import("react").FC<import("./Checkbox/type").CheckboxGroupProps & import("../dataSourceForm/utils").WithModeProps> | import("react").FC<import("./DateRangePicker/type").DateRangePickerProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./Upload/type").UploadProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./Translation/type").TranslationProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./IconSelect/type").IconSelectProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | ((props: import("./RecordListWrapper/type").RecordListWrapperProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps & {
|
|
123
123
|
options?: any;
|
|
124
124
|
optionSourceType?: "default" | "custom" | "api" | undefined;
|
|
125
125
|
labelField: string;
|
|
@@ -4,6 +4,8 @@ import type { PisellLookupProps, PisellLookupRef } from '../pisellLookup';
|
|
|
4
4
|
* 原生扫码事件名,对齐宿主端约定。
|
|
5
5
|
*/
|
|
6
6
|
export declare const SCAN_RESULT_EVENT = "nativeScanResult";
|
|
7
|
+
/** 无扫码焦点栈时,供页面级全局扫码监听避让 Find 的回退计数。 */
|
|
8
|
+
export declare const FIND_FALLBACK_SCANNER_COUNT_KEY = "__pisellFindFallbackScannerCount";
|
|
7
9
|
/**
|
|
8
10
|
* 扫码枪回传数据(对齐宿主 ScanResultPayload)
|
|
9
11
|
* - code: 条码标识(如条码格式 / 业务字段)
|
|
@@ -29,6 +29,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
29
29
|
// src/components/pisellFind/index.tsx
|
|
30
30
|
var pisellFind_exports = {};
|
|
31
31
|
__export(pisellFind_exports, {
|
|
32
|
+
FIND_FALLBACK_SCANNER_COUNT_KEY: () => FIND_FALLBACK_SCANNER_COUNT_KEY,
|
|
32
33
|
PisellFind: () => PisellFind,
|
|
33
34
|
SCAN_RESULT_EVENT: () => SCAN_RESULT_EVENT
|
|
34
35
|
});
|
|
@@ -44,6 +45,7 @@ var import_zh_TW = __toESM(require("../../locales/zh-TW"));
|
|
|
44
45
|
var import_ja = __toESM(require("../../locales/ja"));
|
|
45
46
|
var import_pt = __toESM(require("../../locales/pt"));
|
|
46
47
|
var SCAN_RESULT_EVENT = "nativeScanResult";
|
|
48
|
+
var FIND_FALLBACK_SCANNER_COUNT_KEY = "__pisellFindFallbackScannerCount";
|
|
47
49
|
var pisellFindLocaleTexts = {
|
|
48
50
|
en: import_en_US.default,
|
|
49
51
|
"zh-CN": import_zh_CN.default,
|
|
@@ -158,6 +160,12 @@ var PisellFind = (0, import_react.forwardRef)((props, ref) => {
|
|
|
158
160
|
}
|
|
159
161
|
try {
|
|
160
162
|
pubsub.subscribe(SCAN_RESULT_EVENT, onScan);
|
|
163
|
+
if (typeof window !== "undefined") {
|
|
164
|
+
const current = Number(
|
|
165
|
+
window[FIND_FALLBACK_SCANNER_COUNT_KEY] || 0
|
|
166
|
+
);
|
|
167
|
+
window[FIND_FALLBACK_SCANNER_COUNT_KEY] = current + 1;
|
|
168
|
+
}
|
|
161
169
|
} catch (e) {
|
|
162
170
|
console.warn("[PisellFind] subscribe scanner failed:", e);
|
|
163
171
|
return void 0;
|
|
@@ -168,6 +176,16 @@ var PisellFind = (0, import_react.forwardRef)((props, ref) => {
|
|
|
168
176
|
(_a2 = pubsub.unsubscribe) == null ? void 0 : _a2.call(pubsub, SCAN_RESULT_EVENT, onScan);
|
|
169
177
|
} catch (e) {
|
|
170
178
|
console.warn("[PisellFind] unsubscribe scanner failed:", e);
|
|
179
|
+
} finally {
|
|
180
|
+
if (typeof window !== "undefined") {
|
|
181
|
+
const current = Number(
|
|
182
|
+
window[FIND_FALLBACK_SCANNER_COUNT_KEY] || 0
|
|
183
|
+
);
|
|
184
|
+
window[FIND_FALLBACK_SCANNER_COUNT_KEY] = Math.max(
|
|
185
|
+
0,
|
|
186
|
+
current - 1
|
|
187
|
+
);
|
|
188
|
+
}
|
|
171
189
|
}
|
|
172
190
|
};
|
|
173
191
|
}, [enableScanner]);
|
|
@@ -190,6 +208,7 @@ var PisellFind = (0, import_react.forwardRef)((props, ref) => {
|
|
|
190
208
|
PisellFind.displayName = "PisellFind";
|
|
191
209
|
// Annotate the CommonJS export names for ESM import in node:
|
|
192
210
|
0 && (module.exports = {
|
|
211
|
+
FIND_FALLBACK_SCANNER_COUNT_KEY,
|
|
193
212
|
PisellFind,
|
|
194
213
|
SCAN_RESULT_EVENT
|
|
195
214
|
});
|
|
@@ -43,6 +43,7 @@ var import_PisellLookup = require("./PisellLookup.less");
|
|
|
43
43
|
var PisellLookupComponent = (0, import_react.forwardRef)((props, ref) => {
|
|
44
44
|
const {
|
|
45
45
|
// 触发器配置
|
|
46
|
+
showTrigger = true,
|
|
46
47
|
triggerType = "input",
|
|
47
48
|
trigger,
|
|
48
49
|
triggerText,
|
|
@@ -65,6 +66,7 @@ var PisellLookupComponent = (0, import_react.forwardRef)((props, ref) => {
|
|
|
65
66
|
onSearch,
|
|
66
67
|
searchMode = "realtime",
|
|
67
68
|
debounceTime = 300,
|
|
69
|
+
allowRepeatSearch = false,
|
|
68
70
|
// 扫码配置
|
|
69
71
|
showScan = true,
|
|
70
72
|
onScan,
|
|
@@ -91,9 +93,14 @@ var PisellLookupComponent = (0, import_react.forwardRef)((props, ref) => {
|
|
|
91
93
|
// 容器样式配置
|
|
92
94
|
modalWidth,
|
|
93
95
|
modalStyle,
|
|
96
|
+
modalCentered = false,
|
|
97
|
+
modalTransitionName,
|
|
94
98
|
getContainer,
|
|
95
99
|
drawerWidth,
|
|
100
|
+
drawerHeight,
|
|
96
101
|
drawerPlacement,
|
|
102
|
+
drawerTitle,
|
|
103
|
+
drawerClosable,
|
|
97
104
|
popupWidth,
|
|
98
105
|
containerStyle,
|
|
99
106
|
containerClassName,
|
|
@@ -109,6 +116,7 @@ var PisellLookupComponent = (0, import_react.forwardRef)((props, ref) => {
|
|
|
109
116
|
autoFocusOnOpen = true,
|
|
110
117
|
// 输入栏插槽
|
|
111
118
|
inputRender,
|
|
119
|
+
headerRender,
|
|
112
120
|
// 样式配置
|
|
113
121
|
className,
|
|
114
122
|
style,
|
|
@@ -223,7 +231,7 @@ var PisellLookupComponent = (0, import_react.forwardRef)((props, ref) => {
|
|
|
223
231
|
);
|
|
224
232
|
const handleConfirmSearch = (0, import_react.useCallback)(
|
|
225
233
|
(searchKeyword) => {
|
|
226
|
-
if (lastSearchKeywordRef.current === searchKeyword) {
|
|
234
|
+
if (!allowRepeatSearch && lastSearchKeywordRef.current === searchKeyword) {
|
|
227
235
|
return;
|
|
228
236
|
}
|
|
229
237
|
lastSearchKeywordRef.current = searchKeyword;
|
|
@@ -232,7 +240,7 @@ var PisellLookupComponent = (0, import_react.forwardRef)((props, ref) => {
|
|
|
232
240
|
}
|
|
233
241
|
onSearch == null ? void 0 : onSearch(searchKeyword);
|
|
234
242
|
},
|
|
235
|
-
[showHistory, addHistory, onSearch]
|
|
243
|
+
[allowRepeatSearch, showHistory, addHistory, onSearch]
|
|
236
244
|
);
|
|
237
245
|
(0, import_hooks.useDebounceSearch)({
|
|
238
246
|
keyword,
|
|
@@ -391,7 +399,7 @@ var PisellLookupComponent = (0, import_react.forwardRef)((props, ref) => {
|
|
|
391
399
|
return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lookup-content" }, auxiliary, results);
|
|
392
400
|
};
|
|
393
401
|
if (displayType === "inline" || displayType === "popup") {
|
|
394
|
-
return /* @__PURE__ */ import_react.default.createElement("div", { className: `pisell-lookup pisell-lookup-${displayType} ${className || ""}`, style }, renderTrigger(), /* @__PURE__ */ import_react.default.createElement(
|
|
402
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: `pisell-lookup pisell-lookup-${displayType} ${className || ""}`, style }, showTrigger ? renderTrigger() : null, /* @__PURE__ */ import_react.default.createElement(
|
|
395
403
|
import_components.LookupResultHost,
|
|
396
404
|
{
|
|
397
405
|
displayType,
|
|
@@ -405,7 +413,7 @@ var PisellLookupComponent = (0, import_react.forwardRef)((props, ref) => {
|
|
|
405
413
|
renderContent()
|
|
406
414
|
));
|
|
407
415
|
}
|
|
408
|
-
return /* @__PURE__ */ import_react.default.createElement("div", { className: `pisell-lookup ${className || ""}`, style }, renderTrigger(), /* @__PURE__ */ import_react.default.createElement(
|
|
416
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: `pisell-lookup ${className || ""}`, style }, showTrigger ? renderTrigger() : null, /* @__PURE__ */ import_react.default.createElement(
|
|
409
417
|
import_components.LookupResultHost,
|
|
410
418
|
{
|
|
411
419
|
displayType,
|
|
@@ -413,9 +421,14 @@ var PisellLookupComponent = (0, import_react.forwardRef)((props, ref) => {
|
|
|
413
421
|
onClose: close,
|
|
414
422
|
modalWidth,
|
|
415
423
|
modalStyle,
|
|
424
|
+
modalCentered,
|
|
425
|
+
modalTransitionName,
|
|
416
426
|
getContainer,
|
|
417
427
|
drawerWidth,
|
|
428
|
+
drawerHeight,
|
|
418
429
|
drawerPlacement,
|
|
430
|
+
drawerTitle,
|
|
431
|
+
drawerClosable,
|
|
419
432
|
containerStyle,
|
|
420
433
|
containerClassName,
|
|
421
434
|
mask,
|
|
@@ -423,6 +436,7 @@ var PisellLookupComponent = (0, import_react.forwardRef)((props, ref) => {
|
|
|
423
436
|
zIndex,
|
|
424
437
|
onAfterOpen: handleAfterOpen
|
|
425
438
|
},
|
|
439
|
+
displayType === "modal" || displayType === "drawer" ? typeof headerRender === "function" ? headerRender() : headerRender : null,
|
|
426
440
|
/* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lookup-search-area-with-close" }, /* @__PURE__ */ import_react.default.createElement(
|
|
427
441
|
import_components.LookupTrigger,
|
|
428
442
|
{
|