dn-react-router-toolkit 0.5.8 → 0.6.0
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/auth/cookie_store.d.mts +1 -1
- package/dist/auth/cookie_store.d.ts +1 -1
- package/dist/auth/cookie_store.js +4 -4
- package/dist/auth/cookie_store.mjs +4 -4
- package/dist/auth/index.js +4 -4
- package/dist/auth/index.mjs +4 -4
- package/dist/client/env_loader.d.mts +2 -2
- package/dist/client/env_loader.d.ts +2 -2
- package/dist/client/file_input.d.mts +10 -0
- package/dist/client/file_input.d.ts +10 -0
- package/dist/client/file_input.js +80 -0
- package/dist/client/file_input.mjs +45 -0
- package/dist/client/index.d.mts +4 -0
- package/dist/client/index.d.ts +4 -0
- package/dist/client/index.js +104 -0
- package/dist/client/index.mjs +102 -0
- package/dist/client/store_text_editor.d.mts +13 -0
- package/dist/client/store_text_editor.d.ts +13 -0
- package/dist/client/store_text_editor.js +94 -0
- package/dist/client/store_text_editor.mjs +59 -0
- package/dist/crud/crud_form.d.mts +4 -6
- package/dist/crud/crud_form.d.ts +4 -6
- package/dist/crud/crud_form.js +147 -100
- package/dist/crud/crud_form.mjs +148 -106
- package/dist/crud/crud_form_provider.d.mts +10 -10
- package/dist/crud/crud_form_provider.d.ts +10 -10
- package/dist/crud/crud_form_provider.js +5 -6
- package/dist/crud/crud_form_provider.mjs +4 -5
- package/dist/crud/crud_page.d.mts +8 -8
- package/dist/crud/crud_page.d.ts +8 -8
- package/dist/crud/crud_page.js +203 -160
- package/dist/crud/crud_page.mjs +200 -162
- package/dist/crud/generate_pages.d.mts +3 -3
- package/dist/crud/generate_pages.d.ts +3 -3
- package/dist/crud/index.d.mts +1 -1
- package/dist/crud/index.d.ts +1 -1
- package/dist/crud/index.js +256 -213
- package/dist/crud/index.mjs +240 -202
- package/dist/form/create_form_component.d.mts +28 -0
- package/dist/form/create_form_component.d.ts +28 -0
- package/dist/form/create_form_component.js +47 -0
- package/dist/form/create_form_component.mjs +12 -0
- package/dist/form/form_components.d.mts +7 -0
- package/dist/form/form_components.d.ts +7 -0
- package/dist/form/form_components.js +64 -0
- package/dist/form/form_components.mjs +25 -0
- package/dist/form/index.d.mts +3 -0
- package/dist/form/index.d.ts +3 -0
- package/dist/form/index.js +66 -0
- package/dist/form/index.mjs +26 -0
- package/dist/post/index.d.mts +2 -0
- package/dist/post/index.d.ts +2 -0
- package/dist/post/index.js +33 -0
- package/dist/post/index.mjs +4 -0
- package/dist/post/thumbnail_picker.d.mts +18 -0
- package/dist/post/thumbnail_picker.d.ts +18 -0
- package/dist/post/thumbnail_picker.js +101 -0
- package/dist/post/thumbnail_picker.mjs +70 -0
- package/dist/seo/seo.d.mts +2 -2
- package/dist/seo/seo.d.ts +2 -2
- package/dist/table/buttons.d.mts +2 -2
- package/dist/table/buttons.d.ts +2 -2
- package/dist/table/index.js +44 -47
- package/dist/table/index.mjs +44 -47
- package/dist/table/page.d.mts +5 -7
- package/dist/table/page.d.ts +5 -7
- package/dist/table/page.js +44 -47
- package/dist/table/page.mjs +44 -47
- package/dist/table/table.d.mts +4 -4
- package/dist/table/table.d.ts +4 -4
- package/package.json +14 -2
package/dist/table/index.js
CHANGED
|
@@ -480,7 +480,7 @@ function createTablePage({
|
|
|
480
480
|
primaryKey = "id"
|
|
481
481
|
}) {
|
|
482
482
|
return function TablePage({
|
|
483
|
-
|
|
483
|
+
AdminHeader
|
|
484
484
|
}) {
|
|
485
485
|
const { pathname } = (0, import_react_router3.useLocation)();
|
|
486
486
|
const { table } = (0, import_react_router3.useLoaderData)();
|
|
@@ -493,63 +493,60 @@ function createTablePage({
|
|
|
493
493
|
navigate(`${pathname}?${searchParams2.toString()}`);
|
|
494
494
|
};
|
|
495
495
|
const [searchParams] = (0, import_react_router3.useSearchParams)();
|
|
496
|
-
return /* @__PURE__ */ import_react5.default.createElement(
|
|
497
|
-
|
|
496
|
+
return /* @__PURE__ */ import_react5.default.createElement(import_react5.default.Fragment, null, /* @__PURE__ */ import_react5.default.createElement(
|
|
497
|
+
AdminHeader,
|
|
498
498
|
{
|
|
499
499
|
title: name,
|
|
500
500
|
actions: /* @__PURE__ */ import_react5.default.createElement(import_react_router3.Link, { to: `${pathname}/new`, className: "button-primary" }, name, " \uCD94\uAC00")
|
|
501
|
+
}
|
|
502
|
+
), /* @__PURE__ */ import_react5.default.createElement("div", { className: "max-w-7xl mx-auto" }, searchKey && /* @__PURE__ */ import_react5.default.createElement(
|
|
503
|
+
"form",
|
|
504
|
+
{
|
|
505
|
+
className: "h-18 px-4 flex items-center border-t",
|
|
506
|
+
onSubmit: (e) => {
|
|
507
|
+
e.preventDefault();
|
|
508
|
+
const formData = new FormData(e.currentTarget);
|
|
509
|
+
const query = formData.get("query");
|
|
510
|
+
search(query);
|
|
511
|
+
}
|
|
501
512
|
},
|
|
502
|
-
searchKey && /* @__PURE__ */ import_react5.default.createElement(
|
|
503
|
-
"form",
|
|
504
|
-
{
|
|
505
|
-
className: "h-18 px-4 flex items-center border-t",
|
|
506
|
-
onSubmit: (e) => {
|
|
507
|
-
e.preventDefault();
|
|
508
|
-
const formData = new FormData(e.currentTarget);
|
|
509
|
-
const query = formData.get("query");
|
|
510
|
-
search(query);
|
|
511
|
-
}
|
|
512
|
-
},
|
|
513
|
-
/* @__PURE__ */ import_react5.default.createElement(
|
|
514
|
-
"button",
|
|
515
|
-
{
|
|
516
|
-
type: "submit",
|
|
517
|
-
className: "w-10 h-10 flex justify-center items-center"
|
|
518
|
-
},
|
|
519
|
-
/* @__PURE__ */ import_react5.default.createElement(GoSearch, { className: "text-xl mr-4" })
|
|
520
|
-
),
|
|
521
|
-
/* @__PURE__ */ import_react5.default.createElement(
|
|
522
|
-
"input",
|
|
523
|
-
{
|
|
524
|
-
className: "outline-none h-full flex-1",
|
|
525
|
-
placeholder: "\uC5EC\uAE30\uC5D0 \uAC80\uC0C9\uD558\uC138\uC694...",
|
|
526
|
-
name: "query",
|
|
527
|
-
defaultValue: searchParams.get("query") ?? ""
|
|
528
|
-
}
|
|
529
|
-
)
|
|
530
|
-
),
|
|
531
513
|
/* @__PURE__ */ import_react5.default.createElement(
|
|
532
|
-
|
|
514
|
+
"button",
|
|
533
515
|
{
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
offset,
|
|
539
|
-
orderBy,
|
|
540
|
-
direction
|
|
541
|
-
}
|
|
516
|
+
type: "submit",
|
|
517
|
+
className: "w-10 h-10 flex justify-center items-center"
|
|
518
|
+
},
|
|
519
|
+
/* @__PURE__ */ import_react5.default.createElement(GoSearch, { className: "text-xl mr-4" })
|
|
542
520
|
),
|
|
543
521
|
/* @__PURE__ */ import_react5.default.createElement(
|
|
544
|
-
|
|
522
|
+
"input",
|
|
545
523
|
{
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
524
|
+
className: "outline-none h-full flex-1",
|
|
525
|
+
placeholder: "\uC5EC\uAE30\uC5D0 \uAC80\uC0C9\uD558\uC138\uC694...",
|
|
526
|
+
name: "query",
|
|
527
|
+
defaultValue: searchParams.get("query") ?? ""
|
|
550
528
|
}
|
|
551
529
|
)
|
|
552
|
-
)
|
|
530
|
+
), /* @__PURE__ */ import_react5.default.createElement(
|
|
531
|
+
Table,
|
|
532
|
+
{
|
|
533
|
+
data: items,
|
|
534
|
+
columns,
|
|
535
|
+
getLink: primaryKey ? (item) => `${pathname}/${item[primaryKey]}` : void 0,
|
|
536
|
+
limit,
|
|
537
|
+
offset,
|
|
538
|
+
orderBy,
|
|
539
|
+
direction
|
|
540
|
+
}
|
|
541
|
+
), /* @__PURE__ */ import_react5.default.createElement(
|
|
542
|
+
TablePageButtons,
|
|
543
|
+
{
|
|
544
|
+
total,
|
|
545
|
+
limit,
|
|
546
|
+
offset,
|
|
547
|
+
MAX_PAGES_TO_SHOW: 10
|
|
548
|
+
}
|
|
549
|
+
)));
|
|
553
550
|
};
|
|
554
551
|
}
|
|
555
552
|
// Annotate the CommonJS export names for ESM import in node:
|
package/dist/table/index.mjs
CHANGED
|
@@ -454,7 +454,7 @@ function createTablePage({
|
|
|
454
454
|
primaryKey = "id"
|
|
455
455
|
}) {
|
|
456
456
|
return function TablePage({
|
|
457
|
-
|
|
457
|
+
AdminHeader
|
|
458
458
|
}) {
|
|
459
459
|
const { pathname } = useLocation2();
|
|
460
460
|
const { table } = useLoaderData();
|
|
@@ -467,63 +467,60 @@ function createTablePage({
|
|
|
467
467
|
navigate(`${pathname}?${searchParams2.toString()}`);
|
|
468
468
|
};
|
|
469
469
|
const [searchParams] = useSearchParams3();
|
|
470
|
-
return /* @__PURE__ */ React5.createElement(
|
|
471
|
-
|
|
470
|
+
return /* @__PURE__ */ React5.createElement(React5.Fragment, null, /* @__PURE__ */ React5.createElement(
|
|
471
|
+
AdminHeader,
|
|
472
472
|
{
|
|
473
473
|
title: name,
|
|
474
474
|
actions: /* @__PURE__ */ React5.createElement(Link3, { to: `${pathname}/new`, className: "button-primary" }, name, " \uCD94\uAC00")
|
|
475
|
+
}
|
|
476
|
+
), /* @__PURE__ */ React5.createElement("div", { className: "max-w-7xl mx-auto" }, searchKey && /* @__PURE__ */ React5.createElement(
|
|
477
|
+
"form",
|
|
478
|
+
{
|
|
479
|
+
className: "h-18 px-4 flex items-center border-t",
|
|
480
|
+
onSubmit: (e) => {
|
|
481
|
+
e.preventDefault();
|
|
482
|
+
const formData = new FormData(e.currentTarget);
|
|
483
|
+
const query = formData.get("query");
|
|
484
|
+
search(query);
|
|
485
|
+
}
|
|
475
486
|
},
|
|
476
|
-
searchKey && /* @__PURE__ */ React5.createElement(
|
|
477
|
-
"form",
|
|
478
|
-
{
|
|
479
|
-
className: "h-18 px-4 flex items-center border-t",
|
|
480
|
-
onSubmit: (e) => {
|
|
481
|
-
e.preventDefault();
|
|
482
|
-
const formData = new FormData(e.currentTarget);
|
|
483
|
-
const query = formData.get("query");
|
|
484
|
-
search(query);
|
|
485
|
-
}
|
|
486
|
-
},
|
|
487
|
-
/* @__PURE__ */ React5.createElement(
|
|
488
|
-
"button",
|
|
489
|
-
{
|
|
490
|
-
type: "submit",
|
|
491
|
-
className: "w-10 h-10 flex justify-center items-center"
|
|
492
|
-
},
|
|
493
|
-
/* @__PURE__ */ React5.createElement(GoSearch, { className: "text-xl mr-4" })
|
|
494
|
-
),
|
|
495
|
-
/* @__PURE__ */ React5.createElement(
|
|
496
|
-
"input",
|
|
497
|
-
{
|
|
498
|
-
className: "outline-none h-full flex-1",
|
|
499
|
-
placeholder: "\uC5EC\uAE30\uC5D0 \uAC80\uC0C9\uD558\uC138\uC694...",
|
|
500
|
-
name: "query",
|
|
501
|
-
defaultValue: searchParams.get("query") ?? ""
|
|
502
|
-
}
|
|
503
|
-
)
|
|
504
|
-
),
|
|
505
487
|
/* @__PURE__ */ React5.createElement(
|
|
506
|
-
|
|
488
|
+
"button",
|
|
507
489
|
{
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
offset,
|
|
513
|
-
orderBy,
|
|
514
|
-
direction
|
|
515
|
-
}
|
|
490
|
+
type: "submit",
|
|
491
|
+
className: "w-10 h-10 flex justify-center items-center"
|
|
492
|
+
},
|
|
493
|
+
/* @__PURE__ */ React5.createElement(GoSearch, { className: "text-xl mr-4" })
|
|
516
494
|
),
|
|
517
495
|
/* @__PURE__ */ React5.createElement(
|
|
518
|
-
|
|
496
|
+
"input",
|
|
519
497
|
{
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
498
|
+
className: "outline-none h-full flex-1",
|
|
499
|
+
placeholder: "\uC5EC\uAE30\uC5D0 \uAC80\uC0C9\uD558\uC138\uC694...",
|
|
500
|
+
name: "query",
|
|
501
|
+
defaultValue: searchParams.get("query") ?? ""
|
|
524
502
|
}
|
|
525
503
|
)
|
|
526
|
-
)
|
|
504
|
+
), /* @__PURE__ */ React5.createElement(
|
|
505
|
+
Table,
|
|
506
|
+
{
|
|
507
|
+
data: items,
|
|
508
|
+
columns,
|
|
509
|
+
getLink: primaryKey ? (item) => `${pathname}/${item[primaryKey]}` : void 0,
|
|
510
|
+
limit,
|
|
511
|
+
offset,
|
|
512
|
+
orderBy,
|
|
513
|
+
direction
|
|
514
|
+
}
|
|
515
|
+
), /* @__PURE__ */ React5.createElement(
|
|
516
|
+
TablePageButtons,
|
|
517
|
+
{
|
|
518
|
+
total,
|
|
519
|
+
limit,
|
|
520
|
+
offset,
|
|
521
|
+
MAX_PAGES_TO_SHOW: 10
|
|
522
|
+
}
|
|
523
|
+
)));
|
|
527
524
|
};
|
|
528
525
|
}
|
|
529
526
|
export {
|
package/dist/table/page.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TableColumnOptions } from './table.mjs';
|
|
2
|
-
import
|
|
2
|
+
import React__default from 'react';
|
|
3
3
|
|
|
4
4
|
type TableProps<TModel> = {
|
|
5
5
|
items: TModel[];
|
|
@@ -15,13 +15,11 @@ type TablePageOptions<TModel> = {
|
|
|
15
15
|
columns: TableColumnOptions<TModel>;
|
|
16
16
|
primaryKey?: keyof TModel;
|
|
17
17
|
};
|
|
18
|
-
declare function createTablePage<TModel>({ name, columns, primaryKey, }: TablePageOptions<TModel>): ({
|
|
19
|
-
|
|
18
|
+
declare function createTablePage<TModel>({ name, columns, primaryKey, }: TablePageOptions<TModel>): ({ AdminHeader, }: {
|
|
19
|
+
AdminHeader: React__default.FC<{
|
|
20
20
|
title: string;
|
|
21
|
-
actions?:
|
|
22
|
-
className?: string;
|
|
23
|
-
children?: React.ReactNode;
|
|
21
|
+
actions?: React__default.ReactNode;
|
|
24
22
|
}>;
|
|
25
|
-
}) =>
|
|
23
|
+
}) => React__default.JSX.Element;
|
|
26
24
|
|
|
27
25
|
export { type TablePageOptions, type TableProps, createTablePage };
|
package/dist/table/page.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TableColumnOptions } from './table.js';
|
|
2
|
-
import
|
|
2
|
+
import React__default from 'react';
|
|
3
3
|
|
|
4
4
|
type TableProps<TModel> = {
|
|
5
5
|
items: TModel[];
|
|
@@ -15,13 +15,11 @@ type TablePageOptions<TModel> = {
|
|
|
15
15
|
columns: TableColumnOptions<TModel>;
|
|
16
16
|
primaryKey?: keyof TModel;
|
|
17
17
|
};
|
|
18
|
-
declare function createTablePage<TModel>({ name, columns, primaryKey, }: TablePageOptions<TModel>): ({
|
|
19
|
-
|
|
18
|
+
declare function createTablePage<TModel>({ name, columns, primaryKey, }: TablePageOptions<TModel>): ({ AdminHeader, }: {
|
|
19
|
+
AdminHeader: React__default.FC<{
|
|
20
20
|
title: string;
|
|
21
|
-
actions?:
|
|
22
|
-
className?: string;
|
|
23
|
-
children?: React.ReactNode;
|
|
21
|
+
actions?: React__default.ReactNode;
|
|
24
22
|
}>;
|
|
25
|
-
}) =>
|
|
23
|
+
}) => React__default.JSX.Element;
|
|
26
24
|
|
|
27
25
|
export { type TablePageOptions, type TableProps, createTablePage };
|
package/dist/table/page.js
CHANGED
|
@@ -366,7 +366,7 @@ function createTablePage({
|
|
|
366
366
|
primaryKey = "id"
|
|
367
367
|
}) {
|
|
368
368
|
return function TablePage({
|
|
369
|
-
|
|
369
|
+
AdminHeader
|
|
370
370
|
}) {
|
|
371
371
|
const { pathname } = (0, import_react_router3.useLocation)();
|
|
372
372
|
const { table } = (0, import_react_router3.useLoaderData)();
|
|
@@ -379,63 +379,60 @@ function createTablePage({
|
|
|
379
379
|
navigate(`${pathname}?${searchParams2.toString()}`);
|
|
380
380
|
};
|
|
381
381
|
const [searchParams] = (0, import_react_router3.useSearchParams)();
|
|
382
|
-
return /* @__PURE__ */ import_react5.default.createElement(
|
|
383
|
-
|
|
382
|
+
return /* @__PURE__ */ import_react5.default.createElement(import_react5.default.Fragment, null, /* @__PURE__ */ import_react5.default.createElement(
|
|
383
|
+
AdminHeader,
|
|
384
384
|
{
|
|
385
385
|
title: name,
|
|
386
386
|
actions: /* @__PURE__ */ import_react5.default.createElement(import_react_router3.Link, { to: `${pathname}/new`, className: "button-primary" }, name, " \uCD94\uAC00")
|
|
387
|
+
}
|
|
388
|
+
), /* @__PURE__ */ import_react5.default.createElement("div", { className: "max-w-7xl mx-auto" }, searchKey && /* @__PURE__ */ import_react5.default.createElement(
|
|
389
|
+
"form",
|
|
390
|
+
{
|
|
391
|
+
className: "h-18 px-4 flex items-center border-t",
|
|
392
|
+
onSubmit: (e) => {
|
|
393
|
+
e.preventDefault();
|
|
394
|
+
const formData = new FormData(e.currentTarget);
|
|
395
|
+
const query = formData.get("query");
|
|
396
|
+
search(query);
|
|
397
|
+
}
|
|
387
398
|
},
|
|
388
|
-
searchKey && /* @__PURE__ */ import_react5.default.createElement(
|
|
389
|
-
"form",
|
|
390
|
-
{
|
|
391
|
-
className: "h-18 px-4 flex items-center border-t",
|
|
392
|
-
onSubmit: (e) => {
|
|
393
|
-
e.preventDefault();
|
|
394
|
-
const formData = new FormData(e.currentTarget);
|
|
395
|
-
const query = formData.get("query");
|
|
396
|
-
search(query);
|
|
397
|
-
}
|
|
398
|
-
},
|
|
399
|
-
/* @__PURE__ */ import_react5.default.createElement(
|
|
400
|
-
"button",
|
|
401
|
-
{
|
|
402
|
-
type: "submit",
|
|
403
|
-
className: "w-10 h-10 flex justify-center items-center"
|
|
404
|
-
},
|
|
405
|
-
/* @__PURE__ */ import_react5.default.createElement(GoSearch, { className: "text-xl mr-4" })
|
|
406
|
-
),
|
|
407
|
-
/* @__PURE__ */ import_react5.default.createElement(
|
|
408
|
-
"input",
|
|
409
|
-
{
|
|
410
|
-
className: "outline-none h-full flex-1",
|
|
411
|
-
placeholder: "\uC5EC\uAE30\uC5D0 \uAC80\uC0C9\uD558\uC138\uC694...",
|
|
412
|
-
name: "query",
|
|
413
|
-
defaultValue: searchParams.get("query") ?? ""
|
|
414
|
-
}
|
|
415
|
-
)
|
|
416
|
-
),
|
|
417
399
|
/* @__PURE__ */ import_react5.default.createElement(
|
|
418
|
-
|
|
400
|
+
"button",
|
|
419
401
|
{
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
offset,
|
|
425
|
-
orderBy,
|
|
426
|
-
direction
|
|
427
|
-
}
|
|
402
|
+
type: "submit",
|
|
403
|
+
className: "w-10 h-10 flex justify-center items-center"
|
|
404
|
+
},
|
|
405
|
+
/* @__PURE__ */ import_react5.default.createElement(GoSearch, { className: "text-xl mr-4" })
|
|
428
406
|
),
|
|
429
407
|
/* @__PURE__ */ import_react5.default.createElement(
|
|
430
|
-
|
|
408
|
+
"input",
|
|
431
409
|
{
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
410
|
+
className: "outline-none h-full flex-1",
|
|
411
|
+
placeholder: "\uC5EC\uAE30\uC5D0 \uAC80\uC0C9\uD558\uC138\uC694...",
|
|
412
|
+
name: "query",
|
|
413
|
+
defaultValue: searchParams.get("query") ?? ""
|
|
436
414
|
}
|
|
437
415
|
)
|
|
438
|
-
)
|
|
416
|
+
), /* @__PURE__ */ import_react5.default.createElement(
|
|
417
|
+
Table,
|
|
418
|
+
{
|
|
419
|
+
data: items,
|
|
420
|
+
columns,
|
|
421
|
+
getLink: primaryKey ? (item) => `${pathname}/${item[primaryKey]}` : void 0,
|
|
422
|
+
limit,
|
|
423
|
+
offset,
|
|
424
|
+
orderBy,
|
|
425
|
+
direction
|
|
426
|
+
}
|
|
427
|
+
), /* @__PURE__ */ import_react5.default.createElement(
|
|
428
|
+
TablePageButtons,
|
|
429
|
+
{
|
|
430
|
+
total,
|
|
431
|
+
limit,
|
|
432
|
+
offset,
|
|
433
|
+
MAX_PAGES_TO_SHOW: 10
|
|
434
|
+
}
|
|
435
|
+
)));
|
|
439
436
|
};
|
|
440
437
|
}
|
|
441
438
|
// Annotate the CommonJS export names for ESM import in node:
|
package/dist/table/page.mjs
CHANGED
|
@@ -338,7 +338,7 @@ function createTablePage({
|
|
|
338
338
|
primaryKey = "id"
|
|
339
339
|
}) {
|
|
340
340
|
return function TablePage({
|
|
341
|
-
|
|
341
|
+
AdminHeader
|
|
342
342
|
}) {
|
|
343
343
|
const { pathname } = useLocation2();
|
|
344
344
|
const { table } = useLoaderData();
|
|
@@ -351,63 +351,60 @@ function createTablePage({
|
|
|
351
351
|
navigate(`${pathname}?${searchParams2.toString()}`);
|
|
352
352
|
};
|
|
353
353
|
const [searchParams] = useSearchParams3();
|
|
354
|
-
return /* @__PURE__ */ React5.createElement(
|
|
355
|
-
|
|
354
|
+
return /* @__PURE__ */ React5.createElement(React5.Fragment, null, /* @__PURE__ */ React5.createElement(
|
|
355
|
+
AdminHeader,
|
|
356
356
|
{
|
|
357
357
|
title: name,
|
|
358
358
|
actions: /* @__PURE__ */ React5.createElement(Link3, { to: `${pathname}/new`, className: "button-primary" }, name, " \uCD94\uAC00")
|
|
359
|
+
}
|
|
360
|
+
), /* @__PURE__ */ React5.createElement("div", { className: "max-w-7xl mx-auto" }, searchKey && /* @__PURE__ */ React5.createElement(
|
|
361
|
+
"form",
|
|
362
|
+
{
|
|
363
|
+
className: "h-18 px-4 flex items-center border-t",
|
|
364
|
+
onSubmit: (e) => {
|
|
365
|
+
e.preventDefault();
|
|
366
|
+
const formData = new FormData(e.currentTarget);
|
|
367
|
+
const query = formData.get("query");
|
|
368
|
+
search(query);
|
|
369
|
+
}
|
|
359
370
|
},
|
|
360
|
-
searchKey && /* @__PURE__ */ React5.createElement(
|
|
361
|
-
"form",
|
|
362
|
-
{
|
|
363
|
-
className: "h-18 px-4 flex items-center border-t",
|
|
364
|
-
onSubmit: (e) => {
|
|
365
|
-
e.preventDefault();
|
|
366
|
-
const formData = new FormData(e.currentTarget);
|
|
367
|
-
const query = formData.get("query");
|
|
368
|
-
search(query);
|
|
369
|
-
}
|
|
370
|
-
},
|
|
371
|
-
/* @__PURE__ */ React5.createElement(
|
|
372
|
-
"button",
|
|
373
|
-
{
|
|
374
|
-
type: "submit",
|
|
375
|
-
className: "w-10 h-10 flex justify-center items-center"
|
|
376
|
-
},
|
|
377
|
-
/* @__PURE__ */ React5.createElement(GoSearch, { className: "text-xl mr-4" })
|
|
378
|
-
),
|
|
379
|
-
/* @__PURE__ */ React5.createElement(
|
|
380
|
-
"input",
|
|
381
|
-
{
|
|
382
|
-
className: "outline-none h-full flex-1",
|
|
383
|
-
placeholder: "\uC5EC\uAE30\uC5D0 \uAC80\uC0C9\uD558\uC138\uC694...",
|
|
384
|
-
name: "query",
|
|
385
|
-
defaultValue: searchParams.get("query") ?? ""
|
|
386
|
-
}
|
|
387
|
-
)
|
|
388
|
-
),
|
|
389
371
|
/* @__PURE__ */ React5.createElement(
|
|
390
|
-
|
|
372
|
+
"button",
|
|
391
373
|
{
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
offset,
|
|
397
|
-
orderBy,
|
|
398
|
-
direction
|
|
399
|
-
}
|
|
374
|
+
type: "submit",
|
|
375
|
+
className: "w-10 h-10 flex justify-center items-center"
|
|
376
|
+
},
|
|
377
|
+
/* @__PURE__ */ React5.createElement(GoSearch, { className: "text-xl mr-4" })
|
|
400
378
|
),
|
|
401
379
|
/* @__PURE__ */ React5.createElement(
|
|
402
|
-
|
|
380
|
+
"input",
|
|
403
381
|
{
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
382
|
+
className: "outline-none h-full flex-1",
|
|
383
|
+
placeholder: "\uC5EC\uAE30\uC5D0 \uAC80\uC0C9\uD558\uC138\uC694...",
|
|
384
|
+
name: "query",
|
|
385
|
+
defaultValue: searchParams.get("query") ?? ""
|
|
408
386
|
}
|
|
409
387
|
)
|
|
410
|
-
)
|
|
388
|
+
), /* @__PURE__ */ React5.createElement(
|
|
389
|
+
Table,
|
|
390
|
+
{
|
|
391
|
+
data: items,
|
|
392
|
+
columns,
|
|
393
|
+
getLink: primaryKey ? (item) => `${pathname}/${item[primaryKey]}` : void 0,
|
|
394
|
+
limit,
|
|
395
|
+
offset,
|
|
396
|
+
orderBy,
|
|
397
|
+
direction
|
|
398
|
+
}
|
|
399
|
+
), /* @__PURE__ */ React5.createElement(
|
|
400
|
+
TablePageButtons,
|
|
401
|
+
{
|
|
402
|
+
total,
|
|
403
|
+
limit,
|
|
404
|
+
offset,
|
|
405
|
+
MAX_PAGES_TO_SHOW: 10
|
|
406
|
+
}
|
|
407
|
+
)));
|
|
411
408
|
};
|
|
412
409
|
}
|
|
413
410
|
export {
|
package/dist/table/table.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default, { ReactNode } from 'react';
|
|
2
2
|
|
|
3
3
|
type TableColumnProps<T> = ReactNode | {
|
|
4
4
|
label: ReactNode;
|
|
@@ -8,10 +8,10 @@ type TableColumnProps<T> = ReactNode | {
|
|
|
8
8
|
type TableColumnOptions<T> = {
|
|
9
9
|
[key in string]?: TableColumnProps<T>;
|
|
10
10
|
};
|
|
11
|
-
type OrderedTableProps<T> =
|
|
11
|
+
type OrderedTableProps<T> = React__default.DetailedHTMLProps<React__default.TableHTMLAttributes<HTMLTableElement>, HTMLTableElement> & {
|
|
12
12
|
data: T[];
|
|
13
13
|
columns: TableColumnOptions<T>;
|
|
14
|
-
mapper?:
|
|
14
|
+
mapper?: React__default.FC<{
|
|
15
15
|
item: T;
|
|
16
16
|
index: number;
|
|
17
17
|
children: ReactNode;
|
|
@@ -22,6 +22,6 @@ type OrderedTableProps<T> = React.DetailedHTMLProps<React.TableHTMLAttributes<HT
|
|
|
22
22
|
orderBy?: string;
|
|
23
23
|
direction?: string;
|
|
24
24
|
};
|
|
25
|
-
declare function Table<T>({ className, data, columns, mapper: Mapper, getLink, limit, offset, orderBy, direction, }: OrderedTableProps<T>):
|
|
25
|
+
declare function Table<T>({ className, data, columns, mapper: Mapper, getLink, limit, offset, orderBy, direction, }: OrderedTableProps<T>): React__default.JSX.Element;
|
|
26
26
|
|
|
27
27
|
export { type OrderedTableProps, Table, type TableColumnOptions, type TableColumnProps };
|
package/dist/table/table.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default, { ReactNode } from 'react';
|
|
2
2
|
|
|
3
3
|
type TableColumnProps<T> = ReactNode | {
|
|
4
4
|
label: ReactNode;
|
|
@@ -8,10 +8,10 @@ type TableColumnProps<T> = ReactNode | {
|
|
|
8
8
|
type TableColumnOptions<T> = {
|
|
9
9
|
[key in string]?: TableColumnProps<T>;
|
|
10
10
|
};
|
|
11
|
-
type OrderedTableProps<T> =
|
|
11
|
+
type OrderedTableProps<T> = React__default.DetailedHTMLProps<React__default.TableHTMLAttributes<HTMLTableElement>, HTMLTableElement> & {
|
|
12
12
|
data: T[];
|
|
13
13
|
columns: TableColumnOptions<T>;
|
|
14
|
-
mapper?:
|
|
14
|
+
mapper?: React__default.FC<{
|
|
15
15
|
item: T;
|
|
16
16
|
index: number;
|
|
17
17
|
children: ReactNode;
|
|
@@ -22,6 +22,6 @@ type OrderedTableProps<T> = React.DetailedHTMLProps<React.TableHTMLAttributes<HT
|
|
|
22
22
|
orderBy?: string;
|
|
23
23
|
direction?: string;
|
|
24
24
|
};
|
|
25
|
-
declare function Table<T>({ className, data, columns, mapper: Mapper, getLink, limit, offset, orderBy, direction, }: OrderedTableProps<T>):
|
|
25
|
+
declare function Table<T>({ className, data, columns, mapper: Mapper, getLink, limit, offset, orderBy, direction, }: OrderedTableProps<T>): React__default.JSX.Element;
|
|
26
26
|
|
|
27
27
|
export { type OrderedTableProps, Table, type TableColumnOptions, type TableColumnProps };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dn-react-router-toolkit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"types": "./dist/index.d.ts",
|
|
5
5
|
"main": "./dist/index.mjs",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -49,6 +49,16 @@
|
|
|
49
49
|
"types": "./dist/crud/index.d.ts",
|
|
50
50
|
"import": "./dist/crud/index.mjs",
|
|
51
51
|
"require": "./dist/crud/index.js"
|
|
52
|
+
},
|
|
53
|
+
"./post": {
|
|
54
|
+
"types": "./dist/post/index.d.ts",
|
|
55
|
+
"import": "./dist/post/index.mjs",
|
|
56
|
+
"require": "./dist/post/index.js"
|
|
57
|
+
},
|
|
58
|
+
"./form": {
|
|
59
|
+
"types": "./dist/form/index.d.ts",
|
|
60
|
+
"import": "./dist/form/index.mjs",
|
|
61
|
+
"require": "./dist/form/index.js"
|
|
52
62
|
}
|
|
53
63
|
},
|
|
54
64
|
"scripts": {
|
|
@@ -76,11 +86,13 @@
|
|
|
76
86
|
},
|
|
77
87
|
"dependencies": {
|
|
78
88
|
"@react-router/dev": "^7.11.0",
|
|
89
|
+
"dn-react-text-editor": "^0.2.1",
|
|
90
|
+
"dn-react-toolkit": "^0.2.49",
|
|
79
91
|
"pg": "^8.16.3",
|
|
92
|
+
"react-store-input": "^0.1.5",
|
|
80
93
|
"uuid": "^13.0.0"
|
|
81
94
|
},
|
|
82
95
|
"peerDependencies": {
|
|
83
|
-
"dn-react-toolkit": "^0.2.43",
|
|
84
96
|
"drizzle-orm": "^0.45.1",
|
|
85
97
|
"react": "^19",
|
|
86
98
|
"react-dom": "^19",
|