@nocobase/plugin-public-forms 1.7.1 → 1.8.0-alpha.2
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/{7cba1def9091ffd2.js → 2ba76736c4b92584.js} +1 -1
- package/dist/client/{cab19e4c01100ab3.js → 2fe0d43e0384c416.js} +1 -1
- package/dist/client/{76508966d928172b.js → a88556f9b9475960.js} +1 -1
- package/dist/client/{37268132a36be7d9.js → e5c5dc9e430ed8e5.js} +1 -1
- package/dist/client/index.js +1 -1
- package/dist/externalVersion.js +4 -4
- package/package.json +2 -2
|
@@ -7,4 +7,4 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
"use strict";(self.webpackChunk_nocobase_plugin_public_forms=self.webpackChunk_nocobase_plugin_public_forms||[]).push([["
|
|
10
|
+
"use strict";(self.webpackChunk_nocobase_plugin_public_forms=self.webpackChunk_nocobase_plugin_public_forms||[]).push([["153"],{6458:function(e,t,n){n.r(t),n.d(t,{AdminPublicFormPage:function(){return v}});var r=n(482),o=n(3772),a=n(2721),l=n(8156),i=n.n(l),c=n(5432),u=n(6128),s=n(4632),p=n(4589),m=n(8889);function f(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,r,o,a,l){try{var i=e[a](l),c=i.value}catch(e){n(e);return}i.done?t(c):Promise.resolve(c).then(r,o)}function d(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var a=e.apply(t,n);function l(e){b(a,r,o,l,i,"next",e)}function i(e){b(a,r,o,l,i,"throw",e)}l(void 0)})}}function y(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 h(e,t){var n,r,o,a,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:i(0),throw:i(1),return:i(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function i(a){return function(i){var c=[a,i];if(n)throw TypeError("Generator is already executing.");for(;l;)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 l.label++,{value:c[1],done:!1};case 5:l.label++,r=c[1],c=[0];continue;case 7:c=l.ops.pop(),l.trys.pop();continue;default:if(!(o=(o=l.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){l=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){l.label=c[1];break}if(6===c[0]&&l.label<o[1]){l.label=o[1],o=c;break}if(o&&l.label<o[2]){l.label=o[2],l.ops.push(c);break}o[2]&&l.ops.pop(),l.trys.pop();continue}c=t.call(e,l)}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 g=function(){var e,t=(e=(0,l.useState)(!1),function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],l=!0,i=!1;try{for(o=o.call(e);!(l=(n=o.next()).done)&&(a.push(n.value),a.length!==t);l=!0);}catch(e){i=!0,r=e}finally{try{l||null==o.return||o.return()}finally{if(i)throw r}}return a}}(e,2)||function(e,t){if(e){if("string"==typeof e)return f(e,2);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 f(e,t)}}(e,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),n=t[0],r=t[1],u=(0,m.NY)().t,s=(0,c.useParams)(),p=(0,o.useApp)(),b=window.location.origin+p.getHref("public-forms/".concat(s.name));return i().createElement(a.Popover,{trigger:"hover",open:n,onOpenChange:function(e){r(e)},content:n?i().createElement(a.QRCode,{value:b,bordered:!1}):" "},i().createElement("a",null,u("QR code",{ns:m.A7})))};function v(){var e,t,n=(0,c.useParams)(),l=(0,m.NY)().t,f=(0,o.useGlobalTheme)().theme,b=(0,o.useAPIClient)(),v=(0,o.useCompile)(),w=a.theme.useToken().token,E=(0,o.useApp)(),k=(0,o.useGlobalVariable)("$env"),x=(0,o.useRequest)({url:"publicForms:get/".concat(n.name)}),S=x.data,O=x.loading,P=x.refresh,C=(null==S?void 0:S.data)||{},A=C.enabled,j=C.title,I=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(C,["enabled","title"]);if(O)return i().createElement(a.Spin,null);var T=(e=d(function(e){return h(this,function(t){switch(t.label){case 0:return[4,b.resource("publicForms").update({filterByTk:n.name,values:y({},e)})];case 1:return t.sent(),[4,P()];case 2:return t.sent(),[2]}})}),function(t){return e.apply(this,arguments)}),F=(t=d(function(){return h(this,function(e){switch(e.label){case 0:return[4,(0,o.FormDialog)(l("Password"),function(){return i().createElement(o.ApplicationContext.Provider,{value:E},i().createElement(o.SchemaComponentOptions,{components:{Checkbox:o.Checkbox,TextAreaWithGlobalScope:o.TextAreaWithGlobalScope,FormItem:o.FormItem}},i().createElement(s.FormLayout,{layout:"vertical"},i().createElement(o.SchemaComponent,{schema:{properties:{password:{type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope","x-component-props":{password:!0,scope:[k]}}}}}))))},f).open({initialValues:y({},I)})];case 1:return[4,T({password:e.sent().password})];case 2:return e.sent(),[2]}})}),function(){return t.apply(this,arguments)});return i().createElement("div",{style:{marginTop:"-50px"}},i().createElement("div",{style:{margin:"-24px",padding:"10px",display:"flex",alignItems:"center",justifyContent:"space-between",background:"".concat(w.colorBgContainer),borderBottom:"1px solid ".concat(w.colorBorderSecondary)}},i().createElement(a.Breadcrumb,{style:{marginLeft:"10px"},items:[{title:i().createElement(u.Link,{to:"/admin/settings/public-forms"},l("Public forms",{ns:m.A7}))},{title:v(j)}]}),i().createElement(a.Space,null,i().createElement(u.Link,{target:"_blank",to:"/public-forms/".concat(n.name)},i().createElement(a.Button,{disabled:!A,icon:i().createElement(r.EyeOutlined,null)},l("Open form",{ns:m.A7}))),i().createElement(a.Dropdown,{menu:{items:[{key:"enabled",label:i().createElement("a",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},onClick:function(){return T({enabled:!A})}},i().createElement("span",{style:{marginRight:"10px"}},l("Enable form",{ns:m.A7})),i().createElement(a.Switch,{size:"small",checked:A}))},{key:"password",label:i().createElement("a",{onClick:F}," ",l("Set password"))},{key:"divider1",type:"divider"},{key:"copyLink",label:i().createElement("a",{onClick:function(){var e=window.location.origin+E.getHref("public-forms/".concat(n.name));navigator.clipboard.writeText(e),a.message.success(l("Link copied successfully"))}},l("Copy link"))},{key:"qrcode",label:i().createElement(g,null)}]}},i().createElement(a.Button,{icon:i().createElement(r.SettingOutlined,null)},l("Settings"))))),i().createElement("div",{style:{maxWidth:800,margin:"100px auto",position:"relative",zIndex:0}},i().createElement(o.VariablesProvider,{filterVariables:function(e){return!["$user","$nRole","$nToken"].includes(e.key)}},i().createElement(o.RemoteSchemaComponent,{uid:n.name,scope:{useCreateActionProps:p.hG},components:{PublicFormMessageProvider:function(e){return e.children}}})),i().createElement(o.PoweredBy,null)))}}}]);
|
|
@@ -7,4 +7,4 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
"use strict";(self.webpackChunk_nocobase_plugin_public_forms=self.webpackChunk_nocobase_plugin_public_forms||[]).push([["
|
|
10
|
+
"use strict";(self.webpackChunk_nocobase_plugin_public_forms=self.webpackChunk_nocobase_plugin_public_forms||[]).push([["775"],{3335:function(e,t,o){o.r(t),o.d(t,{AdminPublicFormList:function(){return x}});var n=o(3772),r=o(8156),i=o.n(r),p=o(7790),c=o(8889),l={name:"publicForms",filterTargetKey:"key",fields:[{type:"string",name:"title",interface:"input",uiSchema:{type:"string",title:"{{t('Title')}}",required:!0,"x-component":"Input"}},{type:"text",name:"description",interface:"textarea",uiSchema:{type:"string",title:"{{t('Description')}}","x-component":"Input.TextArea"}},{type:"string",name:"type",interface:"radioGroup",uiSchema:{type:"string",title:'{{t("Type",{ns:"public-forms"})}}',"x-component":"Radio.Group",enum:"{{ formTypes }}"}},{type:"string",name:"collection",interface:"collection",uiSchema:{type:"string",title:"{{t('Collection')}}",required:!0,"x-component":"DataSourceCollectionCascader"}},{type:"password",name:"password",interface:"password",uiSchema:{type:"string",title:"{{t('Password')}}","x-component":"TextAreaWithGlobalScope","x-component-props":{autocomplete:"new-password",password:!0}}},{type:"boolean",name:"enabled",interface:"checkbox",uiSchema:{type:"string",title:'{{t("Enable form",{ns:"'.concat(c.A7,'"})}}'),"x-component":"Checkbox",default:!0}}]},s=o(4589),m=o(8875),a=o(6128),d={type:"void","x-component":"Action",title:'{{t("Add New", { ns: "'.concat(c.A7,'" })}}'),"x-align":"right","x-component-props":{type:"primary",icon:"PlusOutlined"},properties:{drawer:{type:"void","x-component":"Action.Drawer",title:"{{t('Add New')}}","x-decorator":"Form",properties:{form:{type:"void",properties:{title:{type:"string","x-decorator":"FormItem","x-component":"CollectionField"},collection:{type:"string","x-decorator":"FormItem","x-component":"CollectionField"},type:{type:"string","x-decorator":"FormItem",title:'{{t("Type",{ns:"public-forms"})}}',"x-component":"CollectionField",default:"form",enum:"{{ formTypes }}"},description:{type:"string","x-decorator":"FormItem","x-component":"CollectionField"},password:{type:"string","x-decorator":"FormItem","x-component":"CollectionField"},enabled:{type:"string","x-decorator":"FormItem","x-component":"CollectionField",default:!0}}},footer:{type:"void","x-component":"Action.Drawer.Footer",properties:{submit:{title:"Submit","x-component":"Action","x-use-component-props":"useSubmitActionProps"}}}}}}},u={type:"void",title:"{{t('Edit')}}","x-component":"Action.Link","x-component-props":{openMode:"drawer"},properties:{drawer:{type:"void",title:"Edit","x-component":"Action.Drawer","x-decorator":"FormV2","x-use-decorator-props":"useEditFormProps",properties:{form:{type:"void",properties:{title:{type:"string","x-decorator":"FormItem","x-component":"CollectionField"},collection:{type:"string","x-decorator":"FormItem","x-component":"CollectionField","x-component-props":{disabled:!0}},type:{type:"string","x-decorator":"FormItem",title:'{{t("Type",{ns:"public-forms"})}}',"x-component":"Radio.Group",default:"form",enum:"{{ formTypes }}"},description:{type:"string","x-decorator":"FormItem","x-component":"CollectionField"},password:{type:"string","x-decorator":"FormItem","x-component":"CollectionField"},enabled:{type:"string","x-decorator":"FormItem","x-component":"CollectionField",default:!0}}},footer:{type:"void","x-component":"Action.Drawer.Footer",properties:{submit:{title:"Submit","x-component":"Action","x-use-component-props":"useSubmitActionProps"}}}}}}},y={type:"void",name:(0,m.uid)(),"x-component":"CardItem","x-decorator":"TableBlockProvider","x-decorator-props":{collection:l.name,action:"list",params:{sort:"-createdAt",appends:["createdBy","updatedBy"]},showIndex:!0,dragSort:!1,rowKey:"key"},properties:{actions:{type:"void","x-component":"ActionBar","x-component-props":{style:{marginBottom:20}},properties:{filter:{type:"void",title:'{{ t("Filter") }}',default:{$and:[{title:{$includes:""}}]},"x-action":"filter","x-component":"Filter.Action","x-use-component-props":"useFilterActionProps","x-component-props":{icon:"FilterOutlined"},"x-align":"left"},refresh:{type:"void",title:'{{ t("Refresh") }}',"x-component":"Action","x-use-component-props":"useRefreshActionProps","x-component-props":{icon:"ReloadOutlined"}},destroy:{title:'{{ t("Delete") }}',"x-action":"destroy","x-component":"Action","x-use-component-props":"useBulkDestroyActionProps","x-component-props":{icon:"DeleteOutlined",confirm:{title:"{{t('Delete record')}}",content:"{{t('Are you sure you want to delete it?')}}"}}},createActionSchema:d}},table:{type:"array","x-component":"TableV2","x-use-component-props":"useTableBlockProps","x-component-props":{rowKey:l.filterTargetKey,rowSelection:{type:"checkbox"}},properties:{title:{type:"void",title:'{{ t("Title") }}',"x-component":"TableV2.Column","x-component-props":{width:170},properties:{title:{type:"string","x-component":"CollectionField","x-pattern":"readPretty"}}},collection:{type:"void",title:'{{ t("Collection") }}',"x-component":"TableV2.Column","x-component-props":{width:160},properties:{collection:{type:"string","x-component":"CollectionField","x-pattern":"readPretty"}}},column2:{type:"void",title:'{{t("Type", { ns: "'.concat(c.A7,'" })}}'),"x-component":"TableV2.Column","x-component-props":{width:100},properties:{type:{type:"string","x-component":"Radio.Group","x-pattern":"readPretty",enum:"{{ formTypes }}"}}},column3:{type:"void",title:'{{ t("Enabled") }}',"x-component":"TableV2.Column","x-component-props":{width:80},properties:{enabled:{type:"string","x-component":"CollectionField","x-pattern":"readPretty"}}},description:{type:"void",title:'{{ t("Description") }}',"x-component":"TableV2.Column",properties:{description:{type:"string","x-component":"CollectionField","x-pattern":"readPretty"}}},actions:{type:"void",title:'{{ t("Actions") }}',"x-component":"TableV2.Column",properties:{actions:{type:"void","x-component":"Space","x-component-props":{split:"|"},properties:{configure:{type:"void",title:"Configure","x-component":function(){var e=(0,n.useFilterByTk)(),t=(0,c.NT)();return i().createElement(a.Link,{to:"/admin/settings/public-forms/".concat(e)},t("Configure"))}},editActionSchema:u,delete:{type:"void",title:"{{t('Delete')}}","x-component":"Action.Link","x-use-component-props":"useDeleteActionProps"}}}}}}}}},x=function(){var e,t,o=(0,n.usePlugin)(p.default),c=(0,n.useSchemaComponentContext)(),m=(0,r.useMemo)(function(){return o.getFormTypeOptions()},[o]);return i().createElement(n.ExtendCollectionsProvider,{collections:[l]},i().createElement(n.SchemaComponentContext.Provider,{value:(e=function(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{},n=Object.keys(o);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(o).filter(function(e){return Object.getOwnPropertyDescriptor(o,e).enumerable}))),n.forEach(function(t){var n;n=o[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},c),t=t={designable:!1},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);o.push.apply(o,n)}return o})(Object(t)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(t,o))}),e)},i().createElement(n.SchemaComponent,{schema:y,scope:{formTypes:m,useSubmitActionProps:s.j1,useEditFormProps:s.fC,useDeleteActionProps:s.Dq}})))}}}]);
|