@zeedhi/teknisa-components-vuetify 1.58.0 → 1.59.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,9 +1,9 @@
|
|
|
1
|
-
import { ModalService, Icons } from '@zeedhi/common';
|
|
1
|
+
import { ModalService, IterableComponentRender, Icons } from '@zeedhi/common';
|
|
2
2
|
import { ZdUserInfo } from '@zeedhi/zd-user-info-vue';
|
|
3
3
|
import { Metadata, Config, dayjs, Singleton, Utils, I18n, Loader, VersionService } from '@zeedhi/core';
|
|
4
4
|
import { Prop, Component, Watch } from 'vue-property-decorator';
|
|
5
|
-
import { BreadcrumbHeader, CardTitle, CrudButton, CrudAddButton, CrudCancelButton, CrudDeleteButton, CrudForm, CrudSaveButton, TekGrid as TekGrid$2, TekRestDatasource, TekMemoryDatasource, TekGridColumn, TekGridColumnsButton as TekGridColumnsButton$1, TekGridLayoutOptions as TekGridLayoutOptions$1, TekFilterHelper, Image, IterableCarousel,
|
|
6
|
-
import { PropWatch, ZdComponent, ZdComponentRender, components as components$1, ZdForm, ZdGrid, ZdIterableColumnsButton,
|
|
5
|
+
import { BreadcrumbHeader, CardTitle, CrudButton, CrudAddButton, CrudCancelButton, CrudDeleteButton, CrudForm, CrudSaveButton, TekGrid as TekGrid$2, TekRestDatasource, TekMemoryDatasource, TekGridColumn, TekGridColumnsButton as TekGridColumnsButton$1, TekGridLayoutOptions as TekGridLayoutOptions$1, TekFilterHelper, Image, IterableCarousel, Loading, Notifications, ProductCard, TekTreeGrid, TekUserInfo as TekUserInfo$1, TekUserInfoList as TekUserInfoList$1 } from '@zeedhi/teknisa-components-common';
|
|
6
|
+
import { PropWatch, ZdComponent, ZdComponentRender, components as components$1, ZdForm, ZdGrid, ZdIterableColumnsButton, ZdIterableComponentRender, ZdLoading, ZdIterable } from '@zeedhi/vuetify';
|
|
7
7
|
import debounce from 'lodash.debounce';
|
|
8
8
|
import Sortable from 'sortablejs';
|
|
9
9
|
import cloneDeep from 'lodash.clonedeep';
|
|
@@ -4525,19 +4525,39 @@ let TekGridLayoutOptions = class TekGridLayoutOptions extends ZdComponentRender
|
|
|
4525
4525
|
return {};
|
|
4526
4526
|
}
|
|
4527
4527
|
applyLayout(layout) {
|
|
4528
|
+
var _a;
|
|
4528
4529
|
let groupParamsChanged = false;
|
|
4529
4530
|
const tableElement = this.getParentTable();
|
|
4530
4531
|
if (!tableElement)
|
|
4531
4532
|
return;
|
|
4532
4533
|
const { grid } = this.instance;
|
|
4533
4534
|
const gridColumns = {};
|
|
4535
|
+
let layoutChanged = false;
|
|
4536
|
+
const gridColumnNames = [];
|
|
4534
4537
|
grid.columns.forEach((column) => {
|
|
4538
|
+
var _a, _b;
|
|
4535
4539
|
gridColumns[column.name] = column;
|
|
4540
|
+
gridColumnNames.push(column.name);
|
|
4541
|
+
const layoutHasCol = (_a = layout === null || layout === void 0 ? void 0 : layout.columns) === null || _a === void 0 ? void 0 : _a.find((layCol) => layCol.name === column.name);
|
|
4542
|
+
// if column doesnt exist in the layout, push it
|
|
4543
|
+
if (layout && !layoutHasCol) {
|
|
4544
|
+
layoutChanged = true;
|
|
4545
|
+
(_b = layout.columns) === null || _b === void 0 ? void 0 : _b.push(column);
|
|
4546
|
+
}
|
|
4536
4547
|
});
|
|
4537
4548
|
const oldOrder = JSON.stringify(grid.datasource.order);
|
|
4538
4549
|
const oldFilter = JSON.stringify(grid.datasource.filter);
|
|
4539
4550
|
const oldDynamicFilter = JSON.stringify(this.datasourceDynamicFilter(grid.datasource));
|
|
4540
4551
|
if (layout) {
|
|
4552
|
+
// removes columns that are in the layout but not in grid
|
|
4553
|
+
layout.columns = (_a = layout.columns) === null || _a === void 0 ? void 0 : _a.filter((column) => {
|
|
4554
|
+
const isInGrid = gridColumnNames.includes(column.name);
|
|
4555
|
+
if (!isInGrid)
|
|
4556
|
+
layoutChanged = true;
|
|
4557
|
+
return isInGrid;
|
|
4558
|
+
});
|
|
4559
|
+
if (layoutChanged)
|
|
4560
|
+
this.instance.updateLayout(layout.name, this.getCurrentLayout(layout.name));
|
|
4541
4561
|
tableElement.style.width = layout.gridWidth || 'auto';
|
|
4542
4562
|
grid.datasource.order = layout.order !== undefined ? layout.order : grid.datasource.order;
|
|
4543
4563
|
grid.datasource.filter = layout.filter !== undefined ? layout.filter : grid.datasource.filter;
|
|
@@ -5195,64 +5215,14 @@ __vue_render__$7._withStripped = true;
|
|
|
5195
5215
|
);
|
|
5196
5216
|
|
|
5197
5217
|
/**
|
|
5198
|
-
*
|
|
5218
|
+
* ZdIterableComponentRender component
|
|
5199
5219
|
*/
|
|
5200
|
-
let TekIterableComponentRender = class TekIterableComponentRender extends
|
|
5220
|
+
let TekIterableComponentRender = class TekIterableComponentRender extends ZdIterableComponentRender {
|
|
5201
5221
|
constructor() {
|
|
5202
5222
|
super(...arguments);
|
|
5203
5223
|
this.instanceType = IterableComponentRender;
|
|
5204
5224
|
}
|
|
5205
5225
|
};
|
|
5206
|
-
__decorate([
|
|
5207
|
-
Prop({ type: Array, default: () => [] })
|
|
5208
|
-
], TekIterableComponentRender.prototype, "footerSlot", void 0);
|
|
5209
|
-
__decorate([
|
|
5210
|
-
Prop({ type: Array, default: () => [] })
|
|
5211
|
-
], TekIterableComponentRender.prototype, "toolbarSlot", void 0);
|
|
5212
|
-
__decorate([
|
|
5213
|
-
Prop({ type: [Object, String] })
|
|
5214
|
-
], TekIterableComponentRender.prototype, "componentMetadata", void 0);
|
|
5215
|
-
__decorate([
|
|
5216
|
-
PropWatch({ type: String, default: 'row' })
|
|
5217
|
-
], TekIterableComponentRender.prototype, "rowPropName", void 0);
|
|
5218
|
-
__decorate([
|
|
5219
|
-
Prop({ type: Array, default: () => ([]) })
|
|
5220
|
-
], TekIterableComponentRender.prototype, "errorSlot", void 0);
|
|
5221
|
-
__decorate([
|
|
5222
|
-
Prop({
|
|
5223
|
-
type: Array,
|
|
5224
|
-
default: () => ([
|
|
5225
|
-
{
|
|
5226
|
-
name: '<<NAME>>_no-data',
|
|
5227
|
-
component: 'ZdText',
|
|
5228
|
-
cssClass: 'no-data',
|
|
5229
|
-
text: 'NO_DATA',
|
|
5230
|
-
},
|
|
5231
|
-
]),
|
|
5232
|
-
})
|
|
5233
|
-
], TekIterableComponentRender.prototype, "noDataSlot", void 0);
|
|
5234
|
-
__decorate([
|
|
5235
|
-
Prop({
|
|
5236
|
-
type: Array,
|
|
5237
|
-
default: () => ([
|
|
5238
|
-
{
|
|
5239
|
-
name: '<<NAME>>_no-result',
|
|
5240
|
-
component: 'ZdText',
|
|
5241
|
-
cssClass: 'no-result',
|
|
5242
|
-
text: 'NO_RESULT',
|
|
5243
|
-
},
|
|
5244
|
-
]),
|
|
5245
|
-
})
|
|
5246
|
-
], TekIterableComponentRender.prototype, "noResultSlot", void 0);
|
|
5247
|
-
__decorate([
|
|
5248
|
-
PropWatch({ type: [Number, String], default: 'auto' })
|
|
5249
|
-
], TekIterableComponentRender.prototype, "height", void 0);
|
|
5250
|
-
__decorate([
|
|
5251
|
-
PropWatch({ type: [Number, String], default: 'none' })
|
|
5252
|
-
], TekIterableComponentRender.prototype, "maxHeight", void 0);
|
|
5253
|
-
__decorate([
|
|
5254
|
-
PropWatch({ type: [Number, String], default: 'none' })
|
|
5255
|
-
], TekIterableComponentRender.prototype, "minHeight", void 0);
|
|
5256
5226
|
TekIterableComponentRender = __decorate([
|
|
5257
5227
|
Component
|
|
5258
5228
|
], TekIterableComponentRender);
|
|
@@ -4527,19 +4527,39 @@
|
|
|
4527
4527
|
return {};
|
|
4528
4528
|
}
|
|
4529
4529
|
applyLayout(layout) {
|
|
4530
|
+
var _a;
|
|
4530
4531
|
let groupParamsChanged = false;
|
|
4531
4532
|
const tableElement = this.getParentTable();
|
|
4532
4533
|
if (!tableElement)
|
|
4533
4534
|
return;
|
|
4534
4535
|
const { grid } = this.instance;
|
|
4535
4536
|
const gridColumns = {};
|
|
4537
|
+
let layoutChanged = false;
|
|
4538
|
+
const gridColumnNames = [];
|
|
4536
4539
|
grid.columns.forEach((column) => {
|
|
4540
|
+
var _a, _b;
|
|
4537
4541
|
gridColumns[column.name] = column;
|
|
4542
|
+
gridColumnNames.push(column.name);
|
|
4543
|
+
const layoutHasCol = (_a = layout === null || layout === void 0 ? void 0 : layout.columns) === null || _a === void 0 ? void 0 : _a.find((layCol) => layCol.name === column.name);
|
|
4544
|
+
// if column doesnt exist in the layout, push it
|
|
4545
|
+
if (layout && !layoutHasCol) {
|
|
4546
|
+
layoutChanged = true;
|
|
4547
|
+
(_b = layout.columns) === null || _b === void 0 ? void 0 : _b.push(column);
|
|
4548
|
+
}
|
|
4538
4549
|
});
|
|
4539
4550
|
const oldOrder = JSON.stringify(grid.datasource.order);
|
|
4540
4551
|
const oldFilter = JSON.stringify(grid.datasource.filter);
|
|
4541
4552
|
const oldDynamicFilter = JSON.stringify(this.datasourceDynamicFilter(grid.datasource));
|
|
4542
4553
|
if (layout) {
|
|
4554
|
+
// removes columns that are in the layout but not in grid
|
|
4555
|
+
layout.columns = (_a = layout.columns) === null || _a === void 0 ? void 0 : _a.filter((column) => {
|
|
4556
|
+
const isInGrid = gridColumnNames.includes(column.name);
|
|
4557
|
+
if (!isInGrid)
|
|
4558
|
+
layoutChanged = true;
|
|
4559
|
+
return isInGrid;
|
|
4560
|
+
});
|
|
4561
|
+
if (layoutChanged)
|
|
4562
|
+
this.instance.updateLayout(layout.name, this.getCurrentLayout(layout.name));
|
|
4543
4563
|
tableElement.style.width = layout.gridWidth || 'auto';
|
|
4544
4564
|
grid.datasource.order = layout.order !== undefined ? layout.order : grid.datasource.order;
|
|
4545
4565
|
grid.datasource.filter = layout.filter !== undefined ? layout.filter : grid.datasource.filter;
|
|
@@ -5197,64 +5217,14 @@
|
|
|
5197
5217
|
);
|
|
5198
5218
|
|
|
5199
5219
|
/**
|
|
5200
|
-
*
|
|
5220
|
+
* ZdIterableComponentRender component
|
|
5201
5221
|
*/
|
|
5202
|
-
let TekIterableComponentRender = class TekIterableComponentRender extends vuetify.
|
|
5222
|
+
let TekIterableComponentRender = class TekIterableComponentRender extends vuetify.ZdIterableComponentRender {
|
|
5203
5223
|
constructor() {
|
|
5204
5224
|
super(...arguments);
|
|
5205
|
-
this.instanceType =
|
|
5225
|
+
this.instanceType = common.IterableComponentRender;
|
|
5206
5226
|
}
|
|
5207
5227
|
};
|
|
5208
|
-
__decorate([
|
|
5209
|
-
vuePropertyDecorator.Prop({ type: Array, default: () => [] })
|
|
5210
|
-
], TekIterableComponentRender.prototype, "footerSlot", void 0);
|
|
5211
|
-
__decorate([
|
|
5212
|
-
vuePropertyDecorator.Prop({ type: Array, default: () => [] })
|
|
5213
|
-
], TekIterableComponentRender.prototype, "toolbarSlot", void 0);
|
|
5214
|
-
__decorate([
|
|
5215
|
-
vuePropertyDecorator.Prop({ type: [Object, String] })
|
|
5216
|
-
], TekIterableComponentRender.prototype, "componentMetadata", void 0);
|
|
5217
|
-
__decorate([
|
|
5218
|
-
vuetify.PropWatch({ type: String, default: 'row' })
|
|
5219
|
-
], TekIterableComponentRender.prototype, "rowPropName", void 0);
|
|
5220
|
-
__decorate([
|
|
5221
|
-
vuePropertyDecorator.Prop({ type: Array, default: () => ([]) })
|
|
5222
|
-
], TekIterableComponentRender.prototype, "errorSlot", void 0);
|
|
5223
|
-
__decorate([
|
|
5224
|
-
vuePropertyDecorator.Prop({
|
|
5225
|
-
type: Array,
|
|
5226
|
-
default: () => ([
|
|
5227
|
-
{
|
|
5228
|
-
name: '<<NAME>>_no-data',
|
|
5229
|
-
component: 'ZdText',
|
|
5230
|
-
cssClass: 'no-data',
|
|
5231
|
-
text: 'NO_DATA',
|
|
5232
|
-
},
|
|
5233
|
-
]),
|
|
5234
|
-
})
|
|
5235
|
-
], TekIterableComponentRender.prototype, "noDataSlot", void 0);
|
|
5236
|
-
__decorate([
|
|
5237
|
-
vuePropertyDecorator.Prop({
|
|
5238
|
-
type: Array,
|
|
5239
|
-
default: () => ([
|
|
5240
|
-
{
|
|
5241
|
-
name: '<<NAME>>_no-result',
|
|
5242
|
-
component: 'ZdText',
|
|
5243
|
-
cssClass: 'no-result',
|
|
5244
|
-
text: 'NO_RESULT',
|
|
5245
|
-
},
|
|
5246
|
-
]),
|
|
5247
|
-
})
|
|
5248
|
-
], TekIterableComponentRender.prototype, "noResultSlot", void 0);
|
|
5249
|
-
__decorate([
|
|
5250
|
-
vuetify.PropWatch({ type: [Number, String], default: 'auto' })
|
|
5251
|
-
], TekIterableComponentRender.prototype, "height", void 0);
|
|
5252
|
-
__decorate([
|
|
5253
|
-
vuetify.PropWatch({ type: [Number, String], default: 'none' })
|
|
5254
|
-
], TekIterableComponentRender.prototype, "maxHeight", void 0);
|
|
5255
|
-
__decorate([
|
|
5256
|
-
vuetify.PropWatch({ type: [Number, String], default: 'none' })
|
|
5257
|
-
], TekIterableComponentRender.prototype, "minHeight", void 0);
|
|
5258
5228
|
TekIterableComponentRender = __decorate([
|
|
5259
5229
|
vuePropertyDecorator.Component
|
|
5260
5230
|
], TekIterableComponentRender);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeedhi/teknisa-components-vuetify",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.59.0",
|
|
4
4
|
"description": "Teknisa Components based on Vuetify",
|
|
5
5
|
"author": "Zeedhi <zeedhi@teknisa.com>",
|
|
6
6
|
"license": "ISC",
|
|
@@ -18,10 +18,6 @@
|
|
|
18
18
|
"watch": "rollup -cw"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@types/lodash.clonedeep": "^4.5.6",
|
|
22
|
-
"@types/lodash.debounce": "^4.0.6",
|
|
23
|
-
"@types/lodash.merge": "^4.6.6",
|
|
24
|
-
"@types/sortablejs": "^1.10.6",
|
|
25
21
|
"@zeedhi/zd-user-info-common": "^1.0.2",
|
|
26
22
|
"@zeedhi/zd-user-info-vue": "^1.0.2",
|
|
27
23
|
"lodash.clonedeep": "^4.5.0",
|
|
@@ -33,6 +29,10 @@
|
|
|
33
29
|
},
|
|
34
30
|
"devDependencies": {
|
|
35
31
|
"@types/jest": "^26.0.19",
|
|
32
|
+
"@types/lodash.clonedeep": "^4.5.6",
|
|
33
|
+
"@types/lodash.debounce": "^4.0.6",
|
|
34
|
+
"@types/lodash.merge": "^4.6.6",
|
|
35
|
+
"@types/sortablejs": "^1.10.6",
|
|
36
36
|
"@vue/test-utils": "^1.1.2",
|
|
37
37
|
"ts-jest": "^26.4.4"
|
|
38
38
|
},
|
|
@@ -41,5 +41,5 @@
|
|
|
41
41
|
"vue": "^2.6.12",
|
|
42
42
|
"vuetify": "^2.4.0"
|
|
43
43
|
},
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "4921b26650ab33735fee16dea49989a5a0439207"
|
|
45
45
|
}
|
|
@@ -1,20 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { IterableComponentRender } from '@zeedhi/teknisa-components-common';
|
|
1
|
+
import { ZdIterableComponentRender } from '@zeedhi/vuetify';
|
|
2
|
+
import { IterableComponentRender } from '@zeedhi/common';
|
|
4
3
|
/**
|
|
5
|
-
*
|
|
4
|
+
* ZdIterableComponentRender component
|
|
6
5
|
*/
|
|
7
|
-
export default class TekIterableComponentRender extends
|
|
8
|
-
footerSlot: IComponentRender[];
|
|
9
|
-
toolbarSlot: IComponentRender[];
|
|
10
|
-
componentMetadata: IComponentRender;
|
|
11
|
-
rowPropName: string;
|
|
12
|
-
errorSlot: IComponentRender[];
|
|
13
|
-
noDataSlot: IComponentRender[];
|
|
14
|
-
noResultSlot: IComponentRender[];
|
|
15
|
-
height: number | string;
|
|
16
|
-
maxHeight: number | string;
|
|
17
|
-
minHeight: number | string;
|
|
6
|
+
export default class TekIterableComponentRender extends ZdIterableComponentRender {
|
|
18
7
|
instance: IterableComponentRender;
|
|
19
8
|
instanceType: typeof IterableComponentRender;
|
|
20
9
|
}
|