@code0-tech/pictor 0.0.0-mvp.14 → 0.0.0-mvp.16

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 (81) hide show
  1. package/dist/assets/components/button/Button.style.css +1 -1
  2. package/dist/assets/components/card/Card.style.css +1 -1
  3. package/dist/assets/components/d-layout/DLayout.style.css +1 -1
  4. package/dist/components/button/Button.d.ts +2 -1
  5. package/dist/components/button/Button.js +22 -20
  6. package/dist/components/card/Card.d.ts +2 -1
  7. package/dist/components/card/Card.js +24 -21
  8. package/dist/components/d-layout/DLayout.js +25 -25
  9. package/dist/components/{d-namespace/license → d-license}/DNamespaceLicense.service.d.ts +1 -1
  10. package/dist/components/{d-namespace/license → d-license}/DNamespaceLicense.service.js +1 -1
  11. package/dist/components/d-license/index.d.ts +2 -0
  12. package/dist/components/d-license/index.js +6 -0
  13. package/dist/components/{d-namespace/member → d-member}/DNamespaceMember.service.d.ts +3 -2
  14. package/dist/components/d-member/DNamespaceMember.service.js +14 -0
  15. package/dist/components/{d-namespace/member → d-member}/DNamespaceMember.view.d.ts +4 -1
  16. package/dist/components/{d-namespace/member → d-member}/DNamespaceMember.view.js +4 -1
  17. package/dist/components/d-member/index.d.ts +2 -0
  18. package/dist/components/d-member/index.js +6 -0
  19. package/dist/components/d-namespace/index.d.ts +0 -10
  20. package/dist/components/d-namespace/index.js +4 -33
  21. package/dist/components/d-organization/DOrganization.service.d.ts +2 -2
  22. package/dist/components/d-organization/DOrganization.view.d.ts +4 -1
  23. package/dist/components/d-organization/DOrganization.view.js +21 -18
  24. package/dist/components/d-organization/DOrganizationCard.d.ts +3 -3
  25. package/dist/components/d-organization/DOrganizationCard.js +13 -76
  26. package/dist/components/d-organization/DOrganizationList.d.ts +10 -0
  27. package/dist/components/d-organization/DOrganizationList.js +20 -0
  28. package/dist/components/d-organization/DOrganizatonContent.d.ts +9 -0
  29. package/dist/components/d-organization/DOrganizatonContent.js +82 -0
  30. package/dist/components/d-organization/index.d.ts +1 -0
  31. package/dist/components/d-organization/index.js +8 -5
  32. package/dist/components/{d-namespace/project → d-project}/DNamespaceProject.service.d.ts +1 -1
  33. package/dist/components/d-project/DNamespaceProject.service.js +14 -0
  34. package/dist/components/{d-namespace/project → d-project}/DNamespaceProject.view.d.ts +4 -1
  35. package/dist/components/{d-namespace/project → d-project}/DNamespaceProject.view.js +13 -10
  36. package/dist/components/{d-namespace/project → d-project}/DNamespaceProjectCard.d.ts +1 -1
  37. package/dist/components/d-project/DNamespaceProjectCard.js +15 -0
  38. package/dist/components/d-project/DNamespaceProjectContent.d.ts +8 -0
  39. package/dist/components/d-project/DNamespaceProjectContent.js +68 -0
  40. package/dist/components/d-project/DNamespaceProjectList.d.ts +9 -0
  41. package/dist/components/d-project/DNamespaceProjectList.js +19 -0
  42. package/dist/components/{d-namespace/project → d-project}/DNamespaceProjectMenu.d.ts +1 -1
  43. package/dist/components/{d-namespace/project → d-project}/DNamespaceProjectMenu.js +3 -3
  44. package/dist/components/d-project/index.d.ts +5 -0
  45. package/dist/components/d-project/index.js +24 -0
  46. package/dist/components/{d-namespace/role → d-role}/DNamespaceRole.service.d.ts +1 -1
  47. package/dist/components/{d-namespace/role → d-role}/DNamespaceRole.service.js +1 -1
  48. package/dist/components/d-role/index.d.ts +2 -0
  49. package/dist/components/d-role/index.js +6 -0
  50. package/dist/components/d-runtime/DRuntime.view.d.ts +4 -1
  51. package/dist/components/d-runtime/DRuntime.view.js +6 -3
  52. package/dist/components/d-runtime/DRuntimeCard.d.ts +7 -0
  53. package/dist/components/d-runtime/DRuntimeCard.js +17 -0
  54. package/dist/components/d-runtime/DRuntimeContent.d.ts +7 -0
  55. package/dist/components/d-runtime/DRuntimeContent.js +38 -0
  56. package/dist/components/d-runtime/DRuntimeList.d.ts +9 -0
  57. package/dist/components/d-runtime/DRuntimeList.js +19 -0
  58. package/dist/components/d-runtime/index.d.ts +2 -0
  59. package/dist/components/d-runtime/index.js +6 -2
  60. package/dist/components/d-user/DUser.view.d.ts +4 -1
  61. package/dist/components/d-user/DUser.view.js +13 -10
  62. package/dist/components/d-user/DUserCard.d.ts +7 -0
  63. package/dist/components/d-user/DUserCard.js +15 -0
  64. package/dist/components/d-user/DUserContent.d.ts +7 -0
  65. package/dist/components/d-user/DUserContent.js +84 -0
  66. package/dist/components/d-user/DUserList.d.ts +9 -0
  67. package/dist/components/d-user/DUserList.js +19 -0
  68. package/dist/components/d-user/index.d.ts +2 -0
  69. package/dist/components/d-user/index.js +11 -7
  70. package/dist/components/form/useForm.d.ts +2 -1
  71. package/dist/components/form/useForm.js +27 -18
  72. package/dist/index.d.ts +4 -0
  73. package/dist/index.js +184 -172
  74. package/package.json +20 -19
  75. package/dist/components/d-namespace/member/DNamespaceMember.service.js +0 -11
  76. package/dist/components/d-namespace/project/DNamespaceProject.service.js +0 -11
  77. package/dist/components/d-namespace/project/DNamespaceProjectCard.js +0 -57
  78. /package/dist/components/{d-namespace/license → d-license}/DNamespaceLicense.view.d.ts +0 -0
  79. /package/dist/components/{d-namespace/license → d-license}/DNamespaceLicense.view.js +0 -0
  80. /package/dist/components/{d-namespace/role → d-role}/DNamespaceRole.view.d.ts +0 -0
  81. /package/dist/components/{d-namespace/role → d-role}/DNamespaceRole.view.js +0 -0
