@zeedhi/common 1.79.0 → 1.80.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.
@@ -1,5 +1,6 @@
1
- import { AccessorManager, Event, KeyMap, Metadata, Accessor, I18n, FormatterParserProvider, Validation, Mask, DatasourceFactory, MethodNotAssignedError, Loader, Config, dayjs, DateHelper, Utils, Router, InstanceNotFoundError, Cookie, Http, URL as URL$1, VersionService } from '@zeedhi/core';
1
+ import { AccessorManager, Event, KeyMap, Metadata, Accessor, I18n, FormatterParserProvider, Validation, Mask, DatasourceFactory, MethodNotAssignedError, Loader, Config, dayjs, Utils, DateHelper, Router, InstanceNotFoundError, MemoryDatasource, Cookie, Http, URL as URL$1, VersionService } from '@zeedhi/core';
2
2
  import merge from 'lodash.merge';
3
+ import cloneDeep from 'lodash.clonedeep';
3
4
  import debounce from 'lodash.debounce';
4
5
  import isUndefined from 'lodash.isundefined';
5
6
  import set from 'lodash.set';
@@ -526,6 +527,7 @@ class ApexChart extends ComponentRender {
526
527
  },
527
528
  },
528
529
  };
530
+ this.drillHistory = [];
529
531
  this.chartType = this.getInitValue('chartType', props.chartType, this.chartType);
530
532
  this.options = merge(this.defaultOptions, this.getInitValue('options', this.translateOptions(props.options), this.options));
531
533
  this.series = this.getInitValue('series', this.translateSeries(props.series), this.series);
