@zeedhi/common 1.101.1 → 1.102.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/dist/zd-common.esm.js +77 -15
- package/dist/zd-common.umd.js +77 -15
- package/package.json +2 -2
- package/types/components/zd-grid/grid.d.ts +1 -0
- package/types/components/zd-grid/interfaces.d.ts +1 -0
- package/types/components/zd-iterable-component-render/interfaces.d.ts +1 -0
- package/types/components/zd-iterable-component-render/iterable-component-render.d.ts +1 -0
- package/types/components/zd-select/interfaces.d.ts +1 -0
- package/types/components/zd-select/select.d.ts +1 -0
- package/types/services/zd-json-cache/json-cache-service.d.ts +0 -12
package/dist/zd-common.esm.js
CHANGED
|
@@ -2054,7 +2054,7 @@ class Input extends ComponentRender {
|
|
|
2054
2054
|
if (typeof mask === 'function') {
|
|
2055
2055
|
mask = mask(this.internalValue);
|
|
2056
2056
|
}
|
|
2057
|
-
this.internalDisplayValue = Mask.convertAll(mask,
|
|
2057
|
+
this.internalDisplayValue = Mask.convertAll(mask, value);
|
|
2058
2058
|
this.internalValue = this.parser(this.internalDisplayValue);
|
|
2059
2059
|
}
|
|
2060
2060
|
else {
|
|
@@ -5807,8 +5807,18 @@ class GridColumn extends Column {
|
|
|
5807
5807
|
checkOutValues(component, row, newRow) {
|
|
5808
5808
|
var _a;
|
|
5809
5809
|
if (this.componentProps.dataValueOut && ((_a = component.datasource) === null || _a === void 0 ? void 0 : _a.currentRow)) {
|
|
5810
|
-
this.componentProps.dataValueOut.forEach((
|
|
5811
|
-
|
|
5810
|
+
this.componentProps.dataValueOut.forEach((dataOutColumn) => {
|
|
5811
|
+
var _a;
|
|
5812
|
+
let column;
|
|
5813
|
+
let columnOnGrid;
|
|
5814
|
+
if (typeof dataOutColumn === 'string') {
|
|
5815
|
+
column = dataOutColumn;
|
|
5816
|
+
columnOnGrid = ((_a = this.componentProps.foreignColumns) === null || _a === void 0 ? void 0 : _a[column]) || column;
|
|
5817
|
+
}
|
|
5818
|
+
else {
|
|
5819
|
+
column = dataOutColumn.column;
|
|
5820
|
+
columnOnGrid = dataOutColumn.columnOnGrid;
|
|
5821
|
+
}
|
|
5812
5822
|
let currentValue = component.datasource.currentRow[column];
|
|
5813
5823
|
if (Array.isArray(component.value)) {
|
|
5814
5824
|
currentValue = component.selectedValue.map((item) => item[column]);
|
|
@@ -5833,12 +5843,21 @@ class GridColumn extends Column {
|
|
|
5833
5843
|
FormatterParserProvider.registerFormatter('column_ZdSelect', ({ column, value, row, componentProps, }) => {
|
|
5834
5844
|
if (value === null || value === undefined)
|
|
5835
5845
|
return '';
|
|
5836
|
-
const { dataText, formatterDataText, dataTextSeparator, dataValue, dataTextDiscrete, } = componentProps;
|
|
5846
|
+
const { dataText, formatterDataText, dataTextSeparator, dataValue, dataTextDiscrete, foreignColumns, } = componentProps;
|
|
5837
5847
|
let currentRow = row;
|
|
5848
|
+
const dataTextColumns = Array.isArray(dataText) ? dataText : [dataText];
|
|
5838
5849
|
if (dataValue) {
|
|
5839
|
-
const dataTextColumns = Array.isArray(dataText) ? dataText : [dataText];
|
|
5840
5850
|
const columns = Array.isArray(formatterDataText) ? formatterDataText : [formatterDataText];
|
|
5841
|
-
if (
|
|
5851
|
+
if (foreignColumns) {
|
|
5852
|
+
const loopkupRow = {};
|
|
5853
|
+
dataTextColumns.forEach((item) => {
|
|
5854
|
+
const dataTextName = typeof item === 'string' ? item : item.name;
|
|
5855
|
+
loopkupRow[dataTextName] = currentRow[foreignColumns[dataTextName] || dataTextName];
|
|
5856
|
+
});
|
|
5857
|
+
loopkupRow[dataValue] = currentRow[column.name];
|
|
5858
|
+
column.lookupData[currentRow[column.name]] = loopkupRow;
|
|
5859
|
+
}
|
|
5860
|
+
else if (!formatterDataText) {
|
|
5842
5861
|
currentRow = column.getLookupData(dataValue, value[dataValue] || value);
|
|
5843
5862
|
}
|
|
5844
5863
|
else if (columns.length === dataTextColumns.length) {
|
|
@@ -5854,7 +5873,19 @@ FormatterParserProvider.registerFormatter('column_ZdSelect', ({ column, value, r
|
|
|
5854
5873
|
}
|
|
5855
5874
|
if (!Object.keys(currentRow).length)
|
|
5856
5875
|
return typeof value === 'object' ? '' : value;
|
|
5857
|
-
|
|
5876
|
+
let dataTextForeign = dataText;
|
|
5877
|
+
if (dataText && foreignColumns) {
|
|
5878
|
+
if (typeof dataText === 'string') {
|
|
5879
|
+
dataTextForeign = foreignColumns[dataText] || dataText;
|
|
5880
|
+
}
|
|
5881
|
+
else {
|
|
5882
|
+
dataTextForeign = dataTextColumns.map((item) => {
|
|
5883
|
+
const itemName = typeof item === 'string' ? item : item.name;
|
|
5884
|
+
return foreignColumns[itemName] || itemName;
|
|
5885
|
+
});
|
|
5886
|
+
}
|
|
5887
|
+
}
|
|
5888
|
+
const textColumn = formatterDataText || dataTextDiscrete || dataTextForeign;
|
|
5858
5889
|
if (!textColumn)
|
|
5859
5890
|
return value;
|
|
5860
5891
|
if (typeof textColumn === 'string') {
|
|
@@ -5866,19 +5897,35 @@ FormatterParserProvider.registerFormatter('column_ZdSelect', ({ column, value, r
|
|
|
5866
5897
|
FormatterParserProvider.registerFormatter('column_ZdSelectMultiple', ({ column, value, row, componentProps, }) => {
|
|
5867
5898
|
if (!value || !Array.isArray(value) || value.length === 0)
|
|
5868
5899
|
return '';
|
|
5869
|
-
const { formatterDataText } = componentProps;
|
|
5900
|
+
const { formatterDataText, foreignColumns, dataText } = componentProps;
|
|
5870
5901
|
const formatterFn = FormatterParserProvider.getFormatter('column_ZdSelect');
|
|
5871
5902
|
const result = value.map((item, index) => {
|
|
5872
5903
|
let formatterRow = Object.assign({}, row);
|
|
5904
|
+
const rowOverride = {};
|
|
5873
5905
|
if (formatterDataText && formatterDataText.length > 0) {
|
|
5874
5906
|
const columns = Array.isArray(formatterDataText) ? formatterDataText : [formatterDataText];
|
|
5875
|
-
const rowOverride = {};
|
|
5876
5907
|
columns.forEach((col) => {
|
|
5877
5908
|
const textName = typeof col === 'string' ? col : col.name;
|
|
5878
5909
|
rowOverride[textName] = row[textName][index];
|
|
5879
5910
|
});
|
|
5880
5911
|
formatterRow = Object.assign(Object.assign({}, row), rowOverride);
|
|
5881
5912
|
}
|
|
5913
|
+
else if (foreignColumns && dataText) {
|
|
5914
|
+
let dataTextForeign = dataText;
|
|
5915
|
+
if (typeof dataText === 'string') {
|
|
5916
|
+
dataTextForeign = [foreignColumns[dataText] || dataText];
|
|
5917
|
+
}
|
|
5918
|
+
else {
|
|
5919
|
+
dataTextForeign = dataText.map((col) => {
|
|
5920
|
+
const colName = typeof col === 'string' ? col : col.name;
|
|
5921
|
+
return foreignColumns[colName] || colName;
|
|
5922
|
+
});
|
|
5923
|
+
}
|
|
5924
|
+
dataTextForeign.forEach((col) => {
|
|
5925
|
+
rowOverride[col] = row[col][index];
|
|
5926
|
+
});
|
|
5927
|
+
formatterRow = Object.assign(Object.assign({}, row), rowOverride);
|
|
5928
|
+
}
|
|
5882
5929
|
return formatterFn({
|
|
5883
5930
|
column, value: item, row: formatterRow, componentProps,
|
|
5884
5931
|
});
|
|
@@ -6061,6 +6108,7 @@ class Grid extends Iterable {
|
|
|
6061
6108
|
this.cellSelection = false;
|
|
6062
6109
|
this.currentColumn = null;
|
|
6063
6110
|
this.viewNavigate = null;
|
|
6111
|
+
this.backgroundColor = 'transparent';
|
|
6064
6112
|
this.navigationKeyMapping = {
|
|
6065
6113
|
up: {
|
|
6066
6114
|
event: this.navigateUp.bind(this),
|
|
@@ -6142,7 +6190,6 @@ class Grid extends Iterable {
|
|
|
6142
6190
|
this.maxWidth = this.getInitValue('maxWidth', props.maxWidth, this.maxWidth);
|
|
6143
6191
|
this.showFooter = this.getInitValue('showFooter', props.showFooter, this.showFooter);
|
|
6144
6192
|
this.showHeader = this.getInitValue('showHeader', props.showHeader, this.showHeader);
|
|
6145
|
-
this.headerBackground = this.getInitValue('headerBackground', props.headerBackground, this.headerBackground);
|
|
6146
6193
|
this.headerCellTextColor = this.getInitValue('headerCellTextColor', props.headerCellTextColor, this.headerCellTextColor);
|
|
6147
6194
|
this.dragColumns = this.getInitValue('dragColumns', props.dragColumns, this.dragColumns);
|
|
6148
6195
|
this.resizeColumns = this.getInitValue('resizeColumns', props.resizeColumns, this.resizeColumns);
|
|
@@ -6163,6 +6210,9 @@ class Grid extends Iterable {
|
|
|
6163
6210
|
this.showSelectAll = this.getInitValue('showSelectAll', props.showSelectAll, this.showSelectAll);
|
|
6164
6211
|
this.selectAllPages = this.getInitValue('selectAllPages', props.selectAllPages, this.selectAllPages);
|
|
6165
6212
|
this.cellSelection = this.getInitValue('cellSelection', props.cellSelection, this.cellSelection);
|
|
6213
|
+
this.backgroundColor = this.getInitValue('backgroundColor', props.backgroundColor, this.backgroundColor);
|
|
6214
|
+
// headerBackground defaults to the backgroundColor
|
|
6215
|
+
this.headerBackground = this.getInitValue('headerBackground', props.headerBackground, this.backgroundColor);
|
|
6166
6216
|
this.createAccessors();
|
|
6167
6217
|
}
|
|
6168
6218
|
setViewNavigate(viewNavigate) {
|
|
@@ -6911,8 +6961,10 @@ class GridEditable extends Grid {
|
|
|
6911
6961
|
newRow[key].originalRow = omit(row, 'originalRow');
|
|
6912
6962
|
newRow[key][columnName] = value;
|
|
6913
6963
|
newRow[key][`${columnName}_original`] = row[columnName];
|
|
6914
|
-
if (component)
|
|
6964
|
+
if (component) {
|
|
6915
6965
|
column.checkOutValues(component, row, newRow[key]);
|
|
6966
|
+
component.value = value;
|
|
6967
|
+
}
|
|
6916
6968
|
this.editedRows = Object.assign(Object.assign({}, this.editedRows), newRow);
|
|
6917
6969
|
if (this.isAdded(row)) {
|
|
6918
6970
|
this.addedRows = Object.assign(Object.assign({}, this.addedRows), newRow);
|
|
@@ -6923,8 +6975,10 @@ class GridEditable extends Grid {
|
|
|
6923
6975
|
const newRow = rows[key];
|
|
6924
6976
|
delete newRow[columnName];
|
|
6925
6977
|
delete newRow[`${columnName}_original`];
|
|
6926
|
-
if (component)
|
|
6978
|
+
if (component) {
|
|
6927
6979
|
column.checkOutValues(component, row, newRow);
|
|
6980
|
+
component.value = value;
|
|
6981
|
+
}
|
|
6928
6982
|
if (Object.keys(newRow).length === 1 && newRow.originalRow) {
|
|
6929
6983
|
delete rows[key];
|
|
6930
6984
|
}
|
|
@@ -7934,7 +7988,7 @@ const defaultTheme = {
|
|
|
7934
7988
|
'badge-text-color': '#fff',
|
|
7935
7989
|
},
|
|
7936
7990
|
dark: {
|
|
7937
|
-
'font-color': '
|
|
7991
|
+
'font-color': '#ffffff',
|
|
7938
7992
|
'background-base': '#1E1E1E',
|
|
7939
7993
|
'background-base-2': 'var(--v-grey-darken2)',
|
|
7940
7994
|
'background-base-3': 'var(--v-grey-darken4)',
|
|
@@ -9573,6 +9627,7 @@ class Select extends TextInput {
|
|
|
9573
9627
|
* Defines the name of the form target to set using dataValueOut
|
|
9574
9628
|
*/
|
|
9575
9629
|
this.dataValueOutFormName = '';
|
|
9630
|
+
this.closeOnScroll = true;
|
|
9576
9631
|
this.dsSearch = {
|
|
9577
9632
|
SEARCH: (value, searchIn) => ({
|
|
9578
9633
|
searchIn: [searchIn],
|
|
@@ -9625,6 +9680,7 @@ class Select extends TextInput {
|
|
|
9625
9680
|
this.searchParam = this.getInitValue('searchParam', props.searchParam, this.searchParam);
|
|
9626
9681
|
this.dataValueOut = this.getInitValue('dataValueOut', props.dataValueOut, this.dataValueOut);
|
|
9627
9682
|
this.dataValueOutFormName = this.getInitValue('dataValueOutFormName', props.dataValueOutFormName, this.dataValueOutFormName);
|
|
9683
|
+
this.closeOnScroll = this.getInitValue('closeOnScroll', props.closeOnScroll, this.closeOnScroll);
|
|
9628
9684
|
if (((_a = props.datasource) === null || _a === void 0 ? void 0 : _a.type) === 'simple') {
|
|
9629
9685
|
this.dataValue = 'value';
|
|
9630
9686
|
this.dataText = this.dataText || this.dataValue;
|
|
@@ -10337,6 +10393,7 @@ class IterableComponentRender extends Iterable {
|
|
|
10337
10393
|
* Components that will be rendered in error case
|
|
10338
10394
|
*/
|
|
10339
10395
|
this.errorSlot = [];
|
|
10396
|
+
this.showLoading = true;
|
|
10340
10397
|
this.toolbarSlot = props.toolbarSlot || this.toolbarSlot;
|
|
10341
10398
|
this.footerSlot = props.footerSlot || this.footerSlot;
|
|
10342
10399
|
this.componentMetadata = this.getInitValue('componentMetadata', props.componentMetadata, this.componentMetadata);
|
|
@@ -10353,6 +10410,7 @@ class IterableComponentRender extends Iterable {
|
|
|
10353
10410
|
this.width = this.getInitValue('width', props.width, this.width);
|
|
10354
10411
|
this.minWidth = this.getInitValue('minWidth', props.minWidth, this.minWidth);
|
|
10355
10412
|
this.maxWidth = this.getInitValue('maxWidth', props.maxWidth, this.maxWidth);
|
|
10413
|
+
this.showLoading = this.getInitValue('showLoading', props.showLoading, this.showLoading);
|
|
10356
10414
|
this.createAccessors();
|
|
10357
10415
|
}
|
|
10358
10416
|
addSlashes(value) {
|
|
@@ -15011,16 +15069,20 @@ class TreeGridEditable extends TreeGrid {
|
|
|
15011
15069
|
newRow[key].originalRow = omit(row, 'originalRow');
|
|
15012
15070
|
newRow[key][columnName] = value;
|
|
15013
15071
|
newRow[key][`${columnName}_original`] = row[columnName];
|
|
15014
|
-
if (component)
|
|
15072
|
+
if (component) {
|
|
15015
15073
|
column.checkOutValues(component, row, newRow[key]);
|
|
15074
|
+
component.value = value;
|
|
15075
|
+
}
|
|
15016
15076
|
this.editedRows = Object.assign(Object.assign({}, this.editedRows), newRow);
|
|
15017
15077
|
}
|
|
15018
15078
|
else if (this.editedRows[key]) {
|
|
15019
15079
|
const rows = Object.assign({}, this.editedRows);
|
|
15020
15080
|
delete rows[key][columnName];
|
|
15021
15081
|
delete rows[key][`${columnName}_original`];
|
|
15022
|
-
if (component)
|
|
15082
|
+
if (component) {
|
|
15023
15083
|
column.checkOutValues(component, row, rows[key]);
|
|
15084
|
+
component.value = value;
|
|
15085
|
+
}
|
|
15024
15086
|
if (Object.keys(rows[key]).length === 1 && rows[key].originalRow) {
|
|
15025
15087
|
delete rows[key];
|
|
15026
15088
|
}
|
package/dist/zd-common.umd.js
CHANGED
|
@@ -2061,7 +2061,7 @@
|
|
|
2061
2061
|
if (typeof mask === 'function') {
|
|
2062
2062
|
mask = mask(this.internalValue);
|
|
2063
2063
|
}
|
|
2064
|
-
this.internalDisplayValue = core.Mask.convertAll(mask,
|
|
2064
|
+
this.internalDisplayValue = core.Mask.convertAll(mask, value);
|
|
2065
2065
|
this.internalValue = this.parser(this.internalDisplayValue);
|
|
2066
2066
|
}
|
|
2067
2067
|
else {
|
|
@@ -5814,8 +5814,18 @@
|
|
|
5814
5814
|
checkOutValues(component, row, newRow) {
|
|
5815
5815
|
var _a;
|
|
5816
5816
|
if (this.componentProps.dataValueOut && ((_a = component.datasource) === null || _a === void 0 ? void 0 : _a.currentRow)) {
|
|
5817
|
-
this.componentProps.dataValueOut.forEach((
|
|
5818
|
-
|
|
5817
|
+
this.componentProps.dataValueOut.forEach((dataOutColumn) => {
|
|
5818
|
+
var _a;
|
|
5819
|
+
let column;
|
|
5820
|
+
let columnOnGrid;
|
|
5821
|
+
if (typeof dataOutColumn === 'string') {
|
|
5822
|
+
column = dataOutColumn;
|
|
5823
|
+
columnOnGrid = ((_a = this.componentProps.foreignColumns) === null || _a === void 0 ? void 0 : _a[column]) || column;
|
|
5824
|
+
}
|
|
5825
|
+
else {
|
|
5826
|
+
column = dataOutColumn.column;
|
|
5827
|
+
columnOnGrid = dataOutColumn.columnOnGrid;
|
|
5828
|
+
}
|
|
5819
5829
|
let currentValue = component.datasource.currentRow[column];
|
|
5820
5830
|
if (Array.isArray(component.value)) {
|
|
5821
5831
|
currentValue = component.selectedValue.map((item) => item[column]);
|
|
@@ -5840,12 +5850,21 @@
|
|
|
5840
5850
|
core.FormatterParserProvider.registerFormatter('column_ZdSelect', ({ column, value, row, componentProps, }) => {
|
|
5841
5851
|
if (value === null || value === undefined)
|
|
5842
5852
|
return '';
|
|
5843
|
-
const { dataText, formatterDataText, dataTextSeparator, dataValue, dataTextDiscrete, } = componentProps;
|
|
5853
|
+
const { dataText, formatterDataText, dataTextSeparator, dataValue, dataTextDiscrete, foreignColumns, } = componentProps;
|
|
5844
5854
|
let currentRow = row;
|
|
5855
|
+
const dataTextColumns = Array.isArray(dataText) ? dataText : [dataText];
|
|
5845
5856
|
if (dataValue) {
|
|
5846
|
-
const dataTextColumns = Array.isArray(dataText) ? dataText : [dataText];
|
|
5847
5857
|
const columns = Array.isArray(formatterDataText) ? formatterDataText : [formatterDataText];
|
|
5848
|
-
if (
|
|
5858
|
+
if (foreignColumns) {
|
|
5859
|
+
const loopkupRow = {};
|
|
5860
|
+
dataTextColumns.forEach((item) => {
|
|
5861
|
+
const dataTextName = typeof item === 'string' ? item : item.name;
|
|
5862
|
+
loopkupRow[dataTextName] = currentRow[foreignColumns[dataTextName] || dataTextName];
|
|
5863
|
+
});
|
|
5864
|
+
loopkupRow[dataValue] = currentRow[column.name];
|
|
5865
|
+
column.lookupData[currentRow[column.name]] = loopkupRow;
|
|
5866
|
+
}
|
|
5867
|
+
else if (!formatterDataText) {
|
|
5849
5868
|
currentRow = column.getLookupData(dataValue, value[dataValue] || value);
|
|
5850
5869
|
}
|
|
5851
5870
|
else if (columns.length === dataTextColumns.length) {
|
|
@@ -5861,7 +5880,19 @@
|
|
|
5861
5880
|
}
|
|
5862
5881
|
if (!Object.keys(currentRow).length)
|
|
5863
5882
|
return typeof value === 'object' ? '' : value;
|
|
5864
|
-
|
|
5883
|
+
let dataTextForeign = dataText;
|
|
5884
|
+
if (dataText && foreignColumns) {
|
|
5885
|
+
if (typeof dataText === 'string') {
|
|
5886
|
+
dataTextForeign = foreignColumns[dataText] || dataText;
|
|
5887
|
+
}
|
|
5888
|
+
else {
|
|
5889
|
+
dataTextForeign = dataTextColumns.map((item) => {
|
|
5890
|
+
const itemName = typeof item === 'string' ? item : item.name;
|
|
5891
|
+
return foreignColumns[itemName] || itemName;
|
|
5892
|
+
});
|
|
5893
|
+
}
|
|
5894
|
+
}
|
|
5895
|
+
const textColumn = formatterDataText || dataTextDiscrete || dataTextForeign;
|
|
5865
5896
|
if (!textColumn)
|
|
5866
5897
|
return value;
|
|
5867
5898
|
if (typeof textColumn === 'string') {
|
|
@@ -5873,19 +5904,35 @@
|
|
|
5873
5904
|
core.FormatterParserProvider.registerFormatter('column_ZdSelectMultiple', ({ column, value, row, componentProps, }) => {
|
|
5874
5905
|
if (!value || !Array.isArray(value) || value.length === 0)
|
|
5875
5906
|
return '';
|
|
5876
|
-
const { formatterDataText } = componentProps;
|
|
5907
|
+
const { formatterDataText, foreignColumns, dataText } = componentProps;
|
|
5877
5908
|
const formatterFn = core.FormatterParserProvider.getFormatter('column_ZdSelect');
|
|
5878
5909
|
const result = value.map((item, index) => {
|
|
5879
5910
|
let formatterRow = Object.assign({}, row);
|
|
5911
|
+
const rowOverride = {};
|
|
5880
5912
|
if (formatterDataText && formatterDataText.length > 0) {
|
|
5881
5913
|
const columns = Array.isArray(formatterDataText) ? formatterDataText : [formatterDataText];
|
|
5882
|
-
const rowOverride = {};
|
|
5883
5914
|
columns.forEach((col) => {
|
|
5884
5915
|
const textName = typeof col === 'string' ? col : col.name;
|
|
5885
5916
|
rowOverride[textName] = row[textName][index];
|
|
5886
5917
|
});
|
|
5887
5918
|
formatterRow = Object.assign(Object.assign({}, row), rowOverride);
|
|
5888
5919
|
}
|
|
5920
|
+
else if (foreignColumns && dataText) {
|
|
5921
|
+
let dataTextForeign = dataText;
|
|
5922
|
+
if (typeof dataText === 'string') {
|
|
5923
|
+
dataTextForeign = [foreignColumns[dataText] || dataText];
|
|
5924
|
+
}
|
|
5925
|
+
else {
|
|
5926
|
+
dataTextForeign = dataText.map((col) => {
|
|
5927
|
+
const colName = typeof col === 'string' ? col : col.name;
|
|
5928
|
+
return foreignColumns[colName] || colName;
|
|
5929
|
+
});
|
|
5930
|
+
}
|
|
5931
|
+
dataTextForeign.forEach((col) => {
|
|
5932
|
+
rowOverride[col] = row[col][index];
|
|
5933
|
+
});
|
|
5934
|
+
formatterRow = Object.assign(Object.assign({}, row), rowOverride);
|
|
5935
|
+
}
|
|
5889
5936
|
return formatterFn({
|
|
5890
5937
|
column, value: item, row: formatterRow, componentProps,
|
|
5891
5938
|
});
|
|
@@ -6068,6 +6115,7 @@
|
|
|
6068
6115
|
this.cellSelection = false;
|
|
6069
6116
|
this.currentColumn = null;
|
|
6070
6117
|
this.viewNavigate = null;
|
|
6118
|
+
this.backgroundColor = 'transparent';
|
|
6071
6119
|
this.navigationKeyMapping = {
|
|
6072
6120
|
up: {
|
|
6073
6121
|
event: this.navigateUp.bind(this),
|
|
@@ -6149,7 +6197,6 @@
|
|
|
6149
6197
|
this.maxWidth = this.getInitValue('maxWidth', props.maxWidth, this.maxWidth);
|
|
6150
6198
|
this.showFooter = this.getInitValue('showFooter', props.showFooter, this.showFooter);
|
|
6151
6199
|
this.showHeader = this.getInitValue('showHeader', props.showHeader, this.showHeader);
|
|
6152
|
-
this.headerBackground = this.getInitValue('headerBackground', props.headerBackground, this.headerBackground);
|
|
6153
6200
|
this.headerCellTextColor = this.getInitValue('headerCellTextColor', props.headerCellTextColor, this.headerCellTextColor);
|
|
6154
6201
|
this.dragColumns = this.getInitValue('dragColumns', props.dragColumns, this.dragColumns);
|
|
6155
6202
|
this.resizeColumns = this.getInitValue('resizeColumns', props.resizeColumns, this.resizeColumns);
|
|
@@ -6170,6 +6217,9 @@
|
|
|
6170
6217
|
this.showSelectAll = this.getInitValue('showSelectAll', props.showSelectAll, this.showSelectAll);
|
|
6171
6218
|
this.selectAllPages = this.getInitValue('selectAllPages', props.selectAllPages, this.selectAllPages);
|
|
6172
6219
|
this.cellSelection = this.getInitValue('cellSelection', props.cellSelection, this.cellSelection);
|
|
6220
|
+
this.backgroundColor = this.getInitValue('backgroundColor', props.backgroundColor, this.backgroundColor);
|
|
6221
|
+
// headerBackground defaults to the backgroundColor
|
|
6222
|
+
this.headerBackground = this.getInitValue('headerBackground', props.headerBackground, this.backgroundColor);
|
|
6173
6223
|
this.createAccessors();
|
|
6174
6224
|
}
|
|
6175
6225
|
setViewNavigate(viewNavigate) {
|
|
@@ -6918,8 +6968,10 @@
|
|
|
6918
6968
|
newRow[key].originalRow = omit__default["default"](row, 'originalRow');
|
|
6919
6969
|
newRow[key][columnName] = value;
|
|
6920
6970
|
newRow[key][`${columnName}_original`] = row[columnName];
|
|
6921
|
-
if (component)
|
|
6971
|
+
if (component) {
|
|
6922
6972
|
column.checkOutValues(component, row, newRow[key]);
|
|
6973
|
+
component.value = value;
|
|
6974
|
+
}
|
|
6923
6975
|
this.editedRows = Object.assign(Object.assign({}, this.editedRows), newRow);
|
|
6924
6976
|
if (this.isAdded(row)) {
|
|
6925
6977
|
this.addedRows = Object.assign(Object.assign({}, this.addedRows), newRow);
|
|
@@ -6930,8 +6982,10 @@
|
|
|
6930
6982
|
const newRow = rows[key];
|
|
6931
6983
|
delete newRow[columnName];
|
|
6932
6984
|
delete newRow[`${columnName}_original`];
|
|
6933
|
-
if (component)
|
|
6985
|
+
if (component) {
|
|
6934
6986
|
column.checkOutValues(component, row, newRow);
|
|
6987
|
+
component.value = value;
|
|
6988
|
+
}
|
|
6935
6989
|
if (Object.keys(newRow).length === 1 && newRow.originalRow) {
|
|
6936
6990
|
delete rows[key];
|
|
6937
6991
|
}
|
|
@@ -7941,7 +7995,7 @@
|
|
|
7941
7995
|
'badge-text-color': '#fff',
|
|
7942
7996
|
},
|
|
7943
7997
|
dark: {
|
|
7944
|
-
'font-color': '
|
|
7998
|
+
'font-color': '#ffffff',
|
|
7945
7999
|
'background-base': '#1E1E1E',
|
|
7946
8000
|
'background-base-2': 'var(--v-grey-darken2)',
|
|
7947
8001
|
'background-base-3': 'var(--v-grey-darken4)',
|
|
@@ -9580,6 +9634,7 @@
|
|
|
9580
9634
|
* Defines the name of the form target to set using dataValueOut
|
|
9581
9635
|
*/
|
|
9582
9636
|
this.dataValueOutFormName = '';
|
|
9637
|
+
this.closeOnScroll = true;
|
|
9583
9638
|
this.dsSearch = {
|
|
9584
9639
|
SEARCH: (value, searchIn) => ({
|
|
9585
9640
|
searchIn: [searchIn],
|
|
@@ -9632,6 +9687,7 @@
|
|
|
9632
9687
|
this.searchParam = this.getInitValue('searchParam', props.searchParam, this.searchParam);
|
|
9633
9688
|
this.dataValueOut = this.getInitValue('dataValueOut', props.dataValueOut, this.dataValueOut);
|
|
9634
9689
|
this.dataValueOutFormName = this.getInitValue('dataValueOutFormName', props.dataValueOutFormName, this.dataValueOutFormName);
|
|
9690
|
+
this.closeOnScroll = this.getInitValue('closeOnScroll', props.closeOnScroll, this.closeOnScroll);
|
|
9635
9691
|
if (((_a = props.datasource) === null || _a === void 0 ? void 0 : _a.type) === 'simple') {
|
|
9636
9692
|
this.dataValue = 'value';
|
|
9637
9693
|
this.dataText = this.dataText || this.dataValue;
|
|
@@ -10344,6 +10400,7 @@
|
|
|
10344
10400
|
* Components that will be rendered in error case
|
|
10345
10401
|
*/
|
|
10346
10402
|
this.errorSlot = [];
|
|
10403
|
+
this.showLoading = true;
|
|
10347
10404
|
this.toolbarSlot = props.toolbarSlot || this.toolbarSlot;
|
|
10348
10405
|
this.footerSlot = props.footerSlot || this.footerSlot;
|
|
10349
10406
|
this.componentMetadata = this.getInitValue('componentMetadata', props.componentMetadata, this.componentMetadata);
|
|
@@ -10360,6 +10417,7 @@
|
|
|
10360
10417
|
this.width = this.getInitValue('width', props.width, this.width);
|
|
10361
10418
|
this.minWidth = this.getInitValue('minWidth', props.minWidth, this.minWidth);
|
|
10362
10419
|
this.maxWidth = this.getInitValue('maxWidth', props.maxWidth, this.maxWidth);
|
|
10420
|
+
this.showLoading = this.getInitValue('showLoading', props.showLoading, this.showLoading);
|
|
10363
10421
|
this.createAccessors();
|
|
10364
10422
|
}
|
|
10365
10423
|
addSlashes(value) {
|
|
@@ -15018,16 +15076,20 @@
|
|
|
15018
15076
|
newRow[key].originalRow = omit__default["default"](row, 'originalRow');
|
|
15019
15077
|
newRow[key][columnName] = value;
|
|
15020
15078
|
newRow[key][`${columnName}_original`] = row[columnName];
|
|
15021
|
-
if (component)
|
|
15079
|
+
if (component) {
|
|
15022
15080
|
column.checkOutValues(component, row, newRow[key]);
|
|
15081
|
+
component.value = value;
|
|
15082
|
+
}
|
|
15023
15083
|
this.editedRows = Object.assign(Object.assign({}, this.editedRows), newRow);
|
|
15024
15084
|
}
|
|
15025
15085
|
else if (this.editedRows[key]) {
|
|
15026
15086
|
const rows = Object.assign({}, this.editedRows);
|
|
15027
15087
|
delete rows[key][columnName];
|
|
15028
15088
|
delete rows[key][`${columnName}_original`];
|
|
15029
|
-
if (component)
|
|
15089
|
+
if (component) {
|
|
15030
15090
|
column.checkOutValues(component, row, rows[key]);
|
|
15091
|
+
component.value = value;
|
|
15092
|
+
}
|
|
15031
15093
|
if (Object.keys(rows[key]).length === 1 && rows[key].originalRow) {
|
|
15032
15094
|
delete rows[key];
|
|
15033
15095
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeedhi/common",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.102.0",
|
|
4
4
|
"description": "Zeedhi Common",
|
|
5
5
|
"author": "Zeedhi <zeedhi@teknisa.com>",
|
|
6
6
|
"license": "ISC",
|
|
@@ -43,5 +43,5 @@
|
|
|
43
43
|
"lodash.times": "4.3.*",
|
|
44
44
|
"mockdate": "3.0.*"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "0676c21736fe36fd80ffe84851f0503e6163263f"
|
|
47
47
|
}
|
|
@@ -146,6 +146,7 @@ export declare class Grid extends Iterable implements IGrid {
|
|
|
146
146
|
currentColumn: Column | null;
|
|
147
147
|
protected viewNavigate: ((direction: 'up' | 'down' | 'left' | 'right', event?: Event) => void) | null;
|
|
148
148
|
setViewNavigate(viewNavigate: (up: 'up' | 'down' | 'left' | 'right', event?: Event) => void): void;
|
|
149
|
+
backgroundColor: string;
|
|
149
150
|
/**
|
|
150
151
|
* Creates a new Grid.
|
|
151
152
|
* @param props Grid properties
|
|
@@ -72,6 +72,7 @@ export declare class IterableComponentRender extends Iterable implements IIterab
|
|
|
72
72
|
* Components that will be rendered in error case
|
|
73
73
|
*/
|
|
74
74
|
errorSlot: IComponentRender[];
|
|
75
|
+
showLoading: boolean;
|
|
75
76
|
constructor(props: IIterableComponentRender);
|
|
76
77
|
private addSlashes;
|
|
77
78
|
/**
|
|
@@ -91,6 +91,7 @@ export declare class Select extends TextInput implements ISelect {
|
|
|
91
91
|
* Defines the name of the form target to set using dataValueOut
|
|
92
92
|
*/
|
|
93
93
|
dataValueOutFormName: string;
|
|
94
|
+
closeOnScroll: boolean;
|
|
94
95
|
protected dsSearch: {
|
|
95
96
|
SEARCH: (value: any, searchIn: string) => {
|
|
96
97
|
searchIn: string[];
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export interface IJSONObject {
|
|
2
|
-
path: string;
|
|
3
|
-
}
|
|
4
|
-
export declare class JsonCacheService {
|
|
5
|
-
/**
|
|
6
|
-
* jsons collection
|
|
7
|
-
*/
|
|
8
|
-
static jsonCollection: IJSONObject[];
|
|
9
|
-
static saveJSONCache(jsonCollection: IJSONObject[]): Promise<void>;
|
|
10
|
-
static getJSONCache(path: string): any;
|
|
11
|
-
static clearJSONCache(jsonCollection: IJSONObject[]): void;
|
|
12
|
-
}
|