@solidxai/core-ui 0.1.9-beta.5 → 0.1.9-beta.6
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/components/common/AuthBanner.js.map +1 -1
- package/dist/components/core/kanban/SolidManyToOneFilterElement.d.ts.map +1 -1
- package/dist/components/core/kanban/SolidManyToOneFilterElement.js.map +1 -1
- package/dist/components/core/kanban/SolidManyToOneFilterElement.tsx +1 -2
- package/dist/components/core/kanban/kanban-fields/SolidMediaMultipleKanbanField.d.ts.map +1 -1
- package/dist/components/core/kanban/kanban-fields/SolidMediaMultipleKanbanField.js +2 -2
- package/dist/components/core/kanban/kanban-fields/SolidMediaMultipleKanbanField.js.map +1 -1
- package/dist/components/core/kanban/kanban-fields/SolidMediaMultipleKanbanField.tsx +21 -10
- package/dist/components/core/kanban/kanban-fields/SolidMediaSingleKanbanField.d.ts.map +1 -1
- package/dist/components/core/kanban/kanban-fields/SolidMediaSingleKanbanField.js +2 -2
- package/dist/components/core/kanban/kanban-fields/SolidMediaSingleKanbanField.js.map +1 -1
- package/dist/components/core/kanban/kanban-fields/SolidMediaSingleKanbanField.tsx +18 -10
- package/dist/components/core/kanban/kanban-fields/SolidShortTextKanbanField.d.ts.map +1 -1
- package/dist/components/core/kanban/kanban-fields/SolidShortTextKanbanField.js +3 -6
- package/dist/components/core/kanban/kanban-fields/SolidShortTextKanbanField.js.map +1 -1
- package/dist/components/core/kanban/kanban-fields/SolidShortTextKanbanField.tsx +30 -24
- package/dist/components/core/kanban/kanban-fields/relations/SolidRelationManyToOneKanbanField.js.map +1 -1
- package/dist/components/core/kanban/kanban-fields/relations/SolidRelationManyToOneKanbanField.tsx +2 -2
- package/dist/components/core/list/SolidDataTablePagination.d.ts +15 -0
- package/dist/components/core/list/SolidDataTablePagination.d.ts.map +1 -0
- package/dist/components/core/list/SolidDataTablePagination.js +22 -0
- package/dist/components/core/list/SolidDataTablePagination.js.map +1 -0
- package/dist/components/core/list/SolidDataTablePagination.tsx +71 -0
- package/dist/components/core/list/SolidListViewRowButtonContextMenu.d.ts +1 -1
- package/dist/components/core/list/SolidListViewRowButtonContextMenu.d.ts.map +1 -1
- package/dist/components/core/list/SolidListViewRowButtonContextMenu.js +6 -7
- package/dist/components/core/list/SolidListViewRowButtonContextMenu.js.map +1 -1
- package/dist/components/core/list/SolidListViewRowButtonContextMenu.tsx +9 -10
- package/dist/components/solid-ui/SolidButton.d.ts +14 -0
- package/dist/components/solid-ui/SolidButton.d.ts.map +1 -0
- package/dist/components/solid-ui/SolidButton.js +36 -0
- package/dist/components/solid-ui/SolidButton.js.map +1 -0
- package/dist/components/solid-ui/SolidButton.tsx +54 -0
- package/dist/components/solid-ui/SolidTabs.d.ts +18 -0
- package/dist/components/solid-ui/SolidTabs.d.ts.map +1 -0
- package/dist/components/solid-ui/SolidTabs.js +22 -0
- package/dist/components/solid-ui/SolidTabs.js.map +1 -0
- package/dist/components/solid-ui/SolidTabs.tsx +73 -0
- package/dist/components/solid-ui/index.d.ts +3 -0
- package/dist/components/solid-ui/index.d.ts.map +1 -0
- package/dist/components/solid-ui/index.js +3 -0
- package/dist/components/solid-ui/index.js.map +1 -0
- package/dist/components/solid-ui/index.ts +2 -0
- package/package.json +1 -1
- package/dist/components/auth/SolidOTPVerify.d.ts +0 -3
- package/dist/components/auth/SolidOTPVerify.d.ts.map +0 -1
- package/dist/components/auth/SolidOTPVerify.js +0 -67
- package/dist/components/auth/SolidOTPVerify.js.map +0 -1
- package/dist/components/auth/SolidOTPVerify.tsx +0 -133
- package/dist/components/core/common/LoadDynamicJsxComponent.d.ts +0 -2
- package/dist/components/core/common/LoadDynamicJsxComponent.d.ts.map +0 -1
- package/dist/components/core/common/LoadDynamicJsxComponent.js +0 -50
- package/dist/components/core/common/LoadDynamicJsxComponent.js.map +0 -1
- package/dist/components/core/common/LoadDynamicJsxComponent.tsx +0 -70
- package/dist/nextAuth/authProviders.d.ts +0 -4
- package/dist/nextAuth/authProviders.d.ts.map +0 -1
- package/dist/nextAuth/authProviders.js +0 -198
- package/dist/nextAuth/authProviders.js.map +0 -1
- package/dist/nextAuth/authProviders.tsx +0 -232
- package/dist/nextAuth/handleLogout.d.ts +0 -2
- package/dist/nextAuth/handleLogout.d.ts.map +0 -1
- package/dist/nextAuth/handleLogout.js +0 -36
- package/dist/nextAuth/handleLogout.js.map +0 -1
- package/dist/nextAuth/handleLogout.tsx +0 -39
- package/dist/nextAuth/refreshAccessToken.d.ts +0 -2
- package/dist/nextAuth/refreshAccessToken.d.ts.map +0 -1
- package/dist/nextAuth/refreshAccessToken.js +0 -24
- package/dist/nextAuth/refreshAccessToken.js.map +0 -1
- package/dist/nextAuth/refreshAccessToken.tsx +0 -28
- package/dist/redux/features/settingsSlice.d.ts +0 -20
- package/dist/redux/features/settingsSlice.d.ts.map +0 -1
- package/dist/redux/features/settingsSlice.js +0 -39
- package/dist/redux/features/settingsSlice.js.map +0 -1
- package/dist/redux/features/settingsSlice.ts +0 -60
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
import { useState } from 'react';
|
|
3
3
|
import { SolidKanbanViewFieldsParams } from '../SolidKanbanViewFields';
|
|
4
|
-
import { Dialog } from 'primereact/dialog';
|
|
5
4
|
import { Document, Page } from "react-pdf";
|
|
6
5
|
import { PDFSvg } from '../../../../components/Svg/PDFSvg';
|
|
7
6
|
import MP3Image from '../../../../resources/images/fileTypes/Mp3.png'
|
|
@@ -9,29 +8,18 @@ import MP4Image from '../../../../resources/images/fileTypes/Mp4.png'
|
|
|
9
8
|
import FileImage from '../../../../resources/images/fileTypes/File.png'
|
|
10
9
|
import Image from "../../../common/Image";
|
|
11
10
|
import { ExcelSvg } from '../../../../components/Svg/ExcelSvg';
|
|
11
|
+
import {
|
|
12
|
+
SolidDialog,
|
|
13
|
+
SolidDialogBody,
|
|
14
|
+
SolidDialogClose,
|
|
15
|
+
SolidDialogHeader,
|
|
16
|
+
SolidDialogTitle,
|
|
17
|
+
} from "../../../shad-cn-ui";
|
|
12
18
|
const SolidShortTextKanbanField = ({ solidKanbanViewMetaData, fieldMetadata, fieldLayout, data, setLightboxUrls, setOpenLightbox, groupedView }: SolidKanbanViewFieldsParams) => {
|
|
13
19
|
const [visible, setVisible] = useState(false);
|
|
14
20
|
const widget = fieldLayout?.attrs?.widget ? fieldLayout?.attrs?.widget : "text";
|
|
15
21
|
const mimeType = data && data?.mimeType
|
|
16
22
|
const fileName = data?.originalFileName;
|
|
17
|
-
const PDFHeader = () => {
|
|
18
|
-
return (
|
|
19
|
-
<div className='flex justify-content-between align-items-center'>
|
|
20
|
-
<p className='m-0'>
|
|
21
|
-
{fileName}
|
|
22
|
-
</p>
|
|
23
|
-
<a
|
|
24
|
-
href={data[fieldMetadata.name]}
|
|
25
|
-
download={fileName}
|
|
26
|
-
target="_blank"
|
|
27
|
-
rel="noopener noreferrer"
|
|
28
|
-
className='mr-4'
|
|
29
|
-
>
|
|
30
|
-
<i className='pi pi-download' />
|
|
31
|
-
</a>
|
|
32
|
-
</div>
|
|
33
|
-
)
|
|
34
|
-
}
|
|
35
23
|
return (
|
|
36
24
|
<div className={`${fieldLayout?.attrs?.className ? ` ${fieldLayout.attrs.className}` : ""}`}>
|
|
37
25
|
{widget === "text" && groupedView &&
|
|
@@ -61,11 +49,29 @@ const SolidShortTextKanbanField = ({ solidKanbanViewMetaData, fieldMetadata, fie
|
|
|
61
49
|
<div className='kanban-media-view-card' onClick={() => setVisible(true)} style={{ cursor: 'pointer' }}>
|
|
62
50
|
<PDFSvg />
|
|
63
51
|
</div>
|
|
64
|
-
<
|
|
65
|
-
<
|
|
66
|
-
<
|
|
67
|
-
|
|
68
|
-
|
|
52
|
+
<SolidDialog open={visible} onOpenChange={setVisible} className="solid-kanban-preview-dialog">
|
|
53
|
+
<SolidDialogHeader className="solid-kanban-preview-dialog-header">
|
|
54
|
+
<div className="solid-kanban-preview-dialog-title-row">
|
|
55
|
+
<SolidDialogTitle>{fileName}</SolidDialogTitle>
|
|
56
|
+
<a
|
|
57
|
+
href={data[fieldMetadata.name]}
|
|
58
|
+
download={fileName}
|
|
59
|
+
target="_blank"
|
|
60
|
+
rel="noopener noreferrer"
|
|
61
|
+
className="solid-kanban-preview-download"
|
|
62
|
+
onClick={(event) => event.stopPropagation()}
|
|
63
|
+
>
|
|
64
|
+
<i className='pi pi-download' />
|
|
65
|
+
</a>
|
|
66
|
+
<SolidDialogClose />
|
|
67
|
+
</div>
|
|
68
|
+
</SolidDialogHeader>
|
|
69
|
+
<SolidDialogBody className="solid-kanban-preview-dialog-body">
|
|
70
|
+
<Document file={data[fieldMetadata.name]}>
|
|
71
|
+
<Page pageNumber={1} />
|
|
72
|
+
</Document>
|
|
73
|
+
</SolidDialogBody>
|
|
74
|
+
</SolidDialog>
|
|
69
75
|
</div>
|
|
70
76
|
)}
|
|
71
77
|
|
package/dist/components/core/kanban/kanban-fields/relations/SolidRelationManyToOneKanbanField.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SolidRelationManyToOneKanbanField.js","sourceRoot":"","sources":["../../../../../../src/components/core/kanban/kanban-fields/relations/SolidRelationManyToOneKanbanField.tsx"],"names":[],"mappings":";AAOA,IAAM,iCAAiC,GAAG,UAAC,EAAyF;QAAvF,uBAAuB,6BAAA,EAAE,aAAa,mBAAA,EAAE,WAAW,iBAAA,EAAC,IAAI,UAAA;IAEjG,OAAO,CACJ,mBAAK,CACP,CAAC;AAEN,CAAC,CAAC;AAEF,eAAe,iCAAiC,CAAC","sourcesContent":["\nimport { FilterMatchMode } from 'primereact/api';\nimport { Column, ColumnFilterElementTemplateOptions } from \"primereact/column\";\nimport { FormEvent } from \"primereact/ts-helpers\";\nimport { InputTypes, SolidVarInputsFilterElement } from '../../../../../components/core/
|
|
1
|
+
{"version":3,"file":"SolidRelationManyToOneKanbanField.js","sourceRoot":"","sources":["../../../../../../src/components/core/kanban/kanban-fields/relations/SolidRelationManyToOneKanbanField.tsx"],"names":[],"mappings":";AAOA,IAAM,iCAAiC,GAAG,UAAC,EAAyF;QAAvF,uBAAuB,6BAAA,EAAE,aAAa,mBAAA,EAAE,WAAW,iBAAA,EAAC,IAAI,UAAA;IAEjG,OAAO,CACJ,mBAAK,CACP,CAAC;AAEN,CAAC,CAAC;AAEF,eAAe,iCAAiC,CAAC","sourcesContent":["\nimport { FilterMatchMode } from 'primereact/api';\nimport { Column, ColumnFilterElementTemplateOptions } from \"primereact/column\";\nimport { FormEvent } from \"primereact/ts-helpers\";\nimport { InputTypes, SolidVarInputsFilterElement } from '../../../../../components/core/filter/SolidVarInputsFilterElement';\nimport { SolidKanbanViewFieldsParams } from '../../../../../components/core/kanban/SolidKanbanViewFields';\n\nconst SolidRelationManyToOneKanbanField = ({ solidKanbanViewMetaData, fieldMetadata, fieldLayout,data }: SolidKanbanViewFieldsParams) => {\n \n return (\n <></>\n );\n\n};\n\nexport default SolidRelationManyToOneKanbanField;\n"]}
|
package/dist/components/core/kanban/kanban-fields/relations/SolidRelationManyToOneKanbanField.tsx
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { FilterMatchMode } from 'primereact/api';
|
|
3
3
|
import { Column, ColumnFilterElementTemplateOptions } from "primereact/column";
|
|
4
4
|
import { FormEvent } from "primereact/ts-helpers";
|
|
5
|
-
import { InputTypes, SolidVarInputsFilterElement } from '../../../../../components/core/
|
|
5
|
+
import { InputTypes, SolidVarInputsFilterElement } from '../../../../../components/core/filter/SolidVarInputsFilterElement';
|
|
6
6
|
import { SolidKanbanViewFieldsParams } from '../../../../../components/core/kanban/SolidKanbanViewFields';
|
|
7
7
|
|
|
8
8
|
const SolidRelationManyToOneKanbanField = ({ solidKanbanViewMetaData, fieldMetadata, fieldLayout,data }: SolidKanbanViewFieldsParams) => {
|
|
@@ -13,4 +13,4 @@ const SolidRelationManyToOneKanbanField = ({ solidKanbanViewMetaData, fieldMetad
|
|
|
13
13
|
|
|
14
14
|
};
|
|
15
15
|
|
|
16
|
-
export default SolidRelationManyToOneKanbanField;
|
|
16
|
+
export default SolidRelationManyToOneKanbanField;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
type SolidDataTablePaginationProps = {
|
|
2
|
+
rows: number;
|
|
3
|
+
first: number;
|
|
4
|
+
totalRecords: number;
|
|
5
|
+
rowsPerPageOptions?: number[];
|
|
6
|
+
onPage: (event: {
|
|
7
|
+
first: number;
|
|
8
|
+
rows: number;
|
|
9
|
+
}) => void;
|
|
10
|
+
currentPageReportTemplate?: string;
|
|
11
|
+
className?: string;
|
|
12
|
+
};
|
|
13
|
+
export declare function SolidDataTablePagination({ rows, first, totalRecords, rowsPerPageOptions, onPage, currentPageReportTemplate, className, }: SolidDataTablePaginationProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=SolidDataTablePagination.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SolidDataTablePagination.d.ts","sourceRoot":"","sources":["../../../../src/components/core/list/SolidDataTablePagination.tsx"],"names":[],"mappings":"AAEA,KAAK,6BAA6B,GAAG;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC9B,MAAM,EAAE,CAAC,KAAK,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IACzD,yBAAyB,CAAC,EAAE,MAAM,CAAC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAIF,wBAAgB,wBAAwB,CAAC,EACvC,IAAI,EACJ,KAAK,EACL,YAAY,EACZ,kBAAsC,EACtC,MAAM,EACN,yBAAgE,EAChE,SAAS,GACV,EAAE,6BAA6B,2CA+C/B"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
var cx = function () {
|
|
3
|
+
var parts = [];
|
|
4
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
5
|
+
parts[_i] = arguments[_i];
|
|
6
|
+
}
|
|
7
|
+
return parts.filter(Boolean).join(" ");
|
|
8
|
+
};
|
|
9
|
+
export function SolidDataTablePagination(_a) {
|
|
10
|
+
var rows = _a.rows, first = _a.first, totalRecords = _a.totalRecords, _b = _a.rowsPerPageOptions, rowsPerPageOptions = _b === void 0 ? [10, 25, 50, 100] : _b, onPage = _a.onPage, _c = _a.currentPageReportTemplate, currentPageReportTemplate = _c === void 0 ? "{first} - {last} of {totalRecords}" : _c, className = _a.className;
|
|
11
|
+
var safeRows = rows > 0 ? rows : 25;
|
|
12
|
+
var start = totalRecords === 0 ? 0 : first + 1;
|
|
13
|
+
var end = Math.min(first + safeRows, totalRecords);
|
|
14
|
+
var currentPage = Math.floor(first / safeRows) + 1;
|
|
15
|
+
var totalPages = Math.max(1, Math.ceil(totalRecords / safeRows));
|
|
16
|
+
var report = currentPageReportTemplate
|
|
17
|
+
.replace("{first}", String(start))
|
|
18
|
+
.replace("{last}", String(end))
|
|
19
|
+
.replace("{totalRecords}", String(totalRecords));
|
|
20
|
+
return (_jsxs("div", { className: cx("w-full solid-table-paginator flex items-center justify-end gap-3 text-sm rounded-md border border-border/60 px-3 py-1.5 bg-background", className), children: [_jsxs("div", { className: "solid-paginator-meta flex items-center gap-2 ml-auto", children: [_jsx("span", { className: "solid-paginator-label", children: "Rows" }), _jsx("select", { value: safeRows, onChange: function (e) { return onPage({ first: 0, rows: Number(e.target.value) }); }, className: "solid-paginator-select", children: rowsPerPageOptions.map(function (option) { return (_jsx("option", { value: option, children: option }, option)); }) }), _jsx("span", { className: "solid-paginator-report", children: report })] }), _jsxs("div", { className: "solid-paginator-actions flex items-center gap-2", children: [_jsx("button", { type: "button", className: "solid-paginator-btn", onClick: function () { return onPage({ first: Math.max(0, first - safeRows), rows: safeRows }); }, disabled: currentPage <= 1, children: "Previous" }), _jsx("button", { type: "button", className: "solid-paginator-btn", onClick: function () { return onPage({ first: Math.min((totalPages - 1) * safeRows, first + safeRows), rows: safeRows }); }, disabled: currentPage >= totalPages, children: "Next" })] })] }));
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=SolidDataTablePagination.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SolidDataTablePagination.js","sourceRoot":"","sources":["../../../../src/components/core/list/SolidDataTablePagination.tsx"],"names":[],"mappings":";AAYA,IAAM,EAAE,GAAG;IAAC,eAA2C;SAA3C,UAA2C,EAA3C,qBAA2C,EAA3C,IAA2C;QAA3C,0BAA2C;;IAAK,OAAA,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;AAA/B,CAA+B,CAAC;AAE5F,MAAM,UAAU,wBAAwB,CAAC,EAQT;QAP9B,IAAI,UAAA,EACJ,KAAK,WAAA,EACL,YAAY,kBAAA,EACZ,0BAAsC,EAAtC,kBAAkB,mBAAG,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,CAAC,KAAA,EACtC,MAAM,YAAA,EACN,iCAAgE,EAAhE,yBAAyB,mBAAG,oCAAoC,KAAA,EAChE,SAAS,eAAA;IAET,IAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;IACtC,IAAM,KAAK,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC;IACjD,IAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,GAAG,QAAQ,EAAE,YAAY,CAAC,CAAC;IACrD,IAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC;IACrD,IAAM,UAAU,GAA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IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,qBAAqB,EAC/B,OAAO,EAAE,cAAM,OAAA,MAAM,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,UAAU,GAAG,CAAC,CAAC,GAAG,QAAQ,EAAE,KAAK,GAAG,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,EAA1F,CAA0F,EACzG,QAAQ,EAAE,WAAW,IAAI,UAAU,qBAG5B,IACL,IACF,CACP,CAAC;AACJ,CAAC","sourcesContent":["import React from \"react\";\n\ntype SolidDataTablePaginationProps = {\n rows: number;\n first: number;\n totalRecords: number;\n rowsPerPageOptions?: number[];\n onPage: (event: { first: number; rows: number }) => void;\n currentPageReportTemplate?: string;\n className?: string;\n};\n\nconst cx = (...parts: Array<string | undefined | false>) => parts.filter(Boolean).join(\" \");\n\nexport function SolidDataTablePagination({\n rows,\n first,\n totalRecords,\n rowsPerPageOptions = [10, 25, 50, 100],\n onPage,\n currentPageReportTemplate = \"{first} - {last} of {totalRecords}\",\n className,\n}: SolidDataTablePaginationProps) {\n const safeRows = rows > 0 ? rows : 25;\n const start = totalRecords === 0 ? 0 : first + 1;\n const end = Math.min(first + safeRows, totalRecords);\n const currentPage = Math.floor(first / safeRows) + 1;\n const totalPages = Math.max(1, Math.ceil(totalRecords / safeRows));\n\n const report = currentPageReportTemplate\n .replace(\"{first}\", String(start))\n .replace(\"{last}\", String(end))\n .replace(\"{totalRecords}\", String(totalRecords));\n\n return (\n <div className={cx(\"w-full solid-table-paginator flex items-center justify-end gap-3 text-sm rounded-md border border-border/60 px-3 py-1.5 bg-background\", className)}>\n <div className=\"solid-paginator-meta flex items-center gap-2 ml-auto\">\n <span className=\"solid-paginator-label\">Rows</span>\n <select\n value={safeRows}\n onChange={(e) => onPage({ first: 0, rows: Number(e.target.value) })}\n className=\"solid-paginator-select\"\n >\n {rowsPerPageOptions.map((option) => (\n <option key={option} value={option}>{option}</option>\n ))}\n </select>\n <span className=\"solid-paginator-report\">{report}</span>\n </div>\n <div className=\"solid-paginator-actions flex items-center gap-2\">\n <button\n type=\"button\"\n className=\"solid-paginator-btn\"\n onClick={() => onPage({ first: Math.max(0, first - safeRows), rows: safeRows })}\n disabled={currentPage <= 1}\n >\n Previous\n </button>\n <button\n type=\"button\"\n className=\"solid-paginator-btn\"\n onClick={() => onPage({ first: Math.min((totalPages - 1) * safeRows, first + safeRows), rows: safeRows })}\n disabled={currentPage >= totalPages}\n >\n Next\n </button>\n </div>\n </div>\n );\n}\n\n"]}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
type SolidDataTablePaginationProps = {
|
|
4
|
+
rows: number;
|
|
5
|
+
first: number;
|
|
6
|
+
totalRecords: number;
|
|
7
|
+
rowsPerPageOptions?: number[];
|
|
8
|
+
onPage: (event: { first: number; rows: number }) => void;
|
|
9
|
+
currentPageReportTemplate?: string;
|
|
10
|
+
className?: string;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const cx = (...parts: Array<string | undefined | false>) => parts.filter(Boolean).join(" ");
|
|
14
|
+
|
|
15
|
+
export function SolidDataTablePagination({
|
|
16
|
+
rows,
|
|
17
|
+
first,
|
|
18
|
+
totalRecords,
|
|
19
|
+
rowsPerPageOptions = [10, 25, 50, 100],
|
|
20
|
+
onPage,
|
|
21
|
+
currentPageReportTemplate = "{first} - {last} of {totalRecords}",
|
|
22
|
+
className,
|
|
23
|
+
}: SolidDataTablePaginationProps) {
|
|
24
|
+
const safeRows = rows > 0 ? rows : 25;
|
|
25
|
+
const start = totalRecords === 0 ? 0 : first + 1;
|
|
26
|
+
const end = Math.min(first + safeRows, totalRecords);
|
|
27
|
+
const currentPage = Math.floor(first / safeRows) + 1;
|
|
28
|
+
const totalPages = Math.max(1, Math.ceil(totalRecords / safeRows));
|
|
29
|
+
|
|
30
|
+
const report = currentPageReportTemplate
|
|
31
|
+
.replace("{first}", String(start))
|
|
32
|
+
.replace("{last}", String(end))
|
|
33
|
+
.replace("{totalRecords}", String(totalRecords));
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
<div className={cx("w-full solid-table-paginator flex items-center justify-end gap-3 text-sm rounded-md border border-border/60 px-3 py-1.5 bg-background", className)}>
|
|
37
|
+
<div className="solid-paginator-meta flex items-center gap-2 ml-auto">
|
|
38
|
+
<span className="solid-paginator-label">Rows</span>
|
|
39
|
+
<select
|
|
40
|
+
value={safeRows}
|
|
41
|
+
onChange={(e) => onPage({ first: 0, rows: Number(e.target.value) })}
|
|
42
|
+
className="solid-paginator-select"
|
|
43
|
+
>
|
|
44
|
+
{rowsPerPageOptions.map((option) => (
|
|
45
|
+
<option key={option} value={option}>{option}</option>
|
|
46
|
+
))}
|
|
47
|
+
</select>
|
|
48
|
+
<span className="solid-paginator-report">{report}</span>
|
|
49
|
+
</div>
|
|
50
|
+
<div className="solid-paginator-actions flex items-center gap-2">
|
|
51
|
+
<button
|
|
52
|
+
type="button"
|
|
53
|
+
className="solid-paginator-btn"
|
|
54
|
+
onClick={() => onPage({ first: Math.max(0, first - safeRows), rows: safeRows })}
|
|
55
|
+
disabled={currentPage <= 1}
|
|
56
|
+
>
|
|
57
|
+
Previous
|
|
58
|
+
</button>
|
|
59
|
+
<button
|
|
60
|
+
type="button"
|
|
61
|
+
className="solid-paginator-btn"
|
|
62
|
+
onClick={() => onPage({ first: Math.min((totalPages - 1) * safeRows, first + safeRows), rows: safeRows })}
|
|
63
|
+
disabled={currentPage >= totalPages}
|
|
64
|
+
>
|
|
65
|
+
Next
|
|
66
|
+
</button>
|
|
67
|
+
</div>
|
|
68
|
+
</div>
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const SolidListViewRowButtonContextMenu: ({ button, params,
|
|
1
|
+
export declare const SolidListViewRowButtonContextMenu: ({ button, params, rowData, solidListViewMetaData, handleCustomButtonClick, onActionComplete }: any) => import("react/jsx-runtime").JSX.Element | null;
|
|
2
2
|
//# sourceMappingURL=SolidListViewRowButtonContextMenu.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SolidListViewRowButtonContextMenu.d.ts","sourceRoot":"","sources":["../../../../src/components/core/list/SolidListViewRowButtonContextMenu.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SolidListViewRowButtonContextMenu.d.ts","sourceRoot":"","sources":["../../../../src/components/core/list/SolidListViewRowButtonContextMenu.tsx"],"names":[],"mappings":"AAGA,eAAO,MAAM,iCAAiC,kGAAmG,GAAG,mDAmCnJ,CAAC"}
|
|
@@ -9,23 +9,21 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
import { useSession } from "../../../hooks/useSession";
|
|
14
14
|
import { hasAnyRole } from "../../../helpers/rolesHelper";
|
|
15
|
-
import { Button } from "primereact/button";
|
|
16
15
|
export var SolidListViewRowButtonContextMenu = function (_a) {
|
|
17
16
|
var _b, _c, _d, _e, _f, _g, _h;
|
|
18
|
-
var button = _a.button, params = _a.params,
|
|
19
|
-
var selectedSolidViewData = getSelectedSolidViewData === null || getSelectedSolidViewData === void 0 ? void 0 : getSelectedSolidViewData();
|
|
17
|
+
var button = _a.button, params = _a.params, rowData = _a.rowData, solidListViewMetaData = _a.solidListViewMetaData, handleCustomButtonClick = _a.handleCustomButtonClick, onActionComplete = _a.onActionComplete;
|
|
20
18
|
var _j = useSession(), session = _j.data, status = _j.status;
|
|
21
19
|
var user = session === null || session === void 0 ? void 0 : session.user;
|
|
22
20
|
var hasRole = !((_b = button === null || button === void 0 ? void 0 : button.attrs) === null || _b === void 0 ? void 0 : _b.roles) || ((_c = button === null || button === void 0 ? void 0 : button.attrs) === null || _c === void 0 ? void 0 : _c.roles.length) === 0 ? true : hasAnyRole(user === null || user === void 0 ? void 0 : user.roles, (_d = button === null || button === void 0 ? void 0 : button.attrs) === null || _d === void 0 ? void 0 : _d.roles);
|
|
23
21
|
if (!hasRole)
|
|
24
22
|
return null;
|
|
25
|
-
return (
|
|
23
|
+
return (_jsxs("button", { type: "button", className: "solid-row-action-button ".concat(((_e = button === null || button === void 0 ? void 0 : button.attrs) === null || _e === void 0 ? void 0 : _e.className) ? (_f = button === null || button === void 0 ? void 0 : button.attrs) === null || _f === void 0 ? void 0 : _f.className : ''), onClick: function () {
|
|
26
24
|
var event = {
|
|
27
25
|
params: params,
|
|
28
|
-
rowData:
|
|
26
|
+
rowData: rowData,
|
|
29
27
|
solidListViewMetaData: solidListViewMetaData.data,
|
|
30
28
|
};
|
|
31
29
|
var modifiedButtonAttrs = __assign({}, button.attrs); // Create a copy
|
|
@@ -34,6 +32,7 @@ export var SolidListViewRowButtonContextMenu = function (_a) {
|
|
|
34
32
|
modifiedButtonAttrs.popupWidth = '30vw';
|
|
35
33
|
}
|
|
36
34
|
handleCustomButtonClick(modifiedButtonAttrs, event);
|
|
37
|
-
|
|
35
|
+
onActionComplete === null || onActionComplete === void 0 ? void 0 : onActionComplete();
|
|
36
|
+
}, children: [_jsx("i", { className: "".concat(((_g = button === null || button === void 0 ? void 0 : button.attrs) === null || _g === void 0 ? void 0 : _g.icon) ? (_h = button === null || button === void 0 ? void 0 : button.attrs) === null || _h === void 0 ? void 0 : _h.icon : "pi pi-pencil", " solid-row-action-button-icon") }), _jsx("span", { className: "solid-row-action-button-label", children: button.attrs.label })] }));
|
|
38
37
|
};
|
|
39
38
|
//# sourceMappingURL=SolidListViewRowButtonContextMenu.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SolidListViewRowButtonContextMenu.js","sourceRoot":"","sources":["../../../../src/components/core/list/SolidListViewRowButtonContextMenu.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"SolidListViewRowButtonContextMenu.js","sourceRoot":"","sources":["../../../../src/components/core/list/SolidListViewRowButtonContextMenu.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAE1D,MAAM,CAAC,IAAM,iCAAiC,GAAG,UAAC,EAAkG;;QAAhG,MAAM,YAAA,EAAE,MAAM,YAAA,EAAE,OAAO,aAAA,EAAE,qBAAqB,2BAAA,EAAE,uBAAuB,6BAAA,EAAE,gBAAgB,sBAAA;IAEnI,IAAA,KAA4B,UAAU,EAAE,EAAhC,OAAO,UAAA,EAAE,MAAM,YAAiB,CAAC;IAC/C,IAAM,IAAI,GAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,CAAC;IAE3B,IAAM,OAAO,GAAG,CAAC,CAAA,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,0CAAE,KAAK,CAAA,IAAI,CAAA,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,0CAAE,KAAK,CAAC,MAAM,MAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,KAAK,EAAE,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,0CAAE,KAAK,CAAC,CAAC;IAElI,IAAI,CAAC,OAAO;QAAE,OAAO,IAAI,CAAC;IAE1B,OAAO,CACH,kBACI,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,kCAA2B,CAAA,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,0CAAE,SAAS,EAAC,CAAC,CAAC,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,0CAAE,SAAS,CAAC,CAAC,CAAC,EAAE,CAAE,EAChG,OAAO,EAAE;YACL,IAAM,KAAK,GAAG;gBACV,MAAM,QAAA;gBACN,OAAO,EAAE,OAAO;gBAChB,qBAAqB,EAAE,qBAAqB,CAAC,IAAI;aACpD,CAAC;YAEF,IAAM,mBAAmB,gBAAQ,MAAM,CAAC,KAAK,CAAE,CAAC,CAAC,gBAAgB;YAEjE,oDAAoD;YACpD,IAAI,mBAAmB,CAAC,MAAM,KAAK,4BAA4B,IAAI,mBAAmB,CAAC,MAAM,KAAK,6BAA6B,EAAE;gBAC7H,mBAAmB,CAAC,UAAU,GAAG,MAAM,CAAC;aAC3C;YAED,uBAAuB,CAAC,mBAAmB,EAAE,KAAK,CAAC,CAAC;YACpD,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,EAAI,CAAC;QACzB,CAAC,aAED,YAAG,SAAS,EAAE,UAAG,CAAA,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,0CAAE,IAAI,EAAC,CAAC,CAAC,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,0CAAE,IAAI,CAAC,CAAC,CAAC,cAAc,kCAA+B,GAAI,EAC9G,eAAM,SAAS,EAAC,+BAA+B,YAAE,MAAM,CAAC,KAAK,CAAC,KAAK,GAAQ,IACtE,CACZ,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { useSession } from \"../../../hooks/useSession\";\nimport { hasAnyRole } from \"../../../helpers/rolesHelper\";\n\nexport const SolidListViewRowButtonContextMenu = ({ button, params, rowData, solidListViewMetaData, handleCustomButtonClick, onActionComplete }: any) => {\n\n const { data: session, status } = useSession();\n const user = session?.user;\n\n const hasRole = !button?.attrs?.roles || button?.attrs?.roles.length === 0 ? true : hasAnyRole(user?.roles, button?.attrs?.roles);\n\n if (!hasRole) return null;\n\n return (\n <button\n type=\"button\"\n className={`solid-row-action-button ${button?.attrs?.className ? button?.attrs?.className : ''}`}\n onClick={() => {\n const event = {\n params,\n rowData: rowData,\n solidListViewMetaData: solidListViewMetaData.data,\n };\n\n const modifiedButtonAttrs = { ...button.attrs }; // Create a copy\n\n // Conditionally add popupWidth for specific actions\n if (modifiedButtonAttrs.action === 'GenerateModelCodeRowAction' || modifiedButtonAttrs.action === 'GenerateModuleCodeRowAction') {\n modifiedButtonAttrs.popupWidth = '30vw';\n }\n\n handleCustomButtonClick(modifiedButtonAttrs, event);\n onActionComplete?.();\n }}\n >\n <i className={`${button?.attrs?.icon ? button?.attrs?.icon : \"pi pi-pencil\"} solid-row-action-button-icon`} />\n <span className=\"solid-row-action-button-label\">{button.attrs.label}</span>\n </button>\n );\n};\n"]}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { useSession } from "../../../hooks/useSession";
|
|
2
2
|
import { hasAnyRole } from "../../../helpers/rolesHelper";
|
|
3
|
-
import { Button } from "primereact/button";
|
|
4
3
|
|
|
5
|
-
export const SolidListViewRowButtonContextMenu = ({ button, params,
|
|
6
|
-
const selectedSolidViewData = getSelectedSolidViewData?.();
|
|
4
|
+
export const SolidListViewRowButtonContextMenu = ({ button, params, rowData, solidListViewMetaData, handleCustomButtonClick, onActionComplete }: any) => {
|
|
7
5
|
|
|
8
6
|
const { data: session, status } = useSession();
|
|
9
7
|
const user = session?.user;
|
|
@@ -13,16 +11,13 @@ export const SolidListViewRowButtonContextMenu = ({ button, params, getSelectedS
|
|
|
13
11
|
if (!hasRole) return null;
|
|
14
12
|
|
|
15
13
|
return (
|
|
16
|
-
<
|
|
14
|
+
<button
|
|
17
15
|
type="button"
|
|
18
|
-
|
|
19
|
-
className={`w-full text-left gap-2 ${button?.attrs?.className ? button?.attrs?.className : ''}`}
|
|
20
|
-
label={button.attrs.label}
|
|
21
|
-
size="small"
|
|
16
|
+
className={`solid-row-action-button ${button?.attrs?.className ? button?.attrs?.className : ''}`}
|
|
22
17
|
onClick={() => {
|
|
23
18
|
const event = {
|
|
24
19
|
params,
|
|
25
|
-
rowData:
|
|
20
|
+
rowData: rowData,
|
|
26
21
|
solidListViewMetaData: solidListViewMetaData.data,
|
|
27
22
|
};
|
|
28
23
|
|
|
@@ -34,7 +29,11 @@ export const SolidListViewRowButtonContextMenu = ({ button, params, getSelectedS
|
|
|
34
29
|
}
|
|
35
30
|
|
|
36
31
|
handleCustomButtonClick(modifiedButtonAttrs, event);
|
|
32
|
+
onActionComplete?.();
|
|
37
33
|
}}
|
|
38
|
-
|
|
34
|
+
>
|
|
35
|
+
<i className={`${button?.attrs?.icon ? button?.attrs?.icon : "pi pi-pencil"} solid-row-action-button-icon`} />
|
|
36
|
+
<span className="solid-row-action-button-label">{button.attrs.label}</span>
|
|
37
|
+
</button>
|
|
39
38
|
);
|
|
40
39
|
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
type SolidButtonVariant = "primary" | "secondary" | "ghost" | "outline" | "destructive";
|
|
3
|
+
type SolidButtonSize = "sm" | "md" | "lg";
|
|
4
|
+
type SolidButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
5
|
+
variant?: SolidButtonVariant;
|
|
6
|
+
size?: SolidButtonSize;
|
|
7
|
+
fullWidth?: boolean;
|
|
8
|
+
loading?: boolean;
|
|
9
|
+
leftIcon?: React.ReactNode;
|
|
10
|
+
rightIcon?: React.ReactNode;
|
|
11
|
+
};
|
|
12
|
+
export declare function SolidButton({ variant, size, fullWidth, loading, leftIcon, rightIcon, className, disabled, children, type, ...props }: SolidButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=SolidButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SolidButton.d.ts","sourceRoot":"","sources":["../../../src/components/solid-ui/SolidButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,KAAK,kBAAkB,GAAG,SAAS,GAAG,WAAW,GAAG,OAAO,GAAG,SAAS,GAAG,aAAa,CAAC;AACxF,KAAK,eAAe,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE1C,KAAK,gBAAgB,GAAG,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,GAAG;IACtE,OAAO,CAAC,EAAE,kBAAkB,CAAC;IAC7B,IAAI,CAAC,EAAE,eAAe,CAAC;IACvB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC7B,CAAC;AAMF,wBAAgB,WAAW,CAAC,EAC1B,OAAmB,EACnB,IAAW,EACX,SAAS,EACT,OAAO,EACP,QAAQ,EACR,SAAS,EACT,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,IAAe,EACf,GAAG,KAAK,EACT,EAAE,gBAAgB,2CAuBlB"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
|
+
function cx() {
|
|
25
|
+
var parts = [];
|
|
26
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
27
|
+
parts[_i] = arguments[_i];
|
|
28
|
+
}
|
|
29
|
+
return parts.filter(Boolean).join(" ");
|
|
30
|
+
}
|
|
31
|
+
export function SolidButton(_a) {
|
|
32
|
+
var _b = _a.variant, variant = _b === void 0 ? "primary" : _b, _c = _a.size, size = _c === void 0 ? "md" : _c, fullWidth = _a.fullWidth, loading = _a.loading, leftIcon = _a.leftIcon, rightIcon = _a.rightIcon, className = _a.className, disabled = _a.disabled, children = _a.children, _d = _a.type, type = _d === void 0 ? "button" : _d, props = __rest(_a, ["variant", "size", "fullWidth", "loading", "leftIcon", "rightIcon", "className", "disabled", "children", "type"]);
|
|
33
|
+
var isDisabled = disabled || loading;
|
|
34
|
+
return (_jsxs("button", __assign({ type: type, className: cx("solid-btn", "solid-btn--".concat(variant), "solid-btn--".concat(size), fullWidth && "solid-btn--full", loading && "is-loading", className), disabled: isDisabled }, props, { children: [loading && _jsx("span", { className: "solid-btn-spinner", "aria-hidden": "true" }), !loading && leftIcon ? _jsx("span", { className: "solid-btn-icon", children: leftIcon }) : null, _jsx("span", { className: "solid-btn-label", children: children }), !loading && rightIcon ? _jsx("span", { className: "solid-btn-icon", children: rightIcon }) : null] })));
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=SolidButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SolidButton.js","sourceRoot":"","sources":["../../../src/components/solid-ui/SolidButton.tsx"],"names":[],"mappings":";;;;;;;;;;;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\"primary\" | \"secondary\" | \"ghost\" | \"outline\" | \"destructive\";\ntype SolidButtonSize = \"sm\" | \"md\" | \"lg\";\n\ntype SolidButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement> & {\n variant?: SolidButtonVariant;\n size?: SolidButtonSize;\n fullWidth?: boolean;\n loading?: boolean;\n leftIcon?: React.ReactNode;\n rightIcon?: React.ReactNode;\n};\n\nfunction cx(...parts: Array<string | false | undefined>) {\n return parts.filter(Boolean).join(\" \");\n}\n\nexport function SolidButton({\n variant = \"primary\",\n size = \"md\",\n fullWidth,\n loading,\n leftIcon,\n rightIcon,\n className,\n disabled,\n children,\n type = \"button\",\n ...props\n}: SolidButtonProps) {\n const isDisabled = disabled || loading;\n\n return (\n <button\n type={type}\n className={cx(\n \"solid-btn\",\n `solid-btn--${variant}`,\n `solid-btn--${size}`,\n fullWidth && \"solid-btn--full\",\n loading && \"is-loading\",\n className\n )}\n disabled={isDisabled}\n {...props}\n >\n {loading && <span className=\"solid-btn-spinner\" aria-hidden=\"true\" />}\n {!loading && leftIcon ? <span className=\"solid-btn-icon\">{leftIcon}</span> : null}\n <span className=\"solid-btn-label\">{children}</span>\n {!loading && rightIcon ? <span className=\"solid-btn-icon\">{rightIcon}</span> : null}\n </button>\n );\n}\n"]}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
type SolidButtonVariant = "primary" | "secondary" | "ghost" | "outline" | "destructive";
|
|
4
|
+
type SolidButtonSize = "sm" | "md" | "lg";
|
|
5
|
+
|
|
6
|
+
type SolidButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
7
|
+
variant?: SolidButtonVariant;
|
|
8
|
+
size?: SolidButtonSize;
|
|
9
|
+
fullWidth?: boolean;
|
|
10
|
+
loading?: boolean;
|
|
11
|
+
leftIcon?: React.ReactNode;
|
|
12
|
+
rightIcon?: React.ReactNode;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
function cx(...parts: Array<string | false | undefined>) {
|
|
16
|
+
return parts.filter(Boolean).join(" ");
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function SolidButton({
|
|
20
|
+
variant = "primary",
|
|
21
|
+
size = "md",
|
|
22
|
+
fullWidth,
|
|
23
|
+
loading,
|
|
24
|
+
leftIcon,
|
|
25
|
+
rightIcon,
|
|
26
|
+
className,
|
|
27
|
+
disabled,
|
|
28
|
+
children,
|
|
29
|
+
type = "button",
|
|
30
|
+
...props
|
|
31
|
+
}: SolidButtonProps) {
|
|
32
|
+
const isDisabled = disabled || loading;
|
|
33
|
+
|
|
34
|
+
return (
|
|
35
|
+
<button
|
|
36
|
+
type={type}
|
|
37
|
+
className={cx(
|
|
38
|
+
"solid-btn",
|
|
39
|
+
`solid-btn--${variant}`,
|
|
40
|
+
`solid-btn--${size}`,
|
|
41
|
+
fullWidth && "solid-btn--full",
|
|
42
|
+
loading && "is-loading",
|
|
43
|
+
className
|
|
44
|
+
)}
|
|
45
|
+
disabled={isDisabled}
|
|
46
|
+
{...props}
|
|
47
|
+
>
|
|
48
|
+
{loading && <span className="solid-btn-spinner" aria-hidden="true" />}
|
|
49
|
+
{!loading && leftIcon ? <span className="solid-btn-icon">{leftIcon}</span> : null}
|
|
50
|
+
<span className="solid-btn-label">{children}</span>
|
|
51
|
+
{!loading && rightIcon ? <span className="solid-btn-icon">{rightIcon}</span> : null}
|
|
52
|
+
</button>
|
|
53
|
+
);
|
|
54
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
type SolidTabProps = {
|
|
3
|
+
value: string;
|
|
4
|
+
label: React.ReactNode;
|
|
5
|
+
content: React.ReactNode;
|
|
6
|
+
};
|
|
7
|
+
type SolidTabGroupProps = {
|
|
8
|
+
tabs: SolidTabProps[];
|
|
9
|
+
value: string;
|
|
10
|
+
onValueChange: (value: string) => void;
|
|
11
|
+
className?: string;
|
|
12
|
+
listClassName?: string;
|
|
13
|
+
panelClassName?: string;
|
|
14
|
+
};
|
|
15
|
+
export declare function SolidTab(_props: SolidTabProps): null;
|
|
16
|
+
export declare function SolidTabGroup({ tabs, value, onValueChange, className, listClassName, panelClassName, }: SolidTabGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=SolidTabs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SolidTabs.d.ts","sourceRoot":"","sources":["../../../src/components/solid-ui/SolidTabs.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,KAAK,aAAa,GAAG;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;CAC1B,CAAC;AAEF,KAAK,kBAAkB,GAAG;IACxB,IAAI,EAAE,aAAa,EAAE,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAMF,wBAAgB,QAAQ,CAAC,MAAM,EAAE,aAAa,QAE7C;AAED,wBAAgB,aAAa,CAAC,EAC5B,IAAI,EACJ,KAAK,EACL,aAAa,EACb,SAAS,EACT,aAAa,EACb,cAAc,GACf,EAAE,kBAAkB,2CAwCpB"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
function cx() {
|
|
3
|
+
var parts = [];
|
|
4
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
5
|
+
parts[_i] = arguments[_i];
|
|
6
|
+
}
|
|
7
|
+
return parts.filter(Boolean).join(" ");
|
|
8
|
+
}
|
|
9
|
+
export function SolidTab(_props) {
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
12
|
+
export function SolidTabGroup(_a) {
|
|
13
|
+
var tabs = _a.tabs, value = _a.value, onValueChange = _a.onValueChange, className = _a.className, listClassName = _a.listClassName, panelClassName = _a.panelClassName;
|
|
14
|
+
return (_jsxs("div", { className: cx("solid-tabs", className), children: [_jsx("div", { className: cx("solid-tabs-list", listClassName), role: "tablist", children: tabs.map(function (tab) {
|
|
15
|
+
var isActive = tab.value === value;
|
|
16
|
+
return (_jsx("button", { type: "button", role: "tab", "aria-selected": isActive, "aria-controls": "solid-tab-panel-".concat(tab.value), id: "solid-tab-".concat(tab.value), className: cx("solid-tabs-trigger", isActive && "is-active"), onClick: function () { return onValueChange(tab.value); }, children: tab.label }, tab.value));
|
|
17
|
+
}) }), tabs.map(function (tab) {
|
|
18
|
+
var isActive = tab.value === value;
|
|
19
|
+
return (_jsx("div", { role: "tabpanel", id: "solid-tab-panel-".concat(tab.value), "aria-labelledby": "solid-tab-".concat(tab.value), hidden: !isActive, className: cx("solid-tabs-panel", panelClassName), children: isActive ? tab.content : null }, tab.value));
|
|
20
|
+
})] }));
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=SolidTabs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SolidTabs.js","sourceRoot":"","sources":["../../../src/components/solid-ui/SolidTabs.tsx"],"names":[],"mappings":";AAiBA,SAAS,EAAE;IAAC,eAA2C;SAA3C,UAA2C,EAA3C,qBAA2C,EAA3C,IAA2C;QAA3C,0BAA2C;;IACrD,OAAO,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACzC,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,MAAqB;IAC5C,OAAO,IAAI,CAAC;AACd,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,EAOT;QANnB,IAAI,UAAA,EACJ,KAAK,WAA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sourcesContent":["import React from \"react\";\n\ntype SolidTabProps = {\n value: string;\n label: React.ReactNode;\n content: React.ReactNode;\n};\n\ntype SolidTabGroupProps = {\n tabs: SolidTabProps[];\n value: string;\n onValueChange: (value: string) => void;\n className?: string;\n listClassName?: string;\n panelClassName?: string;\n};\n\nfunction cx(...parts: Array<string | false | undefined>) {\n return parts.filter(Boolean).join(\" \");\n}\n\nexport function SolidTab(_props: SolidTabProps) {\n return null;\n}\n\nexport function SolidTabGroup({\n tabs,\n value,\n onValueChange,\n className,\n listClassName,\n panelClassName,\n}: SolidTabGroupProps) {\n return (\n <div className={cx(\"solid-tabs\", className)}>\n <div className={cx(\"solid-tabs-list\", listClassName)} role=\"tablist\">\n {tabs.map((tab) => {\n const isActive = tab.value === value;\n return (\n <button\n key={tab.value}\n type=\"button\"\n role=\"tab\"\n aria-selected={isActive}\n aria-controls={`solid-tab-panel-${tab.value}`}\n id={`solid-tab-${tab.value}`}\n className={cx(\"solid-tabs-trigger\", isActive && \"is-active\")}\n onClick={() => onValueChange(tab.value)}\n >\n {tab.label}\n </button>\n );\n })}\n </div>\n\n {tabs.map((tab) => {\n const isActive = tab.value === value;\n return (\n <div\n key={tab.value}\n role=\"tabpanel\"\n id={`solid-tab-panel-${tab.value}`}\n aria-labelledby={`solid-tab-${tab.value}`}\n hidden={!isActive}\n className={cx(\"solid-tabs-panel\", panelClassName)}\n >\n {isActive ? tab.content : null}\n </div>\n );\n })}\n </div>\n );\n}\n"]}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
type SolidTabProps = {
|
|
4
|
+
value: string;
|
|
5
|
+
label: React.ReactNode;
|
|
6
|
+
content: React.ReactNode;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
type SolidTabGroupProps = {
|
|
10
|
+
tabs: SolidTabProps[];
|
|
11
|
+
value: string;
|
|
12
|
+
onValueChange: (value: string) => void;
|
|
13
|
+
className?: string;
|
|
14
|
+
listClassName?: string;
|
|
15
|
+
panelClassName?: string;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
function cx(...parts: Array<string | false | undefined>) {
|
|
19
|
+
return parts.filter(Boolean).join(" ");
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function SolidTab(_props: SolidTabProps) {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function SolidTabGroup({
|
|
27
|
+
tabs,
|
|
28
|
+
value,
|
|
29
|
+
onValueChange,
|
|
30
|
+
className,
|
|
31
|
+
listClassName,
|
|
32
|
+
panelClassName,
|
|
33
|
+
}: SolidTabGroupProps) {
|
|
34
|
+
return (
|
|
35
|
+
<div className={cx("solid-tabs", className)}>
|
|
36
|
+
<div className={cx("solid-tabs-list", listClassName)} role="tablist">
|
|
37
|
+
{tabs.map((tab) => {
|
|
38
|
+
const isActive = tab.value === value;
|
|
39
|
+
return (
|
|
40
|
+
<button
|
|
41
|
+
key={tab.value}
|
|
42
|
+
type="button"
|
|
43
|
+
role="tab"
|
|
44
|
+
aria-selected={isActive}
|
|
45
|
+
aria-controls={`solid-tab-panel-${tab.value}`}
|
|
46
|
+
id={`solid-tab-${tab.value}`}
|
|
47
|
+
className={cx("solid-tabs-trigger", isActive && "is-active")}
|
|
48
|
+
onClick={() => onValueChange(tab.value)}
|
|
49
|
+
>
|
|
50
|
+
{tab.label}
|
|
51
|
+
</button>
|
|
52
|
+
);
|
|
53
|
+
})}
|
|
54
|
+
</div>
|
|
55
|
+
|
|
56
|
+
{tabs.map((tab) => {
|
|
57
|
+
const isActive = tab.value === value;
|
|
58
|
+
return (
|
|
59
|
+
<div
|
|
60
|
+
key={tab.value}
|
|
61
|
+
role="tabpanel"
|
|
62
|
+
id={`solid-tab-panel-${tab.value}`}
|
|
63
|
+
aria-labelledby={`solid-tab-${tab.value}`}
|
|
64
|
+
hidden={!isActive}
|
|
65
|
+
className={cx("solid-tabs-panel", panelClassName)}
|
|
66
|
+
>
|
|
67
|
+
{isActive ? tab.content : null}
|
|
68
|
+
</div>
|
|
69
|
+
);
|
|
70
|
+
})}
|
|
71
|
+
</div>
|
|
72
|
+
);
|
|
73
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/solid-ui/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/solid-ui/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC","sourcesContent":["export { SolidButton } from \"./SolidButton\";\nexport { SolidTab, SolidTabGroup } from \"./SolidTabs\";\n"]}
|