@everymatrix/user-transaction-history 1.32.4 → 1.33.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/dist/cjs/index-206e75cb.js +1416 -0
  2. package/dist/cjs/index.cjs.js +2 -0
  3. package/dist/cjs/loader.cjs.js +21 -0
  4. package/dist/cjs/user-transaction-history.cjs.entry.js +347 -0
  5. package/dist/cjs/user-transaction-history.cjs.js +19 -0
  6. package/dist/collection/assets/filter.svg +4 -0
  7. package/dist/collection/assets/warning.svg +4 -0
  8. package/dist/collection/collection-manifest.json +12 -0
  9. package/dist/collection/components/internal/filters.js +22 -0
  10. package/dist/collection/components/internal/loader.js +14 -0
  11. package/dist/collection/components/internal/page-size.js +7 -0
  12. package/dist/collection/components/internal/table.js +31 -0
  13. package/dist/collection/components/internal/transaction.js +14 -0
  14. package/dist/collection/components/user-transaction-history/user-transaction-history.css +406 -0
  15. package/dist/collection/components/user-transaction-history/user-transaction-history.js +357 -0
  16. package/dist/collection/contracts/translation.js +1 -0
  17. package/dist/collection/global/app.js +1 -0
  18. package/dist/collection/index.js +1 -0
  19. package/dist/collection/models/transactions-response.model.js +1 -0
  20. package/dist/collection/utils/currency.utils.js +18 -0
  21. package/dist/collection/utils/date.util.js +8 -0
  22. package/dist/collection/utils/locale.util.js +69 -0
  23. package/dist/components/index.d.ts +26 -0
  24. package/dist/components/index.js +1 -0
  25. package/dist/components/user-transaction-history.d.ts +11 -0
  26. package/dist/components/user-transaction-history.js +378 -0
  27. package/dist/esm/index-32e3ae05.js +1388 -0
  28. package/dist/esm/index.js +1 -0
  29. package/dist/esm/loader.js +17 -0
  30. package/dist/esm/polyfills/core-js.js +11 -0
  31. package/dist/esm/polyfills/css-shim.js +1 -0
  32. package/dist/esm/polyfills/dom.js +79 -0
  33. package/dist/esm/polyfills/es5-html-element.js +1 -0
  34. package/dist/esm/polyfills/index.js +34 -0
  35. package/dist/esm/polyfills/system.js +6 -0
  36. package/dist/esm/user-transaction-history.entry.js +343 -0
  37. package/dist/esm/user-transaction-history.js +17 -0
  38. package/dist/index.cjs.js +1 -0
  39. package/dist/index.js +1 -0
  40. package/dist/stencil.config.js +22 -0
  41. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-stencil/packages/user-transaction-history/.stencil/packages/user-transaction-history/stencil.config.d.ts +2 -0
  42. package/dist/types/components/internal/filters.d.ts +8 -0
  43. package/dist/types/components/internal/loader.d.ts +2 -0
  44. package/dist/types/components/internal/page-size.d.ts +9 -0
  45. package/dist/types/components/internal/table.d.ts +7 -0
  46. package/dist/types/components/internal/transaction.d.ts +3 -0
  47. package/dist/types/components/user-transaction-history/user-transaction-history.d.ts +40 -0
  48. package/dist/types/components.d.ts +53 -0
  49. package/dist/types/contracts/translation.d.ts +2 -0
  50. package/dist/types/global/app.d.ts +1 -0
  51. package/dist/types/index.d.ts +1 -0
  52. package/dist/types/models/transactions-response.model.d.ts +23 -0
  53. package/dist/types/stencil-public-runtime.d.ts +1565 -0
  54. package/dist/types/utils/currency.utils.d.ts +4 -0
  55. package/dist/types/utils/date.util.d.ts +4 -0
  56. package/dist/types/utils/locale.util.d.ts +42 -0
  57. package/dist/user-transaction-history/index.esm.js +0 -0
  58. package/dist/user-transaction-history/p-10b5b959.js +1 -0
  59. package/dist/user-transaction-history/p-c71395aa.entry.js +1 -0
  60. package/dist/user-transaction-history/user-transaction-history.esm.js +1 -0
  61. package/loader/cdn.js +3 -0
  62. package/loader/index.cjs.js +3 -0
  63. package/loader/index.d.ts +12 -0
  64. package/loader/index.es2017.js +3 -0
  65. package/loader/index.js +4 -0
  66. package/loader/package.json +10 -0
  67. package/package.json +2 -3
  68. package/LICENSE +0 -21
