@pisell/materials 6.11.10 → 6.11.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +7 -7
- package/build/lowcode/preview.js +9 -9
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +21 -21
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +18 -18
- package/es/components/PisellCards/components/MultilevelCard/components/PanelWrapper.d.ts +7 -0
- package/es/components/PisellProcedure/PisellProcedure.d.ts +22 -0
- package/es/components/PisellProcedure/PisellProcedure.stories.d.ts +163 -0
- package/es/components/PisellProcedure/components/ProcedureBody.d.ts +41 -0
- package/es/components/PisellProcedure/components/ProcedureFooter.d.ts +38 -0
- package/es/components/PisellProcedure/components/ProcedureHeader.d.ts +34 -0
- package/es/components/PisellProcedure/components/index.d.ts +12 -0
- package/es/components/PisellProcedure/index.d.ts +5 -0
- package/es/components/PisellSuperTabs/PisellSuperTabs.d.ts +8 -0
- package/es/components/PisellSuperTabs/hooks/index.d.ts +1 -0
- package/es/components/PisellSuperTabs/hooks/useTabsState.d.ts +7 -0
- package/es/components/PisellSuperTabs/index.d.ts +3 -0
- package/es/components/PisellSuperTabs/types.d.ts +212 -0
- package/es/components/PisellTabbar/constants.d.ts +47 -0
- package/es/components/PisellTabbar/hooks/index.d.ts +2 -0
- package/es/components/PisellTabbar/hooks/useActiveKey.d.ts +55 -0
- package/es/components/PisellTabbar/hooks/useExpand.d.ts +42 -0
- package/es/components/PisellTabbar/template/Template1/constants.d.ts +10 -0
- package/es/components/PisellTabbar/template/Template1/utils/index.d.ts +35 -0
- package/es/components/PisellTabbar/types.d.ts +90 -0
- package/es/components/PisellTabbar/utils/index.d.ts +69 -0
- package/es/components/dataSourceComponents/dataSourceForm/utils.d.ts +1 -1
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useDrawerState.d.ts +1 -0
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +3 -3
- package/es/components/dataSourceComponents/fields/Input.Mobile/serve.d.ts +26 -0
- package/es/components/dataSourceComponents/fields/Input.Subdomain/index.d.ts +1 -1
- package/es/components/dataSourceComponents/fields/Select/index.d.ts +1 -1
- package/es/components/dataSourceComponents/fields/Translation/BaseTranslation.d.ts +5 -0
- package/es/components/dataSourceComponents/fields/Translation/type.d.ts +21 -0
- package/es/components/dataSourceComponents/fields/index.d.ts +15 -15
- package/es/components/dataSourceComponents/provider/variables/VariablesContext.d.ts +15 -0
- package/es/components/drag-sort-tree/TreeItem/index.d.ts +19 -0
- package/es/components/pisellAdjustPrice/status.d.ts +32 -0
- package/es/components/pisellDateTimeDisplay/PisellDateTimeDisplay.js +0 -2
- package/es/components/pisellDateTimeDisplay/formats/dateTimeDisplayFormats.js +5 -5
- package/es/components/pisellGridPro/index.d.ts +4 -0
- package/es/components/pisellLookup/components/LookupTrigger.d.ts +3 -0
- package/es/components/pisellLookup/components/LookupTrigger.js +16 -13
- package/es/components/pisellMetricCard/PisellMetricCard.stories.d.ts +17 -0
- package/es/components/pisellMetricCard/components/index.d.ts +7 -0
- package/es/components/pisellMetricCard/index.d.ts +6 -0
- package/es/components/pisellMultipleSelect/PisellMultipleSelect.less +15 -7
- package/es/components/pisellRecordBoard/PisellRecordBoard.js +47 -14
- package/es/components/pisellRecordBoard/PisellRecordBoard.stories.d.ts +8 -0
- package/es/components/pisellRecordBoard/PisellRecordBoard.stories.js +482 -249
- package/es/components/pisellRecordBoard/layouts/GridLayout/Grid.js +121 -16
- package/es/components/pisellRecordBoard/layouts/GridLayout/Grid.less +38 -0
- package/es/components/pisellRecordBoard/shellFrame/ColumnSetting/ColumnSettingPopover.d.ts +4 -2
- package/es/components/pisellRecordBoard/shellFrame/ColumnSetting/ColumnSettingPopover.js +92 -13
- package/es/components/pisellRecordBoard/shellFrame/ColumnSetting/index.js +7 -3
- package/es/components/pisellRecordBoard/shellFrame/Pagination/index.js +1 -1
- package/es/components/pisellRecordBoard/shellFrame/ToolBar/index.js +9 -3
- package/es/components/pisellRecordBoard/shellFrame/ToolBarReset/index.js +6 -2
- package/es/components/pisellRecordBoard/utils/recordBoardColumns.d.ts +21 -0
- package/es/components/pisellRecordBoard/utils/recordBoardColumns.js +112 -15
- package/es/components/pisellSingleSelect/PisellSingleSelect.less +15 -0
- package/es/components/pisellSort/index.d.ts +4 -0
- package/es/components/pisellStatisticList/index.d.ts +22 -0
- package/es/components/pisellTimeRangeDisplay/PisellTimeRangeDisplay.js +2 -2
- package/es/components/pisellTimeRangeDisplay/PisellTimeRangeDisplay.stories.d.ts +61 -0
- package/es/components/pisellTimeRangeDisplay/index.d.ts +3 -0
- package/es/components/productCard/cartSkuCard/components/Gift/index.d.ts +5 -0
- package/es/components/productCard/cartSkuCard/components/Gift/index.js +60 -0
- package/es/components/productCard/cartSkuCard/components/Gift/index.less +84 -0
- package/es/components/productCard/cartSkuCard/components/Gift/types.d.ts +29 -0
- package/es/components/productCard/cartSkuCard/components/Gift/types.js +1 -0
- package/es/components/productCard/cartSkuCard/components/Promotion/index.d.ts +7 -0
- package/es/components/productCard/cartSkuCard/components/Promotion/index.js +24 -0
- package/es/components/productCard/cartSkuCard/components/Promotion/index.less +16 -0
- package/es/components/productCard/cartSkuCard/components/basicInfo/index.d.ts +4 -0
- package/es/components/productCard/cartSkuCard/components/basicInfo/index.js +41 -6
- package/es/components/productCard/cartSkuCard/components/basicInfo/index.less +66 -1
- package/es/components/productCard/cartSkuCard/components/packages/index.js +1 -0
- package/es/components/productCard/cartSkuCard/index.d.ts +1 -1
- package/es/components/productCard/cartSkuCard/index.js +44 -7
- package/es/components/productCard/cartSkuCard/locales.d.ts +178 -0
- package/es/components/productCard/cartSkuCard/locales.js +30 -5
- package/es/components/productCard/components/Header/EditButton/index.d.ts +1 -1
- package/es/components/productCard/components/Header/EditButton/index.js +3 -1
- package/es/components/productCard/status.d.ts +32 -0
- package/es/components/productCard/status.js +3 -0
- package/es/components/productCard/types.d.ts +95 -0
- package/es/components/select/index.d.ts +9 -0
- package/es/components/select/index.less +18 -2
- package/es/components/table/Table/fields/image/index.d.ts +1 -0
- package/es/components/table/Table/fields/pSwitch/index.d.ts +1 -0
- package/es/components/table/Table/fields/select/Edit/index.d.ts +4 -0
- package/es/components/table/Table/utils.d.ts +1 -1
- package/es/components/virtual-keyboard/Amount/themeConfig.d.ts +32 -0
- package/es/components/virtual-keyboard/Keyboard/index.d.ts +21 -0
- package/es/components/virtual-keyboard/Number/themeConfig.d.ts +32 -0
- package/es/components/virtual-keyboard/VirtualKeyInput/index.d.ts +13 -0
- package/es/components/virtualInput/BaseVirtualInput/index.less +2 -2
- package/es/components/virtualInput/index.js +6 -2
- package/es/hooks/useThemeTokens.js +20 -0
- package/es/index.d.ts +1 -0
- package/es/locales/en-US.d.ts +2 -0
- package/es/locales/en-US.js +2 -0
- package/es/locales/ja.d.ts +2 -0
- package/es/locales/ja.js +2 -0
- package/es/locales/pt.d.ts +2 -0
- package/es/locales/pt.js +2 -0
- package/es/locales/zh-CN.d.ts +2 -0
- package/es/locales/zh-CN.js +2 -0
- package/es/locales/zh-TW.d.ts +2 -0
- package/es/locales/zh-TW.js +2 -0
- package/lib/components/PisellCards/components/MultilevelCard/components/PanelWrapper.d.ts +7 -0
- package/lib/components/PisellProcedure/PisellProcedure.d.ts +22 -0
- package/lib/components/PisellProcedure/PisellProcedure.stories.d.ts +163 -0
- package/lib/components/PisellProcedure/components/ProcedureBody.d.ts +41 -0
- package/lib/components/PisellProcedure/components/ProcedureFooter.d.ts +38 -0
- package/lib/components/PisellProcedure/components/ProcedureHeader.d.ts +34 -0
- package/lib/components/PisellProcedure/components/index.d.ts +12 -0
- package/lib/components/PisellProcedure/index.d.ts +5 -0
- package/lib/components/PisellSuperTabs/PisellSuperTabs.d.ts +8 -0
- package/lib/components/PisellSuperTabs/hooks/index.d.ts +1 -0
- package/lib/components/PisellSuperTabs/hooks/useTabsState.d.ts +7 -0
- package/lib/components/PisellSuperTabs/index.d.ts +3 -0
- package/lib/components/PisellSuperTabs/types.d.ts +212 -0
- package/lib/components/PisellTabbar/constants.d.ts +47 -0
- package/lib/components/PisellTabbar/hooks/index.d.ts +2 -0
- package/lib/components/PisellTabbar/hooks/useActiveKey.d.ts +55 -0
- package/lib/components/PisellTabbar/hooks/useExpand.d.ts +42 -0
- package/lib/components/PisellTabbar/template/Template1/constants.d.ts +10 -0
- package/lib/components/PisellTabbar/template/Template1/utils/index.d.ts +35 -0
- package/lib/components/PisellTabbar/types.d.ts +90 -0
- package/lib/components/PisellTabbar/utils/index.d.ts +69 -0
- package/lib/components/dataSourceComponents/dataSourceForm/utils.d.ts +1 -1
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useDrawerState.d.ts +1 -0
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +3 -3
- package/lib/components/dataSourceComponents/fields/Input.Mobile/serve.d.ts +26 -0
- package/lib/components/dataSourceComponents/fields/Input.Subdomain/index.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/Select/index.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/Translation/BaseTranslation.d.ts +5 -0
- package/lib/components/dataSourceComponents/fields/Translation/type.d.ts +21 -0
- package/lib/components/dataSourceComponents/fields/index.d.ts +15 -15
- package/lib/components/dataSourceComponents/provider/variables/VariablesContext.d.ts +15 -0
- package/lib/components/drag-sort-tree/TreeItem/index.d.ts +19 -0
- package/lib/components/pisellAdjustPrice/status.d.ts +32 -0
- package/lib/components/pisellDateTimeDisplay/PisellDateTimeDisplay.js +0 -2
- package/lib/components/pisellDateTimeDisplay/formats/dateTimeDisplayFormats.js +3 -3
- package/lib/components/pisellGridPro/index.d.ts +4 -0
- package/lib/components/pisellLookup/components/LookupTrigger.d.ts +3 -0
- package/lib/components/pisellLookup/components/LookupTrigger.js +8 -8
- package/lib/components/pisellMetricCard/PisellMetricCard.stories.d.ts +17 -0
- package/lib/components/pisellMetricCard/components/index.d.ts +7 -0
- package/lib/components/pisellMetricCard/index.d.ts +6 -0
- package/lib/components/pisellMultipleSelect/PisellMultipleSelect.less +15 -7
- package/lib/components/pisellRecordBoard/PisellRecordBoard.js +39 -9
- package/lib/components/pisellRecordBoard/PisellRecordBoard.stories.d.ts +8 -0
- package/lib/components/pisellRecordBoard/PisellRecordBoard.stories.js +159 -0
- package/lib/components/pisellRecordBoard/layouts/GridLayout/Grid.js +94 -9
- package/lib/components/pisellRecordBoard/layouts/GridLayout/Grid.less +38 -0
- package/lib/components/pisellRecordBoard/shellFrame/ColumnSetting/ColumnSettingPopover.d.ts +4 -2
- package/lib/components/pisellRecordBoard/shellFrame/ColumnSetting/ColumnSettingPopover.js +88 -3
- package/lib/components/pisellRecordBoard/shellFrame/ColumnSetting/index.js +6 -2
- package/lib/components/pisellRecordBoard/shellFrame/Pagination/index.js +1 -1
- package/lib/components/pisellRecordBoard/shellFrame/ToolBar/index.js +9 -1
- package/lib/components/pisellRecordBoard/shellFrame/ToolBarReset/index.js +3 -2
- package/lib/components/pisellRecordBoard/utils/recordBoardColumns.d.ts +21 -0
- package/lib/components/pisellRecordBoard/utils/recordBoardColumns.js +60 -0
- package/lib/components/pisellSingleSelect/PisellSingleSelect.less +15 -0
- package/lib/components/pisellSort/index.d.ts +4 -0
- package/lib/components/pisellStatisticList/index.d.ts +22 -0
- package/lib/components/pisellTimeRangeDisplay/PisellTimeRangeDisplay.js +1 -1
- package/lib/components/pisellTimeRangeDisplay/PisellTimeRangeDisplay.stories.d.ts +61 -0
- package/lib/components/pisellTimeRangeDisplay/index.d.ts +3 -0
- package/lib/components/productCard/cartSkuCard/components/Gift/index.d.ts +5 -0
- package/lib/components/productCard/cartSkuCard/components/Gift/index.js +62 -0
- package/lib/components/productCard/cartSkuCard/components/Gift/index.less +84 -0
- package/lib/components/productCard/cartSkuCard/components/Gift/types.d.ts +29 -0
- package/lib/components/productCard/cartSkuCard/components/Gift/types.js +17 -0
- package/lib/components/productCard/cartSkuCard/components/Promotion/index.d.ts +7 -0
- package/lib/components/productCard/cartSkuCard/components/Promotion/index.js +63 -0
- package/lib/components/productCard/cartSkuCard/components/Promotion/index.less +16 -0
- package/lib/components/productCard/cartSkuCard/components/basicInfo/index.d.ts +4 -0
- package/lib/components/productCard/cartSkuCard/components/basicInfo/index.js +20 -3
- package/lib/components/productCard/cartSkuCard/components/basicInfo/index.less +66 -1
- package/lib/components/productCard/cartSkuCard/components/packages/index.js +1 -1
- package/lib/components/productCard/cartSkuCard/index.d.ts +1 -1
- package/lib/components/productCard/cartSkuCard/index.js +42 -6
- package/lib/components/productCard/cartSkuCard/locales.d.ts +178 -0
- package/lib/components/productCard/cartSkuCard/locales.js +20 -5
- package/lib/components/productCard/components/Header/EditButton/index.d.ts +1 -1
- package/lib/components/productCard/components/Header/EditButton/index.js +2 -1
- package/lib/components/productCard/status.d.ts +32 -0
- package/lib/components/productCard/status.js +3 -0
- package/lib/components/productCard/types.d.ts +95 -0
- package/lib/components/select/index.d.ts +9 -0
- package/lib/components/select/index.less +18 -2
- package/lib/components/table/Table/fields/image/index.d.ts +1 -0
- package/lib/components/table/Table/fields/pSwitch/index.d.ts +1 -0
- package/lib/components/table/Table/fields/select/Edit/index.d.ts +4 -0
- package/lib/components/table/Table/utils.d.ts +1 -1
- package/lib/components/virtual-keyboard/Amount/themeConfig.d.ts +32 -0
- package/lib/components/virtual-keyboard/Keyboard/index.d.ts +21 -0
- package/lib/components/virtual-keyboard/Number/themeConfig.d.ts +32 -0
- package/lib/components/virtual-keyboard/VirtualKeyInput/index.d.ts +13 -0
- package/lib/components/virtualInput/BaseVirtualInput/index.less +2 -2
- package/lib/components/virtualInput/index.js +7 -1
- package/lib/hooks/useThemeTokens.js +40 -0
- package/lib/index.d.ts +1 -0
- package/lib/locales/en-US.d.ts +2 -0
- package/lib/locales/en-US.js +2 -0
- package/lib/locales/ja.d.ts +2 -0
- package/lib/locales/ja.js +2 -0
- package/lib/locales/pt.d.ts +2 -0
- package/lib/locales/pt.js +2 -0
- package/lib/locales/zh-CN.d.ts +2 -0
- package/lib/locales/zh-CN.js +2 -0
- package/lib/locales/zh-TW.d.ts +2 -0
- package/lib/locales/zh-TW.js +2 -0
- package/package.json +3 -3
- package/es/components/pisellDateTimeDisplay/formats/dateTimeDisplayFormats.d.ts +0 -7
- package/es/components/pisellDateTimeDisplay/formats/index.d.ts +0 -1
- package/es/components/virtualInput/index.d.ts +0 -24
- package/lib/components/pisellDateTimeDisplay/formats/dateTimeDisplayFormats.d.ts +0 -7
- package/lib/components/pisellDateTimeDisplay/formats/index.d.ts +0 -1
- package/lib/components/virtualInput/index.d.ts +0 -24
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { ExpandState, LevelType } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* useExpand Hook 参数
|
|
4
|
+
*/
|
|
5
|
+
interface UseExpandProps {
|
|
6
|
+
/** 初始展开状态 */
|
|
7
|
+
initialExpand?: Partial<ExpandState>;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* useExpand Hook 返回值
|
|
11
|
+
*/
|
|
12
|
+
interface UseExpandReturn {
|
|
13
|
+
/** 展开状态 */
|
|
14
|
+
expand: ExpandState;
|
|
15
|
+
/** 设置展开状态 */
|
|
16
|
+
setExpand: (state: ExpandState) => void;
|
|
17
|
+
/** 切换指定层级的展开状态 */
|
|
18
|
+
toggleExpand: (level: LevelType) => void;
|
|
19
|
+
/** 获取指定层级的展开状态 */
|
|
20
|
+
getExpand: (level: LevelType) => boolean;
|
|
21
|
+
closeAll: () => void;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Tabbar 展开状态管理 Hook
|
|
25
|
+
* 用于管理多层级的展开/收起状态
|
|
26
|
+
*
|
|
27
|
+
* @param props - Hook 配置参数
|
|
28
|
+
* @returns 展开状态和操作方法
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```tsx
|
|
32
|
+
* const { expand, toggleExpand, getExpand } = useExpand({
|
|
33
|
+
* initialExpand: { level1: false }
|
|
34
|
+
* });
|
|
35
|
+
*
|
|
36
|
+
* <button onClick={() => toggleExpand('level1')}>
|
|
37
|
+
* {getExpand('level1') ? '收起' : '展开'}
|
|
38
|
+
* </button>
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
declare const useExpand: (props?: UseExpandProps) => UseExpandReturn;
|
|
42
|
+
export default useExpand;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { TabbarLevelConfig, LevelType } from '../../types';
|
|
2
|
+
export { getExpandConfig, DEFAULT_ITEMS } from '../../constants';
|
|
3
|
+
/**
|
|
4
|
+
* 默认层级配置
|
|
5
|
+
*/
|
|
6
|
+
export declare const DEFAULT_LEVEL_CONFIG: Record<LevelType, TabbarLevelConfig>;
|
|
7
|
+
/**
|
|
8
|
+
* 获取层级对应的添加项配置
|
|
9
|
+
*/
|
|
10
|
+
export declare const LEVEL_ADD_ITEMS: Record<LevelType, ('all' | 'search' | 'expand')[]>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PisellTabbar 工具函数
|
|
3
|
+
*/
|
|
4
|
+
import { TabbarDataSource } from '../../../types';
|
|
5
|
+
/**
|
|
6
|
+
* 向数据源添加特殊项(如 all、search、expand 按钮)
|
|
7
|
+
*
|
|
8
|
+
* @param dataSource - 原始数据源
|
|
9
|
+
* @param keys - 要添加的特殊项 key 数组
|
|
10
|
+
* @returns 添加了特殊项的新数据源
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```tsx
|
|
14
|
+
* const newData = addDataSourceItemsByKey(categoryData, ['expand', 'all']);
|
|
15
|
+
* // 返回: [expandItem, allItem, ...categoryData]
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export declare const addDataSourceItemsByKey: (dataSource: TabbarDataSource[], keys: ('all' | 'search' | 'expand')[]) => TabbarDataSource[];
|
|
19
|
+
/**
|
|
20
|
+
* 获取默认激活的 key 数组
|
|
21
|
+
*
|
|
22
|
+
* @param dataSource - 数据源
|
|
23
|
+
* @param rowKey - 用作唯一标识的字段名
|
|
24
|
+
* @returns 默认激活的 key 数组(多层级)
|
|
25
|
+
*
|
|
26
|
+
* @description
|
|
27
|
+
* 默认选中第一项,如果第一项有子级,同时选中第一个子级
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```tsx
|
|
31
|
+
* const defaultKeys = getDefaultActiveKey(categoryData, 'id');
|
|
32
|
+
* // 返回: [1, 0] (第一层级的第一项ID,第二层级的第一项ID)
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
export declare const getDefaultActiveKey: (dataSource: TabbarDataSource[], rowKey: string) => (string | number)[];
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Tabbar 数据源项类型
|
|
4
|
+
*/
|
|
5
|
+
export interface TabbarDataSource {
|
|
6
|
+
/** 唯一标识 */
|
|
7
|
+
id: string | number;
|
|
8
|
+
/** 店铺ID */
|
|
9
|
+
shop_id?: number;
|
|
10
|
+
/** 父级ID */
|
|
11
|
+
parent_id?: number;
|
|
12
|
+
/** 显示名称 */
|
|
13
|
+
name: string;
|
|
14
|
+
/** URL slug */
|
|
15
|
+
slug?: string;
|
|
16
|
+
/** 图标 URL 或图标名称 */
|
|
17
|
+
icon?: string;
|
|
18
|
+
/** 子级数据 */
|
|
19
|
+
children?: TabbarDataSource[];
|
|
20
|
+
/** 自定义点击事件标识 */
|
|
21
|
+
customClick?: boolean;
|
|
22
|
+
/** 唯一 key */
|
|
23
|
+
key?: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* 层级配置
|
|
27
|
+
*/
|
|
28
|
+
export interface TabbarLevelConfig {
|
|
29
|
+
/** SuperTabs 背景色 */
|
|
30
|
+
superTabsBg: string;
|
|
31
|
+
/** 卡片宽度 */
|
|
32
|
+
cardWidth: number;
|
|
33
|
+
/** 卡片高度 */
|
|
34
|
+
cardHeight: number;
|
|
35
|
+
/** 左侧缩进 */
|
|
36
|
+
paddingLeft?: number;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* 展开配置
|
|
40
|
+
*/
|
|
41
|
+
export interface ExpandConfig {
|
|
42
|
+
/** 激活状态配置 */
|
|
43
|
+
active: {
|
|
44
|
+
icon: string;
|
|
45
|
+
text: string;
|
|
46
|
+
};
|
|
47
|
+
/** 未激活状态配置 */
|
|
48
|
+
inactive: {
|
|
49
|
+
icon: string;
|
|
50
|
+
text: string;
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* 展开状态
|
|
55
|
+
*/
|
|
56
|
+
export interface ExpandState {
|
|
57
|
+
level1: boolean;
|
|
58
|
+
level2: boolean;
|
|
59
|
+
level3: boolean;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* 层级类型
|
|
63
|
+
*/
|
|
64
|
+
export declare type LevelType = 'level1' | 'level2' | 'level3';
|
|
65
|
+
/**
|
|
66
|
+
* PisellTabbar 组件属性
|
|
67
|
+
*/
|
|
68
|
+
export interface PisellTabbarProps {
|
|
69
|
+
/** 数据源 */
|
|
70
|
+
dataSource?: TabbarDataSource[];
|
|
71
|
+
/** 当前选中的值(多层级 key 数组) */
|
|
72
|
+
value?: (string | number)[];
|
|
73
|
+
/** 值变化回调 */
|
|
74
|
+
onChange?: (value: (string | number)[]) => void;
|
|
75
|
+
/** 自定义类名 */
|
|
76
|
+
className?: string;
|
|
77
|
+
/** 自定义样式 */
|
|
78
|
+
style?: CSSProperties;
|
|
79
|
+
/** 层级配置(可按层级自定义) */
|
|
80
|
+
levelConfig?: Partial<Record<LevelType, Partial<TabbarLevelConfig>>>;
|
|
81
|
+
/** 展开配置 */
|
|
82
|
+
expandConfig?: ExpandConfig;
|
|
83
|
+
/** 最大层级数 */
|
|
84
|
+
maxLevel?: 1 | 2 | 3;
|
|
85
|
+
onSearch?: (value: string) => void;
|
|
86
|
+
__designMode?: boolean;
|
|
87
|
+
}
|
|
88
|
+
export interface PisellTabbarRef {
|
|
89
|
+
closeSearchMode: () => void;
|
|
90
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PisellTabbar 工具函数
|
|
3
|
+
*/
|
|
4
|
+
import { TabbarDataSource } from '../types';
|
|
5
|
+
/**
|
|
6
|
+
* 默认的特殊项配置
|
|
7
|
+
*/
|
|
8
|
+
export declare const defaultItems: {
|
|
9
|
+
all: {
|
|
10
|
+
id: number;
|
|
11
|
+
shop_id: number;
|
|
12
|
+
parent_id: number;
|
|
13
|
+
name: any;
|
|
14
|
+
slug: string;
|
|
15
|
+
icon: string;
|
|
16
|
+
};
|
|
17
|
+
search: {
|
|
18
|
+
id: number;
|
|
19
|
+
shop_id: number;
|
|
20
|
+
parent_id: number;
|
|
21
|
+
name: any;
|
|
22
|
+
text: any;
|
|
23
|
+
slug: string;
|
|
24
|
+
key: string;
|
|
25
|
+
icon: string;
|
|
26
|
+
customClick: boolean;
|
|
27
|
+
};
|
|
28
|
+
expand: {
|
|
29
|
+
id: number;
|
|
30
|
+
shop_id: number;
|
|
31
|
+
parent_id: number;
|
|
32
|
+
key: string;
|
|
33
|
+
icon: string;
|
|
34
|
+
name: string;
|
|
35
|
+
slug: string;
|
|
36
|
+
customClick: boolean;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* 向数据源添加特殊项(如 all、search、expand 按钮)
|
|
41
|
+
*
|
|
42
|
+
* @param dataSource - 原始数据源
|
|
43
|
+
* @param keys - 要添加的特殊项 key 数组
|
|
44
|
+
* @returns 添加了特殊项的新数据源
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```tsx
|
|
48
|
+
* const newData = addDataSourceItemsByKey(categoryData, ['expand', 'all']);
|
|
49
|
+
* // 返回: [expandItem, allItem, ...categoryData]
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
export declare const addDataSourceItemsByKey: (dataSource: TabbarDataSource[], keys: ('all' | 'search' | 'expand')[]) => TabbarDataSource[];
|
|
53
|
+
/**
|
|
54
|
+
* 获取默认激活的 key 数组
|
|
55
|
+
*
|
|
56
|
+
* @param dataSource - 数据源
|
|
57
|
+
* @param rowKey - 用作唯一标识的字段名
|
|
58
|
+
* @returns 默认激活的 key 数组(多层级)
|
|
59
|
+
*
|
|
60
|
+
* @description
|
|
61
|
+
* 默认选中第一项,如果第一项有子级,同时选中第一个子级
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* ```tsx
|
|
65
|
+
* const defaultKeys = getDefaultActiveKey(categoryData, 'id');
|
|
66
|
+
* // 返回: [1, 0] (第一层级的第一项ID,第二层级的第一项ID)
|
|
67
|
+
* ```
|
|
68
|
+
*/
|
|
69
|
+
export declare const getDefaultActiveKey: (dataSource: TabbarDataSource[], rowKey: string) => (string | number)[];
|
|
@@ -44,7 +44,7 @@ export declare const withDataSource: <P extends unknown>(WrappedComponent: React
|
|
|
44
44
|
}) => React.JSX.Element;
|
|
45
45
|
export declare const withOptions: <P extends unknown>(WrappedComponent: React.ComponentType<P>) => (props: P & {
|
|
46
46
|
options?: any;
|
|
47
|
-
optionSourceType?: "
|
|
47
|
+
optionSourceType?: "default" | "api" | "custom" | undefined;
|
|
48
48
|
labelField: string;
|
|
49
49
|
valueField: string;
|
|
50
50
|
extraParams?: Record<string, any> | undefined;
|
|
@@ -19,7 +19,7 @@ interface UseTablePropsProps {
|
|
|
19
19
|
*/
|
|
20
20
|
declare const useTableProps: (props: UseTablePropsProps) => {
|
|
21
21
|
currentComponentId: any;
|
|
22
|
-
title: number | boolean | React.
|
|
22
|
+
title: number | boolean | Iterable<React.ReactNode> | React.JSX.Element | (() => React.ReactNode) | null | undefined;
|
|
23
23
|
pagination: {
|
|
24
24
|
total: number;
|
|
25
25
|
current: number;
|
|
@@ -28,7 +28,7 @@ declare const useTableProps: (props: UseTablePropsProps) => {
|
|
|
28
28
|
showSizeChanger: boolean;
|
|
29
29
|
};
|
|
30
30
|
columns: import("./useColumns").Column[];
|
|
31
|
-
subTitle: number | boolean | React.
|
|
31
|
+
subTitle: number | boolean | Iterable<React.ReactNode> | React.JSX.Element | (() => React.ReactNode) | null | undefined;
|
|
32
32
|
buttons: any[] | null;
|
|
33
33
|
filter: {
|
|
34
34
|
dom: any;
|
|
@@ -52,7 +52,7 @@ declare const useTableProps: (props: UseTablePropsProps) => {
|
|
|
52
52
|
show: boolean;
|
|
53
53
|
title: string;
|
|
54
54
|
width: number;
|
|
55
|
-
align: "
|
|
55
|
+
align: "left" | "right" | "center";
|
|
56
56
|
fixed: false | "left" | "right";
|
|
57
57
|
type: "link" | "button";
|
|
58
58
|
items: OperationItem[];
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 获取nocobase数据列表
|
|
3
|
+
*/
|
|
4
|
+
export declare const getCountryDataList: () => Promise<any>;
|
|
5
|
+
export interface Country {
|
|
6
|
+
id: number;
|
|
7
|
+
name: {
|
|
8
|
+
en: string;
|
|
9
|
+
'zh-CN': string;
|
|
10
|
+
'zh-HK': string;
|
|
11
|
+
'ja': string;
|
|
12
|
+
'pt': string;
|
|
13
|
+
original: string;
|
|
14
|
+
};
|
|
15
|
+
code: string;
|
|
16
|
+
calling_code: string;
|
|
17
|
+
currency_code: string;
|
|
18
|
+
sort: number;
|
|
19
|
+
status: string;
|
|
20
|
+
created_at: string;
|
|
21
|
+
updated_at: string;
|
|
22
|
+
prefix: string;
|
|
23
|
+
}
|
|
24
|
+
export declare const useCountries: () => {
|
|
25
|
+
data: Country[];
|
|
26
|
+
};
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
declare const Subdomain: React.FC<import("antd").InputProps & {
|
|
3
3
|
onChange: (value: string) => void;
|
|
4
4
|
onBlur?: ((e: React.FocusEvent<HTMLInputElement, Element>) => void) | undefined;
|
|
5
|
-
rootDomain: "
|
|
5
|
+
rootDomain: "saas" | "custom" | "xzero";
|
|
6
6
|
customDomain?: string | undefined;
|
|
7
7
|
value?: string | undefined;
|
|
8
8
|
tenantId: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
declare const SelectWithDataSource: (props: import("antd").SelectProps<any, import("antd/es/select").DefaultOptionType> & import("../../dataSourceForm/utils").WithModeProps & import("../../dataSourceForm/utils").WithFormItemProps & {
|
|
3
3
|
options?: any;
|
|
4
|
-
optionSourceType?: "
|
|
4
|
+
optionSourceType?: "default" | "api" | "custom" | undefined;
|
|
5
5
|
labelField: string;
|
|
6
6
|
valueField: string;
|
|
7
7
|
extraParams?: Record<string, any> | undefined;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ModeType } from "../../dataSourceForm/type";
|
|
3
|
+
export interface TranslationValue {
|
|
4
|
+
en: string;
|
|
5
|
+
'zh-CN': string;
|
|
6
|
+
'zh-HK': string;
|
|
7
|
+
'ja': string;
|
|
8
|
+
'pt': string;
|
|
9
|
+
original: string;
|
|
10
|
+
}
|
|
11
|
+
export interface TranslationProps {
|
|
12
|
+
renderMode: ModeType;
|
|
13
|
+
value?: TranslationValue;
|
|
14
|
+
onChange?: (value: TranslationValue) => void;
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
placeholder?: string;
|
|
17
|
+
className?: string;
|
|
18
|
+
type?: 'text' | 'textarea';
|
|
19
|
+
maxLength?: number;
|
|
20
|
+
inputStyle?: React.CSSProperties;
|
|
21
|
+
}
|
|
@@ -20,7 +20,7 @@ declare const formFieldMap: {
|
|
|
20
20
|
Subdomain: import("react").FC<import("antd").InputProps & {
|
|
21
21
|
onChange: (value: string) => void;
|
|
22
22
|
onBlur?: ((e: import("react").FocusEvent<HTMLInputElement, Element>) => void) | undefined;
|
|
23
|
-
rootDomain: "
|
|
23
|
+
rootDomain: "saas" | "custom" | "xzero";
|
|
24
24
|
customDomain?: string | undefined;
|
|
25
25
|
value?: string | undefined;
|
|
26
26
|
tenantId: string;
|
|
@@ -35,7 +35,7 @@ declare const formFieldMap: {
|
|
|
35
35
|
};
|
|
36
36
|
FormItemSelect: (props: import("antd").SelectProps<any, import("antd/es/select").DefaultOptionType> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps & {
|
|
37
37
|
options?: any;
|
|
38
|
-
optionSourceType?: "
|
|
38
|
+
optionSourceType?: "default" | "api" | "custom" | undefined;
|
|
39
39
|
labelField: string;
|
|
40
40
|
valueField: string;
|
|
41
41
|
extraParams?: Record<string, any> | undefined;
|
|
@@ -61,11 +61,20 @@ declare const formFieldMap: {
|
|
|
61
61
|
FormItemTranslation: import("react").FC<import("./Translation/type").TranslationProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
|
|
62
62
|
FormItemIconSelect: import("react").FC<import("./IconSelect/type").IconSelectProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
|
|
63
63
|
};
|
|
64
|
-
declare const getFieldComponent: (fieldComponent: string) => import("
|
|
64
|
+
declare const getFieldComponent: (fieldComponent: string) => ((props: import("antd").SelectProps<any, import("antd/es/select").DefaultOptionType> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps & {
|
|
65
|
+
options?: any;
|
|
66
|
+
optionSourceType?: "default" | "api" | "custom" | undefined;
|
|
67
|
+
labelField: string;
|
|
68
|
+
valueField: string;
|
|
69
|
+
extraParams?: Record<string, any> | undefined;
|
|
70
|
+
} & {
|
|
71
|
+
dataSource?: any;
|
|
72
|
+
extraParams?: Record<string, any> | undefined;
|
|
73
|
+
}) => import("react").JSX.Element) | (import("react").FC<{}> & {
|
|
65
74
|
Group: import("react").FC<import("./Checkbox/type").CheckboxGroupProps & import("../dataSourceForm/utils").WithModeProps>;
|
|
66
75
|
} & {
|
|
67
76
|
Group: import("react").FC<import("./Checkbox/type").CheckboxGroupProps & import("../dataSourceForm/utils").WithModeProps>;
|
|
68
|
-
}) | import("react").FC<import("./ColorPicker/type").ColorPickerProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | (import("react").FC<import("./Input/type").InputProps> & {
|
|
77
|
+
}) | import("react").FC<import("./ColorPicker/type").ColorPickerProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<(import("antd").DatePickerProps & import("../dataSourceForm/utils").WithModeProps) & import("../dataSourceForm/utils").WithFormItemProps> | (import("react").FC<import("./Input/type").InputProps> & {
|
|
69
78
|
JSON: import("react").FC<any>;
|
|
70
79
|
Password: import("react").FC<import("antd/es/input").PasswordProps & import("react").RefAttributes<import("antd").InputRef> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
|
|
71
80
|
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>;
|
|
@@ -78,7 +87,7 @@ declare const getFieldComponent: (fieldComponent: string) => import("react").FC<
|
|
|
78
87
|
Subdomain: import("react").FC<import("antd").InputProps & {
|
|
79
88
|
onChange: (value: string) => void;
|
|
80
89
|
onBlur?: ((e: import("react").FocusEvent<HTMLInputElement, Element>) => void) | undefined;
|
|
81
|
-
rootDomain: "
|
|
90
|
+
rootDomain: "saas" | "custom" | "xzero";
|
|
82
91
|
customDomain?: string | undefined;
|
|
83
92
|
value?: string | undefined;
|
|
84
93
|
tenantId: string;
|
|
@@ -89,16 +98,7 @@ declare const getFieldComponent: (fieldComponent: string) => import("react").FC<
|
|
|
89
98
|
Group: import("react").FC<import("./Radio/type").RadioGroupProps & import("../dataSourceForm/utils").WithModeProps>;
|
|
90
99
|
} & {
|
|
91
100
|
Group: import("react").FC<import("./Radio/type").RadioGroupProps & import("../dataSourceForm/utils").WithModeProps>;
|
|
92
|
-
}) | ((
|
|
93
|
-
options?: any;
|
|
94
|
-
optionSourceType?: "custom" | "default" | "api" | undefined;
|
|
95
|
-
labelField: string;
|
|
96
|
-
valueField: string;
|
|
97
|
-
extraParams?: Record<string, any> | undefined;
|
|
98
|
-
} & {
|
|
99
|
-
dataSource?: any;
|
|
100
|
-
extraParams?: Record<string, any> | undefined;
|
|
101
|
-
}) => import("react").JSX.Element) | 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 & {
|
|
101
|
+
}) | 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 & {
|
|
102
102
|
onChange: (value: string) => void;
|
|
103
103
|
} & 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>;
|
|
104
104
|
export { getFieldComponent, formFieldMap };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface VariablesContextType {
|
|
3
|
+
children?: React.ReactNode;
|
|
4
|
+
variables?: Record<string, any>;
|
|
5
|
+
registerVariable?: (value: Record<string, any>) => void;
|
|
6
|
+
parseVariable?: (str: string, localVariables?: Record<string, any>) => any;
|
|
7
|
+
registerValueVariable?: (componentId: string, value: Record<string, any>) => void;
|
|
8
|
+
registerFunctionVariable?: (componentId: string, value: Record<string, any>) => void;
|
|
9
|
+
subscribeVariables?: (listener: (allVariables: Record<string, any>, updateVariables: Record<string, any>) => void) => () => void;
|
|
10
|
+
config?: {
|
|
11
|
+
disabledHistoryListener?: boolean;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export declare const VariablesContext: import("react").Context<VariablesContextType>;
|
|
15
|
+
export default VariablesContext;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './index.less';
|
|
3
|
+
import { ValueProps, SortType } from '../types';
|
|
4
|
+
declare type IdType = string | number;
|
|
5
|
+
declare type TreeItemProps = {
|
|
6
|
+
id: string | number;
|
|
7
|
+
key: string | number;
|
|
8
|
+
item: ValueProps | any;
|
|
9
|
+
depth: number;
|
|
10
|
+
lists: any[];
|
|
11
|
+
childrenProps?: SortType;
|
|
12
|
+
sensors?: any;
|
|
13
|
+
expandedKeys?: IdType[];
|
|
14
|
+
setExpandedKeys?: any;
|
|
15
|
+
onSelectKeys?: (ids: IdType) => void;
|
|
16
|
+
onChange?: (value: any[]) => void;
|
|
17
|
+
};
|
|
18
|
+
declare const TreeItem: (props: TreeItemProps) => React.JSX.Element;
|
|
19
|
+
export default TreeItem;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export declare const defaultConfig: {
|
|
2
|
+
dark: {
|
|
3
|
+
backgroundColor: string;
|
|
4
|
+
containerBackgroundColor: string;
|
|
5
|
+
buttonBackgroundColor: string;
|
|
6
|
+
textColor: string;
|
|
7
|
+
resetButtonBackgroundColor: string;
|
|
8
|
+
resetButtonTextColor: string;
|
|
9
|
+
isDoneButtonFollowTheme: boolean;
|
|
10
|
+
doneButtonBackgroundColor: string;
|
|
11
|
+
doneButtonTextColor: string;
|
|
12
|
+
isShowMainText: boolean;
|
|
13
|
+
mainTextColor: string;
|
|
14
|
+
isShowSubText: boolean;
|
|
15
|
+
subTextColor: string;
|
|
16
|
+
};
|
|
17
|
+
light: {
|
|
18
|
+
backgroundColor: string;
|
|
19
|
+
containerBackgroundColor: string;
|
|
20
|
+
buttonBackgroundColor: string;
|
|
21
|
+
textColor: string;
|
|
22
|
+
resetButtonBackgroundColor: string;
|
|
23
|
+
resetButtonTextColor: string;
|
|
24
|
+
isDoneButtonFollowTheme: boolean;
|
|
25
|
+
doneButtonBackgroundColor: string;
|
|
26
|
+
doneButtonTextColor: string;
|
|
27
|
+
isShowMainText: boolean;
|
|
28
|
+
mainTextColor: string;
|
|
29
|
+
isShowSubText: boolean;
|
|
30
|
+
subTextColor: string;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
@@ -71,10 +71,8 @@ export var PisellDateTimeDisplay = function PisellDateTimeDisplay(props) {
|
|
|
71
71
|
style = props.style;
|
|
72
72
|
var context = useEngineContext();
|
|
73
73
|
var resolvedLocale = locale || (context === null || context === void 0 || (_context$engine = context.engine) === null || _context$engine === void 0 || (_context$engine = _context$engine.props) === null || _context$engine === void 0 ? void 0 : _context$engine.locale) || 'en';
|
|
74
|
-
console.log('resolvedLocale', resolvedLocale);
|
|
75
74
|
// 多语言格式:formatByLocale 优先,否则用内置 DATETIME_DISPLAY_FORMATS;再与单项 props 合并(单项优先)
|
|
76
75
|
var localeKey = getDayjsLocale(resolvedLocale);
|
|
77
|
-
console.log('localeKey', localeKey);
|
|
78
76
|
var baseLocale = localeKey.split('-')[0];
|
|
79
77
|
var presetSource = formatByLocale !== null && formatByLocale !== void 0 ? formatByLocale : DATETIME_DISPLAY_FORMATS;
|
|
80
78
|
var preset = (_ref = (_presetSource$localeK = presetSource[localeKey]) !== null && _presetSource$localeK !== void 0 ? _presetSource$localeK : presetSource[baseLocale]) !== null && _ref !== void 0 ? _ref : {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* PisellDateTimeDisplay 按语言预设的格式
|
|
3
|
-
* - zh-cn:完整日期 - 时间 星期(如 2025-12-31 - 2:00
|
|
4
|
-
* - en:时间 星期, 日期(如 2:00 Sat, 21 Mar, 2026
|
|
3
|
+
* - zh-cn:完整日期 - 时间 星期(如 2025-12-31 - 2:00 周四);默认不展示相对日,可传 dateFormat.showRelativeDay: true 开启
|
|
4
|
+
* - en:时间 星期, 日期(如 2:00 Sat, 21 Mar, 2026);默认不展示相对日,可传 dateFormat.showRelativeDay: true 开启
|
|
5
5
|
*/
|
|
6
6
|
export var DATETIME_DISPLAY_FORMATS = {
|
|
7
7
|
'zh-cn': {
|
|
@@ -10,7 +10,7 @@ export var DATETIME_DISPLAY_FORMATS = {
|
|
|
10
10
|
showYear: true,
|
|
11
11
|
separator: '-',
|
|
12
12
|
showChineseUnit: false,
|
|
13
|
-
showRelativeDay:
|
|
13
|
+
showRelativeDay: false
|
|
14
14
|
},
|
|
15
15
|
timeFormat: {
|
|
16
16
|
use12Hour: false,
|
|
@@ -35,7 +35,7 @@ export var DATETIME_DISPLAY_FORMATS = {
|
|
|
35
35
|
showYear: true,
|
|
36
36
|
separator: '-',
|
|
37
37
|
showChineseUnit: false,
|
|
38
|
-
showRelativeDay:
|
|
38
|
+
showRelativeDay: false
|
|
39
39
|
},
|
|
40
40
|
timeFormat: {
|
|
41
41
|
use12Hour: false,
|
|
@@ -58,7 +58,7 @@ export var DATETIME_DISPLAY_FORMATS = {
|
|
|
58
58
|
order: 'DMY',
|
|
59
59
|
shortMonth: true,
|
|
60
60
|
showYear: true,
|
|
61
|
-
showRelativeDay:
|
|
61
|
+
showRelativeDay: false,
|
|
62
62
|
useCommaBeforeYear: true
|
|
63
63
|
},
|
|
64
64
|
timeFormat: {
|
|
@@ -114,9 +114,8 @@ var LookupTriggerComponent = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
114
114
|
*/
|
|
115
115
|
var getAppScanBarcodePlugin = function getAppScanBarcodePlugin() {
|
|
116
116
|
if (getApp) {
|
|
117
|
-
var _app$getPlugin;
|
|
118
117
|
var app = getApp();
|
|
119
|
-
var scanBarcode = app === null || app === void 0
|
|
118
|
+
var scanBarcode = app === null || app === void 0 ? void 0 : app.getPlugin('webScan');
|
|
120
119
|
if (scanBarcode) {
|
|
121
120
|
return scanBarcode;
|
|
122
121
|
}
|
|
@@ -134,19 +133,23 @@ var LookupTriggerComponent = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
134
133
|
var app = getApp();
|
|
135
134
|
try {
|
|
136
135
|
var scanBarcode = getAppScanBarcodePlugin();
|
|
137
|
-
scanBarcode({
|
|
138
|
-
|
|
136
|
+
scanBarcode.scan({
|
|
137
|
+
type: "capacitor",
|
|
138
|
+
params: {
|
|
139
|
+
hint: 17
|
|
140
|
+
}
|
|
139
141
|
}).then(function (res) {
|
|
140
|
-
|
|
141
|
-
}).catch(function (err) {
|
|
142
|
-
app.logger.addLog({
|
|
143
|
-
type: 'info',
|
|
144
|
-
title: '扫码失败',
|
|
145
|
-
metadata: {
|
|
146
|
-
err: err
|
|
147
|
-
}
|
|
148
|
-
});
|
|
142
|
+
onScan === null || onScan === void 0 || onScan(res);
|
|
149
143
|
});
|
|
144
|
+
// scanBarcode({ hint: 17 })
|
|
145
|
+
// .then((res: { ScanResult: string }) => onScan?.(res?.ScanResult))
|
|
146
|
+
// .catch((err: any) => {
|
|
147
|
+
// app.logger.addLog({
|
|
148
|
+
// type: 'info',
|
|
149
|
+
// title: '扫码失败',
|
|
150
|
+
// metadata: { err },
|
|
151
|
+
// });
|
|
152
|
+
// });
|
|
150
153
|
} catch (err) {
|
|
151
154
|
app.logger.addLog({
|
|
152
155
|
type: 'error',
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import PisellMetricCard from './PisellMetricCard';
|
|
3
|
+
declare const meta: Meta<typeof PisellMetricCard>;
|
|
4
|
+
export default meta;
|
|
5
|
+
declare type Story = StoryObj<typeof PisellMetricCard>;
|
|
6
|
+
export declare const Basic: Story;
|
|
7
|
+
export declare const WithCurrency: Story;
|
|
8
|
+
export declare const PositiveTrend: Story;
|
|
9
|
+
export declare const NegativeTrend: Story;
|
|
10
|
+
export declare const WithGrouping: Story;
|
|
11
|
+
export declare const WithPrecision: Story;
|
|
12
|
+
export declare const Complete: Story;
|
|
13
|
+
export declare const WithTag: Story;
|
|
14
|
+
export declare const CustomStyle: Story;
|
|
15
|
+
export declare const Loading: Story;
|
|
16
|
+
export declare const EmptyValue: Story;
|
|
17
|
+
export declare const MultipleCards: Story;
|