phx-react 1.3.933 → 1.3.934
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/TableStatic/TableStatic.d.ts +5 -1
- package/dist/cjs/components/TableStatic/TableStatic.js +13 -10
- package/dist/cjs/components/TableStatic/TableStatic.js.map +1 -1
- package/dist/esm/components/TableStatic/TableStatic.d.ts +5 -1
- package/dist/esm/components/TableStatic/TableStatic.js +13 -10
- package/dist/esm/components/TableStatic/TableStatic.js.map +1 -1
- package/package.json +1 -1
|
@@ -4,6 +4,10 @@ type TTableProps = {
|
|
|
4
4
|
thBody: Array<string>;
|
|
5
5
|
thComponent?: any;
|
|
6
6
|
bodyData: Array<any>;
|
|
7
|
+
numericalOrder?: {
|
|
8
|
+
enable: boolean;
|
|
9
|
+
title: string;
|
|
10
|
+
};
|
|
7
11
|
};
|
|
8
|
-
export declare function PHXTableStatic({ bodyData, thBody, thComponent, thHeader }: TTableProps): React.JSX.Element;
|
|
12
|
+
export declare function PHXTableStatic({ bodyData, numericalOrder, thBody, thComponent, thHeader }: TTableProps): React.JSX.Element;
|
|
9
13
|
export {};
|
|
@@ -5,8 +5,9 @@ exports.PHXTableStatic = void 0;
|
|
|
5
5
|
var tslib_1 = require("tslib");
|
|
6
6
|
var react_1 = tslib_1.__importDefault(require("react"));
|
|
7
7
|
var EmptyRecord_1 = require("../EmptyRecord");
|
|
8
|
+
var types_1 = require("../types");
|
|
8
9
|
function PHXTableStatic(_a) {
|
|
9
|
-
var bodyData = _a.bodyData, thBody = _a.thBody, _b = _a.thComponent, thComponent = _b === void 0 ? {} : _b, thHeader = _a.thHeader;
|
|
10
|
+
var bodyData = _a.bodyData, numericalOrder = _a.numericalOrder, thBody = _a.thBody, _b = _a.thComponent, thComponent = _b === void 0 ? {} : _b, thHeader = _a.thHeader;
|
|
10
11
|
var headers = thHeader.map(function (label, index) { return ({
|
|
11
12
|
key: thBody[index],
|
|
12
13
|
label: label
|
|
@@ -20,18 +21,20 @@ function PHXTableStatic(_a) {
|
|
|
20
21
|
};
|
|
21
22
|
return (react_1["default"].createElement(react_1["default"].Fragment, null, (bodyData === null || bodyData === void 0 ? void 0 : bodyData.length) ? (react_1["default"].createElement("div", { className: 'rounded-lg border border-gray-300 border-opacity-70 bg-white shadow-sm' },
|
|
22
23
|
react_1["default"].createElement("div", { className: '-my-2 overflow-x-auto' },
|
|
23
|
-
react_1["default"].createElement("div", { className: '
|
|
24
|
+
react_1["default"].createElement("div", { className: 'w-full pb-2 pt-0.5 align-middle ring-black ring-opacity-5' },
|
|
24
25
|
react_1["default"].createElement("div", { className: 'relative mt-1.5 overflow-auto' },
|
|
25
26
|
react_1["default"].createElement("table", { className: 'w-full divide-y divide-gray-300' },
|
|
26
27
|
react_1["default"].createElement("thead", null,
|
|
27
|
-
react_1["default"].createElement("tr", null,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
react_1["default"].createElement("
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
28
|
+
react_1["default"].createElement("tr", null,
|
|
29
|
+
numericalOrder && numericalOrder.enable && (react_1["default"].createElement("th", { key: 'stt', className: (0, types_1.classNames)('min-w-[60px] whitespace-nowrap rounded-lg px-3 py-2.5 pl-8 text-left align-top text-xs font-medium text-gray-800'), scope: 'col' }, numericalOrder.title)),
|
|
30
|
+
headers.map(function (header, index) {
|
|
31
|
+
return index === 0 ? (react_1["default"].createElement("th", { key: header.key, className: 'whitespace-nowrap px-3 py-2.5 pl-8 text-left align-top text-xs font-medium text-gray-500 lg:min-w-[160px]', scope: 'col' },
|
|
32
|
+
react_1["default"].createElement("p", { className: 'text-gray-800' }, header.label))) : (react_1["default"].createElement("th", { key: header.key, className: 'whitespace-nowrap px-3 py-2.5 pl-8 text-left align-top text-xs font-medium text-gray-500 lg:min-w-[135px]', scope: 'col' },
|
|
33
|
+
react_1["default"].createElement("p", { className: 'text-gray-800' }, header.label)));
|
|
34
|
+
}))),
|
|
35
|
+
react_1["default"].createElement("tbody", { className: 'divide-y divide-gray-200' }, bodyData.map(function (item, index) { return (react_1["default"].createElement("tr", { key: index },
|
|
36
|
+
numericalOrder && numericalOrder.enable && (react_1["default"].createElement("td", { className: 'w-[80px] whitespace-nowrap pl-8 text-xs text-gray-900' }, index + 1)),
|
|
37
|
+
headers.map(function (header, indexHeader) { return (react_1["default"].createElement("td", { key: header.key, className: "whitespace-nowrap px-6 py-3 text-xs text-gray-900 ".concat(indexHeader === 0 ? 'rounded-lg sm:w-16 sm:px-8' : 'pl-8') }, renderCell(item, header.key))); }))); })))))))) : (react_1["default"].createElement(EmptyRecord_1.PHXEmptyRecord, null))));
|
|
35
38
|
}
|
|
36
39
|
exports.PHXTableStatic = PHXTableStatic;
|
|
37
40
|
//# sourceMappingURL=TableStatic.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableStatic.js","sourceRoot":"","sources":["../../../../src/components/TableStatic/TableStatic.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAA;;;;AACZ,wDAAyB;AACzB,8CAA+C;
|
|
1
|
+
{"version":3,"file":"TableStatic.js","sourceRoot":"","sources":["../../../../src/components/TableStatic/TableStatic.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAA;;;;AACZ,wDAAyB;AACzB,8CAA+C;AAC/C,kCAAqC;AAkBrC,SAAgB,cAAc,CAAC,EAA6E;QAA3E,QAAQ,cAAA,EAAE,cAAc,oBAAA,EAAE,MAAM,YAAA,EAAE,mBAAgB,EAAhB,WAAW,mBAAG,EAAE,KAAA,EAAE,QAAQ,cAAA;IAC3F,IAAM,OAAO,GAAwB,QAAQ,CAAC,GAAG,CAAC,UAAC,KAAK,EAAE,KAAK,IAAK,OAAA,CAAC;QACnE,GAAG,EAAE,MAAM,CAAC,KAAK,CAAC;QAClB,KAAK,OAAA;KACN,CAAC,EAHkE,CAGlE,CAAC,CAAA;IACH,IAAM,UAAU,GAAG,UAAC,IAAS,EAAE,SA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AgBC,CACF,CACE,CACC;wBACR,4CAAO,SAAS,EAAC,0BAA0B,IACxC,QAAQ,CAAC,GAAG,CAAC,UAAC,IAAI,EAAE,KAAK,IAAK,OAAA,CAC7B,yCAAI,GAAG,EAAE,KAAK;4BACX,cAAc,IAAI,cAAc,CAAC,MAAM,IAAI,CAC1C,yCAAI,SAAS,EAAC,uDAAuD,IAAE,KAAK,GAAG,CAAC,CAAM,CACvF;4BACA,OAAO,CAAC,GAAG,CAAC,UAAC,MAAW,EAAE,WAAgB,IAAK,OAAA,CAC9C,yCACE,GAAG,EAAE,MAAM,CAAC,GAAG,EACf,SAAS,EAAE,4DACT,WAAW,KAAK,CAAC,CAAC,CAAC,CAAC,4BAA4B,CAAC,CAAC,CAAC,MAAM,CACzD,IAED,UAAU,CAAC,IAAI,EAAE,MAAM,CAAC,GAAG,CAAC,CAC1B,CACN,EAT+C,CAS/C,CAAC,CACC,CACN,EAhB8B,CAgB9B,CAAC,CACI,CACF,CACJ,CACF,CACF,CACF,CACP,CAAC,CAAC,CAAC,CACF,iCAAC,4BAAc,OAAG,CACnB,CACA,CACJ,CAAA;AACH,CAAC;AApFD,wCAoFC"}
|
|
@@ -4,6 +4,10 @@ type TTableProps = {
|
|
|
4
4
|
thBody: Array<string>;
|
|
5
5
|
thComponent?: any;
|
|
6
6
|
bodyData: Array<any>;
|
|
7
|
+
numericalOrder?: {
|
|
8
|
+
enable: boolean;
|
|
9
|
+
title: string;
|
|
10
|
+
};
|
|
7
11
|
};
|
|
8
|
-
export declare function PHXTableStatic({ bodyData, thBody, thComponent, thHeader }: TTableProps): React.JSX.Element;
|
|
12
|
+
export declare function PHXTableStatic({ bodyData, numericalOrder, thBody, thComponent, thHeader }: TTableProps): React.JSX.Element;
|
|
9
13
|
export {};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { PHXEmptyRecord } from '../EmptyRecord';
|
|
4
|
+
import { classNames } from '../types';
|
|
4
5
|
export function PHXTableStatic(_a) {
|
|
5
|
-
var bodyData = _a.bodyData, thBody = _a.thBody, _b = _a.thComponent, thComponent = _b === void 0 ? {} : _b, thHeader = _a.thHeader;
|
|
6
|
+
var bodyData = _a.bodyData, numericalOrder = _a.numericalOrder, thBody = _a.thBody, _b = _a.thComponent, thComponent = _b === void 0 ? {} : _b, thHeader = _a.thHeader;
|
|
6
7
|
var headers = thHeader.map(function (label, index) { return ({
|
|
7
8
|
key: thBody[index],
|
|
8
9
|
label: label
|
|
@@ -16,17 +17,19 @@ export function PHXTableStatic(_a) {
|
|
|
16
17
|
};
|
|
17
18
|
return (React.createElement(React.Fragment, null, (bodyData === null || bodyData === void 0 ? void 0 : bodyData.length) ? (React.createElement("div", { className: 'rounded-lg border border-gray-300 border-opacity-70 bg-white shadow-sm' },
|
|
18
19
|
React.createElement("div", { className: '-my-2 overflow-x-auto' },
|
|
19
|
-
React.createElement("div", { className: '
|
|
20
|
+
React.createElement("div", { className: 'w-full pb-2 pt-0.5 align-middle ring-black ring-opacity-5' },
|
|
20
21
|
React.createElement("div", { className: 'relative mt-1.5 overflow-auto' },
|
|
21
22
|
React.createElement("table", { className: 'w-full divide-y divide-gray-300' },
|
|
22
23
|
React.createElement("thead", null,
|
|
23
|
-
React.createElement("tr", null,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
React.createElement("
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
24
|
+
React.createElement("tr", null,
|
|
25
|
+
numericalOrder && numericalOrder.enable && (React.createElement("th", { key: 'stt', className: classNames('min-w-[60px] whitespace-nowrap rounded-lg px-3 py-2.5 pl-8 text-left align-top text-xs font-medium text-gray-800'), scope: 'col' }, numericalOrder.title)),
|
|
26
|
+
headers.map(function (header, index) {
|
|
27
|
+
return index === 0 ? (React.createElement("th", { key: header.key, className: 'whitespace-nowrap px-3 py-2.5 pl-8 text-left align-top text-xs font-medium text-gray-500 lg:min-w-[160px]', scope: 'col' },
|
|
28
|
+
React.createElement("p", { className: 'text-gray-800' }, header.label))) : (React.createElement("th", { key: header.key, className: 'whitespace-nowrap px-3 py-2.5 pl-8 text-left align-top text-xs font-medium text-gray-500 lg:min-w-[135px]', scope: 'col' },
|
|
29
|
+
React.createElement("p", { className: 'text-gray-800' }, header.label)));
|
|
30
|
+
}))),
|
|
31
|
+
React.createElement("tbody", { className: 'divide-y divide-gray-200' }, bodyData.map(function (item, index) { return (React.createElement("tr", { key: index },
|
|
32
|
+
numericalOrder && numericalOrder.enable && (React.createElement("td", { className: 'w-[80px] whitespace-nowrap pl-8 text-xs text-gray-900' }, index + 1)),
|
|
33
|
+
headers.map(function (header, indexHeader) { return (React.createElement("td", { key: header.key, className: "whitespace-nowrap px-6 py-3 text-xs text-gray-900 ".concat(indexHeader === 0 ? 'rounded-lg sm:w-16 sm:px-8' : 'pl-8') }, renderCell(item, header.key))); }))); })))))))) : (React.createElement(PHXEmptyRecord, null))));
|
|
31
34
|
}
|
|
32
35
|
//# sourceMappingURL=TableStatic.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableStatic.js","sourceRoot":"","sources":["../../../../src/components/TableStatic/TableStatic.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;AACZ,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"TableStatic.js","sourceRoot":"","sources":["../../../../src/components/TableStatic/TableStatic.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;AACZ,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAkBrC,MAAM,UAAU,cAAc,CAAC,EAA6E;QAA3E,QAAQ,cAAA,EAAE,cAAc,oBAAA,EAAE,MAAM,YAAA,EAAE,mBAAgB,EAAhB,W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