@deepnoid/ui 0.1.79 → 0.1.81

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 (37) hide show
  1. package/.turbo/turbo-build.log +145 -147
  2. package/dist/{chunk-RSGTFDZ5.mjs → chunk-7Q2WQJ6U.mjs} +2 -2
  3. package/dist/{chunk-YF2N2OBY.mjs → chunk-L65ETSUY.mjs} +1 -1
  4. package/dist/{chunk-AX3D6VFT.mjs → chunk-LNVDBHVI.mjs} +186 -14
  5. package/dist/{chunk-SPIJ6ECD.mjs → chunk-OKO3XRJS.mjs} +1 -1
  6. package/dist/components/breadcrumb/breadcrumb.mjs +3 -3
  7. package/dist/components/breadcrumb/index.mjs +3 -3
  8. package/dist/components/button/button.mjs +2 -2
  9. package/dist/components/button/icon-button.mjs +2 -2
  10. package/dist/components/button/index.mjs +3 -3
  11. package/dist/components/dateTimePicker/dateTimePicker.mjs +3 -3
  12. package/dist/components/dateTimePicker/index.mjs +3 -3
  13. package/dist/components/dateTimePicker/timePicker.mjs +2 -2
  14. package/dist/components/fileUpload/fileUpload.mjs +4 -4
  15. package/dist/components/fileUpload/index.mjs +4 -4
  16. package/dist/components/list/index.mjs +3 -3
  17. package/dist/components/modal/index.mjs +4 -4
  18. package/dist/components/modal/modal.mjs +4 -4
  19. package/dist/components/ripple/index.mjs +3 -3
  20. package/dist/components/table/index.js +34 -27
  21. package/dist/components/table/index.mjs +3 -5
  22. package/dist/components/table/table-body.js +5783 -54
  23. package/dist/components/table/table-body.mjs +11 -1
  24. package/dist/components/table/table-head.js +5810 -45
  25. package/dist/components/table/table-head.mjs +11 -1
  26. package/dist/components/table/table.d.mts +3 -2
  27. package/dist/components/table/table.d.ts +3 -2
  28. package/dist/components/table/table.js +40 -28
  29. package/dist/components/table/table.mjs +6 -6
  30. package/dist/index.js +34 -27
  31. package/dist/index.mjs +28 -30
  32. package/package.json +1 -1
  33. package/dist/chunk-D5N7OBSO.mjs +0 -76
  34. package/dist/chunk-SIVCIIB6.mjs +0 -112
  35. package/dist/{chunk-PQRAYOTJ.mjs → chunk-PDY7UYKZ.mjs} +3 -3
  36. package/dist/{chunk-Q7J5FAMH.mjs → chunk-RN76ARTS.mjs} +3 -3
  37. package/dist/{chunk-WYHCK7XL.mjs → chunk-ZYS4NSXT.mjs} +3 -3
@@ -1,11 +1,21 @@
1
1
  "use client";
2
2
  import {
3
3
  table_head_default
4
- } from "../../chunk-D5N7OBSO.mjs";
4
+ } from "../../chunk-LNVDBHVI.mjs";
5
5
  import "../../chunk-MZ76AA76.mjs";
6
6
  import "../../chunk-6PN3DGOE.mjs";
7
+ import "../../chunk-7B7LRG5J.mjs";
8
+ import "../../chunk-CC2F5HQX.mjs";
9
+ import "../../chunk-F3HENRVM.mjs";
10
+ import "../../chunk-DQRAFUDA.mjs";
11
+ import "../../chunk-M37VBNB3.mjs";
12
+ import "../../chunk-2GCSFWHD.mjs";
13
+ import "../../chunk-5M7UDEMG.mjs";
7
14
  import "../../chunk-QZ3LVYJW.mjs";
8
15
  import "../../chunk-SKOCUCE5.mjs";
16
+ import "../../chunk-ZYIIXWVY.mjs";
17
+ import "../../chunk-JP4TEWP7.mjs";
18
+ import "../../chunk-RRONV7YA.mjs";
9
19
  import "../../chunk-XOPCRI7Z.mjs";
10
20
  import "../../chunk-27Y6K5NK.mjs";
11
21
  import "../../chunk-E3G5QXSH.mjs";
@@ -1,7 +1,7 @@
1
1
  import * as tailwind_variants from 'tailwind-variants';
2
2
  import { VariantProps } from 'tailwind-variants';
3
3
  import * as react from 'react';
