@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
|
@@ -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;
|
|
@@ -16,7 +16,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
16
16
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
17
17
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
18
18
|
import classNames from 'classnames';
|
|
19
|
-
import React, { forwardRef, useCallback, useEffect,
|
|
19
|
+
import React, { forwardRef, useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';
|
|
20
20
|
import PisellCards from "../../../PisellCards";
|
|
21
21
|
import SuperTabs from "../../../PisellSuperTabs";
|
|
22
22
|
import Iconfont from "../../../iconfont";
|
|
@@ -26,6 +26,11 @@ import { useActiveKey, useExpand } from "../../hooks";
|
|
|
26
26
|
import mock from "../../mock";
|
|
27
27
|
import { DEFAULT_LEVEL_CONFIG, LEVEL_ADD_ITEMS, getExpandConfig } from "./constants";
|
|
28
28
|
import { addDataSourceItemsByKey, getDefaultActiveKey } from "./utils";
|
|
29
|
+
var tabbarInstanceSequence = 0;
|
|
30
|
+
function createTabbarInstanceId() {
|
|
31
|
+
tabbarInstanceSequence += 1;
|
|
32
|
+
return "sku-list-tabbar-temp1-".concat(tabbarInstanceSequence);
|
|
33
|
+
}
|
|
29
34
|
function renderCategoryIcon(icon, size) {
|
|
30
35
|
if (/^(?:https?:\/\/|data:|blob:|\/)/i.test(icon)) {
|
|
31
36
|
return /*#__PURE__*/React.createElement("img", {
|
|
@@ -63,6 +68,7 @@ function renderCategoryIcon(icon, size) {
|
|
|
63
68
|
* ```
|
|
64
69
|
*/
|
|
65
70
|
var PisellTabbar = function PisellTabbar(props, ref) {
|
|
71
|
+
var _dataSource$0$id, _dataSource$, _dataSource$2;
|
|
66
72
|
var _props$dataSource = props.dataSource,
|
|
67
73
|
dataSource = _props$dataSource === void 0 ? props !== null && props !== void 0 && props.__designMode ? mock : mock : _props$dataSource,
|
|
68
74
|
value = props.value,
|
|
@@ -77,10 +83,14 @@ var PisellTabbar = function PisellTabbar(props, ref) {
|
|
|
77
83
|
searchProps = props.searchProps,
|
|
78
84
|
level1Actions = props.level1Actions,
|
|
79
85
|
_props$direction = props.direction,
|
|
80
|
-
direction = _props$direction === void 0 ? 'horizontal' : _props$direction
|
|
86
|
+
direction = _props$direction === void 0 ? 'horizontal' : _props$direction,
|
|
87
|
+
_props$showAllItem = props.showAllItem,
|
|
88
|
+
showAllItem = _props$showAllItem === void 0 ? true : _props$showAllItem;
|
|
81
89
|
var isVertical = direction === 'vertical';
|
|
82
90
|
var containerRef = useRef(null);
|
|
83
91
|
var searchRef = useRef(null);
|
|
92
|
+
var firstCategoryKey = (_dataSource$0$id = (_dataSource$ = dataSource[0]) === null || _dataSource$ === void 0 ? void 0 : _dataSource$.id) !== null && _dataSource$0$id !== void 0 ? _dataSource$0$id : (_dataSource$2 = dataSource[0]) === null || _dataSource$2 === void 0 ? void 0 : _dataSource$2.key;
|
|
93
|
+
var initialActiveKey = value !== null && value !== void 0 ? value : showAllItem ? getDefaultActiveKey(dataSource, 'id') : firstCategoryKey !== undefined ? [firstCategoryKey] : [];
|
|
84
94
|
|
|
85
95
|
/**
|
|
86
96
|
* 每个 PisellTabbarTemplate1 实例使用独立的 DOM id(保留历史前缀),
|
|
@@ -89,17 +99,18 @@ var PisellTabbar = function PisellTabbar(props, ref) {
|
|
|
89
99
|
* 命中错误那一个:PisellFind 的搜索弹窗 portal 会挂到隐藏节点 → 看似"无反应",
|
|
90
100
|
* 二级 panel 的 portalContainer 也会渲染到错误位置。
|
|
91
101
|
*
|
|
92
|
-
*
|
|
93
|
-
*
|
|
102
|
+
* Kiosk 低代码渲染只需要客户端实例唯一性;用 ref 保持挂载周期内稳定,
|
|
103
|
+
* 同时兼容 React 17(没有 `useId`)。
|
|
94
104
|
*/
|
|
95
|
-
var
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
}
|
|
105
|
+
var tabbarIdRef = useRef();
|
|
106
|
+
if (!tabbarIdRef.current) {
|
|
107
|
+
tabbarIdRef.current = createTabbarInstanceId();
|
|
108
|
+
}
|
|
109
|
+
var tabbarId = tabbarIdRef.current;
|
|
99
110
|
|
|
100
111
|
// 激活的 key 管理
|
|
101
112
|
var _useActiveKey = useActiveKey({
|
|
102
|
-
initialActiveKey:
|
|
113
|
+
initialActiveKey: initialActiveKey,
|
|
103
114
|
onChange: onChange
|
|
104
115
|
}),
|
|
105
116
|
setActiveKey = _useActiveKey.setActiveKey,
|
|
@@ -188,16 +199,16 @@ var PisellTabbar = function PisellTabbar(props, ref) {
|
|
|
188
199
|
*/
|
|
189
200
|
var handleLevel1Change = useCallback(function (key, item) {
|
|
190
201
|
var _item$children;
|
|
191
|
-
setActiveKey(0, key, item !== null && item !== void 0 && (_item$children = item.children) !== null && _item$children !== void 0 && _item$children.length ? 0 : undefined);
|
|
192
|
-
}, [setActiveKey, activeKey]);
|
|
202
|
+
setActiveKey(0, key, showAllItem && item !== null && item !== void 0 && (_item$children = item.children) !== null && _item$children !== void 0 && _item$children.length ? 0 : undefined);
|
|
203
|
+
}, [setActiveKey, activeKey, showAllItem]);
|
|
193
204
|
|
|
194
205
|
/**
|
|
195
206
|
* 处理二级 Tab 切换
|
|
196
207
|
*/
|
|
197
208
|
var handleLevel2Change = useCallback(function (key, item) {
|
|
198
209
|
var _item$children2;
|
|
199
|
-
setActiveKey(1, key, item !== null && item !== void 0 && (_item$children2 = item.children) !== null && _item$children2 !== void 0 && _item$children2.length ? 0 : undefined);
|
|
200
|
-
}, [setActiveKey, activeKey]);
|
|
210
|
+
setActiveKey(1, key, showAllItem && item !== null && item !== void 0 && (_item$children2 = item.children) !== null && _item$children2 !== void 0 && _item$children2.length ? 0 : undefined);
|
|
211
|
+
}, [setActiveKey, activeKey, showAllItem]);
|
|
201
212
|
|
|
202
213
|
/**
|
|
203
214
|
* 处理三级 Tab 切换
|
|
@@ -304,7 +315,7 @@ var PisellTabbar = function PisellTabbar(props, ref) {
|
|
|
304
315
|
* 渲染 level2/level3 普通卡片
|
|
305
316
|
*/
|
|
306
317
|
var renderNormalCard = useCallback(function (cardProps, level) {
|
|
307
|
-
var _levelCfg$textAlign, _levelCfg$iconSize, _levelCfg$borderRadiu, _cardProps$active2;
|
|
318
|
+
var _levelCfg$textAlign, _levelCfg$iconSize, _levelCfg$borderRadiu, _levelCfg$cardBackgro, _cardProps$active2, _levelCfg$activeBackg;
|
|
308
319
|
var itemData = cardProps.dataSource;
|
|
309
320
|
var levelCfg = getLevelConfig(level);
|
|
310
321
|
var textAlign = isVertical ? (_levelCfg$textAlign = levelCfg.textAlign) !== null && _levelCfg$textAlign !== void 0 ? _levelCfg$textAlign : 'center' : 'center';
|
|
@@ -327,7 +338,7 @@ var PisellTabbar = function PisellTabbar(props, ref) {
|
|
|
327
338
|
height: levelCfg.cardHeight
|
|
328
339
|
}), {}, {
|
|
329
340
|
borderRadius: isVertical ? (_levelCfg$borderRadiu = levelCfg.borderRadius) !== null && _levelCfg$borderRadiu !== void 0 ? _levelCfg$borderRadiu : '999px' : '20px',
|
|
330
|
-
background: '#ffffff',
|
|
341
|
+
background: (_levelCfg$cardBackgro = levelCfg.cardBackground) !== null && _levelCfg$cardBackgro !== void 0 ? _levelCfg$cardBackgro : '#ffffff',
|
|
331
342
|
minWidth: isVertical ? 0 : 100,
|
|
332
343
|
justifyContent: isVertical && textAlign === 'left' ? 'flex-start' : 'center'
|
|
333
344
|
}),
|
|
@@ -335,7 +346,7 @@ var PisellTabbar = function PisellTabbar(props, ref) {
|
|
|
335
346
|
active: _objectSpread(_objectSpread({}, cardProps.active), {}, {
|
|
336
347
|
style: _objectSpread(_objectSpread({}, (_cardProps$active2 = cardProps.active) === null || _cardProps$active2 === void 0 ? void 0 : _cardProps$active2.style), {}, {
|
|
337
348
|
color: '#fff',
|
|
338
|
-
background: '#7f56d9'
|
|
349
|
+
background: (_levelCfg$activeBackg = levelCfg.activeBackground) !== null && _levelCfg$activeBackg !== void 0 ? _levelCfg$activeBackg : '#7f56d9'
|
|
339
350
|
})
|
|
340
351
|
})
|
|
341
352
|
}));
|
|
@@ -345,7 +356,9 @@ var PisellTabbar = function PisellTabbar(props, ref) {
|
|
|
345
356
|
* 一级 Tabbar 数据源
|
|
346
357
|
*/
|
|
347
358
|
var level1DataSource = useMemo(function () {
|
|
348
|
-
var categoryItems = dataSource.length ? addDataSourceItemsByKey(dataSource, LEVEL_ADD_ITEMS.level1)
|
|
359
|
+
var categoryItems = dataSource.length ? addDataSourceItemsByKey(dataSource, LEVEL_ADD_ITEMS.level1.filter(function (itemKey) {
|
|
360
|
+
return showAllItem || itemKey !== 'all';
|
|
361
|
+
})) : [];
|
|
349
362
|
var actionItems = (level1Actions || []).map(function (action, index) {
|
|
350
363
|
return {
|
|
351
364
|
id: "__level1-action-".concat(String(action.key), "-").concat(index),
|
|
@@ -365,12 +378,13 @@ var PisellTabbar = function PisellTabbar(props, ref) {
|
|
|
365
378
|
return isVertical ? full.filter(function (item) {
|
|
366
379
|
return (item === null || item === void 0 ? void 0 : item.key) !== 'expand';
|
|
367
380
|
}) : full;
|
|
368
|
-
}, [dataSource, isSearchOpen, isVertical, level1Actions]);
|
|
381
|
+
}, [dataSource, isSearchOpen, isVertical, level1Actions, showAllItem]);
|
|
369
382
|
|
|
370
383
|
/**
|
|
371
384
|
* 渲染一级 Tab Item
|
|
372
385
|
*/
|
|
373
386
|
var renderLevel1Item = useCallback(function (itemProps) {
|
|
387
|
+
var _itemData$children;
|
|
374
388
|
var itemData = itemProps.dataSource;
|
|
375
389
|
var isExpanded = getExpand('level1');
|
|
376
390
|
var action = itemData === null || itemData === void 0 ? void 0 : itemData.__action;
|
|
@@ -405,6 +419,9 @@ var PisellTabbar = function PisellTabbar(props, ref) {
|
|
|
405
419
|
|
|
406
420
|
// 普通项
|
|
407
421
|
return /*#__PURE__*/React.createElement(PisellCards.MultilevelCard, _extends({}, itemProps, {
|
|
422
|
+
className: classNames(itemProps.className, {
|
|
423
|
+
'pisell-tabbar__category-group--level1': isVertical && (itemData === null || itemData === void 0 || (_itemData$children = itemData.children) === null || _itemData$children === void 0 ? void 0 : _itemData$children.length)
|
|
424
|
+
}),
|
|
408
425
|
card: function card(cardProps) {
|
|
409
426
|
return renderNormalCard(cardProps, 'level1');
|
|
410
427
|
},
|
|
@@ -429,7 +446,9 @@ var PisellTabbar = function PisellTabbar(props, ref) {
|
|
|
429
446
|
if (maxLevel < 2) return null;
|
|
430
447
|
var _dataSource = panelProps.dataSource.children || [];
|
|
431
448
|
if (_dataSource.length) {
|
|
432
|
-
_dataSource = addDataSourceItemsByKey(_dataSource, LEVEL_ADD_ITEMS.level2)
|
|
449
|
+
_dataSource = addDataSourceItemsByKey(_dataSource, LEVEL_ADD_ITEMS.level2.filter(function (itemKey) {
|
|
450
|
+
return showAllItem || itemKey !== 'all';
|
|
451
|
+
}));
|
|
433
452
|
if (isVertical) {
|
|
434
453
|
_dataSource = _dataSource.filter(function (item) {
|
|
435
454
|
return item.key !== 'expand';
|
|
@@ -486,6 +505,7 @@ var PisellTabbar = function PisellTabbar(props, ref) {
|
|
|
486
505
|
}
|
|
487
506
|
},
|
|
488
507
|
renderItem: function renderItem(itemProps) {
|
|
508
|
+
var _itemData$children2;
|
|
489
509
|
var itemData = itemProps.dataSource;
|
|
490
510
|
|
|
491
511
|
// 处理展开按钮
|
|
@@ -502,6 +522,9 @@ var PisellTabbar = function PisellTabbar(props, ref) {
|
|
|
502
522
|
|
|
503
523
|
// 普通项
|
|
504
524
|
return /*#__PURE__*/React.createElement(PisellCards.MultilevelCard, _extends({}, itemProps, {
|
|
525
|
+
className: classNames(itemProps.className, {
|
|
526
|
+
'pisell-tabbar__category-group--level2': isVertical && (itemData === null || itemData === void 0 || (_itemData$children2 = itemData.children) === null || _itemData$children2 === void 0 ? void 0 : _itemData$children2.length)
|
|
527
|
+
}),
|
|
505
528
|
card: function card(cardProps) {
|
|
506
529
|
return renderNormalCard(cardProps, 'level2');
|
|
507
530
|
},
|
|
@@ -519,7 +542,7 @@ var PisellTabbar = function PisellTabbar(props, ref) {
|
|
|
519
542
|
}));
|
|
520
543
|
}
|
|
521
544
|
});
|
|
522
|
-
}, [level2Value, maxLevel, activeKey, getActiveKey, handleLevel2Change, getExpand, toggleExpand, getLevelConfig, renderExpandCard, renderNormalCard, direction, isVertical]);
|
|
545
|
+
}, [level2Value, maxLevel, activeKey, getActiveKey, handleLevel2Change, getExpand, toggleExpand, getLevelConfig, renderExpandCard, renderNormalCard, showAllItem, direction, isVertical]);
|
|
523
546
|
|
|
524
547
|
/**
|
|
525
548
|
* 渲染三级 Tabbar 面板
|
|
@@ -528,7 +551,9 @@ var PisellTabbar = function PisellTabbar(props, ref) {
|
|
|
528
551
|
if (maxLevel < 3) return null;
|
|
529
552
|
var _dataSource2 = panelProps2.dataSource.children || [];
|
|
530
553
|
if (_dataSource2.length) {
|
|
531
|
-
_dataSource2 = addDataSourceItemsByKey(_dataSource2, LEVEL_ADD_ITEMS.level3)
|
|
554
|
+
_dataSource2 = addDataSourceItemsByKey(_dataSource2, LEVEL_ADD_ITEMS.level3.filter(function (itemKey) {
|
|
555
|
+
return showAllItem || itemKey !== 'all';
|
|
556
|
+
}));
|
|
532
557
|
if (isVertical) {
|
|
533
558
|
_dataSource2 = _dataSource2.filter(function (item) {
|
|
534
559
|
return item.key !== 'expand';
|
|
@@ -607,7 +632,7 @@ var PisellTabbar = function PisellTabbar(props, ref) {
|
|
|
607
632
|
}));
|
|
608
633
|
}
|
|
609
634
|
});
|
|
610
|
-
}, [level3Value, maxLevel, activeKey, getActiveKey, handleLevel3Change, getExpand, toggleExpand, getLevelConfig, renderExpandCard, renderNormalCard, direction, isVertical]);
|
|
635
|
+
}, [level3Value, maxLevel, activeKey, getActiveKey, handleLevel3Change, getExpand, toggleExpand, getLevelConfig, renderExpandCard, renderNormalCard, showAllItem, direction, isVertical]);
|
|
611
636
|
|
|
612
637
|
/**
|
|
613
638
|
* 渲染一级 Tabbar
|
|
@@ -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: 条码标识(如条码格式 / 业务字段)
|
|
@@ -17,6 +17,8 @@ import pt from "../../locales/pt";
|
|
|
17
17
|
* 原生扫码事件名,对齐宿主端约定。
|
|
18
18
|
*/
|
|
19
19
|
export var SCAN_RESULT_EVENT = 'nativeScanResult';
|
|
20
|
+
/** 无扫码焦点栈时,供页面级全局扫码监听避让 Find 的回退计数。 */
|
|
21
|
+
export var FIND_FALLBACK_SCANNER_COUNT_KEY = '__pisellFindFallbackScannerCount';
|
|
20
22
|
var pisellFindLocaleTexts = {
|
|
21
23
|
en: enUS,
|
|
22
24
|
'zh-CN': zhCN,
|
|
@@ -196,6 +198,10 @@ export var PisellFind = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
196
198
|
}
|
|
197
199
|
try {
|
|
198
200
|
pubsub.subscribe(SCAN_RESULT_EVENT, onScan);
|
|
201
|
+
if (typeof window !== 'undefined') {
|
|
202
|
+
var current = Number(window[FIND_FALLBACK_SCANNER_COUNT_KEY] || 0);
|
|
203
|
+
window[FIND_FALLBACK_SCANNER_COUNT_KEY] = current + 1;
|
|
204
|
+
}
|
|
199
205
|
} catch (e) {
|
|
200
206
|
console.warn('[PisellFind] subscribe scanner failed:', e);
|
|
201
207
|
return undefined;
|
|
@@ -206,6 +212,11 @@ export var PisellFind = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
206
212
|
(_pubsub$unsubscribe = pubsub.unsubscribe) === null || _pubsub$unsubscribe === void 0 || _pubsub$unsubscribe.call(pubsub, SCAN_RESULT_EVENT, onScan);
|
|
207
213
|
} catch (e) {
|
|
208
214
|
console.warn('[PisellFind] unsubscribe scanner failed:', e);
|
|
215
|
+
} finally {
|
|
216
|
+
if (typeof window !== 'undefined') {
|
|
217
|
+
var _current = Number(window[FIND_FALLBACK_SCANNER_COUNT_KEY] || 0);
|
|
218
|
+
window[FIND_FALLBACK_SCANNER_COUNT_KEY] = Math.max(0, _current - 1);
|
|
219
|
+
}
|
|
209
220
|
}
|
|
210
221
|
};
|
|
211
222
|
}, [enableScanner]);
|
|
@@ -32,7 +32,9 @@ import "./PisellLookup.less";
|
|
|
32
32
|
* ```
|
|
33
33
|
*/
|
|
34
34
|
var PisellLookupComponent = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
35
|
-
var _props$
|
|
35
|
+
var _props$showTrigger = props.showTrigger,
|
|
36
|
+
showTrigger = _props$showTrigger === void 0 ? true : _props$showTrigger,
|
|
37
|
+
_props$triggerType = props.triggerType,
|
|
36
38
|
triggerType = _props$triggerType === void 0 ? 'input' : _props$triggerType,
|
|
37
39
|
trigger = props.trigger,
|
|
38
40
|
triggerText = props.triggerText,
|
|
@@ -65,6 +67,8 @@ var PisellLookupComponent = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
65
67
|
searchMode = _props$searchMode === void 0 ? 'realtime' : _props$searchMode,
|
|
66
68
|
_props$debounceTime = props.debounceTime,
|
|
67
69
|
debounceTime = _props$debounceTime === void 0 ? 300 : _props$debounceTime,
|
|
70
|
+
_props$allowRepeatSea = props.allowRepeatSearch,
|
|
71
|
+
allowRepeatSearch = _props$allowRepeatSea === void 0 ? false : _props$allowRepeatSea,
|
|
68
72
|
_props$showScan = props.showScan,
|
|
69
73
|
showScan = _props$showScan === void 0 ? true : _props$showScan,
|
|
70
74
|
onScan = props.onScan,
|
|
@@ -92,9 +96,15 @@ var PisellLookupComponent = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
92
96
|
emptyRender = props.emptyRender,
|
|
93
97
|
modalWidth = props.modalWidth,
|
|
94
98
|
modalStyle = props.modalStyle,
|
|
99
|
+
_props$modalCentered = props.modalCentered,
|
|
100
|
+
modalCentered = _props$modalCentered === void 0 ? false : _props$modalCentered,
|
|
101
|
+
modalTransitionName = props.modalTransitionName,
|
|
95
102
|
getContainer = props.getContainer,
|
|
96
103
|
drawerWidth = props.drawerWidth,
|
|
104
|
+
drawerHeight = props.drawerHeight,
|
|
97
105
|
drawerPlacement = props.drawerPlacement,
|
|
106
|
+
drawerTitle = props.drawerTitle,
|
|
107
|
+
drawerClosable = props.drawerClosable,
|
|
98
108
|
popupWidth = props.popupWidth,
|
|
99
109
|
containerStyle = props.containerStyle,
|
|
100
110
|
containerClassName = props.containerClassName,
|
|
@@ -111,6 +121,7 @@ var PisellLookupComponent = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
111
121
|
_props$autoFocusOnOpe = props.autoFocusOnOpen,
|
|
112
122
|
autoFocusOnOpen = _props$autoFocusOnOpe === void 0 ? true : _props$autoFocusOnOpe,
|
|
113
123
|
inputRender = props.inputRender,
|
|
124
|
+
headerRender = props.headerRender,
|
|
114
125
|
className = props.className,
|
|
115
126
|
style = props.style,
|
|
116
127
|
zIndex = props.zIndex;
|
|
@@ -355,7 +366,7 @@ var PisellLookupComponent = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
355
366
|
*/
|
|
356
367
|
var handleConfirmSearch = useCallback(function (searchKeyword) {
|
|
357
368
|
// 避免重复触发相同关键词的搜索
|
|
358
|
-
if (lastSearchKeywordRef.current === searchKeyword) {
|
|
369
|
+
if (!allowRepeatSearch && lastSearchKeywordRef.current === searchKeyword) {
|
|
359
370
|
return;
|
|
360
371
|
}
|
|
361
372
|
lastSearchKeywordRef.current = searchKeyword;
|
|
@@ -367,7 +378,7 @@ var PisellLookupComponent = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
367
378
|
|
|
368
379
|
// 触发搜索回调
|
|
369
380
|
onSearch === null || onSearch === void 0 || onSearch(searchKeyword);
|
|
370
|
-
}, [showHistory, addHistory, onSearch]);
|
|
381
|
+
}, [allowRepeatSearch, showHistory, addHistory, onSearch]);
|
|
371
382
|
|
|
372
383
|
/**
|
|
373
384
|
* 防抖搜索(实时搜索模式)
|
|
@@ -613,7 +624,7 @@ var PisellLookupComponent = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
613
624
|
return /*#__PURE__*/React.createElement("div", {
|
|
614
625
|
className: "pisell-lookup pisell-lookup-".concat(displayType, " ").concat(className || ''),
|
|
615
626
|
style: style
|
|
616
|
-
}, renderTrigger(), /*#__PURE__*/React.createElement(LookupResultHost, {
|
|
627
|
+
}, showTrigger ? renderTrigger() : null, /*#__PURE__*/React.createElement(LookupResultHost, {
|
|
617
628
|
displayType: displayType,
|
|
618
629
|
visible: visible,
|
|
619
630
|
onClose: close,
|
|
@@ -630,22 +641,27 @@ var PisellLookupComponent = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
630
641
|
return /*#__PURE__*/React.createElement("div", {
|
|
631
642
|
className: "pisell-lookup ".concat(className || ''),
|
|
632
643
|
style: style
|
|
633
|
-
}, renderTrigger(), /*#__PURE__*/React.createElement(LookupResultHost, {
|
|
644
|
+
}, showTrigger ? renderTrigger() : null, /*#__PURE__*/React.createElement(LookupResultHost, {
|
|
634
645
|
displayType: displayType,
|
|
635
646
|
visible: visible,
|
|
636
647
|
onClose: close,
|
|
637
648
|
modalWidth: modalWidth,
|
|
638
649
|
modalStyle: modalStyle,
|
|
650
|
+
modalCentered: modalCentered,
|
|
651
|
+
modalTransitionName: modalTransitionName,
|
|
639
652
|
getContainer: getContainer,
|
|
640
653
|
drawerWidth: drawerWidth,
|
|
654
|
+
drawerHeight: drawerHeight,
|
|
641
655
|
drawerPlacement: drawerPlacement,
|
|
656
|
+
drawerTitle: drawerTitle,
|
|
657
|
+
drawerClosable: drawerClosable,
|
|
642
658
|
containerStyle: containerStyle,
|
|
643
659
|
containerClassName: containerClassName,
|
|
644
660
|
mask: mask,
|
|
645
661
|
maskClosable: maskClosable,
|
|
646
662
|
zIndex: zIndex,
|
|
647
663
|
onAfterOpen: handleAfterOpen
|
|
648
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
664
|
+
}, displayType === 'modal' || displayType === 'drawer' ? typeof headerRender === 'function' ? headerRender() : headerRender : null, /*#__PURE__*/React.createElement("div", {
|
|
649
665
|
className: "pisell-lookup-search-area-with-close"
|
|
650
666
|
}, /*#__PURE__*/React.createElement(LookupTrigger, {
|
|
651
667
|
ref: modalInputRef,
|
|
@@ -5,9 +5,9 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
|
|
|
5
5
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
6
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
7
|
import React from 'react';
|
|
8
|
-
import {
|
|
9
|
-
import { CloseOutlined } from '@ant-design/icons';
|
|
8
|
+
import { Dropdown } from 'antd';
|
|
10
9
|
import { getText } from "../../../locales";
|
|
10
|
+
import PisellContainer from "../../pisellContainer";
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* LookupResultHost 组件
|
|
@@ -21,11 +21,19 @@ export var LookupResultHost = function LookupResultHost(props) {
|
|
|
21
21
|
_props$modalWidth = props.modalWidth,
|
|
22
22
|
modalWidth = _props$modalWidth === void 0 ? 834 : _props$modalWidth,
|
|
23
23
|
modalStyle = props.modalStyle,
|
|
24
|
+
_props$modalCentered = props.modalCentered,
|
|
25
|
+
modalCentered = _props$modalCentered === void 0 ? false : _props$modalCentered,
|
|
26
|
+
modalTransitionName = props.modalTransitionName,
|
|
24
27
|
getContainer = props.getContainer,
|
|
25
28
|
_props$drawerWidth = props.drawerWidth,
|
|
26
29
|
drawerWidth = _props$drawerWidth === void 0 ? 378 : _props$drawerWidth,
|
|
30
|
+
drawerHeight = props.drawerHeight,
|
|
27
31
|
_props$drawerPlacemen = props.drawerPlacement,
|
|
28
32
|
drawerPlacement = _props$drawerPlacemen === void 0 ? 'right' : _props$drawerPlacemen,
|
|
33
|
+
_props$drawerTitle = props.drawerTitle,
|
|
34
|
+
drawerTitle = _props$drawerTitle === void 0 ? getText('pisell-lookup-confirm-button-text') : _props$drawerTitle,
|
|
35
|
+
_props$drawerClosable = props.drawerClosable,
|
|
36
|
+
drawerClosable = _props$drawerClosable === void 0 ? true : _props$drawerClosable,
|
|
29
37
|
popupWidth = props.popupWidth,
|
|
30
38
|
containerStyle = props.containerStyle,
|
|
31
39
|
containerClassName = props.containerClassName,
|
|
@@ -93,27 +101,33 @@ export var LookupResultHost = function LookupResultHost(props) {
|
|
|
93
101
|
// wrapClassName 用于控制 modal-wrap
|
|
94
102
|
// 只要使用了自定义挂载点,就应用特殊样式
|
|
95
103
|
var wrapClassName = hasCustomContainer ? 'pisell-lookup-modal-custom-container' : '';
|
|
96
|
-
return /*#__PURE__*/React.createElement(
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
104
|
+
return /*#__PURE__*/React.createElement(PisellContainer, {
|
|
105
|
+
renderType: "modal",
|
|
106
|
+
props: {
|
|
107
|
+
open: visible,
|
|
108
|
+
onCancel: onClose,
|
|
109
|
+
footer: null,
|
|
110
|
+
header: false,
|
|
111
|
+
closable: false,
|
|
112
|
+
width: modalWidth,
|
|
113
|
+
centered: modalCentered,
|
|
114
|
+
transitionName: modalTransitionName,
|
|
115
|
+
style: _objectSpread({
|
|
116
|
+
top: 0
|
|
117
|
+
}, modalStyle),
|
|
118
|
+
getContainer: getContainer,
|
|
119
|
+
mask: mask,
|
|
120
|
+
maskClosable: effectiveMaskClosable,
|
|
121
|
+
zIndex: zIndex,
|
|
122
|
+
rootClassName: modalRootClassName,
|
|
123
|
+
className: modalClassName,
|
|
124
|
+
wrapClassName: wrapClassName,
|
|
125
|
+
destroyOnClose: true,
|
|
126
|
+
title: null,
|
|
127
|
+
afterOpenChange: function afterOpenChange(open) {
|
|
128
|
+
if (open && onAfterOpen) {
|
|
129
|
+
onAfterOpen();
|
|
130
|
+
}
|
|
117
131
|
}
|
|
118
132
|
}
|
|
119
133
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -131,21 +145,25 @@ export var LookupResultHost = function LookupResultHost(props) {
|
|
|
131
145
|
|
|
132
146
|
// 如果没有遮罩层,添加特殊类名以支持点击穿透
|
|
133
147
|
var drawerClassName = "pisell-lookup-drawer-container ".concat(!mask ? 'pisell-lookup-drawer-no-mask' : '', " ").concat(containerClassName || '');
|
|
134
|
-
return /*#__PURE__*/React.createElement(
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
148
|
+
return /*#__PURE__*/React.createElement(PisellContainer, {
|
|
149
|
+
renderType: "drawer",
|
|
150
|
+
props: {
|
|
151
|
+
open: visible,
|
|
152
|
+
onClose: onClose,
|
|
153
|
+
width: drawerWidth,
|
|
154
|
+
height: drawerHeight,
|
|
155
|
+
placement: drawerPlacement,
|
|
156
|
+
mask: mask,
|
|
157
|
+
maskClosable: effectiveMaskClosable,
|
|
158
|
+
zIndex: zIndex,
|
|
159
|
+
className: drawerClassName,
|
|
160
|
+
closable: drawerClosable,
|
|
161
|
+
destroyOnClose: true,
|
|
162
|
+
title: drawerTitle,
|
|
163
|
+
afterOpenChange: function afterOpenChange(open) {
|
|
164
|
+
if (open && onAfterOpen) {
|
|
165
|
+
onAfterOpen();
|
|
166
|
+
}
|
|
149
167
|
}
|
|
150
168
|
}
|
|
151
169
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -268,6 +268,8 @@ var LookupTriggerComponent = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
268
268
|
}), showConfirmButton && /*#__PURE__*/React.createElement(Button, {
|
|
269
269
|
type: "primary",
|
|
270
270
|
size: size,
|
|
271
|
+
loading: loading,
|
|
272
|
+
disabled: disabled,
|
|
271
273
|
onClick: handleConfirm,
|
|
272
274
|
className: "pisell-lookup-input-confirm"
|
|
273
275
|
}, confirmButtonText));
|