@wix/auto-patterns 1.39.0 → 1.41.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/cjs/components/AutoPatternsApp/AutoPatternsApp.uni.driver.js +57 -0
- package/dist/cjs/components/AutoPatternsApp/AutoPatternsApp.uni.driver.js.map +1 -0
- package/dist/cjs/components/AutoPatternsCollectionPage/AutoPatternsCollectionPage.js +0 -1
- package/dist/cjs/components/AutoPatternsCollectionPage/AutoPatternsCollectionPage.js.map +1 -1
- package/dist/cjs/components/AutoPatternsEntityPage/ViewModeEntityPage.uni.driver.js +42 -0
- package/dist/cjs/components/AutoPatternsEntityPage/ViewModeEntityPage.uni.driver.js.map +1 -0
- package/dist/cjs/exports/testkit/enzyme.js +10 -0
- package/dist/cjs/exports/testkit/enzyme.js.map +1 -0
- package/dist/cjs/exports/testkit/jsdom.js +10 -0
- package/dist/cjs/exports/testkit/jsdom.js.map +1 -0
- package/dist/cjs/exports/testkit/playwright.js +10 -0
- package/dist/cjs/exports/testkit/playwright.js.map +1 -0
- package/dist/cjs/exports/testkit/puppeteer.js +10 -0
- package/dist/cjs/exports/testkit/puppeteer.js.map +1 -0
- package/dist/cjs/hooks/useActionCell.js +14 -8
- package/dist/cjs/hooks/useActionCell.js.map +1 -1
- package/dist/cjs/hooks/useDragAndDropBaseProps.js +7 -3
- package/dist/cjs/hooks/useDragAndDropBaseProps.js.map +1 -1
- package/dist/cjs/providers/AutoPatternsOverridesContext.js +1 -1
- package/dist/cjs/providers/AutoPatternsOverridesContext.js.map +1 -1
- package/dist/cjs/testkit/enzyme.js +8 -0
- package/dist/cjs/testkit/enzyme.js.map +1 -0
- package/dist/cjs/testkit/jsdom.js +8 -0
- package/dist/cjs/testkit/jsdom.js.map +1 -0
- package/dist/cjs/testkit/playwright.js +8 -0
- package/dist/cjs/testkit/playwright.js.map +1 -0
- package/dist/cjs/testkit/puppeteer.js +8 -0
- package/dist/cjs/testkit/puppeteer.js.map +1 -0
- package/dist/cjs/types/CollectionPageConfig.js.map +1 -1
- package/dist/cjs/types/actions/actionCell.js.map +1 -1
- package/dist/esm/components/AutoPatternsApp/AutoPatternsApp.uni.driver.js +50 -0
- package/dist/esm/components/AutoPatternsApp/AutoPatternsApp.uni.driver.js.map +1 -0
- package/dist/esm/components/AutoPatternsCollectionPage/AutoPatternsCollectionPage.js +0 -1
- package/dist/esm/components/AutoPatternsCollectionPage/AutoPatternsCollectionPage.js.map +1 -1
- package/dist/esm/components/AutoPatternsEntityPage/ViewModeEntityPage.uni.driver.js +37 -0
- package/dist/esm/components/AutoPatternsEntityPage/ViewModeEntityPage.uni.driver.js.map +1 -0
- package/dist/esm/exports/testkit/enzyme.js +2 -0
- package/dist/esm/exports/testkit/enzyme.js.map +1 -0
- package/dist/esm/exports/testkit/jsdom.js +2 -0
- package/dist/esm/exports/testkit/jsdom.js.map +1 -0
- package/dist/esm/exports/testkit/playwright.js +2 -0
- package/dist/esm/exports/testkit/playwright.js.map +1 -0
- package/dist/esm/exports/testkit/puppeteer.js +2 -0
- package/dist/esm/exports/testkit/puppeteer.js.map +1 -0
- package/dist/esm/hooks/useActionCell.js +14 -8
- package/dist/esm/hooks/useActionCell.js.map +1 -1
- package/dist/esm/hooks/useDragAndDropBaseProps.js +8 -4
- package/dist/esm/hooks/useDragAndDropBaseProps.js.map +1 -1
- package/dist/esm/providers/AutoPatternsOverridesContext.js.map +1 -1
- package/dist/esm/testkit/enzyme.js +4 -0
- package/dist/esm/testkit/enzyme.js.map +1 -0
- package/dist/esm/testkit/jsdom.js +4 -0
- package/dist/esm/testkit/jsdom.js.map +1 -0
- package/dist/esm/testkit/playwright.js +4 -0
- package/dist/esm/testkit/playwright.js.map +1 -0
- package/dist/esm/testkit/puppeteer.js +4 -0
- package/dist/esm/testkit/puppeteer.js.map +1 -0
- package/dist/esm/types/CollectionPageConfig.js.map +1 -1
- package/dist/esm/types/actions/actionCell.js.map +1 -1
- package/dist/types/components/AutoPatternsApp/AutoPatternsApp.uni.driver.d.ts +45 -0
- package/dist/types/components/AutoPatternsApp/AutoPatternsApp.uni.driver.d.ts.map +1 -0
- package/dist/types/components/AutoPatternsEntityPage/ViewModeEntityPage.uni.driver.d.ts +81 -0
- package/dist/types/components/AutoPatternsEntityPage/ViewModeEntityPage.uni.driver.d.ts.map +1 -0
- package/dist/types/exports/testkit/enzyme.d.ts +2 -0
- package/dist/types/exports/testkit/enzyme.d.ts.map +1 -0
- package/dist/types/exports/testkit/jsdom.d.ts +2 -0
- package/dist/types/exports/testkit/jsdom.d.ts.map +1 -0
- package/dist/types/exports/testkit/playwright.d.ts +2 -0
- package/dist/types/exports/testkit/playwright.d.ts.map +1 -0
- package/dist/types/exports/testkit/puppeteer.d.ts +2 -0
- package/dist/types/exports/testkit/puppeteer.d.ts.map +1 -0
- package/dist/types/hooks/useActionCell.d.ts.map +1 -1
- package/dist/types/hooks/useDragAndDropBaseProps.d.ts.map +1 -1
- package/dist/types/providers/AutoPatternsOverridesContext.d.ts +1 -0
- package/dist/types/providers/AutoPatternsOverridesContext.d.ts.map +1 -1
- package/dist/types/testkit/enzyme.d.ts +16 -0
- package/dist/types/testkit/enzyme.d.ts.map +1 -0
- package/dist/types/testkit/jsdom.d.ts +16 -0
- package/dist/types/testkit/jsdom.d.ts.map +1 -0
- package/dist/types/testkit/playwright.d.ts +20 -0
- package/dist/types/testkit/playwright.d.ts.map +1 -0
- package/dist/types/testkit/puppeteer.d.ts +20 -0
- package/dist/types/testkit/puppeteer.d.ts.map +1 -0
- package/dist/types/types/CollectionPageConfig.d.ts +6 -0
- package/dist/types/types/CollectionPageConfig.d.ts.map +1 -1
- package/dist/types/types/actions/actionCell.d.ts +13 -1
- package/dist/types/types/actions/actionCell.d.ts.map +1 -1
- package/mcp-docs/action_cell.md +66 -8
- package/mcp-docs/app_config_structure.md +53 -43
- package/mcp-docs/auto-patterns-guide.md +370 -66
- package/mcp-docs/error_handling.md +251 -15
- package/package.json +43 -15
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { EntityPageUniDriver, TableUniDriver, GridUniDriver, PageErrorStateUniDriver, CollectionPageUniDriver, TableGridSwitchUniDriver } from '@wix/patterns/testkit/unidriver';
|
|
2
|
+
import { MessageModalLayoutUniDriver } from '@wix/design-system/dist/testkit/unidriver';
|
|
3
|
+
import ViewModeEntityPageUniDriver from '../AutoPatternsEntityPage/ViewModeEntityPage.uni.driver';
|
|
4
|
+
import { EntityPageFieldsUniDriver } from '../../__tests__/AutoPatternsEntityPage/AutoPatternsEntityPageFields.uni.driver';
|
|
5
|
+
import { baseUniDriverFactory as testUtilsBaseUniDriverFactory } from '@wix/wix-ui-test-utils/base-driver';
|
|
6
|
+
export function baseUniDriverFactory(base) {
|
|
7
|
+
const driver = testUtilsBaseUniDriverFactory(base);
|
|
8
|
+
return {
|
|
9
|
+
exists: () => driver.exists(),
|
|
10
|
+
click: () => driver.click(),
|
|
11
|
+
element: () => driver.element(),
|
|
12
|
+
base: driver.base
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// Type definitions for the return values of each driver function
|
|
17
|
+
|
|
18
|
+
export const AutoPatternsAppUniDriver = (base, body) => {
|
|
19
|
+
const entityPage = () => EntityPageUniDriver(base.$('[data-hook="auto-patterns-entity-page"]'), body);
|
|
20
|
+
const collectionPage = () => CollectionPageUniDriver(base.$('[data-hook="auto-patterns-page"]'), body);
|
|
21
|
+
const viewModeEntityPage = () => ViewModeEntityPageUniDriver(base.$('[data-hook="view-mode-entity-page"]'), body);
|
|
22
|
+
const table = () => TableUniDriver(base.$('[data-hook="auto-patterns-table"]'), body);
|
|
23
|
+
const grid = () => GridUniDriver(base.$('[data-hook="auto-patterns-grid"]'), body);
|
|
24
|
+
const tableGridSwitch = () => TableGridSwitchUniDriver(base.$('[data-hook="auto-patterns-table-grid-switch"]'), body);
|
|
25
|
+
const pageErrorState = () => PageErrorStateUniDriver(base.$('[data-hook="error-page"]'), body);
|
|
26
|
+
const bulkDeleteModal = () => MessageModalLayoutUniDriver(body.$('[data-hook="bulk-delete-modal"]'), body);
|
|
27
|
+
const entityPageFields = () => EntityPageFieldsUniDriver(base, body);
|
|
28
|
+
return {
|
|
29
|
+
...baseUniDriverFactory(base),
|
|
30
|
+
/** Returns CollectionPage driver */
|
|
31
|
+
collectionPage,
|
|
32
|
+
/** Returns EntityPage driver */
|
|
33
|
+
entityPage,
|
|
34
|
+
/** Returns ViewModeEntityPage driver */
|
|
35
|
+
viewModeEntityPage,
|
|
36
|
+
/** Returns Table driver */
|
|
37
|
+
table,
|
|
38
|
+
/** Returns Grid driver */
|
|
39
|
+
grid,
|
|
40
|
+
/** Returns TableGridSwitch driver */
|
|
41
|
+
tableGridSwitch,
|
|
42
|
+
/** Returns PageErrorState driver */
|
|
43
|
+
pageErrorState,
|
|
44
|
+
/** Returns BulkDeleteModal driver */
|
|
45
|
+
bulkDeleteModal,
|
|
46
|
+
/** Returns EntityPageFields driver */
|
|
47
|
+
entityPageFields
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=AutoPatternsApp.uni.driver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["EntityPageUniDriver","TableUniDriver","GridUniDriver","PageErrorStateUniDriver","CollectionPageUniDriver","TableGridSwitchUniDriver","MessageModalLayoutUniDriver","ViewModeEntityPageUniDriver","EntityPageFieldsUniDriver","baseUniDriverFactory","testUtilsBaseUniDriverFactory","base","driver","exists","click","element","AutoPatternsAppUniDriver","body","entityPage","$","collectionPage","viewModeEntityPage","table","grid","tableGridSwitch","pageErrorState","bulkDeleteModal","entityPageFields"],"sources":["../../../../src/components/AutoPatternsApp/AutoPatternsApp.uni.driver.ts"],"sourcesContent":["import { UniDriver } from '@wix/wix-ui-test-utils/unidriver';\nimport {\n EntityPageUniDriver,\n TableUniDriver,\n GridUniDriver,\n PageErrorStateUniDriver,\n CollectionPageUniDriver,\n TableGridSwitchUniDriver,\n} from '@wix/patterns/testkit/unidriver';\nimport { MessageModalLayoutUniDriver } from '@wix/design-system/dist/testkit/unidriver';\nimport ViewModeEntityPageUniDriver from '../AutoPatternsEntityPage/ViewModeEntityPage.uni.driver';\nimport { EntityPageFieldsUniDriver } from '../../__tests__/AutoPatternsEntityPage/AutoPatternsEntityPageFields.uni.driver';\nimport { baseUniDriverFactory as testUtilsBaseUniDriverFactory } from '@wix/wix-ui-test-utils/base-driver';\n\nexport function baseUniDriverFactory(base: UniDriver) {\n const driver = testUtilsBaseUniDriverFactory(base);\n return {\n exists: () => driver.exists(),\n click: () => driver.click(),\n element: () => driver.element(),\n base: driver.base,\n };\n}\n\n// Type definitions for the return values of each driver function\nexport type EntityPageDriver = ReturnType<typeof EntityPageUniDriver>;\nexport type CollectionPageDriver = ReturnType<typeof CollectionPageUniDriver>;\nexport type ViewModeEntityPageDriver = ReturnType<\n typeof ViewModeEntityPageUniDriver\n>;\nexport type TableDriver = ReturnType<typeof TableUniDriver>;\nexport type GridDriver = ReturnType<typeof GridUniDriver>;\nexport type TableGridSwitchDriver = ReturnType<typeof TableGridSwitchUniDriver>;\nexport type PageErrorStateDriver = ReturnType<typeof PageErrorStateUniDriver>;\nexport type BulkDeleteModalDriver = ReturnType<\n typeof MessageModalLayoutUniDriver\n>;\nexport type EntityPageFieldsDriver = ReturnType<\n typeof EntityPageFieldsUniDriver\n>;\n\nexport const AutoPatternsAppUniDriver = (base: UniDriver, body: UniDriver) => {\n const entityPage: () => EntityPageDriver = () =>\n EntityPageUniDriver(\n base.$('[data-hook=\"auto-patterns-entity-page\"]'),\n body,\n );\n\n const collectionPage: () => CollectionPageDriver = () =>\n CollectionPageUniDriver(base.$('[data-hook=\"auto-patterns-page\"]'), body);\n\n const viewModeEntityPage: () => ViewModeEntityPageDriver = () =>\n ViewModeEntityPageUniDriver(\n base.$('[data-hook=\"view-mode-entity-page\"]'),\n body,\n );\n\n const table: () => TableDriver = () =>\n TableUniDriver(base.$('[data-hook=\"auto-patterns-table\"]'), body);\n\n const grid: () => GridDriver = () =>\n GridUniDriver(base.$('[data-hook=\"auto-patterns-grid\"]'), body);\n\n const tableGridSwitch: () => TableGridSwitchDriver = () =>\n TableGridSwitchUniDriver(\n base.$('[data-hook=\"auto-patterns-table-grid-switch\"]'),\n body,\n );\n\n const pageErrorState: () => PageErrorStateDriver = () =>\n PageErrorStateUniDriver(base.$('[data-hook=\"error-page\"]'), body);\n\n const bulkDeleteModal: () => BulkDeleteModalDriver = () =>\n MessageModalLayoutUniDriver(\n body.$('[data-hook=\"bulk-delete-modal\"]'),\n body,\n );\n\n const entityPageFields: () => EntityPageFieldsDriver = () =>\n EntityPageFieldsUniDriver(base, body);\n\n return {\n ...baseUniDriverFactory(base),\n /** Returns CollectionPage driver */\n collectionPage,\n\n /** Returns EntityPage driver */\n entityPage,\n\n /** Returns ViewModeEntityPage driver */\n viewModeEntityPage,\n\n /** Returns Table driver */\n table,\n\n /** Returns Grid driver */\n grid,\n\n /** Returns TableGridSwitch driver */\n tableGridSwitch,\n\n /** Returns PageErrorState driver */\n pageErrorState,\n\n /** Returns BulkDeleteModal driver */\n bulkDeleteModal,\n\n /** Returns EntityPageFields driver */\n entityPageFields,\n };\n};\n"],"mappings":"AACA,SACEA,mBAAmB,EACnBC,cAAc,EACdC,aAAa,EACbC,uBAAuB,EACvBC,uBAAuB,EACvBC,wBAAwB,QACnB,iCAAiC;AACxC,SAASC,2BAA2B,QAAQ,2CAA2C;AACvF,OAAOC,2BAA2B,MAAM,yDAAyD;AACjG,SAASC,yBAAyB,QAAQ,gFAAgF;AAC1H,SAASC,oBAAoB,IAAIC,6BAA6B,QAAQ,oCAAoC;AAE1G,OAAO,SAASD,oBAAoBA,CAACE,IAAe,EAAE;EACpD,MAAMC,MAAM,GAAGF,6BAA6B,CAACC,IAAI,CAAC;EAClD,OAAO;IACLE,MAAM,EAAEA,CAAA,KAAMD,MAAM,CAACC,MAAM,CAAC,CAAC;IAC7BC,KAAK,EAAEA,CAAA,KAAMF,MAAM,CAACE,KAAK,CAAC,CAAC;IAC3BC,OAAO,EAAEA,CAAA,KAAMH,MAAM,CAACG,OAAO,CAAC,CAAC;IAC/BJ,IAAI,EAAEC,MAAM,CAACD;EACf,CAAC;AACH;;AAEA;;AAiBA,OAAO,MAAMK,wBAAwB,GAAGA,CAACL,IAAe,EAAEM,IAAe,KAAK;EAC5E,MAAMC,UAAkC,GAAGA,CAAA,KACzClB,mBAAmB,CACjBW,IAAI,CAACQ,CAAC,CAAC,yCAAyC,CAAC,EACjDF,IACF,CAAC;EAEH,MAAMG,cAA0C,GAAGA,CAAA,KACjDhB,uBAAuB,CAACO,IAAI,CAACQ,CAAC,CAAC,kCAAkC,CAAC,EAAEF,IAAI,CAAC;EAE3E,MAAMI,kBAAkD,GAAGA,CAAA,KACzDd,2BAA2B,CACzBI,IAAI,CAACQ,CAAC,CAAC,qCAAqC,CAAC,EAC7CF,IACF,CAAC;EAEH,MAAMK,KAAwB,GAAGA,CAAA,KAC/BrB,cAAc,CAACU,IAAI,CAACQ,CAAC,CAAC,mCAAmC,CAAC,EAAEF,IAAI,CAAC;EAEnE,MAAMM,IAAsB,GAAGA,CAAA,KAC7BrB,aAAa,CAACS,IAAI,CAACQ,CAAC,CAAC,kCAAkC,CAAC,EAAEF,IAAI,CAAC;EAEjE,MAAMO,eAA4C,GAAGA,CAAA,KACnDnB,wBAAwB,CACtBM,IAAI,CAACQ,CAAC,CAAC,+CAA+C,CAAC,EACvDF,IACF,CAAC;EAEH,MAAMQ,cAA0C,GAAGA,CAAA,KACjDtB,uBAAuB,CAACQ,IAAI,CAACQ,CAAC,CAAC,0BAA0B,CAAC,EAAEF,IAAI,CAAC;EAEnE,MAAMS,eAA4C,GAAGA,CAAA,KACnDpB,2BAA2B,CACzBW,IAAI,CAACE,CAAC,CAAC,iCAAiC,CAAC,EACzCF,IACF,CAAC;EAEH,MAAMU,gBAA8C,GAAGA,CAAA,KACrDnB,yBAAyB,CAACG,IAAI,EAAEM,IAAI,CAAC;EAEvC,OAAO;IACL,GAAGR,oBAAoB,CAACE,IAAI,CAAC;IAC7B;IACAS,cAAc;IAEd;IACAF,UAAU;IAEV;IACAG,kBAAkB;IAElB;IACAC,KAAK;IAEL;IACAC,IAAI;IAEJ;IACAC,eAAe;IAEf;IACAC,cAAc;IAEd;IACAC,eAAe;IAEf;IACAC;EACF,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -15,7 +15,6 @@ export const AutoPatternsCollectionPage = _ref => {
|
|
|
15
15
|
collectionPageActions: configuration.actions
|
|
16
16
|
});
|
|
17
17
|
return /*#__PURE__*/React.createElement(CollectionPage, {
|
|
18
|
-
height: "100vh",
|
|
19
18
|
dataHook: "auto-patterns-page"
|
|
20
19
|
}, /*#__PURE__*/React.createElement(CollectionPage.Header, {
|
|
21
20
|
title: title,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","CollectionPage","AutoPatternsCollectionPageContent","useCollectionPageActions","AutoPatternsCollectionPageFooter","AutoPatternsCollectionPage","_ref","configuration","title","subtitle","actions","collectionPageActions","createElement","
|
|
1
|
+
{"version":3,"names":["React","CollectionPage","AutoPatternsCollectionPageContent","useCollectionPageActions","AutoPatternsCollectionPageFooter","AutoPatternsCollectionPage","_ref","configuration","title","subtitle","actions","collectionPageActions","createElement","dataHook","Header","primaryAction","primaryActions","secondaryActions","Content","Footer"],"sources":["../../../../src/components/AutoPatternsCollectionPage/AutoPatternsCollectionPage.tsx"],"sourcesContent":["import React from 'react';\nimport { CollectionPage } from '@wix/patterns/page';\nimport { AutoPatternsCollectionPageContent } from '../AutoPatternsCollectionPageContent';\nimport { CollectionPageConfig } from '../../types/CollectionPageConfig';\nimport { useCollectionPageActions } from '../../hooks/useCollectionPageActions';\nimport { AutoPatternsCollectionPageFooter } from '../AutoPatternsCollectionPageFooter/AutoPatternsCollectionPageFooter';\n\nexport interface AutoPatternsCollectionPageProps {\n configuration: CollectionPageConfig;\n}\n\nexport const AutoPatternsCollectionPage: React.FC<\n AutoPatternsCollectionPageProps\n> = ({ configuration }) => {\n const { title, subtitle } = configuration;\n\n const actions = useCollectionPageActions({\n collectionPageActions: configuration.actions,\n });\n\n return (\n <CollectionPage dataHook=\"auto-patterns-page\">\n <CollectionPage.Header\n title={title}\n subtitle={subtitle}\n primaryAction={actions.primaryActions}\n secondaryActions={actions.secondaryActions}\n />\n <CollectionPage.Content>\n <AutoPatternsCollectionPageContent configuration={configuration} />\n </CollectionPage.Content>\n <CollectionPage.Footer>\n <AutoPatternsCollectionPageFooter />\n </CollectionPage.Footer>\n </CollectionPage>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,cAAc,QAAQ,oBAAoB;AACnD,SAASC,iCAAiC,QAAQ,sCAAsC;AAExF,SAASC,wBAAwB,QAAQ,sCAAsC;AAC/E,SAASC,gCAAgC,QAAQ,sEAAsE;AAMvH,OAAO,MAAMC,0BAEZ,GAAGC,IAAA,IAAuB;EAAA,IAAtB;IAAEC;EAAc,CAAC,GAAAD,IAAA;EACpB,MAAM;IAAEE,KAAK;IAAEC;EAAS,CAAC,GAAGF,aAAa;EAEzC,MAAMG,OAAO,GAAGP,wBAAwB,CAAC;IACvCQ,qBAAqB,EAAEJ,aAAa,CAACG;EACvC,CAAC,CAAC;EAEF,oBACEV,KAAA,CAAAY,aAAA,CAACX,cAAc;IAACY,QAAQ,EAAC;EAAoB,gBAC3Cb,KAAA,CAAAY,aAAA,CAACX,cAAc,CAACa,MAAM;IACpBN,KAAK,EAAEA,KAAM;IACbC,QAAQ,EAAEA,QAAS;IACnBM,aAAa,EAAEL,OAAO,CAACM,cAAe;IACtCC,gBAAgB,EAAEP,OAAO,CAACO;EAAiB,CAC5C,CAAC,eACFjB,KAAA,CAAAY,aAAA,CAACX,cAAc,CAACiB,OAAO,qBACrBlB,KAAA,CAAAY,aAAA,CAACV,iCAAiC;IAACK,aAAa,EAAEA;EAAc,CAAE,CAC5C,CAAC,eACzBP,KAAA,CAAAY,aAAA,CAACX,cAAc,CAACkB,MAAM,qBACpBnB,KAAA,CAAAY,aAAA,CAACR,gCAAgC,MAAE,CACd,CACT,CAAC;AAErB,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { BadgeUniDriver, PageHeaderUniDriver } from '@wix/design-system/dist/testkit/unidriver';
|
|
2
|
+
import { MoreActionsUniDriver } from '@wix/patterns/testkit/unidriver';
|
|
3
|
+
export function ViewModeEntityPageUniDriver(base, body) {
|
|
4
|
+
const getHeader = () => PageHeaderUniDriver(base.$('[data-hook="view-mode-entity-page-header"]'), body);
|
|
5
|
+
const getMoreActions = () => MoreActionsUniDriver(base.$('[data-hook="view-mode-entity-page-more-actions"]'), body);
|
|
6
|
+
const getBadgeByIndex = index => BadgeUniDriver(base.$(`[data-hook="form-page-header-badge-${index}"]`), body);
|
|
7
|
+
return {
|
|
8
|
+
/**
|
|
9
|
+
* Wait until root element to exist
|
|
10
|
+
* @param timeout - time to wait until bailing
|
|
11
|
+
*/
|
|
12
|
+
wait: timeout => base.wait(timeout),
|
|
13
|
+
/**
|
|
14
|
+
* Check if the view mode entity page exists
|
|
15
|
+
*/
|
|
16
|
+
exists: () => base.exists(),
|
|
17
|
+
/**
|
|
18
|
+
* Get the more actions menu element
|
|
19
|
+
*/
|
|
20
|
+
getMoreActions,
|
|
21
|
+
/**
|
|
22
|
+
* Get the number of badges in the header
|
|
23
|
+
*/
|
|
24
|
+
getBadgesCount: () => base.$$('[data-hook^="form-page-header-badge-"]').count(),
|
|
25
|
+
/**
|
|
26
|
+
* Get badge text by index
|
|
27
|
+
*/
|
|
28
|
+
getBadgeText: index => getBadgeByIndex(index).text(),
|
|
29
|
+
/**
|
|
30
|
+
* Check if badge exists by index
|
|
31
|
+
*/
|
|
32
|
+
hasBadge: index => getBadgeByIndex(index).exists(),
|
|
33
|
+
getHeader
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
export default ViewModeEntityPageUniDriver;
|
|
37
|
+
//# sourceMappingURL=ViewModeEntityPage.uni.driver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["BadgeUniDriver","PageHeaderUniDriver","MoreActionsUniDriver","ViewModeEntityPageUniDriver","base","body","getHeader","$","getMoreActions","getBadgeByIndex","index","wait","timeout","exists","getBadgesCount","$$","count","getBadgeText","text","hasBadge"],"sources":["../../../../src/components/AutoPatternsEntityPage/ViewModeEntityPage.uni.driver.tsx"],"sourcesContent":["import { UniDriver } from '@wix/wix-ui-test-utils/unidriver';\nimport {\n BadgeUniDriver,\n PageHeaderUniDriver,\n} from '@wix/design-system/dist/testkit/unidriver';\nimport { MoreActionsUniDriver } from '@wix/patterns/testkit/unidriver';\n\nexport function ViewModeEntityPageUniDriver(base: UniDriver, body: UniDriver) {\n const getHeader = () =>\n PageHeaderUniDriver(\n base.$('[data-hook=\"view-mode-entity-page-header\"]'),\n body,\n );\n\n const getMoreActions = () =>\n MoreActionsUniDriver(\n base.$('[data-hook=\"view-mode-entity-page-more-actions\"]'),\n body,\n );\n\n const getBadgeByIndex = (index: number) =>\n BadgeUniDriver(\n base.$(`[data-hook=\"form-page-header-badge-${index}\"]`),\n body,\n );\n\n return {\n /**\n * Wait until root element to exist\n * @param timeout - time to wait until bailing\n */\n wait: (timeout?: number) => base.wait(timeout),\n\n /**\n * Check if the view mode entity page exists\n */\n exists: () => base.exists(),\n\n /**\n * Get the more actions menu element\n */\n getMoreActions,\n\n /**\n * Get the number of badges in the header\n */\n getBadgesCount: () =>\n base.$$('[data-hook^=\"form-page-header-badge-\"]').count(),\n\n /**\n * Get badge text by index\n */\n getBadgeText: (index: number) => getBadgeByIndex(index).text(),\n\n /**\n * Check if badge exists by index\n */\n hasBadge: (index: number) => getBadgeByIndex(index).exists(),\n\n getHeader,\n };\n}\n\nexport default ViewModeEntityPageUniDriver;\n"],"mappings":"AACA,SACEA,cAAc,EACdC,mBAAmB,QACd,2CAA2C;AAClD,SAASC,oBAAoB,QAAQ,iCAAiC;AAEtE,OAAO,SAASC,2BAA2BA,CAACC,IAAe,EAAEC,IAAe,EAAE;EAC5E,MAAMC,SAAS,GAAGA,CAAA,KAChBL,mBAAmB,CACjBG,IAAI,CAACG,CAAC,CAAC,4CAA4C,CAAC,EACpDF,IACF,CAAC;EAEH,MAAMG,cAAc,GAAGA,CAAA,KACrBN,oBAAoB,CAClBE,IAAI,CAACG,CAAC,CAAC,kDAAkD,CAAC,EAC1DF,IACF,CAAC;EAEH,MAAMI,eAAe,GAAIC,KAAa,IACpCV,cAAc,CACZI,IAAI,CAACG,CAAC,CAAC,sCAAsCG,KAAK,IAAI,CAAC,EACvDL,IACF,CAAC;EAEH,OAAO;IACL;AACJ;AACA;AACA;IACIM,IAAI,EAAGC,OAAgB,IAAKR,IAAI,CAACO,IAAI,CAACC,OAAO,CAAC;IAE9C;AACJ;AACA;IACIC,MAAM,EAAEA,CAAA,KAAMT,IAAI,CAACS,MAAM,CAAC,CAAC;IAE3B;AACJ;AACA;IACIL,cAAc;IAEd;AACJ;AACA;IACIM,cAAc,EAAEA,CAAA,KACdV,IAAI,CAACW,EAAE,CAAC,wCAAwC,CAAC,CAACC,KAAK,CAAC,CAAC;IAE3D;AACJ;AACA;IACIC,YAAY,EAAGP,KAAa,IAAKD,eAAe,CAACC,KAAK,CAAC,CAACQ,IAAI,CAAC,CAAC;IAE9D;AACJ;AACA;IACIC,QAAQ,EAAGT,KAAa,IAAKD,eAAe,CAACC,KAAK,CAAC,CAACG,MAAM,CAAC,CAAC;IAE5DP;EACF,CAAC;AACH;AAEA,eAAeH,2BAA2B","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../../src/exports/testkit/enzyme.ts"],"sourcesContent":["export * from '../../testkit/enzyme';\n"],"mappings":"AAAA,cAAc,sBAAsB","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../../src/exports/testkit/jsdom.ts"],"sourcesContent":["export * from '../../testkit/jsdom';\n"],"mappings":"AAAA,cAAc,qBAAqB","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../../src/exports/testkit/playwright.ts"],"sourcesContent":["export * from '../../testkit/playwright';\n"],"mappings":"AAAA,cAAc,0BAA0B","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../../src/exports/testkit/puppeteer.ts"],"sourcesContent":["export * from '../../testkit/puppeteer';\n"],"mappings":"AAAA,cAAc,yBAAyB","ignoreList":[]}
|
|
@@ -17,7 +17,7 @@ export const useActionCell = _ref => {
|
|
|
17
17
|
collectionId
|
|
18
18
|
});
|
|
19
19
|
const buildCellActions = useCallback((item, index, api) => {
|
|
20
|
-
var _config$primaryAction, _config$primaryAction2, _config$secondaryActi, _config$secondaryActi2, _config$secondaryActi3, _config$secondaryActi4;
|
|
20
|
+
var _config$primaryAction, _config$primaryAction2, _config$secondaryActi, _config$secondaryActi2, _config$secondaryActi3, _config$secondaryActi4, _config$primaryAction3;
|
|
21
21
|
const buildAction = actionConfig => {
|
|
22
22
|
if (actionConfig.type === 'divider') {
|
|
23
23
|
return {
|
|
@@ -71,7 +71,10 @@ export const useActionCell = _ref => {
|
|
|
71
71
|
disabledDescription: resolvedAction.tooltip
|
|
72
72
|
};
|
|
73
73
|
};
|
|
74
|
-
|
|
74
|
+
|
|
75
|
+
// Handle both single primary action and multiple primary actions
|
|
76
|
+
const isMultiplePrimaryActions = 'items' in ((config == null ? void 0 : config.primaryAction) || {});
|
|
77
|
+
const primaryActions = isMultiplePrimaryActions ? (config == null || (_config$primaryAction = config.primaryAction) == null || (_config$primaryAction = _config$primaryAction.items) == null ? void 0 : _config$primaryAction.map(buildAction).filter(Boolean)) || [] : config != null && config.primaryAction && 'item' in config.primaryAction ? [buildAction(config.primaryAction.item)].filter(Boolean) : [];
|
|
75
78
|
const primaryActionProps = {
|
|
76
79
|
...(config != null && (_config$primaryAction2 = config.primaryAction) != null && _config$primaryAction2.alwaysVisible ? {
|
|
77
80
|
visibility: 'always'
|
|
@@ -83,17 +86,20 @@ export const useActionCell = _ref => {
|
|
|
83
86
|
const secondaryActions = cleanupActionsWithDividers(rawSecondaryActions, config == null || (_config$secondaryActi2 = config.secondaryActions) == null ? void 0 : _config$secondaryActi2.inlineCount);
|
|
84
87
|
const numOfVisibleSecondaryActions = config == null || (_config$secondaryActi3 = config.secondaryActions) == null ? void 0 : _config$secondaryActi3.inlineCount;
|
|
85
88
|
const alwaysShowSecondaryActions = config == null || (_config$secondaryActi4 = config.secondaryActions) == null ? void 0 : _config$secondaryActi4.inlineAlwaysVisible;
|
|
86
|
-
if (!
|
|
89
|
+
if (!primaryActions.length && !secondaryActions.length) {
|
|
87
90
|
return {};
|
|
88
91
|
}
|
|
89
92
|
return {
|
|
90
|
-
...(
|
|
91
|
-
primaryAction: {
|
|
92
|
-
...
|
|
93
|
+
...(primaryActions.length ? {
|
|
94
|
+
primaryAction: primaryActions.map(action => ({
|
|
95
|
+
...action,
|
|
93
96
|
...primaryActionProps
|
|
94
|
-
}
|
|
97
|
+
}))
|
|
95
98
|
} : {
|
|
96
|
-
primaryAction:
|
|
99
|
+
primaryAction: []
|
|
100
|
+
}),
|
|
101
|
+
...(isMultiplePrimaryActions && {
|
|
102
|
+
alwaysShowPrimaryActions: config == null || (_config$primaryAction3 = config.primaryAction) == null ? void 0 : _config$primaryAction3.alwaysVisible
|
|
97
103
|
}),
|
|
98
104
|
...(secondaryActions.length && {
|
|
99
105
|
secondaryActions
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useCallback","useActionsSDK","updateAction","customAction","resolveAction","deleteAction","cleanupActionsWithDividers","actions","inlineCount","clean","a","filter","x","i","ar","_ar","divider","length","slice","useActionCell","_ref","config","collectionId","sdk","buildCellActions","item","index","api","_config$primaryAction","_config$primaryAction2","_config$secondaryActi","_config$secondaryActi2","_config$secondaryActi3","_config$secondaryActi4","buildAction","actionConfig","type","actionToResolve","baseParams","actionParams","action","hidden","resolvedAction","label","tooltip","resolvedActionProps","text","disabledDescription","primaryAction","
|
|
1
|
+
{"version":3,"names":["useCallback","useActionsSDK","updateAction","customAction","resolveAction","deleteAction","cleanupActionsWithDividers","actions","inlineCount","clean","a","filter","x","i","ar","_ar","divider","length","slice","useActionCell","_ref","config","collectionId","sdk","buildCellActions","item","index","api","_config$primaryAction","_config$primaryAction2","_config$secondaryActi","_config$secondaryActi2","_config$secondaryActi3","_config$secondaryActi4","_config$primaryAction3","buildAction","actionConfig","type","actionToResolve","baseParams","actionParams","action","hidden","resolvedAction","label","tooltip","resolvedActionProps","text","disabledDescription","isMultiplePrimaryActions","primaryAction","primaryActions","items","map","Boolean","primaryActionProps","alwaysVisible","visibility","rawSecondaryActions","secondaryActions","numOfVisibleSecondaryActions","alwaysShowSecondaryActions","inlineAlwaysVisible","alwaysShowPrimaryActions"],"sources":["../../../src/hooks/useActionCell.ts"],"sourcesContent":["import { useCallback } from 'react';\nimport {\n ActionCellConfig,\n ActionCellItemConfig,\n ActionCellPrimaryActions,\n ResolvedAction,\n} from '../types';\nimport { useActionsSDK } from './useActionsSDK';\nimport {\n updateAction,\n customAction,\n resolveAction,\n deleteAction,\n} from '../utils/actions';\nimport { DividerActionConfig } from '../types/actions/base';\n\nexport interface useActionCellParams {\n config?: ActionCellConfig;\n collectionId: string;\n}\n\nconst cleanupActionsWithDividers = (\n actions: any[],\n inlineCount?: number,\n): any[] => {\n const clean = (a: any[]) =>\n a.filter(\n (x, i, ar) =>\n x?.divider !== true ||\n (i > 0 && i < ar.length - 1 && ar[i - 1]?.divider !== true),\n );\n return !actions?.length || !inlineCount || inlineCount >= actions.length\n ? clean(actions || [])\n : [\n ...clean(actions.slice(0, inlineCount)),\n ...clean(actions.slice(inlineCount)),\n ];\n};\n\nexport const useActionCell = ({\n config,\n collectionId,\n}: useActionCellParams) => {\n const sdk = useActionsSDK({\n collectionId,\n });\n\n const buildCellActions = useCallback(\n (item, index, api) => {\n const buildAction = (\n actionConfig: ActionCellItemConfig | DividerActionConfig,\n ) => {\n if (actionConfig.type === 'divider') {\n return { divider: true };\n }\n\n let actionToResolve: Partial<ResolvedAction> | null = null;\n\n const baseParams = {\n actionParams: { item, index, api },\n sdk,\n };\n\n switch (actionConfig.type) {\n case 'update':\n actionToResolve = updateAction({\n action: actionConfig,\n ...baseParams,\n });\n break;\n\n case 'delete':\n actionToResolve = deleteAction({\n action: actionConfig,\n ...baseParams,\n });\n break;\n\n case 'custom':\n actionToResolve = customAction({\n action: actionConfig,\n ...baseParams,\n });\n break;\n\n default:\n return null;\n }\n\n if (!actionToResolve || actionToResolve.hidden) {\n return null;\n }\n\n const resolvedAction = resolveAction(actionConfig, actionToResolve);\n\n const { label, tooltip, hidden, ...resolvedActionProps } =\n resolvedAction;\n\n return {\n ...resolvedActionProps,\n text: resolvedAction.label,\n disabledDescription: resolvedAction.tooltip,\n };\n };\n\n // Handle both single primary action and multiple primary actions\n const isMultiplePrimaryActions = 'items' in (config?.primaryAction || {});\n\n const primaryActions = isMultiplePrimaryActions\n ? (config?.primaryAction as ActionCellPrimaryActions)?.items\n ?.map(buildAction)\n .filter(Boolean) || []\n : config?.primaryAction && 'item' in config.primaryAction\n ? [buildAction(config.primaryAction.item)].filter(Boolean)\n : [];\n\n const primaryActionProps = {\n ...(config?.primaryAction?.alwaysVisible\n ? { visibility: 'always' }\n : {}),\n };\n\n const rawSecondaryActions = config?.secondaryActions?.items.length\n ? config.secondaryActions.items.map(buildAction).filter(Boolean)\n : [];\n\n // Process secondary actions with inline count consideration\n const secondaryActions = cleanupActionsWithDividers(\n rawSecondaryActions,\n config?.secondaryActions?.inlineCount,\n );\n\n const numOfVisibleSecondaryActions =\n config?.secondaryActions?.inlineCount;\n const alwaysShowSecondaryActions =\n config?.secondaryActions?.inlineAlwaysVisible;\n\n if (!primaryActions.length && !secondaryActions.length) {\n return {};\n }\n\n return {\n ...(primaryActions.length\n ? {\n primaryAction: primaryActions.map((action: any) => ({\n ...action,\n ...primaryActionProps,\n })),\n }\n : { primaryAction: [] }),\n ...(isMultiplePrimaryActions && {\n alwaysShowPrimaryActions: config?.primaryAction?.alwaysVisible,\n }),\n ...(secondaryActions.length && { secondaryActions }),\n numOfVisibleSecondaryActions,\n alwaysShowSecondaryActions,\n };\n },\n [config, sdk],\n );\n\n return buildCellActions;\n};\n"],"mappings":"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","ignoreList":[]}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { useSchema } from '../providers';
|
|
1
|
+
import { useAutoPatternsOverridesContext, useSchema } from '../providers';
|
|
2
2
|
export function useDragAndDropBaseProps(config) {
|
|
3
|
-
var
|
|
3
|
+
var _dndConfig$dragAndDro, _overrides$dragAndDro;
|
|
4
4
|
const schema = useSchema();
|
|
5
|
-
|
|
5
|
+
const overrides = useAutoPatternsOverridesContext();
|
|
6
|
+
const dndConfig = config.dragAndDrop;
|
|
7
|
+
if (!(dndConfig != null && dndConfig.enabled)) {
|
|
6
8
|
return null;
|
|
7
9
|
}
|
|
8
10
|
if (schema.actions.move == null) {
|
|
@@ -11,6 +13,7 @@ export function useDragAndDropBaseProps(config) {
|
|
|
11
13
|
}
|
|
12
14
|
return null;
|
|
13
15
|
}
|
|
16
|
+
const dragAndDropCancel = (_dndConfig$dragAndDro = dndConfig.dragAndDropCancel) != null && _dndConfig$dragAndDro.id ? overrides == null || (_overrides$dragAndDro = overrides.dragAndDrop) == null ? void 0 : _overrides$dragAndDro[dndConfig.dragAndDropCancel.id] : undefined;
|
|
14
17
|
return {
|
|
15
18
|
dragAndDropSubmit: async _ref => {
|
|
16
19
|
let {
|
|
@@ -21,7 +24,8 @@ export function useDragAndDropBaseProps(config) {
|
|
|
21
24
|
moveAfterId: after == null ? void 0 : after.id
|
|
22
25
|
}));
|
|
23
26
|
},
|
|
24
|
-
dragAndDropCategories: [[]]
|
|
27
|
+
dragAndDropCategories: [[]],
|
|
28
|
+
dragAndDropCancel
|
|
25
29
|
};
|
|
26
30
|
}
|
|
27
31
|
//# sourceMappingURL=useDragAndDropBaseProps.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useSchema","useDragAndDropBaseProps","config","
|
|
1
|
+
{"version":3,"names":["useAutoPatternsOverridesContext","useSchema","useDragAndDropBaseProps","config","_dndConfig$dragAndDro","_overrides$dragAndDro","schema","overrides","dndConfig","dragAndDrop","enabled","actions","move","process","env","NODE_ENV","console","warn","dragAndDropCancel","id","undefined","dragAndDropSubmit","_ref","from","after","moveAfterId","dragAndDropCategories"],"sources":["../../../src/hooks/useDragAndDropBaseProps.ts"],"sourcesContent":["import { useAutoPatternsOverridesContext, useSchema } from '../providers';\nimport { TableProps } from '@wix/patterns';\nimport { BaseCollectionComponentConfig } from '../types';\n\nexport function useDragAndDropBaseProps(\n config: BaseCollectionComponentConfig,\n): Pick<\n TableProps<any, {}>,\n 'dragAndDropSubmit' | 'dragAndDropCategories' | 'dragAndDropCancel'\n> | null {\n const schema = useSchema();\n const overrides = useAutoPatternsOverridesContext();\n const dndConfig = config.dragAndDrop;\n\n if (!dndConfig?.enabled) {\n return null;\n }\n\n if (schema.actions.move == null) {\n if (process.env.NODE_ENV === 'development') {\n console.warn(\n 'Drag and drop is enabled, but the schema does not support moving items. Please provide a \"move\" action in the schema. Current schema:',\n schema,\n );\n }\n return null;\n }\n\n const dragAndDropCancel = dndConfig.dragAndDropCancel?.id\n ? overrides?.dragAndDrop?.[dndConfig.dragAndDropCancel.id]\n : undefined;\n\n return {\n dragAndDropSubmit: async ({ from, after }) => {\n await schema.actions.move?.(from.id, {\n moveAfterId: after?.id,\n });\n },\n dragAndDropCategories: [[]],\n dragAndDropCancel,\n };\n}\n"],"mappings":"AAAA,SAASA,+BAA+B,EAAEC,SAAS,QAAQ,cAAc;AAIzE,OAAO,SAASC,uBAAuBA,CACrCC,MAAqC,EAI9B;EAAA,IAAAC,qBAAA,EAAAC,qBAAA;EACP,MAAMC,MAAM,GAAGL,SAAS,CAAC,CAAC;EAC1B,MAAMM,SAAS,GAAGP,+BAA+B,CAAC,CAAC;EACnD,MAAMQ,SAAS,GAAGL,MAAM,CAACM,WAAW;EAEpC,IAAI,EAACD,SAAS,YAATA,SAAS,CAAEE,OAAO,GAAE;IACvB,OAAO,IAAI;EACb;EAEA,IAAIJ,MAAM,CAACK,OAAO,CAACC,IAAI,IAAI,IAAI,EAAE;IAC/B,IAAIC,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,aAAa,EAAE;MAC1CC,OAAO,CAACC,IAAI,CACV,uIAAuI,EACvIX,MACF,CAAC;IACH;IACA,OAAO,IAAI;EACb;EAEA,MAAMY,iBAAiB,GAAG,CAAAd,qBAAA,GAAAI,SAAS,CAACU,iBAAiB,aAA3Bd,qBAAA,CAA6Be,EAAE,GACrDZ,SAAS,aAAAF,qBAAA,GAATE,SAAS,CAAEE,WAAW,qBAAtBJ,qBAAA,CAAyBG,SAAS,CAACU,iBAAiB,CAACC,EAAE,CAAC,GACxDC,SAAS;EAEb,OAAO;IACLC,iBAAiB,EAAE,MAAAC,IAAA,IAA2B;MAAA,IAApB;QAAEC,IAAI;QAAEC;MAAM,CAAC,GAAAF,IAAA;MACvC,OAAMhB,MAAM,CAACK,OAAO,CAACC,IAAI,oBAAnBN,MAAM,CAACK,OAAO,CAACC,IAAI,CAAGW,IAAI,CAACJ,EAAE,EAAE;QACnCM,WAAW,EAAED,KAAK,oBAALA,KAAK,CAAEL;MACtB,CAAC,CAAC;IACJ,CAAC;IACDO,qBAAqB,EAAE,CAAC,EAAE,CAAC;IAC3BR;EACF,CAAC;AACH","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","createContext","useContext","AutoPatternsOverridesContext","undefined","AutoPatternsOverridesProvider","_ref","children","value","createElement","Provider","useAutoPatternsOverridesContext","PatternsWizardOverridesProvider"],"sources":["../../../src/providers/AutoPatternsOverridesContext.tsx"],"sourcesContent":["import React, { createContext, useContext, ReactNode } from 'react';\nimport {\n CustomComponentProps,\n CustomActionCellPrimaryActionResolver,\n CustomActionCellSecondaryActionResolver,\n CustomEntityPageActionResolver,\n CustomBulkActionsActionResolver,\n CustomActionCollectionPageActionResolver,\n CustomActionCollectionPageActionOnRowClickResolver,\n IColumnValue,\n SchemaConfig,\n} from '../types';\n\nimport { Section, useOptimisticActions } from '@wix/patterns';\nimport { BadgeSkin, IconElement } from '@wix/design-system';\nimport { collections } from '@wix/data';\n\nexport interface AutoPatternsOverridesContextProps {\n actions?: Record<\n string,\n | CustomActionCellPrimaryActionResolver\n | CustomActionCellSecondaryActionResolver\n | CustomBulkActionsActionResolver\n | CustomEntityPageActionResolver\n | CustomActionCollectionPageActionResolver\n | CustomActionCollectionPageActionOnRowClickResolver\n >;\n columns?: Record<string, (props: IColumnValue<any>) => void>;\n modals?: Record<string, React.FC<any>>;\n emptyState?: Record<string, () => void>;\n components?: Record<string, React.FC<CustomComponentProps>>;\n slots?: Record<string, React.FC>;\n entityPageHeaderSubtitle?: Record<\n string,\n (entity: Record<string, any>) => { text: string }\n >;\n entityPageHeaderBadges?: Record<\n string,\n (entity: Record<string, any>) => {\n text: string;\n skin?: BadgeSkin;\n prefixIcon?: IconElement;\n suffixIcon?: IconElement;\n }[]\n >;\n customDataSources?: Record<\n string,\n (collectionId: string, context: any) => Promise<SchemaConfig>\n >;\n cmsSchema?: Record<string, collections.DataCollection>;\n sections?: Record<string, (item: any) => Section>;\n optimisticActions?: Record<\n string,\n Parameters<typeof useOptimisticActions>[1]\n >;\n bulkDeleteModalTitle?: Record<\n string,\n (params: { selectedCount: number; selectedValues: any[] }) => {\n text: string;\n }\n >;\n}\n\nconst AutoPatternsOverridesContext = createContext<\n AutoPatternsOverridesContextProps | undefined\n>(undefined);\n\nexport const AutoPatternsOverridesProvider: React.FC<{\n children: ReactNode;\n value: AutoPatternsOverridesContextProps;\n}> = ({ children, value }) => {\n return (\n <AutoPatternsOverridesContext.Provider value={value}>\n {children}\n </AutoPatternsOverridesContext.Provider>\n );\n};\n\nexport const useAutoPatternsOverridesContext = ():\n | AutoPatternsOverridesContextProps\n | undefined => {\n return useContext(AutoPatternsOverridesContext);\n};\n\n// For backwards compatibility\nexport interface PatternsWizardOverridesContextProps\n extends AutoPatternsOverridesContextProps {}\nexport const PatternsWizardOverridesProvider = AutoPatternsOverridesProvider;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,aAAa,EAAEC,UAAU,QAAmB,OAAO;
|
|
1
|
+
{"version":3,"names":["React","createContext","useContext","AutoPatternsOverridesContext","undefined","AutoPatternsOverridesProvider","_ref","children","value","createElement","Provider","useAutoPatternsOverridesContext","PatternsWizardOverridesProvider"],"sources":["../../../src/providers/AutoPatternsOverridesContext.tsx"],"sourcesContent":["import React, { createContext, useContext, ReactNode } from 'react';\nimport {\n CustomComponentProps,\n CustomActionCellPrimaryActionResolver,\n CustomActionCellSecondaryActionResolver,\n CustomEntityPageActionResolver,\n CustomBulkActionsActionResolver,\n CustomActionCollectionPageActionResolver,\n CustomActionCollectionPageActionOnRowClickResolver,\n IColumnValue,\n SchemaConfig,\n} from '../types';\n\nimport { Section, useOptimisticActions } from '@wix/patterns';\nimport { BadgeSkin, IconElement } from '@wix/design-system';\nimport { collections } from '@wix/data';\n\nexport interface AutoPatternsOverridesContextProps {\n actions?: Record<\n string,\n | CustomActionCellPrimaryActionResolver\n | CustomActionCellSecondaryActionResolver\n | CustomBulkActionsActionResolver\n | CustomEntityPageActionResolver\n | CustomActionCollectionPageActionResolver\n | CustomActionCollectionPageActionOnRowClickResolver\n >;\n columns?: Record<string, (props: IColumnValue<any>) => void>;\n modals?: Record<string, React.FC<any>>;\n emptyState?: Record<string, () => void>;\n components?: Record<string, React.FC<CustomComponentProps>>;\n slots?: Record<string, React.FC>;\n entityPageHeaderSubtitle?: Record<\n string,\n (entity: Record<string, any>) => { text: string }\n >;\n entityPageHeaderBadges?: Record<\n string,\n (entity: Record<string, any>) => {\n text: string;\n skin?: BadgeSkin;\n prefixIcon?: IconElement;\n suffixIcon?: IconElement;\n }[]\n >;\n customDataSources?: Record<\n string,\n (collectionId: string, context: any) => Promise<SchemaConfig>\n >;\n cmsSchema?: Record<string, collections.DataCollection>;\n sections?: Record<string, (item: any) => Section>;\n optimisticActions?: Record<\n string,\n Parameters<typeof useOptimisticActions>[1]\n >;\n bulkDeleteModalTitle?: Record<\n string,\n (params: { selectedCount: number; selectedValues: any[] }) => {\n text: string;\n }\n >;\n dragAndDrop?: Record<string, () => void>;\n}\n\nconst AutoPatternsOverridesContext = createContext<\n AutoPatternsOverridesContextProps | undefined\n>(undefined);\n\nexport const AutoPatternsOverridesProvider: React.FC<{\n children: ReactNode;\n value: AutoPatternsOverridesContextProps;\n}> = ({ children, value }) => {\n return (\n <AutoPatternsOverridesContext.Provider value={value}>\n {children}\n </AutoPatternsOverridesContext.Provider>\n );\n};\n\nexport const useAutoPatternsOverridesContext = ():\n | AutoPatternsOverridesContextProps\n | undefined => {\n return useContext(AutoPatternsOverridesContext);\n};\n\n// For backwards compatibility\nexport interface PatternsWizardOverridesContextProps\n extends AutoPatternsOverridesContextProps {}\nexport const PatternsWizardOverridesProvider = AutoPatternsOverridesProvider;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,aAAa,EAAEC,UAAU,QAAmB,OAAO;AAgEnE,MAAMC,4BAA4B,gBAAGF,aAAa,CAEhDG,SAAS,CAAC;AAEZ,OAAO,MAAMC,6BAGX,GAAGC,IAAA,IAAyB;EAAA,IAAxB;IAAEC,QAAQ;IAAEC;EAAM,CAAC,GAAAF,IAAA;EACvB,oBACEN,KAAA,CAAAS,aAAA,CAACN,4BAA4B,CAACO,QAAQ;IAACF,KAAK,EAAEA;EAAM,GACjDD,QACoC,CAAC;AAE5C,CAAC;AAED,OAAO,MAAMI,+BAA+B,GAAGA,CAAA,KAE9B;EACf,OAAOT,UAAU,CAACC,4BAA4B,CAAC;AACjD,CAAC;;AAED;;AAGA,OAAO,MAAMS,+BAA+B,GAAGP,6BAA6B","ignoreList":[]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { enzymeUniTestkitFactoryCreator } from '@wix/wix-ui-test-utils/enzyme';
|
|
2
|
+
import { AutoPatternsAppUniDriver } from '../components/AutoPatternsApp/AutoPatternsApp.uni.driver';
|
|
3
|
+
export const AutoPatternsAppTestkit = enzymeUniTestkitFactoryCreator(AutoPatternsAppUniDriver);
|
|
4
|
+
//# sourceMappingURL=enzyme.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["enzymeUniTestkitFactoryCreator","AutoPatternsAppUniDriver","AutoPatternsAppTestkit"],"sources":["../../../src/testkit/enzyme.ts"],"sourcesContent":["import { enzymeUniTestkitFactoryCreator } from '@wix/wix-ui-test-utils/enzyme';\nimport { AutoPatternsAppUniDriver } from '../components/AutoPatternsApp/AutoPatternsApp.uni.driver';\n\nexport const AutoPatternsAppTestkit = enzymeUniTestkitFactoryCreator(\n AutoPatternsAppUniDriver,\n);\n"],"mappings":"AAAA,SAASA,8BAA8B,QAAQ,+BAA+B;AAC9E,SAASC,wBAAwB,QAAQ,0DAA0D;AAEnG,OAAO,MAAMC,sBAAsB,GAAGF,8BAA8B,CAClEC,wBACF,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { uniTestkitFactoryCreator } from '@wix/wix-ui-test-utils/vanilla';
|
|
2
|
+
import { AutoPatternsAppUniDriver } from '../components/AutoPatternsApp/AutoPatternsApp.uni.driver';
|
|
3
|
+
export const AutoPatternsAppTestkit = uniTestkitFactoryCreator(AutoPatternsAppUniDriver);
|
|
4
|
+
//# sourceMappingURL=jsdom.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["uniTestkitFactoryCreator","AutoPatternsAppUniDriver","AutoPatternsAppTestkit"],"sources":["../../../src/testkit/jsdom.ts"],"sourcesContent":["import { uniTestkitFactoryCreator } from '@wix/wix-ui-test-utils/vanilla';\nimport { AutoPatternsAppUniDriver } from '../components/AutoPatternsApp/AutoPatternsApp.uni.driver';\n\nexport const AutoPatternsAppTestkit = uniTestkitFactoryCreator(\n AutoPatternsAppUniDriver,\n);\n"],"mappings":"AAAA,SAASA,wBAAwB,QAAQ,gCAAgC;AACzE,SAASC,wBAAwB,QAAQ,0DAA0D;AAEnG,OAAO,MAAMC,sBAAsB,GAAGF,wBAAwB,CAC5DC,wBACF,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { playwrightUniTestkitFactoryCreator } from '@wix/wix-ui-test-utils/playwright';
|
|
2
|
+
import { AutoPatternsAppUniDriver } from '../components/AutoPatternsApp/AutoPatternsApp.uni.driver';
|
|
3
|
+
export const AutoPatternsAppTestkit = playwrightUniTestkitFactoryCreator(AutoPatternsAppUniDriver);
|
|
4
|
+
//# sourceMappingURL=playwright.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["playwrightUniTestkitFactoryCreator","AutoPatternsAppUniDriver","AutoPatternsAppTestkit"],"sources":["../../../src/testkit/playwright.ts"],"sourcesContent":["import { playwrightUniTestkitFactoryCreator } from '@wix/wix-ui-test-utils/playwright';\nimport { AutoPatternsAppUniDriver } from '../components/AutoPatternsApp/AutoPatternsApp.uni.driver';\n\nexport const AutoPatternsAppTestkit = playwrightUniTestkitFactoryCreator(\n AutoPatternsAppUniDriver,\n);\n"],"mappings":"AAAA,SAASA,kCAAkC,QAAQ,mCAAmC;AACtF,SAASC,wBAAwB,QAAQ,0DAA0D;AAEnG,OAAO,MAAMC,sBAAsB,GAAGF,kCAAkC,CACtEC,wBACF,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { puppeteerUniTestkitFactoryCreator } from '@wix/wix-ui-test-utils/puppeteer';
|
|
2
|
+
import { AutoPatternsAppUniDriver } from '../components/AutoPatternsApp/AutoPatternsApp.uni.driver';
|
|
3
|
+
export const AutoPatternsAppTestkit = puppeteerUniTestkitFactoryCreator(AutoPatternsAppUniDriver);
|
|
4
|
+
//# sourceMappingURL=puppeteer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["puppeteerUniTestkitFactoryCreator","AutoPatternsAppUniDriver","AutoPatternsAppTestkit"],"sources":["../../../src/testkit/puppeteer.ts"],"sourcesContent":["import { puppeteerUniTestkitFactoryCreator } from '@wix/wix-ui-test-utils/puppeteer';\nimport { AutoPatternsAppUniDriver } from '../components/AutoPatternsApp/AutoPatternsApp.uni.driver';\n\nexport const AutoPatternsAppTestkit = puppeteerUniTestkitFactoryCreator(\n AutoPatternsAppUniDriver,\n);\n"],"mappings":"AAAA,SAASA,iCAAiC,QAAQ,kCAAkC;AACpF,SAASC,wBAAwB,QAAQ,0DAA0D;AAEnG,OAAO,MAAMC,sBAAsB,GAAGF,iCAAiC,CACrEC,wBACF,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ComponentTypeEnum"],"sources":["../../../src/types/CollectionPageConfig.ts"],"sourcesContent":["import { CollectionToolbarFiltersProps } from '@wix/patterns';\nimport { DateRangeFilterMode, DateRangeOptions } from '@wix/patterns/core';\nimport { BaseCollectionConfig } from './types';\nimport {\n ActionCellConfig,\n BulkActionsConfig,\n CollectionPageOnRowClickActionConfig,\n CollectionPagePrimaryActions,\n CollectionPageSecondaryActions,\n} from './actions';\n\nexport interface CollectionPageTitle {\n /**\n * The title text.\n */\n text: string;\n /**\n * Determines whether to hide the number of total entities on the title of the page.\n */\n hideTotal?: boolean;\n}\n\nexport interface CollectionPageSubtitle {\n /**\n * The subtitle text.\n */\n text: string;\n /**\n * \"Learn more\" link.\n */\n learnMore?: {\n /**\n * Where the link should navigate to.\n */\n url: string;\n /**\n * The label of the link button. defaults to \"Learn More\".\n */\n label?: string;\n };\n}\n\nexport interface CollectionPageConfig {\n /**\n * Route configuration.\n */\n route: {\n /**\n * Route path (relative path).\n */\n path: string;\n };\n /**\n * Page title configuration.\n */\n title: CollectionPageTitle;\n /**\n * Page subtitle configuration.\n */\n subtitle?: CollectionPageSubtitle;\n /**\n * Page-level actions to render in the page header.\n */\n actions?: {\n /**\n * Primary actions.\n */\n primaryActions?: CollectionPagePrimaryActions;\n /**\n * Secondary actions.\n */\n secondaryActions?: CollectionPageSecondaryActions;\n };\n /**\n * Components rendered within the page layout.\n */\n components: ComponentConfig[];\n}\n\nexport interface CollectionComponentConfig\n extends BaseCollectionComponentConfig {\n /**\n * Type discriminator.\n */\n type: 'collection';\n /**\n * Layout items to render.\n */\n layout: LayoutItemConfig[];\n}\n\nexport interface CustomComponentConfig {\n /**\n * Type discriminator.\n */\n type: 'custom';\n /**\n * Identifier that maps to a custom React component provided via overrides.\n */\n id: string;\n}\n\nexport type ComponentConfig = CollectionComponentConfig | CustomComponentConfig;\n\nexport interface LayoutItemConfig {\n /**\n * Rendering mode for the collection component.\n */\n type: 'Table' | 'Grid';\n /**\n * Table-specific configuration.\n */\n table?: TableSpecificConfig;\n /**\n * Grid-specific configuration.\n */\n grid?: GridSpecificConfig;\n}\n\nexport type ColumnsConfig = Column[];\n\nexport interface TableSpecificConfig {\n /**\n * Table columns configuration.\n */\n columns: ColumnsConfig;\n /**\n * Enables custom columns (hide/reorder columns) functionality.\n */\n customColumns?: {\n enabled: boolean;\n };\n /**\n * Number of leading columns that remain sticky on horizontal scroll.\n */\n stickyColumns?: number;\n /**\n * Row click action.\n */\n onRowClick?: CollectionPageOnRowClickActionConfig;\n /**\n * Show column headers (title bar).\n * @default true\n */\n showTitleBar?: boolean;\n /**\n * Sectioning support for table.\n *\n * The `id` must match the identifier of a custom sectioning override component.\n * This allows you to provide a custom React component for table section rendering.\n */\n sections?: {\n id: string;\n };\n /**\n * Data extension configuration.\n */\n dataExtension?: {\n enabled: boolean;\n };\n}\n\nexport interface GridSpecificConfig {\n /**\n * Grid item.\n */\n item: GridItem;\n}\n\nexport interface TableConfig\n extends BaseCollectionComponentConfig,\n TableSpecificConfig {}\n\nexport interface GridConfig\n extends BaseCollectionComponentConfig,\n GridSpecificConfig {}\n\nexport interface TableGridSwitchConfig\n extends BaseCollectionComponentConfig,\n TableSpecificConfig,\n GridSpecificConfig {}\n\nexport type CollectionConfig = BaseCollectionConfig & {\n /**\n * Default fetch limit (items per page).\n */\n limit?: number;\n /**\n * Reflect search/filters/sort in the URL.\n * @default false\n */\n reflectQueryInUrl?: boolean;\n /**\n * Scope of \"Select All\":\n * - 'all': select the entire collection (server-side).\n * - 'page': select only currently visible items.\n * @default \"all\"\n */\n selectAllScope?: 'page' | 'all';\n /**\n * Selection behavior when data changes:\n * - 'preserve': keep current selections if still valid.\n * - 'clear': clear selection on data refresh.\n * @default \"clear\"\n */\n selectionUpdateMode?: 'preserve' | 'clear';\n /**\n * Enables optimistic UI actions;\n * Identifier that maps to a custom optimistic actions provided via overrides.\n */\n optimisticActions?: {\n id: string;\n };\n /**\n * Pagination strategy:\n * - 'cursor': `find()` must return { items, cursor, total? }\n * - 'offset': `find()` must return { items, hasNext, total? }\n * @default \"offset\"\n */\n paginationMode?: 'cursor' | 'offset';\n};\n\nexport interface BaseCollectionComponentConfig {\n /**\n * Collection data configuration and behavior.\n */\n collection: CollectionConfig;\n /**\n * Entity page to navigate to (by page id) when interacting with rows (e.g. onRowClick/update).\n */\n entityPageId?: string;\n /**\n * Search configuration.\n */\n search?: {\n /**\n * Whether to show the search input.\n * @default true\n */\n shown?: boolean;\n };\n /**\n * Toolbar title configuration.\n */\n toolbarTitle?: ToolbarTitle;\n /**\n * Action cell configuration per row.\n */\n actionCell?: ActionCellConfig;\n /**\n * Empty state configuration.\n */\n emptyState?: EmptyState;\n /**\n * Filters configuration.\n */\n filters?: FiltersConfig;\n /**\n * Bulk action toolbar configuration.\n */\n bulkActionToolbar?: BulkActionsConfig;\n /**\n * Drag and drop configuration.\n */\n dragAndDrop?: {\n /**\n * Whether drag and drop is enabled. When enabled, the schema must support a \"move\" action.\n */\n enabled: boolean;\n };\n}\n\nexport interface ToolbarTitle {\n /**\n * Title text.\n */\n title: string;\n /**\n * Subtitle configuration.\n */\n subtitle?: {\n /**\n * Subtitle text.\n */\n text: string;\n /**\n * Info tooltip content with an optional link.\n */\n info?: {\n content: {\n text: string;\n link?: {\n url: string;\n label: string;\n };\n };\n };\n /**\n * \"Learn more\" link.\n */\n learnMore?: {\n /**\n * Where the link should navigate to.\n */\n url: string;\n /**\n * The label of the link button.\n */\n label?: string;\n };\n };\n /**\n * Show total items on the toolbar.\n * @default false\n */\n showTotal?: boolean;\n /**\n * Limit displayed item count in the toolbar.\n */\n itemsLimit?: number;\n}\n\nexport interface Column {\n /**\n * FieldId to bind the column to.\n */\n id: string;\n /**\n * Column header text.\n */\n name: string;\n /**\n * CSS width value (e.g. '120px', '20%').\n */\n width: string;\n /**\n * Whether the column supports sorting.\n */\n sortable?: boolean;\n /**\n * Initial sort order when the page loads.\n */\n defaultSortOrder?: 'asc' | 'desc';\n /**\n * Current sort mode selected in UI.\n */\n sortMode?: 'asc' | 'desc';\n /**\n * Hide column by default in the custom columns panel.\n * When true, the column will not be shown initially and must be enabled by the user via the customize columns UI.\n */\n defaultHidden?: boolean;\n /**\n * Exclude from the \"customize columns\" selection UI.\n */\n hiddenFromCustomColumnsSelection?: boolean;\n /**\n * Controls whether the \"hide/show\" checkbox for this column is enabled in the custom columns panel.\n * If set to false, the checkbox will be disabled and the user cannot toggle visibility for this column.\n */\n hideable?: boolean;\n /**\n * Prevent column reordering in the customization UI.\n */\n reorderDisabled?: boolean;\n /**\n * Tooltip content to display when hovering over the info icon in the column header.\n */\n tooltipContent?: string;\n}\n\nexport interface GridItem {\n /**\n * FieldId to use as the card title.\n */\n titleFieldId: string;\n /**\n * FieldId to use as the card subtitle.\n */\n subtitleFieldId?: string;\n /**\n * FieldId to use as the card image.\n */\n imageFieldId?: string;\n /**\n * Controls which content is shown in the card (preset):\n * - 'full': shows title and subtitle.\n * - 'title': shows only the title.\n * - 'empty': hides both title and subtitle.\n */\n cardContentMode?: 'full' | 'title' | 'empty'; // Footer is not supported in auto-patterns\n /**\n * Position of the image inside the card layout.\n */\n imagePlacement?: 'top' | 'side';\n}\n\nexport interface EmptyState {\n /**\n * Empty state title.\n */\n title?: string;\n /**\n * Empty state subtitle.\n */\n subtitle?: string;\n /**\n * Image to display in the empty state.\n */\n image?: {\n id: string;\n };\n /**\n * \"Add new\" call-to-action button.\n */\n addNewCta?: {\n id?: string;\n text?: string;\n };\n /**\n * Custom CTA slot (advanced).\n */\n customCta?: {\n id?: string;\n };\n}\n\nexport interface FilterOption {\n value: string;\n label: string;\n}\n\nexport type FilterSelectionMode = 'single' | 'multiple';\n\nexport type FilterOptionType =\n | 'checkbox'\n | 'inlineCheckbox'\n | 'radio'\n | 'select';\n\nexport enum ComponentTypeEnum {\n SINGLE = 'single',\n MULTI_SELECT = 'multi-select',\n RADIO_GROUP = 'radio-group',\n NUMBER = 'number',\n DATE_RANGE = 'date-range',\n}\n\nexport type FilterItems = Filter[];\n\nexport interface FiltersConfig {\n /**\n * Filter items to display.\n */\n items: FilterItems;\n /**\n * Maximum number of filters shown inline before moving to the panel.\n * @default 0 (all in panel).\n */\n maxInlineFilters?: CollectionToolbarFiltersProps['inline'];\n /**\n * Title for the filter panel drawer.\n */\n panelTitle?: string;\n}\n\nexport interface BaseOptionsFilterConfig {\n /**\n * Selection behavior: single choice or multiple choices.\n */\n selectionMode: FilterSelectionMode;\n}\n\nexport interface DateFilterConfig {\n /**\n * Controls behavior: presets only, custom only, or both.\n */\n mode?: DateRangeFilterMode;\n /**\n * Which preset ranges to display (only if mode supports presets).\n */\n presets?: DateRangeOptions;\n /**\n * Whether to include time selection.\n * @default true\n */\n includeTime?: boolean;\n}\n\nexport interface NumberFilterConfig {\n /**\n * Minimum allowed value.\n */\n min?: number;\n /**\n * Maximum allowed value.\n */\n max?: number;\n /**\n * Whether decimal values are allowed.\n */\n allowedDecimals?: boolean;\n}\n\nexport interface BooleanFilterConfig {\n /**\n * Label for the \"true\" option.\n */\n trueLabel?: string;\n /**\n * Label for the \"false\" option.\n */\n falseLabel?: string;\n}\n\nexport interface EnumFilterConfig extends BaseOptionsFilterConfig {\n /**\n * List of available options.\n */\n options: FilterOption[];\n /**\n * Rendering control for option appearance.\n */\n optionType?: FilterOptionType;\n}\n\nexport interface DynamicOptionsFilterConfig extends BaseOptionsFilterConfig {}\n\nexport interface Filter {\n /**\n * Filter unique identifier.\n */\n id: string;\n /**\n * Target field id this filter controls.\n */\n fieldId: string;\n /**\n * Optional filter display name (defaults to field name).\n */\n displayName?: string;\n /**\n * Optional grouping label. Filters with the same `sectionTitle` are grouped together.\n */\n sectionTitle?: string;\n /**\n * Whether the filter item is expanded by default in the panel.\n */\n openByDefault?: boolean;\n /**\n * Label shown in the table/grid tag when the filter is active.\n */\n tagLabel?: string;\n /**\n * Configuration for number inputs (NUMBER fields).\n */\n numberConfig?: NumberFilterConfig;\n /**\n * Configuration for date inputs (DATETIME fields).\n */\n dateConfig?: DateFilterConfig;\n /**\n * Configuration for boolean input labels (BOOLEAN fields).\n */\n booleanConfig?: BooleanFilterConfig;\n /**\n * Configuration for enum inputs (ARRAY/ARRAY_STRING fields).\n */\n enumConfig?: EnumFilterConfig;\n /**\n * Dynamic options configuration (advanced).\n */\n dynamicOptionsConfig?: DynamicOptionsFilterConfig;\n}\n"],"mappings":"AAwbA,WAAYA,iBAAiB,0BAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAA,OAAjBA,iBAAiB;AAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["ComponentTypeEnum"],"sources":["../../../src/types/CollectionPageConfig.ts"],"sourcesContent":["import { CollectionToolbarFiltersProps } from '@wix/patterns';\nimport { DateRangeFilterMode, DateRangeOptions } from '@wix/patterns/core';\nimport { BaseCollectionConfig } from './types';\nimport {\n ActionCellConfig,\n BulkActionsConfig,\n CollectionPageOnRowClickActionConfig,\n CollectionPagePrimaryActions,\n CollectionPageSecondaryActions,\n} from './actions';\n\nexport interface CollectionPageTitle {\n /**\n * The title text.\n */\n text: string;\n /**\n * Determines whether to hide the number of total entities on the title of the page.\n */\n hideTotal?: boolean;\n}\n\nexport interface CollectionPageSubtitle {\n /**\n * The subtitle text.\n */\n text: string;\n /**\n * \"Learn more\" link.\n */\n learnMore?: {\n /**\n * Where the link should navigate to.\n */\n url: string;\n /**\n * The label of the link button. defaults to \"Learn More\".\n */\n label?: string;\n };\n}\n\nexport interface CollectionPageConfig {\n /**\n * Route configuration.\n */\n route: {\n /**\n * Route path (relative path).\n */\n path: string;\n };\n /**\n * Page title configuration.\n */\n title: CollectionPageTitle;\n /**\n * Page subtitle configuration.\n */\n subtitle?: CollectionPageSubtitle;\n /**\n * Page-level actions to render in the page header.\n */\n actions?: {\n /**\n * Primary actions.\n */\n primaryActions?: CollectionPagePrimaryActions;\n /**\n * Secondary actions.\n */\n secondaryActions?: CollectionPageSecondaryActions;\n };\n /**\n * Components rendered within the page layout.\n */\n components: ComponentConfig[];\n}\n\nexport interface CollectionComponentConfig\n extends BaseCollectionComponentConfig {\n /**\n * Type discriminator.\n */\n type: 'collection';\n /**\n * Layout items to render.\n */\n layout: LayoutItemConfig[];\n}\n\nexport interface CustomComponentConfig {\n /**\n * Type discriminator.\n */\n type: 'custom';\n /**\n * Identifier that maps to a custom React component provided via overrides.\n */\n id: string;\n}\n\nexport type ComponentConfig = CollectionComponentConfig | CustomComponentConfig;\n\nexport interface LayoutItemConfig {\n /**\n * Rendering mode for the collection component.\n */\n type: 'Table' | 'Grid';\n /**\n * Table-specific configuration.\n */\n table?: TableSpecificConfig;\n /**\n * Grid-specific configuration.\n */\n grid?: GridSpecificConfig;\n}\n\nexport type ColumnsConfig = Column[];\n\nexport interface TableSpecificConfig {\n /**\n * Table columns configuration.\n */\n columns: ColumnsConfig;\n /**\n * Enables custom columns (hide/reorder columns) functionality.\n */\n customColumns?: {\n enabled: boolean;\n };\n /**\n * Number of leading columns that remain sticky on horizontal scroll.\n */\n stickyColumns?: number;\n /**\n * Row click action.\n */\n onRowClick?: CollectionPageOnRowClickActionConfig;\n /**\n * Show column headers (title bar).\n * @default true\n */\n showTitleBar?: boolean;\n /**\n * Sectioning support for table.\n *\n * The `id` must match the identifier of a custom sectioning override component.\n * This allows you to provide a custom React component for table section rendering.\n */\n sections?: {\n id: string;\n };\n /**\n * Data extension configuration.\n */\n dataExtension?: {\n enabled: boolean;\n };\n}\n\nexport interface GridSpecificConfig {\n /**\n * Grid item.\n */\n item: GridItem;\n}\n\nexport interface TableConfig\n extends BaseCollectionComponentConfig,\n TableSpecificConfig {}\n\nexport interface GridConfig\n extends BaseCollectionComponentConfig,\n GridSpecificConfig {}\n\nexport interface TableGridSwitchConfig\n extends BaseCollectionComponentConfig,\n TableSpecificConfig,\n GridSpecificConfig {}\n\nexport type CollectionConfig = BaseCollectionConfig & {\n /**\n * Default fetch limit (items per page).\n */\n limit?: number;\n /**\n * Reflect search/filters/sort in the URL.\n * @default false\n */\n reflectQueryInUrl?: boolean;\n /**\n * Scope of \"Select All\":\n * - 'all': select the entire collection (server-side).\n * - 'page': select only currently visible items.\n * @default \"all\"\n */\n selectAllScope?: 'page' | 'all';\n /**\n * Selection behavior when data changes:\n * - 'preserve': keep current selections if still valid.\n * - 'clear': clear selection on data refresh.\n * @default \"clear\"\n */\n selectionUpdateMode?: 'preserve' | 'clear';\n /**\n * Enables optimistic UI actions;\n * Identifier that maps to a custom optimistic actions provided via overrides.\n */\n optimisticActions?: {\n id: string;\n };\n /**\n * Pagination strategy:\n * - 'cursor': `find()` must return { items, cursor, total? }\n * - 'offset': `find()` must return { items, hasNext, total? }\n * @default \"offset\"\n */\n paginationMode?: 'cursor' | 'offset';\n};\n\nexport interface BaseCollectionComponentConfig {\n /**\n * Collection data configuration and behavior.\n */\n collection: CollectionConfig;\n /**\n * Entity page to navigate to (by page id) when interacting with rows (e.g. onRowClick/update).\n */\n entityPageId?: string;\n /**\n * Search configuration.\n */\n search?: {\n /**\n * Whether to show the search input.\n * @default true\n */\n shown?: boolean;\n };\n /**\n * Toolbar title configuration.\n */\n toolbarTitle?: ToolbarTitle;\n /**\n * Action cell configuration per row.\n */\n actionCell?: ActionCellConfig;\n /**\n * Empty state configuration.\n */\n emptyState?: EmptyState;\n /**\n * Filters configuration.\n */\n filters?: FiltersConfig;\n /**\n * Bulk action toolbar configuration.\n */\n bulkActionToolbar?: BulkActionsConfig;\n /**\n * Drag and drop configuration.\n */\n dragAndDrop?: {\n /**\n * Whether drag and drop is enabled. When enabled, the schema must support a \"move\" action.\n */\n enabled: boolean;\n /**\n * Custom drag and drop cancel handler.\n */\n dragAndDropCancel?: {\n id?: string;\n };\n };\n}\n\nexport interface ToolbarTitle {\n /**\n * Title text.\n */\n title: string;\n /**\n * Subtitle configuration.\n */\n subtitle?: {\n /**\n * Subtitle text.\n */\n text: string;\n /**\n * Info tooltip content with an optional link.\n */\n info?: {\n content: {\n text: string;\n link?: {\n url: string;\n label: string;\n };\n };\n };\n /**\n * \"Learn more\" link.\n */\n learnMore?: {\n /**\n * Where the link should navigate to.\n */\n url: string;\n /**\n * The label of the link button.\n */\n label?: string;\n };\n };\n /**\n * Show total items on the toolbar.\n * @default false\n */\n showTotal?: boolean;\n /**\n * Limit displayed item count in the toolbar.\n */\n itemsLimit?: number;\n}\n\nexport interface Column {\n /**\n * FieldId to bind the column to.\n */\n id: string;\n /**\n * Column header text.\n */\n name: string;\n /**\n * CSS width value (e.g. '120px', '20%').\n */\n width: string;\n /**\n * Whether the column supports sorting.\n */\n sortable?: boolean;\n /**\n * Initial sort order when the page loads.\n */\n defaultSortOrder?: 'asc' | 'desc';\n /**\n * Current sort mode selected in UI.\n */\n sortMode?: 'asc' | 'desc';\n /**\n * Hide column by default in the custom columns panel.\n * When true, the column will not be shown initially and must be enabled by the user via the customize columns UI.\n */\n defaultHidden?: boolean;\n /**\n * Exclude from the \"customize columns\" selection UI.\n */\n hiddenFromCustomColumnsSelection?: boolean;\n /**\n * Controls whether the \"hide/show\" checkbox for this column is enabled in the custom columns panel.\n * If set to false, the checkbox will be disabled and the user cannot toggle visibility for this column.\n */\n hideable?: boolean;\n /**\n * Prevent column reordering in the customization UI.\n */\n reorderDisabled?: boolean;\n /**\n * Tooltip content to display when hovering over the info icon in the column header.\n */\n tooltipContent?: string;\n}\n\nexport interface GridItem {\n /**\n * FieldId to use as the card title.\n */\n titleFieldId: string;\n /**\n * FieldId to use as the card subtitle.\n */\n subtitleFieldId?: string;\n /**\n * FieldId to use as the card image.\n */\n imageFieldId?: string;\n /**\n * Controls which content is shown in the card (preset):\n * - 'full': shows title and subtitle.\n * - 'title': shows only the title.\n * - 'empty': hides both title and subtitle.\n */\n cardContentMode?: 'full' | 'title' | 'empty'; // Footer is not supported in auto-patterns\n /**\n * Position of the image inside the card layout.\n */\n imagePlacement?: 'top' | 'side';\n}\n\nexport interface EmptyState {\n /**\n * Empty state title.\n */\n title?: string;\n /**\n * Empty state subtitle.\n */\n subtitle?: string;\n /**\n * Image to display in the empty state.\n */\n image?: {\n id: string;\n };\n /**\n * \"Add new\" call-to-action button.\n */\n addNewCta?: {\n id?: string;\n text?: string;\n };\n /**\n * Custom CTA slot (advanced).\n */\n customCta?: {\n id?: string;\n };\n}\n\nexport interface FilterOption {\n value: string;\n label: string;\n}\n\nexport type FilterSelectionMode = 'single' | 'multiple';\n\nexport type FilterOptionType =\n | 'checkbox'\n | 'inlineCheckbox'\n | 'radio'\n | 'select';\n\nexport enum ComponentTypeEnum {\n SINGLE = 'single',\n MULTI_SELECT = 'multi-select',\n RADIO_GROUP = 'radio-group',\n NUMBER = 'number',\n DATE_RANGE = 'date-range',\n}\n\nexport type FilterItems = Filter[];\n\nexport interface FiltersConfig {\n /**\n * Filter items to display.\n */\n items: FilterItems;\n /**\n * Maximum number of filters shown inline before moving to the panel.\n * @default 0 (all in panel).\n */\n maxInlineFilters?: CollectionToolbarFiltersProps['inline'];\n /**\n * Title for the filter panel drawer.\n */\n panelTitle?: string;\n}\n\nexport interface BaseOptionsFilterConfig {\n /**\n * Selection behavior: single choice or multiple choices.\n */\n selectionMode: FilterSelectionMode;\n}\n\nexport interface DateFilterConfig {\n /**\n * Controls behavior: presets only, custom only, or both.\n */\n mode?: DateRangeFilterMode;\n /**\n * Which preset ranges to display (only if mode supports presets).\n */\n presets?: DateRangeOptions;\n /**\n * Whether to include time selection.\n * @default true\n */\n includeTime?: boolean;\n}\n\nexport interface NumberFilterConfig {\n /**\n * Minimum allowed value.\n */\n min?: number;\n /**\n * Maximum allowed value.\n */\n max?: number;\n /**\n * Whether decimal values are allowed.\n */\n allowedDecimals?: boolean;\n}\n\nexport interface BooleanFilterConfig {\n /**\n * Label for the \"true\" option.\n */\n trueLabel?: string;\n /**\n * Label for the \"false\" option.\n */\n falseLabel?: string;\n}\n\nexport interface EnumFilterConfig extends BaseOptionsFilterConfig {\n /**\n * List of available options.\n */\n options: FilterOption[];\n /**\n * Rendering control for option appearance.\n */\n optionType?: FilterOptionType;\n}\n\nexport interface DynamicOptionsFilterConfig extends BaseOptionsFilterConfig {}\n\nexport interface Filter {\n /**\n * Filter unique identifier.\n */\n id: string;\n /**\n * Target field id this filter controls.\n */\n fieldId: string;\n /**\n * Optional filter display name (defaults to field name).\n */\n displayName?: string;\n /**\n * Optional grouping label. Filters with the same `sectionTitle` are grouped together.\n */\n sectionTitle?: string;\n /**\n * Whether the filter item is expanded by default in the panel.\n */\n openByDefault?: boolean;\n /**\n * Label shown in the table/grid tag when the filter is active.\n */\n tagLabel?: string;\n /**\n * Configuration for number inputs (NUMBER fields).\n */\n numberConfig?: NumberFilterConfig;\n /**\n * Configuration for date inputs (DATETIME fields).\n */\n dateConfig?: DateFilterConfig;\n /**\n * Configuration for boolean input labels (BOOLEAN fields).\n */\n booleanConfig?: BooleanFilterConfig;\n /**\n * Configuration for enum inputs (ARRAY/ARRAY_STRING fields).\n */\n enumConfig?: EnumFilterConfig;\n /**\n * Dynamic options configuration (advanced).\n */\n dynamicOptionsConfig?: DynamicOptionsFilterConfig;\n}\n"],"mappings":"AA8bA,WAAYA,iBAAiB,0BAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAA,OAAjBA,iBAAiB;AAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["../../../../src/types/actions/actionCell.ts"],"sourcesContent":["import {\n CustomActionModalProps,\n CustomActionParams,\n ResolvedAction,\n} from '../../exports/types';\nimport {\n CustomActionConfig,\n DeleteActionConfig,\n UpdateActionConfig,\n DividerActionConfig,\n} from './base';\nimport { IconElement } from '@wix/design-system';\n\nexport type ActionCellItemConfig =\n | UpdateActionConfig\n | CustomActionConfig\n | DeleteActionConfig;\n\nexport interface ActionCellPrimaryAction {\n /**\n * The action item configuration.\n */\n item: ActionCellItemConfig;\n /**\n * Whether the primary action should always be visible.\n * If true, the action is always visible; if false, it is visible only when hovering the row.\n * @default false\n */\n alwaysVisible?: boolean;\n}\n\nexport interface ActionCellSecondaryActions {\n /**\n * Array of action items and dividers for the secondary actions menu.\n */\n items: (ActionCellItemConfig | DividerActionConfig)[];\n /**\n * Number of secondary actions to show inline before moving to overflow menu.\n * Remaining actions appear in a \"more actions\" dropdown.\n * @default 0 (all actions in dropdown)\n */\n inlineCount?: number;\n /**\n * Whether inline secondary actions should always be visible.\n * If true, the inline actions are always visible; if false, they are visible only when hovering the row.\n * @default false\n */\n inlineAlwaysVisible?: boolean;\n}\n\nexport interface ActionCellConfig {\n /**\n * Primary action configuration.\n * Shown as the main action button in each row.\n */\n primaryAction?: ActionCellPrimaryAction;\n /**\n * Secondary actions configuration.\n * Shown as additional actions in dropdown or inline.\n */\n secondaryActions?: ActionCellSecondaryActions;\n}\n\nexport interface ResolvedActionCellPrimaryAction\n extends Omit<ResolvedAction, 'icon'> {\n /**\n * Icon displayed before the action label.\n */\n prefixIcon?: IconElement;\n /**\n * Icon displayed after the action label.\n */\n suffixIcon?: IconElement;\n}\n\nexport interface ActionCellActionParams {\n /**\n * The data item (row) that the action is being performed on.\n */\n item: any;\n}\n\nexport type CustomActionCellActionParams =\n CustomActionParams<ActionCellActionParams>;\n\nexport type CustomActionCellPrimaryActionResolver = (\n params: CustomActionCellActionParams,\n) => ResolvedActionCellPrimaryAction;\n\nexport type CustomActionCellSecondaryActionResolver = (\n params: CustomActionCellActionParams,\n) => ResolvedAction;\n\nexport interface CustomActionCellActionModalProps\n extends CustomActionModalProps {\n /**\n * Action parameters including the row item context.\n */\n actionParams: ActionCellActionParams;\n}\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../../src/types/actions/actionCell.ts"],"sourcesContent":["import {\n CustomActionModalProps,\n CustomActionParams,\n ResolvedAction,\n} from '../../exports/types';\nimport {\n CustomActionConfig,\n DeleteActionConfig,\n UpdateActionConfig,\n DividerActionConfig,\n} from './base';\nimport { IconElement } from '@wix/design-system';\n\nexport type ActionCellItemConfig =\n | UpdateActionConfig\n | CustomActionConfig\n | DeleteActionConfig;\n\nexport interface ActionCellPrimaryAction {\n /**\n * The action item configuration.\n */\n item: ActionCellItemConfig;\n /**\n * Whether the primary action should always be visible.\n * If true, the action is always visible; if false, it is visible only when hovering the row.\n * @default false\n */\n alwaysVisible?: boolean;\n}\n\nexport interface ActionCellPrimaryActions {\n /**\n * The action items configuration.\n */\n items: ActionCellItemConfig[];\n /**\n * Whether the primary action should always be visible.\n * If true, the action is always visible; if false, it is visible only when hovering the row.\n * @default false\n */\n alwaysVisible?: boolean;\n}\n\nexport interface ActionCellSecondaryActions {\n /**\n * Array of action items and dividers for the secondary actions menu.\n */\n items: (ActionCellItemConfig | DividerActionConfig)[];\n /**\n * Number of secondary actions to show inline before moving to overflow menu.\n * Remaining actions appear in a \"more actions\" dropdown.\n * @default 0 (all actions in dropdown)\n */\n inlineCount?: number;\n /**\n * Whether inline secondary actions should always be visible.\n * If true, the inline actions are always visible; if false, they are visible only when hovering the row.\n * @default false\n */\n inlineAlwaysVisible?: boolean;\n}\n\nexport interface ActionCellConfig {\n /**\n * Primary action configuration.\n * Shown as the main action button in each row.\n */\n primaryAction?: ActionCellPrimaryAction | ActionCellPrimaryActions;\n /**\n * Secondary actions configuration.\n * Shown as additional actions in dropdown or inline.\n */\n secondaryActions?: ActionCellSecondaryActions;\n}\n\nexport interface ResolvedActionCellPrimaryAction\n extends Omit<ResolvedAction, 'icon'> {\n /**\n * Icon displayed before the action label.\n */\n prefixIcon?: IconElement;\n /**\n * Icon displayed after the action label.\n */\n suffixIcon?: IconElement;\n}\n\nexport interface ActionCellActionParams {\n /**\n * The data item (row) that the action is being performed on.\n */\n item: any;\n}\n\nexport type CustomActionCellActionParams =\n CustomActionParams<ActionCellActionParams>;\n\nexport type CustomActionCellPrimaryActionResolver = (\n params: CustomActionCellActionParams,\n) => ResolvedActionCellPrimaryAction;\n\nexport type CustomActionCellSecondaryActionResolver = (\n params: CustomActionCellActionParams,\n) => ResolvedAction;\n\nexport interface CustomActionCellActionModalProps\n extends CustomActionModalProps {\n /**\n * Action parameters including the row item context.\n */\n actionParams: ActionCellActionParams;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { UniDriver } from '@wix/wix-ui-test-utils/unidriver';
|
|
2
|
+
import { EntityPageUniDriver, TableUniDriver, GridUniDriver, PageErrorStateUniDriver, CollectionPageUniDriver, TableGridSwitchUniDriver } from '@wix/patterns/testkit/unidriver';
|
|
3
|
+
import { MessageModalLayoutUniDriver } from '@wix/design-system/dist/testkit/unidriver';
|
|
4
|
+
import ViewModeEntityPageUniDriver from '../AutoPatternsEntityPage/ViewModeEntityPage.uni.driver';
|
|
5
|
+
import { EntityPageFieldsUniDriver } from '../../__tests__/AutoPatternsEntityPage/AutoPatternsEntityPageFields.uni.driver';
|
|
6
|
+
export declare function baseUniDriverFactory(base: UniDriver): {
|
|
7
|
+
exists: () => Promise<boolean>;
|
|
8
|
+
click: () => Promise<void>;
|
|
9
|
+
element: () => Promise<any>;
|
|
10
|
+
base: UniDriver;
|
|
11
|
+
};
|
|
12
|
+
export type EntityPageDriver = ReturnType<typeof EntityPageUniDriver>;
|
|
13
|
+
export type CollectionPageDriver = ReturnType<typeof CollectionPageUniDriver>;
|
|
14
|
+
export type ViewModeEntityPageDriver = ReturnType<typeof ViewModeEntityPageUniDriver>;
|
|
15
|
+
export type TableDriver = ReturnType<typeof TableUniDriver>;
|
|
16
|
+
export type GridDriver = ReturnType<typeof GridUniDriver>;
|
|
17
|
+
export type TableGridSwitchDriver = ReturnType<typeof TableGridSwitchUniDriver>;
|
|
18
|
+
export type PageErrorStateDriver = ReturnType<typeof PageErrorStateUniDriver>;
|
|
19
|
+
export type BulkDeleteModalDriver = ReturnType<typeof MessageModalLayoutUniDriver>;
|
|
20
|
+
export type EntityPageFieldsDriver = ReturnType<typeof EntityPageFieldsUniDriver>;
|
|
21
|
+
export declare const AutoPatternsAppUniDriver: (base: UniDriver, body: UniDriver) => {
|
|
22
|
+
/** Returns CollectionPage driver */
|
|
23
|
+
collectionPage: () => CollectionPageDriver;
|
|
24
|
+
/** Returns EntityPage driver */
|
|
25
|
+
entityPage: () => EntityPageDriver;
|
|
26
|
+
/** Returns ViewModeEntityPage driver */
|
|
27
|
+
viewModeEntityPage: () => ViewModeEntityPageDriver;
|
|
28
|
+
/** Returns Table driver */
|
|
29
|
+
table: () => TableDriver;
|
|
30
|
+
/** Returns Grid driver */
|
|
31
|
+
grid: () => GridDriver;
|
|
32
|
+
/** Returns TableGridSwitch driver */
|
|
33
|
+
tableGridSwitch: () => TableGridSwitchDriver;
|
|
34
|
+
/** Returns PageErrorState driver */
|
|
35
|
+
pageErrorState: () => PageErrorStateDriver;
|
|
36
|
+
/** Returns BulkDeleteModal driver */
|
|
37
|
+
bulkDeleteModal: () => BulkDeleteModalDriver;
|
|
38
|
+
/** Returns EntityPageFields driver */
|
|
39
|
+
entityPageFields: () => EntityPageFieldsDriver;
|
|
40
|
+
exists: () => Promise<boolean>;
|
|
41
|
+
click: () => Promise<void>;
|
|
42
|
+
element: () => Promise<any>;
|
|
43
|
+
base: UniDriver;
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=AutoPatternsApp.uni.driver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AutoPatternsApp.uni.driver.d.ts","sourceRoot":"","sources":["../../../../src/components/AutoPatternsApp/AutoPatternsApp.uni.driver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAC7D,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,aAAa,EACb,uBAAuB,EACvB,uBAAuB,EACvB,wBAAwB,EACzB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,2BAA2B,EAAE,MAAM,2CAA2C,CAAC;AACxF,OAAO,2BAA2B,MAAM,yDAAyD,CAAC;AAClG,OAAO,EAAE,yBAAyB,EAAE,MAAM,gFAAgF,CAAC;AAG3H,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,SAAS;;;;;EAQnD;AAGD,MAAM,MAAM,gBAAgB,GAAG,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC;AACtE,MAAM,MAAM,oBAAoB,GAAG,UAAU,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAC9E,MAAM,MAAM,wBAAwB,GAAG,UAAU,CAC/C,OAAO,2BAA2B,CACnC,CAAC;AACF,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC5D,MAAM,MAAM,UAAU,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC;AAC1D,MAAM,MAAM,qBAAqB,GAAG,UAAU,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAChF,MAAM,MAAM,oBAAoB,GAAG,UAAU,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAC9E,MAAM,MAAM,qBAAqB,GAAG,UAAU,CAC5C,OAAO,2BAA2B,CACnC,CAAC;AACF,MAAM,MAAM,sBAAsB,GAAG,UAAU,CAC7C,OAAO,yBAAyB,CACjC,CAAC;AAEF,eAAO,MAAM,wBAAwB,GAAI,MAAM,SAAS,EAAE,MAAM,SAAS;IA0CrE,oCAAoC;0BAnCV,oBAAoB;IAsC9C,gCAAgC;sBA5CV,gBAAgB;IA+CtC,wCAAwC;8BAtCV,wBAAwB;IAyCtD,2BAA2B;iBAnCV,WAAW;IAsC5B,0BAA0B;gBAnCV,UAAU;IAsC1B,qCAAqC;2BAnCV,qBAAqB;IAsChD,oCAAoC;0BAhCV,oBAAoB;IAmC9C,qCAAqC;2BAhCV,qBAAqB;IAmChD,sCAAsC;4BA7BV,sBAAsB;;;;;CAgCrD,CAAC"}
|