cx 26.0.9 → 26.0.10
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/ui/Controller.d.ts +2 -2
- package/build/ui/index.d.ts +2 -1
- package/build/ui/index.js +2 -1
- package/build.js +133 -133
- package/dist/manifest.js +818 -921
- package/dist/ui.js +1 -1
- package/package.json +2 -2
- package/src/ui/Controller.ts +2 -2
- package/src/ui/index.ts +2 -1
- package/src/widgets/HtmlElement.spec.tsx +8 -6
- package/build/charts/Bar.scss +0 -29
- package/build/charts/BarGraph.scss +0 -29
- package/build/charts/BubbleGraph.scss +0 -32
- package/build/charts/Column.scss +0 -29
- package/build/charts/ColumnGraph.scss +0 -30
- package/build/charts/Gridlines.scss +0 -25
- package/build/charts/Legend.scss +0 -50
- package/build/charts/LegendEntry.scss +0 -29
- package/build/charts/LineGraph.scss +0 -25
- package/build/charts/Marker.scss +0 -44
- package/build/charts/MarkerLine.scss +0 -20
- package/build/charts/PieChart.scss +0 -29
- package/build/charts/Range.scss +0 -20
- package/build/charts/RangeMarker.scss +0 -17
- package/build/charts/ScatterGraph.scss +0 -24
- package/build/charts/Swimlane.scss +0 -16
- package/build/charts/Swimlanes.scss +0 -16
- package/build/charts/axis/Axis.scss +0 -23
- package/build/charts/axis/CategoryAxis.scss +0 -35
- package/build/charts/axis/NumericAxis.scss +0 -35
- package/build/charts/axis/TimeAxis.scss +0 -34
- package/build/charts/axis/index.scss +0 -5
- package/build/charts/axis/variables.scss +0 -3
- package/build/charts/index.scss +0 -22
- package/build/charts/palette.scss +0 -97
- package/build/charts/variables.scss +0 -22
- package/build/data/ArrayElementView.spec.d.ts +0 -1
- package/build/data/ArrayElementView.spec.js +0 -81
- package/build/data/Binding.spec.d.ts +0 -1
- package/build/data/Binding.spec.js +0 -61
- package/build/data/Expression.spec.d.ts +0 -1
- package/build/data/Expression.spec.js +0 -196
- package/build/data/Grouper.spec.d.ts +0 -1
- package/build/data/Grouper.spec.js +0 -48
- package/build/data/Ref.spec.d.ts +0 -1
- package/build/data/Ref.spec.js +0 -72
- package/build/data/Store.spec.d.ts +0 -1
- package/build/data/Store.spec.js +0 -19
- package/build/data/StoreRef.spec.d.ts +0 -1
- package/build/data/StoreRef.spec.js +0 -22
- package/build/data/StringTemplate.spec.d.ts +0 -1
- package/build/data/StringTemplate.spec.js +0 -112
- package/build/data/StructuredSelector.spec.d.ts +0 -1
- package/build/data/StructuredSelector.spec.js +0 -102
- package/build/data/View.spec.d.ts +0 -1
- package/build/data/View.spec.js +0 -44
- package/build/data/ZoomIntoPropertyView.spec.d.ts +0 -1
- package/build/data/ZoomIntoPropertyView.spec.js +0 -54
- package/build/data/comparer.spec.d.ts +0 -1
- package/build/data/comparer.spec.js +0 -50
- package/build/data/computable.spec.d.ts +0 -1
- package/build/data/computable.spec.js +0 -56
- package/build/data/createAccessorModelProxy.spec.d.ts +0 -1
- package/build/data/createAccessorModelProxy.spec.js +0 -30
- package/build/data/createStructuredSelector.spec.d.ts +0 -1
- package/build/data/createStructuredSelector.spec.js +0 -42
- package/build/data/diff/diffs.spec.d.ts +0 -1
- package/build/data/diff/diffs.spec.js +0 -45
- package/build/data/getAccessor.spec.d.ts +0 -1
- package/build/data/getAccessor.spec.js +0 -10
- package/build/data/getSelector.spec.d.ts +0 -1
- package/build/data/getSelector.spec.js +0 -36
- package/build/data/ops/append.spec.d.ts +0 -1
- package/build/data/ops/append.spec.js +0 -24
- package/build/data/ops/filter.spec.d.ts +0 -1
- package/build/data/ops/filter.spec.js +0 -25
- package/build/data/ops/findTreeNode.spec.d.ts +0 -1
- package/build/data/ops/findTreeNode.spec.js +0 -20
- package/build/data/ops/merge.spec.d.ts +0 -1
- package/build/data/ops/merge.spec.js +0 -23
- package/build/data/ops/removeTreeNodes.spec.d.ts +0 -1
- package/build/data/ops/removeTreeNodes.spec.js +0 -35
- package/build/data/ops/updateArray.spec.d.ts +0 -1
- package/build/data/ops/updateArray.spec.js +0 -33
- package/build/data/ops/updateTree.spec.d.ts +0 -1
- package/build/data/ops/updateTree.spec.js +0 -44
- package/build/global.scss +0 -14
- package/build/hooks/invokeCallback.spec.d.ts +0 -1
- package/build/hooks/invokeCallback.spec.js +0 -44
- package/build/hooks/resolveCallback.spec.d.ts +0 -1
- package/build/hooks/resolveCallback.spec.js +0 -35
- package/build/hooks/store.spec.d.ts +0 -1
- package/build/hooks/store.spec.js +0 -48
- package/build/hooks/useTrigger.spec.d.ts +0 -1
- package/build/hooks/useTrigger.spec.js +0 -59
- package/build/index.scss +0 -6
- package/build/svg/Svg.scss +0 -28
- package/build/svg/index.scss +0 -9
- package/build/ui/Controller.spec.d.ts +0 -1
- package/build/ui/Controller.spec.js +0 -251
- package/build/ui/Cx.spec.d.ts +0 -1
- package/build/ui/Cx.spec.js +0 -153
- package/build/ui/DataProxy.spec.d.ts +0 -1
- package/build/ui/DataProxy.spec.js +0 -208
- package/build/ui/IsolatedScope.spec.d.ts +0 -1
- package/build/ui/IsolatedScope.spec.js +0 -42
- package/build/ui/Repeater.spec.d.ts +0 -1
- package/build/ui/Repeater.spec.js +0 -109
- package/build/ui/Rescope.spec.d.ts +0 -1
- package/build/ui/Rescope.spec.js +0 -134
- package/build/ui/Restate.spec.d.ts +0 -1
- package/build/ui/Restate.spec.js +0 -257
- package/build/ui/adapter/ArrayAdapter.spec.d.ts +0 -1
- package/build/ui/adapter/ArrayAdapter.spec.js +0 -44
- package/build/ui/adapter/TreeAdapter.spec.d.ts +0 -1
- package/build/ui/adapter/TreeAdapter.spec.js +0 -71
- package/build/ui/app/Url.spec.d.ts +0 -1
- package/build/ui/app/Url.spec.js +0 -43
- package/build/ui/createFunctionalComponent.spec.d.ts +0 -1
- package/build/ui/createFunctionalComponent.spec.js +0 -272
- package/build/ui/index.scss +0 -2
- package/build/ui/layout/ContentPlaceholder.spec.d.ts +0 -1
- package/build/ui/layout/ContentPlaceholder.spec.js +0 -333
- package/build/ui/layout/FirstVisibleChildLayout.spec.d.ts +0 -1
- package/build/ui/layout/FirstVisibleChildLayout.spec.js +0 -101
- package/build/ui/layout/LabelsLeftLayout.scss +0 -47
- package/build/ui/layout/LabelsTopLayout.scss +0 -65
- package/build/ui/layout/index.scss +0 -3
- package/build/ui/layout/variables.scss +0 -2
- package/build/ui/variables.scss +0 -2
- package/build/util/Format.spec.d.ts +0 -1
- package/build/util/Format.spec.js +0 -58
- package/build/util/TraversalStack.spec.d.ts +0 -1
- package/build/util/TraversalStack.spec.js +0 -43
- package/build/util/call-once.scss +0 -7
- package/build/util/date/upperBoundCheck.spec.d.ts +0 -1
- package/build/util/date/upperBoundCheck.spec.js +0 -22
- package/build/util/getSearchQueryPredicate.spec.d.ts +0 -1
- package/build/util/getSearchQueryPredicate.spec.js +0 -33
- package/build/util/index.scss +0 -11
- package/build/util/isValidIdentifierName.spec.d.ts +0 -1
- package/build/util/isValidIdentifierName.spec.js +0 -28
- package/build/util/routeAppend.spec.d.ts +0 -1
- package/build/util/routeAppend.spec.js +0 -14
- package/build/util/scss/add-rules.scss +0 -40
- package/build/util/scss/calc.scss +0 -45
- package/build/util/scss/call-once.scss +0 -13
- package/build/util/scss/clockwise.scss +0 -49
- package/build/util/scss/colors.scss +0 -10
- package/build/util/scss/deep-get.scss +0 -12
- package/build/util/scss/deep-merge.scss +0 -21
- package/build/util/scss/divide.scss +0 -3
- package/build/util/scss/include.scss +0 -48
- package/build/util/scss/index.scss +0 -9
- package/build/variables.scss +0 -217
- package/build/widgets/AccessorBindings.spec.d.ts +0 -1
- package/build/widgets/AccessorBindings.spec.js +0 -40
- package/build/widgets/Button.scss +0 -119
- package/build/widgets/Button.variables.scss +0 -117
- package/build/widgets/CxCredit.scss +0 -39
- package/build/widgets/FlexBox.scss +0 -148
- package/build/widgets/Heading.scss +0 -40
- package/build/widgets/HighlightedSearchText.scss +0 -20
- package/build/widgets/HtmlElement.spec.d.ts +0 -1
- package/build/widgets/HtmlElement.spec.js +0 -38
- package/build/widgets/Icon.scss +0 -22
- package/build/widgets/List.scss +0 -93
- package/build/widgets/ProgressBar.scss +0 -51
- package/build/widgets/Resizer.scss +0 -44
- package/build/widgets/Section.scss +0 -56
- package/build/widgets/animations.scss +0 -11
- package/build/widgets/drag-drop/DragClone.scss +0 -36
- package/build/widgets/drag-drop/DragHandle.scss +0 -19
- package/build/widgets/drag-drop/DragSource.scss +0 -27
- package/build/widgets/drag-drop/DropZone.scss +0 -77
- package/build/widgets/drag-drop/index.scss +0 -4
- package/build/widgets/drag-drop/variables.scss +0 -15
- package/build/widgets/form/Calendar.scss +0 -199
- package/build/widgets/form/Calendar.variables.scss +0 -64
- package/build/widgets/form/Checkbox.scss +0 -129
- package/build/widgets/form/Checkbox.variables.scss +0 -40
- package/build/widgets/form/ColorField.scss +0 -98
- package/build/widgets/form/ColorPicker.scss +0 -285
- package/build/widgets/form/ColorPicker.variables.scss +0 -22
- package/build/widgets/form/DateTimeField.scss +0 -92
- package/build/widgets/form/DateTimePicker.scss +0 -47
- package/build/widgets/form/Field.scss +0 -164
- package/build/widgets/form/HelpText.scss +0 -24
- package/build/widgets/form/Label.scss +0 -38
- package/build/widgets/form/LookupField.scss +0 -221
- package/build/widgets/form/MonthField.scss +0 -100
- package/build/widgets/form/MonthPicker.scss +0 -125
- package/build/widgets/form/NumberField.scss +0 -63
- package/build/widgets/form/Radio.scss +0 -123
- package/build/widgets/form/Radio.variables.scss +0 -46
- package/build/widgets/form/Select.scss +0 -101
- package/build/widgets/form/Slider.scss +0 -121
- package/build/widgets/form/Switch.scss +0 -142
- package/build/widgets/form/TextArea.scss +0 -45
- package/build/widgets/form/TextField.scss +0 -57
- package/build/widgets/form/UploadButton.scss +0 -49
- package/build/widgets/form/ValidationError.scss +0 -23
- package/build/widgets/form/ValidationGroup.spec.d.ts +0 -1
- package/build/widgets/form/ValidationGroup.spec.js +0 -62
- package/build/widgets/form/Wheel.scss +0 -152
- package/build/widgets/form/index.scss +0 -24
- package/build/widgets/form/variables.scss +0 -355
- package/build/widgets/grid/Grid.scss +0 -640
- package/build/widgets/grid/Pagination.scss +0 -115
- package/build/widgets/grid/TreeNode.scss +0 -90
- package/build/widgets/grid/index.scss +0 -4
- package/build/widgets/grid/variables.scss +0 -137
- package/build/widgets/index.scss +0 -16
- package/build/widgets/nav/Link.scss +0 -20
- package/build/widgets/nav/Menu.scss +0 -76
- package/build/widgets/nav/Menu.variables.scss +0 -25
- package/build/widgets/nav/MenuItem.scss +0 -130
- package/build/widgets/nav/Route.spec.d.ts +0 -1
- package/build/widgets/nav/Route.spec.js +0 -15
- package/build/widgets/nav/Scroller.scss +0 -148
- package/build/widgets/nav/Tab.scss +0 -82
- package/build/widgets/nav/Tab.variables.scss +0 -84
- package/build/widgets/nav/cover.scss +0 -22
- package/build/widgets/nav/index.scss +0 -6
- package/build/widgets/nav/variables.scss +0 -27
- package/build/widgets/overlay/Dropdown.scss +0 -186
- package/build/widgets/overlay/Overlay.scss +0 -68
- package/build/widgets/overlay/Toast.scss +0 -164
- package/build/widgets/overlay/Tooltip.scss +0 -177
- package/build/widgets/overlay/Window.scss +0 -129
- package/build/widgets/overlay/Window.variables.scss +0 -62
- package/build/widgets/overlay/captureMouse.scss +0 -13
- package/build/widgets/overlay/index.scss +0 -15
- package/build/widgets/overlay/variables.scss +0 -85
- package/build/widgets/variables.scss +0 -146
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "cx/jsx-runtime";
|
|
2
|
-
import { Store } from "../../data/Store";
|
|
3
|
-
import { expr } from "../expr";
|
|
4
|
-
import { createTestRenderer } from "../../util/test/createTestRenderer";
|
|
5
|
-
import assert from "assert";
|
|
6
|
-
import { FirstVisibleChildLayout } from "./FirstVisibleChildLayout";
|
|
7
|
-
import { UseParentLayout } from "./UseParentLayout";
|
|
8
|
-
import { PureContainer } from "../PureContainer";
|
|
9
|
-
import { createFunctionalComponent } from "../createFunctionalComponent";
|
|
10
|
-
describe("FirstVisibleChildLayout", () => {
|
|
11
|
-
it("renders only the first child", () => {
|
|
12
|
-
let widget = (_jsx("cx", { children: _jsxs("div", { layout: FirstVisibleChildLayout, children: [_jsx("header", {}), _jsx("main", {}), _jsx("footer", {})] }) }));
|
|
13
|
-
let store = new Store();
|
|
14
|
-
const component = createTestRenderer(store, widget);
|
|
15
|
-
let tree = component.toJSON();
|
|
16
|
-
assert.deepEqual(tree, {
|
|
17
|
-
type: "div",
|
|
18
|
-
props: {},
|
|
19
|
-
children: [{ type: "header", props: {}, children: null }],
|
|
20
|
-
});
|
|
21
|
-
});
|
|
22
|
-
it("does not process other widgets", () => {
|
|
23
|
-
let h = false, m = false, f = false;
|
|
24
|
-
let widget = (_jsx("cx", { children: _jsxs("div", { layout: FirstVisibleChildLayout, children: [_jsx("header", { onInit: () => {
|
|
25
|
-
h = true;
|
|
26
|
-
} }), _jsx("main", { onInit: () => {
|
|
27
|
-
m = true;
|
|
28
|
-
} }), _jsx("footer", { onInit: () => {
|
|
29
|
-
f = true;
|
|
30
|
-
} })] }) }));
|
|
31
|
-
let store = new Store();
|
|
32
|
-
const component = createTestRenderer(store, widget);
|
|
33
|
-
let tree = component.toJSON();
|
|
34
|
-
assert.deepEqual(tree, {
|
|
35
|
-
type: "div",
|
|
36
|
-
props: {},
|
|
37
|
-
children: [{ type: "header", props: {}, children: null }],
|
|
38
|
-
});
|
|
39
|
-
assert.equal(h, true);
|
|
40
|
-
assert.equal(m, false);
|
|
41
|
-
assert.equal(f, false);
|
|
42
|
-
});
|
|
43
|
-
it("skips the first child if not visible", () => {
|
|
44
|
-
let widget = (_jsx("cx", { children: _jsxs("div", { layout: FirstVisibleChildLayout, children: [_jsx("header", { visible: false }), _jsx("main", {}), _jsx("footer", {})] }) }));
|
|
45
|
-
let store = new Store();
|
|
46
|
-
const component = createTestRenderer(store, widget);
|
|
47
|
-
let tree = component.toJSON();
|
|
48
|
-
assert.deepEqual(tree, {
|
|
49
|
-
type: "div",
|
|
50
|
-
props: {},
|
|
51
|
-
children: [{ type: "main", props: {}, children: null }],
|
|
52
|
-
});
|
|
53
|
-
});
|
|
54
|
-
it("skips pure containers which use parent layouts", () => {
|
|
55
|
-
let widget = (_jsx("cx", { children: _jsxs("div", { layout: FirstVisibleChildLayout, children: [_jsx(PureContainer, { layout: UseParentLayout, children: _jsx("header", { visible: false }) }), _jsx("main", {}), _jsx("footer", {})] }) }));
|
|
56
|
-
let store = new Store();
|
|
57
|
-
const component = createTestRenderer(store, widget);
|
|
58
|
-
let tree = component.toJSON();
|
|
59
|
-
assert.deepEqual(tree, {
|
|
60
|
-
type: "div",
|
|
61
|
-
props: {},
|
|
62
|
-
children: [{ type: "main", props: {}, children: null }],
|
|
63
|
-
});
|
|
64
|
-
});
|
|
65
|
-
it("works with functional components", () => {
|
|
66
|
-
let FC = createFunctionalComponent(({ children }) => _jsx("cx", { children: children }));
|
|
67
|
-
let widget = (_jsx("cx", { children: _jsxs("div", { layout: FirstVisibleChildLayout, children: [_jsx(FC, { dummy: true, children: _jsx("header", { visible: false }) }), _jsx("main", {}), _jsx("footer", {})] }) }));
|
|
68
|
-
let store = new Store();
|
|
69
|
-
const component = createTestRenderer(store, widget);
|
|
70
|
-
let tree = component.toJSON();
|
|
71
|
-
assert.deepEqual(tree, {
|
|
72
|
-
type: "div",
|
|
73
|
-
props: {},
|
|
74
|
-
children: [{ type: "main", props: {}, children: null }],
|
|
75
|
-
});
|
|
76
|
-
});
|
|
77
|
-
it("properly destroys invisible items", () => {
|
|
78
|
-
let destroyList = [];
|
|
79
|
-
let widget = (_jsx("cx", { children: _jsxs("div", { layout: FirstVisibleChildLayout, children: [_jsx("div", { visible: expr("{index} == 0"), onDestroy: () => destroyList.push(0) }), _jsx("div", { visible: expr("{index} == 1"), onDestroy: () => destroyList.push(1) }), _jsx("div", { visible: expr("{index} == 2"), onDestroy: () => destroyList.push(2) }), _jsx("div", { visible: expr("{index} == 3"), onDestroy: () => destroyList.push(3) }), _jsx("div", { visible: expr("{index} == 4"), onDestroy: () => destroyList.push(4) })] }) }));
|
|
80
|
-
let store = new Store();
|
|
81
|
-
const component = createTestRenderer(store, widget);
|
|
82
|
-
store.set("index", 0);
|
|
83
|
-
component.toJSON();
|
|
84
|
-
assert.deepEqual(destroyList, []);
|
|
85
|
-
store.set("index", 3);
|
|
86
|
-
component.toJSON();
|
|
87
|
-
assert.deepEqual(destroyList, [0]);
|
|
88
|
-
store.set("index", 1);
|
|
89
|
-
component.toJSON();
|
|
90
|
-
assert.deepEqual(destroyList, [0, 3]);
|
|
91
|
-
store.set("index", 4);
|
|
92
|
-
component.toJSON();
|
|
93
|
-
assert.deepEqual(destroyList, [0, 3, 1]);
|
|
94
|
-
store.set("index", 0);
|
|
95
|
-
component.toJSON();
|
|
96
|
-
assert.deepEqual(destroyList, [0, 3, 1, 4]);
|
|
97
|
-
store.set("index", -1);
|
|
98
|
-
component.toJSON();
|
|
99
|
-
assert.deepEqual(destroyList, [0, 3, 1, 4, 0]);
|
|
100
|
-
});
|
|
101
|
-
});
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
@use "sass:map";
|
|
3
|
-
|
|
4
|
-
@mixin cx-labelsleftlayout(
|
|
5
|
-
$name: 'labelsleftlayout',
|
|
6
|
-
$besm: $cx-besm
|
|
7
|
-
) {
|
|
8
|
-
$block: map.get($besm, block);
|
|
9
|
-
$element: map.get($besm, element);
|
|
10
|
-
$state: map.get($besm, state);
|
|
11
|
-
$mod: map.get($besm, mod);
|
|
12
|
-
|
|
13
|
-
.#{$block}labelsleftlayout {
|
|
14
|
-
border-spacing: 0;
|
|
15
|
-
|
|
16
|
-
&.#{$mod}stretch {
|
|
17
|
-
width: 100%;
|
|
18
|
-
|
|
19
|
-
.#{$element}labelsleftlayout-label {
|
|
20
|
-
width: 5em;
|
|
21
|
-
|
|
22
|
-
.#{$block}label {
|
|
23
|
-
white-space: nowrap;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.#{$element}labelsleftlayout-field {
|
|
30
|
-
padding: 5px 0 5px 5px;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.#{$element}labelsleftlayout-label {
|
|
34
|
-
text-align: right;
|
|
35
|
-
vertical-align: top;
|
|
36
|
-
|
|
37
|
-
padding: 5px 5px 5px 0;
|
|
38
|
-
|
|
39
|
-
.#{$block}label {
|
|
40
|
-
padding-right: 0;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
@if (cx-should-include('cx/ui/LabelsLeftLayout')) {
|
|
46
|
-
@include cx-labelsleftlayout();
|
|
47
|
-
}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
@use "sass:map";
|
|
2
|
-
|
|
3
|
-
@mixin cx-labelstoplayout(
|
|
4
|
-
$name: 'labelstoplayout',
|
|
5
|
-
$besm: $cx-besm
|
|
6
|
-
) {
|
|
7
|
-
$block: map.get($besm, block);
|
|
8
|
-
$element: map.get($besm, element);
|
|
9
|
-
$state: map.get($besm, state);
|
|
10
|
-
$mod: map.get($besm, mod);
|
|
11
|
-
|
|
12
|
-
.#{$block}labelstoplayout {
|
|
13
|
-
border-spacing: 0 3px;
|
|
14
|
-
|
|
15
|
-
&.#{$mod}stretch {
|
|
16
|
-
width: 100%;
|
|
17
|
-
|
|
18
|
-
//unsure what it does
|
|
19
|
-
//.#{$element}labelstoplayout-label {
|
|
20
|
-
// width: 10em;
|
|
21
|
-
//}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
.#{$element}labelstoplayout-field {
|
|
26
|
-
padding: 0 5px;
|
|
27
|
-
box-sizing: border-box;
|
|
28
|
-
vertical-align: top;
|
|
29
|
-
|
|
30
|
-
&:first-child {
|
|
31
|
-
padding-left: 0;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
&:last-child {
|
|
35
|
-
padding-right: 0;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.#{$element}labelstoplayout-label {
|
|
40
|
-
vertical-align: bottom;
|
|
41
|
-
padding: 5px 5px 0 5px;
|
|
42
|
-
box-sizing: border-box;
|
|
43
|
-
|
|
44
|
-
.#{$block}label {
|
|
45
|
-
padding-left: 0;
|
|
46
|
-
padding-bottom: 0;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
&:first-child {
|
|
50
|
-
padding-left: 0;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
&:last-child {
|
|
54
|
-
padding-right: 0;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.#{$mod}fixed {
|
|
59
|
-
table-layout: fixed;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
@if (cx-should-include('cx/ui/LabelsTopLayout')) {
|
|
64
|
-
@include cx-labelstoplayout();
|
|
65
|
-
}
|
package/build/ui/variables.scss
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import assert from 'assert';
|
|
2
|
-
import { Format } from './Format';
|
|
3
|
-
describe('Format', function () {
|
|
4
|
-
describe('n,number ', function () {
|
|
5
|
-
it('correctly formats numbers with min and max allowed precision', function () {
|
|
6
|
-
assert.equal(Format.value(0.5, 'n;2;4'), '0.50');
|
|
7
|
-
assert.equal(Format.value(0.50101, 'n;2;4'), '0.501');
|
|
8
|
-
assert.equal(Format.value(0.5012, 'n;2;4'), '0.5012');
|
|
9
|
-
assert.equal(Format.value(0.0, 'n;0;4'), '0');
|
|
10
|
-
});
|
|
11
|
-
it('correctly formats numbers fixed precision', function () {
|
|
12
|
-
assert.equal(Format.value(0.5, 'number;3'), '0.500');
|
|
13
|
-
assert.equal(Format.value(0.50101, 'number;3'), '0.501');
|
|
14
|
-
assert.equal(Format.value(0.5016, 'number;3'), '0.502');
|
|
15
|
-
});
|
|
16
|
-
});
|
|
17
|
-
describe('p,percentage', function () {
|
|
18
|
-
it('correctly formats numbers with min and max allowed precision', function () {
|
|
19
|
-
assert.equal(Format.value(0.5, 'p;2;4'), '50.00%');
|
|
20
|
-
assert.equal(Format.value(0.50101, 'p;2;4'), '50.101%');
|
|
21
|
-
assert.equal(Format.value(0.50123456, 'p;2;4'), '50.1235%');
|
|
22
|
-
assert.equal(Format.value(0.0, 'p;0;4'), '0%');
|
|
23
|
-
});
|
|
24
|
-
it('correctly formats numbers fixed precision', function () {
|
|
25
|
-
assert.equal(Format.value(0.5, 'percentage;3'), '50.000%');
|
|
26
|
-
assert.equal(Format.value(0.50101, 'percentage;3'), '50.101%');
|
|
27
|
-
assert.equal(Format.value(0.5016, 'percentage;3'), '50.160%');
|
|
28
|
-
});
|
|
29
|
-
});
|
|
30
|
-
describe('date,time,datetime', function () {
|
|
31
|
-
it('correctly formats dates', function () {
|
|
32
|
-
assert.equal(Format.value(new Date(2015, 3, 1), 'd'), '4/1/2015');
|
|
33
|
-
});
|
|
34
|
-
it('correctly formats time', function () {
|
|
35
|
-
assert.equal(Format.value(new Date(2015, 3, 1, 16, 15, 14), 't'), '16:15');
|
|
36
|
-
assert.equal(Format.value(new Date(2015, 3, 1, 5, 6, 14), 'time'), '05:06');
|
|
37
|
-
});
|
|
38
|
-
it('correctly formats date-time', function () {
|
|
39
|
-
assert.equal(Format.value(new Date(2015, 3, 1, 5, 6, 14), 'dt'), '4/1/2015 05:06');
|
|
40
|
-
});
|
|
41
|
-
});
|
|
42
|
-
describe('ellipsis', function () {
|
|
43
|
-
it('can shorten long texts', function () {
|
|
44
|
-
assert.equal(Format.value('This is a very long text.', 'ellipsis;7'), 'This...');
|
|
45
|
-
});
|
|
46
|
-
it('can be used at the start of string', function () {
|
|
47
|
-
assert.equal(Format.value('This is a very long text.', 'ellipsis;8;start'), '...text.');
|
|
48
|
-
});
|
|
49
|
-
it('can be used in the middle of the string', function () {
|
|
50
|
-
assert.equal(Format.value('First (Middle) Last', 'ellipsis;11;middle'), 'Firs...Last');
|
|
51
|
-
});
|
|
52
|
-
});
|
|
53
|
-
describe('null text', function () {
|
|
54
|
-
it('can contain null text', function () {
|
|
55
|
-
assert.equal(Format.value(null, 'n;2|N/A'), 'N/A');
|
|
56
|
-
});
|
|
57
|
-
});
|
|
58
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { TraversalStack } from './TraversalStack';
|
|
2
|
-
import assert from 'assert';
|
|
3
|
-
describe('TraversalStack', function () {
|
|
4
|
-
it('push', function () {
|
|
5
|
-
let stack = new TraversalStack();
|
|
6
|
-
stack.push(1);
|
|
7
|
-
assert.equal(stack.pop(), 1);
|
|
8
|
-
});
|
|
9
|
-
it('traverses the tree in the right order', function () {
|
|
10
|
-
let stack = new TraversalStack();
|
|
11
|
-
let tree = {
|
|
12
|
-
id: 1,
|
|
13
|
-
children: [{
|
|
14
|
-
id: 2,
|
|
15
|
-
children: [{
|
|
16
|
-
id: 3
|
|
17
|
-
}, {
|
|
18
|
-
id: 4
|
|
19
|
-
}]
|
|
20
|
-
}, {
|
|
21
|
-
id: 5,
|
|
22
|
-
children: [{
|
|
23
|
-
id: 6
|
|
24
|
-
}]
|
|
25
|
-
}]
|
|
26
|
-
};
|
|
27
|
-
let list = [];
|
|
28
|
-
stack.push(tree);
|
|
29
|
-
while (!stack.empty()) {
|
|
30
|
-
let node = stack.pop();
|
|
31
|
-
if (node) {
|
|
32
|
-
list.push(node.id);
|
|
33
|
-
if (node.children) {
|
|
34
|
-
stack.hop();
|
|
35
|
-
node.children.forEach((child) => {
|
|
36
|
-
stack.push(child);
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
assert.deepEqual(list, [1, 2, 3, 4, 5, 6]);
|
|
42
|
-
});
|
|
43
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import assert from 'assert';
|
|
2
|
-
import { upperBoundCheck } from './upperBoundCheck';
|
|
3
|
-
describe('upperBoundCheck', () => {
|
|
4
|
-
let may18th = new Date('2017-05-18'); // May 18th
|
|
5
|
-
let may19th = new Date('2017-05-19'); // May 19th
|
|
6
|
-
let exclusive = true; // strictly less than...
|
|
7
|
-
it('returns true for May 18th <= May 19th', () => {
|
|
8
|
-
assert.equal(upperBoundCheck(may18th, may19th), true);
|
|
9
|
-
});
|
|
10
|
-
it('returns true for May 19th <= May 19th', () => {
|
|
11
|
-
assert.equal(upperBoundCheck(may19th, may19th), true);
|
|
12
|
-
});
|
|
13
|
-
it('returns true for May 19th <= May 19th with exclusive=`false`', () => {
|
|
14
|
-
assert.equal(upperBoundCheck(may19th, may19th, false), true);
|
|
15
|
-
});
|
|
16
|
-
it('returns false for May 19th < May 19th', () => {
|
|
17
|
-
assert.equal(upperBoundCheck(may19th, may19th, exclusive), false);
|
|
18
|
-
});
|
|
19
|
-
it('returns false for May 19th <= May 18th', () => {
|
|
20
|
-
assert.equal(upperBoundCheck(may19th, may18th), false);
|
|
21
|
-
});
|
|
22
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { getSearchQueryPredicate, getSearchQueryHighlighter } from "./getSearchQueryPredicate";
|
|
2
|
-
import assert from "assert";
|
|
3
|
-
describe("getSearchQueryPredicate", function () {
|
|
4
|
-
it("blank means allow all", function () {
|
|
5
|
-
var m = getSearchQueryPredicate("");
|
|
6
|
-
assert(m("cx"));
|
|
7
|
-
});
|
|
8
|
-
it("is case insensitive", function () {
|
|
9
|
-
var m = getSearchQueryPredicate("Cx");
|
|
10
|
-
assert(m("cx"));
|
|
11
|
-
});
|
|
12
|
-
it("if multiple words are provided, all must be matched", function () {
|
|
13
|
-
var m = getSearchQueryPredicate("jo smi");
|
|
14
|
-
assert(m("John Smith"));
|
|
15
|
-
assert(!m("John Nash"));
|
|
16
|
-
});
|
|
17
|
-
it("regex special characters are properly escaped", function () {
|
|
18
|
-
var m = getSearchQueryPredicate("*?");
|
|
19
|
-
assert(m("*?"));
|
|
20
|
-
});
|
|
21
|
-
});
|
|
22
|
-
describe("getSearchQueryHighlighter", function () {
|
|
23
|
-
it("detects search parts", function () {
|
|
24
|
-
var m = getSearchQueryHighlighter("jo smi");
|
|
25
|
-
let items = m("John Smith");
|
|
26
|
-
assert.deepStrictEqual(items, ["", "Jo", "hn ", "Smi", "th"]);
|
|
27
|
-
});
|
|
28
|
-
it("detects search parts occuring multiple times", function () {
|
|
29
|
-
var m = getSearchQueryHighlighter("O");
|
|
30
|
-
let items = m("Option 1");
|
|
31
|
-
assert.deepStrictEqual(items, ["", "O", "pti", "o", "n 1"]);
|
|
32
|
-
});
|
|
33
|
-
});
|
package/build/util/index.scss
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { isValidIdentifierName } from "./isValidIdentifierName";
|
|
2
|
-
import assert from "assert";
|
|
3
|
-
describe("isValidIdentifierName", function () {
|
|
4
|
-
it("names starting with a number are not valid", function () {
|
|
5
|
-
assert(!isValidIdentifierName("1a"));
|
|
6
|
-
assert(!isValidIdentifierName("00"));
|
|
7
|
-
assert(!isValidIdentifierName("0_abc"));
|
|
8
|
-
});
|
|
9
|
-
it("names starting with a dollar sign are valid", function () {
|
|
10
|
-
assert(isValidIdentifierName("$a"));
|
|
11
|
-
assert(isValidIdentifierName("$"));
|
|
12
|
-
});
|
|
13
|
-
it("names starting with an underscore are valid", function () {
|
|
14
|
-
assert(isValidIdentifierName("_a"));
|
|
15
|
-
assert(isValidIdentifierName("_"));
|
|
16
|
-
});
|
|
17
|
-
it("names starting with a letter are valid", function () {
|
|
18
|
-
assert(isValidIdentifierName("a"));
|
|
19
|
-
assert(isValidIdentifierName("abc"));
|
|
20
|
-
assert(isValidIdentifierName("abc0123"));
|
|
21
|
-
});
|
|
22
|
-
it("names with invalid characters are not valid", function () {
|
|
23
|
-
assert(!isValidIdentifierName("a b"));
|
|
24
|
-
assert(!isValidIdentifierName("a-b"));
|
|
25
|
-
assert(!isValidIdentifierName("a.b"));
|
|
26
|
-
assert(!isValidIdentifierName("a!b"));
|
|
27
|
-
});
|
|
28
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { routeAppend } from './routeAppend';
|
|
2
|
-
import assert from 'assert';
|
|
3
|
-
describe('routeAppend', function () {
|
|
4
|
-
it('adds / if necessary', function () {
|
|
5
|
-
assert(routeAppend('x', 'y'), 'x/y');
|
|
6
|
-
});
|
|
7
|
-
it('does not add extra / if not necessary', function () {
|
|
8
|
-
assert(routeAppend('x/', 'y'), 'x/y');
|
|
9
|
-
assert(routeAppend('x', '/y'), 'x/y');
|
|
10
|
-
});
|
|
11
|
-
it('removes extra slash if both parts contain it', function () {
|
|
12
|
-
assert(routeAppend('x/', '/y'), 'x/y');
|
|
13
|
-
});
|
|
14
|
-
});
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
@use "sass:map";
|
|
2
|
-
|
|
3
|
-
@mixin cx-add-rules($styles) {
|
|
4
|
-
@each $rule, $value in $styles {
|
|
5
|
-
#{$rule}: $value;
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
@mixin cx-add-state-rules($state-style-map, $key) {
|
|
10
|
-
@include cx-add-rules(map.get($state-style-map, $key));
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
@function cx-merge-state-style-maps($state-style-map, $override-style-map) {
|
|
14
|
-
$result: $state-style-map;
|
|
15
|
-
|
|
16
|
-
@if ($override-style-map != null) {
|
|
17
|
-
@each $key, $new-value in $override-style-map {
|
|
18
|
-
$old-value: map.get($state-style-map, $key);
|
|
19
|
-
@if ($old-value != null) {
|
|
20
|
-
$new-value: map.merge($old-value, $new-value);
|
|
21
|
-
}
|
|
22
|
-
$result: map.merge(
|
|
23
|
-
$result,
|
|
24
|
-
(
|
|
25
|
-
$key: $new-value,
|
|
26
|
-
)
|
|
27
|
-
);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
@return $result;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
@function cx-get-state-rule($state-style-map, $key, $rule, $default: null) {
|
|
35
|
-
$result: map.get(map.get($state-style-map, $key), $rule);
|
|
36
|
-
@if ($result != null) {
|
|
37
|
-
@return $result;
|
|
38
|
-
}
|
|
39
|
-
@return $default;
|
|
40
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
@use "sass:list";
|
|
2
|
-
@use "sass:map";
|
|
3
|
-
@use "sass:math";
|
|
4
|
-
|
|
5
|
-
@function cx-calc($lengths...) {
|
|
6
|
-
$units: ();
|
|
7
|
-
|
|
8
|
-
@each $l in $lengths {
|
|
9
|
-
$unit: math.unit($l);
|
|
10
|
-
@if (map.has-key($units, $unit)) {
|
|
11
|
-
$nl: map.get($units, $unit) + $l;
|
|
12
|
-
$units: map.merge($units, ($unit: $nl))
|
|
13
|
-
} @else {
|
|
14
|
-
$units: map.merge($units, ($unit: $l))
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
$keys: map.keys($units);
|
|
19
|
-
@if (list.length($keys) == 1) {
|
|
20
|
-
@return map.get($units, list.nth($keys, 1));
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
$calc: '';
|
|
24
|
-
$count: 0;
|
|
25
|
-
|
|
26
|
-
@each $u, $v in $units {
|
|
27
|
-
@if ($v != 0) {
|
|
28
|
-
$count: $count + 1;
|
|
29
|
-
@if ($count > 1) {
|
|
30
|
-
$calc: $calc + ' + ';
|
|
31
|
-
}
|
|
32
|
-
$calc: $calc + $v;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
@if ($count == 0) {
|
|
37
|
-
@return 0;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
@if ($count == 1) {
|
|
41
|
-
@return #{$calc};
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
@return #{'calc(' + $calc + ')'};
|
|
45
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
@use "sass:map";
|
|
2
|
-
|
|
3
|
-
$cx-call-once-data: () !default;
|
|
4
|
-
|
|
5
|
-
@function cx-call-once($name) {
|
|
6
|
-
$result: map.get($cx-call-once-data, $name);
|
|
7
|
-
$cx-call-once-data: map.merge($cx-call-once-data, ($name: true)) !global;
|
|
8
|
-
@return $result != true;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
@function cx-called-once($name) {
|
|
12
|
-
@return map.get($cx-call-once-data, $name);
|
|
13
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
@use "sass:list";
|
|
2
|
-
|
|
3
|
-
@function cx-top($list) {
|
|
4
|
-
@if (list.length($list) > 0) {
|
|
5
|
-
@return list.nth($list, 1);
|
|
6
|
-
}
|
|
7
|
-
@return null;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
@function cx-right($list) {
|
|
11
|
-
@if (list.length($list) == 1) {
|
|
12
|
-
@return list.nth($list, 1);
|
|
13
|
-
}
|
|
14
|
-
@if (list.length($list) > 1) {
|
|
15
|
-
@return list.nth($list, 2);
|
|
16
|
-
}
|
|
17
|
-
@return null;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
@function cx-bottom($list) {
|
|
21
|
-
@if (list.length($list) > 2) {
|
|
22
|
-
@return list.nth($list, 3);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
@if (list.length($list) >= 1) {
|
|
26
|
-
@return list.nth($list, 1);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
@return null;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
@function cx-left($list) {
|
|
33
|
-
@if (list.length($list) == 1) {
|
|
34
|
-
@return list.nth($list, 1);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
@if (list.length($list) == 2) {
|
|
38
|
-
@return list.nth($list, 2);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
@if (list.length($list) == 3) {
|
|
42
|
-
@return list.nth($list, 2);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
@if (list.length($list) == 4) {
|
|
46
|
-
@return list.nth($list, 4);
|
|
47
|
-
}
|
|
48
|
-
@return null;
|
|
49
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
@use "sass:map";
|
|
2
|
-
@use "sass:meta";
|
|
3
|
-
|
|
4
|
-
@function cx-deep-map-merge($parent-map, $child-map) {
|
|
5
|
-
$result: $parent-map;
|
|
6
|
-
@each $key, $value in $child-map {
|
|
7
|
-
//If the parent map does not have the child map's key, or
|
|
8
|
-
//If their type don't match, or
|
|
9
|
-
//If they are not both maps,
|
|
10
|
-
@if (not map.has-key($result, $key)) or (meta.type-of(map.get($result, $key)) != meta.type-of($value)) or (not (meta.type-of(map.get($result, $key)) == map and meta.type-of($value) == map)) {
|
|
11
|
-
//Simply add that key to the parent map.
|
|
12
|
-
$result: map.merge($result, ($key: $value));
|
|
13
|
-
}
|
|
14
|
-
@else {
|
|
15
|
-
//If they are both maps, we need another non-destructive merger.
|
|
16
|
-
//Recursive, yay!
|
|
17
|
-
$result: map.merge($result, ($key: cx-deep-map-merge(map.get($result, $key), $value)));
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
@return $result;
|
|
21
|
-
}
|