zova-module-a-table 5.1.16 → 5.1.18

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.
@@ -1,4 +1,4 @@
1
- import type { IResourceTableActionRowOptionsBase, TypeTableCellRenderComponent } from 'zova-module-a-openapi';
1
+ import type { IResourceTableActionRowOptionsBase, ISchemaObjectExtensionField, TypeTableCellRenderComponent, TypeTableCellRenderComponentProvider } from 'zova-module-a-openapi';
2
2
  import { celEnvBase } from '@cabloy/utils';
3
3
  import { CellContext } from '@tanstack/vue-table';
4
4
  import { SchemaObject } from 'openapi3-ts/oas31';
@@ -17,7 +17,7 @@ export interface ControllerTableProps<TData extends {} = {}> {
17
17
  }
18
18
  export declare class ControllerTable<TData extends {} = {}> extends BeanControllerTableBase {
19
19
  static $propsDefault: {};
20
- properties: SchemaObject[] | undefined;
20
+ properties: ISchemaObjectExtensionField[] | undefined;
21
21
  columns: TypeColumn<TData>[];
22
22
  table: TypeTable<TData>;
23
23
  tableMeta: ITableMeta<TData>;
@@ -39,11 +39,11 @@ export declare class ControllerTable<TData extends {} = {}> extends BeanControll
39
39
  cellRender(render: TypeTableCellRenderComponent, columnProps: IResourceTableActionRowOptionsBase, renderContext: IJsxRenderContextTableCell): any;
40
40
  private _cellRender;
41
41
  private _cellRenderInner;
42
- getColumnProperty(name: string): SchemaObject | undefined;
42
+ getColumnProperty(name: string): ISchemaObjectExtensionField | undefined;
43
43
  private _getColumnCelEnv;
44
44
  getColumnScope(name: string, scopeExtra?: {}): ITableColumnScope;
45
45
  getColumnComponentPropsTop(name: string, celScope: {}, renderContext: {}): ITableCellRenderColumnOptions;
46
46
  private _getColumnComponentPropsTopByRest;
47
- getRenderProvider(render: TypeTableCellRenderComponent | undefined): TypeTableCellRenderComponent;
47
+ getRenderProvider(render: TypeTableCellRenderComponent | undefined): TypeTableCellRenderComponentProvider;
48
48
  }
49
49
  //# sourceMappingURL=controller.d.ts.map
@@ -1 +1 @@
1
- {"version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ast, createBeanDecorator, deepEqual, deepExtend, objectAssignReactive, prepareComponentOptions, useController } from "zova";
1
+ import { BeanControllerBase, BeanControllerPageBase, BeanInfo, BeanRenderBase, BeanScopeBase, appResource, beanFullNameFromOnionName, cast, createBeanDecorator, deepEqual, deepExtend, objectAssignReactive, prepareComponentOptions, useController } from "zova";
2
2
  import { celEnvBase, isNilOrEmptyString } from "@cabloy/utils";
3
3
  import { FlexRender, createColumnHelper, getCoreRowModel, useVueTable } from "@tanstack/vue-table";
4
4
  import { classes } from "typestyle";
@@ -249,7 +249,9 @@ var ControllerTable = (_dec$2 = Controller(), _dec2$2 = BeanInfo({ module: "a-ta
249
249
  };
250
250
  }
251
251
  getRenderProvider(render) {
252
- return render || "text";
252
+ if (!render) return "text";
253
+ if (typeof render === "string" && render.includes(":")) return beanFullNameFromOnionName(render, "tableCell");
254
+ return render;
253
255
  }
254
256
  }, _ControllerTable.$propsDefault = {}, _ControllerTable)) || _class$2) || _class$2);