@@ -0,0 +1,17 @@
1
+ import { jsx as i } from "react/jsx-runtime";
2
+ import { c } from "../../_virtual/compiler-runtime.js";
3
+ import { Card as p } from "../card/Card.js";
4
+ import { DRuntimeContent as s } from "./DRuntimeContent.js";
5
+ const x = (m) => {
6
+ const t = c.c(3), {
7
+ runtimeId: n,
8
+ onSetting: e
9
+ } = m, r = e === void 0 ? f : e;
10
+ let o;
11
+ return t[0] !== r || t[1] !== n ? (o = /* @__PURE__ */ i(p, { children: /* @__PURE__ */ i(s, { runtimeId: n, onSetting: r }) }), t[0] = r, t[1] = n, t[2] = o) : o = t[2], o;
12
+ };
13
+ function f() {
14
+ }
15
+ export {
16
+ x as DRuntimeCard
17
+ };
@@ -0,0 +1,7 @@
1
+ import { Runtime } from '@code0-tech/sagittarius-graphql-types';
2
+ import { default as React } from 'react';
3
+ export interface DRuntimeContentProps {
4
+ runtimeId: Runtime['id'];
5
+ onSetting?: (runtimeId: Runtime['id']) => void;
6
+ }
7
+ export declare const DRuntimeContent: React.FC<DRuntimeContentProps>;
@@ -0,0 +1,38 @@
1
+ import { jsxs as o, jsx as e } from "react/jsx-runtime";
2
+ import p from "react";
3
+ import { Text as n } from "../text/Text.js";
4
+ import { Flex as i } from "../flex/Flex.js";
5
+ import { IconSettings as d } from "@tabler/icons-react";
6
+ import { Button as h } from "../button/Button.js";
7
+ import { useService as f, useStore as y } from "../../utils/contextStore.js";
8
+ import "merge-props";
9
+ import { DRuntimeReactiveService as c } from "./DRuntime.service.js";
10
+ import { Badge as m } from "../badge/Badge.js";
11
+ const k = (s) => {
12
+ const {
13
+ runtimeId: t,
14
+ onSetting: l = () => {
15
+ }
16
+ } = s, a = f(c), u = y(c), r = p.useMemo(() => a.getById(t), [u, t]);
17
+ return /* @__PURE__ */ o(i, { justify: "space-between", align: "center", children: [
18
+ /* @__PURE__ */ o(i, { style: {
19
+ flexDirection: "column",
20
+ gap: "0.35rem"
21
+ }, children: [
22
+ /* @__PURE__ */ e(n, { size: "lg", hierarchy: "primary", display: "block", children: r?.name }),
23
+ /* @__PURE__ */ e(n, { size: "sm", hierarchy: "tertiary", display: "block", children: r?.description })
24
+ ] }),
25
+ /* @__PURE__ */ o(i, { align: "center", style: {
26
+ gap: "1.3rem"
27
+ }, children: [
28
+ /* @__PURE__ */ e(i, { align: "center", style: {
29
+ gap: "0.35rem",
30
+ flexWrap: "wrap"
31
+ }, children: r?.status === "CONNECTED" ? /* @__PURE__ */ e(m, { color: "success", children: "CONNECTED" }) : /* @__PURE__ */ e(m, { color: "error", children: "DISCONNECTED" }) }),
32
+ r?.userAbilities?.deleteRuntime || r?.userAbilities?.updateRuntime || r?.userAbilities?.rotateRuntimeToken ? /* @__PURE__ */ e(h, { color: "secondary", onClick: () => l(t), children: /* @__PURE__ */ e(d, { size: 16 }) }) : null
33
+ ] })
34
+ ] });
35
+ };
36
+ export {
37
+ k as DRuntimeContent
38
+ };
@@ -0,0 +1,9 @@
1
+ import { Runtime } from '@code0-tech/sagittarius-graphql-types';
2
+ import { DRuntimeView } from './DRuntime.view';
3
+ import { Card } from '../card/Card';
4
+ import { default as React } from 'react';
5
+ export interface DRuntimeListProps extends Omit<Card, "children"> {
6
+ filter?: (runtime: DRuntimeView, index: number) => boolean;
7
+ onSetting?: (runtimeId: Runtime['id']) => void;
8
+ }
9
+ export declare const DRuntimeList: React.FC<DRuntimeListProps>;
@@ -0,0 +1,19 @@
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import { Card as p } from "../card/Card.js";
3
+ import d from "react";
4
+ import { useService as f, useStore as S } from "../../utils/contextStore.js";
5
+ import "merge-props";
6
+ import { DRuntimeReactiveService as e } from "./DRuntime.service.js";
7
+ import a from "../card/CardSection.js";
8
+ import { DRuntimeContent as l } from "./DRuntimeContent.js";
9
+ const j = (o) => {
10
+ const {
11
+ filter: i = () => !0,
12
+ onSetting: m,
13
+ ...n
14
+ } = o, c = f(e), s = S(e), u = d.useMemo(() => c.values(), [s]);
15
+ return /* @__PURE__ */ t(p, { ...n, children: u.filter(i).map((r) => r.id && /* @__PURE__ */ t(a, { border: !0, children: /* @__PURE__ */ t(l, { onSetting: m, runtimeId: r?.id }) }, r.id)) });
16
+ };
17
+ export {
18
+ j as DRuntimeList
19
+ };
@@ -1,2 +1,4 @@
1
1
  export * from './DRuntime.service';
