export const ctrlState = () => {
  return {
    controlCodeName: '{{ctrl.codeName}}',
    controlName: '{{ctrl.name}}',
    counter: 0,
    enableSearch: {{ctrl.enableSearch}},
    xDataControlName: '{{ctrl.xDataControlName}}',
    selection: {},
    searchValue: '',
    showTitleBar: {{#if ctrl.showTitleBar}}true{{else}}false{{/if}},
    split: 0.2,
    title: '{{ctrl.title}}',
    titleRes: '{{#if ctrl.titlePSLanguageRes}}{{ctrl.titlePSLanguageRes.lanResTag}}{{/if}}',
    {{#each ctrl.psControls as | childCtrl |}}
      {{#eq childCtrl.controlType 'TOOLBAR'}}
    toolbar: [
        {{#childCtrl.psDEToolbarItems}}
      { name:'{{name}}',caption:'{{caption}}',groupExtractMode:'{{groupExtractMode}}',itemType:'{{itemType}}',noPrivDisplayMode:'{{noPrivDisplayMode}}',showIcon:{{showIcon}},showCaption:{{showCaption}},tooltip:'{{tooltip}}',disabled: false, visible: true, imgPath: '{{imgPath}}',iconClass: '{{iconClass}}',xDataControlName:'{{xDataControlName}}',{{#if psUIAction}}uIAction:{codeName:'{{psUIAction.codeName}}',fullCodeName:'{{psUIAction.fullCodeName}}',uIActionMode:'{{psUIAction.uIActionMode}}',actionTarget:'{{psUIAction.actionTarget}}',uIActionTag:'{{psUIAction.uIActionTag}}',dataAccessAction:'{{psUIAction.dataAccessAction}}',uIActionType:'{{psUIAction.uIActionType}}'}{{#if psUIAction.counterId}},counterId: '{{psUIAction.counterId}}'{{/if}}{{/if}} },
        {{/childCtrl.psDEToolbarItems}}
    ],
      {{/eq}}
      {{#eq childCtrl.controlType 'GRID'}}
    {{childCtrl.name}}: {
      action:{
        loadAction: '{{childCtrl.getPSControlAction.psAppDEMethod.codeName}}',
        removeAction: '{{childCtrl.removePSControlAction.psAppDEMethod.codeName}}',
        updateAction: '{{childCtrl.updatePSControlAction.psAppDEMethod.codeName}}',
        loadDraftAction: '{{childCtrl.getDraftPSControlAction.psAppDEMethod.codeName}}',
        createAction: '{{childCtrl.createPSControlAction.psAppDEMethod.codeName}}',
        fetchAction:'{{childCtrl.fetchPSControlAction.psAppDEMethod.codeName}}'
      }  
    },
        {{#and childCtrl.navPSDER childCtrl.navPSDER.minorCodeName}}
    navPSDer: 'n_{{lowerCase childCtrl.navPSDER.minorCodeName}}_eq',
        {{/and}}
        {{#if childCtrl.navFilter}}
    navFilter: '{{lowerCase childCtrl.navFilter}}',
        {{/if}}
        {{#if childCtrl.navPSAppView}}
    navViewName: '{{childCtrl.navPSAppView.name}}',
        {{/if}}
        {{#if childCtrl.psNavigateContexts}}
    navigateContexts: {{> @macro/front-end/common/navparam.hbs appNavParams=childCtrl.psNavigateContexts}},
        {{/if}}
        {{#if childCtrl.psNavigateParams}}
    navigateParams: {{> @macro/front-end/common/navparam.hbs appNavParams=childCtrl.psNavigateParams}},
        {{/if}}
      {{/eq}}
    {{/each}}
  }
};
