@ngnyan/data-table 1.0.5

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/README.md ADDED
@@ -0,0 +1,16 @@
1
+ # React + Vite
2
+
3
+ This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
4
+
5
+ Currently, two official plugins are available:
6
+
7
+ - [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) (or [oxc](https://oxc.rs) when used in [rolldown-vite](https://vite.dev/guide/rolldown)) for Fast Refresh
8
+ - [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
9
+
10
+ ## React Compiler
11
+
12
+ The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see [this documentation](https://react.dev/learn/react-compiler/installation).
13
+
14
+ ## Expanding the ESLint configuration
15
+
16
+ If you are developing a production application, we recommend using TypeScript with type-aware lint rules enabled. Check out the [TS template](https://github.com/vitejs/vite/tree/main/packages/create-vite/template-react-ts) for information on how to integrate TypeScript and [`typescript-eslint`](https://typescript-eslint.io) in your project.
@@ -0,0 +1 @@
1
+ .datatable{width:80%;border-collapse:separate;border-spacing:0;border-radius:10px;overflow:hidden}.datatable__th{text-align:center}.datatable__td{text-align:left;font-size:.8rem}.datatable__th,.datatable__td{padding:8px 12px}
@@ -0,0 +1,361 @@
1
+ import ee from "react";
2
+ var x = { exports: {} }, _ = {};
3
+ var I;
4
+ function re() {
5
+ if (I) return _;
6
+ I = 1;
7
+ var a = /* @__PURE__ */ Symbol.for("react.transitional.element"), s = /* @__PURE__ */ Symbol.for("react.fragment");
8
+ function i(u, t, c) {
9
+ var b = null;
10
+ if (c !== void 0 && (b = "" + c), t.key !== void 0 && (b = "" + t.key), "key" in t) {
11
+ c = {};
12
+ for (var d in t)
13
+ d !== "key" && (c[d] = t[d]);
14
+ } else c = t;
15
+ return t = c.ref, {
16
+ $$typeof: a,
17
+ type: u,
18
+ key: b,
19
+ ref: t !== void 0 ? t : null,
20
+ props: c
21
+ };
22
+ }
23
+ return _.Fragment = s, _.jsx = i, _.jsxs = i, _;
24
+ }
25
+ var E = {};
26
+ var L;
27
+ function te() {
28
+ return L || (L = 1, process.env.NODE_ENV !== "production" && (function() {
29
+ function a(e) {
30
+ if (e == null) return null;
31
+ if (typeof e == "function")
32
+ return e.$$typeof === Z ? null : e.displayName || e.name || null;
33
+ if (typeof e == "string") return e;
34
+ switch (e) {
35
+ case h:
36
+ return "Fragment";
37
+ case q:
38
+ return "Profiler";
39
+ case U:
40
+ return "StrictMode";
41
+ case G:
42
+ return "Suspense";
43
+ case X:
44
+ return "SuspenseList";
45
+ case H:
46
+ return "Activity";
47
+ }
48
+ if (typeof e == "object")
49
+ switch (typeof e.tag == "number" && console.error(
50
+ "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
51
+ ), e.$$typeof) {
52
+ case W:
53
+ return "Portal";
54
+ case V:
55
+ return e.displayName || "Context";
56
+ case J:
57
+ return (e._context.displayName || "Context") + ".Consumer";
58
+ case z:
59
+ var r = e.render;
60
+ return e = e.displayName, e || (e = r.displayName || r.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
61
+ case B:
62
+ return r = e.displayName || null, r !== null ? r : a(e.type) || "Memo";
63
+ case j:
64
+ r = e._payload, e = e._init;
65
+ try {
66
+ return a(e(r));
67
+ } catch {
68
+ }
69
+ }
70
+ return null;
71
+ }
72
+ function s(e) {
73
+ return "" + e;
74
+ }
75
+ function i(e) {
76
+ try {
77
+ s(e);
78
+ var r = !1;
79
+ } catch {
80
+ r = !0;
81
+ }
82
+ if (r) {
83
+ r = console;
84
+ var n = r.error, o = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
85
+ return n.call(
86
+ r,
87
+ "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
88
+ o
89
+ ), s(e);
90
+ }
91
+ }
92
+ function u(e) {
93
+ if (e === h) return "<>";
94
+ if (typeof e == "object" && e !== null && e.$$typeof === j)
95
+ return "<...>";
96
+ try {
97
+ var r = a(e);
98
+ return r ? "<" + r + ">" : "<...>";
99
+ } catch {
100
+ return "<...>";
101
+ }
102
+ }
103
+ function t() {
104
+ var e = y.A;
105
+ return e === null ? null : e.getOwner();
106
+ }
107
+ function c() {
108
+ return Error("react-stack-top-frame");
109
+ }
110
+ function b(e) {
111
+ if (N.call(e, "key")) {
112
+ var r = Object.getOwnPropertyDescriptor(e, "key").get;
113
+ if (r && r.isReactWarning) return !1;
114
+ }
115
+ return e.key !== void 0;
116
+ }
117
+ function d(e, r) {
118
+ function n() {
119
+ C || (C = !0, console.error(
120
+ "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
121
+ r
122
+ ));
123
+ }
124
+ n.isReactWarning = !0, Object.defineProperty(e, "key", {
125
+ get: n,
126
+ configurable: !0
127
+ });
128
+ }
129
+ function p() {
130
+ var e = a(this.type);
131
+ return F[e] || (F[e] = !0, console.error(
132
+ "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
133
+ )), e = this.props.ref, e !== void 0 ? e : null;
134
+ }
135
+ function k(e, r, n, o, T, g) {
136
+ var l = n.ref;
137
+ return e = {
138
+ $$typeof: w,
139
+ type: e,
140
+ key: r,
141
+ props: n,
142
+ _owner: o
143
+ }, (l !== void 0 ? l : null) !== null ? Object.defineProperty(e, "ref", {
144
+ enumerable: !1,
145
+ get: p
146
+ }) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
147
+ configurable: !1,
148
+ enumerable: !1,
149
+ writable: !0,
150
+ value: 0
151
+ }), Object.defineProperty(e, "_debugInfo", {
152
+ configurable: !1,
153
+ enumerable: !1,
154
+ writable: !0,
155
+ value: null
156
+ }), Object.defineProperty(e, "_debugStack", {
157
+ configurable: !1,
158
+ enumerable: !1,
159
+ writable: !0,
160
+ value: T
161
+ }), Object.defineProperty(e, "_debugTask", {
162
+ configurable: !1,
163
+ enumerable: !1,
164
+ writable: !0,
165
+ value: g
166
+ }), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
167
+ }
168
+ function R(e, r, n, o, T, g) {
169
+ var l = r.children;
170
+ if (l !== void 0)
171
+ if (o)
172
+ if (Q(l)) {
173
+ for (o = 0; o < l.length; o++)
174
+ A(l[o]);
175
+ Object.freeze && Object.freeze(l);
176
+ } else
177
+ console.error(
178
+ "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
179
+ );
180
+ else A(l);
181
+ if (N.call(r, "key")) {
182
+ l = a(e);
183
+ var m = Object.keys(r).filter(function(K) {
184
+ return K !== "key";
185
+ });
186
+ o = 0 < m.length ? "{key: someKey, " + m.join(": ..., ") + ": ...}" : "{key: someKey}", $[l + o] || (m = 0 < m.length ? "{" + m.join(": ..., ") + ": ...}" : "{}", console.error(
187
+ `A props object containing a "key" prop is being spread into JSX:
188
+ let props = %s;
189
+ <%s {...props} />
190
+ React keys must be passed directly to JSX without using spread:
191
+ let props = %s;
192
+ <%s key={someKey} {...props} />`,
193
+ o,
194
+ l,
195
+ m,
196
+ l
197
+ ), $[l + o] = !0);
198
+ }
199
+ if (l = null, n !== void 0 && (i(n), l = "" + n), b(r) && (i(r.key), l = "" + r.key), "key" in r) {
200
+ n = {};
201
+ for (var S in r)
202
+ S !== "key" && (n[S] = r[S]);
203
+ } else n = r;
204
+ return l && d(
205
+ n,
206
+ typeof e == "function" ? e.displayName || e.name || "Unknown" : e
207
+ ), k(
208
+ e,
209
+ l,
210
+ n,
211
+ t(),
212
+ T,
213
+ g
214
+ );
215
+ }
216
+ function A(e) {
217
+ P(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === j && (e._payload.status === "fulfilled" ? P(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
218
+ }
219
+ function P(e) {
220
+ return typeof e == "object" && e !== null && e.$$typeof === w;
221
+ }
222
+ var v = ee, w = /* @__PURE__ */ Symbol.for("react.transitional.element"), W = /* @__PURE__ */ Symbol.for("react.portal"), h = /* @__PURE__ */ Symbol.for("react.fragment"), U = /* @__PURE__ */ Symbol.for("react.strict_mode"), q = /* @__PURE__ */ Symbol.for("react.profiler"), J = /* @__PURE__ */ Symbol.for("react.consumer"), V = /* @__PURE__ */ Symbol.for("react.context"), z = /* @__PURE__ */ Symbol.for("react.forward_ref"), G = /* @__PURE__ */ Symbol.for("react.suspense"), X = /* @__PURE__ */ Symbol.for("react.suspense_list"), B = /* @__PURE__ */ Symbol.for("react.memo"), j = /* @__PURE__ */ Symbol.for("react.lazy"), H = /* @__PURE__ */ Symbol.for("react.activity"), Z = /* @__PURE__ */ Symbol.for("react.client.reference"), y = v.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, N = Object.prototype.hasOwnProperty, Q = Array.isArray, O = console.createTask ? console.createTask : function() {
223
+ return null;
224
+ };
225
+ v = {
226
+ react_stack_bottom_frame: function(e) {
227
+ return e();
228
+ }
229
+ };
230
+ var C, F = {}, Y = v.react_stack_bottom_frame.bind(
231
+ v,
232
+ c
233
+ )(), D = O(u(c)), $ = {};
234
+ E.Fragment = h, E.jsx = function(e, r, n) {
235
+ var o = 1e4 > y.recentlyCreatedOwnerStacks++;
236
+ return R(
237
+ e,
238
+ r,
239
+ n,
240
+ !1,
241
+ o ? Error("react-stack-top-frame") : Y,
242
+ o ? O(u(e)) : D
243
+ );
244
+ }, E.jsxs = function(e, r, n) {
245
+ var o = 1e4 > y.recentlyCreatedOwnerStacks++;
246
+ return R(
247
+ e,
248
+ r,
249
+ n,
250
+ !0,
251
+ o ? Error("react-stack-top-frame") : Y,
252
+ o ? O(u(e)) : D
253
+ );
254
+ };
255
+ })()), E;
256
+ }
257
+ var M;
258
+ function ae() {
259
+ return M || (M = 1, process.env.NODE_ENV === "production" ? x.exports = re() : x.exports = te()), x.exports;
260
+ }
261
+ var f = ae();
262
+ function ne({
263
+ columns: a,
264
+ getCellStyle: s,
265
+ headerBgColor: i,
266
+ headerFontColor: u
267
+ }) {
268
+ return /* @__PURE__ */ f.jsx("thead", { children: /* @__PURE__ */ f.jsx("tr", { children: a.map((t, c) => /* @__PURE__ */ f.jsx(
269
+ "th",
270
+ {
271
+ className: "datatable__th",
272
+ style: {
273
+ ...s(c),
274
+ backgroundColor: i,
275
+ color: u
276
+ },
277
+ children: t.title
278
+ },
279
+ t.key
280
+ )) }) });
281
+ }
282
+ function oe({ value: a, style: s }) {
283
+ return /* @__PURE__ */ f.jsx("td", { className: "datatable__td", style: s, children: a ?? "" });
284
+ }
285
+ function le({ row: a, columns: s, getCellStyle: i, isLastRow: u }) {
286
+ return /* @__PURE__ */ f.jsx("tr", { children: s.map((t) => /* @__PURE__ */ f.jsx(
287
+ oe,
288
+ {
289
+ value: a[t.key],
290
+ style: i(s.indexOf(t), u)
291
+ },
292
+ t.key
293
+ )) });
294
+ }
295
+ function se({ data: a, columns: s, getCellStyle: i }) {
296
+ return /* @__PURE__ */ f.jsx("tbody", { children: a.map((u, t) => /* @__PURE__ */ f.jsx(
297
+ le,
298
+ {
299
+ row: u,
300
+ columns: s,
301
+ getCellStyle: i,
302
+ isLastRow: t === a.length - 1
303
+ },
304
+ u.id ?? t
305
+ )) });
306
+ }
307
+ function ce({
308
+ columns: a,
309
+ data: s,
310
+ headerBgColor: i = "#cccccc",
311
+ headerFontColor: u = "#FFFFFF",
312
+ fontFamily: t = "sans-serif",
313
+ borderColor: c = "#000000",
314
+ boxShadow: b = "0px 4px 12px rgba(0, 0, 0, 0.15)"
315
+ }) {
316
+ if (!a || a.length === 0)
317
+ return /* @__PURE__ */ f.jsx("p", { children: "No columns defined." });
318
+ if (!s || s.length === 0)
319
+ return /* @__PURE__ */ f.jsx("p", { children: "No data available." });
320
+ const d = `0.5px solid ${c}`, p = (k, R = !1) => ({
321
+ borderTop: "none",
322
+ borderBottom: R ? "none" : d,
323
+ borderLeft: "none",
324
+ borderRight: k === a.length - 1 ? "none" : d
325
+ });
326
+ return /* @__PURE__ */ f.jsxs(
327
+ "table",
328
+ {
329
+ className: "datatable",
330
+ style: { fontFamily: t, border: d, boxShadow: b },
331
+ role: "table",
332
+ "aria-label": "Data table",
333
+ children: [
334
+ /* @__PURE__ */ f.jsx(
335
+ ne,
336
+ {
337
+ columns: a,
338
+ getCellStyle: p,
339
+ headerBgColor: i,
340
+ headerFontColor: u
341
+ }
342
+ ),
343
+ /* @__PURE__ */ f.jsx(
344
+ se,
345
+ {
346
+ data: s,
347
+ columns: a,
348
+ getCellStyle: p
349
+ }
350
+ )
351
+ ]
352
+ }
353
+ );
354
+ }
355
+ export {
356
+ ce as DataTable,
357
+ se as DataTableBody,
358
+ oe as DataTableCell,
359
+ ne as DataTableHeader,
360
+ le as DataTableRow
361
+ };
@@ -0,0 +1,6 @@
1
+ (function(d,E){typeof exports=="object"&&typeof module<"u"?E(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],E):(d=typeof globalThis<"u"?globalThis:d||self,E(d.DataTable={},d.React))})(this,(function(d,E){"use strict";var p={exports:{}},T={};var w;function G(){if(w)return T;w=1;var a=Symbol.for("react.transitional.element"),s=Symbol.for("react.fragment");function f(u,t,i){var m=null;if(i!==void 0&&(m=""+i),t.key!==void 0&&(m=""+t.key),"key"in t){i={};for(var b in t)b!=="key"&&(i[b]=t[b])}else i=t;return t=i.ref,{$$typeof:a,type:u,key:m,ref:t!==void 0?t:null,props:i}}return T.Fragment=s,T.jsx=f,T.jsxs=f,T}var R={};var N;function B(){return N||(N=1,process.env.NODE_ENV!=="production"&&(function(){function a(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===se?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case x:return"Fragment";case K:return"Profiler";case Q:return"StrictMode";case ae:return"Suspense";case ne:return"SuspenseList";case le:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case Z:return"Portal";case re:return e.displayName||"Context";case ee:return(e._context.displayName||"Context")+".Consumer";case te:var r=e.render;return e=e.displayName,e||(e=r.displayName||r.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case oe:return r=e.displayName||null,r!==null?r:a(e.type)||"Memo";case O:r=e._payload,e=e._init;try{return a(e(r))}catch{}}return null}function s(e){return""+e}function f(e){try{s(e);var r=!1}catch{r=!0}if(r){r=console;var n=r.error,o=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return n.call(r,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",o),s(e)}}function u(e){if(e===x)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===O)return"<...>";try{var r=a(e);return r?"<"+r+">":"<...>"}catch{return"<...>"}}function t(){var e=S.A;return e===null?null:e.getOwner()}function i(){return Error("react-stack-top-frame")}function m(e){if(W.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function b(e,r){function n(){U||(U=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",r))}n.isReactWarning=!0,Object.defineProperty(e,"key",{get:n,configurable:!0})}function v(){var e=a(this.type);return q[e]||(q[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function j(e,r,n,o,k,A){var l=n.ref;return e={$$typeof:M,type:e,key:r,props:n,_owner:o},(l!==void 0?l:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:v}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:k}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:A}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function h(e,r,n,o,k,A){var l=r.children;if(l!==void 0)if(o)if(ue(l)){for(o=0;o<l.length;o++)I(l[o]);Object.freeze&&Object.freeze(l)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else I(l);if(W.call(r,"key")){l=a(e);var _=Object.keys(r).filter(function(ie){return ie!=="key"});o=0<_.length?"{key: someKey, "+_.join(": ..., ")+": ...}":"{key: someKey}",z[l+o]||(_=0<_.length?"{"+_.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
2
+ let props = %s;
3
+ <%s {...props} />
4
+ React keys must be passed directly to JSX without using spread:
5
+ let props = %s;
6
+ <%s key={someKey} {...props} />`,o,l,_,l),z[l+o]=!0)}if(l=null,n!==void 0&&(f(n),l=""+n),m(r)&&(f(r.key),l=""+r.key),"key"in r){n={};for(var P in r)P!=="key"&&(n[P]=r[P])}else n=r;return l&&b(n,typeof e=="function"?e.displayName||e.name||"Unknown":e),j(e,l,n,t(),k,A)}function I(e){L(e)?e._store&&(e._store.validated=1):typeof e=="object"&&e!==null&&e.$$typeof===O&&(e._payload.status==="fulfilled"?L(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function L(e){return typeof e=="object"&&e!==null&&e.$$typeof===M}var y=E,M=Symbol.for("react.transitional.element"),Z=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),Q=Symbol.for("react.strict_mode"),K=Symbol.for("react.profiler"),ee=Symbol.for("react.consumer"),re=Symbol.for("react.context"),te=Symbol.for("react.forward_ref"),ae=Symbol.for("react.suspense"),ne=Symbol.for("react.suspense_list"),oe=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),le=Symbol.for("react.activity"),se=Symbol.for("react.client.reference"),S=y.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W=Object.prototype.hasOwnProperty,ue=Array.isArray,g=console.createTask?console.createTask:function(){return null};y={react_stack_bottom_frame:function(e){return e()}};var U,q={},J=y.react_stack_bottom_frame.bind(y,i)(),V=g(u(i)),z={};R.Fragment=x,R.jsx=function(e,r,n){var o=1e4>S.recentlyCreatedOwnerStacks++;return h(e,r,n,!1,o?Error("react-stack-top-frame"):J,o?g(u(e)):V)},R.jsxs=function(e,r,n){var o=1e4>S.recentlyCreatedOwnerStacks++;return h(e,r,n,!0,o?Error("react-stack-top-frame"):J,o?g(u(e)):V)}})()),R}var C;function X(){return C||(C=1,process.env.NODE_ENV==="production"?p.exports=G():p.exports=B()),p.exports}var c=X();function D({columns:a,getCellStyle:s,headerBgColor:f,headerFontColor:u}){return c.jsx("thead",{children:c.jsx("tr",{children:a.map((t,i)=>c.jsx("th",{className:"datatable__th",style:{...s(i),backgroundColor:f,color:u},children:t.title},t.key))})})}function F({value:a,style:s}){return c.jsx("td",{className:"datatable__td",style:s,children:a??""})}function Y({row:a,columns:s,getCellStyle:f,isLastRow:u}){return c.jsx("tr",{children:s.map(t=>c.jsx(F,{value:a[t.key],style:f(s.indexOf(t),u)},t.key))})}function $({data:a,columns:s,getCellStyle:f}){return c.jsx("tbody",{children:a.map((u,t)=>c.jsx(Y,{row:u,columns:s,getCellStyle:f,isLastRow:t===a.length-1},u.id??t))})}function H({columns:a,data:s,headerBgColor:f="#cccccc",headerFontColor:u="#FFFFFF",fontFamily:t="sans-serif",borderColor:i="#000000",boxShadow:m="0px 4px 12px rgba(0, 0, 0, 0.15)"}){if(!a||a.length===0)return c.jsx("p",{children:"No columns defined."});if(!s||s.length===0)return c.jsx("p",{children:"No data available."});const b=`0.5px solid ${i}`,v=(j,h=!1)=>({borderTop:"none",borderBottom:h?"none":b,borderLeft:"none",borderRight:j===a.length-1?"none":b});return c.jsxs("table",{className:"datatable",style:{fontFamily:t,border:b,boxShadow:m},role:"table","aria-label":"Data table",children:[c.jsx(D,{columns:a,getCellStyle:v,headerBgColor:f,headerFontColor:u}),c.jsx($,{data:s,columns:a,getCellStyle:v})]})}d.DataTable=H,d.DataTableBody=$,d.DataTableCell=F,d.DataTableHeader=D,d.DataTableRow=Y,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})}));
package/package.json ADDED
@@ -0,0 +1,43 @@
1
+ {
2
+ "name": "@ngnyan/data-table",
3
+ "version": "1.0.5",
4
+ "type": "module",
5
+ "main": "dist/data-table.umd.js",
6
+ "module": "dist/data-table.es.js",
7
+ "types": "dist/index.d.ts",
8
+ "files": [
9
+ "dist"
10
+ ],
11
+ "exports": {
12
+ ".": {
13
+ "import": "./dist/data-table.es.js",
14
+ "require": "./dist/data-table.umd.js"
15
+ }
16
+ },
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "https://github.com/NGnYan/HRnet-DataTables.git"
20
+ },
21
+ "homepage": "https://github.com/NGnYan/HRnet-DataTables#readme",
22
+ "scripts": {
23
+ "dev": "vite",
24
+ "build": "vite build",
25
+ "storybook": "storybook dev -p 6006",
26
+ "build-storybook": "storybook build",
27
+ "lint": "eslint ."
28
+ },
29
+ "peerDependencies": {
30
+ "react": "^18.0.0 || ^19.0.0",
31
+ "react-dom": "^18.0.0 || ^19.0.0"
32
+ },
33
+ "devDependencies": {
34
+ "@vitejs/plugin-react": "^5.1.1",
35
+ "vite": "^7.3.1",
36
+ "@types/react": "^19.2.7",
37
+ "@types/react-dom": "^19.2.3",
38
+ "eslint": "^9.39.1",
39
+ "prop-types": "^15.8.1",
40
+ "storybook": "^10.2.12",
41
+ "@storybook/react-vite": "^10.2.12"
42
+ }
43
+ }