@@ -0,0 +1,4 @@
1
+ export declare class CurrencyFormatter {
2
+ private constructor();
3
+ static format(currency: string, value: number): string;
4
+ }
@@ -0,0 +1,4 @@
1
+ export declare class DateTransformer {
2
+ protected constructor();
3
+ static dateToFormatedString(date: Date): string;
4
+ }
@@ -0,0 +1,42 @@
1
+ export declare const DEFAULT_TRANSLATIONS: {
2
+ en: {
3
+ deposit: string;
4
+ withdrawals: string;
5
+ show: string;
6
+ from: string;
7
+ to: string;
8
+ filter: string;
9
+ transactionId: string;
10
+ date: string;
11
+ amount: string;
12
+ productType: string;
13
+ status: string;
14
+ noData: string;
15
+ };
16
+ hr: {
17
+ deposit: string;
18
+ withdrawals: string;
19
+ show: string;
20
+ from: string;
21
+ to: string;
22
+ filter: string;
23
+ transactionId: string;
24
+ date: string;
25
+ amount: string;
26
+ productType: string;
27
+ status: string;
28
+ noData: string;
29
+ };
30
+ };
31
+ export declare class Localization {
32
+ static readonly defaultLanguage: string;
33
+ private static supportedLanguages;
34
+ private static customLanguages?;
35
+ private static defaultTranslation;
36
+ private static customTranslation?;
37
+ protected constructor();
38
+ static loadCustomTranslations(translationUrl: string): Promise<void>;
39
+ static translate(key: string, locale: string): string;
40
+ private static getAvaliableLanguages;
41
+ private static updateTranslations;
42
+ }
File without changes
@@ -0,0 +1 @@
1
+ let e,t,n=!1,l=!1;const s="undefined"!=typeof window?window:{},o=s.document||{head:{}},i={t:0,l:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,l)=>e.addEventListener(t,n,l),rel:(e,t,n,l)=>e.removeEventListener(t,n,l),ce:(e,t)=>new CustomEvent(e,t)},r=e=>Promise.resolve(e),c=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replace}catch(e){}return!1})(),u=(e,t,n)=>{n&&n.map((([n,l,s])=>{const o=a(e,n),r=f(t,s),c=h(n);i.ael(o,l,r,c),(t.o=t.o||[]).push((()=>i.rel(o,l,r,c)))}))},f=(e,t)=>n=>{try{256&e.t?e.i[t](n):(e.u=e.u||[]).push([t,n])}catch(e){Z(e)}},a=(e,t)=>8&t?s:e,h=e=>0!=(2&e),y="http://www.w3.org/1999/xlink",p=new WeakMap,$=e=>"sc-"+e.h,d={},w=e=>"object"==(e=typeof e)||"function"===e,m=(e,t,...n)=>{let l=null,s=null,o=!1,i=!1,r=[];const c=t=>{for(let n=0;n<t.length;n++)l=t[n],Array.isArray(l)?c(l):null!=l&&"boolean"!=typeof l&&((o="function"!=typeof e&&!w(l))&&(l+=""),o&&i?r[r.length-1].p+=l:r.push(o?b(null,l):l),i=o)};if(c(n),t){t.key&&(s=t.key);{const e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter((t=>e[t])).join(" "))}}if("function"==typeof e)return e(null===t?{}:t,r,v);const u=b(e,null);return u.$=t,r.length>0&&(u.m=r),u.g=s,u},b=(e,t)=>({t:0,v:e,p:t,j:null,m:null,$:null,g:null}),g={},v={forEach:(e,t)=>e.map(j).forEach(t),map:(e,t)=>e.map(j).map(t).map(S)},j=e=>({vattrs:e.$,vchildren:e.m,vkey:e.g,vname:e.S,vtag:e.v,vtext:e.p}),S=e=>{if("function"==typeof e.vtag){const t=Object.assign({},e.vattrs);return e.vkey&&(t.key=e.vkey),e.vname&&(t.name=e.vname),m(e.vtag,t,...e.vchildren||[])}const t=b(e.vtag,e.vtext);return t.$=e.vattrs,t.m=e.vchildren,t.g=e.vkey,t.S=e.vname,t},k=(e,t,n,l,o,r)=>{if(n!==l){let c=Y(e,t),u=t.toLowerCase();if("class"===t){const t=e.classList,s=M(n),o=M(l);t.remove(...s.filter((e=>e&&!o.includes(e)))),t.add(...o.filter((e=>e&&!s.includes(e))))}else if("style"===t){for(const t in n)l&&null!=l[t]||(t.includes("-")?e.style.removeProperty(t):e.style[t]="");for(const t in l)n&&l[t]===n[t]||(t.includes("-")?e.style.setProperty(t,l[t]):e.style[t]=l[t])}else if("key"===t);else if("ref"===t)l&&l(e);else if(c||"o"!==t[0]||"n"!==t[1]){const s=w(l);if((c||s&&null!==l)&&!o)try{if(e.tagName.includes("-"))e[t]=l;else{let s=null==l?"":l;"list"===t?c=!1:null!=n&&e[t]==s||(e[t]=s)}}catch(e){}let i=!1;u!==(u=u.replace(/^xlink\:?/,""))&&(t=u,i=!0),null==l||!1===l?!1===l&&""!==e.getAttribute(t)||(i?e.removeAttributeNS(y,t):e.removeAttribute(t)):(!c||4&r||o)&&!s&&(l=!0===l?"":l,i?e.setAttributeNS(y,t,l):e.setAttribute(t,l))}else t="-"===t[2]?t.slice(3):Y(s,u)?u.slice(2):u[2]+t.slice(3),n&&i.rel(e,t,n,!1),l&&i.ael(e,t,l,!1)}},O=/\s/,M=e=>e?e.split(O):[],x=(e,t,n,l)=>{const s=11===t.j.nodeType&&t.j.host?t.j.host:t.j,o=e&&e.$||d,i=t.$||d;for(l in o)l in i||k(s,l,o[l],void 0,n,t.t);for(l in i)k(s,l,o[l],i[l],n,t.t)},C=(t,l,s)=>{let i,r,c=l.m[s],u=0;if(null!==c.p)i=c.j=o.createTextNode(c.p);else{if(n||(n="svg"===c.v),i=c.j=o.createElementNS(n?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",c.v),n&&"foreignObject"===c.v&&(n=!1),x(null,c,n),null!=e&&i["s-si"]!==e&&i.classList.add(i["s-si"]=e),c.m)for(u=0;u<c.m.length;++u)r=C(t,c,u),r&&i.appendChild(r);"svg"===c.v?n=!1:"foreignObject"===i.tagName&&(n=!0)}return i},E=(e,n,l,s,o,i)=>{let r,c=e;for(c.shadowRoot&&c.tagName===t&&(c=c.shadowRoot);o<=i;++o)s[o]&&(r=C(null,l,o),r&&(s[o].j=r,c.insertBefore(r,n)))},L=(e,t,n,l,s)=>{for(;t<=n;++t)(l=e[t])&&(s=l.j,N(l),s.remove())},P=(e,t)=>e.v===t.v&&e.g===t.g,R=(e,t)=>{const l=t.j=e.j,s=e.m,o=t.m,i=t.v,r=t.p;null===r?(n="svg"===i||"foreignObject"!==i&&n,x(e,t,n),null!==s&&null!==o?((e,t,n,l)=>{let s,o,i=0,r=0,c=0,u=0,f=t.length-1,a=t[0],h=t[f],y=l.length-1,p=l[0],$=l[y];for(;i<=f&&r<=y;)if(null==a)a=t[++i];else if(null==h)h=t[--f];else if(null==p)p=l[++r];else if(null==$)$=l[--y];else if(P(a,p))R(a,p),a=t[++i],p=l[++r];else if(P(h,$))R(h,$),h=t[--f],$=l[--y];else if(P(a,$))R(a,$),e.insertBefore(a.j,h.j.nextSibling),a=t[++i],$=l[--y];else if(P(h,p))R(h,p),e.insertBefore(h.j,a.j),h=t[--f],p=l[++r];else{for(c=-1,u=i;u<=f;++u)if(t[u]&&null!==t[u].g&&t[u].g===p.g){c=u;break}c>=0?(o=t[c],o.v!==p.v?s=C(t&&t[r],n,c):(R(o,p),t[c]=void 0,s=o.j),p=l[++r]):(s=C(t&&t[r],n,r),p=l[++r]),s&&a.j.parentNode.insertBefore(s,a.j)}i>f?E(e,null==l[y+1]?null:l[y+1].j,n,l,r,y):r>y&&L(t,i,f)})(l,s,t,o):null!==o?(null!==e.p&&(l.textContent=""),E(l,null,t,o,0,o.length-1)):null!==s&&L(s,0,s.length-1),n&&"svg"===i&&(n=!1)):e.p!==r&&(l.data=r)},N=e=>{e.$&&e.$.ref&&e.$.ref(null),e.m&&e.m.map(N)},T=e=>K(e).k,U=(e,t)=>{t&&!e.O&&t["s-p"]&&t["s-p"].push(new Promise((t=>e.O=t)))},W=(e,t)=>{if(e.t|=16,!(4&e.t))return U(e,e.M),ue((()=>A(e,t)));e.t|=512},A=(e,t)=>{const n=e.i;let l;return t&&(e.t|=256,e.u&&(e.u.map((([e,t])=>V(n,e,t))),e.u=null),l=V(n,"componentWillLoad")),_(l,(()=>H(e,n,t)))},H=async(e,t,n)=>{const l=e.k,s=l["s-rc"];n&&(e=>{const t=e.C,n=e.k,l=t.t,s=((e,t)=>{let n=$(t),l=ne.get(n);if(e=11===e.nodeType?e:o,l)if("string"==typeof l){let t,s=p.get(e=e.head||e);s||p.set(e,s=new Set),s.has(n)||(t=o.createElement("style"),t.innerHTML=l,e.insertBefore(t,e.querySelector("link")),s&&s.add(n))}else e.adoptedStyleSheets.includes(l)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,l]);return n})(n.shadowRoot?n.shadowRoot:n.getRootNode(),t);10&l&&(n["s-sc"]=s,n.classList.add(s+"-h"))})(e);q(e,t),s&&(s.map((e=>e())),l["s-rc"]=void 0);{const t=l["s-p"],n=()=>D(e);0===t.length?n():(Promise.all(t).then(n),e.t|=4,t.length=0)}},q=(n,l)=>{try{l=l.render(),n.t&=-17,n.t|=2,((n,l)=>{const s=n.k,o=n.C,i=n.L||b(null,null),r=(e=>e&&e.v===g)(l)?l:m(null,null,l);t=s.tagName,o.P&&(r.$=r.$||{},o.P.map((([e,t])=>r.$[t]=s[e]))),r.v=null,r.t|=4,n.L=r,r.j=i.j=s.shadowRoot||s,e=s["s-sc"],R(i,r)})(n,l)}catch(e){Z(e,n.k)}return null},D=e=>{const t=e.k,n=e.M;V(e.i,"componentDidRender"),64&e.t||(e.t|=64,z(t),e.R(t),n||F()),e.O&&(e.O(),e.O=void 0),512&e.t&&ce((()=>W(e,!1))),e.t&=-517},F=()=>{z(o.documentElement),ce((()=>(e=>{const t=i.ce("appload",{detail:{namespace:"user-transaction-history"}});return e.dispatchEvent(t),t})(s)))},V=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(e){Z(e)}},_=(e,t)=>e&&e.then?e.then(t):t(),z=e=>e.classList.add("hydrated"),B=(e,t,n)=>{if(t.N){e.watchers&&(t.T=e.watchers);const l=Object.entries(t.N),s=e.prototype;if(l.map((([e,[l]])=>{(31&l||2&n&&32&l)&&Object.defineProperty(s,e,{get(){return((e,t)=>K(this).U.get(t))(0,e)},set(n){((e,t,n,l)=>{const s=K(e),o=s.k,i=s.U.get(t),r=s.t,c=s.i;if(n=((e,t)=>null==e||w(e)?e:4&t?"false"!==e&&(""===e||!!e):1&t?e+"":e)(n,l.N[t][0]),(!(8&r)||void 0===i)&&n!==i&&(!Number.isNaN(i)||!Number.isNaN(n))&&(s.U.set(t,n),c)){if(l.T&&128&r){const e=l.T[t];e&&e.map((e=>{try{c[e](n,i,t)}catch(e){Z(e,o)}}))}2==(18&r)&&W(s,!1)}})(this,e,n,t)},configurable:!0,enumerable:!0})})),1&n){const n=new Map;s.attributeChangedCallback=function(e,t,l){i.jmp((()=>{const t=n.get(e);if(this.hasOwnProperty(t))l=this[t],delete this[t];else if(s.hasOwnProperty(t)&&"number"==typeof this[t]&&this[t]==l)return;this[t]=(null!==l||"boolean"!=typeof this[t])&&l}))},e.observedAttributes=l.filter((([e,t])=>15&t[0])).map((([e,l])=>{const s=l[1]||e;return n.set(s,e),512&l[0]&&t.P.push([e,s]),s}))}}return e},G=(e,t={})=>{const n=[],l=t.exclude||[],r=s.customElements,f=o.head,a=f.querySelector("meta[charset]"),h=o.createElement("style"),y=[];let p,d=!0;Object.assign(i,t),i.l=new URL(t.resourcesUrl||"./",o.baseURI).href,e.map((e=>{e[1].map((t=>{const s={t:t[0],h:t[1],N:t[2],W:t[3]};s.N=t[2],s.W=t[3],s.P=[],s.T={};const o=s.h,f=class extends HTMLElement{constructor(e){super(e),X(e=this,s),1&s.t&&e.attachShadow({mode:"open"})}connectedCallback(){p&&(clearTimeout(p),p=null),d?y.push(this):i.jmp((()=>(e=>{if(0==(1&i.t)){const t=K(e),n=t.C,l=()=>{};if(1&t.t)u(e,t,n.W);else{t.t|=1;{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){U(t,t.M=n);break}}n.N&&Object.entries(n.N).map((([t,[n]])=>{if(31&n&&e.hasOwnProperty(t)){const n=e[t];delete e[t],e[t]=n}})),(async(e,t,n,l,s)=>{if(0==(32&t.t)){{if(t.t|=32,(s=te(n)).then){const e=()=>{};s=await s,e()}s.isProxied||(n.T=s.watchers,B(s,n,2),s.isProxied=!0);const e=()=>{};t.t|=8;try{new s(t)}catch(e){Z(e)}t.t&=-9,t.t|=128,e()}if(s.style){let e=s.style;const t=$(n);if(!ne.has(t)){const l=()=>{};((e,t,n)=>{let l=ne.get(e);c&&n?(l=l||new CSSStyleSheet,l.replace(t)):l=t,ne.set(e,l)})(t,e,!!(1&n.t)),l()}}}const o=t.M,i=()=>W(t,!0);o&&o["s-rc"]?o["s-rc"].push(i):i()})(0,t,n)}l()}})(this)))}disconnectedCallback(){i.jmp((()=>(()=>{if(0==(1&i.t)){const e=K(this);e.o&&(e.o.map((e=>e())),e.o=void 0)}})()))}componentOnReady(){return K(this).A}};s.H=e[0],l.includes(o)||r.get(o)||(n.push(o),r.define(o,B(f,s,1)))}))})),h.innerHTML=n+"{visibility:hidden}.hydrated{visibility:inherit}",h.setAttribute("data-styles",""),f.insertBefore(h,a?a.nextSibling:f.firstChild),d=!1,y.length?y.map((e=>e.connectedCallback())):i.jmp((()=>p=setTimeout(F,30)))},I=e=>{const t=new URL(e,i.l);return t.origin!==s.location.origin?t.href:t.pathname},J=new WeakMap,K=e=>J.get(e),Q=(e,t)=>J.set(t.i=e,t),X=(e,t)=>{const n={t:0,k:e,C:t,U:new Map};return n.A=new Promise((e=>n.R=e)),e["s-p"]=[],e["s-rc"]=[],u(e,n,t.W),J.set(e,n)},Y=(e,t)=>t in e,Z=(e,t)=>(0,console.error)(e,t),ee=new Map,te=e=>{const t=e.h.replace(/-/g,"_"),n=e.H,l=ee.get(n);return l?l[t]:import(`./${n}.entry.js`).then((e=>(ee.set(n,e),e[t])),Z)},ne=new Map,le=[],se=[],oe=(e,t)=>n=>{e.push(n),l||(l=!0,t&&4&i.t?ce(re):i.raf(re))},ie=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){Z(e)}e.length=0},re=()=>{ie(le),ie(se),(l=le.length>0)&&i.raf(re)},ce=e=>r().then(e),ue=oe(se,!0);export{g as H,T as a,G as b,I as g,m as h,r as p,Q as r}
@@ -0,0 +1 @@
1
+ import{h as t,r as e,g as a,H as o,a as i}from"./p-10b5b959.js";class n{constructor(){}static async loadCustomTranslations(t){try{const e=await fetch(t,{headers:{"Content-Type":"application/json"}});if(!e.ok){const t=await e.text();throw new Error(t)}const a=await e.json();n.updateTranslations(a)}catch(e){console.error(`Failed to load translations ${t}. ${e.message}`)}}static translate(t,e){var a,o;const i=n.getAvaliableLanguages(e);return(null===(o=null===(a=n.customTranslation)||void 0===a?void 0:a[i.customLanguage])||void 0===o?void 0:o[t])||n.defaultTranslation[i.predefinedLanguage][t]}static getAvaliableLanguages(t){var e;const a=(null===(e=n.customLanguages)||void 0===e?void 0:e.includes(t))?t:n.defaultLanguage;return{predefinedLanguage:n.supportedLanguages.includes(t)?t:n.defaultLanguage,customLanguage:a}}static updateTranslations(t){n.customLanguages=Array.from(new Set([...n.supportedLanguages,...Object.keys(t).map((t=>t.toLowerCase()))])),n.customTranslation=t}}n.defaultLanguage="en",n.supportedLanguages=["en"],n.defaultTranslation={en:{deposit:"Deposit",withdrawals:"Withdrawals",show:"Show",from:"From",to:"To",filter:"Filter",transactionId:"Transaction ID",date:"Date",amount:"Amount",productType:"Product Type",status:"Status",noData:"There are no account activities"},hr:{deposit:"Uplate",withdrawals:"Isplate",show:"Prikaži",from:"Od",to:"Do",filter:"Filter",transactionId:"ID transakcije",date:"Datum",amount:"Iznos",productType:"Vrsta proizvoda",status:"Status",noData:"Nema aktivnosti na računu"}};const r=()=>t("div",{class:"loader"},t("div",null),t("div",null),t("div",null),t("div",null),t("div",null),t("div",null),t("div",null),t("div",null),t("div",null),t("div",null),t("div",null),t("div",null));class s{constructor(){}static dateToFormatedString(t){return`${t.toLocaleDateString("en-gb")}, ${t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!1})}`}}class l{constructor(){}static format(t,e){let a=`${e} ${t}`;try{a=new Intl.NumberFormat("en-US",{style:"currency",currency:t}).format(e)}catch(t){}return a}}const d=e=>t("div",{class:"data-transaction"},t("p",null,e.productType),t("p",{class:"text-style text-style-status"},t("span",{class:e.status.toLowerCase()},e.status)),t("p",{class:"date"},e.transId," | ",s.dateToFormatedString(new Date(e.created))),t("p",{class:"text-style"},l.format(e.currency,e.realAmount)," ")),c=e=>t("div",{class:"page-size"},t("span",null,n.translate("show",e.language)),e.pageSizes.map((a=>t("button",{class:e.currentPageSize===a?"active":"",onClick:()=>e.changePageSize(a)},a)))),h=({from:e,to:a,applyFilters:o,language:i})=>{let r,s;return t("div",{class:"period"},t("div",{class:"period-content"},t("div",{class:"date-input"},t("vaadin-date-picker",{value:e,ref:t=>r=t,label:n.translate("from",i),onChange:()=>{e=r.value}})),t("span",null,t("svg",{width:"24px",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},t("path",{d:"m21 11.75c0-.414-.336-.75-.75-.75h-16.5c-.414 0-.75.336-.75.75s.336.75.75.75h16.5c.414 0 .75-.336.75-.75z","fill-rule":"nonzero",fill:"#5d687b"}))),t("div",{class:"date-input"},t("vaadin-date-picker",{value:a,ref:t=>s=t,label:n.translate("to",i),onChange:()=>{a=s.value}})),t("button",{class:"filter-btn",onClick:()=>o(e,a)},n.translate("filter",i))))},p=({source:e,language:a})=>{const o=[{name:n.translate("transactionId",a)},{name:n.translate("date",a)},{name:n.translate("amount",a)},{name:n.translate("productType",a)},{name:n.translate("status",a)}];return t("table",null,t("thead",null,t("tr",null,o.map((e=>t("th",null,e.name))))),t("tbody",null,e.map((e=>t("tr",null,t("td",null,e.transId),t("td",null,s.dateToFormatedString(new Date(e.created))),t("td",null,l.format(e.currency,e.realAmount)," "),t("td",null,e.productType),t("td",null,t("span",{class:e.status.toLowerCase()},e.status)))))))},u=class{constructor(t){e(this,t),this.pageSizes=[10,25,50],this.pagination=null,this.stylingAppended=!1,this.language=n.defaultLanguage,this.mobile=!1,this.clientStyling=null,this.clientStylingUrl=null,this.page=0,this.pageSize=this.pageSizes[0],this.showMobileFilter=!1,this.type="0",this.showLoader=!0}watchMultiple(){this.loadTransactions()}async componentWillLoad(){this.translationUrl&&await n.loadCustomTranslations(this.translationUrl),this.loadTransactions()}componentDidRender(){this.getComponentHeight(),!this.stylingAppended&&this.stylingContainer&&(this.clientStyling&&this.setStyles(this.clientStyling),this.clientStylingUrl&&this.setClientStylingByURL(),this.stylingAppended=!0)}getComponentHeight(){var t;if(this.mobile){let e=this.el.getBoundingClientRect().height-(null===(t=this.el.shadowRoot.querySelector(".table"))||void 0===t?void 0:t.getBoundingClientRect().y);this.el.style.setProperty("--heightScrollableContainer",e+"px")}}setHeightTableProperty(){let t=this.getComponentHeight();this.el.style.setProperty("--heightScrollableContainer",t+"px")}changeTransactionsType(t){this.type=t}changePageSize(t){this.pageSize=t}prev(){var t;(null===(t=this.pagination)||void 0===t?void 0:t.previous)&&this.page--}next(){var t;(null===(t=this.pagination)||void 0===t?void 0:t.next)&&this.page++}applyFilters(t,e){this.from=t?new Date(t).toISOString():null,this.to=e?new Date(e).toISOString():null,this.loadTransactions()}showFilter(){this.showMobileFilter=!this.showMobileFilter}render(){var e;const i=a("../assets/filter.svg"),s=a("../assets/warning.svg");return t(o,null,this.showLoader?t(r,null):"",t("div",{class:"wrapper",ref:t=>this.stylingContainer=t},t("div",{class:{"types types-mobile":this.mobile,"types types-desktop":!this.mobile}},t("button",{class:"transaction-type "+("0"===this.type?"clicked":""),onClick:()=>this.changeTransactionsType("0")},n.translate("deposit",this.language)),t("button",{class:"transaction-type "+("1"===this.type?"clicked":""),onClick:()=>this.changeTransactionsType("1")},n.translate("withdrawals",this.language))),this.mobile?"":t(c,{language:this.language,pageSizes:this.pageSizes,currentPageSize:this.pageSize,changePageSize:t=>this.changePageSize(t)}),this.mobile?t("button",{class:"mobile-filter-button",onClick:()=>this.showFilter()},t("img",{src:i,alt:"Filter"}),n.translate("filter",this.language)):"",!this.mobile||this.showMobileFilter&&this.mobile?t(h,{language:this.language,applyFilters:(t,e)=>this.applyFilters(t,e)}):"",(null===(e=this.transactions)||void 0===e?void 0:e.length)>0?t("div",{class:"table"},this.mobile?t("div",{class:"mobile-table"},this.transactions.map((e=>t(d,Object.assign({},e))))):t(p,{source:this.transactions,language:this.language})):t("div",{class:"noData"},t("img",{src:s,alt:"Warning"}),t("span",null,n.translate("noData",this.language))),t("div",{class:"pagination"},t("button",{onClick:()=>this.prev()},"<"),t("button",{onClick:()=>this.next()},">"))))}async loadTransactions(){this.showLoader=!0;try{const t=`${this.endpoint}/v1/player/${this.userId}/transactions/banking?${this.getParams()}`,e=await fetch(t,{headers:{"X-Sessionid":this.session,"Content-Type":"application/json"}});if(!e.ok){const t=await e.text();throw new Error(t)}const a=await e.json();this.pagination=a.pagination,this.transactions=a.transactions}catch(t){console.error(t)}finally{this.showLoader=!1}}getParams(){var t,e;const a=new Date,o=(this.page*this.pageSize).toString(),i=null!==(t=this.from)&&void 0!==t?t:new Date(a.getFullYear(),a.getMonth(),1).toISOString();return`offset=${o}&endDate=${null!==(e=this.to)&&void 0!==e?e:new Date(a.getFullYear(),a.getMonth()+1,0).toISOString()}&startDate=${i}&type=${this.type}&limit=${this.pageSize}`}setStyles(t){const e=document.createElement("style");e.innerHTML=t,this.stylingContainer.prepend(e)}async setClientStylingByURL(){try{const t=await fetch(this.clientStylingUrl);if(!t.ok){const e=await t.text();throw new Error(e)}const e=await t.text();this.setStyles(e)}catch(t){console.error(`Failed to load client styles ${this.clientStylingUrl}`,t)}}static get assetsDirs(){return["../assets"]}get el(){return i(this)}static get watchers(){return{page:["watchMultiple"],type:["watchMultiple"],session:["watchMultiple"],userId:["watchMultiple"],pageSize:["watchMultiple"],showMobileFilter:["getComponentHeight"]}}};u.style=':host{--activeButtonBackground:#7ec51e;--activeButtonFont:#002149;--hoverBackground:#ffffff;--background:#e4e6e8;--success:#7ac345;--heightScrollableContainer:400px;--borderColor:#d3d3d3;--borderColorButton:#c4c4c4;--textColor:#002554;--textColorHover:#7ac345;--errorColor:#c23b21;--loaderColor:#7ac345;--headerTableBackground:#cdcdcd;--borderTable:#dedede;--shadowBorderTable:#f1f1f1;--backgroundTable:#ffffff;font-family:Roboto, Arial, sans-serif;font-size:14px;color:var(--textColor);display:block;background-color:var(--background)}:host .wrapper{height:100%;padding:1rem}:host .types{display:flex;width:100%;gap:5px}:host .transaction-type{background:inherit;font-weight:600;padding:0.6rem 1.6rem;border:1px solid #6c757d;cursor:pointer}:host .transaction-type:hover{color:var(--activeButtonBackground);border-color:var(--activeButtonBackground);background:var(--hoverBackground)}:host .clicked{background-color:var(--activeButtonBackground);border-color:var(--activeButtonBackground)}:host .types-mobile{justify-content:center;margin-bottom:15px}:host .types-desktop{justify-content:flex-end;margin-bottom:3rem}:host .page-size{display:flex;width:100%;justify-content:flex-end;align-items:center}:host .page-size button{background:transparent;border:none;cursor:pointer;margin:0.4rem;width:2rem;height:2rem}:host .page-size button:hover{color:var(--textColorHover)}:host .page-size button.active{background:var(--activeButtonBackground);color:var(--textColor);font-weight:600;border-radius:0.4rem}:host .period{display:flex;width:100%;align-items:flex-end;justify-content:center;gap:10px;background:#f0f0f0;border-bottom:2px solid #e9e9e9;padding:1.6rem 0 0;margin-bottom:4rem}@media (max-width: 801px){:host .period{margin-bottom:0;flex-direction:column;align-items:stretch;width:auto;padding:1.4rem 2.8rem;box-shadow:0 4px 5px 0 rgba(90, 90, 90, 0.24)}}:host .period .range{color:var(--errorColor)}:host .period .filter-btn{height:40px;background:transparent;border:0.1rem solid var(--borderColorButton);min-width:12rem;max-width:17rem;cursor:pointer}@media (max-width: 801px){:host .period .filter-btn{max-width:none;min-width:none;margin-top:1rem}}:host .period .filter-btn:hover{border:none;background:var(--hoverBackground)}:host .period .duet-date__input{padding:7px 60px 7px 7px}:host .period+button{padding:9px 15px}:host .period-content{display:flex;flex-direction:row;width:100%;justify-content:center;align-items:flex-end;margin:0 auto 1.6rem}@media (max-width: 801px){:host .period-content{flex-direction:column;align-items:stretch}}:host .period-content span{height:40px;display:flex;align-items:center;justify-content:center}@media (max-width: 801px){:host .period-content span{display:none}}:host .period-content .filter-btn{margin-left:60px}@media (max-width: 801px){:host .period-content .filter-btn{margin-left:0}}:host .period-content .date-input{padding:0 4px}@media (max-width: 801px){:host .period-content .date-input{width:auto}:host .period-content .date-input:first-child{margin-bottom:0.5rem}}:host .period-content .date-input label{display:inline-block;margin-bottom:0.9rem}:host .period-content .date-input input{border:0.1rem solid var(--borderColor);box-sizing:border-box;border-radius:0.2rem}:host .pagination{display:flex;width:100%;justify-content:center;margin-top:1.5rem}:host .pagination button{cursor:pointer;border:none;background-color:var(--activeButtonBackground);color:#fff;opacity:0.5;padding:7px 12px}:host .pagination button:hover{opacity:1}:host .pagination button:focus{opacity:1}:host button.active{color:var(--activeButtonFont);background-color:var(--activeButtonBackground)}.mobile-filter-button{display:flex;justify-content:center;align-items:center;width:100%;height:2.8rem;background:inherit;border:1px solid var(--borderColorButton)}.mobile-filter-button img{height:50%;margin-right:0.5rem}.noData{display:flex;align-items:center;box-shadow:0 0.4rem 0.4rem rgba(0, 0, 0, 0.25);padding:1.1rem;border-radius:0.6rem}.noData span{margin-left:0.5rem}.table{height:var(--heightScrollableContainer);overflow-y:auto}.table .mobile-table{height:100%}.data-transaction{border-bottom:1px solid var(--borderColor);background-color:var(--hoverBackground);padding:0 20px;display:grid;grid-template-columns:repeat(2, 1fr)}.data-transaction .text-style-status{font-weight:600}.data-transaction .text-style-status .success{color:var(--success)}.data-transaction .text-style-status .error{color:var(--errorColor)}.data-transaction .text-style{text-align:end}.data-transaction .date{font-size:12px;display:flex;align-items:center}.loader{display:inline-block;position:absolute;width:80px;height:80px;top:calc(50% - 40px);left:calc(50% - 40px);z-index:999}.loader::before{content:"";position:fixed;top:0;bottom:0;left:0;right:0;background-color:rgba(255, 255, 255, 0.6)}.loader div{position:absolute;width:6px;height:6px;background:var(--loaderColor);border-radius:50%;animation:loader 1.2s linear infinite}.loader div:nth-child(1){animation-delay:0s;top:37px;left:66px}.loader div:nth-child(2){animation-delay:-0.1s;top:22px;left:62px}.loader div:nth-child(3){animation-delay:-0.2s;top:11px;left:52px}.loader div:nth-child(4){animation-delay:-0.3s;top:7px;left:37px}.loader div:nth-child(5){animation-delay:-0.4s;top:11px;left:22px}.loader div:nth-child(6){animation-delay:-0.5s;top:22px;left:11px}.loader div:nth-child(7){animation-delay:-0.6s;top:37px;left:7px}.loader div:nth-child(8){animation-delay:-0.7s;top:52px;left:11px}.loader div:nth-child(9){animation-delay:-0.8s;top:62px;left:22px}.loader div:nth-child(10){animation-delay:-0.9s;top:66px;left:37px}.loader div:nth-child(11){animation-delay:-1s;top:62px;left:52px}.loader div:nth-child(12){animation-delay:-1.1s;top:52px;left:62px}@keyframes loader{0%,20%,80%,100%{transform:scale(1)}50%{transform:scale(1.5)}}.table thead th{position:sticky;top:0}table{border-collapse:collapse;width:100%}table th{padding:14px 24px;text-align:left;font-weight:600;color:var(--textColor);background:var(--headerTableBackground)}table td{padding:1rem 1.7rem;box-shadow:0 -1px 0 0 var(--shadowBorderTable) inset;border-bottom:0.1rem solid var(--borderTable);text-align:left;color:var(--textColor)}table tbody{background:var(--backgroundTable)}table .success{color:var(--success)}table .error{color:var(--errorColor)}vaadin-date-picker{min-width:320px}@media (max-width: 1261px){vaadin-date-picker{width:auto;min-width:auto}}@media (max-width: 801px){vaadin-date-picker{width:100%}}';export{u as user_transaction_history}
@@ -0,0 +1 @@
1
+ import{p as t,b as e}from"./p-10b5b959.js";(()=>{const e=import.meta.url,n={};return""!==e&&(n.resourcesUrl=new URL(".",e).href),t(n)})().then((t=>e([["p-c71395aa",[[1,"user-transaction-history",{endpoint:[513],session:[513],language:[513],userId:[513,"user-id"],translationUrl:[513,"translation-url"],mobile:[516],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],page:[32],pageSize:[32],showMobileFilter:[32],to:[32],from:[32],type:[32],transactions:[32],showLoader:[32]},[[9,"resize","getComponentHeight"]]]]]],t)));
package/loader/cdn.js ADDED
@@ -0,0 +1,3 @@
1
+
2
+ module.exports = require('../dist/cjs/loader.cjs.js');
3
+ module.exports.applyPolyfills = function() { return Promise.resolve() };
@@ -0,0 +1,3 @@
1
+
2
+ module.exports = require('../dist/cjs/loader.cjs.js');
3
+ module.exports.applyPolyfills = function() { return Promise.resolve() };
@@ -0,0 +1,12 @@
1
+ export * from '../dist/types/components';
2
+ export interface CustomElementsDefineOptions {
3
+ exclude?: string[];
4
+ resourcesUrl?: string;
5
+ syncQueue?: boolean;
6
+ jmp?: (c: Function) => any;
7
+ raf?: (c: FrameRequestCallback) => number;
8
+ ael?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
9
+ rel?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
10
+ }
11
+ export declare function defineCustomElements(win?: Window, opts?: CustomElementsDefineOptions): Promise<void>;
12
+ export declare function applyPolyfills(): Promise<void>;
@@ -0,0 +1,3 @@
1
+
2
+ export * from '../dist/esm/polyfills/index.js';
3
+ export * from '../dist/esm/loader.js';
@@ -0,0 +1,4 @@
1
+
2
+ (function(){if("undefined"!==typeof window&&void 0!==window.Reflect&&void 0!==window.customElements){var a=HTMLElement;window.HTMLElement=function(){return Reflect.construct(a,[],this.constructor)};HTMLElement.prototype=a.prototype;HTMLElement.prototype.constructor=HTMLElement;Object.setPrototypeOf(HTMLElement,a)}})();
3
+ export * from '../dist/esm/polyfills/index.js';
4
+ export * from '../dist/esm/loader.js';
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "user-transaction-history-loader",
3
+ "typings": "./index.d.ts",
4
+ "module": "./index.js",
5
+ "main": "./index.cjs.js",
6
+ "jsnext:main": "./index.es2017.js",
7
+ "es2015": "./index.es2017.js",
8
+ "es2017": "./index.es2017.js",
9
+ "unpkg": "./cdn.js"
10
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/user-transaction-history",
3
- "version": "1.32.4",
3
+ "version": "1.33.1",
4
4
  "main": "./dist/index.cjs.js",
5
5
  "module": "./dist/index.js",
6
6
  "es2015": "./dist/esm/index.mjs",
@@ -15,6 +15,5 @@
15
15
  ],
16
16
  "publishConfig": {
17
17
  "access": "public"
18
- },
19
- "gitHead": "69a4e0bb1b0460c07baef352d283492a6e2dc4b0"
18
+ }
20
19
  }
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2020
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.