@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
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
|
-
IConfig, Config, Router, Http, URL, IDictionary, init,
|
|
2
|
+
type IConfig, Config, Router, Http, URL, type IDictionary, init,
|
|
3
3
|
} from '@zeedhi/core';
|
|
4
4
|
import {
|
|
5
|
-
TekRestDatasource, ITekRestDatasource,
|
|
5
|
+
TekRestDatasource, type ITekRestDatasource,
|
|
6
6
|
} from '../../../../src';
|
|
7
7
|
|
|
8
8
|
describe('TekRestDatasource', () => {
|
|
@@ -306,9 +306,7 @@ describe('TekRestDatasource', () => {
|
|
|
306
306
|
|
|
307
307
|
await instance.get();
|
|
308
308
|
|
|
309
|
-
|
|
310
|
-
expect(callArgs[0]).toBe('/zeedhi'); // Verifica o primeiro argumento
|
|
311
|
-
expect(callArgs[1]).toMatchObject({
|
|
309
|
+
expect(httpSpy).toHaveBeenCalledWith('/zeedhi', expect.objectContaining({
|
|
312
310
|
params: {
|
|
313
311
|
in: [],
|
|
314
312
|
order: [],
|
|
@@ -316,9 +314,9 @@ describe('TekRestDatasource', () => {
|
|
|
316
314
|
search_in: [],
|
|
317
315
|
page: 1,
|
|
318
316
|
limit: 10,
|
|
319
|
-
search_in_params:
|
|
317
|
+
search_in_params: '{}',
|
|
320
318
|
},
|
|
321
|
-
});
|
|
319
|
+
}));
|
|
322
320
|
});
|
|
323
321
|
});
|
|
324
322
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Http } from '@zeedhi/core';
|
|
2
2
|
import {
|
|
3
|
-
IFilterOperation,
|
|
4
|
-
IFilterPropsComponent,
|
|
5
|
-
IFilterRelation,
|
|
6
|
-
ITekGridColumn,
|
|
3
|
+
type IFilterOperation,
|
|
4
|
+
type IFilterPropsComponent,
|
|
5
|
+
type IFilterRelation,
|
|
6
|
+
type ITekGridColumn,
|
|
7
7
|
TekGrid,
|
|
8
8
|
TekGridColumn,
|
|
9
9
|
} from '../../../../src';
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/* eslint-disable no-underscore-dangle */
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
|
-
Button, Date, Form, IButton, IForm, IModal, ISelectMultiple, Modal, ModalService, SelectMultiple,
|
|
4
|
+
Button, Date, Form, type IButton, type IForm, type IModal, type ISelectMultiple, Modal, ModalService, SelectMultiple,
|
|
5
5
|
} from '@zeedhi/common';
|
|
6
6
|
import {
|
|
7
7
|
Http, Metadata, DateHelper, Config,
|
|
8
8
|
} from '@zeedhi/core';
|
|
9
9
|
import {
|
|
10
|
-
IFilterPropsComponent,
|
|
11
|
-
ITekGridFilterButton,
|
|
12
|
-
TekGrid, TekGridColumn, TekGridFilterButton, TekRestDatasource,
|
|
10
|
+
type IFilterPropsComponent,
|
|
11
|
+
type ITekGridFilterButton,
|
|
12
|
+
TekGrid, type TekGridColumn, TekGridFilterButton, type TekRestDatasource,
|
|
13
13
|
} from '../../../../src';
|
|
14
14
|
import { setClick, getChild } from '../../../__helpers__';
|
|
15
15
|
|
|
@@ -318,7 +318,9 @@ describe('TekGridFilterButton', () => {
|
|
|
318
318
|
formObject.value['grid_filterClick5-filter-AND-CONTAINS-id-0'] = ['example'];
|
|
319
319
|
setClick(applyButtonObject);
|
|
320
320
|
|
|
321
|
-
expect(instance.datasource.filter).toEqual({
|
|
321
|
+
expect(instance.datasource.filter).toEqual({
|
|
322
|
+
id: ['example'],
|
|
323
|
+
});
|
|
322
324
|
|
|
323
325
|
selectObject.checkboxAll = true;
|
|
324
326
|
setClick(applyButtonObject);
|
|
@@ -327,7 +329,7 @@ describe('TekGridFilterButton', () => {
|
|
|
327
329
|
|
|
328
330
|
(Config as any).set({ selectAllCompatibilityMode: true });
|
|
329
331
|
setClick(applyButtonObject);
|
|
330
|
-
expect(instance.datasource.filter).toEqual({});
|
|
332
|
+
expect(instance.datasource.filter).toEqual({ id: 'T' });
|
|
331
333
|
|
|
332
334
|
spy.mockReset();
|
|
333
335
|
});
|
|
@@ -545,17 +547,17 @@ describe('TekGridFilterButton', () => {
|
|
|
545
547
|
|
|
546
548
|
const dateComp = new Date(formElements[0]);
|
|
547
549
|
dateComp.helperValue = 'TODAY';
|
|
548
|
-
dateComp.
|
|
550
|
+
dateComp.change({} as Event, {} as HTMLElement);
|
|
549
551
|
expect((instance.columns[0].filterProps as IFilterPropsComponent).helperValue).toBe('TODAY');
|
|
550
552
|
|
|
551
553
|
const dateComp21 = new Date(formElements[1]);
|
|
552
554
|
dateComp21.helperValue = 'TODAY';
|
|
553
|
-
dateComp21.
|
|
555
|
+
dateComp21.change({} as Event, {} as HTMLElement);
|
|
554
556
|
expect((instance.columns[1].filterProps as IFilterPropsComponent[])[0].helperValue).toBe('TODAY');
|
|
555
557
|
|
|
556
558
|
const dateComp22 = new Date(formElements[2]);
|
|
557
559
|
dateComp22.helperValue = 'TODAY';
|
|
558
|
-
dateComp22.
|
|
560
|
+
dateComp22.change({} as Event, {} as HTMLElement);
|
|
559
561
|
expect((instance.columns[1].filterProps as IFilterPropsComponent[])[1].helperValue).toBe('TODAY');
|
|
560
562
|
|
|
561
563
|
spy.mockReset();
|
|
@@ -952,10 +954,14 @@ describe('TekGridFilterButton', () => {
|
|
|
952
954
|
};
|
|
953
955
|
const applyButtonObject = new Button(applyButton);
|
|
954
956
|
setClick(applyButtonObject);
|
|
955
|
-
expect(instance.datasource.filter).toEqual({
|
|
957
|
+
expect(instance.datasource.filter).toEqual({
|
|
958
|
+
id: '1;2;3',
|
|
959
|
+
name: 'teste',
|
|
960
|
+
salary: '1000',
|
|
961
|
+
});
|
|
956
962
|
expect(beforeApplyFilterCalled).toBeTruthy();
|
|
957
963
|
expect(changeLayoutCalled).toBeTruthy();
|
|
958
|
-
expect(instance.columnHasFilterData({ name: 'name' } as TekGridColumn)).
|
|
964
|
+
expect(instance.columnHasFilterData({ name: 'name' } as TekGridColumn)).toBeTruthy();
|
|
959
965
|
|
|
960
966
|
setClick(applyButtonObject, { defaultPrevented: true });
|
|
961
967
|
expect(spyDatasourceGet).toBeCalledTimes(1);
|