@nocobase/plugin-action-export 3.0.0-alpha.6 → 3.0.0-alpha.7
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 +1 -1
- package/dist/client-v2/ExportActionModel.d.ts +11 -0
- package/dist/client-v2/buildExportFieldOptions.d.ts +15 -0
- package/dist/client-v2/getOptionFields.d.ts +4 -0
- package/dist/client-v2/index.js +1 -1
- package/dist/externalVersion.js +9 -9
- package/dist/node_modules/exceljs/package.json +1 -1
- package/package.json +2 -2
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("lodash"),require("react-i18next"),require("@nocobase/flow-engine"),require("@nocobase/client-v2"),require("@emotion/css"),require("@formily/antd-v5"),require("@formily/shared"),require("react"),require("antd"),require("@nocobase/client"),require("@formily/react")):"function"==typeof define&&define.amd?define("@nocobase/plugin-action-export",["lodash","react-i18next","@nocobase/flow-engine","@nocobase/client-v2","@emotion/css","@formily/antd-v5","@formily/shared","react","antd","@nocobase/client","@formily/react"],t):"object"==typeof exports?exports["@nocobase/plugin-action-export"]=t(require("lodash"),require("react-i18next"),require("@nocobase/flow-engine"),require("@nocobase/client-v2"),require("@emotion/css"),require("@formily/antd-v5"),require("@formily/shared"),require("react"),require("antd"),require("@nocobase/client"),require("@formily/react")):e["@nocobase/plugin-action-export"]=t(e.lodash,e["react-i18next"],e["@nocobase/flow-engine"],e["@nocobase/client-v2"],e["@emotion/css"],e["@formily/antd-v5"],e["@formily/shared"],e.react,e.antd,e["@nocobase/client"],e["@formily/react"])}(self,function(e,t,n,r,o,i,a,l,c,u,s){return function(){var p={574:function(e,t,n){var r,o;void 0===(o="function"==typeof(r=function(){"use strict";function t(e,t,n){var r=new XMLHttpRequest;r.open("GET",e),r.responseType="blob",r.onload=function(){l(r.response,t,n)},r.onerror=function(){console.error("could not download file")},r.send()}function r(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch(e){}return 200<=t.status&&299>=t.status}function o(e){try{e.dispatchEvent(new MouseEvent("click"))}catch(n){var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var i="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof n.g&&n.g.global===n.g?n.g:void 0,a=i.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),l=i.saveAs||("object"!=typeof window||window!==i?function(){}:"download"in HTMLAnchorElement.prototype&&!a?function(e,n,a){var l=i.URL||i.webkitURL,c=document.createElement("a");c.download=n=n||e.name||"download",c.rel="noopener","string"==typeof e?(c.href=e,c.origin===location.origin?o(c):r(c.href)?t(e,n,a):o(c,c.target="_blank")):(c.href=l.createObjectURL(e),setTimeout(function(){l.revokeObjectURL(c.href)},4e4),setTimeout(function(){o(c)},0))}:"msSaveOrOpenBlob"in navigator?function(e,n,i){if(n=n||e.name||"download","string"!=typeof e){var a;navigator.msSaveOrOpenBlob((void 0===(a=i)?a={autoBom:!1}:"object"!=typeof a&&(console.warn("Deprecated: Expected third argument to be a object"),a={autoBom:!a}),a.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\uFEFF",e],{type:e.type}):e),n)}else if(r(e))t(e,n,i);else{var l=document.createElement("a");l.href=e,l.target="_blank",setTimeout(function(){o(l)})}}:function(e,n,r,o){if((o=o||open("","_blank"))&&(o.document.title=o.document.body.innerText="downloading..."),"string"==typeof e)return t(e,n,r);var l="application/octet-stream"===e.type,c=/constructor/i.test(i.HTMLElement)||i.safari,u=/CriOS\/[\d]+/.test(navigator.userAgent);if((u||l&&c||a)&&"u">typeof FileReader){var s=new FileReader;s.onloadend=function(){var e=s.result;e=u?e:e.replace(/^data:[^;]*;/,"data:attachment/file;"),o?o.location.href=e:location=e,o=null},s.readAsDataURL(e)}else{var p=i.URL||i.webkitURL,f=p.createObjectURL(e);o?o.location=f:location.href=f,o=null,setTimeout(function(){p.revokeObjectURL(f)},4e4)}});i.saveAs=l.saveAs=l,e.exports=l})?r.apply(t,[]):r)||(e.exports=o)},477:function(e){"use strict";e.exports=o},418:function(e){"use strict";e.exports=i},230:function(e){"use strict";e.exports=s},166:function(e){"use strict";e.exports=a},342:function(e){"use strict";e.exports=u},485:function(e){"use strict";e.exports=r},694:function(e){"use strict";e.exports=n},59:function(e){"use strict";e.exports=c},773:function(t){"use strict";t.exports=e},155:function(e){"use strict";e.exports=l},953:function(e){"use strict";e.exports=t}},f={};function d(e){var t=f[e];if(void 0!==t)return t.exports;var n=f[e]={exports:{}};return p[e].call(n.exports,n,n.exports,d),n.exports}d.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return d.d(t,{a:t}),t},d.d=function(e,t){for(var n in t)d.o(t,n)&&!d.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},d.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),d.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},d.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},d.g.importScripts&&(m=d.g.location+"");var m,b=d.g.document;if(!m&&b&&(b.currentScript&&"SCRIPT"===b.currentScript.tagName.toUpperCase()&&(m=b.currentScript.src),!m)){var y=b.getElementsByTagName("script");if(y.length)for(var v=y.length-1;v>-1&&(!m||!/^http(s?):/.test(m));)m=y[v--].src}if(!m)throw Error("Automatic publicPath is not supported in this browser");d.p=m.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/");var h={};return!function(){"use strict";var e="",t="u">typeof document?document.currentScript:null;if(t&&t.src){var n=t.src.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"");n.indexOf("/static/plugins/@nocobase/plugin-action-export/dist/client/")>=0&&(e=n.replace(/\/[^\/]+$/,"/"))}if(!e){var r=window.__webpack_public_path__||"";r&&("/"!==r.charAt(r.length-1)&&(r+="/"),e=r+"static/plugins/@nocobase/plugin-action-export/dist/client/")}if(!e){var o=window.__nocobase_modern_client_prefix__||"v",i="/"+(o=String(o).replace(/^\/+|\/+$/g,"")||"v")+"/";if(!(e=window.__nocobase_public_path__||"")&&window.location&&window.location.pathname){var a=window.location.pathname||"/",l=a.indexOf(i);e=l>=0?a.slice(0,l+1):"/"}e&&(e=e.replace(RegExp("/"+o+"/?$"),"/")),e||(e="/"),"/"!==e.charAt(e.length-1)&&(e+="/"),e+="static/plugins/@nocobase/plugin-action-export/dist/client/"}d.p=e}(),!function(){"use strict";d.r(h),d.d(h,{PluginActionExportClient:function(){return eh},ExportDesigner:function(){return D},buildExportFieldOptions:function(){return x},default:function(){return eg},ExportActionModel:function(){return ec},ExportPluginProvider:function(){return B},useExportAction:function(){return $},ExportActionInitializer:function(){return A}});var e,t=d(166),n=d(342),r=d(155),o=d.n(r),i=d(230);function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function l(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){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function c(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}var u=["hasMany","belongsToMany","belongsToArray"],s=((function(e){if(Array.isArray(e))return a(e)})(e=["hasOne","belongsTo"])||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e){if(e){if("string"==typeof e)return a(e,void 0);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 a(e,void 0)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).concat(["hasMany","belongsToMany","belongsToArray"]),p=new WeakMap,f=function(e){return(null==e?void 0:e.target)&&s.includes(e.type)},m=function(e){return(null==e?void 0:e.target)&&u.includes(e.type)},b=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{name:e.name,title:t(e),schema:null==e?void 0:e.uiSchema,disabled:n}},y=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=f(e),o=c(l({},b(e,t)),{isLeaf:!r});return p.set(o,{field:e,relationDepth:r?n:0}),o},v=function(e,t,n){return!(n>=2||m(e)&&m(t))},g=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if(!(null==e?void 0:e.interface))return null;if(!f(e))return b(e,t);var o=(n(e)||[]).map(function(o){return f(o)?v(e,o,r)?g(o,t,n,r+1):null:g(o,t,n)}).filter(Boolean);return o.length?c(l({},b(e,t)),{children:o}):b(e,t,!0)},x=function(e,t,n){return(e||[]).map(function(e){return g(e,t,n,+!!f(e))}).filter(Boolean)},S=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.parentField,o=n.parentRelationDepth,i=void 0===o?0:o;return(e||[]).map(function(e){return!(null==e?void 0:e.interface)||r&&f(e)&&!v(r,e,i)?null:y(e,t,f(e)?i+1:0)}).filter(Boolean)},w=function(e,t,n){var r=e&&(void 0===e?"undefined":e&&"u">typeof Symbol&&e.constructor===Symbol?"symbol":typeof e)=="object"?p.get(e):null,o=null==r?void 0:r.field;return f(o)?S(n(o)||[],t,{parentField:o,parentRelationDepth:(null==r?void 0:r.relationDepth)||1}):[]},O=function(e,t,n){var r=S(e,t),o=function(e){if(!e||e.isLeaf)return[];if(e.children)return e.children;var r=w(e,t,n);return r.length?e.children=r:(e.isLeaf=!0,e.disabled=!0,e.children=[]),e.children};return{getRootOptions:function(){return r},loadChildren:o,preloadPath:function(e){if(!Array.isArray(e)||e.length<=1)return!1;for(var t=!1,n=r,i=0;i<e.length-1&&"break"!==function(r){var i,a,l=null!=(i=null==(a=e[r])?void 0:a.name)?i:e[r],c=n.find(function(e){return(null==e?void 0:e.name)===l});if(!c||c.isLeaf)return"break";var u=!!c.children;n=o(c),u||(t=!0)}(i);i++);return t}}},j=function(e){var t,r=(0,i.useFieldSchema)();null==r||null==(t=r["x-component-props"])||t.nonfilterable;var o=(0,n.useCollectionManager_deprecated)().getCollectionFields,a=o(e),l=(0,n.useCompile)();return x(a,function(e){var t;return l(null==e||null==(t=e.uiSchema)?void 0:t.title)||e.name},function(e){return o(e.target)})},A=function(){var e=(0,n.useSchemaInitializerItem)(),r=(0,n.useSchemaInitializer)().insert,i=j((0,n.useCollection_deprecated)().name),a={type:"void",title:'{{ t("Export") }}',"x-action":"export","x-action-settings":{exportSettings:[]},"x-toolbar":"ActionSchemaToolbar","x-settings":"actionSettings:export","x-decorator":"ACLActionProvider","x-component":"Action","x-use-component-props":"useExportAction","x-component-props":{icon:"clouddownloadoutlined"}};return o().createElement(n.SchemaInitializerItem,{title:e.title,onClick:function(){a["x-action-settings"].exportSettings=null==i?void 0:i.filter(function(e){return!e.children&&!e.disabled}).map(function(e){return{dataIndex:[e.name]}});var n,o=(0,t.merge)(a||{},e.schema||{});null==e||null==(n=e.schemaInitialize)||n.call(e,o),r(o)}})},I=d(418);function P(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function E(){var e=P(["\n width: 100%;\n & .ant-space-item:nth-child(2),\n & .ant-space-item:nth-child(3) {\n flex: 1;\n }\n "]);return E=function(){return e},e}function k(){var e=P(["\n border-color: var(--colorSettings);\n color: var(--colorSettings);\n &.ant-btn-dashed:hover {\n border-color: var(--colorSettings);\n color: var(--colorSettings);\n }\n "]);return k=function(){return e},e}var C=function(){var e=(0,n.useCollection_deprecated)().name,t=(0,n.useCompile)(),r=j(e);return{schema:{type:"void","x-component":"Grid",properties:{exportSettings:{type:"array","x-component":"ArrayItems","x-decorator":"FormItem",items:{type:"object",properties:{space:{type:"void","x-component":"Space","x-component-props":{className:(0,n.css)(E())},properties:{sort:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.SortHandle"},dataIndex:{type:"array","x-decorator":"FormItem","x-component":"Cascader",required:!0,"x-component-props":{fieldNames:{label:"title",value:"name",children:"children"},changeOnSelect:!1},"x-use-component-props":function(){return{options:t(r)}}},title:{type:"string","x-decorator":"FormItem","x-component":"Input","x-component-props":{placeholder:'{{ t("Custom column title") }}'}},remove:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.Remove"}}}}},properties:{add:{type:"void",title:'{{ t("Add exportable field") }}',"x-component":"ArrayItems.Addition","x-component-props":{className:(0,n.css)(k())}}}}}}}},T=d(953),_="action-export";function F(){return(0,T.useTranslation)([_,"client"],{nsMode:"fallback"})}function M(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 R(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var D=function(){var e,t,a,l,c,u,s=(0,i.useField)(),p=(0,i.useFieldSchema)(),f=F().t,d=(0,n.useDesignable)().dn,m=function(e){if(Array.isArray(e))return e}(e=(0,r.useState)())||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],i=!0,a=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),2!==o.length);i=!0);}catch(e){a=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(a)throw n}}return o}}(e)||function(e){if(e){if("string"==typeof e)return M(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 M(e,2)}}(e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),b=m[0],y=m[1],v=C().schema;return(0,r.useEffect)(function(){y(v)},[s.address,null==p||null==(t=p["x-action-settings"])?void 0:t.exportSettings]),o().createElement(n.GeneralSchemaDesigner,{disableInitializer:!0},o().createElement(n.SchemaSettingsModalItem,{title:f("Edit button"),schema:{type:"object",title:f("Edit button"),properties:{title:{"x-decorator":"FormItem","x-component":"Input",title:f("Button title"),default:p.title,"x-component-props":{}},icon:{"x-decorator":"FormItem","x-component":"IconPicker",title:f("Button icon"),default:null==p||null==(a=p["x-component-props"])?void 0:a.icon,"x-component-props":{}},type:{"x-decorator":"FormItem","x-component":"Radio.Group",title:f("Button background color"),default:(null==p||null==(l=p["x-component-props"])?void 0:l.danger)?"danger":(null==p||null==(c=p["x-component-props"])?void 0:c.type)==="primary"?"primary":"default",enum:[{value:"default",label:'{{t("Default")}}'},{value:"primary",label:'{{t("Highlight")}}'},{value:"danger",label:'{{t("Danger red")}}'}]}}},onSubmit:function(e){var t,n=e.title,r=e.icon,o=e.type;p.title=n,s.title=n,s.componentProps.icon=r,s.componentProps.danger="danger"===o,s.componentProps.type=o,p["x-component-props"]=p["x-component-props"]||{},p["x-component-props"].icon=r,p["x-component-props"].danger="danger"===o,p["x-component-props"].type=o,d.emit("patch",{schema:(R(t={},"x-uid",p["x-uid"]),R(t,"title",n),R(t,"x-component-props",function(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){R(e,t,n[t])})}return e}({},p["x-component-props"])),t)}),d.refresh()}}),o().createElement(n.SchemaSettingsActionModalItem,{title:f("Exportable fields"),schema:b,initialValues:{exportSettings:null==p||null==(u=p["x-action-settings"])?void 0:u.exportSettings},scope:{t:f},components:{ArrayItems:I.ArrayItems},onSubmit:function(e){var t,n=e.exportSettings;p["x-action-settings"].exportSettings=null==n?void 0:n.filter(function(e){var t;return null==e||null==(t=e.dataIndex)?void 0:t.length}).map(function(e){return{dataIndex:e.dataIndex.map(function(e){var t;return null!=(t=e.name)?t:e}),title:e.title}}),d.emit("patch",{schema:(R(t={},"x-uid",p["x-uid"]),R(t,"x-action-settings",p["x-action-settings"]),t)}),d.refresh()}}),o().createElement(n.SchemaSettingsDivider,null),o().createElement(n.SchemaSettingsRemove,{removeParentsIfNoChildren:!0,breakRemoveOn:function(e){return"Space"===e["x-component"]||e["x-component"].endsWith("ActionBar")},confirm:{title:f("Delete action")}}))},B=function(e){return o().createElement(n.SchemaComponentOptions,{components:{ExportActionInitializer:A,ExportDesigner:D},scope:{useExportAction:$}},e.children)},q=d(773),L=d.n(q),U=d(574),z=d(59);function N(e,t,n,r,o,i,a){try{var l=e[i](a),c=l.value}catch(e){n(e);return}l.done?t(c):Promise.resolve(c).then(r,o)}var $=function(){var e,t=(0,n.useBlockRequestContext)(),o=t.service,a=t.props,l=(0,n.useDataBlockResource)(),c=(0,n.useTableBlockContext)().params,u=(0,n.useCurrentAppInfo)(),s=null==a?void 0:a.params.filter,p=(0,i.useFieldSchema)(),f=(0,n.useCompile)(),d=(0,n.useCollectionManager_deprecated)().getCollectionJoinField,m=(0,n.useCollection_deprecated)(),b=m.name,y=m.title,v=F().t,h=z.App.useApp().modal,g=(null==(e=o.params[0])?void 0:e.filter)||{},x=(0,i.useField)(),S=(0,r.useMemo)(function(){var e;return(null==u||null==(e=u.data)?void 0:e.exportLimit)?u.data.exportLimit:2e3},[u]);return{onClick:function(){var e;return(e=function(){var e,t,r,i,a;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:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(a,"next",{value:c(0)}),l(a,"throw",{value:c(1)}),l(a,"return",{value:c(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function c(l){return function(c){var u=[l,c];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=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(u){switch(u.label){case 0:return x.data=x.data||{},[4,h.confirm({title:v("Export"),content:v("Export warning",{limit:S}),okText:v("Start export")})];case 1:if(!u.sent())return[2];return x.data.loading=!0,(i=L().cloneDeep(null!=(e=null==p?void 0:p["x-action-settings"])?e:{}).exportSettings).forEach(function(e){var t,n,r=null!=(t=d("".concat(b,".").concat(e.dataIndex.join("."))))?t:{},o=r.uiSchema;r.interface,e.enum=null==o||null==(n=o.enum)?void 0:n.map(function(e){return{value:e.value,label:e.label}}),e.enum||(null==o?void 0:o.type)!=="boolean"||(e.enum=[{value:!0,label:v("Yes")},{value:!1,label:v("No")}]),e.defaultTitle=null==o?void 0:o.title}),[4,l.export({title:f(y),appends:null==(r=o.params[0])||null==(t=r.appends)?void 0:t.join(),filter:(0,n.mergeFilter)([g,s]),sort:null==c?void 0:c.sort,values:{columns:f(i)}},{responseType:"blob"})];case 2:return a=new Blob([u.sent().data],{type:"application/x-xls"}),x.data.loading=!1,(0,U.saveAs)(a,"".concat(f(y),".xlsx")),[2]}})},function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){N(i,r,o,a,l,"next",e)}function l(e){N(i,r,o,a,l,"throw",e)}a(void 0)})})()}}},H=d(694),G=d(485),K=d(477);function V(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}var W=function(e){return Array.isArray(e)&&e.length?e.map(function(e){var t;return null!=(t=null==e?void 0:e.name)?t:e}):null},X=function(e){var t;return function(e){if(Array.isArray(e))return V(e)}(t=e.getRootOptions())||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e){if(e){if("string"==typeof e)return V(e,void 0);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 V(e,void 0)}}(t)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()};function Y(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 J(e,t,n,r,o,i,a){try{var l=e[i](a),c=l.value}catch(e){n(e);return}l.done?t(c):Promise.resolve(c).then(r,o)}function Q(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Z(e){return(Z=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ee(e,t){return(ee=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function et(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function en(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(en=function(){return!!e})()}function er(){var e=et(["\n width: 100%;\n & .ant-space-item:nth-child(2),\n & .ant-space-item:nth-child(3) {\n flex: 1;\n }\n "]);return er=function(){return e},e}function eo(){var e=et(["\n border-color: var(--colorSettings);\n color: var(--colorSettings);\n &.ant-btn-dashed:hover {\n border-color: var(--colorSettings);\n color: var(--colorSettings);\n }\n "]);return eo=function(){return e},e}var ei={label:"title",value:"name",children:"children"},ea=function(e){var t,n,r,i=e.optionsCache,a=e.value,l=e.onChange,c=e.onDropdownVisibleChange,u=function(e,t){if(null==e)return{};var n,r,o,i={};if("u">typeof Reflect&&Reflect.ownKeys){for(o=0,n=Reflect.ownKeys(Object(e));o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r]);return i}if(i=function(e,t){if(null==e)return{};var n,r,o={},i=Object.getOwnPropertyNames(e);for(r=0;r<i.length;r++)n=i[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n]);return o}(e,t),Object.getOwnPropertySymbols)for(o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r]);return i}(e,["optionsCache","value","onChange","onDropdownVisibleChange"]),s=function(e){if(Array.isArray(e))return e}(t=o().useState(0))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],i=!0,a=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),2!==o.length);i=!0);}catch(e){a=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(a)throw n}}return o}}(t)||function(e){if(e){if("string"==typeof e)return Y(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 Y(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.")}(),p=(s[0],s[1]),f=o().useMemo(function(){return W(a)},[a]),d=o().useCallback(function(){p(function(e){return e+1})},[]),m=o().useCallback(function(e){return Array.isArray(e)?e.map(function(e){var t;return null!=(t=null==e?void 0:e.name)?t:e}).join("."):""},[]);i.preloadPath(f);var b=X(i),y=o().useCallback(function(e){var t=null==e?void 0:e[e.length-1];!t||t.isLeaf||t.children||(t.loading=!0,i.loadChildren(t),t.loading=!1,d())},[i,d]),v=o().useCallback(function(e){e&&d(),null==c||c(e)},[c,d]),h=o().useCallback(function(e){null==l||l(W(e))},[l]),g=o().useCallback(function(e,t){var n=m(a),r=n?n.split(".").length:0;return(null==e?void 0:e.length)&&(!r||e.length>=r)?e.join(" / "):n?n.replace(/\./g," / "):null==t?void 0:t.map(function(e){return(null==e?void 0:e.title)||(null==e?void 0:e.name)}).join(" / ")},[m,a]);return o().createElement(z.Cascader,(n=function(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){Q(e,t,n[t])})}return e}({},u),r=r={value:f||void 0,fieldNames:ei,options:b,loadData:y,onChange:h,onDropdownVisibleChange:v,displayRender:g},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(r)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))}),n))},el=function(e,t){return O(e,function(e){var n;return t(null==e||null==(n=e.uiSchema)?void 0:n.title)||e.name},function(e){return e.targetCollection&&e.targetCollection.getFields()||[]})},ec=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,r;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return t=n,r=arguments,t=Z(t),Q(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,en()?Reflect.construct(t,r||[],Z(this).constructor):t.apply(this,r)),"defaultProps",{title:(0,H.escapeT)("Export"),type:"default",icon:"clouddownloadoutlined"}),e}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&ee(n,e),t=[{key:"getAclActionName",value:function(){return"export"}}],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}(G.ActionModel);function eu(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 es(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Q(ec,"scene",G.ActionSceneEnum.collection),ec.define({label:(0,H.escapeT)("Export"),sort:1030}),ec.registerFlow({key:"exportSettings",on:"click",steps:{confirm:{use:"confirm",hideInSettings:!0,defaultParams:{enable:!0,title:(0,H.escapeT)("Export"),content:(0,H.escapeT)("Export warning",{ns:_,limit:2e3})}},export:{handler:function(e,t){var n;return(n=function(){var t,n,r,o,i,a,l,c,u,s;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:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(a,"next",{value:c(0)}),l(a,"throw",{value:c(1)}),l(a,"return",{value:c(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function c(l){return function(c){var u=[l,c];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=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(p){switch(p.label){case 0:return t=e.model.getProps().exportSettings,r=(n=e.model.context.blockModel).resource,i=(o=n.collection).title,a=o.fields,l=o.filterTargetKey,u=(c=r.getSelectedRows()).length>0?Q({},l,e.blockModel.collection.getFilterByTK(c)):r.getFilter(),Array.isArray(l)&&l.length>1&&(u={$or:e.blockModel.collection.getFilterByTK(c)}),t.forEach(function(t){var n,r,o=null!=(n=a.get(t.dataIndex[0]))?n:{},i=o.uiSchema;o.interface,t.enum=null==i||null==(r=i.enum)?void 0:r.map(function(e){return{value:e.value,label:e.label}}),t.enum||(null==i?void 0:i.type)!=="boolean"||(t.enum=[{value:!0,label:e.t("Yes")},{value:!1,label:e.t("No")}]),t.defaultTitle=e.t(null==i?void 0:i.title)}),[4,r.runAction("export",{data:{columns:t},responseType:"blob",params:{title:e.t(i),appends:r.getAppends(),sort:r.getSort(),filter:u}})];case 1:return s=new Blob([p.sent()],{type:"application/x-xls"}),(0,U.saveAs)(s,"".concat(e.t(i),".xlsx")),[2]}})},function(){var e=this,t=arguments;return new Promise(function(r,o){var i=n.apply(e,t);function a(e){J(i,r,o,a,l,"next",e)}function l(e){J(i,r,o,a,l,"throw",e)}a(void 0)})})()}}}}),ec.registerFlow({key:"exportActionSetting",title:(0,H.escapeT)("Export settings",{ns:_}),steps:{exportableFields:{title:(0,H.escapeT)("Exportable fields"),uiSchema:function(e){var t=el(e.model.context.blockModel.collection.getFields(),e.t);return{exportSettings:{type:"array","x-component":"ArrayItems","x-decorator":"FormItem",items:{type:"object",properties:{space:{type:"void","x-component":"Space","x-component-props":{className:(0,K.css)(er())},properties:{sort:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.SortHandle"},dataIndex:{type:"array","x-decorator":"FormItem","x-component":ea,required:!0,"x-component-props":{changeOnSelect:!1,optionsCache:t}},title:{type:"string","x-decorator":"FormItem","x-component":"Input","x-component-props":{placeholder:'{{ t("Custom column title") }}'}},remove:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.Remove"}}}}},properties:{add:{type:"void",title:'{{ t("Add exportable field") }}',"x-component":"ArrayItems.Addition","x-component-props":{className:(0,K.css)(eo())}}}}}},defaultParams:function(e){var t;return{exportSettings:null==(t=e.model.context.blockModel.collection.getFields())?void 0:t.filter(function(e){return!e.isAssociationField()&&e.options.interface}).map(function(e){return{dataIndex:[e.name]}})}},handler:function(e,t){var n=t.exportSettings,r=null==n?void 0:n.filter(function(e){var t;return null==e||null==(t=e.dataIndex)?void 0:t.length}).map(function(e){return{dataIndex:e.dataIndex.map(function(e){var t;return null!=(t=e.name)?t:e}),title:e.title}});e.model.setProps("exportSettings",r)}}}});var ep=new n.SchemaSettings({name:"actionSettings:export",items:[{name:"editButton",Component:n.ButtonEditor,useComponentProps:function(){return(0,n.useSchemaToolbar)().buttonEditorProps}},{name:"linkageRules",Component:n.SchemaSettingsLinkageRules,useComponentProps:function(){return function(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){es(e,t,n[t])})}return e}({},(0,n.useSchemaToolbar)().linkageRulesProps)}},{name:"exportableFields",type:"actionModal",useComponentProps:function(){var e,t,o,a=(0,i.useField)(),l=(0,i.useFieldSchema)(),c=(0,T.useTranslation)().t,u=(0,n.useDesignable)().dn,s=function(e){if(Array.isArray(e))return e}(e=(0,r.useState)())||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],i=!0,a=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),2!==o.length);i=!0);}catch(e){a=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(a)throw n}}return o}}(e)||function(e){if(e){if("string"==typeof e)return eu(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 eu(e,2)}}(e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),p=s[0],f=s[1],d=C().schema;return(0,r.useEffect)(function(){f(d)},[a.address,null==l||null==(t=l["x-action-settings"])?void 0:t.exportSettings]),{title:c("Exportable fields"),schema:p,initialValues:{exportSettings:null==l||null==(o=l["x-action-settings"])?void 0:o.exportSettings},components:{ArrayItems:I.ArrayItems},onSubmit:function(e){var t,n=e.exportSettings;l["x-action-settings"].exportSettings=null==n?void 0:n.filter(function(e){var t;return null==e||null==(t=e.dataIndex)?void 0:t.length}).map(function(e){return{dataIndex:e.dataIndex.map(function(e){var t;return null!=(t=e.name)?t:e}),title:e.title}}),u.emit("patch",{schema:(es(t={},"x-uid",l["x-uid"]),es(t,"x-action-settings",l["x-action-settings"]),t)}),u.refresh()}}}},{name:"divider",type:"divider"},{name:"delete",type:"remove",useComponentProps:function(){return{removeParentsIfNoChildren:!0,breakRemoveOn:function(e){return"Space"===e["x-component"]||e["x-component"].endsWith("ActionBar")},confirm:{title:(0,(0,T.useTranslation)().t)("Delete action")}}}}]});function ef(e,t,n,r,o,i,a){try{var l=e[i](a),c=l.value}catch(e){n(e);return}l.done?t(c):Promise.resolve(c).then(r,o)}function ed(e,t,n){return(ed=ev()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&eb(o,n.prototype),o}).apply(null,arguments)}function em(e){return(em=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function eb(e,t){return(eb=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ey(e){var t="function"==typeof Map?new Map:void 0;return(ey=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 ed(e,arguments,em(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),eb(n,e)})(e)}function ev(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(ev=function(){return!!e})()}var eh=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function r(){var e,t;if(!(this instanceof r))throw TypeError("Cannot call a class as a function");return e=r,t=arguments,e=em(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,ev()?Reflect.construct(e,t||[],em(this).constructor):e.apply(this,t))}return r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),e&&eb(r,e),t=[{key:"load",value:function(){var e;return(e=function(){var e,t;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:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(a,"next",{value:c(0)}),l(a,"throw",{value:c(1)}),l(a,"return",{value:c(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function c(l){return function(c){var u=[l,c];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=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(r){return this.app.use(B),e={title:"{{t('Export')}}",Component:"ExportActionInitializer",schema:{"x-align":"right","x-decorator":"ACLActionProvider","x-acl-action-props":{skipScopeCheck:!0}},useVisible:function(){return(0,n.useActionAvailable)("export")}},null==(t=this.app.schemaInitializerManager.get("table:configureActions"))||t.add("enableActions.export",e),this.app.schemaInitializerManager.addItem("gantt:configureActions","enableActions.export",e),this.app.schemaSettingsManager.add(ep),this.app.flowEngine.registerModels({ExportActionModel:ec}),[2]})},function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){ef(i,r,o,a,l,"next",e)}function l(e){ef(i,r,o,a,l,"throw",e)}a(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)}}(r.prototype,t),r}(ey(n.Plugin)),eg=eh}(),h}()});
|
|
10
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("lodash"),require("react-i18next"),require("@nocobase/flow-engine"),require("@nocobase/client-v2"),require("@emotion/css"),require("@formily/antd-v5"),require("@formily/shared"),require("react"),require("antd"),require("@nocobase/client"),require("@formily/react")):"function"==typeof define&&define.amd?define("@nocobase/plugin-action-export",["lodash","react-i18next","@nocobase/flow-engine","@nocobase/client-v2","@emotion/css","@formily/antd-v5","@formily/shared","react","antd","@nocobase/client","@formily/react"],t):"object"==typeof exports?exports["@nocobase/plugin-action-export"]=t(require("lodash"),require("react-i18next"),require("@nocobase/flow-engine"),require("@nocobase/client-v2"),require("@emotion/css"),require("@formily/antd-v5"),require("@formily/shared"),require("react"),require("antd"),require("@nocobase/client"),require("@formily/react")):e["@nocobase/plugin-action-export"]=t(e.lodash,e["react-i18next"],e["@nocobase/flow-engine"],e["@nocobase/client-v2"],e["@emotion/css"],e["@formily/antd-v5"],e["@formily/shared"],e.react,e.antd,e["@nocobase/client"],e["@formily/react"])}(self,function(e,t,n,r,o,i,a,l,c,u,s){return function(){var p={574:function(e,t,n){var r,o;void 0===(o="function"==typeof(r=function(){"use strict";function t(e,t,n){var r=new XMLHttpRequest;r.open("GET",e),r.responseType="blob",r.onload=function(){l(r.response,t,n)},r.onerror=function(){console.error("could not download file")},r.send()}function r(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch(e){}return 200<=t.status&&299>=t.status}function o(e){try{e.dispatchEvent(new MouseEvent("click"))}catch(n){var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var i="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof n.g&&n.g.global===n.g?n.g:void 0,a=i.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),l=i.saveAs||("object"!=typeof window||window!==i?function(){}:"download"in HTMLAnchorElement.prototype&&!a?function(e,n,a){var l=i.URL||i.webkitURL,c=document.createElement("a");c.download=n=n||e.name||"download",c.rel="noopener","string"==typeof e?(c.href=e,c.origin===location.origin?o(c):r(c.href)?t(e,n,a):o(c,c.target="_blank")):(c.href=l.createObjectURL(e),setTimeout(function(){l.revokeObjectURL(c.href)},4e4),setTimeout(function(){o(c)},0))}:"msSaveOrOpenBlob"in navigator?function(e,n,i){if(n=n||e.name||"download","string"!=typeof e){var a;navigator.msSaveOrOpenBlob((void 0===(a=i)?a={autoBom:!1}:"object"!=typeof a&&(console.warn("Deprecated: Expected third argument to be a object"),a={autoBom:!a}),a.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\uFEFF",e],{type:e.type}):e),n)}else if(r(e))t(e,n,i);else{var l=document.createElement("a");l.href=e,l.target="_blank",setTimeout(function(){o(l)})}}:function(e,n,r,o){if((o=o||open("","_blank"))&&(o.document.title=o.document.body.innerText="downloading..."),"string"==typeof e)return t(e,n,r);var l="application/octet-stream"===e.type,c=/constructor/i.test(i.HTMLElement)||i.safari,u=/CriOS\/[\d]+/.test(navigator.userAgent);if((u||l&&c||a)&&"u">typeof FileReader){var s=new FileReader;s.onloadend=function(){var e=s.result;e=u?e:e.replace(/^data:[^;]*;/,"data:attachment/file;"),o?o.location.href=e:location=e,o=null},s.readAsDataURL(e)}else{var p=i.URL||i.webkitURL,f=p.createObjectURL(e);o?o.location=f:location.href=f,o=null,setTimeout(function(){p.revokeObjectURL(f)},4e4)}});i.saveAs=l.saveAs=l,e.exports=l})?r.apply(t,[]):r)||(e.exports=o)},477:function(e){"use strict";e.exports=o},418:function(e){"use strict";e.exports=i},230:function(e){"use strict";e.exports=s},166:function(e){"use strict";e.exports=a},342:function(e){"use strict";e.exports=u},485:function(e){"use strict";e.exports=r},694:function(e){"use strict";e.exports=n},59:function(e){"use strict";e.exports=c},773:function(t){"use strict";t.exports=e},155:function(e){"use strict";e.exports=l},953:function(e){"use strict";e.exports=t}},f={};function d(e){var t=f[e];if(void 0!==t)return t.exports;var n=f[e]={exports:{}};return p[e].call(n.exports,n,n.exports,d),n.exports}d.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return d.d(t,{a:t}),t},d.d=function(e,t){for(var n in t)d.o(t,n)&&!d.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},d.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),d.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},d.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},d.g.importScripts&&(m=d.g.location+"");var m,b=d.g.document;if(!m&&b&&(b.currentScript&&"SCRIPT"===b.currentScript.tagName.toUpperCase()&&(m=b.currentScript.src),!m)){var v=b.getElementsByTagName("script");if(v.length)for(var y=v.length-1;y>-1&&(!m||!/^http(s?):/.test(m));)m=v[y--].src}if(!m)throw Error("Automatic publicPath is not supported in this browser");d.p=m.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/");var h={};return!function(){"use strict";var e="",t="u">typeof document?document.currentScript:null;if(t&&t.src){var n=t.src.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"");n.indexOf("/static/plugins/@nocobase/plugin-action-export/dist/client/")>=0&&(e=n.replace(/\/[^\/]+$/,"/"))}if(!e){var r=window.__webpack_public_path__||"";r&&("/"!==r.charAt(r.length-1)&&(r+="/"),e=r+"static/plugins/@nocobase/plugin-action-export/dist/client/")}if(!e){var o=window.__nocobase_modern_client_prefix__||"v",i="/"+(o=String(o).replace(/^\/+|\/+$/g,"")||"v")+"/";if(!(e=window.__nocobase_public_path__||"")&&window.location&&window.location.pathname){var a=window.location.pathname||"/",l=a.indexOf(i);e=l>=0?a.slice(0,l+1):"/"}e&&(e=e.replace(RegExp("/"+o+"/?$"),"/")),e||(e="/"),"/"!==e.charAt(e.length-1)&&(e+="/"),e+="static/plugins/@nocobase/plugin-action-export/dist/client/"}d.p=e}(),!function(){"use strict";d.r(h),d.d(h,{PluginActionExportClient:function(){return eO},ExportDesigner:function(){return L},buildExportFieldOptions:function(){return w},default:function(){return ej},ExportActionModel:function(){return ed},ExportPluginProvider:function(){return q},useExportAction:function(){return H},ExportActionInitializer:function(){return I}});var e=d(166),t=d(342),n=d(155),r=d.n(n),o=d(230);function i(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 a(e,t,n,r,o,i,a){try{var l=e[i](a),c=l.value}catch(e){n(e);return}l.done?t(c):Promise.resolve(c).then(r,o)}function l(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){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function c(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 u(e){return function(e){if(Array.isArray(e))return i(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e){if(e){if("string"==typeof e)return i(e,void 0);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 i(e,void 0)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var s=["hasMany","belongsToMany","belongsToArray"],p=u(["hasOne","belongsTo"]).concat(["hasMany","belongsToMany","belongsToArray"]),f=new WeakMap,m=function(e){return(null==e?void 0:e.target)&&p.includes(e.type)},b=function(e){return(null==e?void 0:e.target)&&s.includes(e.type)},v=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{name:e.name,title:t(e),schema:null==e?void 0:e.uiSchema,disabled:n}},y=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=m(e),o=c(l({},v(e,t)),{isLeaf:!r});return f.set(o,{field:e,relationDepth:r?n:0}),o},g=function(e,t,n){return!(n>=2||b(e)&&b(t))},x=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if(!(null==e?void 0:e.interface))return null;if(!m(e))return v(e,t);var o=(n(e)||[]).map(function(o){return m(o)?g(e,o,r)?x(o,t,n,r+1):null:x(o,t,n)}).filter(Boolean);return o.length?c(l({},v(e,t)),{children:o}):v(e,t,!0)},w=function(e,t,n){return(e||[]).map(function(e){return x(e,t,n,+!!m(e))}).filter(Boolean)},S=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.parentField,o=n.parentRelationDepth,i=void 0===o?0:o;return(e||[]).map(function(e){return!(null==e?void 0:e.interface)||r&&m(e)&&!g(r,e,i)?null:y(e,t,m(e)?i+1:0)}).filter(Boolean)},O=function(e,t,n){var r=e&&(void 0===e?"undefined":e&&"u">typeof Symbol&&e.constructor===Symbol?"symbol":typeof e)=="object"?f.get(e):null,o=null==r?void 0:r.field;return m(o)?S(n(o)||[],t,{parentField:o,parentRelationDepth:(null==r?void 0:r.relationDepth)||1}):[]},j=function(e){var t=[];return e.forEach(function(e){var n=t;e.forEach(function(t,r){var o,i=r===e.length-1,a=n.find(function(e){return e.name===t.name});a||(a=c(l({},t),{children:i?void 0:[]}),n.push(a)),i||((o=a).children||(o.children=[]),n=a.children)})}),t},A=function(e,t,n){var r=S(e,t),o=function(e){if(!e||e.isLeaf)return[];if(e.children)return e.children;var r=O(e,t,n);return r.length?e.children=r:(e.isLeaf=!0,e.disabled=!0,e.children=[]),e.children};return{getRootOptions:function(){return r},loadChildren:o,preloadPath:function(e){if(!Array.isArray(e)||e.length<=1)return!1;for(var t=!1,n=r,i=0;i<e.length-1&&"break"!==function(r){var i,a,l=null!=(i=null==(a=e[r])?void 0:a.name)?i:e[r],c=n.find(function(e){return(null==e?void 0:e.name)===l});if(!c||c.isLeaf)return"break";var u=!!c.children;n=o(c),u||(t=!0)}(i);i++);return t},searchOptionsAsync:function(e){var o,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l=i.limit,c=void 0===l?50:l,s=i.signal;return(o=function(){var o,i,a,l,p,f,d,m,b,v,y;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:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(a,"next",{value:c(0)}),l(a,"throw",{value:c(1)}),l(a,"return",{value:c(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function c(l){return function(c){var u=[l,c];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=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(h){switch(h.label){case 0:if(!(o=e.trim().toLocaleLowerCase())||(null==s?void 0:s.aborted))return[2,[]];i=[],a=u(r).reverse().map(function(e){return{option:e,path:[]}}),l=Math.max(1,c),p=performance.now(),f=0,h.label=1;case 1:if(!(a.length&&i.length<l))return[3,4];if(null==s?void 0:s.aborted)return[2,[]];if(!(d=a.pop()))return[3,4];if(m=u(d.path).concat([d.option]),d.option.isLeaf)b=m.some(function(e){var t;return String(null!=(t=e.title)?t:"").toLocaleLowerCase().includes(o)}),!d.option.disabled&&b&&i.push(m);else for(y=(v=d.option.children||O(d.option,t,n)).length-1;y>=0;y--)a.push({option:v[y],path:m});if(!((f+=1)>=200||performance.now()-p>=8))return[3,3];return[4,new Promise(function(e){return setTimeout(e,0)})];case 2:if(h.sent(),null==s?void 0:s.aborted)return[2,[]];p=performance.now(),f=0,h.label=3;case 3:return[3,1];case 4:return[2,j(i)]}})},function(){var e=this,t=arguments;return new Promise(function(n,r){var i=o.apply(e,t);function l(e){a(i,n,r,l,c,"next",e)}function c(e){a(i,n,r,l,c,"throw",e)}l(void 0)})})()}}},E=function(e){var n,r=(0,o.useFieldSchema)();null==r||null==(n=r["x-component-props"])||n.nonfilterable;var i=(0,t.useCollectionManager_deprecated)().getCollectionFields,a=i(e),l=(0,t.useCompile)();return w(a,function(e){var t;return l(null==e||null==(t=e.uiSchema)?void 0:t.title)||e.name},function(e){return i(e.target)})},I=function(){var n=(0,t.useSchemaInitializerItem)(),o=(0,t.useSchemaInitializer)().insert,i=E((0,t.useCollection_deprecated)().name),a={type:"void",title:'{{ t("Export") }}',"x-action":"export","x-action-settings":{exportSettings:[]},"x-toolbar":"ActionSchemaToolbar","x-settings":"actionSettings:export","x-decorator":"ACLActionProvider","x-component":"Action","x-use-component-props":"useExportAction","x-component-props":{icon:"clouddownloadoutlined"}};return r().createElement(t.SchemaInitializerItem,{title:n.title,onClick:function(){a["x-action-settings"].exportSettings=null==i?void 0:i.filter(function(e){return!e.children&&!e.disabled}).map(function(e){return{dataIndex:[e.name]}});var t,r=(0,e.merge)(a||{},n.schema||{});null==n||null==(t=n.schemaInitialize)||t.call(n,r),o(r)}})},P=d(418);function k(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function C(){var e=k(["\n width: 100%;\n & .ant-space-item:nth-child(2),\n & .ant-space-item:nth-child(3) {\n flex: 1;\n }\n "]);return C=function(){return e},e}function T(){var e=k(["\n border-color: var(--colorSettings);\n color: var(--colorSettings);\n &.ant-btn-dashed:hover {\n border-color: var(--colorSettings);\n color: var(--colorSettings);\n }\n "]);return T=function(){return e},e}var _=function(){var e=(0,t.useCollection_deprecated)().name,n=(0,t.useCompile)(),r=E(e);return{schema:{type:"void","x-component":"Grid",properties:{exportSettings:{type:"array","x-component":"ArrayItems","x-decorator":"FormItem",items:{type:"object",properties:{space:{type:"void","x-component":"Space","x-component-props":{className:(0,t.css)(C())},properties:{sort:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.SortHandle"},dataIndex:{type:"array","x-decorator":"FormItem","x-component":"Cascader",required:!0,"x-component-props":{fieldNames:{label:"title",value:"name",children:"children"},changeOnSelect:!1},"x-use-component-props":function(){return{options:n(r)}}},title:{type:"string","x-decorator":"FormItem","x-component":"Input","x-component-props":{placeholder:'{{ t("Custom column title") }}'}},remove:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.Remove"}}}}},properties:{add:{type:"void",title:'{{ t("Add exportable field") }}',"x-component":"ArrayItems.Addition","x-component-props":{className:(0,t.css)(T())}}}}}}}},F=d(953),R="action-export";function M(){return(0,F.useTranslation)([R,"client"],{nsMode:"fallback"})}function D(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 B(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var L=function(){var e,i,a,l,c,u,s=(0,o.useField)(),p=(0,o.useFieldSchema)(),f=M().t,d=(0,t.useDesignable)().dn,m=function(e){if(Array.isArray(e))return e}(e=(0,n.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,a=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),2!==o.length);i=!0);}catch(e){a=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(a)throw n}}return o}}(e)||function(e){if(e){if("string"==typeof e)return D(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 D(e,2)}}(e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),b=m[0],v=m[1],y=_().schema;return(0,n.useEffect)(function(){v(y)},[s.address,null==p||null==(i=p["x-action-settings"])?void 0:i.exportSettings]),r().createElement(t.GeneralSchemaDesigner,{disableInitializer:!0},r().createElement(t.SchemaSettingsModalItem,{title:f("Edit button"),schema:{type:"object",title:f("Edit button"),properties:{title:{"x-decorator":"FormItem","x-component":"Input",title:f("Button title"),default:p.title,"x-component-props":{}},icon:{"x-decorator":"FormItem","x-component":"IconPicker",title:f("Button icon"),default:null==p||null==(a=p["x-component-props"])?void 0:a.icon,"x-component-props":{}},type:{"x-decorator":"FormItem","x-component":"Radio.Group",title:f("Button background color"),default:(null==p||null==(l=p["x-component-props"])?void 0:l.danger)?"danger":(null==p||null==(c=p["x-component-props"])?void 0:c.type)==="primary"?"primary":"default",enum:[{value:"default",label:'{{t("Default")}}'},{value:"primary",label:'{{t("Highlight")}}'},{value:"danger",label:'{{t("Danger red")}}'}]}}},onSubmit:function(e){var t,n=e.title,r=e.icon,o=e.type;p.title=n,s.title=n,s.componentProps.icon=r,s.componentProps.danger="danger"===o,s.componentProps.type=o,p["x-component-props"]=p["x-component-props"]||{},p["x-component-props"].icon=r,p["x-component-props"].danger="danger"===o,p["x-component-props"].type=o,d.emit("patch",{schema:(B(t={},"x-uid",p["x-uid"]),B(t,"title",n),B(t,"x-component-props",function(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){B(e,t,n[t])})}return e}({},p["x-component-props"])),t)}),d.refresh()}}),r().createElement(t.SchemaSettingsActionModalItem,{title:f("Exportable fields"),schema:b,initialValues:{exportSettings:null==p||null==(u=p["x-action-settings"])?void 0:u.exportSettings},scope:{t:f},components:{ArrayItems:P.ArrayItems},onSubmit:function(e){var t,n=e.exportSettings;p["x-action-settings"].exportSettings=null==n?void 0:n.filter(function(e){var t;return null==e||null==(t=e.dataIndex)?void 0:t.length}).map(function(e){return{dataIndex:e.dataIndex.map(function(e){var t;return null!=(t=e.name)?t:e}),title:e.title}}),d.emit("patch",{schema:(B(t={},"x-uid",p["x-uid"]),B(t,"x-action-settings",p["x-action-settings"]),t)}),d.refresh()}}),r().createElement(t.SchemaSettingsDivider,null),r().createElement(t.SchemaSettingsRemove,{removeParentsIfNoChildren:!0,breakRemoveOn:function(e){return"Space"===e["x-component"]||e["x-component"].endsWith("ActionBar")},confirm:{title:f("Delete action")}}))},q=function(e){return r().createElement(t.SchemaComponentOptions,{components:{ExportActionInitializer:I,ExportDesigner:L},scope:{useExportAction:H}},e.children)},z=d(773),U=d.n(z),N=d(574),$=d(59);function G(e,t,n,r,o,i,a){try{var l=e[i](a),c=l.value}catch(e){n(e);return}l.done?t(c):Promise.resolve(c).then(r,o)}var H=function(){var e,r=(0,t.useBlockRequestContext)(),i=r.service,a=r.props,l=(0,t.useDataBlockResource)(),c=(0,t.useTableBlockContext)().params,u=(0,t.useCurrentAppInfo)(),s=null==a?void 0:a.params.filter,p=(0,o.useFieldSchema)(),f=(0,t.useCompile)(),d=(0,t.useCollectionManager_deprecated)().getCollectionJoinField,m=(0,t.useCollection_deprecated)(),b=m.name,v=m.title,y=M().t,h=$.App.useApp().modal,g=(null==(e=i.params[0])?void 0:e.filter)||{},x=(0,o.useField)(),w=(0,n.useMemo)(function(){var e;return(null==u||null==(e=u.data)?void 0:e.exportLimit)?u.data.exportLimit:2e3},[u]);return{onClick:function(){var e;return(e=function(){var e,n,r,o,a;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:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(a,"next",{value:c(0)}),l(a,"throw",{value:c(1)}),l(a,"return",{value:c(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function c(l){return function(c){var u=[l,c];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=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(u){switch(u.label){case 0:return x.data=x.data||{},[4,h.confirm({title:y("Export"),content:y("Export warning",{limit:w}),okText:y("Start export")})];case 1:if(!u.sent())return[2];return x.data.loading=!0,(o=U().cloneDeep(null!=(e=null==p?void 0:p["x-action-settings"])?e:{}).exportSettings).forEach(function(e){var t,n,r=null!=(t=d("".concat(b,".").concat(e.dataIndex.join("."))))?t:{},o=r.uiSchema;r.interface,e.enum=null==o||null==(n=o.enum)?void 0:n.map(function(e){return{value:e.value,label:e.label}}),e.enum||(null==o?void 0:o.type)!=="boolean"||(e.enum=[{value:!0,label:y("Yes")},{value:!1,label:y("No")}]),e.defaultTitle=null==o?void 0:o.title}),[4,l.export({title:f(v),appends:null==(r=i.params[0])||null==(n=r.appends)?void 0:n.join(),filter:(0,t.mergeFilter)([g,s]),sort:null==c?void 0:c.sort,values:{columns:f(o)}},{responseType:"blob"})];case 2:return a=new Blob([u.sent().data],{type:"application/x-xls"}),x.data.loading=!1,(0,N.saveAs)(a,"".concat(f(v),".xlsx")),[2]}})},function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){G(i,r,o,a,l,"next",e)}function l(e){G(i,r,o,a,l,"throw",e)}a(void 0)})})()}}},K=d(694),V=d(485),W=d(477);function X(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}var Y=function(e){return Array.isArray(e)&&e.length?e.map(function(e){var t;return null!=(t=null==e?void 0:e.name)?t:e}):null},J=function(e){var t;return function(e){if(Array.isArray(e))return X(e)}(t=e.getRootOptions())||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e){if(e){if("string"==typeof e)return X(e,void 0);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 X(e,void 0)}}(t)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()};function Q(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 Z(e,t,n,r,o,i,a){try{var l=e[i](a),c=l.value}catch(e){n(e);return}l.done?t(c):Promise.resolve(c).then(r,o)}function ee(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){Z(i,r,o,a,l,"next",e)}function l(e){Z(i,r,o,a,l,"throw",e)}a(void 0)})}}function et(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function en(e){return(en=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function er(e,t){return(er=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function eo(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Q(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Q(e,t)}}(e,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.")}()}function ei(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function ea(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(ea=function(){return!!e})()}function el(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(a,"next",{value:c(0)}),l(a,"throw",{value:c(1)}),l(a,"return",{value:c(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function c(l){return function(c){var u=[l,c];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,r=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){i.label=u[1];break}if(6===u[0]&&i.label<o[1]){i.label=o[1],o=u;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=t.call(e,i)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}function ec(){var e=ei(["\n width: 100%;\n & .ant-space-item:nth-child(2),\n & .ant-space-item:nth-child(3) {\n flex: 1;\n }\n "]);return ec=function(){return e},e}function eu(){var e=ei(["\n border-color: var(--colorSettings);\n color: var(--colorSettings);\n &.ant-btn-dashed:hover {\n border-color: var(--colorSettings);\n color: var(--colorSettings);\n }\n "]);return eu=function(){return e},e}var es={label:"title",value:"name",children:"children"},ep=function(e){var t,n,o=e.optionsCache,i=e.value,a=e.onChange,l=e.onDropdownVisibleChange,c=e.onSearch,u=e.notFoundContent,s=function(e,t){if(null==e)return{};var n,r,o,i={};if("u">typeof Reflect&&Reflect.ownKeys){for(o=0,n=Reflect.ownKeys(Object(e));o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r]);return i}if(i=function(e,t){if(null==e)return{};var n,r,o={},i=Object.getOwnPropertyNames(e);for(r=0;r<i.length;r++)n=i[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n]);return o}(e,t),Object.getOwnPropertySymbols)for(o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r]);return i}(e,["optionsCache","value","onChange","onDropdownVisibleChange","onSearch","notFoundContent"]),p=eo(r().useState(0),2)[1],f=eo(r().useState([]),2),d=f[0],m=f[1],b=eo(r().useState("idle"),2),v=b[0],y=b[1],h=r().useRef(),g=r().useRef(),x=r().useRef(""),w=r().useRef(o),S=r().useRef(!1),O=r().useMemo(function(){return Y(i)},[i]),j=r().useCallback(function(){p(function(e){return e+1})},[]);r().useEffect(function(){var e;w.current=o,x.current="",null==(e=h.current)||e.abort(),h.current=void 0,g.current&&(clearTimeout(g.current),g.current=void 0),m([]),y("idle")},[o]),r().useEffect(function(){return S.current=!0,function(){var e;S.current=!1,null==(e=h.current)||e.abort(),g.current&&clearTimeout(g.current)}},[]);var A=r().useCallback(function(e){return Array.isArray(e)?e.map(function(e){var t;return null!=(t=null==e?void 0:e.name)?t:e}).join("."):""},[]);o.preloadPath(O);var E=J(o),I=r().useCallback(function(e){var t=null==e?void 0:e[e.length-1];!t||t.isLeaf||t.children||(t.loading=!0,o.loadChildren(t),t.loading=!1,j())},[o,j]),P=r().useCallback(function(e){e&&j(),null==l||l(e)},[l,j]),k=r().useCallback(function(e,t){null==a||a(Y(e),t)},[a]),C=r().useCallback(function(e){var t;x.current=e,g.current&&(clearTimeout(g.current),g.current=void 0),null==(t=h.current)||t.abort(),h.current=void 0,e.trim()?(m([]),y("loading"),g.current=setTimeout(function(){return ee(function(){var t,n,r,i;return el(this,function(a){switch(a.label){case 0:t=o,n=e,h.current=r=new AbortController,g.current=void 0,a.label=1;case 1:return a.trys.push([1,3,4,5]),[4,t.searchOptionsAsync(n,{signal:r.signal})];case 2:if(i=a.sent(),r.signal.aborted||!S.current||w.current!==t||x.current!==n)return[2];return m(i),y("ready"),[3,5];case 3:return a.sent(),!r.signal.aborted&&S.current&&w.current===t&&x.current===n&&(m([]),y("error")),[3,5];case 4:return h.current===r&&(h.current=void 0),[7];case 5:return[2]}})})()},150)):(m([]),y("idle")),null==c||c(e)},[c,o]),T=!!x.current.trim(),_=r().useCallback(function(e,t){var n=A(i),r=n?n.split(".").length:0;return(null==e?void 0:e.length)&&(!r||e.length>=r)?e.join(" / "):n?n.replace(/\./g," / "):null==t?void 0:t.map(function(e){return(null==e?void 0:e.title)||(null==e?void 0:e.name)}).join(" / ")},[A,i]);return r().createElement($.Cascader,(t=function(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){et(e,t,n[t])})}return e}({},s),n=n={value:O||void 0,fieldNames:es,options:T?d:E,loadData:I,notFoundContent:"loading"===v?r().createElement($.Spin,{size:"small"}):u,onChange:k,onDropdownVisibleChange:P,onSearch:C,showSearch:!0,displayRender:_},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t))},ef=function(e,t){return A(e,function(e){var n;return t(null==e||null==(n=e.uiSchema)?void 0:n.title)||e.name},function(e){return e.targetCollection&&e.targetCollection.getFields()||[]})},ed=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,r;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return t=n,r=arguments,t=en(t),et(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,ea()?Reflect.construct(t,r||[],en(this).constructor):t.apply(this,r)),"defaultProps",{title:(0,K.escapeT)("Export"),type:"default",icon:"clouddownloadoutlined"}),e}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&er(n,e),t=[{key:"getAclActionName",value:function(){return"export"}}],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}(V.ActionModel);function em(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 eb(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}et(ed,"scene",V.ActionSceneEnum.collection),ed.define({label:(0,K.escapeT)("Export"),sort:1030}),ed.registerFlow({key:"exportSettings",on:"click",steps:{confirm:{use:"confirm",hideInSettings:!0,defaultParams:{enable:!0,title:(0,K.escapeT)("Export"),content:(0,K.escapeT)("Export warning",{ns:R,limit:2e3})}},export:{handler:function(e,t){return ee(function(){var t,n,r,o,i,a,l,c,u,s;return el(this,function(p){switch(p.label){case 0:return t=e.model.getProps().exportSettings,r=(n=e.model.context.blockModel).resource,i=(o=n.collection).title,a=o.fields,l=o.filterTargetKey,u=(c=r.getSelectedRows()).length>0?et({},l,e.blockModel.collection.getFilterByTK(c)):r.getFilter(),Array.isArray(l)&&l.length>1&&(u={$or:e.blockModel.collection.getFilterByTK(c)}),t.forEach(function(t){var n,r,o=null!=(n=a.get(t.dataIndex[0]))?n:{},i=o.uiSchema;o.interface,t.enum=null==i||null==(r=i.enum)?void 0:r.map(function(e){return{value:e.value,label:e.label}}),t.enum||(null==i?void 0:i.type)!=="boolean"||(t.enum=[{value:!0,label:e.t("Yes")},{value:!1,label:e.t("No")}]),t.defaultTitle=e.t(null==i?void 0:i.title)}),[4,r.runAction("export",{data:{columns:t},responseType:"blob",params:{title:e.t(i),appends:r.getAppends(),sort:r.getSort(),filter:u}})];case 1:return s=new Blob([p.sent()],{type:"application/x-xls"}),(0,N.saveAs)(s,"".concat(e.t(i),".xlsx")),[2]}})})()}}}}),ed.registerFlow({key:"exportActionSetting",title:(0,K.escapeT)("Export settings",{ns:R}),steps:{exportableFields:{title:(0,K.escapeT)("Exportable fields"),uiSchema:function(e){var t=ef(e.model.context.blockModel.collection.getFields(),e.t);return{exportSettings:{type:"array","x-component":"ArrayItems","x-decorator":"FormItem",items:{type:"object",properties:{space:{type:"void","x-component":"Space","x-component-props":{className:(0,W.css)(ec())},properties:{sort:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.SortHandle"},dataIndex:{type:"array","x-decorator":"FormItem","x-component":ep,required:!0,"x-component-props":{changeOnSelect:!1,optionsCache:t}},title:{type:"string","x-decorator":"FormItem","x-component":"Input","x-component-props":{placeholder:'{{ t("Custom column title") }}'}},remove:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.Remove"}}}}},properties:{add:{type:"void",title:'{{ t("Add exportable field") }}',"x-component":"ArrayItems.Addition","x-component-props":{className:(0,W.css)(eu())}}}}}},defaultParams:function(e){var t;return{exportSettings:null==(t=e.model.context.blockModel.collection.getFields())?void 0:t.filter(function(e){return!e.isAssociationField()&&e.options.interface}).map(function(e){return{dataIndex:[e.name]}})}},handler:function(e,t){var n=t.exportSettings,r=null==n?void 0:n.filter(function(e){var t;return null==e||null==(t=e.dataIndex)?void 0:t.length}).map(function(e){return{dataIndex:e.dataIndex.map(function(e){var t;return null!=(t=e.name)?t:e}),title:e.title}});e.model.setProps("exportSettings",r)}}}});var ev=new t.SchemaSettings({name:"actionSettings:export",items:[{name:"editButton",Component:t.ButtonEditor,useComponentProps:function(){return(0,t.useSchemaToolbar)().buttonEditorProps}},{name:"linkageRules",Component:t.SchemaSettingsLinkageRules,useComponentProps:function(){return function(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){eb(e,t,n[t])})}return e}({},(0,t.useSchemaToolbar)().linkageRulesProps)}},{name:"exportableFields",type:"actionModal",useComponentProps:function(){var e,r,i,a=(0,o.useField)(),l=(0,o.useFieldSchema)(),c=(0,F.useTranslation)().t,u=(0,t.useDesignable)().dn,s=function(e){if(Array.isArray(e))return e}(e=(0,n.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,a=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),2!==o.length);i=!0);}catch(e){a=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(a)throw n}}return o}}(e)||function(e){if(e){if("string"==typeof e)return em(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 em(e,2)}}(e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),p=s[0],f=s[1],d=_().schema;return(0,n.useEffect)(function(){f(d)},[a.address,null==l||null==(r=l["x-action-settings"])?void 0:r.exportSettings]),{title:c("Exportable fields"),schema:p,initialValues:{exportSettings:null==l||null==(i=l["x-action-settings"])?void 0:i.exportSettings},components:{ArrayItems:P.ArrayItems},onSubmit:function(e){var t,n=e.exportSettings;l["x-action-settings"].exportSettings=null==n?void 0:n.filter(function(e){var t;return null==e||null==(t=e.dataIndex)?void 0:t.length}).map(function(e){return{dataIndex:e.dataIndex.map(function(e){var t;return null!=(t=e.name)?t:e}),title:e.title}}),u.emit("patch",{schema:(eb(t={},"x-uid",l["x-uid"]),eb(t,"x-action-settings",l["x-action-settings"]),t)}),u.refresh()}}}},{name:"divider",type:"divider"},{name:"delete",type:"remove",useComponentProps:function(){return{removeParentsIfNoChildren:!0,breakRemoveOn:function(e){return"Space"===e["x-component"]||e["x-component"].endsWith("ActionBar")},confirm:{title:(0,(0,F.useTranslation)().t)("Delete action")}}}}]});function ey(e,t,n,r,o,i,a){try{var l=e[i](a),c=l.value}catch(e){n(e);return}l.done?t(c):Promise.resolve(c).then(r,o)}function eh(e,t,n){return(eh=eS()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&ex(o,n.prototype),o}).apply(null,arguments)}function eg(e){return(eg=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ex(e,t){return(ex=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ew(e){var t="function"==typeof Map?new Map:void 0;return(ew=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 eh(e,arguments,eg(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),ex(n,e)})(e)}function eS(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(eS=function(){return!!e})()}var eO=function(e){var n;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function r(){var e,t;if(!(this instanceof r))throw TypeError("Cannot call a class as a function");return e=r,t=arguments,e=eg(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,eS()?Reflect.construct(e,t||[],eg(this).constructor):e.apply(this,t))}return r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),e&&ex(r,e),n=[{key:"load",value:function(){var e;return(e=function(){var e,n;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:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(a,"next",{value:c(0)}),l(a,"throw",{value:c(1)}),l(a,"return",{value:c(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function c(l){return function(c){var u=[l,c];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=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(r){return this.app.use(q),e={title:"{{t('Export')}}",Component:"ExportActionInitializer",schema:{"x-align":"right","x-decorator":"ACLActionProvider","x-acl-action-props":{skipScopeCheck:!0}},useVisible:function(){return(0,t.useActionAvailable)("export")}},null==(n=this.app.schemaInitializerManager.get("table:configureActions"))||n.add("enableActions.export",e),this.app.schemaInitializerManager.addItem("gantt:configureActions","enableActions.export",e),this.app.schemaSettingsManager.add(ev),this.app.flowEngine.registerModels({ExportActionModel:ed}),[2]})},function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){ey(i,r,o,a,l,"next",e)}function l(e){ey(i,r,o,a,l,"throw",e)}a(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)}}(r.prototype,n),r}(ew(t.Plugin)),ej=eO}(),h}()});
|
|
@@ -7,9 +7,20 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
import { ActionModel } from '@nocobase/client-v2';
|
|
10
|
+
import { type CascaderProps } from 'antd';
|
|
11
|
+
import React from 'react';
|
|
10
12
|
import type { ButtonProps } from 'antd/es/button';
|
|
13
|
+
import type { ExportFieldOption } from './buildExportFieldOptions';
|
|
14
|
+
import { createLazyOptionFieldsCache } from './getOptionFields';
|
|
15
|
+
type ExportFieldsCascaderProps = Omit<CascaderProps<ExportFieldOption, 'name', false>, 'fieldNames' | 'loadData' | 'onChange' | 'options' | 'showSearch' | 'value'> & {
|
|
16
|
+
optionsCache: ReturnType<typeof createLazyOptionFieldsCache>;
|
|
17
|
+
value?: unknown[];
|
|
18
|
+
onChange?: (value: string[] | null, selectedOptions: ExportFieldOption[]) => void;
|
|
19
|
+
};
|
|
20
|
+
export declare const ExportFieldsCascader: (props: ExportFieldsCascaderProps) => React.JSX.Element;
|
|
11
21
|
export declare class ExportActionModel extends ActionModel {
|
|
12
22
|
static scene: import("@nocobase/client-v2").ActionSceneType;
|
|
13
23
|
defaultProps: ButtonProps;
|
|
14
24
|
getAclActionName(): string;
|
|
15
25
|
}
|
|
26
|
+
export {};
|
|
@@ -6,6 +6,19 @@
|
|
|
6
6
|
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
|
+
export type ExportFieldOption = {
|
|
10
|
+
name: string;
|
|
11
|
+
title?: unknown;
|
|
12
|
+
schema?: unknown;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
isLeaf?: boolean;
|
|
15
|
+
loading?: boolean;
|
|
16
|
+
children?: ExportFieldOption[];
|
|
17
|
+
};
|
|
18
|
+
type ExportFieldSearchOptions = {
|
|
19
|
+
limit?: number;
|
|
20
|
+
signal?: AbortSignal;
|
|
21
|
+
};
|
|
9
22
|
export declare const buildExportFieldOptions: (fields: any, getTitle: any, getTargetFields: any) => any;
|
|
10
23
|
export declare const buildExportFieldLazyOptions: (fields: any, getTitle: any, options?: any) => any;
|
|
11
24
|
export declare const buildExportFieldLazyChildren: (option: any, getTitle: any, getTargetFields: any) => any;
|
|
@@ -13,4 +26,6 @@ export declare const createExportFieldLazyOptionsCache: (fields: any, getTitle:
|
|
|
13
26
|
getRootOptions: () => any;
|
|
14
27
|
loadChildren: (option: any) => any;
|
|
15
28
|
preloadPath: (path: any) => boolean;
|
|
29
|
+
searchOptionsAsync: (searchValue: string, { limit, signal }?: ExportFieldSearchOptions) => Promise<ExportFieldOption[]>;
|
|
16
30
|
};
|
|
31
|
+
export {};
|
|
@@ -13,4 +13,8 @@ export declare const createLazyOptionFieldsCache: (fields: any, t: any) => {
|
|
|
13
13
|
getRootOptions: () => any;
|
|
14
14
|
loadChildren: (option: any) => any;
|
|
15
15
|
preloadPath: (path: any) => boolean;
|
|
16
|
+
searchOptionsAsync: (searchValue: string, { limit, signal }?: {
|
|
17
|
+
limit?: number;
|
|
18
|
+
signal?: AbortSignal;
|
|
19
|
+
}) => Promise<import("./buildExportFieldOptions").ExportFieldOption[]>;
|
|
16
20
|
};
|
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("@nocobase/flow-engine")):"function"==typeof define&&define.amd?define("@nocobase/plugin-action-export/client-v2",["@emotion/css","@nocobase/client-v2","react","antd","@nocobase/flow-engine"],t):"object"==typeof exports?exports["@nocobase/plugin-action-export/client-v2"]=t(require("@emotion/css"),require("@nocobase/client-v2"),require("react"),require("antd"),require("@nocobase/flow-engine")):e["@nocobase/plugin-action-export/client-v2"]=t(e["@emotion/css"],e["@nocobase/client-v2"],e.react,e.antd,e["@nocobase/flow-engine"])}(self,function(e,t,n,r,o){return function(){var i={574:function(e,t,n){var r,o;void 0===(o="function"==typeof(r=function(){"use strict";function t(e,t,n){var r=new XMLHttpRequest;r.open("GET",e),r.responseType="blob",r.onload=function(){l(r.response,t,n)},r.onerror=function(){console.error("could not download file")},r.send()}function r(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch(e){}return 200<=t.status&&299>=t.status}function o(e){try{e.dispatchEvent(new MouseEvent("click"))}catch(n){var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var i="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof n.g&&n.g.global===n.g?n.g:void 0,a=i.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),l=i.saveAs||("object"!=typeof window||window!==i?function(){}:"download"in HTMLAnchorElement.prototype&&!a?function(e,n,a){var l=i.URL||i.webkitURL,c=document.createElement("a");c.download=n=n||e.name||"download",c.rel="noopener","string"==typeof e?(c.href=e,c.origin===location.origin?o(c):r(c.href)?t(e,n,a):o(c,c.target="_blank")):(c.href=l.createObjectURL(e),setTimeout(function(){l.revokeObjectURL(c.href)},4e4),setTimeout(function(){o(c)},0))}:"msSaveOrOpenBlob"in navigator?function(e,n,i){if(n=n||e.name||"download","string"!=typeof e){var a;navigator.msSaveOrOpenBlob((void 0===(a=i)?a={autoBom:!1}:"object"!=typeof a&&(console.warn("Deprecated: Expected third argument to be a object"),a={autoBom:!a}),a.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\uFEFF",e],{type:e.type}):e),n)}else if(r(e))t(e,n,i);else{var l=document.createElement("a");l.href=e,l.target="_blank",setTimeout(function(){o(l)})}}:function(e,n,r,o){if((o=o||open("","_blank"))&&(o.document.title=o.document.body.innerText="downloading..."),"string"==typeof e)return t(e,n,r);var l="application/octet-stream"===e.type,c=/constructor/i.test(i.HTMLElement)||i.safari,u=/CriOS\/[\d]+/.test(navigator.userAgent);if((u||l&&c||a)&&"u">typeof FileReader){var s=new FileReader;s.onloadend=function(){var e=s.result;e=u?e:e.replace(/^data:[^;]*;/,"data:attachment/file;"),o?o.location.href=e:location=e,o=null},s.readAsDataURL(e)}else{var f=i.URL||i.webkitURL,p=f.createObjectURL(e);o?o.location=p:location.href=p,o=null,setTimeout(function(){f.revokeObjectURL(p)},4e4)}});i.saveAs=l.saveAs=l,e.exports=l})?r.apply(t,[]):r)||(e.exports=o)},682:function(e,t,n){"use strict";n.r(t),n.d(t,{ExportActionModel:function(){return E}});var r=n(694),o=n(485),i=n(477),a=n(574),l=n(59),c=n(155),u=n.n(c),s=n(132),f="action-export";function p(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}var d=function(e){return Array.isArray(e)&&e.length?e.map(function(e){var t;return null!=(t=null==e?void 0:e.name)?t:e}):null},b=function(e){var t;return function(e){if(Array.isArray(e))return p(e)}(t=e.getRootOptions())||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e){if(e){if("string"==typeof e)return p(e,void 0);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 p(e,void 0)}}(t)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()};function y(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 v(e,t,n,r,o,i,a){try{var l=e[i](a),c=l.value}catch(e){n(e);return}l.done?t(c):Promise.resolve(c).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 h(e){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function g(e,t){return(g=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function w(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function O(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(O=function(){return!!e})()}function x(){var e=w(["\n width: 100%;\n & .ant-space-item:nth-child(2),\n & .ant-space-item:nth-child(3) {\n flex: 1;\n }\n "]);return x=function(){return e},e}function j(){var e=w(["\n border-color: var(--colorSettings);\n color: var(--colorSettings);\n &.ant-btn-dashed:hover {\n border-color: var(--colorSettings);\n color: var(--colorSettings);\n }\n "]);return j=function(){return e},e}var S={label:"title",value:"name",children:"children"},A=function(e){var t,n,r,o=e.optionsCache,i=e.value,a=e.onChange,c=e.onDropdownVisibleChange,s=function(e,t){if(null==e)return{};var n,r,o,i={};if("u">typeof Reflect&&Reflect.ownKeys){for(o=0,n=Reflect.ownKeys(Object(e));o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r]);return i}if(i=function(e,t){if(null==e)return{};var n,r,o={},i=Object.getOwnPropertyNames(e);for(r=0;r<i.length;r++)n=i[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n]);return o}(e,t),Object.getOwnPropertySymbols)for(o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r]);return i}(e,["optionsCache","value","onChange","onDropdownVisibleChange"]),f=function(e){if(Array.isArray(e))return e}(t=u().useState(0))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],i=!0,a=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),2!==o.length);i=!0);}catch(e){a=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(a)throw n}}return o}}(t)||function(e){if(e){if("string"==typeof e)return y(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 y(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.")}(),p=(f[0],f[1]),v=u().useMemo(function(){return d(i)},[i]),h=u().useCallback(function(){p(function(e){return e+1})},[]),g=u().useCallback(function(e){return Array.isArray(e)?e.map(function(e){var t;return null!=(t=null==e?void 0:e.name)?t:e}).join("."):""},[]);o.preloadPath(v);var w=b(o),O=u().useCallback(function(e){var t=null==e?void 0:e[e.length-1];!t||t.isLeaf||t.children||(t.loading=!0,o.loadChildren(t),t.loading=!1,h())},[o,h]),x=u().useCallback(function(e){e&&h(),null==c||c(e)},[c,h]),j=u().useCallback(function(e){null==a||a(d(e))},[a]),A=u().useCallback(function(e,t){var n=g(i),r=n?n.split(".").length:0;return(null==e?void 0:e.length)&&(!r||e.length>=r)?e.join(" / "):n?n.replace(/\./g," / "):null==t?void 0:t.map(function(e){return(null==e?void 0:e.title)||(null==e?void 0:e.name)}).join(" / ")},[g,i]);return u().createElement(l.Cascader,(n=function(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}({},s),r=r={value:v||void 0,fieldNames:S,options:w,loadData:O,onChange:j,onDropdownVisibleChange:x,displayRender:A},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(r)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))}),n))},P=function(e,t){return(0,s.Fv)(e,function(e){var n;return t(null==e||null==(n=e.uiSchema)?void 0:n.title)||e.name},function(e){return e.targetCollection&&e.targetCollection.getFields()||[]})},E=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,o;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return t=n,o=arguments,t=h(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,O()?Reflect.construct(t,o||[],h(this).constructor):t.apply(this,o)),"defaultProps",{title:(0,r.escapeT)("Export"),type:"default",icon:"clouddownloadoutlined"}),e}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&g(n,e),t=[{key:"getAclActionName",value:function(){return"export"}}],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}(o.ActionModel);m(E,"scene",o.ActionSceneEnum.collection),E.define({label:(0,r.escapeT)("Export"),sort:1030}),E.registerFlow({key:"exportSettings",on:"click",steps:{confirm:{use:"confirm",hideInSettings:!0,defaultParams:{enable:!0,title:(0,r.escapeT)("Export"),content:(0,r.escapeT)("Export warning",{ns:f,limit:2e3})}},export:{handler:function(e,t){var n;return(n=function(){var t,n,r,o,i,l,c,u,s,f;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:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(a,"next",{value:c(0)}),l(a,"throw",{value:c(1)}),l(a,"return",{value:c(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function c(l){return function(c){var u=[l,c];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=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(p){switch(p.label){case 0:return t=e.model.getProps().exportSettings,r=(n=e.model.context.blockModel).resource,i=(o=n.collection).title,l=o.fields,c=o.filterTargetKey,s=(u=r.getSelectedRows()).length>0?m({},c,e.blockModel.collection.getFilterByTK(u)):r.getFilter(),Array.isArray(c)&&c.length>1&&(s={$or:e.blockModel.collection.getFilterByTK(u)}),t.forEach(function(t){var n,r,o=null!=(n=l.get(t.dataIndex[0]))?n:{},i=o.uiSchema;o.interface,t.enum=null==i||null==(r=i.enum)?void 0:r.map(function(e){return{value:e.value,label:e.label}}),t.enum||(null==i?void 0:i.type)!=="boolean"||(t.enum=[{value:!0,label:e.t("Yes")},{value:!1,label:e.t("No")}]),t.defaultTitle=e.t(null==i?void 0:i.title)}),[4,r.runAction("export",{data:{columns:t},responseType:"blob",params:{title:e.t(i),appends:r.getAppends(),sort:r.getSort(),filter:s}})];case 1:return f=new Blob([p.sent()],{type:"application/x-xls"}),(0,a.saveAs)(f,"".concat(e.t(i),".xlsx")),[2]}})},function(){var e=this,t=arguments;return new Promise(function(r,o){var i=n.apply(e,t);function a(e){v(i,r,o,a,l,"next",e)}function l(e){v(i,r,o,a,l,"throw",e)}a(void 0)})})()}}}}),E.registerFlow({key:"exportActionSetting",title:(0,r.escapeT)("Export settings",{ns:f}),steps:{exportableFields:{title:(0,r.escapeT)("Exportable fields"),uiSchema:function(e){var t=P(e.model.context.blockModel.collection.getFields(),e.t);return{exportSettings:{type:"array","x-component":"ArrayItems","x-decorator":"FormItem",items:{type:"object",properties:{space:{type:"void","x-component":"Space","x-component-props":{className:(0,i.css)(x())},properties:{sort:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.SortHandle"},dataIndex:{type:"array","x-decorator":"FormItem","x-component":A,required:!0,"x-component-props":{changeOnSelect:!1,optionsCache:t}},title:{type:"string","x-decorator":"FormItem","x-component":"Input","x-component-props":{placeholder:'{{ t("Custom column title") }}'}},remove:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.Remove"}}}}},properties:{add:{type:"void",title:'{{ t("Add exportable field") }}',"x-component":"ArrayItems.Addition","x-component-props":{className:(0,i.css)(j())}}}}}},defaultParams:function(e){var t;return{exportSettings:null==(t=e.model.context.blockModel.collection.getFields())?void 0:t.filter(function(e){return!e.isAssociationField()&&e.options.interface}).map(function(e){return{dataIndex:[e.name]}})}},handler:function(e,t){var n=t.exportSettings,r=null==n?void 0:n.filter(function(e){var t;return null==e||null==(t=e.dataIndex)?void 0:t.length}).map(function(e){return{dataIndex:e.dataIndex.map(function(e){var t;return null!=(t=e.name)?t:e}),title:e.title}});e.model.setProps("exportSettings",r)}}}})},132:function(e,t,n){"use strict";function r(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 o(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){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function i(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}n.d(t,{Fv:function(){return g},xD:function(){return v}});var a,l=["hasMany","belongsToMany","belongsToArray"],c=((function(e){if(Array.isArray(e))return r(e)})(a=["hasOne","belongsTo"])||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(a)||function(e){if(e){if("string"==typeof e)return r(e,void 0);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 r(e,void 0)}}(a)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).concat(["hasMany","belongsToMany","belongsToArray"]),u=new WeakMap,s=function(e){return(null==e?void 0:e.target)&&c.includes(e.type)},f=function(e){return(null==e?void 0:e.target)&&l.includes(e.type)},p=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{name:e.name,title:t(e),schema:null==e?void 0:e.uiSchema,disabled:n}},d=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=s(e),a=i(o({},p(e,t)),{isLeaf:!r});return u.set(a,{field:e,relationDepth:r?n:0}),a},b=function(e,t,n){return!(n>=2||f(e)&&f(t))},y=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if(!(null==e?void 0:e.interface))return null;if(!s(e))return p(e,t);var a=(n(e)||[]).map(function(o){return s(o)?b(e,o,r)?y(o,t,n,r+1):null:y(o,t,n)}).filter(Boolean);return a.length?i(o({},p(e,t)),{children:a}):p(e,t,!0)},v=function(e,t,n){return(e||[]).map(function(e){return y(e,t,n,+!!s(e))}).filter(Boolean)},m=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.parentField,o=n.parentRelationDepth,i=void 0===o?0:o;return(e||[]).map(function(e){return!(null==e?void 0:e.interface)||r&&s(e)&&!b(r,e,i)?null:d(e,t,s(e)?i+1:0)}).filter(Boolean)},h=function(e,t,n){var r=e&&(void 0===e?"undefined":e&&"u">typeof Symbol&&e.constructor===Symbol?"symbol":typeof e)=="object"?u.get(e):null,o=null==r?void 0:r.field;return s(o)?m(n(o)||[],t,{parentField:o,parentRelationDepth:(null==r?void 0:r.relationDepth)||1}):[]},g=function(e,t,n){var r=m(e,t),o=function(e){if(!e||e.isLeaf)return[];if(e.children)return e.children;var r=h(e,t,n);return r.length?e.children=r:(e.isLeaf=!0,e.disabled=!0,e.children=[]),e.children};return{getRootOptions:function(){return r},loadChildren:o,preloadPath:function(e){if(!Array.isArray(e)||e.length<=1)return!1;for(var t=!1,n=r,i=0;i<e.length-1&&"break"!==function(r){var i,a,l=null!=(i=null==(a=e[r])?void 0:a.name)?i:e[r],c=n.find(function(e){return(null==e?void 0:e.name)===l});if(!c||c.isLeaf)return"break";var u=!!c.children;n=o(c),u||(t=!0)}(i);i++);return t}}}},477:function(t){"use strict";t.exports=e},485:function(e){"use strict";e.exports=t},694:function(e){"use strict";e.exports=o},59:function(e){"use strict";e.exports=r},155:function(e){"use strict";e.exports=n}},a={};function l(e){var t=a[e];if(void 0!==t)return t.exports;var n=a[e]={exports:{}};return i[e].call(n.exports,n,n.exports,l),n.exports}l.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(t,{a:t}),t},l.d=function(e,t){for(var n in t)l.o(t,n)&&!l.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},l.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),l.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},l.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.g.importScripts&&(c=l.g.location+"");var c,u=l.g.document;if(!c&&u&&(u.currentScript&&"SCRIPT"===u.currentScript.tagName.toUpperCase()&&(c=u.currentScript.src),!c)){var s=u.getElementsByTagName("script");if(s.length)for(var f=s.length-1;f>-1&&(!c||!/^http(s?):/.test(c));)c=s[f--].src}if(!c)throw Error("Automatic publicPath is not supported in this browser");l.p=c.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/");var p={};return!function(){"use strict";var e="",t="u">typeof document?document.currentScript:null;if(t&&t.src){var n=t.src.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"");n.indexOf("/static/plugins/@nocobase/plugin-action-export/dist/client-v2/")>=0&&(e=n.replace(/\/[^\/]+$/,"/"))}if(!e){var r=window.__webpack_public_path__||"";r&&("/"!==r.charAt(r.length-1)&&(r+="/"),e=r+"static/plugins/@nocobase/plugin-action-export/dist/client-v2/")}if(!e){var o=window.__nocobase_modern_client_prefix__||"v",i="/"+(o=String(o).replace(/^\/+|\/+$/g,"")||"v")+"/";if(!(e=window.__nocobase_public_path__||"")&&window.location&&window.location.pathname){var a=window.location.pathname||"/",c=a.indexOf(i);e=c>=0?a.slice(0,c+1):"/"}e&&(e=e.replace(RegExp("/"+o+"/?$"),"/")),e||(e="/"),"/"!==e.charAt(e.length-1)&&(e+="/"),e+="static/plugins/@nocobase/plugin-action-export/dist/client-v2/"}l.p=e}(),!function(){"use strict";l.r(p),l.d(p,{ExportActionModel:function(){return t.ExportActionModel},PluginActionExportClient:function(){return s},buildExportFieldOptions:function(){return n.xD}});var e=l(485),t=l(682),n=l(132);function r(e,t,n,r,o,i,a){try{var l=e[i](a),c=l.value}catch(e){n(e);return}l.done?t(c):Promise.resolve(c).then(r,o)}function o(e,t,n){return(o=u()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&a(o,n.prototype),o}).apply(null,arguments)}function i(e){return(i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function a(e,t){return(a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function c(e){var t="function"==typeof Map?new Map:void 0;return(c=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 o(e,arguments,i(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),a(n,e)})(e)}function u(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(u=function(){return!!e})()}var s=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=i(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,u()?Reflect.construct(e,t||[],i(this).constructor):e.apply(this,t))}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&a(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:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(a,"next",{value:c(0)}),l(a,"throw",{value:c(1)}),l(a,"return",{value:c(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function c(l){return function(c){var u=[l,c];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=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.app.flowEngine.registerModelLoaders({ExportActionModel:{extends:"ActionModel",loader:function(){return Promise.resolve().then(l.bind(l,682))}}}),[2]})},function(){var t=this,n=arguments;return new Promise(function(o,i){var a=e.apply(t,n);function l(e){r(a,o,i,l,c,"next",e)}function c(e){r(a,o,i,l,c,"throw",e)}l(void 0)})}).call(this)}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(n.prototype,t),n}(c(e.Plugin));p.default=s}(),p}()});
|
|
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/flow-engine")):"function"==typeof define&&define.amd?define("@nocobase/plugin-action-export/client-v2",["@emotion/css","@nocobase/client-v2","react","antd","@nocobase/flow-engine"],t):"object"==typeof exports?exports["@nocobase/plugin-action-export/client-v2"]=t(require("@emotion/css"),require("@nocobase/client-v2"),require("react"),require("antd"),require("@nocobase/flow-engine")):e["@nocobase/plugin-action-export/client-v2"]=t(e["@emotion/css"],e["@nocobase/client-v2"],e.react,e.antd,e["@nocobase/flow-engine"])}(self,function(e,t,n,r,o){return function(){var i={574:function(e,t,n){var r,o;void 0===(o="function"==typeof(r=function(){"use strict";function t(e,t,n){var r=new XMLHttpRequest;r.open("GET",e),r.responseType="blob",r.onload=function(){c(r.response,t,n)},r.onerror=function(){console.error("could not download file")},r.send()}function r(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch(e){}return 200<=t.status&&299>=t.status}function o(e){try{e.dispatchEvent(new MouseEvent("click"))}catch(n){var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var i="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof n.g&&n.g.global===n.g?n.g:void 0,a=i.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),c=i.saveAs||("object"!=typeof window||window!==i?function(){}:"download"in HTMLAnchorElement.prototype&&!a?function(e,n,a){var c=i.URL||i.webkitURL,l=document.createElement("a");l.download=n=n||e.name||"download",l.rel="noopener","string"==typeof e?(l.href=e,l.origin===location.origin?o(l):r(l.href)?t(e,n,a):o(l,l.target="_blank")):(l.href=c.createObjectURL(e),setTimeout(function(){c.revokeObjectURL(l.href)},4e4),setTimeout(function(){o(l)},0))}:"msSaveOrOpenBlob"in navigator?function(e,n,i){if(n=n||e.name||"download","string"!=typeof e){var a;navigator.msSaveOrOpenBlob((void 0===(a=i)?a={autoBom:!1}:"object"!=typeof a&&(console.warn("Deprecated: Expected third argument to be a object"),a={autoBom:!a}),a.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\uFEFF",e],{type:e.type}):e),n)}else if(r(e))t(e,n,i);else{var c=document.createElement("a");c.href=e,c.target="_blank",setTimeout(function(){o(c)})}}:function(e,n,r,o){if((o=o||open("","_blank"))&&(o.document.title=o.document.body.innerText="downloading..."),"string"==typeof e)return t(e,n,r);var c="application/octet-stream"===e.type,l=/constructor/i.test(i.HTMLElement)||i.safari,u=/CriOS\/[\d]+/.test(navigator.userAgent);if((u||c&&l||a)&&"u">typeof FileReader){var s=new FileReader;s.onloadend=function(){var e=s.result;e=u?e:e.replace(/^data:[^;]*;/,"data:attachment/file;"),o?o.location.href=e:location=e,o=null},s.readAsDataURL(e)}else{var f=i.URL||i.webkitURL,p=f.createObjectURL(e);o?o.location=p:location.href=p,o=null,setTimeout(function(){f.revokeObjectURL(p)},4e4)}});i.saveAs=c.saveAs=c,e.exports=c})?r.apply(t,[]):r)||(e.exports=o)},682:function(e,t,n){"use strict";n.r(t),n.d(t,{ExportActionModel:function(){return _},ExportFieldsCascader:function(){return k}});var r=n(694),o=n(485),i=n(477),a=n(574),c=n(59),l=n(155),u=n.n(l),s=n(132),f="action-export";function p(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}var d=function(e){return Array.isArray(e)&&e.length?e.map(function(e){var t;return null!=(t=null==e?void 0:e.name)?t:e}):null},b=function(e){var t;return function(e){if(Array.isArray(e))return p(e)}(t=e.getRootOptions())||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e){if(e){if("string"==typeof e)return p(e,void 0);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 p(e,void 0)}}(t)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()};function v(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,a){try{var c=e[i](a),l=c.value}catch(e){n(e);return}c.done?t(l):Promise.resolve(l).then(r,o)}function h(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){y(i,r,o,a,c,"next",e)}function c(e){y(i,r,o,a,c,"throw",e)}a(void 0)})}}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 g(e){return(g=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function w(e,t){return(w=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function O(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,c=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){c=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(c)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return v(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return v(e,t)}}(e,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.")}()}function x(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function j(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(j=function(){return!!e})()}function S(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),c=Object.defineProperty;return c(a,"next",{value:l(0)}),c(a,"throw",{value:l(1)}),c(a,"return",{value:l(2)}),"function"==typeof Symbol&&c(a,Symbol.iterator,{value:function(){return this}}),a;function l(c){return function(l){var u=[c,l];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,r=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){i.label=u[1];break}if(6===u[0]&&i.label<o[1]){i.label=o[1],o=u;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=t.call(e,i)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}function A(){var e=x(["\n width: 100%;\n & .ant-space-item:nth-child(2),\n & .ant-space-item:nth-child(3) {\n flex: 1;\n }\n "]);return A=function(){return e},e}function P(){var e=x(["\n border-color: var(--colorSettings);\n color: var(--colorSettings);\n &.ant-btn-dashed:hover {\n border-color: var(--colorSettings);\n color: var(--colorSettings);\n }\n "]);return P=function(){return e},e}var E={label:"title",value:"name",children:"children"},k=function(e){var t,n,r=e.optionsCache,o=e.value,i=e.onChange,a=e.onDropdownVisibleChange,l=e.onSearch,s=e.notFoundContent,f=function(e,t){if(null==e)return{};var n,r,o,i={};if("u">typeof Reflect&&Reflect.ownKeys){for(o=0,n=Reflect.ownKeys(Object(e));o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r]);return i}if(i=function(e,t){if(null==e)return{};var n,r,o={},i=Object.getOwnPropertyNames(e);for(r=0;r<i.length;r++)n=i[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n]);return o}(e,t),Object.getOwnPropertySymbols)for(o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r]);return i}(e,["optionsCache","value","onChange","onDropdownVisibleChange","onSearch","notFoundContent"]),p=O(u().useState(0),2)[1],v=O(u().useState([]),2),y=v[0],g=v[1],w=O(u().useState("idle"),2),x=w[0],j=w[1],A=u().useRef(),P=u().useRef(),k=u().useRef(""),T=u().useRef(r),_=u().useRef(!1),C=u().useMemo(function(){return d(o)},[o]),R=u().useCallback(function(){p(function(e){return e+1})},[]);u().useEffect(function(){var e;T.current=r,k.current="",null==(e=A.current)||e.abort(),A.current=void 0,P.current&&(clearTimeout(P.current),P.current=void 0),g([]),j("idle")},[r]),u().useEffect(function(){return _.current=!0,function(){var e;_.current=!1,null==(e=A.current)||e.abort(),P.current&&clearTimeout(P.current)}},[]);var I=u().useCallback(function(e){return Array.isArray(e)?e.map(function(e){var t;return null!=(t=null==e?void 0:e.name)?t:e}).join("."):""},[]);r.preloadPath(C);var M=b(r),F=u().useCallback(function(e){var t=null==e?void 0:e[e.length-1];!t||t.isLeaf||t.children||(t.loading=!0,r.loadChildren(t),t.loading=!1,R())},[r,R]),L=u().useCallback(function(e){e&&R(),null==a||a(e)},[a,R]),D=u().useCallback(function(e,t){null==i||i(d(e),t)},[i]),B=u().useCallback(function(e){var t;k.current=e,P.current&&(clearTimeout(P.current),P.current=void 0),null==(t=A.current)||t.abort(),A.current=void 0,e.trim()?(g([]),j("loading"),P.current=setTimeout(function(){return h(function(){var t,n,o,i;return S(this,function(a){switch(a.label){case 0:t=r,n=e,A.current=o=new AbortController,P.current=void 0,a.label=1;case 1:return a.trys.push([1,3,4,5]),[4,t.searchOptionsAsync(n,{signal:o.signal})];case 2:if(i=a.sent(),o.signal.aborted||!_.current||T.current!==t||k.current!==n)return[2];return g(i),j("ready"),[3,5];case 3:return a.sent(),!o.signal.aborted&&_.current&&T.current===t&&k.current===n&&(g([]),j("error")),[3,5];case 4:return A.current===o&&(A.current=void 0),[7];case 5:return[2]}})})()},150)):(g([]),j("idle")),null==l||l(e)},[l,r]),q=!!k.current.trim(),U=u().useCallback(function(e,t){var n=I(o),r=n?n.split(".").length:0;return(null==e?void 0:e.length)&&(!r||e.length>=r)?e.join(" / "):n?n.replace(/\./g," / "):null==t?void 0:t.map(function(e){return(null==e?void 0:e.title)||(null==e?void 0:e.name)}).join(" / ")},[I,o]);return u().createElement(c.Cascader,(t=function(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}({},f),n=n={value:C||void 0,fieldNames:E,options:q?y:M,loadData:F,notFoundContent:"loading"===x?u().createElement(c.Spin,{size:"small"}):s,onChange:D,onDropdownVisibleChange:L,onSearch:B,showSearch:!0,displayRender:U},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t))},T=function(e,t){return(0,s.Fv)(e,function(e){var n;return t(null==e||null==(n=e.uiSchema)?void 0:n.title)||e.name},function(e){return e.targetCollection&&e.targetCollection.getFields()||[]})},_=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,o;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return t=n,o=arguments,t=g(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,j()?Reflect.construct(t,o||[],g(this).constructor):t.apply(this,o)),"defaultProps",{title:(0,r.escapeT)("Export"),type:"default",icon:"clouddownloadoutlined"}),e}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&w(n,e),t=[{key:"getAclActionName",value:function(){return"export"}}],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}(o.ActionModel);m(_,"scene",o.ActionSceneEnum.collection),_.define({label:(0,r.escapeT)("Export"),sort:1030}),_.registerFlow({key:"exportSettings",on:"click",steps:{confirm:{use:"confirm",hideInSettings:!0,defaultParams:{enable:!0,title:(0,r.escapeT)("Export"),content:(0,r.escapeT)("Export warning",{ns:f,limit:2e3})}},export:{handler:function(e,t){return h(function(){var t,n,r,o,i,c,l,u,s,f;return S(this,function(p){switch(p.label){case 0:return t=e.model.getProps().exportSettings,r=(n=e.model.context.blockModel).resource,i=(o=n.collection).title,c=o.fields,l=o.filterTargetKey,s=(u=r.getSelectedRows()).length>0?m({},l,e.blockModel.collection.getFilterByTK(u)):r.getFilter(),Array.isArray(l)&&l.length>1&&(s={$or:e.blockModel.collection.getFilterByTK(u)}),t.forEach(function(t){var n,r,o=null!=(n=c.get(t.dataIndex[0]))?n:{},i=o.uiSchema;o.interface,t.enum=null==i||null==(r=i.enum)?void 0:r.map(function(e){return{value:e.value,label:e.label}}),t.enum||(null==i?void 0:i.type)!=="boolean"||(t.enum=[{value:!0,label:e.t("Yes")},{value:!1,label:e.t("No")}]),t.defaultTitle=e.t(null==i?void 0:i.title)}),[4,r.runAction("export",{data:{columns:t},responseType:"blob",params:{title:e.t(i),appends:r.getAppends(),sort:r.getSort(),filter:s}})];case 1:return f=new Blob([p.sent()],{type:"application/x-xls"}),(0,a.saveAs)(f,"".concat(e.t(i),".xlsx")),[2]}})})()}}}}),_.registerFlow({key:"exportActionSetting",title:(0,r.escapeT)("Export settings",{ns:f}),steps:{exportableFields:{title:(0,r.escapeT)("Exportable fields"),uiSchema:function(e){var t=T(e.model.context.blockModel.collection.getFields(),e.t);return{exportSettings:{type:"array","x-component":"ArrayItems","x-decorator":"FormItem",items:{type:"object",properties:{space:{type:"void","x-component":"Space","x-component-props":{className:(0,i.css)(A())},properties:{sort:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.SortHandle"},dataIndex:{type:"array","x-decorator":"FormItem","x-component":k,required:!0,"x-component-props":{changeOnSelect:!1,optionsCache:t}},title:{type:"string","x-decorator":"FormItem","x-component":"Input","x-component-props":{placeholder:'{{ t("Custom column title") }}'}},remove:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.Remove"}}}}},properties:{add:{type:"void",title:'{{ t("Add exportable field") }}',"x-component":"ArrayItems.Addition","x-component-props":{className:(0,i.css)(P())}}}}}},defaultParams:function(e){var t;return{exportSettings:null==(t=e.model.context.blockModel.collection.getFields())?void 0:t.filter(function(e){return!e.isAssociationField()&&e.options.interface}).map(function(e){return{dataIndex:[e.name]}})}},handler:function(e,t){var n=t.exportSettings,r=null==n?void 0:n.filter(function(e){var t;return null==e||null==(t=e.dataIndex)?void 0:t.length}).map(function(e){return{dataIndex:e.dataIndex.map(function(e){var t;return null!=(t=e.name)?t:e}),title:e.title}});e.model.setProps("exportSettings",r)}}}})},132:function(e,t,n){"use strict";function r(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 o(e,t,n,r,o,i,a){try{var c=e[i](a),l=c.value}catch(e){n(e);return}c.done?t(l):Promise.resolve(l).then(r,o)}function i(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){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function a(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 c(e){return function(e){if(Array.isArray(e))return r(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e){if(e){if("string"==typeof e)return r(e,void 0);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 r(e,void 0)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}n.d(t,{Fv:function(){return O},xD:function(){return h}});var l=["hasMany","belongsToMany","belongsToArray"],u=c(["hasOne","belongsTo"]).concat(["hasMany","belongsToMany","belongsToArray"]),s=new WeakMap,f=function(e){return(null==e?void 0:e.target)&&u.includes(e.type)},p=function(e){return(null==e?void 0:e.target)&&l.includes(e.type)},d=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{name:e.name,title:t(e),schema:null==e?void 0:e.uiSchema,disabled:n}},b=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=f(e),o=a(i({},d(e,t)),{isLeaf:!r});return s.set(o,{field:e,relationDepth:r?n:0}),o},v=function(e,t,n){return!(n>=2||p(e)&&p(t))},y=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if(!(null==e?void 0:e.interface))return null;if(!f(e))return d(e,t);var o=(n(e)||[]).map(function(o){return f(o)?v(e,o,r)?y(o,t,n,r+1):null:y(o,t,n)}).filter(Boolean);return o.length?a(i({},d(e,t)),{children:o}):d(e,t,!0)},h=function(e,t,n){return(e||[]).map(function(e){return y(e,t,n,+!!f(e))}).filter(Boolean)},m=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.parentField,o=n.parentRelationDepth,i=void 0===o?0:o;return(e||[]).map(function(e){return!(null==e?void 0:e.interface)||r&&f(e)&&!v(r,e,i)?null:b(e,t,f(e)?i+1:0)}).filter(Boolean)},g=function(e,t,n){var r=e&&(void 0===e?"undefined":e&&"u">typeof Symbol&&e.constructor===Symbol?"symbol":typeof e)=="object"?s.get(e):null,o=null==r?void 0:r.field;return f(o)?m(n(o)||[],t,{parentField:o,parentRelationDepth:(null==r?void 0:r.relationDepth)||1}):[]},w=function(e){var t=[];return e.forEach(function(e){var n=t;e.forEach(function(t,r){var o,c=r===e.length-1,l=n.find(function(e){return e.name===t.name});l||(l=a(i({},t),{children:c?void 0:[]}),n.push(l)),c||((o=l).children||(o.children=[]),n=l.children)})}),t},O=function(e,t,n){var r=m(e,t),i=function(e){if(!e||e.isLeaf)return[];if(e.children)return e.children;var r=g(e,t,n);return r.length?e.children=r:(e.isLeaf=!0,e.disabled=!0,e.children=[]),e.children};return{getRootOptions:function(){return r},loadChildren:i,preloadPath:function(e){if(!Array.isArray(e)||e.length<=1)return!1;for(var t=!1,n=r,o=0;o<e.length-1&&"break"!==function(r){var o,a,c=null!=(o=null==(a=e[r])?void 0:a.name)?o:e[r],l=n.find(function(e){return(null==e?void 0:e.name)===c});if(!l||l.isLeaf)return"break";var u=!!l.children;n=i(l),u||(t=!0)}(o);o++);return t},searchOptionsAsync:function(e){var i,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l=a.limit,u=void 0===l?50:l,s=a.signal;return(i=function(){var o,i,a,l,f,p,d,b,v,y,h;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:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),c=Object.defineProperty;return c(a,"next",{value:l(0)}),c(a,"throw",{value:l(1)}),c(a,"return",{value:l(2)}),"function"==typeof Symbol&&c(a,Symbol.iterator,{value:function(){return this}}),a;function l(c){return function(l){var u=[c,l];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=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(m){switch(m.label){case 0:if(!(o=e.trim().toLocaleLowerCase())||(null==s?void 0:s.aborted))return[2,[]];i=[],a=c(r).reverse().map(function(e){return{option:e,path:[]}}),l=Math.max(1,u),f=performance.now(),p=0,m.label=1;case 1:if(!(a.length&&i.length<l))return[3,4];if(null==s?void 0:s.aborted)return[2,[]];if(!(d=a.pop()))return[3,4];if(b=c(d.path).concat([d.option]),d.option.isLeaf)v=b.some(function(e){var t;return String(null!=(t=e.title)?t:"").toLocaleLowerCase().includes(o)}),!d.option.disabled&&v&&i.push(b);else for(h=(y=d.option.children||g(d.option,t,n)).length-1;h>=0;h--)a.push({option:y[h],path:b});if(!((p+=1)>=200||performance.now()-f>=8))return[3,3];return[4,new Promise(function(e){return setTimeout(e,0)})];case 2:if(m.sent(),null==s?void 0:s.aborted)return[2,[]];f=performance.now(),p=0,m.label=3;case 3:return[3,1];case 4:return[2,w(i)]}})},function(){var e=this,t=arguments;return new Promise(function(n,r){var a=i.apply(e,t);function c(e){o(a,n,r,c,l,"next",e)}function l(e){o(a,n,r,c,l,"throw",e)}c(void 0)})})()}}}},477:function(t){"use strict";t.exports=e},485:function(e){"use strict";e.exports=t},694:function(e){"use strict";e.exports=o},59:function(e){"use strict";e.exports=r},155:function(e){"use strict";e.exports=n}},a={};function c(e){var t=a[e];if(void 0!==t)return t.exports;var n=a[e]={exports:{}};return i[e].call(n.exports,n,n.exports,c),n.exports}c.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return c.d(t,{a:t}),t},c.d=function(e,t){for(var n in t)c.o(t,n)&&!c.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},c.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),c.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},c.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},c.g.importScripts&&(l=c.g.location+"");var l,u=c.g.document;if(!l&&u&&(u.currentScript&&"SCRIPT"===u.currentScript.tagName.toUpperCase()&&(l=u.currentScript.src),!l)){var s=u.getElementsByTagName("script");if(s.length)for(var f=s.length-1;f>-1&&(!l||!/^http(s?):/.test(l));)l=s[f--].src}if(!l)throw Error("Automatic publicPath is not supported in this browser");c.p=l.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/");var p={};return!function(){"use strict";var e="",t="u">typeof document?document.currentScript:null;if(t&&t.src){var n=t.src.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"");n.indexOf("/static/plugins/@nocobase/plugin-action-export/dist/client-v2/")>=0&&(e=n.replace(/\/[^\/]+$/,"/"))}if(!e){var r=window.__webpack_public_path__||"";r&&("/"!==r.charAt(r.length-1)&&(r+="/"),e=r+"static/plugins/@nocobase/plugin-action-export/dist/client-v2/")}if(!e){var o=window.__nocobase_modern_client_prefix__||"v",i="/"+(o=String(o).replace(/^\/+|\/+$/g,"")||"v")+"/";if(!(e=window.__nocobase_public_path__||"")&&window.location&&window.location.pathname){var a=window.location.pathname||"/",l=a.indexOf(i);e=l>=0?a.slice(0,l+1):"/"}e&&(e=e.replace(RegExp("/"+o+"/?$"),"/")),e||(e="/"),"/"!==e.charAt(e.length-1)&&(e+="/"),e+="static/plugins/@nocobase/plugin-action-export/dist/client-v2/"}c.p=e}(),!function(){"use strict";c.r(p),c.d(p,{ExportActionModel:function(){return t.ExportActionModel},PluginActionExportClient:function(){return s},buildExportFieldOptions:function(){return n.xD}});var e=c(485),t=c(682),n=c(132);function r(e,t,n,r,o,i,a){try{var c=e[i](a),l=c.value}catch(e){n(e);return}c.done?t(l):Promise.resolve(l).then(r,o)}function o(e,t,n){return(o=u()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&a(o,n.prototype),o}).apply(null,arguments)}function i(e){return(i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function a(e,t){return(a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function l(e){var t="function"==typeof Map?new Map:void 0;return(l=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 o(e,arguments,i(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),a(n,e)})(e)}function u(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(u=function(){return!!e})()}var s=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=i(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,u()?Reflect.construct(e,t||[],i(this).constructor):e.apply(this,t))}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&a(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:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),c=Object.defineProperty;return c(a,"next",{value:l(0)}),c(a,"throw",{value:l(1)}),c(a,"return",{value:l(2)}),"function"==typeof Symbol&&c(a,Symbol.iterator,{value:function(){return this}}),a;function l(c){return function(l){var u=[c,l];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=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.app.flowEngine.registerModelLoaders({ExportActionModel:{extends:"ActionModel",loader:function(){return Promise.resolve().then(c.bind(c,682))}}}),[2]})},function(){var t=this,n=arguments;return new Promise(function(o,i){var a=e.apply(t,n);function c(e){r(a,o,i,c,l,"next",e)}function l(e){r(a,o,i,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}(l(e.Plugin));p.default=s}(),p}()});
|
package/dist/externalVersion.js
CHANGED
|
@@ -10,20 +10,20 @@
|
|
|
10
10
|
module.exports = {
|
|
11
11
|
"@formily/react": "2.3.7",
|
|
12
12
|
"@formily/shared": "2.3.7",
|
|
13
|
-
"@nocobase/client": "3.0.0-alpha.
|
|
13
|
+
"@nocobase/client": "3.0.0-alpha.7",
|
|
14
14
|
"react": "18.2.0",
|
|
15
15
|
"@formily/antd-v5": "1.2.3",
|
|
16
16
|
"react-i18next": "11.18.6",
|
|
17
17
|
"lodash": "4.18.1",
|
|
18
18
|
"antd": "5.24.2",
|
|
19
|
-
"@nocobase/flow-engine": "3.0.0-alpha.
|
|
20
|
-
"@nocobase/client-v2": "3.0.0-alpha.
|
|
19
|
+
"@nocobase/flow-engine": "3.0.0-alpha.7",
|
|
20
|
+
"@nocobase/client-v2": "3.0.0-alpha.7",
|
|
21
21
|
"@emotion/css": "11.13.0",
|
|
22
|
-
"@nocobase/server": "3.0.0-alpha.
|
|
23
|
-
"@nocobase/logger": "3.0.0-alpha.
|
|
24
|
-
"@nocobase/actions": "3.0.0-alpha.
|
|
25
|
-
"@nocobase/database": "3.0.0-alpha.
|
|
22
|
+
"@nocobase/server": "3.0.0-alpha.7",
|
|
23
|
+
"@nocobase/logger": "3.0.0-alpha.7",
|
|
24
|
+
"@nocobase/actions": "3.0.0-alpha.7",
|
|
25
|
+
"@nocobase/database": "3.0.0-alpha.7",
|
|
26
26
|
"async-mutex": "0.5.0",
|
|
27
|
-
"@nocobase/data-source-manager": "3.0.0-alpha.
|
|
28
|
-
"@nocobase/utils": "3.0.0-alpha.
|
|
27
|
+
"@nocobase/data-source-manager": "3.0.0-alpha.7",
|
|
28
|
+
"@nocobase/utils": "3.0.0-alpha.7"
|
|
29
29
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"exceljs","version":"4.4.0","description":"Excel Workbook Manager - Read and Write xlsx and csv Files.","private":false,"license":"MIT","author":{"name":"Guyon Roche","email":"guyon@live.com"},"repository":{"type":"git","url":"https://github.com/exceljs/exceljs.git"},"engines":{"node":">=8.3.0"},"main":"./excel.js","browser":"./dist/exceljs.min.js","types":"./index.d.ts","files":["dist","lib","excel.js","LICENSE","README.md","README_zh.md","index.ts","index.d.ts"],"scripts":{"test":"npm run test:full","test:es5":"export EXCEL_BUILD=es5 && npm run test:full","test:full":"npm run build && npm run test:unit && npm run test:integration && npm run test:end-to-end && npm run test:jasmine","test:version":"npm run build && npm run test:unit && npm run test:integration && npm run test:end-to-end && npm run test:browser && npm run test:dist","test:all":"npm run test:native && npm run test:es5","test:native":"npm run test:full","test:unit":"mocha --require spec/config/setup --require spec/config/setup-unit spec/unit --recursive","test:integration":"mocha --require spec/config/setup spec/integration --recursive","test:end-to-end":"mocha --require spec/config/setup spec/end-to-end --recursive","test:browser":"if [ ! -f .disable-test-browser ]; then npm run build && npm run test:jasmine; fi","test:jasmine":"grunt jasmine","test:unit:es5":"export EXCEL_BUILD=es5 && npm run test:unit","test:integration:es5":"export EXCEL_BUILD=es5 && npm run test:integration","test:end-to-end:es5":"export EXCEL_BUILD=es5 && npm run test:end-to-end","test:dist":"mocha --require spec/config/setup spec/dist --recursive","test:manual":"node spec/manual/app.js","test:typescript":"mocha -r ts-node/register spec/typescript/**/*.spec.ts","clean-build":"npm run clean && npm run build","lint":"eslint --format node_modules/eslint-friendly-formatter .","lint:fix":"prettier-eslint --write $(pwd)'/**/*.js'","lint:staged":"lint-staged","clean":"rm -rf build/ && rm -rf dist","benchmark":"node --expose-gc benchmark","benchmark:debug":"node --expose-gc --inspect-brk --trace-deopt benchmark","build":"grunt build","install-build":"npm install && grunt build","preversion":"npm run clean && npm run build && npm run test:version","postversion":"git push --no-verify && git push --tags --no-verify"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.js":["prettier-eslint --write","eslint --format node_modules/eslint-friendly-formatter","git add"]},"keywords":["xlsx","json","csv","excel","font","border","fill","number","format","number format","alignment","office","spreadsheet","workbook","defined names","data validations","rich text","in-cell format","outlineLevel","views","frozen","split","pageSetup"],"dependencies":{"archiver":"^5.0.0","dayjs":"^1.8.34","fast-csv":"^4.3.1","jszip":"^3.10.1","readable-stream":"^3.6.0","saxes":"^5.0.1","tmp":"^0.2.0","unzipper":"^0.10.11","uuid":"^8.3.0"},"devDependencies":{"@babel/cli":"^7.10.5","@babel/core":"^7.11.4","@babel/preset-env":"^7.11.0","@types/chai":"^4.2.12","@types/mocha":"^8.0.3","@types/node":"^14.11.2","babelify":"^10.0.0","browserify":"^16.5.2","chai":"^4.2.0","chai-datetime":"^1.7.0","chai-xml":"^0.3.2","core-js":"^3.6.5","dirty-chai":"^2.0.1","eslint":"^6.5.1","eslint-config-airbnb-base":"^14.2.0","eslint-config-prettier":"^6.12.0","eslint-friendly-formatter":"^4.0.1","eslint-plugin-import":"^2.22.0","eslint-plugin-node":"^11.1.0","express":"^4.16.4","got":"^9.0.0","grunt":"^1.3.0","grunt-babel":"^8.0.0","grunt-browserify":"^5.3.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-jasmine":"^2.2.0","grunt-contrib-watch":"^1.1.0","grunt-exorcise":"^2.1.1","grunt-terser":"^1.0.0","husky":"^4.3.0","lint-staged":"^10.2.13","mocha":"^7.2.0","prettier-eslint":"^11.0.0","prettier-eslint-cli":"^5.0.0","regenerator-runtime":"^0.13.7","sax":"^1.2.4","ts-node":"^8.10.2","typescript":"^3.9.7"},"_lastModified":"2026-08-
|
|
1
|
+
{"name":"exceljs","version":"4.4.0","description":"Excel Workbook Manager - Read and Write xlsx and csv Files.","private":false,"license":"MIT","author":{"name":"Guyon Roche","email":"guyon@live.com"},"repository":{"type":"git","url":"https://github.com/exceljs/exceljs.git"},"engines":{"node":">=8.3.0"},"main":"./excel.js","browser":"./dist/exceljs.min.js","types":"./index.d.ts","files":["dist","lib","excel.js","LICENSE","README.md","README_zh.md","index.ts","index.d.ts"],"scripts":{"test":"npm run test:full","test:es5":"export EXCEL_BUILD=es5 && npm run test:full","test:full":"npm run build && npm run test:unit && npm run test:integration && npm run test:end-to-end && npm run test:jasmine","test:version":"npm run build && npm run test:unit && npm run test:integration && npm run test:end-to-end && npm run test:browser && npm run test:dist","test:all":"npm run test:native && npm run test:es5","test:native":"npm run test:full","test:unit":"mocha --require spec/config/setup --require spec/config/setup-unit spec/unit --recursive","test:integration":"mocha --require spec/config/setup spec/integration --recursive","test:end-to-end":"mocha --require spec/config/setup spec/end-to-end --recursive","test:browser":"if [ ! -f .disable-test-browser ]; then npm run build && npm run test:jasmine; fi","test:jasmine":"grunt jasmine","test:unit:es5":"export EXCEL_BUILD=es5 && npm run test:unit","test:integration:es5":"export EXCEL_BUILD=es5 && npm run test:integration","test:end-to-end:es5":"export EXCEL_BUILD=es5 && npm run test:end-to-end","test:dist":"mocha --require spec/config/setup spec/dist --recursive","test:manual":"node spec/manual/app.js","test:typescript":"mocha -r ts-node/register spec/typescript/**/*.spec.ts","clean-build":"npm run clean && npm run build","lint":"eslint --format node_modules/eslint-friendly-formatter .","lint:fix":"prettier-eslint --write $(pwd)'/**/*.js'","lint:staged":"lint-staged","clean":"rm -rf build/ && rm -rf dist","benchmark":"node --expose-gc benchmark","benchmark:debug":"node --expose-gc --inspect-brk --trace-deopt benchmark","build":"grunt build","install-build":"npm install && grunt build","preversion":"npm run clean && npm run build && npm run test:version","postversion":"git push --no-verify && git push --tags --no-verify"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.js":["prettier-eslint --write","eslint --format node_modules/eslint-friendly-formatter","git add"]},"keywords":["xlsx","json","csv","excel","font","border","fill","number","format","number format","alignment","office","spreadsheet","workbook","defined names","data validations","rich text","in-cell format","outlineLevel","views","frozen","split","pageSetup"],"dependencies":{"archiver":"^5.0.0","dayjs":"^1.8.34","fast-csv":"^4.3.1","jszip":"^3.10.1","readable-stream":"^3.6.0","saxes":"^5.0.1","tmp":"^0.2.0","unzipper":"^0.10.11","uuid":"^8.3.0"},"devDependencies":{"@babel/cli":"^7.10.5","@babel/core":"^7.11.4","@babel/preset-env":"^7.11.0","@types/chai":"^4.2.12","@types/mocha":"^8.0.3","@types/node":"^14.11.2","babelify":"^10.0.0","browserify":"^16.5.2","chai":"^4.2.0","chai-datetime":"^1.7.0","chai-xml":"^0.3.2","core-js":"^3.6.5","dirty-chai":"^2.0.1","eslint":"^6.5.1","eslint-config-airbnb-base":"^14.2.0","eslint-config-prettier":"^6.12.0","eslint-friendly-formatter":"^4.0.1","eslint-plugin-import":"^2.22.0","eslint-plugin-node":"^11.1.0","express":"^4.16.4","got":"^9.0.0","grunt":"^1.3.0","grunt-babel":"^8.0.0","grunt-browserify":"^5.3.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-jasmine":"^2.2.0","grunt-contrib-watch":"^1.1.0","grunt-exorcise":"^2.1.1","grunt-terser":"^1.0.0","husky":"^4.3.0","lint-staged":"^10.2.13","mocha":"^7.2.0","prettier-eslint":"^11.0.0","prettier-eslint-cli":"^5.0.0","regenerator-runtime":"^0.13.7","sax":"^1.2.4","ts-node":"^8.10.2","typescript":"^3.9.7"},"_lastModified":"2026-08-05T22:30:36.048Z"}
|
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"description": "Export filtered records to excel, you can configure which fields to export.",
|
|
7
7
|
"description.ru-RU": "Экспорт в Excel: можно настроить, какие поля будут экспортироваться.",
|
|
8
8
|
"description.zh-CN": "导出筛选后的记录到 Excel 中,可以配置导出哪些字段。",
|
|
9
|
-
"version": "3.0.0-alpha.
|
|
9
|
+
"version": "3.0.0-alpha.7",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"main": "./dist/server/index.js",
|
|
12
12
|
"homepage": "https://docs.nocobase.com/handbook/action-export",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"@nocobase/test": "2.x",
|
|
41
41
|
"@nocobase/utils": "2.x"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "19cd28c710f3b3c614ebe2fd7d5a415d527ee559",
|
|
44
44
|
"keywords": [
|
|
45
45
|
"Actions"
|
|
46
46
|
]
|