255
257
  //#endregion
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["celEnvBase","isNilOrEmptyString","createColumnHelper","getCoreRowModel","classes","appResource","cast","deepEqual","deepExtend","objectAssignReactive","isJsxComponent","ZovaJsx","Controller","BeanControllerTableBase","ControllerTable","_dec","_dec2","__z_BeanInfo","module","_class","_ControllerTable","constructor","args","properties","columns","table","tableMeta","zovaJsx","columnCelEnv","__init__","bean","_setBean","_getColumnCelEnv","_newBeanSimple","undefined","_createProperties","refreshMeta","$watch","$props","schema","newValue","oldValue","_createTable","data","_createTableMeta","_createColumns","self","tableOptions","getRowId","row","id","renderFallbackValue","scope","config","manualPagination","$useTable","getColumns","_createColumnsMiddle","key","render","columnScope","getColumnScope","jsxRenderContext","getColumnJsxRenderContext","visible","columnProps","getColumnComponentPropsTop","_createColumnRender","columnHelper","property","push","accessor","header","_props","title","cell","props","renders","$computed","$sdk","loadSchemaProperties","promises","res","Promise","all","filter","_item","index","item","forEach","celScope","app","ctx","$scene","$host","$celScope","$jsx","$$table","getCellJsxRenderContext","cellContext","cellRenderPrepare","Array","isArray","renderProviders","map","getRenderProvider","renderProvider","includes","sys","_getBean","renderContext","beanInstance","beanOptions","getBean","onionOptions","options","checkVisible","_cellRender","cellRender","cellScope","_getBeanSyncOnly","cellProps","setTransientObject","getValue","name","_cellRenderInner","value","fallbackValue","cellProps2","renderJsxProps","class","style","$style","children","length","renderJsxChildrenDirect","getColumnProperty","find","celEnv","clone","registerFunction","transientObject","scopeExtra","tableScope","rest","_getColumnComponentPropsTopByRest","_renderContext","evaluateExpression","Object","assign","$propsDefault","FlexRender","BeanRenderBase","Render","RenderTable","_dec","_dec2","__z_BeanInfo","module","_class","_renderTableDefault","table","_createVNode","getFlatHeaders","map","header","id","column","columnDef","getContext","getRowModel","rows","row","getVisibleCells","cell","render","$slotDefault"],"sources":["../src/lib/beanControllerTableBase.ts","../src/component/table/controller.tsx","../src/component/table/render.tsx","../src/.metadata/component/table.ts","../src/config/config.ts","../src/.metadata/index.ts","../src/lib/beanControllerPageTableBase.ts","../src/lib/tableCell.ts"],"sourcesContent":["import type { RowData, Table } from '@tanstack/table-core';\nimport type { TableOptionsWithReactiveData } from '@tanstack/vue-table';\n\nimport { useVueTable } from '@tanstack/vue-table';\nimport { markRaw } from 'vue';\nimport { BeanControllerBase } from 'zova';\n\nexport class BeanControllerTableBase extends BeanControllerBase {\n public $useTable<TData extends RowData>(initialOptions: TableOptionsWithReactiveData<TData>): Table<TData> {\n return this.ctx.util.instanceScope(() => {\n return markRaw(useVueTable(initialOptions));\n });\n }\n\n public async refreshMeta() {\n throw new Error('should implement refreshMeta');\n }\n}\n","import type { IResourceTableActionRowOptionsBase, ISchemaObjectExtensionFieldRest, TypeTableCellRenderComponent } from 'zova-module-a-openapi';\n\nimport { celEnvBase, isNilOrEmptyString } from '@cabloy/utils';\nimport { CellContext, createColumnHelper, getCoreRowModel, TableOptionsWithReactiveData } from '@tanstack/vue-table';\nimport { SchemaObject } from 'openapi3-ts/oas31';\nimport { classes } from 'typestyle';\nimport { VNode } from 'vue';\nimport { appResource, cast, deepEqual, deepExtend, objectAssignReactive } from 'zova';\nimport { isJsxComponent, ZovaJsx } from 'zova-jsx';\nimport { Controller } from 'zova-module-a-bean';\n\nimport type { ITableMeta, TypeColumn, TypeTable, TypeTableGetColumns } from '../../types/table.js';\nimport type { IDecoratorTableCellOptions, IJsxRenderContextTableCell, ITableCellRender } from '../../types/tableCell.js';\n\nimport { BeanControllerTableBase } from '../../lib/beanControllerTableBase.js';\nimport {\n ITableCellRenderColumnOptions,\n type IJsxRenderContextTableColumn,\n type ITableCellRenderColumnProps,\n type ITableCellScope,\n type ITableColumnScope,\n type ITableScope,\n type TypeTableCellRender,\n} from '../../types/tableColumn.js';\n\nexport interface ControllerTableProps<TData extends {} = {}> {\n data?: TData[];\n schema?: SchemaObject;\n tableScope?: ITableScope;\n getColumns?: TypeTableGetColumns<TData>;\n slotDefault?: (table: ControllerTable<TData>) => VNode;\n}\n\n@Controller()\nexport class ControllerTable<TData extends {} = {}> extends BeanControllerTableBase {\n static $propsDefault = {};\n\n properties: SchemaObject[] | undefined;\n columns: TypeColumn<TData>[];\n table: TypeTable<TData>;\n tableMeta: ITableMeta<TData>;\n zovaJsx: ZovaJsx;\n columnCelEnv: typeof celEnvBase;\n\n protected async __init__() {\n this.bean._setBean('$$table', this);\n // jsx\n this.columnCelEnv = this._getColumnCelEnv();\n this.zovaJsx = this.bean._newBeanSimple(ZovaJsx, false, undefined, this.columnCelEnv);\n // properties\n this._createProperties();\n // tableMeta/columns\n await this.refreshMeta();\n // watch\n this.$watch(\n () => this.$props.schema,\n async (newValue, oldValue) => {\n if (deepEqual(newValue, oldValue)) return;\n await this.refreshMeta();\n },\n );\n // table\n this._createTable();\n }\n\n get schema() {\n return this.$props.schema;\n }\n\n get data() {\n return this.$props.data;\n }\n\n public async refreshMeta() {\n this.tableMeta = await this._createTableMeta();\n this.columns = await this._createColumns();\n }\n\n private _createTable() {\n // eslint-disable-next-line\n const self = this;\n const tableOptions: TableOptionsWithReactiveData<TData> = {\n getRowId: (row: TData) => cast(row).id,\n getCoreRowModel: getCoreRowModel(),\n renderFallbackValue: this.scope.config.renderFallbackValue,\n manualPagination: true,\n get data() {\n return self.data || [];\n },\n get columns() {\n return self.columns;\n },\n };\n this.table = this.$useTable(tableOptions);\n }\n\n private async _createColumns() {\n if (!this.properties) return [];\n if (!this.$props.getColumns) return await this._createColumnsMiddle(this.tableMeta.properties);\n return await this.$props.getColumns(\n async properties => {\n return await this._createColumnsMiddle(properties ?? this.tableMeta.properties);\n },\n async (key: string, render: TypeTableCellRenderComponent): Promise<TypeTableCellRender<TData, any> | undefined> => {\n // columnScope\n const columnScope = this.getColumnScope(key);\n // renderContext\n const jsxRenderContext = this.getColumnJsxRenderContext(columnScope);\n // columnProps\n const { visible, columnProps } = this.getColumnComponentPropsTop(key, columnScope, jsxRenderContext);\n // visible\n if (visible === false) return;\n return await this._createColumnRender(render, columnProps, columnScope, jsxRenderContext);\n },\n this,\n );\n }\n\n private async _createColumnsMiddle(properties: SchemaObject[]): Promise<TypeColumn<TData>[]> {\n const tableMeta = this.tableMeta;\n const columnHelper = createColumnHelper<TData>();\n const columns: TypeColumn<TData>[] = [];\n for (const property of properties) {\n const key = property.key!;\n columns.push(\n columnHelper.accessor(key as any, {\n id: key,\n header: _props => {\n return property?.title || key;\n },\n cell: props => tableMeta.renders[key](props),\n }),\n );\n }\n return columns;\n }\n\n private _createProperties() {\n this.properties = this.$computed(() => {\n return this.$sdk.loadSchemaProperties(this.schema, 'table');\n });\n }\n\n private async _createTableMeta() {\n let properties: SchemaObject[] = [];\n const renders: Record<string, TypeTableCellRender<TData>> = {};\n if (!this.properties) return { properties, renders };\n const promises: Promise<any>[] = [];\n for (const property of this.properties) {\n const key = property.key!;\n // columnScope\n const columnScope = this.getColumnScope(key);\n // renderContext\n const jsxRenderContext = this.getColumnJsxRenderContext(columnScope);\n // columnProps\n const { visible, render, columnProps } = this.getColumnComponentPropsTop(key, columnScope, jsxRenderContext);\n // visible\n if (visible === false) continue;\n // property\n properties.push(property);\n // render\n promises.push(this._createColumnRender(render, columnProps, columnScope, jsxRenderContext));\n }\n let res = await Promise.all(promises);\n properties = properties.filter((_item, index) => !!res[index]);\n res = res.filter(item => !!item);\n properties.forEach((item, index) => {\n renders[item.key!] = res[index];\n });\n return { properties, renders };\n }\n\n public getColumnJsxRenderContext(celScope: ITableColumnScope): IJsxRenderContextTableColumn {\n return {\n app: this.app,\n ctx: this.ctx,\n $scene: 'tableColumn',\n $host: this,\n $celScope: celScope,\n $jsx: this.zovaJsx,\n $$table: this,\n };\n }\n\n public getCellJsxRenderContext(celScope: ITableCellScope, cellContext: CellContext<TData, any>): IJsxRenderContextTableCell {\n return {\n app: this.app,\n ctx: this.ctx,\n $scene: 'tableCell',\n $host: this,\n $celScope: celScope,\n $jsx: this.zovaJsx,\n $$table: this,\n cellContext,\n };\n }\n\n public async cellRenderPrepare(renders: TypeTableCellRenderComponent | TypeTableCellRenderComponent[]) {\n if (!Array.isArray(renders)) renders = [renders];\n const renderProviders = renders.map(item => this.getRenderProvider(item));\n const promises: Promise<any>[] = renderProviders.map(renderProvider =>\n (async () => {\n if (typeof renderProvider === 'string' && renderProvider.includes('.tableCell.')) {\n return await this.sys.bean._getBean(renderProvider as any, true);\n }\n })(),\n );\n return await Promise.all(promises);\n }\n\n private async _createColumnRender(\n render: TypeTableCellRenderComponent | undefined,\n columnProps: ITableCellRenderColumnProps | undefined,\n columnScope: ITableColumnScope,\n renderContext: IJsxRenderContextTableColumn,\n ): Promise<TypeTableCellRender<TData, any> | undefined> {\n // renderProvider\n const renderProvider = this.getRenderProvider(render);\n // beanInstance\n let beanInstance: ITableCellRender | undefined;\n if (typeof renderProvider === 'string' && renderProvider.includes('.tableCell.')) {\n beanInstance = await this.sys.bean._getBean(renderProvider as any, true);\n const beanOptions = appResource.getBean(renderProvider as any);\n const onionOptions = beanOptions?.options as IDecoratorTableCellOptions | undefined;\n columnProps = deepExtend({}, onionOptions, columnProps);\n // should not eval jsx columnProps\n // columnProps = this.zovaJsx.renderJsxProps(columnProps as any, {}, columnScope, renderContext) as any;\n if (beanInstance?.checkVisible && !(await beanInstance.checkVisible(columnProps as any, renderContext))) return;\n }\n return cellContext => {\n if (!cellContext) return;\n return this._cellRender(render, columnProps, columnScope, cellContext, renderProvider, beanInstance, undefined, undefined, undefined);\n };\n }\n\n public cellRender(\n render: TypeTableCellRenderComponent,\n columnProps: IResourceTableActionRowOptionsBase,\n renderContext: IJsxRenderContextTableCell,\n ) {\n // render\n const cellScope = renderContext.$celScope;\n // renderProvider\n const renderProvider = this.getRenderProvider(render);\n // beanInstance\n let beanInstance: ITableCellRender | undefined;\n if (typeof renderProvider === 'string' && renderProvider.includes('.tableCell.')) {\n beanInstance = this.sys.bean._getBeanSyncOnly(renderProvider as any);\n const beanOptions = appResource.getBean(renderProvider as any);\n const onionOptions = beanOptions?.options as IDecoratorTableCellOptions | undefined;\n columnProps = deepExtend({}, onionOptions, columnProps);\n // should not eval jsx columnProps\n // columnProps = this.zovaJsx.renderJsxProps(columnProps as any, {}, renderContext.$celScope, renderContext) as any;\n }\n // const cellProps = isJsxComponent(render) ? Object.assign({}, columnProps, cast(render).props) : columnProps;\n const cellProps = columnProps;\n return this._cellRender(\n render,\n columnProps as ITableCellRenderColumnProps,\n undefined,\n renderContext.cellContext,\n renderProvider,\n beanInstance,\n cellProps,\n cellScope,\n renderContext,\n );\n }\n\n private _cellRender(\n render: TypeTableCellRenderComponent | undefined,\n columnProps: ITableCellRenderColumnProps | undefined,\n columnScope: ITableColumnScope | undefined,\n cellContext: CellContext<TData, any>,\n renderProvider: TypeTableCellRenderComponent,\n beanInstance: ITableCellRender | undefined,\n cellProps: any | undefined,\n cellScope: ITableCellScope | undefined,\n jsxRenderContext: IJsxRenderContextTableCell | undefined,\n ) {\n return this.zovaJsx.setTransientObject(\n {\n getValue: (name: string) => {\n return cellContext.row.getValue(name);\n },\n },\n () => {\n return this._cellRenderInner(\n render,\n columnProps,\n columnScope,\n cellContext,\n renderProvider,\n beanInstance,\n cellProps,\n cellScope,\n jsxRenderContext,\n );\n },\n );\n }\n\n private _cellRenderInner(\n render: TypeTableCellRenderComponent | undefined,\n columnProps: ITableCellRenderColumnProps | undefined,\n columnScope: ITableColumnScope | undefined,\n cellContext: CellContext<TData, any>,\n renderProvider: TypeTableCellRenderComponent,\n beanInstance: ITableCellRender | undefined,\n cellProps: any | undefined,\n cellScope: ITableCellScope | undefined,\n jsxRenderContext: IJsxRenderContextTableCell | undefined,\n ) {\n // value\n const value = cellContext.getValue();\n // renderFallbackValue\n const fallbackValue = this.table.options.renderFallbackValue;\n // cellScope\n if (!cellScope) {\n cellScope = objectAssignReactive({}, columnScope, { value, fallbackValue })!;\n }\n // render: text\n if (renderProvider === ('text' as TypeTableCellRenderComponent)) {\n return isNilOrEmptyString(value) ? fallbackValue : value;\n }\n // renderContext\n if (!jsxRenderContext) {\n jsxRenderContext = this.getCellJsxRenderContext(cellScope, cellContext);\n }\n // beanInstance\n if (beanInstance) {\n // jsx: props\n if (!cellProps) {\n // cellProps = isJsxComponent(render) ? Object.assign({}, columnProps, cast(render).props) : columnProps;\n cellProps = columnProps;\n }\n const cellProps2 = this.zovaJsx.renderJsxProps(cellProps, {}, cellScope, jsxRenderContext) as any;\n if (cellProps2.class || cellProps2.style) {\n cellProps2.class = classes(cellProps2.class, jsxRenderContext.$host.$style(cellProps2.style));\n delete cellProps2.style;\n }\n return beanInstance.render(cellProps2, jsxRenderContext, () => {\n const children = isJsxComponent(render) && cast(render).children;\n if (children && children.length > 0) {\n return this.zovaJsx.renderJsxChildrenDirect(children, cellScope, jsxRenderContext);\n } else {\n return value;\n }\n });\n }\n // general component\n return this.zovaJsx.render(render!, {}, cellScope, jsxRenderContext);\n }\n\n public getColumnProperty(name: string): SchemaObject | undefined {\n if (!this.properties) return;\n return this.properties.find(item => item.key === name);\n }\n\n private _getColumnCelEnv(): typeof celEnvBase {\n const celEnv = celEnvBase.clone();\n celEnv.registerFunction('getProperty(string):dyn', name => {\n return this.getColumnProperty(name);\n });\n celEnv.registerFunction('getValue(string):dyn', name => {\n return this.zovaJsx.transientObject.getValue(name);\n });\n return celEnv;\n }\n\n public getColumnScope(name: string, scopeExtra?: {}): ITableColumnScope {\n return objectAssignReactive({}, this.$props.tableScope, {\n name,\n property: this.getColumnProperty(name),\n ...scopeExtra,\n });\n }\n\n public getColumnComponentPropsTop(name: string, celScope: {}, renderContext: {}): ITableCellRenderColumnOptions {\n const property = this.getColumnProperty(name);\n const rest = property?.rest;\n return this._getColumnComponentPropsTopByRest(rest, name, celScope, renderContext);\n }\n\n private _getColumnComponentPropsTopByRest(\n rest: ISchemaObjectExtensionFieldRest | undefined,\n name: string,\n celScope: {},\n _renderContext: {},\n ): ITableCellRenderColumnOptions {\n const visible = this.zovaJsx.evaluateExpression(rest?.visible, celScope);\n const render = rest?.render as TypeTableCellRenderComponent | undefined;\n const columnProps = Object.assign({ key: name }, cast(rest)?.columnProps);\n return { visible, render, columnProps };\n }\n\n // public getRenderFlattern(render: TypeTableCellRenderComponent): TypeTableCellRenderComponent {\n // return isJsxComponent(render) ? cast(render).type : render;\n // }\n\n public getRenderProvider(render: TypeTableCellRenderComponent | undefined): TypeTableCellRenderComponent {\n return render || ('text' as TypeTableCellRenderComponent);\n }\n}\n","import { FlexRender } from '@tanstack/vue-table';\nimport { BeanRenderBase } from 'zova';\nimport { Render } from 'zova-module-a-bean';\n\n@Render()\nexport class RenderTable extends BeanRenderBase {\n private _renderTableDefault() {\n const table = this.table;\n return (\n <table class=\"table\">\n <thead>\n <tr>\n {table.getFlatHeaders().map(header => {\n return (\n <th key={header.id}>\n <FlexRender\n render={header.column.columnDef.header}\n props={header.getContext()}\n ></FlexRender>\n </th>\n );\n })}\n </tr>\n </thead>\n <tbody>\n {table.getRowModel().rows.map(row => {\n return (\n <tr key={row.id}>\n {row.getVisibleCells().map(cell => {\n return (\n <td key={cell.id}>\n <FlexRender\n render={cell.column.columnDef.cell}\n props={cell.getContext()}\n ></FlexRender>\n </td>\n );\n })}\n </tr>\n );\n })}\n </tbody>\n </table>\n );\n }\n\n public render() {\n return this.$slotDefault ? this.$slotDefault(this) : this._renderTableDefault();\n }\n}\n","import type { TypeControllerInnerProps } from 'zova';\n\nimport { defineComponent } from 'vue';\nimport { prepareComponentOptions, useController } from 'zova';\n\nimport type { ControllerTableProps } from '../../component/table/controller.jsx';\n\nimport { ControllerTable } from '../../component/table/controller.jsx';\nimport { RenderTable } from '../../component/table/render.jsx';\nexport type TypeControllerTablePublicProps<TData extends {} = {}> = {\n controllerRef?: (ref: ControllerTable<TData>) => void;\n} & ControllerTableProps<TData>;\n\ntype ControllerInnerProps<TData extends {} = {}> = TypeControllerInnerProps<\n ControllerTableProps<TData>,\n keyof typeof ControllerTable.$propsDefault\n>;\ndeclare module 'zova-module-a-table' {\n export interface ControllerTable<TData extends {} = {}> {\n $props: ControllerInnerProps<TData>;\n }\n}\ndeclare module 'zova-module-a-table' {\n export interface RenderTable<TData extends {} = {}> extends ControllerTable<TData> {}\n}\nexport const ZTable = defineComponent(\n <TData extends {} = {}>(_props: TypeControllerTablePublicProps<TData>) => {\n useController(ControllerTable, RenderTable, undefined);\n return () => {};\n },\n prepareComponentOptions(),\n);\ndeclare module 'zova-module-a-bean' {\n export interface IVonaComponentRecord {\n 'a-table:table': ControllerTableProps;\n }\n}\n","import type { ZovaSys } from 'zova';\n\nexport const config = (_sys: ZovaSys) => {\n return {\n renderFallbackValue: '--',\n };\n};\n","// eslint-disable\n/** controller: begin */\nexport * from '../component/table/controller.jsx';\n\nimport 'zova';\ndeclare module 'zova' {\n \n \n}\ndeclare module 'zova-module-a-table' {\n \n export interface ControllerTable {\n /** @internal */\n get scope(): ScopeModuleATable;\n } \n}\n/** controller: end */\n/** controller: begin */\nimport { ControllerTable } from '../component/table/controller.jsx';\nimport 'zova';\ndeclare module 'zova' {\n export interface IBeanRecordLocal {\n 'a-table.controller.table': ControllerTable;\n }\n}\n/** controller: end */\n\n/** components: begin */\nexport * from './component/table.js';\nimport { ZTable } from './component/table.js';\nexport const components = {\n 'table': ZTable,\n};\nimport 'zova';\ndeclare module 'zova' {\nexport interface IComponentRecord {\n 'a-table:table': ControllerTable;\n}\nexport interface IZovaComponentRecord {\n 'a-table:table': typeof ZTable;\n}\n}\n/** components: end */\n/** render: begin */\nexport * from '../component/table/render.jsx';\n\nimport 'zova';\ndeclare module 'zova' {\n \n \n}\ndeclare module 'zova-module-a-table' {\n \n export interface RenderTable {\n /** @internal */\n get scope(): ScopeModuleATable;\n } \n}\n/** render: end */\n/** render: begin */\nimport { RenderTable } from '../component/table/render.jsx';\nimport 'zova';\ndeclare module 'zova' {\n export interface IBeanRecordLocal {\n 'a-table.render.table': RenderTable;\n }\n}\n/** render: end */\n/** config: begin */\nexport * from '../config/config.js';\nimport { config } from '../config/config.js';\n/** config: end */\n/** scope: begin */\nimport { BeanScopeBase, type BeanScopeUtil, TypeModuleConfig } from 'zova';\nimport { Scope } from 'zova-module-a-bean';\n\n@Scope()\nexport class ScopeModuleATable extends BeanScopeBase {}\n\nexport interface ScopeModuleATable {\n util: BeanScopeUtil;\nconfig: TypeModuleConfig<typeof config>;\n}\n\nimport 'zova';\ndeclare module 'zova' {\n export interface IBeanScopeRecord {\n 'a-table': ScopeModuleATable;\n }\n \n export interface IBeanScopeConfig {\n 'a-table': ReturnType<typeof config>;\n }\n\n \n\n \n}\n \n/** scope: end */\n","import type { RowData, Table } from '@tanstack/table-core';\nimport type { TableOptionsWithReactiveData } from '@tanstack/vue-table';\n\nimport { useVueTable } from '@tanstack/vue-table';\nimport { markRaw } from 'vue';\nimport { BeanControllerPageBase } from 'zova';\n\nexport class BeanControllerPageTableBase extends BeanControllerPageBase {\n public $useTable<TData extends RowData>(initialOptions: TableOptionsWithReactiveData<TData>): Table<TData> {\n return this.ctx.util.instanceScope(() => {\n return markRaw(useVueTable(initialOptions));\n });\n }\n\n public async refreshMeta() {\n throw new Error('should implement refreshMeta');\n }\n}\n","import { createBeanDecorator } from 'zova';\n\nimport type { IDecoratorTableCellOptions } from '../types/tableCell.js';\n\nexport function TableCell<T extends IDecoratorTableCellOptions>(options?: T): ClassDecorator {\n return createBeanDecorator('tableCell', 'sys', true, options);\n}\n"],"mappings":";;;;;;;;AAGA,IAAS,0BAAT,cAA2C,mBAAM;CACjD,UAAS,gBAAmB;AAC5B,SAAS,KAAA,IAAA,KAAA,oBAAgC;;IAEnC;;CAEJ,MAAE,cAAgB;AAChB,QAAE,IAAO,MAAO,+BAA6B;;;;;;ACuBjD,IACac,mBAAeC,SAD3BH,YAAY,EAAAI,UAAAC,SAAA,EAAAC,QAAA,WAAA,CAAA,EAAAH,OAAAI,WAAAH,QAAAG,YAAAC,mBAAb,MACaN,wBAA+CD,wBAAwB;CAAAQ,YAAA,GAAAC,MAAA;AAAA,QAAA,GAAAA,KAAA;AAAA,OAGlFC,aAAU,KAAA;AAAA,OACVC,UAAO,KAAA;AAAA,OACPC,QAAK,KAAA;AAAA,OACLC,YAAS,KAAA;AAAA,OACTC,UAAO,KAAA;AAAA,OACPC,eAAY,KAAA;;CAEZ,MAAgBC,WAAW;AACzB,OAAKC,KAAKC,SAAS,WAAW,KAAK;AAEnC,OAAKH,eAAe,KAAKI,kBAAkB;AAC3C,OAAKL,UAAU,KAAKG,KAAKG,eAAetB,SAAS,OAAOuB,KAAAA,GAAW,KAAKN,aAAa;AAErF,OAAKO,mBAAmB;AAExB,QAAM,KAAKC,aAAa;AAExB,OAAKC,aACG,KAAKC,OAAOC,QAClB,OAAOC,UAAUC,aAAa;AAC5B,OAAIlC,UAAUiC,UAAUC,SAAS,CAAE;AACnC,SAAM,KAAKL,aAAa;IAE3B;AAED,OAAKM,cAAc;;CAGrB,IAAIH,SAAS;AACX,SAAO,KAAKD,OAAOC;;CAGrB,IAAII,OAAO;AACT,SAAO,KAAKL,OAAOK;;CAGrB,MAAaP,cAAc;AACzB,OAAKV,YAAY,MAAM,K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SAAA,IAAAA;;;;AC5CD,eAAc,iBAAA,aAAgC,KAAA,EAAG;;GAEjD,yBAA2B,CAAA;;;ACP3B,IAAa,UAAS,SAAQ;UAE9B,qBAAuB,MACrB;;;;;;ACHF,IAAG,MAAO,OAAA;AAeV,IAAA,aAAA,EACE,SAAE,QACH;AAiBD,IAAQ,qBAAc,OAAA,OAAA,EAAA,QAAA,SAAA,EACtB,QAAO,WACN,CAAC,EAAE,KAAC,SAAa,MAAC,SAAA,MAAe,0BAAA,cAAA,GAAA,IAAA,OAAA,IAAA;;;;ACjClC,IAAS,8BAAT,cAAiD,uBAAA;CACjD,UAAS,gBAAmB;AAC5B,SAAS,KAAA,IAAA,KAAA,oBAAoC;;IAEvC;;CAEJ,MAAE,cAAgB;AAChB,QAAE,IAAO,MAAO,+BAA6B;;;;;;ACRjD,QAAO,oBAAO,aAA4B,OAAO,MAAG,QAAM"}
1
+ {"version":3,"file":"index.js","names":["celEnvBase","isNilOrEmptyString","createColumnHelper","getCoreRowModel","classes","appResource","beanFullNameFromOnionName","cast","deepEqual","deepExtend","objectAssignReactive","isJsxComponent","ZovaJsx","Controller","BeanControllerTableBase","ControllerTable","_dec","_dec2","__z_BeanInfo","module","_class","_ControllerTable","constructor","args","properties","columns","table","tableMeta","zovaJsx","columnCelEnv","__init__","bean","_setBean","_getColumnCelEnv","_newBeanSimple","undefined","_createProperties","refreshMeta","$watch","$props","schema","newValue","oldValue","_createTable","data","_createTableMeta","_createColumns","self","tableOptions","getRowId","row","id","renderFallbackValue","scope","config","manualPagination","$useTable","getColumns","_createColumnsMiddle","key","render","columnScope","getColumnScope","jsxRenderContext","getColumnJsxRenderContext","visible","columnProps","getColumnComponentPropsTop","_createColumnRender","columnHelper","property","push","accessor","header","_props","title","cell","props","renders","$computed","$sdk","loadSchemaProperties","promises","res","Promise","all","filter","_item","index","item","forEach","celScope","app","ctx","$scene","$host","$celScope","$jsx","$$table","getCellJsxRenderContext","cellContext","cellRenderPrepare","Array","isArray","renderProviders","map","getRenderProvider","renderProvider","includes","sys","_getBean","renderContext","beanInstance","beanOptions","getBean","onionOptions","options","checkVisible","_cellRender","cellRender","cellScope","_getBeanSyncOnly","cellProps","setTransientObject","getValue","name","_cellRenderInner","value","fallbackValue","cellProps2","renderJsxProps","class","style","$style","children","length","renderJsxChildrenDirect","getColumnProperty","find","celEnv","clone","registerFunction","transientObject","scopeExtra","tableScope","rest","_getColumnComponentPropsTopByRest","_renderContext","evaluateExpression","Object","assign","$propsDefault","FlexRender","BeanRenderBase","Render","RenderTable","_dec","_dec2","__z_BeanInfo","module","_class","_renderTableDefault","table","_createVNode","getFlatHeaders","map","header","id","column","columnDef","getContext","getRowModel","rows","row","getVisibleCells","cell","render","$slotDefault"],"sources":["../src/lib/beanControllerTableBase.ts","../src/component/table/controller.tsx","../src/component/table/render.tsx","../src/.metadata/component/table.ts","../src/config/config.ts","../src/.metadata/index.ts","../src/lib/beanControllerPageTableBase.ts","../src/lib/tableCell.ts"],"sourcesContent":["import type { RowData, Table } from '@tanstack/table-core';\nimport type { TableOptionsWithReactiveData } from '@tanstack/vue-table';\n\nimport { useVueTable } from '@tanstack/vue-table';\nimport { markRaw } from 'vue';\nimport { BeanControllerBase } from 'zova';\n\nexport class BeanControllerTableBase extends BeanControllerBase {\n public $useTable<TData extends RowData>(initialOptions: TableOptionsWithReactiveData<TData>): Table<TData> {\n return this.ctx.util.instanceScope(() => {\n return markRaw(useVueTable(initialOptions));\n });\n }\n\n public async refreshMeta() {\n throw new Error('should implement refreshMeta');\n }\n}\n","import type {\n IResourceTableActionRowOptionsBase,\n ISchemaObjectExtensionField,\n ISchemaObjectExtensionFieldRest,\n TypeTableCellRenderComponent,\n TypeTableCellRenderComponentProvider,\n} from 'zova-module-a-openapi';\n\nimport { celEnvBase, isNilOrEmptyString } from '@cabloy/utils';\nimport { CellContext, createColumnHelper, getCoreRowModel, TableOptionsWithReactiveData } from '@tanstack/vue-table';\nimport { SchemaObject } from 'openapi3-ts/oas31';\nimport { classes } from 'typestyle';\nimport { VNode } from 'vue';\nimport { appResource, beanFullNameFromOnionName, cast, deepEqual, deepExtend, objectAssignReactive } from 'zova';\nimport { isJsxComponent, ZovaJsx } from 'zova-jsx';\nimport { Controller } from 'zova-module-a-bean';\n\nimport type { ITableMeta, TypeColumn, TypeTable, TypeTableGetColumns } from '../../types/table.js';\nimport type { IDecoratorTableCellOptions, IJsxRenderContextTableCell, ITableCellRender } from '../../types/tableCell.js';\n\nimport { BeanControllerTableBase } from '../../lib/beanControllerTableBase.js';\nimport {\n ITableCellRenderColumnOptions,\n type IJsxRenderContextTableColumn,\n type ITableCellRenderColumnProps,\n type ITableCellScope,\n type ITableColumnScope,\n type ITableScope,\n type TypeTableCellRender,\n} from '../../types/tableColumn.js';\n\nexport interface ControllerTableProps<TData extends {} = {}> {\n data?: TData[];\n schema?: SchemaObject;\n tableScope?: ITableScope;\n getColumns?: TypeTableGetColumns<TData>;\n slotDefault?: (table: ControllerTable<TData>) => VNode;\n}\n\n@Controller()\nexport class ControllerTable<TData extends {} = {}> extends BeanControllerTableBase {\n static $propsDefault = {};\n\n properties: ISchemaObjectExtensionField[] | undefined;\n columns: TypeColumn<TData>[];\n table: TypeTable<TData>;\n tableMeta: ITableMeta<TData>;\n zovaJsx: ZovaJsx;\n columnCelEnv: typeof celEnvBase;\n\n protected async __init__() {\n this.bean._setBean('$$table', this);\n // jsx\n this.columnCelEnv = this._getColumnCelEnv();\n this.zovaJsx = this.bean._newBeanSimple(ZovaJsx, false, undefined, this.columnCelEnv);\n // properties\n this._createProperties();\n // tableMeta/columns\n await this.refreshMeta();\n // watch\n this.$watch(\n () => this.$props.schema,\n async (newValue, oldValue) => {\n if (deepEqual(newValue, oldValue)) return;\n await this.refreshMeta();\n },\n );\n // table\n this._createTable();\n }\n\n get schema() {\n return this.$props.schema;\n }\n\n get data() {\n return this.$props.data;\n }\n\n public async refreshMeta() {\n this.tableMeta = await this._createTableMeta();\n this.columns = await this._createColumns();\n }\n\n private _createTable() {\n // eslint-disable-next-line\n const self = this;\n const tableOptions: TableOptionsWithReactiveData<TData> = {\n getRowId: (row: TData) => cast(row).id,\n getCoreRowModel: getCoreRowModel(),\n renderFallbackValue: this.scope.config.renderFallbackValue,\n manualPagination: true,\n get data() {\n return self.data || [];\n },\n get columns() {\n return self.columns;\n },\n };\n this.table = this.$useTable(tableOptions);\n }\n\n private async _createColumns() {\n if (!this.properties) return [];\n if (!this.$props.getColumns) return await this._createColumnsMiddle(this.tableMeta.properties);\n return await this.$props.getColumns(\n async properties => {\n return await this._createColumnsMiddle(properties ?? this.tableMeta.properties);\n },\n async (key: string, render: TypeTableCellRenderComponent): Promise<TypeTableCellRender<TData, any> | undefined> => {\n // columnScope\n const columnScope = this.getColumnScope(key);\n // renderContext\n const jsxRenderContext = this.getColumnJsxRenderContext(columnScope);\n // columnProps\n const { visible, columnProps } = this.getColumnComponentPropsTop(key, columnScope, jsxRenderContext);\n // visible\n if (visible === false) return;\n return await this._createColumnRender(render, columnProps, columnScope, jsxRenderContext);\n },\n this,\n );\n }\n\n private async _createColumnsMiddle(properties: ISchemaObjectExtensionField[]): Promise<TypeColumn<TData>[]> {\n const tableMeta = this.tableMeta;\n const columnHelper = createColumnHelper<TData>();\n const columns: TypeColumn<TData>[] = [];\n for (const property of properties) {\n const key = property.key!;\n columns.push(\n columnHelper.accessor(key as any, {\n id: key,\n header: _props => {\n return property?.title || key;\n },\n cell: props => tableMeta.renders[key](props),\n }),\n );\n }\n return columns;\n }\n\n private _createProperties() {\n this.properties = this.$computed(() => {\n return this.$sdk.loadSchemaProperties(this.schema, 'table');\n });\n }\n\n private async _createTableMeta() {\n let properties: ISchemaObjectExtensionField[] = [];\n const renders: Record<string, TypeTableCellRender<TData>> = {};\n if (!this.properties) return { properties, renders };\n const promises: Promise<any>[] = [];\n for (const property of this.properties) {\n const key = property.key!;\n // columnScope\n const columnScope = this.getColumnScope(key);\n // renderContext\n const jsxRenderContext = this.getColumnJsxRenderContext(columnScope);\n // columnProps\n const { visible, render, columnProps } = this.getColumnComponentPropsTop(key, columnScope, jsxRenderContext);\n // visible\n if (visible === false) continue;\n // property\n properties.push(property);\n // render\n promises.push(this._createColumnRender(render, columnProps, columnScope, jsxRenderContext));\n }\n let res = await Promise.all(promises);\n properties = properties.filter((_item, index) => !!res[index]);\n res = res.filter(item => !!item);\n properties.forEach((item, index) => {\n renders[item.key!] = res[index];\n });\n return { properties, renders };\n }\n\n public getColumnJsxRenderContext(celScope: ITableColumnScope): IJsxRenderContextTableColumn {\n return {\n app: this.app,\n ctx: this.ctx,\n $scene: 'tableColumn',\n $host: this,\n $celScope: celScope,\n $jsx: this.zovaJsx,\n $$table: this,\n };\n }\n\n public getCellJsxRenderContext(celScope: ITableCellScope, cellContext: CellContext<TData, any>): IJsxRenderContextTableCell {\n return {\n app: this.app,\n ctx: this.ctx,\n $scene: 'tableCell',\n $host: this,\n $celScope: celScope,\n $jsx: this.zovaJsx,\n $$table: this,\n cellContext,\n };\n }\n\n public async cellRenderPrepare(renders: TypeTableCellRenderComponent | TypeTableCellRenderComponent[]) {\n if (!Array.isArray(renders)) renders = [renders];\n const renderProviders = renders.map(item => this.getRenderProvider(item));\n const promises: Promise<any>[] = renderProviders.map(renderProvider =>\n (async () => {\n if (typeof renderProvider === 'string' && renderProvider.includes('.tableCell.')) {\n return await this.sys.bean._getBean(renderProvider as any, true);\n }\n })(),\n );\n return await Promise.all(promises);\n }\n\n private async _createColumnRender(\n render: TypeTableCellRenderComponent | undefined,\n columnProps: ITableCellRenderColumnProps | undefined,\n columnScope: ITableColumnScope,\n renderContext: IJsxRenderContextTableColumn,\n ): Promise<TypeTableCellRender<TData, any> | undefined> {\n // renderProvider\n const renderProvider = this.getRenderProvider(render);\n // beanInstance\n let beanInstance: ITableCellRender | undefined;\n if (typeof renderProvider === 'string' && renderProvider.includes('.tableCell.')) {\n beanInstance = await this.sys.bean._getBean(renderProvider as any, true);\n const beanOptions = appResource.getBean(renderProvider as any);\n const onionOptions = beanOptions?.options as IDecoratorTableCellOptions | undefined;\n columnProps = deepExtend({}, onionOptions, columnProps);\n // should not eval jsx columnProps\n // columnProps = this.zovaJsx.renderJsxProps(columnProps as any, {}, columnScope, renderContext) as any;\n if (beanInstance?.checkVisible && !(await beanInstance.checkVisible(columnProps as any, renderContext))) return;\n }\n return cellContext => {\n if (!cellContext) return;\n return this._cellRender(render, columnProps, columnScope, cellContext, renderProvider, beanInstance, undefined, undefined, undefined);\n };\n }\n\n public cellRender(\n render: TypeTableCellRenderComponent,\n columnProps: IResourceTableActionRowOptionsBase,\n renderContext: IJsxRenderContextTableCell,\n ) {\n // render\n const cellScope = renderContext.$celScope;\n // renderProvider\n const renderProvider = this.getRenderProvider(render);\n // beanInstance\n let beanInstance: ITableCellRender | undefined;\n if (typeof renderProvider === 'string' && renderProvider.includes('.tableCell.')) {\n beanInstance = this.sys.bean._getBeanSyncOnly(renderProvider as any);\n const beanOptions = appResource.getBean(renderProvider as any);\n const onionOptions = beanOptions?.options as IDecoratorTableCellOptions | undefined;\n columnProps = deepExtend({}, onionOptions, columnProps);\n // should not eval jsx columnProps\n // columnProps = this.zovaJsx.renderJsxProps(columnProps as any, {}, renderContext.$celScope, renderContext) as any;\n }\n // const cellProps = isJsxComponent(render) ? Object.assign({}, columnProps, cast(render).props) : columnProps;\n const cellProps = columnProps;\n return this._cellRender(\n render,\n columnProps as ITableCellRenderColumnProps,\n undefined,\n renderContext.cellContext,\n renderProvider,\n beanInstance,\n cellProps,\n cellScope,\n renderContext,\n );\n }\n\n private _cellRender(\n render: TypeTableCellRenderComponent | undefined,\n columnProps: ITableCellRenderColumnProps | undefined,\n columnScope: ITableColumnScope | undefined,\n cellContext: CellContext<TData, any>,\n renderProvider: TypeTableCellRenderComponentProvider,\n beanInstance: ITableCellRender | undefined,\n cellProps: any | undefined,\n cellScope: ITableCellScope | undefined,\n jsxRenderContext: IJsxRenderContextTableCell | undefined,\n ) {\n return this.zovaJsx.setTransientObject(\n {\n getValue: (name: string) => {\n return cellContext.row.getValue(name);\n },\n },\n () => {\n return this._cellRenderInner(\n render,\n columnProps,\n columnScope,\n cellContext,\n renderProvider,\n beanInstance,\n cellProps,\n cellScope,\n jsxRenderContext,\n );\n },\n );\n }\n\n private _cellRenderInner(\n render: TypeTableCellRenderComponent | undefined,\n columnProps: ITableCellRenderColumnProps | undefined,\n columnScope: ITableColumnScope | undefined,\n cellContext: CellContext<TData, any>,\n renderProvider: TypeTableCellRenderComponentProvider,\n beanInstance: ITableCellRender | undefined,\n cellProps: any | undefined,\n cellScope: ITableCellScope | undefined,\n jsxRenderContext: IJsxRenderContextTableCell | undefined,\n ) {\n // value\n const value = cellContext.getValue();\n // renderFallbackValue\n const fallbackValue = this.table.options.renderFallbackValue;\n // cellScope\n if (!cellScope) {\n cellScope = objectAssignReactive({}, columnScope, { value, fallbackValue })!;\n }\n // render: text\n if (renderProvider === ('text' as TypeTableCellRenderComponent)) {\n return isNilOrEmptyString(value) ? fallbackValue : value;\n }\n // renderContext\n if (!jsxRenderContext) {\n jsxRenderContext = this.getCellJsxRenderContext(cellScope, cellContext);\n }\n // beanInstance\n if (beanInstance) {\n // jsx: props\n if (!cellProps) {\n // cellProps = isJsxComponent(render) ? Object.assign({}, columnProps, cast(render).props) : columnProps;\n cellProps = columnProps;\n }\n const cellProps2 = this.zovaJsx.renderJsxProps(cellProps, {}, cellScope, jsxRenderContext) as any;\n if (cellProps2.class || cellProps2.style) {\n cellProps2.class = classes(cellProps2.class, jsxRenderContext.$host.$style(cellProps2.style));\n delete cellProps2.style;\n }\n return beanInstance.render(cellProps2, jsxRenderContext, () => {\n const children = isJsxComponent(render) && cast(render).children;\n if (children && children.length > 0) {\n return this.zovaJsx.renderJsxChildrenDirect(children, cellScope, jsxRenderContext);\n } else {\n return value;\n }\n });\n }\n // general component\n return this.zovaJsx.render(render!, {}, cellScope, jsxRenderContext);\n }\n\n public getColumnProperty(name: string): ISchemaObjectExtensionField | undefined {\n if (!this.properties) return;\n return this.properties.find(item => item.key === name);\n }\n\n private _getColumnCelEnv(): typeof celEnvBase {\n const celEnv = celEnvBase.clone();\n celEnv.registerFunction('getProperty(string):dyn', name => {\n return this.getColumnProperty(name);\n });\n celEnv.registerFunction('getValue(string):dyn', name => {\n return this.zovaJsx.transientObject.getValue(name);\n });\n return celEnv;\n }\n\n public getColumnScope(name: string, scopeExtra?: {}): ITableColumnScope {\n return objectAssignReactive({}, this.$props.tableScope, {\n name,\n property: this.getColumnProperty(name),\n ...scopeExtra,\n });\n }\n\n public getColumnComponentPropsTop(name: string, celScope: {}, renderContext: {}): ITableCellRenderColumnOptions {\n const property = this.getColumnProperty(name);\n const rest = property?.rest;\n return this._getColumnComponentPropsTopByRest(rest, name, celScope, renderContext);\n }\n\n private _getColumnComponentPropsTopByRest(\n rest: ISchemaObjectExtensionFieldRest | undefined,\n name: string,\n celScope: {},\n _renderContext: {},\n ): ITableCellRenderColumnOptions {\n const visible = this.zovaJsx.evaluateExpression(rest?.visible, celScope);\n const render = rest?.render as TypeTableCellRenderComponent | undefined;\n const columnProps = Object.assign({ key: name }, cast(rest)?.columnProps);\n return { visible, render, columnProps };\n }\n\n // public getRenderFlattern(render: TypeTableCellRenderComponent): TypeTableCellRenderComponent {\n // return isJsxComponent(render) ? cast(render).type : render;\n // }\n\n public getRenderProvider(render: TypeTableCellRenderComponent | undefined): TypeTableCellRenderComponentProvider {\n if (!render) return 'text';\n if (typeof render === 'string' && render.includes(':')) {\n return beanFullNameFromOnionName(render, 'tableCell');\n }\n return render;\n }\n}\n","import { FlexRender } from '@tanstack/vue-table';\nimport { BeanRenderBase } from 'zova';\nimport { Render } from 'zova-module-a-bean';\n\n@Render()\nexport class RenderTable extends BeanRenderBase {\n private _renderTableDefault() {\n const table = this.table;\n return (\n <table class=\"table\">\n <thead>\n <tr>\n {table.getFlatHeaders().map(header => {\n return (\n <th key={header.id}>\n <FlexRender\n render={header.column.columnDef.header}\n props={header.getContext()}\n ></FlexRender>\n </th>\n );\n })}\n </tr>\n </thead>\n <tbody>\n {table.getRowModel().rows.map(row => {\n return (\n <tr key={row.id}>\n {row.getVisibleCells().map(cell => {\n return (\n <td key={cell.id}>\n <FlexRender\n render={cell.column.columnDef.cell}\n props={cell.getContext()}\n ></FlexRender>\n </td>\n );\n })}\n </tr>\n );\n })}\n </tbody>\n </table>\n );\n }\n\n public render() {\n return this.$slotDefault ? this.$slotDefault(this) : this._renderTableDefault();\n }\n}\n","import type { TypeControllerInnerProps } from 'zova';\n\nimport { defineComponent } from 'vue';\nimport { prepareComponentOptions, useController } from 'zova';\n\nimport type { ControllerTableProps } from '../../component/table/controller.jsx';\n\nimport { ControllerTable } from '../../component/table/controller.jsx';\nimport { RenderTable } from '../../component/table/render.jsx';\nexport type TypeControllerTablePublicProps<TData extends {} = {}> = {\n controllerRef?: (ref: ControllerTable<TData>) => void;\n} & ControllerTableProps<TData>;\n\ntype ControllerInnerProps<TData extends {} = {}> = TypeControllerInnerProps<\n ControllerTableProps<TData>,\n keyof typeof ControllerTable.$propsDefault\n>;\ndeclare module 'zova-module-a-table' {\n export interface ControllerTable<TData extends {} = {}> {\n $props: ControllerInnerProps<TData>;\n }\n}\ndeclare module 'zova-module-a-table' {\n export interface RenderTable<TData extends {} = {}> extends ControllerTable<TData> {}\n}\nexport const ZTable = defineComponent(\n <TData extends {} = {}>(_props: TypeControllerTablePublicProps<TData>) => {\n useController(ControllerTable, RenderTable, undefined);\n return () => {};\n },\n prepareComponentOptions(),\n);\ndeclare module 'zova-module-a-bean' {\n export interface IVonaComponentRecord {\n 'a-table:table': ControllerTableProps;\n }\n}\n","import type { ZovaSys } from 'zova';\n\nexport const config = (_sys: ZovaSys) => {\n return {\n renderFallbackValue: '--',\n };\n};\n","// eslint-disable\n/** controller: begin */\nexport * from '../component/table/controller.jsx';\n\nimport 'zova';\ndeclare module 'zova' {\n \n \n}\ndeclare module 'zova-module-a-table' {\n \n export interface ControllerTable {\n /** @internal */\n get scope(): ScopeModuleATable;\n } \n}\n/** controller: end */\n/** controller: begin */\nimport { ControllerTable } from '../component/table/controller.jsx';\nimport 'zova';\ndeclare module 'zova' {\n export interface IBeanRecordLocal {\n 'a-table.controller.table': ControllerTable;\n }\n}\n/** controller: end */\n\n/** components: begin */\nexport * from './component/table.js';\nimport { ZTable } from './component/table.js';\nexport const components = {\n 'table': ZTable,\n};\nimport 'zova';\ndeclare module 'zova' {\nexport interface IComponentRecord {\n 'a-table:table': ControllerTable;\n}\nexport interface IZovaComponentRecord {\n 'a-table:table': typeof ZTable;\n}\n}\n/** components: end */\n/** render: begin */\nexport * from '../component/table/render.jsx';\n\nimport 'zova';\ndeclare module 'zova' {\n \n \n}\ndeclare module 'zova-module-a-table' {\n \n export interface RenderTable {\n /** @internal */\n get scope(): ScopeModuleATable;\n } \n}\n/** render: end */\n/** render: begin */\nimport { RenderTable } from '../component/table/render.jsx';\nimport 'zova';\ndeclare module 'zova' {\n export interface IBeanRecordLocal {\n 'a-table.render.table': RenderTable;\n }\n}\n/** render: end */\n/** config: begin */\nexport * from '../config/config.js';\nimport { config } from '../config/config.js';\n/** config: end */\n/** scope: begin */\nimport { BeanScopeBase, type BeanScopeUtil, TypeModuleConfig } from 'zova';\nimport { Scope } from 'zova-module-a-bean';\n\n@Scope()\nexport class ScopeModuleATable extends BeanScopeBase {}\n\nexport interface ScopeModuleATable {\n util: BeanScopeUtil;\nconfig: TypeModuleConfig<typeof config>;\n}\n\nimport 'zova';\ndeclare module 'zova' {\n export interface IBeanScopeRecord {\n 'a-table': ScopeModuleATable;\n }\n \n export interface IBeanScopeConfig {\n 'a-table': ReturnType<typeof config>;\n }\n\n \n\n \n}\n \n/** scope: end */\n","import type { RowData, Table } from '@tanstack/table-core';\nimport type { TableOptionsWithReactiveData } from '@tanstack/vue-table';\n\nimport { useVueTable } from '@tanstack/vue-table';\nimport { markRaw } from 'vue';\nimport { BeanControllerPageBase } from 'zova';\n\nexport class BeanControllerPageTableBase extends BeanControllerPageBase {\n public $useTable<TData extends RowData>(initialOptions: TableOptionsWithReactiveData<TData>): Table<TData> {\n return this.ctx.util.instanceScope(() => {\n return markRaw(useVueTable(initialOptions));\n });\n }\n\n public async refreshMeta() {\n throw new Error('should implement refreshMeta');\n }\n}\n","import { createBeanDecorator } from 'zova';\n\nimport type { IDecoratorTableCellOptions } from '../types/tableCell.js';\n\nexport function TableCell<T extends IDecoratorTableCellOptions>(options?: T): ClassDecorator {\n return createBeanDecorator('tableCell', 'sys', true, options);\n}\n"],"mappings":";;;;;;;;AAGA,IAAS,0BAAT,cAA2C,mBAAM;CACjD,UAAS,gBAAmB;AAC5B,SAAS,KAAA,IAAA,KAAA,oBAAgC;;IAEnC;;CAEJ,MAAE,cAAgB;AAChB,QAAE,IAAO,MAAO,+BAA6B;;;;;;AC6BjD,IACae,mBAAeC,SAD3BH,YAAY,EAAAI,UAAAC,SAAA,EAAAC,QAAA,WAAA,CAAA,EAAAH,OAAAI,WAAAH,QAAAG,YAAAC,mBAAb,MACaN,wBAA+CD,wBAAwB;CAAAQ,YAAA,GAAAC,MAAA;AAAA,QAAA,GAAAA,KAAA;AAAA,OAGlFC,aAAU,KAAA;AAAA,OACVC,UAAO,KAAA;AAAA,OACPC,QAAK,KAAA;AAAA,OACLC,YAAS,KAAA;AAAA,OACTC,UAAO,KAAA;AAAA,OACPC,eAAY,KAAA;;CAEZ,MAAgBC,WAAW;AACzB,OAAKC,KAAKC,SAAS,WAAW,KAAK;AAEnC,OAAKH,eAAe,KAAKI,kBAAkB;AAC3C,OAAKL,UAAU,KAAKG,KAAKG,eAAetB,SAAS,OAAOuB,KAAAA,GAAW,KAAKN,aAAa;AAErF,OAAKO,mBAAmB;AAExB,QAAM,KAAKC,aAAa;AAExB,OAAKC,aACG,KAAKC,OAAOC,QAClB,OAAOC,UAAUC,aAAa;AAC5B,OAAIlC,UAAUiC,UAAUC,SAAS,CAAE;AACnC,SAAM,KAAKL,aAAa;IAE3B;AAED,OAAKM,cAAc;;CAGrB,IAAIH,SAAS;AACX,SAAO,KAAKD,OAAOC;;C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AAUM;KAAI,SAC3BA,KAAKL,YAAW;KAAC,EAAA,KAAA,CAAA,CAAA;KAI9B,CAAA,CAAA;IAGN,CAAA,CAAA,CAAA,CAAA;;CAMHM,SAAS;AACd,SAAO,KAAKC,eAAe,KAAKA,aAAa,KAAK,GAAG,KAAKhB,qBAAqB;;EAElF,IAAAD,SAAA,IAAAA;;;;AC5CD,eAAc,iBAAA,aAAgC,KAAA,EAAG;;GAEjD,yBAA2B,CAAA;;;ACP3B,IAAa,UAAS,SAAQ;UAE9B,qBAAuB,MACrB;;;;;;ACHF,IAAG,MAAO,OAAA;AAeV,IAAA,aAAA,EACE,SAAE,QACH;AAiBD,IAAQ,qBAAc,OAAA,OAAA,EAAA,QAAA,SAAA,EACtB,QAAO,WACN,CAAC,EAAE,KAAC,SAAa,MAAC,SAAA,MAAe,0BAAA,cAAA,GAAA,IAAA,OAAA,IAAA;;;;ACjClC,IAAS,8BAAT,cAAiD,uBAAA;CACjD,UAAS,gBAAmB;AAC5B,SAAS,KAAA,IAAA,KAAA,oBAAoC;;IAEvC;;CAEJ,MAAE,cAAgB;AAChB,QAAE,IAAO,MAAO,+BAA6B;;;;;;ACRjD,QAAO,oBAAO,aAA4B,OAAO,MAAG,QAAM"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "zova-module-a-table",
3
- "version": "5.1.16",
4
- "gitHead": "f5fbd410ec433943070bb60839f1e762f98593c6",
3
+ "version": "5.1.18",
4
+ "gitHead": "343c61ad189fe3f0fc997ee9f4c710567657e05c",
5
5
  "description": "",
6
6
  "keywords": [
7
7
  "Zova Module"
@@ -11,7 +11,6 @@
11
11
  "cli",
12
12
  "dist",
13
13
  "mock",
14
- "rest",
15
14
  "src",
16
15
  "icons",
17
16
  "assets"
@@ -58,7 +57,7 @@
58
57
  "optionsGlobalInterfaceName": "IDecoratorTableCellOptions",
59
58
  "optionsGlobalInterfaceFrom": "zova-module-a-table",
60
59
  "boilerplate": "tableCell/boilerplate",
61
- "boilerplateActionRow": "tableCellActionRow/boilerplate"
60
+ "boilerplateTableActionRow": "tableActionRow/boilerplate"
62
61
  }
63
62
  }
