@tipp/ui 1.4.2 → 1.4.4

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 (42) hide show
  1. package/dist/atoms/field-error-wrapper.js +2 -2
  2. package/dist/atoms/index.js +57 -57
  3. package/dist/atoms/pagination.js +2 -2
  4. package/dist/chunk-2BPFXK4L.js +19 -0
  5. package/dist/chunk-2BPFXK4L.js.map +1 -0
  6. package/dist/chunk-W4GH6ZKK.js +19 -0
  7. package/dist/chunk-W4GH6ZKK.js.map +1 -0
  8. package/dist/chunk-ZQ4XMJH7.js +1 -0
  9. package/dist/chunk-ZQ4XMJH7.js.map +1 -0
  10. package/dist/index.cjs +14 -4
  11. package/dist/index.cjs.map +1 -1
  12. package/dist/index.d.cts +1 -0
  13. package/dist/index.d.ts +1 -0
  14. package/dist/index.js +80 -76
  15. package/dist/molecules/date-picker/index.js +2 -2
  16. package/dist/molecules/expand-table/index.js +25 -25
  17. package/dist/molecules/expand-table/row.js +24 -24
  18. package/dist/molecules/index.js +30 -30
  19. package/dist/molecules/learning-post.js +3 -3
  20. package/dist/molecules/navigation.js +25 -25
  21. package/dist/molecules/stepper.js +3 -3
  22. package/dist/molecules/tag-selector.js +25 -25
  23. package/dist/utils/get-cell-align.cjs +5 -4
  24. package/dist/utils/get-cell-align.cjs.map +1 -1
  25. package/dist/utils/get-cell-align.d.cts +2 -4
  26. package/dist/utils/get-cell-align.d.ts +2 -4
  27. package/dist/utils/get-cell-align.js +1 -1
  28. package/dist/utils/get-column-meta.cjs +69 -0
  29. package/dist/utils/get-column-meta.cjs.map +1 -0
  30. package/dist/utils/get-column-meta.d.cts +20 -0
  31. package/dist/utils/get-column-meta.d.ts +20 -0
  32. package/dist/utils/get-column-meta.js +9 -0
  33. package/dist/utils/get-column-meta.js.map +1 -0
  34. package/dist/utils/index.cjs +31 -4
  35. package/dist/utils/index.cjs.map +1 -1
  36. package/dist/utils/index.d.cts +2 -0
  37. package/dist/utils/index.d.ts +2 -0
  38. package/dist/utils/index.js +6 -2
  39. package/package.json +1 -1
  40. package/src/utils/get-cell-align.ts +12 -5
  41. package/src/utils/get-column-meta.ts +26 -0
  42. package/src/utils/index.ts +1 -0
@@ -1,63 +1,63 @@
1
1
  import {
2
2
  Navigation
3
- } from "../chunk-PPO64OK7.js";
3
+ } from "../chunk-VSGK4POC.js";
4
4
  import "../chunk-76JGDATZ.js";
5
- import "../chunk-ILRUXI2E.js";
6
- import "../chunk-JPIZP2PZ.js";
7
- import "../chunk-CYYWMYE7.js";
8
- import "../chunk-3JRNKBMN.js";
9
- import "../chunk-HYITAA4J.js";
10
- import "../chunk-5H3YPCZK.js";
11
5
  import "../chunk-FR2GDOU2.js";
12
6
  import "../chunk-74DX4CU7.js";
13
7
  import "../chunk-OYM4XCHQ.js";
14
8
  import "../chunk-YJ7ZFOYL.js";
15
9
  import "../chunk-5ZITU5L7.js";
16
- import "../chunk-365QMK4D.js";
17
- import "../chunk-YO3BQW6S.js";
18
- import "../chunk-6IVCARWS.js";
10
+ import "../chunk-ILRUXI2E.js";
11
+ import "../chunk-JPIZP2PZ.js";
12
+ import "../chunk-CYYWMYE7.js";
19
13
  import "../chunk-6DJOIRMF.js";
20
14
  import "../chunk-FPD73OHW.js";
21
15
  import "../chunk-ZKZDVS7G.js";
22
16
  import "../chunk-MUNMDHRF.js";
23
17
  import "../chunk-TVDKGMBI.js";
24
- import "../chunk-O3T3TM3V.js";
18
+ import "../chunk-3JRNKBMN.js";
19
+ import "../chunk-HYITAA4J.js";
20
+ import "../chunk-5H3YPCZK.js";
25
21
  import "../chunk-XQOL7UBI.js";
26
22
  import "../chunk-TULWX7D6.js";
27
23
  import "../chunk-SIM6HKVI.js";
28
- import "../chunk-IM7DSIK2.js";
29
- import "../chunk-O3DNDMV3.js";
24
+ import "../chunk-5X3BCQPR.js";
30
25
  import "../chunk-5AVBYDPB.js";
