dn-react-router-toolkit 0.7.7 → 0.7.9
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/api/create_api_handler.d.mts +5 -5
- package/dist/api/create_api_handler.d.ts +5 -5
- package/dist/client/env_loader.d.mts +2 -2
- package/dist/client/env_loader.d.ts +2 -2
- package/dist/client/env_loader.js +2 -12
- package/dist/client/env_loader.mjs +2 -2
- package/dist/client/file_input.d.mts +3 -2
- package/dist/client/file_input.d.ts +3 -2
- package/dist/client/file_input.js +30 -37
- package/dist/client/file_input.mjs +33 -28
- package/dist/client/index.d.mts +1 -0
- package/dist/client/index.d.ts +1 -0
- package/dist/client/index.js +38 -44
- package/dist/client/index.mjs +39 -33
- package/dist/client/store_text_editor.d.mts +2 -2
- package/dist/client/store_text_editor.d.ts +2 -2
- package/dist/client/store_text_editor.js +3 -12
- package/dist/client/store_text_editor.mjs +3 -2
- package/dist/crud/crud_form.d.mts +5 -4
- package/dist/crud/crud_form.d.ts +5 -4
- package/dist/crud/crud_form.js +83 -72
- package/dist/crud/crud_form.mjs +88 -62
- package/dist/crud/crud_form_provider.d.mts +10 -8
- package/dist/crud/crud_form_provider.d.ts +10 -8
- package/dist/crud/crud_form_provider.js +2 -12
- package/dist/crud/crud_form_provider.mjs +6 -3
- package/dist/crud/crud_loader.d.mts +1 -1
- package/dist/crud/crud_loader.d.ts +1 -1
- package/dist/crud/crud_page.d.mts +10 -6
- package/dist/crud/crud_page.d.ts +10 -6
- package/dist/crud/crud_page.js +281 -409
- package/dist/crud/crud_page.mjs +286 -399
- package/dist/crud/generate_pages.d.mts +10 -2
- package/dist/crud/generate_pages.d.ts +10 -2
- package/dist/crud/generate_pages.js +17 -14
- package/dist/crud/generate_pages.mjs +17 -4
- package/dist/crud/index.d.mts +2 -1
- package/dist/crud/index.d.ts +2 -1
- package/dist/crud/index.js +299 -404
- package/dist/crud/index.mjs +304 -404
- package/dist/form/create_form_component.d.mts +3 -2
- package/dist/form/create_form_component.d.ts +3 -2
- package/dist/form/create_form_component.js +3 -12
- package/dist/form/create_form_component.mjs +3 -2
- package/dist/form/form_components.d.mts +5 -4
- package/dist/form/form_components.d.ts +5 -4
- package/dist/form/form_components.js +3 -12
- package/dist/form/form_components.mjs +3 -2
- package/dist/form/index.d.mts +1 -0
- package/dist/form/index.d.ts +1 -0
- package/dist/form/index.js +3 -12
- package/dist/form/index.mjs +3 -2
- package/dist/post/editor_toolbar.d.mts +4 -3
- package/dist/post/editor_toolbar.d.ts +4 -3
- package/dist/post/editor_toolbar.js +116 -273
- package/dist/post/editor_toolbar.mjs +123 -263
- package/dist/post/index.d.mts +1 -0
- package/dist/post/index.d.ts +1 -0
- package/dist/post/index.js +329 -411
- package/dist/post/index.mjs +337 -409
- package/dist/post/post_form_page.d.mts +5 -4
- package/dist/post/post_form_page.d.ts +5 -4
- package/dist/post/post_form_page.js +331 -413
- package/dist/post/post_form_page.mjs +337 -409
- package/dist/post/thumbnail_picker.d.mts +3 -2
- package/dist/post/thumbnail_picker.d.ts +3 -2
- package/dist/post/thumbnail_picker.js +14 -23
- package/dist/post/thumbnail_picker.mjs +14 -13
- package/dist/seo/index.d.mts +1 -1
- package/dist/seo/index.d.ts +1 -1
- package/dist/seo/index.js +2 -2
- package/dist/seo/index.mjs +2 -2
- package/dist/seo/seo.d.mts +2 -2
- package/dist/seo/seo.d.ts +2 -2
- package/dist/seo/seo.js +2 -2
- package/dist/seo/seo.mjs +2 -2
- package/dist/table/buttons.d.mts +2 -2
- package/dist/table/buttons.d.ts +2 -2
- package/dist/table/buttons.js +42 -57
- package/dist/table/buttons.mjs +42 -47
- package/dist/table/index.d.mts +1 -0
- package/dist/table/index.d.ts +1 -0
- package/dist/table/index.js +185 -338
- package/dist/table/index.mjs +185 -328
- package/dist/table/page.d.mts +5 -4
- package/dist/table/page.d.ts +5 -4
- package/dist/table/page.js +185 -338
- package/dist/table/page.mjs +185 -328
- package/dist/table/table.d.mts +5 -4
- package/dist/table/table.d.ts +5 -4
- package/dist/table/table.js +77 -237
- package/dist/table/table.mjs +77 -227
- package/package.json +7 -5
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
1
2
|
import { Store } from 'react-store-input';
|
|
2
|
-
import
|
|
3
|
+
import { RefObject } from 'react';
|
|
3
4
|
import { TextEditorController } from 'dn-react-text-editor';
|
|
4
5
|
|
|
5
6
|
declare function PostThumbnailPicker<T extends {
|
|
@@ -7,6 +8,6 @@ declare function PostThumbnailPicker<T extends {
|
|
|
7
8
|
}>({ store, textEditorRef, }: {
|
|
8
9
|
store: Store<T>;
|
|
9
10
|
textEditorRef: RefObject<TextEditorController | null>;
|
|
10
|
-
}):
|
|
11
|
+
}): react_jsx_runtime.JSX.Element;
|
|
11
12
|
|
|
12
13
|
export { PostThumbnailPicker };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
1
2
|
import { Store } from 'react-store-input';
|
|
2
|
-
import
|
|
3
|
+
import { RefObject } from 'react';
|
|
3
4
|
import { TextEditorController } from 'dn-react-text-editor';
|
|
4
5
|
|
|
5
6
|
declare function PostThumbnailPicker<T extends {
|
|
@@ -7,6 +8,6 @@ declare function PostThumbnailPicker<T extends {
|
|
|
7
8
|
}>({ store, textEditorRef, }: {
|
|
8
9
|
store: Store<T>;
|
|
9
10
|
textEditorRef: RefObject<TextEditorController | null>;
|
|
10
|
-
}):
|
|
11
|
+
}): react_jsx_runtime.JSX.Element;
|
|
11
12
|
|
|
12
13
|
export { PostThumbnailPicker };
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
2
|
var __defProp = Object.defineProperty;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
6
|
var __export = (target, all) => {
|
|
9
7
|
for (var name in all)
|
|
@@ -17,14 +15,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
15
|
}
|
|
18
16
|
return to;
|
|
19
17
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
19
|
|
|
30
20
|
// src/post/thumbnail_picker.tsx
|
|
@@ -35,7 +25,8 @@ __export(thumbnail_picker_exports, {
|
|
|
35
25
|
module.exports = __toCommonJS(thumbnail_picker_exports);
|
|
36
26
|
var import_react_store_input = require("react-store-input");
|
|
37
27
|
var import_utils = require("dn-react-toolkit/utils");
|
|
38
|
-
var import_react =
|
|
28
|
+
var import_react = require("react");
|
|
29
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
39
30
|
function PostThumbnailPicker({
|
|
40
31
|
store,
|
|
41
32
|
textEditorRef
|
|
@@ -73,10 +64,9 @@ function PostThumbnailPicker({
|
|
|
73
64
|
unsubscribe();
|
|
74
65
|
};
|
|
75
66
|
}, []);
|
|
76
|
-
return /* @__PURE__ */
|
|
67
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "grid grid-cols-6 gap-1", children: thumbnails.map((url, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
77
68
|
"button",
|
|
78
69
|
{
|
|
79
|
-
key: index,
|
|
80
70
|
type: "button",
|
|
81
71
|
className: (0, import_utils.cn)(
|
|
82
72
|
"border border-neutral-200 rounded-lg overflow-hidden aspect-4/3",
|
|
@@ -86,17 +76,18 @@ function PostThumbnailPicker({
|
|
|
86
76
|
store.dispatch((state) => {
|
|
87
77
|
state.thumbnail = url;
|
|
88
78
|
});
|
|
89
|
-
}
|
|
79
|
+
},
|
|
80
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
81
|
+
"img",
|
|
82
|
+
{
|
|
83
|
+
src: url,
|
|
84
|
+
alt: `Thumbnail ${index + 1}`,
|
|
85
|
+
className: "w-full h-full object-cover"
|
|
86
|
+
}
|
|
87
|
+
)
|
|
90
88
|
},
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
{
|
|
94
|
-
src: url,
|
|
95
|
-
alt: `Thumbnail ${index + 1}`,
|
|
96
|
-
className: "w-full h-full object-cover"
|
|
97
|
-
}
|
|
98
|
-
)
|
|
99
|
-
)));
|
|
89
|
+
index
|
|
90
|
+
)) });
|
|
100
91
|
}
|
|
101
92
|
// Annotate the CommonJS export names for ESM import in node:
|
|
102
93
|
0 && (module.exports = {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
// src/post/thumbnail_picker.tsx
|
|
2
2
|
import { useSelector } from "react-store-input";
|
|
3
3
|
import { cn } from "dn-react-toolkit/utils";
|
|
4
|
-
import
|
|
4
|
+
import { useEffect, useState } from "react";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
6
|
function PostThumbnailPicker({
|
|
6
7
|
store,
|
|
7
8
|
textEditorRef
|
|
@@ -39,10 +40,9 @@ function PostThumbnailPicker({
|
|
|
39
40
|
unsubscribe();
|
|
40
41
|
};
|
|
41
42
|
}, []);
|
|
42
|
-
return /* @__PURE__ */
|
|
43
|
+
return /* @__PURE__ */ jsx("div", { className: "grid grid-cols-6 gap-1", children: thumbnails.map((url, index) => /* @__PURE__ */ jsx(
|
|
43
44
|
"button",
|
|
44
45
|
{
|
|
45
|
-
key: index,
|
|
46
46
|
type: "button",
|
|
47
47
|
className: cn(
|
|
48
48
|
"border border-neutral-200 rounded-lg overflow-hidden aspect-4/3",
|
|
@@ -52,17 +52,18 @@ function PostThumbnailPicker({
|
|
|
52
52
|
store.dispatch((state) => {
|
|
53
53
|
state.thumbnail = url;
|
|
54
54
|
});
|
|
55
|
-
}
|
|
55
|
+
},
|
|
56
|
+
children: /* @__PURE__ */ jsx(
|
|
57
|
+
"img",
|
|
58
|
+
{
|
|
59
|
+
src: url,
|
|
60
|
+
alt: `Thumbnail ${index + 1}`,
|
|
61
|
+
className: "w-full h-full object-cover"
|
|
62
|
+
}
|
|
63
|
+
)
|
|
56
64
|
},
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
{
|
|
60
|
-
src: url,
|
|
61
|
-
alt: `Thumbnail ${index + 1}`,
|
|
62
|
-
className: "w-full h-full object-cover"
|
|
63
|
-
}
|
|
64
|
-
)
|
|
65
|
-
)));
|
|
65
|
+
index
|
|
66
|
+
)) });
|
|
66
67
|
}
|
|
67
68
|
export {
|
|
68
69
|
PostThumbnailPicker
|
package/dist/seo/index.d.mts
CHANGED
package/dist/seo/index.d.ts
CHANGED
package/dist/seo/index.js
CHANGED
|
@@ -46,9 +46,9 @@ __export(seo_exports, {
|
|
|
46
46
|
module.exports = __toCommonJS(seo_exports);
|
|
47
47
|
|
|
48
48
|
// src/seo/seo.tsx
|
|
49
|
-
var import_react = __toESM(require("react"));
|
|
50
49
|
var Schema = __toESM(require_schema());
|
|
51
50
|
var import_react_router = require("react-router");
|
|
51
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
52
52
|
function configSEO(config) {
|
|
53
53
|
function create(props) {
|
|
54
54
|
const canonicalPath = props.canonicalPath;
|
|
@@ -290,7 +290,7 @@ function configSEO(config) {
|
|
|
290
290
|
})
|
|
291
291
|
].filter(Boolean)
|
|
292
292
|
};
|
|
293
|
-
return /* @__PURE__ */
|
|
293
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
294
294
|
"script",
|
|
295
295
|
{
|
|
296
296
|
type: "application/ld+json",
|
package/dist/seo/index.mjs
CHANGED
|
@@ -34,8 +34,8 @@ var require_schema = __commonJS({
|
|
|
34
34
|
|
|
35
35
|
// src/seo/seo.tsx
|
|
36
36
|
var Schema = __toESM(require_schema());
|
|
37
|
-
import React from "react";
|
|
38
37
|
import { useLoaderData } from "react-router";
|
|
38
|
+
import { jsx } from "react/jsx-runtime";
|
|
39
39
|
function configSEO(config) {
|
|
40
40
|
function create(props) {
|
|
41
41
|
const canonicalPath = props.canonicalPath;
|
|
@@ -277,7 +277,7 @@ function configSEO(config) {
|
|
|
277
277
|
})
|
|
278
278
|
].filter(Boolean)
|
|
279
279
|
};
|
|
280
|
-
return /* @__PURE__ */
|
|
280
|
+
return /* @__PURE__ */ jsx(
|
|
281
281
|
"script",
|
|
282
282
|
{
|
|
283
283
|
type: "application/ld+json",
|
package/dist/seo/seo.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as Schema from 'schema-dts';
|
|
3
3
|
import { MetaFunction } from 'react-router';
|
|
4
4
|
|
|
@@ -65,7 +65,7 @@ declare function configSEO(config: {
|
|
|
65
65
|
thumbnail: SEOImage | null | undefined;
|
|
66
66
|
};
|
|
67
67
|
meta: MetaFunction<unknown, Record<string, unknown>>;
|
|
68
|
-
StructedData: () =>
|
|
68
|
+
StructedData: () => react_jsx_runtime.JSX.Element;
|
|
69
69
|
};
|
|
70
70
|
|
|
71
71
|
export { type SEO, type SEOImage, configSEO };
|
package/dist/seo/seo.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as Schema from 'schema-dts';
|
|
3
3
|
import { MetaFunction } from 'react-router';
|
|
4
4
|
|
|
@@ -65,7 +65,7 @@ declare function configSEO(config: {
|
|
|
65
65
|
thumbnail: SEOImage | null | undefined;
|
|
66
66
|
};
|
|
67
67
|
meta: MetaFunction<unknown, Record<string, unknown>>;
|
|
68
|
-
StructedData: () =>
|
|
68
|
+
StructedData: () => react_jsx_runtime.JSX.Element;
|
|
69
69
|
};
|
|
70
70
|
|
|
71
71
|
export { type SEO, type SEOImage, configSEO };
|
package/dist/seo/seo.js
CHANGED
|
@@ -44,9 +44,9 @@ __export(seo_exports, {
|
|
|
44
44
|
configSEO: () => configSEO
|
|
45
45
|
});
|
|
46
46
|
module.exports = __toCommonJS(seo_exports);
|
|
47
|
-
var import_react = __toESM(require("react"));
|
|
48
47
|
var Schema = __toESM(require_schema());
|
|
49
48
|
var import_react_router = require("react-router");
|
|
49
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
50
50
|
function configSEO(config) {
|
|
51
51
|
function create(props) {
|
|
52
52
|
const canonicalPath = props.canonicalPath;
|
|
@@ -288,7 +288,7 @@ function configSEO(config) {
|
|
|
288
288
|
})
|
|
289
289
|
].filter(Boolean)
|
|
290
290
|
};
|
|
291
|
-
return /* @__PURE__ */
|
|
291
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
292
292
|
"script",
|
|
293
293
|
{
|
|
294
294
|
type: "application/ld+json",
|
package/dist/seo/seo.mjs
CHANGED
|
@@ -34,8 +34,8 @@ var require_schema = __commonJS({
|
|
|
34
34
|
|
|
35
35
|
// src/seo/seo.tsx
|
|
36
36
|
var Schema = __toESM(require_schema());
|
|
37
|
-
import React from "react";
|
|
38
37
|
import { useLoaderData } from "react-router";
|
|
38
|
+
import { jsx } from "react/jsx-runtime";
|
|
39
39
|
function configSEO(config) {
|
|
40
40
|
function create(props) {
|
|
41
41
|
const canonicalPath = props.canonicalPath;
|
|
@@ -277,7 +277,7 @@ function configSEO(config) {
|
|
|
277
277
|
})
|
|
278
278
|
].filter(Boolean)
|
|
279
279
|
};
|
|
280
|
-
return /* @__PURE__ */
|
|
280
|
+
return /* @__PURE__ */ jsx(
|
|
281
281
|
"script",
|
|
282
282
|
{
|
|
283
283
|
type: "application/ld+json",
|
package/dist/table/buttons.d.mts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
|
|
3
3
|
declare function TablePageButtons({ MAX_PAGES_TO_SHOW, total, limit, offset, }: {
|
|
4
4
|
MAX_PAGES_TO_SHOW: number;
|
|
5
5
|
total: number;
|
|
6
6
|
limit: number;
|
|
7
7
|
offset: number;
|
|
8
|
-
}):
|
|
8
|
+
}): react_jsx_runtime.JSX.Element;
|
|
9
9
|
|
|
10
10
|
export { TablePageButtons as default };
|
package/dist/table/buttons.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
|
|
3
3
|
declare function TablePageButtons({ MAX_PAGES_TO_SHOW, total, limit, offset, }: {
|
|
4
4
|
MAX_PAGES_TO_SHOW: number;
|
|
5
5
|
total: number;
|
|
6
6
|
limit: number;
|
|
7
7
|
offset: number;
|
|
8
|
-
}):
|
|
8
|
+
}): react_jsx_runtime.JSX.Element;
|
|
9
9
|
|
|
10
10
|
export { TablePageButtons as default };
|
package/dist/table/buttons.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
2
|
var __defProp = Object.defineProperty;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
6
|
var __export = (target, all) => {
|
|
9
7
|
for (var name in all)
|
|
@@ -17,14 +15,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
15
|
}
|
|
18
16
|
return to;
|
|
19
17
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
19
|
|
|
30
20
|
// src/table/buttons.tsx
|
|
@@ -35,7 +25,7 @@ __export(buttons_exports, {
|
|
|
35
25
|
module.exports = __toCommonJS(buttons_exports);
|
|
36
26
|
var import_utils = require("dn-react-toolkit/utils");
|
|
37
27
|
var import_react_router = require("react-router");
|
|
38
|
-
var
|
|
28
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
39
29
|
function TablePageButtons({
|
|
40
30
|
MAX_PAGES_TO_SHOW,
|
|
41
31
|
total,
|
|
@@ -48,55 +38,50 @@ function TablePageButtons({
|
|
|
48
38
|
const currentPage = Math.floor(offset / limit) + 1;
|
|
49
39
|
const startButton = (Math.ceil(currentPage / MAX_PAGES_TO_SHOW) - 1) * MAX_PAGES_TO_SHOW;
|
|
50
40
|
const endButton = Math.min(startButton + MAX_PAGES_TO_SHOW - 1, pages);
|
|
51
|
-
return /* @__PURE__ */
|
|
52
|
-
|
|
53
|
-
{
|
|
54
|
-
to: (() => {
|
|
55
|
-
searchParams.set(
|
|
56
|
-
"offset",
|
|
57
|
-
String((startButton - 1) * limit)
|
|
58
|
-
);
|
|
59
|
-
return `${pathname}?${searchParams.toString()}`;
|
|
60
|
-
})(),
|
|
61
|
-
className: "w-10 block text-center transition-colors hover:text-primary"
|
|
62
|
-
},
|
|
63
|
-
"\uC774\uC804"
|
|
64
|
-
), Array.from({
|
|
65
|
-
length: Math.min(
|
|
66
|
-
MAX_PAGES_TO_SHOW,
|
|
67
|
-
pages - startButton
|
|
68
|
-
)
|
|
69
|
-
}).map((_, index) => {
|
|
70
|
-
return /* @__PURE__ */ import_react.default.createElement(
|
|
41
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: pages > 1 && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex justify-center items-center my-8 gap-4 text-neutral-400", children: [
|
|
42
|
+
startButton > 1 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
71
43
|
import_react_router.Link,
|
|
72
44
|
{
|
|
73
|
-
key: index,
|
|
74
45
|
to: (() => {
|
|
75
|
-
searchParams.set(
|
|
76
|
-
"offset",
|
|
77
|
-
String((startButton + index) * limit)
|
|
78
|
-
);
|
|
46
|
+
searchParams.set("offset", String((startButton - 1) * limit));
|
|
79
47
|
return `${pathname}?${searchParams.toString()}`;
|
|
80
48
|
})(),
|
|
81
|
-
className:
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
)
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
49
|
+
className: "w-10 block text-center transition-colors hover:text-primary",
|
|
50
|
+
children: "\uC774\uC804"
|
|
51
|
+
}
|
|
52
|
+
),
|
|
53
|
+
Array.from({
|
|
54
|
+
length: Math.min(MAX_PAGES_TO_SHOW, pages - startButton)
|
|
55
|
+
}).map((_, index) => {
|
|
56
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
57
|
+
import_react_router.Link,
|
|
58
|
+
{
|
|
59
|
+
to: (() => {
|
|
60
|
+
searchParams.set(
|
|
61
|
+
"offset",
|
|
62
|
+
String((startButton + index) * limit)
|
|
63
|
+
);
|
|
64
|
+
return `${pathname}?${searchParams.toString()}`;
|
|
65
|
+
})(),
|
|
66
|
+
className: (0, import_utils.cn)(
|
|
67
|
+
"w-6 block text-center transition-colors",
|
|
68
|
+
currentPage === startButton + index + 1 ? "font-bold text-primary" : "hover:text-primary"
|
|
69
|
+
),
|
|
70
|
+
children: startButton + index + 1
|
|
71
|
+
},
|
|
72
|
+
index
|
|
73
|
+
);
|
|
74
|
+
}),
|
|
75
|
+
endButton < pages && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
76
|
+
import_react_router.Link,
|
|
77
|
+
{
|
|
78
|
+
to: (() => {
|
|
79
|
+
searchParams.set("offset", String((endButton + 1) * limit));
|
|
80
|
+
return `${pathname}?${searchParams.toString()}`;
|
|
81
|
+
})(),
|
|
82
|
+
className: "w-10 block text-center transition-colors hover:text-primary",
|
|
83
|
+
children: "\uB2E4\uC74C"
|
|
84
|
+
}
|
|
85
|
+
)
|
|
86
|
+
] }) });
|
|
102
87
|
}
|
package/dist/table/buttons.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// src/table/buttons.tsx
|
|
2
2
|
import { cn } from "dn-react-toolkit/utils";
|
|
3
3
|
import { Link, useLocation, useSearchParams } from "react-router";
|
|
4
|
-
import
|
|
4
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
function TablePageButtons({
|
|
6
6
|
MAX_PAGES_TO_SHOW,
|
|
7
7
|
total,
|
|
@@ -14,57 +14,52 @@ function TablePageButtons({
|
|
|
14
14
|
const currentPage = Math.floor(offset / limit) + 1;
|
|
15
15
|
const startButton = (Math.ceil(currentPage / MAX_PAGES_TO_SHOW) - 1) * MAX_PAGES_TO_SHOW;
|
|
16
16
|
const endButton = Math.min(startButton + MAX_PAGES_TO_SHOW - 1, pages);
|
|
17
|
-
return /* @__PURE__ */
|
|
18
|
-
|
|
19
|
-
{
|
|
20
|
-
to: (() => {
|
|
21
|
-
searchParams.set(
|
|
22
|
-
"offset",
|
|
23
|
-
String((startButton - 1) * limit)
|
|
24
|
-
);
|
|
25
|
-
return `${pathname}?${searchParams.toString()}`;
|
|
26
|
-
})(),
|
|
27
|
-
className: "w-10 block text-center transition-colors hover:text-primary"
|
|
28
|
-
},
|
|
29
|
-
"\uC774\uC804"
|
|
30
|
-
), Array.from({
|
|
31
|
-
length: Math.min(
|
|
32
|
-
MAX_PAGES_TO_SHOW,
|
|
33
|
-
pages - startButton
|
|
34
|
-
)
|
|
35
|
-
}).map((_, index) => {
|
|
36
|
-
return /* @__PURE__ */ React.createElement(
|
|
17
|
+
return /* @__PURE__ */ jsx(Fragment, { children: pages > 1 && /* @__PURE__ */ jsxs("div", { className: "flex justify-center items-center my-8 gap-4 text-neutral-400", children: [
|
|
18
|
+
startButton > 1 && /* @__PURE__ */ jsx(
|
|
37
19
|
Link,
|
|
38
20
|
{
|
|
39
|
-
key: index,
|
|
40
21
|
to: (() => {
|
|
41
|
-
searchParams.set(
|
|
42
|
-
"offset",
|
|
43
|
-
String((startButton + index) * limit)
|
|
44
|
-
);
|
|
22
|
+
searchParams.set("offset", String((startButton - 1) * limit));
|
|
45
23
|
return `${pathname}?${searchParams.toString()}`;
|
|
46
24
|
})(),
|
|
47
|
-
className:
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
)
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
25
|
+
className: "w-10 block text-center transition-colors hover:text-primary",
|
|
26
|
+
children: "\uC774\uC804"
|
|
27
|
+
}
|
|
28
|
+
),
|
|
29
|
+
Array.from({
|
|
30
|
+
length: Math.min(MAX_PAGES_TO_SHOW, pages - startButton)
|
|
31
|
+
}).map((_, index) => {
|
|
32
|
+
return /* @__PURE__ */ jsx(
|
|
33
|
+
Link,
|
|
34
|
+
{
|
|
35
|
+
to: (() => {
|
|
36
|
+
searchParams.set(
|
|
37
|
+
"offset",
|
|
38
|
+
String((startButton + index) * limit)
|
|
39
|
+
);
|
|
40
|
+
return `${pathname}?${searchParams.toString()}`;
|
|
41
|
+
})(),
|
|
42
|
+
className: cn(
|
|
43
|
+
"w-6 block text-center transition-colors",
|
|
44
|
+
currentPage === startButton + index + 1 ? "font-bold text-primary" : "hover:text-primary"
|
|
45
|
+
),
|
|
46
|
+
children: startButton + index + 1
|
|
47
|
+
},
|
|
48
|
+
index
|
|
49
|
+
);
|
|
50
|
+
}),
|
|
51
|
+
endButton < pages && /* @__PURE__ */ jsx(
|
|
52
|
+
Link,
|
|
53
|
+
{
|
|
54
|
+
to: (() => {
|
|
55
|
+
searchParams.set("offset", String((endButton + 1) * limit));
|
|
56
|
+
return `${pathname}?${searchParams.toString()}`;
|
|
57
|
+
})(),
|
|
58
|
+
className: "w-10 block text-center transition-colors hover:text-primary",
|
|
59
|
+
children: "\uB2E4\uC74C"
|
|
60
|
+
}
|
|
61
|
+
)
|
|
62
|
+
] }) });
|
|
68
63
|
}
|
|
69
64
|
export {
|
|
70
65
|
TablePageButtons as default
|
package/dist/table/index.d.mts
CHANGED