64
63
  }
@@ -1,11 +1,17 @@
1
- import type { IResourceTableActionRowOptionsBase, ISchemaObjectExtensionFieldRest, TypeTableCellRenderComponent } from 'zova-module-a-openapi';
1
+ import type {
2
+ IResourceTableActionRowOptionsBase,
3
+ ISchemaObjectExtensionField,
4
+ ISchemaObjectExtensionFieldRest,
5
+ TypeTableCellRenderComponent,
6
+ TypeTableCellRenderComponentProvider,
7
+ } from 'zova-module-a-openapi';
2
8
 
3
9
  import { celEnvBase, isNilOrEmptyString } from '@cabloy/utils';
4
10
  import { CellContext, createColumnHelper, getCoreRowModel, TableOptionsWithReactiveData } from '@tanstack/vue-table';
5
11
  import { SchemaObject } from 'openapi3-ts/oas31';
6
12
  import { classes } from 'typestyle';
7
13
  import { VNode } from 'vue';
8
- import { appResource, cast, deepEqual, deepExtend, objectAssignReactive } from 'zova';
14
+ import { appResource, beanFullNameFromOnionName, cast, deepEqual, deepExtend, objectAssignReactive } from 'zova';
9
15
  import { isJsxComponent, ZovaJsx } from 'zova-jsx';