31
- import "../chunk-4WFMOFN2.js";
32
- import "../chunk-WKFZ5MMN.js";
33
- import "../chunk-ACVANQJ4.js";
34
- import "../chunk-2DZ2Y3JI.js";
35
- import "../chunk-QDZS4B6A.js";
36
- import "../chunk-52MVZ6AN.js";
26
+ import "../chunk-365QMK4D.js";
27
+ import "../chunk-YO3BQW6S.js";
28
+ import "../chunk-6IVCARWS.js";
29
+ import "../chunk-DJN2IEY6.js";
37
30
  import "../chunk-25HMMI7R.js";
38
31
  import "../chunk-2CVXGGI5.js";
39
32
  import "../chunk-EGEQY3KT.js";
40
33
  import "../chunk-HK224ADT.js";
41
- import "../chunk-IQEEPHOY.js";
42
- import "../chunk-LHCDPZ5E.js";
43
- import "../chunk-OHMOP5PV.js";
34
+ import "../chunk-O3T3TM3V.js";
35
+ import "../chunk-O3DNDMV3.js";
44
36
  import "../chunk-LZJR77Q2.js";
45
37
  import "../chunk-Q37G2GS6.js";
46
38
  import "../chunk-VTJZMOSP.js";
47
39
  import "../chunk-6AJTMXLJ.js";
48
40
  import "../chunk-3IZQ2PIQ.js";
49
- import "../chunk-3SSSCLJ5.js";
50
- import "../chunk-EWD4AO5N.js";
51
- import "../chunk-YGL6SWKN.js";
41
+ import "../chunk-4WFMOFN2.js";
42
+ import "../chunk-WKFZ5MMN.js";
43
+ import "../chunk-ACVANQJ4.js";
44
+ import "../chunk-52MVZ6AN.js";
45
+ import "../chunk-2DZ2Y3JI.js";
52
46
  import "../chunk-4Y5BEXVN.js";
53
47
  import "../chunk-P3YCIJUP.js";
54
48
  import "../chunk-B6XJN6EC.js";
55
49
  import "../chunk-UVKNLJDZ.js";
56
50
  import "../chunk-MIMJ7LON.js";
51
+ import "../chunk-IQEEPHOY.js";
52
+ import "../chunk-LHCDPZ5E.js";
53
+ import "../chunk-OHMOP5PV.js";
57
54
  import "../chunk-66C4U3BG.js";
58
55
  import "../chunk-J242TTFH.js";
59
56
  import "../chunk-EAXUQEO5.js";
60
57
  import "../chunk-YJCCE5WP.js";
58
+ import "../chunk-3SSSCLJ5.js";
59
+ import "../chunk-EWD4AO5N.js";
60
+ import "../chunk-YGL6SWKN.js";
61
61
  import "../chunk-N552FDTV.js";
62
62
  export {
63
63
  Navigation
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  Stepper
3
- } from "../chunk-PF5CPG6R.js";
4
- import "../chunk-52MVZ6AN.js";
3
+ } from "../chunk-Y3L7BYDF.js";
5
4
  import "../chunk-25HMMI7R.js";
6
- import "../chunk-3SSSCLJ5.js";
5
+ import "../chunk-52MVZ6AN.js";
7
6
  import "../chunk-66C4U3BG.js";
7
+ import "../chunk-3SSSCLJ5.js";
8
8
  import "../chunk-N552FDTV.js";
9
9
  export {
10
10
  Stepper
@@ -1,63 +1,63 @@
1
1
  import {
2
2
  TagSelector
3
- } from "../chunk-NUEMI3QO.js";
3
+ } from "../chunk-P7633BEQ.js";
4
4
  import "../chunk-76JGDATZ.js";
5
- import "../chunk-ILRUXI2E.js";
6
- import "../chunk-JPIZP2PZ.js";
7
- import "../chunk-CYYWMYE7.js";
8
- import "../chunk-3JRNKBMN.js";
9
- import "../chunk-HYITAA4J.js";
10
- import "../chunk-5H3YPCZK.js";
11
5
  import "../chunk-FR2GDOU2.js";
12
6
  import "../chunk-74DX4CU7.js";
13
7
  import "../chunk-OYM4XCHQ.js";
14
8
  import "../chunk-YJ7ZFOYL.js";
15
9
  import "../chunk-5ZITU5L7.js";
16
- import "../chunk-365QMK4D.js";
17
- import "../chunk-YO3BQW6S.js";
18
- import "../chunk-6IVCARWS.js";
10
+ import "../chunk-ILRUXI2E.js";
11
+ import "../chunk-JPIZP2PZ.js";
12
+ import "../chunk-CYYWMYE7.js";
19
13
  import "../chunk-6DJOIRMF.js";
