@zeedhi/common 1.87.1 → 1.88.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 +58 -30
- package/dist/zd-common.umd.js +58 -30
- package/package.json +2 -2
- package/types/components/zd-date/date-range.d.ts +3 -1
- package/types/components/zd-grid/grid-editable.d.ts +2 -1
- package/types/components/zd-iterable/column.d.ts +1 -0
- package/types/components/zd-select-tree/interfaces.d.ts +2 -0
- package/types/components/zd-select-tree/select-tree.d.ts +5 -0
package/dist/zd-common.esm.js
CHANGED
|
@@ -4246,10 +4246,7 @@ class DateRange extends TextInput {
|
|
|
4246
4246
|
* Toggles visibility of the week numbers in the body of the calendar.
|
|
4247
4247
|
*/
|
|
4248
4248
|
this.showWeek = false;
|
|
4249
|
-
|
|
4250
|
-
* Character that will separate the two dates
|
|
4251
|
-
*/
|
|
4252
|
-
this.splitter = ' ~ ';
|
|
4249
|
+
this.internalSplitter = ' ~ ';
|
|
4253
4250
|
/**
|
|
4254
4251
|
* Width of the picker.
|
|
4255
4252
|
*/
|
|
@@ -4288,7 +4285,7 @@ class DateRange extends TextInput {
|
|
|
4288
4285
|
this.scrollable = this.getInitValue('scrollable', props.scrollable, this.scrollable);
|
|
4289
4286
|
this.showDatePicker = this.getInitValue('showDatePicker', props.showDatePicker, this.showDatePicker);
|
|
4290
4287
|
this.showWeek = this.getInitValue('showWeek', props.showWeek, this.showWeek);
|
|
4291
|
-
this.splitter = this.getInitValue('splitter', props.splitter, this.
|
|
4288
|
+
this.splitter = this.getInitValue('splitter', props.splitter, this.internalSplitter);
|
|
4292
4289
|
this.width = this.getInitValue('width', props.width, this.width);
|
|
4293
4290
|
this.mask = this.getInitValue('mask', props.mask, undefined);
|
|
4294
4291
|
this.helperOptions = this.getInitValue('helperOptions', props.helperOptions, this.helperOptions);
|
|
@@ -4307,6 +4304,15 @@ class DateRange extends TextInput {
|
|
|
4307
4304
|
}
|
|
4308
4305
|
};
|
|
4309
4306
|
}
|
|
4307
|
+
/**
|
|
4308
|
+
* Character that will separate the two dates
|
|
4309
|
+
*/
|
|
4310
|
+
get splitter() {
|
|
4311
|
+
return I18n.translate(this.internalSplitter);
|
|
4312
|
+
}
|
|
4313
|
+
set splitter(splitter) {
|
|
4314
|
+
this.internalSplitter = splitter;
|
|
4315
|
+
}
|
|
4310
4316
|
getInitialMask() {
|
|
4311
4317
|
if (isUndefined(this.mask)) {
|
|
4312
4318
|
this.unitMask = this.inputFormat && this.maskFormat(this.inputFormat);
|
|
@@ -4344,7 +4350,7 @@ class DateRange extends TextInput {
|
|
|
4344
4350
|
* Gets the updated masked, based on displayFormat if the initial mask is undefined
|
|
4345
4351
|
*/
|
|
4346
4352
|
getUpdatedMask() {
|
|
4347
|
-
if (isUndefined(this.
|
|
4353
|
+
if (isUndefined(this.getInitialMask())) {
|
|
4348
4354
|
return this.maskFormat(`${this.displayFormat}${this.splitter}${this.displayFormat}`);
|
|
4349
4355
|
}
|
|
4350
4356
|
return this.mask;
|
|
@@ -4475,10 +4481,10 @@ class DateRange extends TextInput {
|
|
|
4475
4481
|
* Add date mask
|
|
4476
4482
|
*/
|
|
4477
4483
|
addDateMask() {
|
|
4478
|
-
if (isUndefined(this.
|
|
4484
|
+
if (isUndefined(this.getInitialMask()) || !this.value)
|
|
4479
4485
|
return;
|
|
4480
4486
|
setTimeout(() => {
|
|
4481
|
-
this.mask = this.
|
|
4487
|
+
this.mask = this.getInitialMask();
|
|
4482
4488
|
const firstDate = this.value[0]
|
|
4483
4489
|
? dayjs(this.value[0], this.dateFormat).format(this.inputFormat || this.displayFormat)
|
|
4484
4490
|
: '';
|
|
@@ -4492,7 +4498,7 @@ class DateRange extends TextInput {
|
|
|
4492
4498
|
* Removes the component mask if value is valid
|
|
4493
4499
|
*/
|
|
4494
4500
|
removeDateMask() {
|
|
4495
|
-
if (isUndefined(this.
|
|
4501
|
+
if (isUndefined(this.getInitialMask()) || !this.value || this.dateError
|
|
4496
4502
|
|| !this.isValidDateArray(this.dateFormat, this.value)) {
|
|
4497
4503
|
return;
|
|
4498
4504
|
}
|
|
@@ -5259,6 +5265,7 @@ class Column extends Component {
|
|
|
5259
5265
|
this.factoredConditions = {};
|
|
5260
5266
|
/* Action children conditions */
|
|
5261
5267
|
this.actionFactoredConditions = {};
|
|
5268
|
+
this.helperText = '';
|
|
5262
5269
|
this.defaultData = [];
|
|
5263
5270
|
this.lookup = debounce((lookupColumn) => {
|
|
5264
5271
|
this.loading = true;
|
|
@@ -5290,6 +5297,7 @@ class Column extends Component {
|
|
|
5290
5297
|
this.componentProps = this.getInitValue('componentProps', props.componentProps, this.componentProps);
|
|
5291
5298
|
this.xlsType = this.getInitValue('xlsType', props.xlsType, this.xlsType);
|
|
5292
5299
|
this.conditions = this.getInitValue('conditions', props.conditions, this.conditions);
|
|
5300
|
+
this.helperText = this.getInitValue('', props.helperText, this.helperText);
|
|
5293
5301
|
this.createConditions();
|
|
5294
5302
|
this.createActionConditions();
|
|
5295
5303
|
if (this.componentProps.datasource) {
|
|
@@ -6364,6 +6372,7 @@ class GridEditable extends Grid {
|
|
|
6364
6372
|
* @private
|
|
6365
6373
|
*/
|
|
6366
6374
|
this.invalidComponents = {};
|
|
6375
|
+
this.editingNewRows = false;
|
|
6367
6376
|
this.cancelEditedRowsKeyMapping = {
|
|
6368
6377
|
esc: {
|
|
6369
6378
|
event: this.cancelEditedRows.bind(this),
|
|
@@ -6375,6 +6384,7 @@ class GridEditable extends Grid {
|
|
|
6375
6384
|
this.newRowIdentifier = '__added_row';
|
|
6376
6385
|
this.doubleClickEdit = this.getInitValue('doubleClickEdit', props.doubleClickEdit, this.doubleClickEdit);
|
|
6377
6386
|
this.canEditRow = this.getInitValue('canEditRow', props.canEditRow, this.canEditRow);
|
|
6387
|
+
this.editingNewRows = this.getInitValue('editingNewRows', props.editingNewRows, this.editingNewRows);
|
|
6378
6388
|
this.createAccessors();
|
|
6379
6389
|
}
|
|
6380
6390
|
onMounted(element) {
|
|
@@ -6840,6 +6850,9 @@ class GridEditable extends Grid {
|
|
|
6840
6850
|
}
|
|
6841
6851
|
}
|
|
6842
6852
|
callCanEditRow(row) {
|
|
6853
|
+
if (this.editingNewRows) {
|
|
6854
|
+
return row[this.newRowIdentifier];
|
|
6855
|
+
}
|
|
6843
6856
|
return !this.canEditRow || typeof this.canEditRow !== 'function' || this.canEditRow({ row, component: this });
|
|
6844
6857
|
}
|
|
6845
6858
|
}
|
|
@@ -7766,7 +7779,8 @@ class Select extends TextInput {
|
|
|
7766
7779
|
*/
|
|
7767
7780
|
blur(event, element) {
|
|
7768
7781
|
if (this.autocomplete) {
|
|
7769
|
-
|
|
7782
|
+
const isSameValue = () => this.getValue(this.datasource.data[0]) === this.value;
|
|
7783
|
+
if (this.search && this.autoSelection && this.datasource.data.length === 1 && !isSameValue()) {
|
|
7770
7784
|
this.setValue(this.datasource.data[0]);
|
|
7771
7785
|
}
|
|
7772
7786
|
this.datasource.search = '';
|
|
@@ -7780,7 +7794,7 @@ class Select extends TextInput {
|
|
|
7780
7794
|
super.blur(event, element);
|
|
7781
7795
|
}
|
|
7782
7796
|
checkValueOnBlur() {
|
|
7783
|
-
if (!this.search) {
|
|
7797
|
+
if (!this.search && this.value !== null) {
|
|
7784
7798
|
this.setValue(null);
|
|
7785
7799
|
}
|
|
7786
7800
|
if (this.manualMode)
|
|
@@ -10019,6 +10033,9 @@ class SelectMultiple extends Select {
|
|
|
10019
10033
|
yield this.datasource.get();
|
|
10020
10034
|
}
|
|
10021
10035
|
this.setValue(this.datasource.data);
|
|
10036
|
+
if (!this.datasource.search) {
|
|
10037
|
+
this.setCache();
|
|
10038
|
+
}
|
|
10022
10039
|
});
|
|
10023
10040
|
}
|
|
10024
10041
|
unSelectAllItems() {
|
|
@@ -10546,6 +10563,10 @@ class SelectTree extends TextInput {
|
|
|
10546
10563
|
* Field used to display values
|
|
10547
10564
|
*/
|
|
10548
10565
|
this.dataText = '';
|
|
10566
|
+
/**
|
|
10567
|
+
* Field used to display values when the select is closed
|
|
10568
|
+
*/
|
|
10569
|
+
this.dataTextDiscrete = '';
|
|
10549
10570
|
/**
|
|
10550
10571
|
* Value used to join display values
|
|
10551
10572
|
*/
|
|
@@ -10600,6 +10621,7 @@ class SelectTree extends TextInput {
|
|
|
10600
10621
|
this.returnObject = this.getInitValue('returnObject', props.returnObject, this.returnObject);
|
|
10601
10622
|
this.parentField = this.getInitValue('parentField', props.parentField, this.parentField);
|
|
10602
10623
|
this.dataText = this.getInitValue('dataText', props.dataText, this.dataText);
|
|
10624
|
+
this.dataTextDiscrete = this.getInitValue('dataTextDiscrete', props.dataTextDiscrete, this.dataTextDiscrete);
|
|
10603
10625
|
this.dataTextSeparator = this.getInitValue('dataTextSeparator', props.dataTextSeparator, this.dataTextSeparator);
|
|
10604
10626
|
this.dataValue = this.getInitValue('dataValue', props.dataValue, this.dataValue);
|
|
10605
10627
|
this.dataDisabled = this.getInitValue('dataDisabled', props.dataDisabled, this.dataDisabled);
|
|
@@ -10676,7 +10698,29 @@ class SelectTree extends TextInput {
|
|
|
10676
10698
|
children = undefined;
|
|
10677
10699
|
}
|
|
10678
10700
|
}
|
|
10679
|
-
const
|
|
10701
|
+
const dataText = this.formatRow(this.dataText, row);
|
|
10702
|
+
const dataTextDiscrete = this.formatRow(this.dataTextDiscrete, row);
|
|
10703
|
+
return {
|
|
10704
|
+
id: row[this.dataValue],
|
|
10705
|
+
label: dataText,
|
|
10706
|
+
discreteLabel: (dataTextDiscrete || dataText),
|
|
10707
|
+
children,
|
|
10708
|
+
row,
|
|
10709
|
+
};
|
|
10710
|
+
}
|
|
10711
|
+
createChildrenNodes(rows) {
|
|
10712
|
+
const newNodes = [];
|
|
10713
|
+
rows.forEach((row) => {
|
|
10714
|
+
if (Object.keys(row).length > 0) {
|
|
10715
|
+
const newNode = this.createNodeFromRow(row);
|
|
10716
|
+
row.tree__node = newNode;
|
|
10717
|
+
newNodes.push(newNode);
|
|
10718
|
+
}
|
|
10719
|
+
});
|
|
10720
|
+
return newNodes;
|
|
10721
|
+
}
|
|
10722
|
+
formatRow(dataText, row) {
|
|
10723
|
+
const dataTextArr = Array.isArray(dataText) ? dataText : [dataText];
|
|
10680
10724
|
const dataTextNames = [];
|
|
10681
10725
|
const masks = [];
|
|
10682
10726
|
dataTextArr.forEach((text) => {
|
|
@@ -10695,7 +10739,7 @@ class SelectTree extends TextInput {
|
|
|
10695
10739
|
}
|
|
10696
10740
|
}
|
|
10697
10741
|
});
|
|
10698
|
-
const
|
|
10742
|
+
const rowText = dataTextNames.reduce((result, column, index) => {
|
|
10699
10743
|
if (row[column]) {
|
|
10700
10744
|
const separator = index > 0 ? this.dataTextSeparator : '';
|
|
10701
10745
|
let masked = row[column];
|
|
@@ -10707,23 +10751,7 @@ class SelectTree extends TextInput {
|
|
|
10707
10751
|
}
|
|
10708
10752
|
return result;
|
|
10709
10753
|
}, '');
|
|
10710
|
-
return
|
|
10711
|
-
id: row[this.dataValue],
|
|
10712
|
-
label: dataText,
|
|
10713
|
-
children,
|
|
10714
|
-
row,
|
|
10715
|
-
};
|
|
10716
|
-
}
|
|
10717
|
-
createChildrenNodes(rows) {
|
|
10718
|
-
const newNodes = [];
|
|
10719
|
-
rows.forEach((row) => {
|
|
10720
|
-
if (Object.keys(row).length > 0) {
|
|
10721
|
-
const newNode = this.createNodeFromRow(row);
|
|
10722
|
-
row.tree__node = newNode;
|
|
10723
|
-
newNodes.push(newNode);
|
|
10724
|
-
}
|
|
10725
|
-
});
|
|
10726
|
-
return newNodes;
|
|
10754
|
+
return rowText;
|
|
10727
10755
|
}
|
|
10728
10756
|
/**
|
|
10729
10757
|
* Triggered when the menu opens
|
package/dist/zd-common.umd.js
CHANGED
|
@@ -4253,10 +4253,7 @@
|
|
|
4253
4253
|
* Toggles visibility of the week numbers in the body of the calendar.
|
|
4254
4254
|
*/
|
|
4255
4255
|
this.showWeek = false;
|
|
4256
|
-
|
|
4257
|
-
* Character that will separate the two dates
|
|
4258
|
-
*/
|
|
4259
|
-
this.splitter = ' ~ ';
|
|
4256
|
+
this.internalSplitter = ' ~ ';
|
|
4260
4257
|
/**
|
|
4261
4258
|
* Width of the picker.
|
|
4262
4259
|
*/
|
|
@@ -4295,7 +4292,7 @@
|
|
|
4295
4292
|
this.scrollable = this.getInitValue('scrollable', props.scrollable, this.scrollable);
|
|
4296
4293
|
this.showDatePicker = this.getInitValue('showDatePicker', props.showDatePicker, this.showDatePicker);
|
|
4297
4294
|
this.showWeek = this.getInitValue('showWeek', props.showWeek, this.showWeek);
|
|
4298
|
-
this.splitter = this.getInitValue('splitter', props.splitter, this.
|
|
4295
|
+
this.splitter = this.getInitValue('splitter', props.splitter, this.internalSplitter);
|
|
4299
4296
|
this.width = this.getInitValue('width', props.width, this.width);
|
|
4300
4297
|
this.mask = this.getInitValue('mask', props.mask, undefined);
|
|
4301
4298
|
this.helperOptions = this.getInitValue('helperOptions', props.helperOptions, this.helperOptions);
|
|
@@ -4314,6 +4311,15 @@
|
|
|
4314
4311
|
}
|
|
4315
4312
|
};
|
|
4316
4313
|
}
|
|
4314
|
+
/**
|
|
4315
|
+
* Character that will separate the two dates
|
|
4316
|
+
*/
|
|
4317
|
+
get splitter() {
|
|
4318
|
+
return core.I18n.translate(this.internalSplitter);
|
|
4319
|
+
}
|
|
4320
|
+
set splitter(splitter) {
|
|
4321
|
+
this.internalSplitter = splitter;
|
|
4322
|
+
}
|
|
4317
4323
|
getInitialMask() {
|
|
4318
4324
|
if (isUndefined__default["default"](this.mask)) {
|
|
4319
4325
|
this.unitMask = this.inputFormat && this.maskFormat(this.inputFormat);
|
|
@@ -4351,7 +4357,7 @@
|
|
|
4351
4357
|
* Gets the updated masked, based on displayFormat if the initial mask is undefined
|
|
4352
4358
|
*/
|
|
4353
4359
|
getUpdatedMask() {
|
|
4354
|
-
if (isUndefined__default["default"](this.
|
|
4360
|
+
if (isUndefined__default["default"](this.getInitialMask())) {
|
|
4355
4361
|
return this.maskFormat(`${this.displayFormat}${this.splitter}${this.displayFormat}`);
|
|
4356
4362
|
}
|
|
4357
4363
|
return this.mask;
|
|
@@ -4482,10 +4488,10 @@
|
|
|
4482
4488
|
* Add date mask
|
|
4483
4489
|
*/
|
|
4484
4490
|
addDateMask() {
|
|
4485
|
-
if (isUndefined__default["default"](this.
|
|
4491
|
+
if (isUndefined__default["default"](this.getInitialMask()) || !this.value)
|
|
4486
4492
|
return;
|
|
4487
4493
|
setTimeout(() => {
|
|
4488
|
-
this.mask = this.
|
|
4494
|
+
this.mask = this.getInitialMask();
|
|
4489
4495
|
const firstDate = this.value[0]
|
|
4490
4496
|
? core.dayjs(this.value[0], this.dateFormat).format(this.inputFormat || this.displayFormat)
|
|
4491
4497
|
: '';
|
|
@@ -4499,7 +4505,7 @@
|
|
|
4499
4505
|
* Removes the component mask if value is valid
|
|
4500
4506
|
*/
|
|
4501
4507
|
removeDateMask() {
|
|
4502
|
-
if (isUndefined__default["default"](this.
|
|
4508
|
+
if (isUndefined__default["default"](this.getInitialMask()) || !this.value || this.dateError
|
|
4503
4509
|
|| !this.isValidDateArray(this.dateFormat, this.value)) {
|
|
4504
4510
|
return;
|
|
4505
4511
|
}
|
|
@@ -5266,6 +5272,7 @@
|
|
|
5266
5272
|
this.factoredConditions = {};
|
|
5267
5273
|
/* Action children conditions */
|
|
5268
5274
|
this.actionFactoredConditions = {};
|
|
5275
|
+
this.helperText = '';
|
|
5269
5276
|
this.defaultData = [];
|
|
5270
5277
|
this.lookup = debounce__default["default"]((lookupColumn) => {
|
|
5271
5278
|
this.loading = true;
|
|
@@ -5297,6 +5304,7 @@
|
|
|
5297
5304
|
this.componentProps = this.getInitValue('componentProps', props.componentProps, this.componentProps);
|
|
5298
5305
|
this.xlsType = this.getInitValue('xlsType', props.xlsType, this.xlsType);
|
|
5299
5306
|
this.conditions = this.getInitValue('conditions', props.conditions, this.conditions);
|
|
5307
|
+
this.helperText = this.getInitValue('', props.helperText, this.helperText);
|
|
5300
5308
|
this.createConditions();
|
|
5301
5309
|
this.createActionConditions();
|
|
5302
5310
|
if (this.componentProps.datasource) {
|
|
@@ -6371,6 +6379,7 @@
|
|
|
6371
6379
|
* @private
|
|
6372
6380
|
*/
|
|
6373
6381
|
this.invalidComponents = {};
|
|
6382
|
+
this.editingNewRows = false;
|
|
6374
6383
|
this.cancelEditedRowsKeyMapping = {
|
|
6375
6384
|
esc: {
|
|
6376
6385
|
event: this.cancelEditedRows.bind(this),
|
|
@@ -6382,6 +6391,7 @@
|
|
|
6382
6391
|
this.newRowIdentifier = '__added_row';
|
|
6383
6392
|
this.doubleClickEdit = this.getInitValue('doubleClickEdit', props.doubleClickEdit, this.doubleClickEdit);
|
|
6384
6393
|
this.canEditRow = this.getInitValue('canEditRow', props.canEditRow, this.canEditRow);
|
|
6394
|
+
this.editingNewRows = this.getInitValue('editingNewRows', props.editingNewRows, this.editingNewRows);
|
|
6385
6395
|
this.createAccessors();
|
|
6386
6396
|
}
|
|
6387
6397
|
onMounted(element) {
|
|
@@ -6847,6 +6857,9 @@
|
|
|
6847
6857
|
}
|
|
6848
6858
|
}
|
|
6849
6859
|
callCanEditRow(row) {
|
|
6860
|
+
if (this.editingNewRows) {
|
|
6861
|
+
return row[this.newRowIdentifier];
|
|
6862
|
+
}
|
|
6850
6863
|
return !this.canEditRow || typeof this.canEditRow !== 'function' || this.canEditRow({ row, component: this });
|
|
6851
6864
|
}
|
|
6852
6865
|
}
|
|
@@ -7773,7 +7786,8 @@
|
|
|
7773
7786
|
*/
|
|
7774
7787
|
blur(event, element) {
|
|
7775
7788
|
if (this.autocomplete) {
|
|
7776
|
-
|
|
7789
|
+
const isSameValue = () => this.getValue(this.datasource.data[0]) === this.value;
|
|
7790
|
+
if (this.search && this.autoSelection && this.datasource.data.length === 1 && !isSameValue()) {
|
|
7777
7791
|
this.setValue(this.datasource.data[0]);
|
|
7778
7792
|
}
|
|
7779
7793
|
this.datasource.search = '';
|
|
@@ -7787,7 +7801,7 @@
|
|
|
7787
7801
|
super.blur(event, element);
|
|
7788
7802
|
}
|
|
7789
7803
|
checkValueOnBlur() {
|
|
7790
|
-
if (!this.search) {
|
|
7804
|
+
if (!this.search && this.value !== null) {
|
|
7791
7805
|
this.setValue(null);
|
|
7792
7806
|
}
|
|
7793
7807
|
if (this.manualMode)
|
|
@@ -10026,6 +10040,9 @@
|
|
|
10026
10040
|
yield this.datasource.get();
|
|
10027
10041
|
}
|
|
10028
10042
|
this.setValue(this.datasource.data);
|
|
10043
|
+
if (!this.datasource.search) {
|
|
10044
|
+
this.setCache();
|
|
10045
|
+
}
|
|
10029
10046
|
});
|
|
10030
10047
|
}
|
|
10031
10048
|
unSelectAllItems() {
|
|
@@ -10553,6 +10570,10 @@
|
|
|
10553
10570
|
* Field used to display values
|
|
10554
10571
|
*/
|
|
10555
10572
|
this.dataText = '';
|
|
10573
|
+
/**
|
|
10574
|
+
* Field used to display values when the select is closed
|
|
10575
|
+
*/
|
|
10576
|
+
this.dataTextDiscrete = '';
|
|
10556
10577
|
/**
|
|
10557
10578
|
* Value used to join display values
|
|
10558
10579
|
*/
|
|
@@ -10607,6 +10628,7 @@
|
|
|
10607
10628
|
this.returnObject = this.getInitValue('returnObject', props.returnObject, this.returnObject);
|
|
10608
10629
|
this.parentField = this.getInitValue('parentField', props.parentField, this.parentField);
|
|
10609
10630
|
this.dataText = this.getInitValue('dataText', props.dataText, this.dataText);
|
|
10631
|
+
this.dataTextDiscrete = this.getInitValue('dataTextDiscrete', props.dataTextDiscrete, this.dataTextDiscrete);
|
|
10610
10632
|
this.dataTextSeparator = this.getInitValue('dataTextSeparator', props.dataTextSeparator, this.dataTextSeparator);
|
|
10611
10633
|
this.dataValue = this.getInitValue('dataValue', props.dataValue, this.dataValue);
|
|
10612
10634
|
this.dataDisabled = this.getInitValue('dataDisabled', props.dataDisabled, this.dataDisabled);
|
|
@@ -10683,7 +10705,29 @@
|
|
|
10683
10705
|
children = undefined;
|
|
10684
10706
|
}
|
|
10685
10707
|
}
|
|
10686
|
-
const
|
|
10708
|
+
const dataText = this.formatRow(this.dataText, row);
|
|
10709
|
+
const dataTextDiscrete = this.formatRow(this.dataTextDiscrete, row);
|
|
10710
|
+
return {
|
|
10711
|
+
id: row[this.dataValue],
|
|
10712
|
+
label: dataText,
|
|
10713
|
+
discreteLabel: (dataTextDiscrete || dataText),
|
|
10714
|
+
children,
|
|
10715
|
+
row,
|
|
10716
|
+
};
|
|
10717
|
+
}
|
|
10718
|
+
createChildrenNodes(rows) {
|
|
10719
|
+
const newNodes = [];
|
|
10720
|
+
rows.forEach((row) => {
|
|
10721
|
+
if (Object.keys(row).length > 0) {
|
|
10722
|
+
const newNode = this.createNodeFromRow(row);
|
|
10723
|
+
row.tree__node = newNode;
|
|
10724
|
+
newNodes.push(newNode);
|
|
10725
|
+
}
|
|
10726
|
+
});
|
|
10727
|
+
return newNodes;
|
|
10728
|
+
}
|
|
10729
|
+
formatRow(dataText, row) {
|
|
10730
|
+
const dataTextArr = Array.isArray(dataText) ? dataText : [dataText];
|
|
10687
10731
|
const dataTextNames = [];
|
|
10688
10732
|
const masks = [];
|
|
10689
10733
|
dataTextArr.forEach((text) => {
|
|
@@ -10702,7 +10746,7 @@
|
|
|
10702
10746
|
}
|
|
10703
10747
|
}
|
|
10704
10748
|
});
|
|
10705
|
-
const
|
|
10749
|
+
const rowText = dataTextNames.reduce((result, column, index) => {
|
|
10706
10750
|
if (row[column]) {
|
|
10707
10751
|
const separator = index > 0 ? this.dataTextSeparator : '';
|
|
10708
10752
|
let masked = row[column];
|
|
@@ -10714,23 +10758,7 @@
|
|
|
10714
10758
|
}
|
|
10715
10759
|
return result;
|
|
10716
10760
|
}, '');
|
|
10717
|
-
return
|
|
10718
|
-
id: row[this.dataValue],
|
|
10719
|
-
label: dataText,
|
|
10720
|
-
children,
|
|
10721
|
-
row,
|
|
10722
|
-
};
|
|
10723
|
-
}
|
|
10724
|
-
createChildrenNodes(rows) {
|
|
10725
|
-
const newNodes = [];
|
|
10726
|
-
rows.forEach((row) => {
|
|
10727
|
-
if (Object.keys(row).length > 0) {
|
|
10728
|
-
const newNode = this.createNodeFromRow(row);
|
|
10729
|
-
row.tree__node = newNode;
|
|
10730
|
-
newNodes.push(newNode);
|
|
10731
|
-
}
|
|
10732
|
-
});
|
|
10733
|
-
return newNodes;
|
|
10761
|
+
return rowText;
|
|
10734
10762
|
}
|
|
10735
10763
|
/**
|
|
10736
10764
|
* Triggered when the menu opens
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeedhi/common",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.88.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": "b9e30e705a88fa882c1fbdf140c15cc7c47c7c87"
|
|
47
47
|
}
|
|
@@ -48,7 +48,9 @@ export declare class DateRange extends TextInput implements IDateRange {
|
|
|
48
48
|
/**
|
|
49
49
|
* Character that will separate the two dates
|
|
50
50
|
*/
|
|
51
|
-
splitter: string;
|
|
51
|
+
get splitter(): string;
|
|
52
|
+
set splitter(splitter: string);
|
|
53
|
+
private internalSplitter;
|
|
52
54
|
/**
|
|
53
55
|
* Width of the picker.
|
|
54
56
|
*/
|
|
@@ -40,6 +40,7 @@ export declare class GridEditable extends Grid implements IGridEditable {
|
|
|
40
40
|
* @private
|
|
41
41
|
*/
|
|
42
42
|
private invalidComponents;
|
|
43
|
+
editingNewRows: boolean;
|
|
43
44
|
protected cancelEditedRowsKeyMapping: any;
|
|
44
45
|
constructor(props: IGridEditable);
|
|
45
46
|
onMounted(element: any): void;
|
|
@@ -190,5 +191,5 @@ export declare class GridEditable extends Grid implements IGridEditable {
|
|
|
190
191
|
* @param value Value to be set in the cell
|
|
191
192
|
*/
|
|
192
193
|
private changeCell;
|
|
193
|
-
callCanEditRow(row: IDictionary<any>):
|
|
194
|
+
callCanEditRow(row: IDictionary<any>): any;
|
|
194
195
|
}
|
|
@@ -40,6 +40,7 @@ export declare class Column extends Component implements IColumn {
|
|
|
40
40
|
* Method to get the current column width, assigned by view layer.
|
|
41
41
|
*/
|
|
42
42
|
private viewGetWidth?;
|
|
43
|
+
helperText: string;
|
|
43
44
|
protected defaultData: IDictionary[];
|
|
44
45
|
/**
|
|
45
46
|
* Creates a new Column.
|
|
@@ -4,6 +4,7 @@ import { SelectTree } from './select-tree';
|
|
|
4
4
|
export interface ISelectTreeNode<T> {
|
|
5
5
|
id: string | number;
|
|
6
6
|
label: string;
|
|
7
|
+
discreteLabel?: string;
|
|
7
8
|
isDisabled?: boolean;
|
|
8
9
|
isDefaultExpanded?: boolean;
|
|
9
10
|
children?: ISelectTreeNode<T>[] | null;
|
|
@@ -27,6 +28,7 @@ export interface ISelectTree extends IComponentRender {
|
|
|
27
28
|
parentField?: string;
|
|
28
29
|
dataValue?: string;
|
|
29
30
|
dataText?: string | any[];
|
|
31
|
+
dataTextDiscrete?: string | any[];
|
|
30
32
|
dataDisabled?: string;
|
|
31
33
|
disabledItems?: any[];
|
|
32
34
|
fetchOnDemand?: boolean;
|
|
@@ -60,6 +60,10 @@ export declare class SelectTree extends TextInput implements ISelectTree {
|
|
|
60
60
|
* Field used to display values
|
|
61
61
|
*/
|
|
62
62
|
dataText: string | any[];
|
|
63
|
+
/**
|
|
64
|
+
* Field used to display values when the select is closed
|
|
65
|
+
*/
|
|
66
|
+
dataTextDiscrete: string | any[];
|
|
63
67
|
/**
|
|
64
68
|
* Value used to join display values
|
|
65
69
|
*/
|
|
@@ -115,6 +119,7 @@ export declare class SelectTree extends TextInput implements ISelectTree {
|
|
|
115
119
|
createNodesFromDatasource(buildTree?: boolean): void;
|
|
116
120
|
private createNodeFromRow;
|
|
117
121
|
private createChildrenNodes;
|
|
122
|
+
private formatRow;
|
|
118
123
|
/**
|
|
119
124
|
* Triggered when the menu opens
|
|
120
125
|
*/
|