@pivotfinancialtechnologies/admin-frontend-blueprint-template 0.0.2-dev.9 → 0.0.3-dev.11
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/README.md +61 -60
- package/dist/PermissionVisibility-DWlTcq5R.js +24 -0
- package/dist/PermissionVisibility-DcNQuqAD.cjs +1 -0
- package/dist/SettingsSectionBase-S_Y2d_vs.js +475 -0
- package/dist/SettingsSectionBase-Yx14wvkV.cjs +1 -0
- package/dist/TopBarNavLayout-BkDwDvQf.js +62 -0
- package/dist/TopBarNavLayout-DGP6BWzi.cjs +1 -0
- package/dist/{index.css → admin-frontend-blueprint-template.css} +1 -1
- package/dist/api-CzCTYMlh.js +81 -0
- package/dist/api-nTm6UPd6.cjs +1 -0
- package/dist/{utils → clipboard}/copy.d.ts +1 -1
- package/dist/clipboard/index.d.ts +1 -0
- package/dist/components/Data/BooleanTag/BooleanTag.d.ts +1 -1
- package/dist/components/Data/Datatable/Datatable.d.ts +1 -1
- package/dist/components/index.d.ts +2 -4
- package/dist/components.cjs +1 -0
- package/dist/components.d.ts +2 -0
- package/dist/components.js +14 -0
- package/dist/date-DxdnAP5U.js +13 -0
- package/dist/date-RB_2ERsI.cjs +1 -0
- package/dist/feedback/index.d.ts +1 -0
- package/dist/formatters/duration.d.ts +1 -0
- package/dist/formatters/index.d.ts +4 -0
- package/dist/formatters/money.d.ts +3 -0
- package/dist/formatters/phone.d.ts +1 -0
- package/dist/formatters.cjs +1 -0
- package/dist/formatters.d.ts +2 -0
- package/dist/formatters.js +12 -0
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/useSize.d.ts +5 -0
- package/dist/hooks/useUrlForm.d.ts +5 -0
- package/dist/hooks.cjs +1 -0
- package/dist/hooks.d.ts +2 -0
- package/dist/hooks.js +6 -0
- package/dist/http/api.d.ts +49 -0
- package/dist/http/index.d.ts +2 -0
- package/dist/http/query.d.ts +5 -0
- package/dist/http.cjs +1 -0
- package/dist/http.d.ts +2 -0
- package/dist/http.js +11 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +8 -2
- package/dist/index.js +49 -4535
- package/dist/layout/index.d.ts +4 -0
- package/dist/layout.cjs +1 -0
- package/dist/layout.d.ts +2 -0
- package/dist/layout.js +7 -0
- package/dist/phone-DmQ5SK-X.cjs +1 -0
- package/dist/phone-DtDgQ5qk.js +27 -0
- package/dist/query-Br3l_kxt.cjs +1 -0
- package/dist/query-CherHJOV.js +17 -0
- package/dist/{components/Security → security}/PermissionVisibility.d.ts +4 -2
- package/dist/security/index.d.ts +3 -0
- package/dist/security.cjs +1 -0
- package/dist/security.d.ts +2 -0
- package/dist/security.js +6 -0
- package/dist/toast-B3QUItIK.js +10 -0
- package/dist/toast-CCrs9yfw.cjs +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/{components/Data/Pagination.d.ts → types/pagination.d.ts} +2 -2
- package/dist/useSize-BLbsGFVL.cjs +1 -0
- package/dist/useSize-Ci0PbN9W.js +15 -0
- package/dist/useUrlForm-BYTOPBsx.js +26 -0
- package/dist/useUrlForm-CxnAS6tK.cjs +1 -0
- package/package.json +62 -9
- package/dist/components/Data/utils.d.ts +0 -5
- package/dist/index.umd.cjs +0 -14
- package/dist/layouts/index.d.ts +0 -3
- package/dist/utils/http.d.ts +0 -4
- package/dist/utils/index.d.ts +0 -6
- package/dist/utils/useUrlForm.d.ts +0 -4
- /package/dist/{utils → feedback}/toast.d.ts +0 -0
- /package/dist/{utils/formatters.d.ts → formatters/date.d.ts} +0 -0
- /package/dist/{layouts → layout}/ThemeSwitch/ThemeSwitch.d.ts +0 -0
- /package/dist/{layouts → layout}/TopBarNavLayout/TopBarNavLayout.d.ts +0 -0
- /package/dist/{layouts → layout}/Topbar/Topbar.d.ts +0 -0
- /package/dist/{utils → layout}/theme.d.ts +0 -0
- /package/dist/{components/Security → security}/AuthRoute.d.ts +0 -0
- /package/dist/{components/Security → security}/UnAuthRoute.d.ts +0 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { jsx as e, jsxs as r } from "react/jsx-runtime";
|
|
2
|
+
import { useState as d, useEffect as u } from "react";
|
|
3
|
+
import { Classes as c, Colors as i, Switch as h, Navbar as b, NavbarGroup as s, NavbarHeading as g, PopoverNext as v, Button as p, Menu as y, MenuItem as l, MenuDivider as N } from "@blueprintjs/core";
|
|
4
|
+
const T = () => {
|
|
5
|
+
const [n, a] = d(() => {
|
|
6
|
+
if (typeof window > "u")
|
|
7
|
+
return !1;
|
|
8
|
+
try {
|
|
9
|
+
return window.localStorage.getItem("theme") === "dark";
|
|
10
|
+
} catch {
|
|
11
|
+
return !1;
|
|
12
|
+
}
|
|
13
|
+
}), o = (t) => {
|
|
14
|
+
document.body.classList.toggle(c.DARK, t), document.body.style.backgroundColor = t ? i.DARK_GRAY3 : i.LIGHT_GRAY5;
|
|
15
|
+
try {
|
|
16
|
+
window.localStorage.setItem("theme", t ? "dark" : "light");
|
|
17
|
+
} catch {
|
|
18
|
+
}
|
|
19
|
+
a(t);
|
|
20
|
+
};
|
|
21
|
+
return u(() => {
|
|
22
|
+
o(n);
|
|
23
|
+
const t = new MutationObserver(() => {
|
|
24
|
+
const m = document.body.classList.contains(c.DARK);
|
|
25
|
+
a(m);
|
|
26
|
+
});
|
|
27
|
+
return t.observe(document.body, { attributes: !0, attributeFilter: ["class"] }), () => t.disconnect();
|
|
28
|
+
}, [n]), {
|
|
29
|
+
isDarkTheme: n,
|
|
30
|
+
setTheme: o
|
|
31
|
+
};
|
|
32
|
+
}, f = (n) => {
|
|
33
|
+
const { isDarkTheme: a, setTheme: o } = T();
|
|
34
|
+
return /* @__PURE__ */ e(h, { ...n, checked: a, label: "Dark Mode", onChange: () => o(!a), alignIndicator: "right" });
|
|
35
|
+
}, w = ({ title: n, navigation: a, onProfileClick: o, onLogoutClick: t }) => /* @__PURE__ */ r(b, { className: "custom-navbar", children: [
|
|
36
|
+
/* @__PURE__ */ e(s, { align: "left", className: "custom-navbar__title", children: /* @__PURE__ */ e(g, { children: n }) }),
|
|
37
|
+
/* @__PURE__ */ e(s, { className: "custom-navbar__navigation", children: a }),
|
|
38
|
+
/* @__PURE__ */ r(s, { align: "end", className: "custom-navbar__actions", children: [
|
|
39
|
+
/* @__PURE__ */ e(f, { className: "mb-0!" }),
|
|
40
|
+
/* @__PURE__ */ e(
|
|
41
|
+
v,
|
|
42
|
+
{
|
|
43
|
+
placement: "bottom-end",
|
|
44
|
+
content: /* @__PURE__ */ r(y, { children: [
|
|
45
|
+
/* @__PURE__ */ e(l, { icon: "id-number", text: "My profile", onClick: o }),
|
|
46
|
+
/* @__PURE__ */ e(N, {}),
|
|
47
|
+
/* @__PURE__ */ e(l, { intent: "danger", icon: "log-out", text: "Sign out", onClick: t })
|
|
48
|
+
] }),
|
|
49
|
+
children: /* @__PURE__ */ e(p, { icon: "user" })
|
|
50
|
+
}
|
|
51
|
+
)
|
|
52
|
+
] })
|
|
53
|
+
] }), _ = ({ children: n, ...a }) => /* @__PURE__ */ r("div", { className: "main-layout", children: [
|
|
54
|
+
/* @__PURE__ */ e("div", { className: "topbar", children: /* @__PURE__ */ e(w, { ...a }) }),
|
|
55
|
+
/* @__PURE__ */ e("div", { className: "body", children: n })
|
|
56
|
+
] });
|
|
57
|
+
export {
|
|
58
|
+
f as T,
|
|
59
|
+
_ as a,
|
|
60
|
+
w as b,
|
|
61
|
+
T as u
|
|
62
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),o=require("react"),t=require("@blueprintjs/core"),c=()=>{const[n,a]=o.useState(()=>{if(typeof window>"u")return!1;try{return window.localStorage.getItem("theme")==="dark"}catch{return!1}}),r=s=>{document.body.classList.toggle(t.Classes.DARK,s),document.body.style.backgroundColor=s?t.Colors.DARK_GRAY3:t.Colors.LIGHT_GRAY5;try{window.localStorage.setItem("theme",s?"dark":"light")}catch{}a(s)};return o.useEffect(()=>{r(n);const s=new MutationObserver(()=>{const u=document.body.classList.contains(t.Classes.DARK);a(u)});return s.observe(document.body,{attributes:!0,attributeFilter:["class"]}),()=>s.disconnect()},[n]),{isDarkTheme:n,setTheme:r}},i=n=>{const{isDarkTheme:a,setTheme:r}=c(),s=()=>r(!a);return e.jsx(t.Switch,{...n,checked:a,label:"Dark Mode",onChange:s,alignIndicator:"right"})},l=({title:n,navigation:a,onProfileClick:r,onLogoutClick:s})=>e.jsxs(t.Navbar,{className:"custom-navbar",children:[e.jsx(t.NavbarGroup,{align:"left",className:"custom-navbar__title",children:e.jsx(t.NavbarHeading,{children:n})}),e.jsx(t.NavbarGroup,{className:"custom-navbar__navigation",children:a}),e.jsxs(t.NavbarGroup,{align:"end",className:"custom-navbar__actions",children:[e.jsx(i,{className:"mb-0!"}),e.jsx(t.PopoverNext,{placement:"bottom-end",content:e.jsxs(t.Menu,{children:[e.jsx(t.MenuItem,{icon:"id-number",text:"My profile",onClick:r}),e.jsx(t.MenuDivider,{}),e.jsx(t.MenuItem,{intent:"danger",icon:"log-out",text:"Sign out",onClick:s})]}),children:e.jsx(t.Button,{icon:"user"})})]})]}),m=({children:n,...a})=>e.jsxs("div",{className:"main-layout",children:[e.jsx("div",{className:"topbar",children:e.jsx(l,{...a})}),e.jsx("div",{className:"body",children:n})]});exports.ThemeSwitch=i;exports.TopBarNavLayout=m;exports.Topbar=l;exports.useTheme=c;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.table-form-actions{display:flex}.table-actions{flex-shrink:0;align-self:flex-end;align-items:center;padding:10px 0;gap:10px;display:flex}.columns-visibility-menu{gap:10px;display:flex}.table-form{flex:1}.table-content{height:520px;overflow-y:auto;overflow-x:hidden}.table-pagination{display:flex;justify-content:space-between;align-items:center;margin:10px;padding-top:20px}.rows-select-container{display:flex;align-items:center}.rows-select-container span{margin-right:10px}.pagination-page-info{margin:0 10px}.simple-html-datatable{--table-border-color: rgba(129, 129, 129, .45);font-size:12px;border-collapse:collapse;border:1px solid var(--table-border-color)}.simple-html-datatable th,.simple-html-datatable td{padding:4px 8px;border-bottom:1px solid var(--table-border-color);border-right:1px solid var(--table-border-color)}.
|
|
1
|
+
.table-form-actions{display:flex}.table-actions{flex-shrink:0;align-self:flex-end;align-items:center;padding:10px 0;gap:10px;display:flex}.columns-visibility-menu{gap:10px;display:flex}.table-form{flex:1}.table-content{height:520px;overflow-y:auto;overflow-x:hidden}.table-pagination{display:flex;justify-content:space-between;align-items:center;margin:10px;padding-top:20px}.rows-select-container{display:flex;align-items:center}.rows-select-container span{margin-right:10px}.pagination-page-info{margin:0 10px}.simple-html-datatable{--table-border-color: rgba(129, 129, 129, .45);font-size:12px;border-collapse:collapse;border:1px solid var(--table-border-color)}.simple-html-datatable th,.simple-html-datatable td{padding:4px 8px;border-bottom:1px solid var(--table-border-color);border-right:1px solid var(--table-border-color)}.bp6-intent-primary{background-color:#2d72d21a;color:#2d72d2}.bp6-intent-warning{background-color:#ffe5641a;color:#d9822b}.bp6-intent-danger{background-color:#ff4d4f1a;color:#f45e5e}.custom-navbar{display:flex;width:100%;height:auto;min-height:50px;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:.5rem 1rem;padding-block:.25rem}.custom-navbar>.bp6-navbar-group{height:auto;min-height:50px;flex-wrap:wrap;gap:.5rem}.custom-navbar__navigation{flex:1 1 auto;justify-content:center}.custom-navbar__actions{flex:0 1 auto}@media(max-width:640px){.custom-navbar>.bp6-navbar-group{flex:1 1 100%}.custom-navbar__navigation,.custom-navbar__actions{justify-content:flex-start}}.nav-button{box-shadow:none!important}.nav-button:hover{background:#ffffff1a!important}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { s as U } from "./toast-B3QUItIK.js";
|
|
2
|
+
const h = (t) => typeof t == "object" && t !== null, s = (t, r) => typeof t[r] == "string" ? t[r] : void 0, f = (t, r) => {
|
|
3
|
+
if (typeof t == "string")
|
|
4
|
+
return { status: r, error: t, message: t };
|
|
5
|
+
const e = h(t) ? t : {}, n = s(e, "type"), o = s(e, "title"), i = s(e, "detail"), u = s(e, "error"), p = i ?? o ?? s(e, "message") ?? u ?? `Request failed with status code ${r}`;
|
|
6
|
+
return {
|
|
7
|
+
status: r,
|
|
8
|
+
message: p,
|
|
9
|
+
error: i ?? u ?? o,
|
|
10
|
+
type: n,
|
|
11
|
+
title: o,
|
|
12
|
+
detail: i,
|
|
13
|
+
instance: s(e, "instance"),
|
|
14
|
+
field: s(e, "field"),
|
|
15
|
+
code: s(e, "code") ?? s(e, "statusCode") ?? s(e, "status"),
|
|
16
|
+
entity: s(e, "entity")
|
|
17
|
+
};
|
|
18
|
+
}, R = (t) => {
|
|
19
|
+
if (!h(t))
|
|
20
|
+
return t instanceof Error ? { status: 0, message: t.message, error: t.message } : void 0;
|
|
21
|
+
if (typeof t.status == "number" && typeof t.message == "string")
|
|
22
|
+
return {
|
|
23
|
+
...f(t, t.status),
|
|
24
|
+
error: s(t, "error") ?? s(t, "detail")
|
|
25
|
+
};
|
|
26
|
+
if ("data" in t) {
|
|
27
|
+
const r = typeof t.status == "number" ? t.status : 0;
|
|
28
|
+
return f(t.data, r);
|
|
29
|
+
}
|
|
30
|
+
}, B = async (t, r, e) => {
|
|
31
|
+
try {
|
|
32
|
+
const n = await t();
|
|
33
|
+
await r?.(n);
|
|
34
|
+
} catch (n) {
|
|
35
|
+
e?.(R(n));
|
|
36
|
+
}
|
|
37
|
+
}, S = (t) => {
|
|
38
|
+
U({ intent: "danger", message: t.message });
|
|
39
|
+
}, q = (t) => {
|
|
40
|
+
if (t)
|
|
41
|
+
try {
|
|
42
|
+
return JSON.parse(t);
|
|
43
|
+
} catch {
|
|
44
|
+
return t;
|
|
45
|
+
}
|
|
46
|
+
}, C = (t = {}) => async (r) => {
|
|
47
|
+
const { url: e, method: n, data: o, params: i, headers: u, responseType: p } = r, g = t.onError ?? S;
|
|
48
|
+
try {
|
|
49
|
+
const a = t.getBaseUrl?.() ?? "", d = /^[a-z][a-z\d+.-]*:/i.test(e) ? new URL(e) : new URL(`${a.replace(/\/+$/, "")}/${e.replace(/^\/+/, "")}`, window.location.origin);
|
|
50
|
+
i && i.forEach((E, v) => d.searchParams.append(v, E));
|
|
51
|
+
const l = new Headers(u), m = o === void 0 ? void 0 : JSON.stringify(o);
|
|
52
|
+
m !== void 0 && !l.has("Content-Type") && l.set("Content-Type", "application/json");
|
|
53
|
+
const c = await fetch(d, {
|
|
54
|
+
method: n,
|
|
55
|
+
headers: l,
|
|
56
|
+
body: m,
|
|
57
|
+
credentials: "include"
|
|
58
|
+
});
|
|
59
|
+
if (c.ok && p === "blob")
|
|
60
|
+
return { data: await c.blob() };
|
|
61
|
+
const b = await c.text(), y = q(b);
|
|
62
|
+
if (c.ok)
|
|
63
|
+
return { data: y };
|
|
64
|
+
c.status === 401 && t.onUnauthorized?.();
|
|
65
|
+
const w = f(y, c.status);
|
|
66
|
+
return g(w), { error: w };
|
|
67
|
+
} catch (a) {
|
|
68
|
+
const d = {
|
|
69
|
+
status: 0,
|
|
70
|
+
message: a instanceof Error ? a.message : String(a),
|
|
71
|
+
error: a instanceof Error ? a.message : String(a)
|
|
72
|
+
};
|
|
73
|
+
return g(d), { error: d };
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
export {
|
|
77
|
+
C as c,
|
|
78
|
+
R as g,
|
|
79
|
+
f as m,
|
|
80
|
+
B as w
|
|
81
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const U=require("./toast-CCrs9yfw.cjs"),h=t=>typeof t=="object"&&t!==null,s=(t,r)=>typeof t[r]=="string"?t[r]:void 0,l=(t,r)=>{if(typeof t=="string")return{status:r,error:t,message:t};const e=h(t)?t:{},n=s(e,"type"),o=s(e,"title"),i=s(e,"detail"),u=s(e,"error"),p=i??o??s(e,"message")??u??`Request failed with status code ${r}`;return{status:r,message:p,error:i??u??o,type:n,title:o,detail:i,instance:s(e,"instance"),field:s(e,"field"),code:s(e,"code")??s(e,"statusCode")??s(e,"status"),entity:s(e,"entity")}},b=t=>{if(!h(t))return t instanceof Error?{status:0,message:t.message,error:t.message}:void 0;if(typeof t.status=="number"&&typeof t.message=="string")return{...l(t,t.status),error:s(t,"error")??s(t,"detail")};if("data"in t){const r=typeof t.status=="number"?t.status:0;return l(t.data,r)}},q=async(t,r,e)=>{try{const n=await t();await r?.(n)}catch(n){e?.(b(n))}},B=t=>{U.showToast({intent:"danger",message:t.message})},C=t=>{if(t)try{return JSON.parse(t)}catch{return t}},R=(t={})=>async r=>{const{url:e,method:n,data:o,params:i,headers:u,responseType:p}=r,g=t.onError??B;try{const a=t.getBaseUrl?.()??"",d=/^[a-z][a-z\d+.-]*:/i.test(e)?new URL(e):new URL(`${a.replace(/\/+$/,"")}/${e.replace(/^\/+/,"")}`,window.location.origin);i&&i.forEach((A,v)=>d.searchParams.append(v,A));const f=new Headers(u),y=o===void 0?void 0:JSON.stringify(o);y!==void 0&&!f.has("Content-Type")&&f.set("Content-Type","application/json");const c=await fetch(d,{method:n,headers:f,body:y,credentials:"include"});if(c.ok&&p==="blob")return{data:await c.blob()};const E=await c.text(),m=C(E);if(c.ok)return{data:m};c.status===401&&t.onUnauthorized?.();const w=l(m,c.status);return g(w),{error:w}}catch(a){const d={status:0,message:a instanceof Error?a.message:String(a),error:a instanceof Error?a.message:String(a)};return g(d),{error:d}}};exports.createApiBaseQuery=R;exports.getApiError=b;exports.mapProblemDetails=l;exports.wrapApiCall=q;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const createCopyableText: (value:
|
|
1
|
+
export declare const createCopyableText: (value: unknown) => string;
|
|
2
2
|
export declare const copyTextToClipboard: (text: string) => Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './copy.ts';
|
|
@@ -3,5 +3,5 @@ interface BooleanTagProps {
|
|
|
3
3
|
trueLabel?: string;
|
|
4
4
|
falseLabel?: string;
|
|
5
5
|
}
|
|
6
|
-
export declare const BooleanTag: ({ value, trueLabel, falseLabel
|
|
6
|
+
export declare const BooleanTag: ({ value, trueLabel, falseLabel }: BooleanTagProps) => import("react").JSX.Element;
|
|
7
7
|
export {};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export * from './Data/Pagination.ts';
|
|
2
1
|
export * from './Data/BooleanTag/BooleanTag';
|
|
3
2
|
export * from './Data/Datatable/Datatable.tsx';
|
|
4
3
|
export * from './Data/Datatable/TableCellTag.tsx';
|
|
@@ -8,6 +7,5 @@ export * from './Data/SimpleHTMLDatatable/SimpleHTMLDatatable.tsx';
|
|
|
8
7
|
export * from './Dialog/ConfirmationDialog.tsx';
|
|
9
8
|
export * from './Data/Select/SelectItem.tsx';
|
|
10
9
|
export * from './Data/Select/SelectMultipleItems.tsx';
|
|
11
|
-
export * from './
|
|
12
|
-
export * from './
|
|
13
|
-
export * from './Security/PermissionVisibility.tsx';
|
|
10
|
+
export * from './Data/Settings/SettingGroup.tsx';
|
|
11
|
+
export * from './Data/Settings/SettingsSectionBase.tsx';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./SettingsSectionBase-Yx14wvkV.cjs");exports.BooleanTag=e.BooleanTag;exports.Datatable=e.Datatable;exports.SelectItem=e.SelectItem;exports.SelectMultipleItems=e.SelectMultipleItems;exports.SettingGroup=e.SettingGroup;exports.SettingsSectionBase=e.SettingsSectionBase;exports.SimpleDatatable=e.SimpleDatatable;exports.SimpleHTMLDatatable=e.SimpleHTMLDatatable;exports.TableCellTag=e.TableCellTag;exports.createTableCopyMenu=e.createTableCopyMenu;exports.useConfirmDialog=e.useConfirmDialog;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { B as t, D as l, S as s, a as o, b as i, c as S, d as b, e as m, T as n, f as p, u as T } from "./SettingsSectionBase-S_Y2d_vs.js";
|
|
2
|
+
export {
|
|
3
|
+
t as BooleanTag,
|
|
4
|
+
l as Datatable,
|
|
5
|
+
s as SelectItem,
|
|
6
|
+
o as SelectMultipleItems,
|
|
7
|
+
i as SettingGroup,
|
|
8
|
+
S as SettingsSectionBase,
|
|
9
|
+
b as SimpleDatatable,
|
|
10
|
+
m as SimpleHTMLDatatable,
|
|
11
|
+
n as TableCellTag,
|
|
12
|
+
p as createTableCopyMenu,
|
|
13
|
+
T as useConfirmDialog
|
|
14
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { formatInTimeZone as l } from "date-fns-tz";
|
|
2
|
+
import { enUS as r } from "date-fns/locale";
|
|
3
|
+
const t = { enUS: r }, D = () => Promise.resolve(r), f = (e, n = "yyyy-MM-dd HH:mm:ss z", o = "enUS", s = "America/Los_Angeles") => {
|
|
4
|
+
if (!e)
|
|
5
|
+
return "";
|
|
6
|
+
const i = t[o] || t.enUS, c = typeof e == "string" ? e.endsWith("Z") || e.includes("+") ? new Date(e) : /* @__PURE__ */ new Date(e + "Z") : new Date(e);
|
|
7
|
+
return l(c, s, n, { locale: i });
|
|
8
|
+
}, u = (e, n = "en-US") => e ? (typeof e == "string" ? e.endsWith("Z") || e.includes("+") ? new Date(e) : /* @__PURE__ */ new Date(e + "Z") : new Date(e)).toLocaleDateString(n) : "";
|
|
9
|
+
export {
|
|
10
|
+
f as a,
|
|
11
|
+
u as f,
|
|
12
|
+
D as l
|
|
13
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const l=require("date-fns-tz"),r=require("date-fns/locale"),o={enUS:r.enUS},a=()=>Promise.resolve(r.enUS),D=(e,n="yyyy-MM-dd HH:mm:ss z",t="enUS",s="America/Los_Angeles")=>{if(!e)return"";const c=o[t]||o.enUS,i=typeof e=="string"?e.endsWith("Z")||e.includes("+")?new Date(e):new Date(e+"Z"):new Date(e);return l.formatInTimeZone(i,s,n,{locale:c})},m=(e,n="en-US")=>e?(typeof e=="string"?e.endsWith("Z")||e.includes("+")?new Date(e):new Date(e+"Z"):new Date(e)).toLocaleDateString(n):"";exports.formatDateOnly=m;exports.formatDateTime=D;exports.localeLoader=a;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './toast.ts';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const formatDateDuration: (start?: Date | string | number | null, end?: Date | string | number | null) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const formatPhone: (value: string | number | undefined) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./date-RB_2ERsI.cjs"),e=require("./phone-DmQ5SK-X.cjs");exports.formatDateOnly=r.formatDateOnly;exports.formatDateTime=r.formatDateTime;exports.localeLoader=r.localeLoader;exports.currencyFormatter=e.currencyFormatter;exports.formatCurrency=e.formatCurrency;exports.formatDateDuration=e.formatDateDuration;exports.formatPhone=e.formatPhone;exports.parseMoney=e.parseMoney;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { f as o, a as e, l as t } from "./date-DxdnAP5U.js";
|
|
2
|
+
import { c as m, f as s, a as n, b as c, p as l } from "./phone-DtDgQ5qk.js";
|
|
3
|
+
export {
|
|
4
|
+
m as currencyFormatter,
|
|
5
|
+
s as formatCurrency,
|
|
6
|
+
n as formatDateDuration,
|
|
7
|
+
o as formatDateOnly,
|
|
8
|
+
e as formatDateTime,
|
|
9
|
+
c as formatPhone,
|
|
10
|
+
t as localeLoader,
|
|
11
|
+
l as parseMoney
|
|
12
|
+
};
|
package/dist/hooks.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./useSize-BLbsGFVL.cjs"),r=require("./useUrlForm-CxnAS6tK.cjs");exports.useSize=e.useSize;exports.useUrlForm=r.useUrlForm;
|
package/dist/hooks.d.ts
ADDED
package/dist/hooks.js
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export interface ProblemDetails {
|
|
2
|
+
type?: string;
|
|
3
|
+
title?: string;
|
|
4
|
+
status?: number;
|
|
5
|
+
detail?: string;
|
|
6
|
+
instance?: string;
|
|
7
|
+
message?: string;
|
|
8
|
+
error?: string;
|
|
9
|
+
field?: string;
|
|
10
|
+
code?: string;
|
|
11
|
+
entity?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface ApiError {
|
|
14
|
+
status: number;
|
|
15
|
+
error?: string;
|
|
16
|
+
message: string;
|
|
17
|
+
type?: string;
|
|
18
|
+
title?: string;
|
|
19
|
+
detail?: string;
|
|
20
|
+
instance?: string;
|
|
21
|
+
field?: string;
|
|
22
|
+
code?: string;
|
|
23
|
+
entity?: string;
|
|
24
|
+
}
|
|
25
|
+
export interface ApiRequestArgs {
|
|
26
|
+
url: string;
|
|
27
|
+
method?: string;
|
|
28
|
+
data?: unknown;
|
|
29
|
+
params?: URLSearchParams;
|
|
30
|
+
headers?: HeadersInit;
|
|
31
|
+
responseType?: 'blob';
|
|
32
|
+
}
|
|
33
|
+
export type ApiBaseQueryResult = {
|
|
34
|
+
data: unknown;
|
|
35
|
+
} | {
|
|
36
|
+
error: ApiError;
|
|
37
|
+
};
|
|
38
|
+
export interface CreateApiBaseQueryOptions {
|
|
39
|
+
getBaseUrl?: () => string;
|
|
40
|
+
onUnauthorized?: () => void;
|
|
41
|
+
onError?: (error: ApiError) => void;
|
|
42
|
+
}
|
|
43
|
+
export declare const mapProblemDetails: (responseData: unknown, status: number) => ApiError;
|
|
44
|
+
export declare const getApiError: (error: unknown) => ApiError | undefined;
|
|
45
|
+
type ErrorHandler = (error?: ApiError) => void;
|
|
46
|
+
type SuccessHandler<T> = (result: T) => void | Promise<void>;
|
|
47
|
+
export declare const wrapApiCall: <T>(apiCall: () => Promise<T>, onSuccess?: SuccessHandler<T>, onError?: ErrorHandler) => Promise<void>;
|
|
48
|
+
export declare const createApiBaseQuery: (options?: CreateApiBaseQueryOptions) => (args: ApiRequestArgs) => Promise<ApiBaseQueryResult>;
|
|
49
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { PageRequest } from '../types/pagination.ts';
|
|
2
|
+
export type QueryParamData = Record<string, unknown>;
|
|
3
|
+
export declare const buildQueryParams: (data?: QueryParamData | null | undefined) => URLSearchParams;
|
|
4
|
+
export declare const createHttpQueryParams: (request: PageRequest, data?: QueryParamData) => URLSearchParams;
|
|
5
|
+
export declare const createHttpQueryParamsFromData: (data?: QueryParamData | null) => URLSearchParams;
|
package/dist/http.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./query-Br3l_kxt.cjs"),r=require("./api-nTm6UPd6.cjs");exports.buildQueryParams=e.buildQueryParams;exports.createHttpQueryParams=e.createHttpQueryParams;exports.createHttpQueryParamsFromData=e.createHttpQueryParamsFromData;exports.createApiBaseQuery=r.createApiBaseQuery;exports.getApiError=r.getApiError;exports.mapProblemDetails=r.mapProblemDetails;exports.wrapApiCall=r.wrapApiCall;
|
package/dist/http.d.ts
ADDED
package/dist/http.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { b as e, c as s, a as t } from "./query-CherHJOV.js";
|
|
2
|
+
import { c as p, g as o, m as c, w as i } from "./api-CzCTYMlh.js";
|
|
3
|
+
export {
|
|
4
|
+
e as buildQueryParams,
|
|
5
|
+
p as createApiBaseQuery,
|
|
6
|
+
s as createHttpQueryParams,
|
|
7
|
+
t as createHttpQueryParamsFromData,
|
|
8
|
+
o as getApiError,
|
|
9
|
+
c as mapProblemDetails,
|
|
10
|
+
i as wrapApiCall
|
|
11
|
+
};
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./query-Br3l_kxt.cjs"),a=require("./api-nTm6UPd6.cjs"),i=require("./date-RB_2ERsI.cjs"),t=require("./phone-DmQ5SK-X.cjs"),e=require("./SettingsSectionBase-Yx14wvkV.cjs"),l=require("./PermissionVisibility-DcNQuqAD.cjs"),r=require("./TopBarNavLayout-DGP6BWzi.cjs"),u=require("./useSize-BLbsGFVL.cjs"),s=require("./useUrlForm-CxnAS6tK.cjs"),m=require("./toast-CCrs9yfw.cjs");exports.buildQueryParams=o.buildQueryParams;exports.createHttpQueryParams=o.createHttpQueryParams;exports.createHttpQueryParamsFromData=o.createHttpQueryParamsFromData;exports.createApiBaseQuery=a.createApiBaseQuery;exports.getApiError=a.getApiError;exports.mapProblemDetails=a.mapProblemDetails;exports.wrapApiCall=a.wrapApiCall;exports.formatDateOnly=i.formatDateOnly;exports.formatDateTime=i.formatDateTime;exports.localeLoader=i.localeLoader;exports.currencyFormatter=t.currencyFormatter;exports.formatCurrency=t.formatCurrency;exports.formatDateDuration=t.formatDateDuration;exports.formatPhone=t.formatPhone;exports.parseMoney=t.parseMoney;exports.BooleanTag=e.BooleanTag;exports.Datatable=e.Datatable;exports.SelectItem=e.SelectItem;exports.SelectMultipleItems=e.SelectMultipleItems;exports.SettingGroup=e.SettingGroup;exports.SettingsSectionBase=e.SettingsSectionBase;exports.SimpleDatatable=e.SimpleDatatable;exports.SimpleHTMLDatatable=e.SimpleHTMLDatatable;exports.TableCellTag=e.TableCellTag;exports.copyTextToClipboard=e.copyTextToClipboard;exports.createCopyableText=e.createCopyableText;exports.createPageRequest=e.createPageRequest;exports.createTableCopyMenu=e.createTableCopyMenu;exports.useConfirmDialog=e.useConfirmDialog;exports.AuthRoute=l.AuthRoute;exports.PermissionVisibility=l.PermissionVisibility;exports.UnAuthRoute=l.UnAuthRoute;exports.ThemeSwitch=r.ThemeSwitch;exports.TopBarNavLayout=r.TopBarNavLayout;exports.Topbar=r.Topbar;exports.useTheme=r.useTheme;exports.useSize=u.useSize;exports.useUrlForm=s.useUrlForm;exports.showToast=m.showToast;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
export * from './types';
|
|
2
|
+
export * from './http';
|
|
3
|
+
export * from './formatters';
|
|
1
4
|
export * from './components';
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './
|
|
5
|
+
export * from './security';
|
|
6
|
+
export * from './layout';
|
|
7
|
+
export * from './hooks';
|
|
8
|
+
export * from './feedback';
|
|
9
|
+
export * from './clipboard';
|