@easydata/crud 1.4.0-rc01 → 1.4.1-rc02
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/browser/easydata.css +6 -6
- package/dist/browser/easydata.css.map +1 -1
- package/dist/browser/easydata.js +172 -150
- package/dist/browser/easydata.js.map +1 -1
- package/dist/browser/easydata.min.css +1 -1
- package/dist/browser/easydata.min.js +1 -1
- package/dist/browser/easydata.min.js.map +1 -1
- package/dist/bundles/easydata.crud.js +151 -129
- package/dist/bundles/easydata.crud.js.map +1 -1
- package/dist/bundles/easydata.crud.min.js +1 -1
- package/dist/bundles/easydata.crud.min.js.map +1 -1
- package/dist/lib/form/entity_form_builder.js +7 -10
- package/dist/lib/form/entity_form_builder.js.map +1 -1
- package/dist/lib/i18n/text_resources.js +1 -0
- package/dist/lib/i18n/text_resources.js.map +1 -1
- package/dist/lib/main/data_context.d.ts +1 -1
- package/dist/lib/main/data_context.js +1 -1
- package/dist/lib/views/easy_data_view_dispatcher.d.ts +4 -4
- package/dist/lib/views/easy_data_view_dispatcher.js +38 -35
- package/dist/lib/views/easy_data_view_dispatcher.js.map +1 -1
- package/dist/lib/views/entity_data_view.js +6 -4
- package/dist/lib/views/entity_data_view.js.map +1 -1
- package/package.json +3 -3
package/dist/browser/easydata.js
CHANGED
|
@@ -149,7 +149,7 @@ var EditorTag = {
|
|
|
149
149
|
};
|
|
150
150
|
//# sourceMappingURL=editor_tag.js.map
|
|
151
151
|
// EXTERNAL MODULE: d:/a/easydata/easydata/easydata.js/packs/core/dist/lib/http/http_method.js
|
|
152
|
-
var http_method = __webpack_require__(
|
|
152
|
+
var http_method = __webpack_require__(11);
|
|
153
153
|
|
|
154
154
|
// EXTERNAL MODULE: d:/a/easydata/easydata/easydata.js/packs/core/dist/lib/http/http_request.js
|
|
155
155
|
var http_request = __webpack_require__(16);
|
|
@@ -1710,7 +1710,7 @@ __webpack_require__.d(__webpack_exports__, "dialogs", function() { return /* bin
|
|
|
1710
1710
|
var easy_grid = __webpack_require__(29);
|
|
1711
1711
|
|
|
1712
1712
|
// EXTERNAL MODULE: d:/a/easydata/easydata/easydata.js/packs/ui/dist/lib/grid/easy_grid_options.js
|
|
1713
|
-
var easy_grid_options = __webpack_require__(
|
|
1713
|
+
var easy_grid_options = __webpack_require__(10);
|
|
1714
1714
|
|
|
1715
1715
|
// EXTERNAL MODULE: d:/a/easydata/easydata/easydata.js/packs/ui/dist/lib/grid/easy_grid_columns.js
|
|
1716
1716
|
var easy_grid_columns = __webpack_require__(8);
|
|
@@ -2372,7 +2372,7 @@ var default_date_time_picker_DefaultDateTimePicker = /** @class */ (function (_s
|
|
|
2372
2372
|
var browser_utils = __webpack_require__(18);
|
|
2373
2373
|
|
|
2374
2374
|
// EXTERNAL MODULE: d:/a/easydata/easydata/easydata.js/packs/ui/dist/lib/utils/drag_manager.js
|
|
2375
|
-
var drag_manager = __webpack_require__(
|
|
2375
|
+
var drag_manager = __webpack_require__(12);
|
|
2376
2376
|
|
|
2377
2377
|
// EXTERNAL MODULE: d:/a/easydata/easydata/easydata.js/packs/ui/dist/lib/utils/mask.js
|
|
2378
2378
|
var mask = __webpack_require__(19);
|
|
@@ -3905,6 +3905,20 @@ var Validator = /** @class */ (function () {
|
|
|
3905
3905
|
/* 10 */
|
|
3906
3906
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
3907
3907
|
|
|
3908
|
+
"use strict";
|
|
3909
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AutoResizeColumns; });
|
|
3910
|
+
var AutoResizeColumns;
|
|
3911
|
+
(function (AutoResizeColumns) {
|
|
3912
|
+
AutoResizeColumns[AutoResizeColumns["Always"] = 0] = "Always";
|
|
3913
|
+
AutoResizeColumns[AutoResizeColumns["Once"] = 1] = "Once";
|
|
3914
|
+
AutoResizeColumns[AutoResizeColumns["Never"] = 2] = "Never";
|
|
3915
|
+
})(AutoResizeColumns || (AutoResizeColumns = {}));
|
|
3916
|
+
//# sourceMappingURL=easy_grid_options.js.map
|
|
3917
|
+
|
|
3918
|
+
/***/ }),
|
|
3919
|
+
/* 11 */
|
|
3920
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
3921
|
+
|
|
3908
3922
|
"use strict";
|
|
3909
3923
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return HttpMethod; });
|
|
3910
3924
|
var HttpMethod;
|
|
@@ -3919,7 +3933,7 @@ var HttpMethod;
|
|
|
3919
3933
|
//# sourceMappingURL=http_method.js.map
|
|
3920
3934
|
|
|
3921
3935
|
/***/ }),
|
|
3922
|
-
/*
|
|
3936
|
+
/* 12 */
|
|
3923
3937
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
3924
3938
|
|
|
3925
3939
|
"use strict";
|
|
@@ -4297,20 +4311,6 @@ var DragManager = /** @class */ (function () {
|
|
|
4297
4311
|
var eqDragManager = new DragManager();
|
|
4298
4312
|
//# sourceMappingURL=drag_manager.js.map
|
|
4299
4313
|
|
|
4300
|
-
/***/ }),
|
|
4301
|
-
/* 12 */
|
|
4302
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
4303
|
-
|
|
4304
|
-
"use strict";
|
|
4305
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AutoResizeColumns; });
|
|
4306
|
-
var AutoResizeColumns;
|
|
4307
|
-
(function (AutoResizeColumns) {
|
|
4308
|
-
AutoResizeColumns[AutoResizeColumns["Always"] = 0] = "Always";
|
|
4309
|
-
AutoResizeColumns[AutoResizeColumns["Once"] = 1] = "Once";
|
|
4310
|
-
AutoResizeColumns[AutoResizeColumns["Never"] = 2] = "Never";
|
|
4311
|
-
})(AutoResizeColumns || (AutoResizeColumns = {}));
|
|
4312
|
-
//# sourceMappingURL=easy_grid_options.js.map
|
|
4313
|
-
|
|
4314
4314
|
/***/ }),
|
|
4315
4315
|
/* 13 */
|
|
4316
4316
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
@@ -5758,7 +5758,7 @@ var EntityEditForm = /** @class */ (function () {
|
|
|
5758
5758
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return HttpClient; });
|
|
5759
5759
|
/* harmony import */ var _utils_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4);
|
|
5760
5760
|
/* harmony import */ var _http_action_result__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(32);
|
|
5761
|
-
/* harmony import */ var _http_method__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(
|
|
5761
|
+
/* harmony import */ var _http_method__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(11);
|
|
5762
5762
|
/* harmony import */ var _http_request__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(16);
|
|
5763
5763
|
var __extends = (undefined && undefined.__extends) || (function () {
|
|
5764
5764
|
var extendStatics = function (d, b) {
|
|
@@ -7469,6 +7469,7 @@ var EasyDataTable = /** @class */ (function () {
|
|
|
7469
7469
|
this.cachedRows = [];
|
|
7470
7470
|
this.total = 0;
|
|
7471
7471
|
this.needTotal = !this._elasticChunks;
|
|
7472
|
+
this.fireUpdated();
|
|
7472
7473
|
};
|
|
7473
7474
|
EasyDataTable.prototype.createRow = function (dataOrRow) {
|
|
7474
7475
|
var _this = this;
|
|
@@ -7552,10 +7553,10 @@ var EasyDataTable = /** @class */ (function () {
|
|
|
7552
7553
|
"use strict";
|
|
7553
7554
|
/* WEBPACK VAR INJECTION */(function(Promise) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return EasyGrid; });
|
|
7554
7555
|
/* harmony import */ var _easydata_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
|
|
7555
|
-
/* harmony import */ var _utils_drag_manager__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(
|
|
7556
|
+
/* harmony import */ var _utils_drag_manager__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(12);
|
|
7556
7557
|
/* harmony import */ var _utils_dom_elem_builder__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1);
|
|
7557
7558
|
/* harmony import */ var _utils_ui_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6);
|
|
7558
|
-
/* harmony import */ var _easy_grid_options__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(
|
|
7559
|
+
/* harmony import */ var _easy_grid_options__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(10);
|
|
7559
7560
|
/* harmony import */ var _easy_grid_columns__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(8);
|
|
7560
7561
|
/* harmony import */ var _easy_grid_cell_renderer__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(13);
|
|
7561
7562
|
var __assign = (undefined && undefined.__assign) || function () {
|
|
@@ -7610,7 +7611,7 @@ var EasyGrid = /** @class */ (function () {
|
|
|
7610
7611
|
pageSizeItems: [20, 30, 50, 100, 200]
|
|
7611
7612
|
},
|
|
7612
7613
|
columnWidths: {
|
|
7613
|
-
autoResize: _easy_grid_options__WEBPACK_IMPORTED_MODULE_4__[/* AutoResizeColumns */ "a"].
|
|
7614
|
+
autoResize: _easy_grid_options__WEBPACK_IMPORTED_MODULE_4__[/* AutoResizeColumns */ "a"].Always,
|
|
7614
7615
|
stringColumns: {
|
|
7615
7616
|
min: 100,
|
|
7616
7617
|
max: 500,
|
|
@@ -7638,7 +7639,7 @@ var EasyGrid = /** @class */ (function () {
|
|
|
7638
7639
|
default: 60
|
|
7639
7640
|
}
|
|
7640
7641
|
},
|
|
7641
|
-
|
|
7642
|
+
showPlusButton: false,
|
|
7642
7643
|
viewportRowsCount: null,
|
|
7643
7644
|
showActiveRow: true
|
|
7644
7645
|
};
|
|
@@ -7737,8 +7738,8 @@ var EasyGrid = /** @class */ (function () {
|
|
|
7737
7738
|
if (options.onRowDbClick) {
|
|
7738
7739
|
this.addEventListener('rowDbClick', options.onRowDbClick);
|
|
7739
7740
|
}
|
|
7740
|
-
if (options.
|
|
7741
|
-
this.addEventListener('
|
|
7741
|
+
if (options.onPlusButtonClick) {
|
|
7742
|
+
this.addEventListener('plusButtonClick', options.onPlusButtonClick);
|
|
7742
7743
|
}
|
|
7743
7744
|
if (options.onColumnChanged) {
|
|
7744
7745
|
this.addEventListener('columnChanged', options.onColumnChanged);
|
|
@@ -7824,7 +7825,7 @@ var EasyGrid = /** @class */ (function () {
|
|
|
7824
7825
|
};
|
|
7825
7826
|
EasyGrid.prototype.render = function () {
|
|
7826
7827
|
var _this = this;
|
|
7827
|
-
if (!this.hasData() && !this.options.
|
|
7828
|
+
if (!this.hasData() && !this.options.showPlusButton)
|
|
7828
7829
|
return;
|
|
7829
7830
|
this.containerInitialHeight = this.slot.clientHeight;
|
|
7830
7831
|
this.rootDiv = document.createElement('div');
|
|
@@ -7841,6 +7842,7 @@ var EasyGrid = /** @class */ (function () {
|
|
|
7841
7842
|
gridContainer.classList.add(this.cssPrefix + "-container");
|
|
7842
7843
|
gridContainer.appendChild(this.rootDiv);
|
|
7843
7844
|
this.slot.appendChild(gridContainer);
|
|
7845
|
+
var needAutoResize = this.options.columnWidths.autoResize !== _easy_grid_options__WEBPACK_IMPORTED_MODULE_4__[/* AutoResizeColumns */ "a"].Never;
|
|
7844
7846
|
if (this.rowsOnPagePromise) {
|
|
7845
7847
|
this.rowsOnPagePromise
|
|
7846
7848
|
.then(function () { return _this.updateHeight(); })
|
|
@@ -7854,17 +7856,12 @@ var EasyGrid = /** @class */ (function () {
|
|
|
7854
7856
|
_this.updateHeight()
|
|
7855
7857
|
.then(function () {
|
|
7856
7858
|
_this.firstRender = false;
|
|
7859
|
+
if (needAutoResize) {
|
|
7860
|
+
_this.resizeColumns();
|
|
7861
|
+
}
|
|
7857
7862
|
});
|
|
7858
7863
|
}, 100);
|
|
7859
7864
|
}
|
|
7860
|
-
var needAutoResize = this.options.columnWidths.autoResize !== _easy_grid_options__WEBPACK_IMPORTED_MODULE_4__[/* AutoResizeColumns */ "a"].Never;
|
|
7861
|
-
if (needAutoResize) {
|
|
7862
|
-
this.bodyCellContainerDiv.style.visibility = 'hidden';
|
|
7863
|
-
setTimeout(function () {
|
|
7864
|
-
_this.resizeColumns();
|
|
7865
|
-
_this.bodyCellContainerDiv.style.visibility = null;
|
|
7866
|
-
}, 20);
|
|
7867
|
-
}
|
|
7868
7865
|
};
|
|
7869
7866
|
EasyGrid.prototype.updateHeight = function () {
|
|
7870
7867
|
var _this = this;
|
|
@@ -7873,14 +7870,14 @@ var EasyGrid = /** @class */ (function () {
|
|
|
7873
7870
|
var firstRow = _this.bodyCellContainerDiv.firstElementChild;
|
|
7874
7871
|
var rowHeight = firstRow ? firstRow.offsetHeight : DEFAULT_ROW_HEIGHT;
|
|
7875
7872
|
var rowCount = _this.options.viewportRowsCount; // || DEFAULT_ROW_COUNT;
|
|
7876
|
-
var
|
|
7877
|
-
Object(_utils_dom_elem_builder__WEBPACK_IMPORTED_MODULE_2__[/* domel */ "e"])(_this.
|
|
7878
|
-
.setStyle('height',
|
|
7873
|
+
var viewportHeight_1 = rowHeight * rowCount;
|
|
7874
|
+
Object(_utils_dom_elem_builder__WEBPACK_IMPORTED_MODULE_2__[/* domel */ "e"])(_this.bodyViewportDiv)
|
|
7875
|
+
.setStyle('height', viewportHeight_1 + "px");
|
|
7879
7876
|
setTimeout(function () {
|
|
7880
7877
|
var sbHeight = _this.bodyViewportDiv.offsetHeight - _this.bodyViewportDiv.clientHeight;
|
|
7881
|
-
|
|
7882
|
-
Object(_utils_dom_elem_builder__WEBPACK_IMPORTED_MODULE_2__[/* domel */ "e"])(_this.
|
|
7883
|
-
.setStyle('height',
|
|
7878
|
+
viewportHeight_1 = viewportHeight_1 + sbHeight;
|
|
7879
|
+
Object(_utils_dom_elem_builder__WEBPACK_IMPORTED_MODULE_2__[/* domel */ "e"])(_this.bodyViewportDiv)
|
|
7880
|
+
.setStyle('height', viewportHeight_1 + "px");
|
|
7884
7881
|
resolve();
|
|
7885
7882
|
}, 100);
|
|
7886
7883
|
return;
|
|
@@ -7927,7 +7924,7 @@ var EasyGrid = /** @class */ (function () {
|
|
|
7927
7924
|
_this.headerRowDiv.appendChild(hd);
|
|
7928
7925
|
if (column.isRowNum) {
|
|
7929
7926
|
Object(_utils_dom_elem_builder__WEBPACK_IMPORTED_MODULE_2__[/* domel */ "e"])(hd)
|
|
7930
|
-
.addChildElement(_this.
|
|
7927
|
+
.addChildElement(_this.renderHeaderButtons());
|
|
7931
7928
|
}
|
|
7932
7929
|
});
|
|
7933
7930
|
var containerWidth = this.getContainerWidth();
|
|
@@ -8024,9 +8021,15 @@ var EasyGrid = /** @class */ (function () {
|
|
|
8024
8021
|
_this.updateTotalsState(groups_1, row, true);
|
|
8025
8022
|
}
|
|
8026
8023
|
}
|
|
8027
|
-
var
|
|
8028
|
-
|
|
8029
|
-
.
|
|
8024
|
+
var needAutoResize = _this.options.columnWidths.autoResize !== _easy_grid_options__WEBPACK_IMPORTED_MODULE_4__[/* AutoResizeColumns */ "a"].Never;
|
|
8025
|
+
if (needAutoResize) {
|
|
8026
|
+
_this.resizeColumns();
|
|
8027
|
+
}
|
|
8028
|
+
else {
|
|
8029
|
+
var containerWidth = _this.getContainerWidth();
|
|
8030
|
+
Object(_utils_dom_elem_builder__WEBPACK_IMPORTED_MODULE_2__[/* domel */ "e"])(_this.bodyCellContainerDiv)
|
|
8031
|
+
.setStyle('width', containerWidth + "px");
|
|
8032
|
+
}
|
|
8030
8033
|
return rowsToRender;
|
|
8031
8034
|
})
|
|
8032
8035
|
.catch(function (error) { console.error(error); return 0; });
|
|
@@ -8266,23 +8269,26 @@ var EasyGrid = /** @class */ (function () {
|
|
|
8266
8269
|
var pageInfoDiv = Object(_utils_dom_elem_builder__WEBPACK_IMPORTED_MODULE_2__[/* domel */ "e"])('div')
|
|
8267
8270
|
.addClass(this.cssPrefix + "-page-info")
|
|
8268
8271
|
.toDOM();
|
|
8269
|
-
var
|
|
8270
|
-
|
|
8271
|
-
|
|
8272
|
-
|
|
8273
|
-
|
|
8274
|
-
|
|
8275
|
-
|
|
8276
|
-
|
|
8277
|
-
var
|
|
8278
|
-
|
|
8279
|
-
|
|
8280
|
-
|
|
8281
|
-
|
|
8282
|
-
|
|
8283
|
-
|
|
8284
|
-
.
|
|
8285
|
-
|
|
8272
|
+
var rowCount = this.dataTable.getTotal();
|
|
8273
|
+
if (rowCount > 0) {
|
|
8274
|
+
var fistPageRecordNum = count
|
|
8275
|
+
? (this.pagination.page - 1) * this.pagination.pageSize + 1
|
|
8276
|
+
: 0;
|
|
8277
|
+
var lastPageRecordNum = count
|
|
8278
|
+
? fistPageRecordNum + count - 1
|
|
8279
|
+
: 0;
|
|
8280
|
+
var totalStr = this.dataTable.getTotal().toString();
|
|
8281
|
+
if (this.dataTable.elasticChunks) {
|
|
8282
|
+
var count_1 = this.dataTable.getCachedCount();
|
|
8283
|
+
var total = this.dataTable.getTotal();
|
|
8284
|
+
if (count_1 !== total)
|
|
8285
|
+
totalStr = '?';
|
|
8286
|
+
}
|
|
8287
|
+
pageInfoDiv.innerHTML = _easydata_core__WEBPACK_IMPORTED_MODULE_0__["i18n"].getText('GridPageInfo')
|
|
8288
|
+
.replace('{FirstPageRecordNum}', "<span>" + fistPageRecordNum.toString() + "</span>")
|
|
8289
|
+
.replace('{LastPageRecordNum}', "<span>" + lastPageRecordNum.toString() + "</span>")
|
|
8290
|
+
.replace('{Total}', "<span>" + totalStr + "</span>");
|
|
8291
|
+
}
|
|
8286
8292
|
return pageInfoDiv;
|
|
8287
8293
|
};
|
|
8288
8294
|
EasyGrid.prototype.showProgress = function () {
|
|
@@ -8377,7 +8383,8 @@ var EasyGrid = /** @class */ (function () {
|
|
|
8377
8383
|
var _this = this;
|
|
8378
8384
|
var paginateDiv = document.createElement('div');
|
|
8379
8385
|
paginateDiv.className = this.cssPrefix + "-pagination-wrapper";
|
|
8380
|
-
|
|
8386
|
+
var rowCount = this.dataTable.getTotal();
|
|
8387
|
+
if (this.options.paging && this.options.paging.enabled && rowCount > 0) {
|
|
8381
8388
|
var prefix_1 = this.paginationOptions.useBootstrap ? '' : this.cssPrefix + "-";
|
|
8382
8389
|
var buttonClickHandler_1 = function (ev) {
|
|
8383
8390
|
var element = ev.target;
|
|
@@ -8503,18 +8510,18 @@ var EasyGrid = /** @class */ (function () {
|
|
|
8503
8510
|
EasyGrid.prototype.removeEventListener = function (eventType, handlerId) {
|
|
8504
8511
|
this.eventEmitter.unsubscribe(eventType, handlerId);
|
|
8505
8512
|
};
|
|
8506
|
-
EasyGrid.prototype.
|
|
8513
|
+
EasyGrid.prototype.renderHeaderButtons = function () {
|
|
8507
8514
|
var _this = this;
|
|
8508
|
-
if (this.options.
|
|
8515
|
+
if (this.options.showPlusButton) {
|
|
8509
8516
|
return Object(_utils_dom_elem_builder__WEBPACK_IMPORTED_MODULE_2__[/* domel */ "e"])('div')
|
|
8510
|
-
.addClass(this.cssPrefix + "-
|
|
8511
|
-
.title(this.options.
|
|
8517
|
+
.addClass(this.cssPrefix + "-header-btn-plus")
|
|
8518
|
+
.title(this.options.plusButtonTitle || 'Add')
|
|
8512
8519
|
.addChild('a', function (builder) { return builder
|
|
8513
8520
|
.attr('href', 'javascript:void(0)')
|
|
8514
8521
|
.on('click', function (e) {
|
|
8515
8522
|
e.preventDefault();
|
|
8516
8523
|
_this.fireEvent({
|
|
8517
|
-
type: '
|
|
8524
|
+
type: 'plusButtonClick',
|
|
8518
8525
|
sourceEvent: e
|
|
8519
8526
|
});
|
|
8520
8527
|
}); })
|
|
@@ -8621,6 +8628,8 @@ var EasyGrid = /** @class */ (function () {
|
|
|
8621
8628
|
var containerWidth = this.bodyCellContainerDiv.style.width;
|
|
8622
8629
|
this.bodyCellContainerDiv.style.visibility = 'hidden';
|
|
8623
8630
|
this.bodyCellContainerDiv.style.width = '1px';
|
|
8631
|
+
//this.headerRowDiv.style.visibility = 'hidden';
|
|
8632
|
+
this.headerRowDiv.style.width = '1px';
|
|
8624
8633
|
var sumWidth = 0;
|
|
8625
8634
|
var columns = this.columns.getItems();
|
|
8626
8635
|
var headerCells = this.headerCellContainerDiv.querySelectorAll("." + this.cssPrefix + "-header-cell");
|
|
@@ -8641,44 +8650,53 @@ var EasyGrid = /** @class */ (function () {
|
|
|
8641
8650
|
value.parentElement.style.width = calculatedWidth + "px";
|
|
8642
8651
|
});
|
|
8643
8652
|
headerCells[headerIdx].style.width = calculatedWidth + "px";
|
|
8644
|
-
headerIdx++;
|
|
8645
8653
|
}
|
|
8646
|
-
else
|
|
8647
|
-
cellValues.
|
|
8648
|
-
|
|
8649
|
-
|
|
8650
|
-
if (width > maxWidth) {
|
|
8651
|
-
maxWidth = width;
|
|
8652
|
-
}
|
|
8653
|
-
});
|
|
8654
|
-
maxWidth += 3;
|
|
8655
|
-
var maxOption = column.isRowNum
|
|
8656
|
-
? this_1.options.columnWidths.rowNumColumn.max || 500
|
|
8657
|
-
: this_1.options.columnWidths[column.dataColumn.type].max || 2000;
|
|
8658
|
-
var minOption = column.isRowNum
|
|
8659
|
-
? this_1.options.columnWidths.rowNumColumn.min || 0
|
|
8660
|
-
: this_1.options.columnWidths[column.dataColumn.type].min || 20;
|
|
8661
|
-
if (maxWidth > maxOption) {
|
|
8662
|
-
maxWidth = maxOption;
|
|
8663
|
-
}
|
|
8664
|
-
if (maxWidth < minOption) {
|
|
8665
|
-
maxWidth = minOption;
|
|
8654
|
+
else {
|
|
8655
|
+
if (cellValues.length == 0) {
|
|
8656
|
+
headerCells[headerIdx].style.width = null;
|
|
8657
|
+
headerCells[headerIdx].style.whiteSpace = 'nowrap';
|
|
8666
8658
|
}
|
|
8667
|
-
|
|
8668
|
-
|
|
8669
|
-
|
|
8659
|
+
maxWidth = headerCells[headerIdx].offsetWidth;
|
|
8660
|
+
if (cellValues.length > 0) {
|
|
8661
|
+
cellValues.forEach(function (value) {
|
|
8662
|
+
value.parentElement.style.width = null;
|
|
8663
|
+
var width = value.parentElement.offsetWidth;
|
|
8664
|
+
if (width > maxWidth) {
|
|
8665
|
+
maxWidth = width;
|
|
8666
|
+
}
|
|
8667
|
+
});
|
|
8668
|
+
maxWidth += 3;
|
|
8669
|
+
var maxOption = column.isRowNum
|
|
8670
|
+
? this_1.options.columnWidths.rowNumColumn.max || 500
|
|
8671
|
+
: this_1.options.columnWidths[column.dataColumn.type].max || 2000;
|
|
8672
|
+
var minOption = column.isRowNum
|
|
8673
|
+
? this_1.options.columnWidths.rowNumColumn.min || 0
|
|
8674
|
+
: this_1.options.columnWidths[column.dataColumn.type].min || 20;
|
|
8675
|
+
if (maxWidth > maxOption) {
|
|
8676
|
+
maxWidth = maxOption;
|
|
8677
|
+
}
|
|
8678
|
+
if (maxWidth < minOption) {
|
|
8679
|
+
maxWidth = minOption;
|
|
8680
|
+
}
|
|
8681
|
+
if (_easydata_core__WEBPACK_IMPORTED_MODULE_0__["utils"].isNumericType(column.type)) {
|
|
8682
|
+
//increase the calculated width in 1.3 times for numeric columns
|
|
8683
|
+
maxWidth = Math.round(maxWidth * 1.3);
|
|
8684
|
+
}
|
|
8685
|
+
sumWidth += maxWidth;
|
|
8686
|
+
column.width = maxWidth;
|
|
8687
|
+
cellValues.forEach(function (value) {
|
|
8688
|
+
value.parentElement.style.width = maxWidth + "px";
|
|
8689
|
+
});
|
|
8690
|
+
headerCells[headerIdx].style.width = maxWidth + "px";
|
|
8691
|
+
if (column.dataColumn) {
|
|
8692
|
+
column.dataColumn.calculatedWidth = maxWidth;
|
|
8693
|
+
}
|
|
8670
8694
|
}
|
|
8671
|
-
|
|
8672
|
-
|
|
8673
|
-
cellValues.forEach(function (value) {
|
|
8674
|
-
value.parentElement.style.width = maxWidth + "px";
|
|
8675
|
-
});
|
|
8676
|
-
headerCells[headerIdx].style.width = maxWidth + "px";
|
|
8677
|
-
headerIdx++;
|
|
8678
|
-
if (column.dataColumn) {
|
|
8679
|
-
column.dataColumn.calculatedWidth = maxWidth;
|
|
8695
|
+
else {
|
|
8696
|
+
sumWidth += maxWidth;
|
|
8680
8697
|
}
|
|
8681
8698
|
}
|
|
8699
|
+
headerIdx++;
|
|
8682
8700
|
};
|
|
8683
8701
|
var this_1 = this;
|
|
8684
8702
|
for (var idx = 0; idx < this.columns.count; idx++) {
|
|
@@ -8693,6 +8711,7 @@ var EasyGrid = /** @class */ (function () {
|
|
|
8693
8711
|
this.headerCellContainerDiv.style.width = containerWidth;
|
|
8694
8712
|
}
|
|
8695
8713
|
this.bodyCellContainerDiv.style.visibility = null;
|
|
8714
|
+
this.headerRowDiv.removeAttribute('style');
|
|
8696
8715
|
};
|
|
8697
8716
|
return EasyGrid;
|
|
8698
8717
|
}());
|
|
@@ -11687,7 +11706,9 @@ var entity_form_builder_EntityEditFormBuilder = /** @class */ (function () {
|
|
|
11687
11706
|
var lookupEntity = this.context.getMetaData().getRootEntity()
|
|
11688
11707
|
.subEntities.filter(function (ent) { return ent.id == attr.lookupEntity; })[0];
|
|
11689
11708
|
var dataAttr = this.context.getMetaData().getAttributeById(attr.dataAttr);
|
|
11690
|
-
|
|
11709
|
+
if (!dataAttr)
|
|
11710
|
+
return;
|
|
11711
|
+
readOnly = readOnly || !dataAttr.isEditable;
|
|
11691
11712
|
value = this.params.values
|
|
11692
11713
|
? this.params.values.getValue(dataAttr.id)
|
|
11693
11714
|
: undefined;
|
|
@@ -12078,15 +12099,10 @@ var entity_form_builder_EntityEditFormBuilder = /** @class */ (function () {
|
|
|
12078
12099
|
this.form['setHtmlInt'](formHtml);
|
|
12079
12100
|
for (var _i = 0, _a = this.context.getActiveEntity().attributes; _i < _a.length; _i++) {
|
|
12080
12101
|
var attr = _a[_i];
|
|
12081
|
-
if (!attr.
|
|
12082
|
-
|
|
12083
|
-
|
|
12084
|
-
|
|
12085
|
-
}
|
|
12086
|
-
else {
|
|
12087
|
-
if (!attr.showOnCreate)
|
|
12088
|
-
continue;
|
|
12089
|
-
}
|
|
12102
|
+
if (!this.params.isEditForm && !attr.showOnCreate)
|
|
12103
|
+
continue;
|
|
12104
|
+
if (!attr.isPrimaryKey && this.params.isEditForm && !attr.showOnEdit) {
|
|
12105
|
+
continue;
|
|
12090
12106
|
}
|
|
12091
12107
|
this.addFormField(fb.toDOM(), attr);
|
|
12092
12108
|
}
|
|
@@ -12189,7 +12205,7 @@ var data_context_DataContext = /** @class */ (function () {
|
|
|
12189
12205
|
DataContext.prototype.getActiveEntity = function () {
|
|
12190
12206
|
return this.activeEntity;
|
|
12191
12207
|
};
|
|
12192
|
-
DataContext.prototype.
|
|
12208
|
+
DataContext.prototype.setActiveSource = function (entityId) {
|
|
12193
12209
|
this.activeEntity = this.model.getRootEntity().subEntities
|
|
12194
12210
|
.filter(function (e) { return e.id == entityId; })[0];
|
|
12195
12211
|
};
|
|
@@ -12430,10 +12446,12 @@ var entity_data_view_EntityDataView = /** @class */ (function () {
|
|
|
12430
12446
|
showBackToEntities: true
|
|
12431
12447
|
};
|
|
12432
12448
|
this.defaultValidators = [new required_validator_RequiredValidator(), new type_validator_TypeValidator()];
|
|
12433
|
-
options = options || {};
|
|
12434
12449
|
this.options = public_api["utils"].assignDeep(this.options, options || {});
|
|
12435
12450
|
this.dlg = new lib_public_api["DefaultDialogService"]();
|
|
12436
12451
|
var ent = this.context.getActiveEntity();
|
|
12452
|
+
if (!ent) {
|
|
12453
|
+
throw "Can't find active entity for " + window.location.pathname;
|
|
12454
|
+
}
|
|
12437
12455
|
this.slot.innerHTML += "<h1>" + (ent.captionPlural || ent.caption) + "</h1>";
|
|
12438
12456
|
if (this.options.showBackToEntities) {
|
|
12439
12457
|
Object(lib_public_api["domel"])(this.slot)
|
|
@@ -12470,10 +12488,10 @@ var entity_data_view_EntityDataView = /** @class */ (function () {
|
|
|
12470
12488
|
allowPageSizeChange: true,
|
|
12471
12489
|
pageSizeItems: [15, 30, 50, 100, 200]
|
|
12472
12490
|
},
|
|
12473
|
-
|
|
12474
|
-
|
|
12491
|
+
showPlusButton: _this.context.getActiveEntity().isEditable,
|
|
12492
|
+
plusButtonTitle: public_api["i18n"].getText('AddRecordBtnTitle'),
|
|
12475
12493
|
showActiveRow: false,
|
|
12476
|
-
|
|
12494
|
+
onPlusButtonClick: _this.addClickHandler.bind(_this),
|
|
12477
12495
|
onGetCellRenderer: _this.manageCellRenderer.bind(_this),
|
|
12478
12496
|
onRowDbClick: _this.rowDbClickHandler.bind(_this),
|
|
12479
12497
|
onSyncGridColumn: _this.syncGridColumnHandler.bind(_this)
|
|
@@ -12686,51 +12704,62 @@ var root_data_view_RootDataView = /** @class */ (function () {
|
|
|
12686
12704
|
var easy_data_view_dispatcher_EasyDataViewDispatcher = /** @class */ (function () {
|
|
12687
12705
|
function EasyDataViewDispatcher(options) {
|
|
12688
12706
|
var _this = this;
|
|
12689
|
-
this.options = {
|
|
12707
|
+
this.options = {
|
|
12708
|
+
container: '#EasyDataContainer',
|
|
12709
|
+
basePath: 'easydata'
|
|
12710
|
+
};
|
|
12690
12711
|
this.onSetLocation = function () {
|
|
12691
12712
|
_this.setActiveView();
|
|
12692
12713
|
};
|
|
12693
|
-
options = options || {};
|
|
12694
|
-
|
|
12695
|
-
this.options.basePath = (!this.options.rootEntity)
|
|
12696
|
-
? this.pretiffyPath(this.options.basePath)
|
|
12697
|
-
: this.pretiffyPath(window.location.pathname);
|
|
12698
|
-
if (this.options.rootEntity)
|
|
12714
|
+
this.options = public_api["utils"].assign(this.options, options || {});
|
|
12715
|
+
if (this.options.rootEntity) {
|
|
12699
12716
|
this.options.showBackToEntities = false;
|
|
12700
|
-
|
|
12717
|
+
this.basePath = '/';
|
|
12718
|
+
}
|
|
12719
|
+
else {
|
|
12720
|
+
this.basePath = this.normalizeBasePath(this.options.basePath);
|
|
12721
|
+
}
|
|
12722
|
+
this.setContainer(this.options.container);
|
|
12701
12723
|
var progressBarSlot = document.createElement('div');
|
|
12702
12724
|
var bar = new ProgressBar(progressBarSlot);
|
|
12703
12725
|
var parent = this.container.parentElement;
|
|
12704
12726
|
parent.insertBefore(progressBarSlot, parent.firstElementChild);
|
|
12705
12727
|
this.context = new data_context_DataContext({
|
|
12706
|
-
endpoint: options.endpoint,
|
|
12707
|
-
dataTable: options.dataTable,
|
|
12728
|
+
endpoint: this.options.endpoint,
|
|
12729
|
+
dataTable: this.options.dataTable,
|
|
12708
12730
|
onProcessStart: function () { return bar.show(); },
|
|
12709
12731
|
onProcessEnd: function () { return bar.hide(); }
|
|
12710
12732
|
});
|
|
12711
|
-
this.basePath = this.getBasePath();
|
|
12712
12733
|
}
|
|
12713
|
-
EasyDataViewDispatcher.prototype.
|
|
12734
|
+
EasyDataViewDispatcher.prototype.normalizeBasePath = function (basePath) {
|
|
12735
|
+
basePath = this.trimSlashes(basePath);
|
|
12736
|
+
var fullPath = decodeURIComponent(window.location.pathname);
|
|
12737
|
+
var idx = fullPath.toLocaleLowerCase().indexOf(basePath);
|
|
12738
|
+
return idx >= 0 ? fullPath.substring(0, idx + basePath.length) : '/';
|
|
12739
|
+
};
|
|
12740
|
+
EasyDataViewDispatcher.prototype.trimSlashes = function (path) {
|
|
12714
12741
|
return path.replace(/^\/|\/$/g, '');
|
|
12715
12742
|
};
|
|
12716
12743
|
EasyDataViewDispatcher.prototype.setContainer = function (container) {
|
|
12717
12744
|
if (!container) {
|
|
12718
|
-
|
|
12719
|
-
return;
|
|
12745
|
+
throw 'Container is undefined';
|
|
12720
12746
|
}
|
|
12721
12747
|
if (typeof container === 'string') {
|
|
12722
12748
|
if (container.length) {
|
|
12723
|
-
if (container[0] === '
|
|
12724
|
-
this.container = document.getElementById(container.substring(1));
|
|
12725
|
-
}
|
|
12726
|
-
else if (container[0] === '.') {
|
|
12749
|
+
if (container[0] === '.') {
|
|
12727
12750
|
var result = document.getElementsByClassName(container.substring(1));
|
|
12728
12751
|
if (result.length)
|
|
12729
12752
|
this.container = result[0];
|
|
12730
12753
|
}
|
|
12731
12754
|
else {
|
|
12732
|
-
|
|
12733
|
-
|
|
12755
|
+
if (container[0] === '#') {
|
|
12756
|
+
container = container.substring(1);
|
|
12757
|
+
}
|
|
12758
|
+
this.container = document.getElementById(container);
|
|
12759
|
+
}
|
|
12760
|
+
if (!this.container) {
|
|
12761
|
+
throw Error('Unrecognized `container` parameter: ' + container + '\n'
|
|
12762
|
+
+ 'It must be an element ID, a class name (starting with .) or an HTMLElement object itself.');
|
|
12734
12763
|
}
|
|
12735
12764
|
}
|
|
12736
12765
|
}
|
|
@@ -12738,20 +12767,12 @@ var easy_data_view_dispatcher_EasyDataViewDispatcher = /** @class */ (function (
|
|
|
12738
12767
|
this.container = container;
|
|
12739
12768
|
}
|
|
12740
12769
|
};
|
|
12741
|
-
EasyDataViewDispatcher.prototype.
|
|
12770
|
+
EasyDataViewDispatcher.prototype.getActiveSourceId = function () {
|
|
12742
12771
|
if (this.options.rootEntity)
|
|
12743
12772
|
return this.options.rootEntity;
|
|
12744
|
-
var
|
|
12745
|
-
var
|
|
12746
|
-
|
|
12747
|
-
return typeName && typeName.toLocaleLowerCase() !== this.options.basePath
|
|
12748
|
-
? typeName
|
|
12749
|
-
: null;
|
|
12750
|
-
};
|
|
12751
|
-
EasyDataViewDispatcher.prototype.getBasePath = function () {
|
|
12752
|
-
var decodedUrl = decodeURIComponent(window.location.href);
|
|
12753
|
-
var optBasePathIndex = decodedUrl.toLocaleLowerCase().indexOf(this.options.basePath);
|
|
12754
|
-
return decodedUrl.substring(0, optBasePathIndex + this.options.basePath.length);
|
|
12773
|
+
var path = decodeURIComponent(window.location.pathname);
|
|
12774
|
+
var idIndex = this.basePath.length + 1;
|
|
12775
|
+
return idIndex < path.length ? path.substring(idIndex) : null;
|
|
12755
12776
|
};
|
|
12756
12777
|
EasyDataViewDispatcher.prototype.run = function () {
|
|
12757
12778
|
var _this = this;
|
|
@@ -12764,9 +12785,9 @@ var easy_data_view_dispatcher_EasyDataViewDispatcher = /** @class */ (function (
|
|
|
12764
12785
|
};
|
|
12765
12786
|
EasyDataViewDispatcher.prototype.setActiveView = function () {
|
|
12766
12787
|
this.clear();
|
|
12767
|
-
var
|
|
12768
|
-
if (
|
|
12769
|
-
this.context.
|
|
12788
|
+
var sourceId = this.getActiveSourceId();
|
|
12789
|
+
if (sourceId) {
|
|
12790
|
+
this.context.setActiveSource(sourceId);
|
|
12770
12791
|
window['EDView'] = new entity_data_view_EntityDataView(this.container, this.context, this.basePath, this.options);
|
|
12771
12792
|
}
|
|
12772
12793
|
else {
|
|
@@ -12799,6 +12820,7 @@ function addEasyDataCRUDTexts() {
|
|
|
12799
12820
|
CalendarBtnTitle: 'Open calendar',
|
|
12800
12821
|
TimerBtnTitle: 'Open timer',
|
|
12801
12822
|
AddBtnTitle: 'Add',
|
|
12823
|
+
AddRecordBtnTitle: 'Add record',
|
|
12802
12824
|
EditBtn: 'Edit',
|
|
12803
12825
|
DeleteBtn: 'Delete',
|
|
12804
12826
|
SelectLink: '[ select ]',
|