@datorama/core 21.4.0-rc.9 → 22.0.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/bundle.scss +2 -2
- package/bundles/datorama-core.umd.js +150 -138
- package/bundles/datorama-core.umd.js.map +1 -1
- package/bundles/datorama-core.umd.min.js +15 -15
- package/bundles/datorama-core.umd.min.js.map +1 -1
- package/datorama-core.d.ts +0 -1
- package/datorama-core.metadata.json +1 -1
- package/esm2015/datorama-core.js +1 -2
- package/esm2015/lib/breadcrumbs/breadcrumbs.component.js +2 -4
- package/esm2015/lib/grid-v2/grid/grid-v2.types.js +1 -1
- package/esm2015/lib/grid-v2/grid-controller/grid-controller.component.js +5 -5
- package/esm2015/lib/grid-v2/grid-filter/filter-validator.js +8 -8
- package/esm2015/lib/grid-v2/grid-filter/grid-filter.component.js +28 -16
- package/esm2015/lib/grid-v2/grid-filter/grid-filter.types.js +1 -1
- package/esm2015/lib/grid-v2/grid-pagination/grid-pagination.component.js +5 -3
- package/esm2015/lib/grid-v2/grid-settings.js +2 -2
- package/esm2015/lib/grid-v2/grid-store/grid.query.js +11 -8
- package/esm2015/lib/grid-v2/grid-store/grid.service.js +28 -16
- package/esm2015/lib/grid-v2/grid-toolbar/grid-toolbar.component.js +1 -7
- package/esm2015/lib/rich-text/rich-text.directive.js +33 -15
- package/esm2015/lib/select/select.component.js +10 -5
- package/esm2015/lib/version.js +2 -2
- package/esm5/datorama-core.js +1 -2
- package/esm5/lib/breadcrumbs/breadcrumbs.component.js +2 -4
- package/esm5/lib/grid-v2/grid/grid-v2.types.js +1 -1
- package/esm5/lib/grid-v2/grid-controller/grid-controller.component.js +5 -5
- package/esm5/lib/grid-v2/grid-filter/filter-validator.js +10 -8
- package/esm5/lib/grid-v2/grid-filter/grid-filter.component.js +28 -16
- package/esm5/lib/grid-v2/grid-filter/grid-filter.types.js +1 -1
- package/esm5/lib/grid-v2/grid-pagination/grid-pagination.component.js +6 -3
- package/esm5/lib/grid-v2/grid-settings.js +2 -2
- package/esm5/lib/grid-v2/grid-store/grid.query.js +15 -12
- package/esm5/lib/grid-v2/grid-store/grid.service.js +49 -31
- package/esm5/lib/grid-v2/grid-toolbar/grid-toolbar.component.js +1 -13
- package/esm5/lib/rich-text/rich-text.directive.js +34 -16
- package/esm5/lib/select/select.component.js +10 -5
- package/esm5/lib/version.js +2 -2
- package/fesm2015/datorama-core.js +122 -111
- package/fesm2015/datorama-core.js.map +1 -1
- package/fesm5/datorama-core.js +151 -138
- package/fesm5/datorama-core.js.map +1 -1
- package/lib/grid-v2/grid/grid-v2.types.d.ts +0 -1
- package/lib/grid-v2/grid-controller/grid-controller.component.d.ts +3 -2
- package/lib/grid-v2/grid-filter/filter-validator.d.ts +4 -3
- package/lib/grid-v2/grid-filter/grid-filter.types.d.ts +3 -2
- package/lib/grid-v2/grid-settings.d.ts +2 -2
- package/lib/grid-v2/grid-store/grid.query.d.ts +3 -2
- package/lib/grid-v2/grid-store/grid.service.d.ts +4 -3
- package/lib/grid-v2/grid-toolbar/grid-toolbar.component.d.ts +0 -2
- package/lib/rich-text/rich-text.directive.d.ts +6 -4
- package/package.json +1 -1
- package/esm2015/lib/rich-text/rich-text.service.js +0 -50
- package/esm5/lib/rich-text/rich-text.service.js +0 -51
- package/lib/rich-text/rich-text.service.d.ts +0 -10
package/bundle.scss
CHANGED
|
@@ -14333,11 +14333,11 @@ dato-grid-v2 ag-grid-angular.pivot-mode .ag-row.ag-row-group span {
|
|
|
14333
14333
|
color: themify(primary-500) !important;
|
|
14334
14334
|
}
|
|
14335
14335
|
|
|
14336
|
-
dato-grid-v2 ag-grid-angular.pivot-mode .ag-row.ag-row-group
|
|
14336
|
+
dato-grid-v2 ag-grid-angular.pivot-mode .ag-row.ag-row-group:not(.ag-row-level-0) {
|
|
14337
14337
|
background-color: themify(primary-50) !important;
|
|
14338
14338
|
}
|
|
14339
14339
|
|
|
14340
|
-
dato-grid-v2 ag-grid-angular.pivot-mode .ag-row.ag-row-group
|
|
14340
|
+
dato-grid-v2 ag-grid-angular.pivot-mode .ag-row.ag-row-group:not(.ag-row-level-0) span {
|
|
14341
14341
|
font-weight: 400;
|
|
14342
14342
|
}
|
|
14343
14343
|
|
|
@@ -8629,8 +8629,9 @@
|
|
|
8629
8629
|
DatoSelectComponent.prototype.writeValue = function (activeOptions) {
|
|
8630
8630
|
this._model = activeOptions ? akita.coerceArray(activeOptions) : [];
|
|
8631
8631
|
if (this.options) {
|
|
8632
|
+
var overTheLimit = this.limitSelectedTo && this.isMulti && this._model.length >= this.limitSelectedTo;
|
|
8632
8633
|
this.markAsActive(this._model, { deselectAll: true });
|
|
8633
|
-
|
|
8634
|
+
overTheLimit && this.updateDisabledState();
|
|
8634
8635
|
}
|
|
8635
8636
|
/** For later updates */
|
|
8636
8637
|
this.cdr.markForCheck();
|
|
@@ -8667,7 +8668,7 @@
|
|
|
8667
8668
|
*/
|
|
8668
8669
|
if (this.hasValue && this._initialOpen) {
|
|
8669
8670
|
this.markAsActive(this._model);
|
|
8670
|
-
if (this.limitSelectedTo) {
|
|
8671
|
+
if (this.limitSelectedTo && this._model.length === this.limitSelectedTo) {
|
|
8671
8672
|
this.updateDisabledState();
|
|
8672
8673
|
}
|
|
8673
8674
|
this._initialOpen = false;
|
|
@@ -8756,6 +8757,7 @@
|
|
|
8756
8757
|
};
|
|
8757
8758
|
DatoSelectComponent.prototype.removeOption = function (option) {
|
|
8758
8759
|
var _this = this;
|
|
8760
|
+
var updateDisabled = this.limitSelectedTo && this._model.length === this.limitSelectedTo;
|
|
8759
8761
|
this._model = this._model.filter(function (current) { return current[_this.idKey] !== option[_this.idKey]; });
|
|
8760
8762
|
var optionToRemove = this.options.find(function (datoOption) { return datoOption.option && datoOption.option[_this.idKey] === option[_this.idKey]; });
|
|
8761
8763
|
/**
|
|
@@ -8765,7 +8767,7 @@
|
|
|
8765
8767
|
if (optionToRemove) {
|
|
8766
8768
|
optionToRemove.active = false;
|
|
8767
8769
|
}
|
|
8768
|
-
|
|
8770
|
+
updateDisabled && this.updateDisabledState();
|
|
8769
8771
|
this.onChange(this._model);
|
|
8770
8772
|
this.cdr.markForCheck();
|
|
8771
8773
|
if (this.datoOverlay.attached) {
|
|
@@ -9115,6 +9117,9 @@
|
|
|
9115
9117
|
if (!datoOption) {
|
|
9116
9118
|
return;
|
|
9117
9119
|
}
|
|
9120
|
+
var modelLength = this._model.length;
|
|
9121
|
+
var updateDisabled = this.limitSelectedTo &&
|
|
9122
|
+
(modelLength === this.limitSelectedTo || (modelLength === this.limitSelectedTo - 1 && !datoOption.active));
|
|
9118
9123
|
datoOption.active = !datoOption.active;
|
|
9119
9124
|
var rawOption = datoOption.option;
|
|
9120
9125
|
if (datoOption.active) {
|
|
@@ -9123,7 +9128,7 @@
|
|
|
9123
9128
|
else {
|
|
9124
9129
|
this._model = this._model.filter(function (current) { return current[_this.idKey] !== rawOption[_this.idKey]; });
|
|
9125
9130
|
}
|
|
9126
|
-
|
|
9131
|
+
updateDisabled && this.updateDisabledState();
|
|
9127
9132
|
this.onChange(this._model);
|
|
9128
9133
|
this.cdr.markForCheck();
|
|
9129
9134
|
this.datoOverlay.scheduleUpdate();
|
|
@@ -11576,15 +11581,14 @@
|
|
|
11576
11581
|
};
|
|
11577
11582
|
GridQuery.prototype.getSort = function () {
|
|
11578
11583
|
if (this.gridRef.gridOptions.pivotMode) {
|
|
11579
|
-
var _a = this.api.grid.getSortModel().pop() || {}, sort = _a.sort,
|
|
11580
|
-
var column = this.api.columns.getColumn(
|
|
11581
|
-
var
|
|
11582
|
-
|
|
11583
|
-
|
|
11584
|
-
var
|
|
11585
|
-
var secondaryColumn = secondaryColumns.find(function (col) { return col.getColId() === pivotedColumn_1.getColId(); });
|
|
11584
|
+
var _a = this.api.grid.getSortModel().pop() || {}, sort = _a.sort, colId = _a.colId;
|
|
11585
|
+
var column = this.api.columns.getColumn(colId);
|
|
11586
|
+
var pivotedColumn = this.getSecondaryColumn(colId);
|
|
11587
|
+
if (pivotedColumn) {
|
|
11588
|
+
var uniquePivotParents = uniq(this.api.columns.getSecondaryColumns().map(function (column) { return column.getParent(); }));
|
|
11589
|
+
var secondaryColumn = this.getSecondaryColumn(pivotedColumn.getColId());
|
|
11586
11590
|
var pivotColIndex = uniquePivotParents.indexOf(secondaryColumn.getParent());
|
|
11587
|
-
return { colId: getColField(
|
|
11591
|
+
return { colId: getColField(pivotedColumn.getColDef()), sort: sort, pivotColIndex: pivotColIndex };
|
|
11588
11592
|
}
|
|
11589
11593
|
else if (column) {
|
|
11590
11594
|
return { colId: getColField(column.getColDef()), sort: sort };
|
|
@@ -11619,9 +11623,9 @@
|
|
|
11619
11623
|
GridQuery.prototype.filterChanged = function () {
|
|
11620
11624
|
return this.selectFilter().pipe(operators.map(function (filter) {
|
|
11621
11625
|
return Object.keys(filter).reduce(function (filters, field) {
|
|
11622
|
-
|
|
11623
|
-
|
|
11624
|
-
filters.push({ field: field, filter:
|
|
11626
|
+
var datoFilter = filter[field];
|
|
11627
|
+
if (datoFilter) {
|
|
11628
|
+
filters.push({ field: field, filter: datoFilter });
|
|
11625
11629
|
}
|
|
11626
11630
|
return filters;
|
|
11627
11631
|
}, []);
|
|
@@ -11687,6 +11691,10 @@
|
|
|
11687
11691
|
GridQuery.prototype.selectIsSelectAllRowsEnabled = function () {
|
|
11688
11692
|
return this.select(function (state) { return state.serverSidePagination.selectAllRowsEnabled; });
|
|
11689
11693
|
};
|
|
11694
|
+
GridQuery.prototype.getSecondaryColumn = function (colId) {
|
|
11695
|
+
var secondaryColumns = this.api.columns.getSecondaryColumns();
|
|
11696
|
+
return secondaryColumns && secondaryColumns.find(function (col) { return col.getColId() === colId; });
|
|
11697
|
+
};
|
|
11690
11698
|
GridQuery.prototype.filterCheckboxSelectionColumn = function (columns) {
|
|
11691
11699
|
return columns.filter(function (column) { return !column.getUserProvidedColDef() || !column.getUserProvidedColDef().checkboxSelection; });
|
|
11692
11700
|
};
|
|
@@ -11799,9 +11807,9 @@
|
|
|
11799
11807
|
return !isEmpty(valueLowerCase);
|
|
11800
11808
|
}
|
|
11801
11809
|
}
|
|
11802
|
-
function validateNumberCondition(unparsedRowValue, _a) {
|
|
11810
|
+
function validateNumberCondition(unparsedRowValue, _a, filterKey) {
|
|
11803
11811
|
var condition = _a.condition, value = _a.value, rangeEnd = _a.rangeEnd;
|
|
11804
|
-
var rowValue = !!unparsedRowValue ? parseFloat(unparsedRowValue) : null;
|
|
11812
|
+
var rowValue = !!unparsedRowValue ? parseFloat(unparsedRowValue[filterKey] || unparsedRowValue) : null;
|
|
11805
11813
|
var filterValue = parseFloat(value);
|
|
11806
11814
|
switch (condition) {
|
|
11807
11815
|
case exports.DatoFilterConditions.EQUALS:
|
|
@@ -11849,14 +11857,14 @@
|
|
|
11849
11857
|
}
|
|
11850
11858
|
}
|
|
11851
11859
|
function validateCondition(_a) {
|
|
11852
|
-
var rowValue = _a.rowValue,
|
|
11860
|
+
var rowValue = _a.rowValue, condition = _a.condition, type = _a.type, filterKey = _a.filterKey;
|
|
11853
11861
|
switch (type) {
|
|
11854
11862
|
case exports.DatoGridFilterTypes.Date:
|
|
11855
|
-
return validateDateCondition(rowValue,
|
|
11863
|
+
return validateDateCondition(rowValue, condition);
|
|
11856
11864
|
case exports.DatoGridFilterTypes.Number:
|
|
11857
|
-
return validateNumberCondition(rowValue,
|
|
11865
|
+
return validateNumberCondition(rowValue, condition, filterKey);
|
|
11858
11866
|
default:
|
|
11859
|
-
return validateStringCondition(rowValue,
|
|
11867
|
+
return validateStringCondition(rowValue, condition);
|
|
11860
11868
|
}
|
|
11861
11869
|
}
|
|
11862
11870
|
function validateFilter(_a, activeFilters) {
|
|
@@ -11876,7 +11884,9 @@
|
|
|
11876
11884
|
if (conditional) {
|
|
11877
11885
|
var operator = conditional.operator, conditions = conditional.conditions, type_1 = conditional.type;
|
|
11878
11886
|
var conditionsRelation = operator === exports.OperatorTypes.AND ? 'every' : 'some';
|
|
11879
|
-
filterPasses = conditions[conditionsRelation](function (
|
|
11887
|
+
filterPasses = conditions[conditionsRelation](function (condition) {
|
|
11888
|
+
return validateCondition({ rowValue: rowValue, condition: condition, type: type_1, filterKey: filter });
|
|
11889
|
+
});
|
|
11880
11890
|
}
|
|
11881
11891
|
if (filterPasses && byValue) {
|
|
11882
11892
|
var includesValue = byValue.values.includes(rowValue);
|
|
@@ -12004,7 +12014,7 @@
|
|
|
12004
12014
|
return contextActions;
|
|
12005
12015
|
}
|
|
12006
12016
|
|
|
12007
|
-
var DATO_GRID_STORAGE_API = new core.InjectionToken('
|
|
12017
|
+
var DATO_GRID_STORAGE_API = new core.InjectionToken('DATO_GRID_STORAGE_API');
|
|
12008
12018
|
|
|
12009
12019
|
var defaultEditableColumnRenderer = function (params) {
|
|
12010
12020
|
return params && params.value ? "<div class=\"value-wrapper ellipsis\">" + params.value + "</div>" : null;
|
|
@@ -12676,12 +12686,12 @@
|
|
|
12676
12686
|
var ɵ0$1 = mapToValue;
|
|
12677
12687
|
var mapToListItem = function (val) { return ({ id: val, label: isNil(val) ? "(Empty)" : ("" + val).trim(), value: val }); };
|
|
12678
12688
|
var ɵ1$1 = mapToListItem;
|
|
12679
|
-
var mapToListItemWithFormatted = function (_a) {
|
|
12689
|
+
var mapToListItemWithFormatted = function (_a, key) {
|
|
12680
12690
|
var value = _a.value, formattedValue = _a.formattedValue;
|
|
12681
12691
|
return ({
|
|
12682
|
-
id: value,
|
|
12683
|
-
label: isNil(formattedValue) ? "(Empty)" : ("" + formattedValue).trim(),
|
|
12684
|
-
value: value
|
|
12692
|
+
id: key && value ? value[key] : value,
|
|
12693
|
+
label: isNil(formattedValue) ? "(Empty)" : ("" + (key ? formattedValue[key] : formattedValue)).trim(),
|
|
12694
|
+
value: key && value ? value[key] : value
|
|
12685
12695
|
});
|
|
12686
12696
|
};
|
|
12687
12697
|
var ɵ2$1 = mapToListItemWithFormatted;
|
|
@@ -12820,15 +12830,18 @@
|
|
|
12820
12830
|
var _this = this;
|
|
12821
12831
|
var _b = this.popover.data, gridService = _b.gridService, gridQuery = _b.gridQuery;
|
|
12822
12832
|
var _c = this.colDef, filter = _c.filter, _d = _c.filtersConfig, filtersConfig = _d === void 0 ? {} : _d, pivotValueColumn = _c.pivotValueColumn, pivotKeys = _c.pivotKeys;
|
|
12833
|
+
var colDefs = gridQuery.api.columns.getAllColumns().map(function (column) { return column.getColDef(); });
|
|
12823
12834
|
this.colField = getColField(this.colDef);
|
|
12835
|
+
var colDef = colDefs.find(function (colDef) { return colDef.field === _this.colField; });
|
|
12836
|
+
var colFilter = filter || colDef.filter;
|
|
12837
|
+
var filterOptions = DatoGridFilterOptionsMap[colFilter];
|
|
12824
12838
|
this.pivotColumn = gridQuery.api.columns.getSecondaryPivotColumn(pivotKeys, pivotValueColumn);
|
|
12825
12839
|
if (filtersConfig.sections) {
|
|
12826
12840
|
this.filterSections = (_a = {}, _a[filtersConfig.sections] = true, _a);
|
|
12827
12841
|
}
|
|
12828
12842
|
this.keepPredefinedListOriginalOrder =
|
|
12829
12843
|
filtersConfig.keepPredefinedListOriginalOrder && !isEmpty(filtersConfig.predefinedListValues);
|
|
12830
|
-
|
|
12831
|
-
this.filterType = filterOptions ? filter : exports.DatoGridFilterTypes.String;
|
|
12844
|
+
this.filterType = filterOptions ? colFilter : exports.DatoGridFilterTypes.String;
|
|
12832
12845
|
this.listLabelType = this.filterType.toLowerCase();
|
|
12833
12846
|
this.listSortByKey = this.filterType === exports.DatoGridFilterTypes.Number && this.colDef.valueFormatter ? 'id' : 'label';
|
|
12834
12847
|
this.gridQuery = gridQuery;
|
|
@@ -12863,9 +12876,11 @@
|
|
|
12863
12876
|
var columnValues = this.getColumnValues();
|
|
12864
12877
|
this.columnValues = columnValues.map(function (_a) {
|
|
12865
12878
|
var value = _a.value;
|
|
12866
|
-
return value;
|
|
12879
|
+
return !isNil(_this.pivotColumn) && value ? value[_this.colField] : value;
|
|
12880
|
+
});
|
|
12881
|
+
this.listOptions = columnValues.map(function (colValue) {
|
|
12882
|
+
return mapToListItemWithFormatted(colValue, !isNil(_this.pivotColumn) && _this.colField);
|
|
12867
12883
|
});
|
|
12868
|
-
this.listOptions = columnValues.map(mapToListItemWithFormatted);
|
|
12869
12884
|
}
|
|
12870
12885
|
}
|
|
12871
12886
|
else {
|
|
@@ -12903,6 +12918,7 @@
|
|
|
12903
12918
|
isEmpty(filter)
|
|
12904
12919
|
? this.gridService.clearColumnFilter(this.colField)
|
|
12905
12920
|
: this.gridService.setColumnFilter(column, filter);
|
|
12921
|
+
this.gridService.notifyFilterUpdate();
|
|
12906
12922
|
}
|
|
12907
12923
|
};
|
|
12908
12924
|
DatoGridFilterComponent.prototype.clearFilters = function () {
|
|
@@ -12956,19 +12972,25 @@
|
|
|
12956
12972
|
var _this = this;
|
|
12957
12973
|
var _a = this.filterForm.value, byValue = _a.byValue, conditional = _a.conditional;
|
|
12958
12974
|
var filter = {};
|
|
12959
|
-
filter.pivotKeys = this.pivotKeys;
|
|
12960
|
-
if (this.pivotColumn) {
|
|
12961
|
-
filter.pivotFieldsMap = this.getPivotFields(this.pivotColumn.getParent()).reduce(function (fieldMap, field, index) {
|
|
12962
|
-
fieldMap[field] = _this.pivotKeys[index];
|
|
12963
|
-
return fieldMap;
|
|
12964
|
-
}, {});
|
|
12965
|
-
}
|
|
12966
12975
|
if (this.filterSections.Conditional) {
|
|
12967
12976
|
this.setConditionalFilter(filter, conditional);
|
|
12968
12977
|
}
|
|
12969
12978
|
if (this.filterSections.By_Value) {
|
|
12970
12979
|
this.setByValueFilter(filter, byValue);
|
|
12971
12980
|
}
|
|
12981
|
+
/** If filters applied, add the extra properties to be used by pivot mode */
|
|
12982
|
+
if (filter.byValue || filter.conditional) {
|
|
12983
|
+
filter.colId = this.colDef.colId;
|
|
12984
|
+
filter.pivotKeys = this.pivotKeys;
|
|
12985
|
+
if (this.pivotColumn) {
|
|
12986
|
+
filter.pivotFieldsMap = this.getPivotFields(this.pivotColumn.getParent()).reduce(function (fieldMap, field, index) {
|
|
12987
|
+
if (_this.pivotKeys[index]) {
|
|
12988
|
+
fieldMap[field] = _this.pivotKeys[index];
|
|
12989
|
+
}
|
|
12990
|
+
return fieldMap;
|
|
12991
|
+
}, {});
|
|
12992
|
+
}
|
|
12993
|
+
}
|
|
12972
12994
|
return filter;
|
|
12973
12995
|
};
|
|
12974
12996
|
DatoGridFilterComponent.prototype.initForm = function () {
|
|
@@ -14350,12 +14372,45 @@
|
|
|
14350
14372
|
});
|
|
14351
14373
|
this.notifyFilterUpdate();
|
|
14352
14374
|
};
|
|
14353
|
-
GridService.prototype.setColumnFilter = function (column, filter) {
|
|
14375
|
+
GridService.prototype.setColumnFilter = function (column, filter, notifyGrid) {
|
|
14376
|
+
if (notifyGrid === void 0) { notifyGrid = true; }
|
|
14354
14377
|
this._logEvent("Grids - Filter Applied" /* GRID_FILTER_APPLIED */, {
|
|
14355
14378
|
column: column.getColId(),
|
|
14356
14379
|
numOfConditions: (filter.conditional && filter.conditional.conditions.length) || 0,
|
|
14357
14380
|
byValue: !!filter.byValue ? 'Yes' : 'No'
|
|
14358
14381
|
});
|
|
14382
|
+
this.updateFilter(column, filter);
|
|
14383
|
+
if (notifyGrid) {
|
|
14384
|
+
this.notifyFilterUpdate();
|
|
14385
|
+
}
|
|
14386
|
+
};
|
|
14387
|
+
GridService.prototype.setGridFilters = function (filters) {
|
|
14388
|
+
var e_2, _a;
|
|
14389
|
+
if (this.api) {
|
|
14390
|
+
try {
|
|
14391
|
+
for (var filters_1 = __values(filters), filters_1_1 = filters_1.next(); !filters_1_1.done; filters_1_1 = filters_1.next()) {
|
|
14392
|
+
var filter = filters_1_1.value.filter;
|
|
14393
|
+
var column = this.api.columns.getColumn(filter.colId);
|
|
14394
|
+
if (column) {
|
|
14395
|
+
this.setColumnFilter(column, filter);
|
|
14396
|
+
}
|
|
14397
|
+
else {
|
|
14398
|
+
var pivotColumn = this.gridQuery.getSecondaryColumn(filter.colId);
|
|
14399
|
+
this.setColumnFilter(pivotColumn, filter);
|
|
14400
|
+
}
|
|
14401
|
+
}
|
|
14402
|
+
}
|
|
14403
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
14404
|
+
finally {
|
|
14405
|
+
try {
|
|
14406
|
+
if (filters_1_1 && !filters_1_1.done && (_a = filters_1.return)) _a.call(filters_1);
|
|
14407
|
+
}
|
|
14408
|
+
finally { if (e_2) throw e_2.error; }
|
|
14409
|
+
}
|
|
14410
|
+
this.notifyFilterUpdate();
|
|
14411
|
+
}
|
|
14412
|
+
};
|
|
14413
|
+
GridService.prototype.updateFilter = function (column, filter) {
|
|
14359
14414
|
var colField = getColField(column.getColDef());
|
|
14360
14415
|
this.store.update(function (state) {
|
|
14361
14416
|
var _a;
|
|
@@ -14363,7 +14418,6 @@
|
|
|
14363
14418
|
settings: __assign(__assign({}, state.settings), { filter: __assign(__assign({}, state.settings.filter), (_a = {}, _a[colField] = filter, _a)) })
|
|
14364
14419
|
};
|
|
14365
14420
|
});
|
|
14366
|
-
this.notifyFilterUpdate();
|
|
14367
14421
|
};
|
|
14368
14422
|
GridService.prototype.setSearchTerm = function (searchTerm) {
|
|
14369
14423
|
this.store.update(function (state) {
|
|
@@ -14411,8 +14465,7 @@
|
|
|
14411
14465
|
this.updateSettings({ gridAlignment: gridAlignment, columnsSizes: null });
|
|
14412
14466
|
};
|
|
14413
14467
|
GridService.prototype.saveSettingsToServer = function (settings) {
|
|
14414
|
-
|
|
14415
|
-
this.storageAPI.set(this.gridName, settings, isGlobal);
|
|
14468
|
+
this.storageAPI.set(this.gridName, settings);
|
|
14416
14469
|
};
|
|
14417
14470
|
/**
|
|
14418
14471
|
* @internal used to log grid events to the platform's logging service
|
|
@@ -14656,7 +14709,7 @@
|
|
|
14656
14709
|
this.api.grid.onFilterChanged();
|
|
14657
14710
|
};
|
|
14658
14711
|
GridService.prototype.buildServerRequestFilters = function (filter) {
|
|
14659
|
-
var
|
|
14712
|
+
var e_3, _a;
|
|
14660
14713
|
var columnsFilters = {};
|
|
14661
14714
|
try {
|
|
14662
14715
|
for (var _b = __values(Object.entries(filter)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
@@ -14692,12 +14745,12 @@
|
|
|
14692
14745
|
}
|
|
14693
14746
|
}
|
|
14694
14747
|
}
|
|
14695
|
-
catch (
|
|
14748
|
+
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
14696
14749
|
finally {
|
|
14697
14750
|
try {
|
|
14698
14751
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
14699
14752
|
}
|
|
14700
|
-
finally { if (
|
|
14753
|
+
finally { if (e_3) throw e_3.error; }
|
|
14701
14754
|
}
|
|
14702
14755
|
return columnsFilters;
|
|
14703
14756
|
};
|
|
@@ -14750,7 +14803,7 @@
|
|
|
14750
14803
|
return { operator: exports.OperatorTypes.AND, filters: [columnFilter, searchFilter] };
|
|
14751
14804
|
};
|
|
14752
14805
|
GridService.prototype.buildServerColumnFilters_v2_1 = function (filter) {
|
|
14753
|
-
var
|
|
14806
|
+
var e_4, _a;
|
|
14754
14807
|
var columnFilters = [];
|
|
14755
14808
|
try {
|
|
14756
14809
|
for (var _b = __values(Object.entries(filter)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
@@ -14775,12 +14828,12 @@
|
|
|
14775
14828
|
columnFilters.push(columnFilter);
|
|
14776
14829
|
}
|
|
14777
14830
|
}
|
|
14778
|
-
catch (
|
|
14831
|
+
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
14779
14832
|
finally {
|
|
14780
14833
|
try {
|
|
14781
14834
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
14782
14835
|
}
|
|
14783
|
-
finally { if (
|
|
14836
|
+
finally { if (e_4) throw e_4.error; }
|
|
14784
14837
|
}
|
|
14785
14838
|
return columnFilters;
|
|
14786
14839
|
};
|
|
@@ -14873,27 +14926,14 @@
|
|
|
14873
14926
|
/**
|
|
14874
14927
|
* When pivoting,
|
|
14875
14928
|
* we add the field name to the column header class in order to access it through the auto generated pivot column.
|
|
14876
|
-
* @private
|
|
14877
14929
|
*/
|
|
14878
14930
|
GridService.prototype.initPivotSecondaryColsProcess = function (_a) {
|
|
14879
14931
|
var _this = this;
|
|
14880
14932
|
var gridOptions = _a.gridOptions;
|
|
14881
14933
|
gridOptions.processSecondaryColDef = function (colDef) {
|
|
14882
|
-
var
|
|
14883
|
-
if (
|
|
14884
|
-
|
|
14885
|
-
var originalColDef = valueColumns
|
|
14886
|
-
.map(function (_a) {
|
|
14887
|
-
var userProvidedColDef = _a.userProvidedColDef;
|
|
14888
|
-
return userProvidedColDef;
|
|
14889
|
-
})
|
|
14890
|
-
.find(function (_a) {
|
|
14891
|
-
var colId = _a.colId;
|
|
14892
|
-
return colId === colDef.pivotValueColumn.getColId();
|
|
14893
|
-
});
|
|
14894
|
-
if (originalColDef) {
|
|
14895
|
-
colDef.filter = originalColDef.filter;
|
|
14896
|
-
}
|
|
14934
|
+
var userProvidedColDef = colDef.pivotValueColumn && colDef.pivotValueColumn.getUserProvidedColDef();
|
|
14935
|
+
if (userProvidedColDef) {
|
|
14936
|
+
colDef.filter = userProvidedColDef.filter;
|
|
14897
14937
|
}
|
|
14898
14938
|
if (colDef.pivotKeys) {
|
|
14899
14939
|
colDef.pivotKeys = colDef.pivotKeys.map(function (key) {
|
|
@@ -14909,7 +14949,7 @@
|
|
|
14909
14949
|
var field = parsedValue.field, value = parsedValue.value;
|
|
14910
14950
|
colGroupDef.headerClass = [field];
|
|
14911
14951
|
colGroupDef.headerName = value;
|
|
14912
|
-
if (colGroupDef.children && colGroupDef.children.length >
|
|
14952
|
+
if (colGroupDef.children && colGroupDef.children.length > 0) {
|
|
14913
14953
|
colGroupDef.headerClass.push('group-pivot-cell');
|
|
14914
14954
|
}
|
|
14915
14955
|
}
|
|
@@ -14936,7 +14976,7 @@
|
|
|
14936
14976
|
GridService.prototype.setPivotModeRows = function (data) {
|
|
14937
14977
|
var pivotColumns = this.gridQuery.getAllPivotColumns();
|
|
14938
14978
|
var convertedData = data.map(function (currentValue, index) {
|
|
14939
|
-
var
|
|
14979
|
+
var e_5, _a;
|
|
14940
14980
|
var mappedValues = __assign({}, currentValue);
|
|
14941
14981
|
try {
|
|
14942
14982
|
for (var pivotColumns_1 = __values(pivotColumns), pivotColumns_1_1 = pivotColumns_1.next(); !pivotColumns_1_1.done; pivotColumns_1_1 = pivotColumns_1.next()) {
|
|
@@ -14946,12 +14986,12 @@
|
|
|
14946
14986
|
mappedValues[field] = JSON.stringify(pivotValue);
|
|
14947
14987
|
}
|
|
14948
14988
|
}
|
|
14949
|
-
catch (
|
|
14989
|
+
catch (e_5_1) { e_5 = { error: e_5_1 }; }
|
|
14950
14990
|
finally {
|
|
14951
14991
|
try {
|
|
14952
14992
|
if (pivotColumns_1_1 && !pivotColumns_1_1.done && (_a = pivotColumns_1.return)) _a.call(pivotColumns_1);
|
|
14953
14993
|
}
|
|
14954
|
-
finally { if (
|
|
14994
|
+
finally { if (e_5) throw e_5.error; }
|
|
14955
14995
|
}
|
|
14956
14996
|
return mappedValues;
|
|
14957
14997
|
});
|
|
@@ -15423,10 +15463,7 @@
|
|
|
15423
15463
|
.pipe(operators.switchMap(function () {
|
|
15424
15464
|
_this.gridOptions = _this.normalizeOptions();
|
|
15425
15465
|
agGrid.gridOptions = _this.gridOptions;
|
|
15426
|
-
var
|
|
15427
|
-
var settingsLoader = _this.gridOptions.saveSettings === false
|
|
15428
|
-
? rxjs.of(null)
|
|
15429
|
-
: _this.storageAPI.get(_this.gridOptions.gridName, isGlobal);
|
|
15466
|
+
var settingsLoader = _this.gridOptions.saveSettings === false ? rxjs.of(null) : _this.storageAPI.get(_this.gridOptions.gridName);
|
|
15430
15467
|
return rxjs.combineLatest([agGrid.gridReady, settingsLoader]);
|
|
15431
15468
|
}), ngxTakeUntilDestroy.untilDestroyed(this))
|
|
15432
15469
|
.subscribe(function (_a) {
|
|
@@ -15470,6 +15507,9 @@
|
|
|
15470
15507
|
DatoGridControllerComponent.prototype.setGridRows = function (data) {
|
|
15471
15508
|
this.gridService.setRows(data);
|
|
15472
15509
|
};
|
|
15510
|
+
DatoGridControllerComponent.prototype.setGridFilters = function (filters) {
|
|
15511
|
+
this.gridService.setGridFilters(filters);
|
|
15512
|
+
};
|
|
15473
15513
|
DatoGridControllerComponent.prototype.onFilterChanged = function () {
|
|
15474
15514
|
return this.gridQuery.filterChanged();
|
|
15475
15515
|
};
|
|
@@ -16381,8 +16421,11 @@
|
|
|
16381
16421
|
return page;
|
|
16382
16422
|
};
|
|
16383
16423
|
DatoGridPaginationV2Component.prototype.toggleGroupsState = function () {
|
|
16384
|
-
|
|
16424
|
+
var _this = this;
|
|
16385
16425
|
this.isExpanded = !this.isExpanded;
|
|
16426
|
+
this.gridApi.forEachNode(function (node) {
|
|
16427
|
+
node.setExpanded(_this.isExpanded);
|
|
16428
|
+
});
|
|
16386
16429
|
};
|
|
16387
16430
|
DatoGridPaginationV2Component.prototype.autoFitGrid = function (type) {
|
|
16388
16431
|
this.gridService.fitGrid(type);
|
|
@@ -16475,7 +16518,7 @@
|
|
|
16475
16518
|
core.Component({
|
|
16476
16519
|
selector: 'dato-grid-pagination-v2',
|
|
16477
16520
|
changeDetection: core.ChangeDetectionStrategy.OnPush,
|
|
16478
|
-
template: "<div class=\"d-flex-row d-flex-auto d-flex-wrap container\" [class.small]=\"smallVersion\"\n [attr.data-pages-count]=\"totalPages\"\n [attr.data-current-page]=\"pageNumbersDisplay.currentPage\"\n [attr.data-page-size]=\"rowsPerPage\"\n [attr.data-rows-count]=\"rowCount\">\n <div *ngIf=\"totalPages > 1\" #navigation\n class=\"navigation d-flex-row d-flex-0-0-auto align-center\">\n\n <!-- First Page -->\n <dato-icon-button *ngIf=\"!disableButtons\"\n class=\"mr-4\" data-auto-id=\"pagiantion-first-page\"\n icon=\"chevron-left-double\"\n datoType=\"secondary\"\n datoSize=\"md\"\n [disabled]=\"prevPageDisabled\"\n (click)=\"navigateFirstPage()\">\n </dato-icon-button>\n\n <!-- Previous Page -->\n <dato-icon-button icon=\"arrow-left\" datoType=\"secondary\" datoSize=\"md\"\n [disabled]=\"prevPageDisabled\" data-auto-id=\"pagiantion-previous-page\"\n (click)=\"navigatePrevPage()\">\n </dato-icon-button>\n\n\n <div class=\"d-flex mx-5 align-center number-container\">\n <dato-link class=\"page-number mx-5\" datoType=\"secondary\" datoSize=\"sm\" data-auto-id=\"pagiantion-previous-batch\"\n *ngIf=\"pageNumbersDisplay.showFirstEllipsis && !smallVersion\"\n (click)=\"showPreviousBatch()\">...\n </dato-link>\n <dato-link class=\"page-number mx-5\" [datoType]=\"page === pageNumbersDisplay.currentPage ? 'primary' : 'secondary'\" datoSize=\"sm\"\n *ngFor=\"let page of pageNumbersDisplay.pages; index as i; trackBy: trackByPage;\" [attr.data-auto-id]=\"'pagiantion-page-' + i\"\n (click)=\"navigatePage(page - 1)\">\n {{page}}\n </dato-link>\n\n <div class=\"d-flex\" *ngIf=\"pageNumbersDisplay.showLastPage && !smallVersion\">\n <dato-link class=\"page-number mx-5\" datoType=\"secondary\" datoSize=\"sm\" data-auto-id=\"pagiantion-next-batch\"\n (click)=\"showNextBatch()\">...</dato-link>\n <dato-link class=\"page-number mx-5\" datoType=\"secondary\" datoSize=\"sm\"\n [attr.data-auto-id]=\"'pagiantion-page-' + totalPages\"\n (click)=\"navigatePage(totalPages - 1)\">\n {{totalPages}}\n </dato-link>\n </div>\n\n </div>\n\n <!-- Next Page -->\n <dato-icon-button icon=\"arrow-right\" datoType=\"secondary\" datoSize=\"md\"\n (click)=\"navigateNextPage()\" data-auto-id=\"pagiantion-next-page\"\n [disabled]=\"nextPageDisabled\">\n </dato-icon-button>\n\n <!-- Last Page -->\n <dato-icon-button *ngIf=\"!disableButtons\"\n class=\"ml-4\" icon=\"chevron-right-double\"\n datoType=\"secondary\" datoSize=\"md\" data-auto-id=\"pagiantion-last-page\"\n [disabled]=\"nextPageDisabled\"\n (click)=\"navigatePage(totalPages - 1)\">\n </dato-icon-button>\n\n </div>\n\n <div *ngIf=\"totalPages > 1 && !smallVersion\"\n class=\"separator mx-10 my-auto primary-100-background-color\">\n </div>\n\n <div class=\"total d-flex-0-0-auto d-flex-row align-center\">\n <span class=\"dato-note primary-300-color\">{{rowsRange}}</span>\n </div>\n\n <div *ngIf=\"showBottomControls\" class=\"grid-controls d-flex d-flex-1 justify-end\">\n <dato-icon-button [icon]=\"isExpanded ? 'collapse' : 'expand'\" datoType=\"secondary\" datoSize=\"md\"\n (click)=\"toggleGroupsState()\" data-auto-id=\"pagiantion-
|
|
16521
|
+
template: "<div class=\"d-flex-row d-flex-auto d-flex-wrap container\" [class.small]=\"smallVersion\"\n [attr.data-pages-count]=\"totalPages\"\n [attr.data-current-page]=\"pageNumbersDisplay.currentPage\"\n [attr.data-page-size]=\"rowsPerPage\"\n [attr.data-rows-count]=\"rowCount\">\n <div *ngIf=\"totalPages > 1\" #navigation\n class=\"navigation d-flex-row d-flex-0-0-auto align-center\">\n\n <!-- First Page -->\n <dato-icon-button *ngIf=\"!disableButtons\"\n class=\"mr-4\" data-auto-id=\"pagiantion-first-page\"\n icon=\"chevron-left-double\"\n datoType=\"secondary\"\n datoSize=\"md\"\n [disabled]=\"prevPageDisabled\"\n (click)=\"navigateFirstPage()\">\n </dato-icon-button>\n\n <!-- Previous Page -->\n <dato-icon-button icon=\"arrow-left\" datoType=\"secondary\" datoSize=\"md\"\n [disabled]=\"prevPageDisabled\" data-auto-id=\"pagiantion-previous-page\"\n (click)=\"navigatePrevPage()\">\n </dato-icon-button>\n\n\n <div class=\"d-flex mx-5 align-center number-container\">\n <dato-link class=\"page-number mx-5\" datoType=\"secondary\" datoSize=\"sm\" data-auto-id=\"pagiantion-previous-batch\"\n *ngIf=\"pageNumbersDisplay.showFirstEllipsis && !smallVersion\"\n (click)=\"showPreviousBatch()\">...\n </dato-link>\n <dato-link class=\"page-number mx-5\" [datoType]=\"page === pageNumbersDisplay.currentPage ? 'primary' : 'secondary'\" datoSize=\"sm\"\n *ngFor=\"let page of pageNumbersDisplay.pages; index as i; trackBy: trackByPage;\" [attr.data-auto-id]=\"'pagiantion-page-' + i\"\n (click)=\"navigatePage(page - 1)\">\n {{page}}\n </dato-link>\n\n <div class=\"d-flex\" *ngIf=\"pageNumbersDisplay.showLastPage && !smallVersion\">\n <dato-link class=\"page-number mx-5\" datoType=\"secondary\" datoSize=\"sm\" data-auto-id=\"pagiantion-next-batch\"\n (click)=\"showNextBatch()\">...</dato-link>\n <dato-link class=\"page-number mx-5\" datoType=\"secondary\" datoSize=\"sm\"\n [attr.data-auto-id]=\"'pagiantion-page-' + totalPages\"\n (click)=\"navigatePage(totalPages - 1)\">\n {{totalPages}}\n </dato-link>\n </div>\n\n </div>\n\n <!-- Next Page -->\n <dato-icon-button icon=\"arrow-right\" datoType=\"secondary\" datoSize=\"md\"\n (click)=\"navigateNextPage()\" data-auto-id=\"pagiantion-next-page\"\n [disabled]=\"nextPageDisabled\">\n </dato-icon-button>\n\n <!-- Last Page -->\n <dato-icon-button *ngIf=\"!disableButtons\"\n class=\"ml-4\" icon=\"chevron-right-double\"\n datoType=\"secondary\" datoSize=\"md\" data-auto-id=\"pagiantion-last-page\"\n [disabled]=\"nextPageDisabled\"\n (click)=\"navigatePage(totalPages - 1)\">\n </dato-icon-button>\n\n </div>\n\n <div *ngIf=\"totalPages > 1 && !smallVersion\"\n class=\"separator mx-10 my-auto primary-100-background-color\">\n </div>\n\n <div class=\"total d-flex-0-0-auto d-flex-row align-center\">\n <span class=\"dato-note primary-300-color\">{{rowsRange}}</span>\n </div>\n\n <div *ngIf=\"showBottomControls\" class=\"grid-controls d-flex d-flex-1 justify-end\">\n <dato-icon-button [icon]=\"isExpanded ? 'collapse' : 'expand'\" datoType=\"secondary\" datoSize=\"md\"\n (click)=\"toggleGroupsState()\" data-auto-id=\"pagiantion-expand-collapse\"\n [datoTooltipV2]=\"isExpanded ? 'core.collapse-rows' : 'core.expand-rows'\">\n </dato-icon-button>\n\n <dato-icon-button class=\"mx-4\" icon=\"maximize-horizontal\" datoType=\"secondary\" datoSize=\"md\"\n (click)=\"autoFitGrid('content')\" [datoTooltipV2]=\"'core.fit-to-content'\"\n data-auto-id=\"pagiantion-fit-to-content\">\n </dato-icon-button>\n\n <dato-icon-button icon=\"minimize-horizontal\" datoType=\"secondary\" datoSize=\"md\"\n (click)=\"autoFitGrid('container')\" [datoTooltipV2]=\"'core.fit-to-container'\"\n data-auto-id=\"pagiantion-fit-to-container\">\n </dato-icon-button>\n </div>\n</div>\n",
|
|
16479
16522
|
providers: [common.DecimalPipe],
|
|
16480
16523
|
styles: [":host{padding:12px 0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;min-height:25px}:host .container{height:25px}:host .navigation .page-number{transition:color .3s ease-in-out}:host .navigation .page-number:first-of-type{margin-left:7px}:host .navigation .page-number:last-of-type{margin-right:7px}:host .separator{width:1px;height:25px}:host .container.small .navigation,:host .container.small .total{margin-top:8px;margin-left:auto;margin-right:auto}"]
|
|
16481
16524
|
}),
|
|
@@ -16697,18 +16740,6 @@
|
|
|
16697
16740
|
this.registerGroupListeners();
|
|
16698
16741
|
this.subscribeRowsSelectionData();
|
|
16699
16742
|
};
|
|
16700
|
-
DatoGridV2ToolbarComponent.prototype.getCellValueChangeEvent = function () {
|
|
16701
|
-
var _this = this;
|
|
16702
|
-
return this.gridController.gridQuery.waitForGrid(function () {
|
|
16703
|
-
return _this.gridQuery.gridRef.cellValueChanged.pipe(operators.debounceTime(100), ngxTakeUntilDestroy.untilDestroyed(_this));
|
|
16704
|
-
});
|
|
16705
|
-
};
|
|
16706
|
-
DatoGridV2ToolbarComponent.prototype.getRowDataUpdatedEvent = function () {
|
|
16707
|
-
var _this = this;
|
|
16708
|
-
return this.gridController.gridQuery.waitForGrid(function () {
|
|
16709
|
-
return _this.gridQuery.gridRef.rowDataUpdated.pipe(operators.debounceTime(100), ngxTakeUntilDestroy.untilDestroyed(_this));
|
|
16710
|
-
});
|
|
16711
|
-
};
|
|
16712
16743
|
DatoGridV2ToolbarComponent.prototype.onActionClick = function (action) {
|
|
16713
16744
|
if (isFunction(action.onClick)) {
|
|
16714
16745
|
var selectedRowsCount = this.gridController.gridQuery.getSelectedRowsCount();
|
|
@@ -21180,40 +21211,6 @@
|
|
|
21180
21211
|
* found in the LICENSE file at https://github.com/datorama/client-core/blob/master/LICENSE
|
|
21181
21212
|
*/
|
|
21182
21213
|
|
|
21183
|
-
var RichTextService = /** @class */ (function () {
|
|
21184
|
-
function RichTextService(http, config) {
|
|
21185
|
-
this.http = http;
|
|
21186
|
-
this.config = config;
|
|
21187
|
-
}
|
|
21188
|
-
RichTextService.prototype.getLib = function (appendScriptFunc, appendStyleFunc) {
|
|
21189
|
-
if (!this.richTextScript$) {
|
|
21190
|
-
this.initLib(appendScriptFunc, appendStyleFunc);
|
|
21191
|
-
}
|
|
21192
|
-
return this.richTextScript$;
|
|
21193
|
-
};
|
|
21194
|
-
RichTextService.prototype.initLib = function (appendScriptFunc, appendStyleFunc) {
|
|
21195
|
-
this.richTextScript$ = rxjs.combineLatest([
|
|
21196
|
-
this.http
|
|
21197
|
-
.get(this.config.paths.richText + "/index.js", { responseType: 'text' })
|
|
21198
|
-
.pipe(operators.tap(function (lib) { return appendScriptFunc(lib, 'rich-text-editor'); })),
|
|
21199
|
-
this.http
|
|
21200
|
-
.get(this.config.paths.richText + "/plugins/autocomplete/plugin.css", { responseType: 'text' })
|
|
21201
|
-
.pipe(operators.tap(function (style) { return appendStyleFunc(style, 'tinymce-autocomplete'); }))
|
|
21202
|
-
]).pipe(operators.shareReplay(1));
|
|
21203
|
-
};
|
|
21204
|
-
RichTextService.ctorParameters = function () { return [
|
|
21205
|
-
{ type: http.HttpClient },
|
|
21206
|
-
{ type: undefined, decorators: [{ type: core.Inject, args: [DATO_CORE_CONFIG,] }] }
|
|
21207
|
-
]; };
|
|
21208
|
-
RichTextService.ɵprov = core.ɵɵdefineInjectable({ factory: function RichTextService_Factory() { return new RichTextService(core.ɵɵinject(http.HttpClient), core.ɵɵinject(DATO_CORE_CONFIG)); }, token: RichTextService, providedIn: "root" });
|
|
21209
|
-
RichTextService = __decorate([
|
|
21210
|
-
core.Injectable({ providedIn: 'root' }),
|
|
21211
|
-
__param(1, core.Inject(DATO_CORE_CONFIG)),
|
|
21212
|
-
__metadata("design:paramtypes", [http.HttpClient, Object])
|
|
21213
|
-
], RichTextService);
|
|
21214
|
-
return RichTextService;
|
|
21215
|
-
}());
|
|
21216
|
-
|
|
21217
21214
|
/**
|
|
21218
21215
|
* @license
|
|
21219
21216
|
* Copyright Datorama. All Rights Reserved.
|
|
@@ -21227,12 +21224,12 @@
|
|
|
21227
21224
|
var ɵ0$3 = getTinymce;
|
|
21228
21225
|
var DatoRichTextDirective = /** @class */ (function (_super) {
|
|
21229
21226
|
__extends(DatoRichTextDirective, _super);
|
|
21230
|
-
function DatoRichTextDirective(ngZone,
|
|
21227
|
+
function DatoRichTextDirective(ngZone, http, host, config) {
|
|
21231
21228
|
var _this = _super.call(this) || this;
|
|
21232
21229
|
_this.ngZone = ngZone;
|
|
21233
|
-
_this.
|
|
21234
|
-
_this.config = config;
|
|
21230
|
+
_this.http = http;
|
|
21235
21231
|
_this.host = host;
|
|
21232
|
+
_this.config = config;
|
|
21236
21233
|
_this.autocompleteOptions = {};
|
|
21237
21234
|
_this.forcePlainTextPasting = false;
|
|
21238
21235
|
_this.format = 'html';
|
|
@@ -21266,11 +21263,28 @@
|
|
|
21266
21263
|
base: this.config.paths.richText,
|
|
21267
21264
|
query: ''
|
|
21268
21265
|
};
|
|
21269
|
-
|
|
21270
|
-
|
|
21271
|
-
|
|
21272
|
-
|
|
21273
|
-
|
|
21266
|
+
/**
|
|
21267
|
+
* We support only one instance in load time
|
|
21268
|
+
*/
|
|
21269
|
+
if (window.tinymce) {
|
|
21270
|
+
this.init.call(this);
|
|
21271
|
+
}
|
|
21272
|
+
else {
|
|
21273
|
+
this.loadLib().subscribe(function (lib) {
|
|
21274
|
+
appendScript(lib, 'rich-text-editor');
|
|
21275
|
+
_this.init.call(_this);
|
|
21276
|
+
_this.loadAutoCompleteStyle();
|
|
21277
|
+
});
|
|
21278
|
+
}
|
|
21279
|
+
};
|
|
21280
|
+
DatoRichTextDirective.prototype.loadLib = function () {
|
|
21281
|
+
return this.http.get(this.config.paths.richText + "/index.js", { responseType: 'text' });
|
|
21282
|
+
};
|
|
21283
|
+
DatoRichTextDirective.prototype.loadAutoCompleteStyle = function () {
|
|
21284
|
+
this.http
|
|
21285
|
+
.get(this.config.paths.richText + "/plugins/autocomplete/plugin.css", { responseType: 'text' })
|
|
21286
|
+
.subscribe(function (style) {
|
|
21287
|
+
appendStyle(style, 'tinymce-autocomplete');
|
|
21274
21288
|
});
|
|
21275
21289
|
};
|
|
21276
21290
|
DatoRichTextDirective.prototype.initEditor = function (_, editor) {
|
|
@@ -21363,9 +21377,9 @@
|
|
|
21363
21377
|
var DatoRichTextDirective_1;
|
|
21364
21378
|
DatoRichTextDirective.ctorParameters = function () { return [
|
|
21365
21379
|
{ type: core.NgZone },
|
|
21366
|
-
{ type:
|
|
21367
|
-
{ type:
|
|
21368
|
-
{ type: core.
|
|
21380
|
+
{ type: http.HttpClient },
|
|
21381
|
+
{ type: core.ElementRef },
|
|
21382
|
+
{ type: undefined, decorators: [{ type: core.Inject, args: [DATO_CORE_CONFIG,] }] }
|
|
21369
21383
|
]; };
|
|
21370
21384
|
__decorate([
|
|
21371
21385
|
core.Input(),
|
|
@@ -21431,9 +21445,10 @@
|
|
|
21431
21445
|
}
|
|
21432
21446
|
]
|
|
21433
21447
|
}),
|
|
21434
|
-
__param(
|
|
21448
|
+
__param(3, core.Inject(DATO_CORE_CONFIG)),
|
|
21435
21449
|
__metadata("design:paramtypes", [core.NgZone,
|
|
21436
|
-
|
|
21450
|
+
http.HttpClient,
|
|
21451
|
+
core.ElementRef, Object])
|
|
21437
21452
|
], DatoRichTextDirective);
|
|
21438
21453
|
return DatoRichTextDirective;
|
|
21439
21454
|
}(BaseCustomControl));
|
|
@@ -23956,9 +23971,7 @@
|
|
|
23956
23971
|
};
|
|
23957
23972
|
DatoBreadcrumbsComponent.prototype.initEditableHeader = function () {
|
|
23958
23973
|
var _this = this;
|
|
23959
|
-
this.headerControl.valueChanges
|
|
23960
|
-
.pipe(operators.debounceTime(300), ngxTakeUntilDestroy.untilDestroyed(this))
|
|
23961
|
-
.subscribe(function (res) {
|
|
23974
|
+
this.headerControl.valueChanges.pipe(operators.debounceTime(300), ngxTakeUntilDestroy.untilDestroyed(this)).subscribe(function (res) {
|
|
23962
23975
|
_this.updateEditableText.emit(res);
|
|
23963
23976
|
_this.cdr.detectChanges();
|
|
23964
23977
|
});
|
|
@@ -25301,7 +25314,7 @@
|
|
|
25301
25314
|
};
|
|
25302
25315
|
}
|
|
25303
25316
|
|
|
25304
|
-
window.coreVersion = '
|
|
25317
|
+
window.coreVersion = '22.0.0';
|
|
25305
25318
|
|
|
25306
25319
|
exports.APP_TRANSLATE = APP_TRANSLATE;
|
|
25307
25320
|
exports.AceService = AceService;
|
|
@@ -25743,7 +25756,6 @@
|
|
|
25743
25756
|
exports.ɵl = DatoGridItemsCountCellComponent;
|
|
25744
25757
|
exports.ɵm = DatoGridV2ToolbarMoreMenuComponent;
|
|
25745
25758
|
exports.ɵn = DatoGridSearchBarComponent;
|
|
25746
|
-
exports.ɵo = RichTextService;
|
|
25747
25759
|
|
|
25748
25760
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
25749
25761
|
|