@nocobase/plugin-block-grid-card 2.1.0-beta.44 → 2.1.0-beta.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/client/index.js
CHANGED
|
@@ -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("@emotion/css"),require("@nocobase/client-v2"),require("react"),require("antd"),require("@nocobase/client"),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","@nocobase/client","@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("@nocobase/client"),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["@nocobase/client"],e["@ant-design/icons"],e["@nocobase/flow-engine"])}(self,function(e,t,n,r,o,i,c){return function(){"use strict";var l={375:function(e){e.exports=i},477:function(t){t.exports=e},342:function(e){e.exports=o},485:function(e){e.exports=t},694:function(e){e.exports=c},59:function(e){e.exports=r},155:function(e){e.exports=n}},a={};function u(e){var t=a[e];if(void 0!==t)return t.exports;var n=a[e]={exports:{}};return l[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!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/")}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/"}u.p=e}(),!function(){u.r(b),u.d(b,{default:function(){return J}});var e=u(342),t=u(694),n=u(375),r=u(485),o=u(155),i=u.n(o),c=u(59),l=u(477),a={xs:"Phone device",md:"Tablet device",lg:"Desktop device",xxl:"Large screen device"},s=["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"},d=JSON.parse('{"UU":"@nocobase/plugin-block-grid-card"}');function h(e){return(0,t.tExpr)(e,{ns:[d.UU,"client"]})}function g(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 y(e,t,n,r,o,i,c){try{var l=e[i](c),a=l.value}catch(e){n(e);return}l.done?t(a):Promise.resolve(a).then(r,o)}function m(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function v(e,t,n){return(v="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=w(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 w(e){return(w=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function x(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){m(e,t,n[t])})}return e}function S(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 P(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function M(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(M=function(){return!!e})()}function j(){var e=P(["\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 j=function(){return e},e}function k(){var e=P(["\n height: 100%;\n > div {\n height: 100%;\n }\n "]);return k=function(){return e},e}var C=new Set(["destroyMany","updateMany"]),E=function(e){var o;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function l(){var e,t,n;if(!(this instanceof l))throw TypeError("Cannot call a class as a function");return t=l,n=arguments,t=w(t),m(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,M()?Reflect.construct(t,n||[],w(this).constructor):t.apply(this,n)),"_screens",void 0),m(e,"_defaultCustomModelClasses",{CollectionActionGroupModel:"CollectionActionGroupModel",RecordActionGroupModel:"RecordActionGroupModel",TableColumnModel:"TableColumnModel",TableAssociationFieldGroupModel:"TableAssociationFieldGroupModel",TableCustomColumnModel:"TableCustomColumnModel"}),e}return l.prototype=Object.create(e&&e.prototype,{constructor:{value:l,writable:!0,configurable:!0}}),e&&O(l,e),o=[{key:"resource",get:function(){return v(w(l.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,n){return this.context.createResource(t.MultiRecordResource)}},{key:"getCollectionActionItems",value:function(e){var n;return(n=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),l=Object.defineProperty;return l(c,"next",{value:a(0)}),l(c,"throw",{value:a(1)}),l(c,"return",{value:a(2)}),"function"==typeof Symbol&&l(c,Symbol.iterator,{value:function(){return this}}),c;function a(l){return function(a){var u=[l,a];if(n)throw TypeError("Generator is already executing.");for(;c&&(c=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(n){switch(n.label){case 0:return[4,(0,t.buildItems)(this.getModelClassName("CollectionActionGroupModel"))(e)];case 1:return[2,n.sent().filter(function(t){var n,r=null==(n=t.useModel?e.engine.getModelClass(t.useModel):void 0)?void 0:n.capabilityActionName;return!r||!C.has(r)})]}})},function(){var e=this,t=arguments;return new Promise(function(r,o){var i=n.apply(e,t);function c(e){y(i,r,o,c,l,"next",e)}function l(e){y(i,r,o,c,l,"throw",e)}c(void 0)})}).call(this)}},{key:"renderConfiguireActions",value:function(){var e=this;return i().createElement(t.AddSubModelButton,{key:"table-column-add-actions",model:this,items:function(t){return e.getCollectionActionItems(t)},subModelKey:"actions"},i().createElement(t.FlowSettingsButton,{icon:i().createElement(n.SettingOutlined,null)},this.translate("Actions")))}},{key:"pagination",value:function(){var e,t=this,n=this.resource.getMeta("count"),o=this.resource.getPageSize(),i=this.resource.getMeta("hasNext"),c=this.resource.getPage(),l=this.resource.getData(),a=(null==(e=this.props.columnCount)?void 0:e[this._screens])||1,u=this.props.rowCount||1,s=!!this.context.isMobileLayout,f=[1,2,3,5,10].map(function(e){return a*u*e});if(n)return(0,r.applyMobilePaginationProps)({current:c,pageSize:o,total:n,pageSizeOptions:f,showTotal:function(e){return t.translate("Total {{count}} items",{count:e})},showSizeChanger:!0,onChange:function(e,n){t.resource.loading=!0,t.resource.setPage(e),t.resource.setPageSize(n),t.resource.refresh()}},s);var p=o||10,d=c||1,b={simple:!0,showTitle:!1,showSizeChanger:!0,hideOnSinglePage:!1,pageSize:p,total:(0,r.getUnknownCountPaginationTotal)({dataLength:null==l?void 0:l.length,pageSize:p,current:d,hasNext:i}),className:(0,r.mergePaginationClassName)((0,r.getSimpleModePaginationClassName)(!0),void 0),itemRender:(0,r.createCompactSimpleItemRender)({current:d,controlHeight:this.context.themeToken.controlHeight})};return(0,r.applyMobilePaginationProps)(b,s)}},{key:"renderComponent",value:function(){var e=this.decoratorProps,t=e.heightMode,n=e.height;return i().createElement(T,{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)}}(l.prototype,o),l}(r.CollectionBlockModel);m(E,"scene",r.BlockSceneEnum.many);var R=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},_=function(e){var t,n=e.heightMode,r=e.containerRef,i=e.actionsRef,c=e.listRef,l=e.height,a=function(e){if(Array.isArray(e))return e}(t=(0,o.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,c=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),2!==o.length);i=!0);}catch(e){c=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(c)throw n}}return o}}(t)||function(e){if(e){if("string"==typeof e)return g(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return g(e,2)}}(t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),u=a[0],s=a[1],f=(0,o.useCallback)(function(){if("specifyValue"!==n&&"fullHeight"!==n)return void s(function(e){return void 0===e?e:void 0});var e,t=r.current;if(t){var o=t.getBoundingClientRect().height;if(o){var l=Math.max(0,Math.floor(o-R(i.current)-R(null==(e=c.current)?void 0:e.querySelector(".ant-list-pagination"))));s(function(e){return e===l?e:l})}}},[n,r,i,c]);return(0,o.useLayoutEffect)(function(){f()},[f,l]),(0,o.useEffect)(function(){if(r.current&&"u">typeof ResizeObserver){var e,t=r.current,n=i.current,o=null==(e=c.current)?void 0:e.querySelector(".ant-list-pagination"),l=new ResizeObserver(function(){return f()});return l.observe(t),n&&l.observe(n),o&&l.observe(o),function(){return l.disconnect()}}},[f,r,i,c,l]),u},T=(0,t.observer)(function(e){var n,r,a,u=e.model,s=e.heightMode,f=e.height,p=(0,o.useRef)(null),d=(0,o.useRef)(null),b=(0,o.useRef)(null),h="specifyValue"===s||"fullHeight"===s,g=u.context.themeToken,y=g.marginLG,v=_({heightMode:s,containerRef:p,actionsRef:d,listRef:b,height:f}),w=(0,o.useMemo)(function(){return(0,l.css)(j(),g.marginLG,g.marginLG,g.marginLG,g.marginLG)},[g.marginLG]),O=(0,o.useMemo)(function(){var e,t;return null==v?null==(e=u.props)?void 0:e.style:S(x({},(null==(t=u.props)?void 0:t.style)||{}),m({},"--nb-grid-card-height","".concat(v,"px")))},[v,null==(n=u.props)?void 0:n.style]),P=!!u.context.flowSettingsEnabled,M=u.props.columnCount;return i().createElement("div",{ref:p,style:h?{display:"flex",flexDirection:"column",minHeight:0,height:"100%"}:void 0},i().createElement("div",{ref:d},i().createElement(t.DndProvider,null,i().createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:y}},i().createElement(c.Space,{wrap:!0},u.mapSubModels("actions",function(e){return"left"===e.props.position?i().createElement(t.FlowModelRenderer,{key:e.uid,model:e,showFlowSettings:{showBackground:!1,showBorder:!1,toolbarPosition:"above"}}):null}),i().createElement("span",null)),i().createElement(c.Space,{wrap:!0},u.mapSubModels("actions",function(e){if(!e.hidden||P)return"left"!==e.props.position?i().createElement(t.Droppable,{model:e,key:e.uid},i().createElement(t.FlowModelRenderer,{model:e,showFlowSettings:{showBackground:!1,showBorder:!1,toolbarPosition:"above"},extraToolbarItems:[{key:"drag-handler",component:t.DragHandler,sort:1}]})):null}),u.renderConfiguireActions())))),i().createElement("div",{ref:b,style:{flex:1,minHeight:0}},i().createElement(c.List,S(x({},u.props),{className:(null==(r=u.props)?void 0:r.className)?"".concat(u.props.className," ").concat(w):w,style:O,pagination:u.pagination(),loading:null==(a=u.resource)?void 0:a.loading,dataSource:u.resource.getData(),grid:S(x({},M),{sm:M.xs,xl:M.lg,gutter:[g.marginBlock/2,g.marginBlock/2]}),renderItem:function(e,n){var r=u.subModels.item.createFork({},"".concat(n));return r.context.defineProperty("record",{get:function(){return e},cache:!1,resolveOnServer:!0}),r.context.defineProperty("index",{get:function(){return n},cache:!1,resolveOnServer:!0}),i().createElement(c.Col,{className:(0,l.css)(k())},i().createElement(t.FlowModelRenderer,{model:r}))}}))))});function B(e,t,n,r,o,i,c){try{var l=e[i](c),a=l.value}catch(e){n(e);return}l.done?t(a):Promise.resolve(a).then(r,o)}E.registerFlow({key:"resourceSettings2",steps:{}}),E.registerFlow({key:"GridCardSettings",sort:500,title:h("Grid card block settings"),steps:{columnCount:{title:h("Set the count of columns displayed in a row"),uiSchema:function(e){var t=e.t,n={"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:s.reduce(function(e,r){return e[r]=S(x({},n),{title:t(a[r]),description:"".concat(t("Screen size")," ").concat(p[r]," ").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:h("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 n=t.rowCount*e.model.props.columnCount[e.model._screens];e.model.resource.getPageSize()!==n&&e.model.resource.setPageSize(n)}},dataScope:{use:"dataScope",title:h("Data scope")},defaultSorting:{use:"sortingRule",title:h("Default sorting")},layout:{use:"layout",title:h("Layout"),handler:function(e,t){e.model.setProps(S(x({},t),{labelWidth:"vertical"===t.layout?null:t.labelWidth})),e.model.subModels.item.setProps(S(x({},t),{labelWidth:"vertical"===t.layout?"100%":t.labelWidth,labelWrap:"vertical"===t.layout||t.labelWrap}))}}}}),E.define({label:h("Grid card"),searchable:!0,searchPlaceholder:h("Search"),createModelOptions:{use:"GridCardBlockModel",subModels:{item:{use:"GridCardItemModel"}}},sort:500});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=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 I(e,t){return(I=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function G(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function D(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(D=function(){return!!e})()}function N(){var e=G(["\n height: 100%;\n .ant-card-body {\n height: 100%;\n }\n .ant-form-item {\n margin-bottom: ","px;\n }\n "]);return N=function(){return e},e}function z(){var e=G(["\n button {\n padding: ","px;\n }\n "]);return z=function(){return e},e}function q(){var e=G(["\n button {\n padding: ","px;\n padding-left: ",";\n }\n "]);return q=function(){return e},e}var L=new WeakMap,W=function(e){var o;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function a(){var e,t;if(!(this instanceof a))throw TypeError("Cannot call a class as a function");return e=a,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,D()?Reflect.construct(e,t||[],A(this).constructor):e.apply(this,t))}return a.prototype=Object.create(e&&e.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),e&&I(a,e),o=[{key:"onInit",value:function(e){F(A(a.prototype),"onInit",this).call(this,e)}},{key:"renderConfigureAction",value:function(){return i().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:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(c,"next",{value:a(0)}),l(c,"throw",{value:a(1)}),l(c,"return",{value:a(2)}),"function"==typeof Symbol&&l(c,Symbol.iterator,{value:function(){return this}}),c;function a(l){return function(a){var u=[l,a];if(n)throw TypeError("Generator is already executing.");for(;c&&(c=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 c(e){B(i,r,o,c,l,"next",e)}function l(e){B(i,r,o,c,l,"throw",e)}c(void 0)})})()}},i().createElement(t.FlowSettingsButton,{icon:i().createElement(n.SettingOutlined,null)},this.translate("Actions")))}},{key:"render",value:function(){var e,n=this,o=this.context.index,a=this.context.record,u=this.subModels.grid.createFork({},"grid-".concat(o)),s=this.context.themeToken,f=null!=(e=s.marginSM)?e:8,p=s.paddingXXS?"".concat(s.paddingXXS-s.paddingXXS,"px"):"0px";u.gridContainerRef=i().createRef();var d=(0,t.createRecordMetaFactory)(function(){return u.context.collection},u.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,c=null==n||null==(t=n.getFilterByTK)?void 0:t.call(n,r);if(o&&null!=c)return{collection:o,dataSourceKey:i,filterByTk:c}});u.context.defineProperty("fieldIndex",{get:function(){return o},cache:!1}),u.context.defineProperty("record",{get:function(){return a},cache:!1,resolveOnServer:!0,meta:d}),u.context.defineProperty("fieldKey",{get:function(){return o}});var b=this.props,h=b.colon,g=b.labelAlign,y=b.labelWidth,m=b.labelWrap,v=b.layout,w=!!this.context.flowSettingsEnabled;return i().createElement(c.Card,{role:"button",className:(0,l.css)(N(),f)},i().createElement("div",{style:{display:"flex",width:"100%",height:"100%",flexDirection:"column",justifyContent:"space-between",gap:p}},i().createElement(r.FormComponent,{model:this,layoutProps:{colon:h,labelAlign:g,labelWidth:y,labelWrap:m,layout:v}},i().createElement(t.FlowModelRenderer,{model:u,showFlowSettings:!1})),i().createElement("div",null,i().createElement(t.DndProvider,null,i().createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:s.marginXS}},i().createElement(c.Space,{className:(0,l.css)(z(),f),wrap:!0},this.mapSubModels("actions",function(e,r){var c,u,s,d="".concat(o),b=(null==(s=n.context.collection)||null==(u=s.getFilterByTK)?void 0:u.call(s,a))||"".concat(null!=(c=null==a?void 0:a.id)?c:"","-").concat(d),h=e.getFork(d);h&&L.get(h)!==b&&h.dispose();var g=e.createFork({},d);if(L.set(g,b),g.invalidateFlowCache("beforeRender"),!g.hidden||w){var y=(0,t.createRecordMetaFactory)(function(){return g.context.collection},g.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,c=null==n||null==(t=n.getFilterByTK)?void 0:t.call(n,r);if(o&&null!=c)return{collection:o,dataSourceKey:i,filterByTk:c}});return g.context.defineProperty("record",{get:function(){return n.context.record},resolveOnServer:!0,meta:y,cache:!1}),i().createElement(t.Droppable,{model:g,key:g.uid},i().createElement("div",{className:(0,l.css)(q(),f,0===r?p:"".concat(f,"px"))},i().createElement(t.FlowModelRenderer,{model:g,inputArgs: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)}}(a.prototype,o),a}(t.FlowModel);function K(e,t,n,r,o,i,c){try{var l=e[i](c),a=l.value}catch(e){n(e);return}l.done?t(a):Promise.resolve(a).then(r,o)}function H(e,t,n){return(H=V()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&U(o,n.prototype),o}).apply(null,arguments)}W.define({createModelOptions:{use:"GridCardItemModel",subModels:{grid:{use:"DetailsGridModel"}}},sort:350});function $(e){return($=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function U(e,t){return(U=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function X(e){var t="function"==typeof Map?new Map:void 0;return(X=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 H(e,arguments,$(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),U(n,e)})(e)}function V(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(V=function(){return!!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 n(){var e,t;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return e=n,t=arguments,e=$(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,V()?Reflect.construct(e,t||[],$(this).constructor):e.apply(this,t))}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&U(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:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(c,"next",{value:a(0)}),l(c,"throw",{value:a(1)}),l(c,"return",{value:a(2)}),"function"==typeof Symbol&&l(c,Symbol.iterator,{value:function(){return this}}),c;function a(l){return function(a){var u=[l,a];if(n)throw TypeError("Generator is already executing.");for(;c&&(c=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({GridCardBlockModel:E,GridCardItemModel:W}),[2]})},function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function c(e){K(i,r,o,c,l,"next",e)}function l(e){K(i,r,o,c,l,"throw",e)}c(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}(X(e.Plugin))}(),b}()});
|
|
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("@nocobase/client"),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","@nocobase/client","@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("@nocobase/client"),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["@nocobase/client"],e["@ant-design/icons"],e["@nocobase/flow-engine"])}(self,function(e,t,n,r,o,i,c){return function(){"use strict";var l={375:function(e){e.exports=i},477:function(t){t.exports=e},342:function(e){e.exports=o},485:function(e){e.exports=t},694:function(e){e.exports=c},59:function(e){e.exports=r},155:function(e){e.exports=n}},a={};function u(e){var t=a[e];if(void 0!==t)return t.exports;var n=a[e]={exports:{}};return l[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!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/")}if(!e){var r=window.__nocobase_modern_client_prefix__||"v",o="/"+(r=String(r).replace(/^\/+|\/+$/g,"")||"v")+"/";if(!(e=window.__nocobase_public_path__||"")&&window.location&&window.location.pathname){var i=window.location.pathname||"/",c=i.indexOf(o);e=c>=0?i.slice(0,c+1):"/"}e&&(e=e.replace(RegExp("/"+r+"/?$"),"/")),e||(e="/"),"/"!==e.charAt(e.length-1)&&(e+="/"),e+="static/plugins/@nocobase/plugin-block-grid-card/dist/client/"}u.p=e}(),!function(){u.r(b),u.d(b,{default:function(){return J}});var e=u(342),t=u(694),n=u(375),r=u(485),o=u(155),i=u.n(o),c=u(59),l=u(477),a={xs:"Phone device",md:"Tablet device",lg:"Desktop device",xxl:"Large screen device"},s=["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"},d=JSON.parse('{"UU":"@nocobase/plugin-block-grid-card"}');function h(e){return(0,t.tExpr)(e,{ns:[d.UU,"client"]})}function g(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 y(e,t,n,r,o,i,c){try{var l=e[i](c),a=l.value}catch(e){n(e);return}l.done?t(a):Promise.resolve(a).then(r,o)}function m(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function v(e,t,n){return(v="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=w(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 w(e){return(w=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function x(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){m(e,t,n[t])})}return e}function S(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 P(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function M(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(M=function(){return!!e})()}function j(){var e=P(["\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 j=function(){return e},e}function k(){var e=P(["\n height: 100%;\n > div {\n height: 100%;\n }\n "]);return k=function(){return e},e}var C=new Set(["destroyMany","updateMany"]),E=function(e){var o;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function l(){var e,t,n;if(!(this instanceof l))throw TypeError("Cannot call a class as a function");return t=l,n=arguments,t=w(t),m(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,M()?Reflect.construct(t,n||[],w(this).constructor):t.apply(this,n)),"_screens",void 0),m(e,"_defaultCustomModelClasses",{CollectionActionGroupModel:"CollectionActionGroupModel",RecordActionGroupModel:"RecordActionGroupModel",TableColumnModel:"TableColumnModel",TableAssociationFieldGroupModel:"TableAssociationFieldGroupModel",TableCustomColumnModel:"TableCustomColumnModel"}),e}return l.prototype=Object.create(e&&e.prototype,{constructor:{value:l,writable:!0,configurable:!0}}),e&&O(l,e),o=[{key:"resource",get:function(){return v(w(l.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,n){return this.context.createResource(t.MultiRecordResource)}},{key:"getCollectionActionItems",value:function(e){var n;return(n=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),l=Object.defineProperty;return l(c,"next",{value:a(0)}),l(c,"throw",{value:a(1)}),l(c,"return",{value:a(2)}),"function"==typeof Symbol&&l(c,Symbol.iterator,{value:function(){return this}}),c;function a(l){return function(a){var u=[l,a];if(n)throw TypeError("Generator is already executing.");for(;c&&(c=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(n){switch(n.label){case 0:return[4,(0,t.buildItems)(this.getModelClassName("CollectionActionGroupModel"))(e)];case 1:return[2,n.sent().filter(function(t){var n,r=null==(n=t.useModel?e.engine.getModelClass(t.useModel):void 0)?void 0:n.capabilityActionName;return!r||!C.has(r)})]}})},function(){var e=this,t=arguments;return new Promise(function(r,o){var i=n.apply(e,t);function c(e){y(i,r,o,c,l,"next",e)}function l(e){y(i,r,o,c,l,"throw",e)}c(void 0)})}).call(this)}},{key:"renderConfiguireActions",value:function(){var e=this;return i().createElement(t.AddSubModelButton,{key:"table-column-add-actions",model:this,items:function(t){return e.getCollectionActionItems(t)},subModelKey:"actions"},i().createElement(t.FlowSettingsButton,{icon:i().createElement(n.SettingOutlined,null)},this.translate("Actions")))}},{key:"pagination",value:function(){var e,t=this,n=this.resource.getMeta("count"),o=this.resource.getPageSize(),i=this.resource.getMeta("hasNext"),c=this.resource.getPage(),l=this.resource.getData(),a=(null==(e=this.props.columnCount)?void 0:e[this._screens])||1,u=this.props.rowCount||1,s=!!this.context.isMobileLayout,f=[1,2,3,5,10].map(function(e){return a*u*e});if(n)return(0,r.applyMobilePaginationProps)({current:c,pageSize:o,total:n,pageSizeOptions:f,showTotal:function(e){return t.translate("Total {{count}} items",{count:e})},showSizeChanger:!0,onChange:function(e,n){t.resource.loading=!0,t.resource.setPage(e),t.resource.setPageSize(n),t.resource.refresh()}},s);var p=o||10,d=c||1,b={simple:!0,showTitle:!1,showSizeChanger:!0,hideOnSinglePage:!1,pageSize:p,total:(0,r.getUnknownCountPaginationTotal)({dataLength:null==l?void 0:l.length,pageSize:p,current:d,hasNext:i}),className:(0,r.mergePaginationClassName)((0,r.getSimpleModePaginationClassName)(!0),void 0),itemRender:(0,r.createCompactSimpleItemRender)({current:d,controlHeight:this.context.themeToken.controlHeight})};return(0,r.applyMobilePaginationProps)(b,s)}},{key:"renderComponent",value:function(){var e=this.decoratorProps,t=e.heightMode,n=e.height;return i().createElement(T,{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)}}(l.prototype,o),l}(r.CollectionBlockModel);m(E,"scene",r.BlockSceneEnum.many);var _=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},R=function(e){var t,n=e.heightMode,r=e.containerRef,i=e.actionsRef,c=e.listRef,l=e.height,a=function(e){if(Array.isArray(e))return e}(t=(0,o.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,c=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),2!==o.length);i=!0);}catch(e){c=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(c)throw n}}return o}}(t)||function(e){if(e){if("string"==typeof e)return g(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return g(e,2)}}(t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),u=a[0],s=a[1],f=(0,o.useCallback)(function(){if("specifyValue"!==n&&"fullHeight"!==n)return void s(function(e){return void 0===e?e:void 0});var e,t=r.current;if(t){var o=t.getBoundingClientRect().height;if(o){var l=Math.max(0,Math.floor(o-_(i.current)-_(null==(e=c.current)?void 0:e.querySelector(".ant-list-pagination"))));s(function(e){return e===l?e:l})}}},[n,r,i,c]);return(0,o.useLayoutEffect)(function(){f()},[f,l]),(0,o.useEffect)(function(){if(r.current&&"u">typeof ResizeObserver){var e,t=r.current,n=i.current,o=null==(e=c.current)?void 0:e.querySelector(".ant-list-pagination"),l=new ResizeObserver(function(){return f()});return l.observe(t),n&&l.observe(n),o&&l.observe(o),function(){return l.disconnect()}}},[f,r,i,c,l]),u},T=(0,t.observer)(function(e){var n,r,a,u=e.model,s=e.heightMode,f=e.height,p=(0,o.useRef)(null),d=(0,o.useRef)(null),b=(0,o.useRef)(null),h="specifyValue"===s||"fullHeight"===s,g=u.context.themeToken,y=g.marginLG,v=R({heightMode:s,containerRef:p,actionsRef:d,listRef:b,height:f}),w=(0,o.useMemo)(function(){return(0,l.css)(j(),g.marginLG,g.marginLG,g.marginLG,g.marginLG)},[g.marginLG]),O=(0,o.useMemo)(function(){var e,t;return null==v?null==(e=u.props)?void 0:e.style:S(x({},(null==(t=u.props)?void 0:t.style)||{}),m({},"--nb-grid-card-height","".concat(v,"px")))},[v,null==(n=u.props)?void 0:n.style]),P=!!u.context.flowSettingsEnabled,M=u.props.columnCount;return i().createElement("div",{ref:p,style:h?{display:"flex",flexDirection:"column",minHeight:0,height:"100%"}:void 0},i().createElement("div",{ref:d},i().createElement(t.DndProvider,null,i().createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:y}},i().createElement(c.Space,{wrap:!0},u.mapSubModels("actions",function(e){return"left"===e.props.position?i().createElement(t.FlowModelRenderer,{key:e.uid,model:e,showFlowSettings:{showBackground:!1,showBorder:!1,toolbarPosition:"above"}}):null}),i().createElement("span",null)),i().createElement(c.Space,{wrap:!0},u.mapSubModels("actions",function(e){if(!e.hidden||P)return"left"!==e.props.position?i().createElement(t.Droppable,{model:e,key:e.uid},i().createElement(t.FlowModelRenderer,{model:e,showFlowSettings:{showBackground:!1,showBorder:!1,toolbarPosition:"above"},extraToolbarItems:[{key:"drag-handler",component:t.DragHandler,sort:1}]})):null}),u.renderConfiguireActions())))),i().createElement("div",{ref:b,style:{flex:1,minHeight:0}},i().createElement(c.List,S(x({},u.props),{className:(null==(r=u.props)?void 0:r.className)?"".concat(u.props.className," ").concat(w):w,style:O,pagination:u.pagination(),loading:null==(a=u.resource)?void 0:a.loading,dataSource:u.resource.getData(),grid:S(x({},M),{sm:M.xs,xl:M.lg,gutter:[g.marginBlock/2,g.marginBlock/2]}),renderItem:function(e,n){var r=u.subModels.item.createFork({},"".concat(n));return r.context.defineProperty("record",{get:function(){return e},cache:!1,resolveOnServer:!0}),r.context.defineProperty("index",{get:function(){return n},cache:!1,resolveOnServer:!0}),i().createElement(c.Col,{className:(0,l.css)(k())},i().createElement(t.FlowModelRenderer,{model:r}))}}))))});function B(e,t,n,r,o,i,c){try{var l=e[i](c),a=l.value}catch(e){n(e);return}l.done?t(a):Promise.resolve(a).then(r,o)}E.registerFlow({key:"resourceSettings2",steps:{}}),E.registerFlow({key:"GridCardSettings",sort:500,title:h("Grid card block settings"),steps:{columnCount:{title:h("Set the count of columns displayed in a row"),uiSchema:function(e){var t=e.t,n={"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:s.reduce(function(e,r){return e[r]=S(x({},n),{title:t(a[r]),description:"".concat(t("Screen size")," ").concat(p[r]," ").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:h("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 n=t.rowCount*e.model.props.columnCount[e.model._screens];e.model.resource.getPageSize()!==n&&e.model.resource.setPageSize(n)}},dataScope:{use:"dataScope",title:h("Data scope")},defaultSorting:{use:"sortingRule",title:h("Default sorting")},layout:{use:"layout",title:h("Layout"),handler:function(e,t){e.model.setProps(S(x({},t),{labelWidth:"vertical"===t.layout?null:t.labelWidth})),e.model.subModels.item.setProps(S(x({},t),{labelWidth:"vertical"===t.layout?"100%":t.labelWidth,labelWrap:"vertical"===t.layout||t.labelWrap}))}}}}),E.define({label:h("Grid card"),searchable:!0,searchPlaceholder:h("Search"),createModelOptions:{use:"GridCardBlockModel",subModels:{item:{use:"GridCardItemModel"}}},sort:500});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=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 I(e,t){return(I=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function G(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function D(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(D=function(){return!!e})()}function N(){var e=G(["\n height: 100%;\n .ant-card-body {\n height: 100%;\n }\n .ant-form-item {\n margin-bottom: ","px;\n }\n "]);return N=function(){return e},e}function z(){var e=G(["\n button {\n padding: ","px;\n }\n "]);return z=function(){return e},e}function q(){var e=G(["\n button {\n padding: ","px;\n padding-left: ",";\n }\n "]);return q=function(){return e},e}var L=new WeakMap,W=function(e){var o;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function a(){var e,t;if(!(this instanceof a))throw TypeError("Cannot call a class as a function");return e=a,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,D()?Reflect.construct(e,t||[],A(this).constructor):e.apply(this,t))}return a.prototype=Object.create(e&&e.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),e&&I(a,e),o=[{key:"onInit",value:function(e){F(A(a.prototype),"onInit",this).call(this,e)}},{key:"renderConfigureAction",value:function(){return i().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:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(c,"next",{value:a(0)}),l(c,"throw",{value:a(1)}),l(c,"return",{value:a(2)}),"function"==typeof Symbol&&l(c,Symbol.iterator,{value:function(){return this}}),c;function a(l){return function(a){var u=[l,a];if(n)throw TypeError("Generator is already executing.");for(;c&&(c=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 c(e){B(i,r,o,c,l,"next",e)}function l(e){B(i,r,o,c,l,"throw",e)}c(void 0)})})()}},i().createElement(t.FlowSettingsButton,{icon:i().createElement(n.SettingOutlined,null)},this.translate("Actions")))}},{key:"render",value:function(){var e,n=this,o=this.context.index,a=this.context.record,u=this.subModels.grid.createFork({},"grid-".concat(o)),s=this.context.themeToken,f=null!=(e=s.marginSM)?e:8,p=s.paddingXXS?"".concat(s.paddingXXS-s.paddingXXS,"px"):"0px";u.gridContainerRef=i().createRef();var d=(0,t.createRecordMetaFactory)(function(){return u.context.collection},u.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,c=null==n||null==(t=n.getFilterByTK)?void 0:t.call(n,r);if(o&&null!=c)return{collection:o,dataSourceKey:i,filterByTk:c}});u.context.defineProperty("fieldIndex",{get:function(){return o},cache:!1}),u.context.defineProperty("record",{get:function(){return a},cache:!1,resolveOnServer:!0,meta:d}),u.context.defineProperty("fieldKey",{get:function(){return o}});var b=this.props,h=b.colon,g=b.labelAlign,y=b.labelWidth,m=b.labelWrap,v=b.layout,w=!!this.context.flowSettingsEnabled;return i().createElement(c.Card,{role:"button",className:(0,l.css)(N(),f)},i().createElement("div",{style:{display:"flex",width:"100%",height:"100%",flexDirection:"column",justifyContent:"space-between",gap:p}},i().createElement(r.FormComponent,{model:this,layoutProps:{colon:h,labelAlign:g,labelWidth:y,labelWrap:m,layout:v}},i().createElement(t.FlowModelRenderer,{model:u,showFlowSettings:!1})),i().createElement("div",null,i().createElement(t.DndProvider,null,i().createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:s.marginXS}},i().createElement(c.Space,{className:(0,l.css)(z(),f),wrap:!0},this.mapSubModels("actions",function(e,r){var c,u,s,d="".concat(o),b=(null==(s=n.context.collection)||null==(u=s.getFilterByTK)?void 0:u.call(s,a))||"".concat(null!=(c=null==a?void 0:a.id)?c:"","-").concat(d),h=e.getFork(d);h&&L.get(h)!==b&&h.dispose();var g=e.createFork({},d);if(L.set(g,b),g.invalidateFlowCache("beforeRender"),!g.hidden||w){var y=(0,t.createRecordMetaFactory)(function(){return g.context.collection},g.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,c=null==n||null==(t=n.getFilterByTK)?void 0:t.call(n,r);if(o&&null!=c)return{collection:o,dataSourceKey:i,filterByTk:c}});return g.context.defineProperty("record",{get:function(){return n.context.record},resolveOnServer:!0,meta:y,cache:!1}),i().createElement(t.Droppable,{model:g,key:g.uid},i().createElement("div",{className:(0,l.css)(q(),f,0===r?p:"".concat(f,"px"))},i().createElement(t.FlowModelRenderer,{model:g,inputArgs: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)}}(a.prototype,o),a}(t.FlowModel);function K(e,t,n,r,o,i,c){try{var l=e[i](c),a=l.value}catch(e){n(e);return}l.done?t(a):Promise.resolve(a).then(r,o)}function H(e,t,n){return(H=V()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&U(o,n.prototype),o}).apply(null,arguments)}W.define({createModelOptions:{use:"GridCardItemModel",subModels:{grid:{use:"DetailsGridModel"}}},sort:350});function $(e){return($=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function U(e,t){return(U=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function X(e){var t="function"==typeof Map?new Map:void 0;return(X=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 H(e,arguments,$(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),U(n,e)})(e)}function V(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(V=function(){return!!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 n(){var e,t;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return e=n,t=arguments,e=$(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,V()?Reflect.construct(e,t||[],$(this).constructor):e.apply(this,t))}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&U(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:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(c,"next",{value:a(0)}),l(c,"throw",{value:a(1)}),l(c,"return",{value:a(2)}),"function"==typeof Symbol&&l(c,Symbol.iterator,{value:function(){return this}}),c;function a(l){return function(a){var u=[l,a];if(n)throw TypeError("Generator is already executing.");for(;c&&(c=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({GridCardBlockModel:E,GridCardItemModel:W}),[2]})},function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function c(e){K(i,r,o,c,l,"next",e)}function l(e){K(i,r,o,c,l,"throw",e)}c(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}(X(e.Plugin))}(),b}()});
|
package/dist/client-v2/index.js
CHANGED
|
@@ -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("@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/client-v2",["@emotion/css","@nocobase/client-v2","react","antd","@ant-design/icons","@nocobase/flow-engine"],t):"object"==typeof exports?exports["@nocobase/plugin-block-grid-card/client-v2"]=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/client-v2"]=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:"949cb59836f491ec",812:"4ec520bd159bcdc0"})[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/client-v2:"+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/client-v2:"+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 v=b.getElementsByTagName("script");if(v.length)for(var
|
|
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/client-v2",["@emotion/css","@nocobase/client-v2","react","antd","@ant-design/icons","@nocobase/flow-engine"],t):"object"==typeof exports?exports["@nocobase/plugin-block-grid-card/client-v2"]=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/client-v2"]=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:"949cb59836f491ec",812:"4ec520bd159bcdc0"})[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/client-v2:"+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/client-v2:"+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 v=b.getElementsByTagName("script");if(v.length)for(var g=v.length-1;g>-1&&(!d||!/^http(s?):/.test(d));)d=v[g--].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_client_v2=self.webpackChunk_nocobase_plugin_block_grid_card_client_v2||[]).forEach(u.bind(null,0)),a.push=u.bind(null,a.push.bind(a));var h={};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){var r=window.__nocobase_modern_client_prefix__||"v",o="/"+(r=String(r).replace(/^\/+|\/+$/g,"")||"v")+"/";if(!(e=window.__nocobase_public_path__||"")&&window.location&&window.location.pathname){var i=window.location.pathname||"/",c=i.indexOf(o);e=c>=0?i.slice(0,c+1):"/"}e&&(e=e.replace(RegExp("/"+r+"/?$"),"/")),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(h),s.d(h,{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))}(),h}()});
|
package/dist/externalVersion.js
CHANGED
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
module.exports = {
|
|
11
|
-
"@nocobase/client": "2.1.0-beta.
|
|
12
|
-
"@nocobase/flow-engine": "2.1.0-beta.
|
|
13
|
-
"@nocobase/client-v2": "2.1.0-beta.
|
|
14
|
-
"@nocobase/server": "2.1.0-beta.
|
|
11
|
+
"@nocobase/client": "2.1.0-beta.45",
|
|
12
|
+
"@nocobase/flow-engine": "2.1.0-beta.45",
|
|
13
|
+
"@nocobase/client-v2": "2.1.0-beta.45",
|
|
14
|
+
"@nocobase/server": "2.1.0-beta.45",
|
|
15
15
|
"@ant-design/icons": "5.6.1",
|
|
16
16
|
"react": "18.2.0",
|
|
17
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.
|
|
3
|
+
"version": "2.1.0-beta.45",
|
|
4
4
|
"main": "dist/server/index.js",
|
|
5
5
|
"displayName": "Block: GridCard",
|
|
6
6
|
"displayName.zh-CN": "区块:网格卡片",
|
|
@@ -18,5 +18,5 @@
|
|
|
18
18
|
"keywords": [
|
|
19
19
|
"Blocks"
|
|
20
20
|
],
|
|
21
|
-
"gitHead": "
|
|
21
|
+
"gitHead": "42587115fc34c3eb01ef2b2549f1c998e5708318"
|
|
22
22
|
}
|