@zeedhi/common 1.43.1 → 1.45.1
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 +302 -69
- package/dist/zd-common.umd.js +302 -69
- package/package.json +2 -2
- package/types/components/zd-button-group/button-group.d.ts +1 -1
- package/types/components/zd-carousel/carousel.d.ts +2 -2
- package/types/components/zd-carousel/interfaces.d.ts +1 -1
- package/types/components/zd-collapse-card/collapse-card.d.ts +1 -1
- package/types/components/zd-component/component.d.ts +5 -4
- package/types/components/zd-dashboard/dashboard.d.ts +1 -1
- package/types/components/zd-date/date-range.d.ts +4 -4
- package/types/components/zd-date/date.d.ts +5 -5
- package/types/components/zd-file-input/file-input.d.ts +3 -3
- package/types/components/zd-form/form.d.ts +2 -2
- package/types/components/zd-frame/frame.d.ts +1 -1
- package/types/components/zd-grid/grid-editable.d.ts +6 -6
- package/types/components/zd-grid/grid.d.ts +5 -5
- package/types/components/zd-increment/increment.d.ts +2 -2
- package/types/components/zd-input/input.d.ts +6 -6
- package/types/components/zd-iterable/column.d.ts +2 -0
- package/types/components/zd-iterable/interfaces.d.ts +1 -0
- package/types/components/zd-iterable/iterable-page-component.d.ts +1 -1
- package/types/components/zd-iterable/iterable-page-size.d.ts +2 -2
- package/types/components/zd-iterable/iterable.d.ts +1 -1
- package/types/components/zd-login/login-button.d.ts +1 -1
- package/types/components/zd-master-detail/master-detail.d.ts +1 -1
- package/types/components/zd-menu/menu-group.d.ts +8 -0
- package/types/components/zd-menu/menu-link.d.ts +5 -1
- package/types/components/zd-menu/menu.d.ts +3 -1
- package/types/components/zd-modal/interfaces.d.ts +2 -0
- package/types/components/zd-modal/modal.d.ts +8 -0
- package/types/components/zd-select/select.d.ts +6 -6
- package/types/components/zd-select-multiple/interfaces.d.ts +1 -0
- package/types/components/zd-select-multiple/select-multiple.d.ts +7 -2
- package/types/components/zd-select-tree/select-tree.d.ts +6 -6
- package/types/components/zd-select-tree-multiple/interfaces.d.ts +1 -0
- package/types/components/zd-select-tree-multiple/select-tree-multiple.d.ts +6 -2
- package/types/components/zd-selectable-list/selectable-list.d.ts +1 -1
- package/types/components/zd-svg-map/svg-map.d.ts +1 -1
- package/types/components/zd-tabs/tabs.d.ts +2 -2
- package/types/components/zd-text-input/text-input.d.ts +4 -4
- package/types/components/zd-time/time.d.ts +1 -1
- package/types/components/zd-tree/interfaces.d.ts +4 -0
- package/types/components/zd-tree/tree.d.ts +39 -11
- package/types/components/zd-tree-grid/tree-grid-editable.d.ts +6 -6
- package/types/components/zd-tree-grid/tree-grid.d.ts +2 -2
- package/types/services/zd-loading/loading-service.d.ts +7 -1
- package/types/utils/report/report-type/interfaces.d.ts +1 -0
- package/types/utils/themes/themes.d.ts +8 -2
package/dist/zd-common.umd.js
CHANGED
|
@@ -199,6 +199,7 @@
|
|
|
199
199
|
* @param element Element mounted reference
|
|
200
200
|
*/
|
|
201
201
|
onMounted(element) {
|
|
202
|
+
this.element = element;
|
|
202
203
|
if (Object.keys(this.keyMap).length) {
|
|
203
204
|
core.KeyMap.bind(this.keyMap, this, element);
|
|
204
205
|
}
|
|
@@ -226,7 +227,11 @@
|
|
|
226
227
|
* @param element Element clicked
|
|
227
228
|
*/
|
|
228
229
|
click(event, element) {
|
|
229
|
-
this.callEvent('click', {
|
|
230
|
+
this.callEvent('click', {
|
|
231
|
+
event: (event || new MouseEvent('click')),
|
|
232
|
+
element: (element || this.element),
|
|
233
|
+
component: this,
|
|
234
|
+
});
|
|
230
235
|
}
|
|
231
236
|
/**
|
|
232
237
|
* Triggered when the component is focused.
|
|
@@ -559,7 +564,10 @@
|
|
|
559
564
|
*/
|
|
560
565
|
clickEvent(event, chartContext, config) {
|
|
561
566
|
this.callEvent('chartClick', {
|
|
562
|
-
event
|
|
567
|
+
event: (event || new MouseEvent('click')),
|
|
568
|
+
component: this,
|
|
569
|
+
chartContext,
|
|
570
|
+
config,
|
|
563
571
|
});
|
|
564
572
|
}
|
|
565
573
|
/**
|
|
@@ -1649,9 +1657,9 @@
|
|
|
1649
1657
|
*/
|
|
1650
1658
|
this.storePath = '';
|
|
1651
1659
|
/**
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
this.value =
|
|
1660
|
+
* Internal input value.
|
|
1661
|
+
*/
|
|
1662
|
+
this.value = null;
|
|
1655
1663
|
/**
|
|
1656
1664
|
* Input validations.
|
|
1657
1665
|
*/
|
|
@@ -1799,6 +1807,8 @@
|
|
|
1799
1807
|
* @param element Element clicked
|
|
1800
1808
|
*/
|
|
1801
1809
|
change(event, element) {
|
|
1810
|
+
if (this.value === '')
|
|
1811
|
+
this.value = null;
|
|
1802
1812
|
if (this.events.change && typeof this.events.change === 'function') {
|
|
1803
1813
|
this.events.change({ event, element, component: this });
|
|
1804
1814
|
}
|
|
@@ -2811,61 +2821,34 @@
|
|
|
2811
2821
|
*/
|
|
2812
2822
|
ModalService.modals = [];
|
|
2813
2823
|
|
|
2814
|
-
class Loading extends Component {
|
|
2815
|
-
/*
|
|
2816
|
-
* Creates a new Loading Overlay
|
|
2817
|
-
* @param props Modal structure
|
|
2818
|
-
*/
|
|
2819
|
-
constructor(props) {
|
|
2820
|
-
super(props);
|
|
2821
|
-
/**
|
|
2822
|
-
* text to show in Loader Overlay
|
|
2823
|
-
*/
|
|
2824
|
-
this.text = 'Loading';
|
|
2825
|
-
this.isVisible = false;
|
|
2826
|
-
this.zIndex = 999;
|
|
2827
|
-
this.text = this.getInitValue('text', props.text, this.text);
|
|
2828
|
-
this.zIndex = this.getInitValue('zIndex', props.zIndex, this.zIndex);
|
|
2829
|
-
this.defaultText = this.text;
|
|
2830
|
-
}
|
|
2831
|
-
/**
|
|
2832
|
-
* Displays overlay
|
|
2833
|
-
*/
|
|
2834
|
-
show(text) {
|
|
2835
|
-
if (text)
|
|
2836
|
-
this.text = text;
|
|
2837
|
-
else
|
|
2838
|
-
this.text = this.defaultText;
|
|
2839
|
-
this.isVisible = true;
|
|
2840
|
-
}
|
|
2841
|
-
/**
|
|
2842
|
-
* Close overlay
|
|
2843
|
-
*/
|
|
2844
|
-
hide() {
|
|
2845
|
-
this.isVisible = false;
|
|
2846
|
-
}
|
|
2847
|
-
}
|
|
2848
|
-
|
|
2849
2824
|
/**
|
|
2850
2825
|
* Loading Service Class
|
|
2851
2826
|
*/
|
|
2852
2827
|
class LoadingService {
|
|
2828
|
+
/**
|
|
2829
|
+
* Creates a new loading instance
|
|
2830
|
+
* @param loading loading structure
|
|
2831
|
+
*/
|
|
2832
|
+
static create(CreateLoading, props) {
|
|
2833
|
+
const instance = new CreateLoading(props);
|
|
2834
|
+
this.loading = instance;
|
|
2835
|
+
return instance;
|
|
2836
|
+
}
|
|
2853
2837
|
/**
|
|
2854
2838
|
* Displays a Loading.
|
|
2855
2839
|
* If has an opened Loading it will be closed.
|
|
2856
2840
|
* @param Loading loading structure
|
|
2857
2841
|
*/
|
|
2858
2842
|
static show(text) {
|
|
2859
|
-
this.
|
|
2843
|
+
this.loading.show(text);
|
|
2860
2844
|
}
|
|
2861
2845
|
/**
|
|
2862
2846
|
* Hides current Loading
|
|
2863
2847
|
*/
|
|
2864
2848
|
static hide() {
|
|
2865
|
-
this.
|
|
2849
|
+
this.loading.hide();
|
|
2866
2850
|
}
|
|
2867
|
-
}
|
|
2868
|
-
LoadingService.instance = new Loading({ name: 'loading-instance' });
|
|
2851
|
+
}
|
|
2869
2852
|
|
|
2870
2853
|
/**
|
|
2871
2854
|
* Base class for Dashboard component.
|
|
@@ -3472,8 +3455,9 @@
|
|
|
3472
3455
|
return !this.dateError || core.I18n.translate('VALIDATION_INVALID_DATE');
|
|
3473
3456
|
}
|
|
3474
3457
|
click(event, element) {
|
|
3475
|
-
|
|
3476
|
-
|
|
3458
|
+
const clickEvent = event || new MouseEvent('click');
|
|
3459
|
+
super.click(clickEvent, element);
|
|
3460
|
+
if (!clickEvent.defaultPrevented) {
|
|
3477
3461
|
this.showDatePicker = !this.showDatePicker;
|
|
3478
3462
|
}
|
|
3479
3463
|
}
|
|
@@ -3821,8 +3805,9 @@
|
|
|
3821
3805
|
return !this.dateError || core.I18n.translate('VALIDATION_INVALID_DATE');
|
|
3822
3806
|
}
|
|
3823
3807
|
click(event, element) {
|
|
3824
|
-
|
|
3825
|
-
|
|
3808
|
+
const clickEvent = event || new MouseEvent('click');
|
|
3809
|
+
super.click(clickEvent, element);
|
|
3810
|
+
if (!clickEvent.defaultPrevented) {
|
|
3826
3811
|
this.showDatePicker = !this.showDatePicker;
|
|
3827
3812
|
}
|
|
3828
3813
|
}
|
|
@@ -4195,7 +4180,7 @@
|
|
|
4195
4180
|
* Triggered when a removable chip is clicked
|
|
4196
4181
|
* @param event DOM event
|
|
4197
4182
|
* @param index Chip index
|
|
4198
|
-
* @param element
|
|
4183
|
+
* @param element any
|
|
4199
4184
|
*/
|
|
4200
4185
|
chipClick(event, index, element) {
|
|
4201
4186
|
event.stopImmediatePropagation();
|
|
@@ -4483,6 +4468,8 @@
|
|
|
4483
4468
|
this.componentProps = {};
|
|
4484
4469
|
/** column style property */
|
|
4485
4470
|
this.style = {};
|
|
4471
|
+
/** Type of XLS */
|
|
4472
|
+
this.xlsType = '';
|
|
4486
4473
|
/* Stores lookup data to prevent unnecessary requests */
|
|
4487
4474
|
this.lookupData = {};
|
|
4488
4475
|
/* Stores lookup data count (only to be reactive and force column update) */
|
|
@@ -4525,6 +4512,7 @@
|
|
|
4525
4512
|
this.loading = this.getInitValue('loading', props.loading, this.loading);
|
|
4526
4513
|
this.style = this.getInitValue('style', props.style, this.style);
|
|
4527
4514
|
this.componentProps = this.getInitValue('componentProps', props.componentProps, this.componentProps);
|
|
4515
|
+
this.xlsType = this.getInitValue('xlsType', props.xlsType, this.xlsType);
|
|
4528
4516
|
this.conditions = this.getInitValue('conditions', props.conditions, this.conditions);
|
|
4529
4517
|
this.createConditions();
|
|
4530
4518
|
this.createActionConditions();
|
|
@@ -7043,6 +7031,41 @@
|
|
|
7043
7031
|
}
|
|
7044
7032
|
}
|
|
7045
7033
|
|
|
7034
|
+
class Loading extends Component {
|
|
7035
|
+
/*
|
|
7036
|
+
* Creates a new Loading Overlay
|
|
7037
|
+
* @param props Modal structure
|
|
7038
|
+
*/
|
|
7039
|
+
constructor(props) {
|
|
7040
|
+
super(props);
|
|
7041
|
+
/**
|
|
7042
|
+
* text to show in Loader Overlay
|
|
7043
|
+
*/
|
|
7044
|
+
this.text = 'Loading';
|
|
7045
|
+
this.isVisible = false;
|
|
7046
|
+
this.zIndex = 999;
|
|
7047
|
+
this.text = this.getInitValue('text', props.text, this.text);
|
|
7048
|
+
this.zIndex = this.getInitValue('zIndex', props.zIndex, this.zIndex);
|
|
7049
|
+
this.defaultText = this.text;
|
|
7050
|
+
}
|
|
7051
|
+
/**
|
|
7052
|
+
* Displays overlay
|
|
7053
|
+
*/
|
|
7054
|
+
show(text) {
|
|
7055
|
+
if (text)
|
|
7056
|
+
this.text = text;
|
|
7057
|
+
else
|
|
7058
|
+
this.text = this.defaultText;
|
|
7059
|
+
this.isVisible = true;
|
|
7060
|
+
}
|
|
7061
|
+
/**
|
|
7062
|
+
* Close overlay
|
|
7063
|
+
*/
|
|
7064
|
+
hide() {
|
|
7065
|
+
this.isVisible = false;
|
|
7066
|
+
}
|
|
7067
|
+
}
|
|
7068
|
+
|
|
7046
7069
|
/**
|
|
7047
7070
|
* Base class for Login component.
|
|
7048
7071
|
*/
|
|
@@ -7399,6 +7422,8 @@
|
|
|
7399
7422
|
this.filteredMenuItems = [];
|
|
7400
7423
|
/** Search value */
|
|
7401
7424
|
this.searchValue = '';
|
|
7425
|
+
/** Store the current item focused */
|
|
7426
|
+
this.currentItem = null;
|
|
7402
7427
|
this.app = this.getInitValue('app', props.app, this.app);
|
|
7403
7428
|
this.clipped = this.getInitValue('clipped', props.clipped, this.clipped);
|
|
7404
7429
|
this.fixed = this.getInitValue('fixed', props.fixed, this.fixed);
|
|
@@ -7674,9 +7699,21 @@
|
|
|
7674
7699
|
*/
|
|
7675
7700
|
click(event) {
|
|
7676
7701
|
let preventDefault = false;
|
|
7677
|
-
preventDefault = this.callEvent('click', {
|
|
7702
|
+
preventDefault = this.callEvent('click', {
|
|
7703
|
+
event: (event || new MouseEvent('click')),
|
|
7704
|
+
component: this,
|
|
7705
|
+
});
|
|
7678
7706
|
if (preventDefault) {
|
|
7679
|
-
event.preventDefault();
|
|
7707
|
+
event === null || event === void 0 ? void 0 : event.preventDefault();
|
|
7708
|
+
}
|
|
7709
|
+
this.setFocus();
|
|
7710
|
+
}
|
|
7711
|
+
/**
|
|
7712
|
+
* Event triggered when this item is focus
|
|
7713
|
+
*/
|
|
7714
|
+
focus() {
|
|
7715
|
+
if (this.parentMenu) {
|
|
7716
|
+
this.parentMenu.currentItem = this;
|
|
7680
7717
|
}
|
|
7681
7718
|
}
|
|
7682
7719
|
/**
|
|
@@ -7745,6 +7782,29 @@
|
|
|
7745
7782
|
close() {
|
|
7746
7783
|
this.opened = false;
|
|
7747
7784
|
}
|
|
7785
|
+
/**
|
|
7786
|
+
* Event triggered when this item is clicked
|
|
7787
|
+
*/
|
|
7788
|
+
click(event) {
|
|
7789
|
+
let preventDefault = false;
|
|
7790
|
+
preventDefault = this.callEvent('click', {
|
|
7791
|
+
event: (event || new MouseEvent('click')),
|
|
7792
|
+
component: this,
|
|
7793
|
+
});
|
|
7794
|
+
if (preventDefault) {
|
|
7795
|
+
event === null || event === void 0 ? void 0 : event.preventDefault();
|
|
7796
|
+
}
|
|
7797
|
+
this.setFocus();
|
|
7798
|
+
}
|
|
7799
|
+
/**
|
|
7800
|
+
* Event triggered when this item is focus
|
|
7801
|
+
*/
|
|
7802
|
+
focus(event) {
|
|
7803
|
+
this.callEvent('focus', { event, component: this });
|
|
7804
|
+
if (this.parentMenu) {
|
|
7805
|
+
this.parentMenu.currentItem = this;
|
|
7806
|
+
}
|
|
7807
|
+
}
|
|
7748
7808
|
}
|
|
7749
7809
|
|
|
7750
7810
|
/**
|
|
@@ -7822,10 +7882,20 @@
|
|
|
7822
7882
|
* If true the modal won't close when overlay is clicked
|
|
7823
7883
|
*/
|
|
7824
7884
|
this.persistent = false;
|
|
7885
|
+
/**
|
|
7886
|
+
* Allows modal to be dragged around in the screen
|
|
7887
|
+
*/
|
|
7888
|
+
this.draggable = false;
|
|
7889
|
+
/**
|
|
7890
|
+
* Css selector of the drag handle
|
|
7891
|
+
*/
|
|
7892
|
+
this.dragHandle = '';
|
|
7825
7893
|
this.title = this.getInitValue('title', props.title, this.title);
|
|
7826
7894
|
this.fullscreen = this.getInitValue('fullscreen', props.fullscreen, this.fullscreen);
|
|
7827
7895
|
this.grid = this.getInitValue('grid', props.grid, this.grid);
|
|
7828
7896
|
this.persistent = this.getInitValue('persistent', props.persistent, this.persistent);
|
|
7897
|
+
this.draggable = this.getInitValue('draggable', props.draggable, this.draggable);
|
|
7898
|
+
this.dragHandle = this.getInitValue('dragHandle', props.dragHandle, this.dragHandle);
|
|
7829
7899
|
this.isVisible = false;
|
|
7830
7900
|
this.createAccessors();
|
|
7831
7901
|
}
|
|
@@ -8247,11 +8317,16 @@
|
|
|
8247
8317
|
* Number of hidden items
|
|
8248
8318
|
*/
|
|
8249
8319
|
this.moreChip = 0;
|
|
8320
|
+
/**
|
|
8321
|
+
* Max number of rows the component can have
|
|
8322
|
+
*/
|
|
8323
|
+
this.maxRows = undefined;
|
|
8250
8324
|
this.showSelectAll = false;
|
|
8251
8325
|
if (!this.selectedValue) {
|
|
8252
8326
|
this.selectedValue = [];
|
|
8253
8327
|
}
|
|
8254
8328
|
this.showSelectAll = this.getInitValue('showSelectAll', props.showSelectAll, this.showSelectAll);
|
|
8329
|
+
this.maxRows = this.getInitValue('maxRows', props.maxRows, this.maxRows);
|
|
8255
8330
|
this.createAccessors();
|
|
8256
8331
|
}
|
|
8257
8332
|
afterFocus() {
|
|
@@ -8427,6 +8502,21 @@
|
|
|
8427
8502
|
removePushedValue() {
|
|
8428
8503
|
this.removeInserts();
|
|
8429
8504
|
}
|
|
8505
|
+
doSearch(value) {
|
|
8506
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
8507
|
+
if (this.manualMode || value) {
|
|
8508
|
+
yield this.updateSearch(value);
|
|
8509
|
+
}
|
|
8510
|
+
else {
|
|
8511
|
+
if (!this.manualMode) {
|
|
8512
|
+
this.datasource.data = [...this.cachedData];
|
|
8513
|
+
this.datasource.total = this.cachedTotal;
|
|
8514
|
+
}
|
|
8515
|
+
this.removeInserts();
|
|
8516
|
+
this.insertSelected();
|
|
8517
|
+
}
|
|
8518
|
+
});
|
|
8519
|
+
}
|
|
8430
8520
|
/**
|
|
8431
8521
|
* Removes unselected inserts from datasource
|
|
8432
8522
|
*/
|
|
@@ -9267,8 +9357,13 @@
|
|
|
9267
9357
|
*/
|
|
9268
9358
|
this.selectedNodes = [];
|
|
9269
9359
|
this.selectValue = [];
|
|
9360
|
+
/**
|
|
9361
|
+
* Changes the behavior of checked nodes that will be displayed in the array of values
|
|
9362
|
+
*/
|
|
9363
|
+
this.valueConsistsOf = 'LEAF_PRIORITY';
|
|
9270
9364
|
this.flat = this.getInitValue('flat', props.flat, this.flat);
|
|
9271
9365
|
this.limit = this.getInitValue('limit', props.limit, this.limit);
|
|
9366
|
+
this.valueConsistsOf = this.getInitValue('valueConsistsOf', props.valueConsistsOf, this.valueConsistsOf);
|
|
9272
9367
|
this.createAccessors();
|
|
9273
9368
|
}
|
|
9274
9369
|
/**
|
|
@@ -10088,8 +10183,11 @@
|
|
|
10088
10183
|
|| core.I18n.translate('VALIDATION_TIME_NOT_ALLOWED');
|
|
10089
10184
|
}
|
|
10090
10185
|
click(event) {
|
|
10091
|
-
this.callEvent('click', {
|
|
10092
|
-
|
|
10186
|
+
this.callEvent('click', {
|
|
10187
|
+
event: (event || new MouseEvent('click')),
|
|
10188
|
+
component: this,
|
|
10189
|
+
});
|
|
10190
|
+
if (!(event === null || event === void 0 ? void 0 : event.defaultPrevented)) {
|
|
10093
10191
|
this.showTimePicker = !this.showTimePicker;
|
|
10094
10192
|
}
|
|
10095
10193
|
}
|
|
@@ -10215,6 +10313,10 @@
|
|
|
10215
10313
|
* Components that will be rendered on toolbar slot
|
|
10216
10314
|
*/
|
|
10217
10315
|
this.toolbarSlot = [];
|
|
10316
|
+
/**
|
|
10317
|
+
* Components that will be rendered on title slot
|
|
10318
|
+
*/
|
|
10319
|
+
this.titleSlot = [];
|
|
10218
10320
|
/** Datasource parent field */
|
|
10219
10321
|
this.parentField = '';
|
|
10220
10322
|
/** Datasource title field */
|
|
@@ -10225,11 +10327,21 @@
|
|
|
10225
10327
|
* Defines if the tree will be opened or not (true/false) or if it should open only until a specific level
|
|
10226
10328
|
*/
|
|
10227
10329
|
this.openLevelOnLoad = false;
|
|
10330
|
+
/**
|
|
10331
|
+
* Allow row check
|
|
10332
|
+
*/
|
|
10333
|
+
this.checkbox = false;
|
|
10228
10334
|
/**
|
|
10229
10335
|
* Defines if should wait and not execute GET method when Datasource is created
|
|
10230
10336
|
*/
|
|
10231
10337
|
this.lazyLoad = true;
|
|
10232
|
-
|
|
10338
|
+
/**
|
|
10339
|
+
* Dictionary of nodePath ponting to Dictionary of path pointing to the condition (applied) return value
|
|
10340
|
+
*/
|
|
10341
|
+
this.appliedConditions = {};
|
|
10342
|
+
/* Conditions of tree */
|
|
10343
|
+
this.factoredConditions = {};
|
|
10344
|
+
this.nodes = this.initNodes(props.nodes || this.nodes);
|
|
10233
10345
|
this.itemIconName = this.getInitValue('itemIconName', props.itemIconName, this.itemIconName);
|
|
10234
10346
|
this.groupIconName = this.getInitValue('groupIconName', props.groupIconName, this.groupIconName);
|
|
10235
10347
|
this.openedIconName = this.getInitValue('openedIconName', props.openedIconName, this.openedIconName);
|
|
@@ -10240,8 +10352,16 @@
|
|
|
10240
10352
|
this.titleField = this.getInitValue('titleField', props.titleField, this.titleField);
|
|
10241
10353
|
this.dataField = this.getInitValue('dataField', props.dataField, this.dataField);
|
|
10242
10354
|
this.openLevelOnLoad = this.getInitValue('openLevelOnLoad', props.openLevelOnLoad, this.openLevelOnLoad);
|
|
10355
|
+
this.checkbox = this.getInitValue('checkbox', props.checkbox, this.checkbox);
|
|
10243
10356
|
this.afterTitleSlot = props.afterTitleSlot || this.afterTitleSlot;
|
|
10244
10357
|
this.toolbarSlot = props.toolbarSlot || this.toolbarSlot;
|
|
10358
|
+
this.titleSlot = props.titleSlot || this.titleSlot;
|
|
10359
|
+
if (props.afterTitleSlot) {
|
|
10360
|
+
this.createConditions([props.afterTitleSlot]);
|
|
10361
|
+
}
|
|
10362
|
+
if (props.titleSlot) {
|
|
10363
|
+
this.createConditions(props.titleSlot);
|
|
10364
|
+
}
|
|
10245
10365
|
if (props.datasource && Object.keys(props.datasource).length) {
|
|
10246
10366
|
this.lazyLoad = props.datasource.lazyLoad !== false;
|
|
10247
10367
|
this.datasource = core.DatasourceFactory.factory(Object.assign(Object.assign({}, props.datasource), { searchIn: props.datasource.searchIn || [this.titleField, this.dataField].filter(Boolean), lazyLoad: true, loadAll: true }));
|
|
@@ -10249,6 +10369,12 @@
|
|
|
10249
10369
|
}
|
|
10250
10370
|
this.createAccessors();
|
|
10251
10371
|
}
|
|
10372
|
+
/**
|
|
10373
|
+
* Initialize all the properties of the declared nodes (reactivity)
|
|
10374
|
+
*/
|
|
10375
|
+
initNodes(nodes) {
|
|
10376
|
+
return nodes.map((node) => (Object.assign(Object.assign({ isLeaf: false, isExpanded: true, isSelected: false, isDraggable: true, isSelectable: true, isChecked: false }, node), { children: this.initNodes(node.children || []) })));
|
|
10377
|
+
}
|
|
10252
10378
|
/** Nodes */
|
|
10253
10379
|
get nodes() {
|
|
10254
10380
|
return this.nodesValue;
|
|
@@ -10259,6 +10385,16 @@
|
|
|
10259
10385
|
}
|
|
10260
10386
|
this.nodesValue = value;
|
|
10261
10387
|
}
|
|
10388
|
+
getCheckedNodes() {
|
|
10389
|
+
const selectedNodes = [];
|
|
10390
|
+
this.tree.traverse((node) => {
|
|
10391
|
+
const instanceNode = this.getNode(node.path || []);
|
|
10392
|
+
if (instanceNode === null || instanceNode === void 0 ? void 0 : instanceNode.isChecked) {
|
|
10393
|
+
selectedNodes.push(instanceNode);
|
|
10394
|
+
}
|
|
10395
|
+
});
|
|
10396
|
+
return selectedNodes;
|
|
10397
|
+
}
|
|
10262
10398
|
/** Returns the selected nodes */
|
|
10263
10399
|
get selectedNodes() {
|
|
10264
10400
|
var _a;
|
|
@@ -10357,16 +10493,87 @@
|
|
|
10357
10493
|
setTree(tree) {
|
|
10358
10494
|
this.tree = tree;
|
|
10359
10495
|
}
|
|
10360
|
-
/**
|
|
10361
|
-
|
|
10362
|
-
|
|
10363
|
-
|
|
10364
|
-
|
|
10365
|
-
|
|
10366
|
-
|
|
10367
|
-
|
|
10368
|
-
|
|
10369
|
-
|
|
10496
|
+
/**
|
|
10497
|
+
* Return plain conditions object
|
|
10498
|
+
* @param conditions Conditions object
|
|
10499
|
+
* @param parentPath Path to parent property
|
|
10500
|
+
*/
|
|
10501
|
+
getPlainConditions(conditions, parentPath = '') {
|
|
10502
|
+
let plainData = {};
|
|
10503
|
+
Object.keys(conditions).forEach((key) => {
|
|
10504
|
+
const fullKey = parentPath ? [parentPath, key].join('.') : key;
|
|
10505
|
+
if (typeof conditions[key] === 'object') {
|
|
10506
|
+
plainData = Object.assign(Object.assign({}, plainData), this.getPlainConditions(conditions[key], fullKey));
|
|
10507
|
+
}
|
|
10508
|
+
else {
|
|
10509
|
+
plainData[fullKey] = conditions[key];
|
|
10510
|
+
}
|
|
10511
|
+
});
|
|
10512
|
+
return plainData;
|
|
10513
|
+
}
|
|
10514
|
+
createConditions(children, parentPath = '') {
|
|
10515
|
+
children.forEach((child) => {
|
|
10516
|
+
const path = parentPath ? `${parentPath}.${child.name}` : child.name;
|
|
10517
|
+
if (child.conditions) {
|
|
10518
|
+
const plainConditions = this.getPlainConditions(child.conditions);
|
|
10519
|
+
this.factoredConditions[path] = core.Event.factory(plainConditions);
|
|
10520
|
+
}
|
|
10521
|
+
if (child.children) {
|
|
10522
|
+
this.createConditions(child.children, path);
|
|
10523
|
+
}
|
|
10524
|
+
});
|
|
10525
|
+
}
|
|
10526
|
+
applyCondition(node, factoredConditions) {
|
|
10527
|
+
const appliedConditions = {};
|
|
10528
|
+
Object.keys(factoredConditions).forEach((condition) => {
|
|
10529
|
+
const conditionFunction = factoredConditions[condition];
|
|
10530
|
+
set__default["default"](appliedConditions, condition, conditionFunction(node));
|
|
10531
|
+
});
|
|
10532
|
+
return appliedConditions;
|
|
10533
|
+
}
|
|
10534
|
+
applyChildCondition(node, factoredConditions = this.factoredConditions) {
|
|
10535
|
+
const appliedConditions = {};
|
|
10536
|
+
Object.keys(factoredConditions).forEach((comp) => {
|
|
10537
|
+
const conditions = this.factoredConditions[comp];
|
|
10538
|
+
appliedConditions[comp] = Object.assign({}, this.applyCondition(node, conditions));
|
|
10539
|
+
});
|
|
10540
|
+
return appliedConditions;
|
|
10541
|
+
}
|
|
10542
|
+
reapplyConditions(node) {
|
|
10543
|
+
const nodePath = node.pathStr;
|
|
10544
|
+
if (!nodePath)
|
|
10545
|
+
return {};
|
|
10546
|
+
const appliedConditions = Object.assign({}, this.appliedConditions);
|
|
10547
|
+
appliedConditions[nodePath] = this.applyChildCondition(node);
|
|
10548
|
+
this.appliedConditions = appliedConditions;
|
|
10549
|
+
return this.appliedConditions[nodePath];
|
|
10550
|
+
}
|
|
10551
|
+
getSlotComponent(slot, node, parentPath = '') {
|
|
10552
|
+
const slotArr = Array.isArray(slot) ? slot : [slot];
|
|
10553
|
+
const newComponents = [];
|
|
10554
|
+
slotArr.forEach((component) => {
|
|
10555
|
+
var _a;
|
|
10556
|
+
if (!component)
|
|
10557
|
+
return;
|
|
10558
|
+
const nodePath = node.pathStr;
|
|
10559
|
+
if (!nodePath)
|
|
10560
|
+
return;
|
|
10561
|
+
const compName = component.name;
|
|
10562
|
+
const instanceName = `${compName}_${nodePath}`;
|
|
10563
|
+
const path = parentPath ? `${parentPath}.${compName}` : compName;
|
|
10564
|
+
const newComponent = merge__default["default"]({}, component, (_a = this.appliedConditions[nodePath]) === null || _a === void 0 ? void 0 : _a[path]);
|
|
10565
|
+
const newChildren = this.getSlotComponent(newComponent.children || [], node, path);
|
|
10566
|
+
newComponent.name = instanceName;
|
|
10567
|
+
newComponent.children = newChildren;
|
|
10568
|
+
try {
|
|
10569
|
+
core.Metadata.updateInstance(instanceName, newComponent);
|
|
10570
|
+
}
|
|
10571
|
+
catch (e) {
|
|
10572
|
+
// do nothing
|
|
10573
|
+
}
|
|
10574
|
+
newComponents.push(newComponent);
|
|
10575
|
+
});
|
|
10576
|
+
return newComponents;
|
|
10370
10577
|
}
|
|
10371
10578
|
/** Triggers when dragging nodes have been dropped */
|
|
10372
10579
|
nodeDrop(nodes, position, event, element) {
|
|
@@ -10394,6 +10601,12 @@
|
|
|
10394
10601
|
event, element, component: this, node,
|
|
10395
10602
|
});
|
|
10396
10603
|
}
|
|
10604
|
+
/** Triggers when a node has been checked/unchecked */
|
|
10605
|
+
nodeCheck(node, event, element) {
|
|
10606
|
+
this.callEvent('onNodeCheck', {
|
|
10607
|
+
event, element, component: this, node,
|
|
10608
|
+
});
|
|
10609
|
+
}
|
|
10397
10610
|
clearSelection(nodes) {
|
|
10398
10611
|
const nodesArray = nodes || this.nodes;
|
|
10399
10612
|
nodesArray.forEach((node) => {
|
|
@@ -10403,6 +10616,19 @@
|
|
|
10403
10616
|
}
|
|
10404
10617
|
});
|
|
10405
10618
|
}
|
|
10619
|
+
getNode(path) {
|
|
10620
|
+
return this.searchPath(this.nodes, path);
|
|
10621
|
+
}
|
|
10622
|
+
getParentNode(node) {
|
|
10623
|
+
var _a;
|
|
10624
|
+
return this.getNode(((_a = node.path) === null || _a === void 0 ? void 0 : _a.slice(0, -1)) || []);
|
|
10625
|
+
}
|
|
10626
|
+
searchPath(nodes, path) {
|
|
10627
|
+
const currentNode = (path[0] > -1 && path[0] < nodes.length) ? nodes[path[0]] : undefined;
|
|
10628
|
+
if (currentNode && path.length > 1)
|
|
10629
|
+
return this.searchPath(currentNode.children || [], path.slice(1));
|
|
10630
|
+
return currentNode;
|
|
10631
|
+
}
|
|
10406
10632
|
}
|
|
10407
10633
|
|
|
10408
10634
|
/**
|
|
@@ -11042,7 +11268,7 @@
|
|
|
11042
11268
|
tableColumns: 'mdi-table-headers-eye',
|
|
11043
11269
|
unfold: 'mdi-unfold-more-horizontal',
|
|
11044
11270
|
warning: 'mdi-exclamation',
|
|
11045
|
-
zoom: 'mdi-magnify
|
|
11271
|
+
zoom: 'mdi-magnify',
|
|
11046
11272
|
zoomIn: 'mdi-plus-circle-outline',
|
|
11047
11273
|
zoomPanning: 'mdi-hand-back-right-outline',
|
|
11048
11274
|
zoomOut: 'mdi-minus-circle-outline',
|
|
@@ -11140,15 +11366,23 @@
|
|
|
11140
11366
|
zeedhi: {
|
|
11141
11367
|
light: {
|
|
11142
11368
|
'font-color': 'var(--v-grey-darken2)',
|
|
11143
|
-
'background-base': '#
|
|
11369
|
+
'background-base': '#FDFDFD',
|
|
11370
|
+
'background-base-2': '#F6F6F6',
|
|
11371
|
+
'background-base-3': '#EEE',
|
|
11144
11372
|
'scrollbar-track': 'var(--v-grey-lighten5)',
|
|
11145
11373
|
'scrollbar-thumb': 'var(--v-grey-lighten4)',
|
|
11374
|
+
'badge-background-color': '#f44336',
|
|
11375
|
+
'badge-text-color': '#fff',
|
|
11146
11376
|
},
|
|
11147
11377
|
dark: {
|
|
11148
11378
|
'font-color': 'var(--v-grey-lighten3)',
|
|
11149
|
-
'background-base': '#
|
|
11379
|
+
'background-base': '#1E1E1E',
|
|
11380
|
+
'background-base-2': 'var(--v-grey-darken2)',
|
|
11381
|
+
'background-base-3': 'var(--v-grey-darken4)',
|
|
11150
11382
|
'scrollbar-track': 'var(--v-grey-darken3)',
|
|
11151
11383
|
'scrollbar-thumb': 'var(--v-grey-base)',
|
|
11384
|
+
'badge-background-color': '#f44336',
|
|
11385
|
+
'badge-text-color': '#fff',
|
|
11152
11386
|
},
|
|
11153
11387
|
variables: {
|
|
11154
11388
|
'default-padding': '16px',
|
|
@@ -11166,8 +11400,6 @@
|
|
|
11166
11400
|
'font-body4-weight': '500',
|
|
11167
11401
|
'font-caption-size': '11px',
|
|
11168
11402
|
'font-caption-weight': '400',
|
|
11169
|
-
'badge-background-color': '#f44336',
|
|
11170
|
-
'badge-text-color': '#fff',
|
|
11171
11403
|
},
|
|
11172
11404
|
},
|
|
11173
11405
|
};
|
|
@@ -11422,6 +11654,7 @@
|
|
|
11422
11654
|
sequence: index,
|
|
11423
11655
|
format: this.getFormatOfColumn(col),
|
|
11424
11656
|
size: `${size}%`,
|
|
11657
|
+
xlsType: col.xlsType,
|
|
11425
11658
|
};
|
|
11426
11659
|
return Object.assign(Object.assign({}, result), { [col.name]: row });
|
|
11427
11660
|
}, {});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeedhi/common",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.45.1",
|
|
4
4
|
"description": "Zeedhi Common",
|
|
5
5
|
"author": "Zeedhi <zeedhi@teknisa.com>",
|
|
6
6
|
"license": "ISC",
|
|
@@ -37,5 +37,5 @@
|
|
|
37
37
|
"lodash.times": "^4.3.2",
|
|
38
38
|
"mockdate": "^3.0.2"
|
|
39
39
|
},
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "48ccd8cb489384bbdedb6f649504ca64d9d6fc1c"
|
|
41
41
|
}
|
|
@@ -159,13 +159,13 @@ export declare class Carousel extends ComponentRender implements ICarousel {
|
|
|
159
159
|
* @param element Carousel element
|
|
160
160
|
* @param slideData Data related to the beforeSlide event
|
|
161
161
|
*/
|
|
162
|
-
beforeSlide(element:
|
|
162
|
+
beforeSlide(element: any, slideData: ISlideData, event?: Event): void;
|
|
163
163
|
/**
|
|
164
164
|
* Event triggered when the current slide changes.
|
|
165
165
|
* @param event Event that triggered the slide event
|
|
166
166
|
* @param element Carousel element
|
|
167
167
|
* @param slideData Data related to the slide event
|
|
168
168
|
*/
|
|
169
|
-
slide(element:
|
|
169
|
+
slide(element: any, slideData: ISlideData, event?: Event): void;
|
|
170
170
|
private changeDefaultButtonName;
|
|
171
171
|
}
|
|
@@ -9,7 +9,7 @@ export interface ISlideData {
|
|
|
9
9
|
export interface ICarouselEventParam {
|
|
10
10
|
component: Carousel;
|
|
11
11
|
event?: Event | undefined;
|
|
12
|
-
element?:
|
|
12
|
+
element?: any;
|
|
13
13
|
slideData?: ISlideData;
|
|
14
14
|
}
|
|
15
15
|
export declare type ICarouselEvents = IComponentEvents<ICarouselEventParam>;
|