4
- import { ComponentPropsWithRef, ReactElement, ReactNode } from 'react';
4
+ import { ComponentPropsWithRef, ReactElement, ReactNode, CSSProperties } from 'react';
5
5
  import { SlotsToClasses } from '../../utils/types.mjs';
6
6
 
7
7
  interface TableBaseProps extends Omit<ComponentPropsWithRef<"table">, "ref" | "color" | "slot" | "size" | "height" | "defaultChecked" | "defaultValue"> {
@@ -189,6 +189,7 @@ declare const tableStyle: tailwind_variants.TVReturnType<{
189
189
  td: string[];
190
190
  empty: string[];
191
191
  }, undefined, unknown, unknown, undefined>>;
192
+ declare const getCellStyle: (column: TableColumn) => CSSProperties;
192
193
  type TableVariantProps = VariantProps<typeof tableStyle>;
193
194
  type TableSlots = keyof ReturnType<typeof tableStyle>;
194
195
  type TableReturnType = ReturnType<typeof tableStyle>;
@@ -220,4 +221,4 @@ type ValueFormatterParams<V = any> = {
220
221
  value: V;
221
222
  };
222
223
 
223
- export { type TableColumn, type TableRef, type TableReturnType, type TableRow, type TableSlots, type TableVariantProps, Table as default };
224
+ export { type TableColumn, type TableRef, type TableReturnType, type TableRow, type TableSlots, type TableVariantProps, Table as default, getCellStyle };
@@ -1,7 +1,7 @@
1
1
  import * as tailwind_variants from 'tailwind-variants';
2
2
  import { VariantProps } from 'tailwind-variants';
3
3
  import * as react from 'react';
4
- import { ComponentPropsWithRef, ReactElement, ReactNode } from 'react';
4
+ import { ComponentPropsWithRef, ReactElement, ReactNode, CSSProperties } from 'react';
5
5
  import { SlotsToClasses } from '../../utils/types.js';
6
6
 
7
7
  interface TableBaseProps extends Omit<ComponentPropsWithRef<"table">, "ref" | "color" | "slot" | "size" | "height" | "defaultChecked" | "defaultValue"> {
@@ -189,6 +189,7 @@ declare const tableStyle: tailwind_variants.TVReturnType<{
189
189
  td: string[];
190
190
  empty: string[];
191
191
  }, undefined, unknown, unknown, undefined>>;
192
+ declare const getCellStyle: (column: TableColumn) => CSSProperties;
192
193
  type TableVariantProps = VariantProps<typeof tableStyle>;
193
194
  type TableSlots = keyof ReturnType<typeof tableStyle>;
194
195
  type TableReturnType = ReturnType<typeof tableStyle>;
@@ -220,4 +221,4 @@ type ValueFormatterParams<V = any> = {
220
221
  value: V;
221
222
  };
222
223
 
223
- export { type TableColumn, type TableRef, type TableReturnType, type TableRow, type TableSlots, type TableVariantProps, Table as default };
224
+ export { type TableColumn, type TableRef, type TableReturnType, type TableRow, type TableSlots, type TableVariantProps, Table as default, getCellStyle };
@@ -102,7 +102,8 @@ var require_plugin = __commonJS({
102
102
  // src/components/table/table.tsx
103
103
  var table_exports = {};
104
104
  __export(table_exports, {
105
- default: () => table_default
105
+ default: () => table_default,
106
+ getCellStyle: () => getCellStyle
106
107
  });
107
108
  module.exports = __toCommonJS(table_exports);
108
109
  var import_react5 = require("react");
@@ -692,17 +693,14 @@ var TableHead = ({
692
693
  "th",
693
694
  {
694
695
  className: clsx(slots.th({ class: classNames == null ? void 0 : classNames.th }), column == null ? void 0 : column.className),
695
- style: {
696
- width: isCheckbox ? "40px" : (column == null ? void 0 : column.width) ? `${column.width}px` : "auto",
697
- minWidth: isCheckbox ? "40px" : (column == null ? void 0 : column.minWidth) ? `${column.minWidth}px` : void 0,
698
- maxWidth: isCheckbox ? "40px" : (column == null ? void 0 : column.maxWidth) ? `${column.maxWidth}px` : void 0,
699
- height: (column == null ? void 0 : column.height) ? `${column.height}px` : void 0,
700
- ...isCheckbox || (column == null ? void 0 : column.width) ? {
701
- flexShrink: 0,
702
- flexGrow: 0,
703
- boxSizing: "border-box"
704
- } : {}
705
- },
696
+ style: isCheckbox ? {
697
+ width: "40px",
698
+ minWidth: "40px",
699
+ maxWidth: "40px",
700
+ flexShrink: 0,
701
+ flexGrow: 0,
702
+ boxSizing: "border-box"
703
+ } : column ? { ...getCellStyle(column), textAlign: "center" } : void 0,
706
704
  children: content
707
705
  },
708
706
  key
@@ -750,21 +748,6 @@ var TableBody = ({
750
748
  classNames,
751
749
  className
752
750
  }) => {
753
- const getCellStyle = (column) => ({
754
- width: column.width ? `${column.width}px` : "auto",
755
- minWidth: column.minWidth ? `${column.minWidth}px` : void 0,
756
- maxWidth: column.maxWidth ? `${column.maxWidth}px` : void 0,
757
- height: column.height ? `${column.height}px` : void 0,
758
- textAlign: column.align || "center",
759
- ...column.width && {
760
- flexShrink: 0,
761
- flexGrow: 0,
762
- boxSizing: "border-box",
763
- overflow: "hidden",
764
- textOverflow: "ellipsis",
765
- whiteSpace: "nowrap"
766
- }
767
- });
768
751
  const renderTdSkeleton = (key, column) => {
769
752
  const isCheckbox = key.includes("checkbox");
770
753
  return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
@@ -6178,6 +6161,15 @@ var Table = (0, import_react5.forwardRef)((originalProps, ref) => {
6178
6161
  const { page = 1, perPage = 15 } = pagination || {};
6179
6162
  const showPagination = pagination && totalData > 0 && !isLoading;
6180
6163
  const [checkedRows, setCheckedRows] = (0, import_react5.useState)(/* @__PURE__ */ new Set());
6164
+ const tableMinWidth = (0, import_react5.useMemo)(() => {
6165
+ const columnsWidth = columns.reduce((total, column) => {
6166
+ if (column.width) return total + column.width;
6167
+ if (column.minWidth) return total + column.minWidth;
6168
+ return total + 100;
6169
+ }, 0);
6170
+ const checkboxWidth = rowCheckbox ? 40 : 0;
6171
+ return columnsWidth + checkboxWidth;
6172
+ }, [columns, rowCheckbox]);
6181
6173
  (0, import_react5.useEffect)(() => {
6182
6174
  onCheckedRowsChange == null ? void 0 : onCheckedRowsChange(getCheckedRowData(checkedRows));
6183
6175
  }, [checkedRows]);
@@ -6217,7 +6209,8 @@ var Table = (0, import_react5.forwardRef)((originalProps, ref) => {
6217
6209
  className: slots.table({ class: classNames == null ? void 0 : classNames.table }),
6218
6210
  style: {
6219
6211
  tableLayout: "fixed",
6220
- width: "100%"
6212
+ width: "100%",
6213
+ minWidth: `${tableMinWidth}px`
6221
6214
  },
6222
6215
  children: [
6223
6216
  /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
@@ -6487,3 +6480,22 @@ var tableStyle = (0, import_tailwind_variants7.tv)({
6487
6480
  height: "narrow"
6488
6481
  }
6489
6482
  });
6483
+ var getCellStyle = (column) => {
6484
+ const hasFixedWidth = column.width;
6485
+ const hasMinWidth = column.minWidth;
6486
+ return {
6487
+ width: hasFixedWidth ? `${column.width}px` : "auto",
6488
+ minWidth: hasMinWidth ? `${column.minWidth}px` : hasFixedWidth ? `${column.width}px` : void 0,
6489
+ maxWidth: column.maxWidth ? `${column.maxWidth}px` : void 0,
6490
+ height: column.height ? `${column.height}px` : void 0,
6491
+ textAlign: column.align || "center",
6492
+ boxSizing: "border-box",
6493
+ overflow: "hidden",
6494
+ textOverflow: "ellipsis",
6495
+ whiteSpace: "nowrap"
6496
+ };
6497
+ };
6498
+ // Annotate the CommonJS export names for ESM import in node:
6499
+ 0 && (module.exports = {
6500
+ getCellStyle
6501
+ });
@@ -1,16 +1,15 @@
1
1
  "use client";
2
2
  import {
3
+ getCellStyle,
3
4
  table_default
4
- } from "../../chunk-AX3D6VFT.mjs";
5
- import "../../chunk-SIVCIIB6.mjs";
6
- import "../../chunk-D5N7OBSO.mjs";
7
- import "../../chunk-DQRAFUDA.mjs";
8
- import "../../chunk-M37VBNB3.mjs";
5
+ } from "../../chunk-LNVDBHVI.mjs";
9
6
  import "../../chunk-MZ76AA76.mjs";
10
7
  import "../../chunk-6PN3DGOE.mjs";
11
8
  import "../../chunk-7B7LRG5J.mjs";
12
9
  import "../../chunk-CC2F5HQX.mjs";
13
10
  import "../../chunk-F3HENRVM.mjs";
11
+ import "../../chunk-DQRAFUDA.mjs";
12
+ import "../../chunk-M37VBNB3.mjs";
14
13
  import "../../chunk-2GCSFWHD.mjs";
15
14
  import "../../chunk-5M7UDEMG.mjs";
16
15
  import "../../chunk-QZ3LVYJW.mjs";
@@ -23,5 +22,6 @@ import "../../chunk-27Y6K5NK.mjs";
23
22
  import "../../chunk-E3G5QXSH.mjs";
24
23
  import "../../chunk-AC6TWLRT.mjs";
25
24
  export {
26
- table_default as default
25
+ table_default as default,
26
+ getCellStyle
27
27
  };
package/dist/index.js CHANGED
@@ -7718,17 +7718,14 @@ var TableHead = ({
7718
7718
  "th",
7719
7719
  {
7720
7720
  className: clsx(slots.th({ class: classNames == null ? void 0 : classNames.th }), column == null ? void 0 : column.className),
7721
- style: {
7722
- width: isCheckbox ? "40px" : (column == null ? void 0 : column.width) ? `${column.width}px` : "auto",
7723
- minWidth: isCheckbox ? "40px" : (column == null ? void 0 : column.minWidth) ? `${column.minWidth}px` : void 0,
7724
- maxWidth: isCheckbox ? "40px" : (column == null ? void 0 : column.maxWidth) ? `${column.maxWidth}px` : void 0,
7725
- height: (column == null ? void 0 : column.height) ? `${column.height}px` : void 0,
7726
- ...isCheckbox || (column == null ? void 0 : column.width) ? {
7727
- flexShrink: 0,
7728
- flexGrow: 0,
7729
- boxSizing: "border-box"
7730
- } : {}
7731
- },
7721
+ style: isCheckbox ? {
7722
+ width: "40px",
7723
+ minWidth: "40px",
7724
+ maxWidth: "40px",
7725
+ flexShrink: 0,
7726
+ flexGrow: 0,
7727
+ boxSizing: "border-box"
7728
+ } : column ? { ...getCellStyle(column), textAlign: "center" } : void 0,
7732
7729
  children: content
7733
7730
  },
7734
7731
  key
@@ -7776,21 +7773,6 @@ var TableBody = ({
7776
7773
  classNames,
7777
7774
  className
7778
7775
  }) => {
7779
- const getCellStyle = (column) => ({
7780
- width: column.width ? `${column.width}px` : "auto",
7781
- minWidth: column.minWidth ? `${column.minWidth}px` : void 0,
7782
- maxWidth: column.maxWidth ? `${column.maxWidth}px` : void 0,
7783
- height: column.height ? `${column.height}px` : void 0,
7784
- textAlign: column.align || "center",
7785
- ...column.width && {
7786
- flexShrink: 0,
7787
- flexGrow: 0,
7788
- boxSizing: "border-box",
7789
- overflow: "hidden",
7790
- textOverflow: "ellipsis",
7791
- whiteSpace: "nowrap"
7792
- }
7793
- });
7794
7776
  const renderTdSkeleton = (key, column) => {
7795
7777
  const isCheckbox = key.includes("checkbox");
7796
7778
  return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
@@ -8201,6 +8183,15 @@ var Table = (0, import_react15.forwardRef)((originalProps, ref) => {
8201
8183
  const { page = 1, perPage = 15 } = pagination || {};
8202
8184
  const showPagination = pagination && totalData > 0 && !isLoading;
8203
8185
  const [checkedRows, setCheckedRows] = (0, import_react15.useState)(/* @__PURE__ */ new Set());
8186
+ const tableMinWidth = (0, import_react15.useMemo)(() => {
8187
+ const columnsWidth = columns.reduce((total, column) => {
8188
+ if (column.width) return total + column.width;
8189
+ if (column.minWidth) return total + column.minWidth;
8190
+ return total + 100;
8191
+ }, 0);
8192
+ const checkboxWidth = rowCheckbox ? 40 : 0;
8193
+ return columnsWidth + checkboxWidth;
8194
+ }, [columns, rowCheckbox]);
8204
8195
  (0, import_react15.useEffect)(() => {
8205
8196
  onCheckedRowsChange == null ? void 0 : onCheckedRowsChange(getCheckedRowData(checkedRows));
8206
8197
  }, [checkedRows]);
@@ -8240,7 +8231,8 @@ var Table = (0, import_react15.forwardRef)((originalProps, ref) => {
8240
8231
  className: slots.table({ class: classNames == null ? void 0 : classNames.table }),
8241
8232
  style: {
8242
8233
  tableLayout: "fixed",
8243
- width: "100%"
8234
+ width: "100%",
8235
+ minWidth: `${tableMinWidth}px`
8244
8236
  },
8245
8237
  children: [
8246
8238
  /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
@@ -8510,6 +8502,21 @@ var tableStyle = (0, import_tailwind_variants16.tv)({
8510
8502
  height: "narrow"
8511
8503
  }
8512
8504
  });
8505
+ var getCellStyle = (column) => {
8506
+ const hasFixedWidth = column.width;
8507
+ const hasMinWidth = column.minWidth;
8508
+ return {
8509
+ width: hasFixedWidth ? `${column.width}px` : "auto",
8510
+ minWidth: hasMinWidth ? `${column.minWidth}px` : hasFixedWidth ? `${column.width}px` : void 0,
8511
+ maxWidth: column.maxWidth ? `${column.maxWidth}px` : void 0,
8512
+ height: column.height ? `${column.height}px` : void 0,
8513
+ textAlign: column.align || "center",
8514
+ boxSizing: "border-box",
8515
+ overflow: "hidden",
8516
+ textOverflow: "ellipsis",
8517
+ whiteSpace: "nowrap"
8518
+ };
8519
+ };
8513
8520
 
8514
8521
  // src/components/table/definition-table.tsx
8515
8522
  var import_react16 = require("react");
package/dist/index.mjs CHANGED
@@ -3,6 +3,17 @@ import "./chunk-MBLZYQCN.mjs";
3
3
  import {
4
4
  tree_default
5
5
  } from "./chunk-R7VCFJGU.mjs";
6
+ import "./chunk-TPFN22HR.mjs";
7
+ import {
8
+ radio_default
9
+ } from "./chunk-5IESFXPF.mjs";
10
+ import "./chunk-DX3KXNP6.mjs";
11
+ import {
12
+ definition_table_default
13
+ } from "./chunk-KCAGZUYM.mjs";
14
+ import {
15
+ table_default
16
+ } from "./chunk-LNVDBHVI.mjs";
6
17
  import "./chunk-RRAZM5D3.mjs";
7
18
  import {
8
19
  textarea_default
@@ -22,23 +33,6 @@ import {
22
33
  } from "./chunk-JPFA7PPB.mjs";
23
34
  import "./chunk-ZMOAFSYE.mjs";
24
35
  import "./chunk-WSIADHVC.mjs";
25
- import "./chunk-DX3KXNP6.mjs";
26
- import {
27
- definition_table_default
28
- } from "./chunk-KCAGZUYM.mjs";
29
- import {
30
- table_default
31
- } from "./chunk-AX3D6VFT.mjs";
32
- import "./chunk-SIVCIIB6.mjs";
33
- import "./chunk-D5N7OBSO.mjs";
34
- import "./chunk-3MY6LO7N.mjs";
35
- import {
36
- tabs_default
37
- } from "./chunk-FRKIXGG5.mjs";
38
- import "./chunk-DQRAFUDA.mjs";
39
- import {
40
- scrollArea_default
41
- } from "./chunk-M37VBNB3.mjs";
42
36
  import "./chunk-QCEKPS7U.mjs";
43
37
  import {
44
38
  select_default
@@ -51,19 +45,23 @@ import "./chunk-LVFI2NOH.mjs";
51
45
  import {
52
46
  switch_default
53
47
  } from "./chunk-AJUQBMSV.mjs";
48
+ import "./chunk-3MY6LO7N.mjs";
49
+ import {
50
+ tabs_default
51
+ } from "./chunk-FRKIXGG5.mjs";
54
52
  import "./chunk-7B7LRG5J.mjs";
55
53
  import {
56
54
  pagination_default
57
55
  } from "./chunk-CC2F5HQX.mjs";
58
56
  import "./chunk-F3HENRVM.mjs";
59
- import "./chunk-TPFN22HR.mjs";
57
+ import "./chunk-DQRAFUDA.mjs";
60
58
  import {
61
- radio_default
62
- } from "./chunk-5IESFXPF.mjs";
59
+ scrollArea_default
60
+ } from "./chunk-M37VBNB3.mjs";
63
61
  import "./chunk-DJOG6Z35.mjs";
64
62
  import {
65
63
  modal_default
66
- } from "./chunk-SPIJ6ECD.mjs";
64
+ } from "./chunk-OKO3XRJS.mjs";
67
65
  import "./chunk-32GA3YW4.mjs";
68
66
  import {
69
67
  drawer_default
@@ -71,7 +69,7 @@ import {
71
69
  import "./chunk-RLXOHILK.mjs";
72
70
  import {
73
71
  fileUpload_default
74
- } from "./chunk-RSGTFDZ5.mjs";
72
+ } from "./chunk-7Q2WQJ6U.mjs";
75
73
  import "./chunk-2GCSFWHD.mjs";
76
74
  import {
77
75
  input_default
@@ -88,15 +86,15 @@ import {
88
86
  import "./chunk-75HLCORR.mjs";
89
87
  import {
90
88
  dateTimePicker_default
91
- } from "./chunk-YF2N2OBY.mjs";
92
- import "./chunk-WYHCK7XL.mjs";
89
+ } from "./chunk-L65ETSUY.mjs";
90
+ import "./chunk-ZYS4NSXT.mjs";
93
91
  import "./chunk-7MVEAQ7Z.mjs";
94
- import {
95
- list_default
96
- } from "./chunk-B6XJNGQL.mjs";
97
92
  import {
98
93
  listItem_default
99
94
  } from "./chunk-QFIS6N5R.mjs";
95
+ import {
96
+ list_default
97
+ } from "./chunk-B6XJNGQL.mjs";
100
98
  import "./chunk-FWJ2ZKH6.mjs";
101
99
  import "./chunk-TUXYVNTY.mjs";
102
100
  import "./chunk-P732YGHO.mjs";
@@ -127,13 +125,13 @@ import {
127
125
  } from "./chunk-EKWUOA5B.mjs";
128
126
  import {
129
127
  button_default
130
- } from "./chunk-Q7J5FAMH.mjs";
128
+ } from "./chunk-RN76ARTS.mjs";
131
129
  import {
132
130
  icon_button_default
133
- } from "./chunk-PQRAYOTJ.mjs";
131
+ } from "./chunk-PDY7UYKZ.mjs";
134
132
  import "./chunk-6WSACUIB.mjs";
135
- import "./chunk-6PNKRBUT.mjs";
136
133
  import "./chunk-LXHUO6VM.mjs";
134
+ import "./chunk-6PNKRBUT.mjs";
137
135
  import "./chunk-ZYIIXWVY.mjs";
138
136
  import {
139
137
  Icon_default,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deepnoid/ui",
3
- "version": "0.1.79",
3
+ "version": "0.1.81",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "exports": {
@@ -1,76 +0,0 @@
1
- "use client";
2
- import {
3
- skeleton_default
4
- } from "./chunk-6PN3DGOE.mjs";
5
- import {
6
- checkbox_default
7
- } from "./chunk-SKOCUCE5.mjs";
8
- import {
9
- clsx
10
- } from "./chunk-27Y6K5NK.mjs";
11
-
12
- // src/components/table/table-head.tsx
13
- import { jsx, jsxs } from "react/jsx-runtime";
14
- var TableHead = ({
15
- slots,
16
- columns,
17
- color,
18
- size,
19
- rowCheckbox = false,
20
- isCheckedAll,
21
- isLoading = false,
22
- classNames,
23
- onCheckAll
24
- }) => {
25
- const handleClickCheckAll = (e) => {
26
- e.preventDefault();
27
- onCheckAll(!isCheckedAll);
28
- };
29
- const renderTh = (content, key, column, isCheckbox) => /* @__PURE__ */ jsx(
30
- "th",
31
- {
32
- className: clsx(slots.th({ class: classNames == null ? void 0 : classNames.th }), column == null ? void 0 : column.className),
33
- style: {
34
- width: isCheckbox ? "40px" : (column == null ? void 0 : column.width) ? `${column.width}px` : "auto",
35
- minWidth: isCheckbox ? "40px" : (column == null ? void 0 : column.minWidth) ? `${column.minWidth}px` : void 0,
36
- maxWidth: isCheckbox ? "40px" : (column == null ? void 0 : column.maxWidth) ? `${column.maxWidth}px` : void 0,
37
- height: (column == null ? void 0 : column.height) ? `${column.height}px` : void 0,
38
- ...isCheckbox || (column == null ? void 0 : column.width) ? {
39
- flexShrink: 0,
40
- flexGrow: 0,
41
- boxSizing: "border-box"
42
- } : {}
43
- },
44
- children: content
45
- },
46
- key
47
- );
48
- const renderSkeletonRow = () => /* @__PURE__ */ jsx("thead", { className: slots.thead({ class: classNames == null ? void 0 : classNames.thead }), children: /* @__PURE__ */ jsxs("tr", { className: clsx(slots.tr({ class: classNames == null ? void 0 : classNames.tr }), "[&>th]:border-0"), children: [
49
- columns.map(
50
- (column, idx) => renderTh(/* @__PURE__ */ jsx(skeleton_default, { color, rounded: "lg", speed: "fast" }), `skeleton-${idx}`, column)
51
- ),
52
- rowCheckbox && renderTh(/* @__PURE__ */ jsx(skeleton_default, { color, rounded: "lg", speed: "fast" }), "checkbox-skeleton", void 0, true)
53
- ] }) });
54
- const renderContentRow = () => /* @__PURE__ */ jsx("thead", { className: slots.thead({ class: classNames == null ? void 0 : classNames.thead }), children: /* @__PURE__ */ jsxs("tr", { className: slots.tr({ class: classNames == null ? void 0 : classNames.tr }), children: [
55
- columns.map((column, idx) => renderTh(column.headerName, `${column.field}-${idx}`, column)),
56
- rowCheckbox && renderTh(
57
- /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center", onClick: handleClickCheckAll, children: /* @__PURE__ */ jsx(
58
- checkbox_default,
59
- {
60
- size,
61
- checked: isCheckedAll,
62
- onChange: (e) => onCheckAll(e.target.checked)
63
- }
64
- ) }),
65
- "checkbox",
66
- void 0,
67
- true
68
- )
69
- ] }) });
70
- return isLoading ? renderSkeletonRow() : renderContentRow();
71
- };
72
- var table_head_default = TableHead;
73
-
74
- export {
75
- table_head_default
76
- };
@@ -1,112 +0,0 @@
1
- "use client";
2
- import {
3
- skeleton_default
4
- } from "./chunk-6PN3DGOE.mjs";
5
- import {
6
- checkbox_default
7
- } from "./chunk-SKOCUCE5.mjs";
8
- import {
9
- clsx
10
- } from "./chunk-27Y6K5NK.mjs";
11
-
12
- // src/components/table/table-body.tsx
13
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
14
- var TableBody = ({
15
- slots,
16
- rows,
17
- columns,
18
- size,
19
- color,
20
- rowCheckbox = false,
21
- checkedRows,
22
- onCheckRow,
23
- isLoading = false,
24
- emptyContent,
25
- skeletonRow,
26
- classNames,
27
- className
28
- }) => {
29
- const getCellStyle = (column) => ({
30
- width: column.width ? `${column.width}px` : "auto",
31
- minWidth: column.minWidth ? `${column.minWidth}px` : void 0,
32
- maxWidth: column.maxWidth ? `${column.maxWidth}px` : void 0,
33
- height: column.height ? `${column.height}px` : void 0,
34
- textAlign: column.align || "center",
35
- ...column.width && {
36
- flexShrink: 0,
37
- flexGrow: 0,
38
- boxSizing: "border-box",
39
- overflow: "hidden",
40
- textOverflow: "ellipsis",
41
- whiteSpace: "nowrap"
42
- }
43
- });
44
- const renderTdSkeleton = (key, column) => {
45
- const isCheckbox = key.includes("checkbox");
46
- return /* @__PURE__ */ jsx(
47
- "td",
48
- {
49
- className: slots.td({ class: classNames == null ? void 0 : classNames.td }),
50
- style: isCheckbox ? {
51
- width: "40px",
52
- minWidth: "40px",
53
- maxWidth: "40px",
54
- flexShrink: 0,
55
- flexGrow: 0,
56
- boxSizing: "border-box"
57
- } : column ? getCellStyle(column) : void 0,
58
- children: /* @__PURE__ */ jsx(skeleton_default, { color, className: "h-full w-full", rounded: "lg", speed: "fast" })
59
- },
60
- key
61
- );
62
- };
63
- const renderCheckboxCell = (rowId) => /* @__PURE__ */ jsx(
64
- "td",
65
- {
66
- className: clsx(slots.td({ class: classNames == null ? void 0 : classNames.td }), "text-center"),
67
- style: {
68
- width: "40px",
69
- minWidth: "40px",
70
- maxWidth: "40px",
71
- flexShrink: 0,
72
- flexGrow: 0,
73
- boxSizing: "border-box"
74
- },
75
- children: /* @__PURE__ */ jsx(checkbox_default, { size, checked: checkedRows.has(rowId), onChange: (e) => onCheckRow(rowId, e.target.checked) })
76
- }
77
- );
78
- const renderSkeletonRow = (rowIndex) => /* @__PURE__ */ jsxs("tr", { className: slots.tr({ class: classNames == null ? void 0 : classNames.tr }), children: [
79
- columns.map((column, colIdx) => renderTdSkeleton(`skeleton-${rowIndex}-${colIdx}`, column)),
80
- rowCheckbox && renderTdSkeleton(`skeleton-checkbox-${rowIndex}`)
81
- ] }, `skeleton-${rowIndex}`);
82
- const renderEmptyRow = () => /* @__PURE__ */ jsx("tr", { className: slots.tr({ class: classNames == null ? void 0 : classNames.tr }), children: /* @__PURE__ */ jsx("td", { colSpan: columns.length + (rowCheckbox ? 1 : 0), className: slots.empty({ class: classNames == null ? void 0 : classNames.empty }), children: emptyContent }) });
83
- const renderDataRow = (row, rowIndex) => /* @__PURE__ */ jsxs("tr", { className: slots.tr({ class: classNames == null ? void 0 : classNames.tr }), children: [
84
- columns.map((column, colIdx) => {
85
- var _a;
86
- const value = row[column.field];
87
- const formattedValue = ((_a = column.valueFormatter) == null ? void 0 : _a.call(column, { value, field: column.field })) || value;
88
- const content = column.renderCell ? column.renderCell({ id: row.id, field: column.field, value, formattedValue, row }) : formattedValue;
89
- return /* @__PURE__ */ jsx(
90
- "td",
91
- {
92
- className: clsx(slots.td({ class: classNames == null ? void 0 : classNames.td }), column.className),
93
- style: getCellStyle(column),
94
- children: content
95
- },
96
- `${rowIndex}-${colIdx}`
97
- );
98
- }),
99
- rowCheckbox && renderCheckboxCell(row.id)
100
- ] }, rowIndex);
101
- const renderRows = () => {
102
- if (isLoading) return skeletonRow ? Array.from({ length: skeletonRow }, (_, idx) => renderSkeletonRow(idx)) : /* @__PURE__ */ jsx(Fragment, {});
103
- if (!rows.length && emptyContent) return renderEmptyRow();
104
- return rows.map((row, index) => renderDataRow(row, index));
105
- };
106
- return /* @__PURE__ */ jsx("tbody", { className: `${slots.tbody({ class: classNames == null ? void 0 : classNames.tbody })} ${className || ""}`, children: renderRows() });
107
- };
108
- var table_body_default = TableBody;
109
-
110
- export {
111
- table_body_default
112
- };
@@ -1,10 +1,10 @@
1
1
  "use client";
2
- import {
3
- useRipple
4
- } from "./chunk-6PNKRBUT.mjs";
5
2
  import {
6
3
  ripple_default
7
4
  } from "./chunk-LXHUO6VM.mjs";
5
+ import {
6
+ useRipple
7
+ } from "./chunk-6PNKRBUT.mjs";
8
8
  import {
9
9
  Icon_default
10
10
  } from "./chunk-JP4TEWP7.mjs";
@@ -1,10 +1,10 @@
1
1
  "use client";
2
- import {
3
- useRipple
4
- } from "./chunk-6PNKRBUT.mjs";
5
2
  import {
6
3
  ripple_default
7
4
  } from "./chunk-LXHUO6VM.mjs";
5
+ import {
6
+ useRipple
7
+ } from "./chunk-6PNKRBUT.mjs";
8
8
  import {
9
9
  Icon_default
10
10
  } from "./chunk-JP4TEWP7.mjs";
@@ -1,10 +1,10 @@
1
1
  "use client";
2
- import {
3
- list_default
4
- } from "./chunk-B6XJNGQL.mjs";
5
2
  import {
6
3
  listItem_default
7
4
  } from "./chunk-QFIS6N5R.mjs";
5
+ import {
6
+ list_default
7
+ } from "./chunk-B6XJNGQL.mjs";
8
8
 
9
9
  // src/components/dateTimePicker/timePicker.tsx
10
10
  import { useState, useRef, useEffect } from "react";