@tumaet/prompt-ui-components 1.0.11 → 1.1.0
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/DynamicIcon.js +34 -0
- package/dist/components/DynamicIcon.js.map +1 -0
- package/dist/components/ExportedApplicationAnswerTable.js +15 -0
- package/dist/components/ExportedApplicationAnswerTable.js.map +1 -0
- package/dist/components/FileList.js +43 -0
- package/dist/components/FileList.js.map +1 -0
- package/dist/components/FileUpload.js +76 -0
- package/dist/components/FileUpload.js.map +1 -0
- package/dist/components/FilterBadge.js +7 -0
- package/dist/components/FilterBadge.js.map +1 -0
- package/dist/components/MissingConfig.js +10 -0
- package/dist/components/MissingConfig.js.map +1 -0
- package/dist/components/MissingSettings.js +8 -0
- package/dist/components/MissingSettings.js.map +1 -0
- package/dist/components/ScoreLevelSelector.js +2 -5
- package/dist/components/ScoreLevelSelector.js.map +1 -1
- package/dist/components/SettingsCard.js +7 -0
- package/dist/components/SettingsCard.js.map +1 -0
- package/dist/components/StudentAvatar.js +11 -0
- package/dist/components/StudentAvatar.js.map +1 -0
- package/dist/components/StudentProfile.js +12 -0
- package/dist/components/StudentProfile.js.map +1 -0
- package/dist/components/StudentProfilePicture.js +13 -0
- package/dist/components/StudentProfilePicture.js.map +1 -0
- package/dist/components/ThemeToggle.js +9 -0
- package/dist/components/ThemeToggle.js.map +1 -0
- package/dist/components/index.js +26 -0
- package/dist/components/index.js.map +1 -1
- package/dist/components/minimal-tiptap/components/bubble-menu/link-bubble-menu.js +3 -3
- package/dist/components/minimal-tiptap/components/bubble-menu/link-bubble-menu.js.map +1 -1
- package/dist/components/minimal-tiptap/extensions/code-block-lowlight/code-block-lowlight.js +8 -1
- package/dist/components/minimal-tiptap/extensions/code-block-lowlight/code-block-lowlight.js.map +1 -1
- package/dist/components/minimal-tiptap/extensions/image/image.js +7 -2
- package/dist/components/minimal-tiptap/extensions/image/image.js.map +1 -1
- package/dist/components/minimal-tiptap/extensions/link/link.js +12 -1
- package/dist/components/minimal-tiptap/extensions/link/link.js.map +1 -1
- package/dist/components/minimal-tiptap/extensions/selection/selection.js.map +1 -1
- package/dist/components/pages/CoursePhaseParticipationsTable/CoursePhaseParticipationsTable.js +17 -0
- package/dist/components/pages/CoursePhaseParticipationsTable/CoursePhaseParticipationsTable.js.map +1 -0
- package/dist/components/pages/CoursePhaseParticipationsTable/table/participationActions.js +46 -0
- package/dist/components/pages/CoursePhaseParticipationsTable/table/participationActions.js.map +1 -0
- package/dist/components/pages/CoursePhaseParticipationsTable/table/participationColumns.js +37 -0
- package/dist/components/pages/CoursePhaseParticipationsTable/table/participationColumns.js.map +1 -0
- package/dist/components/pages/CoursePhaseParticipationsTable/table/participationFilters.js +22 -0
- package/dist/components/pages/CoursePhaseParticipationsTable/table/participationFilters.js.map +1 -0
- package/dist/components/pages/CoursePhaseParticipationsTable/table/participationRow.js +27 -0
- package/dist/components/pages/CoursePhaseParticipationsTable/table/participationRow.js.map +1 -0
- package/dist/components/pages/CoursePhaseParticipationsTable/utils/downloadParticipations.js +72 -0
- package/dist/components/pages/CoursePhaseParticipationsTable/utils/downloadParticipations.js.map +1 -0
- package/dist/components/pages/CoursePhaseParticipationsTable/utils/updateBatch.js +19 -0
- package/dist/components/pages/CoursePhaseParticipationsTable/utils/updateBatch.js.map +1 -0
- package/dist/components/pages/Mailing/CoursePhaseMailing.js +87 -0
- package/dist/components/pages/Mailing/CoursePhaseMailing.js.map +1 -0
- package/dist/components/pages/Mailing/components/AvailableMailPlaceholders.js +60 -0
- package/dist/components/pages/Mailing/components/AvailableMailPlaceholders.js.map +1 -0
- package/dist/components/pages/Mailing/components/ConfirmSendEmailDialog.js +43 -0
- package/dist/components/pages/Mailing/components/ConfirmSendEmailDialog.js.map +1 -0
- package/dist/components/pages/Mailing/components/MailingEditor.js +25 -0
- package/dist/components/pages/Mailing/components/MailingEditor.js.map +1 -0
- package/dist/components/pages/Mailing/components/ManualMailSending.js +33 -0
- package/dist/components/pages/Mailing/components/ManualMailSending.js.map +1 -0
- package/dist/components/pages/Mailing/components/SettingsCard.js +13 -0
- package/dist/components/pages/Mailing/components/SettingsCard.js.map +1 -0
- package/dist/components/table/GroupActionDialog.js +7 -0
- package/dist/components/table/GroupActionDialog.js.map +1 -0
- package/dist/components/table/PromptTable/filters/TableFiltersMenu.js +1 -1
- package/dist/components/table/PromptTable/filters/TableFiltersMenu.js.map +1 -1
- package/dist/components/table/SortableHeader.js +6 -0
- package/dist/components/table/SortableHeader.js.map +1 -0
- package/dist/contexts/DarkModeProvider.js +56 -0
- package/dist/contexts/DarkModeProvider.js.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/formatFileSize.js +9 -0
- package/dist/lib/formatFileSize.js.map +1 -0
- package/dist/lib/getCountries.js +15 -0
- package/dist/lib/getCountries.js.map +1 -0
- package/dist/lib/getGravatarUrl.js +7 -0
- package/dist/lib/getGravatarUrl.js.map +1 -0
- package/dist/lib/getStatusBadge.js +27 -0
- package/dist/lib/getStatusBadge.js.map +1 -0
- package/dist/lib/getStatusColor.js +13 -0
- package/dist/lib/getStatusColor.js.map +1 -0
- package/dist/lib/index.js +6 -0
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/openFileDownload.js +17 -0
- package/dist/lib/openFileDownload.js.map +1 -0
- package/dist/lib/translations.json +18 -0
- package/dist/types/components/DynamicIcon.d.ts +6 -0
- package/dist/types/components/ExportedApplicationAnswerTable.d.ts +6 -0
- package/dist/types/components/FileList.d.ts +9 -0
- package/dist/types/components/FileUpload.d.ts +13 -0
- package/dist/types/components/FilterBadge.d.ts +6 -0
- package/dist/types/components/MissingConfig.d.ts +13 -0
- package/dist/types/components/MissingSettings.d.ts +11 -0
- package/dist/types/components/MultiSelect.d.ts +1 -1
- package/dist/types/components/SettingsCard.d.ts +8 -0
- package/dist/types/components/StudentAvatar.d.ts +17 -0
- package/dist/types/components/StudentProfile.d.ts +7 -0
- package/dist/types/components/StudentProfilePicture.d.ts +9 -0
- package/dist/types/components/ThemeToggle.d.ts +1 -0
- package/dist/types/components/index.d.ts +26 -0
- package/dist/types/components/minimal-tiptap/extensions/color/color.d.ts +1 -1
- package/dist/types/components/minimal-tiptap/extensions/image/image.d.ts +1 -1
- package/dist/types/components/minimal-tiptap/extensions/link/link.d.ts +1 -1
- package/dist/types/components/minimal-tiptap/hooks/use-minimal-tiptap.d.ts +1 -1
- package/dist/types/components/pages/CoursePhaseParticipationsTable/CoursePhaseParticipationsTable.d.ts +15 -0
- package/dist/types/components/pages/CoursePhaseParticipationsTable/table/participationActions.d.ts +11 -0
- package/dist/types/components/pages/CoursePhaseParticipationsTable/table/participationColumns.d.ts +3 -0
- package/dist/types/components/pages/CoursePhaseParticipationsTable/table/participationFilters.d.ts +2 -0
- package/dist/types/components/pages/CoursePhaseParticipationsTable/table/participationRow.d.ts +35 -0
- package/dist/types/components/pages/CoursePhaseParticipationsTable/utils/downloadParticipations.d.ts +3 -0
- package/dist/types/components/pages/CoursePhaseParticipationsTable/utils/updateBatch.d.ts +5 -0
- package/dist/types/components/pages/Mailing/CoursePhaseMailing.d.ts +6 -0
- package/dist/types/components/pages/Mailing/components/AvailableMailPlaceholders.d.ts +12 -0
- package/dist/types/components/pages/Mailing/components/ConfirmSendEmailDialog.d.ts +8 -0
- package/dist/types/components/pages/Mailing/components/MailingEditor.d.ts +12 -0
- package/dist/types/components/pages/Mailing/components/ManualMailSending.d.ts +7 -0
- package/dist/types/components/pages/Mailing/components/SettingsCard.d.ts +7 -0
- package/dist/types/components/table/GroupActionDialog.d.ts +11 -0
- package/dist/types/components/table/SortableHeader.d.ts +4 -0
- package/dist/types/components/ui/alert.d.ts +1 -1
- package/dist/types/components/ui/badge.d.ts +1 -1
- package/dist/types/components/ui/button.d.ts +1 -1
- package/dist/types/components/ui/label.d.ts +1 -1
- package/dist/types/components/ui/sheet.d.ts +1 -1
- package/dist/types/components/ui/sidebar.d.ts +1 -1
- package/dist/types/components/ui/toast.d.ts +1 -1
- package/dist/types/components/ui/toggle-group.d.ts +2 -2
- package/dist/types/components/ui/toggle.d.ts +2 -2
- package/dist/types/contexts/DarkModeProvider.d.ts +11 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/lib/formatFileSize.d.ts +1 -0
- package/dist/types/lib/getCountries.d.ts +5 -0
- package/dist/types/lib/getGravatarUrl.d.ts +1 -0
- package/dist/types/lib/getStatusBadge.d.ts +3 -0
- package/dist/types/lib/getStatusColor.d.ts +2 -0
- package/dist/types/lib/index.d.ts +6 -0
- package/dist/types/lib/openFileDownload.d.ts +6 -0
- package/package.json +45 -27
- package/tailwind-config.js +50 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Send } from 'lucide-react';
|
|
3
|
+
import { PassStatus } from '@tumaet/prompt-shared-state';
|
|
4
|
+
import { useState } from 'react';
|
|
5
|
+
import { ConfirmSendEmailDialog } from './ConfirmSendEmailDialog';
|
|
6
|
+
import { Button, Label, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, } from '../../../../components';
|
|
7
|
+
import { useGetMailingIsConfigured } from '@tumaet/prompt-shared-state';
|
|
8
|
+
export const ManualMailSending = ({ mailingMetaData, isModified }) => {
|
|
9
|
+
const [confirmationDialogOpen, setConfirmationDialogOpen] = useState(false);
|
|
10
|
+
const [sendEmailType, setSendEmailType] = useState(null);
|
|
11
|
+
const courseMailingIsConfigured = useGetMailingIsConfigured();
|
|
12
|
+
const isDisabled = (type) => {
|
|
13
|
+
if (isModified)
|
|
14
|
+
return true;
|
|
15
|
+
const contentCheck = type === PassStatus.PASSED
|
|
16
|
+
? mailingMetaData?.passedMailContent && mailingMetaData?.passedMailSubject
|
|
17
|
+
: mailingMetaData?.failedMailContent && mailingMetaData?.failedMailSubject;
|
|
18
|
+
return !(contentCheck && courseMailingIsConfigured);
|
|
19
|
+
};
|
|
20
|
+
const tooltipMessage = courseMailingIsConfigured
|
|
21
|
+
? 'Configure the mail subject and content and save changes before sending.'
|
|
22
|
+
: 'Configure the mailing in the course mail settings before sending.';
|
|
23
|
+
return (_jsx(_Fragment, { children: _jsxs(TooltipProvider, { children: [_jsxs("div", { className: 'flex flex-col sm:flex-row sm:items-center justify-between gap-2', children: [_jsxs("div", { className: 'space-y-0.5', children: [_jsx(Label, { children: "Manual Acceptance Emails" }), _jsx("p", { className: 'text-sm text-muted-foreground', children: "Send an acceptance mail to ALL accepted students." })] }), _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { children: _jsxs(Button, { className: 'w-full sm:w-auto', variant: 'outline', onClick: (e) => {
|
|
24
|
+
e.preventDefault();
|
|
25
|
+
setSendEmailType(PassStatus.PASSED);
|
|
26
|
+
setConfirmationDialogOpen(true);
|
|
27
|
+
}, disabled: isDisabled(PassStatus.PASSED), children: [_jsx(Send, { className: 'mr-2 h-4 w-4' }), "Send Acceptance Mails"] }) }), isDisabled(PassStatus.PASSED) && _jsxs(TooltipContent, { children: [tooltipMessage, " "] })] })] }), _jsxs("div", { className: 'flex flex-col sm:flex-row sm:items-center justify-between gap-2', children: [_jsxs("div", { className: 'space-y-0.5', children: [_jsx(Label, { children: "Manual Rejection Emails" }), _jsx("p", { className: 'text-sm text-muted-foreground', children: "Send a rejection mail to ALL rejected students." })] }), _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { children: _jsxs(Button, { className: 'w-full sm:w-auto', variant: 'outline', onClick: (e) => {
|
|
28
|
+
e.preventDefault();
|
|
29
|
+
setSendEmailType(PassStatus.FAILED);
|
|
30
|
+
setConfirmationDialogOpen(true);
|
|
31
|
+
}, disabled: isDisabled(PassStatus.FAILED), children: [_jsx(Send, { className: 'mr-2 h-4 w-4' }), "Send Rejection Mails"] }) }), isDisabled(PassStatus.FAILED) && _jsxs(TooltipContent, { children: [tooltipMessage, " "] })] })] }), confirmationDialogOpen && sendEmailType && (_jsx(ConfirmSendEmailDialog, { isOpen: confirmationDialogOpen, onClose: () => setConfirmationDialogOpen(false), emailType: sendEmailType }))] }) }));
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=ManualMailSending.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ManualMailSending.js","sourceRoot":"","sources":["../../../../../src/components/pages/Mailing/components/ManualMailSending.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACnC,OAAO,EAAE,UAAU,EAAgC,MAAM,6BAA6B,CAAA;AACtF,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAChC,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;AACjE,OAAO,EACL,MAAM,EACN,KAAK,EACL,OAAO,EACP,cAAc,EACd,eAAe,EACf,cAAc,GACf,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAA;AAOvE,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,EAAE,eAAe,EAAE,UAAU,EAA0B,EAAE,EAAE;IAC3F,MAAM,CAAC,sBAAsB,EAAE,yBAAyB,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAA;IAC3E,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,QAAQ,CAAoB,IAAI,CAAC,CAAA;IAE3E,MAAM,yBAAyB,GAAG,yBAAyB,EAAE,CAAA;IAE7D,MAAM,UAAU,GAAG,CAAC,IAAgB,EAAE,EAAE;QACtC,IAAI,UAAU;YAAE,OAAO,IAAI,CAAA;QAE3B,MAAM,YAAY,GAChB,IAAI,KAAK,UAAU,CAAC,MAAM;YACxB,CAAC,CAAC,eAAe,EAAE,iBAAiB,IAAI,eAAe,EAAE,iBAAiB;YAC1E,CAAC,CAAC,eAAe,EAAE,iBAAiB,IAAI,eAAe,EAAE,iBAAiB,CAAA;QAE9E,OAAO,CAAC,CAAC,YAAY,IAAI,yBAAyB,CAAC,CAAA;IACrD,CAAC,CAAA;IAED,MAAM,cAAc,GAAG,yBAAyB;QAC9C,CAAC,CAAC,yEAAyE;QAC3E,CAAC,CAAC,mEAAmE,CAAA;IAEvE,OAAO,CACL,4BACE,MAAC,eAAe,eACd,eAAK,SAAS,EAAC,iEAAiE,aAC9E,eAAK,SAAS,EAAC,aAAa,aAC1B,KAAC,KAAK,2CAAiC,EACvC,YAAG,SAAS,EAAC,+BAA+B,kEAExC,IACA,EACN,MAAC,OAAO,eACN,KAAC,cAAc,cACb,MAAC,MAAM,IACL,SAAS,EAAC,kBAAkB,EAC5B,OAAO,EAAC,SAAS,EACjB,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;4CACb,CAAC,CAAC,cAAc,EAAE,CAAA;4CAClB,gBAAgB,CAAC,UAAU,CAAC,MAAM,CAAC,CAAA;4CACnC,yBAAyB,CAAC,IAAI,CAAC,CAAA;wCACjC,CAAC,EACD,QAAQ,EAAE,UAAU,CAAC,UAAU,CAAC,MAAM,CAAC,aAEvC,KAAC,IAAI,IAAC,SAAS,EAAC,cAAc,GAAG,6BAE1B,GACM,EAChB,UAAU,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,MAAC,cAAc,eAAE,cAAc,SAAmB,IAC5E,IACN,EACN,eAAK,SAAS,EAAC,iEAAiE,aAC9E,eAAK,SAAS,EAAC,aAAa,aAC1B,KAAC,KAAK,0CAAgC,EACtC,YAAG,SAAS,EAAC,+BAA+B,gEAExC,IACA,EACN,MAAC,OAAO,eACN,KAAC,cAAc,cACb,MAAC,MAAM,IACL,SAAS,EAAC,kBAAkB,EAC5B,OAAO,EAAC,SAAS,EACjB,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;4CACb,CAAC,CAAC,cAAc,EAAE,CAAA;4CAClB,gBAAgB,CAAC,UAAU,CAAC,MAAM,CAAC,CAAA;4CACnC,yBAAyB,CAAC,IAAI,CAAC,CAAA;wCACjC,CAAC,EACD,QAAQ,EAAE,UAAU,CAAC,UAAU,CAAC,MAAM,CAAC,aAEvC,KAAC,IAAI,IAAC,SAAS,EAAC,cAAc,GAAG,4BAE1B,GACM,EAChB,UAAU,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,MAAC,cAAc,eAAE,cAAc,SAAmB,IAC5E,IACN,EACL,sBAAsB,IAAI,aAAa,IAAI,CAC1C,KAAC,sBAAsB,IACrB,MAAM,EAAE,sBAAsB,EAC9B,OAAO,EAAE,GAAG,EAAE,CAAC,yBAAyB,CAAC,KAAK,CAAC,EAC/C,SAAS,EAAE,aAAa,GACxB,CACH,IACe,GACjB,CACJ,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Badge, Card, CardContent, CardDescription, CardHeader, CardTitle } from '../../../../components';
|
|
3
|
+
import { ManualMailSending } from './ManualMailSending';
|
|
4
|
+
import { Info } from 'lucide-react';
|
|
5
|
+
export const SettingsCard = ({ mailingMetaData, isModified }) => {
|
|
6
|
+
const someMailFunctionDisabled = isModified ||
|
|
7
|
+
!mailingMetaData?.passedMailContent ||
|
|
8
|
+
!mailingMetaData?.passedMailSubject ||
|
|
9
|
+
!mailingMetaData?.failedMailContent ||
|
|
10
|
+
!mailingMetaData?.failedMailSubject;
|
|
11
|
+
return (_jsx(_Fragment, { children: _jsxs(Card, { className: 'w-full', children: [_jsxs(CardHeader, { children: [_jsxs("div", { className: 'flex items-center justify-between', children: [_jsx(CardTitle, { children: "E-Mail Settings" }), isModified && (_jsx(Badge, { variant: 'outline', className: 'bg-yellow-100 text-yellow-800 border-yellow-300', children: "Unsaved Changes" }))] }), _jsx(CardDescription, { children: "Configure email settings for the application phase" })] }), _jsxs(CardContent, { className: 'space-y-6', children: [someMailFunctionDisabled && (_jsxs("div", { className: 'flex items-start space-x-2 text-sm text-muted-foreground bg-muted p-3 rounded-md', children: [_jsx(Info, { className: 'h-4 w-4 mt-0.5 flex-shrink-0' }), _jsx("p", { children: "Some of the following mailing options are disabled. Please make sure to configure and save the corresponding mail subject and content." })] })), _jsx("div", { className: 'space-y-4', children: _jsx(ManualMailSending, { mailingMetaData: mailingMetaData, isModified: isModified }) })] })] }) }));
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=SettingsCard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SettingsCard.js","sourceRoot":"","sources":["../../../../../src/components/pages/Mailing/components/SettingsCard.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,eAAe,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAC/F,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAEvD,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAOnC,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,EAAE,eAAe,EAAE,UAAU,EAAqB,EAAE,EAAE;IACjF,MAAM,wBAAwB,GAC5B,UAAU;QACV,CAAC,eAAe,EAAE,iBAAiB;QACnC,CAAC,eAAe,EAAE,iBAAiB;QACnC,CAAC,eAAe,EAAE,iBAAiB;QACnC,CAAC,eAAe,EAAE,iBAAiB,CAAA;IAErC,OAAO,CACL,4BACE,MAAC,IAAI,IAAC,SAAS,EAAC,QAAQ,aACtB,MAAC,UAAU,eACT,eAAK,SAAS,EAAC,mCAAmC,aAChD,KAAC,SAAS,kCAA4B,EACrC,UAAU,IAAI,CACb,KAAC,KAAK,IAAC,OAAO,EAAC,SAAS,EAAC,SAAS,EAAC,iDAAiD,gCAE5E,CACT,IACG,EACN,KAAC,eAAe,qEAAqE,IAC1E,EACb,MAAC,WAAW,IAAC,SAAS,EAAC,WAAW,aAC/B,wBAAwB,IAAI,CAC3B,eAAK,SAAS,EAAC,kFAAkF,aAC/F,KAAC,IAAI,IAAC,SAAS,EAAC,8BAA8B,GAAG,EACjD,iKAGI,IACA,CACP,EACD,cAAK,SAAS,EAAC,WAAW,YACxB,KAAC,iBAAiB,IAAC,eAAe,EAAE,eAAe,EAAE,UAAU,EAAE,UAAU,GAAI,GAC3E,IACM,IACT,GACN,CACJ,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Button, Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, } from '../../components';
|
|
3
|
+
export const ActionDialog = ({ title, description, confirmLabel, confirmVariant = 'default', isOpen, onClose, onConfirm, }) => (_jsx(Dialog, { open: isOpen, onOpenChange: onClose, children: _jsxs(DialogContent, { children: [_jsxs(DialogHeader, { children: [_jsx(DialogTitle, { children: title }), _jsx(DialogDescription, { children: description })] }), _jsxs(DialogFooter, { children: [_jsx(Button, { variant: 'outline', onClick: onClose, children: "Cancel" }), _jsx(Button, { variant: confirmVariant, onClick: () => {
|
|
4
|
+
onConfirm();
|
|
5
|
+
onClose();
|
|
6
|
+
}, children: confirmLabel })] })] }) }));
|
|
7
|
+
//# sourceMappingURL=GroupActionDialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GroupActionDialog.js","sourceRoot":"","sources":["../../../src/components/table/GroupActionDialog.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,MAAM,EACN,MAAM,EACN,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,WAAW,GACZ,MAAM,cAAc,CAAA;AAYrB,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,EAC3B,KAAK,EACL,WAAW,EACX,YAAY,EACZ,cAAc,GAAG,SAAS,EAC1B,MAAM,EACN,OAAO,EACP,SAAS,GACS,EAAE,EAAE,CAAC,CACvB,KAAC,MAAM,IAAC,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,YACzC,MAAC,aAAa,eACZ,MAAC,YAAY,eACX,KAAC,WAAW,cAAE,KAAK,GAAe,EAClC,KAAC,iBAAiB,cAAE,WAAW,GAAqB,IACvC,EACf,MAAC,YAAY,eACX,KAAC,MAAM,IAAC,OAAO,EAAC,SAAS,EAAC,OAAO,EAAE,OAAO,uBAEjC,EACT,KAAC,MAAM,IACL,OAAO,EAAE,cAAc,EACvB,OAAO,EAAE,GAAG,EAAE;4BACZ,SAAS,EAAE,CAAA;4BACX,OAAO,EAAE,CAAA;wBACX,CAAC,YAEA,YAAY,GACN,IACI,IACD,GACT,CACV,CAAA"}
|
|
@@ -4,7 +4,7 @@ import { SelectFilterSection } from './SelectFilterSection';
|
|
|
4
4
|
import { NumericRangeFilterSection } from './NumericRangeFilterSection';
|
|
5
5
|
import { Filter } from 'lucide-react';
|
|
6
6
|
export function TableFiltersMenu({ table, filters, trigger }) {
|
|
7
|
-
return (_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: trigger ?? (_jsxs(Button, { variant: 'outline', className: 'justify-start', children: [_jsx(Filter, { className: 'h-4 w-4' }), _jsx("span", { className: 'hidden sm:inline', children: "Filter" })] })) }), _jsx(DropdownMenuContent, { className: 'w-64', children: filters.map((filter) => {
|
|
7
|
+
return (_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: trigger ?? (_jsxs(Button, { variant: 'outline', className: 'justify-start', children: [_jsx(Filter, { className: 'h-4 w-4' }), _jsx("span", { className: 'hidden sm:inline', children: "Filter" })] })) }), _jsx(DropdownMenuContent, { className: 'w-64 max-h-[60vh] overflow-y-auto', children: filters.map((filter) => {
|
|
8
8
|
const column = table.getColumn(filter.id);
|
|
9
9
|
if (!column)
|
|
10
10
|
return null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableFiltersMenu.js","sourceRoot":"","sources":["../../../../../src/components/table/PromptTable/filters/TableFiltersMenu.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAIhG,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAA;AACvE,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAQrC,MAAM,UAAU,gBAAgB,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAyB;IACjF,OAAO,CACL,MAAC,YAAY,eACX,KAAC,mBAAmB,IAAC,OAAO,kBACzB,OAAO,IAAI,CACV,MAAC,MAAM,IAAC,OAAO,EAAC,SAAS,EAAC,SAAS,EAAC,eAAe,aACjD,KAAC,MAAM,IAAC,SAAS,EAAC,SAAS,GAAG,EAC9B,eAAM,SAAS,EAAC,kBAAkB,uBAAc,IACzC,CACV,GACmB,EAEtB,KAAC,mBAAmB,IAAC,SAAS,EAAC,
|
|
1
|
+
{"version":3,"file":"TableFiltersMenu.js","sourceRoot":"","sources":["../../../../../src/components/table/PromptTable/filters/TableFiltersMenu.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAIhG,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAA;AACvE,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAQrC,MAAM,UAAU,gBAAgB,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAyB;IACjF,OAAO,CACL,MAAC,YAAY,eACX,KAAC,mBAAmB,IAAC,OAAO,kBACzB,OAAO,IAAI,CACV,MAAC,MAAM,IAAC,OAAO,EAAC,SAAS,EAAC,SAAS,EAAC,eAAe,aACjD,KAAC,MAAM,IAAC,SAAS,EAAC,SAAS,GAAG,EAC9B,eAAM,SAAS,EAAC,kBAAkB,uBAAc,IACzC,CACV,GACmB,EAEtB,KAAC,mBAAmB,IAAC,SAAS,EAAC,mCAAmC,YAC/D,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;oBACtB,MAAM,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;oBACzC,IAAI,CAAC,MAAM;wBAAE,OAAO,IAAI,CAAA;oBAExB,IAAI,MAAM,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;wBAC7B,OAAO,CACL,KAAC,mBAAmB,IAElB,KAAK,EAAE,MAAM,CAAC,KAAK,EACnB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,CAAC,OAAO,EACvB,UAAU,EAAE,MAAM,CAAC,WAAW,IAJzB,MAAM,CAAC,EAAE,CAKd,CACH,CAAA;oBACH,CAAC;oBAED,IAAI,MAAM,CAAC,IAAI,KAAK,cAAc,EAAE,CAAC;wBACnC,OAAO,CACL,KAAC,yBAAyB,IAExB,KAAK,EAAE,MAAM,CAAC,KAAK,EACnB,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,MAAM,CAAC,YAAY,IAH5B,MAAM,CAAC,EAAE,CAId,CACH,CAAA;oBACH,CAAC;oBAED,OAAO,wBAAsB,MAAM,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,IAA5C,MAAM,CAAC,EAAE,CAA0C,CAAA;gBACtE,CAAC,CAAC,GACkB,IACT,CAChB,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ArrowDown, ArrowUp, ArrowUpDown } from 'lucide-react';
|
|
3
|
+
export const SortableHeader = ({ column, title }) => {
|
|
4
|
+
return (_jsxs("button", { type: 'button', onClick: () => column.toggleSorting(column.getIsSorted() === 'asc'), className: 'flex items-center hover:cursor-pointer', children: [title, column.getIsSorted() === 'asc' ? (_jsx(ArrowUp, { className: 'ml-2 h-4 w-4' })) : column.getIsSorted() === 'desc' ? (_jsx(ArrowDown, { className: 'ml-2 h-4 w-4' })) : (_jsx(ArrowUpDown, { className: 'ml-2 h-4 w-4' }))] }));
|
|
5
|
+
};
|
|
6
|
+
//# sourceMappingURL=SortableHeader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SortableHeader.js","sourceRoot":"","sources":["../../../src/components/table/SortableHeader.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAE9D,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,EAAE,MAAM,EAAE,KAAK,EAAkC,EAAE,EAAE;IAClF,OAAO,CACL,kBACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,WAAW,EAAE,KAAK,KAAK,CAAC,EACnE,SAAS,EAAC,wCAAwC,aAEjD,KAAK,EACL,MAAM,CAAC,WAAW,EAAE,KAAK,KAAK,CAAC,CAAC,CAAC,CAChC,KAAC,OAAO,IAAC,SAAS,EAAC,cAAc,GAAG,CACrC,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,EAAE,KAAK,MAAM,CAAC,CAAC,CAAC,CACpC,KAAC,SAAS,IAAC,SAAS,EAAC,cAAc,GAAG,CACvC,CAAC,CAAC,CAAC,CACF,KAAC,WAAW,IAAC,SAAS,EAAC,cAAc,GAAG,CACzC,IACM,CACV,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createContext, useContext, useEffect, useState } from 'react';
|
|
3
|
+
const DarkModeContext = createContext(undefined);
|
|
4
|
+
export const useDarkMode = () => {
|
|
5
|
+
const context = useContext(DarkModeContext);
|
|
6
|
+
if (!context) {
|
|
7
|
+
throw new Error('useDarkMode must be used within a DarkModeProvider');
|
|
8
|
+
}
|
|
9
|
+
return context;
|
|
10
|
+
};
|
|
11
|
+
const getSystemTheme = () => {
|
|
12
|
+
if (window.matchMedia('(prefers-color-scheme: dark)').matches) {
|
|
13
|
+
return 'dark';
|
|
14
|
+
}
|
|
15
|
+
return 'light';
|
|
16
|
+
};
|
|
17
|
+
const DarkModeProvider = ({ children }) => {
|
|
18
|
+
const [theme, setTheme] = useState(() => {
|
|
19
|
+
const savedTheme = localStorage.getItem('theme');
|
|
20
|
+
if (savedTheme)
|
|
21
|
+
return savedTheme;
|
|
22
|
+
return 'system';
|
|
23
|
+
});
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
const root = document.documentElement;
|
|
26
|
+
const currentTheme = theme === 'system' ? getSystemTheme() : theme;
|
|
27
|
+
if (currentTheme === 'dark') {
|
|
28
|
+
root.classList.add('dark');
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
root.classList.remove('dark');
|
|
32
|
+
}
|
|
33
|
+
localStorage.setItem('theme', theme);
|
|
34
|
+
}, [theme]);
|
|
35
|
+
useEffect(() => {
|
|
36
|
+
const handleSystemThemeChange = (e) => {
|
|
37
|
+
if (theme === 'system') {
|
|
38
|
+
const root = document.documentElement;
|
|
39
|
+
if (e.matches) {
|
|
40
|
+
root.classList.add('dark');
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
root.classList.remove('dark');
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
const mediaQuery = window.matchMedia('(prefers-color-scheme: dark)');
|
|
48
|
+
mediaQuery.addEventListener('change', handleSystemThemeChange);
|
|
49
|
+
return () => {
|
|
50
|
+
mediaQuery.removeEventListener('change', handleSystemThemeChange);
|
|
51
|
+
};
|
|
52
|
+
}, [theme]);
|
|
53
|
+
return _jsx(DarkModeContext.Provider, { value: { theme, setTheme }, children: children });
|
|
54
|
+
};
|
|
55
|
+
export default DarkModeProvider;
|
|
56
|
+
//# sourceMappingURL=DarkModeProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DarkModeProvider.js","sourceRoot":"","sources":["../../src/contexts/DarkModeProvider.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAS7E,MAAM,eAAe,GAAG,aAAa,CAAmC,SAAS,CAAC,CAAA;AAElF,MAAM,CAAC,MAAM,WAAW,GAAG,GAAyB,EAAE;IACpD,MAAM,OAAO,GAAG,UAAU,CAAC,eAAe,CAAC,CAAA;IAC3C,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,oDAAoD,CAAC,CAAA;IACvE,CAAC;IACD,OAAO,OAAO,CAAA;AAChB,CAAC,CAAA;AAED,MAAM,cAAc,GAAG,GAAU,EAAE;IACjC,IAAI,MAAM,CAAC,UAAU,CAAC,8BAA8B,CAAC,CAAC,OAAO,EAAE,CAAC;QAC9D,OAAO,MAAM,CAAA;IACf,CAAC;IACD,OAAO,OAAO,CAAA;AAChB,CAAC,CAAA;AAED,MAAM,gBAAgB,GAA4C,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;IACjF,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAQ,GAAG,EAAE;QAC7C,MAAM,UAAU,GAAG,YAAY,CAAC,OAAO,CAAC,OAAO,CAAiB,CAAA;QAChE,IAAI,UAAU;YAAE,OAAO,UAAU,CAAA;QACjC,OAAO,QAAQ,CAAA;IACjB,CAAC,CAAC,CAAA;IAEF,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,IAAI,GAAG,QAAQ,CAAC,eAAe,CAAA;QACrC,MAAM,YAAY,GAAG,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC,KAAK,CAAA;QAElE,IAAI,YAAY,KAAK,MAAM,EAAE,CAAC;YAC5B,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;QAC5B,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;QAC/B,CAAC;QAED,YAAY,CAAC,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;IACtC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAA;IAEX,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,uBAAuB,GAAG,CAAC,CAAsB,EAAE,EAAE;YACzD,IAAI,KAAK,KAAK,QAAQ,EAAE,CAAC;gBACvB,MAAM,IAAI,GAAG,QAAQ,CAAC,eAAe,CAAA;gBACrC,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC;oBACd,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;gBAC5B,CAAC;qBAAM,CAAC;oBACN,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;gBAC/B,CAAC;YACH,CAAC;QACH,CAAC,CAAA;QAED,MAAM,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC,8BAA8B,CAAC,CAAA;QACpE,UAAU,CAAC,gBAAgB,CAAC,QAAQ,EAAE,uBAAuB,CAAC,CAAA;QAE9D,OAAO,GAAG,EAAE;YACV,UAAU,CAAC,mBAAmB,CAAC,QAAQ,EAAE,uBAAuB,CAAC,CAAA;QACnE,CAAC,CAAA;IACH,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAA;IAEX,OAAO,KAAC,eAAe,CAAC,QAAQ,IAAC,KAAK,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,YAAG,QAAQ,GAA4B,CAAA;AACpG,CAAC,CAAA;AAED,eAAe,gBAAgB,CAAA"}
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAC3B,cAAc,cAAc,CAAA;AAC5B,cAAc,SAAS,CAAA;AACvB,cAAc,OAAO,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAC3B,cAAc,cAAc,CAAA;AAC5B,cAAc,SAAS,CAAA;AACvB,cAAc,OAAO,CAAA;AACrB,cAAc,6BAA6B,CAAA;AAC3C,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,6BAA6B,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export const formatFileSize = (bytes) => {
|
|
2
|
+
if (!bytes)
|
|
3
|
+
return '0 Bytes';
|
|
4
|
+
const k = 1024;
|
|
5
|
+
const sizes = ['Bytes', 'KB', 'MB', 'GB'];
|
|
6
|
+
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
7
|
+
return `${Math.round((bytes / Math.pow(k, i)) * 100) / 100} ${sizes[i]}`;
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=formatFileSize.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatFileSize.js","sourceRoot":"","sources":["../../src/lib/formatFileSize.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,KAAa,EAAU,EAAE;IACtD,IAAI,CAAC,KAAK;QAAE,OAAO,SAAS,CAAA;IAC5B,MAAM,CAAC,GAAG,IAAI,CAAA;IACd,MAAM,KAAK,GAAG,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;IACzC,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAA;IACnD,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,GAAG,IAAI,KAAK,CAAC,CAAC,CAAC,EAAE,CAAA;AAC1E,CAAC,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Getting the list of countries
|
|
2
|
+
import countries from 'i18n-iso-countries';
|
|
3
|
+
import enLocale from 'i18n-iso-countries/langs/en.json';
|
|
4
|
+
countries.registerLocale(enLocale);
|
|
5
|
+
export const countriesArr = Object.entries(countries.getNames('en', { select: 'alias' })).map(([key, value]) => {
|
|
6
|
+
return {
|
|
7
|
+
label: value,
|
|
8
|
+
value: key,
|
|
9
|
+
};
|
|
10
|
+
});
|
|
11
|
+
// Getting the name of the country by its code
|
|
12
|
+
export const getCountryName = (code) => {
|
|
13
|
+
return countriesArr.find((country) => country.value === code)?.label;
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=getCountries.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getCountries.js","sourceRoot":"","sources":["../../src/lib/getCountries.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,OAAO,SAAS,MAAM,oBAAoB,CAAA;AAC1C,OAAO,QAAQ,MAAM,kCAAkC,CAAA;AAEvD,SAAS,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAA;AAClC,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,GAAG,CAC3F,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;IACf,OAAO;QACL,KAAK,EAAE,KAAK;QACZ,KAAK,EAAE,GAAG;KACX,CAAA;AACH,CAAC,CACF,CAAA;AAED,8CAA8C;AAC9C,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,IAAY,EAAsB,EAAE;IACjE,OAAO,YAAY,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,KAAK,IAAI,CAAC,EAAE,KAAK,CAAA;AACtE,CAAC,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { sha256 } from 'js-sha256';
|
|
2
|
+
export const getGravatarUrl = (email, size) => {
|
|
3
|
+
const requestedSize = size ?? 200;
|
|
4
|
+
const hash = sha256(email.trim().toLowerCase());
|
|
5
|
+
return `https://www.gravatar.com/avatar/${hash}?d=identicon&d=404&size=${requestedSize}`;
|
|
6
|
+
};
|
|
7
|
+
//# sourceMappingURL=getGravatarUrl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getGravatarUrl.js","sourceRoot":"","sources":["../../src/lib/getGravatarUrl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAElC,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,KAAa,EAAE,IAAa,EAAE,EAAE;IAC7D,MAAM,aAAa,GAAG,IAAI,IAAI,GAAG,CAAA;IACjC,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,CAAA;IAE/C,OAAO,mCAAmC,IAAI,2BAA2B,aAAa,EAAE,CAAA;AAC1F,CAAC,CAAA"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Badge } from '../components';
|
|
3
|
+
export function getStatusBadge(status) {
|
|
4
|
+
switch (status) {
|
|
5
|
+
case 'passed':
|
|
6
|
+
return _jsx(Badge, { className: 'bg-green-500 hover:bg-green-500', children: "Passed" });
|
|
7
|
+
case 'failed':
|
|
8
|
+
return _jsx(Badge, { className: 'bg-red-500 hover:bg-red-500', children: "Failed" });
|
|
9
|
+
case 'not_assessed':
|
|
10
|
+
return _jsx(Badge, { className: 'bg-gray-500 hover:bg-gray-500', children: "Not Assessed" });
|
|
11
|
+
default:
|
|
12
|
+
return _jsx(Badge, { className: 'bg-gray-500 hover:bg-gray-500', children: "Unknown" });
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
export function getStatusString(status) {
|
|
16
|
+
switch (status) {
|
|
17
|
+
case 'passed':
|
|
18
|
+
return 'Passed';
|
|
19
|
+
case 'failed':
|
|
20
|
+
return 'Failed';
|
|
21
|
+
case 'not_assessed':
|
|
22
|
+
return 'Not Assessed';
|
|
23
|
+
default:
|
|
24
|
+
return 'Unknown';
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=getStatusBadge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getStatusBadge.js","sourceRoot":"","sources":["../../src/lib/getStatusBadge.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AAGpC,MAAM,UAAU,cAAc,CAAC,MAAkB;IAC/C,QAAQ,MAAM,EAAE,CAAC;QACf,KAAK,QAAQ;YACX,OAAO,KAAC,KAAK,IAAC,SAAS,EAAC,iCAAiC,uBAAe,CAAA;QAC1E,KAAK,QAAQ;YACX,OAAO,KAAC,KAAK,IAAC,SAAS,EAAC,6BAA6B,uBAAe,CAAA;QACtE,KAAK,cAAc;YACjB,OAAO,KAAC,KAAK,IAAC,SAAS,EAAC,+BAA+B,6BAAqB,CAAA;QAC9E;YACE,OAAO,KAAC,KAAK,IAAC,SAAS,EAAC,+BAA+B,wBAAgB,CAAA;IAC3E,CAAC;AACH,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,MAAkB;IAChD,QAAQ,MAAM,EAAE,CAAC;QACf,KAAK,QAAQ;YACX,OAAO,QAAQ,CAAA;QACjB,KAAK,QAAQ;YACX,OAAO,QAAQ,CAAA;QACjB,KAAK,cAAc;YACjB,OAAO,cAAc,CAAA;QACvB;YACE,OAAO,SAAS,CAAA;IACpB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { PassStatus } from '@tumaet/prompt-shared-state';
|
|
2
|
+
export const getStatusColor = (assessmentStatus) => {
|
|
3
|
+
switch (assessmentStatus) {
|
|
4
|
+
case PassStatus.PASSED:
|
|
5
|
+
return 'bg-green-500 dark:bg-green-700';
|
|
6
|
+
case PassStatus.FAILED:
|
|
7
|
+
return 'bg-red-500 dark:bg-red-700';
|
|
8
|
+
case PassStatus.NOT_ASSESSED:
|
|
9
|
+
default:
|
|
10
|
+
return 'bg-gray-500 dark:bg-gray-700';
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=getStatusColor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getStatusColor.js","sourceRoot":"","sources":["../../src/lib/getStatusColor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AAExD,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,gBAA4B,EAAE,EAAE;IAC7D,QAAQ,gBAAgB,EAAE,CAAC;QACzB,KAAK,UAAU,CAAC,MAAM;YACpB,OAAO,gCAAgC,CAAA;QACzC,KAAK,UAAU,CAAC,MAAM;YACpB,OAAO,4BAA4B,CAAA;QACrC,KAAK,UAAU,CAAC,YAAY,CAAC;QAC7B;YACE,OAAO,8BAA8B,CAAA;IACzC,CAAC;AACH,CAAC,CAAA"}
|
package/dist/lib/index.js
CHANGED
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
export * from './utils';
|
|
2
|
+
export * from './formatFileSize';
|
|
3
|
+
export * from './getCountries';
|
|
4
|
+
export * from './getGravatarUrl';
|
|
5
|
+
export * from './getStatusBadge';
|
|
6
|
+
export * from './getStatusColor';
|
|
7
|
+
export * from './openFileDownload';
|
|
2
8
|
//# sourceMappingURL=index.js.map
|
package/dist/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA;AACvB,cAAc,kBAAkB,CAAA;AAChC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,kBAAkB,CAAA;AAChC,cAAc,kBAAkB,CAAA;AAChC,cAAc,kBAAkB,CAAA;AAChC,cAAc,oBAAoB,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export const openFileDownload = async ({ downloadUrl, fileName, }) => {
|
|
2
|
+
if (!downloadUrl) {
|
|
3
|
+
console.error('No download URL available for this file.');
|
|
4
|
+
return;
|
|
5
|
+
}
|
|
6
|
+
const link = document.createElement('a');
|
|
7
|
+
link.href = downloadUrl;
|
|
8
|
+
link.target = '_blank';
|
|
9
|
+
link.rel = 'noopener noreferrer';
|
|
10
|
+
if (fileName) {
|
|
11
|
+
link.download = fileName;
|
|
12
|
+
}
|
|
13
|
+
document.body.appendChild(link);
|
|
14
|
+
link.click();
|
|
15
|
+
link.remove();
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=openFileDownload.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openFileDownload.js","sourceRoot":"","sources":["../../src/lib/openFileDownload.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAK,EAAE,EACrC,WAAW,EACX,QAAQ,GACe,EAAiB,EAAE;IAC1C,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,OAAO,CAAC,KAAK,CAAC,0CAA0C,CAAC,CAAA;QACzD,OAAM;IACR,CAAC;IAED,MAAM,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC,CAAA;IACxC,IAAI,CAAC,IAAI,GAAG,WAAW,CAAA;IACvB,IAAI,CAAC,MAAM,GAAG,QAAQ,CAAA;IACtB,IAAI,CAAC,GAAG,GAAG,qBAAqB,CAAA;IAChC,IAAI,QAAQ,EAAE,CAAC;QACb,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;IAC1B,CAAC;IACD,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;IAC/B,IAAI,CAAC,KAAK,EAAE,CAAA;IACZ,IAAI,CAAC,MAAM,EAAE,CAAA;AACf,CAAC,CAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"university": {
|
|
3
|
+
"name": "TUM",
|
|
4
|
+
"login-name": "TUM-ID",
|
|
5
|
+
"matriculationNumberRegex": "^0\\d{7}$",
|
|
6
|
+
"matriculationExample": "0xxxxxxx",
|
|
7
|
+
"universityLoginRegex": "^[a-zA-Z]{2}\\d{2}[a-zA-Z]{3}$",
|
|
8
|
+
"universityLoginExample": "ab12cde",
|
|
9
|
+
"studyPrograms": ["Computer Science", "Information Systems", "Games Engineering", "Management and Technology"],
|
|
10
|
+
"studyProgramShortNames": {
|
|
11
|
+
"Computer Science": "CS",
|
|
12
|
+
"Information Systems": "IS",
|
|
13
|
+
"Games Engineering": "GE",
|
|
14
|
+
"Management and Technology": "M&T",
|
|
15
|
+
"Other": "Other"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ExportedApplicationAnswer } from '@tumaet/prompt-shared-state';
|
|
2
|
+
interface ExportedApplicationAnswerTableProps {
|
|
3
|
+
applicationAnswers: ExportedApplicationAnswer[];
|
|
4
|
+
}
|
|
5
|
+
export declare const ExportedApplicationAnswerTable: ({ applicationAnswers, }: ExportedApplicationAnswerTableProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { FileResponse } from '@tumaet/prompt-shared-state';
|
|
3
|
+
export interface FileListProps {
|
|
4
|
+
files: FileResponse[];
|
|
5
|
+
onDelete?: (fileId: string) => void;
|
|
6
|
+
allowDelete?: boolean;
|
|
7
|
+
className?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const FileList: React.FC<FileListProps>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { FileResponse } from '@tumaet/prompt-shared-state';
|
|
3
|
+
export interface FileUploadProps {
|
|
4
|
+
coursePhaseId?: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
tags?: string;
|
|
7
|
+
accept?: string;
|
|
8
|
+
maxSizeMB?: number;
|
|
9
|
+
onSuccess?: (file: FileResponse) => void;
|
|
10
|
+
onError?: (error: Error) => void;
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare const FileUpload: React.FC<FileUploadProps>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ElementType } from 'react';
|
|
2
|
+
export interface MissingConfigItem {
|
|
3
|
+
title: string;
|
|
4
|
+
icon: ElementType;
|
|
5
|
+
description?: string;
|
|
6
|
+
link: string;
|
|
7
|
+
hide?: () => void;
|
|
8
|
+
}
|
|
9
|
+
interface MissingConfigProps {
|
|
10
|
+
elements: MissingConfigItem[];
|
|
11
|
+
}
|
|
12
|
+
export declare const MissingConfig: ({ elements }: MissingConfigProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ElementType } from 'react';
|
|
2
|
+
export interface MissingSettingsItem {
|
|
3
|
+
title: string;
|
|
4
|
+
icon: ElementType;
|
|
5
|
+
description?: string;
|
|
6
|
+
}
|
|
7
|
+
interface MissingSettingsProps {
|
|
8
|
+
elements: MissingSettingsItem[];
|
|
9
|
+
}
|
|
10
|
+
export declare const MissingSettings: ({ elements }: MissingSettingsProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -6,7 +6,7 @@ import { type VariantProps } from 'class-variance-authority';
|
|
|
6
6
|
*/
|
|
7
7
|
declare const multiSelectVariants: (props?: ({
|
|
8
8
|
variant?: "default" | "destructive" | "secondary" | "inverted" | null | undefined;
|
|
9
|
-
} & import("class-variance-authority/
|
|
9
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
10
10
|
/**
|
|
11
11
|
* Props for MultiSelect component
|
|
12
12
|
*/
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PropsWithChildren, ReactNode } from 'react';
|
|
2
|
+
interface SettingsCardProps extends PropsWithChildren {
|
|
3
|
+
icon: ReactNode;
|
|
4
|
+
title: string;
|
|
5
|
+
description: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function SettingsCard({ children, icon, title, description }: SettingsCardProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
interface MinimalStudent {
|
|
3
|
+
id?: string;
|
|
4
|
+
firstName: string;
|
|
5
|
+
lastName: string;
|
|
6
|
+
email: string;
|
|
7
|
+
}
|
|
8
|
+
interface StudentAvatarProps {
|
|
9
|
+
student: MinimalStudent;
|
|
10
|
+
}
|
|
11
|
+
export declare const StudentAvatar: ({ student }: StudentAvatarProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare const RenderStudents: ({ students, fallback, className, }: {
|
|
13
|
+
students: MinimalStudent[];
|
|
14
|
+
fallback: ReactNode;
|
|
15
|
+
className?: string;
|
|
16
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Student, PassStatus } from '@tumaet/prompt-shared-state';
|
|
2
|
+
interface StudentProfileProps {
|
|
3
|
+
student: Student;
|
|
4
|
+
status?: PassStatus;
|
|
5
|
+
}
|
|
6
|
+
export declare const StudentProfile: ({ student, status }: StudentProfileProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
type AvatarSize = 'lg' | 'md' | 'sm';
|
|
2
|
+
export declare function ProfilePicture({ email, firstName, lastName, size, className, }: {
|
|
3
|
+
email: string;
|
|
4
|
+
firstName: string;
|
|
5
|
+
lastName: string;
|
|
6
|
+
size?: AvatarSize;
|
|
7
|
+
className?: string;
|
|
8
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function ThemeToggle(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -13,3 +13,29 @@ export * from './SaveChangesAlert';
|
|
|
13
13
|
export * from './ScoreLevelSelector';
|
|
14
14
|
export * from './UnauthorizedPage';
|
|
15
15
|
export * from './getLevelConfig';
|
|
16
|
+
export { default as DynamicIcon } from './DynamicIcon';
|
|
17
|
+
export * from './ExportedApplicationAnswerTable';
|
|
18
|
+
export * from './FileList';
|
|
19
|
+
export * from './FileUpload';
|
|
20
|
+
export * from './FilterBadge';
|
|
21
|
+
export * from './MissingConfig';
|
|
22
|
+
export * from './MissingSettings';
|
|
23
|
+
export * from './SettingsCard';
|
|
24
|
+
export * from './StudentAvatar';
|
|
25
|
+
export * from './StudentProfile';
|
|
26
|
+
export * from './StudentProfilePicture';
|
|
27
|
+
export * from './ThemeToggle';
|
|
28
|
+
export * from './pages/CoursePhaseParticipationsTable/CoursePhaseParticipationsTable';
|
|
29
|
+
export * from './pages/CoursePhaseParticipationsTable/table/participationActions';
|
|
30
|
+
export * from './pages/CoursePhaseParticipationsTable/table/participationColumns';
|
|
31
|
+
export * from './pages/CoursePhaseParticipationsTable/table/participationFilters';
|
|
32
|
+
export * from './pages/CoursePhaseParticipationsTable/table/participationRow';
|
|
33
|
+
export * from './pages/CoursePhaseParticipationsTable/utils/downloadParticipations';
|
|
34
|
+
export * from './pages/CoursePhaseParticipationsTable/utils/updateBatch';
|
|
35
|
+
export * from './pages/Mailing/CoursePhaseMailing';
|
|
36
|
+
export * from './pages/Mailing/components/AvailableMailPlaceholders';
|
|
37
|
+
export * from './pages/Mailing/components/ConfirmSendEmailDialog';
|
|
38
|
+
export * from './pages/Mailing/components/MailingEditor';
|
|
39
|
+
export * from './pages/Mailing/components/ManualMailSending';
|
|
40
|
+
export { SettingsCard as MailingSettingsCard } from './pages/Mailing/components/SettingsCard';
|
|
41
|
+
export * from './table/GroupActionDialog';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const Color: import("@tiptap/core").Extension<import("@tiptap/extension-
|
|
1
|
+
export declare const Color: import("@tiptap/core").Extension<import("@tiptap/extension-text-style").ColorOptions, any>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const Link: import("@tiptap/
|
|
1
|
+
export declare const Link: import("@tiptap/core").Mark<import("@tiptap/extension-link").LinkOptions, any>;
|
|
2
2
|
export default Link;
|
|
@@ -9,5 +9,5 @@ export interface UseMinimalTiptapEditorProps extends UseEditorOptions {
|
|
|
9
9
|
onUpdate?: (content: Content) => void;
|
|
10
10
|
onBlur?: (content: Content) => void;
|
|
11
11
|
}
|
|
12
|
-
export declare const useMinimalTiptapEditor: ({ value, output, placeholder, editorClassName, throttleDelay, onUpdate, onBlur, ...props }: UseMinimalTiptapEditorProps) => Editor
|
|
12
|
+
export declare const useMinimalTiptapEditor: ({ value, output, placeholder, editorClassName, throttleDelay, onUpdate, onBlur, ...props }: UseMinimalTiptapEditorProps) => Editor;
|
|
13
13
|
export default useMinimalTiptapEditor;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ExtraParticipantColumn, ParticipantRow } from './table/participationRow';
|
|
2
|
+
import { ExportDeps } from './table/participationActions';
|
|
3
|
+
import { RowAction, TableFilter } from '../../../../components';
|
|
4
|
+
import { CoursePhaseParticipationWithStudent } from '@tumaet/prompt-shared-state';
|
|
5
|
+
interface CoursePhaseParticipationsTablePageProps {
|
|
6
|
+
phaseId: string;
|
|
7
|
+
participants: CoursePhaseParticipationWithStudent[];
|
|
8
|
+
extraColumns?: ExtraParticipantColumn<any>[];
|
|
9
|
+
extraFilters?: TableFilter[];
|
|
10
|
+
extraActions?: RowAction<ParticipantRow>[];
|
|
11
|
+
exportDeps?: ExportDeps;
|
|
12
|
+
onClickRowAction?: (row: ParticipantRow) => void;
|
|
13
|
+
}
|
|
14
|
+
export declare const CoursePhaseParticipationsTable: ({ phaseId, participants, extraColumns, extraFilters, extraActions, exportDeps, onClickRowAction, }: CoursePhaseParticipationsTablePageProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export {};
|
package/dist/types/components/pages/CoursePhaseParticipationsTable/table/participationActions.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ExtraParticipantColumn, ParticipantRow } from './participationRow';
|
|
2
|
+
import { RowAction } from '../../../../../components';
|
|
3
|
+
export interface ExportDeps {
|
|
4
|
+
prevDataKeys?: string[];
|
|
5
|
+
restrictedDataKeys?: string[];
|
|
6
|
+
studentReadableDataKeys?: string[];
|
|
7
|
+
}
|
|
8
|
+
export declare function getParticipantActions(actions: {
|
|
9
|
+
setPassed: (rows: ParticipantRow[]) => void;
|
|
10
|
+
setFailed: (rows: ParticipantRow[]) => void;
|
|
11
|
+
}, extraActions: RowAction<ParticipantRow>[], exportDeps: ExportDeps, extraColumns?: ExtraParticipantColumn<any>[]): RowAction<ParticipantRow>[];
|