@nocobase/plugin-kanban 1.4.16 → 1.4.18
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 +2 -2
- package/dist/externalVersion.js +4 -4
- package/package.json +2 -2
package/dist/client/index.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
(function($,x){typeof exports=="object"&&typeof module!="undefined"?x(exports,require("react/jsx-runtime"),require("@nocobase/client"),require("react"),require("@formily/react"),require("antd"),require("@emotion/css"),require("lodash"),require("antd-style"),require("@formily/antd-v5"),require("@formily/core"),require("@ant-design/icons"),require("@formily/shared"),require("react-i18next")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","@nocobase/client","react","@formily/react","antd","@emotion/css","lodash","antd-style","@formily/antd-v5","@formily/core","@ant-design/icons","@formily/shared","react-i18next"],x):($=typeof globalThis!="undefined"?globalThis:$||self,x($["@nocobase/plugin-kanban"]={},$.jsxRuntime,$["@nocobase/client"],$.react,$["@formily/react"],$.antd,$["@emotion/css"],$.lodash,$["antd-style"],$["@formily/antd-v5"],$["@formily/core"],$["@ant-design/icons"],$["@formily/shared"],$["react-i18next"]))})(this,function($,x,P,D,J,Re,Eo,ct,xr,Fr,Ug,Gs,Po,Pn){"use strict";var Cb=Object.defineProperty,bb=Object.defineProperties;var xb=Object.getOwnPropertyDescriptors;var Da=Object.getOwnPropertySymbols;var zg=Object.prototype.hasOwnProperty,Rg=Object.prototype.propertyIsEnumerable;var Lg=($,x,P)=>x in $?Cb($,x,{enumerable:!0,configurable:!0,writable:!0,value:P}):$[x]=P,F=($,x)=>{for(var P in x||(x={}))zg.call(x,P)&&Lg($,P,x[P]);if(Da)for(var P of Da(x))Rg.call(x,P)&&Lg($,P,x[P]);return $},G=($,x)=>bb($,xb(x));var Ea=($,x)=>{var P={};for(var D in $)zg.call($,D)&&x.indexOf(D)<0&&(P[D]=$[D]);if($!=null&&Da)for(var D of Da($))x.indexOf(D)<0&&Rg.call($,D)&&(P[D]=$[D]);return P};var ur=($,x,P)=>new Promise((D,J)=>{var Re=xr=>{try{ct(P.next(xr))}catch(Fr){J(Fr)}},Eo=xr=>{try{ct(P.throw(xr))}catch(Fr){J(Fr)}},ct=xr=>xr.done?D(xr.value):Promise.resolve(xr.value).then(Re,Eo);ct((P=P.apply($,x)).next())});function Gg(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const t=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,t.get?t:{enumerable:!0,get:()=>e[n]})}}return r.default=e,Object.freeze(r)}const dt=Gg(D);var Pa=new Map,Io=new WeakMap,Ws=0,Wg=void 0;function $g(e){return e?(Io.has(e)||(Ws+=1,Io.set(e,Ws.toString())),Io.get(e)):"0"}function jg(e){return Object.keys(e).sort().filter(r=>e[r]!==void 0).map(r=>`${r}_${r==="root"?$g(e.root):e[r]}`).toString()}function Vg(e){const r=jg(e);let n=Pa.get(r);if(!n){const t=new Map;let o;const i=new IntersectionObserver(a=>{a.forEach(l=>{var u;const s=l.isIntersecting&&o.some(f=>l.intersectionRatio>=f);e.trackVisibility&&typeof l.isVisible=="undefined"&&(l.isVisible=s),(u=t.get(l.target))==null||u.forEach(f=>{f(s,l)})})},e);o=i.thresholds||(Array.isArray(e.threshold)?e.threshold:[e.threshold||0]),n={id:r,observer:i,elements:t},Pa.set(r,n)}return n}function Hg(e,r,n={},t=Wg){if(typeof window.IntersectionObserver=="undefined"&&t!==void 0){const u=e.getBoundingClientRect();return r(t,{isIntersecting:t,target:e,intersectionRatio:typeof n.threshold=="number"?n.threshold:0,time:0,boundingClientRect:u,intersectionRect:u,rootBounds:u}),()=>{}}const{id:o,observer:i,elements:a}=Vg(n),l=a.get(e)||[];return a.has(e)||a.set(e,l),l.push(r),i.observe(e),function(){l.splice(l.indexOf(r),1),l.length===0&&(a.delete(e),i.unobserve(e)),a.size===0&&(i.disconnect(),Pa.delete(o))}}function _g({threshold:e,delay:r,trackVisibility:n,rootMargin:t,root:o,triggerOnce:i,skip:a,initialInView:l,fallbackInView:u,onChange:s}={}){var f;const[c,d]=dt.useState(null),p=dt.useRef(),[h,y]=dt.useState({inView:!!l,entry:void 0});p.current=s,dt.useEffect(()=>{if(a||!c)return;let g;return g=Hg(c,(S,C)=>{y({inView:S,entry:C}),p.current&&p.current(S,C),C.isIntersecting&&i&&g&&(g(),g=void 0)},{root:o,rootMargin:t,threshold:e,trackVisibility:n,delay:r},u),()=>{g&&g()}},[Array.isArray(e)?e.toString():e,c,o,t,i,a,n,u,r]);const w=(f=h.entry)==null?void 0:f.target,m=dt.useRef();!c&&w&&!i&&!a&&m.current!==w&&(m.current=w,y({inView:!!l,entry:void 0}));const v=[d,h.inView,h.entry];return v.ref=v[0],v.inView=v[1],v.entry=v[2],v}function Ia(e,r){return Ia=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,t){return n.__proto__=t,n},Ia(e,r)}function $s(e,r){e.prototype=Object.create(r.prototype),e.prototype.constructor=e,Ia(e,r)}function R(){return R=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var t in n)({}).hasOwnProperty.call(n,t)&&(e[t]=n[t])}return e},R.apply(null,arguments)}function ft(e){"@babel/helpers - typeof";return ft=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},ft(e)}function Kg(e,r){if(ft(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var t=n.call(e,r||"default");if(ft(t)!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function qg(e){var r=Kg(e,"string");return ft(r)=="symbol"?r:r+""}function Qg(e,r,n){return(r=qg(r))in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function js(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r&&(t=t.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,t)}return n}function Vs(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?js(Object(n),!0).forEach(function(t){Qg(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):js(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Te(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var Hs=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),ka=function(){return Math.random().toString(36).substring(7).split("").join(".")},_s={INIT:"@@redux/INIT"+ka(),REPLACE:"@@redux/REPLACE"+ka(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+ka()}};function Yg(e){if(typeof e!="object"||e===null)return!1;for(var r=e;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(e)===r}function Ks(e,r,n){var t;if(typeof r=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(Te(0));if(typeof r=="function"&&typeof n=="undefined"&&(n=r,r=void 0),typeof n!="undefined"){if(typeof n!="function")throw new Error(Te(1));return n(Ks)(e,r)}if(typeof e!="function")throw new Error(Te(2));var o=e,i=r,a=[],l=a,u=!1;function s(){l===a&&(l=a.slice())}function f(){if(u)throw new Error(Te(3));return i}function c(y){if(typeof y!="function")throw new Error(Te(4));if(u)throw new Error(Te(5));var w=!0;return s(),l.push(y),function(){if(w){if(u)throw new Error(Te(6));w=!1,s();var v=l.indexOf(y);l.splice(v,1),a=null}}}function d(y){if(!Yg(y))throw new Error(Te(7));if(typeof y.type=="undefined")throw new Error(Te(8));if(u)throw new Error(Te(9));try{u=!0,i=o(i,y)}finally{u=!1}for(var w=a=l,m=0;m<w.length;m++){var v=w[m];v()}return y}function p(y){if(typeof y!="function")throw new Error(Te(10));o=y,d({type:_s.REPLACE})}function h(){var y,w=c;return y={subscribe:function(v){if(typeof v!="object"||v===null)throw new Error(Te(11));function g(){v.next&&v.next(f())}g();var S=w(g);return{unsubscribe:S}}},y[Hs]=function(){return this},y}return d({type:_s.INIT}),t={dispatch:d,subscribe:c,getState:f,replaceReducer:p},t[Hs]=h,t}function qs(e,r){return function(){return r(e.apply(this,arguments))}}function Qs(e,r){if(typeof e=="function")return qs(e,r);if(typeof e!="object"||e===null)throw new Error(Te(16));var n={};for(var t in e){var o=e[t];typeof o=="function"&&(n[t]=qs(o,r))}return n}function Ys(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return r.length===0?function(t){return t}:r.length===1?r[0]:r.reduce(function(t,o){return function(){return t(o.apply(void 0,arguments))}})}function Xg(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return function(t){return function(){var o=t.apply(void 0,arguments),i=function(){throw new Error(Te(15))},a={getState:o.getState,dispatch:function(){return i.apply(void 0,arguments)}},l=r.map(function(u){return u(a)});return i=Ys.apply(void 0,l)(o.dispatch),Vs(Vs({},o),{},{dispatch:i})}}}function Xs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Js=D.createContext(null);function Jg(e){e()}var Zs=Jg,Zg=function(r){return Zs=r},em=function(){return Zs};function rm(){var e=em(),r=null,n=null;return{clear:function(){r=null,n=null},notify:function(){e(function(){for(var o=r;o;)o.callback(),o=o.next})},get:function(){for(var o=[],i=r;i;)o.push(i),i=i.next;return o},subscribe:function(o){var i=!0,a=n={callback:o,next:null,prev:n};return a.prev?a.prev.next=a:r=a,function(){!i||r===null||(i=!1,a.next?a.next.prev=a.prev:n=a.prev,a.prev?a.prev.next=a.next:r=a.next)}}}}var ec={notify:function(){},get:function(){return[]}};function rc(e,r){var n,t=ec;function o(c){return u(),t.subscribe(c)}function i(){t.notify()}function a(){f.onStateChange&&f.onStateChange()}function l(){return!!n}function u(){n||(n=r?r.addNestedSub(a):e.subscribe(a),t=rm())}function s(){n&&(n(),n=void 0,t.clear(),t=ec)}var f={addNestedSub:o,notifyNestedSubs:i,handleChangeWrapper:a,isSubscribed:l,trySubscribe:u,tryUnsubscribe:s,getListeners:function(){return t}};return f}var nc=typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement!="undefined"?D.useLayoutEffect:D.useEffect;function nm(e){var r=e.store,n=e.context,t=e.children,o=D.useMemo(function(){var l=rc(r);return{store:r,subscription:l}},[r]),i=D.useMemo(function(){return r.getState()},[r]);nc(function(){var l=o.subscription;return l.onStateChange=l.notifyNestedSubs,l.trySubscribe(),i!==r.getState()&&l.notifyNestedSubs(),function(){l.tryUnsubscribe(),l.onStateChange=null}},[o,i]);var a=n||Js;return D.createElement(a.Provider,{value:o},t)}function ko(e,r){if(e==null)return{};var n={};for(var t in e)if({}.hasOwnProperty.call(e,t)){if(r.includes(t))continue;n[t]=e[t]}return n}var tc={exports:{}},K={};/** @license React v16.13.1
|
|
10
|
+
(function($,x){typeof exports=="object"&&typeof module!="undefined"?x(exports,require("react/jsx-runtime"),require("@nocobase/client"),require("react"),require("@formily/react"),require("antd"),require("@emotion/css"),require("lodash"),require("antd-style"),require("@formily/antd-v5"),require("@formily/core"),require("@ant-design/icons"),require("@formily/shared"),require("react-i18next")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","@nocobase/client","react","@formily/react","antd","@emotion/css","lodash","antd-style","@formily/antd-v5","@formily/core","@ant-design/icons","@formily/shared","react-i18next"],x):($=typeof globalThis!="undefined"?globalThis:$||self,x($["@nocobase/plugin-kanban"]={},$.jsxRuntime,$["@nocobase/client"],$.react,$["@formily/react"],$.antd,$["@emotion/css"],$.lodash,$["antd-style"],$["@formily/antd-v5"],$["@formily/core"],$["@ant-design/icons"],$["@formily/shared"],$["react-i18next"]))})(this,function($,x,P,D,J,Re,Eo,ct,xr,Fr,Ug,Gs,Po,Pn){"use strict";var Cb=Object.defineProperty,bb=Object.defineProperties;var xb=Object.getOwnPropertyDescriptors;var Da=Object.getOwnPropertySymbols;var zg=Object.prototype.hasOwnProperty,Rg=Object.prototype.propertyIsEnumerable;var Lg=($,x,P)=>x in $?Cb($,x,{enumerable:!0,configurable:!0,writable:!0,value:P}):$[x]=P,F=($,x)=>{for(var P in x||(x={}))zg.call(x,P)&&Lg($,P,x[P]);if(Da)for(var P of Da(x))Rg.call(x,P)&&Lg($,P,x[P]);return $},G=($,x)=>bb($,xb(x));var Ea=($,x)=>{var P={};for(var D in $)zg.call($,D)&&x.indexOf(D)<0&&(P[D]=$[D]);if($!=null&&Da)for(var D of Da($))x.indexOf(D)<0&&Rg.call($,D)&&(P[D]=$[D]);return P};var ur=($,x,P)=>new Promise((D,J)=>{var Re=xr=>{try{ct(P.next(xr))}catch(Fr){J(Fr)}},Eo=xr=>{try{ct(P.throw(xr))}catch(Fr){J(Fr)}},ct=xr=>xr.done?D(xr.value):Promise.resolve(xr.value).then(Re,Eo);ct((P=P.apply($,x)).next())});function Gg(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const t=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,t.get?t:{enumerable:!0,get:()=>e[n]})}}return r.default=e,Object.freeze(r)}const dt=Gg(D);var Pa=new Map,Io=new WeakMap,Ws=0,Wg=void 0;function $g(e){return e?(Io.has(e)||(Ws+=1,Io.set(e,Ws.toString())),Io.get(e)):"0"}function jg(e){return Object.keys(e).sort().filter(r=>e[r]!==void 0).map(r=>`${r}_${r==="root"?$g(e.root):e[r]}`).toString()}function Vg(e){const r=jg(e);let n=Pa.get(r);if(!n){const t=new Map;let o;const i=new IntersectionObserver(a=>{a.forEach(l=>{var u;const s=l.isIntersecting&&o.some(f=>l.intersectionRatio>=f);e.trackVisibility&&typeof l.isVisible=="undefined"&&(l.isVisible=s),(u=t.get(l.target))==null||u.forEach(f=>{f(s,l)})})},e);o=i.thresholds||(Array.isArray(e.threshold)?e.threshold:[e.threshold||0]),n={id:r,observer:i,elements:t},Pa.set(r,n)}return n}function Hg(e,r,n={},t=Wg){if(typeof window.IntersectionObserver=="undefined"&&t!==void 0){const u=e.getBoundingClientRect();return r(t,{isIntersecting:t,target:e,intersectionRatio:typeof n.threshold=="number"?n.threshold:0,time:0,boundingClientRect:u,intersectionRect:u,rootBounds:u}),()=>{}}const{id:o,observer:i,elements:a}=Vg(n),l=a.get(e)||[];return a.has(e)||a.set(e,l),l.push(r),i.observe(e),function(){l.splice(l.indexOf(r),1),l.length===0&&(a.delete(e),i.unobserve(e)),a.size===0&&(i.disconnect(),Pa.delete(o))}}function _g({threshold:e,delay:r,trackVisibility:n,rootMargin:t,root:o,triggerOnce:i,skip:a,initialInView:l,fallbackInView:u,onChange:s}={}){var f;const[c,d]=dt.useState(null),p=dt.useRef(s),[h,y]=dt.useState({inView:!!l,entry:void 0});p.current=s,dt.useEffect(()=>{if(a||!c)return;let g;return g=Hg(c,(S,C)=>{y({inView:S,entry:C}),p.current&&p.current(S,C),C.isIntersecting&&i&&g&&(g(),g=void 0)},{root:o,rootMargin:t,threshold:e,trackVisibility:n,delay:r},u),()=>{g&&g()}},[Array.isArray(e)?e.toString():e,c,o,t,i,a,n,u,r]);const w=(f=h.entry)==null?void 0:f.target,m=dt.useRef(void 0);!c&&w&&!i&&!a&&m.current!==w&&(m.current=w,y({inView:!!l,entry:void 0}));const v=[d,h.inView,h.entry];return v.ref=v[0],v.inView=v[1],v.entry=v[2],v}function Ia(e,r){return Ia=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,t){return n.__proto__=t,n},Ia(e,r)}function $s(e,r){e.prototype=Object.create(r.prototype),e.prototype.constructor=e,Ia(e,r)}function R(){return R=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var t in n)({}).hasOwnProperty.call(n,t)&&(e[t]=n[t])}return e},R.apply(null,arguments)}function ft(e){"@babel/helpers - typeof";return ft=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},ft(e)}function Kg(e,r){if(ft(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var t=n.call(e,r||"default");if(ft(t)!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function qg(e){var r=Kg(e,"string");return ft(r)=="symbol"?r:r+""}function Qg(e,r,n){return(r=qg(r))in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function js(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r&&(t=t.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,t)}return n}function Vs(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?js(Object(n),!0).forEach(function(t){Qg(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):js(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Te(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var Hs=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),ka=function(){return Math.random().toString(36).substring(7).split("").join(".")},_s={INIT:"@@redux/INIT"+ka(),REPLACE:"@@redux/REPLACE"+ka(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+ka()}};function Yg(e){if(typeof e!="object"||e===null)return!1;for(var r=e;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(e)===r}function Ks(e,r,n){var t;if(typeof r=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(Te(0));if(typeof r=="function"&&typeof n=="undefined"&&(n=r,r=void 0),typeof n!="undefined"){if(typeof n!="function")throw new Error(Te(1));return n(Ks)(e,r)}if(typeof e!="function")throw new Error(Te(2));var o=e,i=r,a=[],l=a,u=!1;function s(){l===a&&(l=a.slice())}function f(){if(u)throw new Error(Te(3));return i}function c(y){if(typeof y!="function")throw new Error(Te(4));if(u)throw new Error(Te(5));var w=!0;return s(),l.push(y),function(){if(w){if(u)throw new Error(Te(6));w=!1,s();var v=l.indexOf(y);l.splice(v,1),a=null}}}function d(y){if(!Yg(y))throw new Error(Te(7));if(typeof y.type=="undefined")throw new Error(Te(8));if(u)throw new Error(Te(9));try{u=!0,i=o(i,y)}finally{u=!1}for(var w=a=l,m=0;m<w.length;m++){var v=w[m];v()}return y}function p(y){if(typeof y!="function")throw new Error(Te(10));o=y,d({type:_s.REPLACE})}function h(){var y,w=c;return y={subscribe:function(v){if(typeof v!="object"||v===null)throw new Error(Te(11));function g(){v.next&&v.next(f())}g();var S=w(g);return{unsubscribe:S}}},y[Hs]=function(){return this},y}return d({type:_s.INIT}),t={dispatch:d,subscribe:c,getState:f,replaceReducer:p},t[Hs]=h,t}function qs(e,r){return function(){return r(e.apply(this,arguments))}}function Qs(e,r){if(typeof e=="function")return qs(e,r);if(typeof e!="object"||e===null)throw new Error(Te(16));var n={};for(var t in e){var o=e[t];typeof o=="function"&&(n[t]=qs(o,r))}return n}function Ys(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return r.length===0?function(t){return t}:r.length===1?r[0]:r.reduce(function(t,o){return function(){return t(o.apply(void 0,arguments))}})}function Xg(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return function(t){return function(){var o=t.apply(void 0,arguments),i=function(){throw new Error(Te(15))},a={getState:o.getState,dispatch:function(){return i.apply(void 0,arguments)}},l=r.map(function(u){return u(a)});return i=Ys.apply(void 0,l)(o.dispatch),Vs(Vs({},o),{},{dispatch:i})}}}function Xs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Js=D.createContext(null);function Jg(e){e()}var Zs=Jg,Zg=function(r){return Zs=r},em=function(){return Zs};function rm(){var e=em(),r=null,n=null;return{clear:function(){r=null,n=null},notify:function(){e(function(){for(var o=r;o;)o.callback(),o=o.next})},get:function(){for(var o=[],i=r;i;)o.push(i),i=i.next;return o},subscribe:function(o){var i=!0,a=n={callback:o,next:null,prev:n};return a.prev?a.prev.next=a:r=a,function(){!i||r===null||(i=!1,a.next?a.next.prev=a.prev:n=a.prev,a.prev?a.prev.next=a.next:r=a.next)}}}}var ec={notify:function(){},get:function(){return[]}};function rc(e,r){var n,t=ec;function o(c){return u(),t.subscribe(c)}function i(){t.notify()}function a(){f.onStateChange&&f.onStateChange()}function l(){return!!n}function u(){n||(n=r?r.addNestedSub(a):e.subscribe(a),t=rm())}function s(){n&&(n(),n=void 0,t.clear(),t=ec)}var f={addNestedSub:o,notifyNestedSubs:i,handleChangeWrapper:a,isSubscribed:l,trySubscribe:u,tryUnsubscribe:s,getListeners:function(){return t}};return f}var nc=typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement!="undefined"?D.useLayoutEffect:D.useEffect;function nm(e){var r=e.store,n=e.context,t=e.children,o=D.useMemo(function(){var l=rc(r);return{store:r,subscription:l}},[r]),i=D.useMemo(function(){return r.getState()},[r]);nc(function(){var l=o.subscription;return l.onStateChange=l.notifyNestedSubs,l.trySubscribe(),i!==r.getState()&&l.notifyNestedSubs(),function(){l.tryUnsubscribe(),l.onStateChange=null}},[o,i]);var a=n||Js;return D.createElement(a.Provider,{value:o},t)}function ko(e,r){if(e==null)return{};var n={};for(var t in e)if({}.hasOwnProperty.call(e,t)){if(r.includes(t))continue;n[t]=e[t]}return n}var tc={exports:{}},K={};/** @license React v16.13.1
|
|
11
11
|
* react-is.production.min.js
|
|
12
12
|
*
|
|
13
13
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -306,4 +306,4 @@ Error generating stack: `+i.message+`
|
|
|
306
306
|
// color: #8c8c8c;
|
|
307
307
|
// fontweight: normal;
|
|
308
308
|
// }
|
|
309
|
-
`,Bs=D.memo(J.RecursionField);Bs.displayName="MemorizedRecursionField";const ab=()=>{var C;const e=P.useCollection(),{setDisableCardDrag:r}=D.useContext(As)||{},n=J.useFieldSchema(),{openPopup:t,getPopupSchemaFromSchema:o}=P.usePopupUtils(),i=P.useCollectionRecordData(),a=o(n)||lb(n),[l,u]=D.useState(!1),{isPopupVisibleControlledByURL:s}=P.usePopupSettings(),f=D.useCallback(b=>{const E=b.target;b.currentTarget.contains(E)&&(s()?t({popupUidUsedInURL:a==null?void 0:a["x-uid"]}):u(!0)),b.stopPropagation()},[t,a]),c=D.useMemo(()=>({cursor:"pointer",overflow:"hidden"}),[]),d=D.useMemo(()=>Ug.createForm({values:i}),[i]),p=D.useCallback(()=>{r==null||r(!0)},[r]),h=D.useCallback(()=>{r==null||r(!1)},[r]),y=D.useMemo(()=>({type:"void",properties:{drawer:a}}),[a]),w=(C=P.getCardItemSchema)==null?void 0:C.call(P,n),{layout:m="vertical",labelAlign:v="left",labelWidth:g=120,labelWrap:S=!0}=(w==null?void 0:w["x-component-props"])||{};return x.jsxs(x.Fragment,{children:[x.jsx(Re.Card,{onClick:f,bordered:!1,hoverable:!0,style:c,className:ib,children:x.jsx(P.DndContext,{onDragStart:p,onDragEnd:h,children:x.jsx(Fr.FormLayout,{layout:m,labelAlign:v,labelWidth:m==="horizontal"?g:null,labelWrap:S,children:x.jsx(P.FormProvider,{form:d,children:x.jsx(Bs,{schema:n,onlyRenderProperties:!0})})})})}),x.jsx(P.PopupContextProvider,{visible:l,setVisible:u,children:x.jsx(P.VariablePopupRecordProvider,{recordData:i,collection:e,children:x.jsx(Bs,{schema:y})})})]})};function lb(e){var n,t,o,i;return(i=(o=(t=(n=e.parent)==null?void 0:n.properties)==null?void 0:t.cardViewer)==null?void 0:o.properties)!=null&&i.drawer?e.parent.properties.cardViewer.properties.drawer:Eg(e["x-uid"],e.root).parent.properties.cardViewer.properties.drawer}function Eg(e,r,n={value:null}){return n=n||{value:null},r.mapProperties(t=>{t["x-uid"]===e?n.value=t:Eg(e,t,n)}),n.value}const ub=e=>(e["x-read-pretty"]=!0,{type:"void","x-component":"Grid.Row",properties:{[Po.uid()]:{type:"void","x-component":"Grid.Col",properties:{[e.name||Po.uid()]:e}}}}),sb=()=>{const{designable:e}=P.useDesignable(),{render:r}=P.useSchemaInitializerRender("kanban:configureItemFields");return e?x.jsx("div",{className:"general-schema-designer",children:x.jsx("div",{className:"general-schema-designer-icons",children:x.jsx(Re.Space,{size:2,align:"center",children:r()})})}):null},Pg={wrap:ub,useInsert(){const e=J.useFieldSchema(),{t:r}=Pn.useTranslation(),n=P.useAPIClient(),{refresh:t}=P.useDesignable();return o=>{const i=e.reduceProperties((l,u)=>u["x-component"]==="Grid"?u:l,null);if(!i)return;const a=P.createDesignable({t:r,api:n,refresh:t,current:i});a.loadAPIClientEvents(),a.insertBeforeEnd(o)}},Component:e=>{const{getAriaLabel:r}=P.useGetAriaLabelOfDesigner();return x.jsx(Gs.MenuOutlined,G(F({},e),{role:"button","aria-label":r("schema-initializer"),style:{cursor:"pointer",fontSize:12}}))},items:[{type:"itemGroup",title:'{{t("Display fields")}}',name:"displayFields",useChildren:P.useFormItemInitializerFields},{type:"itemGroup",divider:!0,title:'{{t("Display association fields")}}',name:"displayAssociationFields",hideIfNoChildren:!0,useChildren(){return P.useAssociatedFormItemInitializerFields({readPretty:!0,block:"Kanban"})}},{name:"divider",type:"divider"},{name:"openMode",Component:P.SchemaInitializerOpenModeSchemaItems,useComponentProps(){const{hideOpenMode:e}=P.useOpenModeContext();return{openMode:!e,openSize:!e}}}]},Ig=new P.CompatibleSchemaInitializer(F({name:"KanbanCardInitializers"},Pg)),cb=new P.CompatibleSchemaInitializer(F({name:"kanban:configureItemFields"},Pg),Ig),db=J.observer(e=>e.children,{displayName:"KanbanCardViewer"}),fb=()=>{const{name:e,title:r}=P.useCollection_deprecated(),n=P.useSchemaTemplate();return x.jsx(P.GeneralSchemaDesigner,{schemaSettings:"blockSettings:kanban",template:n,title:r||e})},pb=new P.SchemaSettings({name:"blockSettings:kanban",items:[{name:"title",Component:P.SchemaSettingsBlockTitleItem},{name:"setTheBlockHeight",Component:P.SchemaSettingsBlockHeightItem},{name:"dataScope",Component:P.SchemaSettingsDataScope,useComponentProps(){var a,l;const{name:e}=P.useCollection_deprecated(),r=J.useFieldSchema(),{form:n}=P.useFormBlockContext(),t=J.useField(),{service:o}=ya(),{dn:i}=P.useDesignable();return{collectionName:e,defaultFilter:((l=(a=r==null?void 0:r["x-decorator-props"])==null?void 0:a.params)==null?void 0:l.filter)||{},form:n,onSubmit:({filter:u})=>{var f;u=P.removeNullCondition(u);const s=t.decoratorProps.params||{};s.filter=u,t.decoratorProps.params=s,r["x-decorator-props"].params=s,o.run(G(F({},(f=o.params)==null?void 0:f[0]),{filter:u})),i.emit("patch",{schema:{"x-uid":r["x-uid"],"x-decorator-props":r["x-decorator-props"]}})}}}},{name:"template",Component:P.SchemaSettingsTemplate,useComponentProps(){const{name:e}=P.useCollection(),{componentNamePrefix:r}=P.useBlockTemplateContext();return{componentName:`${r}Kanban`,collectionName:e}}},{name:"allowDragAndDrop",type:"switch",useComponentProps:()=>{var o;const e=J.useField(),r=J.useFieldSchema(),{t:n}=Pn.useTranslation(),{dn:t}=P.useDesignable();return{title:n("Enable drag and drop sorting"),checked:((o=e.componentProps)==null?void 0:o.dragSort)!==!1,onChange:i=>ur(this,null,function*(){e.componentProps=e.componentProps||{},e.componentProps.dragSort=i,r["x-component-props"]=r["x-component-props"]||{},r["x-component-props"].dragSort=i,t.emit("patch",{schema:{"x-uid":r["x-uid"],"x-component-props":r["x-component-props"]}})})}}},{name:"setBlockLayout",Component:P.SchemaSettingsLayoutItem},{name:"divider",type:"divider"},{name:"remove",type:"remove",componentProps:{removeParentsIfNoChildren:!0,breakRemoveOn:{"x-component":"Grid"}}}]}),kg={title:"{{t('Configure actions')}}",icon:"SettingOutlined",style:{marginLeft:8},items:[{name:"filter",title:"{{t('Filter')}}",Component:"FilterActionInitializer",schema:{"x-align":"left"}},{name:"addNew",title:"{{t('Add new')}}",Component:"CreateActionInitializer",schema:{"x-align":"right","x-decorator":"ACLActionProvider","x-acl-action-props":{skipScopeCheck:!0}},useVisible:()=>P.useActionAvailable("create")},{name:"customRequest",title:'{{t("Custom request")}}',Component:"CustomRequestInitializer",schema:{"x-action":"customize:table:request:global"}}]},Ng=new P.CompatibleSchemaInitializer(F({name:"KanbanActionInitializers"},kg)),vb=new P.CompatibleSchemaInitializer(F({name:"kanban:configureActions"},kg),Ng),xo="kanban",gb=e=>{const m=e,{sortFields:r,collectionFields:n,groupField:t,collectionName:o,dataSource:i}=m,a=Ea(m,["sortFields","collectionFields","groupField","collectionName","dataSource"]),l=J.useField(),u=P.useCompile(),s=P.useAPIClient(),{t:f}=Pn.useTranslation(),{theme:c}=P.useGlobalTheme(),d=D.useContext(J.SchemaOptionsContext),p=n==null?void 0:n.filter(v=>v.interface==="integer"),h=({scopeKey:v})=>{var C;const g=v&&n.find(b=>b.name===v),S=v&&u((C=g==null?void 0:g.uiSchema)==null?void 0:C.title);return x.jsxs("span",{style:{color:"rgba(0, 0, 0, 0.25)"},children:["(",S?f("Grouped sorting based on",{ns:xo})+`「${S}」`:f("Global sorting",{ns:xo}),")"]})},y=()=>ur(this,null,function*(){var S;const v=yield P.FormDialog(f("Create sort field"),()=>x.jsx(P.SchemaComponentOptions,{scope:d.scope,components:F({},d.components),children:x.jsx(Fr.FormLayout,{layout:"vertical",children:x.jsx(P.SchemaComponent,{schema:{properties:{"uiSchema.title":{type:"string",title:'{{t("Field display name")}}',required:!0,"x-decorator":"FormItem","x-component":"Input"},name:{type:"string",title:'{{t("Field name")}}',required:!0,"x-decorator":"FormItem","x-component":"Input","x-validator":"uid",description:"{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.')}}"},scopeKey:{type:"string",title:'{{t("Grouped sorting")}}',default:t.value,"x-disabled":!0,"x-decorator":"FormItem","x-component":"Select",enum:[t]}}}})})}),c).open({initialValues:{name:`f_${Po.uid()}`}}),{data:g}=yield s.resource("collections.fields",o).create({values:F({type:"sort",interface:"sort"},v)});l.dataSource=l.dataSource.concat([G(F({},g.data),{value:g.data.name,label:u((S=g.data.uiSchema)==null?void 0:S.title)})]),l.value=g.data.name}),w=()=>ur(this,null,function*(){var C;const v=yield P.FormDialog(f("Create sort field"),()=>x.jsx(P.SchemaComponentOptions,{scope:d.scope,components:F({},d.components),children:x.jsx(Fr.FormLayout,{layout:"vertical",children:x.jsx(P.SchemaComponent,{schema:{properties:{field:{type:"string",title:f("Convert the following integer fields to sorting fields",{ns:xo}),required:!0,"x-decorator":"FormItem","x-component":"Select",enum:p.map(b=>{var E;return{value:b.name,label:u(((E=b.uiSchema)==null?void 0:E.title)||b.name)}})},scopeKey:{type:"string",title:'{{t("Grouped sorting")}}',default:t.value,"x-disabled":!0,"x-decorator":"FormItem","x-component":"Select",enum:[t]}}}})})}),c).open({initialValues:{}}),{data:g}=yield s.request({url:`dataSourcesCollections/${i}.${o}/fields:update?filterByTk=${v.field}`,method:"post",data:F({type:"sort",interface:"sort"},v)}),S=g.data;l.dataSource=l.dataSource.concat([G(F({},S),{value:S.name,label:u((C=S.uiSchema)==null?void 0:C.title)})]),l.value=S.name});return x.jsxs(Re.Space.Compact,{style:{width:"100%"},children:[x.jsx(P.Select,G(F({options:r},a),{disabled:!t,optionRender:({label:v,data:g})=>x.jsxs(Re.Space,{children:[x.jsx("span",{children:v}),x.jsx(h,{scopeKey:g.scopeKey})]})})),x.jsx(Re.Button,{disabled:!t,onClick:i==="main"?y:w,children:f("Add new")})]})},Ag=e=>{const{collectionName:r,groupField:n,sortField:t,dataSource:o,params:i,association:a}=e,l={type:"void","x-acl-action":`${a||r}:list`,"x-decorator":"KanbanBlockProvider","x-decorator-props":{collection:r,dataSource:o,action:"list",groupField:n,sortField:t,params:F({paginate:!1},i)},"x-toolbar":"BlockSchemaToolbar","x-settings":"blockSettings:kanban","x-component":"CardItem",properties:{actions:{type:"void","x-initializer":"kanban:configureActions","x-component":"ActionBar","x-component-props":{style:{marginBottom:"var(--nb-spacing)"}},properties:{}},[Po.uid()]:{type:"array","x-component":"Kanban","x-use-component-props":"useKanbanBlockProps",properties:{card:{type:"void","x-read-pretty":!0,"x-label-disabled":!0,"x-decorator":"BlockItem","x-component":"Kanban.Card","x-component-props":{openMode:"drawer"},"x-designer":"Kanban.Card.Designer",properties:{grid:{type:"void","x-component":"Grid","x-component-props":{dndContext:!1}}}},cardViewer:{type:"void",title:'{{ t("View") }}',"x-designer":"Action.Designer","x-component":"Kanban.CardViewer","x-action":"view","x-component-props":{openMode:"drawer"},properties:{drawer:{type:"void",title:'{{ t("View record") }}',"x-component":"Action.Container","x-component-props":{className:"nb-action-popup"},properties:{tabs:{type:"void","x-component":"Tabs","x-component-props":{},"x-initializer":"popup:addTab",properties:{tab1:{type:"void",title:'{{t("Details")}}',"x-component":"Tabs.TabPane","x-designer":"Tabs.Designer","x-component-props":{},properties:{grid:{type:"void","x-component":"Grid","x-initializer":"popup:common:addBlock",properties:{}}}}}}}}}}}}}};return a&&(l["x-decorator-props"].association=a),l},Og=({item:e,sortFields:r,collectionFields:n,fields:t,options:o,api:i})=>{const a=J.useForm(),{t:l}=Pn.useTranslation();return x.jsx(P.APIClientProvider,{apiClient:i,children:x.jsx(P.SchemaComponentOptions,{scope:F({},o==null?void 0:o.scope),components:F({},o==null?void 0:o.components),children:x.jsx(Fr.FormLayout,{layout:"vertical",children:x.jsx(P.SchemaComponent,{schema:{properties:{groupField:{title:l("Grouping field"),enum:t,required:!0,description:l("Single select and radio fields can be used as the grouping field"),"x-component":"Select","x-component-props":{objectValue:!0,fieldNames:{label:"label",value:"value"},onChange:()=>{a.setValuesIn("dragSortBy",null)}},"x-decorator":"FormItem"},dragSortBy:{title:l("Sorting field",{ns:xo}),required:!0,description:l("Used for sorting kanban cards, only sorting fields corresponding to grouping fields can be selected",{ns:xo}),"x-component":gb,"x-component-props":{objectValue:!0,fieldNames:{label:"label",value:"value"},sortFields:r},"x-decorator":"FormItem","x-reactions":[u=>{var s;u.dataSource=r.map(f=>{var c,d;return G(F({},f),{disabled:f.scopeKey!==((d=(c=u.form.values)==null?void 0:c.groupField)==null?void 0:d.value)})}),u.groupField=(s=u.form.values)==null?void 0:s.groupField,u.setComponentProps({dataSource:e.dataSource,collectionName:e.collectionName||e.name,collectionFields:n,sortFields:r})},{dependencies:[".groupField"],fulfill:{schema:{"x-component-props":"{{$form.values}}"}}}]}}}})})})})},mb=({filterCollections:e,onlyCurrentDataSource:r,hideSearch:n,createBlockSchema:t,showAssociationFields:o})=>{const i=P.useSchemaInitializerItem(),{createKanbanBlock:a}=Tg();return x.jsx(P.DataBlockInitializer,G(F({},i),{componentType:"Kanban",icon:x.jsx(Gs.ProjectOutlined,{}),onCreateBlockSchema:l=>ur(this,null,function*(){if(t)return t(l);a(l)}),onlyCurrentDataSource:r,hideSearch:n,filter:e,showAssociationFields:o}))},Tg=()=>{const{insert:e}=P.useSchemaInitializer(),{t:r}=Pn.useTranslation(),{getCollectionFields:n}=P.useCollectionManager_deprecated(),t=D.useContext(J.SchemaOptionsContext),{theme:o}=P.useGlobalTheme(),i=P.useAPIClient();return{createKanbanBlock:u=>ur(this,[u],function*({item:l}){var p,h;const s=n(l.name,l.dataSource),f=(p=s==null?void 0:s.filter(y=>["select","radioGroup"].includes(y.interface)))==null?void 0:p.map(y=>{var w;return{label:(w=y==null?void 0:y.uiSchema)==null?void 0:w.title,value:y.name,uiSchema:G(F({},y.uiSchema),{name:y.name})}}),c=(h=s==null?void 0:s.filter(y=>["sort"].includes(y.interface)))==null?void 0:h.map(y=>{var w;return{label:(w=y==null?void 0:y.uiSchema)==null?void 0:w.title,value:y.name,scopeKey:y.scopeKey,uiSchema:G(F({},y.uiSchema),{name:y.name})}}),d=yield P.FormDialog(r("Create kanban block"),x.jsx(Og,{item:l,sortFields:c,collectionFields:s,fields:f,options:t,api:i}),o).open({initialValues:{}});e(Ag({sortField:d.dragSortBy,groupField:d.groupField.value,collectionName:l.name,dataSource:l.dataSource,params:{sort:[d.dragSortBy]}}))})}};function hb(){const{insert:e}=P.useSchemaInitializer(),{t:r}=Pn.useTranslation(),n=D.useContext(J.SchemaOptionsContext),{theme:t}=P.useGlobalTheme(),{getCollectionFields:o}=P.useCollectionManager_deprecated(),i=P.useAPIClient();return{createAssociationKanbanBlock:u=>ur(this,[u],function*({item:l}){var h,y;console.log(l);const s=l.associationField,f=o(l.name,l.dataSource),c=(h=f==null?void 0:f.filter(w=>["select","radioGroup"].includes(w.interface)))==null?void 0:h.map(w=>{var m;return{label:(m=w==null?void 0:w.uiSchema)==null?void 0:m.title,value:w.name,uiSchema:G(F({},w.uiSchema),{name:w.name})}}),d=(y=f==null?void 0:f.filter(w=>["sort"].includes(w.interface)))==null?void 0:y.map(w=>{var m;return{label:(m=w==null?void 0:w.uiSchema)==null?void 0:m.title,value:w.name,scopeKey:w.scopeKey,uiSchema:G(F({},w.uiSchema),{name:w.name})}}),p=yield P.FormDialog(r("Create kanban block"),x.jsx(Og,{item:l,sortFields:d,collectionFields:f,fields:c,options:n,api:i}),t).open({initialValues:{}});e(Ag({sortField:p.dragSortBy,groupField:p.groupField.value,association:`${s.collectionName}.${s.name}`,dataSource:l.dataSource,params:{sort:[p.dragSortBy]}}))})}}En.Card=ab,En.CardAdder=P.Action,En.CardViewer=db,En.Card.Designer=sb,En.Designer=fb;const yb=En,Bg=D.memo(e=>x.jsx(P.SchemaComponentOptions,{components:{Kanban:En,KanbanBlockProvider:OC,KanbanV2:yb,KanbanBlockInitializer:mb},scope:{useKanbanBlockProps:BC},children:e.children}));Bg.displayName="KanbanPluginProvider";class Sb extends P.Plugin{load(){return ur(this,null,function*(){this.app.use(Bg),this.app.schemaInitializerManager.add(Ig),this.app.schemaInitializerManager.add(cb),this.app.schemaInitializerManager.add(Ng),this.app.schemaInitializerManager.add(vb),this.app.schemaSettingsManager.add(pb);const r=this.app.schemaInitializerManager.get("page:addBlock");r==null||r.add("dataBlocks.kanban",{title:'{{t("Kanban")}}',Component:"KanbanBlockInitializer"}),this.app.schemaInitializerManager.addItem("popup:common:addBlock","dataBlocks.kanban",{title:'{{t("Kanban")}}',Component:"KanbanBlockInitializer",useComponentProps(){const{createAssociationKanbanBlock:n}=hb(),{createKanbanBlock:t}=Tg();return{onlyCurrentDataSource:!0,filterCollections({associationField:o}){return o?["hasMany","belongsToMany"].includes(o.type):!1},createBlockSchema:({item:o,fromOthersInPopup:i})=>{if(i)return t({item:o});n({item:o})},showAssociationFields:!0,hideSearch:!0}}})})}}$.default=Sb,Object.defineProperties($,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
309
|
+
`,Bs=D.memo(J.RecursionField);Bs.displayName="MemorizedRecursionField";const ab=()=>{var C;const e=P.useCollection(),{setDisableCardDrag:r}=D.useContext(As)||{},n=J.useFieldSchema(),{openPopup:t,getPopupSchemaFromSchema:o}=P.usePopupUtils(),i=P.useCollectionRecordData(),a=o(n)||lb(n),[l,u]=D.useState(!1),{isPopupVisibleControlledByURL:s}=P.usePopupSettings(),f=D.useCallback(b=>{const E=b.target;b.currentTarget.contains(E)&&(s()?t({popupUidUsedInURL:a==null?void 0:a["x-uid"]}):u(!0)),b.stopPropagation()},[t,a]),c=D.useMemo(()=>({cursor:"pointer",overflow:"hidden"}),[]),d=D.useMemo(()=>Ug.createForm({values:i}),[i]),p=D.useCallback(()=>{r==null||r(!0)},[r]),h=D.useCallback(()=>{r==null||r(!1)},[r]),y=D.useMemo(()=>({type:"void",properties:{drawer:a}}),[a]),w=(C=P.getCardItemSchema)==null?void 0:C.call(P,n),{layout:m="vertical",labelAlign:v="left",labelWidth:g=120,labelWrap:S=!0}=(w==null?void 0:w["x-component-props"])||{};return x.jsxs(x.Fragment,{children:[x.jsx(Re.Card,{onClick:f,bordered:!1,hoverable:!0,style:c,className:ib,children:x.jsx(P.DndContext,{onDragStart:p,onDragEnd:h,children:x.jsx(Fr.FormLayout,{layout:m,labelAlign:v,labelWidth:m==="horizontal"?g:null,labelWrap:S,children:x.jsx(P.FormProvider,{form:d,children:x.jsx(Bs,{schema:n,onlyRenderProperties:!0})})})})}),x.jsx(P.PopupContextProvider,{visible:l,setVisible:u,children:x.jsx(P.VariablePopupRecordProvider,{recordData:i,collection:e,children:x.jsx(Bs,{schema:y})})})]})};function lb(e){var n,t,o,i;return(i=(o=(t=(n=e.parent)==null?void 0:n.properties)==null?void 0:t.cardViewer)==null?void 0:o.properties)!=null&&i.drawer?e.parent.properties.cardViewer.properties.drawer:Eg(e["x-uid"],e.root).parent.properties.cardViewer.properties.drawer}function Eg(e,r,n={value:null}){return n=n||{value:null},r.mapProperties(t=>{t["x-uid"]===e?n.value=t:Eg(e,t,n)}),n.value}const ub=e=>(e["x-read-pretty"]=!0,{type:"void","x-component":"Grid.Row",properties:{[Po.uid()]:{type:"void","x-component":"Grid.Col",properties:{[e.name||Po.uid()]:e}}}}),sb=()=>{const{designable:e}=P.useDesignable(),{render:r}=P.useSchemaInitializerRender("kanban:configureItemFields");return e?x.jsx("div",{className:"general-schema-designer",children:x.jsx("div",{className:"general-schema-designer-icons",children:x.jsx(Re.Space,{size:2,align:"center",children:r()})})}):null},Pg={wrap:ub,useInsert(){const e=J.useFieldSchema(),{t:r}=Pn.useTranslation(),n=P.useAPIClient(),{refresh:t}=P.useDesignable();return o=>{const i=e.reduceProperties((l,u)=>u["x-component"]==="Grid"?u:l,null);if(!i)return;const a=P.createDesignable({t:r,api:n,refresh:t,current:i});a.loadAPIClientEvents(),a.insertBeforeEnd(o)}},Component:e=>{const{getAriaLabel:r}=P.useGetAriaLabelOfDesigner();return x.jsx(Gs.MenuOutlined,G(F({},e),{role:"button","aria-label":r("schema-initializer"),style:{cursor:"pointer",fontSize:12}}))},items:[{type:"itemGroup",title:'{{t("Display fields")}}',name:"displayFields",useChildren:P.useFormItemInitializerFields},{name:"parentCollectionFields",Component:P.ParentCollectionFields},{type:"itemGroup",divider:!0,title:'{{t("Display association fields")}}',name:"displayAssociationFields",hideIfNoChildren:!0,useChildren(){return P.useAssociatedFormItemInitializerFields({readPretty:!0,block:"Kanban"})}},{name:"divider",type:"divider"},{name:"openMode",Component:P.SchemaInitializerOpenModeSchemaItems,useComponentProps(){const{hideOpenMode:e}=P.useOpenModeContext();return{openMode:!e,openSize:!e}}}]},Ig=new P.CompatibleSchemaInitializer(F({name:"KanbanCardInitializers"},Pg)),cb=new P.CompatibleSchemaInitializer(F({name:"kanban:configureItemFields"},Pg),Ig),db=J.observer(e=>e.children,{displayName:"KanbanCardViewer"}),fb=()=>{const{name:e,title:r}=P.useCollection_deprecated(),n=P.useSchemaTemplate();return x.jsx(P.GeneralSchemaDesigner,{schemaSettings:"blockSettings:kanban",template:n,title:r||e})},pb=new P.SchemaSettings({name:"blockSettings:kanban",items:[{name:"title",Component:P.SchemaSettingsBlockTitleItem},{name:"setTheBlockHeight",Component:P.SchemaSettingsBlockHeightItem},{name:"dataScope",Component:P.SchemaSettingsDataScope,useComponentProps(){var a,l;const{name:e}=P.useCollection_deprecated(),r=J.useFieldSchema(),{form:n}=P.useFormBlockContext(),t=J.useField(),{service:o}=ya(),{dn:i}=P.useDesignable();return{collectionName:e,defaultFilter:((l=(a=r==null?void 0:r["x-decorator-props"])==null?void 0:a.params)==null?void 0:l.filter)||{},form:n,onSubmit:({filter:u})=>{var f;u=P.removeNullCondition(u);const s=t.decoratorProps.params||{};s.filter=u,t.decoratorProps.params=s,r["x-decorator-props"].params=s,o.run(G(F({},(f=o.params)==null?void 0:f[0]),{filter:u})),i.emit("patch",{schema:{"x-uid":r["x-uid"],"x-decorator-props":r["x-decorator-props"]}})}}}},{name:"template",Component:P.SchemaSettingsTemplate,useComponentProps(){const{name:e}=P.useCollection(),{componentNamePrefix:r}=P.useBlockTemplateContext();return{componentName:`${r}Kanban`,collectionName:e}}},{name:"allowDragAndDrop",type:"switch",useComponentProps:()=>{var o;const e=J.useField(),r=J.useFieldSchema(),{t:n}=Pn.useTranslation(),{dn:t}=P.useDesignable();return{title:n("Enable drag and drop sorting"),checked:((o=e.componentProps)==null?void 0:o.dragSort)!==!1,onChange:i=>ur(this,null,function*(){e.componentProps=e.componentProps||{},e.componentProps.dragSort=i,r["x-component-props"]=r["x-component-props"]||{},r["x-component-props"].dragSort=i,t.emit("patch",{schema:{"x-uid":r["x-uid"],"x-component-props":r["x-component-props"]}})})}}},{name:"setBlockLayout",Component:P.SchemaSettingsLayoutItem},{name:"divider",type:"divider"},{name:"remove",type:"remove",componentProps:{removeParentsIfNoChildren:!0,breakRemoveOn:{"x-component":"Grid"}}}]}),kg={title:"{{t('Configure actions')}}",icon:"SettingOutlined",style:{marginLeft:8},items:[{name:"filter",title:"{{t('Filter')}}",Component:"FilterActionInitializer",schema:{"x-align":"left"}},{name:"addNew",title:"{{t('Add new')}}",Component:"CreateActionInitializer",schema:{"x-align":"right","x-decorator":"ACLActionProvider","x-acl-action-props":{skipScopeCheck:!0}},useVisible:()=>P.useActionAvailable("create")},{name:"customRequest",title:'{{t("Custom request")}}',Component:"CustomRequestInitializer",schema:{"x-action":"customize:table:request:global"}}]},Ng=new P.CompatibleSchemaInitializer(F({name:"KanbanActionInitializers"},kg)),vb=new P.CompatibleSchemaInitializer(F({name:"kanban:configureActions"},kg),Ng),xo="kanban",gb=e=>{const m=e,{sortFields:r,collectionFields:n,groupField:t,collectionName:o,dataSource:i}=m,a=Ea(m,["sortFields","collectionFields","groupField","collectionName","dataSource"]),l=J.useField(),u=P.useCompile(),s=P.useAPIClient(),{t:f}=Pn.useTranslation(),{theme:c}=P.useGlobalTheme(),d=D.useContext(J.SchemaOptionsContext),p=n==null?void 0:n.filter(v=>v.interface==="integer"),h=({scopeKey:v})=>{var C;const g=v&&n.find(b=>b.name===v),S=v&&u((C=g==null?void 0:g.uiSchema)==null?void 0:C.title);return x.jsxs("span",{style:{color:"rgba(0, 0, 0, 0.25)"},children:["(",S?f("Grouped sorting based on",{ns:xo})+`「${S}」`:f("Global sorting",{ns:xo}),")"]})},y=()=>ur(this,null,function*(){var S;const v=yield P.FormDialog(f("Create sort field"),()=>x.jsx(P.SchemaComponentOptions,{scope:d.scope,components:F({},d.components),children:x.jsx(Fr.FormLayout,{layout:"vertical",children:x.jsx(P.SchemaComponent,{schema:{properties:{"uiSchema.title":{type:"string",title:'{{t("Field display name")}}',required:!0,"x-decorator":"FormItem","x-component":"Input"},name:{type:"string",title:'{{t("Field name")}}',required:!0,"x-decorator":"FormItem","x-component":"Input","x-validator":"uid",description:"{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.')}}"},scopeKey:{type:"string",title:'{{t("Grouped sorting")}}',default:t.value,"x-disabled":!0,"x-decorator":"FormItem","x-component":"Select",enum:[t]}}}})})}),c).open({initialValues:{name:`f_${Po.uid()}`}}),{data:g}=yield s.resource("collections.fields",o).create({values:F({type:"sort",interface:"sort"},v)});l.dataSource=l.dataSource.concat([G(F({},g.data),{value:g.data.name,label:u((S=g.data.uiSchema)==null?void 0:S.title)})]),l.value=g.data.name}),w=()=>ur(this,null,function*(){var C;const v=yield P.FormDialog(f("Create sort field"),()=>x.jsx(P.SchemaComponentOptions,{scope:d.scope,components:F({},d.components),children:x.jsx(Fr.FormLayout,{layout:"vertical",children:x.jsx(P.SchemaComponent,{schema:{properties:{field:{type:"string",title:f("Convert the following integer fields to sorting fields",{ns:xo}),required:!0,"x-decorator":"FormItem","x-component":"Select",enum:p.map(b=>{var E;return{value:b.name,label:u(((E=b.uiSchema)==null?void 0:E.title)||b.name)}})},scopeKey:{type:"string",title:'{{t("Grouped sorting")}}',default:t.value,"x-disabled":!0,"x-decorator":"FormItem","x-component":"Select",enum:[t]}}}})})}),c).open({initialValues:{}}),{data:g}=yield s.request({url:`dataSourcesCollections/${i}.${o}/fields:update?filterByTk=${v.field}`,method:"post",data:F({type:"sort",interface:"sort"},v)}),S=g.data;l.dataSource=l.dataSource.concat([G(F({},S),{value:S.name,label:u((C=S.uiSchema)==null?void 0:C.title)})]),l.value=S.name});return x.jsxs(Re.Space.Compact,{style:{width:"100%"},children:[x.jsx(P.Select,G(F({options:r},a),{disabled:!t,optionRender:({label:v,data:g})=>x.jsxs(Re.Space,{children:[x.jsx("span",{children:v}),x.jsx(h,{scopeKey:g.scopeKey})]})})),x.jsx(Re.Button,{disabled:!t,onClick:i==="main"?y:w,children:f("Add new")})]})},Ag=e=>{const{collectionName:r,groupField:n,sortField:t,dataSource:o,params:i,association:a}=e,l={type:"void","x-acl-action":`${a||r}:list`,"x-decorator":"KanbanBlockProvider","x-decorator-props":{collection:r,dataSource:o,action:"list",groupField:n,sortField:t,params:F({paginate:!1},i)},"x-toolbar":"BlockSchemaToolbar","x-settings":"blockSettings:kanban","x-component":"CardItem",properties:{actions:{type:"void","x-initializer":"kanban:configureActions","x-component":"ActionBar","x-component-props":{style:{marginBottom:"var(--nb-spacing)"}},properties:{}},[Po.uid()]:{type:"array","x-component":"Kanban","x-use-component-props":"useKanbanBlockProps",properties:{card:{type:"void","x-read-pretty":!0,"x-label-disabled":!0,"x-decorator":"BlockItem","x-component":"Kanban.Card","x-component-props":{openMode:"drawer"},"x-designer":"Kanban.Card.Designer",properties:{grid:{type:"void","x-component":"Grid","x-component-props":{dndContext:!1}}}},cardViewer:{type:"void",title:'{{ t("View") }}',"x-designer":"Action.Designer","x-component":"Kanban.CardViewer","x-action":"view","x-component-props":{openMode:"drawer"},properties:{drawer:{type:"void",title:'{{ t("View record") }}',"x-component":"Action.Container","x-component-props":{className:"nb-action-popup"},properties:{tabs:{type:"void","x-component":"Tabs","x-component-props":{},"x-initializer":"popup:addTab",properties:{tab1:{type:"void",title:'{{t("Details")}}',"x-component":"Tabs.TabPane","x-designer":"Tabs.Designer","x-component-props":{},properties:{grid:{type:"void","x-component":"Grid","x-initializer":"popup:common:addBlock",properties:{}}}}}}}}}}}}}};return a&&(l["x-decorator-props"].association=a),l},Og=({item:e,sortFields:r,collectionFields:n,fields:t,options:o,api:i})=>{const a=J.useForm(),{t:l}=Pn.useTranslation();return x.jsx(P.APIClientProvider,{apiClient:i,children:x.jsx(P.SchemaComponentOptions,{scope:F({},o==null?void 0:o.scope),components:F({},o==null?void 0:o.components),children:x.jsx(Fr.FormLayout,{layout:"vertical",children:x.jsx(P.SchemaComponent,{schema:{properties:{groupField:{title:l("Grouping field"),enum:t,required:!0,description:l("Single select and radio fields can be used as the grouping field"),"x-component":"Select","x-component-props":{objectValue:!0,fieldNames:{label:"label",value:"value"},onChange:()=>{a.setValuesIn("dragSortBy",null)}},"x-decorator":"FormItem"},dragSortBy:{title:l("Sorting field",{ns:xo}),required:!0,description:l("Used for sorting kanban cards, only sorting fields corresponding to grouping fields can be selected",{ns:xo}),"x-component":gb,"x-component-props":{objectValue:!0,fieldNames:{label:"label",value:"value"},sortFields:r},"x-decorator":"FormItem","x-reactions":[u=>{var s;u.dataSource=r.map(f=>{var c,d;return G(F({},f),{disabled:f.scopeKey!==((d=(c=u.form.values)==null?void 0:c.groupField)==null?void 0:d.value)})}),u.groupField=(s=u.form.values)==null?void 0:s.groupField,u.setComponentProps({dataSource:e.dataSource,collectionName:e.collectionName||e.name,collectionFields:n,sortFields:r})},{dependencies:[".groupField"],fulfill:{schema:{"x-component-props":"{{$form.values}}"}}}]}}}})})})})},mb=({filterCollections:e,onlyCurrentDataSource:r,hideSearch:n,createBlockSchema:t,showAssociationFields:o})=>{const i=P.useSchemaInitializerItem(),{createKanbanBlock:a}=Tg();return x.jsx(P.DataBlockInitializer,G(F({},i),{componentType:"Kanban",icon:x.jsx(Gs.ProjectOutlined,{}),onCreateBlockSchema:l=>ur(this,null,function*(){if(t)return t(l);a(l)}),onlyCurrentDataSource:r,hideSearch:n,filter:e,showAssociationFields:o}))},Tg=()=>{const{insert:e}=P.useSchemaInitializer(),{t:r}=Pn.useTranslation(),{getCollectionFields:n}=P.useCollectionManager_deprecated(),t=D.useContext(J.SchemaOptionsContext),{theme:o}=P.useGlobalTheme(),i=P.useAPIClient();return{createKanbanBlock:u=>ur(this,[u],function*({item:l}){var p,h;const s=n(l.name,l.dataSource),f=(p=s==null?void 0:s.filter(y=>["select","radioGroup"].includes(y.interface)))==null?void 0:p.map(y=>{var w;return{label:(w=y==null?void 0:y.uiSchema)==null?void 0:w.title,value:y.name,uiSchema:G(F({},y.uiSchema),{name:y.name})}}),c=(h=s==null?void 0:s.filter(y=>["sort"].includes(y.interface)))==null?void 0:h.map(y=>{var w;return{label:(w=y==null?void 0:y.uiSchema)==null?void 0:w.title,value:y.name,scopeKey:y.scopeKey,uiSchema:G(F({},y.uiSchema),{name:y.name})}}),d=yield P.FormDialog(r("Create kanban block"),x.jsx(Og,{item:l,sortFields:c,collectionFields:s,fields:f,options:t,api:i}),o).open({initialValues:{}});e(Ag({sortField:d.dragSortBy,groupField:d.groupField.value,collectionName:l.name,dataSource:l.dataSource,params:{sort:[d.dragSortBy]}}))})}};function hb(){const{insert:e}=P.useSchemaInitializer(),{t:r}=Pn.useTranslation(),n=D.useContext(J.SchemaOptionsContext),{theme:t}=P.useGlobalTheme(),{getCollectionFields:o}=P.useCollectionManager_deprecated(),i=P.useAPIClient();return{createAssociationKanbanBlock:u=>ur(this,[u],function*({item:l}){var h,y;console.log(l);const s=l.associationField,f=o(l.name,l.dataSource),c=(h=f==null?void 0:f.filter(w=>["select","radioGroup"].includes(w.interface)))==null?void 0:h.map(w=>{var m;return{label:(m=w==null?void 0:w.uiSchema)==null?void 0:m.title,value:w.name,uiSchema:G(F({},w.uiSchema),{name:w.name})}}),d=(y=f==null?void 0:f.filter(w=>["sort"].includes(w.interface)))==null?void 0:y.map(w=>{var m;return{label:(m=w==null?void 0:w.uiSchema)==null?void 0:m.title,value:w.name,scopeKey:w.scopeKey,uiSchema:G(F({},w.uiSchema),{name:w.name})}}),p=yield P.FormDialog(r("Create kanban block"),x.jsx(Og,{item:l,sortFields:d,collectionFields:f,fields:c,options:n,api:i}),t).open({initialValues:{}});e(Ag({sortField:p.dragSortBy,groupField:p.groupField.value,association:`${s.collectionName}.${s.name}`,dataSource:l.dataSource,params:{sort:[p.dragSortBy]}}))})}}En.Card=ab,En.CardAdder=P.Action,En.CardViewer=db,En.Card.Designer=sb,En.Designer=fb;const yb=En,Bg=D.memo(e=>x.jsx(P.SchemaComponentOptions,{components:{Kanban:En,KanbanBlockProvider:OC,KanbanV2:yb,KanbanBlockInitializer:mb},scope:{useKanbanBlockProps:BC},children:e.children}));Bg.displayName="KanbanPluginProvider";class Sb extends P.Plugin{load(){return ur(this,null,function*(){this.app.use(Bg),this.app.schemaInitializerManager.add(Ig),this.app.schemaInitializerManager.add(cb),this.app.schemaInitializerManager.add(Ng),this.app.schemaInitializerManager.add(vb),this.app.schemaSettingsManager.add(pb);const r=this.app.schemaInitializerManager.get("page:addBlock");r==null||r.add("dataBlocks.kanban",{title:'{{t("Kanban")}}',Component:"KanbanBlockInitializer"}),this.app.schemaInitializerManager.addItem("popup:common:addBlock","dataBlocks.kanban",{title:'{{t("Kanban")}}',Component:"KanbanBlockInitializer",useComponentProps(){const{createAssociationKanbanBlock:n}=hb(),{createKanbanBlock:t}=Tg();return{onlyCurrentDataSource:!0,filterCollections({associationField:o}){return o?["hasMany","belongsToMany"].includes(o.type):!1},createBlockSchema:({item:o,fromOthersInPopup:i})=>{if(i)return t({item:o});n({item:o})},showAssociationFields:!0,hideSearch:!0}}})})}}$.default=Sb,Object.defineProperties($,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/dist/externalVersion.js
CHANGED
|
@@ -11,16 +11,16 @@ module.exports = {
|
|
|
11
11
|
"@ant-design/icons": "5.2.6",
|
|
12
12
|
"@formily/react": "2.3.0",
|
|
13
13
|
"@formily/shared": "2.3.2",
|
|
14
|
-
"@nocobase/client": "1.4.
|
|
14
|
+
"@nocobase/client": "1.4.18",
|
|
15
15
|
"antd": "5.12.8",
|
|
16
16
|
"react": "18.2.0",
|
|
17
17
|
"react-i18next": "11.18.6",
|
|
18
18
|
"@emotion/css": "11.13.0",
|
|
19
19
|
"@formily/antd-v5": "1.1.9",
|
|
20
20
|
"@formily/core": "2.3.0",
|
|
21
|
-
"@nocobase/utils": "1.4.
|
|
21
|
+
"@nocobase/utils": "1.4.18",
|
|
22
22
|
"lodash": "4.17.21",
|
|
23
|
-
"@nocobase/server": "1.4.
|
|
24
|
-
"@nocobase/test": "1.4.
|
|
23
|
+
"@nocobase/server": "1.4.18",
|
|
24
|
+
"@nocobase/test": "1.4.18",
|
|
25
25
|
"antd-style": "3.7.1"
|
|
26
26
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/plugin-kanban",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.18",
|
|
4
4
|
"main": "dist/server/index.js",
|
|
5
5
|
"homepage": "https://docs.nocobase.com/handbook/block-kanban",
|
|
6
6
|
"homepage.zh-CN": "https://docs-cn.nocobase.com/handbook/block-kanban",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"devDependencies": {
|
|
18
18
|
"react-intersection-observer": "^9.8.1"
|
|
19
19
|
},
|
|
20
|
-
"gitHead": "
|
|
20
|
+
"gitHead": "0d60bc9a89670c7ec372de3d7b209a67d4c61daa",
|
|
21
21
|
"keywords": [
|
|
22
22
|
"Blocks"
|
|
23
23
|
]
|