@steedos-widgets/amis-object 1.2.10 → 1.2.11

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.
@@ -561,6 +561,9 @@ body {
561
561
  .max-w-md {
562
562
  max-width: 28rem
563
563
  }
564
+ .flex-initial {
565
+ flex: 0 1 auto
566
+ }
564
567
  .flex-auto {
565
568
  flex: 1 1 auto
566
569
  }
@@ -1235,6 +1238,16 @@ body {
1235
1238
  column-gap: 1rem;
1236
1239
  }
1237
1240
 
1241
+ @media (max-width: 768px) {
1242
+ .record-detail-header-name {
1243
+ display: -webkit-box;
1244
+ overflow: hidden;
1245
+ text-overflow: ellipsis;
1246
+ -webkit-line-clamp: 2;
1247
+ -webkit-box-orient: vertical;
1248
+ }
1249
+ }
1250
+
1238
1251
  .steedos-context-bar .antd-Nav-list {
1239
1252
  border-bottom: 0px;
1240
1253
  height: 40px;
@@ -762,7 +762,7 @@ function getContrastColor(bgColor) {
762
762
  * @Author: baozhoutao@steedos.com
763
763
  * @Date: 2022-05-23 09:53:08
764
764
  * @LastEditors: Please set LastEditors
765
- * @LastEditTime: 2023-05-18 16:34:39
765
+ * @LastEditTime: 2023-05-22 15:13:18
766
766
  * @Description:
767
767
  */
768
768
 
@@ -819,8 +819,9 @@ function getSelectMap(selectOptions){
819
819
  let map = {};
820
820
  forEach(selectOptions,(option)=>{
821
821
  const optionValue = option.value + '';
822
- if(option.color){
823
- const background = option.color.charAt(0) === '#' ? option.color : '#'+option.color;
822
+ const optionColor = option.color + '';
823
+ if(optionColor){
824
+ const background = optionColor.charAt(0) === '#' ? optionColor : '#'+optionColor;
824
825
  const color = getContrastColor(background);
825
826
  const optionColorStyle = 'background:'+background+';color:'+color;
826
827
  map[optionValue] = `<span class="rounded-xl px-2 py-1" style='${optionColorStyle}'>${option.label}</span>`;
@@ -2226,9 +2227,10 @@ const getSchema$1 = (uiSchema) => {
2226
2227
  {
2227
2228
  name: "template_url",
2228
2229
  label: "导入模板",
2229
- type: "tpl",
2230
- // type: "markdown",
2231
- // html: true,
2230
+ type: "markdown",
2231
+ options: {
2232
+ html: true
2233
+ },
2232
2234
  className: "whitespace-nowrap",
2233
2235
  },
2234
2236
  null,
@@ -3075,6 +3077,7 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
3075
3077
  if (!ctx) {
3076
3078
  ctx = {};
3077
3079
  }
3080
+ const btnSearchId = "btn_filter_form_search_" + new Date().getTime();
3078
3081
  const filterFormSchema = await getObjectFieldsFilterFormSchema(ctx);
3079
3082
  const onSearchScript = `
3080
3083
  const scope = event.context.scoped;
@@ -3091,7 +3094,7 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
3091
3094
  // // 这会造成handleFilterSubmit时把移除掉的搜索项字段之前的值加到过滤条件中
3092
3095
  // for(var k in filterFormValues){
3093
3096
  // if(filterFormValues[k] === "" && !filterFormValues.hasOwnProperty(k)){
3094
- // removedValues[k] = "";
3097
+ // removedValues[k] = null;
3095
3098
  // }
3096
3099
  // }
3097
3100
  // listView.handleFilterSubmit(Object.assign({}, removedValues, filterFormValues));
@@ -3130,7 +3133,7 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
3130
3133
  const removedValues = {};
3131
3134
  for(var k in filterFormValues){
3132
3135
  if(/^__searchable__/.test(k)){
3133
- removedValues[k] = "";
3136
+ removedValues[k] = null;
3134
3137
  }
3135
3138
  }
3136
3139
  if(!event.data.isLookup){
@@ -3141,7 +3144,7 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
3141
3144
  if(localListViewProps){
3142
3145
  localListViewProps = JSON.parse(localListViewProps);
3143
3146
  for(var k in localListViewProps){
3144
- removedValues[k] = "";
3147
+ removedValues[k] = null;
3145
3148
  }
3146
3149
  }
3147
3150
  }
@@ -3299,7 +3302,7 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
3299
3302
  });
3300
3303
  const removedValues = {};
3301
3304
  removedKeys.forEach(function(key){
3302
- removedValues[key] = "";
3305
+ removedValues[key] = null;
3303
3306
  });
3304
3307
  filterForm.setValues(removedValues);//这里使用filterInnerForm也可以
3305
3308
 
@@ -3312,10 +3315,14 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
3312
3315
  let localListViewProps = sessionStorage.getItem(listViewPropsStoreKey);
3313
3316
  if(localListViewProps){
3314
3317
  localListViewProps = JSON.parse(localListViewProps);
3315
- // const removedValues = {};
3316
- removedKeys.forEach(function(key){
3317
- delete localListViewProps[key];
3318
- // removedValues[key] = "";
3318
+ _.each(localListViewProps, function(n,k){
3319
+ // __searchable__开头的不在searchableFields范围则清除其值
3320
+ let isRemoved = !!removedFields.find(function(fieldName){
3321
+ return new RegExp("__searchable__\.*" + fieldName + "$").test(k);
3322
+ });
3323
+ if(isRemoved){
3324
+ delete localListViewProps[k];
3325
+ }
3319
3326
  });
3320
3327
  sessionStorage.setItem(listViewPropsStoreKey, JSON.stringify(localListViewProps));
3321
3328
  }
@@ -3349,9 +3356,10 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
3349
3356
  "body": [
3350
3357
  {
3351
3358
  "type": "button",
3359
+ "id": btnSearchId,
3352
3360
  "label": "搜索",
3353
3361
  "icon": "fa fa-search",
3354
- "visibleOn": "this.filterFormSearchableFields && this.filterFormSearchableFields.length",
3362
+ // "visibleOn": "this.filterFormSearchableFields && this.filterFormSearchableFields.length",
3355
3363
  "onEvent": {
3356
3364
  "click": {
3357
3365
  "actions": [
@@ -3367,7 +3375,7 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
3367
3375
  "type": "button",
3368
3376
  "label": "取消",
3369
3377
  "name": "btn_filter_form_cancel",
3370
- "visibleOn": "this.filterFormSearchableFields && this.filterFormSearchableFields.length",
3378
+ // "visibleOn": "this.filterFormSearchableFields && this.filterFormSearchableFields.length",
3371
3379
  "onEvent": {
3372
3380
  "click": {
3373
3381
  "actions": [
@@ -3482,6 +3490,10 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
3482
3490
  "actionType": "custom",
3483
3491
  "script": onSearchableFieldsChangeScript
3484
3492
  },
3493
+ {
3494
+ "actionType": "click",
3495
+ "componentId": btnSearchId
3496
+ },
3485
3497
  {
3486
3498
  "componentId": "",
3487
3499
  "args": {},
@@ -3836,7 +3848,7 @@ async function getObjectRecordDetailHeader(objectSchema, recordId, options) {
3836
3848
  // "tpl": "${(record && uiSchema && record[uiSchema.NAME_FIELD_KEY]) || name}",
3837
3849
  "inline": false,
3838
3850
  "wrapperComponent": "",
3839
- "className": "leading-5 text-xl font-bold"
3851
+ "className": "record-detail-header-name leading-5 text-xl font-bold"
3840
3852
  }
3841
3853
  ],
3842
3854
  "columnClassName": "p-l-xs"
@@ -3845,6 +3857,7 @@ async function getObjectRecordDetailHeader(objectSchema, recordId, options) {
3845
3857
  "className": "flex justify-between"
3846
3858
  }
3847
3859
  ],
3860
+ "columnClassName": "flex-initial",
3848
3861
  "md": "auto",
3849
3862
  });
3850
3863
  }
@@ -3865,7 +3878,7 @@ async function getObjectRecordDetailHeader(objectSchema, recordId, options) {
3865
3878
  {
3866
3879
  "type": "grid",
3867
3880
  "columns": gridBody,
3868
- "className": "flex justify-between"
3881
+ "className": "flex justify-between flex-nowrap"
3869
3882
  }
3870
3883
  ],
3871
3884
  "hiddenOn": "${recordLoaded != true}"
@@ -4082,12 +4095,13 @@ const getNewListviewButtonSchema = ()=>{
4082
4095
  "type": "dialog",
4083
4096
  "title": "新建 列表视图",
4084
4097
  "data": {
4085
- "&": "$$",
4098
+ //"&":"$$",2.7、2.9、3.0在此处失效
4086
4099
  "all": "${uiSchema.list_views.all}",
4087
4100
  "list_view": "${uiSchema.list_views[listName]}",
4088
4101
  "appId": "${appId}",
4089
4102
  "global": "${global}",
4090
4103
  "targetObjectName": "${objectName}",
4104
+ "context": "${context}"
4091
4105
  },
4092
4106
  "body": [
4093
4107
  {
@@ -4231,12 +4245,13 @@ const getCopyListviewButtonSchema = ()=>{
4231
4245
  "type": "dialog",
4232
4246
  "title": "复制 列表视图",
4233
4247
  "data": {
4234
- "&": "$$",
4248
+ //"&":"$$",2.7、2.9、3.0在此处失效
4235
4249
  "listName": "${listName}",
4236
4250
  "targetObjectName": "${objectName}",
4237
4251
  "list_view": "${uiSchema.list_views[listName]}",
4238
4252
  "appId": "${appId}",
4239
- "global": "${global}"
4253
+ "global": "${global}",
4254
+ "context": "${context}"
4240
4255
  },
4241
4256
  "body": [
4242
4257
  {
@@ -4378,7 +4393,8 @@ const getRenameListviewButtonSchema = ()=>{
4378
4393
  "data": {
4379
4394
  "targetObjectName": "${objectName}",
4380
4395
  "recordId": "${uiSchema.list_views[listName]._id}",
4381
- "appId": "${appId}"
4396
+ "appId": "${appId}",
4397
+ "context": "${context}"
4382
4398
  },
4383
4399
  "body": [
4384
4400
  {
@@ -4435,6 +4451,7 @@ const getSetListviewShareButtonSchema = ()=>{
4435
4451
  "title": "共享设置",
4436
4452
  "data": {
4437
4453
  "recordId": "${uiSchema.list_views[listName]._id}",
4454
+ "context": "${context}"
4438
4455
  },
4439
4456
  "body": [
4440
4457
  {
@@ -4480,7 +4497,8 @@ const getSetListviewFiltersButtonSchema = ()=>{
4480
4497
  "targetObjectName": "${objectName}",
4481
4498
  "recordId": "${uiSchema.list_views[listName]._id}",
4482
4499
  "listName": "${listName}",
4483
- "appId": "${appId}"
4500
+ "appId": "${appId}",
4501
+ "context": "${context}"
4484
4502
  },
4485
4503
  "body": [
4486
4504
  {
@@ -4624,11 +4642,12 @@ const getSetListviewColumnsButtonSchema = ()=>{
4624
4642
  "type": "dialog",
4625
4643
  "title": "显示的列",
4626
4644
  "data": {
4627
- "&": "$$",
4645
+ //"&":"$$",2.7、2.9、3.0在此处失效
4628
4646
  "targetObjectName": "${objectName}",
4629
4647
  "recordId": "${uiSchema.list_views[listName]._id}",
4630
4648
  "listName": "${listName}",
4631
- "appId": "${appId}"
4649
+ "appId": "${appId}",
4650
+ "context": "${context}"
4632
4651
  },
4633
4652
  "body": [
4634
4653
  {
@@ -4777,11 +4796,12 @@ const getSetListviewSortButtonSchema = ()=>{
4777
4796
  "type": "dialog",
4778
4797
  "title": "默认排序规则",
4779
4798
  "data": {
4780
- "&": "$$",
4799
+ //"&":"$$",2.7、2.9、3.0在此处失效
4781
4800
  "targetObjectName": "${objectName}",
4782
4801
  "recordId": "${uiSchema.list_views[listName]._id}",
4783
4802
  "listName": "${listName}",
4784
- "appId": "${appId}"
4803
+ "appId": "${appId}",
4804
+ "context": "${context}"
4785
4805
  },
4786
4806
  "body": [
4787
4807
  {
@@ -5471,24 +5491,13 @@ function getLookupSapceUserTreeSchema(){
5471
5491
  "actionType": "custom",
5472
5492
  "script": `
5473
5493
  const scope = event.context.scoped;
5474
- //TODO: 将form中的value一同加入筛选内
5475
- // var filterForm = scope.parent.parent.getComponents().find(function(n){
5476
- // return n.props.type === "form";
5477
- // });
5478
- // var filterFormValues = filterForm.getValues();
5479
- filterFormValues={
5494
+ var filterFormValues={
5480
5495
  "__searchable__organizations_parents":event.data.value.value
5481
5496
  }
5482
5497
  var listView = scope.parent.getComponents().find(function(n){
5483
5498
  return n.props.type === "crud";
5484
5499
  });
5485
- const removedValues = {};
5486
- // for(var k in filterFormValues){
5487
- // if(filterFormValues[k] === "" && !filterFormValues.hasOwnProperty(k)){
5488
- // removedValues[k] = "";
5489
- // }
5490
- // }
5491
- listView.handleFilterSubmit(Object.assign({}, removedValues, filterFormValues));
5500
+ listView.handleFilterSubmit(Object.assign({}, filterFormValues));
5492
5501
  `
5493
5502
  }
5494
5503
  ]
@@ -5602,7 +5611,7 @@ async function lookupToAmisPicker(field, readonly, ctx){
5602
5611
 
5603
5612
  const source = await getApi$1(refObjectConfig, null, fields, {expand: true, alias: 'rows', queryOptions: `filters: {__filters}, top: {__top}, skip: {__skip}, sort: "{__sort}"`});
5604
5613
 
5605
- if(source.url){
5614
+ if(source.url && !ctx.inFilterForm){
5606
5615
  const depend_on = [];
5607
5616
  const sendOn = [];
5608
5617
  ___default.each(field.depend_on, (fName)=>{
@@ -5666,9 +5675,10 @@ async function lookupToAmisPicker(field, readonly, ctx){
5666
5675
  filters.push(fieldFilters);
5667
5676
  }
5668
5677
 
5678
+ const inFilterForm = ${ctx.inFilterForm};
5669
5679
  const filtersFunction = ${field.filtersFunction || field._filtersFunction};
5670
5680
 
5671
- if(filtersFunction){
5681
+ if(filtersFunction && !inFilterForm){
5672
5682
  const _filters = filtersFunction(filters, api.data.$self.__super.__super);
5673
5683
  if(_filters && _filters.length > 0){
5674
5684
  filters.push(_filters);
@@ -5888,7 +5898,8 @@ async function lookupToAmisSelect(field, readonly, ctx){
5888
5898
  sort = getListViewSort(listView);
5889
5899
  }
5890
5900
 
5891
- if(apiInfo.url){
5901
+ // 列表视图搜索栏中,即inFilterForm=true时,不需要执行depend_on
5902
+ if(apiInfo.url && !ctx.inFilterForm){
5892
5903
  const depend_on = [];
5893
5904
  const sendOn = [];
5894
5905
  ___default.each(field.depend_on, (fName)=>{
@@ -5925,9 +5936,10 @@ async function lookupToAmisSelect(field, readonly, ctx){
5925
5936
  filters.push(fieldFilters);
5926
5937
  }
5927
5938
 
5939
+ const inFilterForm = ${ctx.inFilterForm};
5928
5940
  const filtersFunction = ${field.filtersFunction || field._filtersFunction};
5929
5941
 
5930
- if(filtersFunction){
5942
+ if(filtersFunction && !inFilterForm){
5931
5943
  const _filters = filtersFunction(filters, api.data.$);
5932
5944
  if(_filters && _filters.length > 0){
5933
5945
  filters.push(_filters);
@@ -5953,7 +5965,14 @@ async function lookupToAmisSelect(field, readonly, ctx){
5953
5965
  referenceTo ? referenceTo.valueField.name : '';
5954
5966
  if(field.optionsFunction || field._optionsFunction){
5955
5967
  apiInfo.adaptor = `
5956
- payload.data.options = eval(${field.optionsFunction || field._optionsFunction})(api.data.$);
5968
+ var options = eval(${field.optionsFunction || field._optionsFunction})(api.data.$);
5969
+ if(api.data.$term){
5970
+ options = _.filter(options, function(o) {
5971
+ var label = o.label;
5972
+ return label.toLowerCase().indexOf(api.data.$term.toLowerCase()) > -1;
5973
+ });
5974
+ }
5975
+ payload.data.options = options;
5957
5976
  return payload;
5958
5977
  `;
5959
5978
  }
@@ -6089,7 +6108,7 @@ async function getIdsPickerSchema(field, readonly, ctx){
6089
6108
  source.data.$term = "$term";
6090
6109
  source.data.$self = "$$";
6091
6110
 
6092
- if(idsDependOn && source.url){
6111
+ if(idsDependOn && source.url && !ctx.inFilterForm){
6093
6112
  source.sendOn = `\${${idsDependOn} && ${idsDependOn}.length}`;
6094
6113
  source.url = `${source.url}&depend_on_${idsDependOn}=\${${idsDependOn}|join}`;
6095
6114
  }
@@ -6931,7 +6950,7 @@ async function convertSFieldToAmisField(field, readonly, ctx) {
6931
6950
  convertData.className = fieldTypeClassName;
6932
6951
  }
6933
6952
 
6934
- if(field.visible_on){
6953
+ if(field.visible_on && !ctx.inFilterForm){
6935
6954
  // convertData.visibleOn = `\$${field.visible_on.substring(1, field.visible_on.length -1).replace(/formData./g, '')}`;
6936
6955
  if(field.visible_on.startsWith("{{")){
6937
6956
  convertData.visibleOn = `${field.visible_on.substring(2, field.visible_on.length -2).replace(/formData./g, 'data.')}`;
@@ -7024,7 +7043,7 @@ async function getFieldSearchable(perField, permissionFields, ctx){
7024
7043
  _field.multiple = true;
7025
7044
  _field.is_wide = false;
7026
7045
  _field.defaultValue = undefined;
7027
- const amisField = await convertSFieldToAmisField(_field, false, Object.assign({}, ctx, {fieldNamePrefix: fieldNamePrefix, required: false, showSystemFields: true}));
7046
+ const amisField = await convertSFieldToAmisField(_field, false, Object.assign({}, ctx, {fieldNamePrefix: fieldNamePrefix, required: false, showSystemFields: true, inFilterForm: true}));
7028
7047
  if(amisField){
7029
7048
  return amisField;
7030
7049
  }
@@ -8026,7 +8045,7 @@ async function getTableColumns$1(fields, options){
8026
8045
  tpl: tpl,
8027
8046
  toggled: field.toggled,
8028
8047
  className,
8029
- html: field.type === 'html' ? true : null
8048
+ options: field.type === 'html' ? {html: true} : null
8030
8049
  // toggled: true
8031
8050
  }, field.amis, {name: field.name}));
8032
8051
  }
@@ -13906,13 +13925,6 @@ var AmisRecordDetailHeader = function (props) { return __awaiter(void 0, void 0,
13906
13925
  });
13907
13926
  }); };
13908
13927
 
13909
- /*
13910
- * @Author: baozhoutao@steedos.com
13911
- * @Date: 2022-12-08 10:32:17
13912
- * @LastEditors: baozhoutao@steedos.com
13913
- * @LastEditTime: 2023-04-13 18:40:42
13914
- * @Description:
13915
- */
13916
13928
  var AmisRecordDetail = function (props) { return __awaiter(void 0, void 0, void 0, function () {
13917
13929
  var className, $schema, appId, _a, objectApiName, body, schema;
13918
13930
  return __generator(this, function (_b) {
@@ -14496,7 +14508,7 @@ var AmisAppMenu = function (props) { return __awaiter(void 0, void 0, void 0, fu
14496
14508
  schemaApi: {
14497
14509
  "method": "get",
14498
14510
  "url": "${context.rootUrl}/service/api/apps/".concat(appId, "/menus"),
14499
- "adaptor": "\n try {\n console.log('payload====>', payload)\n if(payload.nav_schema){\n payload.data = payload.nav_schema;\n return payload\n }\n\n const data = { nav: [] };\n const stacked = ".concat(stacked, ";\n const showIcon = ").concat(showIcon, ";\n const selectedId = '").concat(selectedId, "';\n if(stacked){\n _.each(_.groupBy(payload.children, 'group'), (tabs, groupName) => {\n if (groupName === 'undefined' || groupName === '') {\n _.each(tabs, (tab) => {\n data.nav.push({\n \"label\": showIcon ? {\n type: 'tpl',\n tpl: `<span class='fill-slate-500 text-slate-700 block -ml-px no-underline group flex items-center text-[15px] font-medium rounded-md'><svg class=\"mr-1 flex-shrink-0 h-6 w-6\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#${tab.icon || 'account'}\"></use></svg>${tab.name}</span>`\n } : tab.name,\n \"to\": tab.path,\n \"target\":tab.target\n // active: selectedId === tab.id,\n })\n })\n } else {\n data.nav.push({\n \"label\": groupName,\n \"unfolded\": true,\n \"children\": _.map(tabs, (tab) => {\n return {\n \"label\": showIcon ? {\n type: 'tpl',\n tpl: `<span class='fill-slate-500 text-slate-700 block -ml-px no-underline group flex items-center text-[15px] font-medium rounded-md'><svg class=\"mr-1 flex-shrink-0 h-6 w-6\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#${tab.icon || 'account'}\"></use></svg>${tab.name}</span>`\n } : tab.name,\n \"to\": tab.path,\n \"target\":tab.target\n // active: selectedId === tab.id,\n }\n })\n }) \n }\n });\n }else{\n _.each(payload.children, (tab)=>{\n data.nav.push({\n \"label\": showIcon ? {\n type: 'tpl',\n tpl: `<span class='fill-slate-500 text-slate-700 block -ml-px no-underline group flex items-center text-[15px] font-medium rounded-md'><svg class=\"mr-1 flex-shrink-0 h-6 w-6\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#${tab.icon || 'account'}\"></use></svg>${tab.name}</span>`\n } : tab.name,\n \"to\": tab.path,\n \"target\":tab.target\n // active: selectedId === tab.id,\n });\n })\n }\n payload.data = {\n \"type\": \"nav\",\n className: \"").concat(className, "\",\n \"stacked\": ").concat(stacked, ",\n \"overflow\": ").concat(JSON.stringify(overflow), ",\n \"indentSize\": ").concat(indentSize, ",\n \"links\": data.nav,\n };\n } catch (error) {\n console.log(`error`, error)\n }\n console.log('payload===2==>', payload)\n return payload;\n "),
14511
+ "adaptor": "\n try {\n console.log('payload====>', payload)\n if(payload.nav_schema){\n payload.data = payload.nav_schema;\n return payload\n }\n\n const data = { nav: [] };\n const stacked = ".concat(stacked, ";\n const showIcon = ").concat(showIcon, ";\n const selectedId = '").concat(selectedId, "';\n const tab_groups = payload.tab_groups;\n if(stacked){\n _.each(_.groupBy(payload.children, 'group'), (tabs, groupName) => {\n if (groupName === 'undefined' || groupName === '') {\n _.each(tabs, (tab) => {\n data.nav.push({\n \"label\": showIcon ? {\n type: 'tpl',\n tpl: `<span class='fill-slate-500 text-slate-700 block -ml-px no-underline group flex items-center text-[15px] font-medium rounded-md'><svg class=\"mr-1 flex-shrink-0 h-6 w-6\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#${tab.icon || 'account'}\"></use></svg>${tab.name}</span>`\n } : tab.name,\n \"to\": tab.path,\n \"target\":tab.target\n // active: selectedId === tab.id,\n })\n })\n } else {\n data.nav.push({\n \"label\": groupName,\n \"unfolded\": _.find(tab_groups, {\"group_name\": groupName})?.default_open != false,\n \"children\": _.map(tabs, (tab) => {\n return {\n \"label\": showIcon ? {\n type: 'tpl',\n tpl: `<span class='fill-slate-500 text-slate-700 block -ml-px no-underline group flex items-center text-[15px] font-medium rounded-md'><svg class=\"mr-1 flex-shrink-0 h-6 w-6\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#${tab.icon || 'account'}\"></use></svg>${tab.name}</span>`\n } : tab.name,\n \"to\": tab.path,\n \"target\":tab.target\n // active: selectedId === tab.id,\n }\n })\n }) \n }\n });\n }else{\n _.each(payload.children, (tab)=>{\n data.nav.push({\n \"label\": showIcon ? {\n type: 'tpl',\n tpl: `<span class='fill-slate-500 text-slate-700 block -ml-px no-underline group flex items-center text-[15px] font-medium rounded-md'><svg class=\"mr-1 flex-shrink-0 h-6 w-6\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#${tab.icon || 'account'}\"></use></svg>${tab.name}</span>`\n } : tab.name,\n \"to\": tab.path,\n \"target\":tab.target\n // active: selectedId === tab.id,\n });\n })\n }\n payload.data = {\n \"type\": \"nav\",\n className: \"").concat(className, "\",\n \"stacked\": ").concat(stacked, ",\n \"overflow\": ").concat(JSON.stringify(overflow), ",\n \"indentSize\": ").concat(indentSize, ",\n \"links\": data.nav,\n };\n } catch (error) {\n console.log(`error`, error)\n }\n console.log('payload===2==>', payload)\n return payload;\n "),
14500
14512
  "headers": {
14501
14513
  "Authorization": "Bearer ${context.tenantId},${context.authToken}"
14502
14514
  }