10
16
  import { Controller } from 'zova-module-a-bean';
11
17
 
@@ -35,7 +41,7 @@ export interface ControllerTableProps<TData extends {} = {}> {
35
41
  export class ControllerTable<TData extends {} = {}> extends BeanControllerTableBase {
36
42
  static $propsDefault = {};
37
43
 
38
- properties: SchemaObject[] | undefined;
44
+ properties: ISchemaObjectExtensionField[] | undefined;
39
45
  columns: TypeColumn<TData>[];
40
46
  table: TypeTable<TData>;
41
47
  tableMeta: ITableMeta<TData>;
@@ -116,7 +122,7 @@ export class ControllerTable<TData extends {} = {}> extends BeanControllerTableB
116
122
  );
117
123
  }
118
124
 
119
- private async _createColumnsMiddle(properties: SchemaObject[]): Promise<TypeColumn<TData>[]> {
125
+ private async _createColumnsMiddle(properties: ISchemaObjectExtensionField[]): Promise<TypeColumn<TData>[]> {
120
126
  const tableMeta = this.tableMeta;
121
127
  const columnHelper = createColumnHelper<TData>();
122
128
  const columns: TypeColumn<TData>[] = [];
@@ -142,7 +148,7 @@ export class ControllerTable<TData extends {} = {}> extends BeanControllerTableB
142
148
  }
143
149
 
144
150
  private async _createTableMeta() {
145
- let properties: SchemaObject[] = [];
151
+ let properties: ISchemaObjectExtensionField[] = [];
146
152
  const renders: Record<string, TypeTableCellRender<TData>> = {};
147
153
  if (!this.properties) return { properties, renders };
148
154
  const promises: Promise<any>[] = [];
@@ -272,7 +278,7 @@ export class ControllerTable<TData extends {} = {}> extends BeanControllerTableB
272
278
  columnProps: ITableCellRenderColumnProps | undefined,
273
279
  columnScope: ITableColumnScope | undefined,
274
280
  cellContext: CellContext<TData, any>,
275
- renderProvider: TypeTableCellRenderComponent,
281
+ renderProvider: TypeTableCellRenderComponentProvider,
276
282
  beanInstance: ITableCellRender | undefined,
277
283
  cellProps: any | undefined,
278
284
  cellScope: ITableCellScope | undefined,
@@ -305,7 +311,7 @@ export class ControllerTable<TData extends {} = {}> extends BeanControllerTableB
305
311
  columnProps: ITableCellRenderColumnProps | undefined,
306
312
  columnScope: ITableColumnScope | undefined,
307
313
  cellContext: CellContext<TData, any>,
308
- renderProvider: TypeTableCellRenderComponent,
314
+ renderProvider: TypeTableCellRenderComponentProvider,
309
315
  beanInstance: ITableCellRender | undefined,
310
316
  cellProps: any | undefined,
311
317
  cellScope: ITableCellScope | undefined,
@@ -352,7 +358,7 @@ export class ControllerTable<TData extends {} = {}> extends BeanControllerTableB
352
358
  return this.zovaJsx.render(render!, {}, cellScope, jsxRenderContext);
353
359
  }
354
360
 
355
- public getColumnProperty(name: string): SchemaObject | undefined {
361
+ public getColumnProperty(name: string): ISchemaObjectExtensionField | undefined {
356
362
  if (!this.properties) return;
357
363
  return this.properties.find(item => item.key === name);
358
364
  }
@@ -398,7 +404,11 @@ export class ControllerTable<TData extends {} = {}> extends BeanControllerTableB
398
404
  // return isJsxComponent(render) ? cast(render).type : render;
399
405
  // }
400
406
 
401
- public getRenderProvider(render: TypeTableCellRenderComponent | undefined): TypeTableCellRenderComponent {
402
- return render || ('text' as TypeTableCellRenderComponent);
407
+ public getRenderProvider(render: TypeTableCellRenderComponent | undefined): TypeTableCellRenderComponentProvider {
408
+ if (!render) return 'text';
409
+ if (typeof render === 'string' && render.includes(':')) {
410
+ return beanFullNameFromOnionName(render, 'tableCell');
411
+ }
412
+ return render;
403
413
  }
404
414
  }
@@ -1 +0,0 @@
1
- export * from 'zova-module-a-table';
package/rest/index.ts DELETED
@@ -1 +0,0 @@
1
- export * from './components.js';