@nocobase/plugin-public-forms 1.7.0-beta.9 → 1.7.1
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/LICENSE.txt +4 -4
- package/dist/client/37268132a36be7d9.js +10 -0
- package/dist/client/76508966d928172b.js +10 -0
- package/dist/client/7cba1def9091ffd2.js +10 -0
- package/dist/client/cab19e4c01100ab3.js +10 -0
- package/dist/client/index.js +1 -1
- package/dist/client/schemas/editActionSchema.d.ts +0 -1
- package/dist/externalVersion.js +4 -4
- package/dist/locale/nl-NL.json +19 -0
- package/dist/server/plugin.d.ts +37 -7
- package/dist/server/plugin.js +5 -4
- package/package.json +2 -2
- package/dist/client/5123292363deb049.js +0 -10
- package/dist/client/700c91655d08750c.js +0 -10
- package/dist/client/cda99c1ab9bad776.js +0 -10
- package/dist/client/e6056e6d7e98fff2.js +0 -10
package/LICENSE.txt
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Updated Date:
|
|
1
|
+
Updated Date: April 1, 2025
|
|
2
2
|
|
|
3
3
|
NocoBase License Agreement
|
|
4
4
|
|
|
@@ -88,7 +88,7 @@ Except for Third-Party Open Source Software, the Company owns all copyrights, tr
|
|
|
88
88
|
|
|
89
89
|
6.6 Can sell plugins developed for Software in the Marketplace.
|
|
90
90
|
|
|
91
|
-
6.7 The User with
|
|
91
|
+
6.7 The User with a Professional or Enterprise Edition License can sell Upper Layer Application to their clients.
|
|
92
92
|
|
|
93
93
|
6.8 Not restricted by the AGPL-3.0 agreement.
|
|
94
94
|
|
|
@@ -106,9 +106,9 @@ Except for Third-Party Open Source Software, the Company owns all copyrights, tr
|
|
|
106
106
|
|
|
107
107
|
7.4 It is not allowed to provide any form of no-code, zero-code, low-code platform SaaS products to the public using the original or modified Software.
|
|
108
108
|
|
|
109
|
-
7.5 It is not allowed for the User withot
|
|
109
|
+
7.5 It is not allowed for the User withot a Professional or Enterprise Edition license to sell Upper Layer Application to clients without a Commercial license.
|
|
110
110
|
|
|
111
|
-
7.6 It is not allowed for the User with
|
|
111
|
+
7.6 It is not allowed for the User with a Professional or Enterprise Edition license to sell Upper Layer Application to clients without a Commercial license with access to further development and configuration.
|
|
112
112
|
|
|
113
113
|
7.7 It is not allowed to publicly sell plugins developed for Software outside of the Marketplace.
|
|
114
114
|
|
|
@@ -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
|
+
"use strict";(self.webpackChunk_nocobase_plugin_public_forms=self.webpackChunk_nocobase_plugin_public_forms||[]).push([["978"],{5223:function(e,t,r){r.r(t),r.d(t,{PublicFormMessageContext:function(){return B},PageBackgroundColor:function(){return R},PublicFormPage:function(){return z}});var n=r(4964),o=r(3505),a=r(3772),i=r(2721),l=r(8156),u=r.n(l),c=r(3135),s=r(5432),f=r(4163),p=r(6903),d=function(){var e=(0,p.NY)().t;return u().createElement(a.BlockItemCard,{style:{boxShadow:"unset"}},u().createElement(i.Result,{status:"403",subTitle:e("The form is not enabled and cannot be accessed",{ns:p.A7})}))},m=function(){return(0,p.NY)().t,u().createElement(a.BlockItemCard,{style:{boxShadow:"unset"}},u().createElement(i.Result,{status:"404"}))},b=r(2992),y=r(3238);function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function h(e){var t=e.toLowerCase();if(/\bss?\b/.test(t))return"second";if(/\bmm?\b/.test(t))return"minute";if(/\bhh?\b/.test(t))return"hour";throw Error("Invalid time format")}var g=(0,o.connect)(function(e){var t,r,n,o=(0,y.useTranslation)().t,i=e.value,c=e.onChange,s=(e.dateFormat,e.timeFormat),f=void 0===s?"HH:mm":s,p=e.showTime,d=void 0!==p&&p,m=e.picker,g=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,["value","onChange","dateFormat","timeFormat","showTime","picker"]),w=(t=(0,l.useState)(!1),function(e){if(Array.isArray(e))return e}(t)||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,l=!1;try{for(o=o.call(e);!(i=(r=o.next()).done)&&(a.push(r.value),a.length!==t);i=!0);}catch(e){l=!0,n=e}finally{try{i||null==o.return||o.return()}finally{if(l)throw n}}return a}}(t,2)||function(e,t){if(e){if("string"==typeof e)return v(e,2);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return v(e,t)}}(t,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.")}()),O=w[0],S=w[1];console.log(h(f));var k=(0,l.useCallback)(function(e){S(!1),c(new Date(e))},[d,c]),P=(0,l.useCallback)(function(){S(!1),c(null)},[c]),C=(0,l.useCallback)(function(e,t){return t},[]);return u().createElement(u().Fragment,null,u().createElement("div",{contentEditable:"false",onClick:function(){return S(!0)}},u().createElement(a.DatePicker,(r=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({onClick:function(){return S(!0)},value:i,picker:m},g),n=n={popupStyle:{display:"none"},style:{pointerEvents:"none",width:"100%"}},Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(n)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(n,e))}),r))),u().createElement(b.Mt,{cancelText:o("Cancel"),confirmText:o("Confirm"),visible:O,title:u().createElement("a",{onClick:P},o("Clear")),onClose:function(){S(!1)},precision:d?h(f):"date"===m?"day":m,renderLabel:C,min:new Date(1e3,0,1),max:new Date(9999,11,31),onConfirm:function(e){k(e)}}))},(0,o.mapProps)((0,a.mapDatePicker)()),(0,o.mapReadPretty)(a.DatePicker.ReadPretty));function w(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function O(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,l=!1;try{for(o=o.call(e);!(i=(r=o.next()).done)&&(a.push(r.value),!t||a.length!==t);i=!0);}catch(e){l=!0,n=e}finally{try{i||null==o.return||o.return()}finally{if(l)throw n}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return w(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return w(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.")}()}var S=(0,o.connect)(function(e){var t=e.value,r=e.onChange,n=e.options,o=void 0===n?[]:n,i=e.mode,c=(0,y.useTranslation)().t,s=O((0,l.useState)(!1),2),f=s[0],p=s[1],d=O((0,l.useState)(t||[]),2),m=d[0],v=d[1],h=O((0,l.useState)(null),2),g=h[0],w=h[1],S=(0,l.useMemo)(function(){return g?o.filter(function(e){return e.label.toLowerCase().includes(g.toLowerCase())}):o},[o,g]);return(0,l.useEffect)(function(){f||w(null)},[f]),u().createElement(u().Fragment,null,u().createElement("div",{contentEditable:"false",onClick:function(){return p(!0)}},u().createElement(a.Select,{placeholder:c("Select"),value:t,dropdownStyle:{display:"none"},multiple:"multiple"===i,onClear:function(){p(!1),r(null),v(null)},onFocus:function(e){return e.preventDefault()},style:{pointerEvents:"none"}})),u().createElement(b.GI,{visible:f,onMaskClick:function(){p(!1),t&&(null==t?void 0:t.length)!==0||v([])},destroyOnClose:!0},u().createElement("div",{style:{margin:"10px"}},u().createElement(b.E1,{placeholder:c("search"),value:g,onChange:function(e){return w(e)},showCancelButton:!0})),u().createElement("div",{style:{maxHeight:"60vh",overflowY:"auto"}},u().createElement(b.Su,{multiple:"multiple"===i,value:Array.isArray(m)?m:[m],onChange:function(e){"multiple"===i?v(e):(v(e[0]),r(e[0]),p(!1))}},S.map(function(e){return u().createElement(b.Su.Item,{key:e.value,value:e.value},e.label)}))),"multiple"===i&&u().createElement(b.zx,{block:!0,color:"primary",onClick:function(){r(m),p(!1)},style:{marginTop:"16px"}},c("Confirm"))))},(0,o.mapProps)({dataSource:"options"}));function k(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function P(e,t,r,n,o,a,i){try{var l=e[a](i),u=l.value}catch(e){r(e);return}l.done?t(u):Promise.resolve(u).then(n,o)}function C(e){return(C=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function E(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}function x(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}function j(e,t){return(j=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function A(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,l=!1;try{for(o=o.call(e);!(i=(r=o.next()).done)&&(a.push(r.value),!t||a.length!==t);i=!0);}catch(e){l=!0,n=e}finally{try{i||null==o.return||o.return()}finally{if(l)throw n}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return k(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return k(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 D(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(D=function(){return!!e})()}function F(){var e,t,r=(e=["\n @media (min-width: 1025px) {\n padding-top: 10vh;\n }\n padding-top: 0px;\n "],t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return F=function(){return r},r}var T=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=C(e),function(e,t){var r;if(t&&("object"==((r=t)&&"undefined"!=typeof Symbol&&r.constructor===Symbol?"symbol":typeof r)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,D()?Reflect.construct(e,t||[],C(this).constructor):e.apply(this,t))}return r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),e&&j(r,e),t=[{key:"getDataSource",value:function(){var e;return(e=function(){return function(e,t){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(a){return function(l){var u=[a,l];if(r)throw TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(o=2&u[0]?n.return:u[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,u[1])).done)return o;switch(n=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++,n=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],n=0}finally{r=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}(this,function(e){return[2,{}]})},function(){var t=this,r=arguments;return new Promise(function(n,o){var a=e.apply(t,r);function i(e){P(a,n,o,i,l,"next",e)}function l(e){P(a,n,o,i,l,"throw",e)}i(void 0)})})()}}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(r.prototype,t),r}(a.DataSource);function M(e){var t=e.dataSource,r=(0,a.useApp)(),n=A((0,l.useMemo)(function(){var e=new a.DataSourceManager({},r),n=e.addDataSource(T,t);return[e,new a.CollectionManager([],n)]},[r,t]),2),o=n[0],i=n[1];return u().createElement("div",null,u().createElement(a.DataSourceApplicationProvider,{dataSource:t.key,dataSourceManager:o,instance:i},e.children))}function I(e){var t=e.children,r=(0,a.useApp)();return(0,l.useEffect)(function(){var e=r.apiClient.axios.interceptors.request.use(function(e){return e.headers&&(e.headers["X-Form-Token"]=localStorage.getItem("NOCOBASE_FORM_TOKEN")||""),e});return function(){r.apiClient.axios.interceptors.request.eject(e)}},[r.apiClient.axios.interceptors.request]),u().createElement(a.APIClientProvider,{apiClient:r.apiClient},t)}var B=(0,l.createContext)({}),R="#f5f5f5",_=function(e){var t=e.children,r=A((0,l.useState)(!1),2),n=r[0],a=r[1],i=(0,o.useField)(),c=function(e,t){i.form.query(e).take(function(e){e&&(e.visible=t,e.hidden=!t)})};return(0,l.useEffect)(function(){c("success",n),c("form",!n),n||i.form.query("promptMessage").take(function(e){e&&(e.visible=!1,e.hidden=!0)})},[n]),u().createElement(B.Provider,{value:{showMessage:n,setShowMessage:a}},t)},q=function(e){return u().createElement(a.AssociationField,x(E({},e),{popupMatchSelectWidth:!0}))};q.SubTable=a.AssociationField.SubTable,q.Nester=a.AssociationField.Nester,q.AddNewer=a.Action.Container,q.Selector=a.Action.Container,q.Viewer=a.Action.Container,q.InternalSelect=a.AssociationField.InternalSelect,q.ReadPretty=a.AssociationField.ReadPretty,q.FileSelector=a.AssociationField.FileSelector;var N=function(e){return u().createElement(g,e)};N.FilterWithPicker=a.DatePicker.FilterWithPicker,N.RangePicker=a.DatePicker.RangePicker;var V={Button:b.zx,Select:function(e){return u().createElement(S,e)},DatePicker:N,UnixTimestamp:g,Modal:b.Vq,AssociationField:q};function G(){var e,t,r,o,p,b,y=(0,s.useParams)(),v=(0,a.useAPIClient)(),h=window.matchMedia("(max-width: 768px)").matches,g=(0,a.useRequest)({url:"publicForms:getMeta/".concat(y.name),skipAuth:!0},{onSuccess:function(e){var t;localStorage.setItem("NOCOBASE_FORM_TOKEN",null==e||null==(t=e.data)?void 0:t.token),v.axios.interceptors.request.use(function(t){if(t.headers){var r;t.headers["X-Form-Token"]=(null==e||null==(r=e.data)?void 0:r.token)||""}return t})}}),w=g.error,O=g.data,S=g.loading,k=g.run,P=A((0,l.useState)(""),2),C=P[0],j=P[1],D=(0,l.useContext)(a.SchemaComponentContext);return(e=(0,a.useCompile)(),(0,l.useEffect)(function(){var t;O&&(document.title=e(null==O||null==(t=O.data)?void 0:t.title))},[O]),(0,l.useEffect)(function(){if(!c.isDesktop){var e=document.querySelector('meta[name="viewport"]');e||((e=document.createElement("meta")).setAttribute("name","viewport"),document.head.appendChild(e)),e.setAttribute("content","width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"),document.body.style.backgroundColor=R,document.body.style.overflow="hidden";var t=document.createElement("div");document.body.appendChild(t),document.body.removeChild(t)}},[]),(null==w||null==(t=w.response)?void 0:t.status)===401||(null==O||null==(r=O.data)?void 0:r.passwordRequired))?u().createElement("div",null,u().createElement(i.Modal,{centered:!0,title:"Password",open:!0,cancelButtonProps:{hidden:!0},onOk:function(){k({password:C})}},u().createElement(i.Input.Password,{onChange:function(e){j(e.target.value)}}))):(null==w||null==(o=w.response)?void 0:o.status)===500?u().createElement(m,null):S?u().createElement(i.Spin,null):(null==O?void 0:O.data)?u().createElement(a.ACLCustomContext.Provider,{value:{allowAll:!0}},u().createElement(I,null,u().createElement("div",{style:{minHeight:"100vh",background:R,height:"100%",overflow:"auto"}},u().createElement("div",{style:{maxWidth:800,margin:"0 auto",position:"relative",zIndex:0},className:(0,n.css)(F())},u().createElement(M,{dataSource:null==O||null==(p=O.data)?void 0:p.dataSource},u().createElement(a.VariablesProvider,null,u().createElement(a.SchemaComponentContext.Provider,{value:x(E({},D),{designable:!1})},u().createElement(a.SchemaComponent,{schema:null==O||null==(b=O.data)?void 0:b.schema,scope:{useCreateActionProps:f.hG},components:E({PublicFormMessageProvider:_},h?V:{})})))),u().createElement("div",{style:{marginBottom:"20px"}},u().createElement(a.PoweredBy,null)))))):u().createElement(d,null)}function z(){return u().createElement(a.GlobalThemeProvider,{theme:{token:{marginBlock:18,borderRadiusBlock:0,boxShadowTertiary:"none",fontSize:14}}},u().createElement(G,null))}},4163:function(e,t,r){r.d(t,{Dq:function(){return i},j1:function(){return v},fC:function(){return c},hG:function(){return d}});var n=r(3772),o=r(2721);function a(e,t,r,n,o,a,i){try{var l=e[a](i),u=l.value}catch(e){r(e);return}l.done?t(u):Promise.resolve(u).then(n,o)}function i(){var e=o.App.useApp().message,t=(0,n.useCollectionRecordData)(),r=(0,n.useDataBlockResource)(),i=(0,n.useBlockRequestContext)().service,l=(0,n.useCollection)();return{confirm:{title:"Delete",content:"Are you sure you want to delete it?"},onClick:function(){var n;return(n=function(){return function(e,t){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(a){return function(l){var u=[a,l];if(r)throw TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(o=2&u[0]?n.return:u[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,u[1])).done)return o;switch(n=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++,n=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],n=0}finally{r=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}(this,function(n){switch(n.label){case 0:if(!l)throw Error("collection does not exist");return[4,r.destroy({filterByTk:t[l.filterTargetKey]})];case 1:return n.sent(),[4,i.refresh()];case 2:return n.sent(),e.success("Deleted!"),[2]}})},function(){var e=this,t=arguments;return new Promise(function(r,o){var i=n.apply(e,t);function l(e){a(i,r,o,l,u,"next",e)}function u(e){a(i,r,o,l,u,"throw",e)}l(void 0)})})()}}}var l=r(8563),u=r(8156),c=function(){var e=(0,n.useCollectionRecordData)();return{form:(0,u.useMemo)(function(){return(0,l.createForm)({initialValues:e})},[e])}},s=r(3505),f=r(5223);function p(e,t,r,n,o,a,i){try{var l=e[a](i),u=l.value}catch(e){r(e);return}l.done?t(u):Promise.resolve(u).then(n,o)}var d=function(){var e=(0,s.useForm)(),t=(0,n.useDataBlockResource)(),r=(0,s.useField)(),o=(0,n.useCollectValuesToSubmit)(),a=(0,s.useFieldSchema)(),i=(0,n.useFormBlockContext)().updateAssociationValues,l=(0,u.useContext)(f.PublicFormMessageContext).setShowMessage;return{type:"primary",onClick:function(){var n;return(n=function(){var n,u,c,s,f;return function(e,t){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(a){return function(l){var u=[a,l];if(r)throw TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(o=2&u[0]?n.return:u[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,u[1])).done)return o;switch(n=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++,n=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],n=0}finally{r=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:if(c=(u=null!=(n=null==a?void 0:a["x-action-settings"])?n:{}).skipValidator,s=u.triggerWorkflows,c)return[3,2];return[4,e.submit()];case 1:p.sent(),p.label=2;case 2:return[4,o()];case 3:f=p.sent(),r.data=r.data||{},r.data.loading=!0,p.label=4;case 4:return p.trys.push([4,8,,9]),[4,e.submit()];case 5:return p.sent(),[4,t.publicSubmit({values:f,triggerWorkflows:(null==s?void 0:s.length)?s.map(function(e){return[e.workflowKey,e.context].filter(Boolean).join("!")}).join(","):void 0,updateAssociationValues:i})];case 6:return p.sent(),[4,e.reset()];case 7:return p.sent(),r.data.loading=!1,l(!0),[3,9];case 8:return p.sent(),r.data.loading=!1,[3,9];case 9:return[2]}})},function(){var e=this,t=arguments;return new Promise(function(r,o){var a=n.apply(e,t);function i(e){p(a,r,o,i,l,"next",e)}function l(e){p(a,r,o,i,l,"throw",e)}i(void 0)})})()}}},m=r(8875),b=r(7712);function y(e,t,r,n,o,a,i){try{var l=e[a](i),u=l.value}catch(e){r(e);return}l.done?t(u):Promise.resolve(u).then(n,o)}var v=function(){var e=(0,n.useActionContext)().setVisible,t=o.App.useApp().message,r=(0,s.useForm)(),a=(0,n.useDataBlockResource)(),i=(0,n.useCollection)(),l=(0,n.useAPIClient)(),u=(0,n.usePlugin)(b.default),c=(0,n.useBlockRequestContext)().service;return{type:"primary",onClick:function(){var n;return(n=function(){var n,o,s,f,p,d;return function(e,t){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(a){return function(l){var u=[a,l];if(r)throw TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(o=2&u[0]?n.return:u[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,u[1])).done)return o;switch(n=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++,n=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],n=0}finally{r=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}(this,function(b){switch(b.label){case 0:return[4,r.submit()];case 1:if(b.sent(),!(n=r.values)[i.filterTargetKey])return[3,3];return[4,a.update({values:n,filterByTk:n[i.filterTargetKey]})];case 2:return b.sent(),[3,6];case 3:var y,v,h,g;return o=(0,m.uid)(),s=u.getFormSchemaByType(n.type),p=(f=n.collection.split(":")).pop(),y=s({collection:p,dataSource:f.pop()||"main"}),v=u.t.bind(u),(d={type:"void",name:(0,m.uid)(),"x-decorator":"PublicFormMessageProvider",properties:{form:y,promptMessage:{type:"void","x-component":"h3","x-component-props":{style:{margin:"10px 0px 10px"},children:'{{ t("Prompt after successful submission",{ns:"public-forms"})}}'}},success:{type:"void","x-editable":!1,"x-toolbar-props":{draggable:!1},"x-settings":"blockSettings:publicMarkdown","x-component":"Markdown.Void","x-decorator":"CardItem","x-component-props":{content:v("# Submitted successfully!\nThis is a demo text, **supports Markdown syntax**.")},"x-decorator-props":{name:"markdown",engine:"handlebars"}}}})["x-uid"]=o,[4,a.create({values:(h=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},n),g=g={key:o},Object.getOwnPropertyDescriptors?Object.defineProperties(h,Object.getOwnPropertyDescriptors(g)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(g)).forEach(function(e){Object.defineProperty(h,e,Object.getOwnPropertyDescriptor(g,e))}),h)})];case 4:return b.sent(),[4,l.resource("uiSchemas").insert({values:d})];case 5:b.sent(),b.label=6;case 6:return r.reset(),[4,c.refresh()];case 7:return b.sent(),t.success("Saved successfully!"),e(!1),[2]}})},function(){var e=this,t=arguments;return new Promise(function(r,o){var a=n.apply(e,t);function i(e){y(a,r,o,i,l,"next",e)}function l(e){y(a,r,o,i,l,"throw",e)}i(void 0)})})()}}}}}]);
|