@pisell/materials 3.3.93 → 3.3.95
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 +3 -3
- package/build/lowcode/render/default/view.js +4 -4
- package/build/lowcode/view.js +4 -4
- package/es/components/PisellCards/components/GraphicTextCard/components/BadgeWrapper.d.ts +5 -0
- package/es/components/PisellCards/components/GraphicTextCard/components/TextContent.d.ts +27 -0
- package/es/components/PisellCards/components/GraphicTextCard/hooks/index.d.ts +5 -0
- package/es/components/PisellCards/components/GraphicTextCard/hooks/useGraphicTextCardClick.d.ts +15 -0
- package/es/components/PisellCards/components/GraphicTextCard/hooks/useGraphicTextCardStyle.d.ts +18 -0
- package/es/components/PisellCards/components/GraphicTextCard/types.d.ts +290 -0
- package/es/components/PisellCards/components/GraphicTextCard/utils/index.d.ts +19 -0
- package/es/components/PisellCards/components/PisellImageCard/PisellImageCard.d.ts +1 -0
- package/es/components/PisellCards/components/TextCard/TextCard.d.ts +7 -0
- package/es/components/PisellCards/components/TextCard/components/BadgeWrapper.d.ts +26 -0
- package/es/components/PisellCards/components/TextCard/components/IconWrapper.d.ts +17 -0
- package/es/components/PisellCards/components/TextCard/components/TextContent.d.ts +21 -0
- package/es/components/PisellCards/components/TextCard/components/index.d.ts +6 -0
- package/es/components/PisellCards/components/TextCard/index.d.ts +5 -0
- package/es/components/PisellCards/components/TextCard/types.d.ts +270 -0
- package/es/components/PisellMetrics/index.d.ts +1 -0
- package/es/components/PisellProcedure/PisellProcedure.stories.d.ts +163 -0
- package/es/components/PisellProcedure/index.d.ts +5 -0
- package/es/components/colorPicker/index.d.ts +1 -0
- package/es/components/dataSourceComponents/dataSourceForm/BaseForm.js +27 -19
- package/es/components/dataSourceComponents/dataSourceForm/formItem.d.ts +1 -0
- package/es/components/dataSourceComponents/dataSourceForm/provider/formSetting/FormSettingContext.d.ts +2 -0
- package/es/components/dataSourceComponents/dataSourceForm/provider/formSetting/FormSettingProvider.js +7 -3
- package/es/components/dataSourceComponents/dataSourceForm/serve.d.ts +23 -0
- package/es/components/dataSourceComponents/dataSourceForm/serve.js +99 -0
- package/es/components/dataSourceComponents/dataSourceForm/submitButton/index.js +35 -20
- package/es/components/dataSourceComponents/dataSourceForm/type.d.ts +2 -0
- package/es/components/dataSourceComponents/dataSourceTable/BaseTable.js +1 -1
- package/es/components/dataSourceComponents/dataSourceTable/filter/utils.d.ts +1 -0
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useDataSourceKey.d.ts +1 -0
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.d.ts +1 -0
- package/es/components/dataSourceComponents/fields/ColorPicker/ReadPretty.d.ts +1 -0
- package/es/components/dataSourceComponents/fields/DateRangePicker/ReadPretty.d.ts +1 -0
- package/es/components/dataSourceComponents/fields/IconSelect/ReadPretty.d.ts +1 -0
- package/es/components/dataSourceComponents/fields/Input/ReadPretty.d.ts +1 -0
- package/es/components/dataSourceComponents/fields/Input.Email/ReadPretty.d.ts +1 -0
- package/es/components/dataSourceComponents/fields/Input.Json/ReadPretty.d.ts +1 -0
- package/es/components/dataSourceComponents/fields/Input.Password/ReadPretty.d.ts +1 -0
- package/es/components/dataSourceComponents/fields/Input.Subdomain/ReadPretty.d.ts +1 -0
- package/es/components/dataSourceComponents/fields/Input.TextArea/ReadPretty.d.ts +1 -0
- package/es/components/dataSourceComponents/fields/Input.Url/ReadPretty.d.ts +1 -0
- package/es/components/dataSourceComponents/fields/TimePicker/ReadPretty.d.ts +1 -0
- package/es/components/dataSourceComponents/fields/Upload/ReadPretty.d.ts +1 -0
- package/es/components/dataSourceComponents/fields/index.d.ts +6 -6
- package/es/components/dataSourceComponents/hooks/useActions.js +1 -1
- package/es/components/dataSourceComponents/provider/dataSource/DataSourceContext.d.ts +1 -0
- package/es/components/date-picker/datePickerCpt.d.ts +1 -0
- package/es/components/filter/components/Dropdown/types.d.ts +13 -0
- package/es/components/filter/components/FilterButton/types.d.ts +24 -0
- package/es/components/filter/components/items/index.d.ts +1 -0
- package/es/components/filter/components/items/text/Editor/index.d.ts +1 -0
- package/es/components/filter/components/items/text/Preview/index.d.ts +1 -0
- package/es/components/filter/components/items/text/index.d.ts +1 -0
- package/es/components/filter/index.d.ts +1 -0
- package/es/components/filter/types.d.ts +48 -0
- package/es/components/list/index.d.ts +1 -0
- package/es/components/lowCodePage/index.d.ts +1 -0
- package/es/components/pisellAdjustPrice/PisellAdjustPriceInputNumber.d.ts +1 -0
- package/es/components/pisellDataSourceContainer/hooks/useDataSourceKey.d.ts +1 -0
- package/es/components/pisellDataSourceContainer/hooks/useHandleAction.d.ts +32 -0
- package/es/components/pisellDataSourceContainer/provider/ChildComponentProps.d.ts +13 -0
- package/es/components/pisellDataSourceContainer/provider/RefManager.d.ts +9 -0
- package/es/components/pisellDataSourceContainer/type.d.ts +84 -0
- package/es/components/pisellDatePicker/index.d.ts +1 -0
- package/es/components/pisellGridPro/index.d.ts +4 -0
- package/es/components/pisellLoading/index.d.ts +1 -0
- package/es/components/pisellLookup/PisellLookup.d.ts +4 -0
- package/es/components/pisellLookup/components/LookupResultHost.d.ts +7 -0
- package/es/components/pisellQuickFilter/index.d.ts +11 -0
- package/es/components/pisellQuickFilter/type.d.ts +12 -0
- package/es/components/pisellSort/index.d.ts +4 -0
- package/es/components/productCard/components/AmountFooter/index.d.ts +1 -0
- package/es/components/productCard/components/Header/DeleteButton/index.d.ts +0 -1
- package/es/components/productCard/components/MultiDay/index.d.ts +1 -0
- package/es/components/productCard/components/Note/index.d.ts +1 -0
- package/es/components/productCard/components/Packages/components/collapsibleList/utils.d.ts +1 -0
- package/es/components/productCard/components/Packages/components/options/index.d.ts +1 -0
- package/es/components/productCard/components/Packages/index.d.ts +1 -0
- package/es/components/productCard/components/Time/components/SelectResource/index.d.ts +1 -0
- package/es/components/qrcode/index.d.ts +1 -0
- package/es/components/table/Actions/component/ExportImport/components/ExportFile/index.d.ts +1 -0
- package/es/components/table/Actions/component/ExportImport/components/ImportLog/index.d.ts +1 -0
- package/es/components/table/Actions/component/ExportImport/index.d.ts +1 -0
- package/es/components/table/Actions/component/ViewMode/index.d.ts +9 -0
- package/es/components/table/Gallery/components/GalleryItem/components/RenderFields/index.d.ts +1 -0
- package/es/components/table/Table/fields/date/Show/index.d.ts +1 -0
- package/es/components/table/Table/fields/link/Show/index.d.ts +1 -0
- package/es/components/table/Table/fields/select/index.d.ts +1 -0
- package/es/components/table/Table/fields/treeSelect/index.d.ts +1 -0
- package/es/components/table/Table/tableConfig/SortRow/index.d.ts +1 -0
- package/es/components/table/Table/tableConfig/summary/index.d.ts +1 -0
- package/es/components/table/Table/utils.d.ts +1 -1
- package/es/components/table/View/index.d.ts +1 -0
- package/es/locales/en-US.d.ts +1 -0
- package/es/locales/en-US.js +1 -0
- package/es/locales/zh-CN.d.ts +1 -0
- package/es/locales/zh-CN.js +1 -0
- package/es/locales/zh-TW.d.ts +1 -0
- package/es/locales/zh-TW.js +1 -0
- package/lib/components/PisellCards/components/GraphicTextCard/components/BadgeWrapper.d.ts +5 -0
- package/lib/components/PisellCards/components/GraphicTextCard/components/TextContent.d.ts +27 -0
- package/lib/components/PisellCards/components/GraphicTextCard/hooks/index.d.ts +5 -0
- package/lib/components/PisellCards/components/GraphicTextCard/hooks/useGraphicTextCardClick.d.ts +15 -0
- package/lib/components/PisellCards/components/GraphicTextCard/hooks/useGraphicTextCardStyle.d.ts +18 -0
- package/lib/components/PisellCards/components/GraphicTextCard/types.d.ts +290 -0
- package/lib/components/PisellCards/components/GraphicTextCard/utils/index.d.ts +19 -0
- package/lib/components/PisellCards/components/PisellImageCard/PisellImageCard.d.ts +1 -0
- package/lib/components/PisellCards/components/TextCard/TextCard.d.ts +7 -0
- package/lib/components/PisellCards/components/TextCard/components/BadgeWrapper.d.ts +26 -0
- package/lib/components/PisellCards/components/TextCard/components/IconWrapper.d.ts +17 -0
- package/lib/components/PisellCards/components/TextCard/components/TextContent.d.ts +21 -0
- package/lib/components/PisellCards/components/TextCard/components/index.d.ts +6 -0
- package/lib/components/PisellCards/components/TextCard/index.d.ts +5 -0
- package/lib/components/PisellCards/components/TextCard/types.d.ts +270 -0
- package/lib/components/PisellMetrics/index.d.ts +1 -0
- package/lib/components/PisellProcedure/PisellProcedure.stories.d.ts +163 -0
- package/lib/components/PisellProcedure/index.d.ts +5 -0
- package/lib/components/colorPicker/index.d.ts +1 -0
- package/lib/components/dataSourceComponents/dataSourceForm/BaseForm.js +26 -13
- package/lib/components/dataSourceComponents/dataSourceForm/formItem.d.ts +1 -0
- package/lib/components/dataSourceComponents/dataSourceForm/provider/formSetting/FormSettingContext.d.ts +2 -0
- package/lib/components/dataSourceComponents/dataSourceForm/provider/formSetting/FormSettingProvider.js +7 -3
- package/lib/components/dataSourceComponents/dataSourceForm/serve.d.ts +23 -0
- package/lib/components/dataSourceComponents/dataSourceForm/serve.js +69 -1
- package/lib/components/dataSourceComponents/dataSourceForm/submitButton/index.js +8 -1
- package/lib/components/dataSourceComponents/dataSourceForm/type.d.ts +2 -0
- package/lib/components/dataSourceComponents/dataSourceTable/BaseTable.js +1 -1
- package/lib/components/dataSourceComponents/dataSourceTable/filter/utils.d.ts +1 -0
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useDataSourceKey.d.ts +1 -0
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.d.ts +1 -0
- package/lib/components/dataSourceComponents/fields/ColorPicker/ReadPretty.d.ts +1 -0
- package/lib/components/dataSourceComponents/fields/DateRangePicker/ReadPretty.d.ts +1 -0
- package/lib/components/dataSourceComponents/fields/IconSelect/ReadPretty.d.ts +1 -0
- package/lib/components/dataSourceComponents/fields/Input/ReadPretty.d.ts +1 -0
- package/lib/components/dataSourceComponents/fields/Input.Email/ReadPretty.d.ts +1 -0
- package/lib/components/dataSourceComponents/fields/Input.Json/ReadPretty.d.ts +1 -0
- package/lib/components/dataSourceComponents/fields/Input.Password/ReadPretty.d.ts +1 -0
- package/lib/components/dataSourceComponents/fields/Input.Subdomain/ReadPretty.d.ts +1 -0
- package/lib/components/dataSourceComponents/fields/Input.TextArea/ReadPretty.d.ts +1 -0
- package/lib/components/dataSourceComponents/fields/Input.Url/ReadPretty.d.ts +1 -0
- package/lib/components/dataSourceComponents/fields/TimePicker/ReadPretty.d.ts +1 -0
- package/lib/components/dataSourceComponents/fields/Upload/ReadPretty.d.ts +1 -0
- package/lib/components/dataSourceComponents/fields/index.d.ts +6 -6
- package/lib/components/dataSourceComponents/hooks/useActions.js +1 -1
- package/lib/components/dataSourceComponents/provider/dataSource/DataSourceContext.d.ts +1 -0
- package/lib/components/date-picker/datePickerCpt.d.ts +1 -0
- package/lib/components/filter/components/Dropdown/types.d.ts +13 -0
- package/lib/components/filter/components/FilterButton/types.d.ts +24 -0
- package/lib/components/filter/components/items/index.d.ts +1 -0
- package/lib/components/filter/components/items/text/Editor/index.d.ts +1 -0
- package/lib/components/filter/components/items/text/Preview/index.d.ts +1 -0
- package/lib/components/filter/components/items/text/index.d.ts +1 -0
- package/lib/components/filter/index.d.ts +1 -0
- package/lib/components/filter/types.d.ts +48 -0
- package/lib/components/list/index.d.ts +1 -0
- package/lib/components/lowCodePage/index.d.ts +1 -0
- package/lib/components/pisellAdjustPrice/PisellAdjustPriceInputNumber.d.ts +1 -0
- package/lib/components/pisellDataSourceContainer/hooks/useDataSourceKey.d.ts +1 -0
- package/lib/components/pisellDataSourceContainer/hooks/useHandleAction.d.ts +32 -0
- package/lib/components/pisellDataSourceContainer/provider/ChildComponentProps.d.ts +13 -0
- package/lib/components/pisellDataSourceContainer/provider/RefManager.d.ts +9 -0
- package/lib/components/pisellDataSourceContainer/type.d.ts +84 -0
- package/lib/components/pisellDatePicker/index.d.ts +1 -0
- package/lib/components/pisellGridPro/index.d.ts +4 -0
- package/lib/components/pisellLoading/index.d.ts +1 -0
- package/lib/components/pisellLookup/PisellLookup.d.ts +4 -0
- package/lib/components/pisellLookup/components/LookupResultHost.d.ts +7 -0
- package/lib/components/pisellQuickFilter/index.d.ts +11 -0
- package/lib/components/pisellQuickFilter/type.d.ts +12 -0
- package/lib/components/pisellSort/index.d.ts +4 -0
- package/lib/components/productCard/components/AmountFooter/index.d.ts +1 -0
- package/lib/components/productCard/components/Header/DeleteButton/index.d.ts +0 -1
- package/lib/components/productCard/components/MultiDay/index.d.ts +1 -0
- package/lib/components/productCard/components/Note/index.d.ts +1 -0
- package/lib/components/productCard/components/Packages/components/collapsibleList/utils.d.ts +1 -0
- package/lib/components/productCard/components/Packages/components/options/index.d.ts +1 -0
- package/lib/components/productCard/components/Packages/index.d.ts +1 -0
- package/lib/components/productCard/components/Time/components/SelectResource/index.d.ts +1 -0
- package/lib/components/qrcode/index.d.ts +1 -0
- package/lib/components/table/Actions/component/ExportImport/components/ExportFile/index.d.ts +1 -0
- package/lib/components/table/Actions/component/ExportImport/components/ImportLog/index.d.ts +1 -0
- package/lib/components/table/Actions/component/ExportImport/index.d.ts +1 -0
- package/lib/components/table/Actions/component/ViewMode/index.d.ts +9 -0
- package/lib/components/table/Gallery/components/GalleryItem/components/RenderFields/index.d.ts +1 -0
- package/lib/components/table/Table/fields/date/Show/index.d.ts +1 -0
- package/lib/components/table/Table/fields/link/Show/index.d.ts +1 -0
- package/lib/components/table/Table/fields/select/index.d.ts +1 -0
- package/lib/components/table/Table/fields/treeSelect/index.d.ts +1 -0
- package/lib/components/table/Table/tableConfig/SortRow/index.d.ts +1 -0
- package/lib/components/table/Table/tableConfig/summary/index.d.ts +1 -0
- package/lib/components/table/Table/utils.d.ts +1 -1
- package/lib/components/table/View/index.d.ts +1 -0
- package/lib/locales/en-US.d.ts +1 -0
- package/lib/locales/en-US.js +1 -0
- package/lib/locales/zh-CN.d.ts +1 -0
- package/lib/locales/zh-CN.js +1 -0
- package/lib/locales/zh-TW.d.ts +1 -0
- package/lib/locales/zh-TW.js +1 -0
- package/lowcode/data-source-form/meta.ts +43 -0
- package/lowcode/data-source-form/utils.ts +21 -2
- package/lowcode/data-source-table/meta.ts +51 -45
- package/package.json +2 -2
- package/es/components/auto-resize-text/auto-text-size-standalone.d.ts +0 -20
- package/es/components/auto-resize-text/index.d.ts +0 -6
- package/es/components/config-provider/index.d.ts +0 -10
- package/es/components/dataSourceComponents/fields/Switch/ReadPretty.d.ts +0 -5
- package/es/components/dataSourceComponents/fields/Switch/type.d.ts +0 -16
- package/es/components/dataSourceComponents/fields/Upload/constants.d.ts +0 -9
- package/es/components/translation/utils.d.ts +0 -9
- package/lib/components/auto-resize-text/auto-text-size-standalone.d.ts +0 -20
- package/lib/components/auto-resize-text/index.d.ts +0 -6
- package/lib/components/config-provider/index.d.ts +0 -10
- package/lib/components/dataSourceComponents/fields/Switch/ReadPretty.d.ts +0 -5
- package/lib/components/dataSourceComponents/fields/Switch/type.d.ts +0 -16
- package/lib/components/dataSourceComponents/fields/Upload/constants.d.ts +0 -9
- package/lib/components/translation/utils.d.ts +0 -9
- package/lowcode/pisell-record-board-calendar-view/meta.ts +0 -1569
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
import { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
import { PisellBasicCardProps } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* 样式变体类型
|
|
5
|
+
*/
|
|
6
|
+
export declare type TextCardVariant = 'text' | 'filled' | 'outlined' | 'light' | 'gradient' | 'dashed';
|
|
7
|
+
/**
|
|
8
|
+
* 尺寸类型
|
|
9
|
+
*/
|
|
10
|
+
export declare type TextCardSize = 'small' | 'default' | 'large';
|
|
11
|
+
/**
|
|
12
|
+
* 宽度模式
|
|
13
|
+
*/
|
|
14
|
+
export declare type TextCardWidthMode = 'auto' | 'fixed' | 'full';
|
|
15
|
+
/**
|
|
16
|
+
* 图标配置
|
|
17
|
+
*/
|
|
18
|
+
export interface IconConfig {
|
|
19
|
+
/**
|
|
20
|
+
* 图标大小(单位:px)
|
|
21
|
+
*/
|
|
22
|
+
size?: number;
|
|
23
|
+
/**
|
|
24
|
+
* 图标颜色
|
|
25
|
+
*/
|
|
26
|
+
color?: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* 标签配置
|
|
30
|
+
*/
|
|
31
|
+
export interface TagConfig {
|
|
32
|
+
/**
|
|
33
|
+
* 标签颜色
|
|
34
|
+
*/
|
|
35
|
+
color?: string;
|
|
36
|
+
/**
|
|
37
|
+
* 标签自定义样式
|
|
38
|
+
*/
|
|
39
|
+
style?: CSSProperties;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* 角标类型
|
|
43
|
+
*/
|
|
44
|
+
export declare type BadgeType = 'dot' | 'number' | 'text';
|
|
45
|
+
/**
|
|
46
|
+
* 角标位置
|
|
47
|
+
*/
|
|
48
|
+
export declare type BadgePosition = 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left';
|
|
49
|
+
/**
|
|
50
|
+
* 角标配置
|
|
51
|
+
*/
|
|
52
|
+
export interface BadgeConfig {
|
|
53
|
+
/**
|
|
54
|
+
* 角标类型
|
|
55
|
+
* @default 'dot'
|
|
56
|
+
*/
|
|
57
|
+
type?: BadgeType;
|
|
58
|
+
/**
|
|
59
|
+
* 角标内容(数字或文本)
|
|
60
|
+
* 当 type 为 'number' 或 'text' 时有效
|
|
61
|
+
*/
|
|
62
|
+
content?: ReactNode;
|
|
63
|
+
/**
|
|
64
|
+
* 角标位置
|
|
65
|
+
* @default 'top-right'
|
|
66
|
+
*/
|
|
67
|
+
position?: BadgePosition;
|
|
68
|
+
/**
|
|
69
|
+
* 角标偏移量 [x, y]
|
|
70
|
+
* 正数向右/下偏移,负数向左/上偏移
|
|
71
|
+
*/
|
|
72
|
+
offset?: [number, number];
|
|
73
|
+
/**
|
|
74
|
+
* 角标颜色
|
|
75
|
+
*/
|
|
76
|
+
color?: string;
|
|
77
|
+
/**
|
|
78
|
+
* 角标自定义样式
|
|
79
|
+
*/
|
|
80
|
+
style?: CSSProperties;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* 文本配置
|
|
84
|
+
*/
|
|
85
|
+
export interface TextConfig {
|
|
86
|
+
/**
|
|
87
|
+
* 字体大小(单位:px)
|
|
88
|
+
*/
|
|
89
|
+
fontSize?: number;
|
|
90
|
+
/**
|
|
91
|
+
* 字体粗细
|
|
92
|
+
*/
|
|
93
|
+
fontWeight?: string | number;
|
|
94
|
+
/**
|
|
95
|
+
* 文本颜色
|
|
96
|
+
*/
|
|
97
|
+
color?: string;
|
|
98
|
+
/**
|
|
99
|
+
* 最大显示行数
|
|
100
|
+
* @default 1
|
|
101
|
+
*/
|
|
102
|
+
maxLines?: number;
|
|
103
|
+
/**
|
|
104
|
+
* 是否显示省略号
|
|
105
|
+
* @default true
|
|
106
|
+
*/
|
|
107
|
+
ellipsis?: boolean;
|
|
108
|
+
/**
|
|
109
|
+
* 文本对齐方式
|
|
110
|
+
* @default 'left'
|
|
111
|
+
*/
|
|
112
|
+
textAlign?: 'left' | 'center' | 'right';
|
|
113
|
+
flex?: string;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* TextCard 组件 Props
|
|
117
|
+
* 基于 PisellBasicCardProps 扩展
|
|
118
|
+
* 注意:重写 onClick 为可选属性
|
|
119
|
+
*/
|
|
120
|
+
export interface TextCardProps extends Omit<PisellBasicCardProps, 'onClick'> {
|
|
121
|
+
/**
|
|
122
|
+
* 卡片显示的文本内容(必填)
|
|
123
|
+
*/
|
|
124
|
+
text: ReactNode;
|
|
125
|
+
/**
|
|
126
|
+
* 卡片样式变体
|
|
127
|
+
* @default 'text'
|
|
128
|
+
*/
|
|
129
|
+
variant?: TextCardVariant;
|
|
130
|
+
/**
|
|
131
|
+
* 卡片尺寸
|
|
132
|
+
* @default 'default'
|
|
133
|
+
*/
|
|
134
|
+
size?: TextCardSize;
|
|
135
|
+
/**
|
|
136
|
+
* 是否可点击
|
|
137
|
+
* @default true
|
|
138
|
+
*/
|
|
139
|
+
clickable?: boolean;
|
|
140
|
+
/**
|
|
141
|
+
* 前置图标
|
|
142
|
+
* 支持 ReactNode(如 antd Icon、svg 等)
|
|
143
|
+
*/
|
|
144
|
+
prefixIcon?: ReactNode;
|
|
145
|
+
/**
|
|
146
|
+
* 后置图标
|
|
147
|
+
* 支持 ReactNode(如 antd Icon、svg 等)
|
|
148
|
+
*/
|
|
149
|
+
suffixIcon?: ReactNode;
|
|
150
|
+
/**
|
|
151
|
+
* 图标配置
|
|
152
|
+
* 统一配置前置和后置图标的大小和颜色
|
|
153
|
+
*/
|
|
154
|
+
iconConfig?: IconConfig;
|
|
155
|
+
/**
|
|
156
|
+
* 后置标签
|
|
157
|
+
* 支持 ReactNode(如 antd Tag、Badge 等)
|
|
158
|
+
*/
|
|
159
|
+
tag?: ReactNode;
|
|
160
|
+
/**
|
|
161
|
+
* 标签配置
|
|
162
|
+
*/
|
|
163
|
+
tagConfig?: TagConfig;
|
|
164
|
+
/**
|
|
165
|
+
* 角标配置
|
|
166
|
+
* 用于显示红点、数字或文本提示
|
|
167
|
+
*/
|
|
168
|
+
badge?: BadgeConfig;
|
|
169
|
+
/**
|
|
170
|
+
* 前置插槽
|
|
171
|
+
* 用于替换前置图标,优先级高于 prefixIcon
|
|
172
|
+
*/
|
|
173
|
+
prefixSlot?: ReactNode;
|
|
174
|
+
/**
|
|
175
|
+
* 后置插槽
|
|
176
|
+
* 用于替换后置图标和标签,优先级高于 suffixIcon 和 tag
|
|
177
|
+
*/
|
|
178
|
+
suffixSlot?: ReactNode;
|
|
179
|
+
/**
|
|
180
|
+
* 文本配置
|
|
181
|
+
* 用于自定义文本样式和显示行为
|
|
182
|
+
*/
|
|
183
|
+
textConfig?: TextConfig;
|
|
184
|
+
/**
|
|
185
|
+
* 宽度模式
|
|
186
|
+
* - auto: 内容撑满,最大宽度 maxWidth
|
|
187
|
+
* - fixed: 固定宽度 width
|
|
188
|
+
* - full: 撑满父容器,最小宽度 28px
|
|
189
|
+
* @default 'auto'
|
|
190
|
+
*/
|
|
191
|
+
widthMode?: TextCardWidthMode;
|
|
192
|
+
/**
|
|
193
|
+
* 固定宽度值
|
|
194
|
+
* 当 widthMode='fixed' 时有效
|
|
195
|
+
*/
|
|
196
|
+
width?: number | string;
|
|
197
|
+
/**
|
|
198
|
+
* 最大宽度
|
|
199
|
+
* 当 widthMode='auto' 时有效
|
|
200
|
+
* @default 400
|
|
201
|
+
*/
|
|
202
|
+
maxWidth?: number | string;
|
|
203
|
+
/**
|
|
204
|
+
* 点击事件
|
|
205
|
+
* 当 clickable=true 且不在 disabled/loading 状态时触发
|
|
206
|
+
* 注意:PisellBasicCardProps 中的 onClick 是必填的,这里重新定义为可选
|
|
207
|
+
*/
|
|
208
|
+
onClick?: (event: React.MouseEvent<HTMLDivElement>) => void;
|
|
209
|
+
/**
|
|
210
|
+
* 自定义渲染函数
|
|
211
|
+
* 完全自定义组件的渲染内容
|
|
212
|
+
* 当提供此函数时,组件内置的渲染逻辑将被忽略
|
|
213
|
+
*/
|
|
214
|
+
render?: (props: TextCardProps) => ReactNode;
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* TextContent 组件 Props
|
|
218
|
+
* 文本内容子组件
|
|
219
|
+
*/
|
|
220
|
+
export interface TextContentProps {
|
|
221
|
+
/**
|
|
222
|
+
* 文本内容
|
|
223
|
+
*/
|
|
224
|
+
text: ReactNode;
|
|
225
|
+
/**
|
|
226
|
+
* 文本配置
|
|
227
|
+
*/
|
|
228
|
+
textConfig?: TextConfig;
|
|
229
|
+
/**
|
|
230
|
+
* 自定义类名
|
|
231
|
+
*/
|
|
232
|
+
className?: string;
|
|
233
|
+
active?: PisellBasicCardProps['active'];
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* IconWrapper 组件 Props
|
|
237
|
+
* 图标包装子组件
|
|
238
|
+
*/
|
|
239
|
+
export interface IconWrapperProps {
|
|
240
|
+
/**
|
|
241
|
+
* 图标内容
|
|
242
|
+
*/
|
|
243
|
+
icon: ReactNode;
|
|
244
|
+
/**
|
|
245
|
+
* 图标配置
|
|
246
|
+
*/
|
|
247
|
+
config?: IconConfig;
|
|
248
|
+
/**
|
|
249
|
+
* 图标位置
|
|
250
|
+
*/
|
|
251
|
+
position: 'prefix' | 'suffix';
|
|
252
|
+
/**
|
|
253
|
+
* 自定义类名
|
|
254
|
+
*/
|
|
255
|
+
className?: string;
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* BadgeWrapper 组件 Props
|
|
259
|
+
* 角标包装子组件
|
|
260
|
+
*/
|
|
261
|
+
export interface BadgeWrapperProps {
|
|
262
|
+
/**
|
|
263
|
+
* 角标配置
|
|
264
|
+
*/
|
|
265
|
+
badge?: BadgeConfig;
|
|
266
|
+
/**
|
|
267
|
+
* 子元素
|
|
268
|
+
*/
|
|
269
|
+
children: ReactNode;
|
|
270
|
+
}
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
* />
|
|
14
14
|
* <PisellMetrics.StatisticList data={[...]} />
|
|
15
15
|
*/
|
|
16
|
+
/// <reference types="react" />
|
|
16
17
|
declare const PisellMetrics: {
|
|
17
18
|
MetricCard: import("react").FC<import("../pisellMetricCard").PisellMetricCardProps>;
|
|
18
19
|
StatisticList: (props: import("../pisellStatisticList").PisellStatisticListProps) => JSX.Element;
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import PisellProcedure from './PisellProcedure';
|
|
3
|
+
/**
|
|
4
|
+
* PisellProcedure 流程容器组件
|
|
5
|
+
*
|
|
6
|
+
* 用于管理多步骤流程的复合容器组件,基于 PisellLayout 实现三段式布局
|
|
7
|
+
* 包含头部区域(步骤条)、主体区域(内容区+信息区)、底部区域(操作按钮)
|
|
8
|
+
*/
|
|
9
|
+
declare const meta: Meta<typeof PisellProcedure>;
|
|
10
|
+
export default meta;
|
|
11
|
+
declare type Story = StoryObj<typeof PisellProcedure>;
|
|
12
|
+
/**
|
|
13
|
+
* 基础用法
|
|
14
|
+
* @description 默认流程容器,包含头部、主体、底部三个区域
|
|
15
|
+
*/
|
|
16
|
+
export declare const Default: Story;
|
|
17
|
+
/**
|
|
18
|
+
* 页面模式
|
|
19
|
+
* @description 默认模式,支持响应式和移动端适配
|
|
20
|
+
*/
|
|
21
|
+
export declare const PageMode: Story;
|
|
22
|
+
/**
|
|
23
|
+
* 弹窗模式
|
|
24
|
+
* @description 用于弹窗场景,不应用移动端适配
|
|
25
|
+
*/
|
|
26
|
+
export declare const ModalMode: Story;
|
|
27
|
+
/**
|
|
28
|
+
* 步骤控制
|
|
29
|
+
* @description 使用 onStepsChange 监听步骤变化
|
|
30
|
+
*/
|
|
31
|
+
export declare const StepControl: Story;
|
|
32
|
+
/**
|
|
33
|
+
* 步骤拦截
|
|
34
|
+
* @description 通过 onNext/onPrev 返回 false 阻止步骤切换
|
|
35
|
+
*/
|
|
36
|
+
export declare const StepIntercept: Story;
|
|
37
|
+
/**
|
|
38
|
+
* 无侧边栏
|
|
39
|
+
*/
|
|
40
|
+
export declare const WithoutSidebar: Story;
|
|
41
|
+
/**
|
|
42
|
+
* 无头部
|
|
43
|
+
*/
|
|
44
|
+
export declare const WithoutHeader: Story;
|
|
45
|
+
/**
|
|
46
|
+
* 无底部
|
|
47
|
+
*/
|
|
48
|
+
export declare const WithoutFooter: Story;
|
|
49
|
+
/**
|
|
50
|
+
* 最小配置
|
|
51
|
+
* @description 仅显示主体内容
|
|
52
|
+
*/
|
|
53
|
+
export declare const MinimalConfig: Story;
|
|
54
|
+
/**
|
|
55
|
+
* 头部插槽顺序 - 默认
|
|
56
|
+
* @description left 在左,right 在右
|
|
57
|
+
*/
|
|
58
|
+
export declare const HeaderSlotDefault: Story;
|
|
59
|
+
/**
|
|
60
|
+
* 头部插槽顺序 - 反转
|
|
61
|
+
* @description left 在右,right 在左
|
|
62
|
+
*/
|
|
63
|
+
export declare const HeaderSlotReverse: Story;
|
|
64
|
+
/**
|
|
65
|
+
* 隐藏步骤条
|
|
66
|
+
* @description 仅显示头部插槽,不显示步骤条
|
|
67
|
+
*/
|
|
68
|
+
export declare const HideSteps: Story;
|
|
69
|
+
/**
|
|
70
|
+
* 第一步显示返回按钮
|
|
71
|
+
* @description 通过 showBackOnFirstStep 控制
|
|
72
|
+
*/
|
|
73
|
+
export declare const ShowBackOnFirstStep: Story;
|
|
74
|
+
/**
|
|
75
|
+
* 返回确认弹窗
|
|
76
|
+
* @description 点击返回时弹出确认弹窗
|
|
77
|
+
*/
|
|
78
|
+
export declare const BackConfirmModal: Story;
|
|
79
|
+
/**
|
|
80
|
+
* 关闭确认弹窗
|
|
81
|
+
* @description 点击关闭时弹出确认弹窗
|
|
82
|
+
*/
|
|
83
|
+
export declare const CloseConfirmModal: Story;
|
|
84
|
+
/**
|
|
85
|
+
* 主体布局 - 比例布局
|
|
86
|
+
* @description 使用比例分配内容区和侧边栏宽度
|
|
87
|
+
*/
|
|
88
|
+
export declare const BodyRatioLayout: Story;
|
|
89
|
+
/**
|
|
90
|
+
* 主体布局 - 固定宽度
|
|
91
|
+
* @description 侧边栏使用固定宽度
|
|
92
|
+
*/
|
|
93
|
+
export declare const BodyFixedLayout: Story;
|
|
94
|
+
/**
|
|
95
|
+
* 主体布局 - 垂直布局
|
|
96
|
+
* @description 内容区和侧边栏上下排列
|
|
97
|
+
*/
|
|
98
|
+
export declare const BodyVerticalLayout: Story;
|
|
99
|
+
/**
|
|
100
|
+
* 主体布局 - 内容顺序反转
|
|
101
|
+
* @description 侧边栏在左/上,内容区在右/下
|
|
102
|
+
*/
|
|
103
|
+
export declare const BodyContentOrderReverse: Story;
|
|
104
|
+
/**
|
|
105
|
+
* 底部位置 - 悬浮在侧边栏
|
|
106
|
+
* @description 默认位置,底部悬浮在侧边栏区域
|
|
107
|
+
*/
|
|
108
|
+
export declare const FooterFloatSidebar: Story;
|
|
109
|
+
/**
|
|
110
|
+
* 底部位置 - 固定在整体底部
|
|
111
|
+
*/
|
|
112
|
+
export declare const FooterFixedBottom: Story;
|
|
113
|
+
/**
|
|
114
|
+
* 底部位置 - 悬浮在整体区域
|
|
115
|
+
* @description 移动端默认使用此模式
|
|
116
|
+
*/
|
|
117
|
+
export declare const FooterFloatAll: Story;
|
|
118
|
+
/**
|
|
119
|
+
* 底部位置 - 悬浮在内容区
|
|
120
|
+
*/
|
|
121
|
+
export declare const FooterFloatContent: Story;
|
|
122
|
+
/**
|
|
123
|
+
* 底部位置 - 内嵌在内容区底部
|
|
124
|
+
*/
|
|
125
|
+
export declare const FooterFixedContentBottom: Story;
|
|
126
|
+
/**
|
|
127
|
+
* 底部位置 - 内嵌在侧边栏底部
|
|
128
|
+
*/
|
|
129
|
+
export declare const FooterFixedSidebarBottom: Story;
|
|
130
|
+
/**
|
|
131
|
+
* 移动端总结按钮
|
|
132
|
+
* @description 移动端显示总结按钮,点击可查看侧边栏内容
|
|
133
|
+
*/
|
|
134
|
+
export declare const MobileSummaryButton: Story;
|
|
135
|
+
/**
|
|
136
|
+
* 溢出收纳功能
|
|
137
|
+
* @description 当宽度不足时,按钮会被收纳到 More 菜单中
|
|
138
|
+
*/
|
|
139
|
+
export declare const OverflowActions: Story;
|
|
140
|
+
/**
|
|
141
|
+
* 禁用溢出收纳
|
|
142
|
+
* @description 不启用溢出收纳,按钮会换行显示
|
|
143
|
+
*/
|
|
144
|
+
export declare const DisableOverflow: Story;
|
|
145
|
+
/**
|
|
146
|
+
* 完整示例 - 购物流程
|
|
147
|
+
* @description 模拟真实的购物流程
|
|
148
|
+
*/
|
|
149
|
+
export declare const ShoppingFlow: Story;
|
|
150
|
+
/**
|
|
151
|
+
* 完整示例 - 注册流程
|
|
152
|
+
* @description 模拟用户注册流程
|
|
153
|
+
*/
|
|
154
|
+
export declare const RegistrationFlow: Story;
|
|
155
|
+
/**
|
|
156
|
+
* 完整示例 - 表单向导
|
|
157
|
+
* @description 多步表单向导
|
|
158
|
+
*/
|
|
159
|
+
export declare const FormWizard: Story;
|
|
160
|
+
/**
|
|
161
|
+
* 交互测试 - 组件渲染
|
|
162
|
+
*/
|
|
163
|
+
export declare const InteractionTest: Story;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PisellProcedure 组件导出
|
|
3
|
+
*/
|
|
4
|
+
export { default } from './PisellProcedure';
|
|
5
|
+
export type { PisellProcedureProps, PisellProcedureRef, ProcedureHeaderProps, ProcedureBodyProps, ProcedureFooterProps, FooterPositionMode, BackConfirmModalConfig, BodyLayoutMode, BodyLayoutRatio, BodyDirection, StepItem, StepChangeResult, } from './types';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
var _excluded = ["title", "description", "dataSource", "showTitle", "showDescription", "groupInfoPosition", "variables", "renderMode", "children", "currentValue", "className", "onDataSourceFinish", "onDataSourceLoaded", "formatSubmitValues", "formatInitialValues", "customSubmit", "beforeSubmit", "leaveConfirmConfig"];
|
|
2
|
+
var _excluded = ["title", "description", "dataSource", "showTitle", "showDescription", "groupInfoPosition", "variables", "renderMode", "children", "currentValue", "className", "onDataSourceFinish", "onDataSourceLoaded", "formatSubmitValues", "formatInitialValues", "customSubmit", "beforeSubmit", "leaveConfirmConfig", "scene", "sceneRequestId"];
|
|
3
3
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
4
|
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
5
5
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
@@ -22,7 +22,7 @@ import Form from "../../form";
|
|
|
22
22
|
import FormSettingProvider from "./provider/formSetting/FormSettingProvider";
|
|
23
23
|
import PageHeader from "../../page-header";
|
|
24
24
|
import { transformFormObjToArrayWithUntouched } from "./utils";
|
|
25
|
-
import { getFormSettingMetaData } from "./serve";
|
|
25
|
+
import { getFormSettingMetaData, getDeviceSettingMetaData } from "./serve";
|
|
26
26
|
import useFormSettingParams from "../hooks/useFormSettingParams";
|
|
27
27
|
import "./index.less";
|
|
28
28
|
import { isArr } from "@pisell/utils";
|
|
@@ -31,7 +31,7 @@ import { isArr } from "@pisell/utils";
|
|
|
31
31
|
* @description: 基于数据源动态生成表单,支持编辑、查看、禁用三种模式
|
|
32
32
|
*/
|
|
33
33
|
var BaseForm = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
34
|
-
var _context$appHelper;
|
|
34
|
+
var _context$pageContext, _context$appHelper;
|
|
35
35
|
var title = props.title,
|
|
36
36
|
description = props.description,
|
|
37
37
|
dataSource = props.dataSource,
|
|
@@ -50,8 +50,11 @@ var BaseForm = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
50
50
|
customSubmit = props.customSubmit,
|
|
51
51
|
beforeSubmit = props.beforeSubmit,
|
|
52
52
|
leaveConfirmConfig = props.leaveConfirmConfig,
|
|
53
|
+
scene = props.scene,
|
|
54
|
+
sceneRequestId = props.sceneRequestId,
|
|
53
55
|
others = _objectWithoutProperties(props, _excluded);
|
|
54
56
|
var context = useEngineContext();
|
|
57
|
+
console.log('context_pageProps', context === null || context === void 0 || (_context$pageContext = context.pageContext) === null || _context$pageContext === void 0 ? void 0 : _context$pageContext.props);
|
|
55
58
|
var _useCtxActions = useCtxActions(),
|
|
56
59
|
setBeforeClose = _useCtxActions.setBeforeClose;
|
|
57
60
|
var _context$appHelper$ut = (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.utils,
|
|
@@ -77,25 +80,28 @@ var BaseForm = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
77
80
|
});
|
|
78
81
|
useDeepCompareEffect(function () {
|
|
79
82
|
if (['edit', 'view'].includes(renderMode || '') && dataSource) {
|
|
80
|
-
if (dataSource !== null && dataSource !== void 0 && dataSource.fromSettingMeta) {
|
|
81
|
-
var _dataSource$fields;
|
|
83
|
+
if (dataSource !== null && dataSource !== void 0 && dataSource.fromSettingMeta || dataSource !== null && dataSource !== void 0 && dataSource.fromDeviceSettingMeta) {
|
|
84
|
+
var _dataSource$fields, _dataSource$fields2;
|
|
82
85
|
if (props.__designMode === 'design') return;
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
getFormSettingMetaData({
|
|
90
|
-
sectionCodes:
|
|
86
|
+
var fetchMetaData = dataSource !== null && dataSource !== void 0 && dataSource.fromDeviceSettingMeta ? getDeviceSettingMetaData({
|
|
87
|
+
scene: scene,
|
|
88
|
+
sceneRequestId: sceneRequestId || '',
|
|
89
|
+
items: (dataSource === null || dataSource === void 0 || (_dataSource$fields = dataSource.fields) === null || _dataSource$fields === void 0 ? void 0 : _dataSource$fields.map(function (field) {
|
|
90
|
+
return field.name;
|
|
91
|
+
})) || []
|
|
92
|
+
}) : getFormSettingMetaData({
|
|
93
|
+
sectionCodes: Array.from(new Set(dataSource === null || dataSource === void 0 || (_dataSource$fields2 = dataSource.fields) === null || _dataSource$fields2 === void 0 ? void 0 : _dataSource$fields2.map(function (field) {
|
|
94
|
+
return field.name.split('.').shift();
|
|
95
|
+
}))),
|
|
91
96
|
scope: scope,
|
|
92
97
|
target: target
|
|
93
|
-
})
|
|
94
|
-
|
|
98
|
+
});
|
|
99
|
+
fetchMetaData.then(function (res) {
|
|
100
|
+
var _dataSource$fields3, _formRef$current2;
|
|
95
101
|
var formattedValues = formatInitialValues ? formatInitialValues(res.data) : res.data || {};
|
|
96
102
|
|
|
97
103
|
// 根据 dataSource.fields 筛选 formattedValues
|
|
98
|
-
var fieldNames = new Set((dataSource === null || dataSource === void 0 || (_dataSource$
|
|
104
|
+
var fieldNames = new Set((dataSource === null || dataSource === void 0 || (_dataSource$fields3 = dataSource.fields) === null || _dataSource$fields3 === void 0 ? void 0 : _dataSource$fields3.map(function (field) {
|
|
99
105
|
return field.name;
|
|
100
106
|
})) || []);
|
|
101
107
|
var filteredValues = Object.keys(formattedValues).reduce(function (acc, key) {
|
|
@@ -116,9 +122,9 @@ var BaseForm = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
116
122
|
var formattedValues = formatInitialValues ? formatInitialValues(res) : res;
|
|
117
123
|
var values = formattedValues;
|
|
118
124
|
if (isArr(dataSource === null || dataSource === void 0 ? void 0 : dataSource.fields)) {
|
|
119
|
-
var _dataSource$
|
|
125
|
+
var _dataSource$fields4;
|
|
120
126
|
// 根据 dataSource.fields 筛选 formattedValues
|
|
121
|
-
var fieldNames = new Set((dataSource === null || dataSource === void 0 || (_dataSource$
|
|
127
|
+
var fieldNames = new Set((dataSource === null || dataSource === void 0 || (_dataSource$fields4 = dataSource.fields) === null || _dataSource$fields4 === void 0 ? void 0 : _dataSource$fields4.map(function (field) {
|
|
122
128
|
return field.name;
|
|
123
129
|
})) || []);
|
|
124
130
|
values = Object.keys(formattedValues).reduce(function (acc, key) {
|
|
@@ -218,7 +224,9 @@ var BaseForm = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
218
224
|
formatSubmitValues: formatSubmitValues,
|
|
219
225
|
formatInitialValues: formatInitialValues,
|
|
220
226
|
customSubmit: customSubmit,
|
|
221
|
-
beforeSubmit: beforeSubmit
|
|
227
|
+
beforeSubmit: beforeSubmit,
|
|
228
|
+
scene: scene,
|
|
229
|
+
sceneRequestId: sceneRequestId
|
|
222
230
|
}, /*#__PURE__*/React.createElement(Form, _extends({}, others, {
|
|
223
231
|
className: classNames('pisell-lowcode-data-source-form', className),
|
|
224
232
|
ref: formRef,
|
|
@@ -11,6 +11,8 @@ export interface FormSettingContextType {
|
|
|
11
11
|
formatInitialValues?: (values: Record<string, any>) => Record<string, any>;
|
|
12
12
|
customSubmit?: (values: Record<string, any>) => Promise<any>;
|
|
13
13
|
beforeSubmit?: (values: Record<string, any>) => Promise<boolean> | boolean;
|
|
14
|
+
scene?: 'template' | 'profile' | 'instance';
|
|
15
|
+
sceneRequestId?: string;
|
|
14
16
|
}
|
|
15
17
|
export declare const FormSettingContext: import("react").Context<FormSettingContextType>;
|
|
16
18
|
export default FormSettingContext;
|
|
@@ -15,7 +15,9 @@ var FormSettingProvider = function FormSettingProvider(props) {
|
|
|
15
15
|
formatSubmitValues = props.formatSubmitValues,
|
|
16
16
|
formatInitialValues = props.formatInitialValues,
|
|
17
17
|
customSubmit = props.customSubmit,
|
|
18
|
-
beforeSubmit = props.beforeSubmit
|
|
18
|
+
beforeSubmit = props.beforeSubmit,
|
|
19
|
+
scene = props.scene,
|
|
20
|
+
sceneRequestId = props.sceneRequestId;
|
|
19
21
|
var value = React.useMemo(function () {
|
|
20
22
|
return {
|
|
21
23
|
renderMode: renderMode,
|
|
@@ -26,9 +28,11 @@ var FormSettingProvider = function FormSettingProvider(props) {
|
|
|
26
28
|
formatSubmitValues: formatSubmitValues,
|
|
27
29
|
formatInitialValues: formatInitialValues,
|
|
28
30
|
customSubmit: customSubmit,
|
|
29
|
-
beforeSubmit: beforeSubmit
|
|
31
|
+
beforeSubmit: beforeSubmit,
|
|
32
|
+
scene: scene,
|
|
33
|
+
sceneRequestId: sceneRequestId
|
|
30
34
|
};
|
|
31
|
-
}, [renderMode, groupInfoPosition, currentValue, size, beforeSubmit]);
|
|
35
|
+
}, [renderMode, groupInfoPosition, currentValue, size, beforeSubmit, scene, sceneRequestId]);
|
|
32
36
|
return /*#__PURE__*/React.createElement(FormSettingContext.Provider, {
|
|
33
37
|
value: value
|
|
34
38
|
}, children);
|
|
@@ -175,4 +175,27 @@ export declare const updateTenantSetting: (params: {
|
|
|
175
175
|
target?: string | undefined;
|
|
176
176
|
data: Record<string, any>;
|
|
177
177
|
}) => Promise<any>;
|
|
178
|
+
export declare type DeviceSettingScene = 'template' | 'profile' | 'instance';
|
|
179
|
+
/**
|
|
180
|
+
* 获取设备设置元数据(POST 类型 GET)
|
|
181
|
+
* @param params.scene 场景,默认 template
|
|
182
|
+
* @param params.sceneRequestId URL 中 {id} 占位符的实际取值
|
|
183
|
+
* @param params.items 需要获取的字段列表,例如 ['order.name', 'order.id']
|
|
184
|
+
*/
|
|
185
|
+
export declare const getDeviceSettingMetaData: (params: {
|
|
186
|
+
scene?: DeviceSettingScene | undefined;
|
|
187
|
+
sceneRequestId: string;
|
|
188
|
+
items: string[];
|
|
189
|
+
}) => Promise<any>;
|
|
190
|
+
/**
|
|
191
|
+
* 更新设备设置数据
|
|
192
|
+
* @param params.scene 场景,默认 template
|
|
193
|
+
* @param params.sceneRequestId URL 中 {id} 占位符的实际取值
|
|
194
|
+
* @param params.data 需要更新的字段值对象
|
|
195
|
+
*/
|
|
196
|
+
export declare const updateDeviceSetting: (params: {
|
|
197
|
+
scene?: DeviceSettingScene | undefined;
|
|
198
|
+
sceneRequestId: string;
|
|
199
|
+
data: Record<string, any>;
|
|
200
|
+
}) => Promise<any>;
|
|
178
201
|
export {};
|