@zeedhi/common 1.44.0 → 1.45.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 +233 -70
- package/dist/zd-common.umd.js +233 -70
- 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/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 +1 -1
- package/types/components/zd-menu/menu-link.d.ts +1 -1
- package/types/components/zd-menu/menu.d.ts +1 -1
- package/types/components/zd-select/select.d.ts +5 -5
- package/types/components/zd-select-multiple/select-multiple.d.ts +2 -2
- package/types/components/zd-select-tree/select-tree.d.ts +6 -6
- package/types/components/zd-select-tree-multiple/select-tree-multiple.d.ts +2 -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/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();
|
|
@@ -7046,6 +7031,41 @@
|
|
|
7046
7031
|
}
|
|
7047
7032
|
}
|
|
7048
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
|
+
|
|
7049
7069
|
/**
|
|
7050
7070
|
* Base class for Login component.
|
|
7051
7071
|
*/
|
|
@@ -7679,9 +7699,12 @@
|
|
|
7679
7699
|
*/
|
|
7680
7700
|
click(event) {
|
|
7681
7701
|
let preventDefault = false;
|
|
7682
|
-
preventDefault = this.callEvent('click', {
|
|
7702
|
+
preventDefault = this.callEvent('click', {
|
|
7703
|
+
event: (event || new MouseEvent('click')),
|
|
7704
|
+
component: this,
|
|
7705
|
+
});
|
|
7683
7706
|
if (preventDefault) {
|
|
7684
|
-
event.preventDefault();
|
|
7707
|
+
event === null || event === void 0 ? void 0 : event.preventDefault();
|
|
7685
7708
|
}
|
|
7686
7709
|
this.setFocus();
|
|
7687
7710
|
}
|
|
@@ -7764,9 +7787,12 @@
|
|
|
7764
7787
|
*/
|
|
7765
7788
|
click(event) {
|
|
7766
7789
|
let preventDefault = false;
|
|
7767
|
-
preventDefault = this.callEvent('click', {
|
|
7790
|
+
preventDefault = this.callEvent('click', {
|
|
7791
|
+
event: (event || new MouseEvent('click')),
|
|
7792
|
+
component: this,
|
|
7793
|
+
});
|
|
7768
7794
|
if (preventDefault) {
|
|
7769
|
-
event.preventDefault();
|
|
7795
|
+
event === null || event === void 0 ? void 0 : event.preventDefault();
|
|
7770
7796
|
}
|
|
7771
7797
|
this.setFocus();
|
|
7772
7798
|
}
|
|
@@ -10137,8 +10163,11 @@
|
|
|
10137
10163
|
|| core.I18n.translate('VALIDATION_TIME_NOT_ALLOWED');
|
|
10138
10164
|
}
|
|
10139
10165
|
click(event) {
|
|
10140
|
-
this.callEvent('click', {
|
|
10141
|
-
|
|
10166
|
+
this.callEvent('click', {
|
|
10167
|
+
event: (event || new MouseEvent('click')),
|
|
10168
|
+
component: this,
|
|
10169
|
+
});
|
|
10170
|
+
if (!(event === null || event === void 0 ? void 0 : event.defaultPrevented)) {
|
|
10142
10171
|
this.showTimePicker = !this.showTimePicker;
|
|
10143
10172
|
}
|
|
10144
10173
|
}
|
|
@@ -10264,6 +10293,10 @@
|
|
|
10264
10293
|
* Components that will be rendered on toolbar slot
|
|
10265
10294
|
*/
|
|
10266
10295
|
this.toolbarSlot = [];
|
|
10296
|
+
/**
|
|
10297
|
+
* Components that will be rendered on title slot
|
|
10298
|
+
*/
|
|
10299
|
+
this.titleSlot = [];
|
|
10267
10300
|
/** Datasource parent field */
|
|
10268
10301
|
this.parentField = '';
|
|
10269
10302
|
/** Datasource title field */
|
|
@@ -10274,11 +10307,21 @@
|
|
|
10274
10307
|
* Defines if the tree will be opened or not (true/false) or if it should open only until a specific level
|
|
10275
10308
|
*/
|
|
10276
10309
|
this.openLevelOnLoad = false;
|
|
10310
|
+
/**
|
|
10311
|
+
* Allow row check
|
|
10312
|
+
*/
|
|
10313
|
+
this.checkbox = false;
|
|
10277
10314
|
/**
|
|
10278
10315
|
* Defines if should wait and not execute GET method when Datasource is created
|
|
10279
10316
|
*/
|
|
10280
10317
|
this.lazyLoad = true;
|
|
10281
|
-
|
|
10318
|
+
/**
|
|
10319
|
+
* Dictionary of nodePath ponting to Dictionary of path pointing to the condition (applied) return value
|
|
10320
|
+
*/
|
|
10321
|
+
this.appliedConditions = {};
|
|
10322
|
+
/* Conditions of tree */
|
|
10323
|
+
this.factoredConditions = {};
|
|
10324
|
+
this.nodes = this.initNodes(props.nodes || this.nodes);
|
|
10282
10325
|
this.itemIconName = this.getInitValue('itemIconName', props.itemIconName, this.itemIconName);
|
|
10283
10326
|
this.groupIconName = this.getInitValue('groupIconName', props.groupIconName, this.groupIconName);
|
|
10284
10327
|
this.openedIconName = this.getInitValue('openedIconName', props.openedIconName, this.openedIconName);
|
|
@@ -10289,8 +10332,16 @@
|
|
|
10289
10332
|
this.titleField = this.getInitValue('titleField', props.titleField, this.titleField);
|
|
10290
10333
|
this.dataField = this.getInitValue('dataField', props.dataField, this.dataField);
|
|
10291
10334
|
this.openLevelOnLoad = this.getInitValue('openLevelOnLoad', props.openLevelOnLoad, this.openLevelOnLoad);
|
|
10335
|
+
this.checkbox = this.getInitValue('checkbox', props.checkbox, this.checkbox);
|
|
10292
10336
|
this.afterTitleSlot = props.afterTitleSlot || this.afterTitleSlot;
|
|
10293
10337
|
this.toolbarSlot = props.toolbarSlot || this.toolbarSlot;
|
|
10338
|
+
this.titleSlot = props.titleSlot || this.titleSlot;
|
|
10339
|
+
if (props.afterTitleSlot) {
|
|
10340
|
+
this.createConditions([props.afterTitleSlot]);
|
|
10341
|
+
}
|
|
10342
|
+
if (props.titleSlot) {
|
|
10343
|
+
this.createConditions(props.titleSlot);
|
|
10344
|
+
}
|
|
10294
10345
|
if (props.datasource && Object.keys(props.datasource).length) {
|
|
10295
10346
|
this.lazyLoad = props.datasource.lazyLoad !== false;
|
|
10296
10347
|
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 }));
|
|
@@ -10298,6 +10349,12 @@
|
|
|
10298
10349
|
}
|
|
10299
10350
|
this.createAccessors();
|
|
10300
10351
|
}
|
|
10352
|
+
/**
|
|
10353
|
+
* Initialize all the properties of the declared nodes (reactivity)
|
|
10354
|
+
*/
|
|
10355
|
+
initNodes(nodes) {
|
|
10356
|
+
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 || []) })));
|
|
10357
|
+
}
|
|
10301
10358
|
/** Nodes */
|
|
10302
10359
|
get nodes() {
|
|
10303
10360
|
return this.nodesValue;
|
|
@@ -10308,6 +10365,16 @@
|
|
|
10308
10365
|
}
|
|
10309
10366
|
this.nodesValue = value;
|
|
10310
10367
|
}
|
|
10368
|
+
getCheckedNodes() {
|
|
10369
|
+
const selectedNodes = [];
|
|
10370
|
+
this.tree.traverse((node) => {
|
|
10371
|
+
const instanceNode = this.getNode(node.path || []);
|
|
10372
|
+
if (instanceNode === null || instanceNode === void 0 ? void 0 : instanceNode.isChecked) {
|
|
10373
|
+
selectedNodes.push(instanceNode);
|
|
10374
|
+
}
|
|
10375
|
+
});
|
|
10376
|
+
return selectedNodes;
|
|
10377
|
+
}
|
|
10311
10378
|
/** Returns the selected nodes */
|
|
10312
10379
|
get selectedNodes() {
|
|
10313
10380
|
var _a;
|
|
@@ -10406,16 +10473,87 @@
|
|
|
10406
10473
|
setTree(tree) {
|
|
10407
10474
|
this.tree = tree;
|
|
10408
10475
|
}
|
|
10409
|
-
/**
|
|
10410
|
-
|
|
10411
|
-
|
|
10412
|
-
|
|
10413
|
-
|
|
10414
|
-
|
|
10415
|
-
|
|
10416
|
-
|
|
10417
|
-
|
|
10418
|
-
|
|
10476
|
+
/**
|
|
10477
|
+
* Return plain conditions object
|
|
10478
|
+
* @param conditions Conditions object
|
|
10479
|
+
* @param parentPath Path to parent property
|
|
10480
|
+
*/
|
|
10481
|
+
getPlainConditions(conditions, parentPath = '') {
|
|
10482
|
+
let plainData = {};
|
|
10483
|
+
Object.keys(conditions).forEach((key) => {
|
|
10484
|
+
const fullKey = parentPath ? [parentPath, key].join('.') : key;
|
|
10485
|
+
if (typeof conditions[key] === 'object') {
|
|
10486
|
+
plainData = Object.assign(Object.assign({}, plainData), this.getPlainConditions(conditions[key], fullKey));
|
|
10487
|
+
}
|
|
10488
|
+
else {
|
|
10489
|
+
plainData[fullKey] = conditions[key];
|
|
10490
|
+
}
|
|
10491
|
+
});
|
|
10492
|
+
return plainData;
|
|
10493
|
+
}
|
|
10494
|
+
createConditions(children, parentPath = '') {
|
|
10495
|
+
children.forEach((child) => {
|
|
10496
|
+
const path = parentPath ? `${parentPath}.${child.name}` : child.name;
|
|
10497
|
+
if (child.conditions) {
|
|
10498
|
+
const plainConditions = this.getPlainConditions(child.conditions);
|
|
10499
|
+
this.factoredConditions[path] = core.Event.factory(plainConditions);
|
|
10500
|
+
}
|
|
10501
|
+
if (child.children) {
|
|
10502
|
+
this.createConditions(child.children, path);
|
|
10503
|
+
}
|
|
10504
|
+
});
|
|
10505
|
+
}
|
|
10506
|
+
applyCondition(node, factoredConditions) {
|
|
10507
|
+
const appliedConditions = {};
|
|
10508
|
+
Object.keys(factoredConditions).forEach((condition) => {
|
|
10509
|
+
const conditionFunction = factoredConditions[condition];
|
|
10510
|
+
set__default["default"](appliedConditions, condition, conditionFunction(node));
|
|
10511
|
+
});
|
|
10512
|
+
return appliedConditions;
|
|
10513
|
+
}
|
|
10514
|
+
applyChildCondition(node, factoredConditions = this.factoredConditions) {
|
|
10515
|
+
const appliedConditions = {};
|
|
10516
|
+
Object.keys(factoredConditions).forEach((comp) => {
|
|
10517
|
+
const conditions = this.factoredConditions[comp];
|
|
10518
|
+
appliedConditions[comp] = Object.assign({}, this.applyCondition(node, conditions));
|
|
10519
|
+
});
|
|
10520
|
+
return appliedConditions;
|
|
10521
|
+
}
|
|
10522
|
+
reapplyConditions(node) {
|
|
10523
|
+
const nodePath = node.pathStr;
|
|
10524
|
+
if (!nodePath)
|
|
10525
|
+
return {};
|
|
10526
|
+
const appliedConditions = Object.assign({}, this.appliedConditions);
|
|
10527
|
+
appliedConditions[nodePath] = this.applyChildCondition(node);
|
|
10528
|
+
this.appliedConditions = appliedConditions;
|
|
10529
|
+
return this.appliedConditions[nodePath];
|
|
10530
|
+
}
|
|
10531
|
+
getSlotComponent(slot, node, parentPath = '') {
|
|
10532
|
+
const slotArr = Array.isArray(slot) ? slot : [slot];
|
|
10533
|
+
const newComponents = [];
|
|
10534
|
+
slotArr.forEach((component) => {
|
|
10535
|
+
var _a;
|
|
10536
|
+
if (!component)
|
|
10537
|
+
return;
|
|
10538
|
+
const nodePath = node.pathStr;
|
|
10539
|
+
if (!nodePath)
|
|
10540
|
+
return;
|
|
10541
|
+
const compName = component.name;
|
|
10542
|
+
const instanceName = `${compName}_${nodePath}`;
|
|
10543
|
+
const path = parentPath ? `${parentPath}.${compName}` : compName;
|
|
10544
|
+
const newComponent = merge__default["default"]({}, component, (_a = this.appliedConditions[nodePath]) === null || _a === void 0 ? void 0 : _a[path]);
|
|
10545
|
+
const newChildren = this.getSlotComponent(newComponent.children || [], node, path);
|
|
10546
|
+
newComponent.name = instanceName;
|
|
10547
|
+
newComponent.children = newChildren;
|
|
10548
|
+
try {
|
|
10549
|
+
core.Metadata.updateInstance(instanceName, newComponent);
|
|
10550
|
+
}
|
|
10551
|
+
catch (e) {
|
|
10552
|
+
// do nothing
|
|
10553
|
+
}
|
|
10554
|
+
newComponents.push(newComponent);
|
|
10555
|
+
});
|
|
10556
|
+
return newComponents;
|
|
10419
10557
|
}
|
|
10420
10558
|
/** Triggers when dragging nodes have been dropped */
|
|
10421
10559
|
nodeDrop(nodes, position, event, element) {
|
|
@@ -10443,6 +10581,12 @@
|
|
|
10443
10581
|
event, element, component: this, node,
|
|
10444
10582
|
});
|
|
10445
10583
|
}
|
|
10584
|
+
/** Triggers when a node has been checked/unchecked */
|
|
10585
|
+
nodeCheck(node, event, element) {
|
|
10586
|
+
this.callEvent('onNodeCheck', {
|
|
10587
|
+
event, element, component: this, node,
|
|
10588
|
+
});
|
|
10589
|
+
}
|
|
10446
10590
|
clearSelection(nodes) {
|
|
10447
10591
|
const nodesArray = nodes || this.nodes;
|
|
10448
10592
|
nodesArray.forEach((node) => {
|
|
@@ -10452,6 +10596,19 @@
|
|
|
10452
10596
|
}
|
|
10453
10597
|
});
|
|
10454
10598
|
}
|
|
10599
|
+
getNode(path) {
|
|
10600
|
+
return this.searchPath(this.nodes, path);
|
|
10601
|
+
}
|
|
10602
|
+
getParentNode(node) {
|
|
10603
|
+
var _a;
|
|
10604
|
+
return this.getNode(((_a = node.path) === null || _a === void 0 ? void 0 : _a.slice(0, -1)) || []);
|
|
10605
|
+
}
|
|
10606
|
+
searchPath(nodes, path) {
|
|
10607
|
+
const currentNode = (path[0] > -1 && path[0] < nodes.length) ? nodes[path[0]] : undefined;
|
|
10608
|
+
if (currentNode && path.length > 1)
|
|
10609
|
+
return this.searchPath(currentNode.children || [], path.slice(1));
|
|
10610
|
+
return currentNode;
|
|
10611
|
+
}
|
|
10455
10612
|
}
|
|
10456
10613
|
|
|
10457
10614
|
/**
|
|
@@ -11189,15 +11346,23 @@
|
|
|
11189
11346
|
zeedhi: {
|
|
11190
11347
|
light: {
|
|
11191
11348
|
'font-color': 'var(--v-grey-darken2)',
|
|
11192
|
-
'background-base': '#
|
|
11349
|
+
'background-base': '#FDFDFD',
|
|
11350
|
+
'background-base-2': '#F6F6F6',
|
|
11351
|
+
'background-base-3': '#EEE',
|
|
11193
11352
|
'scrollbar-track': 'var(--v-grey-lighten5)',
|
|
11194
11353
|
'scrollbar-thumb': 'var(--v-grey-lighten4)',
|
|
11354
|
+
'badge-background-color': '#f44336',
|
|
11355
|
+
'badge-text-color': '#fff',
|
|
11195
11356
|
},
|
|
11196
11357
|
dark: {
|
|
11197
11358
|
'font-color': 'var(--v-grey-lighten3)',
|
|
11198
|
-
'background-base': '#
|
|
11359
|
+
'background-base': '#1E1E1E',
|
|
11360
|
+
'background-base-2': 'var(--v-grey-darken2)',
|
|
11361
|
+
'background-base-3': 'var(--v-grey-darken4)',
|
|
11199
11362
|
'scrollbar-track': 'var(--v-grey-darken3)',
|
|
11200
11363
|
'scrollbar-thumb': 'var(--v-grey-base)',
|
|
11364
|
+
'badge-background-color': '#f44336',
|
|
11365
|
+
'badge-text-color': '#fff',
|
|
11201
11366
|
},
|
|
11202
11367
|
variables: {
|
|
11203
11368
|
'default-padding': '16px',
|
|
@@ -11215,8 +11380,6 @@
|
|
|
11215
11380
|
'font-body4-weight': '500',
|
|
11216
11381
|
'font-caption-size': '11px',
|
|
11217
11382
|
'font-caption-weight': '400',
|
|
11218
|
-
'badge-background-color': '#f44336',
|
|
11219
|
-
'badge-text-color': '#fff',
|
|
11220
11383
|
},
|
|
11221
11384
|
},
|
|
11222
11385
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeedhi/common",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.45.0",
|
|
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": "b5841549f61c539c52f2438b72e21ccd72156f73"
|
|
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>;
|
|
@@ -63,6 +63,7 @@ export declare class Component implements IComponent {
|
|
|
63
63
|
* Properties accessors to controller.
|
|
64
64
|
*/
|
|
65
65
|
private accessorManager;
|
|
66
|
+
private element?;
|
|
66
67
|
/**
|
|
67
68
|
* Sets view focus method.
|
|
68
69
|
*/
|
|
@@ -128,7 +129,7 @@ export declare class Component implements IComponent {
|
|
|
128
129
|
* Triggered when the component is mounted.
|
|
129
130
|
* @param element Element mounted reference
|
|
130
131
|
*/
|
|
131
|
-
onMounted(element:
|
|
132
|
+
onMounted(element: any): void;
|
|
132
133
|
/**
|
|
133
134
|
* Triggered before the component is destroyed.
|
|
134
135
|
*/
|
|
@@ -142,17 +143,17 @@ export declare class Component implements IComponent {
|
|
|
142
143
|
* @param event DOM event
|
|
143
144
|
* @param element Element clicked
|
|
144
145
|
*/
|
|
145
|
-
click(event
|
|
146
|
+
click(event?: Event, element?: any): void;
|
|
146
147
|
/**
|
|
147
148
|
* Triggered when the component is focused.
|
|
148
149
|
* @param event DOM event
|
|
149
150
|
* @param element Element focused
|
|
150
151
|
*/
|
|
151
|
-
focus(event: Event, element:
|
|
152
|
+
focus(event: Event, element: any): void;
|
|
152
153
|
/**
|
|
153
154
|
* Triggered when the component loses focus.
|
|
154
155
|
* @param event DOM event
|
|
155
156
|
* @param element Element that lost the focus
|
|
156
157
|
*/
|
|
157
|
-
blur(event: Event, element:
|
|
158
|
+
blur(event: Event, element: any): void;
|
|
158
159
|
}
|
|
@@ -24,7 +24,7 @@ export declare class Dashboard extends ComponentRender implements IDashboard {
|
|
|
24
24
|
* @param props Dashboard properties
|
|
25
25
|
*/
|
|
26
26
|
constructor(props: IDashboard);
|
|
27
|
-
onMounted(element:
|
|
27
|
+
onMounted(element: any): void;
|
|
28
28
|
onBeforeDestroy(): void;
|
|
29
29
|
addCard(): void;
|
|
30
30
|
deleteCard(): void;
|
|
@@ -89,9 +89,9 @@ export declare class DateRange extends TextInput implements IDateRange {
|
|
|
89
89
|
parseISODateRangeValue(values: string[]): any;
|
|
90
90
|
private sortDates;
|
|
91
91
|
dateValidation(): boolean | string;
|
|
92
|
-
click(event
|
|
93
|
-
blur(event: Event, element:
|
|
94
|
-
focus(event: Event, element:
|
|
92
|
+
click(event?: Event, element?: any): void;
|
|
93
|
+
blur(event: Event, element: any): void;
|
|
94
|
+
focus(event: Event, element: any): void;
|
|
95
95
|
/**
|
|
96
96
|
* Add date mask
|
|
97
97
|
*/
|
|
@@ -109,7 +109,7 @@ export declare class DateRange extends TextInput implements IDateRange {
|
|
|
109
109
|
* @param event DOM event
|
|
110
110
|
* @param element Text input
|
|
111
111
|
*/
|
|
112
|
-
iconClick(event: Event, element:
|
|
112
|
+
iconClick(event: Event, element: any): void;
|
|
113
113
|
/**
|
|
114
114
|
* Checks if a date format is simple.
|
|
115
115
|
* Simple date formats are the ones that consists only of 'DD', 'MM' or 'YYYY', and mask delimiters
|
|
@@ -79,7 +79,7 @@ export declare class Date extends TextInput implements IDate {
|
|
|
79
79
|
* @param event
|
|
80
80
|
* @param element
|
|
81
81
|
*/
|
|
82
|
-
selectDate(date: string, event?: Event, element?:
|
|
82
|
+
selectDate(date: string, event?: Event, element?: any): void;
|
|
83
83
|
get displayValue(): string;
|
|
84
84
|
set displayValue(newValue: string);
|
|
85
85
|
/**
|
|
@@ -98,9 +98,9 @@ export declare class Date extends TextInput implements IDate {
|
|
|
98
98
|
formatISODateValue(value: string): string;
|
|
99
99
|
parseISODateValue(value: string): any;
|
|
100
100
|
dateValidation(): boolean | string;
|
|
101
|
-
click(event
|
|
102
|
-
blur(event: Event, element:
|
|
103
|
-
focus(event: Event, element:
|
|
101
|
+
click(event?: Event, element?: any): void;
|
|
102
|
+
blur(event: Event, element: any): void;
|
|
103
|
+
focus(event: Event, element: any): void;
|
|
104
104
|
/**
|
|
105
105
|
* Add date mask
|
|
106
106
|
*/
|
|
@@ -118,7 +118,7 @@ export declare class Date extends TextInput implements IDate {
|
|
|
118
118
|
* @param event DOM event
|
|
119
119
|
* @param element Text input
|
|
120
120
|
*/
|
|
121
|
-
iconClick(event: Event, element:
|
|
121
|
+
iconClick(event: Event, element: any): void;
|
|
122
122
|
/**
|
|
123
123
|
* Checks if a date format is simple.
|
|
124
124
|
* Simple date formats are the ones that consists only of 'DD', 'MM' or 'YYYY', and mask delimiters
|
|
@@ -77,14 +77,14 @@ export declare class FileInput extends TextInput implements IFileInput {
|
|
|
77
77
|
* @param event DOM event
|
|
78
78
|
* @param element Element clicked
|
|
79
79
|
*/
|
|
80
|
-
change(event?: Event, element?:
|
|
80
|
+
change(event?: Event, element?: any): void;
|
|
81
81
|
/**
|
|
82
82
|
* Triggered when a removable chip is clicked
|
|
83
83
|
* @param event DOM event
|
|
84
84
|
* @param index Chip index
|
|
85
|
-
* @param element
|
|
85
|
+
* @param element any
|
|
86
86
|
*/
|
|
87
|
-
chipClick(event: Event, index: number, element
|
|
87
|
+
chipClick(event: Event, index: number, element: any): void;
|
|
88
88
|
/**
|
|
89
89
|
* Check if File type is valid using accept attribute
|
|
90
90
|
* @param file File
|