@@ -625,7 +627,11 @@ class ApexChart extends ComponentRender {
625
627
  */
626
628
  updateChart(options) {
627
629
  merge(this.options, options);
630
+ if (options.labels) {
631
+ this.options.labels = options.labels;
632
+ }
628
633
  if (options.series) {
634
+ this.options.series = options.series;
629
635
  this.series = this.options.series;
630
636
  }
631
637
  if (this.viewUpdate) {
@@ -879,6 +885,20 @@ class ApexChart extends ComponentRender {
879
885
  }
880
886
  return newOptions;
881
887
  }
888
+ drillDown(options) {
889
+ this.drillHistory.push(cloneDeep(this.options));
890
+ return new Promise((resolve) => {
891
+ setTimeout(() => {
892
+ resolve(this.updateChart(options));
893
+ }, 200);
894
+ });
895
+ }
896
+ drillUp() {
897
+ if (this.drillHistory.length === 0)
898
+ return Promise.resolve();
899
+ const options = this.drillHistory.pop();
900
+ return this.updateChart(options);
901
+ }
882
902
  }
883
903
 
884
904
  /**
@@ -3726,6 +3746,14 @@ class Date$1 extends TextInput {
3726
3746
  * Helper value.
3727
3747
  */
3728
3748
  this.helperValue = '';
3749
+ /**
3750
+ * Max value allowed.
3751
+ */
3752
+ this.max = '';
3753
+ /**
3754
+ * Min value allowed.
3755
+ */
3756
+ this.min = '';
3729
3757
  /**
3730
3758
  * Width of the picker.
3731
3759
  */
@@ -3753,6 +3781,8 @@ class Date$1 extends TextInput {
3753
3781
  this.pickerType = this.getInitValue('pickerType', props.pickerType, this.pickerType);
3754
3782
  this.helperOptions = this.getInitValue('helperOptions', props.helperOptions, this.helperOptions);
3755
3783
  this.helperValue = this.getInitValue('helperValue', props.helperValue, this.helperValue);
3784
+ this.min = this.getInitValue('min', props.min, this.min);
3785
+ this.max = this.getInitValue('max', props.max, this.max);
3756
3786
  this.width = this.getInitValue('width', props.width, this.width);
3757
3787
  this.mask = this.getInitValue('mask', props.mask, undefined);
3758
3788
  this.createAccessors();
@@ -3836,6 +3866,28 @@ class Date$1 extends TextInput {
3836
3866
  this.value = this.internalValue; // forces value accessor to be called if necessary
3837
3867
  }
3838
3868
  isValidDate(value, format, strict = true) {
3869
+ const date = dayjs(value, format, strict);
3870
+ const isValidFormat = date.isValid();
3871
+ if (!isValidFormat)
3872
+ return false;
3873
+ const minDate = this.min ? dayjs(this.min, this.dateFormat) : null;
3874
+ const isValidMin = !minDate || date.isAfter(minDate) || date.isSame(minDate);
3875
+ if (!isValidMin)
3876
+ return false;
3877
+ const maxDate = this.max ? dayjs(this.max, this.dateFormat) : null;
3878
+ const isValidMax = !maxDate || date.isBefore(maxDate) || date.isSame(maxDate);
3879
+ if (!isValidMax)
3880
+ return false;
3881
+ const isAllowedDate = this.allowedDates === undefined
3882
+ || (this.allowedDates instanceof Function
3883
+ && this.allowedDates(dayjs(value, format).format(this.dateFormat)))
3884
+ || (Array.isArray(this.allowedDates)
3885
+ && this.allowedDates.indexOf(dayjs(value, format).format(this.dateFormat)) !== -1);
3886
+ if (!isAllowedDate)
3887
+ return false;
3888
+ return true;
3889
+ }
3890
+ isValidFormatDate(value, format, strict = true) {
3839
3891
  return dayjs(value, format, strict).isValid();
3840
3892
  }
3841
3893
  get isoValue() {
@@ -3849,13 +3901,13 @@ class Date$1 extends TextInput {
3849
3901
  this.change(this.value);
3850
3902
  }
3851
3903
  formatISODateValue(value) {
3852
- if (value && this.isValidDate(value, this.dateFormat)) {
3904
+ if (value && this.isValidFormatDate(value, this.dateFormat)) {
3853
3905
  return dayjs(value, this.dateFormat).format(this.isoFormat);
3854
3906
  }
3855
3907
  return '';
3856
3908
  }
3857
3909
  parseISODateValue(value) {
3858
- if (value && this.isValidDate(value, this.isoFormat)) {
3910
+ if (value && this.isValidFormatDate(value, this.isoFormat)) {
3859
3911
  return dayjs(value, this.isoFormat).format(this.dateFormat);
3860
3912
  }
3861
3913
  return null;
@@ -3874,7 +3926,9 @@ class Date$1 extends TextInput {
3874
3926
  this.removeDateMask();
3875
3927
  this.setDateValue(this.formatter(this.value));
3876
3928
  super.blur(event, element);
3877
- this.showDatePicker = false;
3929
+ if (!Utils.isMobile()) {
3930
+ this.showDatePicker = false;
3931
+ }
3878
3932
  }
3879
3933
  focus(event, element) {
3880
3934
  this.addDateMask();
@@ -4078,6 +4132,14 @@ class DateRange extends TextInput {
4078
4132
  * Helper options.
4079
4133
  */
4080
4134
  this.helperOptions = [];
4135
+ /**
4136
+ * Max value allowed.
4137
+ */
4138
+ this.max = '';
4139
+ /**
4140
+ * Min value allowed.
4141
+ */
4142
+ this.min = '';
4081
4143
  /**
4082
4144
  * Helper value.
4083
4145
  */
@@ -4105,6 +4167,8 @@ class DateRange extends TextInput {
4105
4167
  this.mask = this.getInitValue('mask', props.mask, undefined);
4106
4168
  this.helperOptions = this.getInitValue('helperOptions', props.helperOptions, this.helperOptions);
4107
4169
  this.helperValue = this.getInitValue('helperValue', props.helperValue, this.helperValue);
4170
+ this.min = this.getInitValue('min', props.min, this.min);
4171
+ this.max = this.getInitValue('max', props.max, this.max);
4108
4172
  this.createAccessors();
4109
4173
  this.unitMask = this.mask;
4110
4174
  this.initialMask = this.getInitialMask();
@@ -4201,6 +4265,21 @@ class DateRange extends TextInput {
4201
4265
  return [value];
4202
4266
  }
4203
4267
  isValidDate(value, format, strict = true) {
4268
+ const date = dayjs(value, format, strict);
4269
+ const isValidFormat = date.isValid();
4270
+ if (!isValidFormat)
4271
+ return false;
4272
+ const minDate = this.min ? dayjs(this.min, this.dateFormat) : null;
4273
+ const isValidMin = !minDate || date.isAfter(minDate) || date.isSame(minDate);
4274
+ if (!isValidMin)
4275
+ return false;
4276
+ const maxDate = this.max ? dayjs(this.max, this.dateFormat) : null;
4277
+ const isValidMax = !maxDate || date.isBefore(maxDate) || date.isSame(maxDate);
4278
+ if (!isValidMax)
4279
+ return false;
4280
+ return true;
4281
+ }
4282
+ isValidFormatDate(value, format, strict = true) {
4204
4283
  return dayjs(value, format, strict).isValid();
4205
4284
  }
4206
4285
  get isoRangeValue() {
@@ -4221,7 +4300,7 @@ class DateRange extends TextInput {
4221
4300
  splitedValue = this.splitValues(dates);
4222
4301
  const formattedValue = [];
4223
4302
  splitedValue.forEach((value) => {
4224
- if (value && this.isValidDate(value, this.dateFormat)) {
4303
+ if (value && this.isValidFormatDate(value, this.dateFormat)) {
4225
4304
  formattedValue.push(dayjs(value, this.dateFormat, true).format(this.isoFormat));
4226
4305
  }
4227
4306
  });
@@ -4231,7 +4310,7 @@ class DateRange extends TextInput {
4231
4310
  const parsedValue = [];
4232
4311
  if (values.length) {
4233
4312
  values.forEach((value) => {
4234
- if (value && this.isValidDate(value, this.isoFormat)) {
4313
+ if (value && this.isValidFormatDate(value, this.isoFormat)) {
4235
4314
  parsedValue.push(dayjs(value, this.isoFormat, true).format(this.dateFormat));
4236
4315
  }
4237
4316
  });
@@ -4257,6 +4336,8 @@ class DateRange extends TextInput {
4257
4336
  this.removeDateMask();
4258
4337
  this.setDateValue(this.formatter(this.value));
4259
4338
  super.blur(event, element);
4339
+ }
4340
+ if (!Utils.isMobile()) {
4260
4341
  this.showDatePicker = false;
4261
4342
  }
4262
4343
  }
@@ -4890,6 +4971,7 @@ class Frame extends ComponentRender {
4890
4971
  overrideNamedPropsFunc(metadata) {
4891
4972
  let strMetadata = JSON.stringify(metadata);
4892
4973
  Object.keys(this.overrideNamedProps).forEach((key) => {
4974
+ strMetadata = strMetadata.replace(RegExp(`"<<${key}>>"`, 'g'), JSON.stringify(this.overrideNamedProps[key]));
4893
4975
  strMetadata = strMetadata.replace(RegExp(`<<${key}>>`, 'g'), this.overrideNamedProps[key]);
4894
4976
  });
4895
4977
  return JSON.parse(strMetadata);
@@ -6501,7 +6583,13 @@ class GridEditable extends Grid {
6501
6583
  */
6502
6584
  addNewRow(row, position = 'end') {
6503
6585
  return __awaiter(this, void 0, void 0, function* () {
6504
- const { data } = this.datasource;
6586
+ let data;
6587
+ if (this.datasource instanceof MemoryDatasource) {
6588
+ data = this.datasource.allData;
6589
+ }
6590
+ else {
6591
+ data = this.datasource.data;
6592
+ }
6505
6593
  row[this.newRowIdentifier] = true;
6506
6594
  if (position === 'start') {
6507
6595
  data.unshift(row);
@@ -7114,6 +7202,10 @@ class Select extends TextInput {
7114
7202
  * Defines if data handling should be manual or automatic
7115
7203
  */
7116
7204
  this.manualMode = false;
7205
+ /**
7206
+ * Specifies which DOM element that this component should detach to.
7207
+ */
7208
+ this.attach = false;
7117
7209
  /**
7118
7210
  * Defines if data handling should be manual or automatic
7119
7211
  */
@@ -7158,6 +7250,7 @@ class Select extends TextInput {
7158
7250
  this.autocomplete = this.getInitValue('autocomplete', props.autocomplete, this.autocomplete);
7159
7251
  this.disabledItems = this.getInitValue('disabledItems', props.disabledItems, this.disabledItems);
7160
7252
  this.manualMode = this.getInitValue('manualMode', props.manualMode, this.manualMode);
7253
+ this.attach = this.getInitValue('attach', props.attach, this.attach);
7161
7254
  this.searchParam = this.getInitValue('searchParam', props.searchParam, this.searchParam);
7162
7255
  if (((_a = props.datasource) === null || _a === void 0 ? void 0 : _a.type) === 'simple') {
7163
7256
  this.dataValue = 'value';
@@ -9800,11 +9893,13 @@ class TreeDataStructure {
9800
9893
  * Stores tree structure
9801
9894
  */
9802
9895
  this.treeStructure = {};
9896
+ this.fieldHasChild = '';
9803
9897
  this.searchValue = '';
9804
9898
  this.originalDatasource = tree.datasource;
9805
9899
  this.parentField = tree.parentField;
9806
9900
  this.fetchOnDemand = tree.fetchOnDemand;
9807
9901
  this.openLevelOnLoad = tree.openLevelOnLoad;
9902
+ this.fieldHasChild = tree.fieldHasChild;
9808
9903
  this.tree = tree;
9809
9904
  this.init();
9810
9905
  }
@@ -10166,6 +10261,33 @@ class TreeDataStructure {
10166
10261
  });
10167
10262
  return result;
10168
10263
  }
10264
+ /**
10265
+ * Checks if a row has async children that are yet to be loaded
10266
+ * @param row
10267
+ * @returns `false` if the row has no children to be loaded, `true` if it does or if fieldHasChild is not defined
10268
+ */
10269
+ hasChildOnDemand(row) {
10270
+ if (!this.fieldHasChild)
10271
+ return true;
10272
+ const rowHasChild = row[this.fieldHasChild];
10273
+ let isVisibleChevron = true;
10274
+ switch (rowHasChild) {
10275
+ case '0':
10276
+ case false:
10277
+ case 0:
10278
+ isVisibleChevron = false;
10279
+ break;
10280
+ case '1':
10281
+ case true:
10282
+ case 1:
10283
+ isVisibleChevron = true;
10284
+ break;
10285
+ default:
10286
+ isVisibleChevron = true;
10287
+ break;
10288
+ }
10289
+ return isVisibleChevron;
10290
+ }
10169
10291
  }
10170
10292
 
10171
10293
  /**
@@ -10258,6 +10380,10 @@ class SelectTree extends TextInput {
10258
10380
  * Uses delayed loading to load tree branches
10259
10381
  */
10260
10382
  this.fetchOnDemand = false;
10383
+ /**
10384
+ * Defines if the node tree has child
10385
+ */
10386
+ this.fieldHasChild = '';
10261
10387
  this.savedNodes = undefined;
10262
10388
  this.nodes = this.getInitValue('nodes', props.nodes, this.nodes);
10263
10389
  this.alwaysOpen = this.getInitValue('alwaysOpen', props.alwaysOpen, this.alwaysOpen);
@@ -10278,6 +10404,7 @@ class SelectTree extends TextInput {
10278
10404
  this.disabledItems = this.getInitValue('disabledItems', props.disabledItems, this.disabledItems);
10279
10405
  this.preventLoadOnFocus = this.getInitValue('preventLoadOnFocus', props.preventLoadOnFocus, this.preventLoadOnFocus);
10280
10406
  this.fetchOnDemand = this.getInitValue('fetchOnDemand', props.fetchOnDemand, this.fetchOnDemand);
10407
+ this.fieldHasChild = this.getInitValue('fieldHasChild', props.fieldHasChild, this.fieldHasChild);
10281
10408
  this.menuMaxWidth = this.getInitValue('menuMaxWidth', props.menuMaxWidth, this.menuMaxWidth);
10282
10409
  if (props.datasource && Object.keys(props.datasource).length) {
10283
10410
  this.lazyLoad = props.datasource.lazyLoad !== false;
@@ -10316,6 +10443,7 @@ class SelectTree extends TextInput {
10316
10443
  parentField: this.parentField,
10317
10444
  openLevelOnLoad: false,
10318
10445
  fetchOnDemand: this.fetchOnDemand,
10446
+ fieldHasChild: this.fieldHasChild,
10319
10447
  });
10320
10448
  if (!this.lazyLoad) {
10321
10449
  this.datasource.get().then(() => { this.createNodesFromDatasource(false); });
@@ -10446,7 +10574,14 @@ class SelectTree extends TextInput {
10446
10574
  return this.disabledItems.indexOf(node.id) !== -1;
10447
10575
  }
10448
10576
  getDisabledNodes(nodes) {
10449
- return nodes.map((node) => (Object.assign(Object.assign({}, node), { isDisabled: this.isDisable(node), children: node.children ? this.getDisabledNodes(node.children) : node.children })));
10577
+ return nodes.map((node) => (Object.assign(Object.assign({}, node), { isDisabled: this.isDisable(node), children: this.getNodeChildren(node) })));
10578
+ }
10579
+ getNodeChildren(node) {
10580
+ if (node.children)
10581
+ return this.getDisabledNodes(node.children);
10582
+ if (!this.fieldHasChild || !this.treeDataStructure)
10583
+ return node.children;
10584
+ return node.row && this.treeDataStructure.hasChildOnDemand(node.row) ? null : undefined;
10450
10585
  }
10451
10586
  getNodes() {
10452
10587
  return this.getDisabledNodes(this.nodes);
@@ -10464,6 +10599,9 @@ class SelectTree extends TextInput {
10464
10599
  });
10465
10600
  return !hasError;
10466
10601
  }
10602
+ resetValidation() {
10603
+ this.validationError = '';
10604
+ }
10467
10605
  /**
10468
10606
  * Triggered when the data is inputed.
10469
10607
  * @param value search value
@@ -11108,12 +11246,17 @@ class Tabs extends ComponentRender {
11108
11246
  * Set component height to fill all space available
11109
11247
  */
11110
11248
  this.fillHeight = false;
11249
+ /**
11250
+ * Disable touch support.
11251
+ */
11252
+ this.touchless = false;
11111
11253
  this.tabs = this.getTabs(props.tabs || []);
11112
11254
  this.activeTab = this.getInitValue('activeTab', props.activeTab, this.activeTabValue);
11113
11255
  this.height = this.getInitValue('height', props.height, this.height);
11114
11256
  this.minHeight = this.getInitValue('minHeight', props.minHeight, this.minHeight);
11115
11257
  this.maxHeight = this.getInitValue('maxHeight', props.maxHeight, this.maxHeight);
11116
11258
  this.fillHeight = this.getInitValue('fillHeight', props.fillHeight, this.fillHeight);
11259
+ this.touchless = this.getInitValue('touchless', props.touchless, this.touchless);
11117
11260
  this.createAccessors();
11118
11261
  }
11119
11262
  get activeTab() {
@@ -11219,6 +11362,7 @@ class Text extends ComponentRender {
11219
11362
  this.compile = props.compile === true;
11220
11363
  this.tag = this.getInitValue('tag', props.tag, this.tag);
11221
11364
  this.text = this.getInitValue('text', props.text, this.text);
11365
+ this.textResize = this.getInitValue('textResize', props.textResize, this.textResize);
11222
11366
  this.createAccessors();
11223
11367
  }
11224
11368
  }
@@ -11577,7 +11721,6 @@ class Time extends TextInput {
11577
11721
  this.removeTimeMask();
11578
11722
  this.setTimeValue(this.formatter(this.value));
11579
11723
  super.blur(event, element);
11580
- this.showTimePicker = false;
11581
11724
  }
11582
11725
  focus(event, element) {
11583
11726
  this.addTimeMask();
@@ -12926,6 +13069,8 @@ class Icons {
12926
13069
  }
12927
13070
  Icons.mdiIcons = {
12928
13071
  alertOctagon: 'mdi-alert-octagon',
13072
+ arrowLeft: 'mdi-arrow-left',
13073
+ arrowRight: 'mdi-arrow-right',
12929
13074
  cancel: 'mdi-close-circle',
12930
13075
  calendar: 'mdi-calendar',
12931
13076
  checkboxIndeterminate: 'mdi-minus-box',
@@ -12983,6 +13128,8 @@ Icons.mdiIcons = {
12983
13128
  };
12984
13129
  Icons.faIcons = {
12985
13130
  alertOctagon: 'fa fa-exclamation-circle',
13131
+ arrowLeft: 'fa fa-arrow-left',
13132
+ arrowRight: 'fa fa-arrow-right',
12986
13133
  cancel: 'fa fa-times-circle',
12987
13134
  calendar: 'fa fa-calendar-o',
12988
13135
  checkboxIndeterminate: 'fa fa-minus-square',
@@ -1,12 +1,13 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@zeedhi/core'), require('lodash.merge'), require('lodash.debounce'), require('lodash.isundefined'), require('lodash.set'), require('lodash.get')) :
3
- typeof define === 'function' && define.amd ? define(['exports', '@zeedhi/core', 'lodash.merge', 'lodash.debounce', 'lodash.isundefined', 'lodash.set', 'lodash.get'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["@zeedhi/common"] = {}, global.core, global.merge, global.debounce, global.isUndefined, global.set, global.get));
5
- })(this, (function (exports, core, merge, debounce, isUndefined, set, get) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@zeedhi/core'), require('lodash.merge'), require('lodash.clonedeep'), require('lodash.debounce'), require('lodash.isundefined'), require('lodash.set'), require('lodash.get')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', '@zeedhi/core', 'lodash.merge', 'lodash.clonedeep', 'lodash.debounce', 'lodash.isundefined', 'lodash.set', 'lodash.get'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["@zeedhi/common"] = {}, global.core, global.merge, global.cloneDeep, global.debounce, global.isUndefined, global.set, global.get));
5
+ })(this, (function (exports, core, merge, cloneDeep, debounce, isUndefined, set, get) { 'use strict';
6
6
 
7
7
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
8
 
9
9
  var merge__default = /*#__PURE__*/_interopDefaultLegacy(merge);
10
+ var cloneDeep__default = /*#__PURE__*/_interopDefaultLegacy(cloneDeep);
10
11
  var debounce__default = /*#__PURE__*/_interopDefaultLegacy(debounce);
11
12
  var isUndefined__default = /*#__PURE__*/_interopDefaultLegacy(isUndefined);
12
13
  var set__default = /*#__PURE__*/_interopDefaultLegacy(set);
@@ -533,6 +534,7 @@
533
534
  },
534
535
  },
535
536
  };
537
+ this.drillHistory = [];
536
538
  this.chartType = this.getInitValue('chartType', props.chartType, this.chartType);
537
539
  this.options = merge__default["default"](this.defaultOptions, this.getInitValue('options', this.translateOptions(props.options), this.options));
538
540
  this.series = this.getInitValue('series', this.translateSeries(props.series), this.series);
@@ -632,7 +634,11 @@
632
634
  */
633
635
  updateChart(options) {
634
636
  merge__default["default"](this.options, options);
637
+ if (options.labels) {
638
+ this.options.labels = options.labels;
639
+ }
635
640
  if (options.series) {
641
+ this.options.series = options.series;
636
642
  this.series = this.options.series;
637
643
  }
638
644
  if (this.viewUpdate) {
@@ -886,6 +892,20 @@
886
892
  }
887
893
  return newOptions;
888
894
  }
895
+ drillDown(options) {
896
+ this.drillHistory.push(cloneDeep__default["default"](this.options));
897
+ return new Promise((resolve) => {
898
+ setTimeout(() => {
899
+ resolve(this.updateChart(options));
900
+ }, 200);
901
+ });
902
+ }
903
+ drillUp() {
904
+ if (this.drillHistory.length === 0)
905
+ return Promise.resolve();
906
+ const options = this.drillHistory.pop();
907
+ return this.updateChart(options);
908
+ }
889
909
  }
890
910
 
891
911
  /**
@@ -3733,6 +3753,14 @@
3733
3753
  * Helper value.
3734
3754
  */
3735
3755
  this.helperValue = '';
3756
+ /**
3757
+ * Max value allowed.
3758
+ */
3759
+ this.max = '';
3760
+ /**
3761
+ * Min value allowed.
3762
+ */
3763
+ this.min = '';
3736
3764
  /**
3737
3765
  * Width of the picker.
3738
3766
  */
@@ -3760,6 +3788,8 @@
3760
3788
  this.pickerType = this.getInitValue('pickerType', props.pickerType, this.pickerType);
3761
3789
  this.helperOptions = this.getInitValue('helperOptions', props.helperOptions, this.helperOptions);
3762
3790
  this.helperValue = this.getInitValue('helperValue', props.helperValue, this.helperValue);
3791
+ this.min = this.getInitValue('min', props.min, this.min);
3792
+ this.max = this.getInitValue('max', props.max, this.max);
3763
3793
  this.width = this.getInitValue('width', props.width, this.width);
3764
3794
  this.mask = this.getInitValue('mask', props.mask, undefined);
3765
3795
  this.createAccessors();
@@ -3843,6 +3873,28 @@
3843
3873
  this.value = this.internalValue; // forces value accessor to be called if necessary
3844
3874
  }
3845
3875
  isValidDate(value, format, strict = true) {
3876
+ const date = core.dayjs(value, format, strict);
3877
+ const isValidFormat = date.isValid();
3878
+ if (!isValidFormat)
3879
+ return false;
3880
+ const minDate = this.min ? core.dayjs(this.min, this.dateFormat) : null;
3881
+ const isValidMin = !minDate || date.isAfter(minDate) || date.isSame(minDate);
3882
+ if (!isValidMin)
3883
+ return false;
3884
+ const maxDate = this.max ? core.dayjs(this.max, this.dateFormat) : null;
3885
+ const isValidMax = !maxDate || date.isBefore(maxDate) || date.isSame(maxDate);
3886
+ if (!isValidMax)
3887
+ return false;
3888
+ const isAllowedDate = this.allowedDates === undefined
3889
+ || (this.allowedDates instanceof Function
3890
+ && this.allowedDates(core.dayjs(value, format).format(this.dateFormat)))
3891
+ || (Array.isArray(this.allowedDates)
3892
+ && this.allowedDates.indexOf(core.dayjs(value, format).format(this.dateFormat)) !== -1);
3893
+ if (!isAllowedDate)
3894
+ return false;
3895
+ return true;
3896
+ }
3897
+ isValidFormatDate(value, format, strict = true) {
3846
3898
  return core.dayjs(value, format, strict).isValid();
3847
3899
  }
3848
3900
  get isoValue() {
@@ -3856,13 +3908,13 @@
3856
3908
  this.change(this.value);
3857
3909
  }
3858
3910
  formatISODateValue(value) {
3859
- if (value && this.isValidDate(value, this.dateFormat)) {
3911
+ if (value && this.isValidFormatDate(value, this.dateFormat)) {
3860
3912
  return core.dayjs(value, this.dateFormat).format(this.isoFormat);
3861
3913
  }
3862
3914
  return '';
3863
3915
  }
3864
3916
  parseISODateValue(value) {
3865
- if (value && this.isValidDate(value, this.isoFormat)) {
3917
+ if (value && this.isValidFormatDate(value, this.isoFormat)) {
3866
3918
  return core.dayjs(value, this.isoFormat).format(this.dateFormat);
3867
3919
  }
3868
3920
  return null;
@@ -3881,7 +3933,9 @@
3881
3933
  this.removeDateMask();
3882
3934
  this.setDateValue(this.formatter(this.value));
3883
3935
  super.blur(event, element);
3884
- this.showDatePicker = false;
3936
+ if (!core.Utils.isMobile()) {
3937
+ this.showDatePicker = false;
3938
+ }
3885
3939
  }
3886
3940
  focus(event, element) {
3887
3941
  this.addDateMask();
@@ -4085,6 +4139,14 @@
4085
4139
  * Helper options.
4086
4140
  */
4087
4141
  this.helperOptions = [];
4142
+ /**
4143
+ * Max value allowed.
4144
+ */
4145
+ this.max = '';
4146
+ /**
4147
+ * Min value allowed.
4148
+ */
4149
+ this.min = '';
4088
4150
  /**
4089
4151
  * Helper value.
4090
4152
  */
@@ -4112,6 +4174,8 @@
4112
4174
  this.mask = this.getInitValue('mask', props.mask, undefined);
4113
4175
  this.helperOptions = this.getInitValue('helperOptions', props.helperOptions, this.helperOptions);
4114
4176
  this.helperValue = this.getInitValue('helperValue', props.helperValue, this.helperValue);
4177
+ this.min = this.getInitValue('min', props.min, this.min);
4178
+ this.max = this.getInitValue('max', props.max, this.max);
4115
4179
  this.createAccessors();
4116
4180
  this.unitMask = this.mask;
4117
4181
  this.initialMask = this.getInitialMask();
@@ -4208,6 +4272,21 @@
4208
4272
  return [value];
4209
4273
  }
4210
4274
  isValidDate(value, format, strict = true) {
4275
+ const date = core.dayjs(value, format, strict);
4276
+ const isValidFormat = date.isValid();
4277
+ if (!isValidFormat)
4278
+ return false;
4279
+ const minDate = this.min ? core.dayjs(this.min, this.dateFormat) : null;
4280
+ const isValidMin = !minDate || date.isAfter(minDate) || date.isSame(minDate);
4281
+ if (!isValidMin)
4282
+ return false;
4283
+ const maxDate = this.max ? core.dayjs(this.max, this.dateFormat) : null;
4284
+ const isValidMax = !maxDate || date.isBefore(maxDate) || date.isSame(maxDate);
4285
+ if (!isValidMax)
4286
+ return false;
4287
+ return true;
4288
+ }
4289
+ isValidFormatDate(value, format, strict = true) {
4211
4290
  return core.dayjs(value, format, strict).isValid();
4212
4291
  }
4213
4292
  get isoRangeValue() {
@@ -4228,7 +4307,7 @@
4228
4307
  splitedValue = this.splitValues(dates);
4229
4308
  const formattedValue = [];
4230
4309
  splitedValue.forEach((value) => {
4231
- if (value && this.isValidDate(value, this.dateFormat)) {
4310
+ if (value && this.isValidFormatDate(value, this.dateFormat)) {
4232
4311
  formattedValue.push(core.dayjs(value, this.dateFormat, true).format(this.isoFormat));
4233
4312
  }
4234
4313
  });
@@ -4238,7 +4317,7 @@
4238
4317
  const parsedValue = [];
4239
4318
  if (values.length) {
4240
4319
  values.forEach((value) => {
4241
- if (value && this.isValidDate(value, this.isoFormat)) {
4320
+ if (value && this.isValidFormatDate(value, this.isoFormat)) {
4242
4321
  parsedValue.push(core.dayjs(value, this.isoFormat, true).format(this.dateFormat));
4243
4322
  }
4244
4323
  });
@@ -4264,6 +4343,8 @@
4264
4343
  this.removeDateMask();
4265
4344
  this.setDateValue(this.formatter(this.value));
4266
4345
  super.blur(event, element);
4346
+ }
4347
+ if (!core.Utils.isMobile()) {
4267
4348
  this.showDatePicker = false;
4268
4349
  }
4269
4350
  }
@@ -4897,6 +4978,7 @@
4897
4978
  overrideNamedPropsFunc(metadata) {
4898
4979
  let strMetadata = JSON.stringify(metadata);
4899
4980
  Object.keys(this.overrideNamedProps).forEach((key) => {
4981
+ strMetadata = strMetadata.replace(RegExp(`"<<${key}>>"`, 'g'), JSON.stringify(this.overrideNamedProps[key]));
4900
4982
  strMetadata = strMetadata.replace(RegExp(`<<${key}>>`, 'g'), this.overrideNamedProps[key]);
4901
4983
  });
4902
4984
  return JSON.parse(strMetadata);
@@ -6508,7 +6590,13 @@
6508
6590
  */
6509
6591
  addNewRow(row, position = 'end') {
6510
6592
  return __awaiter(this, void 0, void 0, function* () {
6511
- const { data } = this.datasource;
6593
+ let data;
6594
+ if (this.datasource instanceof core.MemoryDatasource) {
6595
+ data = this.datasource.allData;
6596
+ }
6597
+ else {
6598
+ data = this.datasource.data;
6599
+ }
6512
6600
  row[this.newRowIdentifier] = true;
6513
6601
  if (position === 'start') {
6514
6602
  data.unshift(row);
@@ -7121,6 +7209,10 @@
7121
7209
  * Defines if data handling should be manual or automatic
7122
7210
  */
7123
7211
  this.manualMode = false;
7212
+ /**
7213
+ * Specifies which DOM element that this component should detach to.
7214
+ */
7215
+ this.attach = false;
7124
7216
  /**
7125
7217
  * Defines if data handling should be manual or automatic
7126
7218
  */
@@ -7165,6 +7257,7 @@
7165
7257
  this.autocomplete = this.getInitValue('autocomplete', props.autocomplete, this.autocomplete);
7166
7258
  this.disabledItems = this.getInitValue('disabledItems', props.disabledItems, this.disabledItems);
7167
7259
  this.manualMode = this.getInitValue('manualMode', props.manualMode, this.manualMode);
7260
+ this.attach = this.getInitValue('attach', props.attach, this.attach);
7168
7261
  this.searchParam = this.getInitValue('searchParam', props.searchParam, this.searchParam);
7169
7262
  if (((_a = props.datasource) === null || _a === void 0 ? void 0 : _a.type) === 'simple') {
7170
7263
  this.dataValue = 'value';
@@ -9807,11 +9900,13 @@
9807
9900
  * Stores tree structure
9808
9901
  */
9809
9902
  this.treeStructure = {};
9903
+ this.fieldHasChild = '';
9810
9904
  this.searchValue = '';
9811
9905
  this.originalDatasource = tree.datasource;
9812
9906
  this.parentField = tree.parentField;
9813
9907
  this.fetchOnDemand = tree.fetchOnDemand;
9814
9908
  this.openLevelOnLoad = tree.openLevelOnLoad;
9909
+ this.fieldHasChild = tree.fieldHasChild;
9815
9910
  this.tree = tree;
9816
9911
  this.init();
9817
9912
  }
@@ -10173,6 +10268,33 @@
10173
10268
  });
10174
10269
  return result;
10175
10270
  }
10271
+ /**
10272
+ * Checks if a row has async children that are yet to be loaded
10273
+ * @param row
10274
+ * @returns `false` if the row has no children to be loaded, `true` if it does or if fieldHasChild is not defined
10275
+ */
10276
+ hasChildOnDemand(row) {
10277
+ if (!this.fieldHasChild)
10278
+ return true;
10279
+ const rowHasChild = row[this.fieldHasChild];
10280
+ let isVisibleChevron = true;
10281
+ switch (rowHasChild) {
10282
+ case '0':
10283
+ case false:
10284
+ case 0:
10285
+ isVisibleChevron = false;
10286
+ break;
10287
+ case '1':
10288
+ case true:
10289
+ case 1:
10290
+ isVisibleChevron = true;
10291
+ break;
10292
+ default:
10293
+ isVisibleChevron = true;
10294
+ break;
10295
+ }
10296
+ return isVisibleChevron;
10297
+ }
10176
10298
  }
10177
10299
 
10178
10300
  /**
@@ -10265,6 +10387,10 @@
10265
10387
  * Uses delayed loading to load tree branches
10266
10388
  */
10267
10389
  this.fetchOnDemand = false;
10390
+ /**
10391
+ * Defines if the node tree has child
10392
+ */
10393
+ this.fieldHasChild = '';
10268
10394
  this.savedNodes = undefined;
10269
10395
  this.nodes = this.getInitValue('nodes', props.nodes, this.nodes);
10270
10396
  this.alwaysOpen = this.getInitValue('alwaysOpen', props.alwaysOpen, this.alwaysOpen);
@@ -10285,6 +10411,7 @@
10285
10411
  this.disabledItems = this.getInitValue('disabledItems', props.disabledItems, this.disabledItems);
10286
10412
  this.preventLoadOnFocus = this.getInitValue('preventLoadOnFocus', props.preventLoadOnFocus, this.preventLoadOnFocus);
10287
10413
  this.fetchOnDemand = this.getInitValue('fetchOnDemand', props.fetchOnDemand, this.fetchOnDemand);
10414
+ this.fieldHasChild = this.getInitValue('fieldHasChild', props.fieldHasChild, this.fieldHasChild);
10288
10415
  this.menuMaxWidth = this.getInitValue('menuMaxWidth', props.menuMaxWidth, this.menuMaxWidth);
10289
10416
  if (props.datasource && Object.keys(props.datasource).length) {
10290
10417
  this.lazyLoad = props.datasource.lazyLoad !== false;
@@ -10323,6 +10450,7 @@
10323
10450
  parentField: this.parentField,
10324
10451
  openLevelOnLoad: false,
10325
10452
  fetchOnDemand: this.fetchOnDemand,
10453
+ fieldHasChild: this.fieldHasChild,
10326
10454
  });
10327
10455
  if (!this.lazyLoad) {
10328
10456
  this.datasource.get().then(() => { this.createNodesFromDatasource(false); });
@@ -10453,7 +10581,14 @@
10453
10581
  return this.disabledItems.indexOf(node.id) !== -1;
10454
10582
  }
10455
10583
  getDisabledNodes(nodes) {
10456
- return nodes.map((node) => (Object.assign(Object.assign({}, node), { isDisabled: this.isDisable(node), children: node.children ? this.getDisabledNodes(node.children) : node.children })));
10584
+ return nodes.map((node) => (Object.assign(Object.assign({}, node), { isDisabled: this.isDisable(node), children: this.getNodeChildren(node) })));
10585
+ }
10586
+ getNodeChildren(node) {
10587
+ if (node.children)
10588
+ return this.getDisabledNodes(node.children);
10589
+ if (!this.fieldHasChild || !this.treeDataStructure)
10590
+ return node.children;
10591
+ return node.row && this.treeDataStructure.hasChildOnDemand(node.row) ? null : undefined;
10457
10592
  }
10458
10593
  getNodes() {
10459
10594
  return this.getDisabledNodes(this.nodes);
@@ -10471,6 +10606,9 @@
10471
10606
  });
10472
10607
  return !hasError;
10473
10608
  }
10609
+ resetValidation() {
10610
+ this.validationError = '';
10611
+ }
10474
10612
  /**
10475
10613
  * Triggered when the data is inputed.
10476
10614
  * @param value search value
@@ -11115,12 +11253,17 @@
11115
11253
  * Set component height to fill all space available
11116
11254
  */
11117
11255
  this.fillHeight = false;
11256
+ /**
11257
+ * Disable touch support.
11258
+ */
11259
+ this.touchless = false;
11118
11260
  this.tabs = this.getTabs(props.tabs || []);
11119
11261
  this.activeTab = this.getInitValue('activeTab', props.activeTab, this.activeTabValue);
11120
11262
  this.height = this.getInitValue('height', props.height, this.height);
11121
11263
  this.minHeight = this.getInitValue('minHeight', props.minHeight, this.minHeight);
11122
11264
  this.maxHeight = this.getInitValue('maxHeight', props.maxHeight, this.maxHeight);
11123
11265
  this.fillHeight = this.getInitValue('fillHeight', props.fillHeight, this.fillHeight);
11266
+ this.touchless = this.getInitValue('touchless', props.touchless, this.touchless);
11124
11267
  this.createAccessors();
11125
11268
  }
11126
11269
  get activeTab() {
@@ -11226,6 +11369,7 @@
11226
11369
  this.compile = props.compile === true;
11227
11370
  this.tag = this.getInitValue('tag', props.tag, this.tag);
11228
11371
  this.text = this.getInitValue('text', props.text, this.text);
11372
+ this.textResize = this.getInitValue('textResize', props.textResize, this.textResize);
11229
11373
  this.createAccessors();
11230
11374
  }
11231
11375
  }
@@ -11584,7 +11728,6 @@
11584
11728
  this.removeTimeMask();
11585
11729
  this.setTimeValue(this.formatter(this.value));
11586
11730
  super.blur(event, element);
11587
- this.showTimePicker = false;
11588
11731
  }
11589
11732
  focus(event, element) {
11590
11733
  this.addTimeMask();
@@ -12933,6 +13076,8 @@
12933
13076
  }
12934
13077
  Icons.mdiIcons = {
12935
13078
  alertOctagon: 'mdi-alert-octagon',
13079
+ arrowLeft: 'mdi-arrow-left',
13080
+ arrowRight: 'mdi-arrow-right',
12936
13081
  cancel: 'mdi-close-circle',
12937
13082
  calendar: 'mdi-calendar',
12938
13083
  checkboxIndeterminate: 'mdi-minus-box',
@@ -12990,6 +13135,8 @@
12990
13135
  };
12991
13136
  Icons.faIcons = {
12992
13137
  alertOctagon: 'fa fa-exclamation-circle',
13138
+ arrowLeft: 'fa fa-arrow-left',
13139
+ arrowRight: 'fa fa-arrow-right',
12993
13140
  cancel: 'fa fa-times-circle',
12994
13141
  calendar: 'fa fa-calendar-o',
12995
13142
  checkboxIndeterminate: 'fa fa-minus-square',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeedhi/common",
3
- "version": "1.79.0",
3
+ "version": "1.80.0",
4
4
  "description": "Zeedhi Common",
5
5
  "author": "Zeedhi <zeedhi@teknisa.com>",
6
6
  "license": "ISC",
@@ -19,7 +19,9 @@
19
19
  "watch": "npm run build -- -w"
20
20
  },
21
21
  "dependencies": {
22
+ "@types/lodash.clonedeep": "^4.5.7",
22
23
  "@zeedhi/autonumeric": "*",
24
+ "lodash.clonedeep": "^4.5.0",
23
25
  "lodash.debounce": "4.0.*",
24
26
  "lodash.get": "4.4.*",
25
27
  "lodash.isundefined": "3.0.*",
@@ -39,5 +41,5 @@
39
41
  "lodash.times": "4.3.*",
40
42
  "mockdate": "3.0.*"
41
43
  },
42
- "gitHead": "c98be433e557f6f044b0a1f644c9b8558c389180"
44
+ "gitHead": "475e792a47bd61e8b083078ea84dbae954992339"
43
45
  }
@@ -251,4 +251,7 @@ export declare class ApexChart extends ComponentRender implements IApexChart {
251
251
  */
252
252
  brushScrolledEvent(chartContext?: any, config?: any): void;
253
253
  updateToolbarIcons(): any;
254
+ drillHistory: any[];
255
+ drillDown(options: any): Promise<unknown>;
256
+ drillUp(): Promise<any>;
254
257
  }
@@ -57,6 +57,14 @@ export declare class DateRange extends TextInput implements IDateRange {
57
57
  * Helper options.
58
58
  */
59
59
  helperOptions?: string[];
60
+ /**
61
+ * Max value allowed.
62
+ */
63
+ max?: string;
64
+ /**
65
+ * Min value allowed.
66
+ */
67
+ min?: string;
60
68
  /**
61
69
  * Helper value.
62
70
  */
@@ -91,6 +99,7 @@ export declare class DateRange extends TextInput implements IDateRange {
91
99
  isValidDateArray(format: string, values?: string[]): boolean;
92
100
  private splitValues;
93
101
  isValidDate(value: string, format: string, strict?: boolean): boolean;
102
+ isValidFormatDate(value: string, format: string, strict?: boolean): boolean;
94
103
  get isoRangeValue(): string[];
95
104
  set isoRangeValue(newValue: string[]);
96
105
  formatISODateRangeValue(dates: string[] | string): string[];
@@ -64,6 +64,14 @@ export declare class Date extends TextInput implements IDate {
64
64
  * Helper value.
65
65
  */
66
66
  helperValue?: string;
67
+ /**
68
+ * Max value allowed.
69
+ */
70
+ max?: string;
71
+ /**
72
+ * Min value allowed.
73
+ */
74
+ min?: string;
67
75
  /**
68
76
  * Width of the picker.
69
77
  */
@@ -101,6 +109,7 @@ export declare class Date extends TextInput implements IDate {
101
109
  protected maskFormat(format: string): string;
102
110
  setDateValue(displayValue: string): void;
103
111
  isValidDate(value: string, format: string, strict?: boolean): boolean;
112
+ isValidFormatDate(value: string, format: string, strict?: boolean): boolean;
104
113
  get isoValue(): string;
105
114
  set isoValue(newValue: string);
106
115
  formatISODateValue(value: string): string;
@@ -23,6 +23,8 @@ export interface IDate extends ITextInput {
23
23
  orderedDates?: boolean;
24
24
  helperOptions?: string[];
25
25
  helperValue?: string;
26
+ max?: string;
27
+ min?: string;
26
28
  }
27
29
  export interface IDateRange extends IDate {
28
30
  splitter?: string;
@@ -1,5 +1,5 @@
1
- import { IFrame, IFrameEvents } from './interfaces';
2
1
  import { ComponentRender } from '../zd-component/component-render';
2
+ import { IFrame, IFrameEvents } from './interfaces';
3
3
  /**
4
4
  * Base class for Frame component.
5
5
  */
@@ -16,5 +16,6 @@ export interface ISelect extends ITextInput {
16
16
  itemAfterSlot?: IComponentRender[];
17
17
  disabledItems?: any[];
18
18
  manualMode?: boolean;
19
+ attach?: boolean;
19
20
  searchParam?: string;
20
21
  }
@@ -66,6 +66,10 @@ export declare class Select extends TextInput implements ISelect {
66
66
  * Defines if data handling should be manual or automatic
67
67
  */
68
68
  manualMode: boolean;
69
+ /**
70
+ * Specifies which DOM element that this component should detach to.
71
+ */
72
+ attach: boolean;
69
73
  /**
70
74
  * Defines if data handling should be manual or automatic
71
75
  */
@@ -30,6 +30,7 @@ export interface ISelectTree extends IComponentRender {
30
30
  dataDisabled?: string;
31
31
  disabledItems?: any[];
32
32
  fetchOnDemand?: boolean;
33
+ fieldHasChild?: string;
33
34
  menuMaxWidth?: number;
34
35
  }
35
36
  export interface ISelectTreeCloseEvent extends IEventParam<SelectTree> {
@@ -94,6 +94,10 @@ export declare class SelectTree extends TextInput implements ISelectTree {
94
94
  */
95
95
  fetchOnDemand: boolean;
96
96
  menuMaxWidth?: number;
97
+ /**
98
+ * Defines if the node tree has child
99
+ */
100
+ fieldHasChild: string;
97
101
  /**
98
102
  * Creates a new instance of SelectTree
99
103
  * @param props
@@ -125,8 +129,10 @@ export declare class SelectTree extends TextInput implements ISelectTree {
125
129
  searchChange(searchQuery: string, element?: any): void;
126
130
  private isDisable;
127
131
  private getDisabledNodes;
132
+ private getNodeChildren;
128
133
  getNodes(): ISelectTreeNode<IDictionary>[];
129
134
  validate(): boolean;
135
+ resetValidation(): void;
130
136
  /**
131
137
  * Triggered when the data is inputed.
132
138
  * @param value search value
@@ -22,4 +22,5 @@ export interface ITabs extends IComponentRender {
22
22
  maxHeight?: number | string;
23
23
  minHeight?: number | string;
24
24
  fillHeight?: boolean;
25
+ touchless?: boolean;
25
26
  }
@@ -27,6 +27,10 @@ export declare class Tabs extends ComponentRender implements ITabs {
27
27
  * Set component height to fill all space available
28
28
  */
29
29
  fillHeight: boolean;
30
+ /**
31
+ * Disable touch support.
32
+ */
33
+ touchless: boolean;
30
34
  /**
31
35
  * Create a new Tabs.
32
36
  * @param props Tabs properties
@@ -6,4 +6,10 @@ export interface IText extends IComponentRender {
6
6
  tag?: string;
7
7
  text: string | string[];
8
8
  compile?: boolean;
9
+ textResize?: ITextResize;
10
+ }
11
+ export interface ITextResize {
12
+ fontSize?: number;
13
+ min?: number;
14
+ max?: number;
9
15
  }
@@ -1,4 +1,4 @@
1
- import { IText } from './interfaces';
1
+ import { IText, ITextResize } from './interfaces';
2
2
  import { ComponentRender } from '../zd-component/component-render';
3
3
  /**
4
4
  * Base class for Text component.
@@ -7,6 +7,7 @@ export declare class Text extends ComponentRender implements IText {
7
7
  compile: boolean;
8
8
  tag: string;
9
9
  text: string | string[];
10
+ textResize?: ITextResize;
10
11
  /**
11
12
  * Creates a new Text.
12
13
  * @param props Text properties
@@ -5,4 +5,5 @@ export interface ITreeDataStructure {
5
5
  openLevelOnLoad: number | boolean;
6
6
  fetchOnDemand: boolean;
7
7
  detach?: boolean;
8
+ fieldHasChild?: string;
8
9
  }
@@ -29,6 +29,7 @@ export declare class TreeDataStructure {
29
29
  * Stores tree structure
30
30
  */
31
31
  private treeStructure;
32
+ fieldHasChild?: string;
32
33
  /**
33
34
  * Tree component
34
35
  */
@@ -144,4 +145,10 @@ export declare class TreeDataStructure {
144
145
  * @param row datasource row
145
146
  */
146
147
  getChildren(row: IDictionary<any>): IDictionary<any>[];
148
+ /**
149
+ * Checks if a row has async children that are yet to be loaded
150
+ * @param row
151
+ * @returns `false` if the row has no children to be loaded, `true` if it does or if fieldHasChild is not defined
152
+ */
153
+ hasChildOnDemand(row: IDictionary<any>): boolean;
147
154
  }