cx 24.9.0 → 24.9.2
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/manifest.js +737 -737
- package/dist/widgets.css +3 -6
- package/dist/widgets.js +6 -5
- package/package.json +1 -1
- package/src/ui/layout/LabelsTopLayout.js +134 -134
- package/src/widgets/form/ColorField.js +397 -397
- package/src/widgets/form/ColorField.scss +2 -1
- package/src/widgets/form/DateTimeField.js +573 -573
- package/src/widgets/form/LookupField.scss +2 -2
- package/src/widgets/form/MonthField.js +516 -516
- package/src/widgets/form/NumberField.js +459 -459
- package/src/widgets/form/Radio.scss +1 -2
- package/src/widgets/form/TextField.js +2 -1
package/dist/widgets.css
CHANGED
|
@@ -1224,7 +1224,6 @@ th.cxe-calendar-display {
|
|
|
1224
1224
|
}
|
|
1225
1225
|
|
|
1226
1226
|
.cxe-lookupfield-input {
|
|
1227
|
-
height: 100%;
|
|
1228
1227
|
box-sizing: border-box;
|
|
1229
1228
|
line-height: 16px;
|
|
1230
1229
|
padding: 5px 24px 5px 5px;
|
|
@@ -1238,10 +1237,10 @@ th.cxe-calendar-display {
|
|
|
1238
1237
|
color: black;
|
|
1239
1238
|
outline-offset: 0;
|
|
1240
1239
|
box-shadow: none;
|
|
1241
|
-
text-overflow: ellipsis;
|
|
1242
1240
|
-ms-appearance: none;
|
|
1243
1241
|
-moz-appearance: none;
|
|
1244
1242
|
-webkit-appearance: none;
|
|
1243
|
+
height: 100%;
|
|
1245
1244
|
}
|
|
1246
1245
|
.cxe-lookupfield-input:focus {
|
|
1247
1246
|
border-color: rgba(77, 144, 254, 0.8);
|
|
@@ -2058,7 +2057,6 @@ th.cxe-calendar-display {
|
|
|
2058
2057
|
left: 0;
|
|
2059
2058
|
display: inline-block;
|
|
2060
2059
|
position: absolute;
|
|
2061
|
-
border-radius: 50%;
|
|
2062
2060
|
opacity: 1;
|
|
2063
2061
|
box-sizing: border-box;
|
|
2064
2062
|
line-height: 16px;
|
|
@@ -2068,7 +2066,7 @@ th.cxe-calendar-display {
|
|
|
2068
2066
|
font-family: inherit;
|
|
2069
2067
|
border-color: #bfbfbf;
|
|
2070
2068
|
border-style: solid;
|
|
2071
|
-
border-radius:
|
|
2069
|
+
border-radius: 50%;
|
|
2072
2070
|
background-color: white;
|
|
2073
2071
|
color: currentColor;
|
|
2074
2072
|
outline-offset: 0;
|
|
@@ -2406,7 +2404,6 @@ th.cxe-calendar-display {
|
|
|
2406
2404
|
}
|
|
2407
2405
|
.cxe-colorfield-left-icon {
|
|
2408
2406
|
box-sizing: border-box;
|
|
2409
|
-
opacity: 1;
|
|
2410
2407
|
background-image: linear-gradient(45deg, rgba(128, 128, 128, 0.5) 25%, transparent 25%), linear-gradient(-45deg, rgba(128, 128, 128, 0.5) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, rgba(128, 128, 128, 0.5) 75%), linear-gradient(-45deg, transparent 75%, rgba(128, 128, 128, 0.5) 75%);
|
|
2411
2408
|
background-size: 8px 8px;
|
|
2412
2409
|
background-position: 0 0, 0 4px, 4px -4px, -4px 0px;
|
|
@@ -2419,7 +2416,7 @@ th.cxe-calendar-display {
|
|
|
2419
2416
|
height: 16px;
|
|
2420
2417
|
width: 16px;
|
|
2421
2418
|
line-height: 16px;
|
|
2422
|
-
opacity:
|
|
2419
|
+
opacity: 1;
|
|
2423
2420
|
text-align: center;
|
|
2424
2421
|
cursor: pointer;
|
|
2425
2422
|
}
|
package/dist/widgets.js
CHANGED
|
@@ -7137,7 +7137,8 @@ var Input$2 = /*#__PURE__*/ (function (_VDOM$Component) {
|
|
|
7137
7137
|
autoFocus(this.input, this);
|
|
7138
7138
|
};
|
|
7139
7139
|
_proto2.componentWillUnmount = function componentWillUnmount() {
|
|
7140
|
-
if (this.input == getActiveElement()
|
|
7140
|
+
if (this.input == getActiveElement() && this.input.value != this.props.data.value)
|
|
7141
|
+
this.onChange(this.input.value, "blur");
|
|
7141
7142
|
tooltipParentWillUnmount$1(this.props.instance);
|
|
7142
7143
|
};
|
|
7143
7144
|
_proto2.onKeyDown = function onKeyDown(e) {
|
|
@@ -10146,7 +10147,7 @@ var Input$1 = /*#__PURE__*/ (function (_VDOM$Component) {
|
|
|
10146
10147
|
autoFocus(this.input, this);
|
|
10147
10148
|
};
|
|
10148
10149
|
_proto2.componentWillUnmount = function componentWillUnmount() {
|
|
10149
|
-
if (this.input == getActiveElement()) {
|
|
10150
|
+
if (this.input == getActiveElement() && this.input.value != this.props.data.formatted) {
|
|
10150
10151
|
this.onChange(
|
|
10151
10152
|
{
|
|
10152
10153
|
target: {
|
|
@@ -12416,7 +12417,7 @@ var MonthInput = /*#__PURE__*/ (function (_VDOM$Component) {
|
|
|
12416
12417
|
autoFocus(this.input, this);
|
|
12417
12418
|
};
|
|
12418
12419
|
_proto2.componentWillUnmount = function componentWillUnmount() {
|
|
12419
|
-
if (this.input == getActiveElement()) {
|
|
12420
|
+
if (this.input == getActiveElement() && this.input.value != this.props.data.formatted) {
|
|
12420
12421
|
this.onChange(this.input.value, "blur");
|
|
12421
12422
|
}
|
|
12422
12423
|
tooltipParentWillUnmount$1(this.props.instance);
|
|
@@ -12801,7 +12802,7 @@ var ColorInput = /*#__PURE__*/ (function (_VDOM$Component) {
|
|
|
12801
12802
|
if (this.props.instance.widget.autoFocus && !isTouchDevice()) this.input.focus();
|
|
12802
12803
|
};
|
|
12803
12804
|
_proto2.componentWillUnmount = function componentWillUnmount() {
|
|
12804
|
-
if (this.input == getActiveElement()) {
|
|
12805
|
+
if (this.input == getActiveElement() && this.input.value != this.props.data.value) {
|
|
12805
12806
|
this.onChange(this.input.value, "blur");
|
|
12806
12807
|
}
|
|
12807
12808
|
tooltipParentWillUnmount$1(this.props.instance);
|
|
@@ -14948,7 +14949,7 @@ var DateTimeInput = /*#__PURE__*/ (function (_VDOM$Component) {
|
|
|
14948
14949
|
autoFocus(this.input, this);
|
|
14949
14950
|
};
|
|
14950
14951
|
_proto2.componentWillUnmount = function componentWillUnmount() {
|
|
14951
|
-
if (this.input == getActiveElement()) {
|
|
14952
|
+
if (this.input == getActiveElement() && this.input.value != this.props.data.formatted) {
|
|
14952
14953
|
this.onChange(this.input.value, "blur");
|
|
14953
14954
|
}
|
|
14954
14955
|
tooltipParentWillUnmount$1(this.props.instance);
|
package/package.json
CHANGED
|
@@ -1,135 +1,135 @@
|
|
|
1
|
-
import {VDOM, getContent, contentAppend} from '../Widget';
|
|
2
|
-
import {Container} from '../Container';
|
|
3
|
-
import {PureContainer} from '../PureContainer';
|
|
4
|
-
import {isArray} from '../../util/isArray';
|
|
5
|
-
import {isUndefined} from '../../util/isUndefined';
|
|
6
|
-
import {isNumber} from "../../util/isNumber";
|
|
7
|
-
|
|
8
|
-
function validContent(r) {
|
|
9
|
-
let content = [];
|
|
10
|
-
for (let key in r)
|
|
11
|
-
if (key != "label")
|
|
12
|
-
contentAppend(content, r[key]);
|
|
13
|
-
return content;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export class LabelsTopLayout extends Container {
|
|
17
|
-
|
|
18
|
-
init() {
|
|
19
|
-
if (this.vertical && isUndefined(this.columns))
|
|
20
|
-
this.columns = 1;
|
|
21
|
-
|
|
22
|
-
super.init();
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
render(context, instance, key) {
|
|
26
|
-
let {children, data} = instance;
|
|
27
|
-
|
|
28
|
-
let state = {
|
|
29
|
-
rows: [],
|
|
30
|
-
currentRow: 0,
|
|
31
|
-
labelCells: [],
|
|
32
|
-
fieldCells: [],
|
|
33
|
-
rowCapacities: [this.columns]
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
const processContent = (r) => {
|
|
37
|
-
if (!r)
|
|
38
|
-
return;
|
|
39
|
-
if (isArray(r.content) && r.useParentLayout)
|
|
40
|
-
r.content.forEach((x) => processContent(x));
|
|
41
|
-
else if (r.atomic && r.type == "layout-cell")
|
|
42
|
-
this.addItem(state, isArray(r.content) && r.content.length == 1 ? r.content[0] : r.content, r.data);
|
|
43
|
-
else
|
|
44
|
-
this.addItem(state, r, {});
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
children.forEach(item => processContent(item.vdom));
|
|
48
|
-
|
|
49
|
-
this.addRow(state);
|
|
50
|
-
|
|
51
|
-
return <table key={key} className={data.classNames} style={data.style}>
|
|
52
|
-
<tbody>
|
|
53
|
-
{state.rows}
|
|
54
|
-
</tbody>
|
|
55
|
-
</table>;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
addRow(state) {
|
|
59
|
-
if (state.labelCells.length > 0)
|
|
60
|
-
state.rows.push(<tr key={state.rows.length}>{state.labelCells}</tr>);
|
|
61
|
-
|
|
62
|
-
if (state.fieldCells.length > 0)
|
|
63
|
-
state.rows.push(<tr key={state.rows.length}>{state.fieldCells}</tr>);
|
|
64
|
-
|
|
65
|
-
state.labelCells = [];
|
|
66
|
-
state.fieldCells = [];
|
|
67
|
-
state.currentRow++;
|
|
68
|
-
if (state.currentRow == state.rowCapacities.length)
|
|
69
|
-
state.rowCapacities.push(this.columns);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
addItem(state, item, data) {
|
|
74
|
-
|
|
75
|
-
while (state.labelCells.length == state.rowCapacities[state.currentRow])
|
|
76
|
-
this.addRow(state);
|
|
77
|
-
|
|
78
|
-
if (data.rowSpan > 1) {
|
|
79
|
-
for (let row = state.currentRow + 1; row < state.currentRow + data.rowSpan; row++) {
|
|
80
|
-
if (row == state.rowCapacities.length)
|
|
81
|
-
state.rowCapacities.push(this.columns);
|
|
82
|
-
state.rowCapacities[row] -= data.colSpan || 1;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
if (data.colSpan > 1)
|
|
87
|
-
state.rowCapacities[state.currentRow] -= data.colSpan - 1;
|
|
88
|
-
|
|
89
|
-
state.labelCells.push(
|
|
90
|
-
<td className={this.CSS.element(this.baseClass, "label")} key={state.labelCells.length} colSpan={data.colSpan}>
|
|
91
|
-
{getContent(item.label)}
|
|
92
|
-
</td>
|
|
93
|
-
);
|
|
94
|
-
state.fieldCells.push(
|
|
95
|
-
<td className={this.CSS.element(this.baseClass, "field")}
|
|
96
|
-
key={state.fieldCells.length}
|
|
97
|
-
colSpan={data.colSpan}
|
|
98
|
-
rowSpan={isNumber(data.rowSpan) ? 2 * data.rowSpan - 1 : undefined}
|
|
99
|
-
style={data.style}
|
|
100
|
-
>
|
|
101
|
-
{validContent(item)}
|
|
102
|
-
</td>
|
|
103
|
-
);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
LabelsTopLayout.prototype.baseClass = 'labelstoplayout';
|
|
108
|
-
LabelsTopLayout.prototype.vertical = false;
|
|
109
|
-
LabelsTopLayout.prototype.columns = undefined;
|
|
110
|
-
LabelsTopLayout.prototype.styled = true;
|
|
111
|
-
|
|
112
|
-
export class LabelsTopLayoutCell extends PureContainer {
|
|
113
|
-
|
|
114
|
-
declareData(...args) {
|
|
115
|
-
super.declareData(...args, {
|
|
116
|
-
colSpan: undefined,
|
|
117
|
-
rowSpan: undefined
|
|
118
|
-
})
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
render(context, instance, key) {
|
|
122
|
-
|
|
123
|
-
let { content } = this.renderChildren(context, instance);
|
|
124
|
-
|
|
125
|
-
return {
|
|
126
|
-
atomic: true,
|
|
127
|
-
type: 'layout-cell',
|
|
128
|
-
data: instance.data,
|
|
129
|
-
content
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
LabelsTopLayoutCell.prototype.styled = true;
|
|
1
|
+
import {VDOM, getContent, contentAppend} from '../Widget';
|
|
2
|
+
import {Container} from '../Container';
|
|
3
|
+
import {PureContainer} from '../PureContainer';
|
|
4
|
+
import {isArray} from '../../util/isArray';
|
|
5
|
+
import {isUndefined} from '../../util/isUndefined';
|
|
6
|
+
import {isNumber} from "../../util/isNumber";
|
|
7
|
+
|
|
8
|
+
function validContent(r) {
|
|
9
|
+
let content = [];
|
|
10
|
+
for (let key in r)
|
|
11
|
+
if (key != "label")
|
|
12
|
+
contentAppend(content, r[key]);
|
|
13
|
+
return content;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export class LabelsTopLayout extends Container {
|
|
17
|
+
|
|
18
|
+
init() {
|
|
19
|
+
if (this.vertical && isUndefined(this.columns))
|
|
20
|
+
this.columns = 1;
|
|
21
|
+
|
|
22
|
+
super.init();
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
render(context, instance, key) {
|
|
26
|
+
let {children, data} = instance;
|
|
27
|
+
|
|
28
|
+
let state = {
|
|
29
|
+
rows: [],
|
|
30
|
+
currentRow: 0,
|
|
31
|
+
labelCells: [],
|
|
32
|
+
fieldCells: [],
|
|
33
|
+
rowCapacities: [this.columns]
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const processContent = (r) => {
|
|
37
|
+
if (!r)
|
|
38
|
+
return;
|
|
39
|
+
if (isArray(r.content) && r.useParentLayout)
|
|
40
|
+
r.content.forEach((x) => processContent(x));
|
|
41
|
+
else if (r.atomic && r.type == "layout-cell")
|
|
42
|
+
this.addItem(state, isArray(r.content) && r.content.length == 1 ? r.content[0] : r.content, r.data);
|
|
43
|
+
else
|
|
44
|
+
this.addItem(state, r, {});
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
children.forEach(item => processContent(item.vdom));
|
|
48
|
+
|
|
49
|
+
this.addRow(state);
|
|
50
|
+
|
|
51
|
+
return <table key={key} className={data.classNames} style={data.style}>
|
|
52
|
+
<tbody>
|
|
53
|
+
{state.rows}
|
|
54
|
+
</tbody>
|
|
55
|
+
</table>;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
addRow(state) {
|
|
59
|
+
if (state.labelCells.length > 0)
|
|
60
|
+
state.rows.push(<tr key={state.rows.length}>{state.labelCells}</tr>);
|
|
61
|
+
|
|
62
|
+
if (state.fieldCells.length > 0)
|
|
63
|
+
state.rows.push(<tr key={state.rows.length}>{state.fieldCells}</tr>);
|
|
64
|
+
|
|
65
|
+
state.labelCells = [];
|
|
66
|
+
state.fieldCells = [];
|
|
67
|
+
state.currentRow++;
|
|
68
|
+
if (state.currentRow == state.rowCapacities.length)
|
|
69
|
+
state.rowCapacities.push(this.columns);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
addItem(state, item, data) {
|
|
74
|
+
|
|
75
|
+
while (state.labelCells.length == state.rowCapacities[state.currentRow])
|
|
76
|
+
this.addRow(state);
|
|
77
|
+
|
|
78
|
+
if (data.rowSpan > 1) {
|
|
79
|
+
for (let row = state.currentRow + 1; row < state.currentRow + data.rowSpan; row++) {
|
|
80
|
+
if (row == state.rowCapacities.length)
|
|
81
|
+
state.rowCapacities.push(this.columns);
|
|
82
|
+
state.rowCapacities[row] -= data.colSpan || 1;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
if (data.colSpan > 1)
|
|
87
|
+
state.rowCapacities[state.currentRow] -= data.colSpan - 1;
|
|
88
|
+
|
|
89
|
+
state.labelCells.push(
|
|
90
|
+
<td className={this.CSS.element(this.baseClass, "label")} key={state.labelCells.length} colSpan={data.colSpan}>
|
|
91
|
+
{getContent(item.label)}
|
|
92
|
+
</td>
|
|
93
|
+
);
|
|
94
|
+
state.fieldCells.push(
|
|
95
|
+
<td className={this.CSS.element(this.baseClass, "field")}
|
|
96
|
+
key={state.fieldCells.length}
|
|
97
|
+
colSpan={data.colSpan}
|
|
98
|
+
rowSpan={isNumber(data.rowSpan) ? 2 * data.rowSpan - 1 : undefined}
|
|
99
|
+
style={data.style}
|
|
100
|
+
>
|
|
101
|
+
{validContent(item)}
|
|
102
|
+
</td>
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
LabelsTopLayout.prototype.baseClass = 'labelstoplayout';
|
|
108
|
+
LabelsTopLayout.prototype.vertical = false;
|
|
109
|
+
LabelsTopLayout.prototype.columns = undefined;
|
|
110
|
+
LabelsTopLayout.prototype.styled = true;
|
|
111
|
+
|
|
112
|
+
export class LabelsTopLayoutCell extends PureContainer {
|
|
113
|
+
|
|
114
|
+
declareData(...args) {
|
|
115
|
+
super.declareData(...args, {
|
|
116
|
+
colSpan: undefined,
|
|
117
|
+
rowSpan: undefined
|
|
118
|
+
})
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
render(context, instance, key) {
|
|
122
|
+
|
|
123
|
+
let { content } = this.renderChildren(context, instance);
|
|
124
|
+
|
|
125
|
+
return {
|
|
126
|
+
atomic: true,
|
|
127
|
+
type: 'layout-cell',
|
|
128
|
+
data: instance.data,
|
|
129
|
+
content
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
LabelsTopLayoutCell.prototype.styled = true;
|
|
135
135
|
LabelsTopLayoutCell.prototype.useParentLayout = true;
|