@wix/auto-patterns 1.40.0 → 1.42.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/components/AutoPatternsGrid/AutoPatternsGrid.js +3 -1
- package/dist/cjs/components/AutoPatternsGrid/AutoPatternsGrid.js.map +1 -1
- package/dist/cjs/components/AutoPatternsTable/AutoPatternsTable.js +3 -1
- package/dist/cjs/components/AutoPatternsTable/AutoPatternsTable.js.map +1 -1
- 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/useCommonCollectionFeatures.js +12 -7
- package/dist/cjs/hooks/useCommonCollectionFeatures.js.map +1 -1
- package/dist/cjs/hooks/useDragAndDropBaseProps.js +7 -3
- package/dist/cjs/hooks/useDragAndDropBaseProps.js.map +1 -1
- package/dist/cjs/hooks/useTableFeatures.js.map +1 -1
- package/dist/cjs/hooks/useViews.js +107 -0
- package/dist/cjs/hooks/useViews.js.map +1 -0
- 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/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/components/AutoPatternsGrid/AutoPatternsGrid.js +2 -0
- package/dist/esm/components/AutoPatternsGrid/AutoPatternsGrid.js.map +1 -1
- package/dist/esm/components/AutoPatternsTable/AutoPatternsTable.js +2 -0
- package/dist/esm/components/AutoPatternsTable/AutoPatternsTable.js.map +1 -1
- 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/useCommonCollectionFeatures.js +8 -3
- package/dist/esm/hooks/useCommonCollectionFeatures.js.map +1 -1
- package/dist/esm/hooks/useDragAndDropBaseProps.js +8 -4
- package/dist/esm/hooks/useDragAndDropBaseProps.js.map +1 -1
- package/dist/esm/hooks/useTableFeatures.js.map +1 -1
- package/dist/esm/hooks/useViews.js +106 -0
- package/dist/esm/hooks/useViews.js.map +1 -0
- 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/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/components/AutoPatternsGrid/AutoPatternsGrid.d.ts.map +1 -1
- package/dist/types/components/AutoPatternsTable/AutoPatternsTable.d.ts.map +1 -1
- 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/useCommonCollectionFeatures.d.ts +3 -2
- package/dist/types/hooks/useCommonCollectionFeatures.d.ts.map +1 -1
- package/dist/types/hooks/useDragAndDropBaseProps.d.ts.map +1 -1
- package/dist/types/hooks/useGridFeatures.d.ts +1 -0
- package/dist/types/hooks/useGridFeatures.d.ts.map +1 -1
- package/dist/types/hooks/useTableFeatures.d.ts +1 -0
- package/dist/types/hooks/useTableFeatures.d.ts.map +1 -1
- package/dist/types/hooks/useTableGridSwitchFeatures.d.ts +1 -0
- package/dist/types/hooks/useTableGridSwitchFeatures.d.ts.map +1 -1
- package/dist/types/hooks/useViews.d.ts +4 -0
- package/dist/types/hooks/useViews.d.ts.map +1 -0
- 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 +193 -1
- package/dist/types/types/CollectionPageConfig.d.ts.map +1 -1
- package/mcp-docs/app_config_structure.md +95 -0
- package/mcp-docs/auto-patterns-guide.md +721 -15
- package/mcp-docs/custom_overrides.md +37 -0
- package/mcp-docs/error_handling.md +251 -15
- package/mcp-docs/index.md +4 -0
- package/mcp-docs/views.md +335 -0
- package/package.json +49 -15
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_patterns","_jsxFileName","iconToInfo","icon","content","tooltipContent","SORT_DIRECTION_MAP","asc","columnSortOrder","Ascending","desc","Descending","transformViews","views","map","view","label","columnPreferences","rest","name","sortDirections","filter","direction","undefined","id","columnId","selectedColumns","show","isSelected","transformPresets","presets","type","categories","preset","info","useViews","config","_saveViewModalProps$l","enabled","saveViewModalProps","viewsDropdownProps","default","createElement","Views","_extends2","viewNamePlaceholder","placeholderName","learnMoreLink","learnMore","url","showTotal","allItemsViewProps","customAllItemsViewLabel","hideAllItemsView","hidden","__self","__source","fileName","lineNumber","columnNumber","exports"],"sources":["../../../src/hooks/useViews.tsx"],"sourcesContent":["import React from 'react';\nimport { Category, columnSortOrder, View, Views } from '@wix/patterns';\nimport { ViewsConfig, AutoView, AutoCategory } from '../types';\nimport { InfoIconProps } from '@wix/design-system';\n\nconst iconToInfo = (icon: AutoCategory['icon']): InfoIconProps => {\n return {\n ...icon,\n content: icon?.tooltipContent,\n };\n};\n\nconst SORT_DIRECTION_MAP = {\n asc: columnSortOrder.Ascending,\n desc: columnSortOrder.Descending,\n};\n\nconst transformViews = (views: AutoView[]): View<any>[] => {\n return views.map((view) => {\n const { label, columnPreferences, ...rest } = view;\n return {\n name: label,\n sortDirections: columnPreferences\n ?.filter(({ direction }) => direction !== undefined)\n .map(({ id, direction }) => ({\n columnId: id,\n direction: SORT_DIRECTION_MAP[direction!],\n })),\n selectedColumns: columnPreferences\n ?.filter(({ show }) => show !== undefined)\n .map(({ id, show }) => ({\n id,\n isSelected: show,\n })),\n ...rest,\n };\n });\n};\n\nconst transformPresets = (presets: ViewsConfig['presets']) => {\n if (!presets) {\n return;\n }\n\n if (presets.type === 'categories') {\n return presets.categories.map((preset) => {\n const { views, id, label, icon, ...rest } = preset;\n return {\n id,\n name: label,\n info: iconToInfo(icon),\n views: transformViews(views),\n ...rest,\n };\n }) as Category<any>[];\n } else {\n return transformViews(presets.views);\n }\n};\n\nexport const useViews = (config: ViewsConfig | undefined) => {\n const { enabled, saveViewModalProps, viewsDropdownProps, presets, ...rest } =\n config || {};\n\n return enabled ? (\n <Views\n {...rest}\n viewNamePlaceholder={saveViewModalProps?.placeholderName}\n learnMoreLink={saveViewModalProps?.learnMore?.url}\n showTotal={viewsDropdownProps?.showTotal}\n allItemsViewProps={{\n ...(viewsDropdownProps?.customAllItemsViewLabel && {\n name: viewsDropdownProps.customAllItemsViewLabel,\n }),\n ...(viewsDropdownProps?.hideAllItemsView && {\n hidden: viewsDropdownProps.hideAllItemsView,\n }),\n }}\n presets={transformPresets(presets)}\n />\n ) : undefined;\n};\n"],"mappings":"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","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_jsxFileName","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","AutoPatternsOverridesContext","createContext","undefined","AutoPatternsOverridesProvider","children","value","createElement","Provider","__self","__source","fileName","lineNumber","columnNumber","exports","useAutoPatternsOverridesContext","useContext","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,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAoE,IAAAC,YAAA;AAAA,SAAAC,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAJ,wBAAAI,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,CAAA,SAAAG,CAAA,GAAAP,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAG,CAAA,KAAAA,CAAA,CAAAV,GAAA,IAAAU,CAAA,CAAAC,GAAA,IAAAP,MAAA,CAAAC,cAAA,CAAAJ,CAAA,EAAAM,CAAA,EAAAG,CAAA,IAAAT,CAAA,CAAAM,CAAA,IAAAd,CAAA,CAAAc,CAAA,YAAAN,CAAA,CAAAH,OAAA,GAAAL,CAAA,EAAAG,CAAA,IAAAA,CAAA,CAAAe,GAAA,CAAAlB,CAAA,EAAAQ,CAAA,GAAAA,CAAA;
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_jsxFileName","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","AutoPatternsOverridesContext","createContext","undefined","AutoPatternsOverridesProvider","children","value","createElement","Provider","__self","__source","fileName","lineNumber","columnNumber","exports","useAutoPatternsOverridesContext","useContext","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,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAoE,IAAAC,YAAA;AAAA,SAAAC,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAJ,wBAAAI,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,CAAA,SAAAG,CAAA,GAAAP,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAG,CAAA,KAAAA,CAAA,CAAAV,GAAA,IAAAU,CAAA,CAAAC,GAAA,IAAAP,MAAA,CAAAC,cAAA,CAAAJ,CAAA,EAAAM,CAAA,EAAAG,CAAA,IAAAT,CAAA,CAAAM,CAAA,IAAAd,CAAA,CAAAc,CAAA,YAAAN,CAAA,CAAAH,OAAA,GAAAL,CAAA,EAAAG,CAAA,IAAAA,CAAA,CAAAe,GAAA,CAAAlB,CAAA,EAAAQ,CAAA,GAAAA,CAAA;AAgEpE,MAAMW,4BAA4B,gBAAG,IAAAC,oBAAa,EAEhDC,SAAS,CAAC;AAEL,MAAMC,6BAGX,GAAGA,CAAC;EAAEC,QAAQ;EAAEC;AAAM,CAAC,KAAK;EAC5B,oBACE7B,MAAA,CAAAU,OAAA,CAAAoB,aAAA,CAACN,4BAA4B,CAACO,QAAQ;IAACF,KAAK,EAAEA,KAAM;IAAAG,MAAA;IAAAC,QAAA;MAAAC,QAAA,EAAA/B,YAAA;MAAAgC,UAAA;MAAAC,YAAA;IAAA;EAAA,GACjDR,QACoC,CAAC;AAE5C,CAAC;AAACS,OAAA,CAAAV,6BAAA,GAAAA,6BAAA;AAEK,MAAMW,+BAA+B,GAAGA,CAAA,KAE9B;EACf,OAAO,IAAAC,iBAAU,EAACf,4BAA4B,CAAC;AACjD,CAAC;;AAED;AAAAa,OAAA,CAAAC,+BAAA,GAAAA,+BAAA;AAGO,MAAME,+BAA+B,GAAAH,OAAA,CAAAG,+BAAA,GAAGb,6BAA6B","ignoreList":[]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.AutoPatternsAppTestkit = void 0;
|
|
5
|
+
var _enzyme = require("@wix/wix-ui-test-utils/enzyme");
|
|
6
|
+
var _AutoPatternsAppUni = require("../components/AutoPatternsApp/AutoPatternsApp.uni.driver");
|
|
7
|
+
const AutoPatternsAppTestkit = exports.AutoPatternsAppTestkit = (0, _enzyme.enzymeUniTestkitFactoryCreator)(_AutoPatternsAppUni.AutoPatternsAppUniDriver);
|
|
8
|
+
//# sourceMappingURL=enzyme.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_enzyme","require","_AutoPatternsAppUni","AutoPatternsAppTestkit","exports","enzymeUniTestkitFactoryCreator","AutoPatternsAppUniDriver"],"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,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAD,OAAA;AAEO,MAAME,sBAAsB,GAAAC,OAAA,CAAAD,sBAAA,GAAG,IAAAE,sCAA8B,EAClEC,4CACF,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.AutoPatternsAppTestkit = void 0;
|
|
5
|
+
var _vanilla = require("@wix/wix-ui-test-utils/vanilla");
|
|
6
|
+
var _AutoPatternsAppUni = require("../components/AutoPatternsApp/AutoPatternsApp.uni.driver");
|
|
7
|
+
const AutoPatternsAppTestkit = exports.AutoPatternsAppTestkit = (0, _vanilla.uniTestkitFactoryCreator)(_AutoPatternsAppUni.AutoPatternsAppUniDriver);
|
|
8
|
+
//# sourceMappingURL=jsdom.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_vanilla","require","_AutoPatternsAppUni","AutoPatternsAppTestkit","exports","uniTestkitFactoryCreator","AutoPatternsAppUniDriver"],"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,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAD,OAAA;AAEO,MAAME,sBAAsB,GAAAC,OAAA,CAAAD,sBAAA,GAAG,IAAAE,iCAAwB,EAC5DC,4CACF,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.AutoPatternsAppTestkit = void 0;
|
|
5
|
+
var _playwright = require("@wix/wix-ui-test-utils/playwright");
|
|
6
|
+
var _AutoPatternsAppUni = require("../components/AutoPatternsApp/AutoPatternsApp.uni.driver");
|
|
7
|
+
const AutoPatternsAppTestkit = exports.AutoPatternsAppTestkit = (0, _playwright.playwrightUniTestkitFactoryCreator)(_AutoPatternsAppUni.AutoPatternsAppUniDriver);
|
|
8
|
+
//# sourceMappingURL=playwright.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_playwright","require","_AutoPatternsAppUni","AutoPatternsAppTestkit","exports","playwrightUniTestkitFactoryCreator","AutoPatternsAppUniDriver"],"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,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAD,OAAA;AAEO,MAAME,sBAAsB,GAAAC,OAAA,CAAAD,sBAAA,GAAG,IAAAE,8CAAkC,EACtEC,4CACF,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.AutoPatternsAppTestkit = void 0;
|
|
5
|
+
var _puppeteer = require("@wix/wix-ui-test-utils/puppeteer");
|
|
6
|
+
var _AutoPatternsAppUni = require("../components/AutoPatternsApp/AutoPatternsApp.uni.driver");
|
|
7
|
+
const AutoPatternsAppTestkit = exports.AutoPatternsAppTestkit = (0, _puppeteer.puppeteerUniTestkitFactoryCreator)(_AutoPatternsAppUni.AutoPatternsAppUniDriver);
|
|
8
|
+
//# sourceMappingURL=puppeteer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_puppeteer","require","_AutoPatternsAppUni","AutoPatternsAppTestkit","exports","puppeteerUniTestkitFactoryCreator","AutoPatternsAppUniDriver"],"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,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAD,OAAA;AAEO,MAAME,sBAAsB,GAAAC,OAAA,CAAAD,sBAAA,GAAG,IAAAE,4CAAiC,EACrEC,4CACF,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ComponentTypeEnum","exports"],"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":";;;;IAwbYA,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,0BAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAA,OAAjBA,iBAAiB;AAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["ComponentTypeEnum","exports"],"sources":["../../../src/types/CollectionPageConfig.ts"],"sourcesContent":["import { CollectionToolbarFiltersProps } from '@wix/patterns';\nimport {\n DateRangeFilterMode,\n DateRangeOptions,\n DateRangePredefinedPresetOptions,\n} 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 * Views configuration.\n */\n views?: ViewsConfig;\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 ViewsConfig {\n /**\n * Whether to show the views control.\n * @default false\n */\n enabled?: boolean;\n /**\n * Props for the Save View modal.\n */\n saveViewModalProps?: {\n /**\n * Placeholder text for the new view name input in the modal.\n */\n placeholderName?: string;\n /**\n * props for the learn more link in the modal.\n */\n learnMore?: {\n /**\n * Redirect URL for the Learn More button in the modal.\n */\n url?: string;\n };\n };\n /**\n * Props for the views control dropdown.\n */\n viewsDropdownProps?: {\n /**\n * Show the total number of items next to the views control.\n * @default false\n */\n showTotal?: boolean;\n /**\n * Hide the \"All items\" view from the dropdown. Only works when custom presets exist.\n * @default false\n */\n hideAllItemsView?: boolean;\n /**\n * Custom label for the \"All items\" view. Ignored if a preset has `isDefaultView: true`.\n * @default \"All items\"\n */\n customAllItemsViewLabel?: string;\n };\n /**\n * Custom presets to use for the views control.\n */\n presets?:\n | {\n type: 'categories';\n categories: AutoCategory[];\n }\n | {\n type: 'views';\n views: AutoView[];\n };\n}\n\nexport interface AutoCategory {\n /**\n * Category unique identifier.\n */\n id: string;\n /**\n * Category name that will be displayed in the views control.\n */\n label: string;\n /**\n * Category views.\n */\n views: AutoView[];\n /**\n * An icon that will be displayed next to the category label.\n */\n icon?: {\n tooltipContent: string;\n size?: 'small' | 'medium';\n };\n}\n\nexport interface AutoView {\n /**\n * View unique identifier.\n */\n id: string;\n /**\n * Display name for the view in the dropdown.\n */\n label: string;\n /**\n * Filters to apply when the view is selected. Keys must be filters id declared in this config.\n * @external\n */\n filters?: Record<string, AutoFilterValue | null>;\n /**\n * Column preferences for the view. Use this to control column order, visibility, and sorting.\n */\n columnPreferences?: ColumnPreferences[];\n /**\n * Makes this view the default selection instead of the \"All items\" view.\n */\n isDefaultView?: boolean;\n}\n\ninterface ColumnPreferences {\n /**\n * Column unique identifier.\n */\n id: string;\n /**\n * Sorting direction of the column in the view.\n */\n direction?: 'asc' | 'desc';\n /**\n * Pass false to hide the column from the view.\n */\n show?: boolean;\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 type AutoFilterValue =\n | {\n filterType: 'date';\n value: DateFilterValue;\n }\n | {\n filterType: 'number';\n value: NumberFilterValue;\n }\n | {\n filterType: 'boolean';\n value: BooleanFilterValue;\n }\n | {\n filterType: 'enum';\n value: EnumFilterValue;\n }\n | {\n filterType: 'reference';\n value: ReferenceFilterValue;\n };\n\nexport type DateFilterValue =\n | {\n preset: DateRangeOptions | DateRangePredefinedPresetOptions;\n }\n | {\n /**\n * Start date. format: MM-DD-YYYY\n */\n from?: string;\n /**\n * End date. format: MM-DD-YYYY\n */\n to?: string;\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 type NumberFilterValue = {\n /**\n * Minimum allowed value. default is negative infinity\n */\n from?: number;\n /**\n * Maximum allowed value. default is infinity\n */\n to?: number;\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 type BooleanFilterValue = {\n /**\n * checked for true, unchecked for false, all for all\n */\n id: 'checked' | 'unchecked' | 'all';\n /**\n * A string that will appear on the filter tag, after the field name, when the filter is active (appears as \\<field-name\\>: \\<name\\>)\n */\n name: 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 type EnumFilterValue = {\n /**\n * The option value (from the filter config)\n */\n id: string;\n /**\n * A string that will appear on the filter tag, after the field name, when the filter is active (appears as \\<field-name\\>: \\<name\\>)\n */\n name: string;\n}[];\n\nexport interface DynamicOptionsFilterConfig extends BaseOptionsFilterConfig {}\n\nexport type ReferenceFilterValue = {\n /**\n * The option value (from the filter config)\n */\n id: string;\n /**\n * A string that will appear on the filter tag, after the field name, when the filter is active (appears as \\<field-name\\>: \\<name\\>)\n */\n name: string;\n}[];\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":";;;;IAscYA,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,0BAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAA,OAAjBA,iBAAiB;AAAA","ignoreList":[]}
|
|
@@ -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":[]}
|
|
@@ -15,6 +15,7 @@ export const AutoPatternsGrid = _ref => {
|
|
|
15
15
|
actionCell,
|
|
16
16
|
renderItem,
|
|
17
17
|
imagePlacement,
|
|
18
|
+
views,
|
|
18
19
|
preset,
|
|
19
20
|
dragAndDropProps
|
|
20
21
|
} = useGridFeatures(configuration);
|
|
@@ -25,6 +26,7 @@ export const AutoPatternsGrid = _ref => {
|
|
|
25
26
|
state: state,
|
|
26
27
|
actionCell: actionCell,
|
|
27
28
|
filters: filters,
|
|
29
|
+
views: views,
|
|
28
30
|
emptyState: emptyState,
|
|
29
31
|
imagePlacement: imagePlacement
|
|
30
32
|
}, dragAndDropProps, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Grid","useGridFeatures","AutoPatternsGrid","_ref","configuration","state","search","title","emptyState","filters","actionCell","renderItem","imagePlacement","preset","dragAndDropProps","createElement","_extends","dataHook"],"sources":["../../../../src/components/AutoPatternsGrid/AutoPatternsGrid.tsx"],"sourcesContent":["import React from 'react';\nimport { Grid } from '@wix/patterns';\nimport { GridConfig } from '../../types';\nimport { useGridFeatures } from '../../hooks';\n\nexport interface AutoPatternsGridContentProps {\n configuration: GridConfig;\n}\n\nexport const AutoPatternsGrid = ({\n configuration,\n}: AutoPatternsGridContentProps) => {\n const {\n state,\n search,\n title,\n emptyState,\n filters,\n actionCell,\n renderItem,\n imagePlacement,\n preset,\n dragAndDropProps,\n } = useGridFeatures(configuration);\n\n return (\n <Grid\n dataHook=\"auto-patterns-grid\"\n search={search}\n title={title}\n state={state}\n actionCell={actionCell}\n filters={filters}\n emptyState={emptyState}\n imagePlacement={imagePlacement}\n {...dragAndDropProps}\n preset={preset}\n renderItem={renderItem}\n />\n );\n};\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,eAAe;AAEpC,SAASC,eAAe,QAAQ,aAAa;AAM7C,OAAO,MAAMC,gBAAgB,GAAGC,IAAA,IAEI;EAAA,IAFH;IAC/BC;EAC4B,CAAC,GAAAD,IAAA;EAC7B,MAAM;IACJE,KAAK;IACLC,MAAM;IACNC,KAAK;IACLC,UAAU;IACVC,OAAO;IACPC,UAAU;IACVC,UAAU;IACVC,cAAc;IACdC,MAAM;IACNC;EACF,CAAC,
|
|
1
|
+
{"version":3,"names":["React","Grid","useGridFeatures","AutoPatternsGrid","_ref","configuration","state","search","title","emptyState","filters","actionCell","renderItem","imagePlacement","views","preset","dragAndDropProps","createElement","_extends","dataHook"],"sources":["../../../../src/components/AutoPatternsGrid/AutoPatternsGrid.tsx"],"sourcesContent":["import React from 'react';\nimport { Grid } from '@wix/patterns';\nimport { GridConfig } from '../../types';\nimport { useGridFeatures } from '../../hooks';\n\nexport interface AutoPatternsGridContentProps {\n configuration: GridConfig;\n}\n\nexport const AutoPatternsGrid = ({\n configuration,\n}: AutoPatternsGridContentProps) => {\n const {\n state,\n search,\n title,\n emptyState,\n filters,\n actionCell,\n renderItem,\n imagePlacement,\n views,\n preset,\n dragAndDropProps,\n } = useGridFeatures(configuration);\n\n return (\n <Grid\n dataHook=\"auto-patterns-grid\"\n search={search}\n title={title}\n state={state}\n actionCell={actionCell}\n filters={filters}\n views={views}\n emptyState={emptyState}\n imagePlacement={imagePlacement}\n {...dragAndDropProps}\n preset={preset}\n renderItem={renderItem}\n />\n );\n};\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,eAAe;AAEpC,SAASC,eAAe,QAAQ,aAAa;AAM7C,OAAO,MAAMC,gBAAgB,GAAGC,IAAA,IAEI;EAAA,IAFH;IAC/BC;EAC4B,CAAC,GAAAD,IAAA;EAC7B,MAAM;IACJE,KAAK;IACLC,MAAM;IACNC,KAAK;IACLC,UAAU;IACVC,OAAO;IACPC,UAAU;IACVC,UAAU;IACVC,cAAc;IACdC,KAAK;IACLC,MAAM;IACNC;EACF,CAAC,GAAGd,eAAe,CAACG,aAAa,CAAC;EAElC,oBACEL,KAAA,CAAAiB,aAAA,CAAChB,IAAI,EAAAiB,QAAA;IACHC,QAAQ,EAAC,oBAAoB;IAC7BZ,MAAM,EAAEA,MAAO;IACfC,KAAK,EAAEA,KAAM;IACbF,KAAK,EAAEA,KAAM;IACbK,UAAU,EAAEA,UAAW;IACvBD,OAAO,EAAEA,OAAQ;IACjBI,KAAK,EAAEA,KAAM;IACbL,UAAU,EAAEA,UAAW;IACvBI,cAAc,EAAEA;EAAe,GAC3BG,gBAAgB;IACpBD,MAAM,EAAEA,MAAO;IACfH,UAAU,EAAEA;EAAW,EACxB,CAAC;AAEN,CAAC","ignoreList":[]}
|
|
@@ -14,6 +14,7 @@ export const AutoPatternsTable = _ref => {
|
|
|
14
14
|
title,
|
|
15
15
|
emptyState,
|
|
16
16
|
filters,
|
|
17
|
+
views,
|
|
17
18
|
actionCell,
|
|
18
19
|
bulkActionToolbar,
|
|
19
20
|
onRowClick,
|
|
@@ -35,6 +36,7 @@ export const AutoPatternsTable = _ref => {
|
|
|
35
36
|
}, dragAndDropProps, {
|
|
36
37
|
actionCell: actionCell,
|
|
37
38
|
filters: filters,
|
|
39
|
+
views: views,
|
|
38
40
|
emptyState: emptyState,
|
|
39
41
|
bulkActionToolbar: bulkActionToolbar,
|
|
40
42
|
onRowClick: onRowClick,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Table","useTableFeatures","AutoPatternsTable","_ref","configuration","state","columns","customColumns","search","title","emptyState","filters","actionCell","bulkActionToolbar","onRowClick","stickyColumns","stickySelectionColumn","showTitleBar","sections","dragAndDropProps","dataExtension","createElement","_extends","dataHook","horizontalScroll"],"sources":["../../../../src/components/AutoPatternsTable/AutoPatternsTable.tsx"],"sourcesContent":["import React from 'react';\nimport { Table } from '@wix/patterns';\nimport { TableConfig } from '../../types';\nimport { useTableFeatures } from '../../hooks';\n\nexport interface AutoPatternsTableContentProps {\n configuration: TableConfig;\n}\n\nexport const AutoPatternsTable = ({\n configuration,\n}: AutoPatternsTableContentProps) => {\n const {\n state,\n columns,\n customColumns,\n search,\n title,\n emptyState,\n filters,\n actionCell,\n bulkActionToolbar,\n onRowClick,\n stickyColumns,\n stickySelectionColumn,\n showTitleBar,\n sections,\n dragAndDropProps,\n dataExtension,\n } = useTableFeatures(configuration);\n\n return (\n <Table\n dataHook=\"auto-patterns-table\"\n search={search}\n title={title}\n state={state}\n columns={columns}\n dataExtension={dataExtension}\n customColumns={customColumns}\n {...dragAndDropProps}\n actionCell={actionCell}\n filters={filters}\n emptyState={emptyState}\n bulkActionToolbar={bulkActionToolbar}\n onRowClick={onRowClick}\n horizontalScroll\n stickyColumns={stickyColumns}\n stickySelectionColumn={stickySelectionColumn}\n showTitleBar={showTitleBar}\n sections={sections}\n />\n );\n};\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,KAAK,QAAQ,eAAe;AAErC,SAASC,gBAAgB,QAAQ,aAAa;AAM9C,OAAO,MAAMC,iBAAiB,GAAGC,IAAA,IAEI;EAAA,IAFH;IAChCC;EAC6B,CAAC,GAAAD,IAAA;EAC9B,MAAM;IACJE,KAAK;IACLC,OAAO;IACPC,aAAa;IACbC,MAAM;IACNC,KAAK;IACLC,UAAU;IACVC,OAAO;IACPC,UAAU;IACVC,iBAAiB;IACjBC,UAAU;IACVC,aAAa;IACbC,qBAAqB;IACrBC,YAAY;IACZC,QAAQ;IACRC,gBAAgB;IAChBC;EACF,CAAC,
|
|
1
|
+
{"version":3,"names":["React","Table","useTableFeatures","AutoPatternsTable","_ref","configuration","state","columns","customColumns","search","title","emptyState","filters","views","actionCell","bulkActionToolbar","onRowClick","stickyColumns","stickySelectionColumn","showTitleBar","sections","dragAndDropProps","dataExtension","createElement","_extends","dataHook","horizontalScroll"],"sources":["../../../../src/components/AutoPatternsTable/AutoPatternsTable.tsx"],"sourcesContent":["import React from 'react';\nimport { Table } from '@wix/patterns';\nimport { TableConfig } from '../../types';\nimport { useTableFeatures } from '../../hooks';\n\nexport interface AutoPatternsTableContentProps {\n configuration: TableConfig;\n}\n\nexport const AutoPatternsTable = ({\n configuration,\n}: AutoPatternsTableContentProps) => {\n const {\n state,\n columns,\n customColumns,\n search,\n title,\n emptyState,\n filters,\n views,\n actionCell,\n bulkActionToolbar,\n onRowClick,\n stickyColumns,\n stickySelectionColumn,\n showTitleBar,\n sections,\n dragAndDropProps,\n dataExtension,\n } = useTableFeatures(configuration);\n\n return (\n <Table\n dataHook=\"auto-patterns-table\"\n search={search}\n title={title}\n state={state}\n columns={columns}\n dataExtension={dataExtension}\n customColumns={customColumns}\n {...dragAndDropProps}\n actionCell={actionCell}\n filters={filters}\n views={views}\n emptyState={emptyState}\n bulkActionToolbar={bulkActionToolbar}\n onRowClick={onRowClick}\n horizontalScroll\n stickyColumns={stickyColumns}\n stickySelectionColumn={stickySelectionColumn}\n showTitleBar={showTitleBar}\n sections={sections}\n />\n );\n};\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,KAAK,QAAQ,eAAe;AAErC,SAASC,gBAAgB,QAAQ,aAAa;AAM9C,OAAO,MAAMC,iBAAiB,GAAGC,IAAA,IAEI;EAAA,IAFH;IAChCC;EAC6B,CAAC,GAAAD,IAAA;EAC9B,MAAM;IACJE,KAAK;IACLC,OAAO;IACPC,aAAa;IACbC,MAAM;IACNC,KAAK;IACLC,UAAU;IACVC,OAAO;IACPC,KAAK;IACLC,UAAU;IACVC,iBAAiB;IACjBC,UAAU;IACVC,aAAa;IACbC,qBAAqB;IACrBC,YAAY;IACZC,QAAQ;IACRC,gBAAgB;IAChBC;EACF,CAAC,GAAGpB,gBAAgB,CAACG,aAAa,CAAC;EAEnC,oBACEL,KAAA,CAAAuB,aAAA,CAACtB,KAAK,EAAAuB,QAAA;IACJC,QAAQ,EAAC,qBAAqB;IAC9BhB,MAAM,EAAEA,MAAO;IACfC,KAAK,EAAEA,KAAM;IACbJ,KAAK,EAAEA,KAAM;IACbC,OAAO,EAAEA,OAAQ;IACjBe,aAAa,EAAEA,aAAc;IAC7Bd,aAAa,EAAEA;EAAc,GACzBa,gBAAgB;IACpBP,UAAU,EAAEA,UAAW;IACvBF,OAAO,EAAEA,OAAQ;IACjBC,KAAK,EAAEA,KAAM;IACbF,UAAU,EAAEA,UAAW;IACvBI,iBAAiB,EAAEA,iBAAkB;IACrCC,UAAU,EAAEA,UAAW;IACvBU,gBAAgB;IAChBT,aAAa,EAAEA,aAAc;IAC7BC,qBAAqB,EAAEA,qBAAsB;IAC7CC,YAAY,EAAEA,YAAa;IAC3BC,QAAQ,EAAEA;EAAS,EACpB,CAAC;AAEN,CAAC","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":[]}
|
|
@@ -5,6 +5,7 @@ import { Box, Text, TextButton } from '@wix/design-system';
|
|
|
5
5
|
import { useActionCell } from './useActionCell';
|
|
6
6
|
import { useBulkActionToolbar } from './useBulkActionToolbar';
|
|
7
7
|
import { useAutoPatternsOptimisticActions } from './useAutoPatternsOptimisticActions';
|
|
8
|
+
import { useViews } from './useViews';
|
|
8
9
|
export const useCommonCollectionFeatures = _ref => {
|
|
9
10
|
var _toolbarTitle$subtitl, _toolbarTitle$subtitl2, _toolbarTitle$subtitl3, _toolbarTitle$subtitl4, _toolbarTitle$subtitl5, _toolbarTitle$subtitl6, _toolbarTitle$subtitl7;
|
|
10
11
|
let {
|
|
@@ -14,7 +15,8 @@ export const useCommonCollectionFeatures = _ref => {
|
|
|
14
15
|
search,
|
|
15
16
|
emptyState: emptyStateConfig,
|
|
16
17
|
collection,
|
|
17
|
-
collectionState
|
|
18
|
+
collectionState,
|
|
19
|
+
views: viewsConfig
|
|
18
20
|
} = _ref;
|
|
19
21
|
const optimisticActions = useAutoPatternsOptimisticActions({
|
|
20
22
|
collectionConfig: collection,
|
|
@@ -31,7 +33,9 @@ export const useCommonCollectionFeatures = _ref => {
|
|
|
31
33
|
config: bulkActionToolbarConfig,
|
|
32
34
|
collectionId: collection.collectionId
|
|
33
35
|
});
|
|
34
|
-
const
|
|
36
|
+
const views = useViews(viewsConfig);
|
|
37
|
+
const shouldShowTitle = toolbarTitle && !views;
|
|
38
|
+
const title = shouldShowTitle ? /*#__PURE__*/React.createElement(ToolbarTitle, {
|
|
35
39
|
title: toolbarTitle.title,
|
|
36
40
|
subtitle: {
|
|
37
41
|
text: ((_toolbarTitle$subtitl = toolbarTitle.subtitle) == null ? void 0 : _toolbarTitle$subtitl.text) ?? '',
|
|
@@ -58,10 +62,11 @@ export const useCommonCollectionFeatures = _ref => {
|
|
|
58
62
|
},
|
|
59
63
|
itemsLimit: toolbarTitle.itemsLimit,
|
|
60
64
|
showTotal: toolbarTitle.showTotal
|
|
61
|
-
});
|
|
65
|
+
}) : undefined;
|
|
62
66
|
return {
|
|
63
67
|
search: (search == null ? void 0 : search.shown) !== false,
|
|
64
68
|
title,
|
|
69
|
+
views,
|
|
65
70
|
emptyState,
|
|
66
71
|
actionCell,
|
|
67
72
|
bulkActionToolbar,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useEmptyStates","ToolbarTitle","Box","Text","TextButton","useActionCell","useBulkActionToolbar","useAutoPatternsOptimisticActions","useCommonCollectionFeatures","_ref","_toolbarTitle$subtitl","_toolbarTitle$subtitl2","_toolbarTitle$subtitl3","_toolbarTitle$subtitl4","_toolbarTitle$subtitl5","_toolbarTitle$subtitl6","_toolbarTitle$subtitl7","actionCell","actionCellConfig","bulkActionToolbar","bulkActionToolbarConfig","toolbarTitle","search","emptyState","emptyStateConfig","collection","collectionState","optimisticActions","collectionConfig","config","collectionId","title","createElement","subtitle","text","learnMore","info","content","direction","gap","dataHook","light","size","link","underline","skin","as","rel","target","href","url","label","itemsLimit","showTotal","shown"],"sources":["../../../src/hooks/useCommonCollectionFeatures.tsx"],"sourcesContent":["import React from 'react';\nimport { useEmptyStates } from './useEmptyStates';\n\nimport { CollectionState, ToolbarTitle } from '@wix/patterns';\n\nimport { Box, Text, TextButton } from '@wix/design-system';\nimport { BaseCollectionComponentConfig } from '../types';\nimport { useActionCell } from './useActionCell';\nimport { useBulkActionToolbar } from './useBulkActionToolbar';\nimport { useAutoPatternsOptimisticActions } from './useAutoPatternsOptimisticActions';\n\nexport type UseCommonCollectionFeaturesParams = Pick<\n BaseCollectionComponentConfig,\n | 'actionCell'\n | 'toolbarTitle'\n | 'search'\n | 'emptyState'\n | 'collection'\n | 'bulkActionToolbar'\n | 'entityPageId'\n> & {\n collectionState: CollectionState<any>;\n};\n\nexport const useCommonCollectionFeatures = ({\n actionCell: actionCellConfig,\n bulkActionToolbar: bulkActionToolbarConfig,\n toolbarTitle,\n search,\n emptyState: emptyStateConfig,\n collection,\n collectionState,\n}: UseCommonCollectionFeaturesParams) => {\n const optimisticActions = useAutoPatternsOptimisticActions({\n collectionConfig: collection,\n collectionState,\n });\n\n const { emptyState } = useEmptyStates(emptyStateConfig);\n const actionCell = useActionCell({\n config: actionCellConfig,\n collectionId: collection.collectionId,\n });\n\n const bulkActionToolbar = useBulkActionToolbar({\n config: bulkActionToolbarConfig,\n collectionId: collection.collectionId,\n });\n\n const
|
|
1
|
+
{"version":3,"names":["React","useEmptyStates","ToolbarTitle","Box","Text","TextButton","useActionCell","useBulkActionToolbar","useAutoPatternsOptimisticActions","useViews","useCommonCollectionFeatures","_ref","_toolbarTitle$subtitl","_toolbarTitle$subtitl2","_toolbarTitle$subtitl3","_toolbarTitle$subtitl4","_toolbarTitle$subtitl5","_toolbarTitle$subtitl6","_toolbarTitle$subtitl7","actionCell","actionCellConfig","bulkActionToolbar","bulkActionToolbarConfig","toolbarTitle","search","emptyState","emptyStateConfig","collection","collectionState","views","viewsConfig","optimisticActions","collectionConfig","config","collectionId","shouldShowTitle","title","createElement","subtitle","text","learnMore","info","content","direction","gap","dataHook","light","size","link","underline","skin","as","rel","target","href","url","label","itemsLimit","showTotal","undefined","shown"],"sources":["../../../src/hooks/useCommonCollectionFeatures.tsx"],"sourcesContent":["import React from 'react';\nimport { useEmptyStates } from './useEmptyStates';\n\nimport { CollectionState, ToolbarTitle } from '@wix/patterns';\n\nimport { Box, Text, TextButton } from '@wix/design-system';\nimport { BaseCollectionComponentConfig } from '../types';\nimport { useActionCell } from './useActionCell';\nimport { useBulkActionToolbar } from './useBulkActionToolbar';\nimport { useAutoPatternsOptimisticActions } from './useAutoPatternsOptimisticActions';\nimport { useViews } from './useViews';\n\nexport type UseCommonCollectionFeaturesParams = Pick<\n BaseCollectionComponentConfig,\n | 'actionCell'\n | 'toolbarTitle'\n | 'search'\n | 'emptyState'\n | 'collection'\n | 'bulkActionToolbar'\n | 'entityPageId'\n | 'views'\n> & {\n collectionState: CollectionState<any>;\n};\n\nexport const useCommonCollectionFeatures = ({\n actionCell: actionCellConfig,\n bulkActionToolbar: bulkActionToolbarConfig,\n toolbarTitle,\n search,\n emptyState: emptyStateConfig,\n collection,\n collectionState,\n views: viewsConfig,\n}: UseCommonCollectionFeaturesParams) => {\n const optimisticActions = useAutoPatternsOptimisticActions({\n collectionConfig: collection,\n collectionState,\n });\n\n const { emptyState } = useEmptyStates(emptyStateConfig);\n const actionCell = useActionCell({\n config: actionCellConfig,\n collectionId: collection.collectionId,\n });\n\n const bulkActionToolbar = useBulkActionToolbar({\n config: bulkActionToolbarConfig,\n collectionId: collection.collectionId,\n });\n\n const views = useViews(viewsConfig);\n\n const shouldShowTitle = toolbarTitle && !views;\n\n const title = shouldShowTitle ? (\n <ToolbarTitle\n title={toolbarTitle.title}\n subtitle={{\n text: toolbarTitle.subtitle?.text ?? '',\n learnMore: toolbarTitle.subtitle?.learnMore,\n info: toolbarTitle.subtitle?.info && {\n content: (\n <Box direction=\"vertical\" gap=\"6px\">\n <Text\n dataHook=\"toolbar-title-subtitle-info-content\"\n light\n size=\"small\"\n >\n {toolbarTitle.subtitle?.info?.content.text}\n </Text>\n {toolbarTitle.subtitle?.info?.content.link && (\n <TextButton\n dataHook=\"toolbar-title-subtitle-info-link\"\n size=\"small\"\n underline=\"always\"\n skin=\"light\"\n as=\"a\"\n rel=\"noopener\"\n target=\"_blank\"\n href={toolbarTitle.subtitle?.info?.content.link.url}\n >\n {toolbarTitle.subtitle?.info?.content.link.label}\n </TextButton>\n )}\n </Box>\n ),\n },\n }}\n itemsLimit={toolbarTitle.itemsLimit}\n showTotal={toolbarTitle.showTotal}\n />\n ) : undefined;\n\n return {\n search: search?.shown !== false,\n title,\n views,\n emptyState,\n actionCell,\n bulkActionToolbar,\n optimisticActions,\n };\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":[]}
|