@nocobase/plugin-action-bulk-edit
Version:
Batch edit all records or selected records.
10 lines (9 loc) • 4.08 kB
JavaScript
/**
* This file is part of the NocoBase (R) project.
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
* Authors: NocoBase Team.
*
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
* For more information, please refer to: https://www.nocobase.com/agreement.
*/
;(self.webpackChunk_nocobase_plugin_action_bulk_edit_client_v2=self.webpackChunk_nocobase_plugin_action_bulk_edit_client_v2||[]).push([["265"],{864:function(t,e,n){n.r(e),n.d(e,{BulkEditBlockModel:function(){return h},BulkEditDataBlockModel:function(){return d}});var r=n(694),o=n(485);function u(t,e,n,r,o,u,c){try{var i=t[u](c),l=i.value}catch(t){n(t);return}i.done?e(l):Promise.resolve(l).then(r,o)}function c(t){return function(){var e=this,n=arguments;return new Promise(function(r,o){var c=t.apply(e,n);function i(t){u(c,r,o,i,l,"next",t)}function l(t){u(c,r,o,i,l,"throw",t)}i(void 0)})}}function i(t,e,n){return e=a(e),function(t,e){var n;if(e&&("object"==((n=e)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof e))return e;if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t,p()?Reflect.construct(e,n||[],a(t).constructor):e.apply(t,n))}function l(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}function a(t){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function f(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&s(t,e)}function s(t,e){return(s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function p(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(p=function(){return!!t})()}function b(t,e){var n,r,o,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),i=Object.defineProperty;return i(c,"next",{value:l(0)}),i(c,"throw",{value:l(1)}),i(c,"return",{value:l(2)}),"function"==typeof Symbol&&i(c,Symbol.iterator,{value:function(){return this}}),c;function l(i){return function(l){var a=[i,l];if(n)throw TypeError("Generator is already executing.");for(;c&&(c=0,a[0]&&(u=0)),u;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return u.label++,{value:a[1],done:!1};case 5:u.label++,r=a[1],a=[0];continue;case 7:a=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===a[0]||2===a[0])){u=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){u.label=a[1];break}if(6===a[0]&&u.label<o[1]){u.label=o[1],o=a;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(a);break}o[2]&&u.ops.pop(),u.trys.pop();continue}a=e.call(t,u)}catch(t){a=[6,t],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}}}var d=function(t){function e(){return l(this,e),i(this,e,arguments)}return f(e,t),e}(o.DataBlockModel);d.define({hide:!0,label:(0,r.tExpr)("Data blocks"),children:function(t){return c(function(){var e,n;return b(this,function(u){switch(u.label){case 0:return[4,(0,r.buildSubModelItems)(o.DataBlockModel)(t)];case 1:return e=u.sent(),n=t.view.inputArgs.scene,[2,e.filter(function(e){if("BulkEditFormModel"===e.useModel)return!0;var r,o=t.engine.getModelClass(e.useModel);return"bulkEditForm"===n&&(null==(r=o._isScene)?void 0:r.call(o,"bulkEditForm"))})]}})})()}});var h=function(t){function e(){return l(this,e),i(this,e,arguments)}return f(e,t),e}(o.BlockModel);h.define({hide:!0,label:(0,r.tExpr)("Data blocks"),children:function(t){return c(function(){return b(this,function(e){switch(e.label){case 0:return[4,(0,r.buildSubModelItems)(o.BlockModel)(t)];case 1:return[2,e.sent().filter(function(t){return"MarkdownBlockModel"===t.useModel})]}})})()}})}}]);