@nocobase/plugin-block-list 2.1.0-alpha.10 → 2.1.0-alpha.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.
@@ -7,4 +7,4 @@
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
9
 
10
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("antd"),require("@emotion/css"),require("@nocobase/client"),require("@ant-design/icons"),require("@nocobase/flow-engine")):"function"==typeof define&&define.amd?define("@nocobase/plugin-block-list",["react","antd","@emotion/css","@nocobase/client","@ant-design/icons","@nocobase/flow-engine"],t):"object"==typeof exports?exports["@nocobase/plugin-block-list"]=t(require("react"),require("antd"),require("@emotion/css"),require("@nocobase/client"),require("@ant-design/icons"),require("@nocobase/flow-engine")):e["@nocobase/plugin-block-list"]=t(e.react,e.antd,e["@emotion/css"],e["@nocobase/client"],e["@ant-design/icons"],e["@nocobase/flow-engine"])}(self,function(e,t,n,r,o,i){return function(){"use strict";var l,a={375:function(e){e.exports=o},477:function(e){e.exports=n},342:function(e){e.exports=r},694:function(e){e.exports=i},59:function(e){e.exports=t},155:function(t){t.exports=e}},c={};function u(e){var t=c[e];if(void 0!==t)return t.exports;var n=c[e]={exports:{}};return a[e](n,n.exports,u),n.exports}u.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return u.d(t,{a:t}),t},u.d=function(e,t){for(var n in t)u.o(t,n)&&!u.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},u.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),u.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},u.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},u.g.importScripts&&(s=u.g.location+"");var s,f=u.g.document;if(!s&&f&&(f.currentScript&&"SCRIPT"===f.currentScript.tagName.toUpperCase()&&(s=f.currentScript.src),!s)){var p=f.getElementsByTagName("script");if(p.length)for(var d=p.length-1;d>-1&&(!s||!/^http(s?):/.test(s));)s=p[d--].src}if(!s)throw Error("Automatic publicPath is not supported in this browser");u.p=s.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/");var b={};return"/"!==(l=window.__webpack_public_path__||"/").charAt(l.length-1)&&(l+="/"),u.p=l+"static/plugins/@nocobase/plugin-block-list/dist/client/",!function(){u.r(b),u.d(b,{default:function(){return $}});var e=u(342),t=u(694),n=u(375),r=u(155),o=u.n(r),i=u(59),l=u(477);function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function c(e){return function(e){if(Array.isArray(e))return a(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||s(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){if(e){if("string"==typeof e)return a(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return a(e,t)}}var f=function(e){if(!e)return 0;var t=e.getBoundingClientRect(),n=window.getComputedStyle(e),r=parseFloat(n.marginTop)||0,o=parseFloat(n.marginBottom)||0;return t.height+r+o},p=function(e){var t,n=e.heightMode,o=e.containerRef,i=e.actionsRef,l=e.listRef,a=e.deps,u=void 0===a?[]:a,p=function(e){if(Array.isArray(e))return e}(t=(0,r.useState)())||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],i=!0,l=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),2!==o.length);i=!0);}catch(e){l=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(l)throw n}}return o}}(t)||s(t,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),d=p[0],b=p[1],y=(0,r.useCallback)(function(){if("specifyValue"!==n&&"fullHeight"!==n)return void b(function(e){return void 0===e?e:void 0});var e,t=o.current;if(t){var r=t.getBoundingClientRect().height;if(r){var a=Math.max(0,Math.floor(r-f(i.current)-f(null==(e=l.current)?void 0:e.querySelector(".ant-list-pagination"))));b(function(e){return e===a?e:a})}}},[n,o,i,l]);return(0,r.useLayoutEffect)(function(){y()},[y].concat(c(u))),(0,r.useEffect)(function(){if(o.current&&"u">typeof ResizeObserver){var e,t=o.current,n=i.current,r=null==(e=l.current)?void 0:e.querySelector(".ant-list-pagination"),a=new ResizeObserver(function(){return y()});return a.observe(t),n&&a.observe(n),r&&a.observe(r),function(){return a.disconnect()}}},[y,o,i,l].concat(c(u))),d};function d(e,t,n,r,o,i,l){try{var a=e[i](l),c=a.value}catch(e){n(e);return}a.done?t(c):Promise.resolve(c).then(r,o)}function y(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function l(e){d(i,r,o,l,a,"next",e)}function a(e){d(i,r,o,l,a,"throw",e)}l(void 0)})}}function h(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function g(e,t,n){return(g="u">typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=v(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(n||e):o.value}})(e,t,n||e)}function v(e){return(v=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function m(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){h(e,t,n[t])})}return e}function w(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function O(e,t){return(O=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function S(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function x(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(x=function(){return!!e})()}function P(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},l=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),a=Object.defineProperty;return a(l,"next",{value:c(0)}),a(l,"throw",{value:c(1)}),a(l,"return",{value:c(2)}),"function"==typeof Symbol&&a(l,Symbol.iterator,{value:function(){return this}}),l;function c(a){return function(c){var u=[a,c];if(n)throw TypeError("Generator is already executing.");for(;l&&(l=0,u[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,r=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){i.label=u[1];break}if(6===u[0]&&i.label<o[1]){i.label=o[1],o=u;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=t.call(e,i)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}function j(){var e=S(["\n .ant-pagination-simple-pager {\n display: none !important;\n }\n "]);return j=function(){return e},e}function k(){var e=S(["\n .ant-pagination-item-link {\n min-width: ","px;\n }\n "]);return k=function(){return e},e}function E(){var e=S(["\n .ant-spin-nested-loading {\n height: var(--nb-list-height);\n overflow: auto;\n margin-left: -","px;\n margin-right: -","px;\n padding-left: ","px;\n padding-right: ","px;\n }\n .ant-spin-nested-loading > .ant-spin-container {\n min-height: 100%;\n }\n "]);return E=function(){return e},e}function M(){var e=S(["\n > div {\n width: 100%;\n }\n "]);return M=function(){return e},e}var R=function(r){var a;if("function"!=typeof r&&null!==r)throw TypeError("Super expression must either be null or a function");function c(){var e,t,n;if(!(this instanceof c))throw TypeError("Cannot call a class as a function");return t=c,n=arguments,t=v(t),h(e=function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,x()?Reflect.construct(t,n||[],v(this).constructor):t.apply(this,n)),"_defaultCustomModelClasses",{CollectionActionGroupModel:"CollectionActionGroupModel",RecordActionGroupModel:"RecordActionGroupModel",TableColumnModel:"TableColumnModel",TableAssociationFieldGroupModel:"TableAssociationFieldGroupModel",TableCustomColumnModel:"TableCustomColumnModel"}),e}return c.prototype=Object.create(r&&r.prototype,{constructor:{value:c,writable:!0,configurable:!0}}),r&&O(c,r),a=[{key:"resource",get:function(){return g(v(c.prototype),"resource",this)}},{key:"createResource",value:function(e,n){return this.context.createResource(t.MultiRecordResource)}},{key:"renderConfigureActions",value:function(){return o().createElement(t.AddSubModelButton,{key:"table-column-add-actions",model:this,subModelBaseClass:this.getModelClassName("CollectionActionGroupModel"),subModelKey:"actions"},o().createElement(t.FlowSettingsButton,{icon:o().createElement(n.SettingOutlined,null)},this.translate("Actions")))}},{key:"pagination",value:function(){var t=this,n=this.resource.getMeta("count"),r=this.resource.getPageSize(),i=this.resource.getMeta("hasNext"),a=this.resource.getPage(),c=this.resource.getData();return n?{current:a,pageSize:r,total:n,showTotal:function(e){return t.translate("Total {{count}} items",{count:e})},showSizeChanger:!0,onChange:function(n,r){return y(function(){return P(this,function(t){switch(t.label){case 0:return this.resource.loading=!0,this.resource.setPage(n),this.resource.setPageSize(r),[4,this.resource.refresh()];case 1:return t.sent(),[4,new Promise(function(e){return setTimeout(e,0)})];case 2:return t.sent(),[4,(0,e.dispatchEventDeep)(this,"paginationChange")];case 3:return t.sent(),[2]}})}).call(t)}}:{simple:!0,showTitle:!1,showSizeChanger:!0,hideOnSinglePage:!1,pageSize:r,total:(null==c?void 0:c.length)<r||!i?r*a:r*a+1,className:(0,l.css)(j()),itemRender:function(e,n,r){return"prev"===n?o().createElement("div",{style:{display:"flex"},className:(0,l.css)(k(),t.context.themeToken.controlHeight)},r," ",o().createElement("div",null,t.resource.getPage())):r}}}},{key:"renderActions",value:function(){var e=!!this.context.flowSettingsEnabled;if(e||this.hasSubModel("actions"))return o().createElement(t.DndProvider,null,o().createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:16}},o().createElement(i.Space,null,this.mapSubModels("actions",function(e){return"left"===e.props.position?o().createElement(t.FlowModelRenderer,{key:e.uid,model:e,showFlowSettings:{showBackground:!1,showBorder:!1,toolbarPosition:"above"}}):null}),o().createElement("span",null)),o().createElement(i.Space,{wrap:!0},this.mapSubModels("actions",function(n){if(!n.hidden||e)return"left"!==n.props.position?o().createElement(t.Droppable,{model:n,key:n.uid},o().createElement(t.FlowModelRenderer,{model:n,showFlowSettings:{showBackground:!1,showBorder:!1,toolbarPosition:"above"},extraToolbarItems:[{key:"drag-handler",component:t.DragHandler,sort:1}]})):null}),this.renderConfigureActions())))}},{key:"renderComponent",value:function(){var e=this.decoratorProps,t=e.heightMode,n=e.height;return o().createElement(C,{model:this,heightMode:t,height:n})}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(c.prototype,a),c}(e.CollectionBlockModel);h(R,"scene",e.BlockSceneEnum.many);var C=(0,t.observer)(function(e){var n,a,c,u=e.model,s=e.heightMode,f=e.height,d=(0,r.useRef)(null),b=(0,r.useRef)(null),y=(0,r.useRef)(null),g="specifyValue"===s||"fullHeight"===s,v=u.context.themeToken,O=p({heightMode:s,containerRef:d,actionsRef:b,listRef:y,deps:[f]}),S=(0,r.useMemo)(function(){return(0,l.css)(E(),v.marginLG,v.marginLG,v.marginLG,v.marginLG)},[]),x=(0,r.useMemo)(function(){var e,t;return null==O?null==(e=u.props)?void 0:e.style:w(m({},(null==(t=u.props)?void 0:t.style)||{}),h({},"--nb-list-height","".concat(O,"px")))},[O,null==(n=u.props)?void 0:n.style]);return o().createElement("div",{ref:d,style:g?{display:"flex",flexDirection:"column",minHeight:0,height:"100%"}:void 0},o().createElement("div",{ref:b},u.renderActions()),o().createElement("div",{ref:y,style:{flex:1,minHeight:0}},o().createElement(i.List,w(m({},u.props),{className:(null==(a=u.props)?void 0:a.className)?"".concat(u.props.className," ").concat(S):S,style:x,pagination:u.pagination(),loading:null==(c=u.resource)?void 0:c.loading,dataSource:u.resource.getData(),renderItem:function(e,n){var r=u.subModels.item.createFork({},"".concat(n));return r.context.defineProperty("record",{get:function(){return e},cache:!1}),r.context.defineProperty("index",{get:function(){return n},cache:!1}),o().createElement(i.List.Item,{key:n,className:(0,l.css)(M())},o().createElement(t.FlowModelRenderer,{model:r}))}}))))});function _(e,t,n,r,o,i,l){try{var a=e[i](l),c=a.value}catch(e){n(e);return}a.done?t(c):Promise.resolve(c).then(r,o)}R.registerFlow({key:"resourceSettings2",steps:{}}),R.registerFlow({key:"listSettings",sort:500,title:(0,t.tExpr)("List settings",{ns:"block-list"}),steps:{pageSize:{title:(0,t.tExpr)("Page size"),uiMode:{type:"select",key:"pageSize",props:{options:[{label:"5",value:5},{label:"10",value:10},{label:"20",value:20},{label:"50",value:50},{label:"100",value:100},{label:"200",value:200}]}},defaultParams:{pageSize:20},handler:function(e,t){e.model.resource.loading=!0,e.model.resource.setPage(1),e.model.resource.setPageSize(t.pageSize)}},dataScope:{use:"dataScope",title:(0,t.tExpr)("Data scope")},defaultSorting:{use:"sortingRule",title:(0,t.tExpr)("Default sorting")},layout:{use:"layout",title:(0,t.tExpr)("Layout"),handler:function(e,t){e.model.setProps(w(m({},t),{labelWidth:"vertical"===t.layout?null:t.labelWidth})),e.model.subModels.item.setProps(w(m({},t),{labelWidth:"vertical"===t.layout?"100%":t.labelWidth,labelWrap:"vertical"===t.layout||t.labelWrap}))}},refreshData:{title:(0,t.tExpr)("Refresh data"),handler:function(e,t){return y(function(){return P(this,function(e){return[2]})})()}}}}),R.registerFlow({key:"paginationChange",on:"paginationChange",steps:{linkageRulesRefresh:{use:"linkageRulesRefresh",defaultParams:{actionName:"blockLinkageRules",flowKey:"cardSettings",stepKey:"linkageRules"}}}}),R.define({label:(0,t.tExpr)("List"),group:(0,t.tExpr)("Content"),searchable:!0,searchPlaceholder:(0,t.tExpr)("Search"),createModelOptions:{use:"ListBlockModel",subModels:{item:{use:"ListItemModel"}}},sort:500});function T(e,t,n){return(T="u">typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=A(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(n||e):o.value}})(e,t,n||e)}function A(e){return(A=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function B(e,t){return(B=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function F(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function I(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(I=function(){return!!e})()}function D(){var e=F(["\n .ant-form-item {\n margin-bottom: 5px;\n }\n "]);return D=function(){return e},e}function z(){var e=F(["\n button {\n padding: 5px;\n padding-left: ",";\n }\n "]);return z=function(){return e},e}var G=function(r){var a;if("function"!=typeof r&&null!==r)throw TypeError("Super expression must either be null or a function");function c(){var e,t;if(!(this instanceof c))throw TypeError("Cannot call a class as a function");return e=c,t=arguments,e=A(e),function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,I()?Reflect.construct(e,t||[],A(this).constructor):e.apply(this,t))}return c.prototype=Object.create(r&&r.prototype,{constructor:{value:c,writable:!0,configurable:!0}}),r&&B(c,r),a=[{key:"onInit",value:function(e){T(A(c.prototype),"onInit",this).call(this,e)}},{key:"renderConfigureAction",value:function(){return o().createElement(t.AddSubModelButton,{key:"table-row-actions-add",model:this,subModelBaseClass:this.context.getModelClassName("RecordActionGroupModel"),subModelKey:"actions",afterSubModelInit:function(e){var t;return(t=function(){return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},l=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),a=Object.defineProperty;return a(l,"next",{value:c(0)}),a(l,"throw",{value:c(1)}),a(l,"return",{value:c(2)}),"function"==typeof Symbol&&a(l,Symbol.iterator,{value:function(){return this}}),l;function c(a){return function(c){var u=[a,c];if(n)throw TypeError("Generator is already executing.");for(;l&&(l=0,u[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,r=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){i.label=u[1];break}if(6===u[0]&&i.label<o[1]){i.label=o[1],o=u;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=t.call(e,i)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}(this,function(t){return e.setStepParams("buttonSettings","general",{type:"link",icon:null}),[2]})},function(){var e=this,n=arguments;return new Promise(function(r,o){var i=t.apply(e,n);function l(e){_(i,r,o,l,a,"next",e)}function a(e){_(i,r,o,l,a,"throw",e)}l(void 0)})})()}},o().createElement(t.FlowSettingsButton,{icon:o().createElement(n.SettingOutlined,null)},this.translate("Actions")))}},{key:"render",value:function(){var n=this,r=this.context.index,a=this.context.record,c=this.subModels.grid.createFork({},"grid-".concat(r));c.gridContainerRef=o().createRef();var u=(0,t.createRecordMetaFactory)(function(){return c.context.collection},c.context.t("Current record"),function(e){var t,n=e.collection,r=e.record,o=null==n?void 0:n.name,i=null==n?void 0:n.dataSourceKey,l=null==n||null==(t=n.getFilterByTK)?void 0:t.call(n,r);if(o&&null!=l)return{collection:o,dataSourceKey:i,filterByTk:l}});c.context.defineProperty("fieldIndex",{get:function(){return r},cache:!1}),c.context.defineProperty("record",{get:function(){return a},cache:!1,resolveOnServer:!0,meta:u}),c.context.defineProperty("fieldKey",{get:function(){return r}});var s=this.props,f=s.colon,p=s.labelAlign,d=s.labelWidth,b=s.labelWrap,y=s.layout,h=!!this.context.flowSettingsEnabled;return o().createElement("div",{key:this.context.index,style:{width:"100%"},className:(0,l.css)(D())},o().createElement(e.FormComponent,{model:this,layoutProps:{colon:f,labelAlign:p,labelWidth:d,labelWrap:b,layout:y}},o().createElement(t.FlowModelRenderer,{model:c,showFlowSettings:!1})),o().createElement("div",null,o().createElement(t.DndProvider,null,o().createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},o().createElement(i.Space,{wrap:!0},this.mapSubModels("actions",function(e,i){var a=e.createFork({},"".concat(r));if(!a.hidden||h){var c=(0,t.createRecordMetaFactory)(function(){return a.context.collection},a.context.t("Current record"),function(e){var t,n=e.collection,r=e.record,o=null==n?void 0:n.name,i=null==n?void 0:n.dataSourceKey,l=null==n||null==(t=n.getFilterByTK)?void 0:t.call(n,r);if(o&&null!=l)return{collection:o,dataSourceKey:i,filterByTk:l}});return a.context.defineProperty("record",{get:function(){return n.context.record},resolveOnServer:!0,meta:c,cache:!1}),o().createElement(t.Droppable,{model:a,key:a.uid},o().createElement("div",{className:(0,l.css)(z(),0===i?"0px":null)},o().createElement(t.FlowModelRenderer,{model:a,showFlowSettings:{showBackground:!1,showBorder:!1,toolbarPosition:"above"},extraToolbarItems:[{key:"drag-handler",component:t.DragHandler,sort:1}]})))}}),this.renderConfigureAction())))))}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(c.prototype,a),c}(t.FlowModel);function L(e,t,n,r,o,i,l){try{var a=e[i](l),c=a.value}catch(e){n(e);return}a.done?t(c):Promise.resolve(c).then(r,o)}function q(e,t,n){return(q=H()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&K(o,n.prototype),o}).apply(null,arguments)}G.define({createModelOptions:{use:"ListItemModel",subModels:{grid:{use:"DetailsGridModel"}}},sort:350});function N(e){return(N=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function K(e,t){return(K=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function W(e){var t="function"==typeof Map?new Map:void 0;return(W=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return q(e,arguments,N(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),K(n,e)})(e)}function H(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(H=function(){return!!e})()}var $=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function n(){var e,t;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return e=n,t=arguments,e=N(e),function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,H()?Reflect.construct(e,t||[],N(this).constructor):e.apply(this,t))}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&K(n,e),t=[{key:"load",value:function(){var e;return(e=function(){return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},l=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),a=Object.defineProperty;return a(l,"next",{value:c(0)}),a(l,"throw",{value:c(1)}),a(l,"return",{value:c(2)}),"function"==typeof Symbol&&a(l,Symbol.iterator,{value:function(){return this}}),l;function c(a){return function(c){var u=[a,c];if(n)throw TypeError("Generator is already executing.");for(;l&&(l=0,u[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,r=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){i.label=u[1];break}if(6===u[0]&&i.label<o[1]){i.label=o[1],o=u;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=t.call(e,i)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}(this,function(e){return this.flowEngine.registerModels({ListBlockModel:R,ListItemModel:G}),[2]})},function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function l(e){L(i,r,o,l,a,"next",e)}function a(e){L(i,r,o,l,a,"throw",e)}l(void 0)})}).call(this)}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(n.prototype,t),n}(W(e.Plugin))}(),b}()});
10
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("antd"),require("@emotion/css"),require("@nocobase/client"),require("@ant-design/icons"),require("@nocobase/flow-engine")):"function"==typeof define&&define.amd?define("@nocobase/plugin-block-list",["react","antd","@emotion/css","@nocobase/client","@ant-design/icons","@nocobase/flow-engine"],t):"object"==typeof exports?exports["@nocobase/plugin-block-list"]=t(require("react"),require("antd"),require("@emotion/css"),require("@nocobase/client"),require("@ant-design/icons"),require("@nocobase/flow-engine")):e["@nocobase/plugin-block-list"]=t(e.react,e.antd,e["@emotion/css"],e["@nocobase/client"],e["@ant-design/icons"],e["@nocobase/flow-engine"])}(self,function(e,t,n,r,o,i){return function(){"use strict";var l={375:function(e){e.exports=o},477:function(e){e.exports=n},342:function(e){e.exports=r},694:function(e){e.exports=i},59:function(e){e.exports=t},155:function(t){t.exports=e}},a={};function c(e){var t=a[e];if(void 0!==t)return t.exports;var n=a[e]={exports:{}};return l[e](n,n.exports,c),n.exports}c.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return c.d(t,{a:t}),t},c.d=function(e,t){for(var n in t)c.o(t,n)&&!c.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},c.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),c.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},c.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},c.g.importScripts&&(u=c.g.location+"");var u,s=c.g.document;if(!u&&s&&(s.currentScript&&"SCRIPT"===s.currentScript.tagName.toUpperCase()&&(u=s.currentScript.src),!u)){var f=s.getElementsByTagName("script");if(f.length)for(var p=f.length-1;p>-1&&(!u||!/^http(s?):/.test(u));)u=f[p--].src}if(!u)throw Error("Automatic publicPath is not supported in this browser");c.p=u.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/");var d={},b=window.__nocobase_public_path__||"";if(!b&&window.location&&window.location.pathname){var y=window.location.pathname||"/",h=y.indexOf("/v2/");b=h>=0?y.slice(0,h+1):"/"}return b&&(b=b.replace(/\/v2\/?$/,"/")),b||(b="/"),"/"!==b.charAt(b.length-1)&&(b+="/"),c.p=b+"static/plugins/@nocobase/plugin-block-list/dist/client/",!function(){c.r(d),c.d(d,{default:function(){return $}});var e=c(342),t=c(694),n=c(375),r=c(155),o=c.n(r),i=c(59),l=c(477);function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function u(e){return function(e){if(Array.isArray(e))return a(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||s(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){if(e){if("string"==typeof e)return a(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return a(e,t)}}var f=function(e){if(!e)return 0;var t=e.getBoundingClientRect(),n=window.getComputedStyle(e),r=parseFloat(n.marginTop)||0,o=parseFloat(n.marginBottom)||0;return t.height+r+o},p=function(e){var t,n=e.heightMode,o=e.containerRef,i=e.actionsRef,l=e.listRef,a=e.deps,c=void 0===a?[]:a,p=function(e){if(Array.isArray(e))return e}(t=(0,r.useState)())||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],i=!0,l=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),2!==o.length);i=!0);}catch(e){l=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(l)throw n}}return o}}(t)||s(t,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),d=p[0],b=p[1],y=(0,r.useCallback)(function(){if("specifyValue"!==n&&"fullHeight"!==n)return void b(function(e){return void 0===e?e:void 0});var e,t=o.current;if(t){var r=t.getBoundingClientRect().height;if(r){var a=Math.max(0,Math.floor(r-f(i.current)-f(null==(e=l.current)?void 0:e.querySelector(".ant-list-pagination"))));b(function(e){return e===a?e:a})}}},[n,o,i,l]);return(0,r.useLayoutEffect)(function(){y()},[y].concat(u(c))),(0,r.useEffect)(function(){if(o.current&&"u">typeof ResizeObserver){var e,t=o.current,n=i.current,r=null==(e=l.current)?void 0:e.querySelector(".ant-list-pagination"),a=new ResizeObserver(function(){return y()});return a.observe(t),n&&a.observe(n),r&&a.observe(r),function(){return a.disconnect()}}},[y,o,i,l].concat(u(c))),d};function b(e,t,n,r,o,i,l){try{var a=e[i](l),c=a.value}catch(e){n(e);return}a.done?t(c):Promise.resolve(c).then(r,o)}function y(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function l(e){b(i,r,o,l,a,"next",e)}function a(e){b(i,r,o,l,a,"throw",e)}l(void 0)})}}function h(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function g(e,t,n){return(g="u">typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=v(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(n||e):o.value}})(e,t,n||e)}function v(e){return(v=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function m(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){h(e,t,n[t])})}return e}function w(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function O(e,t){return(O=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function S(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function x(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(x=function(){return!!e})()}function P(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},l=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),a=Object.defineProperty;return a(l,"next",{value:c(0)}),a(l,"throw",{value:c(1)}),a(l,"return",{value:c(2)}),"function"==typeof Symbol&&a(l,Symbol.iterator,{value:function(){return this}}),l;function c(a){return function(c){var u=[a,c];if(n)throw TypeError("Generator is already executing.");for(;l&&(l=0,u[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,r=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){i.label=u[1];break}if(6===u[0]&&i.label<o[1]){i.label=o[1],o=u;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=t.call(e,i)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}function j(){var e=S(["\n .ant-pagination-simple-pager {\n display: none !important;\n }\n "]);return j=function(){return e},e}function E(){var e=S(["\n .ant-pagination-item-link {\n min-width: ","px;\n }\n "]);return E=function(){return e},e}function M(){var e=S(["\n .ant-spin-nested-loading {\n height: var(--nb-list-height);\n overflow: auto;\n margin-left: -","px;\n margin-right: -","px;\n padding-left: ","px;\n padding-right: ","px;\n }\n .ant-spin-nested-loading > .ant-spin-container {\n min-height: 100%;\n }\n "]);return M=function(){return e},e}function k(){var e=S(["\n > div {\n width: 100%;\n }\n "]);return k=function(){return e},e}var R=function(r){var a;if("function"!=typeof r&&null!==r)throw TypeError("Super expression must either be null or a function");function c(){var e,t,n;if(!(this instanceof c))throw TypeError("Cannot call a class as a function");return t=c,n=arguments,t=v(t),h(e=function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,x()?Reflect.construct(t,n||[],v(this).constructor):t.apply(this,n)),"_defaultCustomModelClasses",{CollectionActionGroupModel:"CollectionActionGroupModel",RecordActionGroupModel:"RecordActionGroupModel",TableColumnModel:"TableColumnModel",TableAssociationFieldGroupModel:"TableAssociationFieldGroupModel",TableCustomColumnModel:"TableCustomColumnModel"}),e}return c.prototype=Object.create(r&&r.prototype,{constructor:{value:c,writable:!0,configurable:!0}}),r&&O(c,r),a=[{key:"resource",get:function(){return g(v(c.prototype),"resource",this)}},{key:"createResource",value:function(e,n){return this.context.createResource(t.MultiRecordResource)}},{key:"renderConfigureActions",value:function(){return o().createElement(t.AddSubModelButton,{key:"table-column-add-actions",model:this,subModelBaseClass:this.getModelClassName("CollectionActionGroupModel"),subModelKey:"actions"},o().createElement(t.FlowSettingsButton,{icon:o().createElement(n.SettingOutlined,null)},this.translate("Actions")))}},{key:"pagination",value:function(){var t=this,n=this.resource.getMeta("count"),r=this.resource.getPageSize(),i=this.resource.getMeta("hasNext"),a=this.resource.getPage(),c=this.resource.getData();return n?{current:a,pageSize:r,total:n,showTotal:function(e){return t.translate("Total {{count}} items",{count:e})},showSizeChanger:!0,onChange:function(n,r){return y(function(){return P(this,function(t){switch(t.label){case 0:return this.resource.loading=!0,this.resource.setPage(n),this.resource.setPageSize(r),[4,this.resource.refresh()];case 1:return t.sent(),[4,new Promise(function(e){return setTimeout(e,0)})];case 2:return t.sent(),[4,(0,e.dispatchEventDeep)(this,"paginationChange")];case 3:return t.sent(),[2]}})}).call(t)}}:{simple:!0,showTitle:!1,showSizeChanger:!0,hideOnSinglePage:!1,pageSize:r,total:(null==c?void 0:c.length)<r||!i?r*a:r*a+1,className:(0,l.css)(j()),itemRender:function(e,n,r){return"prev"===n?o().createElement("div",{style:{display:"flex"},className:(0,l.css)(E(),t.context.themeToken.controlHeight)},r," ",o().createElement("div",null,t.resource.getPage())):r}}}},{key:"renderActions",value:function(){var e=!!this.context.flowSettingsEnabled;if(e||this.hasSubModel("actions"))return o().createElement(t.DndProvider,null,o().createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:16}},o().createElement(i.Space,null,this.mapSubModels("actions",function(e){return"left"===e.props.position?o().createElement(t.FlowModelRenderer,{key:e.uid,model:e,showFlowSettings:{showBackground:!1,showBorder:!1,toolbarPosition:"above"}}):null}),o().createElement("span",null)),o().createElement(i.Space,{wrap:!0},this.mapSubModels("actions",function(n){if(!n.hidden||e)return"left"!==n.props.position?o().createElement(t.Droppable,{model:n,key:n.uid},o().createElement(t.FlowModelRenderer,{model:n,showFlowSettings:{showBackground:!1,showBorder:!1,toolbarPosition:"above"},extraToolbarItems:[{key:"drag-handler",component:t.DragHandler,sort:1}]})):null}),this.renderConfigureActions())))}},{key:"renderComponent",value:function(){var e=this.decoratorProps,t=e.heightMode,n=e.height;return o().createElement(C,{model:this,heightMode:t,height:n})}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(c.prototype,a),c}(e.CollectionBlockModel);h(R,"scene",e.BlockSceneEnum.many);var C=(0,t.observer)(function(e){var n,a,c,u=e.model,s=e.heightMode,f=e.height,d=(0,r.useRef)(null),b=(0,r.useRef)(null),y=(0,r.useRef)(null),g="specifyValue"===s||"fullHeight"===s,v=u.context.themeToken,O=p({heightMode:s,containerRef:d,actionsRef:b,listRef:y,deps:[f]}),S=(0,r.useMemo)(function(){return(0,l.css)(M(),v.marginLG,v.marginLG,v.marginLG,v.marginLG)},[]),x=(0,r.useMemo)(function(){var e,t;return null==O?null==(e=u.props)?void 0:e.style:w(m({},(null==(t=u.props)?void 0:t.style)||{}),h({},"--nb-list-height","".concat(O,"px")))},[O,null==(n=u.props)?void 0:n.style]);return o().createElement("div",{ref:d,style:g?{display:"flex",flexDirection:"column",minHeight:0,height:"100%"}:void 0},o().createElement("div",{ref:b},u.renderActions()),o().createElement("div",{ref:y,style:{flex:1,minHeight:0}},o().createElement(i.List,w(m({},u.props),{className:(null==(a=u.props)?void 0:a.className)?"".concat(u.props.className," ").concat(S):S,style:x,pagination:u.pagination(),loading:null==(c=u.resource)?void 0:c.loading,dataSource:u.resource.getData(),renderItem:function(e,n){var r=u.subModels.item.createFork({},"".concat(n));return r.context.defineProperty("record",{get:function(){return e},cache:!1}),r.context.defineProperty("index",{get:function(){return n},cache:!1}),o().createElement(i.List.Item,{key:n,className:(0,l.css)(k())},o().createElement(t.FlowModelRenderer,{model:r}))}}))))});function _(e,t,n,r,o,i,l){try{var a=e[i](l),c=a.value}catch(e){n(e);return}a.done?t(c):Promise.resolve(c).then(r,o)}R.registerFlow({key:"resourceSettings2",steps:{}}),R.registerFlow({key:"listSettings",sort:500,title:(0,t.tExpr)("List settings",{ns:"block-list"}),steps:{pageSize:{title:(0,t.tExpr)("Page size"),uiMode:{type:"select",key:"pageSize",props:{options:[{label:"5",value:5},{label:"10",value:10},{label:"20",value:20},{label:"50",value:50},{label:"100",value:100},{label:"200",value:200}]}},defaultParams:{pageSize:20},handler:function(e,t){e.model.resource.loading=!0,e.model.resource.setPage(1),e.model.resource.setPageSize(t.pageSize)}},dataScope:{use:"dataScope",title:(0,t.tExpr)("Data scope")},defaultSorting:{use:"sortingRule",title:(0,t.tExpr)("Default sorting")},layout:{use:"layout",title:(0,t.tExpr)("Layout"),handler:function(e,t){e.model.setProps(w(m({},t),{labelWidth:"vertical"===t.layout?null:t.labelWidth})),e.model.subModels.item.setProps(w(m({},t),{labelWidth:"vertical"===t.layout?"100%":t.labelWidth,labelWrap:"vertical"===t.layout||t.labelWrap}))}},refreshData:{title:(0,t.tExpr)("Refresh data"),handler:function(e,t){return y(function(){return P(this,function(e){return[2]})})()}}}}),R.registerFlow({key:"paginationChange",on:"paginationChange",steps:{linkageRulesRefresh:{use:"linkageRulesRefresh",defaultParams:{actionName:"blockLinkageRules",flowKey:"cardSettings",stepKey:"linkageRules"}}}}),R.define({label:(0,t.tExpr)("List"),group:(0,t.tExpr)("Content"),searchable:!0,searchPlaceholder:(0,t.tExpr)("Search"),createModelOptions:{use:"ListBlockModel",subModels:{item:{use:"ListItemModel"}}},sort:500});function T(e,t,n){return(T="u">typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=A(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(n||e):o.value}})(e,t,n||e)}function A(e){return(A=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function B(e,t){return(B=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function F(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function I(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(I=function(){return!!e})()}function D(){var e=F(["\n .ant-form-item {\n margin-bottom: 5px;\n }\n "]);return D=function(){return e},e}function z(){var e=F(["\n button {\n padding: 5px;\n padding-left: ",";\n }\n "]);return z=function(){return e},e}var G=function(r){var a;if("function"!=typeof r&&null!==r)throw TypeError("Super expression must either be null or a function");function c(){var e,t;if(!(this instanceof c))throw TypeError("Cannot call a class as a function");return e=c,t=arguments,e=A(e),function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,I()?Reflect.construct(e,t||[],A(this).constructor):e.apply(this,t))}return c.prototype=Object.create(r&&r.prototype,{constructor:{value:c,writable:!0,configurable:!0}}),r&&B(c,r),a=[{key:"onInit",value:function(e){T(A(c.prototype),"onInit",this).call(this,e)}},{key:"renderConfigureAction",value:function(){return o().createElement(t.AddSubModelButton,{key:"table-row-actions-add",model:this,subModelBaseClass:this.context.getModelClassName("RecordActionGroupModel"),subModelKey:"actions",afterSubModelInit:function(e){var t;return(t=function(){return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},l=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),a=Object.defineProperty;return a(l,"next",{value:c(0)}),a(l,"throw",{value:c(1)}),a(l,"return",{value:c(2)}),"function"==typeof Symbol&&a(l,Symbol.iterator,{value:function(){return this}}),l;function c(a){return function(c){var u=[a,c];if(n)throw TypeError("Generator is already executing.");for(;l&&(l=0,u[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,r=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){i.label=u[1];break}if(6===u[0]&&i.label<o[1]){i.label=o[1],o=u;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=t.call(e,i)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}(this,function(t){return e.setStepParams("buttonSettings","general",{type:"link",icon:null}),[2]})},function(){var e=this,n=arguments;return new Promise(function(r,o){var i=t.apply(e,n);function l(e){_(i,r,o,l,a,"next",e)}function a(e){_(i,r,o,l,a,"throw",e)}l(void 0)})})()}},o().createElement(t.FlowSettingsButton,{icon:o().createElement(n.SettingOutlined,null)},this.translate("Actions")))}},{key:"render",value:function(){var n=this,r=this.context.index,a=this.context.record,c=this.subModels.grid.createFork({},"grid-".concat(r));c.gridContainerRef=o().createRef();var u=(0,t.createRecordMetaFactory)(function(){return c.context.collection},c.context.t("Current record"),function(e){var t,n=e.collection,r=e.record,o=null==n?void 0:n.name,i=null==n?void 0:n.dataSourceKey,l=null==n||null==(t=n.getFilterByTK)?void 0:t.call(n,r);if(o&&null!=l)return{collection:o,dataSourceKey:i,filterByTk:l}});c.context.defineProperty("fieldIndex",{get:function(){return r},cache:!1}),c.context.defineProperty("record",{get:function(){return a},cache:!1,resolveOnServer:!0,meta:u}),c.context.defineProperty("fieldKey",{get:function(){return r}});var s=this.props,f=s.colon,p=s.labelAlign,d=s.labelWidth,b=s.labelWrap,y=s.layout,h=!!this.context.flowSettingsEnabled;return o().createElement("div",{key:this.context.index,style:{width:"100%"},className:(0,l.css)(D())},o().createElement(e.FormComponent,{model:this,layoutProps:{colon:f,labelAlign:p,labelWidth:d,labelWrap:b,layout:y}},o().createElement(t.FlowModelRenderer,{model:c,showFlowSettings:!1})),o().createElement("div",null,o().createElement(t.DndProvider,null,o().createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},o().createElement(i.Space,{wrap:!0},this.mapSubModels("actions",function(e,i){var a=e.createFork({},"".concat(r));if(!a.hidden||h){var c=(0,t.createRecordMetaFactory)(function(){return a.context.collection},a.context.t("Current record"),function(e){var t,n=e.collection,r=e.record,o=null==n?void 0:n.name,i=null==n?void 0:n.dataSourceKey,l=null==n||null==(t=n.getFilterByTK)?void 0:t.call(n,r);if(o&&null!=l)return{collection:o,dataSourceKey:i,filterByTk:l}});return a.context.defineProperty("record",{get:function(){return n.context.record},resolveOnServer:!0,meta:c,cache:!1}),o().createElement(t.Droppable,{model:a,key:a.uid},o().createElement("div",{className:(0,l.css)(z(),0===i?"0px":null)},o().createElement(t.FlowModelRenderer,{model:a,showFlowSettings:{showBackground:!1,showBorder:!1,toolbarPosition:"above"},extraToolbarItems:[{key:"drag-handler",component:t.DragHandler,sort:1}]})))}}),this.renderConfigureAction())))))}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(c.prototype,a),c}(t.FlowModel);function L(e,t,n,r,o,i,l){try{var a=e[i](l),c=a.value}catch(e){n(e);return}a.done?t(c):Promise.resolve(c).then(r,o)}function q(e,t,n){return(q=H()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&K(o,n.prototype),o}).apply(null,arguments)}G.define({createModelOptions:{use:"ListItemModel",subModels:{grid:{use:"DetailsGridModel"}}},sort:350});function N(e){return(N=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function K(e,t){return(K=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function W(e){var t="function"==typeof Map?new Map:void 0;return(W=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return q(e,arguments,N(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),K(n,e)})(e)}function H(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(H=function(){return!!e})()}var $=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function n(){var e,t;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return e=n,t=arguments,e=N(e),function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,H()?Reflect.construct(e,t||[],N(this).constructor):e.apply(this,t))}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&K(n,e),t=[{key:"load",value:function(){var e;return(e=function(){return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},l=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),a=Object.defineProperty;return a(l,"next",{value:c(0)}),a(l,"throw",{value:c(1)}),a(l,"return",{value:c(2)}),"function"==typeof Symbol&&a(l,Symbol.iterator,{value:function(){return this}}),l;function c(a){return function(c){var u=[a,c];if(n)throw TypeError("Generator is already executing.");for(;l&&(l=0,u[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,r=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){i.label=u[1];break}if(6===u[0]&&i.label<o[1]){i.label=o[1],o=u;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=t.call(e,i)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}(this,function(e){return this.flowEngine.registerModels({ListBlockModel:R,ListItemModel:G}),[2]})},function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function l(e){L(i,r,o,l,a,"next",e)}function a(e){L(i,r,o,l,a,"throw",e)}l(void 0)})}).call(this)}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(n.prototype,t),n}(W(e.Plugin))}(),d}()});
@@ -8,9 +8,9 @@
8
8
  */