20
14
  import "../chunk-FPD73OHW.js";
21
15
  import "../chunk-ZKZDVS7G.js";
22
16
  import "../chunk-MUNMDHRF.js";
23
17
  import "../chunk-TVDKGMBI.js";
24
- import "../chunk-O3T3TM3V.js";
18
+ import "../chunk-3JRNKBMN.js";
19
+ import "../chunk-HYITAA4J.js";
20
+ import "../chunk-5H3YPCZK.js";
25
21
  import "../chunk-XQOL7UBI.js";
26
22
  import "../chunk-TULWX7D6.js";
27
23
  import "../chunk-SIM6HKVI.js";
28
- import "../chunk-IM7DSIK2.js";
29
- import "../chunk-O3DNDMV3.js";
24
+ import "../chunk-5X3BCQPR.js";
30
25
  import "../chunk-5AVBYDPB.js";
31
- import "../chunk-4WFMOFN2.js";
32
- import "../chunk-WKFZ5MMN.js";
33
- import "../chunk-ACVANQJ4.js";
34
- import "../chunk-2DZ2Y3JI.js";
35
- import "../chunk-QDZS4B6A.js";
36
- import "../chunk-52MVZ6AN.js";
26
+ import "../chunk-365QMK4D.js";
27
+ import "../chunk-YO3BQW6S.js";
28
+ import "../chunk-6IVCARWS.js";
29
+ import "../chunk-DJN2IEY6.js";
37
30
  import "../chunk-25HMMI7R.js";
38
31
  import "../chunk-2CVXGGI5.js";
39
32
  import "../chunk-EGEQY3KT.js";
40
33
  import "../chunk-HK224ADT.js";
41
- import "../chunk-IQEEPHOY.js";
42
- import "../chunk-LHCDPZ5E.js";
43
- import "../chunk-OHMOP5PV.js";
34
+ import "../chunk-O3T3TM3V.js";
35
+ import "../chunk-O3DNDMV3.js";
44
36
  import "../chunk-LZJR77Q2.js";
45
37
  import "../chunk-Q37G2GS6.js";
46
38
  import "../chunk-VTJZMOSP.js";
47
39
  import "../chunk-6AJTMXLJ.js";
48
40
  import "../chunk-3IZQ2PIQ.js";
49
- import "../chunk-3SSSCLJ5.js";
50
- import "../chunk-EWD4AO5N.js";
51
- import "../chunk-YGL6SWKN.js";
41
+ import "../chunk-4WFMOFN2.js";
42
+ import "../chunk-WKFZ5MMN.js";
43
+ import "../chunk-ACVANQJ4.js";
44
+ import "../chunk-52MVZ6AN.js";
45
+ import "../chunk-2DZ2Y3JI.js";
52
46
  import "../chunk-4Y5BEXVN.js";
53
47
  import "../chunk-P3YCIJUP.js";
54
48
  import "../chunk-B6XJN6EC.js";
55
49
  import "../chunk-UVKNLJDZ.js";
56
50
  import "../chunk-MIMJ7LON.js";
51
+ import "../chunk-IQEEPHOY.js";
52
+ import "../chunk-LHCDPZ5E.js";
53
+ import "../chunk-OHMOP5PV.js";
57
54
  import "../chunk-66C4U3BG.js";
58
55
  import "../chunk-J242TTFH.js";
59
56
  import "../chunk-EAXUQEO5.js";
60
57
  import "../chunk-YJCCE5WP.js";
58
+ import "../chunk-3SSSCLJ5.js";
59
+ import "../chunk-EWD4AO5N.js";
60
+ import "../chunk-YGL6SWKN.js";
61
61
  import "../chunk-N552FDTV.js";
