@code0-tech/pictor 0.0.0-mvp.13 → 0.0.0-mvp.15
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/assets/components/button/Button.style.css +1 -1
- package/dist/assets/components/card/Card.style.css +1 -1
- package/dist/assets/components/toast/Toast.style.css +1 -1
- package/dist/components/button/Button.d.ts +2 -1
- package/dist/components/button/Button.js +22 -20
- package/dist/components/card/Card.d.ts +2 -1
- package/dist/components/card/Card.js +24 -21
- package/dist/components/{d-namespace/license → d-license}/DNamespaceLicense.service.d.ts +1 -1
- package/dist/components/{d-namespace/license → d-license}/DNamespaceLicense.service.js +1 -1
- package/dist/components/d-license/index.d.ts +2 -0
- package/dist/components/d-license/index.js +6 -0
- package/dist/components/{d-namespace/member → d-member}/DNamespaceMember.service.d.ts +3 -2
- package/dist/components/d-member/DNamespaceMember.service.js +14 -0
- package/dist/components/{d-namespace/member → d-member}/DNamespaceMember.view.d.ts +4 -1
- package/dist/components/{d-namespace/member → d-member}/DNamespaceMember.view.js +4 -1
- package/dist/components/d-member/index.d.ts +2 -0
- package/dist/components/d-member/index.js +6 -0
- package/dist/components/d-namespace/index.d.ts +0 -10
- package/dist/components/d-namespace/index.js +4 -33
- package/dist/components/d-organization/DOrganization.service.d.ts +2 -2
- package/dist/components/d-organization/DOrganization.view.d.ts +4 -1
- package/dist/components/d-organization/DOrganization.view.js +21 -18
- package/dist/components/d-organization/DOrganizationCard.d.ts +3 -3
- package/dist/components/d-organization/DOrganizationCard.js +13 -76
- package/dist/components/d-organization/DOrganizationList.d.ts +10 -0
- package/dist/components/d-organization/DOrganizationList.js +20 -0
- package/dist/components/d-organization/DOrganizatonContent.d.ts +9 -0
- package/dist/components/d-organization/DOrganizatonContent.js +82 -0
- package/dist/components/d-organization/index.d.ts +1 -0
- package/dist/components/d-organization/index.js +8 -5
- package/dist/components/{d-namespace/project → d-project}/DNamespaceProject.service.d.ts +1 -1
- package/dist/components/d-project/DNamespaceProject.service.js +14 -0
- package/dist/components/{d-namespace/project → d-project}/DNamespaceProject.view.d.ts +4 -1
- package/dist/components/{d-namespace/project → d-project}/DNamespaceProject.view.js +13 -10
- package/dist/components/{d-namespace/project → d-project}/DNamespaceProjectCard.d.ts +1 -1
- package/dist/components/d-project/DNamespaceProjectCard.js +15 -0
- package/dist/components/d-project/DNamespaceProjectContent.d.ts +8 -0
- package/dist/components/d-project/DNamespaceProjectContent.js +68 -0
- package/dist/components/d-project/DNamespaceProjectList.d.ts +9 -0
- package/dist/components/d-project/DNamespaceProjectList.js +19 -0
- package/dist/components/{d-namespace/project → d-project}/DNamespaceProjectMenu.d.ts +1 -1
- package/dist/components/{d-namespace/project → d-project}/DNamespaceProjectMenu.js +3 -3
- package/dist/components/d-project/index.d.ts +5 -0
- package/dist/components/d-project/index.js +24 -0
- package/dist/components/{d-namespace/role → d-role}/DNamespaceRole.service.d.ts +1 -1
- package/dist/components/{d-namespace/role → d-role}/DNamespaceRole.service.js +1 -1
- package/dist/components/d-role/index.d.ts +2 -0
- package/dist/components/d-role/index.js +6 -0
- package/dist/components/d-runtime/DRuntime.view.d.ts +4 -1
- package/dist/components/d-runtime/DRuntime.view.js +6 -3
- package/dist/components/d-runtime/DRuntimeCard.d.ts +7 -0
- package/dist/components/d-runtime/DRuntimeCard.js +17 -0
- package/dist/components/d-runtime/DRuntimeContent.d.ts +7 -0
- package/dist/components/d-runtime/DRuntimeContent.js +38 -0
- package/dist/components/d-runtime/DRuntimeList.d.ts +9 -0
- package/dist/components/d-runtime/DRuntimeList.js +19 -0
- package/dist/components/d-runtime/index.d.ts +2 -0
- package/dist/components/d-runtime/index.js +6 -2
- package/dist/components/d-user/DUser.view.d.ts +4 -1
- package/dist/components/d-user/DUser.view.js +13 -10
- package/dist/components/d-user/DUserCard.d.ts +7 -0
- package/dist/components/d-user/DUserCard.js +15 -0
- package/dist/components/d-user/DUserContent.d.ts +7 -0
- package/dist/components/d-user/DUserContent.js +84 -0
- package/dist/components/d-user/DUserList.d.ts +9 -0
- package/dist/components/d-user/DUserList.js +19 -0
- package/dist/components/d-user/index.d.ts +2 -0
- package/dist/components/d-user/index.js +11 -7
- package/dist/components/form/useForm.d.ts +2 -1
- package/dist/components/form/useForm.js +27 -18
- package/dist/components/toast/Toast.d.ts +1 -0
- package/dist/components/toast/Toast.js +54 -62
- package/dist/index.d.ts +4 -0
- package/dist/index.js +184 -172
- package/package.json +11 -10
- package/dist/components/d-namespace/member/DNamespaceMember.service.js +0 -11
- package/dist/components/d-namespace/project/DNamespaceProject.service.js +0 -11
- package/dist/components/d-namespace/project/DNamespaceProjectCard.js +0 -57
- /package/dist/components/{d-namespace/license → d-license}/DNamespaceLicense.view.d.ts +0 -0
- /package/dist/components/{d-namespace/license → d-license}/DNamespaceLicense.view.js +0 -0
- /package/dist/components/{d-namespace/role → d-role}/DNamespaceRole.view.d.ts +0 -0
- /package/dist/components/{d-namespace/role → d-role}/DNamespaceRole.view.js +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Maybe, Namespace, NamespaceMemberConnection, Scalars, User, UserIdentityConnection, UserSessionConnection } from '@code0-tech/sagittarius-graphql-types';
|
|
1
|
+
import { Maybe, Namespace, NamespaceMemberConnection, Scalars, User, UserIdentityConnection, UserSessionConnection, UserUserAbilities } from '@code0-tech/sagittarius-graphql-types';
|
|
2
2
|
export declare class DUserView {
|
|
3
3
|
/** Global admin status of the user */
|
|
4
4
|
private _admin?;
|
|
@@ -28,6 +28,8 @@ export declare class DUserView {
|
|
|
28
28
|
private readonly _updatedAt?;
|
|
29
29
|
/** Username of the user */
|
|
30
30
|
private _username?;
|
|
31
|
+
/** Abilities for the current user on this User */
|
|
32
|
+
private readonly _userAbilities?;
|
|
31
33
|
constructor(user: User);
|
|
32
34
|
get admin(): Maybe<Scalars["Boolean"]["output"]> | undefined;
|
|
33
35
|
get avatarPath(): Maybe<Scalars["String"]["output"]> | undefined;
|
|
@@ -43,6 +45,7 @@ export declare class DUserView {
|
|
|
43
45
|
get sessions(): Maybe<UserSessionConnection> | undefined;
|
|
44
46
|
get updatedAt(): Maybe<Scalars["Time"]["output"]> | undefined;
|
|
45
47
|
get username(): Maybe<Scalars["String"]["output"]> | undefined;
|
|
48
|
+
get userAbilities(): Maybe<UserUserAbilities> | undefined;
|
|
46
49
|
set admin(value: Maybe<Scalars["Boolean"]["output"]>);
|
|
47
50
|
set email(value: Maybe<Scalars["String"]["output"]>);
|
|
48
51
|
set firstname(value: Maybe<Scalars["String"]["output"]>);
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
function i
|
|
2
|
-
return (e =
|
|
1
|
+
function t(i, e, s) {
|
|
2
|
+
return (e = r(e)) in i ? Object.defineProperty(i, e, { value: s, enumerable: !0, configurable: !0, writable: !0 }) : i[e] = s, i;
|
|
3
3
|
}
|
|
4
|
-
function
|
|
5
|
-
var e =
|
|
4
|
+
function r(i) {
|
|
5
|
+
var e = n(i, "string");
|
|
6
6
|
return typeof e == "symbol" ? e : e + "";
|
|
7
7
|
}
|
|
8
|
-
function
|
|
9
|
-
if (typeof
|
|
10
|
-
var s =
|
|
8
|
+
function n(i, e) {
|
|
9
|
+
if (typeof i != "object" || !i) return i;
|
|
10
|
+
var s = i[Symbol.toPrimitive];
|
|
11
11
|
if (s !== void 0) {
|
|
12
|
-
var a = s.call(
|
|
12
|
+
var a = s.call(i, e);
|
|
13
13
|
if (typeof a != "object") return a;
|
|
14
14
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
15
15
|
}
|
|
16
|
-
return (e === "string" ? String : Number)(
|
|
16
|
+
return (e === "string" ? String : Number)(i);
|
|
17
17
|
}
|
|
18
18
|
class m {
|
|
19
19
|
constructor(e) {
|
|
20
|
-
|
|
20
|
+
t(this, "_admin", void 0), t(this, "_avatarPath", void 0), t(this, "_createdAt", void 0), t(this, "_email", void 0), t(this, "_emailVerifiedAt", void 0), t(this, "_firstname", void 0), t(this, "_id", void 0), t(this, "_identities", void 0), t(this, "_lastname", void 0), t(this, "_namespace", void 0), t(this, "_namespaceMemberships", void 0), t(this, "_sessions", void 0), t(this, "_updatedAt", void 0), t(this, "_username", void 0), t(this, "_userAbilities", void 0), this._admin = e.admin, this._avatarPath = e.avatarPath, this._createdAt = e.createdAt, this._email = e.email, this._emailVerifiedAt = e.emailVerifiedAt, this._firstname = e.firstname, this._id = e.id, this._identities = e.identities, this._lastname = e.lastname, this._namespace = e.namespace, this._namespaceMemberships = e.namespaceMemberships, this._sessions = e.sessions, this._updatedAt = e.updatedAt, this._username = e.username, this._userAbilities = e.userAbilities;
|
|
21
21
|
}
|
|
22
22
|
get admin() {
|
|
23
23
|
return this._admin;
|
|
@@ -61,6 +61,9 @@ class m {
|
|
|
61
61
|
get username() {
|
|
62
62
|
return this._username;
|
|
63
63
|
}
|
|
64
|
+
get userAbilities() {
|
|
65
|
+
return this._userAbilities;
|
|
66
|
+
}
|
|
64
67
|
set admin(e) {
|
|
65
68
|
this._admin = e;
|
|
66
69
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { User } from '@code0-tech/sagittarius-graphql-types';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
export interface DUserCardProps {
|
|
4
|
+
userId: User['id'];
|
|
5
|
+
onRemove?: (userId: User['id']) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const DUserCard: React.FC<DUserCardProps>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import { c as n } from "../../_virtual/compiler-runtime.js";
|
|
3
|
+
import { Card as i } from "../card/Card.js";
|
|
4
|
+
import { DUserContent as c } from "./DUserContent.js";
|
|
5
|
+
const a = (s) => {
|
|
6
|
+
const r = n.c(3), {
|
|
7
|
+
userId: t,
|
|
8
|
+
onRemove: e
|
|
9
|
+
} = s;
|
|
10
|
+
let o;
|
|
11
|
+
return r[0] !== e || r[1] !== t ? (o = /* @__PURE__ */ m(i, { children: /* @__PURE__ */ m(c, { userId: t, onRemove: e }) }), r[0] = e, r[1] = t, r[2] = o) : o = r[2], o;
|
|
12
|
+
};
|
|
13
|
+
export {
|
|
14
|
+
a as DUserCard
|
|
15
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { User } from '@code0-tech/sagittarius-graphql-types';
|
|
3
|
+
export interface DUserContentProps {
|
|
4
|
+
userId: User['id'];
|
|
5
|
+
onRemove?: (userId: User['id']) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const DUserContent: React.FC<DUserContentProps>;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { jsx as d, jsxs as p } from "react/jsx-runtime";
|
|
2
|
+
import { c as V } from "../../_virtual/compiler-runtime.js";
|
|
3
|
+
import B from "react";
|
|
4
|
+
import { Flex as h } from "../flex/Flex.js";
|
|
5
|
+
import { Avatar as E } from "../avatar/Avatar.js";
|
|
6
|
+
import { useUserSession as k } from "./DUser.session.hook.js";
|
|
7
|
+
import { useService as w } from "../../utils/contextStore.js";
|
|
8
|
+
import "merge-props";
|
|
9
|
+
import { DUserReactiveService as F } from "./DUser.service.js";
|
|
10
|
+
import { Text as R } from "../text/Text.js";
|
|
11
|
+
import { Badge as C } from "../badge/Badge.js";
|
|
12
|
+
import { IconMailCheck as M } from "@tabler/icons-react";
|
|
13
|
+
import "../button/Button.js";
|
|
14
|
+
const Z = (D) => {
|
|
15
|
+
const e = V.c(37), {
|
|
16
|
+
userId: u,
|
|
17
|
+
onRemove: A
|
|
18
|
+
} = D, z = A === void 0 ? T : A, b = w(F), I = k(), [U, $] = B.useState(!1);
|
|
19
|
+
let y;
|
|
20
|
+
e[0] !== u || e[1] !== b ? (y = b.getById(u), e[0] = u, e[1] = b, e[2] = y) : y = e[2];
|
|
21
|
+
const t = y, j = I?.user?.id === t.id;
|
|
22
|
+
let g;
|
|
23
|
+
e[3] === Symbol.for("react.memo_cache_sentinel") ? (g = {
|
|
24
|
+
gap: ".7rem"
|
|
25
|
+
}, e[3] = g) : g = e[3];
|
|
26
|
+
let r;
|
|
27
|
+
e[4] !== t.username ? (r = /* @__PURE__ */ d(E, { identifier: t.username, bg: "transparent" }), e[4] = t.username, e[5] = r) : r = e[5];
|
|
28
|
+
let v;
|
|
29
|
+
e[6] === Symbol.for("react.memo_cache_sentinel") ? (v = {
|
|
30
|
+
gap: ".35rem",
|
|
31
|
+
flexDirection: "column"
|
|
32
|
+
}, e[6] = v) : v = e[6];
|
|
33
|
+
let S;
|
|
34
|
+
e[7] === Symbol.for("react.memo_cache_sentinel") ? (S = {
|
|
35
|
+
gap: "0.35rem"
|
|
36
|
+
}, e[7] = S) : S = e[7];
|
|
37
|
+
let i;
|
|
38
|
+
e[8] !== t.username ? (i = /* @__PURE__ */ d(R, { size: "md", hierarchy: "primary", children: t.username }), e[8] = t.username, e[9] = i) : i = e[9];
|
|
39
|
+
let l;
|
|
40
|
+
e[10] !== t.admin ? (l = t.admin ? /* @__PURE__ */ d(C, { color: "secondary", children: "Admin" }) : null, e[10] = t.admin, e[11] = l) : l = e[11];
|
|
41
|
+
let s;
|
|
42
|
+
e[12] !== i || e[13] !== l ? (s = /* @__PURE__ */ p(h, { align: "center", style: S, children: [
|
|
43
|
+
i,
|
|
44
|
+
l
|
|
45
|
+
] }), e[12] = i, e[13] = l, e[14] = s) : s = e[14];
|
|
46
|
+
let n;
|
|
47
|
+
e[15] !== t.email ? (n = /* @__PURE__ */ d(R, { size: "md", hierarchy: "tertiary", children: t.email }), e[15] = t.email, e[16] = n) : n = e[16];
|
|
48
|
+
let m;
|
|
49
|
+
e[17] !== s || e[18] !== n ? (m = /* @__PURE__ */ p(h, { style: v, children: [
|
|
50
|
+
s,
|
|
51
|
+
n
|
|
52
|
+
] }), e[17] = s, e[18] = n, e[19] = m) : m = e[19];
|
|
53
|
+
let o;
|
|
54
|
+
e[20] !== m || e[21] !== r ? (o = /* @__PURE__ */ p(h, { style: g, align: "center", children: [
|
|
55
|
+
r,
|
|
56
|
+
m
|
|
57
|
+
] }), e[20] = m, e[21] = r, e[22] = o) : o = e[22];
|
|
58
|
+
let _;
|
|
59
|
+
e[23] === Symbol.for("react.memo_cache_sentinel") ? (_ = {
|
|
60
|
+
gap: "1.3rem"
|
|
61
|
+
}, e[23] = _) : _ = e[23];
|
|
62
|
+
let c;
|
|
63
|
+
e[24] !== t.emailVerifiedAt ? (c = t.emailVerifiedAt ? /* @__PURE__ */ p(C, { color: "secondary", children: [
|
|
64
|
+
/* @__PURE__ */ d(M, { size: 16 }),
|
|
65
|
+
/* @__PURE__ */ d(R, { size: "xs", children: "Email verified" })
|
|
66
|
+
] }) : null, e[24] = t.emailVerifiedAt, e[25] = c) : c = e[25];
|
|
67
|
+
let a;
|
|
68
|
+
e[26] !== j || e[27] !== z || e[28] !== U || e[29] !== u ? (a = null, e[26] = j, e[27] = z, e[28] = U, e[29] = u, e[30] = a) : a = e[30];
|
|
69
|
+
let f;
|
|
70
|
+
e[31] !== c || e[32] !== a ? (f = /* @__PURE__ */ p(h, { style: _, align: "center", children: [
|
|
71
|
+
c,
|
|
72
|
+
a
|
|
73
|
+
] }), e[31] = c, e[32] = a, e[33] = f) : f = e[33];
|
|
74
|
+
let x;
|
|
75
|
+
return e[34] !== o || e[35] !== f ? (x = /* @__PURE__ */ p(h, { justify: "space-between", align: "center", children: [
|
|
76
|
+
o,
|
|
77
|
+
f
|
|
78
|
+
] }), e[34] = o, e[35] = f, e[36] = x) : x = e[36], x;
|
|
79
|
+
};
|
|
80
|
+
function T() {
|
|
81
|
+
}
|
|
82
|
+
export {
|
|
83
|
+
Z as DUserContent
|
|
84
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { User } from '@code0-tech/sagittarius-graphql-types';
|
|
2
|
+
import { DUserView } from './DUser.view';
|
|
3
|
+
import { default as React } from 'react';
|
|
4
|
+
import { Card } from '../card/Card';
|
|
5
|
+
export interface DUserListProps extends Omit<Card, "children"> {
|
|
6
|
+
filter?: (user: DUserView, index: number) => boolean;
|
|
7
|
+
onRemove?: (userId: User['id']) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare const DUserList: React.FC<DUserListProps>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import d from "react";
|
|
3
|
+
import { useService as f, useStore as u } from "../../utils/contextStore.js";
|
|
4
|
+
import "merge-props";
|
|
5
|
+
import { DUserReactiveService as o } from "./DUser.service.js";
|
|
6
|
+
import { Card as a } from "../card/Card.js";
|
|
7
|
+
import v from "../card/CardSection.js";
|
|
8
|
+
import { DUserContent as S } from "./DUserContent.js";
|
|
9
|
+
const j = (t) => {
|
|
10
|
+
const {
|
|
11
|
+
filter: i = () => !0,
|
|
12
|
+
onRemove: m,
|
|
13
|
+
...s
|
|
14
|
+
} = t, c = f(o), n = u(o), p = d.useMemo(() => c.values(), [n]);
|
|
15
|
+
return /* @__PURE__ */ e(a, { ...s, children: p.filter(i).map((r) => r.id && /* @__PURE__ */ e(v, { border: !0, children: /* @__PURE__ */ e(S, { onRemove: m, userId: r?.id }) }, r.id)) });
|
|
16
|
+
};
|
|
17
|
+
export {
|
|
18
|
+
j as DUserList
|
|
19
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { DUserReactiveService as
|
|
2
|
-
import { DUserView as
|
|
1
|
+
import { DUserReactiveService as a } from "./DUser.service.js";
|
|
2
|
+
import { DUserView as n } from "./DUser.view.js";
|
|
3
3
|
import "react/jsx-runtime";
|
|
4
4
|
import "react";
|
|
5
5
|
import "../../_virtual/compiler-runtime.js";
|
|
@@ -11,10 +11,14 @@ import "js-md5";
|
|
|
11
11
|
/* empty css */
|
|
12
12
|
/* empty css */
|
|
13
13
|
/* empty css */
|
|
14
|
-
import {
|
|
14
|
+
import { DUserCard as d } from "./DUserCard.js";
|
|
15
|
+
import { DUserList as w } from "./DUserList.js";
|
|
16
|
+
import { setUserSession as L, useUserSession as R } from "./DUser.session.hook.js";
|
|
15
17
|
export {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
d as DUserCard,
|
|
19
|
+
w as DUserList,
|
|
20
|
+
a as DUserReactiveService,
|
|
21
|
+
n as DUserView,
|
|
22
|
+
L as setUserSession,
|
|
23
|
+
R as useUserSession
|
|
20
24
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type Validations<Values> = Partial<{
|
|
2
|
-
[Key in keyof Values]: (value: Values[Key]) => string | null;
|
|
2
|
+
[Key in keyof Values]: (value: Values[Key], values?: Values) => string | null;
|
|
3
3
|
}>;
|
|
4
4
|
export interface FormValidationProps<Values> {
|
|
5
5
|
initialValues: Values;
|
|
@@ -21,5 +21,6 @@ export type ValidationsProps<Values> = Partial<{
|
|
|
21
21
|
export type FormValidationReturn<Values> = [IValidation<Values>, () => void];
|
|
22
22
|
export interface IValidation<Values> {
|
|
23
23
|
getInputProps<Key extends keyof Values>(key: Key): ValidationProps<Values[Key]>;
|
|
24
|
+
isValid(): boolean;
|
|
24
25
|
}
|
|
25
26
|
export declare const useForm: <Values extends Record<string, any> = Record<string, any>>(props: FormValidationProps<Values>) => FormValidationReturn<Values>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { useState as c, useMemo as
|
|
2
|
-
function
|
|
3
|
-
return (t =
|
|
1
|
+
import { useState as c, useMemo as p, useCallback as g } from "react";
|
|
2
|
+
function l(e, t, i) {
|
|
3
|
+
return (t = b(t)) in e ? Object.defineProperty(e, t, { value: i, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = i, e;
|
|
4
4
|
}
|
|
5
|
-
function
|
|
5
|
+
function b(e) {
|
|
6
6
|
var t = P(e, "string");
|
|
7
7
|
return typeof t == "symbol" ? t : t + "";
|
|
8
8
|
}
|
|
@@ -10,29 +10,38 @@ function P(e, t) {
|
|
|
10
10
|
if (typeof e != "object" || !e) return e;
|
|
11
11
|
var i = e[Symbol.toPrimitive];
|
|
12
12
|
if (i !== void 0) {
|
|
13
|
-
var
|
|
14
|
-
if (typeof
|
|
13
|
+
var r = i.call(e, t);
|
|
14
|
+
if (typeof r != "object") return r;
|
|
15
15
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
16
16
|
}
|
|
17
17
|
return (t === "string" ? String : Number)(e);
|
|
18
18
|
}
|
|
19
19
|
class d {
|
|
20
|
-
constructor(t, i,
|
|
21
|
-
|
|
20
|
+
constructor(t, i, r, n) {
|
|
21
|
+
l(this, "changeValue", void 0), l(this, "initialRender", void 0), l(this, "currentValues", void 0), l(this, "currentValidations", void 0), this.changeValue = t, this.currentValues = i, this.currentValidations = r, this.initialRender = n;
|
|
22
|
+
}
|
|
23
|
+
isValid() {
|
|
24
|
+
if (!this.currentValidations) return !0;
|
|
25
|
+
for (const t in this.currentValidations) {
|
|
26
|
+
const i = this.currentValidations[t];
|
|
27
|
+
if (i && i(this.currentValues[t], this.currentValues) !== null)
|
|
28
|
+
return !1;
|
|
29
|
+
}
|
|
30
|
+
return !0;
|
|
22
31
|
}
|
|
23
32
|
getInputProps(t) {
|
|
24
|
-
const i = this.currentValues[t] || null,
|
|
33
|
+
const i = this.currentValues[t] || null, r = t, n = this.currentValidations && this.currentValidations[t] ? this.currentValidations[t] : (u) => null, s = this.initialRender ? null : n(i, this.currentValues);
|
|
25
34
|
return {
|
|
26
35
|
initialValue: i,
|
|
27
36
|
formValidation: {
|
|
28
|
-
setValue: (
|
|
29
|
-
this.changeValue(
|
|
37
|
+
setValue: (u) => {
|
|
38
|
+
this.changeValue(r, u);
|
|
30
39
|
},
|
|
31
40
|
...this.initialRender ? {
|
|
32
41
|
valid: !0
|
|
33
42
|
} : {
|
|
34
|
-
notValidMessage:
|
|
35
|
-
valid:
|
|
43
|
+
notValidMessage: s,
|
|
44
|
+
valid: s === null ? !0 : !s
|
|
36
45
|
}
|
|
37
46
|
},
|
|
38
47
|
...this.currentValidations && this.currentValidations[t] ? {
|
|
@@ -45,12 +54,12 @@ const w = (e) => {
|
|
|
45
54
|
const {
|
|
46
55
|
initialValues: t,
|
|
47
56
|
validate: i = {},
|
|
48
|
-
onSubmit:
|
|
49
|
-
} = e, [
|
|
50
|
-
let
|
|
51
|
-
|
|
57
|
+
onSubmit: r
|
|
58
|
+
} = e, [n, s] = c(t), u = (a, m) => s((o) => (o[a] = m, o)), V = p(() => new d(u, t, i, !0), []), [h, f] = c(V), v = g(() => {
|
|
59
|
+
let a = new d(u, n, i, !1);
|
|
60
|
+
f(() => a), r && a.isValid() && r(n);
|
|
52
61
|
}, []);
|
|
53
|
-
return [
|
|
62
|
+
return [h, v];
|
|
54
63
|
};
|
|
55
64
|
export {
|
|
56
65
|
w as useForm
|
|
@@ -7,6 +7,7 @@ export interface ToastProps extends Omit<Code0Component<HTMLDivElement>, "title"
|
|
|
7
7
|
color?: Color;
|
|
8
8
|
dismissible?: boolean;
|
|
9
9
|
onClose?: (event: React.MouseEvent<HTMLSpanElement, MouseEvent>) => void;
|
|
10
|
+
duration?: number;
|
|
10
11
|
}
|
|
11
12
|
export declare function toast(toast: Omit<ToastProps, 'id'>): string | number;
|
|
12
13
|
export declare function Toast(props: ToastProps): React.JSX.Element;
|
|
@@ -1,70 +1,62 @@
|
|
|
1
|
-
import { jsx as s, jsxs as
|
|
2
|
-
import { c as
|
|
3
|
-
import { toast as
|
|
1
|
+
import { jsx as s, jsxs as r } from "react/jsx-runtime";
|
|
2
|
+
import { c as p } from "../../_virtual/compiler-runtime.js";
|
|
3
|
+
import { toast as d } from "sonner";
|
|
4
4
|
import '../../assets/components/toast/Toast.style.css';/* empty css */
|
|
5
5
|
import "../../utils/contextStore.js";
|
|
6
6
|
import "react";
|
|
7
|
-
import { mergeCode0Props as
|
|
8
|
-
import { IconX as
|
|
9
|
-
import { Text as
|
|
10
|
-
import { Flex as
|
|
11
|
-
function
|
|
12
|
-
return
|
|
7
|
+
import { mergeCode0Props as f } from "../../utils/utils.js";
|
|
8
|
+
import { IconX as u, IconCircleX as N, IconAlertCircle as y, IconCircleCheck as C, IconInfoCircle as z, IconCircleDot as l } from "@tabler/icons-react";
|
|
9
|
+
import { Text as c } from "../text/Text.js";
|
|
10
|
+
import { Flex as m } from "../flex/Flex.js";
|
|
11
|
+
function D(o) {
|
|
12
|
+
return d.custom((e) => /* @__PURE__ */ s(I, { id: e, ...o, children: o.children }), {
|
|
13
|
+
duration: o.duration ?? 4e3
|
|
14
|
+
});
|
|
13
15
|
}
|
|
14
|
-
function
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
m,
|
|
43
|
-
d
|
|
44
|
-
] }), e[16] = m, e[17] = d, e[18] = f) : f = e[18];
|
|
45
|
-
let _;
|
|
46
|
-
e[19] !== o ? (_ = o && /* @__PURE__ */ s("div", { className: "toast__content", children: o }), e[19] = o, e[20] = _) : _ = e[20];
|
|
47
|
-
let h;
|
|
48
|
-
return e[21] !== l || e[22] !== f || e[23] !== _ ? (h = /* @__PURE__ */ N("div", { ...l, children: [
|
|
49
|
-
f,
|
|
50
|
-
_
|
|
51
|
-
] }), e[21] = l, e[22] = f, e[23] = _, e[24] = h) : h = e[24], h;
|
|
16
|
+
function I(o) {
|
|
17
|
+
const {
|
|
18
|
+
dismissible: e = !1,
|
|
19
|
+
color: t = "secondary",
|
|
20
|
+
title: i,
|
|
21
|
+
onClose: _ = () => {
|
|
22
|
+
},
|
|
23
|
+
children: a,
|
|
24
|
+
duration: n = 4e3,
|
|
25
|
+
...h
|
|
26
|
+
} = o;
|
|
27
|
+
return /* @__PURE__ */ r("div", { ...f(`toast toast--${t}`, h), children: [
|
|
28
|
+
/* @__PURE__ */ r(m, { className: "toast__header", children: [
|
|
29
|
+
/* @__PURE__ */ r(m, { className: "toast__header-wrapper", children: [
|
|
30
|
+
t && /* @__PURE__ */ s(x, { color: t }),
|
|
31
|
+
/* @__PURE__ */ s(c, { size: "md", children: i })
|
|
32
|
+
] }),
|
|
33
|
+
e && /* @__PURE__ */ s("span", { className: "toast__dismissible", onClick: () => d.dismiss(o.id), children: /* @__PURE__ */ s(u, { size: 18 }) })
|
|
34
|
+
] }),
|
|
35
|
+
a && /* @__PURE__ */ s("div", { className: "toast__content", children: a }),
|
|
36
|
+
/* @__PURE__ */ s("div", { className: "toast__duration", style: {
|
|
37
|
+
"--toast-duration": `${n}ms`
|
|
38
|
+
}, children: /* @__PURE__ */ r(c, { hierarchy: "tertiary", children: [
|
|
39
|
+
"This message will close in ",
|
|
40
|
+
/* @__PURE__ */ s(c, { hierarchy: "primary", children: n / 1e3 }),
|
|
41
|
+
" seconds"
|
|
42
|
+
] }) })
|
|
43
|
+
] });
|
|
52
44
|
}
|
|
53
|
-
const
|
|
54
|
-
const e =
|
|
55
|
-
color:
|
|
56
|
-
} =
|
|
57
|
-
let
|
|
58
|
-
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (
|
|
59
|
-
primary: /* @__PURE__ */ s(
|
|
60
|
-
secondary: /* @__PURE__ */ s(
|
|
61
|
-
info: /* @__PURE__ */ s(
|
|
62
|
-
success: /* @__PURE__ */ s(
|
|
63
|
-
warning: /* @__PURE__ */ s(
|
|
64
|
-
error: /* @__PURE__ */ s(
|
|
65
|
-
}, e[0] =
|
|
45
|
+
const x = (o) => {
|
|
46
|
+
const e = p.c(1), {
|
|
47
|
+
color: t
|
|
48
|
+
} = o;
|
|
49
|
+
let i;
|
|
50
|
+
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (i = {
|
|
51
|
+
primary: /* @__PURE__ */ s(l, { className: "toast__icon", size: 18 }),
|
|
52
|
+
secondary: /* @__PURE__ */ s(l, { className: "toast__icon", size: 18 }),
|
|
53
|
+
info: /* @__PURE__ */ s(z, { className: "toast__icon", size: 18 }),
|
|
54
|
+
success: /* @__PURE__ */ s(C, { className: "toast__icon", size: 18 }),
|
|
55
|
+
warning: /* @__PURE__ */ s(y, { className: "toast__icon", size: 18 }),
|
|
56
|
+
error: /* @__PURE__ */ s(N, { className: "toast__icon", size: 18 })
|
|
57
|
+
}, e[0] = i) : i = e[0], i[t] ?? null;
|
|
66
58
|
};
|
|
67
59
|
export {
|
|
68
|
-
|
|
69
|
-
|
|
60
|
+
I as Toast,
|
|
61
|
+
D as toast
|
|
70
62
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -11,9 +11,13 @@ export * from './components/container/Container';
|
|
|
11
11
|
export * from './components/d-flow/index';
|
|
12
12
|
export * from './components/d-fullscreen/DFullScreen';
|
|
13
13
|
export * from './components/d-layout/DLayout';
|
|
14
|
+
export * from './components/d-license/index';
|
|
15
|
+
export * from './components/d-member/index';
|
|
14
16
|
export * from './components/d-namespace/index';
|
|
15
17
|
export * from './components/d-organization/index';
|
|
18
|
+
export * from './components/d-project/index';
|
|
16
19
|
export * from './components/d-resizable/DResizable';
|
|
20
|
+
export * from './components/d-role/index';
|
|
17
21
|
export * from './components/d-runtime/index';
|
|
18
22
|
export * from './components/d-user/index';
|
|
19
23
|
export * from './components/dialog/Dialog';
|