@easydata/crud 1.4.5 → 1.4.7
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.js +23 -3
- package/dist/browser/easydata.js.map +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 +23 -3
- 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/package.json +3 -3
|
@@ -731,7 +731,7 @@ var i18n_i18n;
|
|
|
731
731
|
}
|
|
732
732
|
else if (['D', 'F', 'C'].indexOf(type) >= 0) {
|
|
733
733
|
var locale = getCurrentLocale();
|
|
734
|
-
return number.toLocaleString(locale,
|
|
734
|
+
return number.toLocaleString(locale, getNumberFormatOptions(format));
|
|
735
735
|
}
|
|
736
736
|
else {
|
|
737
737
|
return convertWithMask(Math.trunc(number), format);
|
|
@@ -807,7 +807,7 @@ var i18n_i18n;
|
|
|
807
807
|
}
|
|
808
808
|
return result.split('').reverse().join('');
|
|
809
809
|
}
|
|
810
|
-
function
|
|
810
|
+
function getNumberFormatOptions(format) {
|
|
811
811
|
var localeSettings = getLocaleSettings();
|
|
812
812
|
var type = format[0].toUpperCase();
|
|
813
813
|
var digits = (format.length > 1)
|
|
@@ -829,7 +829,8 @@ var i18n_i18n;
|
|
|
829
829
|
default:
|
|
830
830
|
return {
|
|
831
831
|
style: 'decimal',
|
|
832
|
-
minimumFractionDigits: digits
|
|
832
|
+
minimumFractionDigits: digits,
|
|
833
|
+
maximumFractionDigits: digits
|
|
833
834
|
};
|
|
834
835
|
}
|
|
835
836
|
}
|
|
@@ -4491,7 +4492,9 @@ var easy_grid_spreadArrays = (undefined && undefined.__spreadArrays) || function
|
|
|
4491
4492
|
|
|
4492
4493
|
var DEFAULT_ROW_HEIGHT = 36;
|
|
4493
4494
|
var DEFAULT_ROW_COUNT = 15;
|
|
4495
|
+
/** Represents a grid widget with columns rows, paging, custom rendering and more */
|
|
4494
4496
|
var easy_grid_EasyGrid = /** @class */ (function () {
|
|
4497
|
+
/** Creates and initializes all internal properties of the grid object */
|
|
4495
4498
|
function EasyGrid(options) {
|
|
4496
4499
|
this.cssPrefix = "keg";
|
|
4497
4500
|
this.pagination = { page: 1, pageSize: 30, total: 0 };
|
|
@@ -4610,6 +4613,7 @@ var easy_grid_EasyGrid = /** @class */ (function () {
|
|
|
4610
4613
|
widthOptions[dataType] = easy_grid_assign(easy_grid_assign({}, widthOptions.otherColumns), widthOptions[dataType]);
|
|
4611
4614
|
}
|
|
4612
4615
|
});
|
|
4616
|
+
widthOptions[DataType.Unknown] = widthOptions.otherColumns;
|
|
4613
4617
|
};
|
|
4614
4618
|
EasyGrid.prototype.setSlot = function (slot) {
|
|
4615
4619
|
if (typeof slot === 'string') {
|
|
@@ -4632,6 +4636,7 @@ var easy_grid_EasyGrid = /** @class */ (function () {
|
|
|
4632
4636
|
this.slot = slot;
|
|
4633
4637
|
}
|
|
4634
4638
|
};
|
|
4639
|
+
/** Initializes grid widget according to the options passed in the parameter */
|
|
4635
4640
|
EasyGrid.prototype.init = function (options) {
|
|
4636
4641
|
var _this = this;
|
|
4637
4642
|
if (options.onInit) {
|
|
@@ -4695,6 +4700,10 @@ var easy_grid_EasyGrid = /** @class */ (function () {
|
|
|
4695
4700
|
this.refresh();
|
|
4696
4701
|
this.fireEvent('init');
|
|
4697
4702
|
};
|
|
4703
|
+
/** Fires a grid event. You can pass either an event type
|
|
4704
|
+
* (like 'init', 'rowClick', 'pageChanged', etc )
|
|
4705
|
+
* or a ready-to-use grid event object
|
|
4706
|
+
* */
|
|
4698
4707
|
EasyGrid.prototype.fireEvent = function (event) {
|
|
4699
4708
|
if (typeof event === "string") {
|
|
4700
4709
|
this.eventEmitter.fire(event);
|
|
@@ -4703,20 +4712,26 @@ var easy_grid_EasyGrid = /** @class */ (function () {
|
|
|
4703
4712
|
this.eventEmitter.fire(event.type, event);
|
|
4704
4713
|
}
|
|
4705
4714
|
};
|
|
4715
|
+
/** Allows to set the data (represented by a EasyDataTable object)
|
|
4716
|
+
* or to replace the existing one associated with the grid */
|
|
4706
4717
|
EasyGrid.prototype.setData = function (data) {
|
|
4707
4718
|
this.dataTable = data;
|
|
4708
4719
|
this.clear();
|
|
4709
4720
|
this.refresh();
|
|
4710
4721
|
};
|
|
4722
|
+
/** Returns the EasyDataTable object associated with the grid via `setData()` call */
|
|
4711
4723
|
EasyGrid.prototype.getData = function () {
|
|
4712
4724
|
return this.dataTable;
|
|
4713
4725
|
};
|
|
4726
|
+
/** Gets the list of grid columns */
|
|
4714
4727
|
EasyGrid.prototype.getColumns = function () {
|
|
4715
4728
|
return this.columns;
|
|
4716
4729
|
};
|
|
4730
|
+
/** This function is called when the grid is destroyed */
|
|
4717
4731
|
EasyGrid.prototype.destroy = function () {
|
|
4718
4732
|
this.slot.innerHTML = "";
|
|
4719
4733
|
};
|
|
4734
|
+
/** Clears the current DOM object and re-renders everything from the scratch */
|
|
4720
4735
|
EasyGrid.prototype.refresh = function () {
|
|
4721
4736
|
this.clearDOM();
|
|
4722
4737
|
this.render();
|
|
@@ -4724,10 +4739,12 @@ var easy_grid_EasyGrid = /** @class */ (function () {
|
|
|
4724
4739
|
EasyGrid.prototype.clearDOM = function () {
|
|
4725
4740
|
this.slot.innerHTML = '';
|
|
4726
4741
|
};
|
|
4742
|
+
/** Clears all DOM object in the grid and return it to its initial state */
|
|
4727
4743
|
EasyGrid.prototype.clear = function () {
|
|
4728
4744
|
this.pagination.page = 1;
|
|
4729
4745
|
this.clearDOM();
|
|
4730
4746
|
};
|
|
4747
|
+
/** Renders the grid */
|
|
4731
4748
|
EasyGrid.prototype.render = function () {
|
|
4732
4749
|
var _this = this;
|
|
4733
4750
|
if (!this.hasData() && !this.options.showPlusButton)
|
|
@@ -5282,6 +5299,7 @@ var easy_grid_EasyGrid = /** @class */ (function () {
|
|
|
5282
5299
|
}
|
|
5283
5300
|
return cellElement;
|
|
5284
5301
|
};
|
|
5302
|
+
/** Sets current grid pages (if paging is used) */
|
|
5285
5303
|
EasyGrid.prototype.setPage = function (page) {
|
|
5286
5304
|
this.pagination.page = page;
|
|
5287
5305
|
this.fireEvent({ type: "pageChanged", page: page });
|
|
@@ -5528,9 +5546,11 @@ var easy_grid_EasyGrid = /** @class */ (function () {
|
|
|
5528
5546
|
return rows[index];
|
|
5529
5547
|
return null;
|
|
5530
5548
|
};
|
|
5549
|
+
/** Makes the grid focused for keyboard events */
|
|
5531
5550
|
EasyGrid.prototype.focus = function () {
|
|
5532
5551
|
this.bodyViewportDiv.focus();
|
|
5533
5552
|
};
|
|
5553
|
+
/** Resizes columns according to the data they represent */
|
|
5534
5554
|
EasyGrid.prototype.resizeColumns = function () {
|
|
5535
5555
|
if (this.options.columnWidths.autoResize === AutoResizeColumns.Never)
|
|
5536
5556
|
return;
|