62
62
  export {
63
63
  TagSelector
@@ -23,16 +23,17 @@ __export(get_cell_align_exports, {
23
23
  getCellAlign: () => getCellAlign
24
24
  });
25
25
  module.exports = __toCommonJS(get_cell_align_exports);
26
- var getCellAlign = (arg) => {
27
- const { dataType } = arg;
28
- switch (dataType) {
26
+ var getCellAlign = (type) => {
27
+ switch (type) {
29
28
  case "number":
30
29
  case "date":
31
30
  case "time":
32
31
  return "right";
33
32
  case "string":
34
- default:
33
+ case "button":
35
34
  return "left";
35
+ default:
36
+ return type;
36
37
  }
37
38
  };
38
39
  // Annotate the CommonJS export names for ESM import in node:
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/get-cell-align.ts"],"sourcesContent":["export type CellDataType = 'number' | 'date' | 'time' | 'string' | 'button';\nexport type CellAlign = 'left' | 'center' | 'right';\n\nexport const getCellAlign = (arg: { dataType: CellDataType }): CellAlign => {\n const { dataType } = arg;\n\n switch (dataType) {\n case 'number':\n case 'date':\n case 'time':\n return 'right';\n case 'string':\n default:\n return 'left';\n }\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGO,IAAM,eAAe,CAAC,QAA+C;AAC1E,QAAM,EAAE,SAAS,IAAI;AAErB,UAAQ,UAAU;AAAA,IAChB,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AAAA,IACL;AACE,aAAO;AAAA,EACX;AACF;","names":[]}
1
+ {"version":3,"sources":["../../src/utils/get-cell-align.ts"],"sourcesContent":["export type CellAlign = 'left' | 'center' | 'right';\n\nexport type CellDataType =\n | 'number'\n | 'date'\n | 'time'\n | 'string'\n | 'button'\n | CellAlign;\n\nexport const getCellAlign = (type: CellDataType): CellAlign => {\n switch (type) {\n case 'number':\n case 'date':\n case 'time':\n return 'right';\n case 'string':\n case 'button':\n return 'left';\n default:\n return type;\n }\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAUO,IAAM,eAAe,CAAC,SAAkC;AAC7D,UAAQ,MAAM;AAAA,IACZ,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AAAA,IACL,KAAK;AACH,aAAO;AAAA,IACT;AACE,aAAO;AAAA,EACX;AACF;","names":[]}
@@ -1,7 +1,5 @@
1
- type CellDataType = 'number' | 'date' | 'time' | 'string' | 'button';
2
1
  type CellAlign = 'left' | 'center' | 'right';
3
- declare const getCellAlign: (arg: {
4
- dataType: CellDataType;
5
- }) => CellAlign;
2
+ type CellDataType = 'number' | 'date' | 'time' | 'string' | 'button' | CellAlign;
3
+ declare const getCellAlign: (type: CellDataType) => CellAlign;
6
4
 
7
5
  export { type CellAlign, type CellDataType, getCellAlign };
@@ -1,7 +1,5 @@
1
- type CellDataType = 'number' | 'date' | 'time' | 'string' | 'button';
2
1
  type CellAlign = 'left' | 'center' | 'right';
3
- declare const getCellAlign: (arg: {
4
- dataType: CellDataType;
5
- }) => CellAlign;
2
+ type CellDataType = 'number' | 'date' | 'time' | 'string' | 'button' | CellAlign;
3
+ declare const getCellAlign: (type: CellDataType) => CellAlign;
6
4
 
7
5
  export { type CellAlign, type CellDataType, getCellAlign };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getCellAlign
3
- } from "../chunk-A7CXRZIO.js";
3
+ } from "../chunk-2BPFXK4L.js";
4
4
  import "../chunk-N552FDTV.js";
5
5
  export {
6
6
  getCellAlign
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __defProps = Object.defineProperties;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
10
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
11
+ var __spreadValues = (a, b) => {
12
+ for (var prop in b || (b = {}))
13
+ if (__hasOwnProp.call(b, prop))
14
+ __defNormalProp(a, prop, b[prop]);
15
+ if (__getOwnPropSymbols)
16
+ for (var prop of __getOwnPropSymbols(b)) {
17
+ if (__propIsEnum.call(b, prop))
18
+ __defNormalProp(a, prop, b[prop]);
19
+ }
20
+ return a;
21
+ };
22
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
23
+ var __export = (target, all) => {
24
+ for (var name in all)
25
+ __defProp(target, name, { get: all[name], enumerable: true });
26
+ };
27
+ var __copyProps = (to, from, except, desc) => {
28
+ if (from && typeof from === "object" || typeof from === "function") {
29
+ for (let key of __getOwnPropNames(from))
30
+ if (!__hasOwnProp.call(to, key) && key !== except)
31
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
32
+ }
33
+ return to;
34
+ };
35
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
36
+
37
+ // src/utils/get-column-meta.ts
38
+ var get_column_meta_exports = {};
39
+ __export(get_column_meta_exports, {
40
+ getColumnMeta: () => getColumnMeta
41
+ });
42
+ module.exports = __toCommonJS(get_column_meta_exports);
43
+
44
+ // src/utils/get-cell-align.ts
45
+ var getCellAlign = (type) => {
46
+ switch (type) {
47
+ case "number":
48
+ case "date":
49
+ case "time":
50
+ return "right";
51
+ case "string":
52
+ case "button":
53
+ return "left";
54
+ default:
55
+ return type;
56
+ }
57
+ };
58
+
59
+ // src/utils/get-column-meta.ts
60
+ var getColumnMeta = (meta) => {
61
+ return __spreadProps(__spreadValues({}, meta), {
62
+ align: getCellAlign(meta.align || "left")
63
+ });
64
+ };
65
+ // Annotate the CommonJS export names for ESM import in node:
66
+ 0 && (module.exports = {
67
+ getColumnMeta
68
+ });
69
+ //# sourceMappingURL=get-column-meta.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/utils/get-column-meta.ts","../../src/utils/get-cell-align.ts"],"sourcesContent":["import type { RowData } from '@tanstack/react-table';\nimport type { CellDataType } from './get-cell-align';\nimport { getCellAlign } from './get-cell-align';\n\ntype ExpandButtonComp = <Data extends RowData>(props: {\n open: boolean;\n setIsOpen: (value: boolean) => void;\n data: Data;\n}) => React.ReactNode;\n\nexport interface ColumnMeta {\n OpenBtn?: ExpandButtonComp;\n /** 셀의 가로 너비 지정을 number가 아닌 auto로 사용하고 싶을 경우.\n * 테이블 당 하나의 셀에만 사용하기를 권장\n */\n autoSize?: boolean;\n /** 좌/우/중앙 정렬 설정의 기준, dataType을 우선해 사용 */\n align?: CellDataType;\n}\n\nexport const getColumnMeta = (meta: ColumnMeta): ColumnMeta => {\n return {\n ...meta,\n align: getCellAlign(meta.align || 'left'),\n };\n};\n","export type CellAlign = 'left' | 'center' | 'right';\n\nexport type CellDataType =\n | 'number'\n | 'date'\n | 'time'\n | 'string'\n | 'button'\n | CellAlign;\n\nexport const getCellAlign = (type: CellDataType): CellAlign => {\n switch (type) {\n case 'number':\n case 'date':\n case 'time':\n return 'right';\n case 'string':\n case 'button':\n return 'left';\n default:\n return type;\n }\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACUO,IAAM,eAAe,CAAC,SAAkC;AAC7D,UAAQ,MAAM;AAAA,IACZ,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AAAA,IACL,KAAK;AACH,aAAO;AAAA,IACT;AACE,aAAO;AAAA,EACX;AACF;;;ADFO,IAAM,gBAAgB,CAAC,SAAiC;AAC7D,SAAO,iCACF,OADE;AAAA,IAEL,OAAO,aAAa,KAAK,SAAS,MAAM;AAAA,EAC1C;AACF;","names":[]}
@@ -0,0 +1,20 @@
1
+ import { RowData } from '@tanstack/react-table';
2
+ import { CellDataType } from './get-cell-align.cjs';
3
+
4
+ type ExpandButtonComp = <Data extends RowData>(props: {
5
+ open: boolean;
6
+ setIsOpen: (value: boolean) => void;
7
+ data: Data;
8
+ }) => React.ReactNode;
9
+ interface ColumnMeta {
10
+ OpenBtn?: ExpandButtonComp;
11
+ /** 셀의 가로 너비 지정을 number가 아닌 auto로 사용하고 싶을 경우.
12
+ * 테이블 당 하나의 셀에만 사용하기를 권장
13
+ */
14
+ autoSize?: boolean;
15
+ /** 좌/우/중앙 정렬 설정의 기준, dataType을 우선해 사용 */
16
+ align?: CellDataType;
17
+ }
18
+ declare const getColumnMeta: (meta: ColumnMeta) => ColumnMeta;
19
+
20
+ export { type ColumnMeta, getColumnMeta };
@@ -0,0 +1,20 @@
1
+ import { RowData } from '@tanstack/react-table';
2
+ import { CellDataType } from './get-cell-align.js';
3
+
4
+ type ExpandButtonComp = <Data extends RowData>(props: {
5
+ open: boolean;
6
+ setIsOpen: (value: boolean) => void;
7
+ data: Data;
8
+ }) => React.ReactNode;
9
+ interface ColumnMeta {
10
+ OpenBtn?: ExpandButtonComp;
11
+ /** 셀의 가로 너비 지정을 number가 아닌 auto로 사용하고 싶을 경우.
12
+ * 테이블 당 하나의 셀에만 사용하기를 권장
13
+ */
14
+ autoSize?: boolean;
15
+ /** 좌/우/중앙 정렬 설정의 기준, dataType을 우선해 사용 */
16
+ align?: CellDataType;
17
+ }
18
+ declare const getColumnMeta: (meta: ColumnMeta) => ColumnMeta;
19
+
20
+ export { type ColumnMeta, getColumnMeta };
@@ -0,0 +1,9 @@
1
+ import {
2
+ getColumnMeta
3
+ } from "../chunk-W4GH6ZKK.js";
4
+ import "../chunk-2BPFXK4L.js";
5
+ import "../chunk-N552FDTV.js";
6
+ export {
7
+ getColumnMeta
8
+ };
9
+ //# sourceMappingURL=get-column-meta.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,8 +1,25 @@
1
1
  "use strict";
2
2
  var __defProp = Object.defineProperty;
3
+ var __defProps = Object.defineProperties;
3
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
6
  var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
8
  var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
10
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
11
+ var __spreadValues = (a, b) => {
12
+ for (var prop in b || (b = {}))
13
+ if (__hasOwnProp.call(b, prop))
14
+ __defNormalProp(a, prop, b[prop]);
15
+ if (__getOwnPropSymbols)
16
+ for (var prop of __getOwnPropSymbols(b)) {
17
+ if (__propIsEnum.call(b, prop))
18
+ __defNormalProp(a, prop, b[prop]);
19
+ }
20
+ return a;
21
+ };
22
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
6
23
  var __export = (target, all) => {
7
24
  for (var name in all)
8
25
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -21,24 +38,33 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
21
38
  var utils_exports = {};
22
39
  __export(utils_exports, {
23
40
  getCellAlign: () => getCellAlign,
41
+ getColumnMeta: () => getColumnMeta,
24
42
  scrollTo: () => scrollTo
25
43
  });
26
44
  module.exports = __toCommonJS(utils_exports);
27
45
 
28
46
  // src/utils/get-cell-align.ts
29
- var getCellAlign = (arg) => {
30
- const { dataType } = arg;
31
- switch (dataType) {
47
+ var getCellAlign = (type) => {
48
+ switch (type) {
32
49
  case "number":
33
50
  case "date":
34
51
  case "time":
35
52
  return "right";
36
53
  case "string":
37
- default:
54
+ case "button":
38
55
  return "left";
56
+ default:
57
+ return type;
39
58
  }
40
59
  };
41
60
 
61
+ // src/utils/get-column-meta.ts
62
+ var getColumnMeta = (meta) => {
63
+ return __spreadProps(__spreadValues({}, meta), {
64
+ align: getCellAlign(meta.align || "left")
65
+ });
66
+ };
67
+
42
68
  // src/utils/scroll-to.ts
43
69
  function scrollTo(element, targetPosition, duration) {
44
70
  const startPosition = element.scrollTop;
@@ -68,6 +94,7 @@ function scrollTo(element, targetPosition, duration) {
68
94
  // Annotate the CommonJS export names for ESM import in node:
69
95
  0 && (module.exports = {
70
96
  getCellAlign,
97
+ getColumnMeta,
71
98
  scrollTo
72
99
  });
73
100
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/index.ts","../../src/utils/get-cell-align.ts","../../src/utils/scroll-to.ts"],"sourcesContent":["export * from './get-cell-align';\nexport * from './scroll-to';\n","export type CellDataType = 'number' | 'date' | 'time' | 'string' | 'button';\nexport type CellAlign = 'left' | 'center' | 'right';\n\nexport const getCellAlign = (arg: { dataType: CellDataType }): CellAlign => {\n const { dataType } = arg;\n\n switch (dataType) {\n case 'number':\n case 'date':\n case 'time':\n return 'right';\n case 'string':\n default:\n return 'left';\n }\n};\n","export function scrollTo(\n element: HTMLDivElement,\n targetPosition: number,\n duration: number\n): void {\n const startPosition = element.scrollTop;\n const distance = targetPosition - startPosition;\n let startTime: number | null = null;\n\n function animation(currentTime: number): void {\n if (startTime === null) startTime = currentTime;\n const timeElapsed = currentTime - startTime;\n const run = ease(timeElapsed, startPosition, distance, duration);\n element.scrollTop = run;\n if (timeElapsed < duration) {\n requestAnimationFrame(animation);\n }\n }\n\n function ease(t: number, b: number, c: number, d: number): number {\n let [t2] = [t];\n const [b2, c2, d2] = [b, c, d];\n t2 /= d2 / 2;\n if (t2 < 1) return (c2 / 2) * t2 * t2 + b2;\n t2--;\n return (-c2 / 2) * (t2 * (t2 - 2) - 1) + b2;\n }\n\n requestAnimationFrame(animation);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACGO,IAAM,eAAe,CAAC,QAA+C;AAC1E,QAAM,EAAE,SAAS,IAAI;AAErB,UAAQ,UAAU;AAAA,IAChB,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AAAA,IACL;AACE,aAAO;AAAA,EACX;AACF;;;ACfO,SAAS,SACd,SACA,gBACA,UACM;AACN,QAAM,gBAAgB,QAAQ;AAC9B,QAAM,WAAW,iBAAiB;AAClC,MAAI,YAA2B;AAE/B,WAAS,UAAU,aAA2B;AAC5C,QAAI,cAAc;AAAM,kBAAY;AACpC,UAAM,cAAc,cAAc;AAClC,UAAM,MAAM,KAAK,aAAa,eAAe,UAAU,QAAQ;AAC/D,YAAQ,YAAY;AACpB,QAAI,cAAc,UAAU;AAC1B,4BAAsB,SAAS;AAAA,IACjC;AAAA,EACF;AAEA,WAAS,KAAK,GAAW,GAAW,GAAW,GAAmB;AAChE,QAAI,CAAC,EAAE,IAAI,CAAC,CAAC;AACb,UAAM,CAAC,IAAI,IAAI,EAAE,IAAI,CAAC,GAAG,GAAG,CAAC;AAC7B,UAAM,KAAK;AACX,QAAI,KAAK;AAAG,aAAQ,KAAK,IAAK,KAAK,KAAK;AACxC;AACA,WAAQ,CAAC,KAAK,KAAM,MAAM,KAAK,KAAK,KAAK;AAAA,EAC3C;AAEA,wBAAsB,SAAS;AACjC;","names":[]}
1
+ {"version":3,"sources":["../../src/utils/index.ts","../../src/utils/get-cell-align.ts","../../src/utils/get-column-meta.ts","../../src/utils/scroll-to.ts"],"sourcesContent":["export * from './get-cell-align';\nexport * from './get-column-meta';\nexport * from './scroll-to';\n","export type CellAlign = 'left' | 'center' | 'right';\n\nexport type CellDataType =\n | 'number'\n | 'date'\n | 'time'\n | 'string'\n | 'button'\n | CellAlign;\n\nexport const getCellAlign = (type: CellDataType): CellAlign => {\n switch (type) {\n case 'number':\n case 'date':\n case 'time':\n return 'right';\n case 'string':\n case 'button':\n return 'left';\n default:\n return type;\n }\n};\n","import type { RowData } from '@tanstack/react-table';\nimport type { CellDataType } from './get-cell-align';\nimport { getCellAlign } from './get-cell-align';\n\ntype ExpandButtonComp = <Data extends RowData>(props: {\n open: boolean;\n setIsOpen: (value: boolean) => void;\n data: Data;\n}) => React.ReactNode;\n\nexport interface ColumnMeta {\n OpenBtn?: ExpandButtonComp;\n /** 셀의 가로 너비 지정을 number가 아닌 auto로 사용하고 싶을 경우.\n * 테이블 당 하나의 셀에만 사용하기를 권장\n */\n autoSize?: boolean;\n /** 좌/우/중앙 정렬 설정의 기준, dataType을 우선해 사용 */\n align?: CellDataType;\n}\n\nexport const getColumnMeta = (meta: ColumnMeta): ColumnMeta => {\n return {\n ...meta,\n align: getCellAlign(meta.align || 'left'),\n };\n};\n","export function scrollTo(\n element: HTMLDivElement,\n targetPosition: number,\n duration: number\n): void {\n const startPosition = element.scrollTop;\n const distance = targetPosition - startPosition;\n let startTime: number | null = null;\n\n function animation(currentTime: number): void {\n if (startTime === null) startTime = currentTime;\n const timeElapsed = currentTime - startTime;\n const run = ease(timeElapsed, startPosition, distance, duration);\n element.scrollTop = run;\n if (timeElapsed < duration) {\n requestAnimationFrame(animation);\n }\n }\n\n function ease(t: number, b: number, c: number, d: number): number {\n let [t2] = [t];\n const [b2, c2, d2] = [b, c, d];\n t2 /= d2 / 2;\n if (t2 < 1) return (c2 / 2) * t2 * t2 + b2;\n t2--;\n return (-c2 / 2) * (t2 * (t2 - 2) - 1) + b2;\n }\n\n requestAnimationFrame(animation);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACUO,IAAM,eAAe,CAAC,SAAkC;AAC7D,UAAQ,MAAM;AAAA,IACZ,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AAAA,IACL,KAAK;AACH,aAAO;AAAA,IACT;AACE,aAAO;AAAA,EACX;AACF;;;ACFO,IAAM,gBAAgB,CAAC,SAAiC;AAC7D,SAAO,iCACF,OADE;AAAA,IAEL,OAAO,aAAa,KAAK,SAAS,MAAM;AAAA,EAC1C;AACF;;;ACzBO,SAAS,SACd,SACA,gBACA,UACM;AACN,QAAM,gBAAgB,QAAQ;AAC9B,QAAM,WAAW,iBAAiB;AAClC,MAAI,YAA2B;AAE/B,WAAS,UAAU,aAA2B;AAC5C,QAAI,cAAc;AAAM,kBAAY;AACpC,UAAM,cAAc,cAAc;AAClC,UAAM,MAAM,KAAK,aAAa,eAAe,UAAU,QAAQ;AAC/D,YAAQ,YAAY;AACpB,QAAI,cAAc,UAAU;AAC1B,4BAAsB,SAAS;AAAA,IACjC;AAAA,EACF;AAEA,WAAS,KAAK,GAAW,GAAW,GAAW,GAAmB;AAChE,QAAI,CAAC,EAAE,IAAI,CAAC,CAAC;AACb,UAAM,CAAC,IAAI,IAAI,EAAE,IAAI,CAAC,GAAG,GAAG,CAAC;AAC7B,UAAM,KAAK;AACX,QAAI,KAAK;AAAG,aAAQ,KAAK,IAAK,KAAK,KAAK;AACxC;AACA,WAAQ,CAAC,KAAK,KAAM,MAAM,KAAK,KAAK,KAAK;AAAA,EAC3C;AAEA,wBAAsB,SAAS;AACjC;","names":[]}
@@ -1,2 +1,4 @@
1
1
  export { CellAlign, CellDataType, getCellAlign } from './get-cell-align.cjs';
2
+ export { ColumnMeta, getColumnMeta } from './get-column-meta.cjs';
2
3
  export { scrollTo } from './scroll-to.cjs';
4
+ import '@tanstack/react-table';
@@ -1,2 +1,4 @@
1
1
  export { CellAlign, CellDataType, getCellAlign } from './get-cell-align.js';
2
+ export { ColumnMeta, getColumnMeta } from './get-column-meta.js';
2
3
  export { scrollTo } from './scroll-to.js';
4
+ import '@tanstack/react-table';
@@ -1,13 +1,17 @@
1
- import "../chunk-DRBRT57F.js";
1
+ import "../chunk-ZQ4XMJH7.js";
2
+ import {
3
+ getColumnMeta
4
+ } from "../chunk-W4GH6ZKK.js";
2
5
  import {
3
6
  getCellAlign
4
- } from "../chunk-A7CXRZIO.js";
7
+ } from "../chunk-2BPFXK4L.js";
5
8
  import {
6
9
  scrollTo
7
10
  } from "../chunk-ZXQZRIRS.js";
8
11
  import "../chunk-N552FDTV.js";
9
12
  export {
10
13
  getCellAlign,
14
+ getColumnMeta,
11
15
  scrollTo
12
16
  };
13
17
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tipp/ui",
3
- "version": "1.4.2",
3
+ "version": "1.4.4",
4
4
  "private": false,
5
5
  "sideEffects": false,
6
6
  "type": "module",
@@ -1,16 +1,23 @@
1
- export type CellDataType = 'number' | 'date' | 'time' | 'string' | 'button';
2
1
  export type CellAlign = 'left' | 'center' | 'right';
3
2
 
4
- export const getCellAlign = (arg: { dataType: CellDataType }): CellAlign => {
5
- const { dataType } = arg;
3
+ export type CellDataType =
4
+ | 'number'
5
+ | 'date'
6
+ | 'time'
7
+ | 'string'
8
+ | 'button'
9
+ | CellAlign;
6
10
 
7
- switch (dataType) {
11
+ export const getCellAlign = (type: CellDataType): CellAlign => {
12
+ switch (type) {
8
13
  case 'number':
9
14
  case 'date':
10
15
  case 'time':
11
16
  return 'right';
12
17
  case 'string':
13
- default:
18
+ case 'button':
14
19
  return 'left';
20
+ default:
21
+ return type;
15
22
  }
16
23
  };
@@ -0,0 +1,26 @@
1
+ import type { RowData } from '@tanstack/react-table';
2
+ import type { CellDataType } from './get-cell-align';
3
+ import { getCellAlign } from './get-cell-align';
4
+
5
+ type ExpandButtonComp = <Data extends RowData>(props: {
6
+ open: boolean;
7
+ setIsOpen: (value: boolean) => void;
8
+ data: Data;
9
+ }) => React.ReactNode;
10
+
11
+ export interface ColumnMeta {
12
+ OpenBtn?: ExpandButtonComp;
13
+ /** 셀의 가로 너비 지정을 number가 아닌 auto로 사용하고 싶을 경우.
14
+ * 테이블 당 하나의 셀에만 사용하기를 권장
15
+ */
16
+ autoSize?: boolean;
17
+ /** 좌/우/중앙 정렬 설정의 기준, dataType을 우선해 사용 */
18
+ align?: CellDataType;
19
+ }
20
+
21
+ export const getColumnMeta = (meta: ColumnMeta): ColumnMeta => {
22
+ return {
23
+ ...meta,
24
+ align: getCellAlign(meta.align || 'left'),
25
+ };
26
+ };
@@ -1,2 +1,3 @@
1
1
  export * from './get-cell-align';
2
+ export * from './get-column-meta';
2
3
  export * from './scroll-to';