Skip to content

Commit 6c4525c

Browse files
Add FormList and List
1 parent 0a1b37d commit 6c4525c

File tree

10 files changed

+166
-139
lines changed

10 files changed

+166
-139
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.0.60
2+
3+
- Add `FormList` and `List`
4+
15
## 0.0.59
26

37
- Refactoring code

dist/index.es.js

Lines changed: 41 additions & 35 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.es.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js

Lines changed: 42 additions & 35 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/components/Table/ConfigLoader.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,13 @@ var ConfigLoader = function ConfigLoader(props) {
106106
hidden: !item.visible
107107
}, colProps, {
108108
cellRenderer: function cellRenderer(object) {
109-
if (colProps && colProps.cellRenderer) return colProps.cellRenderer(object) ? colProps.cellRenderer(object) : '---';else return object.cellData ? React.createElement(
110-
_Typography.Text,
111-
{ ellipsis: true, style: { width: '100%' } },
112-
object.cellData
113-
) : '---';
109+
if (colProps && colProps.cellRenderer) return React.createElement(colProps.cellRenderer, object);
110+
// return colProps.cellRenderer(object) ? colProps.cellRenderer(object) : '---';
111+
else return object.cellData ? React.createElement(
112+
_Typography.Text,
113+
{ ellipsis: true, style: { width: '100%' } },
114+
object.cellData
115+
) : '---';
114116
// return object.cellData ? object.cellData : '---';
115117
}
116118
});

lib/components/declarative.js

Lines changed: 34 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ import "antd/es/divider/style";
1212
import _Divider from "antd/es/divider";
1313
import "antd/es/typography/style";
1414
import _Typography from "antd/es/typography";
15+
import "antd/es/list/style";
16+
import _List from "antd/es/list";
1517
import "antd/es/tabs/style";
1618
import _Tabs from "antd/es/tabs";
1719
import "antd/es/col/style";
@@ -143,39 +145,41 @@ var ComponentClassicWithOutStore = function ComponentClassicWithOutStore(Compone
143145
};
144146

145147
var classicComponents = {
146-
Form: RtForm, // +
147-
FormHeader: FormHeader, // +
148-
FormBody: FormBody, // +
149-
FormFooter: FormFooter, // +
150-
Space: renderFormItemComponent(_Space), // +
151-
Row: renderFormItemComponent(_Row), // +
152-
Col: renderFormItemComponent(_Col), // +
153-
Layout: renderFormItemComponent(RtLayout), // +
154-
Tabs: _Tabs, // +
155-
TabPane: RtTabPane // +
148+
Form: RtForm,
149+
FormHeader: FormHeader,
150+
FormBody: FormBody,
151+
FormFooter: FormFooter,
152+
FormList: _Form.List,
153+
Space: renderFormItemComponent(_Space),
154+
Row: renderFormItemComponent(_Row),
155+
Col: renderFormItemComponent(_Col),
156+
Layout: renderFormItemComponent(RtLayout),
157+
Tabs: _Tabs,
158+
TabPane: RtTabPane,
159+
List: renderFormItemComponent(_List)
156160
};
157161
var withComponentType = {
158-
Button: ComponentClassicWithOutStore(RtButton), // +
159-
Title: ComponentClassicWithLabel(_Typography.Title), // +
160-
Text: ComponentClassicWithLabel(_Typography.Text), // +
161-
Divider: ComponentClassicWithLabel(_Divider), // +
162-
Checkbox: ComponentClassicWithLabel(_Checkbox), // +
163-
DatePicker: ComponentClassicWithPlaceholder(RtDatePicker, 'Выберите дату'), // +
164-
DateText: ComponentClassic(TypographyDate), // +
165-
Input: ComponentClassicWithPlaceholder(_Input, 'Введите значение'), // +
166-
Search: ComponentClassicWithPlaceholder(_Input.Search, 'Поиск'), // +
167-
TextArea: ComponentClassicWithPlaceholder(_Input.TextArea, 'Введите текст'), // +
168-
Password: ComponentClassicWithPlaceholder(_Input.Password, 'Введите пароль'), // +
169-
InputNumber: ComponentClassicWithPlaceholder(_InputNumber, 'Введите значение'), // +
170-
Switch: ComponentClassic(_Switch), // +
171-
RadioGroup: ComponentClassic(_Radio.Group), // +
172-
Select: ComponentClassicWithPlaceholder(RtSelect, 'Выберите значение'), // +
173-
TreeSelect: ComponentClassicWithPlaceholder(RtTreeSelect, 'Выберите значение'), // +
162+
Button: ComponentClassicWithOutStore(RtButton),
163+
Title: ComponentClassicWithLabel(_Typography.Title),
164+
Text: ComponentClassicWithLabel(_Typography.Text),
165+
Divider: ComponentClassicWithLabel(_Divider),
166+
Checkbox: ComponentClassicWithLabel(_Checkbox),
167+
DatePicker: ComponentClassicWithPlaceholder(RtDatePicker, 'Выберите дату'),
168+
DateText: ComponentClassic(TypographyDate),
169+
Input: ComponentClassicWithPlaceholder(_Input, 'Введите значение'),
170+
Search: ComponentClassicWithPlaceholder(_Input.Search, 'Поиск'),
171+
TextArea: ComponentClassicWithPlaceholder(_Input.TextArea, 'Введите текст'),
172+
Password: ComponentClassicWithPlaceholder(_Input.Password, 'Введите пароль'),
173+
InputNumber: ComponentClassicWithPlaceholder(_InputNumber, 'Введите значение'),
174+
Switch: ComponentClassic(_Switch),
175+
RadioGroup: ComponentClassic(_Radio.Group),
176+
Select: ComponentClassicWithPlaceholder(RtSelect, 'Выберите значение'),
177+
TreeSelect: ComponentClassicWithPlaceholder(RtTreeSelect, 'Выберите значение'),
174178
Table: ComponentClassicWithOutStore(RtTable),
175-
Modal: ComponentClassicWithOutStore(RtModal), // +
176-
Custom: ComponentClassic(Custom), // +
177-
Switcher: ComponentClassic(RtSwitcher), // +
178-
UploadFile: ComponentClassic(RtUploadFile) // +
179+
Modal: ComponentClassicWithOutStore(RtModal),
180+
Custom: ComponentClassic(Custom),
181+
Switcher: ComponentClassic(RtSwitcher),
182+
UploadFile: ComponentClassic(RtUploadFile)
179183
};
180184

181185
export var classic = _extends({}, classicComponents, Object.keys(withComponentType).reduce(function (obj, key) {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "rt-design",
3-
"version": "0.0.59",
3+
"version": "0.0.60",
44
"description": "React technical design library",
55
"author": "Iron tech space",
66
"license": "MIT",

src/components/Table/ConfigLoader.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ const ConfigLoader = props => {
7575
...colProps,
7676
cellRenderer: (object) => {
7777
if (colProps && colProps.cellRenderer)
78-
return colProps.cellRenderer(object) ? colProps.cellRenderer(object) : '---';
78+
return <colProps.cellRenderer {...object}/>
79+
// return colProps.cellRenderer(object) ? colProps.cellRenderer(object) : '---';
7980
else
8081
return object.cellData ? <Typography.Text ellipsis={true} style={{width: '100%'}}>{object.cellData}</Typography.Text> : '---';
8182
// return object.cellData ? object.cellData : '---';

0 commit comments

Comments
 (0)