@m4l/testing 0.0.13 → 0.0.14-JT07112025.beta.2

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.
Files changed (45) hide show
  1. package/e2e/commands/components/DataGrid/commands.d.ts +4 -0
  2. package/e2e/commands/components/DataGrid/commands.js +42 -0
  3. package/e2e/commands/components/DataGrid/export.d.ts +7 -0
  4. package/e2e/commands/components/DataGrid/types.d.ts +55 -0
  5. package/e2e/commands/components/DynamicFilter/commands.d.ts +4 -0
  6. package/e2e/commands/components/DynamicFilter/commands.js +12 -0
  7. package/e2e/commands/components/DynamicFilter/types.d.ts +20 -0
  8. package/e2e/commands/components/DynamicSort/commands.d.ts +4 -0
  9. package/e2e/commands/components/DynamicSort/commands.js +10 -0
  10. package/e2e/commands/components/DynamicSort/types.d.ts +10 -0
  11. package/e2e/commands/components/MenuActions/commands.d.ts +4 -0
  12. package/e2e/commands/components/MenuActions/commands.js +8 -0
  13. package/e2e/commands/components/MenuActions/types.d.ts +9 -0
  14. package/e2e/commands/components/Popover/commands.d.ts +4 -0
  15. package/e2e/commands/components/Popover/commands.js +8 -0
  16. package/e2e/commands/components/Popover/types.d.ts +9 -0
  17. package/e2e/commands/components/PropertyValue/commands.d.ts +4 -0
  18. package/e2e/commands/components/PropertyValue/commands.js +8 -0
  19. package/e2e/commands/components/PropertyValue/types.d.ts +14 -0
  20. package/e2e/commands/components/Tab/commands.d.ts +4 -0
  21. package/e2e/commands/components/Tab/commands.js +8 -0
  22. package/e2e/commands/components/Tab/types.d.ts +14 -0
  23. package/e2e/commands/components/WindowBase/commands.d.ts +4 -0
  24. package/e2e/commands/components/WindowBase/commands.js +16 -0
  25. package/e2e/commands/components/WindowBase/types.d.ts +18 -0
  26. package/e2e/commands/components/index.d.ts +8 -0
  27. package/e2e/commands/components/index.js +1 -0
  28. package/e2e/commands/index.d.ts +1 -0
  29. package/e2e/commands/index.js +1 -0
  30. package/e2e/commands/intercepts/index.d.ts +1 -0
  31. package/e2e/commands/intercepts/index.js +1 -0
  32. package/e2e/commands/intercepts/noPrivileges/interceptCommands.d.ts +4 -0
  33. package/e2e/commands/intercepts/noPrivileges/interceptCommands.js +14 -0
  34. package/e2e/commands/intercepts/noPrivileges/types.d.ts +8 -0
  35. package/e2e/commands/register.d.ts +4 -0
  36. package/e2e/commands/register.js +15 -0
  37. package/e2e/cypress.d.ts +20 -0
  38. package/e2e/index.d.ts +1 -0
  39. package/index.d.ts +1 -1
  40. package/index.js +17 -17
  41. package/package.json +51 -9
  42. package/testComponents/DataGrid/helpers.js +6 -2
  43. package/testComponents/DataGrid/types.d.ts +6 -3
  44. package/e2e/findAllColumns/findAllColumns.d.ts +0 -4
  45. package/e2e/findAllColumns/findAllColumns.js +0 -6
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Registra los comandos de DataGrid
3
+ */
4
+ export declare const registerDataGridCommands: () => void;
@@ -0,0 +1,42 @@
1
+ const u = () => {
2
+ Cypress.Commands.add("m4lDataGrid", (e) => {
3
+ cy.get(e).find('[class^="M4LDataGrid-root"]');
4
+ }), Cypress.Commands.add("m4lDataGridValidateVisibleColumns", (e, d, l, r = 1) => {
5
+ let a = 0, i = r;
6
+ d(l).forEach((n) => {
7
+ n.visible && (cy.log(`Validando columna visible: ${n.headerText} , index: ${i}`), i++, cy.m4lDataGrid(e).find("[role=row]").find(`[role=columnheader][aria-colindex=${i}]`).should("have.text", n.headerText), cy.m4lDataGrid(e).find("[role=row]").find(`[role=gridcell][aria-colindex=${i}]`).should("contain", n.value), cy.m4lDataGrid(e).find("[role=row]").find(`[role=columnheader][aria-colindex=${i}]`).then((s) => {
8
+ const o = s.width();
9
+ o !== void 0 && (a += o), cy.m4lDataGrid(e).find("[role=grid]").scrollTo(a, 0, { duration: 100, ensureScrollable: !1 });
10
+ }));
11
+ });
12
+ }), Cypress.Commands.add("m4lDataGridRow", (e, d, l) => {
13
+ let r = 0, a = 0;
14
+ const i = 10, n = d + 1;
15
+ function s() {
16
+ return cy.m4lDataGrid(e).find("[role=row]").not('[aria-rowindex="1"]').filter(`[aria-rowindex="${n}"]`).then((o) => {
17
+ if (o.length > 0) {
18
+ const t = o[0].getBoundingClientRect();
19
+ if (t.top >= 0 && t.left >= 0 && t.bottom <= (window.innerHeight || document.documentElement.clientHeight) && t.right <= (window.innerWidth || document.documentElement.clientWidth))
20
+ return cy.wrap(o);
21
+ }
22
+ if (a >= i)
23
+ throw new Error(`No se encontró la fila ${n} después de ${i} intentos`);
24
+ return a++, cy.m4lDataGrid(e).find("[role=row]").not('[aria-rowindex="1"]').filter((m, t) => {
25
+ const c = t.getBoundingClientRect();
26
+ return c.top >= 0 && c.left >= 0 && c.bottom <= (window.innerHeight || document.documentElement.clientHeight) && c.right <= (window.innerWidth || document.documentElement.clientWidth);
27
+ }).first().then((m) => {
28
+ const t = m.height() || 0;
29
+ return r += t, cy.m4lDataGrid(e).find("[role=grid]").scrollTo(0, r, { duration: 100, ensureScrollable: !1 }).then(() => s());
30
+ });
31
+ });
32
+ }
33
+ return s().find(`[role=gridcell][aria-colindex="${l}"]`);
34
+ }), Cypress.Commands.add("m4lDataGridRowAction", (e, d, l = 1, r = 1) => {
35
+ cy.m4lDataGridRow(e, l, r).find("button").eq(0).should("be.visible", { timeout: 1e4 }).click(), cy.m4lMenuActionsItem(d);
36
+ }), Cypress.Commands.add("m4lDataGridFindAllColumns", (e) => {
37
+ cy.m4lDataGrid(e).find('[class^="M4LDataGrid-actionsConfigContainer"]').find("button").eq(2).click();
38
+ });
39
+ };
40
+ export {
41
+ u as r
42
+ };
@@ -0,0 +1,7 @@
1
+ export type M4LDataGridCypressColumn = {
2
+ key: string;
3
+ value: any;
4
+ headerText: string;
5
+ visible: boolean;
6
+ };
7
+ export type M4LGetCypressDataGridColumnsConfig<T> = (data: T) => M4LDataGridCypressColumn[];
@@ -0,0 +1,55 @@
1
+ import { M4LGetCypressDataGridColumnsConfig } from './export';
2
+ declare global {
3
+ namespace Cypress {
4
+ interface Chainable {
5
+ /**
6
+ * Obtiene el grid
7
+ * @param selector selector del grid
8
+ * @returns el grid
9
+ */
10
+ m4lDataGrid(selector: string): Chainable<Element>
11
+ /**
12
+ * Valida las columnas visibles del grid
13
+ * @param selector selector del grid
14
+ * @param getColumnsConfig función que obtiene las columnas visibles del grid
15
+ * @param mockData datos del grid
16
+ * @param baseColumnIndex índice de la columna a obtener
17
+ */
18
+ m4lDataGridValidateVisibleColumns<T>(
19
+ selector: string,
20
+ getColumnsConfig: M4LGetCypressDataGridColumnsConfig<T>,
21
+ mockData: T,
22
+ baseColumnIndex?: number
23
+ ): Chainable<void>;
24
+ /**
25
+ * Obtiene la fila del grid especificada por el índice de base 1, garantizando que esté visible en el viewport
26
+ * @param selector selector del grid
27
+ * @param targetRowBaseOneIndex índice de la fila a obtener
28
+ * @param baseOneColumnIndex índice de la columna a obtener
29
+ * @returns la fila del grid
30
+ */
31
+ m4lDataGridRow(selector: string, targetRowBaseOneIndex: number, baseOneColumnIndex: number): Chainable<JQuery<HTMLElement>>;
32
+ /**
33
+ * Obtiene el rowAction del menuActions asociado a la fila del grid especificada por el índice de base 1
34
+ * @param selector selector del grid
35
+ * @param menuItemIndex índice del item del menuActions
36
+ * @param baseOneTargetRowIndex índice de la fila a obtener
37
+ * @param baseColbaseOneColumnIndexumnIndex índice de la columna a obtener
38
+ * @returns el rowAction del menuActions asociado a la fila del grid
39
+ */
40
+ m4lDataGridRowAction(
41
+ selector: string,
42
+ menuItemIndex: number,
43
+ baseOnetargetRowIndex?: number,
44
+ baseOneColumnIndex?: number,
45
+ ): Chainable<Element>
46
+
47
+ /**
48
+ * Busca y muestra todas las columnas del grid principal
49
+ */
50
+ m4lDataGridFindAllColumns(selector: string): Chainable<Element>
51
+ }
52
+ }
53
+ }
54
+
55
+ export {};
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Registra los comandos de DynamicFilter
3
+ */
4
+ export declare const registerDynamicFilterCommands: () => void;
@@ -0,0 +1,12 @@
1
+ const n = () => {
2
+ Cypress.Commands.add("m4lDynamicFilterInputClick", () => {
3
+ cy.get('[class*="M4LDynamicFilter-root"]').find('[class*="M4LDynamicFilter-inputFilter"]').find("input").click();
4
+ }), Cypress.Commands.add("m4lDynamicFilterApplyedDateField", (i) => {
5
+ cy.m4lDynamicFilterInputClick(), cy.m4lPopover().find("li").contains(i).click(), cy.m4lPopover().find("button").contains("N_D:[common_actions.intro]").click();
6
+ }), Cypress.Commands.add("m4lDynamicFilterRefreshButton", (i) => {
7
+ cy.get(i).find('[class*="M4LDynamicFilter-root"]').find('[class*="M4LDynamicFilter-actions"]').find('[class*="MuiButtonBase-root"]').eq(1);
8
+ });
9
+ };
10
+ export {
11
+ n as r
12
+ };
@@ -0,0 +1,20 @@
1
+ declare global {
2
+ namespace Cypress {
3
+ interface Chainable {
4
+ /**
5
+ * Click en el input de filtro
6
+ */
7
+ m4lDynamicFilterInputClick(): Chainable<Element>;
8
+ /**
9
+ * Aplicar el filtro de fecha
10
+ */
11
+ m4lDynamicFilterApplyedDateField(dateFieldLabel: string): Chainable<Element>;
12
+ /**
13
+ * Obtiene el botón de refrescar
14
+ */
15
+ m4lDynamicFilterRefreshButton(selector: string): Chainable<Element>;
16
+ }
17
+ }
18
+ }
19
+
20
+ export {};
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Registra los comandos de DynamicSort
3
+ */
4
+ export declare const registerDynamicSortCommands: () => void;
@@ -0,0 +1,10 @@
1
+ const c = () => {
2
+ Cypress.Commands.add("m4lDynamicSortInputClick", () => {
3
+ cy.get('[class*="M4LDynamicSort-root"]').find('[class*="M4LDynamicSort-inputSort"]').find("input").click();
4
+ }), Cypress.Commands.add("m4lDynamicSortApplyedField", (n) => {
5
+ cy.m4lDynamicSortInputClick(), cy.m4lPopover().find("li").contains(n).click(), cy.m4lPopover().find("button").contains("N_D:[common_actions.intro]").click();
6
+ });
7
+ };
8
+ export {
9
+ c as r
10
+ };
@@ -0,0 +1,10 @@
1
+ declare global {
2
+ namespace Cypress {
3
+ interface Chainable {
4
+ m4lDynamicSortInputClick(): Chainable<Element>
5
+ m4lDynamicSortApplyedField(dateFieldLabel: string): Chainable<Element>
6
+ }
7
+ }
8
+ }
9
+
10
+ export {};
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Registra los comandos de MenuActions
3
+ */
4
+ export declare const registerMenuActionsCommands: () => void;
@@ -0,0 +1,8 @@
1
+ const o = () => {
2
+ Cypress.Commands.add("m4lMenuActionsItem", (e) => {
3
+ cy.m4lPopover().find("[role=menuitem]").eq(e).should("be.visible", { timeout: 1e4 });
4
+ });
5
+ };
6
+ export {
7
+ o as r
8
+ };
@@ -0,0 +1,9 @@
1
+ declare global {
2
+ namespace Cypress {
3
+ interface Chainable {
4
+ m4lMenuActionsItem(menuItemIndex: number): Chainable<Element>
5
+ }
6
+ }
7
+ }
8
+
9
+ export {};
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Registra los comandos de Popover
3
+ */
4
+ export declare const registerPopoverCommands: () => void;
@@ -0,0 +1,8 @@
1
+ const o = () => {
2
+ Cypress.Commands.add("m4lPopover", () => {
3
+ cy.get("[role=presentation").find('[class^="MuiPaper-root"]');
4
+ });
5
+ };
6
+ export {
7
+ o as r
8
+ };
@@ -0,0 +1,9 @@
1
+ declare global {
2
+ namespace Cypress {
3
+ interface Chainable {
4
+ m4lPopover(): Chainable<Element>
5
+ }
6
+ }
7
+ }
8
+
9
+ export {};
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Registra los comandos de PropertyValue
3
+ */
4
+ export declare const registerPropertyValueCommands: () => void;
@@ -0,0 +1,8 @@
1
+ const r = () => {
2
+ Cypress.Commands.add("m4lPropertyValue", (e) => {
3
+ cy.get(e).find('[class*="M4LPropertyValue-value"]');
4
+ });
5
+ };
6
+ export {
7
+ r
8
+ };
@@ -0,0 +1,14 @@
1
+ declare global {
2
+ namespace Cypress {
3
+ interface Chainable {
4
+ /**
5
+ * Obtiene el PropertyValue
6
+ * @param selector selector de la propiedad
7
+ * @returns el valor de la propiedad
8
+ */
9
+ m4lPropertyValue(selector: string): Chainable<Element>
10
+ }
11
+ }
12
+ }
13
+
14
+ export {};
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Registra los comandos de Tab
3
+ */
4
+ export declare const registerTabCommands: () => void;
@@ -0,0 +1,8 @@
1
+ const a = () => {
2
+ Cypress.Commands.add("m4lTabButton", (t, s) => {
3
+ cy.get(t).find("[role=tablist]").find("button").eq(s);
4
+ });
5
+ };
6
+ export {
7
+ a as r
8
+ };
@@ -0,0 +1,14 @@
1
+ declare global {
2
+ namespace Cypress {
3
+ interface Chainable {
4
+ /**
5
+ * Obtiene el botón de la pestaña indicada
6
+ * @param tabIndex índice de la pestaña a obtener
7
+ * @returns el botón de la pestaña indicada
8
+ */
9
+ m4lTabButton(selector: string, tabIndex: number): Chainable<Element>
10
+ }
11
+ }
12
+ }
13
+
14
+ export {};
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Registra los comandos de WindowBase
3
+ */
4
+ export declare const registerWindowBaseCommands: () => void;
@@ -0,0 +1,16 @@
1
+ const a = () => {
2
+ Cypress.Commands.add("m4lWindowBaseHeader", () => {
3
+ cy.get('[class^="M4LDragResizeWindowRND-draggableHandle"]').find('[class^="M4LDragResizeWindowRND-draggableCancel"]');
4
+ }), Cypress.Commands.add("m4lWindowBaseLeftAction", (e) => {
5
+ cy.m4lWindowBaseHeader().find("button").eq(e);
6
+ }), Cypress.Commands.add("m4lWindowBaseLeftActionClick", (e) => {
7
+ cy.m4lWindowBaseLeftAction(e).click({ force: !0 });
8
+ }), Cypress.Commands.add("m4lWindowBaseMenuAction", (e) => {
9
+ cy.m4lWindowBaseHeader().find('[class*="M4LMenuActions-root-M4LWindowBase-menuActionsWindowBase"]').find("button").eq(0).click(), cy.get("[role=presentation]").find('[class^="MuiPaper-root"]').find("[role=menuitem]").eq(e);
10
+ }), Cypress.Commands.add("m4lWindowBaseMenuActionDisabled", (e) => {
11
+ cy.m4lWindowBaseMenuAction(e).should("have.attr", "aria-disabled", "true");
12
+ });
13
+ };
14
+ export {
15
+ a as r
16
+ };
@@ -0,0 +1,18 @@
1
+ declare global {
2
+ namespace Cypress {
3
+ interface Chainable {
4
+ m4lWindowBaseHeader(): Chainable<Element>
5
+ m4lWindowBaseLeftAction(buttonPosition: number): Chainable<Element>
6
+ m4lWindowBaseLeftActionClick(buttonPosition: number): Chainable<Element>
7
+ m4lWindowBaseMenuAction(menuItemPosition: number): Chainable<Element>
8
+ m4lWindowBaseMenuActionDisabled(menuItemPosition: number): Chainable<Element>
9
+
10
+ // login(email: string, password: string): Chainable<void>
11
+ // drag(subject: string, options?: Partial<TypeOptions>): Chainable<Element>
12
+ // dismiss(subject: string, options?: Partial<TypeOptions>): Chainable<Element>
13
+ // visit(originalFn: CommandOriginalFn, url: string, options: Partial<VisitOptions>): Chainable<Element>
14
+ }
15
+ }
16
+ }
17
+
18
+ export {};
@@ -0,0 +1,8 @@
1
+ export * from './DataGrid/commands';
2
+ export * from './DynamicFilter/commands';
3
+ export * from './DynamicSort/commands';
4
+ export * from './MenuActions/commands';
5
+ export * from './Popover/commands';
6
+ export * from './PropertyValue/commands';
7
+ export * from './Tab/commands';
8
+ export * from './WindowBase/commands';
@@ -0,0 +1 @@
1
+
@@ -0,0 +1 @@
1
+ export { registerCommands } from './register';
@@ -0,0 +1 @@
1
+
@@ -0,0 +1 @@
1
+ export * from './noPrivileges/interceptCommands';
@@ -0,0 +1 @@
1
+
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Registra los comandos de intercepts
3
+ */
4
+ export declare const registerInterceptNoPrivilegesCommands: () => void;
@@ -0,0 +1,14 @@
1
+ const e = () => {
2
+ Cypress.Commands.add("m4lInterceptNoPrivileges", () => {
3
+ cy.intercept("GET", "**/main/auth/login*", {
4
+ statusCode: 200,
5
+ body: {
6
+ data: {},
7
+ user: {}
8
+ }
9
+ }).as("noPrivileges");
10
+ });
11
+ };
12
+ export {
13
+ e as r
14
+ };
@@ -0,0 +1,8 @@
1
+ declare global {
2
+ namespace Cypress {
3
+ interface Chainable {
4
+ m4lInterceptNoPrivileges(): Chainable<void>;
5
+ }
6
+ }
7
+ }
8
+ export {};
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Registra los comandos de la aplicación
3
+ */
4
+ export declare const registerCommands: () => void;
@@ -0,0 +1,15 @@
1
+ import { r } from "./components/DataGrid/commands.js";
2
+ import { r as m } from "./components/DynamicFilter/commands.js";
3
+ import { r as o } from "./components/DynamicSort/commands.js";
4
+ import { r as s } from "./components/MenuActions/commands.js";
5
+ import { r as e } from "./components/Popover/commands.js";
6
+ import { r as t } from "./components/PropertyValue/commands.js";
7
+ import { r as a } from "./components/Tab/commands.js";
8
+ import { r as i } from "./components/WindowBase/commands.js";
9
+ import { r as n } from "./intercepts/noPrivileges/interceptCommands.js";
10
+ const P = () => {
11
+ r(), m(), o(), s(), e(), t(), a(), i(), n();
12
+ };
13
+ export {
14
+ P as r
15
+ };
@@ -0,0 +1,20 @@
1
+ /// <reference path="./commands/components/DataGrid/types.d.ts" />
2
+ /// <reference path="./commands/components/DynamicFilter/types.d.ts" />
3
+ /// <reference path="./commands/components/DynamicSort/types.d.ts" />
4
+ /// <reference path="./commands/components/MenuActions/types.d.ts" />
5
+ /// <reference path="./commands/components/WindowBase/types.d.ts" />
6
+ /// <reference path="./commands/components/Popover/types.d.ts" />
7
+ /// <reference path="./commands/components/PropertyValue/types.d.ts" />
8
+ /// <reference path="./commands/components/Tab/types.d.ts" />
9
+ /// <reference path="./commands/intercepts/noPrivileges/types.d.ts" />
10
+
11
+ export type { M4LGetCypressDataGridColumnsConfig , M4LDataGridCypressColumn } from './commands/components/DataGrid/export';
12
+
13
+ declare global {
14
+ namespace Cypress {
15
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
16
+ interface Chainable {
17
+ // Los tipos se extienden automáticamente desde los archivos importados
18
+ }
19
+ }
20
+ }
package/e2e/index.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './commands';
package/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- export { findAllColumns } from './e2e/findAllColumns/findAllColumns';
1
+ export * from './e2e/commands';
2
2
  export * from './testComponents';
