@akanjs/client 0.9.42 → 0.9.44
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/cjs/src/index.js +1 -0
- package/cjs/src/locale.js +29 -0
- package/cjs/src/router.js +3 -3
- package/esm/src/index.js +1 -0
- package/esm/src/locale.js +10 -0
- package/esm/src/router.js +3 -3
- package/package.json +1 -1
- package/src/index.d.ts +1 -0
- package/src/locale.d.ts +10 -0
- package/src/types.d.ts +6 -7
package/cjs/src/index.js
CHANGED
|
@@ -21,3 +21,4 @@ __reExport(src_exports, require("./cookie"), module.exports);
|
|
|
21
21
|
__reExport(src_exports, require("./storage"), module.exports);
|
|
22
22
|
__reExport(src_exports, require("./device"), module.exports);
|
|
23
23
|
__reExport(src_exports, require("./createFont"), module.exports);
|
|
24
|
+
__reExport(src_exports, require("./locale"), module.exports);
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var locale_exports = {};
|
|
20
|
+
__export(locale_exports, {
|
|
21
|
+
dictionaryContext: () => dictionaryContext,
|
|
22
|
+
useDictionary: () => useDictionary
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(locale_exports);
|
|
25
|
+
var import_react = require("react");
|
|
26
|
+
const dictionaryContext = (0, import_react.createContext)({});
|
|
27
|
+
const useDictionary = () => {
|
|
28
|
+
return (0, import_react.useContext)(dictionaryContext);
|
|
29
|
+
};
|
package/cjs/src/router.js
CHANGED
|
@@ -80,13 +80,13 @@ class Router {
|
|
|
80
80
|
const router2 = options.router;
|
|
81
81
|
const pathInfo = this.#getPathInfo(href);
|
|
82
82
|
this.#postPathChange(pathInfo);
|
|
83
|
-
|
|
83
|
+
router2.push(pathInfo.href);
|
|
84
84
|
},
|
|
85
85
|
replace: (href) => {
|
|
86
86
|
const router2 = options.router;
|
|
87
87
|
const pathInfo = this.#getPathInfo(href);
|
|
88
88
|
this.#postPathChange(pathInfo);
|
|
89
|
-
|
|
89
|
+
router2.replace(pathInfo.href);
|
|
90
90
|
},
|
|
91
91
|
back: () => {
|
|
92
92
|
const router2 = options.router;
|
|
@@ -98,7 +98,7 @@ class Router {
|
|
|
98
98
|
const router2 = options.router;
|
|
99
99
|
const pathInfo = this.#getPathInfo(location.pathname);
|
|
100
100
|
this.#postPathChange(pathInfo);
|
|
101
|
-
router2.
|
|
101
|
+
router2.refresh();
|
|
102
102
|
}
|
|
103
103
|
};
|
|
104
104
|
}
|
package/esm/src/index.js
CHANGED
package/esm/src/router.js
CHANGED
|
@@ -57,13 +57,13 @@ class Router {
|
|
|
57
57
|
const router2 = options.router;
|
|
58
58
|
const pathInfo = this.#getPathInfo(href);
|
|
59
59
|
this.#postPathChange(pathInfo);
|
|
60
|
-
|
|
60
|
+
router2.push(pathInfo.href);
|
|
61
61
|
},
|
|
62
62
|
replace: (href) => {
|
|
63
63
|
const router2 = options.router;
|
|
64
64
|
const pathInfo = this.#getPathInfo(href);
|
|
65
65
|
this.#postPathChange(pathInfo);
|
|
66
|
-
|
|
66
|
+
router2.replace(pathInfo.href);
|
|
67
67
|
},
|
|
68
68
|
back: () => {
|
|
69
69
|
const router2 = options.router;
|
|
@@ -75,7 +75,7 @@ class Router {
|
|
|
75
75
|
const router2 = options.router;
|
|
76
76
|
const pathInfo = this.#getPathInfo(location.pathname);
|
|
77
77
|
this.#postPathChange(pathInfo);
|
|
78
|
-
router2.
|
|
78
|
+
router2.refresh();
|
|
79
79
|
}
|
|
80
80
|
};
|
|
81
81
|
}
|
package/package.json
CHANGED
package/src/index.d.ts
CHANGED
package/src/locale.d.ts
ADDED
package/src/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { FetchInitForm } from "@akanjs/signal";
|
|
2
2
|
import { type ClassValue } from "clsx";
|
|
3
|
-
import type { ReactNode } from "react";
|
|
3
|
+
import type { ReactElement, ReactNode } from "react";
|
|
4
4
|
export declare const clsx: (...args: ClassValue[]) => string;
|
|
5
5
|
export declare const loadFonts: (fonts: {
|
|
6
6
|
name: string;
|
|
@@ -29,7 +29,7 @@ export type ModelProps<T extends string, L extends {
|
|
|
29
29
|
className?: string;
|
|
30
30
|
sliceName?: T;
|
|
31
31
|
onClick?: (model: L) => any;
|
|
32
|
-
actions?: DataAction
|
|
32
|
+
actions?: DataAction[];
|
|
33
33
|
columns?: DataColumn<L>[];
|
|
34
34
|
href?: string;
|
|
35
35
|
};
|
|
@@ -43,7 +43,9 @@ export interface ModelDashboardProps<Summary> {
|
|
|
43
43
|
hidePresents?: boolean;
|
|
44
44
|
sliceName?: string;
|
|
45
45
|
}
|
|
46
|
-
export interface ModelInsightProps<Insight
|
|
46
|
+
export interface ModelInsightProps<Insight = {
|
|
47
|
+
count: number;
|
|
48
|
+
}> {
|
|
47
49
|
className?: string;
|
|
48
50
|
insight: Insight;
|
|
49
51
|
sliceName?: string;
|
|
@@ -55,10 +57,7 @@ export interface ModelViewProps {
|
|
|
55
57
|
id?: string;
|
|
56
58
|
sliceName?: string;
|
|
57
59
|
}
|
|
58
|
-
export type DataAction
|
|
59
|
-
type: string;
|
|
60
|
-
render: () => ReactNode;
|
|
61
|
-
};
|
|
60
|
+
export type DataAction = "edit" | "view" | "remove" | null | undefined | ReactElement;
|
|
62
61
|
export interface DataTool {
|
|
63
62
|
render: () => ReactNode;
|
|
64
63
|
}
|