@steedos-widgets/amis-lib 6.10.14 → 6.10.15
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/tsconfig.tsbuildinfo +1 -1
- package/dist/index.cjs.js +8 -8
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +8 -8
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +3 -3
- package/dist/index.umd.js.map +1 -1
- package/package.json +2 -2
package/dist/index.umd.js
CHANGED
|
@@ -567,7 +567,7 @@ var onSearchScript="\n ".concat(onChangeScript,"\n\n // \u4E0B\u9762\u7684
|
|
|
567
567
|
// }, 500);
|
|
568
568
|
// `;
|
|
569
569
|
return{"type":"tooltip-wrapper","id":"steedos_crud_toolbar_quick_search","align":"right","title":"","content":i18next__default["default"].t('frontend_crud_toolbar_quick_search_tooltip_prefix')+searchableFieldsLabel.join(","),"placement":"bottom","tooltipTheme":"dark","trigger":"click","className":formFactor!=='SMALL'?"mr-1":'',"visible":!!searchableFieldsLabel.length,"body":[{"type":"search-box","name":keywordsSearchBoxName,"placeholder":i18next__default["default"].t('frontend_crud_toolbar_quick_search_placeholder'),//"快捷搜索",
|
|
570
|
-
"value":crudKeywords,"mini":
|
|
570
|
+
"value":crudKeywords,"mini":false,"clearable":true,//因为清除并不会触发失去焦点事件,只有禁用,但是它会触发change事件,所以等升级到amis 3.4+后可以重新放开
|
|
571
571
|
"clearAndSubmit":true,"searchImediately":false,"onEvent":{"search":{"actions":[{"actionType":"custom","script":onSearchScript}]},"change":{//amis 3.2change事件中setData会卡,升级到amis 3.4+应该不会再卡了,所以这里换回change事件,如果还是会卡就要考虑重新换成blur事件
|
|
572
572
|
"actions":[{"actionType":"custom","script":onChangeScript}]}// "blur": {
|
|
573
573
|
// "actions": [
|
|
@@ -614,7 +614,7 @@ var toolbarFilter;if(filterVisible){toolbarFilter={"label":i18next__default["def
|
|
|
614
614
|
var toolbars=[];if(formFactor==='SMALL'){// if(toolbarCount){
|
|
615
615
|
// toolbars.push(toolbarCount);
|
|
616
616
|
// }
|
|
617
|
-
toolbars.push(toolbarReloadButton);toolbars.push(toolbarDQuickSearchBox);if(toolbarFilter){toolbars.push(toolbarFilter);}toolbars.push(toolbarDisplayAsButton);return[].concat(_toConsumableArray(headerToolbarItems||[]),toolbars);}else{var _mainObject$permissio;toolbars.push(
|
|
617
|
+
toolbars.push(toolbarReloadButton);toolbars.push(toolbarDQuickSearchBox);if(toolbarFilter){toolbars.push(toolbarFilter);}toolbars.push(toolbarDisplayAsButton);return[].concat(_toConsumableArray(headerToolbarItems||[]),toolbars);}else{var _mainObject$permissio;if(toolbarFilter){toolbars.push(toolbarFilter);}toolbars.push(toolbarReloadButton);toolbars.push(toolbarDisplayAsButton);if(mainObject!==null&&mainObject!==void 0&&(_mainObject$permissio=mainObject.permissions)!==null&&_mainObject$permissio!==void 0&&_mainObject$permissio.allowCreateListViews){toolbars.push(getSettingListviewToolbarButtonSchema());}toolbars.push(toolbarDQuickSearchBox);if(toolbarCount){toolbars.push(toolbarCount);}return[].concat(_toConsumableArray(headerToolbarItems||[]),["bulkActions"],toolbars);}}function getObjectFooterToolbar(mainObject,formFactor,options){// crud card模式与table模式两种情况下showPageInput默认值不一样,所以需要显式设置为false
|
|
618
618
|
if(formFactor==='SMALL'){// return [
|
|
619
619
|
// "load-more",
|
|
620
620
|
// ]
|
|
@@ -1670,7 +1670,7 @@ spaceId=amisLib.getSteedosAuth().tenantId;return _context35.a(2,{"type":"list","
|
|
|
1670
1670
|
},"actionType":"setValue"}]}},"id":"u:06e0037dcd23","level":"link","className":"m-r"},{"type":"button","label":amisLib.i18next.t('frontend_workflow_approval_suggestion_other'),//"同意"
|
|
1671
1671
|
"onEvent":{"click":{"actions":[]}},"id":"u:3a781bc550a2","level":"link","className":"m-r"}],"id":"u:3def7a5b7cd5"}],"id":"u:ecbefa51b638"}],"id":"u:dd32ae67b5c7"}],"id":"u:a5d06d3a61b9","closeOnEsc":false,"closeOnOutside":false,"showCloseButton":true,"actions":[{"type":"button","label":"${'OK' | t}","onEvent":{"click":{"actions":[{"componentId":"yijian-".concat(field.code),"args":{"valueInput":"${yijian}","value":"${yijian}"},"actionType":"setValue"},{"componentId":"","args":{},"actionType":"closeDialog"}]}},"id":"u:87e22efe707a","level":"primary"},{"type":"button","label":"${'Cancel' | t}","onEvent":{"click":{"actions":[{"componentId":"","args":{},"actionType":"closeDialog"}]}},"id":"u:d0e6550a848e"}]}}],"weight":0}},"className":"instance-sign-text-btn"}];_context37.n=30;break;case 1:_t64=field.type;_context37.n=_t64==="input"?2:_t64==="number"?3:_t64==="date"?4:_t64==="dateTime"?5:_t64==="checkbox"?6:_t64==="email"?7:_t64==="url"?8:_t64==="password"?9:_t64==="select"?10:_t64==="user"?11:_t64==="group"?13:_t64==="radio"?15:_t64==="multiSelect"?16:_t64==="odata"?17:_t64==="html"?18:_t64==="table"?19:_t64==="section"?28:29;break;case 2:if(field.is_textarea){tpl.type="textarea";}else{tpl.type="input-text";}return _context37.a(3,30);case 3:tpl.type="input-number";tpl.precision=2;return _context37.a(3,30);case 4:tpl.type="input-date";tpl.inputFormat="YYYY-MM-DD";tpl.format='YYYY-MM-DDT00:00:00.000[Z]';return _context37.a(3,30);case 5:tpl.type="input-datetime";tpl.inputFormat="YYYY-MM-DD HH:mm";tpl.format='YYYY-MM-DDTHH:mm:ss.SSSZ';return _context37.a(3,30);case 6:tpl.type="checkbox";return _context37.a(3,30);case 7:tpl.type="input-email";tpl.validations={isEmail:true};return _context37.a(3,30);case 8:tpl.type="input-url";tpl.validations={isUrl:true};return _context37.a(3,30);case 9:tpl.type="input-password";tpl.showCounter=true;return _context37.a(3,30);case 10:tpl.type="select";tpl.options=getSelectOptions(field);return _context37.a(3,30);case 11:_context37.n=12;return amisLib.lookupToAmis({name:field.code,label:field.name,reference_to:"space_users",reference_to_field:'user',multiple:field.is_multiselect},false,{});case 12:useTpl=_context37.v;Object.assign(tpl,useTpl);return _context37.a(3,30);case 13:_context37.n=14;return amisLib.lookupToAmis({name:field.code,label:field.name,reference_to:"organizations",multiple:field.is_multiselect},false,{});case 14:orgTpl=_context37.v;Object.assign(tpl,orgTpl);return _context37.a(3,30);case 15:tpl.type="radios";tpl.options=getSelectOptions(field);return _context37.a(3,30);case 16:tpl.type="checkboxes";tpl.options=getSelectOptions(field);return _context37.a(3,30);case 17:argsName=getArgumentsList(field.filters);labelField=field.formula.substr(1,field.formula.length-2);labelField=labelField.substr(labelField.indexOf(".")+1);tpl.type="select";tpl.multiple=field.is_multiselect;// tpl.labelField = labelField;
|
|
1672
1672
|
// tpl.valueField = "_value";
|
|
1673
|
-
tpl.source={url:field.url,method:"get",dataType:"json",adaptor:"\n payload.data = {\n options: _.map(payload.value, (item)=>{\n const value = item;\n item[\"@label\"] = item[\"".concat(labelField,"\"]\n delete item['@odata.editLink'];\n delete item['@odata.etag'];\n delete item['@odata.id'];\n return {\n label: item[\"@label\"],\n value: value\n }\n })\n }\n return payload;\n "),requestAdaptor:"\n const filters = ".concat(_.replace(field.filters,/_.pluck/g,'_.map'),"
|
|
1673
|
+
tpl.source={url:field.url,method:"get",dataType:"json",adaptor:"\n payload.data = {\n options: _.map(payload.value, (item)=>{\n const value = item;\n item[\"@label\"] = item[\"".concat(labelField,"\"]\n delete item['@odata.editLink'];\n delete item['@odata.etag'];\n delete item['@odata.id'];\n return {\n label: item[\"@label\"],\n value: value\n }\n })\n }\n return payload;\n "),requestAdaptor:"\n const filters = `".concat(_.replace(field.filters,/_.pluck/g,'_.map'),"`;\n const url = `").concat(field.url,"`;\n if(filters){\n console.log('filters', filters);\n const joinKey = url.indexOf('?') > 0 ? '&' : '?';\n if(filters.startsWith('function(') || filters.startsWith('function (')){\n const argsName = ").concat(JSON.stringify(argsName),";\n const fun = eval('_fun='+filters);\n const funArgs = [];\n for(const item of argsName){\n funArgs.push(context[item])\n }\n api.url = url + joinKey + \"$filter=\" + fun.apply({}, funArgs)\n }else{\n api.url = url + joinKey + \"$filter=\" + filters\n }\n }else{\n api.url = url \n }\n api.query = {};\n return api;\n "),trackExpression:_.join(_.map(argsName,function(item){return"${".concat(item,"|json}");}),'-')};tpl.isAmis=true;console.log("odata",tpl);return _context37.a(3,30);case 18:if(tpl.disabled){tpl.type='html';}else{tpl.type="input-rich-text";}return _context37.a(3,30);case 19:tpl.type="steedos-input-table";tpl.addable=field.permission==="editable";tpl.editable=tpl.addable;tpl.copyable=tpl.addable;tpl.removable=tpl.addable;// tpl.fieldPrefix = field.name + "_";
|
|
1674
1674
|
tpl.autoGeneratePrimaryKeyValue=true;tpl.fields=[];if(tpl.editable){tpl.className="".concat(tpl.className||''," steedos-input-table-editable");}_iterator2=_createForOfIteratorHelper(field.fields);_context37.p=20;_iterator2.s();case 21:if((_step2=_iterator2.n()).done){_context37.n=24;break;}sField=_step2.value;if(!(sField.type!="hidden")){_context37.n=23;break;}sField.permission=field.permission;_context37.n=22;return getTdInputTpl(sField,true);case 22:column=_context37.v;if(column.type==='steedos-field'){tpl.fields.push(column.config);}else{tpl.fields.push(column);}case 23:_context37.n=21;break;case 24:_context37.n=26;break;case 25:_context37.p=25;_t65=_context37.v;_iterator2.e(_t65);case 26:_context37.p=26;_iterator2.f();return _context37.f(26);case 27:return _context37.a(3,30);case 28:tpl.type="input-text";return _context37.a(3,30);case 29:tpl.type='steedos-field';tpl.config=field.steedos_field||field.config;return _context37.a(3,30);case 30:return _context37.a(2,tpl);}},_callee37,null,[[20,25,26,27]]);}));return function getFieldEditTpl(_x271,_x272){return _ref40.apply(this,arguments);};}();var getFieldReadonlyTpl=/*#__PURE__*/function(){var _ref41=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee38(field,label){var tpl,options,map,_iterator3,_step3,sField,column,_t66;return _regenerator().w(function(_context38){while(1)switch(_context38.p=_context38.n){case 0:tpl={label:label===true?field.name:false,name:field.code,mode:"horizontal",className:"m-none p-none form-control"};if(!_$1.includes(['text'],field.type)){_context38.n=1;break;}tpl.type="static-".concat(field.type);_context38.n=21;break;case 1:if(!(field.type==='select')){_context38.n=2;break;}options=getSelectOptions(field);map={};_$1.each(options,function(item){map[item.value]=item.label;});tpl.type='static';tpl.tpl="<% var options = ".concat(JSON.stringify(map),"; return (options && options[data[\"").concat(field.code,"\"]]) || ''%>");_context38.n=21;break;case 2:if(!(field.type==='odata')){_context38.n=3;break;}tpl.type='static';tpl.tpl="<div>${".concat(field.code,"['@label']}</div>");_context38.n=21;break;case 3:if(!(field.type==='checkbox')){_context38.n=4;break;}tpl.type='static';tpl.tpl="${".concat(field.code," ? '\u662F': '\u5426'}");_context38.n=21;break;case 4:if(!(field.type==='email')){_context38.n=5;break;}tpl.type='static';tpl.tpl="<a href=\"mailto:${".concat(field.code,"}\">${").concat(field.code,"}</a>");_context38.n=21;break;case 5:if(!(field.type==='url')){_context38.n=6;break;}tpl.type='static';tpl.tpl="<a href=\"${".concat(field.code,"}\" target=\"_blank\">${").concat(field.code,"}</a>");_context38.n=21;break;case 6:if(!(field.type==='password')){_context38.n=7;break;}tpl.type='static';tpl.tpl="******";_context38.n=21;break;case 7:if(!(field.type==='date')){_context38.n=8;break;}tpl.type='static';// tpl.format = 'YYYY-MM-DD HH:mm'
|
|
1675
1675
|
tpl.tpl="<%=data.".concat(field.code," ? date(new Date(data.").concat(field.code,"), 'YYYY-MM-DD') : '' %>");_context38.n=21;break;case 8:if(!(field.type==='dateTime')){_context38.n=9;break;}tpl.type='static';// tpl.format = 'YYYY-MM-DD HH:mm'
|
|
1676
1676
|
tpl.tpl="<%=data.".concat(field.code," ? date(new Date(data.").concat(field.code,"), 'YYYY-MM-DD HH:mm') : '' %>");_context38.n=21;break;case 9:if(!(field.type==='user')){_context38.n=10;break;}tpl.type='static';// tpl.format = 'YYYY-MM-DD HH:mm'
|