dn-react-router-toolkit 0.8.1 → 0.9.1

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 (130) hide show
  1. package/dist/api/create_api_handler.d.mts +2 -2
  2. package/dist/api/create_api_handler.d.ts +2 -2
  3. package/dist/api/create_api_handler.js +55 -52
  4. package/dist/api/create_api_handler.mjs +61 -59
  5. package/dist/api/create_handler.d.mts +5 -5
  6. package/dist/api/create_handler.d.ts +5 -5
  7. package/dist/api/create_handler.js +41 -44
  8. package/dist/api/create_handler.mjs +41 -44
  9. package/dist/api/index.d.mts +4 -3
  10. package/dist/api/index.d.ts +4 -3
  11. package/dist/api/index.js +118 -102
  12. package/dist/api/index.mjs +130 -109
  13. package/dist/api/item_api_handler.d.mts +4 -3
  14. package/dist/api/item_api_handler.d.ts +4 -3
  15. package/dist/api/item_api_handler.js +22 -6
  16. package/dist/api/item_api_handler.mjs +28 -6
  17. package/dist/auth/cookie_manager.d.mts +1 -1
  18. package/dist/auth/cookie_manager.d.ts +1 -1
  19. package/dist/auth/index.d.mts +2 -2
  20. package/dist/auth/index.d.ts +2 -2
  21. package/dist/auth/index.js +18 -18
  22. package/dist/auth/index.mjs +18 -18
  23. package/dist/auth/with_auth.d.mts +2 -2
  24. package/dist/auth/with_auth.d.ts +2 -2
  25. package/dist/auth/with_auth.js +18 -18
  26. package/dist/auth/with_auth.mjs +18 -18
  27. package/dist/client/editor.d.mts +2 -2
  28. package/dist/client/editor.d.ts +2 -2
  29. package/dist/client/editor.js +9 -3
  30. package/dist/client/editor.mjs +9 -3
  31. package/dist/client/index.d.mts +2 -2
  32. package/dist/client/index.d.ts +2 -2
  33. package/dist/client/index.js +9 -3
  34. package/dist/client/index.mjs +9 -3
  35. package/dist/crud/crud_form.js +22 -4
  36. package/dist/crud/crud_form.mjs +11 -3
  37. package/dist/crud/crud_form_provider.js +16 -3
  38. package/dist/crud/crud_form_provider.mjs +14 -1
  39. package/dist/crud/index.d.mts +0 -20
  40. package/dist/crud/index.d.ts +0 -20
  41. package/dist/crud/index.js +32 -8589
  42. package/dist/crud/index.mjs +11 -8599
  43. package/dist/db/backup/index.d.mts +1 -1
  44. package/dist/db/backup/index.d.ts +1 -1
  45. package/dist/form/create_form_component.js +21 -2
  46. package/dist/form/create_form_component.mjs +10 -1
  47. package/dist/form/form_components.js +21 -2
  48. package/dist/form/form_components.mjs +10 -1
  49. package/dist/form/index.js +21 -2
  50. package/dist/form/index.mjs +10 -1
  51. package/dist/post/editor_toolbar.js +20 -3
  52. package/dist/post/editor_toolbar.mjs +9 -2
  53. package/dist/post/index.js +93 -7711
  54. package/dist/post/index.mjs +69 -7723
  55. package/dist/post/post_form_page.js +91 -7711
  56. package/dist/post/post_form_page.mjs +69 -7725
  57. package/dist/post/thumbnail_picker.js +21 -2
  58. package/dist/post/thumbnail_picker.mjs +10 -1
  59. package/dist/table/buttons.js +11 -14
  60. package/dist/table/buttons.mjs +10 -13
  61. package/dist/table/index.d.mts +0 -2
  62. package/dist/table/index.d.ts +0 -2
  63. package/dist/table/index.js +24 -95
  64. package/dist/table/index.mjs +23 -92
  65. package/dist/table/load_table.d.mts +1 -1
  66. package/dist/table/load_table.d.ts +1 -1
  67. package/dist/table/load_table.js +2 -2
  68. package/dist/table/load_table.mjs +2 -2
  69. package/dist/table/loader.js +2 -2
  70. package/dist/table/loader.mjs +2 -2
  71. package/dist/table/table.d.mts +2 -2
  72. package/dist/table/table.d.ts +2 -2
  73. package/dist/table/table.js +14 -25
  74. package/dist/table/table.mjs +11 -24
  75. package/dist/table/table_form.js +16 -39
  76. package/dist/table/table_form.mjs +15 -38
  77. package/dist/utils/cn.d.mts +3 -0
  78. package/dist/utils/cn.d.ts +3 -0
  79. package/dist/utils/cn.js +32 -0
  80. package/dist/utils/cn.mjs +7 -0
  81. package/dist/utils/date.d.mts +5 -0
  82. package/dist/utils/date.d.ts +5 -0
  83. package/dist/utils/date.js +65 -0
  84. package/dist/utils/date.mjs +29 -0
  85. package/dist/utils/index.d.mts +7 -0
  86. package/dist/utils/index.d.ts +7 -0
  87. package/dist/utils/index.js +116 -0
  88. package/dist/utils/index.mjs +73 -0
  89. package/dist/utils/korean.d.mts +6 -0
  90. package/dist/utils/korean.d.ts +6 -0
  91. package/dist/{crud/generate_pages.js → utils/korean.js} +16 -30
  92. package/dist/utils/korean.mjs +16 -0
  93. package/dist/utils/singleton.d.mts +3 -0
  94. package/dist/utils/singleton.d.ts +3 -0
  95. package/dist/utils/singleton.js +37 -0
  96. package/dist/utils/singleton.mjs +12 -0
  97. package/dist/utils/sleep.d.mts +3 -0
  98. package/dist/utils/sleep.d.ts +3 -0
  99. package/dist/{table/item_loader.js → utils/sleep.js} +8 -19
  100. package/dist/utils/sleep.mjs +7 -0
  101. package/dist/utils/slug.d.mts +3 -0
  102. package/dist/utils/slug.d.ts +3 -0
  103. package/dist/{crud/generate_handlers.js → utils/slug.js} +8 -15
  104. package/dist/utils/slug.mjs +7 -0
  105. package/package.json +7 -3
  106. package/dist/crud/crud_loader.d.mts +0 -26
  107. package/dist/crud/crud_loader.d.ts +0 -26
  108. package/dist/crud/crud_loader.js +0 -351
  109. package/dist/crud/crud_loader.mjs +0 -337
  110. package/dist/crud/crud_page.d.mts +0 -32
  111. package/dist/crud/crud_page.d.ts +0 -32
  112. package/dist/crud/crud_page.js +0 -776
  113. package/dist/crud/crud_page.mjs +0 -758
  114. package/dist/crud/generate_handlers.d.mts +0 -16
  115. package/dist/crud/generate_handlers.d.ts +0 -16
  116. package/dist/crud/generate_handlers.mjs +0 -14
  117. package/dist/crud/generate_pages.d.mts +0 -19
  118. package/dist/crud/generate_pages.d.ts +0 -19
  119. package/dist/crud/generate_pages.mjs +0 -30
  120. package/dist/crud/generate_routes.d.mts +0 -5
  121. package/dist/crud/generate_routes.d.ts +0 -5
  122. package/dist/crud/generate_routes.js +0 -7639
  123. package/dist/crud/generate_routes.mjs +0 -7627
  124. package/dist/table/item_loader.d.mts +0 -14
  125. package/dist/table/item_loader.d.ts +0 -14
  126. package/dist/table/item_loader.mjs +0 -18
  127. package/dist/table/page.d.mts +0 -16
  128. package/dist/table/page.d.ts +0 -16
  129. package/dist/table/page.js +0 -375
  130. package/dist/table/page.mjs +0 -350
