@nocobase/plugin-data-source-manager 2.1.0-alpha.40 → 2.1.0-alpha.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client-v2.d.ts +2 -0
- package/client-v2.js +1 -0
- package/dist/client/index.js +1 -1
- package/dist/client-v2/167.a04d61a8103d37ed.js +10 -0
- package/dist/client-v2/426.8387d793b913b8e0.js +10 -0
- package/dist/client-v2/components/DataSourceForm.d.ts +17 -0
- package/dist/client-v2/field-interfaces/index.d.ts +13 -0
- package/dist/client-v2/index.d.ts +12 -0
- package/dist/client-v2/index.js +10 -0
- package/dist/client-v2/locale.d.ts +12 -0
- package/dist/client-v2/pages/DataSourceCollectionsPage.d.ts +10 -0
- package/dist/client-v2/pages/DataSourcesPage.d.ts +10 -0
- package/dist/client-v2/pages/components/CollectionsPage.d.ts +27 -0
- package/dist/client-v2/pages/components/FieldForm.d.ts +19 -0
- package/dist/client-v2/pages/components/FieldsPage.d.ts +15 -0
- package/dist/client-v2/pages/components/ViewCollectionConfigure.d.ts +27 -0
- package/dist/client-v2/pages/components/collectionFieldApi.d.ts +11 -0
- package/dist/client-v2/pages/components/collectionTemplateFieldInterfaces.d.ts +18 -0
- package/dist/client-v2/plugin.d.ts +234 -0
- package/dist/client-v2/runtime.d.ts +12 -0
- package/dist/client-v2/utils/compileLegacyTemplate.d.ts +16 -0
- package/dist/externalVersion.js +16 -12
- package/dist/locale/en-US.json +261 -0
- package/dist/locale/zh-CN.json +261 -0
- package/dist/node_modules/zod/package.json +1 -1
- package/package.json +4 -2
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("ahooks"),require("@nocobase/client-v2"),require("react-router-dom"),require("@dnd-kit/sortable"),require("dayjs"),require("react"),require("antd"),require("@ant-design/icons"),require("@nocobase/flow-engine"),require("@dnd-kit/core"),require("@nocobase/utils/client"),require("lodash")):"function"==typeof define&&define.amd?define("@nocobase/plugin-data-source-manager/client-v2",["ahooks","@nocobase/client-v2","react-router-dom","@dnd-kit/sortable","dayjs","react","antd","@ant-design/icons","@nocobase/flow-engine","@dnd-kit/core","@nocobase/utils/client","lodash"],t):"object"==typeof exports?exports["@nocobase/plugin-data-source-manager/client-v2"]=t(require("ahooks"),require("@nocobase/client-v2"),require("react-router-dom"),require("@dnd-kit/sortable"),require("dayjs"),require("react"),require("antd"),require("@ant-design/icons"),require("@nocobase/flow-engine"),require("@dnd-kit/core"),require("@nocobase/utils/client"),require("lodash")):e["@nocobase/plugin-data-source-manager/client-v2"]=t(e.ahooks,e["@nocobase/client-v2"],e["react-router-dom"],e["@dnd-kit/sortable"],e.dayjs,e.react,e.antd,e["@ant-design/icons"],e["@nocobase/flow-engine"],e["@dnd-kit/core"],e["@nocobase/utils/client"],e.lodash)}(self,function(e,t,n,r,o,i,a,l,u,c,s,f){return function(){"use strict";var d,p,m,y,b,v={890:function(e,t,n){n.d(t,{A:function(){return en},v:function(){return et}});var r=n(485),o=n(155),i=n.n(o),a=n(143),l=n(694),u=n(625),c=n(59),s=n(773),f=n(938);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 p(e,t,n,r,o,i,a){try{var l=e[i](a),u=l.value}catch(e){n(e);return}l.done?t(u):Promise.resolve(u).then(r,o)}function m(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){p(i,r,o,a,l,"next",e)}function l(e){p(i,r,o,a,l,"throw",e)}a(void 0)})}}function y(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function b(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){y(e,t,n[t])})}return e}function v(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 h(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)||w(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 g(e){return function(e){if(Array.isArray(e))return d(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||w(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function w(e,t){if(e){if("string"==typeof e)return d(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 d(e,t)}}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),l=Object.defineProperty;return l(a,"next",{value:u(0)}),l(a,"throw",{value:u(1)}),l(a,"return",{value:u(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function u(l){return function(u){var c=[l,u];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var O=new Set(["hasOne","hasMany","belongsToMany"]),j="__viewUnsupportedFields";function k(e){var t=(0,s.get)(e,"data.data");return Array.isArray(t)?t:Array.isArray((0,s.get)(t,"data"))?(0,s.get)(t,"data"):[]}function F(e){var t=e||{};return t.rawTitle,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}(t,["rawTitle"])}function P(e){return Array.isArray(e)?e.filter(Boolean):"string"==typeof e?e.split(".").filter(Boolean):[]}function A(e){var t=P(e);return t.length?t.join("."):null}function x(e){return(null==e?void 0:e.options)||e||{}}function C(){var e=(0,l.useFlowContext)();return(0,u.useRequest)(function(){return m(function(){return S(this,function(t){switch(t.label){case 0:return[4,e.api.request({url:"dataSources/main/collections:list",params:{paginate:!1,sort:["sort"],filter:{"hidden.$isFalsy":!0},appends:["fields"]}})];case 1:return[2,k(t.sent())]}})})()})}function I(e){var t=(0,l.useFlowContext)(),n=(0,a.kj)(),r=t.dataSourceManager.collectionFieldInterfaceManager,d=(0,o.useRef)(),p=h((0,o.useState)(!1),2),g=p[0],w=p[1],O=c.Form.useWatch("databaseView",e.form),P=c.Form.useWatch("schema",e.form),x=c.Form.useWatch("viewName",e.form),C=(0,o.useMemo)(function(){return O||(x?P?"".concat(P,"@").concat(x):x:void 0)},[O,P,x]),I=(0,o.useMemo)(function(){var e;return((null==r||null==(e=r.getFieldInterfaces)?void 0:e.call(r))||[]).reduce(function(e,t){return t.name&&(e[t.name]=t),e},{})},[r]),E=(0,u.useRequest)(function(){return m(function(){return S(this,function(e){switch(e.label){case 0:return[4,t.api.resource("dbViews").list()];case 1:return[2,k(e.sent())]}})})()}),T=(0,o.useMemo)(function(){var e=(E.data||[]).map(function(e){return{value:e.schema?"".concat(e.schema,"@").concat(e.name):e.name,label:e.schema?"".concat(e.schema,".").concat((0,f.hd)(e.name,n)):(0,f.hd)(e.name,n)}});return C&&!e.some(function(e){return e.value===C})&&e.unshift({value:C,label:P?"".concat(P,".").concat((0,f.hd)(x||C,n)):(0,f.hd)(x||C,n)}),e},[C,n,E.data,P,x]),_=(0,o.useCallback)(function(n,r){return m(function(){var o,i,a,l;return S(this,function(u){switch(u.label){case 0:w(!0),u.label=1;case 1:return u.trys.push([1,,3,4]),[4,t.api.resource("dbViews").get({filterByTk:n,schema:r||void 0})];case 2:var c,f,d,p,m;return c=u.sent(),o={fields:(f=(0,s.get)(c,"data.data")||(0,s.get)(c,"data")||c||{}).fields,sources:f.sources,unsupportedFields:f.unsupportedFields},m=new Map(((p={currentFields:Array.isArray(i=e.form.getFieldValue("fields")||[])?i:[],fieldInterfacesByName:I,inferredFields:(d=o.fields)?(Array.isArray(d)?d:Object.values(d)).filter(Boolean):[]}).currentFields||[]).map(function(e){return[e.name,e]})),a=p.inferredFields.map(function(e){var t,n,r,o=m.get(e.name)||e,i=p.fieldInterfacesByName[o.interface||e.interface||""],a=(null==i||null==(t=i.default)?void 0:t.uiSchema)||{},l=(null==(n=o.uiSchema)?void 0:n.title)||o.title||(null==(r=e.uiSchema)?void 0:r.title)||e.name,u=v(b({},F(a),F(o.uiSchema||e.uiSchema)),{title:l});return e.source?v(b({},e),{interface:e.interface||o.interface,type:e.type||o.type,uiSchema:u}):v(b({},e,o),{uiSchema:u})}),l=Array.isArray(o.sources)?o.sources:[],e.form.setFieldsValue(y({fields:a.map(function(e){return v(b({},e),{source:A(e.source)})}),sources:l},j,Array.isArray(o.unsupportedFields)?o.unsupportedFields:[])),[3,4];case 3:return w(!1),[7];case 4:return[2]}})})()},[t.api,I,e.form]),M=(0,o.useCallback)(function(t){var n=function(e){if(!e)return{schema:null,viewName:null};var t=h(e.includes("@")?e.split("@"):[null,e],2);return{schema:t[0]||null,viewName:t[1]||e}}(t),r=n.schema,o=n.viewName;if(e.form.setFieldsValue(y({databaseView:t,schema:r,viewName:o,fields:[],sources:[]},j,[])),o){var i=e.form.getFieldValue("name");(!e.form.isFieldTouched("name")||i===d.current||/^t_[A-Za-z0-9]+$/.test(i))&&(d.current=o,e.form.setFieldValue("name",o)),_(o,r)}},[_,e.form]);return(0,o.useEffect)(function(){!O&&C&&e.form.setFieldValue("databaseView",C)},[C,e.form,O]),i().createElement(c.Spin,{spinning:g},i().createElement(c.Form.Item,{name:"databaseView",label:n("Connect to database view"),rules:[{required:!0,message:n("Please select a database view")}]},i().createElement(c.Select,{allowClear:!0,loading:E.loading,options:T,showSearch:!0,optionFilterProp:"label",disabled:"edit"===e.mode,onChange:M})),i().createElement(c.Form.Item,{name:"schema",hidden:!0},i().createElement(c.Input,null)),i().createElement(c.Form.Item,{name:"viewName",hidden:!0,rules:[{required:!0}]},i().createElement(c.Input,null)))}function E(e){var t=(0,a.kj)(),n=C(),r=c.Form.useWatch("sources",e.form),l=(0,o.useMemo)(function(){return Array.isArray(r)?r:[]},[r]),u=(0,o.useMemo)(function(){var e,r=(e=n.data||[],e.filter(function(e){return e.name}).map(function(e){return{value:e.name,label:(0,f.hd)(e.title||e.name,t)}})),o=l.filter(function(e){return!r.some(function(t){return t.value===e})}).map(function(e){return{value:e,label:e}});return g(r).concat(g(o))},[n.data,l,t]);return i().createElement(c.Form.Item,{name:"sources",label:t("Source collections")},i().createElement(c.Select,{mode:"multiple",options:u,loading:n.loading,disabled:!0,allowClear:!0}))}function T(e){var t=(0,l.useFlowContext)(),n=(0,a.kj)(),r=C(),u=t.dataSourceManager.collectionFieldInterfaceManager,s=t.dataSourceManager.getDataSource("main"),d=c.Form.useWatch("fields",e.form),p=c.Form.useWatch("sources",e.form),m=c.Form.useWatch(j,{form:e.form,preserve:!0}),y=(0,o.useMemo)(function(){return Array.isArray(d)?d:[]},[d]),w=(0,o.useMemo)(function(){return Array.isArray(p)?p:[]},[p]),S=(0,o.useMemo)(function(){var e,t,n,r,o;return n=(null==u||null==(e=u.getFieldInterfaceGroups)?void 0:e.call(u))||{},r=(null==u||null==(t=u.getFieldInterfaces)?void 0:t.call(u))||[],o=new Map,r.filter(function(e){return e.name&&!["relation","systemInfo"].includes(String(e.group))}).forEach(function(e){var t=String(e.group||"other"),n=o.get(t)||[];n.push({value:String(e.name),label:e.title||String(e.name),availableTypes:e.availableTypes}),o.set(t,n)}),Array.from(o.entries()).sort(function(e,t){var r,o,i,a,l=h(e,1)[0],u=h(t,1)[0];return(null!=(r=null==(i=n[l])?void 0:i.order)?r:0)-(null!=(o=null==(a=n[u])?void 0:a.order)?o:0)}).map(function(e){var t,r=h(e,2),o=r[0],i=r[1];return{label:(null==(t=n[o])?void 0:t.label)||o,options:i}})},[u]),k=(0,o.useMemo)(function(){return w.map(function(e){return(r.data||[]).find(function(t){return t.name===e})}).filter(Boolean).map(function(e){var t,r=null==s||null==(t=s.getCollection)?void 0:t.call(s,e.name),o="function"==typeof(null==r?void 0:r.getFields)?r.getFields():e.fields||[];return{value:e.name,label:(0,f.hd)(e.title||(null==r?void 0:r.title)||e.name,n),children:o.map(x).filter(function(e){return e.name&&!O.has(String(e.type))}).map(function(e){var t,r;return{value:e.name,label:(0,f.hd)((null==(t=(r=x(e)).uiSchema)?void 0:t.title)||r.title||r.name,n)}})}})},[r.data,s,w,n]),I=(0,o.useCallback)(function(t,n){var r=g(y);r.splice(t,1,v(b({},n),{source:A(n.source)})),e.form.setFieldValue("fields",r)},[y,e.form]),E=[{title:n("Field name"),dataIndex:"name",width:130},{title:n("Field source"),dataIndex:"source",width:220,render:function(e,t,o){return i().createElement(c.Cascader,{allowClear:!0,options:k,placeholder:n("Select field source"),value:P(e),onChange:function(e){var n,i,a,l=(e||[]).map(String),u=(r.data||[]).find(function(e){return e.name===l[0]}),c=l[0]?null==s||null==(n=s.getCollection)?void 0:n.call(s,l[0]):void 0,f=("function"==typeof(null==c?void 0:c.getFields)?c.getFields().map(x):(null==u?void 0:u.fields)||[]).find(function(e){return e.name===l[1]});I(o,v(b({},t),{source:l,interface:(null==f?void 0:f.interface)||t.interface,type:(null==f?void 0:f.type)||t.type,uiSchema:v(b({},t.uiSchema,null==f?void 0:f.uiSchema),{title:(null==f||null==(i=f.uiSchema)?void 0:i.title)||(null==(a=t.uiSchema)?void 0:a.title)||t.name})}))}})}},{title:n("Field type"),dataIndex:"type",width:140,render:function(e,t,n){var r;return!t.source&&(null==(r=t.possibleTypes)?void 0:r.length)?i().createElement(c.Select,{value:e,style:{width:"100%"},popupMatchSelectWidth:!1,options:t.possibleTypes.map(function(e){return{label:e,value:e}}),onChange:function(e){return I(n,v(b({},t),{type:e}))}}):i().createElement(c.Tag,null,e)}},{title:n("Field interface"),dataIndex:"interface",width:180,render:function(e,t,r){if(t.source){var o,a=null==u||null==(o=u.getFieldInterface)?void 0:o.call(u,e);return i().createElement(c.Tag,null,(0,f.hd)((null==a?void 0:a.title)||e,n))}return i().createElement(c.Select,{allowClear:!0,popupMatchSelectWidth:!1,style:{width:"100%"},options:S.map(function(e){return{label:(0,f.hd)(e.label,n),options:e.options.filter(function(e){var n;return!t.type||(null==(n=e.availableTypes)?void 0:n.includes(t.type))}).map(function(e){return{value:e.value,label:(0,f.hd)(e.label,n)}})}}),value:e||void 0,onChange:function(e){var n,o,i,a,l,c,s=null==u||null==(n=u.getFieldInterface)?void 0:n.call(u,e);I(r,v(b({},t),{interface:e||null,type:(null==s||null==(o=s.default)?void 0:o.type)||t.type,uiSchema:v(b({},null==s||null==(i=s.default)?void 0:i.uiSchema),{title:(null==s||null==(l=s.default)||null==(a=l.uiSchema)?void 0:a.title)||(null==(c=t.uiSchema)?void 0:c.title)||t.name})}))}})}},{title:n("Field display name"),dataIndex:["uiSchema","title"],width:180,render:function(e,t,n){var r;return i().createElement(c.Input,{value:(null==(r=t.uiSchema)?void 0:r.title)||t.name,onChange:function(e){I(n,v(b({},t),{uiSchema:v(b({},F(t.uiSchema)),{title:e.target.value})}))}})}}];return r.loading?i().createElement(c.Spin,null):i().createElement(i().Fragment,null,i().createElement(c.Form.Item,{name:"fields",hidden:!0,rules:[{required:!0}]},i().createElement(c.Input,null)),y.length?i().createElement(c.Form.Item,{label:n("Fields"),required:!0,extra:n("Fields can only be used correctly if they are defined with an interface.")},i().createElement(c.Table,{bordered:!0,columns:E,dataSource:y,pagination:!1,rowKey:"name",scroll:{y:300}})):i().createElement(c.Form.Item,{label:n("Fields"),required:!0},i().createElement(c.Alert,{showIcon:!0,message:n("Please select a database view")})),(null==m?void 0:m.length)?i().createElement(c.Alert,{showIcon:!0,type:"warning",message:n("Unsupported fields"),description:m.map(function(e){return e.name}).join(", "),style:{marginBottom:24}}):null)}function _(e){var t=(0,l.useFlowContext)(),n=(0,a.kj)(),r=c.Form.useWatch("viewName",e.form),u=c.Form.useWatch("schema",e.form),s=c.Form.useWatch("fields",e.form),d=(0,o.useMemo)(function(){return Array.isArray(s)?s:[]},[s]),p=h((0,o.useState)(!1),2),y=p[0],b=p[1],v=h((0,o.useState)([]),2),g=v[0],w=v[1],O=(0,o.useMemo)(function(){var e=["lineString","point","circle","polygon"];return JSON.stringify(d.reduce(function(t,n){return n.type&&e.includes(n.type)&&(t[n.name]=n.type),t},{}))},[d]),j=(0,o.useMemo)(function(){return d.filter(function(e){return e.source||e.interface}).map(function(e){var t;return{title:(0,f.hd)((null==(t=e.uiSchema)?void 0:t.title)||e.name,n),dataIndex:e.name,key:e.name,width:200,ellipsis:!0,render:function(e){return null==e?null:(void 0===e?"undefined":e&&"u">typeof Symbol&&e.constructor===Symbol?"symbol":typeof e)=="object"?JSON.stringify(e):String(e)}}})},[d,n]);return(0,o.useEffect)(function(){if(!r||!d.length)return void w([]);var e=!1;return m(function(){var n;return S(this,function(o){switch(o.label){case 0:b(!0),o.label=1;case 1:return o.trys.push([1,,3,4]),[4,t.api.resource("dbViews").query({filterByTk:r,schema:u||void 0,fieldTypes:JSON.parse(O)})];case 2:return n=o.sent(),e||w(k(n)),[3,4];case 3:return e||b(!1),[7];case 4:return[2]}})})(),function(){e=!0}},[t.api,O,d.length,u,r]),i().createElement(c.Form.Item,{label:n("Preview")},i().createElement(c.Spin,{spinning:y},i().createElement(c.Table,{bordered:!0,columns:j,dataSource:g,pagination:!1,rowKey:function(e,t){return String(null!=t?t:0)},scroll:{x:1e3,y:300}})))}function M(e){var t=b({},e);return delete t[j],Array.isArray(t.fields)&&(t.fields=t.fields.map(function(e){return v(b({},e),{source:A(e.source)})})),t}var q=n(448);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 N(e,t,n,r,o,i,a){try{var l=e[i](a),u=l.value}catch(e){n(e);return}l.done?t(u):Promise.resolve(u).then(r,o)}function B(e){return 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)})}}function R(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function V(e,t,n){return(V=H()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&G(o,n.prototype),o}).apply(null,arguments)}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)}}function W(e,t,n){return t&&$(e.prototype,t),n&&$(e,n),e}function K(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function L(e){return(L=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function U(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){K(e,t,n[t])})}return e}function J(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 G(e,t){return(G=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function z(e){return function(e){if(Array.isArray(e))return D(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 D(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 D(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.")}()}function Z(e){var t="function"==typeof Map?new Map:void 0;return(Z=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 V(e,arguments,L(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),G(n,e)})(e)}function H(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(H=function(){return!!e})()}function Q(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:u(0)}),l(a,"throw",{value:u(1)}),l(a,"return",{value:u(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function u(l){return function(u){var c=[l,u];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var X=function(){function e(){R(this,e),K(this,"templates",new Map)}return W(e,[{key:"register",value:function(e,t){var n="string"==typeof e?J(U({},t),{name:(null==t?void 0:t.name)||e}):e;(null==n?void 0:n.name)&&this.templates.set(n.name,J(U({},n),{name:n.name}))}},{key:"get",value:function(e){return e?this.templates.get(e):void 0}},{key:"getAll",value:function(){return z(this.templates.values()).sort(function(e,t){var n,r;return(null!=(n=e.order)?n:0)-(null!=(r=t.order)?r:0)})}}]),e}(),Y=function(){function e(){R(this,e),K(this,"fields",new Map)}return W(e,[{key:"register",value:function(e){var t,n=e.name||(null==(t=e.value)?void 0:t.name);n&&this.fields.set(n,J(U({},e),{name:n}))}},{key:"remove",value:function(e){this.fields.delete(e)}},{key:"getAll",value:function(){return z(this.fields.values()).sort(function(e,t){var n,r;return(null!=(n=e.order)?n:0)-(null!=(r=t.order)?r:0)})}}]),e}(),ee=function(){function e(){R(this,e),K(this,"managerActions",[])}return W(e,[{key:"registerManagerAction",value:function(e){var t=e.order,n=e.component;this.managerActions.push({order:null!=t?t:0,component:n})}},{key:"getManagerActions",value:function(){return z(this.managerActions).sort(function(e,t){return e.order-t.order})}}]),e}(),et=function(e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function t(){var e,n,r;return R(this,t),n=t,r=arguments,n=L(n),K(e=function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,H()?Reflect.construct(n,r||[],L(this).constructor):n.apply(this,r)),"types",new Map),K(e,"extensionManager",new ee),K(e,"collectionTemplateRegistry",new X),K(e,"collectionPresetFieldRegistry",new Y),e}return t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&G(t,e),W(t,[{key:"load",value:function(){return B(function(){var e;return Q(this,function(t){return e=this,this.registerBuiltInCollectionPresetFields(),this.registerBuiltInCollectionTemplates(),this.dataSourceManager.registerLoader("*",function(){return B(function(){var e,t,n;return Q(this,function(r){switch(r.label){case 0:return[4,this.app.apiClient.request({resource:"dataSources",action:"listEnabled",params:{paginate:!1,appends:["collections"]}})];case 1:return n=(null==(t=r.sent())||null==(e=t.data)?void 0:e.data)||[],(0,q.b)(this.dataSourceManager,n),[2,{dataSources:n}]}})}).call(e)}),this.pluginSettingsManager.addMenuItem({key:a.Ji,title:this.t("Data sources"),icon:"ClusterOutlined",isPinned:!0,sort:100,showTabs:!1,aclSnippet:"pm.data-source-manager*"}),this.pluginSettingsManager.addPageTabItem({menuKey:a.Ji,key:"list",title:this.t("Data sources"),componentLoader:function(){return n.e("426").then(n.bind(n,649))},sort:1,aclSnippet:"pm.data-source-manager"}),this.pluginSettingsManager.addPageTabItem({menuKey:a.Ji,key:":name/collections",title:this.t("Collections"),componentLoader:function(){return n.e("167").then(n.bind(n,442))},hidden:!0,sort:2,aclSnippet:"pm.data-source-manager"}),[2]})}).call(this)}},{key:"registerType",value:function(e,t){this.types.set(e,J(U({},t),{name:t.name||e}))}},{key:"getType",value:function(e){return e?this.types.get(e):void 0}},{key:"registerFieldInterfaceConfigure",value:function(e){var t,n;null==(n=this.dataSourceManager.collectionFieldInterfaceManager)||null==(t=n.registerFieldInterfaceConfigure)||t.call(n,e)}},{key:"registerCollectionTemplate",value:function(e,t){this.collectionTemplateRegistry.register(e,t)}},{key:"registerCollectionPresetField",value:function(e){this.collectionPresetFieldRegistry.register(e)}},{key:"addCollectionPresetField",value:function(e){this.registerCollectionPresetField(e)}},{key:"removeCollectionPresetField",value:function(e){this.collectionPresetFieldRegistry.remove(e)}},{key:"getCollectionPresetFields",value:function(){return this.collectionPresetFieldRegistry.getAll()}},{key:"getCollectionTemplate",value:function(e){return this.collectionTemplateRegistry.get(e)}},{key:"getCollectionTemplates",value:function(){return this.collectionTemplateRegistry.getAll()}},{key:"registerBuiltInCollectionPresetFields",value:function(){this.registerCollectionPresetField({order:100,description:'{{t("Primary key, distributed uniqueness, time-ordering") }}',value:{name:"id",type:"snowflakeId",autoIncrement:!1,primaryKey:!0,allowNull:!1,uiSchema:{type:"number",title:'{{t("ID")}}',"x-component":"InputNumber","x-component-props":{stringMode:!0,separator:"0.00",step:"1"},"x-validator":"integer"},interface:"snowflakeId"}}),this.registerCollectionPresetField({order:200,description:'{{t("Store the creation time of each record")}}',value:{name:"createdAt",interface:"createdAt",type:"date",field:"createdAt",uiSchema:{type:"datetime",title:'{{t("Created at")}}',"x-component":"DatePicker","x-component-props":{},"x-read-pretty":!0}}}),this.registerCollectionPresetField({order:300,description:'{{t("Store the creation user of each record") }}',value:{name:"createdBy",interface:"createdBy",type:"belongsTo",target:"users",foreignKey:"createdById",uiSchema:{type:"object",title:'{{t("Created by")}}',"x-component":"AssociationField","x-component-props":{fieldNames:{value:"id",label:"nickname"}},"x-read-pretty":!0}}}),this.registerCollectionPresetField({order:400,description:'{{t("Store the last update time of each record")}}',value:{type:"date",field:"updatedAt",name:"updatedAt",interface:"updatedAt",uiSchema:{type:"datetime",title:'{{t("Last updated at")}}',"x-component":"DatePicker","x-component-props":{},"x-read-pretty":!0}}}),this.registerCollectionPresetField({order:500,description:'{{t("Store the last update user of each record")}}',value:{type:"belongsTo",target:"users",foreignKey:"updatedById",name:"updatedBy",interface:"updatedBy",uiSchema:{type:"object",title:'{{t("Last updated by")}}',"x-component":"AssociationField","x-component-props":{fieldNames:{value:"id",label:"nickname"}},"x-read-pretty":!0}}})}},{key:"registerBuiltInCollectionTemplates",value:function(){this.registerCollectionTemplate({name:"general",title:'{{t("General collection")}}',order:10,color:"blue",collection:{options:{template:"general"},fields:[]}}),this.registerCollectionTemplate({name:"view",title:'{{t("Connect to database view")}}',order:50,color:"yellow",divider:!0,collection:{options:{template:"view",view:!0},fields:[]},capabilities:{recordUniqueKey:!0,simplePaginate:!0},presetFields:{disabled:!0},fieldInterfaces:{create:{include:["m2o"]}},configure:{items:[{name:"databaseView",Component:I,required:!0},{name:"sources",Component:E},{name:"fields",Component:T,required:!0,hidden:function(e){return"edit"===e.mode}},{name:"preview",Component:_,hidden:function(e){return"edit"===e.mode}},{name:"writableView",label:'{{t("Allow add new, update and delete actions")}}',component:"Checkbox"}],transformSubmitValues:M}})}}]),t}(Z(r.Plugin)),en=et},143:function(e,t,n){n.d(t,{Ji:function(){return i},kj:function(){return a}});var r=n(694),o=JSON.parse('{"UU":"@nocobase/plugin-data-source-manager"}').UU,i="data-source-manager";function a(){var e=(0,r.useFlowEngine)();return function(t,n){return e.context.t(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){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}({ns:[o,"client"]},n))}}},448:function(e,t,n){n.d(t,{b:function(){return o},h:function(){return i}});var r=n(694);function o(e,t){e&&t.forEach(function(t){var n,o,i,a,l=(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){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}({},t),o=o={key:t.key,use:"main"===t.key?void 0:r.DataSource},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}),n);e.getDataSource(t.key)?null==(i=e.getDataSource(t.key))||i.patchOptions(l):e.addDataSource(l),Array.isArray(t.collections)&&(null==(a=e.getDataSource(t.key))||a.setCollections(t.collections,{clearFields:!0}))})}function i(e,t){e&&t.forEach(function(t){"main"!==String(t)&&e.removeDataSource(String(t))})}},938:function(e,t,n){n.d(t,{Ad:function(){return c},hd:function(){return l},sZ:function(){return u},zN:function(){return i}});var r=/^\s*\{\{\s*t\s*\(\s*(['"])(.*?)\1(?:\s*,\s*([\s\S]*?))?\)\s*\}\}\s*$/,o=/\{\{\s*t\s*\(\s*(['"])(.*?)\1(?:\s*,\s*([\s\S]*?))?\)\s*\}\}/g;function i(e){var t;return"string"==typeof e?null==(t=e.match(r))?void 0:t[2]:void 0}function a(e){var t=null==e?void 0:e.trim();if(t){try{var n=JSON.parse(t);return n&&(void 0===n?"undefined":n&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)=="object"&&!Array.isArray(n)?n:void 0}catch(e){}var r={},o=t.match(/(?:^|[{,\s])ns\s*:\s*(\[[\s\S]*?\])/);if(null==o?void 0:o[1]){var i,a,l=(i=o[1],a=[],i.replace(/(['"])(.*?)\1/g,function(e,t,n){return a.push(n),""}),a.length?a:void 0);l&&(r.ns=l)}else{var u=t.match(/(?:^|[{,\s])ns\s*:\s*(['"])(.*?)\1/);(null==u?void 0:u[2])&&(r.ns=u[2])}var c=t.match(/(?:^|[{,\s])nsMode\s*:\s*(['"])(.*?)\1/);return(null==c?void 0:c[2])&&(r.nsMode=c[2]),Object.keys(r).length?r:void 0}}function l(e,t){if("string"!=typeof e)return e;var n=e.match(r);return(null==n?void 0:n[2])?t(n[2],a(n[3])):e.replace(o,function(e,n,r,o){return t(r,a(o))})}function u(e,t){var n=i(t);return"string"==typeof e&&n===e?t:e}function c(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"-",r=l(e,t);return null==r||""===r?n:"string"==typeof r||"number"==typeof r||"boolean"==typeof r?String(r):n}},375:function(e){e.exports=l},799:function(e){e.exports=c},428:function(e){e.exports=r},485:function(e){e.exports=t},694:function(e){e.exports=u},768:function(e){e.exports=s},625:function(t){t.exports=e},59:function(e){e.exports=a},185:function(e){e.exports=o},773:function(e){e.exports=f},155:function(e){e.exports=i},61:function(e){e.exports=n}},h={};function g(e){var t=h[e];if(void 0!==t)return t.exports;var n=h[e]={exports:{}};return v[e](n,n.exports,g),n.exports}g.m=v,g.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return g.d(t,{a:t}),t},g.d=function(e,t){for(var n in t)g.o(t,n)&&!g.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},g.f={},g.e=function(e){return Promise.all(Object.keys(g.f).reduce(function(t,n){return g.f[n](e,t),t},[]))},g.u=function(e){return""+e+"."+({167:"a04d61a8103d37ed",426:"8387d793b913b8e0"})[e]+".js"},g.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),g.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},w={},g.l=function(e,t,n,r){if(w[e])return void w[e].push(t);if(void 0!==n)for(var o,i,a=document.getElementsByTagName("script"),l=0;l<a.length;l++){var u=a[l];if(u.getAttribute("src")==e||u.getAttribute("data-rspack")=="@nocobase/plugin-data-source-manager/client-v2:"+n){o=u;break}}o||(i=!0,(o=document.createElement("script")).timeout=120,g.nc&&o.setAttribute("nonce",g.nc),o.setAttribute("data-rspack","@nocobase/plugin-data-source-manager/client-v2:"+n),o.src=e),w[e]=[t];var c=function(t,n){o.onerror=o.onload=null,clearTimeout(s);var r=w[e];if(delete w[e],o.parentNode&&o.parentNode.removeChild(o),r&&r.forEach(function(e){return e(n)}),t)return t(n)},s=setTimeout(c.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=c.bind(null,o.onerror),o.onload=c.bind(null,o.onload),i&&document.head.appendChild(o)},g.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},g.g.importScripts&&(S=g.g.location+"");var w,S,O=g.g.document;if(!S&&O&&(O.currentScript&&"SCRIPT"===O.currentScript.tagName.toUpperCase()&&(S=O.currentScript.src),!S)){var j=O.getElementsByTagName("script");if(j.length)for(var k=j.length-1;k>-1&&(!S||!/^http(s?):/.test(S));)S=j[k--].src}if(!S)throw Error("Automatic publicPath is not supported in this browser");g.p=S.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),d={889:0},g.f.j=function(e,t){var n=g.o(d,e)?d[e]:void 0;if(0!==n)if(n)t.push(n[2]);else{var r=new Promise(function(t,r){n=d[e]=[t,r]});t.push(n[2]=r);var o=g.p+g.u(e),i=Error();g.l(o,function(t){if(g.o(d,e)&&(0!==(n=d[e])&&(d[e]=void 0),n)){var r=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;i.message="Loading chunk "+e+" failed.\n("+r+": "+o+")",i.name="ChunkLoadError",i.type=r,i.request=o,n[1](i)}},"chunk-"+e,e)}},p=function(e,t){var n,r,o=t[0],i=t[1],a=t[2],l=0;if(o.some(function(e){return 0!==d[e]})){for(n in i)g.o(i,n)&&(g.m[n]=i[n]);a&&a(g)}for(e&&e(t);l<o.length;l++)r=o[l],g.o(d,r)&&d[r]&&d[r][0](),d[r]=0},(m=self.webpackChunk_nocobase_plugin_data_source_manager_client_v2=self.webpackChunk_nocobase_plugin_data_source_manager_client_v2||[]).forEach(p.bind(null,0)),m.push=p.bind(null,m.push.bind(m));var F={};return!function(){var e="",t="u">typeof document?document.currentScript:null;if(t&&t.src&&(e=t.src.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/")),!e){var n=window.__webpack_public_path__||"";n&&("/"!==n.charAt(n.length-1)&&(n+="/"),e=n+"static/plugins/@nocobase/plugin-data-source-manager/dist/client-v2/")}if(!e){var r=window.__nocobase_modern_client_prefix__||"v",o="/"+(r=String(r).replace(/^\/+|\/+$/g,"")||"v")+"/";if(!(e=window.__nocobase_public_path__||"")&&window.location&&window.location.pathname){var i=window.location.pathname||"/",a=i.indexOf(o);e=a>=0?i.slice(0,a+1):"/"}e&&(e=e.replace(RegExp("/"+r+"/?$"),"/")),e||(e="/"),"/"!==e.charAt(e.length-1)&&(e+="/"),e+="static/plugins/@nocobase/plugin-data-source-manager/dist/client-v2/"}g.p=e}(),g.r(F),g.d(F,{PluginDataSourceManagerClientV2:function(){return y.v},compileLegacyTemplate:function(){return b.hd},compileLegacyTemplateText:function(){return b.Ad},default:function(){return y.A},getLegacyTemplateKey:function(){return b.zN},preferLegacyTemplateTitle:function(){return b.sZ}}),y=g(890),b=g(938),F}()});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
export declare const NAMESPACE: string;
|
|
10
|
+
export declare const DATA_SOURCE_MANAGER_SETTINGS_KEY = "data-source-manager";
|
|
11
|
+
export declare function tExpr(key: string): string;
|
|
12
|
+
export declare function useT(): (key: string, options?: Record<string, unknown>) => string;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import React from 'react';
|
|
10
|
+
export default function DataSourceCollectionsPage(): React.JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import React from 'react';
|
|
10
|
+
export default function DataSourcesPage(): React.JSX.Element;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import { type CollectionPresetFieldOptions } from '../../plugin';
|
|
11
|
+
interface CollectionsPageProps {
|
|
12
|
+
dataSourceKey: string;
|
|
13
|
+
title?: React.ReactNode;
|
|
14
|
+
}
|
|
15
|
+
type PresetFieldRow = {
|
|
16
|
+
name: string;
|
|
17
|
+
field: React.ReactNode;
|
|
18
|
+
interfaceLabel: React.ReactNode;
|
|
19
|
+
description?: React.ReactNode;
|
|
20
|
+
};
|
|
21
|
+
export declare function getPresetFieldRows(presetFields: CollectionPresetFieldOptions[], fieldInterfaceManager?: {
|
|
22
|
+
getFieldInterface?: (name: string) => {
|
|
23
|
+
title?: React.ReactNode;
|
|
24
|
+
} | undefined;
|
|
25
|
+
}): PresetFieldRow[];
|
|
26
|
+
declare function CollectionsPage(props: CollectionsPageProps): React.JSX.Element;
|
|
27
|
+
export default CollectionsPage;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import React from 'react';
|
|
10
|
+
interface FieldFormProps {
|
|
11
|
+
mode: 'create' | 'edit';
|
|
12
|
+
dataSourceKey: string;
|
|
13
|
+
collection: Record<string, any>;
|
|
14
|
+
interfaceName?: string;
|
|
15
|
+
field?: Record<string, any>;
|
|
16
|
+
onSubmitted: () => void;
|
|
17
|
+
}
|
|
18
|
+
export declare function FieldForm(props: FieldFormProps): React.JSX.Element;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import React from 'react';
|
|
10
|
+
interface FieldsPageProps {
|
|
11
|
+
dataSourceKey: string;
|
|
12
|
+
collection: Record<string, any>;
|
|
13
|
+
}
|
|
14
|
+
export default function FieldsPage(props: FieldsPageProps): React.JSX.Element;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import type { CollectionTemplateConfigureItemProps } from '../../plugin';
|
|
11
|
+
export type ViewFieldRecord = {
|
|
12
|
+
interface?: string;
|
|
13
|
+
name: string;
|
|
14
|
+
possibleTypes?: string[];
|
|
15
|
+
source?: string | string[] | null;
|
|
16
|
+
title?: React.ReactNode;
|
|
17
|
+
type?: string;
|
|
18
|
+
uiSchema?: Record<string, unknown>;
|
|
19
|
+
[key: string]: unknown;
|
|
20
|
+
};
|
|
21
|
+
export declare function ViewDatabaseConfigureItem(props: CollectionTemplateConfigureItemProps): React.JSX.Element;
|
|
22
|
+
export declare function ViewSourcesConfigureItem(props: CollectionTemplateConfigureItemProps): React.JSX.Element;
|
|
23
|
+
export declare function ViewFieldsConfigureItem(props: CollectionTemplateConfigureItemProps): React.JSX.Element;
|
|
24
|
+
export declare function ViewPreviewConfigureItem(props: CollectionTemplateConfigureItemProps): React.JSX.Element;
|
|
25
|
+
export declare function normalizeViewCollectionSubmitValues(values: Record<string, unknown>): {
|
|
26
|
+
[x: string]: unknown;
|
|
27
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
type FieldAction = 'list' | 'create' | 'update' | 'destroy';
|
|
10
|
+
export declare function getCollectionFieldActionUrl(dataSourceKey: string, collectionName: string, action: FieldAction, filterByTk?: string | number): string;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import type { CollectionTemplateOptions } from '../../plugin';
|
|
10
|
+
type FieldInterfaceLike = {
|
|
11
|
+
group?: string;
|
|
12
|
+
name: string;
|
|
13
|
+
};
|
|
14
|
+
export declare function filterFieldInterfacesByCollectionTemplate<T extends FieldInterfaceLike>(fieldInterfaces: T[], template: CollectionTemplateOptions | undefined, collection: Record<string, unknown>, options?: {
|
|
15
|
+
databaseDialect?: string;
|
|
16
|
+
}): T[];
|
|
17
|
+
export declare function filterCreateFieldInterfacesByCollectionTemplate<T extends FieldInterfaceLike>(fieldInterfaces: T[], template: CollectionTemplateOptions | undefined): T[];
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import { Application, Plugin, type CollectionTemplateField } from '@nocobase/client-v2';
|
|
10
|
+
import React, { ComponentType } from 'react';
|
|
11
|
+
import { FieldInterfaceConfigureOptions } from './field-interfaces';
|
|
12
|
+
export interface DataSourceSettingsFormProps {
|
|
13
|
+
mode: 'create' | 'edit';
|
|
14
|
+
type: DataSourceTypeOptions;
|
|
15
|
+
initialValues?: Record<string, any>;
|
|
16
|
+
loadCollections: (key: string) => Promise<any>;
|
|
17
|
+
}
|
|
18
|
+
export interface DataSourceCollectionActionProps {
|
|
19
|
+
dataSourceKey: string;
|
|
20
|
+
record?: Record<string, any>;
|
|
21
|
+
selectedRowKeys?: React.Key[];
|
|
22
|
+
onSubmitted?: () => void;
|
|
23
|
+
children?: React.ReactNode;
|
|
24
|
+
isBulk?: boolean;
|
|
25
|
+
}
|
|
26
|
+
export interface DataSourceFieldInterfaceFilterOptions {
|
|
27
|
+
groups?: string[];
|
|
28
|
+
include?: string[];
|
|
29
|
+
exclude?: string[];
|
|
30
|
+
}
|
|
31
|
+
export interface DataSourceFieldInterfaceReadOnlyContext {
|
|
32
|
+
collection: Record<string, unknown>;
|
|
33
|
+
field: Record<string, unknown>;
|
|
34
|
+
fieldInterface?: {
|
|
35
|
+
name?: string;
|
|
36
|
+
group?: string;
|
|
37
|
+
isAssociation?: boolean;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
export interface DataSourceTypeOptions {
|
|
41
|
+
name?: string;
|
|
42
|
+
label?: React.ReactNode;
|
|
43
|
+
defaultValues?: Record<string, any>;
|
|
44
|
+
createFieldInterfaces?: DataSourceFieldInterfaceFilterOptions | ((context: {
|
|
45
|
+
collection: Record<string, any>;
|
|
46
|
+
}) => DataSourceFieldInterfaceFilterOptions | undefined);
|
|
47
|
+
disableAddFields?: boolean;
|
|
48
|
+
disableConfigureFields?: boolean;
|
|
49
|
+
disableTestConnection?: boolean;
|
|
50
|
+
AddCollection?: ComponentType<DataSourceCollectionActionProps>;
|
|
51
|
+
EditCollection?: ComponentType<DataSourceCollectionActionProps>;
|
|
52
|
+
DeleteCollection?: ComponentType<DataSourceCollectionActionProps>;
|
|
53
|
+
allowCollectionCreate?: boolean;
|
|
54
|
+
allowCollectionDeletion?: boolean;
|
|
55
|
+
isFieldInterfaceReadOnly?: (context: DataSourceFieldInterfaceReadOnlyContext) => boolean | undefined;
|
|
56
|
+
normalizeValues?: (values: Record<string, any>) => Record<string, any>;
|
|
57
|
+
SettingsForm?: ComponentType<DataSourceSettingsFormProps>;
|
|
58
|
+
}
|
|
59
|
+
export interface CollectionPresetFieldOptions {
|
|
60
|
+
name?: string;
|
|
61
|
+
order?: number;
|
|
62
|
+
field?: React.ReactNode;
|
|
63
|
+
interfaceLabel?: React.ReactNode;
|
|
64
|
+
description?: React.ReactNode;
|
|
65
|
+
defaultSelected?: boolean;
|
|
66
|
+
value: CollectionTemplateField & {
|
|
67
|
+
name: string;
|
|
68
|
+
interface?: string;
|
|
69
|
+
primaryKey?: boolean;
|
|
70
|
+
uiSchema?: Record<string, any>;
|
|
71
|
+
[key: string]: any;
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
export interface CollectionTemplateFormProps {
|
|
75
|
+
mode: 'create' | 'edit';
|
|
76
|
+
template: CollectionTemplateOptions;
|
|
77
|
+
form: any;
|
|
78
|
+
}
|
|
79
|
+
export interface CollectionTemplateConfigureItemProps extends CollectionTemplateFormProps {
|
|
80
|
+
item: CollectionTemplateConfigureItem;
|
|
81
|
+
}
|
|
82
|
+
export interface CollectionTemplateSyncFieldsProps {
|
|
83
|
+
collection: Record<string, any>;
|
|
84
|
+
dataSourceKey: string;
|
|
85
|
+
onSubmitted: () => void;
|
|
86
|
+
}
|
|
87
|
+
export interface CollectionTemplateSyncFieldsOptions {
|
|
88
|
+
Component?: ComponentType<CollectionTemplateSyncFieldsProps>;
|
|
89
|
+
visible?: boolean | ((props: {
|
|
90
|
+
collection: Record<string, any>;
|
|
91
|
+
dataSourceKey: string;
|
|
92
|
+
}) => boolean);
|
|
93
|
+
}
|
|
94
|
+
export interface CollectionTemplateConfigureItem {
|
|
95
|
+
name?: string;
|
|
96
|
+
label?: React.ReactNode;
|
|
97
|
+
component?: 'Input' | 'Input.TextArea' | 'Select' | 'Checkbox';
|
|
98
|
+
options?: Array<{
|
|
99
|
+
label: React.ReactNode;
|
|
100
|
+
value: string | number | boolean;
|
|
101
|
+
}>;
|
|
102
|
+
Component?: ComponentType<CollectionTemplateConfigureItemProps>;
|
|
103
|
+
componentProps?: Record<string, unknown>;
|
|
104
|
+
required?: boolean;
|
|
105
|
+
hidden?: boolean | ((props: CollectionTemplateFormProps) => boolean);
|
|
106
|
+
}
|
|
107
|
+
export interface CollectionTemplateOptions {
|
|
108
|
+
name?: string;
|
|
109
|
+
title: React.ReactNode;
|
|
110
|
+
description?: React.ReactNode;
|
|
111
|
+
order?: number;
|
|
112
|
+
color?: string;
|
|
113
|
+
divider?: boolean;
|
|
114
|
+
collection?: {
|
|
115
|
+
options?: Record<string, any> | (() => Record<string, any>);
|
|
116
|
+
fields?: CollectionTemplateField[] | (() => CollectionTemplateField[]);
|
|
117
|
+
};
|
|
118
|
+
capabilities?: {
|
|
119
|
+
recordUniqueKey?: boolean;
|
|
120
|
+
simplePaginate?: boolean;
|
|
121
|
+
};
|
|
122
|
+
configure?: {
|
|
123
|
+
items?: CollectionTemplateConfigureItem[];
|
|
124
|
+
Form?: ComponentType<CollectionTemplateFormProps>;
|
|
125
|
+
syncFields?: CollectionTemplateSyncFieldsOptions;
|
|
126
|
+
transformSubmitValues?: (values: Record<string, any>) => Record<string, any> | void;
|
|
127
|
+
};
|
|
128
|
+
fieldInterfaces?: {
|
|
129
|
+
include?: Array<string | {
|
|
130
|
+
interface?: string;
|
|
131
|
+
name?: string;
|
|
132
|
+
targetScope?: Record<string, unknown>;
|
|
133
|
+
}>;
|
|
134
|
+
exclude?: string[];
|
|
135
|
+
create?: {
|
|
136
|
+
include?: Array<string | {
|
|
137
|
+
interface?: string;
|
|
138
|
+
name?: string;
|
|
139
|
+
targetScope?: Record<string, unknown>;
|
|
140
|
+
}>;
|
|
141
|
+
exclude?: string[];
|
|
142
|
+
};
|
|
143
|
+
};
|
|
144
|
+
/**
|
|
145
|
+
* @deprecated Use fieldInterfaces instead.
|
|
146
|
+
*/
|
|
147
|
+
availableFieldInterfaces?: {
|
|
148
|
+
include?: Array<string | {
|
|
149
|
+
interface?: string;
|
|
150
|
+
name?: string;
|
|
151
|
+
targetScope?: Record<string, unknown>;
|
|
152
|
+
}>;
|
|
153
|
+
exclude?: string[];
|
|
154
|
+
create?: {
|
|
155
|
+
include?: Array<string | {
|
|
156
|
+
interface?: string;
|
|
157
|
+
name?: string;
|
|
158
|
+
targetScope?: Record<string, unknown>;
|
|
159
|
+
}>;
|
|
160
|
+
exclude?: string[];
|
|
161
|
+
};
|
|
162
|
+
};
|
|
163
|
+
presetFields?: {
|
|
164
|
+
disabled?: boolean;
|
|
165
|
+
disabledIncludes?: string[];
|
|
166
|
+
};
|
|
167
|
+
actions?: unknown[];
|
|
168
|
+
/**
|
|
169
|
+
* @deprecated Use collection.options instead.
|
|
170
|
+
*/
|
|
171
|
+
defaultValues?: Record<string, any> | (() => Record<string, any>);
|
|
172
|
+
/**
|
|
173
|
+
* @deprecated Use presetFields.disabled instead.
|
|
174
|
+
*/
|
|
175
|
+
presetFieldsDisabled?: boolean;
|
|
176
|
+
/**
|
|
177
|
+
* @deprecated Use presetFields.disabledIncludes instead.
|
|
178
|
+
*/
|
|
179
|
+
presetFieldsDisabledIncludes?: string[];
|
|
180
|
+
/**
|
|
181
|
+
* @deprecated Use configure.Form instead.
|
|
182
|
+
*/
|
|
183
|
+
ConfigureForm?: ComponentType<CollectionTemplateFormProps>;
|
|
184
|
+
/**
|
|
185
|
+
* @deprecated Use configure.transformSubmitValues instead.
|
|
186
|
+
*/
|
|
187
|
+
beforeSubmit?: (values: Record<string, any>) => void;
|
|
188
|
+
}
|
|
189
|
+
declare class CollectionTemplateRegistry {
|
|
190
|
+
protected templates: Map<string, CollectionTemplateOptions>;
|
|
191
|
+
register(nameOrOptions: string | CollectionTemplateOptions, options?: CollectionTemplateOptions): void;
|
|
192
|
+
get(name?: string): CollectionTemplateOptions;
|
|
193
|
+
getAll(): CollectionTemplateOptions[];
|
|
194
|
+
}
|
|
195
|
+
declare class CollectionPresetFieldRegistry {
|
|
196
|
+
protected fields: Map<string, CollectionPresetFieldOptions>;
|
|
197
|
+
register(options: CollectionPresetFieldOptions): void;
|
|
198
|
+
remove(name: string): void;
|
|
199
|
+
getAll(): CollectionPresetFieldOptions[];
|
|
200
|
+
}
|
|
201
|
+
declare class ExtensionManager {
|
|
202
|
+
protected managerActions: Array<{
|
|
203
|
+
order: number;
|
|
204
|
+
component: ComponentType;
|
|
205
|
+
}>;
|
|
206
|
+
registerManagerAction({ order, component }: {
|
|
207
|
+
order?: number;
|
|
208
|
+
component: ComponentType;
|
|
209
|
+
}): void;
|
|
210
|
+
getManagerActions(): {
|
|
211
|
+
order: number;
|
|
212
|
+
component: React.ComponentType;
|
|
213
|
+
}[];
|
|
214
|
+
}
|
|
215
|
+
export declare class PluginDataSourceManagerClientV2 extends Plugin<any, Application> {
|
|
216
|
+
types: Map<string, DataSourceTypeOptions>;
|
|
217
|
+
extensionManager: ExtensionManager;
|
|
218
|
+
collectionTemplateRegistry: CollectionTemplateRegistry;
|
|
219
|
+
collectionPresetFieldRegistry: CollectionPresetFieldRegistry;
|
|
220
|
+
load(): Promise<void>;
|
|
221
|
+
registerType(name: string, options: DataSourceTypeOptions): void;
|
|
222
|
+
getType(name?: string): DataSourceTypeOptions;
|
|
223
|
+
registerFieldInterfaceConfigure(options: FieldInterfaceConfigureOptions): void;
|
|
224
|
+
registerCollectionTemplate(nameOrOptions: string | CollectionTemplateOptions, options?: CollectionTemplateOptions): void;
|
|
225
|
+
registerCollectionPresetField(options: CollectionPresetFieldOptions): void;
|
|
226
|
+
addCollectionPresetField(options: CollectionPresetFieldOptions): void;
|
|
227
|
+
removeCollectionPresetField(name: string): void;
|
|
228
|
+
getCollectionPresetFields(): CollectionPresetFieldOptions[];
|
|
229
|
+
getCollectionTemplate(name?: string): CollectionTemplateOptions;
|
|
230
|
+
getCollectionTemplates(): CollectionTemplateOptions[];
|
|
231
|
+
private registerBuiltInCollectionPresetFields;
|
|
232
|
+
private registerBuiltInCollectionTemplates;
|
|
233
|
+
}
|
|
234
|
+
export default PluginDataSourceManagerClientV2;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import { type DataSourceManager } from '@nocobase/flow-engine';
|
|
10
|
+
import type React from 'react';
|
|
11
|
+
export declare function syncDataSourcesToRuntime(dataSourceManager: DataSourceManager | undefined, records: Array<Record<string, any>>): void;
|
|
12
|
+
export declare function removeDataSourcesFromRuntime(dataSourceManager: DataSourceManager | undefined, keys: React.Key[]): void;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import type { ReactNode } from 'react';
|
|
10
|
+
type TOptions = Record<string, unknown>;
|
|
11
|
+
type TFunction = (key: string, options?: TOptions) => string;
|
|
12
|
+
export declare function getLegacyTemplateKey(value: ReactNode): string;
|
|
13
|
+
export declare function compileLegacyTemplate(value: ReactNode, t: TFunction): ReactNode;
|
|
14
|
+
export declare function preferLegacyTemplateTitle(value: ReactNode, templateTitle?: ReactNode): ReactNode;
|
|
15
|
+
export declare function compileLegacyTemplateText(value: ReactNode, t: TFunction, fallback?: string): string;
|
|
16
|
+
export {};
|
package/dist/externalVersion.js
CHANGED
|
@@ -8,30 +8,34 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
module.exports = {
|
|
11
|
-
"@nocobase/client": "2.1.0-alpha.
|
|
11
|
+
"@nocobase/client": "2.1.0-alpha.46",
|
|
12
12
|
"react": "18.2.0",
|
|
13
|
-
"@nocobase/plugin-acl": "2.1.0-alpha.
|
|
14
|
-
"@nocobase/utils": "2.1.0-alpha.
|
|
15
|
-
"@nocobase/
|
|
16
|
-
"@nocobase/
|
|
17
|
-
"@nocobase/
|
|
13
|
+
"@nocobase/plugin-acl": "2.1.0-alpha.46",
|
|
14
|
+
"@nocobase/utils": "2.1.0-alpha.46",
|
|
15
|
+
"@nocobase/flow-engine": "2.1.0-alpha.46",
|
|
16
|
+
"@nocobase/client-v2": "2.1.0-alpha.46",
|
|
17
|
+
"@nocobase/ai": "2.1.0-alpha.46",
|
|
18
|
+
"@nocobase/server": "2.1.0-alpha.46",
|
|
19
|
+
"@nocobase/data-source-manager": "2.1.0-alpha.46",
|
|
18
20
|
"lodash": "4.18.1",
|
|
19
|
-
"@nocobase/acl": "2.1.0-alpha.
|
|
20
|
-
"@nocobase/database": "2.1.0-alpha.
|
|
21
|
+
"@nocobase/acl": "2.1.0-alpha.46",
|
|
22
|
+
"@nocobase/database": "2.1.0-alpha.46",
|
|
21
23
|
"@ant-design/icons": "5.6.1",
|
|
22
24
|
"antd": "5.24.2",
|
|
23
25
|
"react-router-dom": "6.30.1",
|
|
24
|
-
"@nocobase/flow-engine": "2.1.0-alpha.40",
|
|
25
26
|
"@formily/shared": "2.3.7",
|
|
26
27
|
"@formily/react": "2.3.7",
|
|
27
28
|
"react-i18next": "11.18.6",
|
|
28
29
|
"@emotion/css": "11.13.0",
|
|
29
|
-
"
|
|
30
|
+
"ahooks": "3.7.8",
|
|
31
|
+
"@nocobase/actions": "2.1.0-alpha.46",
|
|
30
32
|
"sequelize": "6.35.2",
|
|
31
|
-
"@nocobase/test": "2.1.0-alpha.
|
|
33
|
+
"@nocobase/test": "2.1.0-alpha.46",
|
|
32
34
|
"@formily/antd-v5": "1.2.3",
|
|
33
35
|
"@formily/core": "2.3.7",
|
|
34
36
|
"@formily/reactive": "2.3.7",
|
|
35
37
|
"@dnd-kit/core": "6.1.0",
|
|
36
|
-
"antd-style": "3.7.1"
|
|
38
|
+
"antd-style": "3.7.1",
|
|
39
|
+
"@dnd-kit/sortable": "7.0.2",
|
|
40
|
+
"dayjs": "1.11.13"
|
|
37
41
|
};
|