3
3
  export * from './testTools';
package/index.js CHANGED
@@ -1,27 +1,27 @@
1
- import { f as t } from "./e2e/findAllColumns/findAllColumns.js";
1
+ import { r as t } from "./e2e/commands/register.js";
2
2
  import { t as s } from "./testComponents/DataGrid/helpers.js";
3
3
  import { t as a } from "./testComponents/DynamicFilter/helpers.js";
4
- import { t as n } from "./testComponents/DynamicSort/helpers.js";
5
- import { act as i } from "react";
6
- import { cleanup as l, fireEvent as c, renderHook as d, screen as u, waitFor as F, within as C } from "@testing-library/react";
7
- import { beforeEach as b, describe as h, expect as v } from "vitest";
8
- import { c as g } from "./testTools/utils.js";
9
- import { default as A } from "@testing-library/user-event";
4
+ import { t as p } from "./testComponents/DynamicSort/helpers.js";
5
+ import { act as n } from "react";
6
+ import { cleanup as c, fireEvent as d, renderHook as l, screen as u, waitFor as F, within as C } from "@testing-library/react";
7
+ import { beforeEach as b, describe as g, expect as h } from "vitest";
8
+ import { c as w } from "./testTools/utils.js";
9
+ import { default as H } from "@testing-library/user-event";
10
10
  export {
11
- i as act,
11
+ n as act,
12
12
  b as beforeEach,
13
- l as cleanup,
14
- h as describe,
15
- v as expect,
16
- t as findAllColumns,
17
- c as fireEvent,
18
- g as render,
19
- d as renderHook,
13
+ c as cleanup,
14
+ g as describe,
15
+ h as expect,
16
+ d as fireEvent,
17
+ t as registerCommands,
18
+ w as render,
19
+ l as renderHook,
20
20
  u as screen,
21
21
  s as testColumnConfigs,
22
22
  a as testFilterFields,
23
- n as testSortFields,
24
- A as userEvent,
23
+ p as testSortFields,
24
+ H as userEvent,
25
25
  F as waitFor,
26
26
  C as within
27
27
  };
