@ukpc-lib/react 0.2.22 → 0.2.23
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/application.d.ts +1 -0
- package/dist/components/MultiProvider.d.ts +6 -0
- package/dist/components/index.cjs +1 -1
- package/dist/components/index.js +2 -2
- package/dist/components/main.d.ts +5 -4
- package/dist/{index.module-eaf7a821.cjs → index.module-3c7dfdd1.cjs} +75 -75
- package/dist/{index.module-a18bd948.js → index.module-97c322f5.js} +4701 -4698
- package/dist/main.d.ts +1 -0
- package/dist/share/index.cjs +1 -1
- package/dist/share/index.js +2 -2
- package/dist/theme/Colors.d.ts +33 -0
- package/dist/theme/SaasThemeProvider.d.ts +2 -0
- package/dist/theme/Theme.d.ts +21 -0
- package/dist/theme/index.cjs +1 -1
- package/dist/theme/index.d.ts +3 -0
- package/dist/theme/index.js +7 -6
- package/dist/translations/config.d.ts +10 -0
- package/dist/translations/de/translation.json.d.ts +230 -0
- package/dist/translations/en/translation.json.d.ts +230 -0
- package/dist/web-components/global-menu.d.ts +1 -0
- package/dist/web-components/global-topbar.d.ts +1 -0
- package/dist/web-components/has-permission.d.ts +1 -0
- package/dist/web-components/index.d.ts +2 -0
- package/package.json +1 -1
- package/web-components-bundle/global-topbar/index.cjs +1 -1
- package/web-components-bundle/global-topbar/index.js +1 -1
- package/web-components-bundle/has-permission/index.cjs +1 -1
- package/web-components-bundle/has-permission/index.js +1 -1
- package/web-components-bundle/{index-2c1ba689.cjs → index-a1eabc81.cjs} +68 -68
- package/web-components-bundle/{index-8d8b181c.js → index-f74899a8.js} +5833 -5836
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function Application(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("../index.module-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("../index.module-3c7dfdd1.cjs"),p=require("react/jsx-runtime"),_=require("react"),ti=require("../Colors-51ce6654.cjs"),se=require("moment"),qt=require("axios");require("@r2wc/react-to-web-component");const Uo=require("react-router-dom"),yc=require("react-dom"),I=require("@mui/material");function vc(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const N=vc(_),bc=`.modal-overlay{z-index:1300;position:fixed;top:0;right:0;bottom:0;left:0;background:hsla(0,0%,0%,.254);--tw-backdrop-blur: blur(4px);justify-content:center;align-items:center;-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.modal-title{font-size:1.25rem;line-height:1.75rem;color:#e01b00;font-weight:500}.modal-footer{display:flex;justify-content:space-between;width:80%}.modal-container{background:#ffffff;-webkit-backdrop-filter:blur(4.5px);backdrop-filter:blur(4.5px);display:flex;padding:32px 24px 40px;flex-direction:column;align-items:center;gap:24px;align-self:stretch;width:500px;height:204px;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);border-radius:.5rem}.modal-button{border-radius:3px;border:1px solid #ddd;background:#ddd;padding:8px 32px;font-size:14px}.confirm-btn{background:#e01b00!important}.text-white{color:#fff}.text-sm{font-size:.875rem;line-height:1.25rem}
|
|
2
2
|
`;function Yo({isOpen:e,onClose:t,onConfirm:n}){if(!e)return null;function r(i){var o;((o=i.target)==null?void 0:o.id)==="modal-wrapper"&&t()}return p.jsxs(p.Fragment,{children:[p.jsx("style",{type:"text/css",children:bc}),p.jsx("div",{onClick:r,className:"modal-overlay",id:"modal-wrapper",children:p.jsxs("div",{className:"modal-container",children:[p.jsx("h3",{className:"modal-title",children:"Log out"}),p.jsx("p",{className:"text-sm",children:"Are you sure want to log out?"}),p.jsxs("div",{className:"modal-footer",children:[p.jsx("button",{className:"modal-button",onClick:t,children:"Cancel"}),p.jsx("button",{onClick:n,className:"text-white confirm-btn modal-button",children:"Confirm"})]})]})})]})}function xc({primaryColor:e="#009d4f"}){return p.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"25",viewBox:"0 0 24 25",fill:"none",children:[p.jsx("path",{d:"M8.5 19.5H8C4 19.5 2 18.5 2 13.5V8.5C2 4.5 4 2.5 8 2.5H16C20 2.5 22 4.5 22 8.5V13.5C22 17.5 20 19.5 16 19.5H15.5C15.19 19.5 14.89 19.65 14.7 19.9L13.2 21.9C12.54 22.78 11.46 22.78 10.8 21.9L9.3 19.9C9.14 19.68 8.77 19.5 8.5 19.5Z",stroke:e,"stroke-width":"1.5","stroke-miterlimit":"10","stroke-linecap":"round","stroke-linejoin":"round"}),p.jsx("path",{d:"M15.9965 11.5H16.0054",stroke:e,"stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}),p.jsx("path",{d:"M11.9955 11.5H12.0045",stroke:e,"stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}),p.jsx("path",{d:"M7.99451 11.5H8.00349",stroke:e,"stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})]})}const wc=e=>{const{tabs:t}=e,n=r=>{e.setCurrentTab(r.target.id)};return p.jsxs("div",{className:"tab-container",children:[p.jsx("div",{style:{display:"flex",width:"100%",height:"50px",borderBottom:`1px solid ${ti.color.grey200}`},className:"tab-container__title",children:t.map((r,i)=>p.jsx("button",{id:r.id,disabled:e.currentTab===`${r.id}`,onClick:n,className:`tab-title ${e.currentTab===`${r.id}`?"is-active":""}`,children:r.tabTitle},i))}),p.jsx("div",{className:"tab-content",children:t.map((r,i)=>p.jsx("div",{children:e.currentTab===`${r.id}`&&p.jsx("div",{children:r.children})},i))})]})},Sc=({notification:e,handleUpdateRead:t})=>{const n=r=>{const i=se(),o=se(r),s=i.diff(o,"days");return s===0?"Today":s===1?"Yesterday":s>=2&&s<=7?`Last ${s} days`:s===8||s===9||s===10?"1 week ago":s>=11&&s<=14?"2 weeks ago":o.format("MMMM DD, YYYY")};return p.jsxs("div",{className:"notitification-item__container",onClick:()=>t(e.id,!e.isRead),children:[p.jsx("div",{className:"notification-item__image-container",children:p.jsx("img",{src:(e==null?void 0:e.userAvatarUrl)===void 0?"https://ukpcsaprod.blob.core.windows.net/account/logo.png":e==null?void 0:e.userAvatarUrl,alt:e.userName})}),p.jsxs("div",{className:"notification-item__content",children:[p.jsx("p",{className:"notification-item__user-name",children:e.userName}),p.jsxs("p",{children:[`${e.message} `,p.jsx("span",{children:e==null?void 0:e.context})]})]}),p.jsx("div",{className:"notification-item__time",children:p.jsx("p",{children:n(e.createdAt)})}),p.jsx("button",{className:`${(e==null?void 0:e.isRead)===!1?"unread":"read"} notification-item__read-at`,onClick:()=>t(e.id,!e.isRead),"aria-label":"Mark as read"})]})},Wi=({notidata:e,handleUpdateRead:t,handleUpdateReadAll:n})=>p.jsxs("div",{children:[p.jsx("div",{className:"mark-all-read",children:p.jsx("button",{onClick:n,children:"Mark all as read"})}),p.jsx("div",{className:"notification-items__wrapper",children:p.jsx("div",{className:"notification-items__content",children:Object.values(e).map((r,i)=>p.jsx(Sc,{notification:r,handleUpdateRead:t},i))})})]}),Go=({baseUrl:e,notiPath:t,setNotiData:n})=>async()=>{const o=e+(t||"/notification-management/api/v1/notifications"),s=await qt.get(o,{params:{filter:{notificationFilterType:"all"}},withCredentials:!0}),a=await qt.get(o,{params:{filter:{notificationFilterType:"unread"}},withCredentials:!0});Promise.all([s,a]).then(l=>{var c,d,u,h;console.log("result: "+l),n({all:{rows:(c=l[0].data)==null?void 0:c.rows,total:(d=l[0].data)==null?void 0:d.total},unread:{rows:(u=l[1].data)==null?void 0:u.rows,total:(h=l[1].data)==null?void 0:h.total}})})},Ec=({baseUrl:e,notiPath:t})=>{var u,h,m,y;const{setShowModalFalse:n}=_.useContext(S.CustomOpenList),{notidata:r,setNotiData:i}=_.useContext(S.CustomOpenList);console.log(r);const[o,s]=_.useState("all"),a=Go({baseUrl:e,notiPath:t,setNotiData:i}),l=async()=>{var f,g;try{const w=e+(t||"/notification-management/api/v1/notifications");await qt.put(w,{withCredentials:!0})}catch(b){console.log(b),S.pushError(((g=(f=b.response)==null?void 0:f.data)==null?void 0:g.errorMessage)||"Have error when get notification list")}await a()},c=async(f,g)=>{var b,w;try{const x=t||`/notification-management/api/v1/notifications/${f}`,E=e+x;await qt.put(E,{isRead:g},{withCredentials:!0})}catch(x){S.pushError(((w=(b=x.response)==null?void 0:b.data)==null?void 0:w.errorMessage)||"Have error when get notification list")}await a()},d=[{id:"all",tabTitle:`All (${((u=r==null?void 0:r.all)==null?void 0:u.total)||0})`,children:p.jsx(Wi,{notidata:((h=r==null?void 0:r.all)==null?void 0:h.rows)||[],handleUpdateRead:c,handleUpdateReadAll:l})},{id:"unread",tabTitle:`Unread (${((m=r==null?void 0:r.unread)==null?void 0:m.total)||0})`,children:p.jsx(Wi,{notidata:((y=r==null?void 0:r.unread)==null?void 0:y.rows)||[],handleUpdateRead:c,handleUpdateReadAll:l})}];return p.jsx(p.Fragment,{children:p.jsx("div",{style:{position:"absolute",backgroundColor:"#fff",width:"550px",height:"90vh",right:"100px",top:"100%",padding:"32px",boxShadow:"10px 0px 20px #999",borderRadius:"0 0 8px 8px",overflow:"hidden"},children:p.jsxs("div",{className:"list-content",children:[p.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[p.jsx("h3",{style:{fontSize:"24px",fontWeight:"500"},className:"list-title",children:"Notifications"}),p.jsx("button",{onClick:n,children:p.jsx("svg",{width:"24",height:"25",viewBox:"0 0 24 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:p.jsx("path",{d:"M7.05086 6.13616C6.66033 5.74563 6.02717 5.74563 5.63664 6.13616C5.24612 6.52668 5.24612 7.15984 5.63664 7.55037L10.5864 12.5001L5.63664 17.4499C5.24612 17.8404 5.24612 18.4736 5.63664 18.8641C6.02717 19.2546 6.66033 19.2546 7.05086 18.8641L12.0006 13.9143L16.9504 18.8641C17.3409 19.2546 17.974 19.2546 18.3646 18.8641C18.7551 18.4736 18.7551 17.8404 18.3646 17.4499L13.4148 12.5001L18.3646 7.55037C18.7551 7.15984 18.7551 6.52668 18.3646 6.13616C17.974 5.74563 17.3409 5.74563 16.9504 6.13616L12.0006 11.0859L7.05086 6.13616Z",fill:"#85858A"})})})]}),p.jsx(wc,{tabs:d,setCurrentTab:s,currentTab:o})]})})})};function Cc({primaryColor:e="#009d4f",baseUrl:t,notiPath:n}){var c;const{isOpen:r,toggleOpen:i}=_.useContext(S.CustomOpenList),{notidata:o,setNotiData:s}=_.useContext(S.CustomOpenList),a=Go({baseUrl:t,notiPath:n,setNotiData:s}),l=async()=>{var d,u;try{await a()}catch(h){S.pushError(((u=(d=h.response)==null?void 0:d.data)==null?void 0:u.errorMessage)||"Have error when get notification list")}};return _.useEffect(()=>{l()},[]),p.jsxs("div",{children:[p.jsxs("svg",{width:"24",height:"25",viewBox:"0 0 24 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",onClick:i,style:{cursor:"pointer"},children:[p.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.7968 17.4705C16.5901 17.4705 18.8076 16.8556 19.0218 14.3874C19.0218 11.921 17.4757 12.0796 17.4757 9.05334C17.4757 6.68952 15.2352 4 11.7968 4C8.35833 4 6.1178 6.68952 6.1178 9.05334C6.1178 12.0796 4.57178 11.921 4.57178 14.3874C4.78679 16.8649 7.00428 17.4705 11.7968 17.4705Z",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),p.jsx("path",{d:"M13.8274 20.0286C12.6679 21.3161 10.8591 21.3313 9.68848 20.0286",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),(o==null?void 0:o.unread)&&(o==null?void 0:o.unread.total)!=0&&p.jsx("span",{style:{position:"absolute",top:"18px",background:`${ti.color.dangerDark}`,width:"13px",height:"13px",border:"1px solid #fff",borderRadius:"50%",color:"#fff",fontSize:"8px"},className:"notification-badge",children:(c=o==null?void 0:o.unread)==null?void 0:c.total}),!r&&p.jsx(Ec,{baseUrl:t,notiPath:n})]})}const Tc=`*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}
|
|
3
3
|
`;function qo({children:e,styles:t=[],...n}){return p.jsxs(S.C.div,{...n,children:[[Tc,...t].map((r,i)=>p.jsx("style",{type:"text/css",children:r},i)),e]})}const _c=`.avatar-dropdown-item{padding:.5rem;font-size:.875rem;line-height:1.25rem;cursor:pointer;border-radius:.25rem}.avartarDropdownMenu{background-color:#fff;padding:.5rem;width:13rem;--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);position:absolute;left:-10rem;top:3.2rem}.avartarDropdownMenu ul{list-style:none;padding-inline-start:0;margin-block-end:0}.navbar{position:fixed;display:flex;z-index:30;background:#292929;top:0;width:100%;padding-left:2.5rem;height:64px}.navbar-container{display:flex;flex-direction:row;align-items:center;width:100%;justify-content:space-between}.logo-container{padding:16px 0;height:100%}.right-side-container{display:flex;flex-direction:row;align-items:center;text-align:center;margin-right:2.5rem;gap:1rem}.userContainer{display:flex;align-items:center;gap:.5rem}.languageDropdown{height:100%;padding:0 8px;display:flex;flex-direction:row;gap:8px;border-radius:3px;align-items:center;justify-content:center;height:41px;background-color:#ffffff1a;cursor:pointer;transition:background-color .2s ease-in-out}.languageDropdown:hover{background-color:#fff3}.userFullName{color:#fff;font-weight:400;font-size:.875rem;line-height:1.25rem}.userAvatar{width:2.5rem;height:2.5rem;cursor:pointer;-o-object-fit:cover;object-fit:cover;border-radius:9999px;border:2px solid #FFFFFF}.userAvatarNull{width:2.5rem;height:2.5rem;background:#DDDDDD;border-radius:100%;color:#fff;font-size:20px;font-weight:400;display:flex;align-items:center;justify-content:center}.relative{position:relative}.cursor-pointer{cursor:pointer}
|
|
4
4
|
`,Pc=`.tab-title{min-width:90px;padding:5px 16px;font-size:14px;font-weight:500;color:#c5c5c5;transition:all .3s ease-in-out;position:relative}.tab-title.is-active{color:#2e7d32}.tab-title.is-active:before{transition:all .3s ease-in-out;position:absolute;content:"";width:100%;height:100%;top:0;left:0;border-bottom:2px solid #2E7D32}.tab-content{padding:16px 0}
|
package/dist/components/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as Xn, p as Zn, a as Uc, b as Yc, L as co, u as Gc, i as qc, g as Kc, Q as ga, R as Xc, l as Zc, c as An, s as kn, t as Vr, _ as W, d as st, P as R, e as Fe, f as Jc, o as Qc, h as eu, j as tu, k as uo, I as nu, m as ru, n as fo, D as iu, q as ut, r as ou, v as su, B as au, w as On } from "../index.module-
|
|
2
|
-
import { x as J3, y as Q3 } from "../index.module-
|
|
1
|
+
import { C as Xn, p as Zn, a as Uc, b as Yc, L as co, u as Gc, i as qc, g as Kc, Q as ga, R as Xc, l as Zc, c as An, s as kn, t as Vr, _ as W, d as st, P as R, e as Fe, f as Jc, o as Qc, h as eu, j as tu, k as uo, I as nu, m as ru, n as fo, D as iu, q as ut, r as ou, v as su, B as au, w as On } from "../index.module-97c322f5.js";
|
|
2
|
+
import { x as J3, y as Q3 } from "../index.module-97c322f5.js";
|
|
3
3
|
import { jsxs as k, Fragment as gn, jsx as g } from "react/jsx-runtime";
|
|
4
4
|
import * as N from "react";
|
|
5
5
|
import ya, { useContext as ie, useState as K, useEffect as be, useRef as ze, createContext as jt, useLayoutEffect as wi, useInsertionEffect as lu, useCallback as Qt, useMemo as hr, forwardRef as va, createElement as en, useId as cu, PureComponent as uu } from "react";
|
|
@@ -7,10 +7,11 @@ export * from './NotFoundPage';
|
|
|
7
7
|
export * from './UnauthorizedPage';
|
|
8
8
|
export * from './StyledAutocomplete/index.ts';
|
|
9
9
|
export * from './StyledDateRangePicker';
|
|
10
|
-
export * from
|
|
11
|
-
export * from
|
|
10
|
+
export * from './BaseCheckBox';
|
|
11
|
+
export * from './IconButton';
|
|
12
12
|
export * from './RequiredLabel';
|
|
13
13
|
export * from './SearchTypeSelect';
|
|
14
14
|
export * from './BaseSwitch';
|
|
15
|
-
export * from
|
|
16
|
-
export * from
|
|
15
|
+
export * from './FilterWraper';
|
|
16
|
+
export * from './Notification';
|
|
17
|
+
export * from './MultiProvider';
|