jsl-ui 9.18.2 → 9.18.3
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/lib/grid.css +0 -8
- package/lib/index.css.map +1 -1
- package/lib/index.js +10198 -61
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
- package/lib/components/IntervalComponent.d.ts +0 -17
- package/lib/components/IntervalComponent.js +0 -68
- package/lib/components/auto-suggest/AutoSuggestComponent.d.ts +0 -22
- package/lib/components/auto-suggest/AutoSuggestComponent.js +0 -49
- package/lib/components/button/ButtonComponent.d.ts +0 -18
- package/lib/components/button/ButtonComponent.js +0 -46
- package/lib/components/checkbox/CheckBoxComponent.d.ts +0 -28
- package/lib/components/checkbox/CheckBoxComponent.js +0 -94
- package/lib/components/checkbox/CheckBoxStyle.scss +0 -86
- package/lib/components/date/DateComponent.d.ts +0 -32
- package/lib/components/date/DateComponent.js +0 -106
- package/lib/components/date-range/DateRangeComponent.d.ts +0 -35
- package/lib/components/date-range/DateRangeComponent.js +0 -136
- package/lib/components/date-range/DateRangeStyle.scss +0 -12
- package/lib/components/date-time/DateTimeComponent.d.ts +0 -15
- package/lib/components/date-time/DateTimeComponent.js +0 -53
- package/lib/components/date-time/DateTimeStyle.scss +0 -7
- package/lib/components/dialog/DialogComponent.d.ts +0 -67
- package/lib/components/dialog/DialogComponent.js +0 -242
- package/lib/components/drop-down/DropDownComponent.d.ts +0 -27
- package/lib/components/drop-down/DropDownComponent.js +0 -74
- package/lib/components/expander/ExpanderComponent.d.ts +0 -27
- package/lib/components/expander/ExpanderComponent.js +0 -90
- package/lib/components/expander/ExpanderStyle.scss +0 -47
- package/lib/components/expander/OldExpanderStyle.scss +0 -37
- package/lib/components/form-field/FormComponent.d.ts +0 -12
- package/lib/components/form-field/FormComponent.js +0 -26
- package/lib/components/form-field/FormFieldComponent.d.ts +0 -38
- package/lib/components/form-field/FormFieldComponent.js +0 -139
- package/lib/components/form-field/FormFieldStyle.scss +0 -87
- package/lib/components/grid/GridComponent.d.ts +0 -26
- package/lib/components/grid/GridComponent.js +0 -116
- package/lib/components/input/InputComponent.d.ts +0 -33
- package/lib/components/input/InputComponent.js +0 -144
- package/lib/components/loading/LoadingComponent.d.ts +0 -8
- package/lib/components/loading/LoadingComponent.js +0 -22
- package/lib/components/loading/LoadingStyle.css +0 -29
- package/lib/components/navigation/NavigationComponent.d.ts +0 -34
- package/lib/components/navigation/NavigationComponent.js +0 -70
- package/lib/components/navigation/NavigationStyle.scss +0 -226
- package/lib/components/notification/Notification.d.ts +0 -17
- package/lib/components/notification/Notification.js +0 -56
- package/lib/components/notification/Notification.scss +0 -19
- package/lib/components/number/NumberComponent.d.ts +0 -25
- package/lib/components/number/NumberComponent.js +0 -87
- package/lib/components/overlay/OverlayComponent.d.ts +0 -27
- package/lib/components/overlay/OverlayComponent.js +0 -149
- package/lib/components/overlay/overlay.css +0 -57
- package/lib/components/progress/ProgressComponent.d.ts +0 -18
- package/lib/components/progress/ProgressComponent.js +0 -42
- package/lib/components/progress/ProgressStyle.scss +0 -15
- package/lib/components/ribbon-menu/RibbonMenuComponent.d.ts +0 -12
- package/lib/components/ribbon-menu/RibbonMenuComponent.js +0 -34
- package/lib/components/ribbon-menu/RibbonMenuStyle.scss +0 -76
- package/lib/components/select/SelectComponent.d.ts +0 -79
- package/lib/components/select/SelectComponent.js +0 -362
- package/lib/components/select/SelectDDAreaComponent.d.ts +0 -32
- package/lib/components/select/SelectDDAreaComponent.js +0 -317
- package/lib/components/select/SelectStyle.scss +0 -187
- package/lib/components/slider/nouislider.css +0 -310
- package/lib/components/slider/nouislider.d.ts +0 -44
- package/lib/components/slider/nouislider.js +0 -2158
- package/lib/components/stack-panel/SplitterComponent.d.ts +0 -21
- package/lib/components/stack-panel/SplitterComponent.js +0 -126
- package/lib/components/stack-panel/SplitterStyle.scss +0 -45
- package/lib/components/stack-panel/StackPanelComponent.d.ts +0 -20
- package/lib/components/stack-panel/StackPanelComponent.js +0 -64
- package/lib/components/stack-panel/StackPanelStyle.scss +0 -53
- package/lib/components/tabs/TabsComponent.d.ts +0 -39
- package/lib/components/tabs/TabsComponent.js +0 -177
- package/lib/components/tabs/TabsStyle.scss +0 -76
- package/lib/components/time/TimeComponent.d.ts +0 -29
- package/lib/components/time/TimeComponent.js +0 -113
- package/lib/components/time/TimeComponent.scss +0 -4
- package/lib/components/tree-view/TreeViewComponent.d.ts +0 -23
- package/lib/components/tree-view/TreeViewComponent.js +0 -45
- package/lib/components/tree-view/TreeViewStyle.scss +0 -96
- package/lib/components/virtual-render/VirtualRenderComponent.d.ts +0 -30
- package/lib/components/virtual-render/VirtualRenderComponent.js +0 -104
- package/lib/components/virtual-render/VirtualRenderStyle.scss +0 -9
- package/lib/core/culture.d.ts +0 -5
- package/lib/core/culture.js +0 -385
- package/lib/core/date.d.ts +0 -14
- package/lib/core/date.js +0 -350
- package/lib/core/helper.d.ts +0 -12
- package/lib/core/helper.js +0 -101
- package/lib/core/jq.d.ts +0 -37
- package/lib/core/jq.js +0 -371
- package/lib/core/lang.d.ts +0 -24
- package/lib/core/lang.js +0 -28
- package/lib/core/numeric.d.ts +0 -7
- package/lib/core/numeric.js +0 -143
- package/lib/core/polyfills.d.ts +0 -0
- package/lib/core/polyfills.js +0 -22
- package/lib/core.d.ts +0 -6
- package/lib/core.js +0 -6
- package/lib/grid/controls/slick.columnpicker.css +0 -46
- package/lib/grid/controls/slick.draggablegrouping.css +0 -52
- package/lib/grid/controls/slick.gridmenu.css +0 -127
- package/lib/grid/controls/slick.pager.css +0 -41
- package/lib/grid/examples/examples.css +0 -203
- package/lib/grid/filterDialogs/dateRangeFilter.d.ts +0 -7
- package/lib/grid/filterDialogs/dateRangeFilter.js +0 -156
- package/lib/grid/filterDialogs/excelFilter.d.ts +0 -9
- package/lib/grid/filterDialogs/excelFilter.js +0 -313
- package/lib/grid/plugins/ext.overlay.css +0 -28
- package/lib/grid/plugins/ext.overlay.d.ts +0 -2
- package/lib/grid/plugins/ext.overlay.js +0 -291
- package/lib/grid/plugins/slick.cellrangedecorator.d.ts +0 -12
- package/lib/grid/plugins/slick.cellrangedecorator.js +0 -68
- package/lib/grid/plugins/slick.cellrangeselector.d.ts +0 -1
- package/lib/grid/plugins/slick.cellrangeselector.js +0 -144
- package/lib/grid/plugins/slick.cellselectionmodel.d.ts +0 -1
- package/lib/grid/plugins/slick.cellselectionmodel.js +0 -194
- package/lib/grid/plugins/slick.headerbuttons.css +0 -40
- package/lib/grid/plugins/slick.headerbuttons.d.ts +0 -55
- package/lib/grid/plugins/slick.headerbuttons.js +0 -156
- package/lib/grid/plugins/slick.headermenu.css +0 -101
- package/lib/grid/plugins/slick.headermenu.d.ts +0 -74
- package/lib/grid/plugins/slick.headermenu.js +0 -260
- package/lib/grid/plugins/slick.rowdetailview.css +0 -37
- package/lib/grid/plugins/slick.rowmovemanager.css +0 -8
- package/lib/grid/plugins/slick.rowmovemanager.d.ts +0 -18
- package/lib/grid/plugins/slick.rowmovemanager.js +0 -249
- package/lib/grid/plugins/slick.rowselectionmodel.d.ts +0 -1
- package/lib/grid/plugins/slick.rowselectionmodel.js +0 -167
- package/lib/grid/slick-default-theme.css +0 -154
- package/lib/grid/slick.core.d.ts +0 -90
- package/lib/grid/slick.core.js +0 -574
- package/lib/grid/slick.creator.d.ts +0 -80
- package/lib/grid/slick.creator.js +0 -723
- package/lib/grid/slick.dataview.d.ts +0 -71
- package/lib/grid/slick.dataview.js +0 -1080
- package/lib/grid/slick.editors.core.d.ts +0 -4
- package/lib/grid/slick.editors.core.js +0 -232
- package/lib/grid/slick.editors.date.d.ts +0 -2
- package/lib/grid/slick.editors.date.js +0 -125
- package/lib/grid/slick.editors.lookup.d.ts +0 -14
- package/lib/grid/slick.editors.lookup.js +0 -353
- package/lib/grid/slick.editors.nav.d.ts +0 -6
- package/lib/grid/slick.editors.nav.js +0 -22
- package/lib/grid/slick.formatters.d.ts +0 -17
- package/lib/grid/slick.formatters.js +0 -137
- package/lib/grid/slick.grid.css +0 -325
- package/lib/grid/slick.grid.d.ts +0 -284
- package/lib/grid/slick.grid.js +0 -5395
- package/lib/grid/slick.groupitemmetadataprovider.d.ts +0 -39
- package/lib/grid/slick.groupitemmetadataprovider.js +0 -165
- package/lib/grid/slick.tree.css +0 -20
- package/lib/grid/slick.tree.d.ts +0 -33
- package/lib/grid/slick.tree.js +0 -220
- package/lib/grid.d.ts +0 -13
- package/lib/grid.js +0 -13
- package/lib/index.css +0 -2584
- package/lib/index.d.ts +0 -56
- package/lib/interaction/dataconverter.d.ts +0 -4
- package/lib/interaction/dataconverter.js +0 -1
- package/lib/interaction/eventhandler.d.ts +0 -13
- package/lib/interaction/eventhandler.js +0 -42
- package/lib/interaction/moveable.css +0 -0
- package/lib/interaction/moveable.d.ts +0 -39
- package/lib/interaction/moveable.js +0 -172
- package/lib/interaction/resizable.css +0 -33
- package/lib/interaction/resizable.d.ts +0 -37
- package/lib/interaction/resizable.js +0 -123
- package/lib/ui/auto.suggest.css +0 -14
- package/lib/ui/auto.suggest.d.ts +0 -17
- package/lib/ui/auto.suggest.js +0 -255
- package/lib/ui/base.css +0 -150
- package/lib/ui/date.picker/css/date-range-picker.css +0 -87
- package/lib/ui/date.picker/css/tiny-date-picker.css +0 -326
- package/lib/ui/date.picker/date-picker-options.d.ts +0 -11
- package/lib/ui/date.picker/date-picker-options.js +0 -76
- package/lib/ui/date.picker/lib/date-manip.d.ts +0 -74
- package/lib/ui/date.picker/lib/date-manip.js +0 -120
- package/lib/ui/date.picker/lib/dom.d.ts +0 -23
- package/lib/ui/date.picker/lib/dom.js +0 -28
- package/lib/ui/date.picker/lib/emitter.d.ts +0 -13
- package/lib/ui/date.picker/lib/emitter.js +0 -49
- package/lib/ui/date.picker/lib/fns.d.ts +0 -23
- package/lib/ui/date.picker/lib/fns.js +0 -43
- package/lib/ui/date.picker/mode/base-mode.d.ts +0 -26
- package/lib/ui/date.picker/mode/base-mode.js +0 -248
- package/lib/ui/date.picker/mode/dropdown-mode.d.ts +0 -28
- package/lib/ui/date.picker/mode/dropdown-mode.js +0 -50
- package/lib/ui/date.picker/mode/index.d.ts +0 -28
- package/lib/ui/date.picker/mode/index.js +0 -18
- package/lib/ui/date.picker/mode/modal-mode.d.ts +0 -25
- package/lib/ui/date.picker/mode/modal-mode.js +0 -17
- package/lib/ui/date.picker/mode/permanent-mode.d.ts +0 -29
- package/lib/ui/date.picker/mode/permanent-mode.js +0 -19
- package/lib/ui/date.picker/views/day-picker.d.ts +0 -40
- package/lib/ui/date.picker/views/day-picker.js +0 -155
- package/lib/ui/date.picker/views/month-picker.d.ts +0 -26
- package/lib/ui/date.picker/views/month-picker.js +0 -65
- package/lib/ui/date.picker/views/year-picker.d.ts +0 -20
- package/lib/ui/date.picker/views/year-picker.js +0 -66
- package/lib/ui/date.picker.d.ts +0 -66
- package/lib/ui/date.picker.js +0 -32
- package/lib/ui/dialog.css +0 -109
- package/lib/ui/dialog.d.ts +0 -22
- package/lib/ui/dialog.js +0 -113
- package/lib/ui/drop.down.css +0 -472
- package/lib/ui/drop.down.d.ts +0 -52
- package/lib/ui/drop.down.js +0 -2112
- package/lib/ui/number.input.css +0 -3
- package/lib/ui/number.input.d.ts +0 -12
- package/lib/ui/number.input.js +0 -64
- package/lib/ui/tabs.css +0 -53
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
import "./TimeComponent.scss";
|
|
13
|
-
import { EventHandler } from "../../interaction/eventhandler";
|
|
14
|
-
import { helper } from "../../core/helper";
|
|
15
|
-
import { date } from "../../core/date";
|
|
16
|
-
var TimeComponent = /** @class */ (function () {
|
|
17
|
-
function TimeComponent(options) {
|
|
18
|
-
var _a;
|
|
19
|
-
this.options = __assign({
|
|
20
|
-
enabled: true,
|
|
21
|
-
id: helper.newDomGuid(),
|
|
22
|
-
inputMode: "HourMinute",
|
|
23
|
-
bindMode: "toModel",
|
|
24
|
-
placeholder: (options === null || options === void 0 ? void 0 : options.inputMode) === "HourMinuteSecond" ? "__:__:__" : "__:__"
|
|
25
|
-
}, options);
|
|
26
|
-
if (this.options.bindTo != null && this.options.bindMode !== "fromModel" && this.options.property != null && this.options.value == null) {
|
|
27
|
-
this.options.value = (((_a = this.options.converter) === null || _a === void 0 ? void 0 : _a.toUI) ?
|
|
28
|
-
this.options.converter.toUI(this.options.bindTo[this.options.property]) :
|
|
29
|
-
this.options.bindTo[this.options.property]);
|
|
30
|
-
}
|
|
31
|
-
this.options.onChange = EventHandler.Create(this.options.onChange);
|
|
32
|
-
}
|
|
33
|
-
TimeComponent.prototype.render = function () {
|
|
34
|
-
var _a, _b;
|
|
35
|
-
var val = this.options.value;
|
|
36
|
-
if (this.options.bindMode !== "toModel" && this.options.bindTo != null && this.options.property != null) {
|
|
37
|
-
var current = this.getValue();
|
|
38
|
-
var newVal = (((_a = this.options.converter) === null || _a === void 0 ? void 0 : _a.toUI) ?
|
|
39
|
-
this.options.converter.toUI(this.options.bindTo[this.options.property]) :
|
|
40
|
-
this.options.bindTo[this.options.property]);
|
|
41
|
-
var newValStr = date.formatTime(newVal, this.options.inputMode);
|
|
42
|
-
if (newValStr !== current) {
|
|
43
|
-
val = newVal;
|
|
44
|
-
if (this.currentDom != null) {
|
|
45
|
-
this.currentDom.value = newValStr;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
return {
|
|
50
|
-
tag: "input", attr: {
|
|
51
|
-
id: this.options.id,
|
|
52
|
-
enabled: this.options.enabled,
|
|
53
|
-
value: date.formatTime(val, this.options.inputMode),
|
|
54
|
-
class: "time-comp " + ((_b = this.options.class) !== null && _b !== void 0 ? _b : ""),
|
|
55
|
-
style: this.options.style,
|
|
56
|
-
placeholder: this.options.placeholder,
|
|
57
|
-
change: this.raiseChangeEvent
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
};
|
|
61
|
-
TimeComponent.prototype.onCreate = function (node) {
|
|
62
|
-
this.currentDom = node.dom;
|
|
63
|
-
};
|
|
64
|
-
TimeComponent.prototype.onUpdate = function (node) {
|
|
65
|
-
this.currentDom = node.dom;
|
|
66
|
-
};
|
|
67
|
-
TimeComponent.prototype.getValue = function () {
|
|
68
|
-
if (this.currentDom == null) {
|
|
69
|
-
return "";
|
|
70
|
-
}
|
|
71
|
-
return this.currentDom.value;
|
|
72
|
-
};
|
|
73
|
-
TimeComponent.prototype.getValueAsDate = function (datePart) {
|
|
74
|
-
var x = datePart ? new Date(datePart.getTime()) : new Date();
|
|
75
|
-
try {
|
|
76
|
-
var parts = this.getValue().split(":");
|
|
77
|
-
x.setHours(parseInt(parts[0], 10));
|
|
78
|
-
if (parts.length > 1) {
|
|
79
|
-
x.setMinutes(parseInt(parts[1], 10));
|
|
80
|
-
}
|
|
81
|
-
else {
|
|
82
|
-
x.setMinutes(0);
|
|
83
|
-
}
|
|
84
|
-
if (this.options.inputMode === "HourMinuteSecond" && parts.length > 2) {
|
|
85
|
-
x.setSeconds(parseInt(parts[2], 10));
|
|
86
|
-
}
|
|
87
|
-
else {
|
|
88
|
-
x.setSeconds(0);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
catch (e) {
|
|
92
|
-
console.log(e);
|
|
93
|
-
this.currentDom.value = "";
|
|
94
|
-
x.setHours(0);
|
|
95
|
-
x.setMinutes(0);
|
|
96
|
-
x.setSeconds(0);
|
|
97
|
-
}
|
|
98
|
-
return x;
|
|
99
|
-
};
|
|
100
|
-
TimeComponent.prototype.raiseChangeEvent = function (e, node) {
|
|
101
|
-
var _a;
|
|
102
|
-
if (this.options.enabled) {
|
|
103
|
-
var val = this.getValueAsDate(this.options.value);
|
|
104
|
-
if (this.options.bindTo && this.options.bindMode !== "fromModel" && this.options.property) {
|
|
105
|
-
this.options.bindTo[this.options.property] =
|
|
106
|
-
((_a = this.options.converter) === null || _a === void 0 ? void 0 : _a.toData) ? this.options.converter.toData(val) : val;
|
|
107
|
-
}
|
|
108
|
-
this.options.onChange.notify(val);
|
|
109
|
-
}
|
|
110
|
-
};
|
|
111
|
-
return TimeComponent;
|
|
112
|
-
}());
|
|
113
|
-
export { TimeComponent };
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import "./TreeViewStyle.scss";
|
|
2
|
-
import { IJSLComponent, IJSLVNode } from "jsl-render";
|
|
3
|
-
export interface ITreeViewComponentOptions {
|
|
4
|
-
data: ITreeViewChild;
|
|
5
|
-
renderItem?: (data: any) => IJSLVNode;
|
|
6
|
-
style?: string;
|
|
7
|
-
class?: string;
|
|
8
|
-
}
|
|
9
|
-
export interface ITreeViewChild {
|
|
10
|
-
id: string;
|
|
11
|
-
content: IJSLVNode | string;
|
|
12
|
-
children?: ITreeViewChild[];
|
|
13
|
-
collapsed?: boolean;
|
|
14
|
-
}
|
|
15
|
-
export declare class TreeViewComponent implements IJSLComponent {
|
|
16
|
-
private options;
|
|
17
|
-
private filteredData;
|
|
18
|
-
constructor(options: ITreeViewComponentOptions);
|
|
19
|
-
isEqual(node: IJSLComponent): boolean;
|
|
20
|
-
render(): IJSLVNode;
|
|
21
|
-
private renderNode;
|
|
22
|
-
private addChild;
|
|
23
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import "./TreeViewStyle.scss";
|
|
2
|
-
var TreeViewComponent = /** @class */ (function () {
|
|
3
|
-
function TreeViewComponent(options) {
|
|
4
|
-
this.options = options;
|
|
5
|
-
}
|
|
6
|
-
TreeViewComponent.prototype.isEqual = function (node) {
|
|
7
|
-
return this.__proto__ === node.__proto__;
|
|
8
|
-
};
|
|
9
|
-
TreeViewComponent.prototype.render = function () {
|
|
10
|
-
var _a, _b;
|
|
11
|
-
return {
|
|
12
|
-
tag: "div", attr: { style: this.options.style, class: "treeview-comp hover " + ((_a = this.options.class) !== null && _a !== void 0 ? _a : "") }, children: [
|
|
13
|
-
{ tag: "ul", attr: { class: "tv-ul" }, children: [this.renderNode((_b = this.filteredData) !== null && _b !== void 0 ? _b : this.options.data)] }
|
|
14
|
-
]
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
TreeViewComponent.prototype.renderNode = function (el) {
|
|
18
|
-
var _this = this;
|
|
19
|
-
function getInput() {
|
|
20
|
-
var res = { tag: "input", attr: { class: "tv-input", type: "checkbox", id: el.id } };
|
|
21
|
-
if (el.collapsed) {
|
|
22
|
-
res.attr.checked = "checked";
|
|
23
|
-
}
|
|
24
|
-
return res;
|
|
25
|
-
}
|
|
26
|
-
return (el.children && el.children.length > 0) ?
|
|
27
|
-
{ tag: "li", children: [
|
|
28
|
-
getInput(),
|
|
29
|
-
this.addChild({ tag: "label", attr: { for: el.id } }, this.options.renderItem != null ? this.options.renderItem(el) : el.content),
|
|
30
|
-
{ tag: "ul", attr: { class: "tv-ul" }, children: el.children.map(function (c) { return _this.renderNode(c); }) }
|
|
31
|
-
] } :
|
|
32
|
-
this.addChild({ tag: "li" }, this.options.renderItem != null ? this.options.renderItem(el) : el.content);
|
|
33
|
-
};
|
|
34
|
-
TreeViewComponent.prototype.addChild = function (parent, content) {
|
|
35
|
-
if (typeof content === "string") {
|
|
36
|
-
parent.content = content;
|
|
37
|
-
}
|
|
38
|
-
else {
|
|
39
|
-
parent.children = [content];
|
|
40
|
-
}
|
|
41
|
-
return parent;
|
|
42
|
-
};
|
|
43
|
-
return TreeViewComponent;
|
|
44
|
-
}());
|
|
45
|
-
export { TreeViewComponent };
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
$defaultColor: rgba(50,50,50, 0.5);
|
|
3
|
-
// $hoverColor: #3B99FF;
|
|
4
|
-
|
|
5
|
-
// @mixin transition-duration($duration: 1s){
|
|
6
|
-
// -webkit-transition-duration: $duration;
|
|
7
|
-
// -moz-transition-duration: $duration;
|
|
8
|
-
// -ms-transition-duration: $duration;
|
|
9
|
-
// -o-transition-duration: $duration;
|
|
10
|
-
// transition-duration: $duration;
|
|
11
|
-
// }
|
|
12
|
-
|
|
13
|
-
// @mixin transition-property($property){
|
|
14
|
-
// -webkit-transition-property: $property;
|
|
15
|
-
// -moz-transition-property: $property;
|
|
16
|
-
// -ms-transition-property: $property;
|
|
17
|
-
// -o-transition-property: $property;
|
|
18
|
-
// transition-property: $property;
|
|
19
|
-
// }
|
|
20
|
-
|
|
21
|
-
// @mixin user-select($select: none){
|
|
22
|
-
// -webkit-user-select: $select;
|
|
23
|
-
// -moz-user-select: $select;
|
|
24
|
-
// -ms-user-select: $select;
|
|
25
|
-
// -o-user-select: $select;
|
|
26
|
-
// user-select: $select;
|
|
27
|
-
// }
|
|
28
|
-
|
|
29
|
-
.treeview-comp {
|
|
30
|
-
// float: left;
|
|
31
|
-
// @include user-select;
|
|
32
|
-
|
|
33
|
-
// &:hover input ~ label:before,
|
|
34
|
-
// &.hover input ~ label:before{
|
|
35
|
-
// opacity: 1.0;
|
|
36
|
-
// @include transition-duration(0.5s);
|
|
37
|
-
// }
|
|
38
|
-
|
|
39
|
-
.tv-ul {
|
|
40
|
-
// @include transition-duration;
|
|
41
|
-
list-style: none;
|
|
42
|
-
padding-left: 1em;
|
|
43
|
-
|
|
44
|
-
// li {
|
|
45
|
-
// span{
|
|
46
|
-
// @include transition-property(color);
|
|
47
|
-
// @include transition-duration;
|
|
48
|
-
|
|
49
|
-
// &:hover {
|
|
50
|
-
// color: $hoverColor;
|
|
51
|
-
// @include transition-duration(0.3s);
|
|
52
|
-
// }
|
|
53
|
-
// }
|
|
54
|
-
// }
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
.tv-input{
|
|
58
|
-
display: none;
|
|
59
|
-
|
|
60
|
-
&:checked ~ ul {
|
|
61
|
-
display: none;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
& ~ label {
|
|
65
|
-
cursor: pointer;
|
|
66
|
-
position: relative;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
& ~ label:before {
|
|
70
|
-
content: '';
|
|
71
|
-
width: 0;
|
|
72
|
-
height: 0;
|
|
73
|
-
position: absolute;
|
|
74
|
-
margin-left: -1em;
|
|
75
|
-
margin-top: 0.4em;
|
|
76
|
-
border-width: 4px;
|
|
77
|
-
border-style: solid;
|
|
78
|
-
border-top-color: transparent;
|
|
79
|
-
border-right-color: $defaultColor;
|
|
80
|
-
border-bottom-color: $defaultColor;
|
|
81
|
-
border-left-color: transparent;
|
|
82
|
-
// opacity: 0.0;
|
|
83
|
-
// @include transition-property(opacity);
|
|
84
|
-
// @include transition-duration;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
&:checked ~ label:before {
|
|
88
|
-
margin-left: -0.8em;
|
|
89
|
-
border-width: 5px;
|
|
90
|
-
border-top-color: transparent;
|
|
91
|
-
border-right-color: transparent;
|
|
92
|
-
border-bottom-color: transparent;
|
|
93
|
-
border-left-color: $defaultColor;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import "./VirtualRenderStyle.scss";
|
|
2
|
-
import { IJSLComponent, IJSLVNode, JSLRender } from "jsl-render";
|
|
3
|
-
export interface IVirtualArg {
|
|
4
|
-
index: number;
|
|
5
|
-
rowData: any;
|
|
6
|
-
container: IJSLVNode;
|
|
7
|
-
}
|
|
8
|
-
export interface IVirtualRenderOptions {
|
|
9
|
-
data: any[];
|
|
10
|
-
renderRow: (args: IVirtualArg) => string | IJSLVNode | IJSLComponent | void;
|
|
11
|
-
rowHeight?: number;
|
|
12
|
-
rowTag?: string;
|
|
13
|
-
bufferSizeInPx?: number;
|
|
14
|
-
viewportSizeInPX?: number;
|
|
15
|
-
class?: string;
|
|
16
|
-
style?: string;
|
|
17
|
-
}
|
|
18
|
-
export declare class VirtualRenderComponent implements IJSLComponent {
|
|
19
|
-
State: {
|
|
20
|
-
scrollPos: number;
|
|
21
|
-
renderer?: JSLRender;
|
|
22
|
-
};
|
|
23
|
-
private options;
|
|
24
|
-
constructor(options: IVirtualRenderOptions);
|
|
25
|
-
isEqual(node: IJSLComponent): boolean;
|
|
26
|
-
setData(data: any[]): void;
|
|
27
|
-
onInit(renderer: JSLRender): void;
|
|
28
|
-
render(): IJSLVNode;
|
|
29
|
-
private getChildren;
|
|
30
|
-
}
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
import "./VirtualRenderStyle.scss";
|
|
13
|
-
var VirtualRenderComponent = /** @class */ (function () {
|
|
14
|
-
function VirtualRenderComponent(options) {
|
|
15
|
-
this.State = { scrollPos: 0 };
|
|
16
|
-
var defaultOptions = {
|
|
17
|
-
data: null,
|
|
18
|
-
renderRow: null,
|
|
19
|
-
bufferSizeInPx: 200,
|
|
20
|
-
rowHeight: 20,
|
|
21
|
-
rowTag: "div",
|
|
22
|
-
viewportSizeInPX: window.innerHeight
|
|
23
|
-
};
|
|
24
|
-
this.options = __assign(__assign({}, defaultOptions), options);
|
|
25
|
-
}
|
|
26
|
-
VirtualRenderComponent.prototype.isEqual = function (node) {
|
|
27
|
-
return this.__proto__ === node.__proto__;
|
|
28
|
-
};
|
|
29
|
-
VirtualRenderComponent.prototype.setData = function (data) {
|
|
30
|
-
this.options.data = data;
|
|
31
|
-
};
|
|
32
|
-
VirtualRenderComponent.prototype.onInit = function (renderer) {
|
|
33
|
-
this.State.renderer = renderer;
|
|
34
|
-
};
|
|
35
|
-
VirtualRenderComponent.prototype.render = function () {
|
|
36
|
-
var _this = this;
|
|
37
|
-
var _a, _b;
|
|
38
|
-
var o = this.options;
|
|
39
|
-
var vrBody = {
|
|
40
|
-
tag: "div",
|
|
41
|
-
attr: { class: "v-r-child", style: "height:" + (o.data.length * o.rowHeight) + "px;position:relative" },
|
|
42
|
-
children: this.getChildren()
|
|
43
|
-
};
|
|
44
|
-
var vrContainer = {
|
|
45
|
-
tag: "div", attr: {
|
|
46
|
-
class: "v-r-comp " + ((_a = o.class) !== null && _a !== void 0 ? _a : ""),
|
|
47
|
-
style: "overflow-y:auto;" + ((_b = o.style) !== null && _b !== void 0 ? _b : ""),
|
|
48
|
-
scroll: function (e, node) {
|
|
49
|
-
var newScrollPos = node.dom.scrollTop;
|
|
50
|
-
if (Math.abs(_this.State.scrollPos - newScrollPos) < o.bufferSizeInPx) {
|
|
51
|
-
return false;
|
|
52
|
-
}
|
|
53
|
-
_this.State.scrollPos = newScrollPos;
|
|
54
|
-
vrBody.children = _this.getChildren();
|
|
55
|
-
node.children[0].children = [{ tag: "dummy" }];
|
|
56
|
-
_this.State.renderer.updateNode(node.children[0], vrBody);
|
|
57
|
-
return false;
|
|
58
|
-
}
|
|
59
|
-
}, children: [vrBody]
|
|
60
|
-
};
|
|
61
|
-
return vrContainer;
|
|
62
|
-
};
|
|
63
|
-
// public scrollRowToTop(idx: number) {
|
|
64
|
-
// }
|
|
65
|
-
// public scrollRowToCenter(idx: number) {
|
|
66
|
-
// }
|
|
67
|
-
// public scrollRowToBottom(idx: number) {
|
|
68
|
-
// }
|
|
69
|
-
VirtualRenderComponent.prototype.getChildren = function () {
|
|
70
|
-
var o = this.options;
|
|
71
|
-
var children = [];
|
|
72
|
-
var viewport = {
|
|
73
|
-
top: Math.floor((this.State.scrollPos - o.bufferSizeInPx) / o.rowHeight),
|
|
74
|
-
bottom: Math.ceil((this.State.scrollPos + o.viewportSizeInPX + o.bufferSizeInPx) / o.rowHeight)
|
|
75
|
-
};
|
|
76
|
-
for (var idx = viewport.top; idx < viewport.bottom; idx++) {
|
|
77
|
-
if (idx < 0 || idx >= o.data.length) {
|
|
78
|
-
continue;
|
|
79
|
-
}
|
|
80
|
-
var node = {
|
|
81
|
-
tag: o.rowTag, attr: {
|
|
82
|
-
style: {
|
|
83
|
-
top: (idx * o.rowHeight) + "px",
|
|
84
|
-
height: o.rowHeight + "px",
|
|
85
|
-
position: "absolute",
|
|
86
|
-
left: "0",
|
|
87
|
-
right: "0"
|
|
88
|
-
}
|
|
89
|
-
}, children: []
|
|
90
|
-
};
|
|
91
|
-
var result = o.renderRow({ index: idx, container: node, rowData: o.data[idx] });
|
|
92
|
-
if (typeof result === "string") {
|
|
93
|
-
node.content = result;
|
|
94
|
-
}
|
|
95
|
-
else if (result != null) {
|
|
96
|
-
node.children.push(result);
|
|
97
|
-
}
|
|
98
|
-
children.push(node);
|
|
99
|
-
}
|
|
100
|
-
return children;
|
|
101
|
-
};
|
|
102
|
-
return VirtualRenderComponent;
|
|
103
|
-
}());
|
|
104
|
-
export { VirtualRenderComponent };
|