@sankhyalabs/sankhyablocks 8.9.3 → 8.9.5
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/cjs/{ConfigStorage-c15716fd.js → ConfigStorage-90552fe8.js} +2 -2
- package/dist/cjs/{DataFetcher-713f0749.js → DataFetcher-1b1e9ff0.js} +58 -43
- package/dist/cjs/{SnkFormConfigManager-29101e20.js → SnkFormConfigManager-0561602d.js} +2 -2
- package/dist/cjs/Sortable-fb1c4cbb.js +2853 -0
- package/dist/cjs/{auth-fetcher-555ff856.js → auth-fetcher-eee6ec18.js} +1 -1
- package/dist/cjs/{constants-d187e03e.js → constants-35ddd366.js} +4 -0
- package/dist/cjs/{dataunit-fetcher-a0079a6f.js → dataunit-fetcher-38233d72.js} +1 -1
- package/dist/cjs/{form-config-fetcher-17775a75.js → form-config-fetcher-00372ac0.js} +1 -1
- package/dist/cjs/{pesquisa-fetcher-34922b83.js → pesquisa-fetcher-8bc6d0a5.js} +1 -1
- package/dist/cjs/snk-actions-button.cjs.entry.js +4 -5
- package/dist/cjs/snk-application.cjs.entry.js +6 -7
- package/dist/cjs/snk-attach.cjs.entry.js +3 -4
- package/dist/cjs/snk-config-options.cjs.entry.js +1 -1
- package/dist/cjs/snk-configurator.cjs.entry.js +1 -1
- package/dist/cjs/snk-crud.cjs.entry.js +6 -7
- package/dist/cjs/snk-data-exporter.cjs.entry.js +3 -4
- package/dist/cjs/{snk-data-unit-b949160d.js → snk-data-unit-04d76538.js} +1 -1
- package/dist/cjs/snk-data-unit.cjs.entry.js +1 -1
- package/dist/cjs/snk-detail-view.cjs.entry.js +8 -9
- package/dist/cjs/snk-field-config.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-bar.cjs.entry.js +3 -4
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +3 -4
- package/dist/cjs/snk-form-config.cjs.entry.js +15 -14
- package/dist/cjs/snk-form.cjs.entry.js +4 -5
- package/dist/cjs/snk-grid-config.cjs.entry.js +4 -5
- package/dist/cjs/snk-grid.cjs.entry.js +3 -4
- package/dist/cjs/{snk-guides-viewer-f7ef9607.js → snk-guides-viewer-676dd526.js} +6 -6
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +8 -9
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +3 -4
- package/dist/cjs/snk-select-box.cjs.entry.js +1 -1
- package/dist/cjs/snk-simple-crud.cjs.entry.js +5 -6
- package/dist/cjs/snk-tab-config.cjs.entry.js +7 -7
- package/dist/collection/components/snk-data-unit/snk-data-unit.js +1 -1
- package/dist/collection/components/snk-form/subcomponents/snk-form-config/snk-form-config.js +10 -8
- package/dist/collection/components/snk-form/subcomponents/snk-tab-config/snk-tab-config.js +5 -4
- package/dist/collection/lib/utils/constants.js +3 -0
- package/dist/components/DataFetcher.js +16 -1
- package/dist/components/constants.js +4 -1
- package/dist/components/snk-data-unit2.js +1 -1
- package/dist/components/snk-form-config2.js +13 -11
- package/dist/components/snk-tab-config2.js +2198 -6229
- package/dist/esm/{ConfigStorage-79c81f36.js → ConfigStorage-84abda58.js} +2 -2
- package/dist/esm/{DataFetcher-79f78222.js → DataFetcher-7814568f.js} +16 -1
- package/dist/esm/{SnkFormConfigManager-7723f3ec.js → SnkFormConfigManager-655943d0.js} +2 -2
- package/dist/esm/Sortable-83960219.js +2851 -0
- package/dist/esm/{auth-fetcher-e260d0cd.js → auth-fetcher-06354710.js} +1 -1
- package/dist/esm/{constants-3644f1b6.js → constants-8457af36.js} +4 -1
- package/dist/esm/{dataunit-fetcher-a2e763f3.js → dataunit-fetcher-aa70ea72.js} +1 -1
- package/dist/esm/{form-config-fetcher-e1603e66.js → form-config-fetcher-24f43afd.js} +1 -1
- package/dist/esm/{pesquisa-fetcher-8e922c9d.js → pesquisa-fetcher-f7aaf727.js} +1 -1
- package/dist/esm/snk-actions-button.entry.js +4 -5
- package/dist/esm/snk-application.entry.js +6 -7
- package/dist/esm/snk-attach.entry.js +3 -4
- package/dist/esm/snk-config-options.entry.js +1 -1
- package/dist/esm/snk-configurator.entry.js +1 -1
- package/dist/esm/snk-crud.entry.js +6 -7
- package/dist/esm/snk-data-exporter.entry.js +3 -4
- package/dist/esm/{snk-data-unit-ca945bf5.js → snk-data-unit-ad5cf70c.js} +1 -1
- package/dist/esm/snk-data-unit.entry.js +1 -1
- package/dist/esm/snk-detail-view.entry.js +8 -9
- package/dist/esm/snk-field-config.entry.js +1 -1
- package/dist/esm/snk-filter-bar.entry.js +3 -4
- package/dist/esm/snk-filter-modal-item.entry.js +3 -4
- package/dist/esm/snk-form-config.entry.js +15 -14
- package/dist/esm/snk-form.entry.js +4 -5
- package/dist/esm/snk-grid-config.entry.js +4 -5
- package/dist/esm/snk-grid.entry.js +3 -4
- package/dist/esm/{snk-guides-viewer-9f5dfbcc.js → snk-guides-viewer-746e2547.js} +6 -6
- package/dist/esm/snk-guides-viewer.entry.js +8 -9
- package/dist/esm/snk-personalized-filter.entry.js +3 -4
- package/dist/esm/snk-select-box.entry.js +1 -1
- package/dist/esm/snk-simple-crud.entry.js +5 -6
- package/dist/esm/snk-tab-config.entry.js +7 -7
- package/dist/sankhyablocks/p-0d5e8a37.entry.js +1 -0
- package/dist/sankhyablocks/p-1ae31937.entry.js +1 -0
- package/dist/sankhyablocks/p-25df73bf.entry.js +1 -0
- package/dist/sankhyablocks/p-3b60db06.entry.js +1 -0
- package/dist/sankhyablocks/p-3f0fe056.js +1 -0
- package/dist/sankhyablocks/{p-2e6f1666.js → p-5eb3ac18.js} +1 -1
- package/dist/sankhyablocks/{p-73d3daa8.entry.js → p-5f74c859.entry.js} +1 -1
- package/dist/sankhyablocks/p-6e32de4b.entry.js +1 -0
- package/dist/sankhyablocks/p-718ecd01.entry.js +1 -0
- package/dist/sankhyablocks/p-809a09ac.entry.js +1 -0
- package/dist/sankhyablocks/p-88039a7f.js +1 -0
- package/dist/sankhyablocks/p-8eb67fa4.entry.js +1 -0
- package/dist/sankhyablocks/p-8f307ef2.entry.js +1 -0
- package/dist/sankhyablocks/{p-f30526a7.entry.js → p-95df461f.entry.js} +1 -1
- package/dist/sankhyablocks/p-97277eae.entry.js +1 -0
- package/dist/sankhyablocks/{p-838f8234.entry.js → p-98674137.entry.js} +1 -1
- package/dist/sankhyablocks/p-993e27ad.entry.js +1 -0
- package/dist/sankhyablocks/p-9be1dfd5.entry.js +1 -0
- package/dist/sankhyablocks/p-a3868fbc.entry.js +1 -0
- package/dist/sankhyablocks/p-a3fbded7.entry.js +1 -0
- package/dist/sankhyablocks/p-a4401f5f.entry.js +1 -0
- package/dist/sankhyablocks/{p-29176742.js → p-a9b6acf1.js} +1 -1
- package/dist/sankhyablocks/p-b0ef4383.js +1 -0
- package/dist/sankhyablocks/{p-80e9773f.js → p-b54e06ca.js} +1 -1
- package/dist/sankhyablocks/p-c6800fd4.entry.js +1 -0
- package/dist/sankhyablocks/{p-210b4794.js → p-cd2a285d.js} +1 -1
- package/dist/sankhyablocks/p-d7665a57.entry.js +1 -0
- package/dist/sankhyablocks/{p-41d156dd.js → p-e38f28ae.js} +2 -2
- package/dist/sankhyablocks/{p-4651b43f.js → p-e47d966c.js} +1 -1
- package/dist/sankhyablocks/{p-839da75f.js → p-ee49df44.js} +1 -1
- package/dist/sankhyablocks/{p-6a33f844.entry.js → p-f3479d53.entry.js} +2 -2
- package/dist/sankhyablocks/p-fa816fb2.js +1 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/lib/utils/constants.d.ts +3 -4
- package/package.json +2 -2
- package/dist/cjs/_commonjsHelpers-537d719a.js +0 -20
- package/dist/cjs/draggable.bundle-82a25c06.js +0 -6886
- package/dist/components/_commonjsHelpers.js +0 -17
- package/dist/esm/_commonjsHelpers-9943807e.js +0 -17
- package/dist/esm/draggable.bundle-41d56f06.js +0 -6884
- package/dist/sankhyablocks/p-06e76ed2.entry.js +0 -1
- package/dist/sankhyablocks/p-112455b1.js +0 -1
- package/dist/sankhyablocks/p-1e8262a0.entry.js +0 -1
- package/dist/sankhyablocks/p-32b0a5e1.entry.js +0 -1
- package/dist/sankhyablocks/p-47e4b6c9.entry.js +0 -1
- package/dist/sankhyablocks/p-4a78e118.js +0 -1
- package/dist/sankhyablocks/p-51529d47.entry.js +0 -1
- package/dist/sankhyablocks/p-6bdb1068.entry.js +0 -1
- package/dist/sankhyablocks/p-80692cbd.entry.js +0 -1
- package/dist/sankhyablocks/p-94c532bb.entry.js +0 -1
- package/dist/sankhyablocks/p-9cbf6c15.entry.js +0 -1
- package/dist/sankhyablocks/p-b2ce189a.entry.js +0 -1
- package/dist/sankhyablocks/p-b6d6b172.js +0 -1
- package/dist/sankhyablocks/p-bd628455.entry.js +0 -1
- package/dist/sankhyablocks/p-c1e50dda.entry.js +0 -1
- package/dist/sankhyablocks/p-c9399ce6.js +0 -1
- package/dist/sankhyablocks/p-cd024328.entry.js +0 -1
- package/dist/sankhyablocks/p-cead4799.entry.js +0 -1
- package/dist/sankhyablocks/p-d0b36421.js +0 -1
- package/dist/sankhyablocks/p-e60325bc.entry.js +0 -1
- package/dist/sankhyablocks/p-f007b434.entry.js +0 -1
- package/dist/sankhyablocks/p-fda8c84c.entry.js +0 -1
@@ -1,4 +1,4 @@
|
|
1
|
-
import{r as t,c as s,h as e,g as i}from"./p-d2d301a6.js";import{DateUtils as n,StringUtils as r,ObjectUtils as a,WaitingChangeException as o,WarningException as c,ErrorException as h,OnboardingUtils as u,DependencyType as l,ElementIDUtils as p,DataType as d,ApplicationContext as m,ErrorTracking as w}from"@sankhyalabs/core";import{ApplicationUtils as
|
1
|
+
import{r as t,c as s,h as e,g as i}from"./p-d2d301a6.js";import{DateUtils as n,StringUtils as r,ObjectUtils as a,WaitingChangeException as o,WarningException as c,ErrorException as h,OnboardingUtils as u,DependencyType as l,ElementIDUtils as p,DataType as d,ApplicationContext as m,ErrorTracking as w}from"@sankhyalabs/core";import{ApplicationUtils as f}from"@sankhyalabs/ezui/dist/collection/utils";import{C as y}from"./p-a9b6acf1.js";import{d as P,D as g,U as v}from"./p-88039a7f.js";import{A,a as I}from"./p-3f0fe056.js";import{D as _}from"./p-ee49df44.js";import{P as S}from"./p-e38f28ae.js";import{S as C}from"./p-aa3b0d19.js";import"./p-e47d966c.js";import"./p-584d7212.js";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-8d884fab.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"./p-c22c1d8e.js";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";import"./p-688dcb4c.js";class D{static webConnectionCaller(t,s,e){var i;null===(i=window.AppletCaller)||void 0===i||i.webConnectionCaller(t,s,e)}}const E=N;function N(t,s){const e=k();return(N=function(t){return e[t-=378]})(t,s)}function k(){const t=["true","863GKWjmo","parse","56355fjjjAm","isSup","putAccess","4324480sjuCdS","hasOwnProperty","239748okvJLB","name","6055770tXeRaU","actions","forEach","7RPRvzn","1042CHxkUw","2988126NIwRMm","20MTNzmH","authorizationSf","item","string","hasAccess","isArray","Objeto não pode ser indefinido.","3071943fWslZp","parseFromJSON"];return(k=function(){return t})()}!function(){const t=N,s=k();for(;;)try{if(281287==parseInt(t(399))/1*(-parseInt(t(387))/2)+-parseInt(t(401))/3+parseInt(t(381))/4*(-parseInt(t(389))/5)+parseInt(t(388))/6*(-parseInt(t(386))/7)+parseInt(t(379))/8+parseInt(t(396))/9+parseInt(t(383))/10)break;s.push(s.shift())}catch(t){s.push(s.shift())}}();class L{[E(397)](t){const s=E;if(typeof(t=utxt(t[s(390)]))==s(392)&&(t=JSON[s(400)](t)),null==t)throw Error(s(395));const e=new T("S"===t[s(402)]||!0===t[s(402)]);return Array[s(394)](t[s(391)])&&t[s(391)][s(385)]((t=>e.putAccess(t[s(382)],String(t.status)==s(398)))),e}}class T{constructor(t){const s=E;this.isSup=t,this[s(384)]={}}[E(378)](t,s){this[E(384)][t]=s}[E(393)](t){const s=E;if(this[s(402)])return!0;let e=!0;return this[s(384)][s(380)](t)&&(e=this.actions[t]),e}isUserSup(){return this.isSup}}class b{constructor(){this.templateByQuery=new Map,this.buldTemplates()}buldTemplates(){this.templateByQuery.set("fetchParam",P.gql`query($name: String!) {
|
2
2
|
$queryAlias$: fetchResource(name: $name){
|
3
3
|
name
|
4
4
|
resource
|
@@ -8,4 +8,4 @@ import{r as t,c as s,h as e,g as i}from"./p-d2d301a6.js";import{DateUtils as n,S
|
|
8
8
|
name
|
9
9
|
value
|
10
10
|
}
|
11
|
-
}`)}fetchTotals(t,s,e=[]){const i=`${t}_${s}`,n=this.cancel.findIndex((t=>t[i]));return n>=0&&(this.cancel[n][i](),this.cancel.splice(n,1)),Promise.race([new Promise((t=>this.cancel.push({[i]:t}))),this.getTotals(t,s,e)]).then((t=>{let s=new Map;if(t){s=t;const e=this.cancel.findIndex((t=>t[i]));e>=0&&this.cancel.splice(e,1)}return s}))}getTotals(t,s,e=[]){return new Promise(((i,n)=>{g.get().callGraphQL({query:this.templateByQuery.get("fetchTotals"),values:{name:`totals://${t}/${s}`,filters:e}}).then((t=>{if(t.length>0){const s=new Map;return t.forEach((t=>s.set(t.name,parseFloat(t.value)))),i(s)}return n("Não foi possível recuperar os totalizadores")})).catch(n)}))}}function j(){const t=["2909523kXwted","CompanyName=Sankhya Jiva Tecnologia e Inovao Ltda,LicensedApplication=Sankhya Gestao,LicenseType=SingleApplication,LicensedConcurrentDeveloperCount=2,LicensedProductionInstancesCount=0,AssetReference=AG-019460,ExpiryDate=9_November_2022_[v2]_MTY2Nzk1MjAwMDAwMA==10487151e296ee4360f80961ca960869","1131048CARoeW","502909mLEPmu","447255iQEXuN","428UHbJwW","270AFTxAV","194369jhGqTI","1540nWuTrj","2044062GicUQI","30CkXPWg"];return(j=function(){return t})()}const U=$;function $(t,s){const e=j();return($=function(t){return e[t-=392]})(t,s)}!function(){const t=$,s=j();for(;;)try{if(951926==-parseInt(t(398))/1+-parseInt(t(393))/2+parseInt(t(395))/3+-parseInt(t(400))/4*(parseInt(t(392))/5)+-parseInt(t(401))/6*(-parseInt(t(402))/7)+parseInt(t(397))/8+-parseInt(t(399))/9*(-parseInt(t(394))/10))break;s.push(s.shift())}catch(t){s.push(s.shift())}}();const R=U(396);var M;class F{static openAppActivity(t,s){var e;null===(e=window.workspace)||void 0===e||e.openAppActivity(t,s)}static getAppLabel(t){if(null!=(null===window||void 0===window?void 0:window.workspace))return null==window.workspace.getAppLabel&&(window.workspace.getAppLabel=t=>(t||"").split(".").pop()),window.workspace.getAppLabel(t)}static setScreenToUseV3Layout(){var t;null===(t=window.workspace)||void 0===t||t.setScreenToUseV3Layout()}static setScreenToUseOldLayout(){var t;null===(t=window.workspace)||void 0===t||t.setScreenToUseOldLayout()}static applicationClick(){var t,s;(null===(t=window.workspace)||void 0===t?void 0:t.applicationClick)&&(null===(s=window.workspace)||void 0===s||s.applicationClick())}}F.resourceID=null===(M=window.workspace)||void 0===M?void 0:M.resourceID;class z{constructor(t){this._app=t,window.addEventListener("error",(t=>this.errorHandler(t))),window.addEventListener("unhandledrejection",(t=>this.rejectionHandler(t)))}rejectionHandler(t){const s=t.reason;s instanceof o||(s?this.processException(s):this._app.isDebugMode().then((t=>{t&&this._app.error("Promise rejeitada","Erro interno: Uma promise foi rejeitada sem razão determinada.")})))}errorHandler(t){this.processException(t.error)}buildErrorCodeHTML(t){return'<br><a href="#" onclick="try{window.workspace.openHelp(\'_tbcode:'+t+"')} catch(e){alert('Não é possível abrir a ajuda fora do workspace Sankhya');}\">Código: "+t+"</a>"}processException(t){t.errorCode&&(t.message+=this.buildErrorCodeHTML(t.errorCode)),t instanceof o||t instanceof c?this._app.alert(t.title,t.message):t instanceof h?this._app.error(t.title,t.message):this._app.isDebugMode().then((s=>{if(s)if(t instanceof Error)this._app.error(t.name,t.message);else{const s=(null==t?void 0:t.title)||"Erro detectado",e="string"==typeof t?t:t.message||`Erro interno "${a.objectToString(t)}"`;this._app.error(s,e)}}))}}const q=class{constructor(e){t(this,e),this.applicationLoaded=s(this,"applicationLoaded",7),this.applicationLoading=s(this,"applicationLoading",7),this.NEW_VERSION_POPUP_LOCKER="NEW_VERSION_POPUP_LOCKER",this._authPromises=[],this._duCache=new Map,this._duPromises=new Map,this._requestListener=new x,this._pendingActions=new Map,this._isLoadedByPk=!1,this.messagesBuilder=void 0,this.configName=void 0,this.loadByPK=void 0}async processPendingActions(t){const s=this._pendingActions.get(t);s&&s.length&&(s.forEach((t=>t())),this._pendingActions.set(t,[]))}get parameters(){return this._parameters||(this._parameters=new T),this._parameters}async getAuth(t){return null==t?this.getApplicationAuth():new Promise(((s,e)=>{this.authFetcher.getData(t).then((t=>{s(t)})).catch((t=>{e(t)}))}))}async getApplicationAuth(){return this._auth?Promise.resolve(this._auth):new Promise(((t,s)=>{const e=this._authPromises.length>0;this._authPromises.push(new B(t,s)),e||this.authFetcher.getData(this.applicationResourceID).then((t=>{for(this._auth=t;this._authPromises.length>0;)this._authPromises.pop().resolve(this._auth)})).catch((t=>{for(;this._authPromises.length>0;)this._authPromises.pop().reject(t)}))}))}async isUserSup(){return new Promise(((t,s)=>{this.getAuth().then((e=>{this.getAuthList(e).then((s=>{t(s.isSup)})).catch((t=>s(t)))}))}))}async addPendingAction(t,s){var e;const i=null!==(e=this._pendingActions.get(t))&&void 0!==e?e:[];this._pendingActions.set(t,[...i,s])}async callServiceBroker(t,s,e){return g.get().callServiceBroker(t,s,e)}async initOnboarding(t){this.hasToShowNewVersionPopup()?await this.addPendingAction(this.NEW_VERSION_POPUP_LOCKER,(()=>this.doInitOnboarding(t))):this.doInitOnboarding(t)}doInitOnboarding(t){u.getInstance().init(t,window.envContext)}async hasAccess(t,s){return new Promise(((e,i)=>{this.getAuth(s).then((s=>{this.getAuthList(s).then((s=>{e(s.isSup||s.actions[t])})).catch((t=>i(t)))}))}))}async getAllAccess(t){return new Promise(((s,e)=>{this.getAuth(t).then((t=>{this.getAuthList(t).then((t=>{const e={};e.isSup=t.isSup,Object.entries(A).forEach((s=>{e[s[0]]=t.actions[s[1]]||!1})),s(e)})).catch((t=>e(t)))}))}))}async getStringParam(t){return this.parameters.asString(t)}async getIntParam(t){return this.parameters.asInteger(t)}async getFloatParam(t){return this.parameters.asFloat(t)}async getBooleanParam(t){return this.parameters.asBoolean(t)}async getDateParam(t){return this.parameters.asDate(t)}async showPopUp(t,s="full",e=!0){this.clearContent(this._popUp),this._popUp.appendChild(t),this._popUp.opened=!0,this._popUp.heightMode=s,this._popUp.useHeader=e,"EZ-MODAL-CONTAINER"===t.tagName&&(this._popUp.useHeader=!1)}async showModal(t){this.clearContent(this._rightModal),this._rightModal.appendChild(t),this._rightModal.opened=!0}showAlerts(t){return y.showAlerts({alerts:t})}async closeModal(){this.clearContent(this._rightModal),this._rightModal.opened=!1}async closePopUp(){this.clearContent(this._popUp),this._popUp.opened=!1,this._popUp.useHeader=!0,this._popUp.heightMode="full"}async temOpcional(t){const s=t.split(",");return new Promise(((t,e)=>{this.getAttributeFromHTMLWrapper("opc0009").then((i=>{"1"===i?t(!0):Promise.all(s.map((t=>this.getAttributeFromHTMLWrapper("opc"+t)))).then((s=>{t(s.includes("1"))})).catch((t=>{e(t)}))})).catch((t=>{e(t)}))}))}async getConfig(t){let s={serviceName:"SystemUtilsSP.getConf",requestBody:{config:{chave:t,tipo:"T"}}};return new Promise(((t,e)=>{g.get().callServiceBroker("SystemUtilsSP.getConf",JSON.stringify(s)).then((s=>{var e;return t(null===(e=s.config)||void 0===e?void 0:e.data)})).catch((t=>e(t)))}))}async saveConfig(t,s){let e={serviceName:"SystemUtilsSP.saveConf",requestBody:{config:{chave:t,tipo:"T",data:s}}};return new Promise(((t,s)=>{g.get().callServiceBroker("SystemUtilsSP.saveConf",JSON.stringify(e)).then((s=>t(s))).catch((t=>s(t)))}))}async getAttributeFromHTMLWrapper(t){return Promise.resolve(window[t])}async openApp(t,s){F.openAppActivity(t,s)}async webConnection(t,s,e){this.getStringParam(t).then((t=>{D.webConnectionCaller(t,s,e)}))}getDuPromissesStack(t){let s;return t&&(s=this._duPromises.get(t),s||(s=[],this._duPromises.set(t,s))),s||[]}async createDataunit(t,s,e,i,n){return null==n&&(n=this.applicationResourceID),new Promise(((r,a)=>{const o=this.getDuPromissesStack(s),c=o.length>0;if(o.push(new B(r,a)),!c){const r=this.dataUnitFetcher.getDataUnit(t,n,e,i);r.loadMetadata().then((()=>{for(s&&this.updateDataunitCache(void 0,s,r);o.length>0;)o.pop().resolve(r)})).catch((t=>{for(;o.length>0;)o.pop().reject(t)}))}}))}async updateDataunitCache(t,s,e){t&&this._duCache.delete(t),this._duCache.set(s,e)}async getDataUnit(t,s,e,i,n){return new Promise(((r,a)=>{const o=this._duCache.get(s);o?r(o):this.createDataunit(t,s,e,i,n).then((t=>{r(t)})).catch((t=>a(t)))}))}async addClientEvent(t,s){return new Promise((e=>{g.addClientEvent(t,s),e()}))}async removeClientEvent(t){return new Promise((s=>{g.removeClientEvent(t),s()}))}async hasClientEvent(t){return new Promise((s=>{s(g.hasClientEvent(t))}))}get applicationResourceID(){return this._applicationResourceID||(this._applicationResourceID=this.urlParams.get("workspaceResourceID")||this.urlParams.get("resourceID")||F.resourceID||"unknown.resource.id"),this._applicationResourceID}async getResourceID(){return Promise.resolve(this.applicationResourceID)}async getUserID(){return Promise.resolve(window.UID)}async alert(t,s,e,i){return y.alert(t,s,e,i)}async error(t,s,e,i){return y.error(t,s,e,i)}async success(t,s,e,i){return y.success(t,s,e,i)}async message(t,s,e,i){return y.message(t,s,e,i)}async confirm(t,s,e,i,n){return y.confirm(t,s,e,i,n)}async info(t,s){return y.info(t,s)}async loadTotals(t,s,e){return this.totalsFetcher.fetchTotals(t,s,e)}async isLoadedByPk(){return Promise.resolve(this._isLoadedByPk)}async getAuthList(t){return await(new k).parseFromJSON(t)}get urlParams(){return this._urlParams||(this._urlParams=v.getQueryParams(location.search)),this._urlParams}getMessage(t,s){var e;return null===(e=this.messagesBuilder)||void 0===e?void 0:e.getMessage(t,s)}get dataUnitFetcher(){return this._dataUnitFetcher||(this._dataUnitFetcher=new _),this._dataUnitFetcher}get totalsFetcher(){return this._totalsFetcher||(this._totalsFetcher=new O),this._totalsFetcher}get pesquisaFetcher(){return this._pesquisaFetcher||(this._pesquisaFetcher=new S),this._pesquisaFetcher}get authFetcher(){return this._authFetcher||(this._authFetcher=new I),this._authFetcher}async executeSearch(t,s,e){const i=null==e?void 0:e.getField(s);if(i){const{mode:s,argument:n}=t,{ENTITYNAME:r,CODEFIELD:a,DESCRIPTIONFIELD:o,ROOTENTITY:c,DESCRIPTIONENTITY:h}=i.properties,u=i.dependencies;let p;const m={rootEntity:c,descriptionFieldName:o,codeFieldName:a,showInactives:!1,dataUnitId:e.dataUnitId};return null==u||u.filter((t=>t.masterFields)).forEach((t=>{var s;t.type===l.SEARCHING&&(null===(s=t.masterFields)||void 0===s?void 0:s.length)>0&&(p={expression:t.expression,params:t.masterFields.map((t=>{const s=e.getField(t),i=(null==s?void 0:s.dataType)||d.TEXT,n=e.getFieldValue(t);if(null==n)throw this.alert("Erro ao pesquisar",`É necessario informar o campo ${s.label} para executar a pesquisa.`),new Error(`É necessario informar o campo ${s.label} para executar a pesquisa.`);return{name:t,value:n,dataType:i}}))})})),this.executePreparedSearch(s,n,{entity:r,entityDescription:h,criteria:p,searchOptions:m})}}async executePreparedSearch(t,s,e){const{entity:i,entityDescription:n,criteria:r,searchOptions:a}=e;return"ADVANCED"===t?new Promise((t=>{const e=document.createElement("snk-pesquisa");e[p.DATA_ELEMENT_ID_ATTRIBUTE_NAME]=`entity_${i}`,e.argument=s,e.searchLoader=t=>this.pesquisaFetcher.loadAdvancedSearch(i,t,r,a),e.selectItem=s=>{t(s),this.clearPopUpTitle(),this.closePopUp()},this.setPopUpTitle(n),this.showPopUp(e)})):this.pesquisaFetcher.loadSearchOptions(i,s,r,a)}async isDebugMode(){return new Promise((t=>{t(window.isDebugMode)}))}async getAppLabel(){return F.getAppLabel(this.applicationResourceID)}addSearchListener(t,s,e){return new Promise((i=>{i(this.pesquisaFetcher.addSearchListener(t,s.dataUnitId,e))}))}importScript(t){return new Promise((s=>{this.getApplicationPath().then((e=>{let i=[];Array.isArray(t)||(i=[t]),i.forEach((t=>{const s=document.createElement("script");s.src=`${e}/${t}`,s.async=!0,document.body.appendChild(s)})),s()}))}))}async getApplicationPath(){return new Promise((t=>{"dev"===window.applicationenv?t(""):t(`/${this.getModuleName()}/labsApps/${window.APPLICATION_NAME}/build`)}))}getModuleName(){return window.MGE_MODULE_NAME||"mgefin-bff"}executeSelectDistinct(t,s,e){return this.dataUnitFetcher.loadSelectDistinct(t,s,e)}getDataFetcher(){return Promise.resolve(g.get())}clearContent(t){t&&Array.from(t.children).forEach((s=>{t.removeChild(s)}))}clearPopUpTitle(){this._popUp.ezTitle=""}setPopUpTitle(t){this._popUp.ezTitle=t}async pkChangeListener(){const t=top.window.location.hash.split("/")[2];if(this._currentPkParameter===t)return;const s=this.getResourceIdFromToken(),e=v.getPkObjectFromUrlToken(top.window.location.hash);if(null==e||s!==this.applicationResourceID)return;const i={pk:e};if(this._isLoadedByPk=!0,this.loadByPK)return this.loadByPK(i),void(this._currentPkParameter=t);this.defaultLoadByPK(i,t)}getResourceIdFromToken(){return top.window.location.pathname.indexOf("tabContent.jsp")>-1?v.getResourceIdFromUrlToken(window.location.generateHash(window.location.hash)):v.getResourceIdFromUrlToken(top.window.location.hash)}defaultLoadByPK(t,s){if(!(null==t?void 0:t.pk))return;const e=this.getFirstDataUnitFromDOM(),i=e.dataUnit;if(!i)return console.warn("Dataunit não inicializado"),void e.addEventListener("dataUnitReady",(e=>{this.loadDataWithPKFilter(t,e.detail),this._currentPkParameter=s}));this.loadDataWithPKFilter(t,i),this._currentPkParameter=s}loadDataWithPKFilter(t,s){const e={term:"",filter:{name:"LOAD_BY_PK_FILTER",expression:this.buildFilterExpressionByPkObject(t),params:this.getFilterParamsFromPkObject(t,s)}};s.loadData(e)}getFirstDataUnitFromDOM(){let t=this._element.querySelector("snk-data-unit[data-load-by-pk]");if(t||(t=this._element.querySelector("snk-data-unit")),t)return t}getFilterParamsFromPkObject(t,s){var e;const i=[];for(const n in t.pk)t.pk.hasOwnProperty(n)&&!Array.isArray(t.pk[n])&&i.push({name:n,dataType:(null===(e=s.getField(n))||void 0===e?void 0:e.dataType)||this.getDefaultDataTypeLoadByPK(t.pk[n]),value:t.pk[n]});return i}getDefaultDataTypeLoadByPK(t){return"number"==typeof t||t instanceof Number?d.NUMBER:"boolean"==typeof t||t instanceof Boolean?d.BOOLEAN:t instanceof Date?d.DATE:d.TEXT}buildFilterExpressionByPkObject(t){let s="";for(const e in t.pk)r.isEmpty(s)||(s+=" AND "),Array.isArray(t.pk[e])?s+=`${e} IN (${t.pk[e].toString()})`:s+=`${e} = :${e}`;return s}async showNewVersionPopup(){const t=document.createElement("ez-modal-container"),s=await this.getAppLabel();t.modalTitle=this.getMessage("snkApplication.newVersionPopup.title",{screenName:s}),t.okButtonLabel=this.getMessage("snkApplication.newVersionPopup.okButton"),t.cancelButtonLabel=this.getMessage("snkApplication.newVersionPopup.cancelButton");const e=document.createElement("p");e.innerText=this.getMessage("snkApplication.newVersionPopup.info"),e.className="ez-text",t.appendChild(e),t.addEventListener("ezModalAction",this.newVersionPopupEventListener.bind(this));const i=await y.showPopup({content:t});this._removeVersionLayoutPopup=async()=>{await i(),await this.processPendingActions(this.NEW_VERSION_POPUP_LOCKER)}}async newVersionPopupEventListener(t){"LOAD"!==t.detail&&("OK"===t.detail&&F.setScreenToUseV3Layout(),"CANCEL"===t.detail&&F.setScreenToUseOldLayout(),this._popUp.opened=!1,this._removeVersionLayoutPopup&&await this._removeVersionLayoutPopup())}async handleShowNewVersionPopup(){this.hasToShowNewVersionPopup()&&await this.showNewVersionPopup()}hasToShowNewVersionPopup(){const t=new URLSearchParams(window.location.search).get("firstLoadConv");return t&&"S"===t}registerPkChangeListener(){window.hasOwnProperty("onhashchange")?window.onhashchange=this.pkChangeListener.bind(this):setInterval(this.pkChangeListener.bind(this),100)}componentWillLoad(){m.setContextValue("__SNK__APPLICATION__LOADING__",!0),this._errorHandler=new z(this),this.messagesBuilder=new C,m.setContextValue("__EZUI__UPLOAD__ADD__URL__",`${v.getUrlBase()}/mge/upload/file`),m.setContextValue("__EZUI__SEARCH__OPTION__LOADER__",((t,s,e)=>this.executeSearch(t,s,e))),m.setContextValue("__EZUI__GRID_LICENSE__",R),this.registerPkChangeListener(),w.init(),f.preload(this.applicationResourceID,this.configName),document.addEventListener("click",(()=>F.applicationClick()))}connectedCallback(){m.setContextValue("__SNK__APPLICATION__",this),g.addRequestListener(this._requestListener)}disconnectedCallback(){g.removeRequestListener(this._requestListener)}async componentDidLoad(){this.applicationLoading.emit(!0),window.requestAnimationFrame((()=>{m.setContextValue("__SNK__APPLICATION__LOADING__",!1),this.applicationLoaded.emit(!0),this.pkChangeListener()})),p.addIDInfo(this._element,`resource_${this.applicationResourceID}`),await this.handleShowNewVersionPopup()}render(){return e("div",null,e("ez-loading-bar",{ref:t=>this._requestListener.loadingBar=t}),e("ez-popup",{opened:!1,ref:t=>this._popUp=t,onEzClosePopup:()=>this.closePopUp()}),e("ez-modal",{opened:!1,ref:t=>this._rightModal=t,"modal-size":"small",closeOutsideClick:!0,closeEsc:!0}))}get _element(){return i(this)}};class x{constructor(){this._debounceTime=1e3,this._ignoredNameTypes=["totals"],this._countRequest=0}onRequestStart(t){this.isIgnoreLoadingOnRequest(t)||(this._countRequest++,this.loadingBar.show(),this._timerLoading&&clearTimeout(this._timerLoading))}onRequestEnd(t){this.isIgnoreLoadingOnRequest(t)||(this._countRequest--,this._timerLoading=setTimeout((()=>{this._countRequest<=0&&this.loadingBar.hide()}),this._debounceTime))}isIgnoreLoadingOnRequest(t){if(null==t)return!1;if(t.url.includes("quietMode=true"))return!0;if(null==t.requestBody)return!1;if(1==t.requestBody.length){const{name:s}=t.requestBody[0].variables;if(s){const t=s.split(":");return this._ignoredNameTypes.indexOf(t[0])>=0}}return!1}}class B{constructor(t,s){this.resolve=t,this.reject=s}}q.style=".sc-snk-application-h{display:flex;flex-direction:column;height:100%}";export{q as snk_application}
|
11
|
+
}`)}fetchTotals(t,s,e=[]){const i=`${t}_${s}`,n=this.cancel.findIndex((t=>t[i]));return n>=0&&(this.cancel[n][i](),this.cancel.splice(n,1)),Promise.race([new Promise((t=>this.cancel.push({[i]:t}))),this.getTotals(t,s,e)]).then((t=>{let s=new Map;if(t){s=t;const e=this.cancel.findIndex((t=>t[i]));e>=0&&this.cancel.splice(e,1)}return s}))}getTotals(t,s,e=[]){return new Promise(((i,n)=>{g.get().callGraphQL({query:this.templateByQuery.get("fetchTotals"),values:{name:`totals://${t}/${s}`,filters:e}}).then((t=>{if(t.length>0){const s=new Map;return t.forEach((t=>s.set(t.name,parseFloat(t.value)))),i(s)}return n("Não foi possível recuperar os totalizadores")})).catch(n)}))}}function U(){const t=["2909523kXwted","CompanyName=Sankhya Jiva Tecnologia e Inovao Ltda,LicensedApplication=Sankhya Gestao,LicenseType=SingleApplication,LicensedConcurrentDeveloperCount=2,LicensedProductionInstancesCount=0,AssetReference=AG-019460,ExpiryDate=9_November_2022_[v2]_MTY2Nzk1MjAwMDAwMA==10487151e296ee4360f80961ca960869","1131048CARoeW","502909mLEPmu","447255iQEXuN","428UHbJwW","270AFTxAV","194369jhGqTI","1540nWuTrj","2044062GicUQI","30CkXPWg"];return(U=function(){return t})()}const j=$;function $(t,s){const e=U();return($=function(t){return e[t-=392]})(t,s)}!function(){const t=$,s=U();for(;;)try{if(951926==-parseInt(t(398))/1+-parseInt(t(393))/2+parseInt(t(395))/3+-parseInt(t(400))/4*(parseInt(t(392))/5)+-parseInt(t(401))/6*(-parseInt(t(402))/7)+parseInt(t(397))/8+-parseInt(t(399))/9*(-parseInt(t(394))/10))break;s.push(s.shift())}catch(t){s.push(s.shift())}}();const R=j(396);var M;class F{static openAppActivity(t,s){var e;null===(e=window.workspace)||void 0===e||e.openAppActivity(t,s)}static getAppLabel(t){if(null!=(null===window||void 0===window?void 0:window.workspace))return null==window.workspace.getAppLabel&&(window.workspace.getAppLabel=t=>(t||"").split(".").pop()),window.workspace.getAppLabel(t)}static setScreenToUseV3Layout(){var t;null===(t=window.workspace)||void 0===t||t.setScreenToUseV3Layout()}static setScreenToUseOldLayout(){var t;null===(t=window.workspace)||void 0===t||t.setScreenToUseOldLayout()}static applicationClick(){var t,s;(null===(t=window.workspace)||void 0===t?void 0:t.applicationClick)&&(null===(s=window.workspace)||void 0===s||s.applicationClick())}}F.resourceID=null===(M=window.workspace)||void 0===M?void 0:M.resourceID;class z{constructor(t){this._app=t,window.addEventListener("error",(t=>this.errorHandler(t))),window.addEventListener("unhandledrejection",(t=>this.rejectionHandler(t)))}rejectionHandler(t){const s=t.reason;s instanceof o||(s?this.processException(s):this._app.isDebugMode().then((t=>{t&&this._app.error("Promise rejeitada","Erro interno: Uma promise foi rejeitada sem razão determinada.")})))}errorHandler(t){this.processException(t.error)}buildErrorCodeHTML(t){return'<br><a href="#" onclick="try{window.workspace.openHelp(\'_tbcode:'+t+"')} catch(e){alert('Não é possível abrir a ajuda fora do workspace Sankhya');}\">Código: "+t+"</a>"}processException(t){t.errorCode&&(t.message+=this.buildErrorCodeHTML(t.errorCode)),t instanceof o||t instanceof c?this._app.alert(t.title,t.message):t instanceof h?this._app.error(t.title,t.message):this._app.isDebugMode().then((s=>{if(s)if(t instanceof Error)this._app.error(t.name,t.message);else{const s=(null==t?void 0:t.title)||"Erro detectado",e="string"==typeof t?t:t.message||`Erro interno "${a.objectToString(t)}"`;this._app.error(s,e)}}))}}const q=class{constructor(e){t(this,e),this.applicationLoaded=s(this,"applicationLoaded",7),this.applicationLoading=s(this,"applicationLoading",7),this.NEW_VERSION_POPUP_LOCKER="NEW_VERSION_POPUP_LOCKER",this._authPromises=[],this._duCache=new Map,this._duPromises=new Map,this._requestListener=new x,this._pendingActions=new Map,this._isLoadedByPk=!1,this.messagesBuilder=void 0,this.configName=void 0,this.loadByPK=void 0}async processPendingActions(t){const s=this._pendingActions.get(t);s&&s.length&&(s.forEach((t=>t())),this._pendingActions.set(t,[]))}get parameters(){return this._parameters||(this._parameters=new b),this._parameters}async getAuth(t){return null==t?this.getApplicationAuth():new Promise(((s,e)=>{this.authFetcher.getData(t).then((t=>{s(t)})).catch((t=>{e(t)}))}))}async getApplicationAuth(){return this._auth?Promise.resolve(this._auth):new Promise(((t,s)=>{const e=this._authPromises.length>0;this._authPromises.push(new B(t,s)),e||this.authFetcher.getData(this.applicationResourceID).then((t=>{for(this._auth=t;this._authPromises.length>0;)this._authPromises.pop().resolve(this._auth)})).catch((t=>{for(;this._authPromises.length>0;)this._authPromises.pop().reject(t)}))}))}async isUserSup(){return new Promise(((t,s)=>{this.getAuth().then((e=>{this.getAuthList(e).then((s=>{t(s.isSup)})).catch((t=>s(t)))}))}))}async addPendingAction(t,s){var e;const i=null!==(e=this._pendingActions.get(t))&&void 0!==e?e:[];this._pendingActions.set(t,[...i,s])}async callServiceBroker(t,s,e){return g.get().callServiceBroker(t,s,e)}async initOnboarding(t){this.hasToShowNewVersionPopup()?await this.addPendingAction(this.NEW_VERSION_POPUP_LOCKER,(()=>this.doInitOnboarding(t))):this.doInitOnboarding(t)}doInitOnboarding(t){u.getInstance().init(t,window.envContext)}async hasAccess(t,s){return new Promise(((e,i)=>{this.getAuth(s).then((s=>{this.getAuthList(s).then((s=>{e(s.isSup||s.actions[t])})).catch((t=>i(t)))}))}))}async getAllAccess(t){return new Promise(((s,e)=>{this.getAuth(t).then((t=>{this.getAuthList(t).then((t=>{const e={};e.isSup=t.isSup,Object.entries(A).forEach((s=>{e[s[0]]=t.actions[s[1]]||!1})),s(e)})).catch((t=>e(t)))}))}))}async getStringParam(t){return this.parameters.asString(t)}async getIntParam(t){return this.parameters.asInteger(t)}async getFloatParam(t){return this.parameters.asFloat(t)}async getBooleanParam(t){return this.parameters.asBoolean(t)}async getDateParam(t){return this.parameters.asDate(t)}async showPopUp(t,s="full",e=!0){this.clearContent(this._popUp),this._popUp.appendChild(t),this._popUp.opened=!0,this._popUp.heightMode=s,this._popUp.useHeader=e,"EZ-MODAL-CONTAINER"===t.tagName&&(this._popUp.useHeader=!1)}async showModal(t){this.clearContent(this._rightModal),this._rightModal.appendChild(t),this._rightModal.opened=!0}showAlerts(t){return f.showAlerts({alerts:t})}async closeModal(){this.clearContent(this._rightModal),this._rightModal.opened=!1}async closePopUp(){this.clearContent(this._popUp),this._popUp.opened=!1,this._popUp.useHeader=!0,this._popUp.heightMode="full"}async temOpcional(t){const s=t.split(",");return new Promise(((t,e)=>{this.getAttributeFromHTMLWrapper("opc0009").then((i=>{"1"===i?t(!0):Promise.all(s.map((t=>this.getAttributeFromHTMLWrapper("opc"+t)))).then((s=>{t(s.includes("1"))})).catch((t=>{e(t)}))})).catch((t=>{e(t)}))}))}async getConfig(t){let s={serviceName:"SystemUtilsSP.getConf",requestBody:{config:{chave:t,tipo:"T"}}};return new Promise(((t,e)=>{g.get().callServiceBroker("SystemUtilsSP.getConf",JSON.stringify(s)).then((s=>{var e;return t(null===(e=s.config)||void 0===e?void 0:e.data)})).catch((t=>e(t)))}))}async saveConfig(t,s){let e={serviceName:"SystemUtilsSP.saveConf",requestBody:{config:{chave:t,tipo:"T",data:s}}};return new Promise(((t,s)=>{g.get().callServiceBroker("SystemUtilsSP.saveConf",JSON.stringify(e)).then((s=>t(s))).catch((t=>s(t)))}))}async getAttributeFromHTMLWrapper(t){return Promise.resolve(window[t])}async openApp(t,s){F.openAppActivity(t,s)}async webConnection(t,s,e){this.getStringParam(t).then((t=>{D.webConnectionCaller(t,s,e)}))}getDuPromissesStack(t){let s;return t&&(s=this._duPromises.get(t),s||(s=[],this._duPromises.set(t,s))),s||[]}async createDataunit(t,s,e,i,n){return null==n&&(n=this.applicationResourceID),new Promise(((r,a)=>{const o=this.getDuPromissesStack(s),c=o.length>0;if(o.push(new B(r,a)),!c){const r=this.dataUnitFetcher.getDataUnit(t,n,e,i);r.loadMetadata().then((()=>{for(s&&this.updateDataunitCache(void 0,s,r);o.length>0;)o.pop().resolve(r)})).catch((t=>{for(;o.length>0;)o.pop().reject(t)}))}}))}async updateDataunitCache(t,s,e){t&&this._duCache.delete(t),this._duCache.set(s,e)}async getDataUnit(t,s,e,i,n){return new Promise(((r,a)=>{const o=this._duCache.get(s);o?r(o):this.createDataunit(t,s,e,i,n).then((t=>{r(t)})).catch((t=>a(t)))}))}async addClientEvent(t,s){return new Promise((e=>{g.addClientEvent(t,s),e()}))}async removeClientEvent(t){return new Promise((s=>{g.removeClientEvent(t),s()}))}async hasClientEvent(t){return new Promise((s=>{s(g.hasClientEvent(t))}))}get applicationResourceID(){return this._applicationResourceID||(this._applicationResourceID=this.urlParams.get("workspaceResourceID")||this.urlParams.get("resourceID")||F.resourceID||"unknown.resource.id"),this._applicationResourceID}async getResourceID(){return Promise.resolve(this.applicationResourceID)}async getUserID(){return Promise.resolve(window.UID)}async alert(t,s,e,i){return f.alert(t,s,e,i)}async error(t,s,e,i){return f.error(t,s,e,i)}async success(t,s,e,i){return f.success(t,s,e,i)}async message(t,s,e,i){return f.message(t,s,e,i)}async confirm(t,s,e,i,n){return f.confirm(t,s,e,i,n)}async info(t,s){return f.info(t,s)}async loadTotals(t,s,e){return this.totalsFetcher.fetchTotals(t,s,e)}async isLoadedByPk(){return Promise.resolve(this._isLoadedByPk)}async getAuthList(t){return await(new L).parseFromJSON(t)}get urlParams(){return this._urlParams||(this._urlParams=v.getQueryParams(location.search)),this._urlParams}getMessage(t,s){var e;return null===(e=this.messagesBuilder)||void 0===e?void 0:e.getMessage(t,s)}get dataUnitFetcher(){return this._dataUnitFetcher||(this._dataUnitFetcher=new _),this._dataUnitFetcher}get totalsFetcher(){return this._totalsFetcher||(this._totalsFetcher=new O),this._totalsFetcher}get pesquisaFetcher(){return this._pesquisaFetcher||(this._pesquisaFetcher=new S),this._pesquisaFetcher}get authFetcher(){return this._authFetcher||(this._authFetcher=new I),this._authFetcher}async executeSearch(t,s,e){const i=null==e?void 0:e.getField(s);if(i){const{mode:s,argument:n}=t,{ENTITYNAME:r,CODEFIELD:a,DESCRIPTIONFIELD:o,ROOTENTITY:c,DESCRIPTIONENTITY:h}=i.properties,u=i.dependencies;let p;const m={rootEntity:c,descriptionFieldName:o,codeFieldName:a,showInactives:!1,dataUnitId:e.dataUnitId};return null==u||u.filter((t=>t.masterFields)).forEach((t=>{var s;t.type===l.SEARCHING&&(null===(s=t.masterFields)||void 0===s?void 0:s.length)>0&&(p={expression:t.expression,params:t.masterFields.map((t=>{const s=e.getField(t),i=(null==s?void 0:s.dataType)||d.TEXT,n=e.getFieldValue(t);if(null==n)throw this.alert("Erro ao pesquisar",`É necessario informar o campo ${s.label} para executar a pesquisa.`),new Error(`É necessario informar o campo ${s.label} para executar a pesquisa.`);return{name:t,value:n,dataType:i}}))})})),this.executePreparedSearch(s,n,{entity:r,entityDescription:h,criteria:p,searchOptions:m})}}async executePreparedSearch(t,s,e){const{entity:i,entityDescription:n,criteria:r,searchOptions:a}=e;return"ADVANCED"===t?new Promise((t=>{const e=document.createElement("snk-pesquisa");e[p.DATA_ELEMENT_ID_ATTRIBUTE_NAME]=`entity_${i}`,e.argument=s,e.searchLoader=t=>this.pesquisaFetcher.loadAdvancedSearch(i,t,r,a),e.selectItem=s=>{t(s),this.clearPopUpTitle(),this.closePopUp()},this.setPopUpTitle(n),this.showPopUp(e)})):this.pesquisaFetcher.loadSearchOptions(i,s,r,a)}async isDebugMode(){return new Promise((t=>{t(window.isDebugMode)}))}async getAppLabel(){return F.getAppLabel(this.applicationResourceID)}addSearchListener(t,s,e){return new Promise((i=>{i(this.pesquisaFetcher.addSearchListener(t,s.dataUnitId,e))}))}importScript(t){return new Promise((s=>{this.getApplicationPath().then((e=>{let i=[];Array.isArray(t)||(i=[t]),i.forEach((t=>{const s=document.createElement("script");s.src=`${e}/${t}`,s.async=!0,document.body.appendChild(s)})),s()}))}))}async getApplicationPath(){return new Promise((t=>{"dev"===window.applicationenv?t(""):t(`/${this.getModuleName()}/labsApps/${window.APPLICATION_NAME}/build`)}))}getModuleName(){return window.MGE_MODULE_NAME||"mgefin-bff"}executeSelectDistinct(t,s,e){return this.dataUnitFetcher.loadSelectDistinct(t,s,e)}getDataFetcher(){return Promise.resolve(g.get())}clearContent(t){t&&Array.from(t.children).forEach((s=>{t.removeChild(s)}))}clearPopUpTitle(){this._popUp.ezTitle=""}setPopUpTitle(t){this._popUp.ezTitle=t}async pkChangeListener(){const t=top.window.location.hash.split("/")[2];if(this._currentPkParameter===t)return;const s=this.getResourceIdFromToken(),e=v.getPkObjectFromUrlToken(top.window.location.hash);if(null==e||s!==this.applicationResourceID)return;const i={pk:e};if(this._isLoadedByPk=!0,this.loadByPK)return this.loadByPK(i),void(this._currentPkParameter=t);this.defaultLoadByPK(i,t)}getResourceIdFromToken(){return top.window.location.pathname.indexOf("tabContent.jsp")>-1?v.getResourceIdFromUrlToken(window.location.generateHash(window.location.hash)):v.getResourceIdFromUrlToken(top.window.location.hash)}defaultLoadByPK(t,s){if(!(null==t?void 0:t.pk))return;const e=this.getFirstDataUnitFromDOM(),i=e.dataUnit;if(!i)return console.warn("Dataunit não inicializado"),void e.addEventListener("dataUnitReady",(e=>{this.loadDataWithPKFilter(t,e.detail),this._currentPkParameter=s}));this.loadDataWithPKFilter(t,i),this._currentPkParameter=s}loadDataWithPKFilter(t,s){const e={term:"",filter:{name:"LOAD_BY_PK_FILTER",expression:this.buildFilterExpressionByPkObject(t),params:this.getFilterParamsFromPkObject(t,s)}};s.loadData(e)}getFirstDataUnitFromDOM(){let t=this._element.querySelector("snk-data-unit[data-load-by-pk]");if(t||(t=this._element.querySelector("snk-data-unit")),t)return t}getFilterParamsFromPkObject(t,s){var e;const i=[];for(const n in t.pk)t.pk.hasOwnProperty(n)&&!Array.isArray(t.pk[n])&&i.push({name:n,dataType:(null===(e=s.getField(n))||void 0===e?void 0:e.dataType)||this.getDefaultDataTypeLoadByPK(t.pk[n]),value:t.pk[n]});return i}getDefaultDataTypeLoadByPK(t){return"number"==typeof t||t instanceof Number?d.NUMBER:"boolean"==typeof t||t instanceof Boolean?d.BOOLEAN:t instanceof Date?d.DATE:d.TEXT}buildFilterExpressionByPkObject(t){let s="";for(const e in t.pk)r.isEmpty(s)||(s+=" AND "),Array.isArray(t.pk[e])?s+=`${e} IN (${t.pk[e].toString()})`:s+=`${e} = :${e}`;return s}async showNewVersionPopup(){const t=document.createElement("ez-modal-container"),s=await this.getAppLabel();t.modalTitle=this.getMessage("snkApplication.newVersionPopup.title",{screenName:s}),t.okButtonLabel=this.getMessage("snkApplication.newVersionPopup.okButton"),t.cancelButtonLabel=this.getMessage("snkApplication.newVersionPopup.cancelButton");const e=document.createElement("p");e.innerText=this.getMessage("snkApplication.newVersionPopup.info"),e.className="ez-text",t.appendChild(e),t.addEventListener("ezModalAction",this.newVersionPopupEventListener.bind(this));const i=await f.showPopup({content:t});this._removeVersionLayoutPopup=async()=>{await i(),await this.processPendingActions(this.NEW_VERSION_POPUP_LOCKER)}}async newVersionPopupEventListener(t){"LOAD"!==t.detail&&("OK"===t.detail&&F.setScreenToUseV3Layout(),"CANCEL"===t.detail&&F.setScreenToUseOldLayout(),this._popUp.opened=!1,this._removeVersionLayoutPopup&&await this._removeVersionLayoutPopup())}async handleShowNewVersionPopup(){this.hasToShowNewVersionPopup()&&await this.showNewVersionPopup()}hasToShowNewVersionPopup(){const t=new URLSearchParams(window.location.search).get("firstLoadConv");return t&&"S"===t}registerPkChangeListener(){window.hasOwnProperty("onhashchange")?window.onhashchange=this.pkChangeListener.bind(this):setInterval(this.pkChangeListener.bind(this),100)}componentWillLoad(){m.setContextValue("__SNK__APPLICATION__LOADING__",!0),this._errorHandler=new z(this),this.messagesBuilder=new C,m.setContextValue("__EZUI__UPLOAD__ADD__URL__",`${v.getUrlBase()}/mge/upload/file`),m.setContextValue("__EZUI__SEARCH__OPTION__LOADER__",((t,s,e)=>this.executeSearch(t,s,e))),m.setContextValue("__EZUI__GRID_LICENSE__",R),this.registerPkChangeListener(),w.init(),y.preload(this.applicationResourceID,this.configName),document.addEventListener("click",(()=>F.applicationClick()))}connectedCallback(){m.setContextValue("__SNK__APPLICATION__",this),g.addRequestListener(this._requestListener)}disconnectedCallback(){g.removeRequestListener(this._requestListener)}async componentDidLoad(){this.applicationLoading.emit(!0),window.requestAnimationFrame((()=>{m.setContextValue("__SNK__APPLICATION__LOADING__",!1),this.applicationLoaded.emit(!0),this.pkChangeListener()})),p.addIDInfo(this._element,`resource_${this.applicationResourceID}`),await this.handleShowNewVersionPopup()}render(){return e("div",null,e("ez-loading-bar",{ref:t=>this._requestListener.loadingBar=t}),e("ez-popup",{opened:!1,ref:t=>this._popUp=t,onEzClosePopup:()=>this.closePopUp()}),e("ez-modal",{opened:!1,ref:t=>this._rightModal=t,"modal-size":"small",closeOutsideClick:!0,closeEsc:!0}))}get _element(){return i(this)}};class x{constructor(){this._debounceTime=1e3,this._ignoredNameTypes=["totals"],this._countRequest=0}onRequestStart(t){this.isIgnoreLoadingOnRequest(t)||(this._countRequest++,this.loadingBar.show(),this._timerLoading&&clearTimeout(this._timerLoading))}onRequestEnd(t){this.isIgnoreLoadingOnRequest(t)||(this._countRequest--,this._timerLoading=setTimeout((()=>{this._countRequest<=0&&this.loadingBar.hide()}),this._debounceTime))}isIgnoreLoadingOnRequest(t){if(null==t)return!1;if(t.url.includes("quietMode=true"))return!0;if(null==t.requestBody)return!1;if(1==t.requestBody.length){const{name:s}=t.requestBody[0].variables;if(s){const t=s.split(":");return this._ignoredNameTypes.indexOf(t[0])>=0}}return!1}}class B{constructor(t,s){this.resolve=t,this.reject=s}}q.style=".sc-snk-application-h{display:flex;flex-direction:column;height:100%}";export{q as snk_application}
|
@@ -0,0 +1 @@
|
|
1
|
+
class t{constructor(t){this._canceled=!1,this.data=t}get type(){return this.constructor.type}get cancelable(){return this.constructor.cancelable}cancel(){this._canceled=!0}canceled(){return this._canceled}clone(t){return new this.constructor({...this.data,...t})}}t.type="event",t.cancelable=!1;class e{constructor(t){this.draggable=t}attach(){throw new Error("Not Implemented")}detach(){throw new Error("Not Implemented")}}const s={mouse:0,drag:0,touch:100};class i{constructor(t=[],e={}){this.containers=[...t],this.options={...e},this.dragging=!1,this.currentContainer=null,this.originalSource=null,this.startEvent=null,this.delay=function(t){const e={};if(void 0===t)return{...s};if("number"==typeof t){for(const i in s)Object.prototype.hasOwnProperty.call(s,i)&&(e[i]=t);return e}for(const i in s)Object.prototype.hasOwnProperty.call(s,i)&&(e[i]=void 0===t[i]?s[i]:t[i]);return e}(e.delay)}attach(){return this}detach(){return this}addContainer(...t){this.containers=[...this.containers,...t]}removeContainer(...t){this.containers=this.containers.filter((e=>!t.includes(e)))}trigger(t,e){const s=document.createEvent("Event");return s.detail=e,s.initEvent(e.type,!0,!0),t.dispatchEvent(s),this.lastEvent=e,e}}function r(t,e){if(null==t)return null;let s=t;do{if(s=s.correspondingUseElement||s.correspondingElement||s,null!=(i=s)&&null!=e&&(function(t){return Boolean("string"==typeof t)}(e)?Element.prototype.matches.call(i,e):function(t){return Boolean(t instanceof NodeList||t instanceof Array)}(e)?[...e].includes(i):function(t){return Boolean(t instanceof Node)}(e)?e===i:function(t){return Boolean("function"==typeof t)}(e)&&e(i)))return s;s=s?.parentNode||null}while(null!=s&&s!==document.body&&s!==document);var i;return null}function n(t,e,s,i){return Math.sqrt((s-t)**2+(i-e)**2)}class o extends t{get originalEvent(){return this.data.originalEvent}get clientX(){return this.data.clientX}get clientY(){return this.data.clientY}get target(){return this.data.target}get container(){return this.data.container}get originalSource(){return this.data.originalSource}get pressure(){return this.data.pressure}}class h extends o{}h.type="drag:start";class a extends o{}a.type="drag:move";class c extends o{}c.type="drag:stop";const u=Symbol("onContextMenuWhileDragging"),l=Symbol("onMouseDown"),d=Symbol("onMouseMove"),g=Symbol("onMouseUp"),m=Symbol("startDrag"),f=Symbol("onDistanceChange");function v(t){t.preventDefault()}function p(t){const{touches:e,changedTouches:s}=t;return e&&e[0]||s&&s[0]}const b=Symbol("onTouchStart"),w=Symbol("onTouchEnd"),y=Symbol("onTouchMove"),x=Symbol("startDrag"),S=Symbol("onDistanceChange");let C=!1;function E(t){t.preventDefault(),t.stopPropagation()}function M(t,e){return function(s){(function(t){if(t.v)throw new Error("attempted to call addInitializer after decoration was finished")})(e),O(s,"An initializer"),t.push(s)}}function D(t,e){if(!t(e))throw new TypeError("Attempted to access private element on non-instance")}function T(t,e,s,i,r,n,o,h,a,c,u){var l;switch(n){case 1:l="accessor";break;case 2:l="method";break;case 3:l="getter";break;case 4:l="setter";break;default:l="field"}var d,g,m={kind:l,name:h?"#"+s:s,static:o,private:h,metadata:u},f={v:!1};if(0!==n&&(m.addInitializer=M(r,f)),h||0!==n&&2!==n)if(2===n)d=function(t){return D(c,t),i.value};else{var v=0===n||1===n;(v||3===n)&&(d=h?function(t){return D(c,t),i.get.call(t)}:function(t){return i.get.call(t)}),(v||4===n)&&(g=h?function(t,e){D(c,t),i.set.call(t,e)}:function(t,e){i.set.call(t,e)})}else d=function(t){return t[s]},0===n&&(g=function(t,e){t[s]=e});var p=h?c.bind():function(t){return s in t};m.access=d&&g?{get:d,set:g,has:p}:d?{get:d,has:p}:{set:g,has:p};try{return t.call(e,a,m)}finally{f.v=!0}}function O(t,e){if("function"!=typeof t)throw new TypeError(e+" must be a function")}function X(t,e){var s=typeof e;if(1===t){if("object"!==s||null===e)throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");void 0!==e.get&&O(e.get,"accessor.get"),void 0!==e.set&&O(e.set,"accessor.set"),void 0!==e.init&&O(e.init,"accessor.init")}else if("function"!==s)throw new TypeError((0===t?"field":5===t?"class":"method")+" decorators must return a function or void 0")}function Y(t){return function(){return t(this)}}function A(t){return function(e){t(this,e)}}function F(t,e,s,i,r,n,o,h,a,c,u){var l,d,g,m,f=s[0];i||Array.isArray(f)||(f=[f]),h?l=0===n||1===n?{get:Y(s[3]),set:A(s[4])}:3===n?{get:s[3]}:4===n?{set:s[3]}:{value:s[3]}:0!==n&&(l=Object.getOwnPropertyDescriptor(e,r)),1===n?g={get:l.get,set:l.set}:2===n?g=l.value:3===n?g=l.get:4===n&&(g=l.set);for(var v=i?2:1,p=f.length-1;p>=0;p-=v){var b;void 0!==(m=T(f[p],i?f[p-1]:void 0,r,l,a,n,o,h,g,c,u))&&(X(n,m),0===n?b=m:1===n?(b=m.init,g={get:m.get||g.get,set:m.set||g.set}):g=m,void 0!==b&&(void 0===d?d=b:"function"==typeof d?d=[d,b]:d.push(b)))}if(0===n||1===n){if(void 0===d)d=function(t,e){return e};else if("function"!=typeof d){var w=d;d=function(t,e){for(var s=e,i=w.length-1;i>=0;i--)s=w[i].call(t,s);return s}}else{var y=d;d=function(t,e){return y.call(t,e)}}t.push(d)}0!==n&&(1===n?(l.get=g.get,l.set=g.set):2===n?l.value=g:3===n?l.get=g:4===n&&(l.set=g),h?1===n?(t.push((function(t,e){return g.get.call(t,e)})),t.push((function(t,e){return g.set.call(t,e)}))):t.push(2===n?g:function(t,e){return g.call(t,e)}):Object.defineProperty(e,r,l))}function I(t,e,s,i){for(var r,n,o,h=[],a=new Map,c=new Map,u=0;u<e.length;u++){var l=e[u];if(Array.isArray(l)){var d,g,m=l[1],f=l[2],v=l.length>3,p=16&m,b=!!(8&m),w=s;if(m&=7,b?(d=t,0!==m&&(g=n=n||[]),v&&!o&&(o=function(e){return P(e)===t}),w=o):(d=t.prototype,0!==m&&(g=r=r||[])),0!==m&&!v){var y=b?c:a,x=y.get(f)||0;if(!0===x||3===x&&4!==m||4===x&&3!==m)throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+f);y.set(f,!(!x&&m>2)||m)}F(h,d,l,p,f,m,b,v,g,w,i)}}return $(h,r),$(h,n),h}function $(t,e){e&&t.push((function(t){for(var s=0;s<e.length;s++)e[s].call(t);return t}))}function j(t,e,s,i){if(e.length){for(var r=[],n=t,o=t.name,h=s?2:1,a=e.length-1;a>=0;a-=h){var c={v:!1};try{var u=e[a].call(s?e[a-1]:void 0,n,{kind:"class",name:o,addInitializer:M(r,c),metadata:i})}finally{c.v=!0}void 0!==u&&(X(5,u),n=u)}return[q(n,i),function(){for(var t=0;t<r.length;t++)r[t].call(n)}]}}function q(t,e){return Object.defineProperty(t,Symbol.metadata||Symbol.for("Symbol.metadata"),{configurable:!0,enumerable:!0,value:e})}function z(t,e,s,i,r,n){if(arguments.length>=6)var o=n[Symbol.metadata||Symbol.for("Symbol.metadata")];var h=Object.create(void 0===o?null:o),a=I(t,e,r,h);return s.length||q(t,h),{e:a,get c(){return j(t,s,i,h)}}}function P(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(null!==t?typeof t:"null"));return t}function N(t,{name:e,addInitializer:s}){s((function(){this[e]=t.bind(this)}))}window.addEventListener("touchmove",(t=>{C&&t.preventDefault()}),{passive:!1});class B extends t{constructor(t){super(t),this.data=t}get source(){return this.data.source}get originalSource(){return this.data.originalSource}get mirror(){return this.data.mirror}get sourceContainer(){return this.data.sourceContainer}get sensorEvent(){return this.data.sensorEvent}get originalEvent(){return this.sensorEvent?this.sensorEvent.originalEvent:null}}B.type="drag";class L extends B{}L.type="drag:start",L.cancelable=!0;class k extends B{}k.type="drag:move";class H extends B{get overContainer(){return this.data.overContainer}get over(){return this.data.over}}H.type="drag:over",H.cancelable=!0;class R extends B{get overContainer(){return this.data.overContainer}get over(){return this.data.over}}R.type="drag:out";class W extends B{get overContainer(){return this.data.overContainer}}W.type="drag:over:container";class U extends B{get overContainer(){return this.data.overContainer}}U.type="drag:out:container";class G extends B{get pressure(){return this.data.pressure}}G.type="drag:pressure";class J extends B{}J.type="drag:stop",J.cancelable=!0;class K extends B{}var Q,V,Z,_;K.type="drag:stopped",V=class extends e{constructor(t){Q(super(t)),this.lastWidth=0,this.lastHeight=0,this.mirror=null}attach(){this.draggable.on("mirror:created",this.onMirrorCreated).on("drag:over",this.onDragOver).on("drag:over:container",this.onDragOver)}detach(){this.draggable.off("mirror:created",this.onMirrorCreated).off("mirror:destroy",this.onMirrorDestroy).off("drag:over",this.onDragOver).off("drag:over:container",this.onDragOver)}getOptions(){return this.draggable.options.resizeMirror||{}}onMirrorCreated({mirror:t}){this.mirror=t}onMirrorDestroy(){this.mirror=null}onDragOver(t){this.resize(t)}resize(t){requestAnimationFrame((()=>{let e=null;const{overContainer:s}=t;if(null==this.mirror||null==this.mirror.parentNode)return;this.mirror.parentNode!==s&&s.appendChild(this.mirror),t.type===H.type&&(e=t.over);const i=e||this.draggable.getDraggableElementsForContainer(s)[0];var r;i&&(r=()=>{const t=i.getBoundingClientRect();null==this.mirror||this.lastHeight===t.height&&this.lastWidth===t.width||(this.mirror.style.width=`${t.width}px`,this.mirror.style.height=`${t.height}px`,this.lastWidth=t.width,this.lastHeight=t.height)},requestAnimationFrame((()=>{requestAnimationFrame(r)})))}))}},[Q]=z(V,[[N,2,"onMirrorCreated"],[N,2,"onMirrorDestroy"],[N,2,"onDragOver"]],[],0,void 0,e).e;const tt={duration:150,easingFunction:"ease-in-out",horizontal:!1};function et(t,e,{duration:s,easingFunction:i,horizontal:r}){for(const s of[t,e])s.style.pointerEvents="none";if(r){const s=t.offsetWidth;t.style.transform=`translate3d(${s}px, 0, 0)`,e.style.transform=`translate3d(-${s}px, 0, 0)`}else{const s=t.offsetHeight;t.style.transform=`translate3d(0, ${s}px, 0)`,e.style.transform=`translate3d(0, -${s}px, 0)`}requestAnimationFrame((()=>{for(const r of[t,e])r.addEventListener("transitionend",st),r.style.transition=`transform ${s}ms ${i}`,r.style.transform=""}))}function st(t){null!=t.target&&Boolean("style"in t.target)&&(t.target.style.transition="",t.target.style.pointerEvents="",t.target.removeEventListener("transitionend",st))}_=class extends e{constructor(t){Z(super(t)),this.options={...tt,...this.getOptions()},this.lastAnimationFrame=null}attach(){this.draggable.on("sortable:sorted",this.onSortableSorted)}detach(){this.draggable.off("sortable:sorted",this.onSortableSorted)}getOptions(){return this.draggable.options.swapAnimation||{}}onSortableSorted({oldIndex:t,newIndex:e,dragEvent:s}){const{source:i,over:r}=s;this.lastAnimationFrame&&cancelAnimationFrame(this.lastAnimationFrame),this.lastAnimationFrame=requestAnimationFrame((()=>{t>=e?et(i,r,this.options):et(r,i,this.options)}))}},[Z]=z(_,[[N,2,"onSortableSorted"]],[],0,void 0,e).e;const it=Symbol("onInitialize"),rt=Symbol("onDestroy"),nt=Symbol("announceEvent"),ot=Symbol("announceMessage"),ht={expire:7e3},at=function(){const t=document.createElement("div");return t.setAttribute("id","draggable-live-region"),t.setAttribute("aria-relevant","additions"),t.setAttribute("aria-atomic","true"),t.setAttribute("aria-live","assertive"),t.setAttribute("role","log"),t.style.position="fixed",t.style.width="1px",t.style.height="1px",t.style.top="-1px",t.style.overflow="hidden",t}();document.addEventListener("DOMContentLoaded",(()=>{document.body.appendChild(at)}));const ct=Symbol("onInitialize"),ut=Symbol("onDestroy"),lt={},dt=[];class gt extends t{constructor(t){super(t),this.data=t}get source(){return this.data.source}get originalSource(){return this.data.originalSource}get sourceContainer(){return this.data.sourceContainer}get sensorEvent(){return this.data.sensorEvent}get dragEvent(){return this.data.dragEvent}get originalEvent(){return this.sensorEvent?this.sensorEvent.originalEvent:null}}class mt extends gt{}mt.type="mirror:create";class ft extends gt{get mirror(){return this.data.mirror}}ft.type="mirror:created";class vt extends gt{get mirror(){return this.data.mirror}}vt.type="mirror:attached";class pt extends gt{get mirror(){return this.data.mirror}get passedThreshX(){return this.data.passedThreshX}get passedThreshY(){return this.data.passedThreshY}}pt.type="mirror:move",pt.cancelable=!0;class bt extends gt{get mirror(){return this.data.mirror}get passedThreshX(){return this.data.passedThreshX}get passedThreshY(){return this.data.passedThreshY}}bt.type="mirror:moved";class wt extends gt{get mirror(){return this.data.mirror}}wt.type="mirror:destroy",wt.cancelable=!0;const yt=Symbol("onDragStart"),xt=Symbol("onDragMove"),St=Symbol("onDragStop"),Ct=Symbol("onMirrorCreated"),Et=Symbol("onMirrorMove"),Mt=Symbol("onScroll"),Dt=Symbol("getAppendableContainer"),Tt={constrainDimensions:!1,xAxis:!0,yAxis:!0,cursorOffsetX:null,cursorOffsetY:null,thresholdX:null,thresholdY:null};function Ot({source:t,...e}){return $t((s=>{const i=t.getBoundingClientRect();s({source:t,sourceRect:i,...e})}))}function Xt({sensorEvent:t,sourceRect:e,options:s,...i}){return $t((r=>{r({sensorEvent:t,sourceRect:e,mirrorOffset:{top:null===s.cursorOffsetY?t.clientY-e.top:s.cursorOffsetY,left:null===s.cursorOffsetX?t.clientX-e.left:s.cursorOffsetX},options:s,...i})}))}function Yt({mirror:t,source:e,options:s,...i}){return $t((r=>{let n,o;if(s.constrainDimensions){const t=getComputedStyle(e);n=t.getPropertyValue("height"),o=t.getPropertyValue("width")}t.style.display=null,t.style.position="fixed",t.style.pointerEvents="none",t.style.top=0,t.style.left=0,t.style.margin=0,s.constrainDimensions&&(t.style.height=n,t.style.width=o),r({mirror:t,source:e,options:s,...i})}))}function At({mirror:t,mirrorClasses:e,...s}){return $t((i=>{t.classList.add(...e),i({mirror:t,mirrorClasses:e,...s})}))}function Ft({mirror:t,...e}){return $t((s=>{t.removeAttribute("id"),delete t.id,s({mirror:t,...e})}))}function It({withFrame:t=!1,initial:e=!1}={}){return({mirror:s,sensorEvent:i,mirrorOffset:r,initialY:n,initialX:o,scrollOffset:h,options:a,passedThreshX:c,passedThreshY:u,lastMovedX:l,lastMovedY:d,...g})=>$t((t=>{const m={mirror:s,sensorEvent:i,mirrorOffset:r,options:a,...g};if(r){const t=c?Math.round((i.clientX-r.left-h.x)/(a.thresholdX||1))*(a.thresholdX||1):Math.round(l),g=u?Math.round((i.clientY-r.top-h.y)/(a.thresholdY||1))*(a.thresholdY||1):Math.round(d);a.xAxis&&a.yAxis||e?s.style.transform=`translate3d(${t}px, ${g}px, 0)`:a.xAxis&&!a.yAxis?s.style.transform=`translate3d(${t}px, ${n}px, 0)`:a.yAxis&&!a.xAxis&&(s.style.transform=`translate3d(${o}px, ${g}px, 0)`),e&&(m.initialX=t,m.initialY=g),m.lastMovedX=t,m.lastMovedY=g}t(m)}),{frame:t})}function $t(t,{raf:e=!1}={}){return new Promise(((s,i)=>{e?requestAnimationFrame((()=>{t(s,i)})):t(s,i)}))}const jt=Symbol("onDragStart"),qt=Symbol("onDragMove"),zt=Symbol("onDragStop"),Pt=Symbol("scroll"),Nt={speed:6,sensitivity:50,scrollableElements:[]};function Bt(){return document.scrollingElement||document.documentElement}class Lt{constructor(){this.callbacks={}}on(t,...e){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(...e),this}off(t,e){if(!this.callbacks[t])return null;const s=this.callbacks[t].slice(0);for(let i=0;i<s.length;i++)e===s[i]&&this.callbacks[t].splice(i,1);return this}trigger(t){if(!this.callbacks[t.type])return null;const e=[...this.callbacks[t.type]],s=[];for(let i=e.length-1;i>=0;i--){const r=e[i];try{r(t)}catch(t){s.push(t)}}return s.length&&console.error(`Draggable caught errors while triggering '${t.type}'`,s),this}}class kt extends t{get draggable(){return this.data.draggable}}kt.type="draggable";class Ht extends kt{}Ht.type="draggable:initialize";class Rt extends kt{}Rt.type="draggable:destroy";const Wt=Symbol("onDragStart"),Ut=Symbol("onDragMove"),Gt=Symbol("onDragStop"),Jt=Symbol("onDragPressure"),Kt=Symbol("dragStop"),Qt={"drag:start":t=>`Picked up ${t.source.textContent.trim()||t.source.id||"draggable element"}`,"drag:stop":t=>`Released ${t.source.textContent.trim()||t.source.id||"draggable element"}`},Vt={"container:dragging":"draggable-container--is-dragging","source:dragging":"draggable-source--is-dragging","source:placed":"draggable-source--placed","container:placed":"draggable-container--placed","body:dragging":"draggable--is-dragging","draggable:over":"draggable--over","container:over":"draggable-container--over","source:original":"draggable--original",mirror:"draggable-mirror"},Zt={draggable:".draggable-source",handle:null,delay:{},distance:0,placedTimeout:800,plugins:[],sensors:[],exclude:{plugins:[],sensors:[]}};class _t{constructor(t=[document.body],e={}){if(t instanceof NodeList||t instanceof Array)this.containers=[...t];else{if(!(t instanceof HTMLElement))throw new Error("Draggable containers are expected to be of type `NodeList`, `HTMLElement[]` or `HTMLElement`");this.containers=[t]}this.options={...Zt,...e,classes:{...Vt,...e.classes||{}},announcements:{...Qt,...e.announcements||{}},exclude:{plugins:e.exclude&&e.exclude.plugins||[],sensors:e.exclude&&e.exclude.sensors||[]}},this.emitter=new Lt,this.dragging=!1,this.plugins=[],this.sensors=[],this[Wt]=this[Wt].bind(this),this[Ut]=this[Ut].bind(this),this[Gt]=this[Gt].bind(this),this[Jt]=this[Jt].bind(this),this[Kt]=this[Kt].bind(this),document.addEventListener("drag:start",this[Wt],!0),document.addEventListener("drag:move",this[Ut],!0),document.addEventListener("drag:stop",this[Gt],!0),document.addEventListener("drag:pressure",this[Jt],!0);const s=Object.values(_t.Plugins).filter((t=>!this.options.exclude.plugins.includes(t))),i=Object.values(_t.Sensors).filter((t=>!this.options.exclude.sensors.includes(t)));this.addPlugin(...s,...this.options.plugins),this.addSensor(...i,...this.options.sensors);const r=new Ht({draggable:this});this.on("mirror:created",(({mirror:t})=>this.mirror=t)),this.on("mirror:destroy",(()=>this.mirror=null)),this.trigger(r)}destroy(){document.removeEventListener("drag:start",this[Wt],!0),document.removeEventListener("drag:move",this[Ut],!0),document.removeEventListener("drag:stop",this[Gt],!0),document.removeEventListener("drag:pressure",this[Jt],!0);const t=new Rt({draggable:this});this.trigger(t),this.removePlugin(...this.plugins.map((t=>t.constructor))),this.removeSensor(...this.sensors.map((t=>t.constructor)))}addPlugin(...t){const e=t.map((t=>new t(this)));return e.forEach((t=>t.attach())),this.plugins=[...this.plugins,...e],this}removePlugin(...t){return this.plugins.filter((e=>t.includes(e.constructor))).forEach((t=>t.detach())),this.plugins=this.plugins.filter((e=>!t.includes(e.constructor))),this}addSensor(...t){const e=t.map((t=>new t(this.containers,this.options)));return e.forEach((t=>t.attach())),this.sensors=[...this.sensors,...e],this}removeSensor(...t){return this.sensors.filter((e=>t.includes(e.constructor))).forEach((t=>t.detach())),this.sensors=this.sensors.filter((e=>!t.includes(e.constructor))),this}addContainer(...t){return this.containers=[...this.containers,...t],this.sensors.forEach((e=>e.addContainer(...t))),this}removeContainer(...t){return this.containers=this.containers.filter((e=>!t.includes(e))),this.sensors.forEach((e=>e.removeContainer(...t))),this}on(t,...e){return this.emitter.on(t,...e),this}off(t,e){return this.emitter.off(t,e),this}trigger(t){return this.emitter.trigger(t),this}getClassNameFor(t){return this.getClassNamesFor(t)[0]}getClassNamesFor(t){const e=this.options.classes[t];return e instanceof Array?e:"string"==typeof e||e instanceof String?[e]:[]}isDragging(){return Boolean(this.dragging)}getDraggableElements(){return this.containers.reduce(((t,e)=>[...t,...this.getDraggableElementsForContainer(e)]),[])}getDraggableElementsForContainer(t){return[...t.querySelectorAll(this.options.draggable)].filter((t=>t!==this.originalSource&&t!==this.mirror))}cancel(){this[Kt]()}[Wt](t){const e=te(t),{target:s,container:i,originalSource:n}=e;if(!this.containers.includes(i))return;if(this.options.handle&&s&&!r(s,this.options.handle))return void e.cancel();this.originalSource=n,this.sourceContainer=i,this.lastPlacedSource&&this.lastPlacedContainer&&(clearTimeout(this.placedTimeoutID),this.lastPlacedSource.classList.remove(...this.getClassNamesFor("source:placed")),this.lastPlacedContainer.classList.remove(...this.getClassNamesFor("container:placed"))),this.source=this.originalSource.cloneNode(!0),this.originalSource.parentNode.insertBefore(this.source,this.originalSource),this.originalSource.style.display="none";const o=new L({source:this.source,originalSource:this.originalSource,sourceContainer:i,sensorEvent:e});if(this.trigger(o),this.dragging=!o.canceled(),o.canceled())return this.source.remove(),void(this.originalSource.style.display=null);this.originalSource.classList.add(...this.getClassNamesFor("source:original")),this.source.classList.add(...this.getClassNamesFor("source:dragging")),this.sourceContainer.classList.add(...this.getClassNamesFor("container:dragging")),document.body.classList.add(...this.getClassNamesFor("body:dragging")),ee(document.body,"none"),requestAnimationFrame((()=>{const e=te(t).clone({target:this.source});this[Ut]({...t,detail:e})}))}[Ut](t){if(!this.dragging)return;const e=te(t),{container:s}=e;let i=e.target;const n=new k({source:this.source,originalSource:this.originalSource,sourceContainer:s,sensorEvent:e});this.trigger(n),n.canceled()&&e.cancel(),i=r(i,this.options.draggable);const o=r(e.target,this.containers),h=e.overContainer||o,a=this.currentOverContainer&&h!==this.currentOverContainer,c=h&&this.currentOverContainer!==h,u=o&&i&&this.currentOver!==i;if(this.currentOver&&i!==this.currentOver){const t=new R({source:this.source,originalSource:this.originalSource,sourceContainer:s,sensorEvent:e,over:this.currentOver,overContainer:this.currentOverContainer});this.currentOver.classList.remove(...this.getClassNamesFor("draggable:over")),this.currentOver=null,this.trigger(t)}if(a){const t=new U({source:this.source,originalSource:this.originalSource,sourceContainer:s,sensorEvent:e,overContainer:this.currentOverContainer});this.currentOverContainer.classList.remove(...this.getClassNamesFor("container:over")),this.currentOverContainer=null,this.trigger(t)}if(c){h.classList.add(...this.getClassNamesFor("container:over"));const t=new W({source:this.source,originalSource:this.originalSource,sourceContainer:s,sensorEvent:e,overContainer:h});this.currentOverContainer=h,this.trigger(t)}if(u){i.classList.add(...this.getClassNamesFor("draggable:over"));const t=new H({source:this.source,originalSource:this.originalSource,sourceContainer:s,sensorEvent:e,overContainer:h,over:i});this.currentOver=i,this.trigger(t)}}[Kt](t){if(!this.dragging)return;this.dragging=!1;const e=new J({source:this.source,originalSource:this.originalSource,sensorEvent:t?t.sensorEvent:null,sourceContainer:this.sourceContainer});this.trigger(e),e.canceled()||this.source.parentNode.insertBefore(this.originalSource,this.source),this.source.remove(),this.originalSource.style.display="",this.source.classList.remove(...this.getClassNamesFor("source:dragging")),this.originalSource.classList.remove(...this.getClassNamesFor("source:original")),this.originalSource.classList.add(...this.getClassNamesFor("source:placed")),this.sourceContainer.classList.add(...this.getClassNamesFor("container:placed")),this.sourceContainer.classList.remove(...this.getClassNamesFor("container:dragging")),document.body.classList.remove(...this.getClassNamesFor("body:dragging")),ee(document.body,""),this.currentOver&&this.currentOver.classList.remove(...this.getClassNamesFor("draggable:over")),this.currentOverContainer&&this.currentOverContainer.classList.remove(...this.getClassNamesFor("container:over")),this.lastPlacedSource=this.originalSource,this.lastPlacedContainer=this.sourceContainer,this.placedTimeoutID=setTimeout((()=>{this.lastPlacedSource&&this.lastPlacedSource.classList.remove(...this.getClassNamesFor("source:placed")),this.lastPlacedContainer&&this.lastPlacedContainer.classList.remove(...this.getClassNamesFor("container:placed")),this.lastPlacedSource=null,this.lastPlacedContainer=null}),this.options.placedTimeout);const s=new K({source:this.source,originalSource:this.originalSource,sensorEvent:t?t.sensorEvent:null,sourceContainer:this.sourceContainer});this.trigger(s),this.source=null,this.originalSource=null,this.currentOverContainer=null,this.currentOver=null,this.sourceContainer=null}[Gt](t){this[Kt](t)}[Jt](t){if(!this.dragging)return;const e=te(t),s=this.source||r(e.originalEvent.target,this.options.draggable),i=new G({sensorEvent:e,source:s,pressure:e.pressure});this.trigger(i)}}function te(t){return t.detail}function ee(t,e){t.style.webkitUserSelect=e,t.style.mozUserSelect=e,t.style.msUserSelect=e,t.style.oUserSelect=e,t.style.userSelect=e}_t.Plugins={Announcement:class extends e{constructor(t){super(t),this.options={...ht,...this.getOptions()},this.originalTriggerMethod=this.draggable.trigger,this[it]=this[it].bind(this),this[rt]=this[rt].bind(this)}attach(){this.draggable.on("draggable:initialize",this[it])}detach(){this.draggable.off("draggable:destroy",this[rt])}getOptions(){return this.draggable.options.announcements||{}}[nt](t){const e=this.options[t.type];e&&"string"==typeof e&&this[ot](e),e&&"function"==typeof e&&this[ot](e(t))}[ot](t){!function(t,{expire:e}){const s=document.createElement("div");s.textContent=t,at.appendChild(s),setTimeout((()=>{at.removeChild(s)}),e)}(t,{expire:this.options.expire})}[it](){this.draggable.trigger=t=>{try{this[nt](t)}finally{this.originalTriggerMethod.call(this.draggable,t)}}}[rt](){this.draggable.trigger=this.originalTriggerMethod}},Focusable:class extends e{constructor(t){super(t),this.options={...lt,...this.getOptions()},this[ct]=this[ct].bind(this),this[ut]=this[ut].bind(this)}attach(){this.draggable.on("draggable:initialize",this[ct]).on("draggable:destroy",this[ut])}detach(){this.draggable.off("draggable:initialize",this[ct]).off("draggable:destroy",this[ut]),this[ut]()}getOptions(){return this.draggable.options.focusable||{}}getElements(){return[...this.draggable.containers,...this.draggable.getDraggableElements()]}[ct](){requestAnimationFrame((()=>{this.getElements().forEach((t=>function(t){Boolean(!t.getAttribute("tabindex")&&-1===t.tabIndex)&&(dt.push(t),t.tabIndex=0)}(t)))}))}[ut](){requestAnimationFrame((()=>{this.getElements().forEach((t=>function(t){const e=dt.indexOf(t);-1!==e&&(t.tabIndex=-1,dt.splice(e,1))}(t)))}))}},Mirror:class extends e{constructor(t){super(t),this.options={...Tt,...this.getOptions()},this.scrollOffset={x:0,y:0},this.initialScrollOffset={x:window.scrollX,y:window.scrollY},this[yt]=this[yt].bind(this),this[xt]=this[xt].bind(this),this[St]=this[St].bind(this),this[Ct]=this[Ct].bind(this),this[Et]=this[Et].bind(this),this[Mt]=this[Mt].bind(this)}attach(){this.draggable.on("drag:start",this[yt]).on("drag:move",this[xt]).on("drag:stop",this[St]).on("mirror:created",this[Ct]).on("mirror:move",this[Et])}detach(){this.draggable.off("drag:start",this[yt]).off("drag:move",this[xt]).off("drag:stop",this[St]).off("mirror:created",this[Ct]).off("mirror:move",this[Et])}getOptions(){return this.draggable.options.mirror||{}}[yt](t){if(t.canceled())return;"ontouchstart"in window&&document.addEventListener("scroll",this[Mt],!0),this.initialScrollOffset={x:window.scrollX,y:window.scrollY};const{source:e,originalSource:s,sourceContainer:i,sensorEvent:r}=t;this.lastMirrorMovedClient={x:r.clientX,y:r.clientY};const n=new mt({source:e,originalSource:s,sourceContainer:i,sensorEvent:r,dragEvent:t});if(this.draggable.trigger(n),function(t){return/^drag/.test(t.originalEvent.type)}(r)||n.canceled())return;const o=this[Dt](e)||i;this.mirror=e.cloneNode(!0);const h=new ft({source:e,originalSource:s,sourceContainer:i,sensorEvent:r,dragEvent:t,mirror:this.mirror}),a=new vt({source:e,originalSource:s,sourceContainer:i,sensorEvent:r,dragEvent:t,mirror:this.mirror});this.draggable.trigger(h),o.appendChild(this.mirror),this.draggable.trigger(a)}[xt](t){if(!this.mirror||t.canceled())return;const{source:e,originalSource:s,sourceContainer:i,sensorEvent:r}=t;let n=!0,o=!0;if(this.options.thresholdX||this.options.thresholdY){const{x:t,y:e}=this.lastMirrorMovedClient;if(Math.abs(t-r.clientX)<this.options.thresholdX?n=!1:this.lastMirrorMovedClient.x=r.clientX,Math.abs(e-r.clientY)<this.options.thresholdY?o=!1:this.lastMirrorMovedClient.y=r.clientY,!n&&!o)return}const h=new pt({source:e,originalSource:s,sourceContainer:i,sensorEvent:r,dragEvent:t,mirror:this.mirror,passedThreshX:n,passedThreshY:o});this.draggable.trigger(h)}[St](t){if("ontouchstart"in window&&document.removeEventListener("scroll",this[Mt],!0),this.initialScrollOffset={x:0,y:0},this.scrollOffset={x:0,y:0},!this.mirror)return;const{source:e,sourceContainer:s,sensorEvent:i}=t,r=new wt({source:e,mirror:this.mirror,sourceContainer:s,sensorEvent:i,dragEvent:t});this.draggable.trigger(r),r.canceled()||this.mirror.remove()}[Mt](){this.scrollOffset={x:window.scrollX-this.initialScrollOffset.x,y:window.scrollY-this.initialScrollOffset.y}}[Ct]({mirror:t,source:e,sensorEvent:s}){const i=this.draggable.getClassNamesFor("mirror");return t.style.display="none",Promise.resolve({mirror:t,source:e,sensorEvent:s,mirrorClasses:i,scrollOffset:this.scrollOffset,options:this.options,passedThreshX:!0,passedThreshY:!0}).then(Ot).then(Xt).then(Yt).then(At).then(It({initial:!0})).then(Ft).then((({mirrorOffset:t,initialX:e,initialY:s,...i})=>(this.mirrorOffset=t,this.initialX=e,this.initialY=s,this.lastMovedX=e,this.lastMovedY=s,{mirrorOffset:t,initialX:e,initialY:s,...i})))}[Et](t){return t.canceled()?null:Promise.resolve({mirror:t.mirror,sensorEvent:t.sensorEvent,mirrorOffset:this.mirrorOffset,options:this.options,initialX:this.initialX,initialY:this.initialY,scrollOffset:this.scrollOffset,passedThreshX:t.passedThreshX,passedThreshY:t.passedThreshY,lastMovedX:this.lastMovedX,lastMovedY:this.lastMovedY}).then(It({raf:!0})).then((({lastMovedX:t,lastMovedY:e,...s})=>(this.lastMovedX=t,this.lastMovedY=e,{lastMovedX:t,lastMovedY:e,...s}))).then((e=>{const s=new bt({source:t.source,originalSource:t.originalSource,sourceContainer:t.sourceContainer,sensorEvent:t.sensorEvent,dragEvent:t.dragEvent,mirror:this.mirror,passedThreshX:t.passedThreshX,passedThreshY:t.passedThreshY});return this.draggable.trigger(s),e}))}[Dt](t){const e=this.options.appendTo;return"string"==typeof e?document.querySelector(e):e instanceof HTMLElement?e:"function"==typeof e?e(t):t.parentNode}},Scrollable:class extends e{constructor(t){super(t),this.options={...Nt,...this.getOptions()},this.currentMousePosition=null,this.scrollAnimationFrame=null,this.scrollableElement=null,this.findScrollableElementFrame=null,this[jt]=this[jt].bind(this),this[qt]=this[qt].bind(this),this[zt]=this[zt].bind(this),this[Pt]=this[Pt].bind(this)}attach(){this.draggable.on("drag:start",this[jt]).on("drag:move",this[qt]).on("drag:stop",this[zt])}detach(){this.draggable.off("drag:start",this[jt]).off("drag:move",this[qt]).off("drag:stop",this[zt])}getOptions(){return this.draggable.options.scrollable||{}}getScrollableElement(t){return this.hasDefinedScrollableElements()?r(t,this.options.scrollableElements)||document.documentElement:function(t){if(!t)return Bt();const e=getComputedStyle(t).getPropertyValue("position"),s="absolute"===e,i=r(t,(t=>(!s||!function(t){return"static"===getComputedStyle(t).getPropertyValue("position")}(t))&&function(t){const e=getComputedStyle(t,null),s=e.getPropertyValue("overflow")+e.getPropertyValue("overflow-y")+e.getPropertyValue("overflow-x");return/(auto|scroll)/.test(s)}(t)));return"fixed"!==e&&i?i:Bt()}(t)}hasDefinedScrollableElements(){return Boolean(0!==this.options.scrollableElements.length)}[jt](t){this.findScrollableElementFrame=requestAnimationFrame((()=>{this.scrollableElement=this.getScrollableElement(t.source)}))}[qt](t){if(this.findScrollableElementFrame=requestAnimationFrame((()=>{this.scrollableElement=this.getScrollableElement(t.sensorEvent.target)})),!this.scrollableElement)return;const e=t.sensorEvent,s={x:0,y:0};"ontouchstart"in window&&(s.y=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0,s.x=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0),this.currentMousePosition={clientX:e.clientX-s.x,clientY:e.clientY-s.y},this.scrollAnimationFrame=requestAnimationFrame(this[Pt])}[zt](){cancelAnimationFrame(this.scrollAnimationFrame),cancelAnimationFrame(this.findScrollableElementFrame),this.scrollableElement=null,this.scrollAnimationFrame=null,this.findScrollableElementFrame=null,this.currentMousePosition=null}[Pt](){if(!this.scrollableElement||!this.currentMousePosition)return;cancelAnimationFrame(this.scrollAnimationFrame);const{speed:t,sensitivity:e}=this.options,s=this.scrollableElement.getBoundingClientRect(),i=s.bottom>window.innerHeight,r=s.top<0||i,n=Bt(),o=this.scrollableElement,h=this.currentMousePosition.clientX,a=this.currentMousePosition.clientY;if(o===document.body||o===document.documentElement||r){const{innerHeight:s,innerWidth:i}=window;a<e?n.scrollTop-=t:s-a<e&&(n.scrollTop+=t),h<e?n.scrollLeft-=t:i-h<e&&(n.scrollLeft+=t)}else{const{offsetHeight:i,offsetWidth:r}=o;s.top+i-a<e?o.scrollTop+=t:a-s.top<e&&(o.scrollTop-=t),s.left+r-h<e?o.scrollLeft+=t:h-s.left<e&&(o.scrollLeft-=t)}this.scrollAnimationFrame=requestAnimationFrame(this[Pt])}}},_t.Sensors={MouseSensor:class extends i{constructor(t=[],e={}){super(t,e),this.mouseDownTimeout=null,this.pageX=null,this.pageY=null,this[u]=this[u].bind(this),this[l]=this[l].bind(this),this[d]=this[d].bind(this),this[g]=this[g].bind(this),this[m]=this[m].bind(this),this[f]=this[f].bind(this)}attach(){document.addEventListener("mousedown",this[l],!0)}detach(){document.removeEventListener("mousedown",this[l],!0)}[l](t){if(0!==t.button||t.ctrlKey||t.metaKey)return;const e=r(t.target,this.containers);if(!e)return;if(this.options.handle&&t.target&&!r(t.target,this.options.handle))return;const s=r(t.target,this.options.draggable);if(!s)return;const{delay:i}=this,{pageX:n,pageY:o}=t;Object.assign(this,{pageX:n,pageY:o}),this.onMouseDownAt=Date.now(),this.startEvent=t,this.currentContainer=e,this.originalSource=s,document.addEventListener("mouseup",this[g]),document.addEventListener("dragstart",v),document.addEventListener("mousemove",this[f]),this.mouseDownTimeout=window.setTimeout((()=>{this[f]({pageX:this.pageX,pageY:this.pageY})}),i.mouse)}[m](){const t=this.startEvent,e=new h({clientX:t.clientX,clientY:t.clientY,target:t.target,container:this.currentContainer,originalSource:this.originalSource,originalEvent:t});this.trigger(this.currentContainer,e),this.dragging=!e.canceled(),this.dragging&&(document.addEventListener("contextmenu",this[u],!0),document.addEventListener("mousemove",this[d]))}[f](t){const{pageX:e,pageY:s}=t,{distance:i}=this.options,{startEvent:r,delay:o}=this;if(Object.assign(this,{pageX:e,pageY:s}),!this.currentContainer)return;const h=Date.now()-this.onMouseDownAt,a=n(r.pageX,r.pageY,e,s)||0;clearTimeout(this.mouseDownTimeout),h<o.mouse?document.removeEventListener("mousemove",this[f]):a>=i&&(document.removeEventListener("mousemove",this[f]),this[m]())}[d](t){if(!this.dragging)return;const e=document.elementFromPoint(t.clientX,t.clientY),s=new a({clientX:t.clientX,clientY:t.clientY,target:e,container:this.currentContainer,originalEvent:t});this.trigger(this.currentContainer,s)}[g](t){if(clearTimeout(this.mouseDownTimeout),0!==t.button)return;if(document.removeEventListener("mouseup",this[g]),document.removeEventListener("dragstart",v),document.removeEventListener("mousemove",this[f]),!this.dragging)return;const e=document.elementFromPoint(t.clientX,t.clientY),s=new c({clientX:t.clientX,clientY:t.clientY,target:e,container:this.currentContainer,originalEvent:t});this.trigger(this.currentContainer,s),document.removeEventListener("contextmenu",this[u],!0),document.removeEventListener("mousemove",this[d]),this.currentContainer=null,this.dragging=!1,this.startEvent=null}[u](t){t.preventDefault()}},TouchSensor:class extends i{constructor(t=[],e={}){super(t,e),this.currentScrollableParent=null,this.tapTimeout=null,this.touchMoved=!1,this.pageX=null,this.pageY=null,this[b]=this[b].bind(this),this[w]=this[w].bind(this),this[y]=this[y].bind(this),this[x]=this[x].bind(this),this[S]=this[S].bind(this)}attach(){document.addEventListener("touchstart",this[b])}detach(){document.removeEventListener("touchstart",this[b])}[b](t){const e=r(t.target,this.containers);if(!e)return;if(this.options.handle&&t.target&&!r(t.target,this.options.handle))return;const s=r(t.target,this.options.draggable);if(!s)return;const{distance:i=0}=this.options,{delay:n}=this,{pageX:o,pageY:h}=p(t);Object.assign(this,{pageX:o,pageY:h}),this.onTouchStartAt=Date.now(),this.startEvent=t,this.currentContainer=e,this.originalSource=s,document.addEventListener("touchend",this[w]),document.addEventListener("touchcancel",this[w]),document.addEventListener("touchmove",this[S]),e.addEventListener("contextmenu",E),i&&(C=!0),this.tapTimeout=window.setTimeout((()=>{this[S]({touches:[{pageX:this.pageX,pageY:this.pageY}]})}),n.touch)}[x](){const t=this.startEvent,e=this.currentContainer,s=p(t),i=new h({clientX:s.pageX,clientY:s.pageY,target:t.target,container:e,originalSource:this.originalSource,originalEvent:t});this.trigger(this.currentContainer,i),this.dragging=!i.canceled(),this.dragging&&document.addEventListener("touchmove",this[y]),C=this.dragging}[S](t){const{distance:e}=this.options,{startEvent:s,delay:i}=this,r=p(s),o=p(t),h=Date.now()-this.onTouchStartAt,a=n(r.pageX,r.pageY,o.pageX,o.pageY);Object.assign(this,o),clearTimeout(this.tapTimeout),h<i.touch?document.removeEventListener("touchmove",this[S]):a>=e&&(document.removeEventListener("touchmove",this[S]),this[x]())}[y](t){if(!this.dragging)return;const{pageX:e,pageY:s}=p(t),i=document.elementFromPoint(e-window.scrollX,s-window.scrollY),r=new a({clientX:e,clientY:s,target:i,container:this.currentContainer,originalEvent:t});this.trigger(this.currentContainer,r)}[w](t){if(clearTimeout(this.tapTimeout),C=!1,document.removeEventListener("touchend",this[w]),document.removeEventListener("touchcancel",this[w]),document.removeEventListener("touchmove",this[S]),this.currentContainer&&this.currentContainer.removeEventListener("contextmenu",E),!this.dragging)return;document.removeEventListener("touchmove",this[y]);const{pageX:e,pageY:s}=p(t),i=document.elementFromPoint(e-window.scrollX,s-window.scrollY);t.preventDefault();const r=new c({clientX:e,clientY:s,target:i,container:this.currentContainer,originalEvent:t});this.trigger(this.currentContainer,r),this.currentContainer=null,this.dragging=!1,this.startEvent=null}}};class se extends t{constructor(t){super(t),this.data=t}get dragEvent(){return this.data.dragEvent}}se.type="sortable";class ie extends se{get startIndex(){return this.data.startIndex}get startContainer(){return this.data.startContainer}}ie.type="sortable:start",ie.cancelable=!0;class re extends se{get currentIndex(){return this.data.currentIndex}get over(){return this.data.over}get overContainer(){return this.data.dragEvent.overContainer}}re.type="sortable:sort",re.cancelable=!0;class ne extends se{get oldIndex(){return this.data.oldIndex}get newIndex(){return this.data.newIndex}get oldContainer(){return this.data.oldContainer}get newContainer(){return this.data.newContainer}}ne.type="sortable:sorted";class oe extends se{get oldIndex(){return this.data.oldIndex}get newIndex(){return this.data.newIndex}get oldContainer(){return this.data.oldContainer}get newContainer(){return this.data.newContainer}}oe.type="sortable:stop";const he=Symbol("onDragStart"),ae=Symbol("onDragOverContainer"),ce=Symbol("onDragOver"),ue=Symbol("onDragStop"),le={"sortable:sorted":function({dragEvent:t}){const e=t.source.textContent.trim()||t.source.id||"sortable element";if(t.over){const s=t.over.textContent.trim()||t.over.id||"sortable element";return t.source.compareDocumentPosition(t.over)&Node.DOCUMENT_POSITION_FOLLOWING?`Placed ${e} after ${s}`:`Placed ${e} before ${s}`}return`Placed ${e} into a different container`}};class de extends _t{constructor(t=[],e={}){super(t,{...e,announcements:{...le,...e.announcements||{}}}),this.startIndex=null,this.startContainer=null,this[he]=this[he].bind(this),this[ae]=this[ae].bind(this),this[ce]=this[ce].bind(this),this[ue]=this[ue].bind(this),this.on("drag:start",this[he]).on("drag:over:container",this[ae]).on("drag:over",this[ce]).on("drag:stop",this[ue])}destroy(){super.destroy(),this.off("drag:start",this[he]).off("drag:over:container",this[ae]).off("drag:over",this[ce]).off("drag:stop",this[ue])}index(t){return this.getSortableElementsForContainer(t.parentNode).indexOf(t)}getSortableElementsForContainer(t){return[...t.querySelectorAll(this.options.draggable)].filter((e=>e!==this.originalSource&&e!==this.mirror&&e.parentNode===t))}[he](t){this.startContainer=t.source.parentNode,this.startIndex=this.index(t.source);const e=new ie({dragEvent:t,startIndex:this.startIndex,startContainer:this.startContainer});this.trigger(e),e.canceled()&&t.cancel()}[ae](t){if(t.canceled())return;const{source:e,over:s,overContainer:i}=t,r=this.index(e),n=new re({dragEvent:t,currentIndex:r,source:e,over:s});if(this.trigger(n),n.canceled())return;const o=me({source:e,over:s,overContainer:i,children:this.getSortableElementsForContainer(i)});if(!o)return;const{oldContainer:h,newContainer:a}=o,c=this.index(t.source),u=new ne({dragEvent:t,oldIndex:r,newIndex:c,oldContainer:h,newContainer:a});this.trigger(u)}[ce](t){if(t.over===t.originalSource||t.over===t.source)return;const{source:e,over:s,overContainer:i}=t,r=this.index(e),n=new re({dragEvent:t,currentIndex:r,source:e,over:s});if(this.trigger(n),n.canceled())return;const o=me({source:e,over:s,overContainer:i,children:this.getDraggableElementsForContainer(i)});if(!o)return;const{oldContainer:h,newContainer:a}=o,c=this.index(e),u=new ne({dragEvent:t,oldIndex:r,newIndex:c,oldContainer:h,newContainer:a});this.trigger(u)}[ue](t){const e=new oe({dragEvent:t,oldIndex:this.startIndex,newIndex:this.index(t.source),oldContainer:this.startContainer,newContainer:t.source.parentNode});this.trigger(e),this.startIndex=null,this.startContainer=null}}function ge(t){return Array.prototype.indexOf.call(t.parentNode.children,t)}function me({source:t,over:e,overContainer:s,children:i}){const r=t.parentNode!==s;return i.length?e&&t.parentNode===e.parentNode?function(t,e){const s=ge(t),i=ge(e);return t.parentNode.insertBefore(t,s<i?e.nextElementSibling:e),{oldContainer:t.parentNode,newContainer:t.parentNode}}(t,e):r?function(t,e,s){const i=t.parentNode;return e?e.parentNode.insertBefore(t,e):s.appendChild(t),{oldContainer:i,newContainer:t.parentNode}}(t,e,s):null:function(t,e){const s=t.parentNode;return e.appendChild(t),{oldContainer:s,newContainer:e}}(t,s)}export{de as S}
|
@@ -1 +1 @@
|
|
1
|
-
import{p as e,b as t}from"./p-d2d301a6.js";export{s as setNonce}from"./p-d2d301a6.js";(()=>{const t=import.meta.url,a={};return""!==t&&(a.resourcesUrl=new URL(".",t).href),e(a)})().then((e=>t(JSON.parse('[["p-118e769b",[[1,"teste-pesquisa"]]],["p-2640ba03",[[0,"snk-filter-modal",{"getMessage":[16],"configName":[1025,"config-name"],"filters":[1040],"applyFilters":[16],"closeModal":[16],"addPersonalizedFilter":[16],"editPersonalizedFilter":[16]}]]],["p-ac8d1cd6",[[2,"snk-actions-form",{"action":[16],"applyParameters":[16],"dataUnit":[32],"openPopup":[64]}]]],["p-9531fd46",[[2,"snk-client-confirm",{"titleMessage":[1,"title-message"],"message":[1],"accept":[16],"cancel":[16],"openPopup":[64]}]]],["p-69754d94",[[6,"snk-custom-slot-elements",{"slotName":[1,"slot-name"]}]]],["p-d4f9ee17",[[2,"snk-entity-list",{"config":[1040],"rightListSlotBuilder":[1040],"maxHeightList":[1,"max-height-list"],"_searchValue":[32],"_ezListSource":[32],"reloadList":[64]}]]],["p-eb636e15",[[0,"snk-filter-binary-select",{"value":[1544],"config":[16],"presentationMode":[2,"presentation-mode"],"resetValues":[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-d3f53df2",[[4,"snk-filter-list",{"label":[1],"iconName":[1,"icon-name"],"items":[16],"getMessage":[16],"emptyText":[1,"empty-text"],"findFilterText":[1,"find-filter-text"],"buttonClass":[1,"button-class"],"_filterArgument":[32],"_showAll":[32],"hideDetail":[64]},[[2,"keydown","keyDownHandler"]]]]],["p-cb37982f",[[0,"snk-filter-multi-select",{"value":[1544],"config":[16],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-29529c8f",[[0,"snk-filter-number",{"config":[16],"getMessage":[16],"value":[2],"presentationMode":[2,"presentation-mode"],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-fc257290",[[0,"snk-filter-period",{"config":[16],"getMessage":[16],"value":[8],"presentationMode":[2,"presentation-mode"],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-fe49067d",[[0,"snk-filter-search",{"config":[16],"value":[16],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-96a89d58",[[0,"snk-filter-text",{"config":[16],"value":[1]},[[0,"ezChange","ezChangeListener"]]]]],["p-26ad62b9",[[2,"snk-personalized-filter-editor",{"messagesBuilder":[1040],"presentationMode":[2,"presentation-mode"],"config":[16],"value":[1040],"items":[32],"show":[64]}]]],["p-72fc257b",[[2,"snk-print-selector",{"_printServerActive":[32],"_selectedPrinter":[32],"_remotePrintersDataSource":[32],"_localPrintersDataSource":[32],"_printJobData":[32],"openPrintSelector":[64]}]]],["p-fda8c84c",[[0,"snk-filter-modal-item",{"filterItem":[1040],"configName":[1025,"config-name"],"resourceID":[1,"resource-i-d"]}]]],["p-c606c748",[[0,"snk-filter-detail",{"config":[1040],"getMessage":[16],"show":[64]}]]],["p-88aa931b",[[6,"snk-simple-bar",{"label":[1],"breadcrumbItens":[16],"messagesBuilder":[1040]}]]],["p-51529d47",[[6,"snk-detail-view",{"formConfigManager":[1040],"dataUnitName":[1,"data-unit-name"],"resourceID":[1,"resource-i-d"],"guideItemPath":[16],"entityName":[1,"entity-name"],"label":[1],"dataUnit":[1040],"selectedForm":[1025,"selected-form"],"dataState":[1040],"messagesBuilder":[1040],"branchGuide":[1040],"canEdit":[4,"can-edit"],"taskbarCustomContainerId":[1,"taskbar-custom-container-id"],"_disabledButtons":[32],"_currentView":[32],"attachmentRegisterKey":[32],"changeViewMode":[64],"configGrid":[64],"showUp":[64]},[[0,"snkContentCardChanged","onContentCardChanged"]]]]],["p-73d3daa8",[[2,"snk-configurator",{"showActionButtons":[4,"show-action-buttons"],"configName":[1,"config-name"],"resourceID":[1,"resource-i-d"],"viewMode":[2,"view-mode"],"customContainerId":[1,"custom-container-id"],"messagesBuilder":[1040],"_opened":[32],"_permissions":[32],"open":[64],"close":[64]}]]],["p-247a8b36",[[2,"snk-pesquisa",{"searchLoader":[16],"selectItem":[16],"argument":[1025],"_itemList":[32],"_startLoading":[32]}]]],["p-c0931902",[[2,"snk-filter-field-search",{"searchable":[4],"fieldsDataSource":[16],"breadcrumbItems":[32],"linkItems":[32],"fieldItems":[32],"searchEmpty":[32],"groupEmpty":[32],"show":[64],"applyFilter":[64]}],[0,"snk-filter-param-config",{"messagesBuilder":[1040],"_opened":[32],"_configType":[32],"_expressionItem":[32],"_informedInstance":[32],"_canSave":[32],"open":[64],"close":[64]}]]],["p-9d3a025a",[[2,"snk-expression-group",{"parentTop":[1026,"parent-top"],"group":[1040],"messagesBuilder":[1040],"filterId":[1025,"filter-id"],"entityURI":[1025,"entity-u-r-i"],"_conditionOperator":[32],"_group":[32],"_selfTop":[32],"canAddExpression":[32],"_showDashes":[32],"getExpressionGroup":[64]},[[8,"ezExpressionLayoutChanged","todoCompletedHandler"]]],[2,"snk-expression-item",{"expression":[16],"canRemove":[516,"can-remove"],"messagesBuilder":[1040],"entityURI":[1025,"entity-u-r-i"],"_showValueVariable":[32],"_fieldSelected":[32],"_optionNotNull":[32]}]]],["p-c78a80ae",[[2,"snk-filter-assistent-mode",{"filterAssistent":[1040],"messagesBuilder":[1040],"filterId":[1025,"filter-id"],"entityUri":[1025,"entity-uri"],"application":[1040]}],[2,"snk-filter-advanced-mode",{"filterAssistent":[1040],"application":[1040]}]]],["p-e60325bc",[[2,"snk-personalized-filter",{"messagesBuilder":[1040],"entityUri":[1025,"entity-uri"],"filterId":[1025,"filter-id"],"configName":[1025,"config-name"],"resourceID":[1,"resource-i-d"],"_filterAssistentMode":[32],"_filterAssistent":[32],"createPersonalizedFilter":[64]}]]],["p-94c532bb",[[2,"snk-filter-bar",{"dataUnit":[1040],"configName":[1,"config-name"],"resourceID":[1,"resource-i-d"],"filterConfig":[1040],"messagesBuilder":[1040],"allowDefault":[32],"scrollerLocked":[32],"showPersonalizedFilter":[32],"personalizedFilterId":[32],"reload":[64],"getFilterItem":[64],"updateFilterItem":[64],"addFilterItem":[64]},[[0,"filterChange","filterChangeListener"]]]]],["p-bd628455",[[2,"snk-config-options",{"fieldConfig":[16],"idConfig":[513,"id-config"],"dataUnit":[16],"messagesBuilder":[1040],"_defaultType":[32]}]]],["p-f30526a7",[[2,"snk-field-config",{"isConfigActive":[16],"fieldConfig":[16],"modeInsertion":[516,"mode-insertion"],"dataUnit":[16],"messagesBuilder":[1040]}]]],["p-f007b434",[[6,"snk-tab-config",{"selectedIndex":[1538,"selected-index"],"selectedTab":[1537,"selected-tab"],"tabs":[1],"tabItems":[16],"messagesBuilder":[1040],"_processedTabs":[32],"_activeEditText":[32],"_activeEditTextIndex":[32],"_actionsHide":[32],"_actionsShow":[32]}]]],["p-80692cbd",[[2,"snk-form-config",{"dataUnit":[16],"configManager":[16],"messagesBuilder":[1040],"_formConfigOptions":[32],"_fieldConfigSelected":[32],"_layoutFormConfig":[32],"_fieldsAvailable":[32],"_formConfig":[32],"_formConfigChanged":[32],"_optionFormConfigSelected":[32],"_optionFormConfigChanged":[32],"_tempGroups":[32]}]]],["p-838f8234",[[1,"snk-select-box",{"selectedOption":[1,"selected-option"]}]]],["p-47e4b6c9",[[2,"snk-grid-config",{"selectedIndex":[1026,"selected-index"],"application":[16],"columns":[1040],"config":[1040],"configName":[1,"config-name"],"resourceID":[1,"resource-i-d"]}]]],["p-d4c72815",[[0,"snk-filter-item",{"config":[1040],"getMessage":[16],"detailIsVisible":[32],"showUp":[64],"hideDetail":[64]},[[2,"click","clickListener"],[2,"mousedown","mouseDownListener"],[0,"filterChange","filterChangeListener"]]]]],["p-cd024328",[[2,"snk-data-unit",{"dataState":[1040],"messagesBuilder":[1040],"dataUnitName":[1,"data-unit-name"],"entityName":[1,"entity-name"],"pageSize":[2,"page-size"],"dataUnit":[1040],"beforeSave":[16],"afterSave":[16],"useCancelConfirm":[4,"use-cancel-confirm"],"ignoreSaveMessage":[4,"ignore-save-message"],"configName":[1,"config-name"],"resourceID":[1,"resource-i-d"],"getDataUnit":[64],"getSelectedRecordsIDsInfo":[64]}]]],["p-219f888d",[[0,"snk-exporter-email-sender",{"getMessage":[16],"_config":[32],"_opened":[32],"_currentStep":[32],"open":[64],"close":[64]}]]],["p-b2ce189a",[[2,"snk-data-exporter",{"provider":[16],"messagesBuilder":[1040],"_items":[32],"_showDropdown":[32],"_releasedToExport":[32]}]]],["p-d4fb9642",[[6,"snk-taskbar",{"customSlotId":[1,"custom-slot-id"],"customContainerId":[1,"custom-container-id"],"configName":[1,"config-name"],"resourceID":[1,"resource-i-d"],"buttons":[1],"customButtons":[16],"actionsList":[16],"primaryButton":[1,"primary-button"],"disabledButtons":[16],"dataUnit":[16],"presentationMode":[1537,"presentation-mode"],"messagesBuilder":[1040],"_permissions":[32],"_customElements":[32],"_customElementsId":[32],"_slotContainer":[32]}]]],["p-cead4799",[[6,"snk-grid",{"columnFilterDataSource":[1040],"configName":[1,"config-name"],"resourceID":[1,"resource-i-d"],"selectionToastConfig":[16],"actionsList":[16],"isDetail":[4,"is-detail"],"taskbarManager":[16],"statusResolver":[16],"multipleSelection":[4,"multiple-selection"],"presentationMode":[1,"presentation-mode"],"messagesBuilder":[1040],"useEnterLikeTab":[4,"use-enter-like-tab"],"recordsValidator":[16],"canEdit":[4,"can-edit"],"taskbarCustomContainerId":[1,"taskbar-custom-container-id"],"gridHeaderCustomSlotId":[1,"grid-header-custom-slot-id"],"topTaskbarCustomSlotId":[1,"top-taskbar-custom-slot-id"],"_dataUnit":[32],"_dataState":[32],"_gridConfig":[32],"_popUpGridConfig":[32],"_showSnkFilterBar":[32],"showConfig":[64],"hideConfig":[64],"setConfig":[64],"reloadFilterBar":[64],"getFilterBar":[64]}]]],["p-1e8262a0",[[6,"snk-guides-viewer",{"dataUnit":[16],"dataState":[16],"configName":[1,"config-name"],"entityPath":[1,"entity-path"],"actionsList":[16],"recordsValidator":[16],"masterFormConfig":[1040],"selectedGuide":[16],"taskbarManager":[16],"messagesBuilder":[1040],"canEdit":[4,"can-edit"],"presentationMode":[1,"presentation-mode"],"resourceID":[1,"resource-i-d"],"detailTaskbarCustomContainerId":[1,"detail-taskbar-custom-container-id"],"_breadcrumbItems":[32],"_guides":[32],"_formEditorConfigManager":[32],"_formEditorDataUnit":[32],"showFormConfig":[64]},[[2,"actionClick","onActionClick"],[0,"snkContentCardChanged","onContentCardChanged"]]]]],["p-9cbf6c15",[[6,"snk-crud",{"configName":[1025,"config-name"],"selectionToastConfig":[16],"showActionButtons":[4,"show-action-buttons"],"actionsList":[16],"taskbarManager":[16],"recordsValidator":[16],"statusResolver":[16],"multipleSelection":[4,"multiple-selection"],"presentationMode":[1,"presentation-mode"],"messagesBuilder":[1040],"useEnterLikeTab":[4,"use-enter-like-tab"],"_dataUnit":[32],"_dataState":[32],"attachmentRegisterKey":[32],"_currentViewMode":[32],"_canEdit":[32],"_resourceID":[32],"customContainerId":[32],"goToView":[64],"openConfigurator":[64],"closeConfigurator":[64],"reloadFilterBar":[64],"getFilterBar":[64]}]]],["p-06e76ed2",[[2,"snk-form",{"configName":[1,"config-name"],"recordsValidator":[16],"messagesBuilder":[1040],"resourceID":[1,"resource-i-d"],"_dataUnit":[32],"_dataState":[32],"_showFormConfig":[32],"_configManager":[32],"showConfig":[64],"hideConfig":[64]}]]],["p-6a33f844",[[2,"snk-application",{"messagesBuilder":[1040],"configName":[1,"config-name"],"loadByPK":[16],"isUserSup":[64],"addPendingAction":[64],"callServiceBroker":[64],"initOnboarding":[64],"hasAccess":[64],"getAllAccess":[64],"getStringParam":[64],"getIntParam":[64],"getFloatParam":[64],"getBooleanParam":[64],"getDateParam":[64],"showPopUp":[64],"showModal":[64],"showAlerts":[64],"closeModal":[64],"closePopUp":[64],"temOpcional":[64],"getConfig":[64],"saveConfig":[64],"getAttributeFromHTMLWrapper":[64],"openApp":[64],"webConnection":[64],"createDataunit":[64],"updateDataunitCache":[64],"getDataUnit":[64],"addClientEvent":[64],"removeClientEvent":[64],"hasClientEvent":[64],"getResourceID":[64],"getUserID":[64],"alert":[64],"error":[64],"success":[64],"message":[64],"confirm":[64],"info":[64],"loadTotals":[64],"isLoadedByPk":[64],"executeSearch":[64],"executePreparedSearch":[64],"isDebugMode":[64],"getAppLabel":[64],"addSearchListener":[64],"importScript":[64],"getApplicationPath":[64],"executeSelectDistinct":[64],"getDataFetcher":[64]}]]],["p-6bdb1068",[[6,"snk-simple-crud",{"dataState":[16],"dataUnit":[16],"mode":[2],"gridConfig":[16],"formConfig":[16],"multipleSelection":[4,"multiple-selection"],"useCancelConfirm":[4,"use-cancel-confirm"],"taskbarManager":[16],"messagesBuilder":[1040],"useEnterLikeTab":[4,"use-enter-like-tab"],"_currentViewMode":[32],"_config":[32],"goToView":[64],"setMetadata":[64],"setRecords":[64],"getRecords":[64]},[[0,"actionClick","actionClickListener"]]]]],["p-c1e50dda",[[2,"snk-attach",{"registerKey":[1,"register-key"],"entityName":[1,"entity-name"],"messagesBuilder":[1040],"dataUnit":[32],"crudConfig":[32]}]]],["p-26b0ce3e",[[2,"snk-form-summary",{"fixed":[1540],"contracted":[1540],"summary":[16]}]]],["p-c555075c",[[6,"snk-form-view",{"levelPath":[1,"level-path"],"label":[1],"name":[1],"fields":[16],"formMetadata":[8,"form-metadata"],"dataUnit":[16],"contracted":[4],"fixed":[1540],"summaryFields":[16],"canExpand":[4,"can-expand"],"canFix":[4,"can-fix"],"recordsValidator":[16],"showUp":[64]}]]],["p-32b0a5e1",[[2,"snk-actions-button",{"_items":[32],"_showDropdown":[32],"_actions":[32],"_isOrderActions":[32]}]]]]'),e)));
|
1
|
+
import{p as e,b as t}from"./p-d2d301a6.js";export{s as setNonce}from"./p-d2d301a6.js";(()=>{const t=import.meta.url,a={};return""!==t&&(a.resourcesUrl=new URL(".",t).href),e(a)})().then((e=>t(JSON.parse('[["p-118e769b",[[1,"teste-pesquisa"]]],["p-2640ba03",[[0,"snk-filter-modal",{"getMessage":[16],"configName":[1025,"config-name"],"filters":[1040],"applyFilters":[16],"closeModal":[16],"addPersonalizedFilter":[16],"editPersonalizedFilter":[16]}]]],["p-ac8d1cd6",[[2,"snk-actions-form",{"action":[16],"applyParameters":[16],"dataUnit":[32],"openPopup":[64]}]]],["p-9531fd46",[[2,"snk-client-confirm",{"titleMessage":[1,"title-message"],"message":[1],"accept":[16],"cancel":[16],"openPopup":[64]}]]],["p-69754d94",[[6,"snk-custom-slot-elements",{"slotName":[1,"slot-name"]}]]],["p-d4f9ee17",[[2,"snk-entity-list",{"config":[1040],"rightListSlotBuilder":[1040],"maxHeightList":[1,"max-height-list"],"_searchValue":[32],"_ezListSource":[32],"reloadList":[64]}]]],["p-eb636e15",[[0,"snk-filter-binary-select",{"value":[1544],"config":[16],"presentationMode":[2,"presentation-mode"],"resetValues":[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-d3f53df2",[[4,"snk-filter-list",{"label":[1],"iconName":[1,"icon-name"],"items":[16],"getMessage":[16],"emptyText":[1,"empty-text"],"findFilterText":[1,"find-filter-text"],"buttonClass":[1,"button-class"],"_filterArgument":[32],"_showAll":[32],"hideDetail":[64]},[[2,"keydown","keyDownHandler"]]]]],["p-cb37982f",[[0,"snk-filter-multi-select",{"value":[1544],"config":[16],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-29529c8f",[[0,"snk-filter-number",{"config":[16],"getMessage":[16],"value":[2],"presentationMode":[2,"presentation-mode"],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-fc257290",[[0,"snk-filter-period",{"config":[16],"getMessage":[16],"value":[8],"presentationMode":[2,"presentation-mode"],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-fe49067d",[[0,"snk-filter-search",{"config":[16],"value":[16],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-96a89d58",[[0,"snk-filter-text",{"config":[16],"value":[1]},[[0,"ezChange","ezChangeListener"]]]]],["p-26ad62b9",[[2,"snk-personalized-filter-editor",{"messagesBuilder":[1040],"presentationMode":[2,"presentation-mode"],"config":[16],"value":[1040],"items":[32],"show":[64]}]]],["p-72fc257b",[[2,"snk-print-selector",{"_printServerActive":[32],"_selectedPrinter":[32],"_remotePrintersDataSource":[32],"_localPrintersDataSource":[32],"_printJobData":[32],"openPrintSelector":[64]}]]],["p-25df73bf",[[0,"snk-filter-modal-item",{"filterItem":[1040],"configName":[1025,"config-name"],"resourceID":[1,"resource-i-d"]}]]],["p-c606c748",[[0,"snk-filter-detail",{"config":[1040],"getMessage":[16],"show":[64]}]]],["p-88aa931b",[[6,"snk-simple-bar",{"label":[1],"breadcrumbItens":[16],"messagesBuilder":[1040]}]]],["p-718ecd01",[[6,"snk-detail-view",{"formConfigManager":[1040],"dataUnitName":[1,"data-unit-name"],"resourceID":[1,"resource-i-d"],"guideItemPath":[16],"entityName":[1,"entity-name"],"label":[1],"dataUnit":[1040],"selectedForm":[1025,"selected-form"],"dataState":[1040],"messagesBuilder":[1040],"branchGuide":[1040],"canEdit":[4,"can-edit"],"taskbarCustomContainerId":[1,"taskbar-custom-container-id"],"_disabledButtons":[32],"_currentView":[32],"attachmentRegisterKey":[32],"changeViewMode":[64],"configGrid":[64],"showUp":[64]},[[0,"snkContentCardChanged","onContentCardChanged"]]]]],["p-5f74c859",[[2,"snk-configurator",{"showActionButtons":[4,"show-action-buttons"],"configName":[1,"config-name"],"resourceID":[1,"resource-i-d"],"viewMode":[2,"view-mode"],"customContainerId":[1,"custom-container-id"],"messagesBuilder":[1040],"_opened":[32],"_permissions":[32],"open":[64],"close":[64]}]]],["p-247a8b36",[[2,"snk-pesquisa",{"searchLoader":[16],"selectItem":[16],"argument":[1025],"_itemList":[32],"_startLoading":[32]}]]],["p-c0931902",[[2,"snk-filter-field-search",{"searchable":[4],"fieldsDataSource":[16],"breadcrumbItems":[32],"linkItems":[32],"fieldItems":[32],"searchEmpty":[32],"groupEmpty":[32],"show":[64],"applyFilter":[64]}],[0,"snk-filter-param-config",{"messagesBuilder":[1040],"_opened":[32],"_configType":[32],"_expressionItem":[32],"_informedInstance":[32],"_canSave":[32],"open":[64],"close":[64]}]]],["p-9d3a025a",[[2,"snk-expression-group",{"parentTop":[1026,"parent-top"],"group":[1040],"messagesBuilder":[1040],"filterId":[1025,"filter-id"],"entityURI":[1025,"entity-u-r-i"],"_conditionOperator":[32],"_group":[32],"_selfTop":[32],"canAddExpression":[32],"_showDashes":[32],"getExpressionGroup":[64]},[[8,"ezExpressionLayoutChanged","todoCompletedHandler"]]],[2,"snk-expression-item",{"expression":[16],"canRemove":[516,"can-remove"],"messagesBuilder":[1040],"entityURI":[1025,"entity-u-r-i"],"_showValueVariable":[32],"_fieldSelected":[32],"_optionNotNull":[32]}]]],["p-c78a80ae",[[2,"snk-filter-assistent-mode",{"filterAssistent":[1040],"messagesBuilder":[1040],"filterId":[1025,"filter-id"],"entityUri":[1025,"entity-uri"],"application":[1040]}],[2,"snk-filter-advanced-mode",{"filterAssistent":[1040],"application":[1040]}]]],["p-a3fbded7",[[2,"snk-personalized-filter",{"messagesBuilder":[1040],"entityUri":[1025,"entity-uri"],"filterId":[1025,"filter-id"],"configName":[1025,"config-name"],"resourceID":[1,"resource-i-d"],"_filterAssistentMode":[32],"_filterAssistent":[32],"createPersonalizedFilter":[64]}]]],["p-993e27ad",[[2,"snk-filter-bar",{"dataUnit":[1040],"configName":[1,"config-name"],"resourceID":[1,"resource-i-d"],"filterConfig":[1040],"messagesBuilder":[1040],"allowDefault":[32],"scrollerLocked":[32],"showPersonalizedFilter":[32],"personalizedFilterId":[32],"reload":[64],"getFilterItem":[64],"updateFilterItem":[64],"addFilterItem":[64]},[[0,"filterChange","filterChangeListener"]]]]],["p-3b60db06",[[2,"snk-config-options",{"fieldConfig":[16],"idConfig":[513,"id-config"],"dataUnit":[16],"messagesBuilder":[1040],"_defaultType":[32]}]]],["p-95df461f",[[2,"snk-field-config",{"isConfigActive":[16],"fieldConfig":[16],"modeInsertion":[516,"mode-insertion"],"dataUnit":[16],"messagesBuilder":[1040]}]]],["p-8eb67fa4",[[6,"snk-tab-config",{"selectedIndex":[1538,"selected-index"],"selectedTab":[1537,"selected-tab"],"tabs":[1],"tabItems":[16],"messagesBuilder":[1040],"_processedTabs":[32],"_activeEditText":[32],"_activeEditTextIndex":[32],"_actionsHide":[32],"_actionsShow":[32]}]]],["p-a3868fbc",[[2,"snk-form-config",{"dataUnit":[16],"configManager":[16],"messagesBuilder":[1040],"_formConfigOptions":[32],"_fieldConfigSelected":[32],"_layoutFormConfig":[32],"_fieldsAvailable":[32],"_formConfig":[32],"_formConfigChanged":[32],"_optionFormConfigSelected":[32],"_optionFormConfigChanged":[32],"_tempGroups":[32]}]]],["p-98674137",[[1,"snk-select-box",{"selectedOption":[1,"selected-option"]}]]],["p-8f307ef2",[[2,"snk-grid-config",{"selectedIndex":[1026,"selected-index"],"application":[16],"columns":[1040],"config":[1040],"configName":[1,"config-name"],"resourceID":[1,"resource-i-d"]}]]],["p-d4c72815",[[0,"snk-filter-item",{"config":[1040],"getMessage":[16],"detailIsVisible":[32],"showUp":[64],"hideDetail":[64]},[[2,"click","clickListener"],[2,"mousedown","mouseDownListener"],[0,"filterChange","filterChangeListener"]]]]],["p-9be1dfd5",[[2,"snk-data-unit",{"dataState":[1040],"messagesBuilder":[1040],"dataUnitName":[1,"data-unit-name"],"entityName":[1,"entity-name"],"pageSize":[2,"page-size"],"dataUnit":[1040],"beforeSave":[16],"afterSave":[16],"useCancelConfirm":[4,"use-cancel-confirm"],"ignoreSaveMessage":[4,"ignore-save-message"],"configName":[1,"config-name"],"resourceID":[1,"resource-i-d"],"getDataUnit":[64],"getSelectedRecordsIDsInfo":[64]}]]],["p-219f888d",[[0,"snk-exporter-email-sender",{"getMessage":[16],"_config":[32],"_opened":[32],"_currentStep":[32],"open":[64],"close":[64]}]]],["p-97277eae",[[2,"snk-data-exporter",{"provider":[16],"messagesBuilder":[1040],"_items":[32],"_showDropdown":[32],"_releasedToExport":[32]}]]],["p-d4fb9642",[[6,"snk-taskbar",{"customSlotId":[1,"custom-slot-id"],"customContainerId":[1,"custom-container-id"],"configName":[1,"config-name"],"resourceID":[1,"resource-i-d"],"buttons":[1],"customButtons":[16],"actionsList":[16],"primaryButton":[1,"primary-button"],"disabledButtons":[16],"dataUnit":[16],"presentationMode":[1537,"presentation-mode"],"messagesBuilder":[1040],"_permissions":[32],"_customElements":[32],"_customElementsId":[32],"_slotContainer":[32]}]]],["p-c6800fd4",[[6,"snk-grid",{"columnFilterDataSource":[1040],"configName":[1,"config-name"],"resourceID":[1,"resource-i-d"],"selectionToastConfig":[16],"actionsList":[16],"isDetail":[4,"is-detail"],"taskbarManager":[16],"statusResolver":[16],"multipleSelection":[4,"multiple-selection"],"presentationMode":[1,"presentation-mode"],"messagesBuilder":[1040],"useEnterLikeTab":[4,"use-enter-like-tab"],"recordsValidator":[16],"canEdit":[4,"can-edit"],"taskbarCustomContainerId":[1,"taskbar-custom-container-id"],"gridHeaderCustomSlotId":[1,"grid-header-custom-slot-id"],"topTaskbarCustomSlotId":[1,"top-taskbar-custom-slot-id"],"_dataUnit":[32],"_dataState":[32],"_gridConfig":[32],"_popUpGridConfig":[32],"_showSnkFilterBar":[32],"showConfig":[64],"hideConfig":[64],"setConfig":[64],"reloadFilterBar":[64],"getFilterBar":[64]}]]],["p-a4401f5f",[[6,"snk-guides-viewer",{"dataUnit":[16],"dataState":[16],"configName":[1,"config-name"],"entityPath":[1,"entity-path"],"actionsList":[16],"recordsValidator":[16],"masterFormConfig":[1040],"selectedGuide":[16],"taskbarManager":[16],"messagesBuilder":[1040],"canEdit":[4,"can-edit"],"presentationMode":[1,"presentation-mode"],"resourceID":[1,"resource-i-d"],"detailTaskbarCustomContainerId":[1,"detail-taskbar-custom-container-id"],"_breadcrumbItems":[32],"_guides":[32],"_formEditorConfigManager":[32],"_formEditorDataUnit":[32],"showFormConfig":[64]},[[2,"actionClick","onActionClick"],[0,"snkContentCardChanged","onContentCardChanged"]]]]],["p-1ae31937",[[6,"snk-crud",{"configName":[1025,"config-name"],"selectionToastConfig":[16],"showActionButtons":[4,"show-action-buttons"],"actionsList":[16],"taskbarManager":[16],"recordsValidator":[16],"statusResolver":[16],"multipleSelection":[4,"multiple-selection"],"presentationMode":[1,"presentation-mode"],"messagesBuilder":[1040],"useEnterLikeTab":[4,"use-enter-like-tab"],"_dataUnit":[32],"_dataState":[32],"attachmentRegisterKey":[32],"_currentViewMode":[32],"_canEdit":[32],"_resourceID":[32],"customContainerId":[32],"goToView":[64],"openConfigurator":[64],"closeConfigurator":[64],"reloadFilterBar":[64],"getFilterBar":[64]}]]],["p-d7665a57",[[2,"snk-form",{"configName":[1,"config-name"],"recordsValidator":[16],"messagesBuilder":[1040],"resourceID":[1,"resource-i-d"],"_dataUnit":[32],"_dataState":[32],"_showFormConfig":[32],"_configManager":[32],"showConfig":[64],"hideConfig":[64]}]]],["p-f3479d53",[[2,"snk-application",{"messagesBuilder":[1040],"configName":[1,"config-name"],"loadByPK":[16],"isUserSup":[64],"addPendingAction":[64],"callServiceBroker":[64],"initOnboarding":[64],"hasAccess":[64],"getAllAccess":[64],"getStringParam":[64],"getIntParam":[64],"getFloatParam":[64],"getBooleanParam":[64],"getDateParam":[64],"showPopUp":[64],"showModal":[64],"showAlerts":[64],"closeModal":[64],"closePopUp":[64],"temOpcional":[64],"getConfig":[64],"saveConfig":[64],"getAttributeFromHTMLWrapper":[64],"openApp":[64],"webConnection":[64],"createDataunit":[64],"updateDataunitCache":[64],"getDataUnit":[64],"addClientEvent":[64],"removeClientEvent":[64],"hasClientEvent":[64],"getResourceID":[64],"getUserID":[64],"alert":[64],"error":[64],"success":[64],"message":[64],"confirm":[64],"info":[64],"loadTotals":[64],"isLoadedByPk":[64],"executeSearch":[64],"executePreparedSearch":[64],"isDebugMode":[64],"getAppLabel":[64],"addSearchListener":[64],"importScript":[64],"getApplicationPath":[64],"executeSelectDistinct":[64],"getDataFetcher":[64]}]]],["p-0d5e8a37",[[6,"snk-simple-crud",{"dataState":[16],"dataUnit":[16],"mode":[2],"gridConfig":[16],"formConfig":[16],"multipleSelection":[4,"multiple-selection"],"useCancelConfirm":[4,"use-cancel-confirm"],"taskbarManager":[16],"messagesBuilder":[1040],"useEnterLikeTab":[4,"use-enter-like-tab"],"_currentViewMode":[32],"_config":[32],"goToView":[64],"setMetadata":[64],"setRecords":[64],"getRecords":[64]},[[0,"actionClick","actionClickListener"]]]]],["p-809a09ac",[[2,"snk-attach",{"registerKey":[1,"register-key"],"entityName":[1,"entity-name"],"messagesBuilder":[1040],"dataUnit":[32],"crudConfig":[32]}]]],["p-26b0ce3e",[[2,"snk-form-summary",{"fixed":[1540],"contracted":[1540],"summary":[16]}]]],["p-c555075c",[[6,"snk-form-view",{"levelPath":[1,"level-path"],"label":[1],"name":[1],"fields":[16],"formMetadata":[8,"form-metadata"],"dataUnit":[16],"contracted":[4],"fixed":[1540],"summaryFields":[16],"canExpand":[4,"can-expand"],"canFix":[4,"can-fix"],"recordsValidator":[16],"showUp":[64]}]]],["p-6e32de4b",[[2,"snk-actions-button",{"_items":[32],"_showDropdown":[32],"_actions":[32],"_isOrderActions":[32]}]]]]'),e)));
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { SortableEventNames } from '@shopify/draggable';
|
1
2
|
export declare const REPORT_LAUNCHER_RESOURCE_ID = "br.com.sankhya.controls.ReportLauncher";
|
2
3
|
export declare const KEY_PORT_EXPORT = "global.porta.app.impressao";
|
3
4
|
export declare const ALL_RECORD = "ALL_RECORD";
|
@@ -37,11 +38,9 @@ export declare const CONFIG_EVENTS: {
|
|
37
38
|
changeConfig: string;
|
38
39
|
configChanged: string;
|
39
40
|
fieldChanged: string;
|
40
|
-
|
41
|
-
dragSort: string;
|
42
|
-
dragSorted: string;
|
43
|
-
dragStop: string;
|
41
|
+
dragStartDistance: number;
|
44
42
|
};
|
43
|
+
export declare const CONFIG_SORTABLE_EVENTS: Record<string, SortableEventNames>;
|
45
44
|
export declare const KEY_EVENTS: {
|
46
45
|
enter: string;
|
47
46
|
arrowLeft: string;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@sankhyalabs/sankhyablocks",
|
3
|
-
"version": "8.9.
|
3
|
+
"version": "8.9.5",
|
4
4
|
"description": "Stencil Component Starter",
|
5
5
|
"main": "dist/index.cjs.js",
|
6
6
|
"module": "dist/index.js",
|
@@ -33,7 +33,7 @@
|
|
33
33
|
"prepare": "husky install"
|
34
34
|
},
|
35
35
|
"dependencies": {
|
36
|
-
"@shopify/draggable": "1.
|
36
|
+
"@shopify/draggable": "1.1.3",
|
37
37
|
"@stencil/store": "^2.0.4",
|
38
38
|
"graphql": "16.6.0",
|
39
39
|
"graphql-request": "^4.2.0"
|
@@ -1,20 +0,0 @@
|
|
1
|
-
'use strict';
|
2
|
-
|
3
|
-
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
4
|
-
|
5
|
-
function createCommonjsModule(fn, basedir, module) {
|
6
|
-
return module = {
|
7
|
-
path: basedir,
|
8
|
-
exports: {},
|
9
|
-
require: function (path, base) {
|
10
|
-
return commonjsRequire();
|
11
|
-
}
|
12
|
-
}, fn(module, module.exports), module.exports;
|
13
|
-
}
|
14
|
-
|
15
|
-
function commonjsRequire () {
|
16
|
-
throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');
|
17
|
-
}
|
18
|
-
|
19
|
-
exports.commonjsGlobal = commonjsGlobal;
|
20
|
-
exports.createCommonjsModule = createCommonjsModule;
|