package/package.json CHANGED
@@ -1,9 +1,30 @@
1
1
  {
2
2
  "name": "@m4l/testing",
3
3
  "description": "Shared testing utilities for MFs",
4
- "version": "0.0.13",
4
+ "version": "0.0.14-JT07112025.beta.2",
5
5
  "license": "UNLICENSED",
6
6
  "author": "M4L Team",
7
+ "scripts": {
8
+ "clean": "npx -y rimraf node_modules **/node_modules/ **/dist/ dist yarn.lock .yarn .config/yarn package-lock.json",
9
+ "typescript": "tsc --noEmit",
10
+ "build": "yarn lint:fix && tsc && vite build && buildM4lPackage",
11
+ "build:only": "vite build && buildM4lPackage",
12
+ "buildM4Lpackage:monorepo": "node ../m4l_vite_plugins/dist/bin/buildM4lPackage.js",
13
+ "build:monorepo": "yarn lint:fix && tsc && vite build",
14
+ "build:only:monorepo": "tsc && vite build && yarn buildM4Lpackage:monorepo",
15
+ "release": "yarn build && npm publish ./dist",
16
+ "release:monorepo": "yarn build:monorepo && cd dist && npm publish",
17
+ "release:monorepo:beta": "yarn build:monorepo && cd dist && npm publish --tag beta",
18
+ "release:monorepo:beta:only": "cd dist && npm publish --tag beta",
19
+ "lint": "npx eslint . --max-warnings 0",
20
+ "lint:fix": "yarn lint --fix --max-warnings 0",
21
+ "lefthook:install": "lefthook install",
22
+ "test": "vitest --config vitest.config.ts",
23
+ "test:only": "vitest --config vitest.config.ts --allowOnly",
24
+ "coverage": "vitest run --coverage",
25
+ "coverage:ui": "vitest --ui run --coverage ",
26
+ "docs": "typedoc --entryPointStrategy expand --tsconfig ./tsconfig.json"
27
+ },
7
28
  "lint-staged": {
8
29
  "*.{js,ts,tsx}": "eslint --fix --max-warnings 0"
9
30
  },
@@ -28,7 +49,7 @@
28
49
  "@vitest/coverage-istanbul": "^3.1.1",
29
50
  "@vitest/coverage-v8": "^3.1.1",
30
51
  "@vitest/ui": "^3.1.1",
31
- "cypress": "^13.14.2",
52
+ "cypress": "^14.1.0",
32
53
  "cypress-vite": "^1.5.0",
33
54
  "happy-dom": "^17.1.9",
34
55
  "jest-environment-jsdom": "^29.7.0",
@@ -40,6 +61,23 @@
40
61
  "react": "^18.0.0",
41
62
  "vitest": "^3.1.1"
42
63
  },
