jsl-ui 9.3.1 → 9.5.0
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/components/form-field/FormFieldComponent.d.ts +1 -0
- package/lib/components/form-field/FormFieldComponent.js +2 -1
- package/lib/grid/slick.editors.date.d.ts +1 -0
- package/lib/grid/slick.editors.date.js +58 -0
- package/lib/grid/slick.grid.d.ts +2 -0
- package/lib/grid/slick.grid.js +4 -4
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -13,7 +13,7 @@ var FormFieldComponent = /** @class */ (function () {
|
|
|
13
13
|
var _a, _b;
|
|
14
14
|
return {
|
|
15
15
|
tag: "div",
|
|
16
|
-
attr: { class: "form-field " + (_a = this.options.class, (_a !== null && _a !== void 0 ? _a : "")) },
|
|
16
|
+
attr: { class: "form-field " + (this.options.value ? "form-field--is-filled " : "") + (_a = this.options.class, (_a !== null && _a !== void 0 ? _a : "")) },
|
|
17
17
|
children: [{
|
|
18
18
|
tag: "div",
|
|
19
19
|
attr: { class: "form-field__control" + (this.validationMessage ? " failed__valid" : "") },
|
|
@@ -30,6 +30,7 @@ var FormFieldComponent = /** @class */ (function () {
|
|
|
30
30
|
attr: {
|
|
31
31
|
id: this.id,
|
|
32
32
|
type: this.type,
|
|
33
|
+
value: this.options.value,
|
|
33
34
|
maxLength: this.options.maxLength,
|
|
34
35
|
class: "form-field__input",
|
|
35
36
|
blur: this.setInActive,
|
|
@@ -65,3 +65,61 @@ export function DateEditor(args) {
|
|
|
65
65
|
};
|
|
66
66
|
this.init();
|
|
67
67
|
}
|
|
68
|
+
export function TimeEditor(args) {
|
|
69
|
+
var input;
|
|
70
|
+
var defaultValue;
|
|
71
|
+
var scope = this;
|
|
72
|
+
this.init = function () {
|
|
73
|
+
var navOnLR = args.grid.getOptions().editorCellNavOnLRKeys;
|
|
74
|
+
input = document.createElement("input");
|
|
75
|
+
input.type = "time";
|
|
76
|
+
input.className = "editor-text";
|
|
77
|
+
if (args.column.maxLength > 0) {
|
|
78
|
+
input.maxLength = args.column.maxLength;
|
|
79
|
+
}
|
|
80
|
+
input.addEventListener("keydown", navOnLR ? handleKeydownLRNav : handleKeydownLRNoNav);
|
|
81
|
+
args.container.appendChild(input);
|
|
82
|
+
input.focus();
|
|
83
|
+
input.select();
|
|
84
|
+
};
|
|
85
|
+
this.destroy = function () {
|
|
86
|
+
input.parentElement.removeChild(input);
|
|
87
|
+
};
|
|
88
|
+
this.focus = function () {
|
|
89
|
+
input.focus();
|
|
90
|
+
};
|
|
91
|
+
this.getValue = function () {
|
|
92
|
+
return input.value;
|
|
93
|
+
};
|
|
94
|
+
this.setValue = function (val) {
|
|
95
|
+
input.value = val;
|
|
96
|
+
};
|
|
97
|
+
this.loadValue = function (item) {
|
|
98
|
+
defaultValue = item[args.column.field] || "";
|
|
99
|
+
input.value = defaultValue;
|
|
100
|
+
input.defaultValue = defaultValue;
|
|
101
|
+
input.select();
|
|
102
|
+
};
|
|
103
|
+
this.serializeValue = function () {
|
|
104
|
+
return input.value;
|
|
105
|
+
};
|
|
106
|
+
this.applyValue = function (item, state) {
|
|
107
|
+
item[args.column.field] = state;
|
|
108
|
+
};
|
|
109
|
+
this.isValueChanged = function () {
|
|
110
|
+
return (!(input.value == "" && defaultValue == null)) && (input.value != defaultValue);
|
|
111
|
+
};
|
|
112
|
+
this.validate = function () {
|
|
113
|
+
if (args.column.validator) {
|
|
114
|
+
var validationResults = args.column.validator(input.value);
|
|
115
|
+
if (!validationResults.valid) {
|
|
116
|
+
return validationResults;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
return {
|
|
120
|
+
valid: true,
|
|
121
|
+
msg: null
|
|
122
|
+
};
|
|
123
|
+
};
|
|
124
|
+
this.init();
|
|
125
|
+
}
|
package/lib/grid/slick.grid.d.ts
CHANGED
|
@@ -127,6 +127,7 @@ export interface ISlickGrid<T> {
|
|
|
127
127
|
row: number;
|
|
128
128
|
cell: number;
|
|
129
129
|
item: T;
|
|
130
|
+
value: any;
|
|
130
131
|
}>;
|
|
131
132
|
"onAddNewRow": ISlickEvent<{
|
|
132
133
|
item: T;
|
|
@@ -243,5 +244,6 @@ export interface ISlickGrid<T> {
|
|
|
243
244
|
commitCurrentEdit: () => boolean;
|
|
244
245
|
cancelCurrentEdit: () => boolean;
|
|
245
246
|
};
|
|
247
|
+
"resetActiveCell": () => void;
|
|
246
248
|
}
|
|
247
249
|
export declare function SlickGrid(container: HTMLDivElement | string, data: any, columns: ISlickColumn[], options: ISlickGridOptions): void;
|
package/lib/grid/slick.grid.js
CHANGED
|
@@ -2866,7 +2866,7 @@ export function SlickGrid(container, data, columns, options) {
|
|
|
2866
2866
|
}
|
|
2867
2867
|
}
|
|
2868
2868
|
// do not render cells outside of the viewport.
|
|
2869
|
-
if (columnPosRight[Math.min(ii - 1, i + colspan - 1)] > range.leftPx) {
|
|
2869
|
+
if (columnPosRight[Math.min(ii - 1, i + colspan - 1)] > range.leftPx || m.alwaysRenderColumn) {
|
|
2870
2870
|
if (!m.alwaysRenderColumn && columnPosLeft[i] > range.rightPx) {
|
|
2871
2871
|
// all columns to the right are outside the range.
|
|
2872
2872
|
break;
|
|
@@ -2878,9 +2878,9 @@ export function SlickGrid(container, data, columns, options) {
|
|
|
2878
2878
|
html.L += appendCellHtml(row, i, colspan, d);
|
|
2879
2879
|
}
|
|
2880
2880
|
}
|
|
2881
|
-
else if (m.alwaysRenderColumn || (hasFrozenColumns() && i <= options.frozenColumn)) {
|
|
2882
|
-
|
|
2883
|
-
}
|
|
2881
|
+
// else if (m.alwaysRenderColumn || (hasFrozenColumns() && i <= options.frozenColumn)) {
|
|
2882
|
+
// html.L += appendCellHtml(row, i, colspan, d);
|
|
2883
|
+
// }
|
|
2884
2884
|
if (colspan > 1) {
|
|
2885
2885
|
i += (colspan - 1);
|
|
2886
2886
|
}
|