react-crud-mobile 1.0.71 → 1.0.73
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/dist/elements/UIChildren.d.ts +2 -2
- package/dist/react-crud-mobile.cjs.development.js +81 -86
- package/dist/react-crud-mobile.cjs.development.js.map +1 -1
- package/dist/react-crud-mobile.cjs.production.min.js +1 -1
- package/dist/react-crud-mobile.cjs.production.min.js.map +1 -1
- package/dist/react-crud-mobile.esm.js +81 -86
- package/dist/react-crud-mobile.esm.js.map +1 -1
- package/package.json +66 -66
- package/src/elements/UI.tsx +57 -57
- package/src/elements/UIChildren.tsx +114 -117
- package/src/elements/UIComplete.tsx +14 -14
- package/src/elements/UIElement.tsx +408 -418
- package/src/elements/UITag.tsx +13 -13
- package/src/elements/card/ElCard.tsx +25 -25
- package/src/elements/charts/ElChart.tsx +10 -10
- package/src/elements/core/Input.tsx +40 -40
- package/src/elements/grid/ElGrid.tsx +48 -48
- package/src/elements/grid/ElGridBotom.tsx +21 -21
- package/src/elements/grid/ElGridCheck.tsx +67 -67
- package/src/elements/grid/ElGridColumn.tsx +32 -32
- package/src/elements/grid/ElGridFilter.tsx +5 -5
- package/src/elements/grid/ElGridPaginator.tsx +82 -82
- package/src/elements/grid/ElGridRow.tsx +123 -123
- package/src/elements/grid/ElGridTop.tsx +44 -44
- package/src/elements/grid/ElInclude.tsx +40 -40
- package/src/elements/grid/ElLabel.tsx +50 -50
- package/src/elements/grid/ElRepeat.tsx +24 -24
- package/src/elements/grid/ElRepeatRow.tsx +40 -40
- package/src/elements/index.ts +1 -1
- package/src/elements/tabs/ElTabs.tsx +178 -178
- package/src/index.ts +1 -1
package/src/elements/UITag.tsx
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import React, { useState } from "react";
|
|
2
|
-
import { Utils } from "react-crud-utils";
|
|
3
|
-
|
|
4
|
-
interface UITagType {
|
|
5
|
-
name: string;
|
|
6
|
-
[otherOptions: string]: unknown;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export default function UITag(props: UITagType) {
|
|
10
|
-
let Aux = Utils.nvl(props.name, "span");
|
|
11
|
-
|
|
12
|
-
return <Aux {...props} />;
|
|
13
|
-
}
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import { Utils } from "react-crud-utils";
|
|
3
|
+
|
|
4
|
+
interface UITagType {
|
|
5
|
+
name: string;
|
|
6
|
+
[otherOptions: string]: unknown;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export default function UITag(props: UITagType) {
|
|
10
|
+
let Aux = Utils.nvl(props.name, "span");
|
|
11
|
+
|
|
12
|
+
return <Aux {...props} />;
|
|
13
|
+
}
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import UIChildren from '../UIChildren';
|
|
2
|
-
import ElLabel from '../grid/ElLabel';
|
|
3
|
-
import ElInclude from '../grid/ElInclude';
|
|
4
|
-
import { ChildType } from 'react-crud-utils';
|
|
5
|
-
|
|
6
|
-
export default function ElCard(props: ChildType) {
|
|
7
|
-
let scope = props.scope;
|
|
8
|
-
|
|
9
|
-
return (
|
|
10
|
-
<div
|
|
11
|
-
className={scope.getStyleClass('inner')}
|
|
12
|
-
style={scope.getStyle('inner')}
|
|
13
|
-
>
|
|
14
|
-
<ElLabel {...props} scope={scope}></ElLabel>
|
|
15
|
-
<UIChildren {...props} scope={scope} />
|
|
16
|
-
|
|
17
|
-
<div
|
|
18
|
-
className={scope.getStyleClass('bottom')}
|
|
19
|
-
style={scope.getStyle('bottom')}
|
|
20
|
-
>
|
|
21
|
-
<ElInclude {...props} scope={scope} name="bottom" />
|
|
22
|
-
</div>
|
|
23
|
-
</div>
|
|
24
|
-
);
|
|
25
|
-
}
|
|
1
|
+
import UIChildren from '../UIChildren';
|
|
2
|
+
import ElLabel from '../grid/ElLabel';
|
|
3
|
+
import ElInclude from '../grid/ElInclude';
|
|
4
|
+
import { ChildType } from 'react-crud-utils';
|
|
5
|
+
|
|
6
|
+
export default function ElCard(props: ChildType) {
|
|
7
|
+
let scope = props.scope;
|
|
8
|
+
|
|
9
|
+
return (
|
|
10
|
+
<div
|
|
11
|
+
className={scope.getStyleClass('inner')}
|
|
12
|
+
style={scope.getStyle('inner')}
|
|
13
|
+
>
|
|
14
|
+
<ElLabel {...props} scope={scope}></ElLabel>
|
|
15
|
+
<UIChildren {...props} scope={scope} />
|
|
16
|
+
|
|
17
|
+
<div
|
|
18
|
+
className={scope.getStyleClass('bottom')}
|
|
19
|
+
style={scope.getStyle('bottom')}
|
|
20
|
+
>
|
|
21
|
+
<ElInclude {...props} scope={scope} name="bottom" />
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
);
|
|
25
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { ChildType, Scope, Utils } from "react-crud-utils";
|
|
3
|
-
|
|
4
|
-
export default function ElChart(props: ChildType) {
|
|
5
|
-
let scope: Scope = props.scope;
|
|
6
|
-
let items: any = scope.getItems();
|
|
7
|
-
let columns = Utils.asList(scope.original.columns);
|
|
8
|
-
|
|
9
|
-
return <div className="ui-chart-data"></div>;
|
|
10
|
-
}
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ChildType, Scope, Utils } from "react-crud-utils";
|
|
3
|
+
|
|
4
|
+
export default function ElChart(props: ChildType) {
|
|
5
|
+
let scope: Scope = props.scope;
|
|
6
|
+
let items: any = scope.getItems();
|
|
7
|
+
let columns = Utils.asList(scope.original.columns);
|
|
8
|
+
|
|
9
|
+
return <div className="ui-chart-data"></div>;
|
|
10
|
+
}
|
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
import { useState } from 'react';
|
|
2
|
-
import { ChildType, Utils } from 'react-crud-utils';
|
|
3
|
-
import { StyleSheet, TextInput } from 'react-native';
|
|
4
|
-
|
|
5
|
-
export default function Input(props: ChildType) {
|
|
6
|
-
let scope = props.scope;
|
|
7
|
-
let initial = Utils.nvl(scope.getValue(), '');
|
|
8
|
-
|
|
9
|
-
let label = scope.getLabel();
|
|
10
|
-
let placeholder = scope.getPart('placeholder', null, label);
|
|
11
|
-
|
|
12
|
-
const [value, setValue] = useState(initial);
|
|
13
|
-
|
|
14
|
-
let onChange = v => {
|
|
15
|
-
scope.changeValue(v);
|
|
16
|
-
|
|
17
|
-
setValue(v);
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
return (
|
|
21
|
-
<TextInput
|
|
22
|
-
style={styles.input}
|
|
23
|
-
onChangeText={onChange}
|
|
24
|
-
value={value}
|
|
25
|
-
placeholder={placeholder}
|
|
26
|
-
/>
|
|
27
|
-
);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
const styles = StyleSheet.create({
|
|
31
|
-
input: {
|
|
32
|
-
borderRadius: 20,
|
|
33
|
-
padding: 10,
|
|
34
|
-
paddingLeft: 20,
|
|
35
|
-
paddingRight: 20,
|
|
36
|
-
height: 40,
|
|
37
|
-
borderWidth: 1,
|
|
38
|
-
width: '100%',
|
|
39
|
-
},
|
|
40
|
-
});
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import { ChildType, Utils } from 'react-crud-utils';
|
|
3
|
+
import { StyleSheet, TextInput } from 'react-native';
|
|
4
|
+
|
|
5
|
+
export default function Input(props: ChildType) {
|
|
6
|
+
let scope = props.scope;
|
|
7
|
+
let initial = Utils.nvl(scope.getValue(), '');
|
|
8
|
+
|
|
9
|
+
let label = scope.getLabel();
|
|
10
|
+
let placeholder = scope.getPart('placeholder', null, label);
|
|
11
|
+
|
|
12
|
+
const [value, setValue] = useState(initial);
|
|
13
|
+
|
|
14
|
+
let onChange = v => {
|
|
15
|
+
scope.changeValue(v);
|
|
16
|
+
|
|
17
|
+
setValue(v);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<TextInput
|
|
22
|
+
style={styles.input}
|
|
23
|
+
onChangeText={onChange}
|
|
24
|
+
value={value}
|
|
25
|
+
placeholder={placeholder}
|
|
26
|
+
/>
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const styles = StyleSheet.create({
|
|
31
|
+
input: {
|
|
32
|
+
borderRadius: 20,
|
|
33
|
+
padding: 10,
|
|
34
|
+
paddingLeft: 20,
|
|
35
|
+
paddingRight: 20,
|
|
36
|
+
height: 40,
|
|
37
|
+
borderWidth: 1,
|
|
38
|
+
width: '100%',
|
|
39
|
+
},
|
|
40
|
+
});
|
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
import ElGridRow from './ElGridRow';
|
|
2
|
-
import ElGridTop from './ElGridTop';
|
|
3
|
-
import ElGridFilter from './ElGridFilter';
|
|
4
|
-
import ElGridBotom from './ElGridBotom';
|
|
5
|
-
import ElLabel from './ElLabel';
|
|
6
|
-
import { ChildType, ComponentUtils, Scope } from 'react-crud-utils';
|
|
7
|
-
|
|
8
|
-
export default function ElGrid(props: ChildType) {
|
|
9
|
-
let scope: Scope = props.scope;
|
|
10
|
-
let items: any = scope.getItems();
|
|
11
|
-
let expansion = ComponentUtils.getDefine(props, 'expansion');
|
|
12
|
-
|
|
13
|
-
return (
|
|
14
|
-
<div
|
|
15
|
-
className={scope.getStyleClass('inner')}
|
|
16
|
-
style={scope.getStyle('inner')}
|
|
17
|
-
>
|
|
18
|
-
<ElLabel {...props} scope={scope} position="outside"></ElLabel>
|
|
19
|
-
<div
|
|
20
|
-
className={scope.getStyleClass('child')}
|
|
21
|
-
style={scope.getStyle('child')}
|
|
22
|
-
>
|
|
23
|
-
<ElLabel {...props} scope={scope} position="inside"></ElLabel>
|
|
24
|
-
<div className="ui-data">
|
|
25
|
-
<ElGridTop {...props} scope={scope}></ElGridTop>
|
|
26
|
-
<ElGridFilter scope={scope}></ElGridFilter>
|
|
27
|
-
<div className="ui-grid-data">
|
|
28
|
-
<table className="ui-grid ui-table">
|
|
29
|
-
<tbody>
|
|
30
|
-
{items.map((row: any, i: number) => (
|
|
31
|
-
<ElGridRow
|
|
32
|
-
{...props}
|
|
33
|
-
expansion={expansion}
|
|
34
|
-
key={'r' + i}
|
|
35
|
-
scope={scope}
|
|
36
|
-
value={row}
|
|
37
|
-
index={i}
|
|
38
|
-
/>
|
|
39
|
-
))}
|
|
40
|
-
</tbody>
|
|
41
|
-
</table>
|
|
42
|
-
</div>
|
|
43
|
-
</div>
|
|
44
|
-
<ElGridBotom {...props} scope={scope} />
|
|
45
|
-
</div>
|
|
46
|
-
</div>
|
|
47
|
-
);
|
|
48
|
-
}
|
|
1
|
+
import ElGridRow from './ElGridRow';
|
|
2
|
+
import ElGridTop from './ElGridTop';
|
|
3
|
+
import ElGridFilter from './ElGridFilter';
|
|
4
|
+
import ElGridBotom from './ElGridBotom';
|
|
5
|
+
import ElLabel from './ElLabel';
|
|
6
|
+
import { ChildType, ComponentUtils, Scope } from 'react-crud-utils';
|
|
7
|
+
|
|
8
|
+
export default function ElGrid(props: ChildType) {
|
|
9
|
+
let scope: Scope = props.scope;
|
|
10
|
+
let items: any = scope.getItems();
|
|
11
|
+
let expansion = ComponentUtils.getDefine(props, 'expansion');
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<div
|
|
15
|
+
className={scope.getStyleClass('inner')}
|
|
16
|
+
style={scope.getStyle('inner')}
|
|
17
|
+
>
|
|
18
|
+
<ElLabel {...props} scope={scope} position="outside"></ElLabel>
|
|
19
|
+
<div
|
|
20
|
+
className={scope.getStyleClass('child')}
|
|
21
|
+
style={scope.getStyle('child')}
|
|
22
|
+
>
|
|
23
|
+
<ElLabel {...props} scope={scope} position="inside"></ElLabel>
|
|
24
|
+
<div className="ui-data">
|
|
25
|
+
<ElGridTop {...props} scope={scope}></ElGridTop>
|
|
26
|
+
<ElGridFilter scope={scope}></ElGridFilter>
|
|
27
|
+
<div className="ui-grid-data">
|
|
28
|
+
<table className="ui-grid ui-table">
|
|
29
|
+
<tbody>
|
|
30
|
+
{items.map((row: any, i: number) => (
|
|
31
|
+
<ElGridRow
|
|
32
|
+
{...props}
|
|
33
|
+
expansion={expansion}
|
|
34
|
+
key={'r' + i}
|
|
35
|
+
scope={scope}
|
|
36
|
+
value={row}
|
|
37
|
+
index={i}
|
|
38
|
+
/>
|
|
39
|
+
))}
|
|
40
|
+
</tbody>
|
|
41
|
+
</table>
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
<ElGridBotom {...props} scope={scope} />
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
);
|
|
48
|
+
}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import React, { useState } from "react";
|
|
2
|
-
import ElGridPaginator from "./ElGridPaginator";
|
|
3
|
-
import UI from "../UI";
|
|
4
|
-
import { ChildType } from "react-crud-utils";
|
|
5
|
-
|
|
6
|
-
export default function ElGridBotom(props: ChildType) {
|
|
7
|
-
let scope = props.scope;
|
|
8
|
-
let children = props.children;
|
|
9
|
-
|
|
10
|
-
return (
|
|
11
|
-
<div className="ui-grid-bottom">
|
|
12
|
-
<div className="ui-grid-bottom-inner">
|
|
13
|
-
<UI.Include {...props} transient name="bottomLeft" />
|
|
14
|
-
<ElGridPaginator scope={scope} position="bottom">
|
|
15
|
-
{children}
|
|
16
|
-
</ElGridPaginator>
|
|
17
|
-
<UI.Include {...props} transient name="bottomRight" />
|
|
18
|
-
</div>
|
|
19
|
-
</div>
|
|
20
|
-
);
|
|
21
|
-
}
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import ElGridPaginator from "./ElGridPaginator";
|
|
3
|
+
import UI from "../UI";
|
|
4
|
+
import { ChildType } from "react-crud-utils";
|
|
5
|
+
|
|
6
|
+
export default function ElGridBotom(props: ChildType) {
|
|
7
|
+
let scope = props.scope;
|
|
8
|
+
let children = props.children;
|
|
9
|
+
|
|
10
|
+
return (
|
|
11
|
+
<div className="ui-grid-bottom">
|
|
12
|
+
<div className="ui-grid-bottom-inner">
|
|
13
|
+
<UI.Include {...props} transient name="bottomLeft" />
|
|
14
|
+
<ElGridPaginator scope={scope} position="bottom">
|
|
15
|
+
{children}
|
|
16
|
+
</ElGridPaginator>
|
|
17
|
+
<UI.Include {...props} transient name="bottomRight" />
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
);
|
|
21
|
+
}
|
|
@@ -1,67 +1,67 @@
|
|
|
1
|
-
import UI from '../UI';
|
|
2
|
-
import Ionicons from '@expo/vector-icons/Ionicons';
|
|
3
|
-
import { useState } from 'react';
|
|
4
|
-
import { GridRowType, Utils } from 'react-crud-utils';
|
|
5
|
-
|
|
6
|
-
export default function ElGridCheck({ scope, value, rowIndex }: GridRowType) {
|
|
7
|
-
let original = scope.original;
|
|
8
|
-
let [index, setIndex] = useState(0);
|
|
9
|
-
let key = scope.key('check', rowIndex, 's', index);
|
|
10
|
-
|
|
11
|
-
let check = () => {
|
|
12
|
-
let cs = scope.crudSearch;
|
|
13
|
-
|
|
14
|
-
if (cs) {
|
|
15
|
-
if (!cs.selecteds) {
|
|
16
|
-
cs.selecteds = {};
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
let itemValue = Utils.nvl(original.itemValue, 'id');
|
|
20
|
-
let key = value[itemValue];
|
|
21
|
-
|
|
22
|
-
if (typeof key !== 'undefined') {
|
|
23
|
-
if (typeof cs.selecteds[key] === 'undefined') {
|
|
24
|
-
cs.selecteds[key] = value;
|
|
25
|
-
} else {
|
|
26
|
-
delete cs.selecteds[key];
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
setIndex(++index);
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
let getCheckIcon = () => {
|
|
34
|
-
if (isChecked()) {
|
|
35
|
-
return <Ionicons />;
|
|
36
|
-
}
|
|
37
|
-
return <Ionicons />;
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
let isChecked = () => {
|
|
41
|
-
let cs = scope.crudSearch;
|
|
42
|
-
|
|
43
|
-
if (cs) {
|
|
44
|
-
if (!cs.selecteds) {
|
|
45
|
-
cs.selecteds = {};
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
let itemValue = Utils.nvl(original.itemValue, 'id');
|
|
49
|
-
let key = value[itemValue];
|
|
50
|
-
|
|
51
|
-
if (typeof key !== 'undefined') {
|
|
52
|
-
if (typeof cs.selecteds[key] !== 'undefined') {
|
|
53
|
-
return true;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
return false;
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
return (
|
|
61
|
-
<UI.Button
|
|
62
|
-
key={key}
|
|
63
|
-
icon={getCheckIcon()}
|
|
64
|
-
click={{ action: check }}
|
|
65
|
-
></UI.Button>
|
|
66
|
-
);
|
|
67
|
-
}
|
|
1
|
+
import UI from '../UI';
|
|
2
|
+
import Ionicons from '@expo/vector-icons/Ionicons';
|
|
3
|
+
import { useState } from 'react';
|
|
4
|
+
import { GridRowType, Utils } from 'react-crud-utils';
|
|
5
|
+
|
|
6
|
+
export default function ElGridCheck({ scope, value, rowIndex }: GridRowType) {
|
|
7
|
+
let original = scope.original;
|
|
8
|
+
let [index, setIndex] = useState(0);
|
|
9
|
+
let key = scope.key('check', rowIndex, 's', index);
|
|
10
|
+
|
|
11
|
+
let check = () => {
|
|
12
|
+
let cs = scope.crudSearch;
|
|
13
|
+
|
|
14
|
+
if (cs) {
|
|
15
|
+
if (!cs.selecteds) {
|
|
16
|
+
cs.selecteds = {};
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
let itemValue = Utils.nvl(original.itemValue, 'id');
|
|
20
|
+
let key = value[itemValue];
|
|
21
|
+
|
|
22
|
+
if (typeof key !== 'undefined') {
|
|
23
|
+
if (typeof cs.selecteds[key] === 'undefined') {
|
|
24
|
+
cs.selecteds[key] = value;
|
|
25
|
+
} else {
|
|
26
|
+
delete cs.selecteds[key];
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
setIndex(++index);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
let getCheckIcon = () => {
|
|
34
|
+
if (isChecked()) {
|
|
35
|
+
return <Ionicons />;
|
|
36
|
+
}
|
|
37
|
+
return <Ionicons />;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
let isChecked = () => {
|
|
41
|
+
let cs = scope.crudSearch;
|
|
42
|
+
|
|
43
|
+
if (cs) {
|
|
44
|
+
if (!cs.selecteds) {
|
|
45
|
+
cs.selecteds = {};
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
let itemValue = Utils.nvl(original.itemValue, 'id');
|
|
49
|
+
let key = value[itemValue];
|
|
50
|
+
|
|
51
|
+
if (typeof key !== 'undefined') {
|
|
52
|
+
if (typeof cs.selecteds[key] !== 'undefined') {
|
|
53
|
+
return true;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return false;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
return (
|
|
61
|
+
<UI.Button
|
|
62
|
+
key={key}
|
|
63
|
+
icon={getCheckIcon()}
|
|
64
|
+
click={{ action: check }}
|
|
65
|
+
></UI.Button>
|
|
66
|
+
);
|
|
67
|
+
}
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import React, { useState } from "react";
|
|
2
|
-
import UIChildren from "../UIChildren";
|
|
3
|
-
import { Scope, Utils } from "react-crud-utils";
|
|
4
|
-
|
|
5
|
-
interface ElGridColumnType {
|
|
6
|
-
scope: Scope;
|
|
7
|
-
styleClass?: string;
|
|
8
|
-
children?: any;
|
|
9
|
-
colspan?: number;
|
|
10
|
-
column?: any;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export default function ElGridColumn(props: ElGridColumnType) {
|
|
14
|
-
let scope = props.scope;
|
|
15
|
-
let col = Utils.nvl(props.column?.props, {});
|
|
16
|
-
let [colScope] = useState(new Scope(col, scope, scope.crud));
|
|
17
|
-
|
|
18
|
-
let getStyleClass = () => {
|
|
19
|
-
let def = Utils.nvl(props.styleClass, "");
|
|
20
|
-
|
|
21
|
-
return "ui-grid-col " + def + " " + colScope.getStyleClass("column");
|
|
22
|
-
};
|
|
23
|
-
return (
|
|
24
|
-
<td
|
|
25
|
-
className={getStyleClass()}
|
|
26
|
-
style={colScope.getStyle("column")}
|
|
27
|
-
colSpan={props.colspan}
|
|
28
|
-
>
|
|
29
|
-
<UIChildren scope={scope}>{props.children}</UIChildren>
|
|
30
|
-
</td>
|
|
31
|
-
);
|
|
32
|
-
}
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import UIChildren from "../UIChildren";
|
|
3
|
+
import { Scope, Utils } from "react-crud-utils";
|
|
4
|
+
|
|
5
|
+
interface ElGridColumnType {
|
|
6
|
+
scope: Scope;
|
|
7
|
+
styleClass?: string;
|
|
8
|
+
children?: any;
|
|
9
|
+
colspan?: number;
|
|
10
|
+
column?: any;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export default function ElGridColumn(props: ElGridColumnType) {
|
|
14
|
+
let scope = props.scope;
|
|
15
|
+
let col = Utils.nvl(props.column?.props, {});
|
|
16
|
+
let [colScope] = useState(new Scope(col, scope, scope.crud));
|
|
17
|
+
|
|
18
|
+
let getStyleClass = () => {
|
|
19
|
+
let def = Utils.nvl(props.styleClass, "");
|
|
20
|
+
|
|
21
|
+
return "ui-grid-col " + def + " " + colScope.getStyleClass("column");
|
|
22
|
+
};
|
|
23
|
+
return (
|
|
24
|
+
<td
|
|
25
|
+
className={getStyleClass()}
|
|
26
|
+
style={colScope.getStyle("column")}
|
|
27
|
+
colSpan={props.colspan}
|
|
28
|
+
>
|
|
29
|
+
<UIChildren scope={scope}>{props.children}</UIChildren>
|
|
30
|
+
</td>
|
|
31
|
+
);
|
|
32
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ChildType } from "react-crud-utils";
|
|
2
|
-
|
|
3
|
-
export default function ElGridFilter(props: ChildType) {
|
|
4
|
-
return <></>;
|
|
5
|
-
}
|
|
1
|
+
import { ChildType } from "react-crud-utils";
|
|
2
|
+
|
|
3
|
+
export default function ElGridFilter(props: ChildType) {
|
|
4
|
+
return <></>;
|
|
5
|
+
}
|