@owlmeans/client-panel 0.1.1 → 0.1.2

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2024 OwlMeans Common — Fullstack typescript framework
3
+ Copyright (c) 2026 OwlMeans Common — Fullstack typescript framework
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@owlmeans/client-panel",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
+ "license": "MIT",
4
5
  "type": "module",
5
6
  "scripts": {
6
7
  "build": "tsc -b",
@@ -35,12 +36,12 @@
35
36
  },
36
37
  "dependencies": {
37
38
  "@hookform/resolvers": "^3.9.0",
38
- "@owlmeans/client": "^0.1.1",
39
- "@owlmeans/client-i18n": "^0.1.1",
40
- "@owlmeans/client-module": "^0.1.1",
41
- "@owlmeans/client-route": "^0.1.1",
42
- "@owlmeans/error": "^0.1.1",
43
- "@owlmeans/module": "^0.1.1"
39
+ "@owlmeans/client": "^0.1.2",
40
+ "@owlmeans/client-i18n": "^0.1.2",
41
+ "@owlmeans/client-module": "^0.1.2",
42
+ "@owlmeans/client-route": "^0.1.2",
43
+ "@owlmeans/error": "^0.1.2",
44
+ "@owlmeans/module": "^0.1.2"
44
45
  },
45
46
  "peerDependencies": {
46
47
  "@owlmeans/auth": "*",
@@ -60,8 +61,8 @@
60
61
  }
61
62
  },
62
63
  "devDependencies": {
63
- "@owlmeans/auth": "^0.1.1",
64
- "@owlmeans/client-auth": "^0.1.1",
64
+ "@owlmeans/auth": "^0.1.2",
65
+ "@owlmeans/client-auth": "^0.1.2",
65
66
  "@types/react": "^19.2.7",
66
67
  "nodemon": "^3.1.11",
67
68
  "npm-check": "^6.0.1",
@@ -1,4 +0,0 @@
1
- import type { FC } from "react";
2
- import type { FormActionProps } from "./types.js";
3
- export declare const ActionCtrl: FC<FormActionProps>;
4
- //# sourceMappingURL=actiont.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"actiont.d.ts","sourceRoot":"","sources":["../../../src/components/form/actiont.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAI/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAKjD,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,eAAe,CA6B1C,CAAA"}
@@ -1,28 +0,0 @@
1
- import { useMemo } from "react";
2
- import { useFormContext } from "react-hook-form";
3
- import { useClientFormContext } from "./context.js";
4
- import { useContext } from "@owlmeans/client";
5
- import { usePanelHelper } from "../context.js";
6
- import { useCommonI18n, useI18nApp, useI18nLib } from "@owlmeans/client-i18n";
7
- export const ActionCtrl = ({ render, label, i18n, size, onClick, submit }) => {
8
- const form = useFormContext();
9
- const client = useClientFormContext();
10
- const context = useContext();
11
- const panel = usePanelHelper();
12
- const t = useCommonI18n(i18n?.resource ?? panel.resource ?? context.cfg.service, i18n?.ns ?? panel.ns, i18n?.prefix ?? panel.prefix);
13
- const appT = useI18nApp(context.cfg.service, 'buttons');
14
- const libT = useI18nLib('client-panel', 'buttons');
15
- label = useMemo(() => i18n?.suppress ? label : t(label, {
16
- defaultValue: appT(label, { defaultValue: libT(label) })
17
- }), [i18n?.suppress, label]);
18
- size = size ?? 'medium';
19
- const progressSize = size === 'large'
20
- ? 20
21
- : size === 'medium' ? 16 : 14;
22
- submit = onClick != null ? undefined : (submit ?? client.onSubmit);
23
- const action = onClick ??
24
- submit != null ? form.handleSubmit(async (data) => submit?.(data, client.formRef?.current?.update))
25
- : undefined;
26
- return render({ form, client, label, size, progressSize, action });
27
- };
28
- //# sourceMappingURL=actiont.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"actiont.js","sourceRoot":"","sources":["../../../src/components/form/acti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IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;KACzD,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAA;IAE5B,IAAI,GAAG,IAAI,IAAI,QAAQ,CAAA;IACvB,MAAM,YAAY,GAAG,IAAI,KAAK,OAAO;QACnC,CAAC,CAAC,EAAE;QACJ,CAAC,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAA;IAE/B,MAAM,GAAG,OAAO,IAAI,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,MAAM,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAA;IAElE,MAAM,MAAM,GAAG,OAAO;QACpB,MAAM,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,KAAK,EAAC,IAAI,EAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;QACjG,CAAC,CAAC,SAAS,CAAA;IAEb,OAAO,MAAM,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,EAAE,CAAC,CAAA;AACpE,CAAC,CAAA"}
@@ -1,4 +0,0 @@
1
- import type { FC } from "react";
2
- import type { FormActionProps } from "./types.js";
3
- export declare const ActionCtrl: FC<FormActionProps>;
4
- //# sourceMappingURL=actionts.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"actionts.d.ts","sourceRoot":"","sources":["../../../src/components/form/actionts.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAI/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAKjD,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,eAAe,CA6B1C,CAAA"}
@@ -1,28 +0,0 @@
1
- import { useMemo } from "react";
2
- import { useFormContext } from "react-hook-form";
3
- import { useClientFormContext } from "./context.js";
4
- import { useContext } from "@owlmeans/client";
5
- import { usePanelHelper } from "../context.js";
6
- import { useCommonI18n, useI18nApp, useI18nLib } from "@owlmeans/client-i18n";
7
- export const ActionCtrl = ({ render, label, i18n, size, onClick, submit }) => {
8
- const form = useFormContext();
9
- const client = useClientFormContext();
10
- const context = useContext();
11
- const panel = usePanelHelper();
12
- const t = useCommonI18n(i18n?.resource ?? panel.resource ?? context.cfg.service, i18n?.ns ?? panel.ns, i18n?.prefix ?? panel.prefix);
13
- const appT = useI18nApp(context.cfg.service, 'buttons');
14
- const libT = useI18nLib('client-panel', 'buttons');
15
- label = useMemo(() => i18n?.suppress ? label : t(label, {
16
- defaultValue: appT(label, { defaultValue: libT(label) })
17
- }), [i18n?.suppress, label]);
18
- size = size ?? 'medium';
19
- const progressSize = size === 'large'
20
- ? 20
21
- : size === 'medium' ? 16 : 14;
22
- submit = submit ?? client.onSubmit;
23
- const action = onClick ??
24
- submit != null ? form.handleSubmit(async (data) => submit?.(data, client.formRef?.current?.update))
25
- : undefined;
26
- return render({ form, client, label, size, progressSize, action });
27
- };
28
- //# sourceMappingURL=actionts.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"actionts.js","sourceRoot":"","sources":["../../../src/components/form/actionts.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;AAEnD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAE7E,MAAM,CAAC,MAAM,UAAU,GAAwB,CAAC,EAAE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