9
9
 
10
10
  module.exports = {
11
- "@nocobase/flow-engine": "2.1.0-alpha.10",
12
- "@nocobase/client": "2.1.0-alpha.10",
13
- "@nocobase/server": "2.1.0-alpha.10",
11
+ "@nocobase/flow-engine": "2.1.0-alpha.11",
12
+ "@nocobase/client": "2.1.0-alpha.11",
13
+ "@nocobase/server": "2.1.0-alpha.11",
14
14
  "@ant-design/icons": "5.6.1",
15
15
  "react": "18.2.0",
16
16
  "antd": "5.24.2",
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import type { FlowSchemaContribution } from '@nocobase/flow-engine';
10
+ export declare const flowSchemaContribution: FlowSchemaContribution;
@@ -0,0 +1,435 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
10
+ var __defProp = Object.defineProperty;
11
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12
+ var __getOwnPropNames = Object.getOwnPropertyNames;
13
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
14
+ var __export = (target, all) => {
15
+ for (var name in all)
16
+ __defProp(target, name, { get: all[name], enumerable: true });
17
+ };
18
+ var __copyProps = (to, from, except, desc) => {
19
+ if (from && typeof from === "object" || typeof from === "function") {
20
+ for (let key of __getOwnPropNames(from))
21
+ if (!__hasOwnProp.call(to, key) && key !== except)
22
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
23
+ }
24
+ return to;
25
+ };
26
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
27
+ var flow_schema_contributions_exports = {};
28
+ __export(flow_schema_contributions_exports, {
29
+ flowSchemaContribution: () => flowSchemaContribution
30
+ });
31
+ module.exports = __toCommonJS(flow_schema_contributions_exports);
32
+ const genericFilterSchemaId = "urn:nocobase:schema:plugin-block-list:generic-filter";
33
+ const genericFilterSchema = {
34
+ $id: genericFilterSchemaId,
35
+ definitions: {
36
+ filterCondition: {
37
+ type: "object",
38
+ properties: {
39
+ path: {
40
+ type: "string"
41
+ },
42
+ operator: {
43
+ type: "string"
44
+ },
45
+ value: {},
46
+ noValue: {
47
+ type: "boolean"
48
+ }
49
+ },
50
+ required: ["path"],
51
+ additionalProperties: true,
52
+ allOf: [
53
+ {
54
+ not: {
55
+ required: ["logic"]
56
+ }
57
+ },
58
+ {
59
+ not: {
60
+ required: ["items"]
61
+ }
62
+ }
63
+ ]
64
+ },
65
+ filterGroup: {
66
+ type: "object",
67
+ properties: {
68
+ logic: {
69
+ type: "string",
70
+ enum: ["$and", "$or"]
71
+ },
72
+ items: {
73
+ type: "array",
74
+ items: {
75
+ oneOf: [
76
+ { $ref: `${genericFilterSchemaId}#/definitions/filterCondition` },
77
+ { $ref: `${genericFilterSchemaId}#/definitions/filterGroup` }
78
+ ]
79
+ }
80
+ }
81
+ },
82
+ required: ["logic", "items"],
83
+ additionalProperties: true,
84
+ allOf: [
85
+ {
86
+ not: {
87
+ required: ["path"]
88
+ }
89
+ },
90
+ {
91
+ not: {
92
+ required: ["operator"]
93
+ }
94
+ },
95
+ {
96
+ not: {
97
+ required: ["value"]
98
+ }
99
+ },
100
+ {
101
+ not: {
102
+ required: ["noValue"]
103
+ }
104
+ }
105
+ ]
106
+ }
107
+ },
108
+ type: "object",
109
+ properties: {
110
+ logic: {
111
+ type: "string",
112
+ enum: ["$and", "$or"]
113
+ },
114
+ items: {
115
+ type: "array",
116
+ items: {
117
+ oneOf: [
118
+ { $ref: `${genericFilterSchemaId}#/definitions/filterCondition` },
119
+ { $ref: `${genericFilterSchemaId}#/definitions/filterGroup` }
120
+ ]
121
+ }
122
+ }
123
+ },
124
+ required: ["logic", "items"],
125
+ additionalProperties: true,
126
+ allOf: [
127
+ {
128
+ not: {
129
+ required: ["path"]
130
+ }
131
+ },
132
+ {
133
+ not: {
134
+ required: ["operator"]
135
+ }
136
+ },
137
+ {
138
+ not: {
139
+ required: ["value"]
140
+ }
141
+ },
142
+ {
143
+ not: {
144
+ required: ["noValue"]
145
+ }
146
+ }
147
+ ]
148
+ };
149
+ const sortingRuleParamsSchema = {
150
+ type: "object",
151
+ properties: {
152
+ sort: {
153
+ type: "array",
154
+ items: {
155
+ type: "object",
156
+ properties: {
157
+ field: { type: "string" },
158
+ direction: { type: "string", enum: ["asc", "desc"] }
159
+ },
160
+ required: ["field", "direction"],
161
+ additionalProperties: false
162
+ }
163
+ }
164
+ },
165
+ additionalProperties: false
166
+ };
167
+ const layoutParamsSchema = {
168
+ type: "object",
169
+ properties: {
170
+ layout: {
171
+ type: "string",
172
+ enum: ["vertical", "horizontal"]
173
+ },
174
+ labelAlign: {
175
+ type: "string",
176
+ enum: ["left", "right"]
177
+ },
178
+ labelWidth: { type: ["number", "string", "null"] },
179
+ labelWrap: { type: "boolean" },
180
+ colon: { type: "boolean" }
181
+ },
182
+ required: ["layout"],
183
+ additionalProperties: false
184
+ };
185
+ const genericModelNodeSchema = {
186
+ type: "object",
187
+ required: ["uid", "use"],
188
+ properties: {
189
+ uid: { type: "string" },
190
+ use: { type: "string" }
191
+ },
192
+ additionalProperties: true
193
+ };
194
+ const collectionResourceInitSchema = {
195
+ type: "object",
196
+ properties: {
197
+ dataSourceKey: { type: "string" },
198
+ collectionName: { type: "string" },
199
+ associationName: { type: "string" },
200
+ sourceId: { type: ["string", "number"] },
201
+ filterByTk: { type: ["string", "number"] }
202
+ },
203
+ required: ["dataSourceKey", "collectionName"],
204
+ additionalProperties: true
205
+ };
206
+ const collectionResourceSettingsStepParamsSchema = {
207
+ type: "object",
208
+ properties: {
209
+ resourceSettings: {
210
+ type: "object",
211
+ properties: {
212
+ init: collectionResourceInitSchema
213
+ },
214
+ additionalProperties: true
215
+ }
216
+ },
217
+ additionalProperties: true
218
+ };
219
+ const createCollectionResourceStepParams = (init = {}, extraStepParams = {}) => ({
220
+ resourceSettings: {
221
+ init: {
222
+ dataSourceKey: "main",
223
+ collectionName: "users",
224
+ ...init
225
+ }
226
+ },
227
+ ...extraStepParams
228
+ });
229
+ const createAssociatedCollectionPattern = (use, extraStepParams = {}) => ({
230
+ title: "Associated records in popup/new scene",
231
+ description: "Use associationName + sourceId when the block should load records through a parent relation.",
232
+ snippet: {
233
+ use,
234
+ stepParams: createCollectionResourceStepParams(
235
+ {
236
+ collectionName: "roles",
237
+ associationName: "users.roles",
238
+ sourceId: "{{ctx.view.inputArgs.sourceId}}"
239
+ },
240
+ extraStepParams
241
+ )
242
+ }
243
+ });
244
+ const listItemModelInternalSchemaContribution = {
245
+ use: "ListItemModel",
246
+ title: "List item",
247
+ source: "plugin",
248
+ strict: false,
249
+ exposure: "internal",
250
+ subModelSlots: {
251
+ grid: {
252
+ type: "object",
253
+ use: "DetailsGridModel",
254
+ description: "Per-record details grid."
255
+ }
256
+ },
257
+ skeleton: {
258
+ uid: "todo-list-item-uid",
259
+ use: "ListItemModel",
260
+ subModels: {
261
+ grid: {
262
+ uid: "todo-list-item-grid-uid",
263
+ use: "DetailsGridModel"
264
+ }
265
+ }
266
+ }
267
+ };
268
+ const listBlockModelSchemaContribution = {
269
+ use: "ListBlockModel",
270
+ title: "List block",
271
+ source: "plugin",
272
+ strict: false,
273
+ stepParamsSchema: {
274
+ type: "object",
275
+ properties: {
276
+ ...collectionResourceSettingsStepParamsSchema.properties || {},
277
+ resourceSettings2: {
278
+ type: "object",
279
+ additionalProperties: true
280
+ },
281
+ listSettings: {
282
+ type: "object",
283
+ properties: {
284
+ pageSize: {
285
+ type: "object",
286
+ properties: {
287
+ pageSize: {
288
+ type: "number",
289
+ enum: [5, 10, 20, 50, 100, 200]
290
+ }
291
+ },
292
+ additionalProperties: false
293
+ },
294
+ dataScope: {
295
+ type: "object",
296
+ properties: {
297
+ filter: genericFilterSchema
298
+ },
299
+ additionalProperties: false
300
+ },
301
+ defaultSorting: sortingRuleParamsSchema,
302
+ layout: layoutParamsSchema
303
+ },
304
+ additionalProperties: true
305
+ },
306
+ paginationChange: {
307
+ type: "object",
308
+ properties: {
309
+ linkageRulesRefresh: {
310
+ type: "object",
311
+ properties: {
312
+ actionName: { type: "string" },
313
+ flowKey: { type: "string" },
314
+ stepKey: { type: "string" }
315
+ },
316
+ required: ["actionName", "flowKey"],
317
+ additionalProperties: false
318
+ }
319
+ },
320
+ additionalProperties: true
321
+ }
322
+ },
323
+ additionalProperties: true
324
+ },
325
+ subModelSlots: {
326
+ item: {
327
+ type: "object",
328
+ use: "ListItemModel",
329
+ description: "List item layout."
330
+ },
331
+ actions: {
332
+ type: "array",
333
+ dynamic: true,
334
+ schema: genericModelNodeSchema,
335
+ description: "List actions depend on runtime collection-action registries."
336
+ }
337
+ },
338
+ skeleton: {
339
+ uid: "todo-uid",
340
+ use: "ListBlockModel",
341
+ stepParams: createCollectionResourceStepParams(
342
+ {},
343
+ {
344
+ listSettings: {
345
+ pageSize: {
346
+ pageSize: 20
347
+ }
348
+ }
349
+ }
350
+ ),
351
+ subModels: {
352
+ item: {
353
+ uid: "todo-list-item-uid",
354
+ use: "ListItemModel"
355
+ },
356
+ actions: []
357
+ }
358
+ },
359
+ docs: {
360
+ minimalExample: {
361
+ uid: "list-users",
362
+ use: "ListBlockModel",
363
+ stepParams: createCollectionResourceStepParams(
364
+ {},
365
+ {
366
+ listSettings: {
367
+ pageSize: {
368
+ pageSize: 20
369
+ }
370
+ }
371
+ }
372
+ ),
373
+ subModels: {
374
+ item: {
375
+ uid: "list-item-users",
376
+ use: "ListItemModel"
377
+ },
378
+ actions: []
379
+ }
380
+ },
381
+ commonPatterns: [
382
+ {
383
+ title: "Basic list block",
384
+ snippet: {
385
+ use: "ListBlockModel",
386
+ stepParams: createCollectionResourceStepParams(
387
+ {},
388
+ {
389
+ listSettings: {
390
+ pageSize: {
391
+ pageSize: 20
392
+ }
393
+ }
394
+ }
395
+ )
396
+ }
397
+ },
398
+ createAssociatedCollectionPattern("ListBlockModel", {
399
+ listSettings: {
400
+ pageSize: {
401
+ pageSize: 20
402
+ }
403
+ }
404
+ })
405
+ ],
406
+ dynamicHints: [
407
+ {
408
+ kind: "dynamic-children",
409
+ path: "ListBlockModel.subModels.actions",
410
+ message: "List actions depend on runtime collection-action registries.",
411
+ "x-flow": {
412
+ slotRules: {
413
+ slotKey: "actions",
414
+ type: "array"
415
+ },
416
+ contextRequirements: ["collection action registry"],
417
+ unresolvedReason: "runtime-list-actions"
418
+ }
419
+ }
420
+ ]
421
+ }
422
+ };
423
+ const flowSchemaContribution = {
424
+ inventory: {
425
+ publicTreeRoots: ["ListBlockModel"]
426
+ },
427
+ models: [listItemModelInternalSchemaContribution, listBlockModelSchemaContribution],
428
+ defaults: {
429
+ source: "plugin"
430
+ }
431
+ };
432
+ // Annotate the CommonJS export names for ESM import in node:
433
+ 0 && (module.exports = {
434
+ flowSchemaContribution
435
+ });
@@ -6,9 +6,11 @@
6
6
  * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
+ import type { FlowSchemaContribution } from '@nocobase/flow-engine';
9
10
  import { Plugin } from '@nocobase/server';
10
11
  export declare class PluginBlockListServer extends Plugin {
11
12
  afterAdd(): Promise<void>;
13
+ getFlowSchemaContributions(): FlowSchemaContribution;
12
14
  beforeLoad(): Promise<void>;
13
15
  load(): Promise<void>;
14
16
  install(): Promise<void>;
@@ -31,9 +31,13 @@ __export(plugin_exports, {
31
31
  });
32
32
  module.exports = __toCommonJS(plugin_exports);
33
33
  var import_server = require("@nocobase/server");
34
+ var import_flow_schema_contributions = require("./flow-schema-contributions");
34
35
  class PluginBlockListServer extends import_server.Plugin {
35
36
  async afterAdd() {
36
37
  }
38
+ getFlowSchemaContributions() {
39
+ return import_flow_schema_contributions.flowSchemaContribution;
40
+ }
37
41
  async beforeLoad() {
38
42
  }
39
43
  async load() {
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "displayName.zh-CN": "区块:列表",
5
5
  "description": "Display data in a list with pagination support.",
6
6
  "description.zh-CN": "以列表形式展示数据,支持分页设置",
7
- "version": "2.1.0-alpha.10",
7
+ "version": "2.1.0-alpha.11",
8
8
  "license": "Apache-2.0",
9
9
  "main": "./dist/server/index.js",
10
10
  "homepage": "https://docs.nocobase.com/handbook/block-list",
@@ -17,5 +17,5 @@
17
17
  "keywords": [
18
18
  "Blocks"
19
19
  ],
20
- "gitHead": "ce790d46c0a5768ca9618c7d0d77ab8300de75c8"
20
+ "gitHead": "bb96d633a6371afb586072ff516bd0613c757db0"
21
21
  }