cx 24.3.5 → 24.3.6
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/charts.js +1 -0
- package/dist/manifest.js +560 -560
- package/dist/widgets.js +4 -2
- package/package.json +1 -1
- package/src/charts/Swimlanes.d.ts +3 -3
- package/src/charts/Swimlanes.js +2 -0
- package/src/core.d.ts +1 -0
- package/src/widgets/form/Field.d.ts +1 -1
- package/src/widgets/form/Label.d.ts +8 -10
- package/src/widgets/form/Label.js +89 -88
- package/src/widgets/form/LabeledContainer.d.ts +3 -11
- package/src/widgets/form/ValidationGroup.d.ts +1 -1
- package/src/widgets/grid/Grid.d.ts +4 -2
- package/src/widgets/grid/Grid.js +2 -1
- package/src/widgets/grid/Grid.scss +680 -680
- package/src/widgets/grid/variables.scss +88 -88
package/dist/widgets.js
CHANGED
|
@@ -6348,6 +6348,7 @@ var Label = /*#__PURE__*/ (function (_HtmlElement) {
|
|
|
6348
6348
|
required: undefined,
|
|
6349
6349
|
disabled: undefined,
|
|
6350
6350
|
htmlFor: undefined,
|
|
6351
|
+
asterisk: undefined,
|
|
6351
6352
|
},
|
|
6352
6353
|
]),
|
|
6353
6354
|
);
|
|
@@ -6368,7 +6369,7 @@ var Label = /*#__PURE__*/ (function (_HtmlElement) {
|
|
|
6368
6369
|
data._disabled,
|
|
6369
6370
|
context.parentDisabled,
|
|
6370
6371
|
);
|
|
6371
|
-
data.asterisk = context.parentAsterisk ||
|
|
6372
|
+
data.asterisk = context.parentAsterisk || data.asterisk;
|
|
6372
6373
|
if (instance.cache("disabled", data.disabled) || instance.cache("asterisk", data.asterisk)) {
|
|
6373
6374
|
instance.markShouldUpdate(context);
|
|
6374
6375
|
this.prepareCSS(context, instance);
|
|
@@ -16636,6 +16637,7 @@ var GridComponent = /*#__PURE__*/ (function (_VDOM$Component) {
|
|
|
16636
16637
|
dragged: isDragged,
|
|
16637
16638
|
cursor: widget.selectable && index == cursor,
|
|
16638
16639
|
over: dropTarget == "row" && dropInsertionIndex === index,
|
|
16640
|
+
alternate: index % 2 == 1,
|
|
16639
16641
|
};
|
|
16640
16642
|
if (isRecordSelectable) {
|
|
16641
16643
|
var selectable = isRecordSelectable(record.data, {});
|
|
@@ -16932,7 +16934,7 @@ var GridComponent = /*#__PURE__*/ (function (_VDOM$Component) {
|
|
|
16932
16934
|
index++;
|
|
16933
16935
|
}
|
|
16934
16936
|
var count = 0;
|
|
16935
|
-
while (count < this.state.dropInsertionIndex) {
|
|
16937
|
+
while (index < children.length && count < this.state.dropInsertionIndex) {
|
|
16936
16938
|
var _children$index2;
|
|
16937
16939
|
if (
|
|
16938
16940
|
((_children$index2 = children[index]) == null ||
|
package/package.json
CHANGED
|
@@ -20,19 +20,19 @@ interface SwimlanesProps extends BoundedObjectProps {
|
|
|
20
20
|
baseClass?: string;
|
|
21
21
|
|
|
22
22
|
/** Represents a swimlane size. */
|
|
23
|
-
size?:
|
|
23
|
+
size?: Cx.NumberProp;
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
26
|
* Represents a swimlane step. Define a step on which a swimlane will be rendered. (eg. step 2 will render
|
|
27
27
|
* every second swimlane in the chart.)
|
|
28
28
|
*/
|
|
29
|
-
step?:
|
|
29
|
+
step?: Cx.NumberProp;
|
|
30
30
|
|
|
31
31
|
/** Switch to vertical swimlanes. */
|
|
32
32
|
vertical?: boolean;
|
|
33
33
|
|
|
34
34
|
/**The laneOffset property adjusts the positioning of lane elements, enhancing their alignment and readability. */
|
|
35
|
-
laneOffset?:
|
|
35
|
+
laneOffset?: Cx.NumberProp;
|
|
36
36
|
|
|
37
37
|
/** Style object applied to the swimlanes. */
|
|
38
38
|
laneStyle?: StyleProp;
|
package/src/charts/Swimlanes.js
CHANGED
package/src/core.d.ts
CHANGED
|
@@ -59,7 +59,7 @@ export interface FieldProps extends Cx.StyledContainerProps {
|
|
|
59
59
|
requiredText?: string;
|
|
60
60
|
|
|
61
61
|
/** Append asterisk to the label to indicate a required field. */
|
|
62
|
-
asterisk?:
|
|
62
|
+
asterisk?: Cx.BooleanProp;
|
|
63
63
|
|
|
64
64
|
/** Text displayed to the user to indicate that server-side validation is in progress. */
|
|
65
65
|
validatingText?: string;
|
|
@@ -1,25 +1,23 @@
|
|
|
1
|
-
import * as Cx from
|
|
1
|
+
import * as Cx from "../../core";
|
|
2
2
|
|
|
3
3
|
interface LabelProps extends Cx.HtmlElementProps {
|
|
4
|
-
|
|
5
4
|
/** Used in combination with `asterisk` to indicate required fields. */
|
|
6
|
-
required?: Cx.BooleanProp
|
|
5
|
+
required?: Cx.BooleanProp;
|
|
7
6
|
|
|
8
7
|
/** Set to true to disable the label. */
|
|
9
|
-
disabled?: Cx.BooleanProp
|
|
8
|
+
disabled?: Cx.BooleanProp;
|
|
10
9
|
|
|
11
10
|
/** Id of the field. */
|
|
12
|
-
htmlFor?: Cx.StringProp
|
|
13
|
-
|
|
11
|
+
htmlFor?: Cx.StringProp;
|
|
12
|
+
|
|
14
13
|
/** Base CSS class to be applied to the element. No class is applied by default. */
|
|
15
|
-
baseClass?: string
|
|
14
|
+
baseClass?: string;
|
|
16
15
|
|
|
17
16
|
/** Set to `true` to add red asterisk for required fields. */
|
|
18
|
-
asterisk?:
|
|
17
|
+
asterisk?: Cx.BooleanProp;
|
|
19
18
|
|
|
20
19
|
/** Name of the HTML element to be rendered. Default is `div`. */
|
|
21
|
-
tag?: string
|
|
22
|
-
|
|
20
|
+
tag?: string;
|
|
23
21
|
}
|
|
24
22
|
|
|
25
23
|
export class Label extends Cx.Widget<LabelProps> {}
|
|
@@ -1,88 +1,89 @@
|
|
|
1
|
-
import { Widget, VDOM } from "../../ui/Widget";
|
|
2
|
-
import { HtmlElement } from "../HtmlElement";
|
|
3
|
-
import { FocusManager } from "../../ui/FocusManager";
|
|
4
|
-
import { isArray } from "../../util/isArray";
|
|
5
|
-
import { coalesce } from "../../util/coalesce";
|
|
6
|
-
|
|
7
|
-
export class Label extends HtmlElement {
|
|
8
|
-
declareData() {
|
|
9
|
-
super.declareData(...arguments, {
|
|
10
|
-
required: undefined,
|
|
11
|
-
disabled: undefined,
|
|
12
|
-
htmlFor: undefined,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
data
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
case "
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
props.children.
|
|
77
|
-
props.children.push(
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
Label.prototype.
|
|
88
|
-
Label.prototype.
|
|
1
|
+
import { Widget, VDOM } from "../../ui/Widget";
|
|
2
|
+
import { HtmlElement } from "../HtmlElement";
|
|
3
|
+
import { FocusManager } from "../../ui/FocusManager";
|
|
4
|
+
import { isArray } from "../../util/isArray";
|
|
5
|
+
import { coalesce } from "../../util/coalesce";
|
|
6
|
+
|
|
7
|
+
export class Label extends HtmlElement {
|
|
8
|
+
declareData() {
|
|
9
|
+
super.declareData(...arguments, {
|
|
10
|
+
required: undefined,
|
|
11
|
+
disabled: undefined,
|
|
12
|
+
htmlFor: undefined,
|
|
13
|
+
asterisk: undefined,
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
prepareData(context, instance) {
|
|
18
|
+
let { data } = instance;
|
|
19
|
+
data.stateMods = {
|
|
20
|
+
...data.stateMods,
|
|
21
|
+
disabled: data.disabled,
|
|
22
|
+
};
|
|
23
|
+
data._disabled = data.disabled;
|
|
24
|
+
super.prepareData(context, instance);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
explore(context, instance) {
|
|
28
|
+
let { data } = instance;
|
|
29
|
+
|
|
30
|
+
if (!data.htmlFor) data.htmlFor = context.lastFieldId;
|
|
31
|
+
|
|
32
|
+
data.disabled = data.stateMods.disabled = coalesce(
|
|
33
|
+
context.parentStrict ? context.parentDisabled : null,
|
|
34
|
+
data._disabled,
|
|
35
|
+
context.parentDisabled
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
data.asterisk = context.parentAsterisk || data.asterisk;
|
|
39
|
+
|
|
40
|
+
if (instance.cache("disabled", data.disabled) || instance.cache("asterisk", data.asterisk)) {
|
|
41
|
+
instance.markShouldUpdate(context);
|
|
42
|
+
this.prepareCSS(context, instance);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
super.explore(context, instance);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
isValidHtmlAttribute(attrName) {
|
|
49
|
+
switch (attrName) {
|
|
50
|
+
case "asterisk":
|
|
51
|
+
case "required":
|
|
52
|
+
return false;
|
|
53
|
+
}
|
|
54
|
+
return super.isValidHtmlAttribute(attrName);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
attachProps(context, instance, props) {
|
|
58
|
+
super.attachProps(context, instance, props);
|
|
59
|
+
|
|
60
|
+
let { data } = instance;
|
|
61
|
+
|
|
62
|
+
if (data.htmlFor) {
|
|
63
|
+
props.htmlFor = data.htmlFor;
|
|
64
|
+
|
|
65
|
+
if (!props.onClick)
|
|
66
|
+
props.onClick = () => {
|
|
67
|
+
//additional focus for LookupFields which are not input based
|
|
68
|
+
let el = document.getElementById(instance.data.htmlFor);
|
|
69
|
+
if (el) FocusManager.focusFirst(el);
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if (!props.id && data.htmlFor) props.id = `${data.htmlFor}-label`;
|
|
74
|
+
|
|
75
|
+
if (data.required && data.asterisk) {
|
|
76
|
+
if (!isArray(props.children)) props.children = [props.children];
|
|
77
|
+
props.children.push(" ");
|
|
78
|
+
props.children.push(
|
|
79
|
+
<span key="asterisk" className={this.CSS.element(this.baseClass, "asterisk")}>
|
|
80
|
+
*
|
|
81
|
+
</span>
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
Label.prototype.baseClass = "label";
|
|
88
|
+
Label.prototype.tag = "label";
|
|
89
|
+
Label.prototype.asterisk = false;
|
|
@@ -1,17 +1,9 @@
|
|
|
1
|
-
import * as Cx from
|
|
2
|
-
import { FieldGroupProps } from
|
|
1
|
+
import * as Cx from "../../core";
|
|
2
|
+
import { FieldGroupProps } from "./FieldGroup";
|
|
3
3
|
|
|
4
4
|
interface LabeledContainerProps extends FieldGroupProps {
|
|
5
|
-
|
|
6
5
|
/** The label. */
|
|
7
|
-
label?: Cx.StringProp | Cx.Config
|
|
8
|
-
|
|
9
|
-
/** Set to true to disable all fields inside the container. */
|
|
10
|
-
disabled?: boolean,
|
|
11
|
-
|
|
12
|
-
/** Apply asterisk to the label. */
|
|
13
|
-
asterisk?: boolean
|
|
14
|
-
|
|
6
|
+
label?: Cx.StringProp | Cx.Config;
|
|
15
7
|
}
|
|
16
8
|
|
|
17
9
|
export class LabeledContainer extends Cx.Widget<LabeledContainerProps> {}
|
|
@@ -35,7 +35,7 @@ export interface ValidationGroupProps extends Cx.PureContainerProps {
|
|
|
35
35
|
strict?: Cx.BooleanProp;
|
|
36
36
|
|
|
37
37
|
/** Set to `true` to add red asterisk for all required fields inside the group. */
|
|
38
|
-
asterisk?:
|
|
38
|
+
asterisk?: Cx.BooleanProp;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
export class ValidationGroup extends Cx.Widget<ValidationGroupProps> {}
|
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
StructuredProp,
|
|
18
18
|
StyledContainerProps,
|
|
19
19
|
StyleProp,
|
|
20
|
+
UnknownProp,
|
|
20
21
|
Widget,
|
|
21
22
|
} from "../../core";
|
|
22
23
|
import { DataAdapterRecord } from "../../ui/adapter/DataAdapter";
|
|
@@ -108,6 +109,7 @@ interface GridColumnConfig {
|
|
|
108
109
|
aggregate?: "min" | "max" | "count" | "sum" | "distinct" | "avg";
|
|
109
110
|
aggregateAlias?: string;
|
|
110
111
|
aggregateField?: string;
|
|
112
|
+
aggregateValue?: UnknownProp;
|
|
111
113
|
caption?: StringProp;
|
|
112
114
|
class?: ClassProp;
|
|
113
115
|
className?: ClassProp;
|
|
@@ -319,7 +321,7 @@ interface GridProps<T = unknown> extends StyledContainerProps {
|
|
|
319
321
|
sortField?: string;
|
|
320
322
|
sortDirection?: string;
|
|
321
323
|
},
|
|
322
|
-
instance?: Instance
|
|
324
|
+
instance?: Instance
|
|
323
325
|
) => FetchRecordsResult | Promise<FetchRecordsResult>;
|
|
324
326
|
|
|
325
327
|
/** Callback function to be executed when a row is double-clicked. */
|
|
@@ -352,7 +354,7 @@ interface GridProps<T = unknown> extends StyledContainerProps {
|
|
|
352
354
|
/** Callback to create a function that can be used to check whether a record is selectable. */
|
|
353
355
|
onCreateIsRecordSelectable?: (
|
|
354
356
|
params: any,
|
|
355
|
-
instance: Instance
|
|
357
|
+
instance: Instance
|
|
356
358
|
) => (record: T, options?: { range?: boolean; toggle?: boolean }) => boolean;
|
|
357
359
|
|
|
358
360
|
/** Parameters whose change will cause scroll to be reset. */
|
package/src/widgets/grid/Grid.js
CHANGED
|
@@ -1324,6 +1324,7 @@ class GridComponent extends VDOM.Component {
|
|
|
1324
1324
|
dragged: isDragged,
|
|
1325
1325
|
cursor: widget.selectable && index == cursor,
|
|
1326
1326
|
over: dropTarget == "row" && dropInsertionIndex === index,
|
|
1327
|
+
alternate: index % 2 == 1,
|
|
1327
1328
|
};
|
|
1328
1329
|
|
|
1329
1330
|
if (isRecordSelectable) {
|
|
@@ -1597,7 +1598,7 @@ class GridComponent extends VDOM.Component {
|
|
|
1597
1598
|
while (index < children.length && children[index]?.props?.record?.type != "data") index++;
|
|
1598
1599
|
|
|
1599
1600
|
let count = 0;
|
|
1600
|
-
while (count < this.state.dropInsertionIndex) {
|
|
1601
|
+
while (index < children.length && count < this.state.dropInsertionIndex) {
|
|
1601
1602
|
if (children[index]?.props?.record?.type == "data") count++;
|
|
1602
1603
|
index++;
|
|
1603
1604
|
}
|