2
2
  export * from './DRuntime.view';
3
+ export * from './DRuntimeCard';
4
+ export * from './DRuntimeList';
@@ -1,6 +1,10 @@
1
- import { DRuntimeReactiveService as r } from "./DRuntime.service.js";
1
+ import { DRuntimeReactiveService as t } from "./DRuntime.service.js";
2
2
  import { DRuntimeView as m } from "./DRuntime.view.js";
3
+ import { DRuntimeCard as R } from "./DRuntimeCard.js";
4
+ import { DRuntimeList as n } from "./DRuntimeList.js";
3
5
  export {
4
- r as DRuntimeReactiveService,
6
+ R as DRuntimeCard,
7
+ n as DRuntimeList,
8
+ t as DRuntimeReactiveService,
5
9
  m as DRuntimeView
6
10
  };
@@ -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(t, e, s) {
2
- return (e = n(e)) in t ? Object.defineProperty(t, e, { value: s, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = s, t;
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 n(t) {
5
- var e = r(t, "string");
4
+ function r(i) {
5
+ var e = n(i, "string");
6
6
  return typeof e == "symbol" ? e : e + "";
7
7
  }
8
- function r(t, e) {
9
- if (typeof t != "object" || !t) return t;
10
- var s = t[Symbol.toPrimitive];
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(t, e);
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)(t);
16
+ return (e === "string" ? String : Number)(i);
17
17
  }
18
18
  class m {
19
19
  constructor(e) {
20
- i(this, "_admin", void 0), i(this, "_avatarPath", void 0), i(this, "_createdAt", void 0), i(this, "_email", void 0), i(this, "_emailVerifiedAt", void 0), i(this, "_firstname", void 0), i(this, "_id", void 0), i(this, "_identities", void 0), i(this, "_lastname", void 0), i(this, "_namespace", void 0), i(this, "_namespaceMemberships", void 0), i(this, "_sessions", void 0), i(this, "_updatedAt", void 0), i(this, "_username", 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;
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,4 +1,6 @@
1
1
  export * from './DUser.service';
2
2
  export * from './DUser.view';
3
3
  export * from './DUserMenu';
4
+ export * from './DUserCard';
5
+ export * from './DUserList';
4
6
  export * from './DUser.session.hook';
@@ -1,5 +1,5 @@
1
- import { DUserReactiveService as n } from "./DUser.service.js";
2
- import { DUserView as D } from "./DUser.view.js";
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 { setUserSession as u, useUserSession as w } from "./DUser.session.hook.js";
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
- n as DUserReactiveService,
17
- D as DUserView,
18
- u as setUserSession,
19
- w as useUserSession
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 f, useCallback as b } from "react";
2
- function s(e, t, i) {
3
- return (t = g(t)) in e ? Object.defineProperty(e, t, { value: i, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = i, e;
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 g(e) {
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 n = i.call(e, t);
14
- if (typeof n != "object") return n;
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, n, r) {
21
- s(this, "changeValue", void 0), s(this, "initialRender", void 0), s(this, "currentValues", void 0), s(this, "currentValidations", void 0), this.changeValue = t, this.currentValues = i, this.currentValidations = n, this.initialRender = r;
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, n = t, r = this.currentValidations && this.currentValidations[t] ? this.currentValidations[t] : (a) => null, u = this.initialRender ? null : r(i);
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: (a) => {
29
- this.changeValue(n, a);
37
+ setValue: (u) => {
38
+ this.changeValue(r, u);
30
39
  },
31
40
  ...this.initialRender ? {
32
41
  valid: !0
33
42
  } : {
34
- notValidMessage: u,
35
- valid: u === null ? !0 : !u
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: n
49
- } = e, [r, u] = c(t), a = (o, m) => u((l) => (l[o] = m, l)), h = f(() => new d(a, t, i, !0), []), [V, p] = c(h), v = b(() => {
50
- let o = new d(a, r, i, !1);
51
- p(() => o), n && n(r);
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 [V, v];
62
+ return [h, v];
54
63
  };
55
64
  export {
56
65
  w as useForm
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';