udp-stencil-component-library 25.18.2-beta.11 → 25.18.2-beta.12
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/{SearchBuilder-C1sUitjQ.js → SearchBuilder-DYM_FL5l.js} +1 -1
- package/dist/cjs/advanced-search_12.cjs.entry.js +3 -3
- package/dist/cjs/ag-grid-base_6.cjs.entry.js +2 -2
- package/dist/cjs/ambient-template-grid.cjs.entry.js +3 -3
- package/dist/cjs/api-method-instance-grid.cjs.entry.js +1 -1
- package/dist/cjs/{apiUtils-DT-fLJOw.js → apiUtils-bDl8etNp.js} +1 -1
- package/dist/cjs/{catalog-store-BOiNPWZB.js → catalog-store-DIF1IDLi.js} +1 -1
- package/dist/cjs/entity-maintenance-grid.cjs.entry.js +2 -2
- package/dist/cjs/index.cjs.js +4 -4
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{makeApiCall-CFfg9gI0.js → makeApiCall-B9MMU_Ob.js} +4 -1
- package/dist/cjs/search-method-grid.cjs.entry.js +2 -2
- package/dist/cjs/stencil-library.cjs.js +1 -1
- package/dist/cjs/udp-forms-builder.cjs.entry.js +4 -4
- package/dist/cjs/udp-forms-renderer.cjs.entry.js +37 -19
- package/dist/collection/components/forms/udp-forms/udp-forms-builder/udp-forms-builder.js +4 -4
- package/dist/collection/components/forms/udp-forms/udp-forms-renderer/udp-forms-renderer.js +38 -3
- package/dist/collection/components/forms/udp-forms/udp-forms-utils/form-handler/UdpFormHandler.js +7 -7
- package/dist/collection/components/forms/udp-forms/udp-forms-utils/form-submission-handler/FormSubmissionHandler.js +14 -5
- package/dist/collection/components/forms/udp-forms/udp-forms-utils/form-submission-handler/FormSubmissionHandlerFactory.js +2 -2
- package/dist/collection/udp-utilities/api/makeApiCall/makeApiCall.js +4 -1
- package/dist/components/makeApiCall.js +1 -1
- package/dist/components/udp-forms-builder.js +1 -1
- package/dist/components/udp-forms-renderer.js +1 -1
- package/dist/docs.json +33 -3
- package/dist/esm/{SearchBuilder-CvKqGlUH.js → SearchBuilder-BjVdKjci.js} +1 -1
- package/dist/esm/advanced-search_12.entry.js +3 -3
- package/dist/esm/ag-grid-base_6.entry.js +2 -2
- package/dist/esm/ambient-template-grid.entry.js +3 -3
- package/dist/esm/api-method-instance-grid.entry.js +1 -1
- package/dist/esm/{apiUtils-cUHs50y0.js → apiUtils-11-yfzUs.js} +1 -1
- package/dist/esm/{catalog-store-BhgNAUY6.js → catalog-store-CbwcwIKF.js} +1 -1
- package/dist/esm/entity-maintenance-grid.entry.js +2 -2
- package/dist/esm/index.js +4 -4
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{makeApiCall-B-daVutk.js → makeApiCall-2umiVB6u.js} +4 -1
- package/dist/esm/search-method-grid.entry.js +2 -2
- package/dist/esm/stencil-library.js +1 -1
- package/dist/esm/udp-forms-builder.entry.js +4 -4
- package/dist/esm/udp-forms-renderer.entry.js +37 -19
- package/dist/stencil-library/{SearchBuilder-CvKqGlUH.js → SearchBuilder-BjVdKjci.js} +1 -1
- package/dist/stencil-library/advanced-search_12.entry.js +1 -1
- package/dist/stencil-library/ag-grid-base_6.entry.js +1 -1
- package/dist/stencil-library/ambient-template-grid.entry.js +1 -1
- package/dist/stencil-library/api-method-instance-grid.entry.js +1 -1
- package/dist/stencil-library/{apiUtils-cUHs50y0.js → apiUtils-11-yfzUs.js} +1 -1
- package/dist/stencil-library/{catalog-store-BhgNAUY6.js → catalog-store-CbwcwIKF.js} +1 -1
- package/dist/stencil-library/entity-maintenance-grid.entry.js +1 -1
- package/dist/stencil-library/index.esm.js +1 -1
- package/dist/stencil-library/makeApiCall-2umiVB6u.js +1 -0
- package/dist/stencil-library/search-method-grid.entry.js +1 -1
- package/dist/stencil-library/stencil-library.esm.js +1 -1
- package/dist/stencil-library/udp-forms-builder.entry.js +1 -1
- package/dist/stencil-library/udp-forms-renderer.entry.js +1 -1
- package/dist/types/components/forms/udp-forms/udp-forms-renderer/udp-forms-renderer.d.ts +1 -0
- package/dist/types/components/forms/udp-forms/udp-forms-utils/form-submission-handler/FormSubmissionHandler.d.ts +3 -1
- package/dist/types/components/forms/udp-forms/udp-forms-utils/form-submission-handler/FormSubmissionHandlerFactory.d.ts +1 -1
- package/dist/types/components.d.ts +4 -2
- package/dist/types/udp-utilities/api/makeApiCall/makeApiCall.d.ts +1 -1
- package/package.json +1 -1
- package/dist/stencil-library/makeApiCall-B-daVutk.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,h as e}from"./index-DFnjA9NX.js";import{m as i}from"./makeApiCall-
|
|
1
|
+
import{r as t,h as e}from"./index-DFnjA9NX.js";import{m as i}from"./makeApiCall-2umiVB6u.js";import o from"lodash/isEqual";import{c as r}from"./configureUdpColumnMods-CoCTzhve.js";import{C as a}from"./configService-BqLfkVKh.js";import"axios";function n(t){const e=t.replace(/\?$/,"").trim().toLowerCase();return"byte"===e||"short"===e||"int"===e||"long"===e||"float"===e||"double"===e||"decimal"===e?"number":"string"===e||"guid"===e?"text":"bool"===e||"boolean"===e?"boolean":"date"===e?"dateString":"datetime"===e?"dateTimeString":e.startsWith("dictionary")||"object"===e?"object":"text"}var d;!function(t){t[t.AND=1]="AND",t[t.OR=2]="OR"}(d||(d={}));const s=class{constructor(e){t(this,e),this.gridFunctions=[],this.apiMethodInstanceData={},this.searchMethodConfig=null}get entityName(){var t;return null===(t=this.apiMethodInstanceData)||void 0===t?void 0:t.returnObject}get querySearchObject(){var t;try{return(null===(t=this.apiMethodInstanceData)||void 0===t?void 0:t.body)?JSON.parse(this.apiMethodInstanceData.body):{}}catch(t){return console.error("Failed to parse apiMethodInstanceData.body:",t),{}}}handleGridReady(t){this.gridApi=t.detail,t.preventDefault()}async getApiMethodInstanceData(){if(!this.apiMethodInstanceId)return;const t=await i("GET",a.integrationV1ApiUrl+`/apiMethodInstance/${this.apiMethodInstanceId}`);this.apiMethodInstanceData=t}createColumnDefs(t,e){var i,a;if(!(null===(i=this.apiMethodInstanceData)||void 0===i?void 0:i.catalogModification))return;if(o(t,e))return;this.gridApi.setGridOption("context",Object.assign(Object.assign({},this.gridApi.getGridOption("context")),{apiMethodInstanceId:this.apiMethodInstanceId}));let d=JSON.parse(this.apiMethodInstanceData.catalogModification).map((t=>{var e;return{headerName:t.alias,field:t.name,tooltipField:t.name,sortable:t.extendedProperties.orderable,rowGroup:t.groupBy,hide:t.groupBy,cellDataType:t.extendedProperties.lookup?"text":n(t.type),context:Object.assign({lookupId:null===(e=null==t?void 0:t.extendedProperties)||void 0===e?void 0:e.lookup},t)}}));this.columnDefOverrides&&this.columnDefOverrides.length>0&&this.columnDefOverrides.forEach((t=>{const e=d.findIndex((e=>e.field===t.field));e>-1?d[e]=Object.assign(Object.assign({},d[e]),t):"actions"===t.field&&d.push(t)}));const s=r(d,null===(a=this.gridFunctions)||void 0===a?void 0:a.some((t=>"advancedSearch"===(null==t?void 0:t.name))));this.gridApi.setGridOption("columnDefs",s)}updateSearchMethodConfig(){var t;if(!(null===(t=this.apiMethodInstanceData)||void 0===t?void 0:t.apiMethodId))return void(this.searchMethodConfig=null);const e=function(t,e){var i,o,r,a,n,s,c;if(!t||!e||!(null===(i=e.filterElements)||void 0===i?void 0:i.length))return t;const l=[...(null===(o=t.filterGroups)||void 0===o?void 0:o.map((t=>t.groupId)))||[],...(null===(r=e.filterGroups)||void 0===r?void 0:r.map((t=>t.groupId)))||[]],h=l.length>0?Math.max(...l):0,u=h+1,p=h+2,v={groupId:u,logicalSearchOperator:t.logicalSearchOperator||d.AND,parentGroupId:null},f={groupId:p,logicalSearchOperator:e.logicalSearchOperator||d.AND,parentGroupId:null},g=(null===(a=t.filterElements)||void 0===a?void 0:a.map((t=>Object.assign(Object.assign({},t),{groupId:u}))))||[],m=(null===(n=t.filterGroups)||void 0===n?void 0:n.map((t=>Object.assign(Object.assign({},t),{parentGroupId:u}))))||[],b=(null===(s=e.filterElements)||void 0===s?void 0:s.map((t=>Object.assign(Object.assign({},t),{groupId:p}))))||[],O=(null===(c=e.filterGroups)||void 0===c?void 0:c.map((t=>Object.assign(Object.assign({},t),{parentGroupId:p}))))||[];return Object.assign(Object.assign({},t),{logicalSearchOperator:d.AND,filterElements:[...g,...b],filterGroups:[...m,...O,v,f]})}(this.querySearchObject,this.defaultSearchObject);this.searchMethodConfig={apiMethodId:this.apiMethodInstanceData.apiMethodId,customSearchObject:e}}updateApiMethodInstanceId(){this.getApiMethodInstanceData()}componentWillLoad(){this.getApiMethodInstanceData()}render(){return e("search-method-grid",{key:"33e4a95cef2df0e1bad3284a3ac51a9adc41b07f",onGridReady:t=>this.handleGridReady(t),gridFunctions:this.gridFunctions,gridOptions:this.gridOptions,gridHeaderConfig:this.gridHeaderConfig,gridId:this.gridId,entityName:this.entityName,gridHeight:this.gridHeight,searchMethodConfig:this.searchMethodConfig,gridApiCallback:this.gridApiCallback})}static get watchers(){return{apiMethodInstanceData:[{createColumnDefs:0},{updateSearchMethodConfig:0}],columnDefOverrides:[{createColumnDefs:0}],defaultSearchObject:[{updateSearchMethodConfig:0}],apiMethodInstanceId:[{updateApiMethodInstanceId:0}]}}};export{s as api_method_instance_grid}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import t from"deep-equal";import{m as a}from"./makeApiCall-
|
|
1
|
+
import t from"deep-equal";import{m as a}from"./makeApiCall-2umiVB6u.js";import{C as e}from"./configService-BqLfkVKh.js";import{createStore as s}from"@stencil/store";import{g as n}from"./tenantUtils-Basdb1b1.js";let o=null;const i=async()=>(o||await(async()=>{await e.waitForConfig(),o={baseURL:e.integrationV1ApiUrl,baseURLV2:e.integrationV2ApiUrl,baseURLTenantV1:e.tenantV1ApiUrl,baseURLTenantV2:e.tenantV2ApiUrl,baseURLHost:e.productV1ApiUrl,securityServiceV1:e.securityV1ApiUrl}})(),o),{state:r,onChange:c}=s({lookupsDataMap:null});function l(t,a=!1){r.lookupsDataMap=a?t:Object.assign(Object.assign({},r.lookupsDataMap),t)}var d=Object.freeze({__proto__:null,onChange:c,setLookupsDataMap:l,state:r});(async()=>{const t=await i();console.log("Base URL:",t.baseURL)})();const u=async()=>{const{baseURL:t}=await i();console.log("baseURL from External config:",t);const s=`${t}/tenantProductApiCatalogBase/tenant/${n()}/product/${e.config.UNITY_PRODUCT_ID}`;return a("GET",s)},p=async(t,s,n=!1)=>{const{baseURL:o}=await i();return console.log("baseURL from External config:",o),a("GET",`${o}/apicatalog/${t}/promotedMethodEntities/${s}/product/${e.config.UNITY_PRODUCT_ID}?compareSanitizedName=${n}`)};let m;const $=(e,s,o,r=!1)=>{const c=[e,s,n(),"hotlist"!=o];if(!r&&m){if(t(m.args,c)){const{response:t}=m;return console.info(`Using prefetch for /apimethod/executeQueryAdHoc/${s} prefetch`,m.args,c),m=void 0,t}console.warn(`Failed to match arguments for /apimethod/executeQueryAdHoc/${s} prefetch:\nPrefetch args: %o\nExecute args: %o`,m.args,c),m=void 0}const l=i().then((({baseURL:t,baseURLHost:n})=>a("POST","hotlist"!=o?`${t}/apimethod/executeQueryAdHoc/${s}`:`${n}/UdpHotList/containingRecord`,e)));return r&&(console.info(`Prefetching /apimethod/executeQueryAdHoc/${s}`),m={args:c,response:l}),l},b=async t=>{const{baseURL:e}=await i();return a("GET",`${e}/apiCatalog/${t}`)},w=async(t,e)=>{console.log("executeQueryWithParameters called",e);const{baseURL:s}=await i();console.log("baseURL from External config:",s);const n=`${s}/apimethod/executeQueryWithParameters/${e}`;return await a("POST",n,t)};class f{constructor(){this.pageList=[]}}function y(t){const{state:a}=d;return a.lookupsDataMap&&t?a.lookupsDataMap[t]:null}function U(t,a){let e=Object.assign({},t);return a&&e&&Object.keys(a).forEach((t=>{const s=y(a[t].value);if(Array.isArray(e))e.forEach(((a,n)=>{var o;let i=a[t],r=null===(o=null==s?void 0:s.data)||void 0===o?void 0:o.find((t=>t[s.valueName]===i));null!=r&&(e[n][t]=r[s.keyName])}));else if(e[t]){let a=e[t],n=s.data.find((t=>t[s.valueName]===a));null!=n&&(e[t]=n[s.keyName])}})),e}const L=async(t={},a={},e,s,n,o,i)=>{const{lookupApiMethodId:r,prefetch:c=!1}=i;console.info("Udp Lookup Api Method Id IS Set",r),t[0].logicalSearchOperator=e;const d=Object.assign({},...t);let u=Object.assign({},d);a&&Array.isArray(a)&&a.length>0&&(u=Object.assign(Object.assign({},u),{filterElements:[...d.filterElements,...a]})),console.log("filter object AUI",JSON.stringify(u,null,2));const p=await $(u,s,"",c);return console.log("response from QUAD",p),r?await async function(t,a,e,s){let n=new f,o={};if(!a)return console.error("Could not retrieve query data"),null;o=s||(null==a?void 0:a.lookupsMap)||{},n=a;const i=[],r={};Object.keys(o).forEach((a=>{const s=o[a];if(null==s?void 0:s.value){const n=!e&&y(s.value),c={id:s.value};n?r[a]={data:n.data,keyName:s.lookupKeyName||n.keyName,valueName:s.lookupValueName||n.valueName,businessObjectKey:n.businessObjectKey}:i.push(Promise.resolve(t).then((t=>w({data:c},t))).then((t=>{if(t){const s=o[a];r[a]={data:t.data,keyName:s.lookupKeyName||t.keyName,valueName:s.lookupValueName||t.valueName,businessObjectKey:t.businessObjectKey},l({[t.id]:t},e)}})).catch((t=>t)))}})),await Promise.all(i);const c=((t={},a=[])=>a.map((a=>{const e=Object.assign({},a);return Object.keys(t).forEach((s=>{var n;const o=t[s],i=a[s];if(null!=i){const t=null===(n=null==o?void 0:o.data)||void 0===n?void 0:n.find((t=>!(!o.keyName||!t[o.keyName])&&t[o.keyName].toString()===i.toString()));t&&o.valueName&&(e[s]=t[o.valueName])}})),e})))(r,n.pageList);return n.pageList=c,n}(r,p,o,n):(console.log("response from executeQueryAdHocAndMapLookups",p),null==p?void 0:p.data)},g=async(t,e)=>{const{baseURLTenantV2:s}=await i(),n=`${s}/GridView/${t}/PartiallyFull`,o=await a("GET",n);console.log("data from utils:",o),e(o)},T=async(t,e)=>{const{baseURLTenantV2:s}=await i(),n=`${s}/GridView/${t}`,o=await a("DELETE",n);console.log("data from utils:",o),e(o)},R=async(t,e,s,n,o)=>{const{baseURLTenantV2:r}=await i(),c=`${r}/GridView/getFromUser/${t}/${e}?domainName=${n}&apiCatalogId=${s}`;o(await a("GET",c))},E=async(t,e)=>{const{baseURLTenantV2:s}=await i(),n=`${s}/GridView/gridConfigurations/${t}/${e}`;return await a("GET",n)},V=async(t,e,s,o,r,c,l,d,u)=>{const{baseURLTenantV2:p}=await i(),m=`${p}/GridView/createGridView`,$={gridView:{Name:o,GridViewVisibilityTypeId:l,isDefault:d,tenantId:n(),userId:t,gridId:e,domain:r,apiCatalogId:s},gridConfigurations:c};u(await a("POST",m,$))},h=async(t,e,s,o,r,c,l,d,u,p)=>{const{baseURLTenantV2:m}=await i(),$=`${m}/GridView/updateGridView/${t}`,b={gridView:{Name:r,GridViewVisibilityTypeId:u,isDefault:l,tenantId:n(),userId:e,gridId:s,domain:d,apiCatalogId:o},gridConfigurations:c};try{p(await a("PUT",$,b))}catch(t){console.error("Error updating view:",t)}},G=async(t,e,s,o,r,c,l,d,u)=>{const{baseURLTenantV2:p}=await i(),m=`${p}/GridView/${t}`,$={Name:r,GridViewVisibilityTypeId:d,isDefault:c,tenantId:n(),userId:e,gridId:s,domain:l,apiCatalogId:o};try{const t=await a("PUT",m,$);return u(t),t}catch(t){console.error("Error updating view:",t)}},I=async(t,e,s,n)=>{const{baseURLV2:o}=await i(),r=`${o}/action/grid/${t}`,c=await a("GET",r);if(e){const t=(await a("GET",`${o}/actionPermission`)).filter((t=>s.some((a=>a.permissionId===t.permissionId))));n(c.filter((a=>t.some((t=>t.actionId===a.actionId)))))}else n(c)};console.log("dynamicTenantId:",null);const v=async t=>{const{baseURL:e}=await i();return console.log("baseURL from External config:",e),a("GET",`${e}/apimethodinstance/${t}`,{data:{}})},O=async t=>{const{baseURL:e}=await i();return console.log("baseURL from External config:",e),a("GET",`${e}/apimethod/${t}`)},j=async t=>{const s=`lookupMethod-${t}`,n=sessionStorage.getItem(s);if(n)return JSON.parse(n);const{baseURL:o}=await i(),r=`${o}/apicatalog/${t}/promotedMethodEntities/UdpLookup/product/${e.config.UNITY_PRODUCT_ID}?compareSanitizedName=true`,c=await a("GET",r);return c&&sessionStorage.setItem(s,JSON.stringify(c)),c},H=async()=>{const{baseURLHost:t}=await i();return a("GET",`${t}/UdpHotList`,null)},S=async t=>{const{baseURLHost:e}=await i();return a("POST",`${e}/UdpHotList`,t)},P=async t=>{const{baseURLHost:e}=await i();return a("DELETE",`${e}/UdpHotList/${t}`,null)},x=async t=>{const{baseURLHost:e}=await i();return a("POST",`${e}/UdpHotListRecord`,t,!0)},C=async t=>{const{baseURLHost:e}=await i();return a("GET",`${e}/UdpHotList/${t}/full`,null,!0)},A=async t=>{const{baseURLHost:e}=await i();return a("DELETE",`${e}/udphotlistrecord/${t}`,null,!0)},N=async(t,e)=>{const{baseURLTenantV2:s}=await i();return a("GET",`${s}/GridConfiguration/gridId/${t}?gridStateTypeId=${e}`,null)};export{u as a,v as b,O as c,j as d,b as e,R as f,U as g,g as h,T as i,H as j,x as k,P as l,C as m,S as n,$ as o,I as p,w as q,h as r,V as s,A as t,G as u,L as v,p as w,E as x,N as y}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createStore as a}from"@stencil/store";import{e as t}from"./apiUtils-
|
|
1
|
+
import{createStore as a}from"@stencil/store";import{e as t}from"./apiUtils-11-yfzUs.js";const{state:o,onChange:s}=a({catalogData:null,isLoadingCatalogData:!1,hotListActive:""});async function l(a){o.isLoadingCatalogData=!0;try{const s=await t(a);console.log("store state was"),o.catalogData=s}catch(a){console.error("Error loading catalog data:",a),o.catalogData=null}finally{o.isLoadingCatalogData=!1}}export{l,s as o,o as s}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as i,h as s}from"./index-DFnjA9NX.js";import{w as e}from"./apiUtils-
|
|
1
|
+
import{r as t,c as i,h as s}from"./index-DFnjA9NX.js";import{w as e}from"./apiUtils-11-yfzUs.js";import"deep-equal";import"./makeApiCall-2umiVB6u.js";import"axios";import"./configService-BqLfkVKh.js";import"@stencil/store";import"./tenantUtils-Basdb1b1.js";const o=class{constructor(s){t(this,s),this.gridReady=i(this,"gridReady"),this.promotedEntityMethods={}}handleGridReady(t){this.gridApi=t.detail,console.log(this.gridApi)}async getPromotedMethods(){const t=await e("",this.entityName,!0);this.promotedEntityMethods=t;const i=await e("","udpObjectInfo",!0);this.udpObjectInfoMethods=i,console.log(this.udpObjectInfoMethods),this.promotedEntityMethods=t}componentWillLoad(){this.gridHeaderConfig={title:this.entityName+" Maintenance Grid"},this.getPromotedMethods()}render(){return s("api-method-grid",{key:"fc83d69ce7476b4494ca6afcce903d4ff236f502",onGridReady:t=>this.handleGridReady(t),gridHeaderConfig:this.gridHeaderConfig})}};export{o as entity_maintenance_grid}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"axios";export{c as convertToAgGridColumns,a as createStructuredQuery,d as defaultPayload,b as demoMSSearchData,t as transformSearchData}from"./transformSearchData-DBjFnXu6.js";export{l as loadCatalogData,o as onChange,s as state}from"./catalog-store-
|
|
1
|
+
import e from"axios";export{c as convertToAgGridColumns,a as createStructuredQuery,d as defaultPayload,b as demoMSSearchData,t as transformSearchData}from"./transformSearchData-DBjFnXu6.js";export{l as loadCatalogData,o as onChange,s as state}from"./catalog-store-CbwcwIKF.js";export{L as LogicalSearchOperator,S as SearchBuilder,b as SearchGroupingType,a as SearchUtilities,c as SqlFilterOperators}from"./SearchBuilder-BjVdKjci.js";export{C as ConfigService}from"./configService-BqLfkVKh.js";import"@stencil/store";import"./apiUtils-11-yfzUs.js";import"deep-equal";import"./makeApiCall-2umiVB6u.js";import"./tenantUtils-Basdb1b1.js";const i=(t,e)=>{const i=(null==e?void 0:e.headers)?Object.assign({},e.headers):{};return i.currentTenantId=t,Object.assign(Object.assign({},e),{headers:i})},r=async(t,i,s,r)=>e(Object.assign(Object.assign(Object.assign({},{url:`${t}/${i}`}),s),r));function n(t){return getComputedStyle(document.documentElement).getPropertyValue(t)}const h={xs:`(max-width: ${n("--breakpoint-xs-max")}px)`,sm:`(min-width: ${n("--breakpoint-sm-min")}px) and (max-width: ${n("--breakpoint-sm-max")}px)`,md:`(min-width: ${n("--breakpoint-md-min")}px) and (max-width: ${n("--breakpoint-md-max")}px)`,lg:`(min-width: ${n("--breakpoint-lg-min")}px) and (max-width: ${n("--breakpoint-lg-max")}px)`,xl:`(min-width: ${n("--breakpoint-xl-min")}px)`};function p(t){return"undefined"!=typeof window&&window.matchMedia(h[t]).matches}class m{get isConnected(){var t;return(null===(t=this.socket)||void 0===t?void 0:t.readyState)===WebSocket.OPEN}async connect(t,e,i=0,s=0){var r;if(!this.isWssUrl(t))throw new Error("Invalid WebSocket URL. Only ws and wss protocols are supported.");const o=await e();this.socket=o?new WebSocket(t,o):new WebSocket(t),await new Promise(((t,e)=>{const i=()=>{this.socket.removeEventListener("open",i),this.socket.removeEventListener("error",s),t()},s=t=>{this.socket.removeEventListener("open",i),this.socket.removeEventListener("error",s),e(t)};this.socket.addEventListener("open",i),this.socket.addEventListener("error",s)})),null===(r=this.openHandler)||void 0===r||r.call(this),this.socket.onmessage=t=>this.handleMessage(t),this.socket.onclose=t=>this.handleClose(t),this.socket.onerror=t=>this.handleError(t),i&&s&&this.startKeepAliveTimer(i,s)}onMessageReceived(t){return this.messageReceivedHandler=t,this}onOpen(t){return this.openHandler=t,this}onClose(t){return this.closeHandler=t,this}onError(t){return this.errorHandler=t,this}send(t){if(!this.isConnected)throw new Error("WebSocket is not connected.");const e=JSON.stringify(t);this.socket.send(e)}close(){this.socket&&(this.socket.close(),this.stopKeepAliveTimer(),this.socket=void 0)}handleMessage(t){var e;try{const i=JSON.parse(t.data);null===(e=this.messageReceivedHandler)||void 0===e||e.call(this,i)}catch(t){console.error("Invalid UdpWebSocketMessage received:",t)}}handleClose(t){var e;null===(e=this.closeHandler)||void 0===e||e.call(this,t),this.close()}handleError(t){var e;null===(e=this.errorHandler)||void 0===e||e.call(this,t),console.error("UdpWebSocket error:",t)}startKeepAliveTimer(t,e){this.stopKeepAliveTimer(),this.keepAliveIntervalId=window.setInterval((()=>{this.sendKeepAlivePing()}),t),this.keepAliveTimeoutId=window.setTimeout((()=>{this.close()}),e)}stopKeepAliveTimer(){this.keepAliveIntervalId&&clearInterval(this.keepAliveIntervalId),this.keepAliveTimeoutId&&clearTimeout(this.keepAliveTimeoutId),this.keepAliveIntervalId=void 0,this.keepAliveTimeoutId=void 0}sendKeepAlivePing(){const t={headers:{type:"KeepAlive",timestamp:Date.now()}};try{this.send(t)}catch(t){console.error("KeepAlive ping failed to send:",t)}}isWssUrl(t){return/^wss?:\/\//.test(t)}}m.DEFAULT_KEEPALIVE_INTERVAL_MS=3e4,m.DEFAULT_KEEPALIVE_TIMEOUT_MS=36e5;export{m as UdpWebSocketClient,r as apiMutate,i as getMergedConfig,p as useMatchBreakpoint}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import n from"axios";const o=n=>{const o=new FormData;return Object.entries(n).forEach((([n,t])=>{null!=t&&(t instanceof File||t instanceof Blob?o.append(n,t):Array.isArray(t)?t.forEach(((t,e)=>{t instanceof File||t instanceof Blob?o.append(`${n}[${e}]`,t):o.append(`${n}[${e}]`,String(t))})):o.append(n,String(t)))})),o},t=async(o,t,e,a=!1,l)=>{var c;const s=e instanceof FormData,i={};s||(i["Content-Type"]="application/json"),l&&Object.assign(i,l);let r=null;e&&(r=s||a?e:null!==(c=null==e?void 0:e.data)&&void 0!==c?c:e);const u={method:o,url:t,headers:i,timeout:3e5};["POST","PUT","PATCH"].includes(o)&&null!=r&&(u.data=s?r:JSON.stringify(r));try{const e=await n(u);return console.log(`${o} ${t} - Response:`,e.data),e.data}catch(n){throw console.error(`${o} ${t} - API call failed:`,n),n}};export{o as c,t as m}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as e,h as r}from"./index-DFnjA9NX.js";import{d as o,q as i,o as a}from"./apiUtils-
|
|
1
|
+
import{r as t,c as e,h as r}from"./index-DFnjA9NX.js";import{d as o,q as i,o as a}from"./apiUtils-11-yfzUs.js";import{g as n}from"./getCurrentApiCatalogId-DeurXd9l.js";import{m as s}from"./makeApiCall-2umiVB6u.js";import{C as l}from"./configService-BqLfkVKh.js";import c from"lodash/isEqual";import"deep-equal";import"@stencil/store";import"./tenantUtils-Basdb1b1.js";import"axios";const u={equals:"=",contains:"LIKE",notEqual:"<>",greaterThan:">",lessThan:"<",greaterThanOrEqual:">=",lessThanOrEqual:"<=",between:"BETWEEN",inRange:"BETWEEN",blank:"NULL",notBlank:"NOTNULL",startsWith:"STARTSWITH"};function d(t){return t.charAt(0).toUpperCase()+t.slice(1)}const h=class{constructor(r){t(this,r),this.gridReady=e(this,"gridReady"),this.columnDefs=[],this.gridFunctions=[]}handleGridReady(t){this.gridApi=t.detail,this.setDatasource(),this.setGridModel()}handleSearchMethodUpdate(t,e){c(t,e)||(this.setDatasource(),this.setGridModel())}setDatasource(){if(!this.searchMethodConfig)return;const{apiMethodId:t,customSearchObject:e,requestUrl:r}=this.searchMethodConfig;e&&(null==e?void 0:e.pageSize)&&this.gridApi.setGridOption("cacheBlockSize",null==e?void 0:e.pageSize),(t||r)&&(this.dataSource=(t=>{const{apiMethodId:e,requestUrl:r,externalSearchObject:c={}}=t;return{async getRows(t){var h,p,f,g,v;const{startRow:m,endRow:O,filterModel:I,sortModel:b,rowGroupCols:j,groupKeys:w,valueCols:S}=t.request;let C=1;const y=O-m;let E={pageNumber:Math.floor(m/y)+1,pageSize:y,orderElements:[],filterElements:[],filterGroups:[],groupProperty:[],groupOperationList:[],groupingType:"",eagerLoad:!1,logicalSearchOperator:1};c&&(E=Object.assign(Object.assign(Object.assign({},E),structuredClone(c)),{filterElements:[...null!==(h=E.filterElements)&&void 0!==h?h:[],...null!==(p=c.filterElements)&&void 0!==p?p:[]],filterGroups:[...null!==(f=E.filterGroups)&&void 0!==f?f:[],...null!==(g=c.filterGroups)&&void 0!==g?g:[]]})),(null==b?void 0:b.length)&&function(t,e){t.orderElements=[...t.orderElements,...e.map((t=>({sortColumn:d(t.colId),sortDirection:t.sort.toUpperCase()})))]}(E,b),I&&Object.keys(I).length&&(C=function(t,e,r=null,o){if(!e)return o;if(t.filterElements||(t.filterElements=[]),t.filterGroups||(t.filterGroups=[]),!e.filterType){for(const t of Object.keys(e))i(e[t],null,t);return o}function i(e,r,a){if(!e)return-1;if("join"===e.filterType&&Array.isArray(e.conditions)){const a=o++;t.filterGroups.push({groupId:a,logicalSearchOperator:"AND"===e.type?1:2,parentGroupId:r});for(const t of e.conditions)i(t,a);return a}if(e.conditions){const n=o++;t.filterGroups.push({groupId:n,logicalSearchOperator:"AND"===e.operator?1:2,parentGroupId:r});for(const t of e.conditions)i(t,n,a);return-1}return"text"!==e.filterType&&"number"!==e.filterType||t.filterElements.push("true"===e.type||"false"===e.type?{searchField:d(null!=a?a:e.colId),searchValue:e.type,searchOperator:"=",groupId:r}:{searchField:d(null!=a?a:e.colId),searchValue:`${e.filter}${e.filterTo?`,${e.filterTo}`:""}`,searchOperator:u[e.type],groupId:r}),"date"===e.filterType&&t.filterElements.push({searchField:d(null!=a?a:e.colId),searchValue:`${e.dateFrom}${e.dateTo?`,${e.dateTo}`:""}`,searchOperator:u[e.type],groupId:r}),"set"===e.filterType&&t.filterElements.push({searchField:d(a),searchValue:e.values.join(),searchOperator:"IN",groupId:r}),-1}return i(e,r),o}(E,I,null,C)),(null==j?void 0:j.length)>0&&function(t,e,r,o){t.groupProperty=e.map((t=>t.field)),t.filterElements=[...t.filterElements,...r.map(((t,r)=>{var o;return{searchField:null===(o=e[r])||void 0===o?void 0:o.field,searchOperator:"=",searchValue:t,searchValueType:1,groupId:1}}))],t.orderElements=[...t.orderElements,...e.map((t=>({sortColumn:t.field,sortDirection:"ASC"})))],console.log(o),0===(null==r?void 0:r.length)&&(t.groupingType="DISTINCT")}(E,j,w,S),t.api.setGridOption("context",Object.assign(Object.assign({},t.api.getGridOption("context")),{searchObject:E}));try{let c;if(r?c=await s("POST",r,E):e?c=await a(E,e,l.config.UNITY_API_DOMAIN+l.integrationV1ApiUrl,!1):(console.error("No apiMethodId or url provided to search grid"),t.fail()),null===(v=null==c?void 0:c.pageList)||void 0===v?void 0:v.length){let e=c.pageList;const r=t.api.getColumnDefs();e=await async function(t,e){var r,a;if(!(null==t?void 0:t.length))return t;const s=new Map;if(e.forEach((t=>{var e;const r=null===(e=null==t?void 0:t.context)||void 0===e?void 0:e.lookupId;if(r&&"string"==typeof r&&t.field){const e=s.get(r);e?e.columnFields.push(t.field):s.set(r,{columnFields:[t.field]})}})),0===s.size)return t;const l=null===(a=null===(r=await o(n()))||void 0===r?void 0:r.unityBaseGetDataMethod)||void 0===a?void 0:a.apiMethodId;if(!l)return t;const c=Array.from(s.keys()).map((t=>i({data:{id:t}},l).then((e=>Object.assign({lookupId:t},e))).catch((()=>({lookupId:t,data:[]}))))),u=await Promise.all(c),d=new Map;return u.forEach((t=>{const e=s.get(t.lookupId),r=t.keyName,o=t.valueName;if(t.data&&r&&o){const i=new Map(t.data.map((t=>[t[r],t[o]])));for(const t of e.columnFields)d.set(t,i)}})),t.map((t=>{const e=Object.assign({},t);for(const[t,r]of d.entries())null!=e[t]&&r.has(e[t])&&(e[t+"LookupValue"]=r.get(e[t]));return e}))}(c.pageList,r),t.api.setGridOption("context",Object.assign(Object.assign({},t.api.getGridOption("context")),{rowCount:parseInt(c.total)})),t.success({rowData:e,rowCount:parseInt(c.total)})}else t.success({rowData:[],rowCount:0})}catch(e){console.error("Failed to fetch data:",e),t.fail()}}}})({apiMethodId:t,requestUrl:r,externalSearchObject:{filterElements:null==e?void 0:e.filterElements,filterGroups:null==e?void 0:e.filterGroups,logicalSearchOperator:null==e?void 0:e.logicalSearchOperator,eagerLoad:(null==e?void 0:e.eagerLoad)||!1}}))}setGridModel(){if(!this.searchMethodConfig)return;const{customSearchObject:t}=this.searchMethodConfig;if(t){const e=function(t){var e,r;const o=[];return(null===(e=null==t?void 0:t.orderElements)||void 0===e?void 0:e.length)&&o.push(...t.orderElements.map(((t,e)=>({colId:t.sortColumn,sort:t.sortDirection.toLowerCase(),sortIndex:e})))),(null===(r=null==t?void 0:t.groupProperty)||void 0===r?void 0:r.length)&&o.push(...t.groupProperty.map(((t,e)=>({colId:t,rowGroup:!0,rowGroupIndex:e})))),o}(t);this.gridApi.applyColumnState({state:e})}}render(){return r("server-side-grid",{key:"01d53dbfb1d9d8b959cb2c9ac3e75c229fff23f6",onGridReady:t=>this.handleGridReady(t),dataSource:this.dataSource,gridFunctions:this.gridFunctions,columnDefs:this.columnDefs,gridOptions:this.gridOptions,gridHeaderConfig:this.gridHeaderConfig,gridId:this.gridId,entityName:this.entityName,gridHeight:this.gridHeight,gridApiCallback:this.gridApiCallback})}static get watchers(){return{searchMethodConfig:[{handleSearchMethodUpdate:0}]}}};export{h as search_method_grid}
|