@pisell/materials 3.3.87 → 3.3.88
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 +4 -4
- package/build/lowcode/preview.js +8 -8
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +25 -25
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +15 -15
- package/es/components/PisellLayouts/index.d.ts +0 -1
- package/es/components/dataSourceComponents/dataSourceForm/utils.d.ts +1 -1
- package/es/components/dataSourceComponents/dataSourceSubForm/index.d.ts +13 -0
- package/es/components/dataSourceComponents/dataSourceSubForm/index.js +274 -0
- package/es/components/dataSourceComponents/dataSourceSubForm/index.less +19 -0
- package/es/components/dataSourceComponents/dataSourceSubForm/schema-full-example.json +544 -0
- package/es/components/dataSourceComponents/dataSourceSubForm/schema-simple-example.json +174 -0
- package/es/components/dataSourceComponents/dataSourceSubForm/types.d.ts +117 -0
- package/es/components/dataSourceComponents/dataSourceSubForm/types.js +1 -0
- package/es/components/dataSourceComponents/fields/Input.Subdomain/index.d.ts +1 -1
- package/es/components/dataSourceComponents/fields/RecordListWrapper/ReadPretty.d.ts +9 -0
- package/es/components/dataSourceComponents/fields/RecordListWrapper/ReadPretty.js +61 -0
- package/es/components/dataSourceComponents/fields/RecordListWrapper/WithMode.d.ts +4 -0
- package/es/components/dataSourceComponents/fields/RecordListWrapper/WithMode.js +176 -0
- package/es/components/dataSourceComponents/fields/RecordListWrapper/index.d.ts +12 -0
- package/es/components/dataSourceComponents/fields/RecordListWrapper/index.js +11 -0
- package/es/components/dataSourceComponents/fields/RecordListWrapper/type.d.ts +87 -0
- package/es/components/dataSourceComponents/fields/RecordListWrapper/type.js +1 -0
- package/es/components/dataSourceComponents/fields/Select/index.d.ts +1 -1
- package/es/components/dataSourceComponents/fields/Tabs/ReadPretty.d.ts +9 -0
- package/es/components/dataSourceComponents/fields/Tabs/ReadPretty.js +16 -0
- package/es/components/dataSourceComponents/fields/Tabs/Tabs.d.ts +23 -0
- package/es/components/dataSourceComponents/fields/Tabs/Tabs.js +93 -0
- package/es/components/dataSourceComponents/fields/Tabs/Tabs.less +64 -0
- package/es/components/dataSourceComponents/fields/Tabs/WithMode.d.ts +6 -0
- package/es/components/dataSourceComponents/fields/Tabs/WithMode.js +9 -0
- package/es/components/dataSourceComponents/fields/Tabs/index.d.ts +12 -0
- package/es/components/dataSourceComponents/fields/Tabs/index.js +18 -0
- package/es/components/dataSourceComponents/fields/Tabs/type.d.ts +38 -0
- package/es/components/dataSourceComponents/fields/Tabs/type.js +1 -0
- package/es/components/dataSourceComponents/fields/Upload/utils.d.ts +1 -1
- package/es/components/dataSourceComponents/fields/index.d.ts +44 -7
- package/es/components/dataSourceComponents/fields/index.js +5 -1
- package/es/components/dataSourceComponents/fields/utils.js +3 -0
- package/es/components/pisellLookup/PisellLookup.d.ts +4 -0
- package/es/components/pisellLookup/PisellLookup.js +8 -1
- package/es/components/productCard/components/Packages/utils.d.ts +2 -2
- package/es/index.d.ts +4 -0
- package/es/index.js +3 -0
- package/lib/components/PisellLayouts/index.d.ts +0 -1
- package/lib/components/dataSourceComponents/dataSourceForm/utils.d.ts +1 -1
- package/lib/components/dataSourceComponents/dataSourceSubForm/index.d.ts +13 -0
- package/lib/components/dataSourceComponents/dataSourceSubForm/index.js +229 -0
- package/lib/components/dataSourceComponents/dataSourceSubForm/index.less +19 -0
- package/lib/components/dataSourceComponents/dataSourceSubForm/schema-full-example.json +544 -0
- package/lib/components/dataSourceComponents/dataSourceSubForm/schema-simple-example.json +174 -0
- package/lib/components/dataSourceComponents/dataSourceSubForm/types.d.ts +117 -0
- package/lib/components/dataSourceComponents/dataSourceSubForm/types.js +17 -0
- package/lib/components/dataSourceComponents/fields/Input.Subdomain/index.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/RecordListWrapper/ReadPretty.d.ts +9 -0
- package/lib/components/dataSourceComponents/fields/RecordListWrapper/ReadPretty.js +64 -0
- package/lib/components/dataSourceComponents/fields/RecordListWrapper/WithMode.d.ts +4 -0
- package/lib/components/dataSourceComponents/fields/RecordListWrapper/WithMode.js +157 -0
- package/lib/components/dataSourceComponents/fields/RecordListWrapper/index.d.ts +12 -0
- package/lib/components/dataSourceComponents/fields/RecordListWrapper/index.js +40 -0
- package/lib/components/dataSourceComponents/fields/RecordListWrapper/type.d.ts +87 -0
- package/lib/components/dataSourceComponents/fields/RecordListWrapper/type.js +17 -0
- package/lib/components/dataSourceComponents/fields/Select/index.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/Tabs/ReadPretty.d.ts +9 -0
- package/lib/components/dataSourceComponents/fields/Tabs/ReadPretty.js +45 -0
- package/lib/components/dataSourceComponents/fields/Tabs/Tabs.d.ts +23 -0
- package/lib/components/dataSourceComponents/fields/Tabs/Tabs.js +95 -0
- package/lib/components/dataSourceComponents/fields/Tabs/Tabs.less +64 -0
- package/lib/components/dataSourceComponents/fields/Tabs/WithMode.d.ts +6 -0
- package/lib/components/dataSourceComponents/fields/Tabs/WithMode.js +39 -0
- package/lib/components/dataSourceComponents/fields/Tabs/index.d.ts +12 -0
- package/lib/components/dataSourceComponents/fields/Tabs/index.js +40 -0
- package/lib/components/dataSourceComponents/fields/Tabs/type.d.ts +38 -0
- package/lib/components/dataSourceComponents/fields/Tabs/type.js +17 -0
- package/lib/components/dataSourceComponents/fields/Upload/utils.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/index.d.ts +44 -7
- package/lib/components/dataSourceComponents/fields/index.js +5 -1
- package/lib/components/dataSourceComponents/fields/utils.js +3 -0
- package/lib/components/pisellLookup/PisellLookup.d.ts +4 -0
- package/lib/components/pisellLookup/PisellLookup.js +5 -1
- package/lib/components/productCard/components/Packages/utils.d.ts +2 -2
- package/lib/index.d.ts +4 -0
- package/lib/index.js +9 -0
- package/lowcode/auto-resize-text/meta.ts +9 -9
- package/lowcode/data-source-form/constants.ts +3 -0
- package/lowcode/data-source-form/utils.ts +31 -5
- package/lowcode/data-source-sub-form/meta.ts +259 -0
- package/lowcode/data-source-sub-form/snippets.ts +21 -0
- package/lowcode/form-item-record-list-wrapper/meta.ts +180 -0
- package/lowcode/form-item-record-list-wrapper/snippets.ts +18 -0
- package/lowcode/form-item-tabs/meta.ts +172 -0
- package/package.json +3 -3
- package/es/components/PisellCards/components/GraphicTextCard/components/BadgeWrapper.d.ts +0 -5
- package/es/components/PisellCards/components/GraphicTextCard/components/TextContent.d.ts +0 -27
- package/es/components/PisellCards/components/GraphicTextCard/hooks/index.d.ts +0 -5
- package/es/components/PisellCards/components/GraphicTextCard/hooks/useGraphicTextCardClick.d.ts +0 -15
- package/es/components/PisellCards/components/GraphicTextCard/hooks/useGraphicTextCardStyle.d.ts +0 -18
- package/es/components/PisellCards/components/GraphicTextCard/types.d.ts +0 -290
- package/es/components/PisellCards/components/GraphicTextCard/utils/index.d.ts +0 -19
- package/es/components/PisellCards/components/TextCard/TextCard.d.ts +0 -8
- package/es/components/PisellCards/components/TextCard/components/BadgeWrapper.d.ts +0 -26
- package/es/components/PisellCards/components/TextCard/components/IconWrapper.d.ts +0 -17
- package/es/components/PisellCards/components/TextCard/components/TextContent.d.ts +0 -21
- package/es/components/PisellCards/components/TextCard/components/index.d.ts +0 -6
- package/es/components/PisellCards/components/TextCard/index.d.ts +0 -5
- package/es/components/PisellCards/components/TextCard/types.d.ts +0 -270
- package/es/components/PisellCards/index.d.ts +0 -15
- package/es/components/config-provider/index.d.ts +0 -10
- package/es/components/dataSourceComponents/dataSourceTable/type.d.ts +0 -84
- package/es/components/dataSourceComponents/fields/Input.Phone/serve.d.ts +0 -27
- package/es/components/dataSourceComponents/fields/Upload/constants.d.ts +0 -9
- package/es/components/drag-sort-tree/index.d.ts +0 -5
- package/es/components/filter/components/Dropdown/types.d.ts +0 -13
- package/es/components/filter/components/FilterButton/types.d.ts +0 -24
- package/es/components/filter/types.d.ts +0 -48
- package/es/components/login-and-register/index.d.ts +0 -82
- package/es/components/pisellCurrency/PisellCurrency.d.ts +0 -39
- package/es/components/pisellDateTimeDisplay/utils/relativeDay.d.ts +0 -24
- package/es/components/pisellEmail/PisellEmail.d.ts +0 -37
- package/es/components/pisellFilter/type.d.ts +0 -5
- package/es/components/pisellGridPro/index.d.ts +0 -4
- package/es/components/pisellLongText/PisellLongText.d.ts +0 -39
- package/es/components/pisellMultipleSelect/PisellMultipleSelect.d.ts +0 -9
- package/es/components/pisellMultipleSelect/components/EditView.d.ts +0 -8
- package/es/components/pisellNumber/PisellNumber.d.ts +0 -42
- package/es/components/pisellPhone/PisellPhone.d.ts +0 -36
- package/es/components/pisellPhone/components/EditView.d.ts +0 -19
- package/es/components/pisellPhone/constants/countryCodes.d.ts +0 -20
- package/es/components/pisellPhone/types.d.ts +0 -209
- package/es/components/pisellPhone/utils/countryCodeHelper.d.ts +0 -35
- package/es/components/pisellQuickFilter/type.d.ts +0 -12
- package/es/components/pisellRating/PisellRating.d.ts +0 -31
- package/es/components/pisellRecordBoard/shellFrame/BatchActionBar/index.d.ts +0 -8
- package/es/components/pisellRecordBoard/shellFrame/Search/index.d.ts +0 -10
- package/es/components/pisellRecordBoard/shellFrame/ToolBarReset/index.d.ts +0 -16
- package/es/components/pisellSingleLineText/PisellSingleLineText.d.ts +0 -40
- package/es/components/pisellSingleSelect/PisellSingleSelect.d.ts +0 -9
- package/es/components/pisellTimeRangeDisplay/PisellTimeRangeDisplay.d.ts +0 -32
- package/es/components/pisellUrl/PisellUrl.d.ts +0 -37
- package/es/components/productCard/components/Header/DeleteButton/index.d.ts +0 -4
- package/es/components/productCard/components/Time/components/SelectHolder/index.d.ts +0 -4
- package/es/components/productCard/components/Time/components/SelectResource/index.d.ts +0 -19
- package/es/components/sort/index.d.ts +0 -5
- package/es/components/table/Actions/component/ViewMode/index.d.ts +0 -9
- package/es/components/table/Gallery/components/GalleryItem/index.d.ts +0 -14
- package/es/components/table/types.d.ts +0 -268
- package/es/components/translation/index.d.ts +0 -17
- package/es/components/translation/utils.d.ts +0 -9
- package/lib/components/PisellCards/components/GraphicTextCard/components/BadgeWrapper.d.ts +0 -5
- package/lib/components/PisellCards/components/GraphicTextCard/components/TextContent.d.ts +0 -27
- package/lib/components/PisellCards/components/GraphicTextCard/hooks/index.d.ts +0 -5
- package/lib/components/PisellCards/components/GraphicTextCard/hooks/useGraphicTextCardClick.d.ts +0 -15
- package/lib/components/PisellCards/components/GraphicTextCard/hooks/useGraphicTextCardStyle.d.ts +0 -18
- package/lib/components/PisellCards/components/GraphicTextCard/types.d.ts +0 -290
- package/lib/components/PisellCards/components/GraphicTextCard/utils/index.d.ts +0 -19
- package/lib/components/PisellCards/components/TextCard/TextCard.d.ts +0 -8
- package/lib/components/PisellCards/components/TextCard/components/BadgeWrapper.d.ts +0 -26
- package/lib/components/PisellCards/components/TextCard/components/IconWrapper.d.ts +0 -17
- package/lib/components/PisellCards/components/TextCard/components/TextContent.d.ts +0 -21
- package/lib/components/PisellCards/components/TextCard/components/index.d.ts +0 -6
- package/lib/components/PisellCards/components/TextCard/index.d.ts +0 -5
- package/lib/components/PisellCards/components/TextCard/types.d.ts +0 -270
- package/lib/components/PisellCards/index.d.ts +0 -15
- package/lib/components/config-provider/index.d.ts +0 -10
- package/lib/components/dataSourceComponents/dataSourceTable/type.d.ts +0 -84
- package/lib/components/dataSourceComponents/fields/Input.Phone/serve.d.ts +0 -27
- package/lib/components/dataSourceComponents/fields/Upload/constants.d.ts +0 -9
- package/lib/components/drag-sort-tree/index.d.ts +0 -5
- package/lib/components/filter/components/Dropdown/types.d.ts +0 -13
- package/lib/components/filter/components/FilterButton/types.d.ts +0 -24
- package/lib/components/filter/types.d.ts +0 -48
- package/lib/components/login-and-register/index.d.ts +0 -82
- package/lib/components/pisellCurrency/PisellCurrency.d.ts +0 -39
- package/lib/components/pisellDateTimeDisplay/utils/relativeDay.d.ts +0 -24
- package/lib/components/pisellEmail/PisellEmail.d.ts +0 -37
- package/lib/components/pisellFilter/type.d.ts +0 -5
- package/lib/components/pisellGridPro/index.d.ts +0 -4
- package/lib/components/pisellLongText/PisellLongText.d.ts +0 -39
- package/lib/components/pisellMultipleSelect/PisellMultipleSelect.d.ts +0 -9
- package/lib/components/pisellMultipleSelect/components/EditView.d.ts +0 -8
- package/lib/components/pisellNumber/PisellNumber.d.ts +0 -42
- package/lib/components/pisellPhone/PisellPhone.d.ts +0 -36
- package/lib/components/pisellPhone/components/EditView.d.ts +0 -19
- package/lib/components/pisellPhone/constants/countryCodes.d.ts +0 -20
- package/lib/components/pisellPhone/types.d.ts +0 -209
- package/lib/components/pisellPhone/utils/countryCodeHelper.d.ts +0 -35
- package/lib/components/pisellQuickFilter/type.d.ts +0 -12
- package/lib/components/pisellRating/PisellRating.d.ts +0 -31
- package/lib/components/pisellRecordBoard/shellFrame/BatchActionBar/index.d.ts +0 -8
- package/lib/components/pisellRecordBoard/shellFrame/Search/index.d.ts +0 -10
- package/lib/components/pisellRecordBoard/shellFrame/ToolBarReset/index.d.ts +0 -16
- package/lib/components/pisellSingleLineText/PisellSingleLineText.d.ts +0 -40
- package/lib/components/pisellSingleSelect/PisellSingleSelect.d.ts +0 -9
- package/lib/components/pisellTimeRangeDisplay/PisellTimeRangeDisplay.d.ts +0 -32
- package/lib/components/pisellUrl/PisellUrl.d.ts +0 -37
- package/lib/components/productCard/components/Header/DeleteButton/index.d.ts +0 -4
- package/lib/components/productCard/components/Time/components/SelectHolder/index.d.ts +0 -4
- package/lib/components/productCard/components/Time/components/SelectResource/index.d.ts +0 -19
- package/lib/components/sort/index.d.ts +0 -5
- package/lib/components/table/Actions/component/ViewMode/index.d.ts +0 -9
- package/lib/components/table/Gallery/components/GalleryItem/index.d.ts +0 -14
- package/lib/components/table/types.d.ts +0 -268
- package/lib/components/translation/index.d.ts +0 -17
- package/lib/components/translation/utils.d.ts +0 -9
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ModeType } from '../dataSourceForm/type';
|
|
3
|
+
/**
|
|
4
|
+
* @title 字段选项接口
|
|
5
|
+
* @description 用于下拉框、单选框等组件的选项配置
|
|
6
|
+
*/
|
|
7
|
+
export interface DataSourceSubFormOption {
|
|
8
|
+
label?: React.ReactNode;
|
|
9
|
+
value: string | number;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* @title 字段 Schema 接口
|
|
13
|
+
* @description 定义表单字段的结构和配置
|
|
14
|
+
*/
|
|
15
|
+
export interface DataSourceSubFormFieldSchema {
|
|
16
|
+
/** 字段名称(必填) */
|
|
17
|
+
name: string;
|
|
18
|
+
/** 字段标签 */
|
|
19
|
+
label?: React.ReactNode;
|
|
20
|
+
/** 组件类型(兼容多种命名方式) */
|
|
21
|
+
component?: string;
|
|
22
|
+
componentName?: string;
|
|
23
|
+
/** 字段数据类型 */
|
|
24
|
+
type?: string;
|
|
25
|
+
/** 接口类型,用于映射到具体组件(如 Select、Input 等) */
|
|
26
|
+
interface?: string;
|
|
27
|
+
/** 字段选项列表(用于 Select、Radio 等) */
|
|
28
|
+
options?: DataSourceSubFormOption[];
|
|
29
|
+
/** 组件额外配置 */
|
|
30
|
+
props?: Record<string, any>;
|
|
31
|
+
/** 子字段(用于嵌套结构,如 Input.JSON) */
|
|
32
|
+
children?: DataSourceSubFormFieldSchema[];
|
|
33
|
+
_children?: DataSourceSubFormFieldSchema[];
|
|
34
|
+
/** 字段 Schema 配置 */
|
|
35
|
+
schema?: Record<string, any>;
|
|
36
|
+
/** UI Schema 配置(支持低代码平台的各种配置项) */
|
|
37
|
+
uiSchema?: {
|
|
38
|
+
title?: React.ReactNode;
|
|
39
|
+
enum?: DataSourceSubFormOption[];
|
|
40
|
+
'x-component'?: string;
|
|
41
|
+
'x-component-props'?: Record<string, any>;
|
|
42
|
+
'x-read-pretty'?: boolean;
|
|
43
|
+
'x-validator'?: string;
|
|
44
|
+
'x-display'?: 'visible' | 'hidden' | 'none';
|
|
45
|
+
'x-pattern'?: 'editable' | 'disabled' | 'readPretty';
|
|
46
|
+
'x-data-source'?: {
|
|
47
|
+
type?: string;
|
|
48
|
+
options?: Array<{
|
|
49
|
+
id?: string;
|
|
50
|
+
label: string | Record<string, any>;
|
|
51
|
+
value: string;
|
|
52
|
+
color?: string;
|
|
53
|
+
}>;
|
|
54
|
+
labelField?: string;
|
|
55
|
+
valueField?: string;
|
|
56
|
+
dataSource?: any;
|
|
57
|
+
extraParams?: Record<string, any>;
|
|
58
|
+
};
|
|
59
|
+
'x-record-schema'?: DataSourceSubFormSchema | DataSourceSubFormFieldSchema[] | string;
|
|
60
|
+
default?: any;
|
|
61
|
+
type?: 'string' | 'number' | 'integer' | 'boolean' | 'array' | 'object';
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* @title Schema 接口
|
|
66
|
+
* @description 表单字段集合的结构定义
|
|
67
|
+
*/
|
|
68
|
+
export interface DataSourceSubFormSchema {
|
|
69
|
+
/** 字段列表 */
|
|
70
|
+
fields?: DataSourceSubFormFieldSchema[];
|
|
71
|
+
/** 属性映射(key-value 形式) */
|
|
72
|
+
properties?: Record<string, any>;
|
|
73
|
+
/** 子字段列表 */
|
|
74
|
+
children?: DataSourceSubFormFieldSchema[];
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* @title DataSourceSubForm 组件 Props
|
|
78
|
+
* @description
|
|
79
|
+
* 独立的子表单组件,用于渲染一组表单字段。
|
|
80
|
+
* 支持通过 xRecordSchema 配置字段,或直接传入 children 低代码子组件。
|
|
81
|
+
*/
|
|
82
|
+
export interface DataSourceSubFormProps {
|
|
83
|
+
/** 渲染模式:edit(编辑)、disabled(禁用)、preview(预览) */
|
|
84
|
+
renderMode?: ModeType;
|
|
85
|
+
/**
|
|
86
|
+
* 表单值对象
|
|
87
|
+
* @example { "fieldName1": "value1", "fieldName2": "value2" }
|
|
88
|
+
*/
|
|
89
|
+
value?: Record<string, any>;
|
|
90
|
+
/**
|
|
91
|
+
* 值变化回调
|
|
92
|
+
* @param value 更新后的表单值对象
|
|
93
|
+
*/
|
|
94
|
+
onChange?: (value: Record<string, any>) => void;
|
|
95
|
+
/**
|
|
96
|
+
* xRecordSchema:定义表单字段结构
|
|
97
|
+
* 支持三种格式:
|
|
98
|
+
* 1. JSON 字符串
|
|
99
|
+
* 2. Schema 对象(包含 fields/properties/children)
|
|
100
|
+
* 3. 字段数组
|
|
101
|
+
*/
|
|
102
|
+
xRecordSchema?: string | DataSourceSubFormSchema | DataSourceSubFormFieldSchema[];
|
|
103
|
+
/**
|
|
104
|
+
* 容器 children:低代码引擎渲染的子组件节点
|
|
105
|
+
* 优先使用 children,如果没有则回退到 xRecordSchema 渲染
|
|
106
|
+
*/
|
|
107
|
+
children?: React.ReactNode;
|
|
108
|
+
/** 低代码设计模式标识 */
|
|
109
|
+
__designMode?: string;
|
|
110
|
+
/** 表单布局方式 */
|
|
111
|
+
layout?: 'horizontal' | 'vertical' | 'inline';
|
|
112
|
+
/** 自定义类名 */
|
|
113
|
+
className?: string;
|
|
114
|
+
/** 自定义样式 */
|
|
115
|
+
style?: React.CSSProperties;
|
|
116
|
+
[key: string]: any;
|
|
117
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
for (let key of __getOwnPropNames(from))
|
|
8
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
+
}
|
|
11
|
+
return to;
|
|
12
|
+
};
|
|
13
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
14
|
+
|
|
15
|
+
// src/components/dataSourceComponents/dataSourceSubForm/types.ts
|
|
16
|
+
var types_exports = {};
|
|
17
|
+
module.exports = __toCommonJS(types_exports);
|
|
@@ -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: "custom" | "saas" | "xzero";
|
|
6
6
|
customDomain?: string | undefined;
|
|
7
7
|
value?: string | undefined;
|
|
8
8
|
tenantId: string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { RecordListWrapperProps } from './type';
|
|
3
|
+
/**
|
|
4
|
+
* @title: RecordListWrapper 只读态
|
|
5
|
+
* @description: 低代码详情模式下展示每个 option 对应的 record 数据。
|
|
6
|
+
* 值结构: { optionValue: { field1: v1, field2: v2 } }
|
|
7
|
+
*/
|
|
8
|
+
declare const RecordListWrapperReadPretty: React.FC<RecordListWrapperProps>;
|
|
9
|
+
export default RecordListWrapperReadPretty;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/dataSourceComponents/fields/RecordListWrapper/ReadPretty.tsx
|
|
30
|
+
var ReadPretty_exports = {};
|
|
31
|
+
__export(ReadPretty_exports, {
|
|
32
|
+
default: () => ReadPretty_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(ReadPretty_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var RecordListWrapperReadPretty = (props) => {
|
|
37
|
+
const { value, options = [] } = props;
|
|
38
|
+
const safeValue = value && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
39
|
+
const entries = Object.entries(safeValue);
|
|
40
|
+
if (!entries.length) {
|
|
41
|
+
return /* @__PURE__ */ import_react.default.createElement("span", null, "-");
|
|
42
|
+
}
|
|
43
|
+
return /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement("div", { style: { marginBottom: 8 } }, "Records: ", entries.length), entries.map(([key, record]) => {
|
|
44
|
+
const option = options.find((o) => String(o.value) === key);
|
|
45
|
+
const label = (option == null ? void 0 : option.label) || key;
|
|
46
|
+
const displayLabel = typeof label === "object" ? JSON.stringify(label) : label;
|
|
47
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { key, style: { marginBottom: 8 } }, /* @__PURE__ */ import_react.default.createElement("div", { style: { fontWeight: 500, marginBottom: 4 } }, displayLabel), /* @__PURE__ */ import_react.default.createElement(
|
|
48
|
+
"pre",
|
|
49
|
+
{
|
|
50
|
+
style: {
|
|
51
|
+
margin: 0,
|
|
52
|
+
padding: 8,
|
|
53
|
+
background: "#f7f8fa",
|
|
54
|
+
borderRadius: 4,
|
|
55
|
+
fontSize: 12,
|
|
56
|
+
maxHeight: 200,
|
|
57
|
+
overflow: "auto"
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
JSON.stringify(record, null, 2)
|
|
61
|
+
));
|
|
62
|
+
}));
|
|
63
|
+
};
|
|
64
|
+
var ReadPretty_default = RecordListWrapperReadPretty;
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/dataSourceComponents/fields/RecordListWrapper/WithMode.tsx
|
|
30
|
+
var WithMode_exports = {};
|
|
31
|
+
__export(WithMode_exports, {
|
|
32
|
+
default: () => WithMode_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(WithMode_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_utils = require("../../dataSourceForm/utils");
|
|
37
|
+
var import_ReadPretty = __toESM(require("./ReadPretty"));
|
|
38
|
+
var import_Tabs = __toESM(require("../Tabs/Tabs"));
|
|
39
|
+
var import_dataSourceSubForm = __toESM(require("../../dataSourceSubForm"));
|
|
40
|
+
var RecordListWrapperBase = (props) => {
|
|
41
|
+
const {
|
|
42
|
+
value,
|
|
43
|
+
onChange,
|
|
44
|
+
options = [],
|
|
45
|
+
children,
|
|
46
|
+
xRecordSchema,
|
|
47
|
+
topSlot,
|
|
48
|
+
slot,
|
|
49
|
+
renderMode,
|
|
50
|
+
__designMode,
|
|
51
|
+
defaultValue
|
|
52
|
+
} = props;
|
|
53
|
+
const isMounted = (0, import_react.useRef)(false);
|
|
54
|
+
const dataSourceSubFormRef = (0, import_react.useRef)(null);
|
|
55
|
+
const safeValue = (0, import_react.useMemo)(() => {
|
|
56
|
+
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
57
|
+
return value;
|
|
58
|
+
}
|
|
59
|
+
return {};
|
|
60
|
+
}, [value]);
|
|
61
|
+
const [activeKey, setActiveKey] = (0, import_react.useState)(() => {
|
|
62
|
+
var _a;
|
|
63
|
+
if (defaultValue != null) return String(defaultValue);
|
|
64
|
+
return String(((_a = options[0]) == null ? void 0 : _a.value) || "");
|
|
65
|
+
});
|
|
66
|
+
(0, import_react.useEffect)(() => {
|
|
67
|
+
if (defaultValue != null) {
|
|
68
|
+
setActiveKey(String(defaultValue));
|
|
69
|
+
}
|
|
70
|
+
}, [defaultValue]);
|
|
71
|
+
(0, import_react.useEffect)(() => {
|
|
72
|
+
var _a;
|
|
73
|
+
if (options.length && !options.find((o) => String(o.value) === activeKey)) {
|
|
74
|
+
setActiveKey(
|
|
75
|
+
defaultValue != null ? String(defaultValue) : String(((_a = options[0]) == null ? void 0 : _a.value) || "")
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
}, [options]);
|
|
79
|
+
(0, import_react.useEffect)(() => {
|
|
80
|
+
var _a, _b;
|
|
81
|
+
if (isMounted.current) {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
if ((options == null ? void 0 : options.length) > 0 && dataSourceSubFormRef.current) {
|
|
85
|
+
const defaultValues = ((_b = (_a = dataSourceSubFormRef.current).getFieldsValue) == null ? void 0 : _b.call(_a)) ?? {};
|
|
86
|
+
const completeValue = options.reduce(
|
|
87
|
+
(acc, option) => {
|
|
88
|
+
if (option.value === null || option.value === void 0) return acc;
|
|
89
|
+
acc[String(option.value)] = {
|
|
90
|
+
...defaultValues,
|
|
91
|
+
...safeValue[String(option.value)] || {}
|
|
92
|
+
};
|
|
93
|
+
return acc;
|
|
94
|
+
},
|
|
95
|
+
{}
|
|
96
|
+
);
|
|
97
|
+
onChange == null ? void 0 : onChange(completeValue);
|
|
98
|
+
isMounted.current = true;
|
|
99
|
+
}
|
|
100
|
+
}, [options, safeValue]);
|
|
101
|
+
const renderTopSlot = () => {
|
|
102
|
+
const slotElement = topSlot || slot;
|
|
103
|
+
if (slotElement && import_react.default.isValidElement(slotElement)) {
|
|
104
|
+
return import_react.default.cloneElement(slotElement, {
|
|
105
|
+
options,
|
|
106
|
+
value: activeKey,
|
|
107
|
+
onChange: setActiveKey
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
const tabOptions = options.map((o) => ({
|
|
111
|
+
...o,
|
|
112
|
+
label: o.label ?? String(o.value)
|
|
113
|
+
}));
|
|
114
|
+
if (!options.length) {
|
|
115
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { style: { color: "#999", fontSize: 16 } }, "暂无选项,请配置数据源。");
|
|
116
|
+
}
|
|
117
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
118
|
+
import_Tabs.default,
|
|
119
|
+
{
|
|
120
|
+
options: tabOptions,
|
|
121
|
+
value: activeKey,
|
|
122
|
+
onChange: (key) => setActiveKey(String(key)),
|
|
123
|
+
disabled: renderMode === "disabled"
|
|
124
|
+
}
|
|
125
|
+
);
|
|
126
|
+
};
|
|
127
|
+
const renderBottom = () => {
|
|
128
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
|
|
129
|
+
import_dataSourceSubForm.default,
|
|
130
|
+
{
|
|
131
|
+
activeKey,
|
|
132
|
+
value: safeValue[activeKey],
|
|
133
|
+
onChange: (recordValue) => onChange == null ? void 0 : onChange({ ...safeValue || {}, [activeKey]: recordValue || {} }),
|
|
134
|
+
xRecordSchema,
|
|
135
|
+
renderMode,
|
|
136
|
+
__designMode
|
|
137
|
+
},
|
|
138
|
+
children
|
|
139
|
+
), /* @__PURE__ */ import_react.default.createElement("div", { style: { width: "100%", height: 0, visibility: "hidden", overflow: "hidden" } }, /* @__PURE__ */ import_react.default.createElement(
|
|
140
|
+
import_dataSourceSubForm.default,
|
|
141
|
+
{
|
|
142
|
+
key: "record-list-wrapper-default-value-form",
|
|
143
|
+
ref: dataSourceSubFormRef,
|
|
144
|
+
xRecordSchema,
|
|
145
|
+
renderMode,
|
|
146
|
+
__designMode
|
|
147
|
+
},
|
|
148
|
+
children
|
|
149
|
+
)));
|
|
150
|
+
};
|
|
151
|
+
return /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement("div", { style: { marginBottom: 12 } }, renderTopSlot()), renderBottom());
|
|
152
|
+
};
|
|
153
|
+
var RecordListWrapperWithMode = (0, import_utils.withMode)(
|
|
154
|
+
RecordListWrapperBase,
|
|
155
|
+
import_ReadPretty.default
|
|
156
|
+
);
|
|
157
|
+
var WithMode_default = RecordListWrapperWithMode;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare const RecordListWrapperWithDataSource: (props: import("./type").RecordListWrapperProps & import("../../dataSourceForm/utils").WithModeProps & import("../../dataSourceForm/utils").WithFormItemProps & {
|
|
3
|
+
options?: any;
|
|
4
|
+
optionSourceType?: "default" | "custom" | "api" | undefined;
|
|
5
|
+
labelField: string;
|
|
6
|
+
valueField: string;
|
|
7
|
+
extraParams?: Record<string, any> | undefined;
|
|
8
|
+
} & {
|
|
9
|
+
dataSource?: any;
|
|
10
|
+
extraParams?: Record<string, any> | undefined;
|
|
11
|
+
}) => React.JSX.Element;
|
|
12
|
+
export default RecordListWrapperWithDataSource;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/dataSourceComponents/fields/RecordListWrapper/index.tsx
|
|
30
|
+
var RecordListWrapper_exports = {};
|
|
31
|
+
__export(RecordListWrapper_exports, {
|
|
32
|
+
default: () => RecordListWrapper_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(RecordListWrapper_exports);
|
|
35
|
+
var import_utils = require("../../dataSourceForm/utils");
|
|
36
|
+
var import_WithMode = __toESM(require("./WithMode"));
|
|
37
|
+
var RecordListWrapperWithFormItem = (0, import_utils.withFormItem)(import_WithMode.default);
|
|
38
|
+
var RecordListWrapperWithOptions = (0, import_utils.withOptions)(RecordListWrapperWithFormItem);
|
|
39
|
+
var RecordListWrapperWithDataSource = (0, import_utils.withDataSource)(RecordListWrapperWithOptions);
|
|
40
|
+
var RecordListWrapper_default = RecordListWrapperWithDataSource;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ModeType } from '../../dataSourceForm/type';
|
|
3
|
+
export interface RecordListWrapperOption {
|
|
4
|
+
label?: React.ReactNode;
|
|
5
|
+
value: string | number;
|
|
6
|
+
}
|
|
7
|
+
export interface RecordListWrapperFieldSchema {
|
|
8
|
+
name: string;
|
|
9
|
+
label?: React.ReactNode;
|
|
10
|
+
component?: string;
|
|
11
|
+
componentName?: string;
|
|
12
|
+
type?: string;
|
|
13
|
+
/** 接口类型,用于映射到具体组件(如 Select、Input 等) */
|
|
14
|
+
interface?: string;
|
|
15
|
+
options?: RecordListWrapperOption[];
|
|
16
|
+
props?: Record<string, any>;
|
|
17
|
+
/** 子字段(用于嵌套结构,如 Input.JSON) */
|
|
18
|
+
children?: RecordListWrapperFieldSchema[];
|
|
19
|
+
_children?: RecordListWrapperFieldSchema[];
|
|
20
|
+
schema?: Record<string, any>;
|
|
21
|
+
uiSchema?: {
|
|
22
|
+
title?: React.ReactNode;
|
|
23
|
+
enum?: RecordListWrapperOption[];
|
|
24
|
+
'x-component'?: string;
|
|
25
|
+
'x-component-props'?: Record<string, any>;
|
|
26
|
+
'x-read-pretty'?: boolean;
|
|
27
|
+
'x-validator'?: string;
|
|
28
|
+
'x-display'?: 'visible' | 'hidden' | 'none';
|
|
29
|
+
'x-pattern'?: 'editable' | 'disabled' | 'readPretty';
|
|
30
|
+
'x-data-source'?: {
|
|
31
|
+
type?: string;
|
|
32
|
+
options?: Array<{
|
|
33
|
+
id?: string;
|
|
34
|
+
label: string | Record<string, any>;
|
|
35
|
+
value: string;
|
|
36
|
+
color?: string;
|
|
37
|
+
}>;
|
|
38
|
+
labelField?: string;
|
|
39
|
+
valueField?: string;
|
|
40
|
+
dataSource?: any;
|
|
41
|
+
extraParams?: Record<string, any>;
|
|
42
|
+
};
|
|
43
|
+
'x-record-schema'?: RecordListWrapperSchema | RecordListWrapperFieldSchema[] | string;
|
|
44
|
+
default?: any;
|
|
45
|
+
type?: 'string' | 'number' | 'integer' | 'boolean' | 'array' | 'object';
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
export interface RecordListWrapperSchema {
|
|
49
|
+
fields?: RecordListWrapperFieldSchema[];
|
|
50
|
+
properties?: Record<string, any>;
|
|
51
|
+
children?: RecordListWrapperFieldSchema[];
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* @title RecordListWrapper 组件 Props
|
|
55
|
+
* @description
|
|
56
|
+
* 值结构为 Map:key 是 xDataSource option 的 value,value 是该 option 对应的表单字段值。
|
|
57
|
+
* 例如:{ "5": { "code": "xxx", "type": "yyy" }, "3": { "code": "aaa" } }
|
|
58
|
+
*/
|
|
59
|
+
export interface RecordListWrapperProps {
|
|
60
|
+
renderMode: ModeType;
|
|
61
|
+
/**
|
|
62
|
+
* 值: Map 结构
|
|
63
|
+
* - key: xDataSource option 的 value
|
|
64
|
+
* - value: 该 option 对应的 xRecordSchema 字段值对象
|
|
65
|
+
*/
|
|
66
|
+
value?: Record<string, Record<string, any>>;
|
|
67
|
+
onChange?: (value: Record<string, Record<string, any>>) => void;
|
|
68
|
+
/** xDataSource 选项列表,驱动 tabs 导航和 records 结构 */
|
|
69
|
+
options?: RecordListWrapperOption[];
|
|
70
|
+
/**
|
|
71
|
+
* 上部插槽:用户可在低代码平台拖入自定义导航组件。
|
|
72
|
+
* RecordListWrapper 会通过 cloneElement 注入 options、value(activeKey)、onChange。
|
|
73
|
+
*/
|
|
74
|
+
topSlot?: React.ReactNode;
|
|
75
|
+
slot?: React.ReactNode;
|
|
76
|
+
/** xRecordSchema:定义每条记录的子字段结构 */
|
|
77
|
+
xRecordSchema?: string | RecordListWrapperSchema | RecordListWrapperFieldSchema[];
|
|
78
|
+
/** 容器 children:低代码引擎渲染的子组件节点 */
|
|
79
|
+
children?: React.ReactNode;
|
|
80
|
+
/** 低代码设计模式标识 */
|
|
81
|
+
__designMode?: string;
|
|
82
|
+
/**
|
|
83
|
+
* 默认激活的 Tab key,外部传入时优先于 options[0].value
|
|
84
|
+
*/
|
|
85
|
+
defaultValue?: string;
|
|
86
|
+
[key: string]: any;
|
|
87
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
for (let key of __getOwnPropNames(from))
|
|
8
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
+
}
|
|
11
|
+
return to;
|
|
12
|
+
};
|
|
13
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
14
|
+
|
|
15
|
+
// src/components/dataSourceComponents/fields/RecordListWrapper/type.ts
|
|
16
|
+
var type_exports = {};
|
|
17
|
+
module.exports = __toCommonJS(type_exports);
|
|
@@ -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?: "default" | "
|
|
4
|
+
optionSourceType?: "default" | "custom" | "api" | undefined;
|
|
5
5
|
labelField: string;
|
|
6
6
|
valueField: string;
|
|
7
7
|
extraParams?: Record<string, any> | undefined;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/dataSourceComponents/fields/Tabs/ReadPretty.tsx
|
|
30
|
+
var ReadPretty_exports = {};
|
|
31
|
+
__export(ReadPretty_exports, {
|
|
32
|
+
default: () => ReadPretty_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(ReadPretty_exports);
|
|
35
|
+
var import_useValueMap = __toESM(require("../../hooks/useValueMap"));
|
|
36
|
+
var import_utils = require("../../dataSourceForm/utils");
|
|
37
|
+
var TabsReadPretty = ({
|
|
38
|
+
value,
|
|
39
|
+
options,
|
|
40
|
+
renderMode
|
|
41
|
+
}) => {
|
|
42
|
+
const valueMap = (0, import_useValueMap.default)(options || []);
|
|
43
|
+
return (0, import_utils.renderValueWithMap)(value, valueMap, renderMode);
|
|
44
|
+
};
|
|
45
|
+
var ReadPretty_default = TabsReadPretty;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TabsProps } from './type';
|
|
3
|
+
import './Tabs.less';
|
|
4
|
+
/**
|
|
5
|
+
* Tabs 胶囊风格选项卡组件
|
|
6
|
+
*
|
|
7
|
+
* @description 提供类似 Segmented 控件的胶囊风格选项卡,支持受控与非受控模式。
|
|
8
|
+
* 用于表单中替代 Radio.Group,展示更为直观的标签页切换交互。
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```tsx
|
|
12
|
+
* <Tabs
|
|
13
|
+
* value={current}
|
|
14
|
+
* options={[
|
|
15
|
+
* { label: '校区', value: 'campus' },
|
|
16
|
+
* { label: '场地', value: 'venue' },
|
|
17
|
+
* ]}
|
|
18
|
+
* onChange={(val) => setCurrent(val)}
|
|
19
|
+
* />
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
declare const Tabs: React.FC<TabsProps>;
|
|
23
|
+
export default Tabs;
|