64
+ "devDependencies": {
65
+ "@m4l/components": "^9.0.0",
66
+ "@m4l/config": "^1.1.2",
67
+ "@m4l/vite-plugins": "^1.1.5",
68
+ "@types/node": "^22.7.3",
69
+ "@types/react": "^18.0.0",
70
+ "@types/react-dom": "^18.0.0",
71
+ "eslint": "^9.0.0",
72
+ "lefthook": "^1.7.18",
73
+ "lint-staged": "^15.2.10",
74
+ "react": "^18.0.0",
75
+ "react-dom": "^18.0.0",
76
+ "typescript": "^5.4.5",
77
+ "vite": "^6.3.5",
78
+ "vite-plugin-dts": "^4.2.1",
79
+ "vitest": "^3.1.1"
80
+ },
43
81
  "resolutions": {
44
82
  "glob": "^10.4.5",
45
83
  "react": "^18.0.0",
@@ -64,6 +102,16 @@
64
102
  "module": "./index.js",
65
103
  "type": "module",
66
104
  "types": "./index.d.ts",
105
+ "exports": {
106
+ ".": {
107
+ "types": "./index.d.ts",
108
+ "import": "./index.js",
109
+ "require": null
110
+ },
111
+ "./cypress": {
112
+ "types": "./e2e/cypress.d.ts"
113
+ }
114
+ },
67
115
  "sideEffects": false,
68
116
  "publishConfig": {
69
117
  "access": "public"
@@ -71,11 +119,5 @@
71
119
  "engines": {
72
120
  "node": ">=12.0.0"
73
121
  },
74
- "packageManager": "yarn@4.5.0",
75
- "private": false,
76
- "exports": {
77
- ".": {
78
- "import": "./index.js"
79
- }
80
- }
122
+ "packageManager": "yarn@4.5.0"
81
123
  }
@@ -1,5 +1,5 @@
1
1
  import { expect as t } from "vitest";
2
- const n = (o) => o?.type === "nested", h = (o) => o?.type === "date", d = (o) => o?.type === "boolean", k = (o) => o?.type === "setCheck", C = (o) => o?.type === "price", p = (o) => o?.type === "points", y = (o) => o?.type === "uncertainty", f = (o) => o?.type === "concatenated", m = (o) => o?.type === "chipStatus", V = (o, a) => {
2
+ const n = (o) => o?.type === "nested", h = (o) => o?.type === "date", d = (o) => o?.type === "boolean", k = (o) => o?.type === "setCheck", C = (o) => o?.type === "price", p = (o) => o?.type === "points", y = (o) => o?.type === "uncertainty", f = (o) => o?.type === "concatenated", m = (o) => o?.type === "chipStatus", V = (o) => o?.type === "tags", b = (o, a) => {
3
3
  t(o).toHaveLength(a.length), a.forEach((e, s) => {
4
4
  const l = o[s], u = e.hookCall?.type ?? "none";
5
5
  describe(`Column ${s + 1}: ${e.key} (${u})`, () => {
@@ -56,6 +56,10 @@ const n = (o) => o?.type === "nested", h = (o) => o?.type === "date", d = (o) =>
56
56
  statusesColors: e.hookCall.statusesColors,
57
57
  fallbackColor: e.hookCall.fallbackColor
58
58
  });
59
+ else if (V(e.hookCall))
60
+ t(l.testProps).toEqual({
61
+ fieldValue: e.hookCall.fieldValue
62
+ });
59
63
  else
60
64
  throw new Error(`Unknown hook call type: ${e.hookCall?.type}`);
61
65
  }), it("should have formatter, customFilter and customSort functions", () => {
@@ -69,5 +73,5 @@ const n = (o) => o?.type === "nested", h = (o) => o?.type === "date", d = (o) =>
69
73
  });
70
74
  };
71
75
  export {
72
- V as t
76
+ b as t
73
77
  };
@@ -1,7 +1,7 @@
1
- import { ColumnNestedValueFormatterProps, ColumnDateFormatterProps, ColumnBooleanFormatterProps, ColumnPriceFormatterProps, ColumnPointsFormatterProps, ColumnSetCheckFormatterProps, ColumnUncertaintyFormatterProps, ColumnConcatenatedValuesFormatterProps, Column, ColumnInteractiveCheckFormatterProps, ColumnChipStatusFormatterProps } from '@m4l/components';
1
+ import { ColumnNestedValueFormatterProps, ColumnDateFormatterProps, ColumnBooleanFormatterProps, ColumnPriceFormatterProps, ColumnPointsFormatterProps, ColumnSetCheckFormatterProps, ColumnUncertaintyFormatterProps, ColumnConcatenatedValuesFormatterProps, Column, ColumnInteractiveCheckFormatterProps, ColumnChipStatusFormatterProps, ColumnTagsFormatterProps } from '@m4l/components';
2
2
  type BaseColumnConfig<T> = Column<T, unknown>;
3
3
  type BaseHookCall = {
4
- type: 'nested' | 'date' | 'boolean' | 'price' | 'points' | 'interactiveCheck' | 'setCheck' | 'uncertainty' | 'concatenated' | 'chipStatus';
4
+ type: 'nested' | 'date' | 'boolean' | 'price' | 'points' | 'interactiveCheck' | 'setCheck' | 'uncertainty' | 'concatenated' | 'chipStatus' | 'tags';
5
5
  };
6
6
  export type TestingNestedValueHookCall<T> = BaseHookCall & ColumnNestedValueFormatterProps<T> & {
7
7
  type: 'nested';
@@ -33,8 +33,11 @@ export type TestingConcatenatedHookCall<T> = BaseHookCall & ColumnConcatenatedVa
33
33
  export type TestingChipStatusHookCall<T> = BaseHookCall & ColumnChipStatusFormatterProps<T> & {
34
34
  type: 'chipStatus';
35
35
  };
36
+ export type TestingTagsHookCall<T> = BaseHookCall & ColumnTagsFormatterProps<T> & {
37
+ type: 'tags';
38
+ };
36
39
  export type TestingColumnConfig<T> = BaseColumnConfig<T> & {
37
- hookCall?: TestingNestedValueHookCall<T> | TestingDateHookCall<T> | TestingBooleanHookCall<T> | TestingPriceHookCall<T> | TestingPointsHookCall<T> | TestingInteractiveCheckHookCall<T> | TestingSetCheckHookCall<T> | TestingUncertaintyHookCall<T> | TestingConcatenatedHookCall<T> | TestingChipStatusHookCall<T>;
40
+ hookCall?: TestingNestedValueHookCall<T> | TestingDateHookCall<T> | TestingBooleanHookCall<T> | TestingPriceHookCall<T> | TestingPointsHookCall<T> | TestingInteractiveCheckHookCall<T> | TestingSetCheckHookCall<T> | TestingUncertaintyHookCall<T> | TestingConcatenatedHookCall<T> | TestingChipStatusHookCall<T> | TestingTagsHookCall<T>;
38
41
  };
39
42
  export type TestingColumn = Column<unknown, unknown> & {
40
43
  testProps?: Record<string, unknown>;
@@ -1,4 +0,0 @@
1
- /**
2
- * Busca y muestra todas las columnas del grid principal
3
- */
4
- export declare const findAllColumns: () => void;
@@ -1,6 +0,0 @@
1
- const n = () => {
2
- cy.get('[class^="M4LDataGrid-root"]').find('[class^="M4LDataGrid-actionsConfigContainer"]').find("button").eq(2).click();
3
- };
4
- export {
5
- n as f
6
- };