@@ -4,7 +4,7 @@ import { TableRepository, ColumnOf } from './repository.mjs';
4
4
  import 'drizzle-orm/node-postgres';
5
5
 
6
6
  type TableOptions<T extends PgTableWithColumns<any>> = {
7
- where?: SQLWrapper[];
7
+ where?: SQLWrapper;
8
8
  searchKey?: ColumnOf<T>;
9
9
  defaultOrderBy: keyof InferSelectModel<T>;
10
10
  defaultDirection: "asc" | "desc";
@@ -4,7 +4,7 @@ import { TableRepository, ColumnOf } from './repository.js';
4
4
  import 'drizzle-orm/node-postgres';
5
5
 
6
6
  type TableOptions<T extends PgTableWithColumns<any>> = {
7
- where?: SQLWrapper[];
7
+ where?: SQLWrapper;
8
8
  searchKey?: ColumnOf<T>;
9
9
  defaultOrderBy: keyof InferSelectModel<T>;
10
10
  defaultDirection: "asc" | "desc";
@@ -32,7 +32,7 @@ async function loadTable({
32
32
  const searchParams = new URL(request.url).searchParams;
33
33
  const { where, searchKey, defaultOrderBy, defaultDirection } = options;
34
34
  const query = searchParams.get("query") ?? void 0;
35
- const limit = Number(searchParams.get("limit") ?? "20");
35
+ const limit = Number(searchParams.get("limit") ?? "10");
36
36
  const offset = Number(searchParams.get("offset") ?? "0");
37
37
  const orderBy = searchParams.get("orderBy") ?? defaultOrderBy;
38
38
  const direction = searchParams.get("direction") ?? defaultDirection;
@@ -52,7 +52,7 @@ async function loadTable({
52
52
  `%${query}%`
53
53
  ) : void 0,
54
54
  ...filterWhere,
55
- ...where ?? []
55
+ where
56
56
  );
57
57
  const total = await repository.countTotal({ where: whereClauses });
58
58
  const items = await repository.findAll({
@@ -12,7 +12,7 @@ async function loadTable({
12
12
  const searchParams = new URL(request.url).searchParams;
13
13
  const { where, searchKey, defaultOrderBy, defaultDirection } = options;
14
14
  const query = searchParams.get("query") ?? void 0;
15
- const limit = Number(searchParams.get("limit") ?? "20");
15
+ const limit = Number(searchParams.get("limit") ?? "10");
16
16
  const offset = Number(searchParams.get("offset") ?? "0");
17
17
  const orderBy = searchParams.get("orderBy") ?? defaultOrderBy;
18
18
  const direction = searchParams.get("direction") ?? defaultDirection;
@@ -32,7 +32,7 @@ async function loadTable({
32
32
  `%${query}%`
33
33
  ) : void 0,
34
34
  ...filterWhere,
35
- ...where ?? []
35
+ where
36
36
  );
37
37
  const total = await repository.countTotal({ where: whereClauses });
38
38
  const items = await repository.findAll({
@@ -34,7 +34,7 @@ async function loadTable({
34
34
  const searchParams = new URL(request.url).searchParams;
35
35
  const { where, searchKey, defaultOrderBy, defaultDirection } = options;
36
36
  const query = searchParams.get("query") ?? void 0;
37
- const limit = Number(searchParams.get("limit") ?? "20");
37
+ const limit = Number(searchParams.get("limit") ?? "10");
38
38
  const offset = Number(searchParams.get("offset") ?? "0");
39
39
  const orderBy = searchParams.get("orderBy") ?? defaultOrderBy;
40
40
  const direction = searchParams.get("direction") ?? defaultDirection;
@@ -54,7 +54,7 @@ async function loadTable({
54
54
  `%${query}%`
55
55
  ) : void 0,
56
56
  ...filterWhere,
57
- ...where ?? []
57
+ where
58
58
  );
59
59
  const total = await repository.countTotal({ where: whereClauses });
60
60
  const items = await repository.findAll({
@@ -12,7 +12,7 @@ async function loadTable({
12
12
  const searchParams = new URL(request.url).searchParams;
13
13
  const { where, searchKey, defaultOrderBy, defaultDirection } = options;
14
14
  const query = searchParams.get("query") ?? void 0;
15
- const limit = Number(searchParams.get("limit") ?? "20");
15
+ const limit = Number(searchParams.get("limit") ?? "10");
16
16
  const offset = Number(searchParams.get("offset") ?? "0");
17
17
  const orderBy = searchParams.get("orderBy") ?? defaultOrderBy;
18
18
  const direction = searchParams.get("direction") ?? defaultDirection;
@@ -32,7 +32,7 @@ async function loadTable({
32
32
  `%${query}%`
33
33
  ) : void 0,
34
34
  ...filterWhere,
35
- ...where ?? []
35
+ where
36
36
  );
37
37
  const total = await repository.countTotal({ where: whereClauses });
38
38
  const items = await repository.findAll({
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { ReactNode, DetailedHTMLProps, TableHTMLAttributes, FC } from 'react';
2
+ import { DetailedHTMLProps, TableHTMLAttributes, ReactNode, FC } from 'react';
3
3
 
4
4
  type TableColumnProps<T> = ReactNode | {
5
5
  label: ReactNode;
@@ -22,7 +22,7 @@ type OrderedTableProps<T> = DetailedHTMLProps<TableHTMLAttributes<HTMLTableEleme
22
22
  offset?: number;
23
23
  orderBy?: string;
24
24
  direction?: string;
25
- filters: {
25
+ filters?: {
26
26
  [key: string]: unknown[];
27
27
  };
28
28
  };
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { ReactNode, DetailedHTMLProps, TableHTMLAttributes, FC } from 'react';
2
+ import { DetailedHTMLProps, TableHTMLAttributes, ReactNode, FC } from 'react';
3
3
 
4
4
  type TableColumnProps<T> = ReactNode | {
5
5
  label: ReactNode;
@@ -22,7 +22,7 @@ type OrderedTableProps<T> = DetailedHTMLProps<TableHTMLAttributes<HTMLTableEleme
22
22
  offset?: number;
23
23
  orderBy?: string;
24
24
  direction?: string;
25
- filters: {
25
+ filters?: {
26
26
  [key: string]: unknown[];
27
27
  };
28
28
  };
@@ -23,7 +23,13 @@ __export(table_exports, {
23
23
  Table: () => Table
24
24
  });
25
25
  module.exports = __toCommonJS(table_exports);
26
- var import_utils = require("dn-react-toolkit/utils");
26
+
27
+ // src/utils/cn.ts
28
+ function cn(...classes) {
29
+ return classes.filter(Boolean).join(" ").trim();
30
+ }
31
+
32
+ // src/table/table.tsx
27
33
  var import_go = require("react-icons/go");
28
34
  var import_react_router = require("react-router");
29
35
  var import_jsx_runtime = require("react/jsx-runtime");
@@ -45,10 +51,7 @@ function Table({
45
51
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
46
52
  "table",
47
53
  {
48
- className: (0, import_utils.cn)(
49
- className,
50
- "text-[15px] border-separate border-spacing-0"
51
- ),
54
+ className: cn(className, "text-[15px] border-separate border-spacing-0"),
52
55
  children: [
53
56
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("tr", { children: keys.map((key) => {
54
57
  const value = columns[key];
@@ -64,7 +67,7 @@ function Table({
64
67
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
65
68
  "button",
66
69
  {
67
- className: (0, import_utils.cn)(
70
+ className: cn(
68
71
  orderBy === key ? "text-gray-900 font-medium" : "text-gray-500 font-medium",
69
72
  "px-4 flex items-center w-full"
70
73
  ),
@@ -87,13 +90,11 @@ function Table({
87
90
  }
88
91
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: reactNode });
89
92
  }
90
- const filter = filters[key];
93
+ const filter = filters?.[key];
91
94
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
92
95
  "th",
93
96
  {
94
- className: (0, import_utils.cn)(
95
- "py-4 border-y font-normal align-top"
96
- ),
97
+ className: cn("py-4 border-y font-normal align-top"),
97
98
  children: [
98
99
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Head, {}),
99
100
  filter && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "px-3 mt-4", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
@@ -104,12 +105,7 @@ function Table({
104
105
  const value2 = e.target.value;
105
106
  setSearchParams((prev) => {
106
107
  if (value2) {
107
- prev.set(
108
- key,
109
- encodeURIComponent(
110
- value2
111
- )
112
- );
108
+ prev.set(key, encodeURIComponent(value2));
113
109
  } else {
114
110
  prev.delete(key);
115
111
  }
@@ -118,14 +114,7 @@ function Table({
118
114
  },
119
115
  children: [
120
116
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { value: "", children: "\uC804\uCCB4" }),
121
- filter.map((option) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
122
- "option",
123
- {
124
- value: option,
125
- children: option
126
- },
127
- option
128
- ))
117
+ filter.map((option) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { value: option, children: option }, option))
129
118
  ]
130
119
  }
131
120
  ) })
@@ -164,7 +153,7 @@ function Table({
164
153
  className: "block content-center px-4 w-full h-full",
165
154
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Content, {})
166
155
  }
167
- ) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Content, {});
156
+ ) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "px-4 w-full h-full content-center", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Content, {}) });
168
157
  const cell = Mapper ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Mapper, { item, index: i2, children: linkedContent }) : linkedContent;
169
158
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("td", { className: "px-0 h-14 border-b", children: cell }, key);
170
159
  }) }, i))
@@ -1,5 +1,9 @@
1
+ // src/utils/cn.ts
2
+ function cn(...classes) {
3
+ return classes.filter(Boolean).join(" ").trim();
4
+ }
5
+
1
6
  // src/table/table.tsx
2
- import { cn } from "dn-react-toolkit/utils";
3
7
  import { GoArrowDown, GoArrowUp } from "react-icons/go";
4
8
  import { Link, useSearchParams } from "react-router";
5
9
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
@@ -21,10 +25,7 @@ function Table({
21
25
  return /* @__PURE__ */ jsxs(
22
26
  "table",
23
27
  {
24
- className: cn(
25
- className,
26
- "text-[15px] border-separate border-spacing-0"
27
- ),
28
+ className: cn(className, "text-[15px] border-separate border-spacing-0"),
28
29
  children: [
29
30
  /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsx("tr", { children: keys.map((key) => {
30
31
  const value = columns[key];
@@ -63,13 +64,11 @@ function Table({
63
64
  }
64
65
  return /* @__PURE__ */ jsx(Fragment, { children: reactNode });
65
66
  }
66
- const filter = filters[key];
67
+ const filter = filters?.[key];
67
68
  return /* @__PURE__ */ jsxs(
68
69
  "th",
69
70
  {
70
- className: cn(
71
- "py-4 border-y font-normal align-top"
72
- ),
71
+ className: cn("py-4 border-y font-normal align-top"),
73
72
  children: [
74
73
  /* @__PURE__ */ jsx(Head, {}),
75
74
  filter && /* @__PURE__ */ jsx("div", { className: "px-3 mt-4", children: /* @__PURE__ */ jsxs(
@@ -80,12 +79,7 @@ function Table({
80
79
  const value2 = e.target.value;
81
80
  setSearchParams((prev) => {
82
81
  if (value2) {
83
- prev.set(
84
- key,
85
- encodeURIComponent(
86
- value2
87
- )
88
- );
82
+ prev.set(key, encodeURIComponent(value2));
89
83
  } else {
90
84
  prev.delete(key);
91
85
  }
@@ -94,14 +88,7 @@ function Table({
94
88
  },
95
89
  children: [
96
90
  /* @__PURE__ */ jsx("option", { value: "", children: "\uC804\uCCB4" }),
97
- filter.map((option) => /* @__PURE__ */ jsx(
98
- "option",
99
- {
100
- value: option,
101
- children: option
102
- },
103
- option
104
- ))
91
+ filter.map((option) => /* @__PURE__ */ jsx("option", { value: option, children: option }, option))
105
92
  ]
106
93
  }
107
94
  ) })
@@ -140,7 +127,7 @@ function Table({
140
127
  className: "block content-center px-4 w-full h-full",
141
128
  children: /* @__PURE__ */ jsx(Content, {})
142
129
  }
143
- ) : /* @__PURE__ */ jsx(Content, {});
130
+ ) : /* @__PURE__ */ jsx("div", { className: "px-4 w-full h-full content-center", children: /* @__PURE__ */ jsx(Content, {}) });
144
131
  const cell = Mapper ? /* @__PURE__ */ jsx(Mapper, { item, index: i2, children: linkedContent }) : linkedContent;
145
132
  return /* @__PURE__ */ jsx("td", { className: "px-0 h-14 border-b", children: cell }, key);
146
133
  }) }, i))
@@ -26,8 +26,12 @@ module.exports = __toCommonJS(table_form_exports);
26
26
  var import_react_router4 = require("react-router");
27
27
  var import_go2 = require("react-icons/go");
28
28
 
29
+ // src/utils/cn.ts
30
+ function cn(...classes) {
31
+ return classes.filter(Boolean).join(" ").trim();
32
+ }
33
+
29
34
  // src/table/table.tsx
30
- var import_utils = require("dn-react-toolkit/utils");
31
35
  var import_go = require("react-icons/go");
32
36
  var import_react_router = require("react-router");
33
37
  var import_jsx_runtime = require("react/jsx-runtime");
@@ -49,10 +53,7 @@ function Table({
49
53
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
50
54
  "table",
51
55
  {
52
- className: (0, import_utils.cn)(
53
- className,
54
- "text-[15px] border-separate border-spacing-0"
55
- ),
56
+ className: cn(className, "text-[15px] border-separate border-spacing-0"),
56
57
  children: [
57
58
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("tr", { children: keys.map((key) => {
58
59
  const value = columns[key];
@@ -68,7 +69,7 @@ function Table({
68
69
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
69
70
  "button",
70
71
  {
71
- className: (0, import_utils.cn)(
72
+ className: cn(
72
73
  orderBy === key ? "text-gray-900 font-medium" : "text-gray-500 font-medium",
73
74
  "px-4 flex items-center w-full"
74
75
  ),
@@ -91,13 +92,11 @@ function Table({
91
92
  }
92
93
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: reactNode });
93
94
  }
94
- const filter = filters[key];
95
+ const filter = filters?.[key];
95
96
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
96
97
  "th",
97
98
  {
98
- className: (0, import_utils.cn)(
99
- "py-4 border-y font-normal align-top"
100
- ),
99
+ className: cn("py-4 border-y font-normal align-top"),
101
100
  children: [
102
101
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Head, {}),
103
102
  filter && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "px-3 mt-4", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
@@ -108,12 +107,7 @@ function Table({
108
107
  const value2 = e.target.value;
109
108
  setSearchParams((prev) => {
110
109
  if (value2) {
111
- prev.set(
112
- key,
113
- encodeURIComponent(
114
- value2
115
- )
116
- );
110
+ prev.set(key, encodeURIComponent(value2));
117
111
  } else {
118
112
  prev.delete(key);
119
113
  }
@@ -122,14 +116,7 @@ function Table({
122
116
  },
123
117
  children: [
124
118
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { value: "", children: "\uC804\uCCB4" }),
125
- filter.map((option) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
126
- "option",
127
- {
128
- value: option,
129
- children: option
130
- },
131
- option
132
- ))
119
+ filter.map((option) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { value: option, children: option }, option))
133
120
  ]
134
121
  }
135
122
  ) })
@@ -168,7 +155,7 @@ function Table({
168
155
  className: "block content-center px-4 w-full h-full",
169
156
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Content, {})
170
157
  }
171
- ) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Content, {});
158
+ ) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "px-4 w-full h-full content-center", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Content, {}) });
172
159
  const cell = Mapper ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Mapper, { item, index: i2, children: linkedContent }) : linkedContent;
173
160
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("td", { className: "px-0 h-14 border-b", children: cell }, key);
174
161
  }) }, i))
@@ -186,7 +173,6 @@ function useTable() {
186
173
  }
187
174
 
188
175
  // src/table/buttons.tsx
189
- var import_utils2 = require("dn-react-toolkit/utils");
190
176
  var import_react_router3 = require("react-router");
191
177
  var import_jsx_runtime2 = require("react/jsx-runtime");
192
178
  function TablePageButtons({
@@ -206,10 +192,7 @@ function TablePageButtons({
206
192
  import_react_router3.Link,
207
193
  {
208
194
  to: (() => {
209
- searchParams.set(
210
- "offset",
211
- String((startButton - 1) * limit)
212
- );
195
+ searchParams.set("offset", String((startButton - 1) * limit));
213
196
  return `${pathname}?${searchParams.toString()}`;
214
197
  })(),
215
198
  className: "w-10 block text-center transition-colors hover:text-primary",
@@ -217,10 +200,7 @@ function TablePageButtons({
217
200
  }
218
201
  ),
219
202
  Array.from({
220
- length: Math.min(
221
- MAX_PAGES_TO_SHOW,
222
- pages - startButton
223
- )
203
+ length: Math.min(MAX_PAGES_TO_SHOW, pages - startButton)
224
204
  }).map((_, index) => {
225
205
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
226
206
  import_react_router3.Link,
@@ -232,7 +212,7 @@ function TablePageButtons({
232
212
  );
233
213
  return `${pathname}?${searchParams.toString()}`;
234
214
  })(),
235
- className: (0, import_utils2.cn)(
215
+ className: cn(
236
216
  "w-6 block text-center transition-colors",
237
217
  currentPage === startButton + index + 1 ? "font-bold text-primary" : "hover:text-primary"
238
218
  ),
@@ -245,10 +225,7 @@ function TablePageButtons({
245
225
  import_react_router3.Link,
246
226
  {
247
227
  to: (() => {
248
- searchParams.set(
249
- "offset",
250
- String((endButton + 1) * limit)
251
- );
228
+ searchParams.set("offset", String((endButton + 1) * limit));
252
229
  return `${pathname}?${searchParams.toString()}`;
253
230
  })(),
254
231
  className: "w-10 block text-center transition-colors hover:text-primary",
@@ -2,8 +2,12 @@
2
2
  import { useLocation as useLocation2, useNavigate, useSearchParams as useSearchParams3 } from "react-router";
3
3
  import { GoSearch } from "react-icons/go";
4
4
 
5
+ // src/utils/cn.ts
6
+ function cn(...classes) {
7
+ return classes.filter(Boolean).join(" ").trim();
8
+ }
9
+
5
10
  // src/table/table.tsx
6
- import { cn } from "dn-react-toolkit/utils";
7
11
  import { GoArrowDown, GoArrowUp } from "react-icons/go";
8
12
  import { Link, useSearchParams } from "react-router";
9
13
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
@@ -25,10 +29,7 @@ function Table({
25
29
  return /* @__PURE__ */ jsxs(
26
30
  "table",
27
31
  {
28
- className: cn(
29
- className,
30
- "text-[15px] border-separate border-spacing-0"
31
- ),
32
+ className: cn(className, "text-[15px] border-separate border-spacing-0"),
32
33
  children: [
33
34
  /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsx("tr", { children: keys.map((key) => {
34
35
  const value = columns[key];
@@ -67,13 +68,11 @@ function Table({
67
68
  }
68
69
  return /* @__PURE__ */ jsx(Fragment, { children: reactNode });
69
70
  }
70
- const filter = filters[key];
71
+ const filter = filters?.[key];
71
72
  return /* @__PURE__ */ jsxs(
72
73
  "th",
73
74
  {
74
- className: cn(
75
- "py-4 border-y font-normal align-top"
76
- ),
75
+ className: cn("py-4 border-y font-normal align-top"),
77
76
  children: [
78
77
  /* @__PURE__ */ jsx(Head, {}),
79
78
  filter && /* @__PURE__ */ jsx("div", { className: "px-3 mt-4", children: /* @__PURE__ */ jsxs(
@@ -84,12 +83,7 @@ function Table({
84
83
  const value2 = e.target.value;
85
84
  setSearchParams((prev) => {
86
85
  if (value2) {
87
- prev.set(
88
- key,
89
- encodeURIComponent(
90
- value2
91
- )
92
- );
86
+ prev.set(key, encodeURIComponent(value2));
93
87
  } else {
94
88
  prev.delete(key);
95
89
  }
@@ -98,14 +92,7 @@ function Table({
98
92
  },
99
93
  children: [
100
94
  /* @__PURE__ */ jsx("option", { value: "", children: "\uC804\uCCB4" }),
101
- filter.map((option) => /* @__PURE__ */ jsx(
102
- "option",
103
- {
104
- value: option,
105
- children: option
106
- },
107
- option
108
- ))
95
+ filter.map((option) => /* @__PURE__ */ jsx("option", { value: option, children: option }, option))
109
96
  ]
110
97
  }
111
98
  ) })
@@ -144,7 +131,7 @@ function Table({
144
131
  className: "block content-center px-4 w-full h-full",
145
132
  children: /* @__PURE__ */ jsx(Content, {})
146
133
  }
147
- ) : /* @__PURE__ */ jsx(Content, {});
134
+ ) : /* @__PURE__ */ jsx("div", { className: "px-4 w-full h-full content-center", children: /* @__PURE__ */ jsx(Content, {}) });
148
135
  const cell = Mapper ? /* @__PURE__ */ jsx(Mapper, { item, index: i2, children: linkedContent }) : linkedContent;
149
136
  return /* @__PURE__ */ jsx("td", { className: "px-0 h-14 border-b", children: cell }, key);
150
137
  }) }, i))
@@ -162,7 +149,6 @@ function useTable() {
162
149
  }
163
150
 
164
151
  // src/table/buttons.tsx
165
- import { cn as cn2 } from "dn-react-toolkit/utils";
166
152
  import { Link as Link2, useLocation, useSearchParams as useSearchParams2 } from "react-router";
167
153
  import { Fragment as Fragment2, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
168
154
  function TablePageButtons({
@@ -182,10 +168,7 @@ function TablePageButtons({
182
168
  Link2,
183
169
  {
184
170
  to: (() => {
185
- searchParams.set(
186
- "offset",
187
- String((startButton - 1) * limit)
188
- );
171
+ searchParams.set("offset", String((startButton - 1) * limit));
189
172
  return `${pathname}?${searchParams.toString()}`;
190
173
  })(),
191
174
  className: "w-10 block text-center transition-colors hover:text-primary",
@@ -193,10 +176,7 @@ function TablePageButtons({
193
176
  }
194
177
  ),
195
178
  Array.from({
196
- length: Math.min(
197
- MAX_PAGES_TO_SHOW,
198
- pages - startButton
199
- )
179
+ length: Math.min(MAX_PAGES_TO_SHOW, pages - startButton)
200
180
  }).map((_, index) => {
201
181
  return /* @__PURE__ */ jsx2(
202
182
  Link2,
@@ -208,7 +188,7 @@ function TablePageButtons({
208
188
  );
209
189
  return `${pathname}?${searchParams.toString()}`;
210
190
  })(),
211
- className: cn2(
191
+ className: cn(
212
192
  "w-6 block text-center transition-colors",
213
193
  currentPage === startButton + index + 1 ? "font-bold text-primary" : "hover:text-primary"
214
194
  ),
@@ -221,10 +201,7 @@ function TablePageButtons({
221
201
  Link2,
222
202
  {
223
203
  to: (() => {
224
- searchParams.set(
225
- "offset",
226
- String((endButton + 1) * limit)
227
- );
204
+ searchParams.set("offset", String((endButton + 1) * limit));
228
205
  return `${pathname}?${searchParams.toString()}`;
229
206
  })(),
230
207
  className: "w-10 block text-center transition-colors hover:text-primary",
@@ -0,0 +1,3 @@
1
+ declare function cn(...classes: (string | false | undefined)[]): string;
2
+
3
+ export { cn };
@@ -0,0 +1,3 @@
1
+ declare function cn(...classes: (string | false | undefined)[]): string;
2
+
3
+ export { cn };
@@ -0,0 +1,32 @@
1
+ "use strict";
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
+
20
+ // src/utils/cn.ts
21
+ var cn_exports = {};
22
+ __export(cn_exports, {
23
+ cn: () => cn
24
+ });
25
+ module.exports = __toCommonJS(cn_exports);
26
+ function cn(...classes) {
27
+ return classes.filter(Boolean).join(" ").trim();
28
+ }
29
+ // Annotate the CommonJS export names for ESM import in node:
30
+ 0 && (module.exports = {
31
+ cn
32
+ });
@@ -0,0 +1,7 @@
1
+ // src/utils/cn.ts
2
+ function cn(...classes) {
3
+ return classes.filter(Boolean).join(" ").trim();
4
+ }
5
+ export {
6
+ cn
7
+ };
@@ -0,0 +1,5 @@
1
+ export { default as moment } from 'moment-timezone';
2
+
3
+ declare const formatHumanDateTime: (value: string | Date) => string;
4
+
5
+ export { formatHumanDateTime };
@@ -0,0 +1,5 @@
1
+ export { default as moment } from 'moment-timezone';
2
+
3
+ declare const formatHumanDateTime: (value: string | Date) => string;
4
+
5
+ export { formatHumanDateTime };