@zeedhi/teknisa-components-common 1.114.0 → 3.0.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/.package.json +40 -0
- package/dist/teknisa-components-common.js +112 -0
- package/dist/teknisa-components-common.min.js +112 -0
- package/dist/types/components/index.d.ts +2 -0
- package/{types → dist/types}/components/tek-breadcrumb-header/breadcrumb-header.d.ts +12 -12
- package/{types → dist/types}/components/tek-breadcrumb-header/interfaces.d.ts +6 -6
- package/{types → dist/types}/error/delete-rows-error.d.ts +6 -6
- package/dist/types/index.d.ts +1 -0
- package/environments.json +14 -0
- package/package.json +26 -18
- package/src/components/index.ts +108 -0
- package/src/components/tek-breadcrumb-header/breadcrumb-header.ts +29 -0
- package/src/components/tek-breadcrumb-header/interfaces.ts +7 -0
- package/src/error/delete-rows-error.ts +11 -0
- package/src/index.ts +1 -0
- package/tests/__helpers__/component-event-helper.ts +1 -1
- package/tests/__helpers__/get-child-helper.ts +1 -1
- package/tests/__helpers__/mock-created-helper.ts +1 -1
- package/tests/unit/components/crud/crud-button.spec.ts +1 -1
- package/tests/unit/components/tek-datasource/memory-datasource.spec.ts +1 -11
- package/tests/unit/components/tek-datasource/rest-datasource.spec.ts +5 -7
- package/tests/unit/components/tek-drag-grid/tek-drag-grid.spec.ts +1 -1
- package/tests/unit/components/tek-grid/grid-column.spec.ts +4 -4
- package/tests/unit/components/tek-grid/grid-filter-button.spec.ts +17 -11
- package/tests/unit/components/tek-grid/grid.spec.ts +45 -721
- package/tests/unit/components/tek-grid/layout_options.spec.ts +5 -7
- package/tests/unit/components/tek-user-info/tek-user-info-list.spec.ts +1 -1
- package/tests/unit/components/tek-user-info/tek-user-info.spec.ts +10 -14
- package/tests/unit/components/tree-grid/tree-grid.spec.ts +4 -28
- package/tests/unit/utils/grid-base/export-options/multi-option.spec.ts +2 -2
- package/tests/unit/utils/grid-base/grid-controller.spec.ts +17 -152
- package/tsconfig.build.json +7 -0
- package/dist/tek-components-common.esm.js +0 -4830
- package/dist/tek-components-common.umd.js +0 -4867
- package/tests/unit/utils/grid-base/delete-rows-error.spec.ts +0 -24
- package/types/components/crud/crud-add-button.d.ts +0 -38
- package/types/components/crud/crud-button.d.ts +0 -27
- package/types/components/crud/crud-cancel-button.d.ts +0 -28
- package/types/components/crud/crud-delete-button.d.ts +0 -42
- package/types/components/crud/crud-form.d.ts +0 -46
- package/types/components/crud/crud-save-button.d.ts +0 -24
- package/types/components/crud/interfaces.d.ts +0 -15
- package/types/components/index.d.ts +0 -41
- package/types/components/tek-card-title/card-title.d.ts +0 -14
- package/types/components/tek-card-title/interfaces.d.ts +0 -9
- package/types/components/tek-datasource/interfaces.d.ts +0 -16
- package/types/components/tek-datasource/memory-datasource.d.ts +0 -100
- package/types/components/tek-datasource/rest-datasource.d.ts +0 -103
- package/types/components/tek-drag-grid/interfaces.d.ts +0 -7
- package/types/components/tek-drag-grid/tek-drag-grid.d.ts +0 -36
- package/types/components/tek-grid/filter-helper.d.ts +0 -7
- package/types/components/tek-grid/grid-column.d.ts +0 -45
- package/types/components/tek-grid/grid-columns-button-controller.d.ts +0 -8
- package/types/components/tek-grid/grid-columns-button.d.ts +0 -12
- package/types/components/tek-grid/grid-filter-button.d.ts +0 -31
- package/types/components/tek-grid/grid.d.ts +0 -267
- package/types/components/tek-grid/interfaces.d.ts +0 -203
- package/types/components/tek-grid/layout-options.d.ts +0 -31
- package/types/components/tek-image/image.d.ts +0 -55
- package/types/components/tek-image/interfaces.d.ts +0 -12
- package/types/components/tek-iterable-carousel/interfaces.d.ts +0 -5
- package/types/components/tek-iterable-carousel/iterable-carousel.d.ts +0 -13
- package/types/components/tek-iterable-component-render/interfaces.d.ts +0 -3
- package/types/components/tek-iterable-component-render/iterable-component-render.d.ts +0 -10
- package/types/components/tek-loading/interfaces.d.ts +0 -6
- package/types/components/tek-loading/loading.d.ts +0 -24
- package/types/components/tek-notifications/interfaces.d.ts +0 -22
- package/types/components/tek-notifications/notifications.d.ts +0 -35
- package/types/components/tek-product-card/interfaces.d.ts +0 -19
- package/types/components/tek-product-card/product-card.d.ts +0 -66
- package/types/components/tek-tree-grid/interfaces.d.ts +0 -30
- package/types/components/tek-tree-grid/tree-grid.d.ts +0 -102
- package/types/components/tek-user-info/TekUserInfoController.d.ts +0 -21
- package/types/components/tek-user-info/interfaces.d.ts +0 -27
- package/types/components/tek-user-info/tek-user-info-list.d.ts +0 -31
- package/types/components/tek-user-info/tek-user-info.d.ts +0 -37
- package/types/error/incomplete-groups-error.d.ts +0 -8
- package/types/index.d.ts +0 -2
- package/types/utils/config/config.d.ts +0 -7
- package/types/utils/extract-properties.d.ts +0 -7
- package/types/utils/grid-base/export-options/button-option.d.ts +0 -16
- package/types/utils/grid-base/export-options/index.d.ts +0 -3
- package/types/utils/grid-base/export-options/interfaces.d.ts +0 -5
- package/types/utils/grid-base/export-options/multi-option.d.ts +0 -12
- package/types/utils/grid-base/grid-base.d.ts +0 -59
- package/types/utils/grid-base/grid-controller.d.ts +0 -27
- package/types/utils/index.d.ts +0 -6
- package/types/utils/report-filter/report-filter.d.ts +0 -12
package/.package.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@zeedhi/teknisa-components-common",
|
|
3
|
+
"version": "3.0.0",
|
|
4
|
+
"description": "Teknisa Components Common",
|
|
5
|
+
"author": "Zeedhi <zeedhi@teknisa.com>",
|
|
6
|
+
"license": "ISC",
|
|
7
|
+
"main": "src/index.ts",
|
|
8
|
+
"types": "dist/types/index.d.ts",
|
|
9
|
+
"type": "module",
|
|
10
|
+
"module": "dist/teknisa-components-common.js",
|
|
11
|
+
"packageManager": "npm@8.19.2",
|
|
12
|
+
"publishConfig": {
|
|
13
|
+
"access": "public"
|
|
14
|
+
},
|
|
15
|
+
"scripts": {
|
|
16
|
+
"build": "rollup -c",
|
|
17
|
+
"clean": "rm -rf ./dist",
|
|
18
|
+
"test": "jest --verbose=false",
|
|
19
|
+
"watch": "rollup -cw"
|
|
20
|
+
},
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"lodash.debounce": "^4.0.8",
|
|
23
|
+
"lodash.get": "^4.4.2",
|
|
24
|
+
"lodash.merge": "^4.6.2"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@rollup/plugin-json": "^6.0.0",
|
|
28
|
+
"@rollup/plugin-commonjs": "^24.0.1",
|
|
29
|
+
"@rollup/plugin-typescript": "^11.1.1",
|
|
30
|
+
"@types/lodash.debounce": "^4.0.7",
|
|
31
|
+
"@types/lodash.get": "^4.4.7",
|
|
32
|
+
"@types/lodash.merge": "^4.6.7",
|
|
33
|
+
"@zeedhi/common": "^3.0.0",
|
|
34
|
+
"@zeedhi/core": "^3.0.0"
|
|
35
|
+
},
|
|
36
|
+
"peerDependencies": {
|
|
37
|
+
"@zeedhi/common": "^3.0.0",
|
|
38
|
+
"@zeedhi/core": "^3.0.0"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { Messages } from '@zeedhi/core';
|
|
2
|
+
import { ComponentRender } from '@zeedhi/common';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* BreadcrumbHeader join breadcrumb and title
|
|
6
|
+
*/
|
|
7
|
+
class BreadcrumbHeader extends ComponentRender {
|
|
8
|
+
breadcrumb;
|
|
9
|
+
title = '';
|
|
10
|
+
rightSlot = [];
|
|
11
|
+
constructor(props) {
|
|
12
|
+
super(props);
|
|
13
|
+
this.breadcrumb = this.getBreadcrumbProperties(props.breadcrumb);
|
|
14
|
+
this.title = this.getInitValue('title', props.title, this.title);
|
|
15
|
+
this.rightSlot = props.rightSlot || this.rightSlot;
|
|
16
|
+
}
|
|
17
|
+
getBreadcrumbProperties(breadcrumb) {
|
|
18
|
+
return {
|
|
19
|
+
...breadcrumb,
|
|
20
|
+
name: breadcrumb.name,
|
|
21
|
+
component: 'ZdBreadcrumb',
|
|
22
|
+
divider: '>',
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
Messages.add({
|
|
28
|
+
'pt-BR': {
|
|
29
|
+
translation: {
|
|
30
|
+
NO_NOTIFICATIONS: 'Nenhuma Notificação',
|
|
31
|
+
MARK_ALL_AS_READ: 'Marcar todas como lidas',
|
|
32
|
+
NOTIFICATIONS: 'Notificações',
|
|
33
|
+
SEE_ALL_NOTIFICATIONS: 'Ver todas notificações',
|
|
34
|
+
UNAVAILABLE_IMAGE: 'Imagem indisponível',
|
|
35
|
+
REFRESH: 'Atualizar',
|
|
36
|
+
ACTIONS: 'Ações',
|
|
37
|
+
FILTER: 'Filtro',
|
|
38
|
+
LAYOUT: 'Layout: ',
|
|
39
|
+
NEW_LAYOUT: 'Novo layout',
|
|
40
|
+
DEFAULT_LAYOUT: 'Padrão',
|
|
41
|
+
LAYOUT_MODIFIED: 'O layout atual foi modificado. Crie um novo layout, sobrescreva um existente ou descarte as alterações',
|
|
42
|
+
LAYOUT_NOT_MODIFIED: 'Crie um novo layout ou aplique um dos layouts já existentes',
|
|
43
|
+
LAYOUT_DISCART_CHANGES: 'Descartar alterações',
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
'en-US': {
|
|
47
|
+
translation: {
|
|
48
|
+
NO_NOTIFICATIONS: 'No Notifications',
|
|
49
|
+
MARK_ALL_AS_READ: 'Mark all as read',
|
|
50
|
+
NOTIFICATIONS: 'Notifications',
|
|
51
|
+
SEE_ALL_NOTIFICATIONS: 'See all notifications',
|
|
52
|
+
UNAVAILABLE_IMAGE: 'Unavailable image',
|
|
53
|
+
REFRESH: 'Refresh',
|
|
54
|
+
ACTIONS: 'Actions',
|
|
55
|
+
FILTER: 'Filter',
|
|
56
|
+
LAYOUT: 'Layout: ',
|
|
57
|
+
NEW_LAYOUT: 'New layout',
|
|
58
|
+
DEFAULT_LAYOUT: 'Default',
|
|
59
|
+
LAYOUT_MODIFIED: 'The current layout has been modified. Create a new layout, overwrite an existing one or discard changes',
|
|
60
|
+
LAYOUT_NOT_MODIFIED: 'Create a new layout or apply one of the existing layouts',
|
|
61
|
+
LAYOUT_DISCART_CHANGES: 'Discard changes',
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
'es-CL': {
|
|
65
|
+
translation: {
|
|
66
|
+
NO_NOTIFICATIONS: 'Sin Notificación',
|
|
67
|
+
MARK_ALL_AS_READ: 'Marcar todo como leído',
|
|
68
|
+
NOTIFICATIONS: 'Notificaciones',
|
|
69
|
+
SEE_ALL_NOTIFICATIONS: 'Ver todas las notificaciones',
|
|
70
|
+
UNAVAILABLE_IMAGE: 'Imagen no disponible',
|
|
71
|
+
REFRESH: 'Actualizar',
|
|
72
|
+
ACTIONS: 'Acciones',
|
|
73
|
+
FILTER: 'Filtro',
|
|
74
|
+
LAYOUT: 'Disposición: ',
|
|
75
|
+
NEW_LAYOUT: 'Nueva disposición',
|
|
76
|
+
DEFAULT_LAYOUT: 'Default',
|
|
77
|
+
LAYOUT_MODIFIED: 'La disposición actual ha sido modificada. Cree una nueva disposición, sobrescriba una existente o descarte los cambios',
|
|
78
|
+
LAYOUT_NOT_MODIFIED: 'Cree una nueva disposición o aplique una de las disposiciones existentes',
|
|
79
|
+
LAYOUT_DISCART_CHANGES: 'Descartar los cambios',
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
});
|
|
83
|
+
// export * from './tek-card-title/card-title';
|
|
84
|
+
// export * from './tek-card-title/interfaces';
|
|
85
|
+
// export * from './tek-image/image';
|
|
86
|
+
// export * from './tek-image/interfaces';
|
|
87
|
+
// export * from './tek-product-card/product-card';
|
|
88
|
+
// export * from './tek-product-card/interfaces';
|
|
89
|
+
// export * from './tek-iterable-component-render/iterable-component-render';
|
|
90
|
+
// export * from './tek-iterable-component-render/interfaces';
|
|
91
|
+
// export * from './tek-iterable-carousel/iterable-carousel';
|
|
92
|
+
// export * from './tek-iterable-carousel/interfaces';
|
|
93
|
+
// export * from './tek-loading/loading';
|
|
94
|
+
// export * from './tek-loading/interfaces';
|
|
95
|
+
// export * from './tek-notifications/notifications';
|
|
96
|
+
// export * from './tek-notifications/interfaces';
|
|
97
|
+
// export * from './tek-grid/interfaces';
|
|
98
|
+
// export * from './tek-grid/grid';
|
|
99
|
+
// export * from './tek-grid/grid-column';
|
|
100
|
+
// export * from './tek-grid/grid-columns-button';
|
|
101
|
+
// export * from './tek-grid/layout-options';
|
|
102
|
+
// export * from './tek-grid/filter-helper';
|
|
103
|
+
// export * from './tek-datasource/interfaces';
|
|
104
|
+
// export * from './tek-datasource/rest-datasource';
|
|
105
|
+
// export * from './tek-datasource/memory-datasource';
|
|
106
|
+
// export * from './tek-tree-grid/interfaces';
|
|
107
|
+
// export * from './tek-tree-grid/tree-grid';
|
|
108
|
+
// export * from './tek-user-info/interfaces';
|
|
109
|
+
// export * from './tek-user-info/tek-user-info';
|
|
110
|
+
// export * from './tek-user-info/tek-user-info-list';
|
|
111
|
+
|
|
112
|
+
export { BreadcrumbHeader };
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { Messages } from '@zeedhi/core';
|
|
2
|
+
import { ComponentRender } from '@zeedhi/common';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* BreadcrumbHeader join breadcrumb and title
|
|
6
|
+
*/
|
|
7
|
+
class BreadcrumbHeader extends ComponentRender {
|
|
8
|
+
breadcrumb;
|
|
9
|
+
title = '';
|
|
10
|
+
rightSlot = [];
|
|
11
|
+
constructor(props) {
|
|
12
|
+
super(props);
|
|
13
|
+
this.breadcrumb = this.getBreadcrumbProperties(props.breadcrumb);
|
|
14
|
+
this.title = this.getInitValue('title', props.title, this.title);
|
|
15
|
+
this.rightSlot = props.rightSlot || this.rightSlot;
|
|
16
|
+
}
|
|
17
|
+
getBreadcrumbProperties(breadcrumb) {
|
|
18
|
+
return {
|
|
19
|
+
...breadcrumb,
|
|
20
|
+
name: breadcrumb.name,
|
|
21
|
+
component: 'ZdBreadcrumb',
|
|
22
|
+
divider: '>',
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
Messages.add({
|
|
28
|
+
'pt-BR': {
|
|
29
|
+
translation: {
|
|
30
|
+
NO_NOTIFICATIONS: 'Nenhuma Notificação',
|
|
31
|
+
MARK_ALL_AS_READ: 'Marcar todas como lidas',
|
|
32
|
+
NOTIFICATIONS: 'Notificações',
|
|
33
|
+
SEE_ALL_NOTIFICATIONS: 'Ver todas notificações',
|
|
34
|
+
UNAVAILABLE_IMAGE: 'Imagem indisponível',
|
|
35
|
+
REFRESH: 'Atualizar',
|
|
36
|
+
ACTIONS: 'Ações',
|
|
37
|
+
FILTER: 'Filtro',
|
|
38
|
+
LAYOUT: 'Layout: ',
|
|
39
|
+
NEW_LAYOUT: 'Novo layout',
|
|
40
|
+
DEFAULT_LAYOUT: 'Padrão',
|
|
41
|
+
LAYOUT_MODIFIED: 'O layout atual foi modificado. Crie um novo layout, sobrescreva um existente ou descarte as alterações',
|
|
42
|
+
LAYOUT_NOT_MODIFIED: 'Crie um novo layout ou aplique um dos layouts já existentes',
|
|
43
|
+
LAYOUT_DISCART_CHANGES: 'Descartar alterações',
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
'en-US': {
|
|
47
|
+
translation: {
|
|
48
|
+
NO_NOTIFICATIONS: 'No Notifications',
|
|
49
|
+
MARK_ALL_AS_READ: 'Mark all as read',
|
|
50
|
+
NOTIFICATIONS: 'Notifications',
|
|
51
|
+
SEE_ALL_NOTIFICATIONS: 'See all notifications',
|
|
52
|
+
UNAVAILABLE_IMAGE: 'Unavailable image',
|
|
53
|
+
REFRESH: 'Refresh',
|
|
54
|
+
ACTIONS: 'Actions',
|
|
55
|
+
FILTER: 'Filter',
|
|
56
|
+
LAYOUT: 'Layout: ',
|
|
57
|
+
NEW_LAYOUT: 'New layout',
|
|
58
|
+
DEFAULT_LAYOUT: 'Default',
|
|
59
|
+
LAYOUT_MODIFIED: 'The current layout has been modified. Create a new layout, overwrite an existing one or discard changes',
|
|
60
|
+
LAYOUT_NOT_MODIFIED: 'Create a new layout or apply one of the existing layouts',
|
|
61
|
+
LAYOUT_DISCART_CHANGES: 'Discard changes',
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
'es-CL': {
|
|
65
|
+
translation: {
|
|
66
|
+
NO_NOTIFICATIONS: 'Sin Notificación',
|
|
67
|
+
MARK_ALL_AS_READ: 'Marcar todo como leído',
|
|
68
|
+
NOTIFICATIONS: 'Notificaciones',
|
|
69
|
+
SEE_ALL_NOTIFICATIONS: 'Ver todas las notificaciones',
|
|
70
|
+
UNAVAILABLE_IMAGE: 'Imagen no disponible',
|
|
71
|
+
REFRESH: 'Actualizar',
|
|
72
|
+
ACTIONS: 'Acciones',
|
|
73
|
+
FILTER: 'Filtro',
|
|
74
|
+
LAYOUT: 'Disposición: ',
|
|
75
|
+
NEW_LAYOUT: 'Nueva disposición',
|
|
76
|
+
DEFAULT_LAYOUT: 'Default',
|
|
77
|
+
LAYOUT_MODIFIED: 'La disposición actual ha sido modificada. Cree una nueva disposición, sobrescriba una existente o descarte los cambios',
|
|
78
|
+
LAYOUT_NOT_MODIFIED: 'Cree una nueva disposición o aplique una de las disposiciones existentes',
|
|
79
|
+
LAYOUT_DISCART_CHANGES: 'Descartar los cambios',
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
});
|
|
83
|
+
// export * from './tek-card-title/card-title';
|
|
84
|
+
// export * from './tek-card-title/interfaces';
|
|
85
|
+
// export * from './tek-image/image';
|
|
86
|
+
// export * from './tek-image/interfaces';
|
|
87
|
+
// export * from './tek-product-card/product-card';
|
|
88
|
+
// export * from './tek-product-card/interfaces';
|
|
89
|
+
// export * from './tek-iterable-component-render/iterable-component-render';
|
|
90
|
+
// export * from './tek-iterable-component-render/interfaces';
|
|
91
|
+
// export * from './tek-iterable-carousel/iterable-carousel';
|
|
92
|
+
// export * from './tek-iterable-carousel/interfaces';
|
|
93
|
+
// export * from './tek-loading/loading';
|
|
94
|
+
// export * from './tek-loading/interfaces';
|
|
95
|
+
// export * from './tek-notifications/notifications';
|
|
96
|
+
// export * from './tek-notifications/interfaces';
|
|
97
|
+
// export * from './tek-grid/interfaces';
|
|
98
|
+
// export * from './tek-grid/grid';
|
|
99
|
+
// export * from './tek-grid/grid-column';
|
|
100
|
+
// export * from './tek-grid/grid-columns-button';
|
|
101
|
+
// export * from './tek-grid/layout-options';
|
|
102
|
+
// export * from './tek-grid/filter-helper';
|
|
103
|
+
// export * from './tek-datasource/interfaces';
|
|
104
|
+
// export * from './tek-datasource/rest-datasource';
|
|
105
|
+
// export * from './tek-datasource/memory-datasource';
|
|
106
|
+
// export * from './tek-tree-grid/interfaces';
|
|
107
|
+
// export * from './tek-tree-grid/tree-grid';
|
|
108
|
+
// export * from './tek-user-info/interfaces';
|
|
109
|
+
// export * from './tek-user-info/tek-user-info';
|
|
110
|
+
// export * from './tek-user-info/tek-user-info-list';
|
|
111
|
+
|
|
112
|
+
export { BreadcrumbHeader };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { IBreadcrumbHeader } from './interfaces';
|
|
3
|
-
/**
|
|
4
|
-
* BreadcrumbHeader join breadcrumb and title
|
|
5
|
-
*/
|
|
6
|
-
export declare class BreadcrumbHeader extends ComponentRender implements IBreadcrumbHeader {
|
|
7
|
-
breadcrumb: IBreadcrumbs;
|
|
8
|
-
title: string;
|
|
9
|
-
rightSlot: IComponentRender[];
|
|
10
|
-
constructor(props: IBreadcrumbHeader);
|
|
11
|
-
private getBreadcrumbProperties;
|
|
12
|
-
}
|
|
1
|
+
import { type IBreadcrumbs, ComponentRender, type IComponentRender } from '@zeedhi/common';
|
|
2
|
+
import type { IBreadcrumbHeader } from './interfaces';
|
|
3
|
+
/**
|
|
4
|
+
* BreadcrumbHeader join breadcrumb and title
|
|
5
|
+
*/
|
|
6
|
+
export declare class BreadcrumbHeader extends ComponentRender implements IBreadcrumbHeader {
|
|
7
|
+
breadcrumb: IBreadcrumbs;
|
|
8
|
+
title: string;
|
|
9
|
+
rightSlot: IComponentRender[];
|
|
10
|
+
constructor(props: IBreadcrumbHeader);
|
|
11
|
+
private getBreadcrumbProperties;
|
|
12
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export interface IBreadcrumbHeader extends IComponentRender {
|
|
3
|
-
breadcrumb: IBreadcrumbs;
|
|
4
|
-
title: string;
|
|
5
|
-
rightSlot?: IComponentRender[];
|
|
6
|
-
}
|
|
1
|
+
import type { IBreadcrumbs, IComponentRender } from '@zeedhi/common';
|
|
2
|
+
export interface IBreadcrumbHeader extends IComponentRender {
|
|
3
|
+
breadcrumb: IBreadcrumbs;
|
|
4
|
+
title: string;
|
|
5
|
+
rightSlot?: IComponentRender[];
|
|
6
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Delete rows error
|
|
3
|
-
*/
|
|
4
|
-
export declare class TekGridDeleteRowsError extends Error {
|
|
5
|
-
constructor();
|
|
6
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Delete rows error
|
|
3
|
+
*/
|
|
4
|
+
export declare class TekGridDeleteRowsError extends Error {
|
|
5
|
+
constructor();
|
|
6
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"development": {
|
|
3
|
+
"devDependencies": {
|
|
4
|
+
"@zeedhi/common": "file:../../../zeedhi-client-core/packages/common",
|
|
5
|
+
"@zeedhi/core": "file:../../../zeedhi-client-core/packages/core"
|
|
6
|
+
}
|
|
7
|
+
},
|
|
8
|
+
"production": {
|
|
9
|
+
"devDependencies": {
|
|
10
|
+
"@zeedhi/common": "^3.0.0",
|
|
11
|
+
"@zeedhi/core": "^3.0.0"
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
package/package.json
CHANGED
|
@@ -1,36 +1,44 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeedhi/teknisa-components-common",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "Teknisa Components Common",
|
|
5
5
|
"author": "Zeedhi <zeedhi@teknisa.com>",
|
|
6
6
|
"license": "ISC",
|
|
7
|
-
"main": "
|
|
8
|
-
"
|
|
9
|
-
"
|
|
7
|
+
"main": "src/index.ts",
|
|
8
|
+
"types": "dist/types/index.d.ts",
|
|
9
|
+
"type": "module",
|
|
10
|
+
"module": "dist/teknisa-components-common.js",
|
|
11
|
+
"packageManager": "npm@8.19.2",
|
|
10
12
|
"publishConfig": {
|
|
11
13
|
"access": "public"
|
|
12
14
|
},
|
|
13
15
|
"scripts": {
|
|
14
16
|
"build": "rollup -c",
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"watch": "npm run build -- -w"
|
|
17
|
+
"clean": "rm -rf ./dist",
|
|
18
|
+
"test": "jest --verbose=false",
|
|
19
|
+
"watch": "rollup -cw"
|
|
19
20
|
},
|
|
20
21
|
"dependencies": {
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"lodash.
|
|
24
|
-
"lodash.get": "4.4.*",
|
|
25
|
-
"lodash.merge": "4.6.*"
|
|
22
|
+
"lodash.debounce": "^4.0.8",
|
|
23
|
+
"lodash.get": "^4.4.2",
|
|
24
|
+
"lodash.merge": "^4.6.2"
|
|
26
25
|
},
|
|
27
26
|
"devDependencies": {
|
|
28
|
-
"@
|
|
29
|
-
"@
|
|
30
|
-
"@
|
|
27
|
+
"@rollup/plugin-commonjs": "^24.0.1",
|
|
28
|
+
"@rollup/plugin-json": "^6.0.0",
|
|
29
|
+
"@rollup/plugin-typescript": "^11.1.1",
|
|
30
|
+
"@types/lodash.debounce": "^4.0.7",
|
|
31
|
+
"@types/lodash.get": "^4.4.7",
|
|
32
|
+
"@types/lodash.merge": "^4.6.7",
|
|
33
|
+
"@zeedhi/common": "^3.0.0",
|
|
34
|
+
"@zeedhi/core": "^3.0.0"
|
|
31
35
|
},
|
|
32
36
|
"peerDependencies": {
|
|
33
|
-
"@zeedhi/
|
|
37
|
+
"@zeedhi/common": "^3.0.0",
|
|
38
|
+
"@zeedhi/core": "^3.0.0"
|
|
34
39
|
},
|
|
35
|
-
"
|
|
40
|
+
"env": {
|
|
41
|
+
"NODE_ENV": "production"
|
|
42
|
+
},
|
|
43
|
+
"gitHead": "8f96c641dd2a27edfd63eadf165843c9499d32b0"
|
|
36
44
|
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { Messages } from '@zeedhi/core';
|
|
2
|
+
|
|
3
|
+
Messages.add({
|
|
4
|
+
'pt-BR': {
|
|
5
|
+
translation: {
|
|
6
|
+
NO_NOTIFICATIONS: 'Nenhuma Notificação',
|
|
7
|
+
MARK_ALL_AS_READ: 'Marcar todas como lidas',
|
|
8
|
+
NOTIFICATIONS: 'Notificações',
|
|
9
|
+
SEE_ALL_NOTIFICATIONS: 'Ver todas notificações',
|
|
10
|
+
UNAVAILABLE_IMAGE: 'Imagem indisponível',
|
|
11
|
+
REFRESH: 'Atualizar',
|
|
12
|
+
ACTIONS: 'Ações',
|
|
13
|
+
FILTER: 'Filtro',
|
|
14
|
+
LAYOUT: 'Layout: ',
|
|
15
|
+
NEW_LAYOUT: 'Novo layout',
|
|
16
|
+
DEFAULT_LAYOUT: 'Padrão',
|
|
17
|
+
LAYOUT_MODIFIED: 'O layout atual foi modificado. Crie um novo layout, sobrescreva um existente ou descarte as alterações', // eslint-disable-line
|
|
18
|
+
LAYOUT_NOT_MODIFIED: 'Crie um novo layout ou aplique um dos layouts já existentes',
|
|
19
|
+
LAYOUT_DISCART_CHANGES: 'Descartar alterações',
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
'en-US': {
|
|
23
|
+
translation: {
|
|
24
|
+
NO_NOTIFICATIONS: 'No Notifications',
|
|
25
|
+
MARK_ALL_AS_READ: 'Mark all as read',
|
|
26
|
+
NOTIFICATIONS: 'Notifications',
|
|
27
|
+
SEE_ALL_NOTIFICATIONS: 'See all notifications',
|
|
28
|
+
UNAVAILABLE_IMAGE: 'Unavailable image',
|
|
29
|
+
REFRESH: 'Refresh',
|
|
30
|
+
ACTIONS: 'Actions',
|
|
31
|
+
FILTER: 'Filter',
|
|
32
|
+
LAYOUT: 'Layout: ',
|
|
33
|
+
NEW_LAYOUT: 'New layout',
|
|
34
|
+
DEFAULT_LAYOUT: 'Default',
|
|
35
|
+
LAYOUT_MODIFIED: 'The current layout has been modified. Create a new layout, overwrite an existing one or discard changes', // eslint-disable-line
|
|
36
|
+
LAYOUT_NOT_MODIFIED: 'Create a new layout or apply one of the existing layouts',
|
|
37
|
+
LAYOUT_DISCART_CHANGES: 'Discard changes',
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
'es-CL': {
|
|
41
|
+
translation: {
|
|
42
|
+
NO_NOTIFICATIONS: 'Sin Notificación',
|
|
43
|
+
MARK_ALL_AS_READ: 'Marcar todo como leído',
|
|
44
|
+
NOTIFICATIONS: 'Notificaciones',
|
|
45
|
+
SEE_ALL_NOTIFICATIONS: 'Ver todas las notificaciones',
|
|
46
|
+
UNAVAILABLE_IMAGE: 'Imagen no disponible',
|
|
47
|
+
REFRESH: 'Actualizar',
|
|
48
|
+
ACTIONS: 'Acciones',
|
|
49
|
+
FILTER: 'Filtro',
|
|
50
|
+
LAYOUT: 'Disposición: ',
|
|
51
|
+
NEW_LAYOUT: 'Nueva disposición',
|
|
52
|
+
DEFAULT_LAYOUT: 'Default',
|
|
53
|
+
LAYOUT_MODIFIED: 'La disposición actual ha sido modificada. Cree una nueva disposición, sobrescriba una existente o descarte los cambios', // eslint-disable-line
|
|
54
|
+
LAYOUT_NOT_MODIFIED: 'Cree una nueva disposición o aplique una de las disposiciones existentes',
|
|
55
|
+
LAYOUT_DISCART_CHANGES: 'Descartar los cambios',
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
// export * from './crud/crud-form';
|
|
61
|
+
// export * from './crud/crud-button';
|
|
62
|
+
// export * from './crud/crud-add-button';
|
|
63
|
+
// export * from './crud/crud-cancel-button';
|
|
64
|
+
// export * from './crud/crud-delete-button';
|
|
65
|
+
// export * from './crud/crud-save-button';
|
|
66
|
+
// export * from './crud/interfaces';
|
|
67
|
+
|
|
68
|
+
export * from './tek-breadcrumb-header/breadcrumb-header';
|
|
69
|
+
export * from './tek-breadcrumb-header/interfaces';
|
|
70
|
+
|
|
71
|
+
// export * from './tek-card-title/card-title';
|
|
72
|
+
// export * from './tek-card-title/interfaces';
|
|
73
|
+
|
|
74
|
+
// export * from './tek-image/image';
|
|
75
|
+
// export * from './tek-image/interfaces';
|
|
76
|
+
|
|
77
|
+
// export * from './tek-product-card/product-card';
|
|
78
|
+
// export * from './tek-product-card/interfaces';
|
|
79
|
+
|
|
80
|
+
// export * from './tek-iterable-component-render/iterable-component-render';
|
|
81
|
+
// export * from './tek-iterable-component-render/interfaces';
|
|
82
|
+
|
|
83
|
+
// export * from './tek-iterable-carousel/iterable-carousel';
|
|
84
|
+
// export * from './tek-iterable-carousel/interfaces';
|
|
85
|
+
|
|
86
|
+
// export * from './tek-loading/loading';
|
|
87
|
+
// export * from './tek-loading/interfaces';
|
|
88
|
+
|
|
89
|
+
// export * from './tek-notifications/notifications';
|
|
90
|
+
// export * from './tek-notifications/interfaces';
|
|
91
|
+
|
|
92
|
+
// export * from './tek-grid/interfaces';
|
|
93
|
+
// export * from './tek-grid/grid';
|
|
94
|
+
// export * from './tek-grid/grid-column';
|
|
95
|
+
// export * from './tek-grid/grid-columns-button';
|
|
96
|
+
// export * from './tek-grid/layout-options';
|
|
97
|
+
// export * from './tek-grid/filter-helper';
|
|
98
|
+
|
|
99
|
+
// export * from './tek-datasource/interfaces';
|
|
100
|
+
// export * from './tek-datasource/rest-datasource';
|
|
101
|
+
// export * from './tek-datasource/memory-datasource';
|
|
102
|
+
|
|
103
|
+
// export * from './tek-tree-grid/interfaces';
|
|
104
|
+
// export * from './tek-tree-grid/tree-grid';
|
|
105
|
+
|
|
106
|
+
// export * from './tek-user-info/interfaces';
|
|
107
|
+
// export * from './tek-user-info/tek-user-info';
|
|
108
|
+
// export * from './tek-user-info/tek-user-info-list';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type IBreadcrumbs, ComponentRender, type IComponentRender } from '@zeedhi/common';
|
|
2
|
+
import type { IBreadcrumbHeader } from './interfaces';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* BreadcrumbHeader join breadcrumb and title
|
|
6
|
+
*/
|
|
7
|
+
export class BreadcrumbHeader extends ComponentRender implements IBreadcrumbHeader {
|
|
8
|
+
public breadcrumb: IBreadcrumbs;
|
|
9
|
+
|
|
10
|
+
public title = '';
|
|
11
|
+
|
|
12
|
+
public rightSlot: IComponentRender[] = [];
|
|
13
|
+
|
|
14
|
+
public constructor(props: IBreadcrumbHeader) {
|
|
15
|
+
super(props);
|
|
16
|
+
this.breadcrumb = this.getBreadcrumbProperties(props.breadcrumb);
|
|
17
|
+
this.title = this.getInitValue('title', props.title, this.title);
|
|
18
|
+
this.rightSlot = props.rightSlot || this.rightSlot;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
private getBreadcrumbProperties(breadcrumb: any): IBreadcrumbs {
|
|
22
|
+
return {
|
|
23
|
+
...breadcrumb,
|
|
24
|
+
name: breadcrumb.name,
|
|
25
|
+
component: 'ZdBreadcrumb',
|
|
26
|
+
divider: '>',
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Delete rows error
|
|
3
|
+
*/
|
|
4
|
+
export class TekGridDeleteRowsError extends Error {
|
|
5
|
+
constructor() {
|
|
6
|
+
super('TekGrid can\'t automatically delete rows when selectAllPages property is true.'
|
|
7
|
+
+ ' You should delete them manually using the beforeDelete event and preventing'
|
|
8
|
+
+ ' the default execution');
|
|
9
|
+
this.name = 'TekGridDeleteRowsError';
|
|
10
|
+
}
|
|
11
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components';
|
|
@@ -2,7 +2,7 @@ import { GridEditable } from '@zeedhi/common';
|
|
|
2
2
|
import { KeyMap } from '@zeedhi/core';
|
|
3
3
|
import { CrudButton, CrudForm } from '../../../../src';
|
|
4
4
|
|
|
5
|
-
const dispatchEvent = (key: string, modifiers: any, repeated
|
|
5
|
+
const dispatchEvent = (key: string, modifiers: any, repeated = false) => {
|
|
6
6
|
let prevented = false;
|
|
7
7
|
const event = new KeyboardEvent('keydown', modifiers);
|
|
8
8
|
delete (event as any).key;
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
URL,
|
|
5
5
|
} from '@zeedhi/core';
|
|
6
6
|
import {
|
|
7
|
-
TekMemoryDatasource, ITekMemoryDatasource,
|
|
7
|
+
TekMemoryDatasource, type ITekMemoryDatasource,
|
|
8
8
|
} from '../../../../src';
|
|
9
9
|
|
|
10
10
|
describe('TekMemoryDatasource', () => {
|
|
@@ -390,16 +390,6 @@ describe('TekMemoryDatasource', () => {
|
|
|
390
390
|
expect(instance.dynamicFilter).toEqual({ name: [{ operation: 'EQUALS', relation: 'AND', value: '2' }] });
|
|
391
391
|
urlSpy.mockClear();
|
|
392
392
|
});
|
|
393
|
-
|
|
394
|
-
it('deve chamar setDynamicFilter ao usar setBaseFilter', () => {
|
|
395
|
-
const ds = new TekMemoryDatasource({ uniqueKey: 'id', data: [] });
|
|
396
|
-
const filtro = { ativo: true };
|
|
397
|
-
const spy = jest.spyOn(ds, 'setDynamicFilter');
|
|
398
|
-
|
|
399
|
-
ds.setBaseFilter(filtro);
|
|
400
|
-
|
|
401
|
-
expect(spy).toHaveBeenCalledWith(filtro);
|
|
402
|
-
});
|
|
403
393
|
});
|
|
404
394
|
|
|
405
395
|
describe('clearDynamicFilter()', () => {
|