@nocobase/plugin-block-grid-card 2.1.0-beta.24 → 2.1.0-beta.26

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/client-v2.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export * from './dist/client-v2';
2
+ export { default } from './dist/client-v2';
package/client-v2.js ADDED
@@ -0,0 +1 @@
1
+ module.exports = require('./dist/client-v2/index.js');
@@ -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
+
10
+ "use strict";(self.webpackChunk_nocobase_plugin_block_grid_card=self.webpackChunk_nocobase_plugin_block_grid_card||[]).push([["17"],{680:function(e,t,r){r.r(t),r.d(t,{GridCardBlockModel:function(){return j}});var n=r(694),o=r(375),i=r(485),l=r(155),a=r.n(l),c=r(59),u=r(477),s={xs:"Phone device",md:"Tablet device",lg:"Desktop device",xxl:"Large screen device"},d=["xs","md","lg","xxl"],f=[1,2,3,4,6,8,12,24].reduce(function(e,t){return e[t]=t,e},{}),p={xs:"< 768",md:"≥ 768",lg:"≥ 992",xxl:"≥ 1600"},m=JSON.parse('{"UU":"@nocobase/plugin-block-grid-card"}');function g(e){return(0,n.tExpr)(e,{ns:[m.UU,"client"]})}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function b(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function y(e,t,r){return(y="u">typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=v(e)););return e}(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(r||e):o.value}})(e,t,r||e)}function v(e){return(v=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function S(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){b(e,t,r[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 r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}function C(e,t){return(C=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function O(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function x(e){return function(e){if(Array.isArray(e))return h(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||P(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 P(e,t){if(e){if("string"==typeof e)return h(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return h(e,t)}}function M(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(M=function(){return!!e})()}function k(){var e=O(["\n .ant-spin-nested-loading {\n height: var(--nb-grid-card-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 k=function(){return e},e}function R(){var e=O(["\n height: 100%;\n > div {\n height: 100%;\n }\n "]);return R=function(){return e},e}var j=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function r(){var e,t,n;if(!(this instanceof r))throw TypeError("Cannot call a class as a function");return t=r,n=arguments,t=v(t),b(e=function(e,t){var r;if(t&&("object"==((r=t)&&"u">typeof Symbol&&r.constructor===Symbol?"symbol":typeof r)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,M()?Reflect.construct(t,n||[],v(this).constructor):t.apply(this,n)),"_screens",void 0),b(e,"_defaultCustomModelClasses",{CollectionActionGroupModel:"CollectionActionGroupModel",RecordActionGroupModel:"RecordActionGroupModel",TableColumnModel:"TableColumnModel",TableAssociationFieldGroupModel:"TableAssociationFieldGroupModel",TableCustomColumnModel:"TableCustomColumnModel"}),e}return r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),e&&C(r,e),t=[{key:"resource",get:function(){return y(v(r.prototype),"resource",this)}},{key:"useHooksBeforeRender",value:function(){var e=c.Grid.useBreakpoint();this._screens=["xxl","lg","md","xs"].find(function(t){return e[t]})||"lg"}},{key:"createResource",value:function(e,t){return this.context.createResource(n.MultiRecordResource)}},{key:"renderConfiguireActions",value:function(){return a().createElement(n.AddSubModelButton,{key:"table-column-add-actions",model:this,subModelBaseClass:this.getModelClassName("CollectionActionGroupModel"),subModelKey:"actions"},a().createElement(n.FlowSettingsButton,{icon:a().createElement(o.SettingOutlined,null)},this.translate("Actions")))}},{key:"pagination",value:function(){var e,t=this,r=this.resource.getMeta("count"),n=this.resource.getPageSize(),o=this.resource.getMeta("hasNext"),l=this.resource.getPage(),a=this.resource.getData(),c=(null==(e=this.props.columnCount)?void 0:e[this._screens])||1,u=this.props.rowCount||1,s=!!this.context.isMobileLayout,d=[1,2,3,5,10].map(function(e){return c*u*e});if(r)return(0,i.applyMobilePaginationProps)({current:l,pageSize:n,total:r,pageSizeOptions:d,showTotal:function(e){return t.translate("Total {{count}} items",{count:e})},showSizeChanger:!0,onChange:function(e,r){t.resource.loading=!0,t.resource.setPage(e),t.resource.setPageSize(r),t.resource.refresh()}},s);var f=n||10,p=l||1,m={simple:!0,showTitle:!1,showSizeChanger:!0,hideOnSinglePage:!1,pageSize:f,total:(0,i.getUnknownCountPaginationTotal)({dataLength:null==a?void 0:a.length,pageSize:f,current:p,hasNext:o}),className:(0,i.mergePaginationClassName)((0,i.getSimpleModePaginationClassName)(!0),void 0),itemRender:(0,i.createCompactSimpleItemRender)({current:p,controlHeight:this.context.themeToken.controlHeight})};return(0,i.applyMobilePaginationProps)(m,s)}},{key:"renderComponent",value:function(){var e=this.decoratorProps,t=e.heightMode,r=e.height;return a().createElement(B,{model:this,heightMode:t,height:r})}}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(r.prototype,t),r}(i.CollectionBlockModel);b(j,"scene",i.BlockSceneEnum.many);var E=function(e){if(!e)return 0;var t=e.getBoundingClientRect(),r=window.getComputedStyle(e),n=parseFloat(r.marginTop)||0,o=parseFloat(r.marginBottom)||0;return t.height+n+o},_=function(e){var t,r=e.heightMode,n=e.containerRef,o=e.actionsRef,i=e.listRef,a=e.deps,c=void 0===a?[]:a,u=function(e){if(Array.isArray(e))return e}(t=(0,l.useState)())||function(e){var t,r,n=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(t=n.next()).done)&&(o.push(t.value),2!==o.length);i=!0);}catch(e){l=!0,r=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw r}}return o}}(t)||P(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.")}(),s=u[0],d=u[1],f=(0,l.useCallback)(function(){if("specifyValue"!==r&&"fullHeight"!==r)return void d(function(e){return void 0===e?e:void 0});var e,t=n.current;if(t){var l=t.getBoundingClientRect().height;if(l){var a=Math.max(0,Math.floor(l-E(o.current)-E(null==(e=i.current)?void 0:e.querySelector(".ant-list-pagination"))));d(function(e){return e===a?e:a})}}},[r,n,o,i]);return(0,l.useLayoutEffect)(function(){f()},[f].concat(x(c))),(0,l.useEffect)(function(){if(n.current&&"u">typeof ResizeObserver){var e,t=n.current,r=o.current,l=null==(e=i.current)?void 0:e.querySelector(".ant-list-pagination"),a=new ResizeObserver(function(){return f()});return a.observe(t),r&&a.observe(r),l&&a.observe(l),function(){return a.disconnect()}}},[f,n,o,i].concat(x(c))),s},B=(0,n.observer)(function(e){var t,r,o,i=e.model,s=e.heightMode,d=e.height,f=(0,l.useRef)(null),p=(0,l.useRef)(null),m=(0,l.useRef)(null),g="specifyValue"===s||"fullHeight"===s,h=i.context.themeToken,y=_({heightMode:s,containerRef:f,actionsRef:p,listRef:m,deps:[d]}),v=(0,l.useMemo)(function(){return(0,u.css)(k(),h.marginLG,h.marginLG,h.marginLG,h.marginLG)},[]),C=(0,l.useMemo)(function(){var e,t;return null==y?null==(e=i.props)?void 0:e.style:w(S({},(null==(t=i.props)?void 0:t.style)||{}),b({},"--nb-grid-card-height","".concat(y,"px")))},[y,null==(t=i.props)?void 0:t.style]),O=!!i.context.flowSettingsEnabled,x=i.props.columnCount;return a().createElement("div",{ref:f,style:g?{display:"flex",flexDirection:"column",minHeight:0,height:"100%"}:void 0},a().createElement("div",{ref:p},a().createElement(n.DndProvider,null,a().createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:16}},a().createElement(c.Space,{wrap:!0},i.mapSubModels("actions",function(e){return"left"===e.props.position?a().createElement(n.FlowModelRenderer,{key:e.uid,model:e,showFlowSettings:{showBackground:!1,showBorder:!1,toolbarPosition:"above"}}):null}),a().createElement("span",null)),a().createElement(c.Space,{wrap:!0},i.mapSubModels("actions",function(e){if(!e.hidden||O)return"left"!==e.props.position?a().createElement(n.Droppable,{model:e,key:e.uid},a().createElement(n.FlowModelRenderer,{model:e,showFlowSettings:{showBackground:!1,showBorder:!1,toolbarPosition:"above"},extraToolbarItems:[{key:"drag-handler",component:n.DragHandler,sort:1}]})):null}),i.renderConfiguireActions())))),a().createElement("div",{ref:m,style:{flex:1,minHeight:0}},a().createElement(c.List,w(S({},i.props),{className:(null==(r=i.props)?void 0:r.className)?"".concat(i.props.className," ").concat(v):v,style:C,pagination:i.pagination(),loading:null==(o=i.resource)?void 0:o.loading,dataSource:i.resource.getData(),grid:w(S({},x),{sm:x.xs,xl:x.lg,gutter:[h.marginBlock/2,h.marginBlock/2]}),renderItem:function(e,t){var r=i.subModels.item.createFork({},"".concat(t));return r.context.defineProperty("record",{get:function(){return e},cache:!1,resolveOnServer:!0}),r.context.defineProperty("index",{get:function(){return t},cache:!1,resolveOnServer:!0}),a().createElement(c.Col,{className:(0,u.css)(R())},a().createElement(n.FlowModelRenderer,{model:r}))}}))))});j.registerFlow({key:"resourceSettings2",steps:{}}),j.registerFlow({key:"GridCardSettings",sort:500,title:g("Grid card block settings"),steps:{columnCount:{title:g("Set the count of columns displayed in a row"),uiSchema:function(e){var t=e.t,r={"x-component":c.Slider,"x-decorator":"FormItem","x-component-props":{min:1,max:24,marks:f,tooltip:{formatter:function(e){return"".concat(e).concat(t("Column"))}},step:null}};return{columnCount:{type:"object",properties:d.reduce(function(e,n){return e[n]=w(S({},r),{title:t(s[n]),description:"".concat(t("Screen size")," ").concat(p[n]," ").concat(t("pixels"))}),e},{})}}},defaultParams:{columnCount:{xs:1,md:2,lg:3,xxl:4}},handler:function(e,t){e.model.setProps({columnCount:t.columnCount})}},rowCount:{title:g("Number of Rows"),uiSchema:{rowCount:{"x-component":c.InputNumber,"x-decorator":"FormItem"}},defaultParams:{rowCount:3},handler:function(e,t){e.model.resource.loading=!0,e.model.resource.setPage(1);var r=t.rowCount*e.model.props.columnCount[e.model._screens];e.model.resource.getPageSize()!==r&&e.model.resource.setPageSize(r)}},dataScope:{use:"dataScope",title:g("Data scope")},defaultSorting:{use:"sortingRule",title:g("Default sorting")},layout:{use:"layout",title:g("Layout"),handler:function(e,t){e.model.setProps(w(S({},t),{labelWidth:"vertical"===t.layout?null:t.labelWidth})),e.model.subModels.item.setProps(w(S({},t),{labelWidth:"vertical"===t.layout?"100%":t.labelWidth,labelWrap:"vertical"===t.layout||t.labelWrap}))}}}}),j.define({label:g("Grid card"),searchable:!0,searchPlaceholder:g("Search"),createModelOptions:{use:"GridCardBlockModel",subModels:{item:{use:"GridCardItemModel"}}},sort:500})}}]);
@@ -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
+
10
+ "use strict";(self.webpackChunk_nocobase_plugin_block_grid_card=self.webpackChunk_nocobase_plugin_block_grid_card||[]).push([["812"],{39:function(e,t,n){n.r(t),n.d(t,{GridCardItemModel:function(){return w}});var r=n(694),o=n(155),l=n.n(o),c=n(477),a=n(375),i=n(485),u=n(59);function s(e,t,n,r,o,l,c){try{var a=e[l](c),i=a.value}catch(e){n(e);return}a.done?t(i):Promise.resolve(i).then(r,o)}function f(e,t,n){return(f="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=d(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 d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function p(e,t){return(p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function y(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function b(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(b=function(){return!!e})()}function h(){var e=y(["\n height: 100%;\n .ant-card-body {\n height: 100%;\n }\n .ant-form-item {\n margin-bottom: 5px;\n }\n "]);return h=function(){return e},e}function v(){var e=y(["\n button {\n padding: 5px;\n }\n "]);return v=function(){return e},e}function g(){var e=y(["\n button {\n padding: 5px;\n padding-left: ",";\n }\n "]);return g=function(){return e},e}var m=new WeakMap,w=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=d(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,b()?Reflect.construct(e,t||[],d(this).constructor):e.apply(this,t))}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&p(n,e),t=[{key:"onInit",value:function(e){f(d(n.prototype),"onInit",this).call(this,e)}},{key:"renderConfigureAction",value:function(){return l().createElement(r.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,l={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),a=Object.defineProperty;return a(c,"next",{value:i(0)}),a(c,"throw",{value:i(1)}),a(c,"return",{value:i(2)}),"function"==typeof Symbol&&a(c,Symbol.iterator,{value:function(){return this}}),c;function i(a){return function(i){var u=[a,i];if(n)throw TypeError("Generator is already executing.");for(;c&&(c=0,u[0]&&(l=0)),l;)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 l.label++,{value:u[1],done:!1};case 5:l.label++,r=u[1],u=[0];continue;case 7:u=l.ops.pop(),l.trys.pop();continue;default:if(!(o=(o=l.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){l=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){l.label=u[1];break}if(6===u[0]&&l.label<o[1]){l.label=o[1],o=u;break}if(o&&l.label<o[2]){l.label=o[2],l.ops.push(u);break}o[2]&&l.ops.pop(),l.trys.pop();continue}u=t.call(e,l)}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 l=t.apply(e,n);function c(e){s(l,r,o,c,a,"next",e)}function a(e){s(l,r,o,c,a,"throw",e)}c(void 0)})})()}},l().createElement(r.FlowSettingsButton,{icon:l().createElement(a.SettingOutlined,null)},this.translate("Actions")))}},{key:"render",value:function(){var e=this,t=this.context.index,n=this.context.record,o=this.subModels.grid.createFork({},"grid-".concat(t));o.gridContainerRef=l().createRef();var a=(0,r.createRecordMetaFactory)(function(){return o.context.collection},o.context.t("Current record"),function(e){var t,n=e.collection,r=e.record,o=null==n?void 0:n.name,l=null==n?void 0:n.dataSourceKey,c=null==n||null==(t=n.getFilterByTK)?void 0:t.call(n,r);if(o&&null!=c)return{collection:o,dataSourceKey:l,filterByTk:c}});o.context.defineProperty("fieldIndex",{get:function(){return t},cache:!1}),o.context.defineProperty("record",{get:function(){return n},cache:!1,resolveOnServer:!0,meta:a}),o.context.defineProperty("fieldKey",{get:function(){return t}});var s=this.props,f=s.colon,d=s.labelAlign,p=s.labelWidth,y=s.labelWrap,b=s.layout,w=!!this.context.flowSettingsEnabled;return l().createElement(u.Card,{role:"button",className:(0,c.css)(h())},l().createElement("div",{style:{display:"flex",width:"100%",height:"100%",flexDirection:"column",justifyContent:"space-between",gap:"0px"}},l().createElement(i.FormComponent,{model:this,layoutProps:{colon:f,labelAlign:d,labelWidth:p,labelWrap:y,layout:b}},l().createElement(r.FlowModelRenderer,{model:o,showFlowSettings:!1})),l().createElement("div",null,l().createElement(r.DndProvider,null,l().createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},l().createElement(u.Space,{className:(0,c.css)(v()),wrap:!0},this.mapSubModels("actions",function(o,a){var i,u,s,f="".concat(t),d=(null==(s=e.context.collection)||null==(u=s.getFilterByTK)?void 0:u.call(s,n))||"".concat(null!=(i=null==n?void 0:n.id)?i:"","-").concat(f),p=o.getFork(f);p&&m.get(p)!==d&&p.dispose();var y=o.createFork({},f);if(m.set(y,d),y.invalidateFlowCache("beforeRender"),!y.hidden||w){var b=(0,r.createRecordMetaFactory)(function(){return y.context.collection},y.context.t("Current record"),function(e){var t,n=e.collection,r=e.record,o=null==n?void 0:n.name,l=null==n?void 0:n.dataSourceKey,c=null==n||null==(t=n.getFilterByTK)?void 0:t.call(n,r);if(o&&null!=c)return{collection:o,dataSourceKey:l,filterByTk:c}});return y.context.defineProperty("record",{get:function(){return e.context.record},resolveOnServer:!0,meta:b,cache:!1}),l().createElement(r.Droppable,{model:y,key:y.uid},l().createElement("div",{className:(0,c.css)(g(),0===a?"0px":null)},l().createElement(r.FlowModelRenderer,{model:y,inputArgs:n,showFlowSettings:{showBackground:!1,showBorder:!1,toolbarPosition:"above"},extraToolbarItems:[{key:"drag-handler",component:r.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)}}(n.prototype,t),n}(r.FlowModel);w.define({createModelOptions:{use:"GridCardItemModel",subModels:{grid:{use:"DetailsGridModel"}}},sort:350})}}]);
@@ -0,0 +1,9 @@
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
+ export { default } from './plugin';
@@ -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
+
10
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@emotion/css"),require("@nocobase/client-v2"),require("react"),require("antd"),require("@ant-design/icons"),require("@nocobase/flow-engine")):"function"==typeof define&&define.amd?define("@nocobase/plugin-block-grid-card",["@emotion/css","@nocobase/client-v2","react","antd","@ant-design/icons","@nocobase/flow-engine"],t):"object"==typeof exports?exports["@nocobase/plugin-block-grid-card"]=t(require("@emotion/css"),require("@nocobase/client-v2"),require("react"),require("antd"),require("@ant-design/icons"),require("@nocobase/flow-engine")):e["@nocobase/plugin-block-grid-card"]=t(e["@emotion/css"],e["@nocobase/client-v2"],e.react,e.antd,e["@ant-design/icons"],e["@nocobase/flow-engine"])}(self,function(e,t,n,r,o,i){return function(){"use strict";var c,u,a,l={375:function(e){e.exports=o},477:function(t){t.exports=e},485:function(e){e.exports=t},694:function(e){e.exports=i},59:function(e){e.exports=r},155:function(e){e.exports=n}},f={};function s(e){var t=f[e];if(void 0!==t)return t.exports;var n=f[e]={exports:{}};return l[e](n,n.exports,s),n.exports}s.m=l,s.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(t,{a:t}),t},s.d=function(e,t){for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},s.f={},s.e=function(e){return Promise.all(Object.keys(s.f).reduce(function(t,n){return s.f[n](e,t),t},[]))},s.u=function(e){return""+e+"."+({17:"3d87b3dc2d1bfc18",812:"94f3ccac19193d05"})[e]+".js"},s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},p={},s.l=function(e,t,n,r){if(p[e])return void p[e].push(t);if(void 0!==n)for(var o,i,c=document.getElementsByTagName("script"),u=0;u<c.length;u++){var a=c[u];if(a.getAttribute("src")==e||a.getAttribute("data-rspack")=="@nocobase/plugin-block-grid-card:"+n){o=a;break}}o||(i=!0,(o=document.createElement("script")).timeout=120,s.nc&&o.setAttribute("nonce",s.nc),o.setAttribute("data-rspack","@nocobase/plugin-block-grid-card:"+n),o.src=e),p[e]=[t];var l=function(t,n){o.onerror=o.onload=null,clearTimeout(f);var r=p[e];if(delete p[e],o.parentNode&&o.parentNode.removeChild(o),r&&r.forEach(function(e){return e(n)}),t)return t(n)},f=setTimeout(l.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=l.bind(null,o.onerror),o.onload=l.bind(null,o.onload),i&&document.head.appendChild(o)},s.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.g.importScripts&&(d=s.g.location+"");var p,d,b=s.g.document;if(!d&&b&&(b.currentScript&&"SCRIPT"===b.currentScript.tagName.toUpperCase()&&(d=b.currentScript.src),!d)){var h=b.getElementsByTagName("script");if(h.length)for(var v=h.length-1;v>-1&&(!d||!/^http(s?):/.test(d));)d=h[v--].src}if(!d)throw Error("Automatic publicPath is not supported in this browser");s.p=d.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),c={889:0},s.f.j=function(e,t){var n=s.o(c,e)?c[e]:void 0;if(0!==n)if(n)t.push(n[2]);else{var r=new Promise(function(t,r){n=c[e]=[t,r]});t.push(n[2]=r);var o=s.p+s.u(e),i=Error();s.l(o,function(t){if(s.o(c,e)&&(0!==(n=c[e])&&(c[e]=void 0),n)){var r=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;i.message="Loading chunk "+e+" failed.\n("+r+": "+o+")",i.name="ChunkLoadError",i.type=r,i.request=o,n[1](i)}},"chunk-"+e,e)}},u=function(e,t){var n,r,o=t[0],i=t[1],u=t[2],a=0;if(o.some(function(e){return 0!==c[e]})){for(n in i)s.o(i,n)&&(s.m[n]=i[n]);u&&u(s)}for(e&&e(t);a<o.length;a++)r=o[a],s.o(c,r)&&c[r]&&c[r][0](),c[r]=0},(a=self.webpackChunk_nocobase_plugin_block_grid_card=self.webpackChunk_nocobase_plugin_block_grid_card||[]).forEach(u.bind(null,0)),a.push=u.bind(null,a.push.bind(a));var g={};return!function(){var e="",t="u">typeof document?document.currentScript:null;if(t&&t.src&&(e=t.src.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/")),!e){var n=window.__webpack_public_path__||"";n&&("/"!==n.charAt(n.length-1)&&(n+="/"),e=n+"static/plugins/@nocobase/plugin-block-grid-card/dist/client-v2/")}if(!e){if(!(e=window.__nocobase_public_path__||"")&&window.location&&window.location.pathname){var r=window.location.pathname||"/",o=r.indexOf("/v2/");e=o>=0?r.slice(0,o+1):"/"}e&&(e=e.replace(/\/v2\/?$/,"/")),e||(e="/"),"/"!==e.charAt(e.length-1)&&(e+="/"),e+="static/plugins/@nocobase/plugin-block-grid-card/dist/client-v2/"}s.p=e}(),!function(){s.r(g),s.d(g,{default:function(){return u}});var e=s(485);function t(e,t,n,r,o,i,c){try{var u=e[i](c),a=u.value}catch(e){n(e);return}u.done?t(a):Promise.resolve(a).then(r,o)}function n(e,t,r){return(n=c()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&o(i,n.prototype),i}).apply(null,arguments)}function r(e){return(r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function o(e,t){return(o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function i(e){var t="function"==typeof Map?new Map:void 0;return(i=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,i)}function i(){return n(e,arguments,r(this).constructor)}return i.prototype=Object.create(e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),o(i,e)})(e)}function c(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(c=function(){return!!e})()}var u=function(e){var n;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function i(){var e,t;if(!(this instanceof i))throw TypeError("Cannot call a class as a function");return e=i,t=arguments,e=r(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,c()?Reflect.construct(e,t||[],r(this).constructor):e.apply(this,t))}return i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),e&&o(i,e),n=[{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:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(c,"next",{value:a(0)}),u(c,"throw",{value:a(1)}),u(c,"return",{value:a(2)}),"function"==typeof Symbol&&u(c,Symbol.iterator,{value:function(){return this}}),c;function a(u){return function(a){var l=[u,a];if(n)throw TypeError("Generator is already executing.");for(;c&&(c=0,l[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,r=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e],r=0}finally{n=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}(this,function(e){return this.flowEngine.registerModelLoaders({GridCardBlockModel:{loader:function(){return s.e("17").then(s.bind(s,680))}},GridCardItemModel:{loader:function(){return s.e("812").then(s.bind(s,39))}}}),[2]})},function(){var n=this,r=arguments;return new Promise(function(o,i){var c=e.apply(n,r);function u(e){t(c,o,i,u,a,"next",e)}function a(e){t(c,o,i,u,a,"throw",e)}u(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)}}(i.prototype,n),i}(i(e.Plugin))}(),g}()});
@@ -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
+ export declare function useT(): (str: string) => string;
10
+ export declare function tExpr(key: string): string;
@@ -0,0 +1,36 @@
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 { MultiRecordResource } from '@nocobase/flow-engine';
10
+ import { CollectionBlockModel, ActionModel } from '@nocobase/client-v2';
11
+ import React from 'react';
12
+ import { GridCardItemModel } from './GridCardItemModel';
13
+ type GridBlockModelStructure = {
14
+ subModels: {
15
+ item: GridCardItemModel;
16
+ actions: ActionModel[];
17
+ };
18
+ };
19
+ export declare class GridCardBlockModel extends CollectionBlockModel<GridBlockModelStructure> {
20
+ static scene: import("@nocobase/client-v2").BlockSceneType;
21
+ _screens: any;
22
+ _defaultCustomModelClasses: {
23
+ CollectionActionGroupModel: string;
24
+ RecordActionGroupModel: string;
25
+ TableColumnModel: string;
26
+ TableAssociationFieldGroupModel: string;
27
+ TableCustomColumnModel: string;
28
+ };
29
+ get resource(): MultiRecordResource<any>;
30
+ useHooksBeforeRender(): void;
31
+ createResource(ctx: any, params: any): MultiRecordResource<unknown>;
32
+ renderConfiguireActions(): React.JSX.Element;
33
+ pagination(): import("antd").PaginationProps;
34
+ renderComponent(): React.JSX.Element;
35
+ }
36
+ export {};
@@ -0,0 +1,23 @@
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 { FlowModel } from '@nocobase/flow-engine';
10
+ import React from 'react';
11
+ import { DetailsGridModel, ActionModel } from '@nocobase/client-v2';
12
+ type GridItemModelStructure = {
13
+ subModels: {
14
+ grid: DetailsGridModel;
15
+ actions: ActionModel[];
16
+ };
17
+ };
18
+ export declare class GridCardItemModel extends FlowModel<GridItemModelStructure> {
19
+ onInit(options: any): void;
20
+ renderConfigureAction(): React.JSX.Element;
21
+ render(): React.JSX.Element;
22
+ }
23
+ export {};
@@ -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
+ export { GridCardBlockModel } from './GridCardBlockModel';
10
+ export { GridCardItemModel } from './GridCardItemModel';
@@ -0,0 +1,22 @@
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
+ export declare const screenSizeTitleMaps: {
10
+ xs: string;
11
+ md: string;
12
+ lg: string;
13
+ xxl: string;
14
+ };
15
+ export declare const gridSizes: string[];
16
+ export declare const columnCountMarks: {};
17
+ export declare const screenSizeMaps: {
18
+ xs: string;
19
+ md: string;
20
+ lg: string;
21
+ xxl: string;
22
+ };
@@ -0,0 +1,13 @@
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 { Plugin } from '@nocobase/client-v2';
10
+ export declare class PluginBlockGridCardClient extends Plugin {
11
+ load(): Promise<void>;
12
+ }
13
+ export default PluginBlockGridCardClient;
@@ -8,9 +8,10 @@
8
8
  */
9
9
 
10
10
  module.exports = {
11
- "@nocobase/flow-engine": "2.1.0-beta.24",
12
- "@nocobase/client": "2.1.0-beta.24",
13
- "@nocobase/server": "2.1.0-beta.24",
11
+ "@nocobase/flow-engine": "2.1.0-beta.26",
12
+ "@nocobase/client": "2.1.0-beta.26",
13
+ "@nocobase/client-v2": "2.1.0-beta.26",
14
+ "@nocobase/server": "2.1.0-beta.26",
14
15
  "@ant-design/icons": "5.6.1",
15
16
  "react": "18.2.0",
16
17
  "antd": "5.24.2",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/plugin-block-grid-card",
3
- "version": "2.1.0-beta.24",
3
+ "version": "2.1.0-beta.26",
4
4
  "main": "dist/server/index.js",
5
5
  "displayName": "Block: GridCard",
6
6
  "displayName.zh-CN": "区块:网格卡片",
@@ -11,11 +11,12 @@
11
11
  "homepage.zh-CN": "https://docs-cn.nocobase.com/handbook/block-grid-card",
12
12
  "peerDependencies": {
13
13
  "@nocobase/client": "2.x",
14
+ "@nocobase/client-v2": "2.x",
14
15
  "@nocobase/server": "2.x",
15
16
  "@nocobase/test": "2.x"
16
17
  },
17
18
  "keywords": [
18
19
  "Blocks"
19
20
  ],
20
- "gitHead": "f77b85530a2d127d9bfe4dca3a26fbb02c1139ba"
21
+ "gitHead": "b17e1a72057813fa27d8435bf0f2af67ea4b059f"
21
22
  }