@@ -14,7 +14,12 @@ import { UICompBuilder, withPropertyViewFn, withViewFn } from "comps/generators"
1414import { childrenToProps } from "comps/generators/multi" ;
1515import { HidableView } from "comps/generators/uiCompBuilder" ;
1616import { withDispatchHook } from "comps/generators/withDispatchHook" ;
17- import { DepsConfig , NameConfig , withExposingConfigs } from "comps/generators/withExposing" ;
17+ import {
18+ depsConfig ,
19+ DepsConfig ,
20+ NameConfig ,
21+ withExposingConfigs ,
22+ } from "comps/generators/withExposing" ;
1823import { withMethodExposing } from "comps/generators/withMethodExposing" ;
1924import { trans } from "i18n" ;
2025import _ from "lodash" ;
@@ -454,29 +459,27 @@ export const TableComp = withExposingConfigs(TableTmpComp, [
454459 } ,
455460 trans ( "table.selectedRowsDesc" )
456461 ) ,
457- new DepsConfig (
458- "changeSet" ,
459- ( children ) => {
460- return { columns : children . columns . exposingNode ( ) } ;
461- } ,
462- ( input ) => {
462+ depsConfig ( {
463+ name : "changeSet" ,
464+ desc : trans ( "table.changeSetDesc" ) ,
465+ depKeys : [ "columns" ] ,
466+ func : ( input ) => {
463467 const record : Record < string , Record < string , JSONValue > > = { } ;
464468 Object . values ( input . columns ) . forEach ( ( column : any ) => {
465469 const dataIndex : string = column . dataIndex ;
466470 // const title: string = column.title;
467471 const render = column . render ; // {comp, map: [0].comp.changeValue, length}
468472 _ . forEach ( render . map , ( value , key ) => {
469473 const changeValue = value . comp ?. changeValue ;
470- if ( changeValue ) {
474+ if ( ! _ . isNil ( changeValue ) ) {
471475 if ( ! record [ key ] ) record [ key ] = { } ;
472476 record [ key ] [ dataIndex ] = changeValue ;
473477 }
474478 } ) ;
475479 } ) ;
476480 return record ;
477481 } ,
478- trans ( "table.changeSetDesc" )
479- ) ,
482+ } ) ,
480483 new DepsConfig (
481484 "pageNo" ,
482485 ( children ) => {
@@ -517,7 +520,7 @@ export const TableComp = withExposingConfigs(TableTmpComp, [
517520 } ,
518521 ( input ) => {
519522 const sortIndex = input . sort [ 0 ] ?. column ;
520- const column = Object . values ( input . columns ) . find (
523+ const column = Object . values ( input . columns as any ) . find (
521524 ( c : any ) => c . dataIndex === sortIndex
522525 ) as any ;
523526 if ( column ?. isCustom && column ?. title . value ) {
@@ -528,18 +531,14 @@ export const TableComp = withExposingConfigs(TableTmpComp, [
528531 } ,
529532 trans ( "table.sortColumnDesc" )
530533 ) ,
531- new DepsConfig (
532- "sortDesc" ,
533- ( children ) => {
534- return {
535- sort : children . sort . node ( ) ,
536- } ;
537- } ,
538- ( input ) => {
534+ depsConfig ( {
535+ name : "sortDesc" ,
536+ desc : trans ( "table.sortDesc" ) ,
537+ depKeys : [ "sort" ] ,
538+ func : ( input ) => {
539539 return input . sort [ 0 ] ?. desc || false ;
540540 } ,
541- trans ( "table.sortDesc" )
542- ) ,
541+ } ) ,
543542 new DepsConfig (
544543 "pageOffset" ,
545544 ( children ) => {
@@ -579,7 +578,7 @@ export const TableComp = withExposingConfigs(TableTmpComp, [
579578 return getDisplayData (
580579 input . data ,
581580 input . pagination ,
582- input . columns ,
581+ input . columns as any ,
583582 input . toolbar . filter ,
584583 input . sort ,
585584 input . toolbar . searchText . value ,
@@ -593,11 +592,11 @@ export const TableComp = withExposingConfigs(TableTmpComp, [
593592 "filter" ,
594593 ( children ) => {
595594 return {
596- toolbar : children . toolbar . node ( ) ,
595+ filter : children . toolbar . children . filter . node ( ) ,
597596 } ;
598597 } ,
599598 ( input ) => {
600- return input . toolbar . filter ;
599+ return input . filter ;
601600 } ,
602601 trans ( "table.filterDesc" )
603602 ) ,
0 commit comments